Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

Commit

Permalink
Upgrade and add new blocks and more.
Browse files Browse the repository at this point in the history
  • Loading branch information
Casper233 committed Dec 24, 2022
1 parent 175a5c6 commit 20b7c0a
Show file tree
Hide file tree
Showing 27 changed files with 172 additions and 5 deletions.
12 changes: 11 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,20 @@

## 更新日志

**2022-12-24-1**
添加了以下物品/方块:
- 青铜
- 青铜矿石
- 深层青铜矿石
- 青铜块
#### 以下矿石可以在主世界中被正常生成
- 深层青铜矿石
- 深层碎片矿石

**2022-12-16-1**

添加了readme,添加了以下物品/方块:
- 碎片
- 碎片矿石
- 深层碎片矿石
- 矿石块
- 碎片块
12 changes: 11 additions & 1 deletion readme_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,20 @@ The debris are now deeply under the soil.

## Others

This mod needs to put in both client and server.
This mod needs to put in both client and server side.

## Update log

**2022-12-24-1**
Added following items/blocks:
- Bronze Ingot
- Bronze Ore
- Deepslate Bronze Ore
- Bronze Block
#### These following blocks can be spawned in the world
- Deepslate Bronze Ore
- Deepslate Debris Ore

**2022-12-16-1**

Updated the Readme, and add these items/blocks
Expand Down
15 changes: 14 additions & 1 deletion src/main/java/com/Casper_233/aciday/init/BlockInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,28 @@ public class BlockInit {
DropExperienceBlock(BlockBehaviour.Properties.of(Material.STONE).strength(5f)
.requiresCorrectToolForDrops(), UniformInt.of(3, 10)), Main.ACIDAY_TAB);

public static final RegistryObject<Block> BRONZE_ORE = registerBlock("bronze_ore", () -> new
DropExperienceBlock(BlockBehaviour.Properties.of(Material.STONE).strength(5f)
.requiresCorrectToolForDrops(), UniformInt.of(3, 10)), Main.ACIDAY_TAB);

//ore_deep
public static final RegistryObject<Block> DEEPSLATE_DEBRIS_ORE = registerBlock("deepslate_debris_ore", () ->
new Block(BlockBehaviour.Properties.of(Material.STONE).strength(7f).requiresCorrectToolForDrops()),
Main.ACIDAY_TAB);

public static final RegistryObject<Block> DEEPSLATE_BRONZE_ORE = registerBlock("deepslate_bronze_ore", () ->
new Block(BlockBehaviour.Properties.of(Material.STONE).strength(7f).requiresCorrectToolForDrops()),
Main.ACIDAY_TAB);

//Blocks
public static final RegistryObject<Block> DEBRIS_BLOCK = register("debris_block", () -> new
Block(BlockBehaviour.Properties.of(Material.METAL, MaterialColor.COLOR_BROWN).strength(3f,
4f).sound(SoundType.STONE).requiresCorrectToolForDrops()), object -> () -> new
4f).sound(SoundType.STONE).requiresCorrectToolForDrops()), object -> () -> new
BlockItem(object.get(), new Item.Properties().tab(Main.ACIDAY_TAB)));

public static final RegistryObject<Block> BRONZE_BLOCK = register("bronze_block", () -> new
Block(BlockBehaviour.Properties.of(Material.METAL, MaterialColor.COLOR_BROWN).strength(3f,
4f).sound(SoundType.METAL).requiresCorrectToolForDrops()), object -> () -> new
BlockItem(object.get(), new Item.Properties().tab(Main.ACIDAY_TAB)));

private static <T extends Block> RegistryObject<T> registryBlock(final String name,
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/Casper_233/aciday/init/ItemInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
public class ItemInit {
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Main.MOD_ID);

//items
public static final RegistryObject<Item> DEBRIS = register("debris",
() -> new Item(new Item.Properties().tab(Main.ACIDAY_TAB)));

public static final RegistryObject<Item> BRONZE_INGOT = register("bronze_ingot",
() -> new Item(new Item.Properties().tab(Main.ACIDAY_TAB)));

private static <T extends Item> RegistryObject<T> register(final String name, final Supplier<T> item) {
return ITEMS.register(name, item);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,19 @@ public class ModConfiguredFeatures {
.get().defaultBlockState())
));

public static final Supplier<List<OreConfiguration.TargetBlockState>> OVERWORLD_BRONZE_ORES = Suppliers
.memoize(() -> List.of(OreConfiguration.target(OreFeatures.STONE_ORE_REPLACEABLES, BlockInit.BRONZE_ORE
.get().defaultBlockState()),
OreConfiguration.target(OreFeatures.DEEPSLATE_ORE_REPLACEABLES, BlockInit.DEEPSLATE_BRONZE_ORE
.get().defaultBlockState())
));

