Skip to content

Commit

Permalink
添加树脂块和强化树脂块的本地化和tag注册,暂时删除彩色强化树脂块
Browse files Browse the repository at this point in the history
  • Loading branch information
Viola-Siemens committed Feb 15, 2023
1 parent 4eca8b6 commit 3c7796e
Show file tree
Hide file tree
Showing 22 changed files with 184 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public boolean matches(Container container, @NotNull Level level) {
return this.costA.sameItem(container.getItem(0)) && this.costB.sameItem(container.getItem(1));
}

@Override @Nullable
@Override @NotNull
public ItemStack assemble(@NotNull Container container) {
return null;
return this.result.copy();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,21 @@ public static int getReloadCount() {

public Collection<R> getRecipes(@Nonnull Level level) {
updateCache(level.getRecipeManager(), level.isClientSide());
return Objects.requireNonNull(recipes).values();
return Objects.requireNonNull(this.recipes).values();
}

public Collection<ResourceLocation> getRecipeNames(@Nonnull Level level) {
updateCache(level.getRecipeManager(), level.isClientSide());
return Objects.requireNonNull(recipes).keySet();
return Objects.requireNonNull(this.recipes).keySet();
}

public R getById(@Nonnull Level level, ResourceLocation name) {
updateCache(level.getRecipeManager(), level.isClientSide());
return recipes.get(name);
return this.recipes.get(name);
}

private void updateCache(RecipeManager manager, boolean isClient) {
if(recipes!=null && cachedAtReloadCount==reloadCount && (!cachedDataIsClient||isClient)) {
if(this.recipes != null && this.cachedAtReloadCount == reloadCount && (!this.cachedDataIsClient || isClient)) {
return;
}
this.recipes = manager.getRecipes().stream()
Expand All @@ -79,7 +79,7 @@ private void updateCache(RecipeManager manager, boolean isClient) {
}
return Stream.of(r);
})
.map(recipeClass::cast)
.map(this.recipeClass::cast)
.collect(Collectors.toMap(R::getId, Function.identity()));
this.cachedDataIsClient = isClient;
this.cachedAtReloadCount = reloadCount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -759,8 +759,8 @@ public static final class Decoration {
"mossy_stone", STONE_PROPERTIES, Block::new
);

public static final BlockEntry<Block> RESIN_BLOCK = new BlockEntry<>(
"resin_block", RESIN_PROPERTIES, Block::new
public static final BlockEntry<HalfTransparentBlock> RESIN_BLOCK = new BlockEntry<>(
"resin_block", RESIN_PROPERTIES, HalfTransparentBlock::new
);
public static final BlockEntry<Block> REINFORCED_RESIN_BLOCK = new BlockEntry<>(
"reinforced_resin_block", REINFORCED_RESIN_PROPERTIES, Block::new
Expand Down Expand Up @@ -862,10 +862,10 @@ private static void init() {
registerWall(Decoration.WARPED_COBBLESTONE);
registerWall(Decoration.REINFORCED_RESIN_BLOCK);

List<ECBlocks.BlockEntry<?>> list = registerAllColors(Decoration.REINFORCED_RESIN_BLOCK, COLORED_REINFORCED_RESIN_PROPERTIES, Block::new);
list.forEach(ECBlocks::registerStairs);
list.forEach(ECBlocks::registerSlab);
list.forEach(ECBlocks::registerWall);
// List<ECBlocks.BlockEntry<?>> list = registerAllColors(Decoration.REINFORCED_RESIN_BLOCK, COLORED_REINFORCED_RESIN_PROPERTIES, Block::new);
// list.forEach(ECBlocks::registerStairs);
// list.forEach(ECBlocks::registerSlab);
// list.forEach(ECBlocks::registerWall);
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/assets/emeraldcraft/lang/en_gb.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
"block.emeraldcraft.mossy_stone": "Mossy Stone",
"block.emeraldcraft.mossy_stone_slab": "Mossy Stone Slab",
"block.emeraldcraft.mossy_stone_stairs": "Mossy Stone Stairs",
"block.emeraldcraft.resin_block": "Resin Block",
"block.emeraldcraft.reinforced_resin_block": "Reinforced Resin Block",
"block.emeraldcraft.reinforced_resin_slab": "Reinforced Resin Slab",
"block.emeraldcraft.reinforced_resin_stairs": "Reinforced Resin Stairs",
"block.emeraldcraft.reinforced_resin_wall": "Reinforced Resin Wall",
"block.emeraldcraft.carpentry_table": "Carpentry Table",
"block.emeraldcraft.glass_kiln": "Glass Kiln",
"block.emeraldcraft.mineral_table": "Mineral Table",
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/assets/emeraldcraft/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
"block.emeraldcraft.mossy_stone": "ǝuoʇS ʎssoW",
"block.emeraldcraft.mossy_stone_slab": "qɐlS ǝuoʇS ʎssoW",
"block.emeraldcraft.mossy_stone_stairs": "sɹᴉɐʇS ǝuoʇS ʎssoW",
"block.emeraldcraft.resin_block": "ʞɔolq uᴉsǝɹ",
"block.emeraldcraft.reinforced_resin_block": "ʞɔolq uᴉsǝɹ pǝɔɹoɟuᴉǝɹ",
"block.emeraldcraft.reinforced_resin_slab": "qɐlS uᴉsǝɹ pǝɔɹoɟuᴉǝɹ",
"block.emeraldcraft.reinforced_resin_stairs": "sɹᴉɐʇS uᴉsǝɹ pǝɔɹoɟuᴉǝɹ",
"block.emeraldcraft.reinforced_resin_wall": "llɐM uᴉsǝɹ pǝɔɹoɟuᴉǝɹ",
"block.emeraldcraft.carpentry_table": "ǝlqɐ┴ ʎɹʇuǝdɹɐƆ",
"block.emeraldcraft.glass_kiln": "ulᴉʞ ssɐlפ",
"block.emeraldcraft.mineral_table": "ǝlqɐ┴ lɐɹǝuᴉW",
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/assets/emeraldcraft/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
"block.emeraldcraft.mossy_stone": "Mossy Stone",
"block.emeraldcraft.mossy_stone_slab": "Mossy Stone Slab",
"block.emeraldcraft.mossy_stone_stairs": "Mossy Stone Stairs",
"block.emeraldcraft.resin_block": "Resin Block",
"block.emeraldcraft.reinforced_resin_block": "Reinforced Resin Block",
"block.emeraldcraft.reinforced_resin_slab": "Reinforced Resin Slab",
"block.emeraldcraft.reinforced_resin_stairs": "Reinforced Resin Stairs",
"block.emeraldcraft.reinforced_resin_wall": "Reinforced Resin Wall",
"block.emeraldcraft.carpentry_table": "Carpentry Table",
"block.emeraldcraft.glass_kiln": "Glass Kiln",
"block.emeraldcraft.mineral_table": "Mineral Table",
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/assets/emeraldcraft/lang/ja_jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
"block.emeraldcraft.mossy_stone": "苔むした石",
"block.emeraldcraft.mossy_stone_slab": "苔むした石のハーフブロック",
"block.emeraldcraft.mossy_stone_stairs": "苔むした石の階段",
"block.emeraldcraft.resin_block": "樹脂ブロック",
"block.emeraldcraft.reinforced_resin_block": "強化樹脂ブロック",
"block.emeraldcraft.reinforced_resin_slab": "強化樹脂のハーフブロック",
"block.emeraldcraft.reinforced_resin_stairs": "強化樹脂の階段",
"block.emeraldcraft.reinforced_resin_wall": "強化樹脂の塀",
"block.emeraldcraft.carpentry_table": "木工用テーブル",
"block.emeraldcraft.glass_kiln": "ガラス窯",
"block.emeraldcraft.mineral_table": "冶金の机",
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/assets/emeraldcraft/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
"block.emeraldcraft.mossy_stone": "生苔石头",
"block.emeraldcraft.mossy_stone_slab": "生苔石头台阶",
"block.emeraldcraft.mossy_stone_stairs": "生苔石头楼梯",
"block.emeraldcraft.resin_block": "树脂块",
"block.emeraldcraft.reinforced_resin_block": "强化树脂块",
"block.emeraldcraft.reinforced_resin_slab": "强化树脂台阶",
"block.emeraldcraft.reinforced_resin_stairs": "强化树脂楼梯",
"block.emeraldcraft.reinforced_resin_wall": "强化树脂墙",
"block.emeraldcraft.carpentry_table": "木工桌",
"block.emeraldcraft.glass_kiln": "玻璃窑",
"block.emeraldcraft.mineral_table": "冶矿台",
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/assets/emeraldcraft/lang/zh_tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
"block.emeraldcraft.mossy_stone": "青苔石頭",
"block.emeraldcraft.mossy_stone_slab": "青苔石頭半磚",
"block.emeraldcraft.mossy_stone_stairs": "青苔石頭階梯",
"block.emeraldcraft.resin_block": "樹脂塊",
"block.emeraldcraft.reinforced_resin_block": "强化樹脂塊",
"block.emeraldcraft.reinforced_resin_slab": "强化樹脂半磚",
"block.emeraldcraft.reinforced_resin_stairs": "强化樹脂階梯",
"block.emeraldcraft.reinforced_resin_wall": "强化樹脂牆",
"block.emeraldcraft.carpentry_table": "木工桌",
"block.emeraldcraft.glass_kiln": "玻璃窯",
"block.emeraldcraft.mineral_table": "冶礦臺",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"###"
],
"key": {
"#": [
{
"item": "emeraldcraft:reinforced_resin_block"
}
]
},
"result": {
"item": "emeraldcraft:reinforced_resin_slab",
"count": 6
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"# ",
"## ",
"###"
],
"key": {
"#": [
{
"item": "emeraldcraft:reinforced_resin_block"
}
]
},
"result": {
"item": "emeraldcraft:reinforced_resin_stairs",
"count": 4
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"###",
"###"
],
"key": {
"#": {
"item": "emeraldcraft:reinforced_resin_block"
}
},
"result": {
"item": "emeraldcraft:reinforced_resin_wall",
"count": 6
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"##",
"##"
],
"key": {
"#": {
"item": "emeraldcraft:resin_shard"
}
},
"result": {
"item": "emeraldcraft:resin_block"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"emeraldcraft:carpentry_table",
"emeraldcraft:squeezer",
"emeraldcraft:purpuraceus_fungus",
"emeraldcraft:purpuraceus_roots"
"emeraldcraft:purpuraceus_roots",

"emeraldcraft:reinforced_resin_block",
"emeraldcraft:reinforced_resin_slab",
"emeraldcraft:reinforced_resin_stairs",
"emeraldcraft:reinforced_resin_wall"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"emeraldcraft:ginkgo_leaves",
"emeraldcraft:palm_leaves",
"emeraldcraft:peach_leaves",
"emeraldcraft:purpuraceus_wart_block"
"emeraldcraft:purpuraceus_wart_block",

"emeraldcraft:resin_block"
]
}
42 changes: 21 additions & 21 deletions src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,73 +69,73 @@
"emeraldcraft:emery_sandstone_wall",
"emeraldcraft:jadeite_sandstone_wall",
"emeraldcraft:quartz_sandstone_wall",

"emeraldcraft:glass_kiln",
"emeraldcraft:mineral_table",
"emeraldcraft:continuous_miner",
"emeraldcraft:ice_maker",
"emeraldcraft:melter",

"emeraldcraft:blue_nether_bricks",
"emeraldcraft:blue_nether_brick_slab",
"emeraldcraft:blue_nether_brick_stairs",
"emeraldcraft:blue_nether_brick_wall",

"emeraldcraft:purple_nether_bricks",
"emeraldcraft:purple_nether_brick_slab",
"emeraldcraft:purple_nether_brick_stairs",
"emeraldcraft:purple_nether_brick_wall",

"emeraldcraft:crimson_stone",
"emeraldcraft:crimson_stone_slab",
"emeraldcraft:crimson_stone_stairs",
"emeraldcraft:crimson_stone_wall",

"emeraldcraft:crimson_cobblestone",
"emeraldcraft:crimson_cobblestone_slab",
"emeraldcraft:crimson_cobblestone_stairs",
"emeraldcraft:crimson_cobblestone_wall",

"emeraldcraft:warped_stone",
"emeraldcraft:warped_stone_slab",
"emeraldcraft:warped_stone_stairs",
"emeraldcraft:warped_stone_wall",

"emeraldcraft:warped_cobblestone",
"emeraldcraft:warped_cobblestone_slab",
"emeraldcraft:warped_cobblestone_stairs",
"emeraldcraft:warped_cobblestone_wall",
"emeraldcraft:purpuraceus_nylium",

"emeraldcraft:mossy_stone",
"emeraldcraft:mossy_stone_slab",
"emeraldcraft:mossy_stone_stairs",

"emeraldcraft:resin_block",
"emeraldcraft:reinforced_resin_block",
"emeraldcraft:reinforced_resin_slab",
"emeraldcraft:reinforced_resin_stairs",
"emeraldcraft:reinforced_resin_wall",
"emeraldcraft:zinc_slab",
"emeraldcraft:zinc_slab",
"emeraldcraft:zinc_stairs",
"emeraldcraft:zinc_wall",
"emeraldcraft:zinc_wall",
"emeraldcraft:aluminum_stairs",
"emeraldcraft:aluminum_wall",
"emeraldcraft:aluminum_wall",
"emeraldcraft:lead_stairs",
"emeraldcraft:lead_wall",
"emeraldcraft:lead_wall",
"emeraldcraft:silver_stairs",
"emeraldcraft:silver_wall",
"emeraldcraft:silver_wall",
"emeraldcraft:nickel_stairs",
"emeraldcraft:nickel_wall",
"emeraldcraft:nickel_wall",
"emeraldcraft:uranium_stairs",
"emeraldcraft:uranium_wall",
"emeraldcraft:uranium_wall",
"emeraldcraft:constantan_stairs",
"emeraldcraft:constantan_wall",
"emeraldcraft:constantan_wall",
"emeraldcraft:electrum_stairs",
"emeraldcraft:electrum_wall",
"emeraldcraft:electrum_wall",
"emeraldcraft:steel_stairs",
"emeraldcraft:steel_wall"
"emeraldcraft:steel_wall"
]
}
4 changes: 2 additions & 2 deletions src/main/resources/data/minecraft/tags/blocks/slabs.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

"emeraldcraft:mossy_stone_slab",
"emeraldcraft:reinforced_resin_slab",
"emeraldcraft:zinc_slab"
"emeraldcraft:zinc_slab"
]
}
20 changes: 10 additions & 10 deletions src/main/resources/data/minecraft/tags/blocks/stairs.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@

"emeraldcraft:mossy_stone_stairs",
"emeraldcraft:reinforced_resin_stairs",
"emeraldcraft:zinc_stairs",
"emeraldcraft:aluminum_stairs",
"emeraldcraft:lead_stairs",
"emeraldcraft:silver_stairs",
"emeraldcraft:nickel_stairs",
"emeraldcraft:uranium_stairs",
"emeraldcraft:constantan_stairs",
"emeraldcraft:electrum_stairs",
"emeraldcraft:steel_stairs"
"emeraldcraft:zinc_stairs",
"emeraldcraft:aluminum_stairs",
"emeraldcraft:lead_stairs",
"emeraldcraft:silver_stairs",
"emeraldcraft:nickel_stairs",
"emeraldcraft:uranium_stairs",
"emeraldcraft:constantan_stairs",
"emeraldcraft:electrum_stairs",
"emeraldcraft:steel_stairs"
]
}
Loading

0 comments on commit 3c7796e

Please sign in to comment.