public static final RegistryObject<ConfiguredFeature<?, ?>> DEBRIS_ORES = CONFIGURED_FEATURES.register(
"debris_ore", () -> new ConfiguredFeature<>(Feature.ORE, new OreConfiguration(OVERWORLD_DEBRIS_ORES
"debris_ores", () -> new ConfiguredFeature<>(Feature.ORE, new OreConfiguration(OVERWORLD_DEBRIS_ORES
.get(), 7)));

public static final RegistryObject<ConfiguredFeature<?, ?>> BRONZE_ORES = CONFIGURED_FEATURES.register(
"bronze_ores", () -> new ConfiguredFeature<>(Feature.ORE, new OreConfiguration(OVERWORLD_BRONZE_ORES
.get(), 7)));

public static void register(IEventBus eventBus) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ public class ModPlacedFeatures {
commonOrePlacement(7, HeightRangePlacement.triangle(VerticalAnchor.aboveBottom(-60),
VerticalAnchor.aboveBottom(60)))));

public static final RegistryObject<PlacedFeature> BRONZE_ORE_PLACED = PLACED_FEATURES.register(
"bronze_ore_placed", () -> new PlacedFeature(ModConfiguredFeatures.BRONZE_ORES.getHolder().get(),
commonOrePlacement(24, HeightRangePlacement.triangle(VerticalAnchor.aboveBottom(-60),
VerticalAnchor.aboveBottom(60)))));


public static void register(IEventBus eventBus) {
PLACED_FEATURES.register(eventBus);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "aciday:block/bronze_block"
}
}
}
7 changes: 7 additions & 0 deletions src/main/resources/assets/aciday/blockstates/bronze_ore.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "aciday:block/bronze_ore"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "aciday:block/deepslate_bronze_ore"
}
}
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/aciday/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"item.aciday.debris": "Debris",
"item.aciday.bronze_ingot": "Bronze Ingot",
"block.aciday.debris_ore": "Debris Ore",
"block.aciday.bronze_ore": "Bronze Ore",
"block.aciday.debris_block": "Debris Block",
"block.aciday.bronze_block": "Bronze Block",
"block.aciday.deepslate_debris_ore": "Deepslate Debris Ore",
"block.aciday.deepslate_bronze_ore": "Deepslate Bronze Ore",
"itemGroup.aciday": "Ancient Days"
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/aciday/lang/zh_cn.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"item.aciday.debris": "碎片",
"item.aciday.bronze_ingot": "青铜锭",
"block.aciday.debris_ore": "碎片矿石",
"block.aciday.bronze_ore": "青铜矿石",
"block.aciday.debris_block": "碎片块",
"block.aciday.bronze_block": "青铜块",
"block.aciday.deepslate_debris_ore": "深层碎片矿石",
"block.aciday.deepslate_bronze_ore": "深层青铜矿石",
"itemGroup.aciday": "古代时期"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "aciday:block/bronze_block"
}
}
6 changes: 6 additions & 0 deletions src/main/resources/assets/aciday/models/block/bronze_ore.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "aciday:block/bronze_ore"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "aciday:block/deepslate_bronze_ore"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "aciday:block/bronze_block"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "aciday:item/bronze_ingot"
}
}
3 changes: 3 additions & 0 deletions src/main/resources/assets/aciday/models/item/bronze_ore.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "aciday:block/bronze_ore"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "aciday:block/deepslate_bronze_ore"
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "forge:add_features",
"biomes": "#minecraft:is_overworld",
"features": "aciday:bronze_ore_placed",
"step": "underground_ores"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"entries": [
{
"type": "minecraft:item",
"name": "aciday:bronze_block"
}
]
}
]
}
14 changes: 14 additions & 0 deletions src/main/resources/data/aciday/loot_tables/blocks/bronze_ore.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"entries": [
{
"type": "minecraft:item",
"name": "aciday:bronze_ore"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"entries": [
{
"type": "minecraft:item",
"name": "aciday:deepslate_bronze_ore"
}
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"values": [
"aciday:debris_ore",
"aciday:debris_block",
"aciday:deepslate_debris_ore"
"aciday:bronze_block",
"aciday:deepslate_debris_ore",
"aciday:bronze_ore",
"aciday:deepslate_bronze_ore"
]
}

0 comments on commit 20b7c0a

Please sign in to comment.