From c59d1c8500db81ef3b5b9e566dfcc5a832ca2522 Mon Sep 17 00:00:00 2001 From: stfwi Date: Sat, 26 Mar 2022 17:58:06 +0100 Subject: [PATCH] Updated to 1.18.2. --- build.gradle | 2 +- gradle.properties | 8 +- meta/update.json | 7 +- readme.md | 2 + .../java/wile/engineersdecor/ModConfig.java | 7 +- .../java/wile/engineersdecor/ModContent.java | 2188 +++++++---------- .../engineersdecor/ModEngineersDecor.java | 36 +- .../wile/engineersdecor/blocks/EdBreaker.java | 13 +- .../engineersdecor/blocks/EdCatwalkBlock.java | 2 +- .../blocks/EdCatwalkStairsBlock.java | 8 +- .../blocks/EdCatwalkTopAlignedBlock.java | 4 +- .../wile/engineersdecor/blocks/EdChair.java | 2 +- .../blocks/EdCraftingTable.java | 20 +- .../wile/engineersdecor/blocks/EdDropper.java | 19 +- .../blocks/EdElectricalFurnace.java | 16 +- .../engineersdecor/blocks/EdFluidBarrel.java | 11 +- .../engineersdecor/blocks/EdFluidFunnel.java | 9 +- .../wile/engineersdecor/blocks/EdFreezer.java | 9 +- .../wile/engineersdecor/blocks/EdFurnace.java | 10 +- .../wile/engineersdecor/blocks/EdHopper.java | 14 +- .../blocks/EdHorizontalSupportBlock.java | 4 +- .../engineersdecor/blocks/EdLabeledCrate.java | 17 +- .../wile/engineersdecor/blocks/EdMilker.java | 12 +- .../blocks/EdMineralSmelter.java | 11 +- .../engineersdecor/blocks/EdPipeValve.java | 14 +- .../wile/engineersdecor/blocks/EdPlacer.java | 19 +- .../engineersdecor/blocks/EdSolarPanel.java | 9 +- .../engineersdecor/blocks/EdTestBlock.java | 13 +- .../engineersdecor/blocks/EdTreeCutter.java | 9 +- .../blocks/EdWasteIncinerator.java | 11 +- .../engineersdecor/detail/TreeCutting.java | 5 +- .../engineersdecor/eapi/jei/JEIPlugin.java | 18 +- .../wile/engineersdecor/items/EdItem.java | 10 +- .../libmc/blocks/StandardBlocks.java | 5 +- .../libmc/blocks/StandardEntityBlocks.java | 11 +- .../libmc/blocks/StandardStairsBlock.java | 3 - .../libmc/blocks/VariantSlabBlock.java | 2 +- .../libmc/detail/Auxiliaries.java | 26 +- .../libmc/detail/Inventories.java | 12 +- .../libmc/detail/OptionalRecipeCondition.java | 18 +- .../libmc/detail/Registries.java | 265 ++ src/main/resources/META-INF/mods.toml | 4 +- ...e.json => halfslab_concrete.json.disabled} | 0 ...alfslab_sheetmetal_aluminum.json.disabled} | 0 ... halfslab_sheetmetal_copper.json.disabled} | 0 ...=> halfslab_sheetmetal_gold.json.disabled} | 0 ...=> halfslab_sheetmetal_iron.json.disabled} | 0 ...> halfslab_sheetmetal_steel.json.disabled} | 0 ...on => halfslab_treated_wood.json.disabled} | 0 ...=> halfslab_concrete_recipe.json.disabled} | 0 ..._sheetmetal_aluminum_recipe.json.disabled} | 0 ...l_aluminum_recipe_decompose.json.disabled} | 0 ...ab_sheetmetal_copper_recipe.json.disabled} | 0 ...tal_copper_recipe_decompose.json.disabled} | 0 ...slab_sheetmetal_gold_recipe.json.disabled} | 0 ...metal_gold_recipe_decompose.json.disabled} | 0 ...slab_sheetmetal_iron_recipe.json.disabled} | 0 ...metal_iron_recipe_decompose.json.disabled} | 0 ...lab_sheetmetal_steel_recipe.json.disabled} | 0 ...etal_steel_recipe_decompose.json.disabled} | 0 ...alfslab_treated_wood_recipe.json.disabled} | 0 ...eated_wood_recipe_decompose.json.disabled} | 0 62 files changed, 1440 insertions(+), 1445 deletions(-) create mode 100644 src/main/java/wile/engineersdecor/libmc/detail/Registries.java rename src/main/resources/assets/engineersdecor/blockstates/{halfslab_concrete.json => halfslab_concrete.json.disabled} (100%) rename src/main/resources/assets/engineersdecor/blockstates/{halfslab_sheetmetal_aluminum.json => halfslab_sheetmetal_aluminum.json.disabled} (100%) rename src/main/resources/assets/engineersdecor/blockstates/{halfslab_sheetmetal_copper.json => halfslab_sheetmetal_copper.json.disabled} (100%) rename src/main/resources/assets/engineersdecor/blockstates/{halfslab_sheetmetal_gold.json => halfslab_sheetmetal_gold.json.disabled} (100%) rename src/main/resources/assets/engineersdecor/blockstates/{halfslab_sheetmetal_iron.json => halfslab_sheetmetal_iron.json.disabled} (100%) rename src/main/resources/assets/engineersdecor/blockstates/{halfslab_sheetmetal_steel.json => halfslab_sheetmetal_steel.json.disabled} (100%) rename src/main/resources/assets/engineersdecor/blockstates/{halfslab_treated_wood.json => halfslab_treated_wood.json.disabled} (100%) rename src/main/resources/data/engineersdecor/recipes/dependent/{halfslab_concrete_recipe.json => halfslab_concrete_recipe.json.disabled} (100%) rename src/main/resources/data/engineersdecor/recipes/dependent/{halfslab_sheetmetal_aluminum_recipe.json => halfslab_sheetmetal_aluminum_recipe.json.disabled} (100%) rename src/main/resources/data/engineersdecor/recipes/dependent/{halfslab_sheetmetal_aluminum_recipe_decompose.json => halfslab_sheetmetal_aluminum_recipe_decompose.json.disabled} (100%) rename src/main/resources/data/engineersdecor/recipes/dependent/{halfslab_sheetmetal_copper_recipe.json => halfslab_sheetmetal_copper_recipe.json.disabled} (100%) rename src/main/resources/data/engineersdecor/recipes/dependent/{halfslab_sheetmetal_copper_recipe_decompose.json => halfslab_sheetmetal_copper_recipe_decompose.json.disabled} (100%) rename src/main/resources/data/engineersdecor/recipes/dependent/{halfslab_sheetmetal_gold_recipe.json => halfslab_sheetmetal_gold_recipe.json.disabled} (100%) rename src/main/resources/data/engineersdecor/recipes/dependent/{halfslab_sheetmetal_gold_recipe_decompose.json => halfslab_sheetmetal_gold_recipe_decompose.json.disabled} (100%) rename src/main/resources/data/engineersdecor/recipes/dependent/{halfslab_sheetmetal_iron_recipe.json => halfslab_sheetmetal_iron_recipe.json.disabled} (100%) rename src/main/resources/data/engineersdecor/recipes/dependent/{halfslab_sheetmetal_iron_recipe_decompose.json => halfslab_sheetmetal_iron_recipe_decompose.json.disabled} (100%) rename src/main/resources/data/engineersdecor/recipes/dependent/{halfslab_sheetmetal_steel_recipe.json => halfslab_sheetmetal_steel_recipe.json.disabled} (100%) rename src/main/resources/data/engineersdecor/recipes/dependent/{halfslab_sheetmetal_steel_recipe_decompose.json => halfslab_sheetmetal_steel_recipe_decompose.json.disabled} (100%) rename src/main/resources/data/engineersdecor/recipes/dependent/{halfslab_treated_wood_recipe.json => halfslab_treated_wood_recipe.json.disabled} (100%) rename src/main/resources/data/engineersdecor/recipes/dependent/{halfslab_treated_wood_recipe_decompose.json => halfslab_treated_wood_recipe_decompose.json.disabled} (100%) diff --git a/build.gradle b/build.gradle index fb23806..d467b8b 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,7 @@ repositories { } minecraft { - mappings channel: "official", version: "1.18.1" + mappings channel: "official", version: "1.18.2" runs { client { workingDirectory project.file('run') diff --git a/gradle.properties b/gradle.properties index 508deeb..83400e8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx8G meta_modid=engineersdecor meta_issues=https://github.com/stfwi/engineers-decor/issues meta_download=https://www.curseforge.com/minecraft/mc-mods/engineers-decor/ -version_minecraft=1.18.1 -version_forge_minecraft=1.18.1-39.0.5 -version_jei=1.18.1:9.1.2.54 -version_engineersdecor=1.1.21 +version_minecraft=1.18.2 +version_forge_minecraft=1.18.2-40.0.32 +version_jei=1.18.2:9.5.4.171 +version_engineersdecor=1.1.22-b1 diff --git a/meta/update.json b/meta/update.json index 3ab2dcf..4e64573 100644 --- a/meta/update.json +++ b/meta/update.json @@ -1,6 +1,7 @@ { "homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/", - "1.18.1": { + "1.18.2": { + "1.1.22-b1": "[U] Updated to 1.18.2.", "1.1.21": "[A] Added French translation (PR#203, dracnis).", "1.1.20": "[F] Fixed Shingle Roof Wire Conduit collision shape (thx os, issue #202).\n[F] Mineral Melter accepts input items only when empty (issue #198, ty Archie).", "1.1.19": "[R] Release build.\n[F] Manual category RLs prefixed (issue #199, ty freopt).", @@ -52,7 +53,7 @@ "1.1.2-b1": "[U] Ported to MC1.16.2." }, "promos": { - "1.18.1-recommended": "1.1.21", - "1.18.1-latest": "1.1.21" + "1.18.2-recommended": "1.1.21", + "1.18.2-latest": "1.1.22-b1" } } \ No newline at end of file diff --git a/readme.md b/readme.md index b3ecb7b..93856a4 100644 --- a/readme.md +++ b/readme.md @@ -11,6 +11,8 @@ Mod sources for Minecraft version 1.18.x. ## Version history + - v1.1.22-b1 [U] Updated to 1.18.2. + - v1.1.21 [A] Added French translation (PR#203, dracnis). - v1.1.20 [F] Fixed Shingle Roof Wire Conduit collision shape (thx os, issue #202). diff --git a/src/main/java/wile/engineersdecor/ModConfig.java b/src/main/java/wile/engineersdecor/ModConfig.java index fa12253..f3bca66 100644 --- a/src/main/java/wile/engineersdecor/ModConfig.java +++ b/src/main/java/wile/engineersdecor/ModConfig.java @@ -321,7 +321,7 @@ public class ModConfig //-------------------------------------------------------------------------------------------------------------------- public static boolean isOptedOut(final @Nullable Block block) - { return isOptedOut(block.asItem()); } + { return (block==null) || isOptedOut(block.asItem()); } public static boolean isOptedOut(final @Nullable Item item) { return (item!=null) && optouts_.contains(item.getRegistryName().getPath()); } @@ -379,12 +379,9 @@ public class ModConfig if(!includes.isEmpty()) log("Config pattern includes: '" + String.join(",", includes) + "'"); { HashSet optouts = new HashSet<>(); - ModContent.getRegisteredItems().stream().filter(Objects::nonNull).forEach( - e -> optouts.add(e.getRegistryName().getPath()) - ); ModContent.getRegisteredBlocks().stream().filter((Block block) -> { if(block==null) return true; - if(block==ModContent.SIGN_MODLOGO) return true; + if(block==ModContent.getBlock("sign_decor")) return true; try { if(!with_experimental_features_) { if(block instanceof Auxiliaries.IExperimentalFeature) return true; diff --git a/src/main/java/wile/engineersdecor/ModContent.java b/src/main/java/wile/engineersdecor/ModContent.java index 83f4b39..f99fcf2 100644 --- a/src/main/java/wile/engineersdecor/ModContent.java +++ b/src/main/java/wile/engineersdecor/ModContent.java @@ -21,11 +21,10 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundEvents; -import net.minecraft.world.entity.Entity; +import net.minecraft.tags.TagKey; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.MobCategory; import net.minecraft.world.inventory.MenuType; -import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.block.Block; @@ -43,1287 +42,1006 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; -import org.apache.commons.lang3.ArrayUtils; import wile.engineersdecor.blocks.*; import wile.engineersdecor.detail.ModRenderers; import wile.engineersdecor.items.EdItem; import wile.engineersdecor.libmc.blocks.*; import wile.engineersdecor.libmc.blocks.StandardBlocks.IStandardBlock; import wile.engineersdecor.libmc.detail.Auxiliaries; +import wile.engineersdecor.libmc.detail.Registries; import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.List; -import java.util.stream.Collectors; @SuppressWarnings("unused") public class ModContent { - private static final String MODID = ModEngineersDecor.MODID; + private static class detail { + public static String MODID = ""; + public static Boolean disallowSpawn(BlockState state, BlockGetter reader, BlockPos pos, EntityType entity) { return false; } + } - //-------------------------------------------------------------------------------------------------------------------- - - private static Boolean disallowSpawn(BlockState state, BlockGetter reader, BlockPos pos, EntityType entity) { return false; } - - //-------------------------------------------------------------------------------------------------------------------- - // Registry auxiliary functions. - //-------------------------------------------------------------------------------------------------------------------- - - private static class ModRegistry + public static void init(String modid) { - private static BlockEntityType register(String name, BlockEntityType.BlockEntitySupplier ctor, Block... blocks) - { - final BlockEntityType tet = BlockEntityType.Builder.of(ctor, blocks).build(null); - tet.setRegistryName(MODID, name); - return tet; - } - - @SuppressWarnings("unchecked") - private static EntityType register(String name, EntityType.Builder builder) - { - final EntityType et = (EntityType)builder.build(new ResourceLocation(MODID, name).toString()); - et.setRegistryName(MODID, name); - return et; - } + detail.MODID = modid; + initTags(); + initBlocks(); + initItems(); + initEntities(); } - //-------------------------------------------------------------------------------------------------------------------- - // Blocks - //-------------------------------------------------------------------------------------------------------------------- - - public static final StandardBlocks.BaseBlock CLINKER_BRICK_BLOCK = (StandardBlocks.BaseBlock)(new StandardBlocks.BaseBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) - )).setRegistryName(new ResourceLocation(MODID, "clinker_brick_block")); - - public static final VariantSlabBlock CLINKER_BRICK_SLAB = (VariantSlabBlock)(new VariantSlabBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) - )).setRegistryName(new ResourceLocation(MODID, "clinker_brick_slab")); - - public static final StandardStairsBlock CLINKER_BRICK_STAIRS = (StandardStairsBlock)(new StandardStairsBlock( - DecorBlock.CFG_DEFAULT, - CLINKER_BRICK_BLOCK.defaultBlockState(), - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) - )).setRegistryName(new ResourceLocation(MODID, "clinker_brick_stairs")); - - public static final EdWallBlock CLINKER_BRICK_WALL = (EdWallBlock)(new EdWallBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) - )).setRegistryName(new ResourceLocation(MODID, "clinker_brick_wall")); - - public static final StandardBlocks.BaseBlock CLINKER_BRICK_STAINED_BLOCK = (StandardBlocks.BaseBlock)(new StandardBlocks.BaseBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) - )).setRegistryName(new ResourceLocation(MODID, "clinker_brick_stained_block")); - - public static final VariantSlabBlock CLINKER_BRICK_STAINED_SLAB = (VariantSlabBlock)(new VariantSlabBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) - )).setRegistryName(new ResourceLocation(MODID, "clinker_brick_stained_slab")); - - public static final StandardStairsBlock CLINKER_BRICK_STAINED_STAIRS = (StandardStairsBlock)(new StandardStairsBlock( - DecorBlock.CFG_DEFAULT, - CLINKER_BRICK_BLOCK.defaultBlockState(), - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) - )).setRegistryName(new ResourceLocation(MODID, "clinker_brick_stained_stairs")); - - public static final EdCornerOrnamentedBlock CLINKER_BRICK_SASTOR_CORNER = (EdCornerOrnamentedBlock)(new EdCornerOrnamentedBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE), - new Block[]{CLINKER_BRICK_BLOCK, CLINKER_BRICK_STAINED_BLOCK, CLINKER_BRICK_SLAB, CLINKER_BRICK_STAIRS, CLINKER_BRICK_STAINED_SLAB, CLINKER_BRICK_STAINED_STAIRS} - )).setRegistryName(new ResourceLocation(MODID, "clinker_brick_sastor_corner_block")); - - public static final StandardBlocks.HorizontalWaterLoggable CLINKER_BRICK_RECESSED = (StandardBlocks.HorizontalWaterLoggable)(new StandardBlocks.HorizontalWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_LOOK_PLACEMENT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE), - new AABB[] { - Auxiliaries.getPixeledAABB( 3,0, 0, 13,16, 1), - Auxiliaries.getPixeledAABB( 0,0, 1, 16,16,11), - Auxiliaries.getPixeledAABB( 4,0,11, 12,16,13) - } - )).setRegistryName(new ResourceLocation(MODID, "clinker_brick_recessed")); - - public static final StandardBlocks.HorizontalWaterLoggable CLINKER_BRICK_SASTOR_VERTICAL_SLOTTED = (StandardBlocks.HorizontalWaterLoggable)(new StandardBlocks.HorizontalWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_LOOK_PLACEMENT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE), - new AABB[] { - Auxiliaries.getPixeledAABB( 3,0, 0, 13,16, 1), - Auxiliaries.getPixeledAABB( 3,0,15, 13,16,16), - Auxiliaries.getPixeledAABB( 0,0, 1, 16,16,15) - } - )).setRegistryName(new ResourceLocation(MODID, "clinker_brick_vertically_slit")); - - public static final StandardBlocks.HorizontalWaterLoggable CLINKER_BRICK_VERTICAL_SLAB_STRUCTURED = (StandardBlocks.HorizontalWaterLoggable)(new StandardBlocks.HorizontalWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_LOOK_PLACEMENT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE), - new AABB[] { - Auxiliaries.getPixeledAABB( 0,0, 0, 16,16, 8), - } - )).setRegistryName(new ResourceLocation(MODID, "clinker_brick_vertical_slab_structured")); - - // ------------------------------------------------------------------------------------------------------------------- - - public static final StandardBlocks.BaseBlock SLAG_BRICK_BLOCK = (StandardBlocks.BaseBlock)(new StandardBlocks.BaseBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) - )).setRegistryName(new ResourceLocation(MODID, "slag_brick_block")); - - public static final VariantSlabBlock SLAG_BRICK_SLAB = (VariantSlabBlock)(new VariantSlabBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) - )).setRegistryName(new ResourceLocation(MODID, "slag_brick_slab")); - - public static final StandardStairsBlock SLAG_BRICK_STAIRS = (StandardStairsBlock)(new StandardStairsBlock( - DecorBlock.CFG_DEFAULT, - SLAG_BRICK_BLOCK.defaultBlockState(), - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) - )).setRegistryName(new ResourceLocation(MODID, "slag_brick_stairs")); - - public static final EdWallBlock SLAG_BRICK_WALL = (EdWallBlock)(new EdWallBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) - )).setRegistryName(new ResourceLocation(MODID, "slag_brick_wall")); - - // ------------------------------------------------------------------------------------------------------------------- - - public static final StandardBlocks.BaseBlock REBAR_CONCRETE_BLOCK = (StandardBlocks.BaseBlock)(new StandardBlocks.BaseBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(ModContent::disallowSpawn) - )).setRegistryName(new ResourceLocation(MODID, "rebar_concrete")); - - public static final VariantSlabBlock REBAR_CONCRETE_SLAB = (VariantSlabBlock)(new VariantSlabBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(ModContent::disallowSpawn) - )).setRegistryName(new ResourceLocation(MODID, "rebar_concrete_slab")); - - public static final StandardStairsBlock REBAR_CONCRETE_STAIRS = (StandardStairsBlock)(new StandardStairsBlock( - DecorBlock.CFG_DEFAULT, - REBAR_CONCRETE_BLOCK.defaultBlockState(), - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(ModContent::disallowSpawn) - )).setRegistryName(new ResourceLocation(MODID, "rebar_concrete_stairs")); - - public static final EdWallBlock REBAR_CONCRETE_WALL = (EdWallBlock)(new EdWallBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(ModContent::disallowSpawn) - )).setRegistryName(new ResourceLocation(MODID, "rebar_concrete_wall")); - - public static final SlabSliceBlock HALFSLAB_REBARCONCRETE = (SlabSliceBlock)(new SlabSliceBlock( - DecorBlock.CFG_CUTOUT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(ModContent::disallowSpawn) - )).setRegistryName(new ResourceLocation(MODID, "halfslab_rebar_concrete")); - - // ------------------------------------------------------------------------------------------------------------------- - - public static final StandardBlocks.BaseBlock REBAR_CONCRETE_TILE = (StandardBlocks.BaseBlock)(new StandardBlocks.BaseBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(ModContent::disallowSpawn) - )).setRegistryName(new ResourceLocation(MODID, "rebar_concrete_tile")); - - public static final VariantSlabBlock REBAR_CONCRETE_TILE_SLAB = (VariantSlabBlock)(new VariantSlabBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(ModContent::disallowSpawn) - )).setRegistryName(new ResourceLocation(MODID, "rebar_concrete_tile_slab")); - - public static final StandardStairsBlock REBAR_CONCRETE_TILE_STAIRS = (StandardStairsBlock)(new StandardStairsBlock( - DecorBlock.CFG_DEFAULT, - REBAR_CONCRETE_TILE.defaultBlockState(), - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(ModContent::disallowSpawn) - )).setRegistryName(new ResourceLocation(MODID, "rebar_concrete_tile_stairs")); - - // ------------------------------------------------------------------------------------------------------------------- - - public static final EdGlassBlock PANZERGLASS_BLOCK = (EdGlassBlock)(new EdGlassBlock( - DecorBlock.CFG_TRANSLUCENT, - BlockBehaviour.Properties.of(Material.GLASS, MaterialColor.NONE).strength(0.5f, 2000f).sound(SoundType.METAL).noOcclusion().isValidSpawn(ModContent::disallowSpawn) - )).setRegistryName(new ResourceLocation(MODID, "panzerglass_block")); - - public static final VariantSlabBlock PANZERGLASS_SLAB = (VariantSlabBlock)(new VariantSlabBlock( - DecorBlock.CFG_TRANSLUCENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 2000f).sound(SoundType.METAL).noOcclusion().isValidSpawn(ModContent::disallowSpawn) - )).setRegistryName(new ResourceLocation(MODID, "panzerglass_slab")); - - // ------------------------------------------------------------------------------------------------------------------- - - public static final EdRoofBlock DARK_CERAMIC_SHINGLE_ROOF = (EdRoofBlock)(new EdRoofBlock( - DecorBlock.CFG_CUTOUT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 6f).sound(SoundType.STONE).noOcclusion().dynamicShape().isValidSpawn(ModContent::disallowSpawn) - )).setRegistryName(new ResourceLocation(MODID, "dark_shingle_roof")); - - public static final EdRoofBlock DARK_CERAMIC_SHINGLE_ROOF_METALIZED = (EdRoofBlock)(new EdRoofBlock( - DecorBlock.CFG_CUTOUT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 6f).sound(SoundType.STONE).noOcclusion().dynamicShape().isValidSpawn(ModContent::disallowSpawn) - )).setRegistryName(new ResourceLocation(MODID, "dark_shingle_roof_metallized")); - - public static final EdRoofBlock DARK_CERAMIC_SHINGLE_ROOF_SKYLIGHT = (EdRoofBlock)(new EdRoofBlock( - DecorBlock.CFG_TRANSLUCENT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 6f).sound(SoundType.STONE).noOcclusion().dynamicShape().isValidSpawn(ModContent::disallowSpawn) - )).setRegistryName(new ResourceLocation(MODID, "dark_shingle_roof_skylight")); - - public static final EdChimneyTrunkBlock DARK_CERAMIC_SHINGLE_ROOF_CHIMNEYTRUNK = (EdChimneyTrunkBlock)(new EdChimneyTrunkBlock( - DecorBlock.CFG_CUTOUT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 6f).sound(SoundType.STONE).noOcclusion().dynamicShape().isValidSpawn(ModContent::disallowSpawn), - Shapes.create(Auxiliaries.getPixeledAABB(3, 0, 3, 13, 16, 13)), - Shapes.create(Auxiliaries.getPixeledAABB(5, 0, 5, 11, 16, 11)) - )).setRegistryName(new ResourceLocation(MODID, "dark_shingle_roof_chimneytrunk")); - - public static final EdChimneyTrunkBlock DARK_CERAMIC_SHINGLE_ROOF_WIRECONDUIT = (EdChimneyTrunkBlock)(new EdChimneyTrunkBlock( - DecorBlock.CFG_CUTOUT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 6f).sound(SoundType.STONE).noOcclusion().dynamicShape().isValidSpawn(ModContent::disallowSpawn), - Shapes.join( - Shapes.create(Auxiliaries.getPixeledAABB(3, 0, 3, 13, 13, 13)), - Shapes.create(Auxiliaries.getPixeledAABB(5, 13, 5, 11, 16, 11)), - BooleanOp.OR - ), - Shapes.join( - Shapes.create(Auxiliaries.getPixeledAABB(5, 0, 5, 11, 15, 11)), - Shapes.create(Auxiliaries.getPixeledAABB(7, 15, 7, 9, 16, 9)), - BooleanOp.OR - ) - )).setRegistryName(new ResourceLocation(MODID, "dark_shingle_roof_wireconduit")); - - public static final EdChimneyBlock DARK_CERAMIC_SHINGLE_ROOF_CHIMNEY = (EdChimneyBlock)(new EdChimneyBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_AI_PASSABLE, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 6f).sound(SoundType.STONE).dynamicShape().isValidSpawn(ModContent::disallowSpawn), - Auxiliaries.getPixeledAABB(3, 0, 3, 13, 6, 13) - )).setRegistryName(new ResourceLocation(MODID, "dark_shingle_roof_chimney")); - - public static final StandardBlocks.BaseBlock DARK_CERAMIC_SHINGLE_ROOF_BLOCK = (StandardBlocks.BaseBlock)(new StandardBlocks.BaseBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 6f).sound(SoundType.STONE) - )).setRegistryName(new ResourceLocation(MODID, "dark_shingle_roof_block")); - - public static final VariantSlabBlock DARK_CERAMIC_SHINGLE_ROOF_SLAB = (VariantSlabBlock)(new VariantSlabBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 6f).sound(SoundType.STONE) - )).setRegistryName(new ResourceLocation(MODID, "dark_shingle_roof_slab")); - - // ------------------------------------------------------------------------------------------------------------------- - - public static final StandardBlocks.BaseBlock DENSE_GRIT_SAND = (StandardBlocks.BaseBlock)(new StandardBlocks.BaseBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.DIRT, MaterialColor.DIRT).strength(0.1f, 3f).sound(SoundType.GRAVEL) - )).setRegistryName(new ResourceLocation(MODID, "dense_grit_sand_block")); - - public static final StandardBlocks.BaseBlock DENSE_GRIT_DIRT = (StandardBlocks.BaseBlock)(new StandardBlocks.BaseBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.DIRT, MaterialColor.DIRT).strength(0.1f, 3f).sound(SoundType.GRAVEL) - )).setRegistryName(new ResourceLocation(MODID, "dense_grit_dirt_block")); - - public static final SlabSliceBlock HALFSLAB_DARK_CERAMIC_SHINGLE_ROOF = (SlabSliceBlock)(new SlabSliceBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 6f).sound(SoundType.STONE) - )).setRegistryName(new ResourceLocation(MODID, "dark_shingle_roof_slabslice")); - - // ------------------------------------------------------------------------------------------------------------------- - - public static final EdLadderBlock METAL_RUNG_LADDER = (EdLadderBlock)(new EdLadderBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion() - )).setRegistryName(new ResourceLocation(MODID, "metal_rung_ladder")); - - public static final EdLadderBlock METAL_RUNG_STEPS = (EdLadderBlock)(new EdLadderBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion() - )).setRegistryName(new ResourceLocation(MODID, "metal_rung_steps")); - - public static final EdLadderBlock TREATED_WOOD_LADDER = (EdLadderBlock)(new EdLadderBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.3f, 8f).sound(SoundType.WOOD).noOcclusion() - )).setRegistryName(new ResourceLocation(MODID, "treated_wood_ladder")); - - public static final EdHatchBlock IRON_HATCH = (EdHatchBlock)(new EdHatchBlock( - DecorBlock.CFG_LOOK_PLACEMENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 2000f).sound(SoundType.METAL).noOcclusion(), - Auxiliaries.getPixeledAABB(0.5,1,0, 15.5,3,14), - Auxiliaries.getPixeledAABB(0.5,1,0, 15.5,14.,2) - )).setRegistryName(new ResourceLocation(MODID, "iron_hatch")); - - public static final StandardDoorBlock METAL_SLIDING_DOOR = (StandardDoorBlock)(new StandardDoorBlock( - DecorBlock.CFG_TRANSLUCENT|DecorBlock.CFG_HORIZIONTAL, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 8f).sound(SoundType.METAL).noOcclusion(), - new AABB[]{ - Auxiliaries.getPixeledAABB(15, 0.0,6, 16,16.0,10), - Auxiliaries.getPixeledAABB( 0,15.5,6, 16,16.0,10), - }, - new AABB[]{ - Auxiliaries.getPixeledAABB(15, 0.0,6, 16,16.0,10), - Auxiliaries.getPixeledAABB( 0, 0.0,6, 16, 0.3,10), - }, - new AABB[]{ - Auxiliaries.getPixeledAABB( 0,0,7, 16,16,9) - }, - new AABB[]{ - Auxiliaries.getPixeledAABB( 0,0,7, 16,16,9) - }, - SoundEvents.IRON_DOOR_OPEN, SoundEvents.IRON_DOOR_CLOSE - )).setRegistryName(new ResourceLocation(MODID, "metal_sliding_door")); - - // ------------------------------------------------------------------------------------------------------------------- - - public static final StandardBlocks.BaseBlock OLD_INDUSTRIAL_PLANKS = (StandardBlocks.BaseBlock)(new StandardBlocks.BaseBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 6f).sound(SoundType.WOOD) - )).setRegistryName(new ResourceLocation(MODID, "old_industrial_wood_planks")); - - public static final VariantSlabBlock OLD_INDUSTRIAL_SLAB = (VariantSlabBlock)(new VariantSlabBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 6f).sound(SoundType.WOOD) - )).setRegistryName(new ResourceLocation(MODID, "old_industrial_wood_slab")); - - public static final StandardStairsBlock OLD_INDUSTRIAL_STAIRS = (StandardStairsBlock)(new StandardStairsBlock( - DecorBlock.CFG_DEFAULT, - OLD_INDUSTRIAL_PLANKS.defaultBlockState(), - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 6f).sound(SoundType.WOOD) - )).setRegistryName(new ResourceLocation(MODID, "old_industrial_wood_stairs")); - - public static final SlabSliceBlock OLD_INDUSTRIAL_SLABSLICE = (SlabSliceBlock)(new SlabSliceBlock( - DecorBlock.CFG_CUTOUT, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 6f).sound(SoundType.WOOD).noOcclusion() - )).setRegistryName(new ResourceLocation(MODID, "old_industrial_wood_slabslice")); - - public static final StandardDoorBlock OLD_INDUSTRIAL_WOOD_DOOR = (StandardDoorBlock)(new StandardDoorBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 6f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(15,0, 0, 16,16,16), - Auxiliaries.getPixeledAABB( 0,0,13, 16,16,16), - SoundEvents.WOODEN_DOOR_OPEN, SoundEvents.WOODEN_DOOR_CLOSE - )).setRegistryName(new ResourceLocation(MODID, "old_industrial_wood_door")); - - // ------------------------------------------------------------------------------------------------------------------- - - public static final StandardBlocks.WaterLoggable TREATED_WOOD_TABLE = (StandardBlocks.WaterLoggable)(new StandardBlocks.WaterLoggable( - DecorBlock.CFG_CUTOUT, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(1,0,1, 15,15.9,15) - )).setRegistryName(new ResourceLocation(MODID, "treated_wood_table")); - - public static final EdChair.ChairBlock TREATED_WOOD_STOOL = (EdChair.ChairBlock)(new EdChair.ChairBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_LOOK_PLACEMENT, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(), - new AABB[]{ - Auxiliaries.getPixeledAABB(4,7,4, 12,8.8,12), - Auxiliaries.getPixeledAABB(7,0,7, 9,7,9), - Auxiliaries.getPixeledAABB(4,0,7, 12,1,9), - Auxiliaries.getPixeledAABB(7,0,4, 9,1,12), - } - )).setRegistryName(new ResourceLocation(MODID, "treated_wood_stool")); - - public static final StandardBlocks.DirectedWaterLoggable TREATED_WOOD_WINDOWSILL = (StandardBlocks.DirectedWaterLoggable)(new StandardBlocks.DirectedWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_AI_PASSABLE, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(0.5,15,10.5, 15.5,16,16) - )).setRegistryName(new ResourceLocation(MODID, "treated_wood_windowsill")); - - public static final StandardBlocks.DirectedWaterLoggable TREATED_WOOD_BROAD_WINDOWSILL = (StandardBlocks.DirectedWaterLoggable)(new StandardBlocks.DirectedWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_FACING_PLACEMENT, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(0,14.5,4, 16,16,16) - )).setRegistryName(new ResourceLocation(MODID, "treated_wood_broad_windowsill")); - - // ------------------------------------------------------------------------------------------------------------------- - - public static final StandardBlocks.DirectedWaterLoggable INSET_LIGHT_IRON = (StandardBlocks.DirectedWaterLoggable)(new StandardBlocks.DirectedWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_OPPOSITE_PLACEMENT|DecorBlock.CFG_AI_PASSABLE, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 8f).sound(SoundType.METAL).lightLevel((state)->15).noOcclusion(), - Auxiliaries.getPixeledAABB(5.2,5.2,0, 10.8,10.8,0.3) - )).setRegistryName(new ResourceLocation(MODID, "iron_inset_light")); - - public static final StandardBlocks.DirectedWaterLoggable FLOOR_EDGE_LIGHT_IRON = (StandardBlocks.DirectedWaterLoggable)(new StandardBlocks.DirectedWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_LOOK_PLACEMENT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_AI_PASSABLE, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 8f).sound(SoundType.METAL).lightLevel((state)->15).noOcclusion(), - Auxiliaries.getPixeledAABB(5,0,0, 11,2,0.5) - )).setRegistryName(new ResourceLocation(MODID, "iron_floor_edge_light")); - - public static final StandardBlocks.DirectedWaterLoggable CEILING_EDGE_LIGHT_IRON = (StandardBlocks.DirectedWaterLoggable)(new StandardBlocks.DirectedWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_LOOK_PLACEMENT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_AI_PASSABLE, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 8f).sound(SoundType.METAL).lightLevel((state)->15).noOcclusion(), - new AABB[]{ - Auxiliaries.getPixeledAABB( 0,15.5,0, 16,16,2.0), - Auxiliaries.getPixeledAABB( 0,14.0,0, 16,16,0.5), - Auxiliaries.getPixeledAABB( 0,14.0,0, 1,16,2.0), - Auxiliaries.getPixeledAABB(15,14.0,0, 16,16,2.0), - } - )).setRegistryName(new ResourceLocation(MODID, "iron_ceiling_edge_light")); - - public static final StandardBlocks.DirectedWaterLoggable BULB_LIGHT_IRON = (StandardBlocks.DirectedWaterLoggable)(new StandardBlocks.DirectedWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_OPPOSITE_PLACEMENT|DecorBlock.CFG_AI_PASSABLE, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 8f).sound(SoundType.METAL).lightLevel((state)->15).noOcclusion(), - new AABB[]{ - Auxiliaries.getPixeledAABB(6.5,6.5,1, 9.5,9.5,4), - Auxiliaries.getPixeledAABB(6.0,6.0,0, 10.0,10.0,1.0) - } - )).setRegistryName(new ResourceLocation(MODID, "iron_bulb_light")); - - // ------------------------------------------------------------------------------------------------------------------- - - public static final StandardBlocks.WaterLoggable STEEL_TABLE = (StandardBlocks.WaterLoggable)(new StandardBlocks.WaterLoggable( - DecorBlock.CFG_CUTOUT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 8f).sound(SoundType.METAL).noOcclusion(), - Auxiliaries.getPixeledAABB(0,0,0, 16,16,16) - )).setRegistryName(new ResourceLocation(MODID, "steel_table")); - - public static final EdFloorGratingBlock STEEL_FLOOR_GRATING = (EdFloorGratingBlock)(new EdFloorGratingBlock( - DecorBlock.CFG_CUTOUT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 8f).sound(SoundType.METAL).noOcclusion(), - Auxiliaries.getPixeledAABB(0,14,0, 16,15.5,16) - )).setRegistryName(new ResourceLocation(MODID, "steel_floor_grating")); - - // ------------------------------------------------------------------------------------------------------------------- - - public static final EdWindowBlock TREATED_WOOD_WINDOW = (EdWindowBlock)(new EdWindowBlock( - DecorBlock.CFG_LOOK_PLACEMENT, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 8f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(0,0,7, 16,16,9) - )).setRegistryName(new ResourceLocation(MODID, "treated_wood_window")); - - public static final EdWindowBlock STEEL_FRAMED_WINDOW = (EdWindowBlock)(new EdWindowBlock( - DecorBlock.CFG_LOOK_PLACEMENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 8f).sound(SoundType.METAL).noOcclusion(), - Auxiliaries.getPixeledAABB(0,0,7.5, 16,16,8.5) - )).setRegistryName(new ResourceLocation(MODID, "steel_framed_window")); - - // ------------------------------------------------------------------------------------------------------------------- - - public static final EdStraightPoleBlock TREATED_WOOD_POLE = (EdStraightPoleBlock)(new EdStraightPoleBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_FLIP_PLACEMENT_IF_SAME, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(5.8,5.8,0, 10.2,10.2,16), - null - )).setRegistryName(new ResourceLocation(MODID, "treated_wood_pole")); - - public static final EdStraightPoleBlock TREATED_WOOD_POLE_HEAD = (EdStraightPoleBlock)(new EdStraightPoleBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_FLIP_PLACEMENT_IF_SAME, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(5.8,5.8,0, 10.2,10.2,16), - TREATED_WOOD_POLE - )).setRegistryName(new ResourceLocation(MODID, "treated_wood_pole_head")); - - public static final EdStraightPoleBlock TREATED_WOOD_POLE_SUPPORT = (EdStraightPoleBlock)(new EdStraightPoleBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_FLIP_PLACEMENT_IF_SAME, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(5.8,5.8,0, 10.2,10.2,16), - TREATED_WOOD_POLE - )).setRegistryName(new ResourceLocation(MODID, "treated_wood_pole_support")); - - public static final EdStraightPoleBlock THIN_STEEL_POLE = (EdStraightPoleBlock)(new EdStraightPoleBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 11f).sound(SoundType.METAL).noOcclusion(), - Auxiliaries.getPixeledAABB(6,6,0, 10,10,16), - null - )).setRegistryName(new ResourceLocation(MODID, "thin_steel_pole")); - - public static final EdStraightPoleBlock THIN_STEEL_POLE_HEAD = (EdStraightPoleBlock)(new EdStraightPoleBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_FLIP_PLACEMENT_IF_SAME, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 11f).sound(SoundType.METAL).noOcclusion(), - Auxiliaries.getPixeledAABB(6,6,0, 10,10,16), - THIN_STEEL_POLE - )).setRegistryName(new ResourceLocation(MODID, "thin_steel_pole_head")); - - public static final EdStraightPoleBlock THICK_STEEL_POLE = (EdStraightPoleBlock)(new EdStraightPoleBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 11f).sound(SoundType.METAL).noOcclusion(), - Auxiliaries.getPixeledAABB(5,5,0, 11,11,16), - null - )).setRegistryName(new ResourceLocation(MODID, "thick_steel_pole")); - - public static final EdStraightPoleBlock THICK_STEEL_POLE_HEAD = (EdStraightPoleBlock)(new EdStraightPoleBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_FLIP_PLACEMENT_IF_SAME, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 11f).sound(SoundType.METAL).noOcclusion(), - Auxiliaries.getPixeledAABB(5,5,0, 11,11,16), - THICK_STEEL_POLE - )).setRegistryName(new ResourceLocation(MODID, "thick_steel_pole_head")); - - public static final EdHorizontalSupportBlock STEEL_DOUBLE_T_SUPPORT = (EdHorizontalSupportBlock)(new EdHorizontalSupportBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_LOOK_PLACEMENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 11f).sound(SoundType.METAL).noOcclusion(), - Auxiliaries.getPixeledAABB( 5,11,0, 11,16,16), // main beam - Auxiliaries.getPixeledAABB(10,11,5, 16,16,11), // east beam (also for west 180deg) - Auxiliaries.getPixeledAABB( 6, 0,6, 10,16,10), // down thin - Auxiliaries.getPixeledAABB( 5, 0,5, 11,16,11) // down thick - )).setRegistryName(new ResourceLocation(MODID, "steel_double_t_support")); - - // ------------------------------------------------------------------------------------------------------------------- - - public static final StandardBlocks.DirectedWaterLoggable SIGN_MODLOGO = (StandardBlocks.DirectedWaterLoggable)(new StandardBlocks.DirectedWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_AI_PASSABLE, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.3f, 1000f).sound(SoundType.WOOD).lightLevel((state)->1).noOcclusion(), - Auxiliaries.getPixeledAABB(0,0,15.6, 16,16,16.0) - )).setRegistryName(new ResourceLocation(MODID, "sign_decor")); - - public static final StandardBlocks.DirectedWaterLoggable SIGN_HOTWIRE = (StandardBlocks.DirectedWaterLoggable)(new StandardBlocks.DirectedWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_AI_PASSABLE, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) - )).setRegistryName(new ResourceLocation(MODID, "sign_hotwire")); - - public static final StandardBlocks.DirectedWaterLoggable SIGN_DANGER = (StandardBlocks.DirectedWaterLoggable)(new StandardBlocks.DirectedWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_AI_PASSABLE, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) - )).setRegistryName(new ResourceLocation(MODID, "sign_danger")); - - public static final StandardBlocks.DirectedWaterLoggable SIGN_DEFENSE = (StandardBlocks.DirectedWaterLoggable)(new StandardBlocks.DirectedWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_AI_PASSABLE, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) - )).setRegistryName(new ResourceLocation(MODID, "sign_defense")); - - public static final StandardBlocks.DirectedWaterLoggable SIGN_FACTORY_AREA = (StandardBlocks.DirectedWaterLoggable)(new StandardBlocks.DirectedWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_AI_PASSABLE, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) - )).setRegistryName(new ResourceLocation(MODID, "sign_factoryarea")); - - public static final StandardBlocks.DirectedWaterLoggable SIGN_EXIT = (StandardBlocks.DirectedWaterLoggable)(new StandardBlocks.DirectedWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_AI_PASSABLE, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(3,7,15.6, 13,13,16) - )).setRegistryName(new ResourceLocation(MODID, "sign_exit")); - - public static final StandardBlocks.DirectedWaterLoggable SIGN_RADIOACTIVE = (StandardBlocks.DirectedWaterLoggable)(new StandardBlocks.DirectedWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_AI_PASSABLE, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) - )).setRegistryName(new ResourceLocation(MODID, "sign_radioactive")); - - public static final StandardBlocks.DirectedWaterLoggable SIGN_LASER = (StandardBlocks.DirectedWaterLoggable)(new StandardBlocks.DirectedWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_AI_PASSABLE, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) - )).setRegistryName(new ResourceLocation(MODID, "sign_laser")); - - public static final StandardBlocks.DirectedWaterLoggable SIGN_CAUTION = (StandardBlocks.DirectedWaterLoggable)(new StandardBlocks.DirectedWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_AI_PASSABLE, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) - )).setRegistryName(new ResourceLocation(MODID, "sign_caution")); - - public static final StandardBlocks.DirectedWaterLoggable SIGN_MAGIC_HAZARD = (StandardBlocks.DirectedWaterLoggable)(new StandardBlocks.DirectedWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_AI_PASSABLE, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) - )).setRegistryName(new ResourceLocation(MODID, "sign_magichazard")); - - public static final StandardBlocks.DirectedWaterLoggable SIGN_FIRE_HAZARD = (StandardBlocks.DirectedWaterLoggable)(new StandardBlocks.DirectedWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_AI_PASSABLE, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) - )).setRegistryName(new ResourceLocation(MODID, "sign_firehazard")); - - public static final StandardBlocks.DirectedWaterLoggable SIGN_HOT_SURFACE = (StandardBlocks.DirectedWaterLoggable)(new StandardBlocks.DirectedWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_AI_PASSABLE, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) - )).setRegistryName(new ResourceLocation(MODID, "sign_hotsurface")); - - public static final StandardBlocks.DirectedWaterLoggable SIGN_MAGNETIC_FIELD = (StandardBlocks.DirectedWaterLoggable)(new StandardBlocks.DirectedWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_AI_PASSABLE, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) - )).setRegistryName(new ResourceLocation(MODID, "sign_magneticfield")); - - public static final StandardBlocks.DirectedWaterLoggable SIGN_FROST_WARNING = (StandardBlocks.DirectedWaterLoggable)(new StandardBlocks.DirectedWaterLoggable( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_AI_PASSABLE, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), - Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) - )).setRegistryName(new ResourceLocation(MODID, "sign_frost")); - - // ------------------------------------------------------------------------------------------------------------------- - - public static final EdCraftingTable.CraftingTableBlock CRAFTING_TABLE = (EdCraftingTable.CraftingTableBlock)(new EdCraftingTable.CraftingTableBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_LOOK_PLACEMENT|DecorBlock.CFG_OPPOSITE_PLACEMENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(), - new AABB[]{ - Auxiliaries.getPixeledAABB(0,15,0, 16,16,16), - Auxiliaries.getPixeledAABB(1, 0,1, 15,16,15) - } - )).setRegistryName(new ResourceLocation(MODID, "metal_crafting_table")); - - public static final EdFurnace.FurnaceBlock SMALL_LAB_FURNACE = (EdFurnace.FurnaceBlock)(new EdFurnace.FurnaceBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_LOOK_PLACEMENT|DecorBlock.CFG_OPPOSITE_PLACEMENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(), - new AABB[]{ - Auxiliaries.getPixeledAABB(1,0,1, 15, 1,15), - Auxiliaries.getPixeledAABB(0,1,1, 16,16,16), - } - )).setRegistryName(new ResourceLocation(MODID, "small_lab_furnace")); - - public static final EdElectricalFurnace.ElectricalFurnaceBlock SMALL_ELECTRICAL_FURNACE = (EdElectricalFurnace.ElectricalFurnaceBlock)(new EdElectricalFurnace.ElectricalFurnaceBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_LOOK_PLACEMENT|DecorBlock.CFG_OPPOSITE_PLACEMENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(), - new AABB[]{ - Auxiliaries.getPixeledAABB(0, 0,0, 16,11,16), - Auxiliaries.getPixeledAABB(1,11,0, 15,12,16), - Auxiliaries.getPixeledAABB(2,12,0, 14,13,16), - Auxiliaries.getPixeledAABB(3,13,0, 13,14,16), - Auxiliaries.getPixeledAABB(4,14,0, 12,16,16), - } - )).setRegistryName(new ResourceLocation(MODID, "small_electrical_furnace")); - - public static final EdDropper.DropperBlock FACTORY_DROPPER = (EdDropper.DropperBlock)(new EdDropper.DropperBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_LOOK_PLACEMENT|DecorBlock.CFG_OPPOSITE_PLACEMENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(), - Auxiliaries.getPixeledAABB(0,0,1, 16,16,16) - )).setRegistryName(new ResourceLocation(MODID, "factory_dropper")); - - public static final EdPlacer.PlacerBlock FACTORY_PLACER = (EdPlacer.PlacerBlock)(new EdPlacer.PlacerBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_LOOK_PLACEMENT|DecorBlock.CFG_FLIP_PLACEMENT_SHIFTCLICK|DecorBlock.CFG_OPPOSITE_PLACEMENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(), - new AABB[]{ - Auxiliaries.getPixeledAABB(0,0,2, 16,16,16), - Auxiliaries.getPixeledAABB( 0,0,0, 1,16, 2), - Auxiliaries.getPixeledAABB(15,0,0,16,16, 2) - } - )).setRegistryName(new ResourceLocation(MODID, "factory_placer")); - - public static final EdBreaker.BreakerBlock SMALL_BLOCK_BREAKER = (EdBreaker.BreakerBlock)(new EdBreaker.BreakerBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_LOOK_PLACEMENT|DecorBlock.CFG_OPPOSITE_PLACEMENT|DecorBlock.CFG_FLIP_PLACEMENT_SHIFTCLICK, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(), - new AABB[]{ - Auxiliaries.getPixeledAABB(1,0,0, 15, 4, 7), - Auxiliaries.getPixeledAABB(1,0,7, 15,12,16), - Auxiliaries.getPixeledAABB(0,0,0, 1, 5, 4), - Auxiliaries.getPixeledAABB(0,0,4, 1,12,16), - Auxiliaries.getPixeledAABB(15,0,0, 16, 5, 4), - Auxiliaries.getPixeledAABB(15,0,4, 16,12,16) - } - )).setRegistryName(new ResourceLocation(MODID, "small_block_breaker")); - - public static final EdHopper.HopperBlock FACTORY_HOPPER = (EdHopper.HopperBlock)(new EdHopper.HopperBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_OPPOSITE_PLACEMENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(),()->{ - final AABB[] down_aabbs = new AABB[]{ - Auxiliaries.getPixeledAABB( 5, 0, 5, 11, 1,11), - Auxiliaries.getPixeledAABB( 4, 1, 4, 12, 7,12), - Auxiliaries.getPixeledAABB( 2, 7, 2, 14,10,14), - Auxiliaries.getPixeledAABB( 0,10, 0, 16,16,16), - Auxiliaries.getPixeledAABB( 0, 4, 5, 2,10,11), - Auxiliaries.getPixeledAABB(14, 4, 5, 16,10,11), - Auxiliaries.getPixeledAABB( 5, 4, 0, 11,10, 2), - Auxiliaries.getPixeledAABB( 5, 4,14, 11,10,16), - }; - final AABB[] up_aabbs = new AABB[]{ - Auxiliaries.getPixeledAABB( 5,15, 5, 11,16,11), - Auxiliaries.getPixeledAABB( 4,14, 4, 12, 9,12), - Auxiliaries.getPixeledAABB( 2, 9, 2, 14, 6,14), - Auxiliaries.getPixeledAABB( 0, 6, 0, 16, 0,16), - Auxiliaries.getPixeledAABB( 0,12, 5, 2, 6,11), - Auxiliaries.getPixeledAABB(14,12, 5, 16, 6,11), - Auxiliaries.getPixeledAABB( 5,12, 0, 11, 6, 2), - Auxiliaries.getPixeledAABB( 5,12,14, 11, 6,16), - }; - final AABB[] north_aabbs = new AABB[]{ - Auxiliaries.getPixeledAABB( 5, 0, 5, 11, 1,11), - Auxiliaries.getPixeledAABB( 4, 1, 4, 12, 7,12), - Auxiliaries.getPixeledAABB( 2, 7, 2, 14,10,14), - Auxiliaries.getPixeledAABB( 0,10, 0, 16,16,16), - Auxiliaries.getPixeledAABB( 0, 4, 5, 2,10,11), - Auxiliaries.getPixeledAABB(14, 4, 5, 16,10,11), - Auxiliaries.getPixeledAABB( 5, 1, 0, 11, 7, 4), - Auxiliaries.getPixeledAABB( 5, 4,14, 11,10,16), - }; - return new ArrayList<>(Arrays.asList( - Auxiliaries.getUnionShape(down_aabbs), - Auxiliaries.getUnionShape(up_aabbs), - Auxiliaries.getUnionShape(Auxiliaries.getRotatedAABB(north_aabbs, Direction.NORTH, false)), - Auxiliaries.getUnionShape(Auxiliaries.getRotatedAABB(north_aabbs, Direction.SOUTH, false)), - Auxiliaries.getUnionShape(Auxiliaries.getRotatedAABB(north_aabbs, Direction.WEST, false)), - Auxiliaries.getUnionShape(Auxiliaries.getRotatedAABB(north_aabbs, Direction.EAST, false)), - Shapes.block(), - Shapes.block() - )); - } - )).setRegistryName(new ResourceLocation(MODID, "factory_hopper")); - - public static final EdWasteIncinerator.WasteIncineratorBlock SMALL_WASTE_INCINERATOR = (EdWasteIncinerator.WasteIncineratorBlock)(new EdWasteIncinerator.WasteIncineratorBlock( - DecorBlock.CFG_DEFAULT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 12f).sound(SoundType.METAL), - Auxiliaries.getPixeledAABB(0,0,0, 16,16,16) - )).setRegistryName(new ResourceLocation(MODID, "small_waste_incinerator")); - - public static final EdMineralSmelter.MineralSmelterBlock SMALL_MINERAL_SMELTER = (EdMineralSmelter.MineralSmelterBlock)(new EdMineralSmelter.MineralSmelterBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_LOOK_PLACEMENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(), - Auxiliaries.getPixeledAABB(1.1,0,1.1, 14.9,16,14.9) - )).setRegistryName(new ResourceLocation(MODID, "small_mineral_smelter")); - - public static final EdFreezer.FreezerBlock SMALL_FREEZER = (EdFreezer.FreezerBlock)(new EdFreezer.FreezerBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_LOOK_PLACEMENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(), - Auxiliaries.getPixeledAABB(1.1,0,1.1, 14.9,16,14.9) - )).setRegistryName(new ResourceLocation(MODID, "small_freezer")); - - public static final EdSolarPanel.SolarPanelBlock SMALL_SOLAR_PANEL = (EdSolarPanel.SolarPanelBlock)(new EdSolarPanel.SolarPanelBlock( - DecorBlock.CFG_CUTOUT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), - new AABB[]{ - Auxiliaries.getPixeledAABB(0,0,0, 16,2,16), - Auxiliaries.getPixeledAABB(6,1.5,3, 10,10.5,13), - } - )).setRegistryName(new ResourceLocation(MODID, "small_solar_panel")); - - public static final EdMilker.MilkerBlock SMALL_MILKING_MACHINE = (EdMilker.MilkerBlock)(new EdMilker.MilkerBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_LOOK_PLACEMENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), - new AABB[]{ - Auxiliaries.getPixeledAABB( 1, 1,0, 15,14,10), - Auxiliaries.getPixeledAABB( 0,14,0, 16,16,13), - Auxiliaries.getPixeledAABB( 0, 0,0, 16, 1,13), - Auxiliaries.getPixeledAABB( 0, 1,1, 1,14,11), - Auxiliaries.getPixeledAABB(15, 1,1, 16,14,11) - } - )).setRegistryName(new ResourceLocation(MODID, "small_milking_machine")); - - public static final EdTreeCutter.TreeCutterBlock SMALL_TREE_CUTTER = (EdTreeCutter.TreeCutterBlock)(new EdTreeCutter.TreeCutterBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_LOOK_PLACEMENT|DecorBlock.CFG_FLIP_PLACEMENT_SHIFTCLICK, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), - new AABB[]{ - Auxiliaries.getPixeledAABB( 0,0, 0, 16,3,16), - Auxiliaries.getPixeledAABB( 0,3, 0, 3,8,16), - Auxiliaries.getPixeledAABB( 3,7, 0, 5,8,16), - Auxiliaries.getPixeledAABB(15,0, 0, 16,6,16), - Auxiliaries.getPixeledAABB( 0,0,13, 16,8,16), - Auxiliaries.getPixeledAABB( 5,6,12, 16,8,13), - } - )).setRegistryName(new ResourceLocation(MODID, "small_tree_cutter")); - - public static final EdPipeValve.PipeValveBlock STRAIGHT_CHECK_VALVE = (EdPipeValve.PipeValveBlock)(new EdPipeValve.PipeValveBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_OPPOSITE_PLACEMENT|DecorBlock.CFG_FLIP_PLACEMENT_SHIFTCLICK, - EdPipeValve.CFG_CHECK_VALVE, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion(), - new AABB[]{ - Auxiliaries.getPixeledAABB(2,2, 0, 14,14, 2), - Auxiliaries.getPixeledAABB(2,2,14, 14,14,16), - Auxiliaries.getPixeledAABB(3,3, 5, 13,13,11), - Auxiliaries.getPixeledAABB(4,4, 2, 12,12,14), - } - )).setRegistryName(new ResourceLocation(MODID, "straight_pipe_valve")); - - public static final EdPipeValve.PipeValveBlock STRAIGHT_REDSTONE_VALVE = (EdPipeValve.PipeValveBlock)(new EdPipeValve.PipeValveBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_OPPOSITE_PLACEMENT, - EdPipeValve.CFG_REDSTONE_CONTROLLED_VALVE, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion(), - new AABB[]{ - Auxiliaries.getPixeledAABB(2,2, 0, 14,14, 2), - Auxiliaries.getPixeledAABB(2,2,14, 14,14,16), - Auxiliaries.getPixeledAABB(3,3, 5, 13,13,11), - Auxiliaries.getPixeledAABB(4,4, 2, 12,12,14), - } - )).setRegistryName(new ResourceLocation(MODID, "straight_pipe_valve_redstone")); - - public static final EdPipeValve.PipeValveBlock STRAIGHT_REDSTONE_ANALOG_VALVE = (EdPipeValve.PipeValveBlock)(new EdPipeValve.PipeValveBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_OPPOSITE_PLACEMENT, - EdPipeValve.CFG_REDSTONE_CONTROLLED_VALVE|EdPipeValve.CFG_ANALOG_VALVE, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion(), - new AABB[]{ - Auxiliaries.getPixeledAABB(2,2, 0, 14,14, 2), - Auxiliaries.getPixeledAABB(2,2,14, 14,14,16), - Auxiliaries.getPixeledAABB(3,3, 5, 13,13,11), - Auxiliaries.getPixeledAABB(4,4, 2, 12,12,14), - } - )).setRegistryName(new ResourceLocation(MODID, "straight_pipe_valve_redstone_analog")); - - public static final EdFluidBarrel.FluidBarrelBlock FLUID_BARREL = (EdFluidBarrel.FluidBarrelBlock)(new EdFluidBarrel.FluidBarrelBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_LOOK_PLACEMENT|DecorBlock.CFG_OPPOSITE_PLACEMENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), - new AABB[]{ - Auxiliaries.getPixeledAABB(2, 0,0, 14, 1,16), - Auxiliaries.getPixeledAABB(1, 1,0, 15, 2,16), - Auxiliaries.getPixeledAABB(0, 2,0, 16,14,16), - Auxiliaries.getPixeledAABB(1,14,0, 15,15,16), - Auxiliaries.getPixeledAABB(2,15,0, 14,16,16), - } - )).setRegistryName(new ResourceLocation(MODID, "fluid_barrel")); - - public static final EdFluidFunnel.FluidFunnelBlock SMALL_FLUID_FUNNEL = (EdFluidFunnel.FluidFunnelBlock)(new EdFluidFunnel.FluidFunnelBlock( - DecorBlock.CFG_CUTOUT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), - new AABB[]{ - Auxiliaries.getPixeledAABB(0, 0,0, 16,14,16), - Auxiliaries.getPixeledAABB(1,14,1, 15,15,15), - Auxiliaries.getPixeledAABB(0,15,0, 16,16,16) - } - )).setRegistryName(new ResourceLocation(MODID, "small_fluid_funnel")); - - public static final EdLabeledCrate.LabeledCrateBlock LABELED_CRATE = (EdLabeledCrate.LabeledCrateBlock)(new EdLabeledCrate.LabeledCrateBlock( - DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_LOOK_PLACEMENT|DecorBlock.CFG_OPPOSITE_PLACEMENT, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.3f, 32f).sound(SoundType.METAL).noOcclusion(), - Auxiliaries.getPixeledAABB(0,0,0, 16,16,16) - )).setRegistryName(new ResourceLocation(MODID, "labeled_crate")); - - // ------------------------------------------------------------------------------------------------------------------- - - public static final SlabSliceBlock HALFSLAB_TREATEDWOOD = (SlabSliceBlock)(new SlabSliceBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HARD_IE_DEPENDENT, - BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.3f, 4f).sound(SoundType.WOOD).noOcclusion() - )).setRegistryName(new ResourceLocation(MODID, "halfslab_treated_wood")); - - public static final SlabSliceBlock HALFSLAB_SHEETMETALIRON = (SlabSliceBlock)(new SlabSliceBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HARD_IE_DEPENDENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion() - )).setRegistryName(new ResourceLocation(MODID, "halfslab_sheetmetal_iron")); - - public static final SlabSliceBlock HALFSLAB_SHEETMETALSTEEL = (SlabSliceBlock)(new SlabSliceBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HARD_IE_DEPENDENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion() - )).setRegistryName(new ResourceLocation(MODID, "halfslab_sheetmetal_steel")); - - public static final SlabSliceBlock HALFSLAB_SHEETMETALCOPPER = (SlabSliceBlock)(new SlabSliceBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HARD_IE_DEPENDENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion() - )).setRegistryName(new ResourceLocation(MODID, "halfslab_sheetmetal_copper")); - - public static final SlabSliceBlock HALFSLAB_SHEETMETALGOLD = (SlabSliceBlock)(new SlabSliceBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HARD_IE_DEPENDENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion() - )).setRegistryName(new ResourceLocation(MODID, "halfslab_sheetmetal_gold")); - - public static final SlabSliceBlock HALFSLAB_SHEETMETALALUMINIUM = (SlabSliceBlock)(new SlabSliceBlock( - DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HARD_IE_DEPENDENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion() - )).setRegistryName(new ResourceLocation(MODID, "halfslab_sheetmetal_aluminum")); - - // ------------------------------------------------------------------------------------------------------------------- - - public static final EdFenceBlock STEEL_MESH_FENCE = (EdFenceBlock)(new EdFenceBlock( - DecorBlock.CFG_CUTOUT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), - 1.5, 16, 0.25, 0, 16, 16 - )).setRegistryName(new ResourceLocation(MODID, "steel_mesh_fence")); - - public static final EdDoubleGateBlock STEEL_MESH_FENCE_GATE = (EdDoubleGateBlock)(new EdDoubleGateBlock( - DecorBlock.CFG_CUTOUT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), - Auxiliaries.getPixeledAABB(0,0,6.5, 16,16,9.5) - )).setRegistryName(new ResourceLocation(MODID, "steel_mesh_fence_gate")); - - public static final EdRailingBlock STEEL_RAILING = (EdRailingBlock)(new EdRailingBlock( - DecorBlock.CFG_CUTOUT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), - Auxiliaries.getPixeledAABB(0,0,0, 0, 0,0), - Auxiliaries.getPixeledAABB(0,0,0, 16,15.9,1) - )).setRegistryName(new ResourceLocation(MODID, "steel_railing")); - - public static final EdCatwalkBlock STEEL_CATWALK = (EdCatwalkBlock)(new EdCatwalkBlock( - DecorBlock.CFG_CUTOUT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), - Auxiliaries.getPixeledAABB(0,0,0, 16, 2,16), - Auxiliaries.getPixeledAABB(0,0,0, 16,15.9, 1), - STEEL_RAILING - )).setRegistryName(new ResourceLocation(MODID, "steel_catwalk")); - - public static final EdCatwalkTopAlignedBlock STEEL_CATWALK_TOP_ALIGNED = (EdCatwalkTopAlignedBlock)(new EdCatwalkTopAlignedBlock( - DecorBlock.CFG_CUTOUT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), - new VoxelShape[]{ - Shapes.create(Auxiliaries.getPixeledAABB(0,14,0, 16, 16,16)), // only base - Auxiliaries.getUnionShape( // base with thick pole - Auxiliaries.getPixeledAABB(0,14,0, 16, 16,16), - Auxiliaries.getPixeledAABB(5, 0,5, 11,15, 11) + public static void initTags() + { + Registries.addOptionalBlockTag("accepted_mineral_smelter_input", new ResourceLocation("minecraft", "diorite"), new ResourceLocation("minecraft", "cobblestone")); + } + + public static void initBlocks() + { + Registries.addBlock("clinker_brick_block", ()->new StandardBlocks.BaseBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) + )); + Registries.addBlock("clinker_brick_slab", ()->new VariantSlabBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) + )); + Registries.addBlock("clinker_brick_stairs", ()->new StandardStairsBlock( + StandardBlocks.CFG_DEFAULT, + ()->Registries.getBlock("clinker_brick").defaultBlockState(), + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) + )); + Registries.addBlock("clinker_brick_wall", ()->new EdWallBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) + )); + Registries.addBlock("clinker_brick_stained_block", ()->new StandardBlocks.BaseBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) + )); + Registries.addBlock("clinker_brick_stained_slab", ()->new VariantSlabBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) + )); + Registries.addBlock("clinker_brick_stained_stairs", ()->new StandardStairsBlock( + StandardBlocks.CFG_DEFAULT, + ()->Registries.getBlock("clinker_brick_stained").defaultBlockState(), + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) + )); + Registries.addBlock("clinker_brick_sastor_corner_block", ()->new EdCornerOrnamentedBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE), + new Block[]{ + Registries.getBlock("clinker_brick_block"), + Registries.getBlock("clinker_brick_slab"), + Registries.getBlock("clinker_brick_stairs"), + Registries.getBlock("clinker_brick_stained_block"), + Registries.getBlock("clinker_brick_stained_slab"), + Registries.getBlock("clinker_brick_stained_stairs") + } + )); + Registries.addBlock("clinker_brick_recessed", ()->new StandardBlocks.HorizontalWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_LOOK_PLACEMENT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE), + new AABB[] { + Auxiliaries.getPixeledAABB( 3,0, 0, 13,16, 1), + Auxiliaries.getPixeledAABB( 0,0, 1, 16,16,11), + Auxiliaries.getPixeledAABB( 4,0,11, 12,16,13) + } + )); + Registries.addBlock("clinker_brick_vertically_slit", ()->new StandardBlocks.HorizontalWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_LOOK_PLACEMENT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE), + new AABB[] { + Auxiliaries.getPixeledAABB( 3,0, 0, 13,16, 1), + Auxiliaries.getPixeledAABB( 3,0,15, 13,16,16), + Auxiliaries.getPixeledAABB( 0,0, 1, 16,16,15) + } + )); + Registries.addBlock("clinker_brick_vertical_slab_structured", ()->new StandardBlocks.HorizontalWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_LOOK_PLACEMENT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE), + new AABB[] { + Auxiliaries.getPixeledAABB( 0,0, 0, 16,16, 8), + } + )); + + // ------------------------------------------------------------------------------------------------------------------- + + Registries.addBlock("slag_brick_block", ()->new StandardBlocks.BaseBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) + )); + Registries.addBlock("slag_brick_slab", ()->new VariantSlabBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) + )); + Registries.addBlock("slag_brick_stairs", ()->new StandardStairsBlock( + StandardBlocks.CFG_DEFAULT, + ()->Registries.getBlock("slag_brick").defaultBlockState(), + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) + )); + Registries.addBlock("slag_brick_wall", ()->new EdWallBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 7f).sound(SoundType.STONE) + )); + + // ------------------------------------------------------------------------------------------------------------------- + + Registries.addBlock("rebar_concrete", ()->new StandardBlocks.BaseBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn) + )); + Registries.addBlock("rebar_concrete_slab", ()->new VariantSlabBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn) + )); + Registries.addBlock("rebar_concrete_stairs", ()->new StandardStairsBlock( + StandardBlocks.CFG_DEFAULT, + ()->Registries.getBlock("rebar_concrete").defaultBlockState(), + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn) + )); + Registries.addBlock("rebar_concrete_wall", ()->new EdWallBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn) + )); + Registries.addBlock("halfslab_rebar_concrete", ()->new SlabSliceBlock( + StandardBlocks.CFG_CUTOUT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn) + )); + + // ------------------------------------------------------------------------------------------------------------------- + + Registries.addBlock("rebar_concrete_tile", ()->new StandardBlocks.BaseBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn) + )); + Registries.addBlock("rebar_concrete_tile_slab", ()->new VariantSlabBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn) + )); + Registries.addBlock("rebar_concrete_tile_stairs", ()->new StandardStairsBlock( + StandardBlocks.CFG_DEFAULT, + ()->Registries.getBlock("rebar_concrete_tile").defaultBlockState(), + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(1.0f, 2000f).sound(SoundType.STONE).isValidSpawn(detail::disallowSpawn) + )); + + // ------------------------------------------------------------------------------------------------------------------- + + Registries.addBlock("panzerglass_block", ()->new EdGlassBlock( + StandardBlocks.CFG_TRANSLUCENT, + BlockBehaviour.Properties.of(Material.GLASS, MaterialColor.NONE).strength(0.5f, 2000f).sound(SoundType.METAL).noOcclusion().isValidSpawn(detail::disallowSpawn) + )); + Registries.addBlock("panzerglass_slab", ()->new VariantSlabBlock( + StandardBlocks.CFG_TRANSLUCENT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 2000f).sound(SoundType.METAL).noOcclusion().isValidSpawn(detail::disallowSpawn) + )); + + // ------------------------------------------------------------------------------------------------------------------- + + Registries.addBlock("dark_shingle_roof", ()->new EdRoofBlock( + StandardBlocks.CFG_CUTOUT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 6f).sound(SoundType.STONE).noOcclusion().dynamicShape().isValidSpawn(detail::disallowSpawn) + )); + Registries.addBlock("dark_shingle_roof_metallized", ()->new EdRoofBlock( + StandardBlocks.CFG_CUTOUT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 6f).sound(SoundType.STONE).noOcclusion().dynamicShape().isValidSpawn(detail::disallowSpawn) + )); + Registries.addBlock("dark_shingle_roof_skylight", ()->new EdRoofBlock( + StandardBlocks.CFG_TRANSLUCENT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 6f).sound(SoundType.STONE).noOcclusion().dynamicShape().isValidSpawn(detail::disallowSpawn) + )); + Registries.addBlock("dark_shingle_roof_chimneytrunk", ()->new EdChimneyTrunkBlock( + StandardBlocks.CFG_CUTOUT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 6f).sound(SoundType.STONE).noOcclusion().dynamicShape().isValidSpawn(detail::disallowSpawn), + Shapes.create(Auxiliaries.getPixeledAABB(3, 0, 3, 13, 16, 13)), + Shapes.create(Auxiliaries.getPixeledAABB(5, 0, 5, 11, 16, 11)) + )); + Registries.addBlock("dark_shingle_roof_wireconduit", ()->new EdChimneyTrunkBlock( + StandardBlocks.CFG_CUTOUT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 6f).sound(SoundType.STONE).noOcclusion().dynamicShape().isValidSpawn(detail::disallowSpawn), + Shapes.join( + Shapes.create(Auxiliaries.getPixeledAABB(3, 0, 3, 13, 13, 13)), + Shapes.create(Auxiliaries.getPixeledAABB(5, 13, 5, 11, 16, 11)), + BooleanOp.OR ), - Auxiliaries.getUnionShape( // base with thin pole - Auxiliaries.getPixeledAABB(0,14,0, 16, 16,16), - Auxiliaries.getPixeledAABB(6, 0,6, 10,15, 10) - ), - Auxiliaries.getUnionShape( // structure frame-like - Auxiliaries.getPixeledAABB( 0, 0, 0, 16, 2,16), - Auxiliaries.getPixeledAABB( 0,14, 0, 16, 16,16), - Auxiliaries.getPixeledAABB( 0, 0, 0, 1, 16, 1), - Auxiliaries.getPixeledAABB(15, 0, 0, 16, 16, 1), - Auxiliaries.getPixeledAABB(15, 0,15, 16, 16,16), - Auxiliaries.getPixeledAABB( 0, 0,15, 1, 16,16) + Shapes.join( + Shapes.create(Auxiliaries.getPixeledAABB(5, 0, 5, 11, 15, 11)), + Shapes.create(Auxiliaries.getPixeledAABB(7, 15, 7, 9, 16, 9)), + BooleanOp.OR ) + )); + Registries.addBlock("dark_shingle_roof_chimney", ()->new EdChimneyBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_AI_PASSABLE, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 6f).sound(SoundType.STONE).dynamicShape().isValidSpawn(detail::disallowSpawn), + Auxiliaries.getPixeledAABB(3, 0, 3, 13, 6, 13) + )); + Registries.addBlock("dark_shingle_roof_block", ()->new StandardBlocks.BaseBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 6f).sound(SoundType.STONE) + )); + Registries.addBlock("dark_shingle_roof_slab", ()->new VariantSlabBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 6f).sound(SoundType.STONE) + )); + + // ------------------------------------------------------------------------------------------------------------------- + + Registries.addBlock("dense_grit_sand_block", ()->new StandardBlocks.BaseBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.DIRT, MaterialColor.DIRT).strength(0.1f, 3f).sound(SoundType.GRAVEL) + )); + Registries.addBlock("dense_grit_dirt_block", ()->new StandardBlocks.BaseBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.DIRT, MaterialColor.DIRT).strength(0.1f, 3f).sound(SoundType.GRAVEL) + )); + Registries.addBlock("dark_shingle_roof_slabslice", ()->new SlabSliceBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.STONE, MaterialColor.STONE).strength(0.5f, 6f).sound(SoundType.STONE) + )); + + // ------------------------------------------------------------------------------------------------------------------- + + Registries.addBlock("metal_rung_ladder", ()->new EdLadderBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion() + )); + Registries.addBlock("metal_rung_steps", ()->new EdLadderBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion() + )); + Registries.addBlock("treated_wood_ladder", ()->new EdLadderBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.3f, 8f).sound(SoundType.WOOD).noOcclusion() + )); + Registries.addBlock("iron_hatch", ()->new EdHatchBlock( + StandardBlocks.CFG_LOOK_PLACEMENT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 2000f).sound(SoundType.METAL).noOcclusion(), + Auxiliaries.getPixeledAABB(0.5,1,0, 15.5,3,14), + Auxiliaries.getPixeledAABB(0.5,1,0, 15.5,14.,2) + )); + Registries.addBlock("metal_sliding_door", ()->new StandardDoorBlock( + StandardBlocks.CFG_TRANSLUCENT|StandardBlocks.CFG_HORIZIONTAL, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 8f).sound(SoundType.METAL).noOcclusion(), + new AABB[]{ + Auxiliaries.getPixeledAABB(15, 0.0,6, 16,16.0,10), + Auxiliaries.getPixeledAABB( 0,15.5,6, 16,16.0,10), + }, + new AABB[]{ + Auxiliaries.getPixeledAABB(15, 0.0,6, 16,16.0,10), + Auxiliaries.getPixeledAABB( 0, 0.0,6, 16, 0.3,10), + }, + new AABB[]{ + Auxiliaries.getPixeledAABB( 0,0,7, 16,16,9) + }, + new AABB[]{ + Auxiliaries.getPixeledAABB( 0,0,7, 16,16,9) + }, + SoundEvents.IRON_DOOR_OPEN, SoundEvents.IRON_DOOR_CLOSE + )); + + // ------------------------------------------------------------------------------------------------------------------- + + Registries.addBlock("old_industrial_wood_planks", ()->new StandardBlocks.BaseBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 6f).sound(SoundType.WOOD) + )); + Registries.addBlock("old_industrial_wood_slab", ()->new VariantSlabBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 6f).sound(SoundType.WOOD) + )); + Registries.addBlock("old_industrial_wood_stairs", ()->new StandardStairsBlock( + StandardBlocks.CFG_DEFAULT, + ()->Registries.getBlock("old_industrial_wood_planks").defaultBlockState(), + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 6f).sound(SoundType.WOOD) + )); + Registries.addBlock("old_industrial_wood_slabslice", ()->new SlabSliceBlock( + StandardBlocks.CFG_CUTOUT, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 6f).sound(SoundType.WOOD).noOcclusion() + )); + Registries.addBlock("old_industrial_wood_door", ()->new StandardDoorBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 6f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(15,0, 0, 16,16,16), + Auxiliaries.getPixeledAABB( 0,0,13, 16,16,16), + SoundEvents.WOODEN_DOOR_OPEN, SoundEvents.WOODEN_DOOR_CLOSE + )); + + // ------------------------------------------------------------------------------------------------------------------- + + Registries.addBlock("treated_wood_table", ()->new StandardBlocks.WaterLoggable( + StandardBlocks.CFG_CUTOUT, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(1,0,1, 15,15.9,15) + )); + Registries.addBlock("treated_wood_stool", ()->new EdChair.ChairBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_LOOK_PLACEMENT, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(), + new AABB[]{ + Auxiliaries.getPixeledAABB(4,7,4, 12,8.8,12), + Auxiliaries.getPixeledAABB(7,0,7, 9,7,9), + Auxiliaries.getPixeledAABB(4,0,7, 12,1,9), + Auxiliaries.getPixeledAABB(7,0,4, 9,1,12), + } + )); + Registries.addBlock("treated_wood_windowsill", ()->new StandardBlocks.DirectedWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_AI_PASSABLE, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(0.5,15,10.5, 15.5,16,16) + )); + Registries.addBlock("treated_wood_broad_windowsill", ()->new StandardBlocks.DirectedWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_FACING_PLACEMENT, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(0,14.5,4, 16,16,16) + )); + + // ------------------------------------------------------------------------------------------------------------------- + + Registries.addBlock("iron_inset_light", ()->new StandardBlocks.DirectedWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_OPPOSITE_PLACEMENT|StandardBlocks.CFG_AI_PASSABLE, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 8f).sound(SoundType.METAL).lightLevel((state)->15).noOcclusion(), + Auxiliaries.getPixeledAABB(5.2,5.2,0, 10.8,10.8,0.3) + )); + Registries.addBlock("iron_floor_edge_light", ()->new StandardBlocks.DirectedWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_LOOK_PLACEMENT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_AI_PASSABLE, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 8f).sound(SoundType.METAL).lightLevel((state)->15).noOcclusion(), + Auxiliaries.getPixeledAABB(5,0,0, 11,2,0.5) + )); + Registries.addBlock("iron_ceiling_edge_light", ()->new StandardBlocks.DirectedWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_LOOK_PLACEMENT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_AI_PASSABLE, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 8f).sound(SoundType.METAL).lightLevel((state)->15).noOcclusion(), + new AABB[]{ + Auxiliaries.getPixeledAABB( 0,15.5,0, 16,16,2.0), + Auxiliaries.getPixeledAABB( 0,14.0,0, 16,16,0.5), + Auxiliaries.getPixeledAABB( 0,14.0,0, 1,16,2.0), + Auxiliaries.getPixeledAABB(15,14.0,0, 16,16,2.0), + } + )); + Registries.addBlock("iron_bulb_light", ()->new StandardBlocks.DirectedWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_OPPOSITE_PLACEMENT|StandardBlocks.CFG_AI_PASSABLE, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 8f).sound(SoundType.METAL).lightLevel((state)->15).noOcclusion(), + new AABB[]{ + Auxiliaries.getPixeledAABB(6.5,6.5,1, 9.5,9.5,4), + Auxiliaries.getPixeledAABB(6.0,6.0,0, 10.0,10.0,1.0) + } + )); + + // ------------------------------------------------------------------------------------------------------------------- + + Registries.addBlock("steel_table", ()->new StandardBlocks.WaterLoggable( + StandardBlocks.CFG_CUTOUT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 8f).sound(SoundType.METAL).noOcclusion(), + Auxiliaries.getPixeledAABB(0,0,0, 16,16,16) + )); + Registries.addBlock("steel_floor_grating", ()->new EdFloorGratingBlock( + StandardBlocks.CFG_CUTOUT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 8f).sound(SoundType.METAL).noOcclusion(), + Auxiliaries.getPixeledAABB(0,14,0, 16,15.5,16) + )); + + // ------------------------------------------------------------------------------------------------------------------- + + Registries.addBlock("treated_wood_window", ()->new EdWindowBlock( + StandardBlocks.CFG_LOOK_PLACEMENT, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 8f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(0,0,7, 16,16,9) + )); + Registries.addBlock("steel_framed_window", ()->new EdWindowBlock( + StandardBlocks.CFG_LOOK_PLACEMENT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 8f).sound(SoundType.METAL).noOcclusion(), + Auxiliaries.getPixeledAABB(0,0,7.5, 16,16,8.5) + )); + + // ------------------------------------------------------------------------------------------------------------------- + + Registries.addBlock("treated_wood_pole", ()->new EdStraightPoleBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_FLIP_PLACEMENT_IF_SAME, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(5.8,5.8,0, 10.2,10.2,16), + null + )); + Registries.addBlock("treated_wood_pole_head", ()->new EdStraightPoleBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_FLIP_PLACEMENT_IF_SAME, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(5.8,5.8,0, 10.2,10.2,16), + (EdStraightPoleBlock)Registries.getBlock("treated_wood_pole") // TREATED_WOOD_POLE + )); + Registries.addBlock("treated_wood_pole_support", ()->new EdStraightPoleBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_FLIP_PLACEMENT_IF_SAME, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.5f, 5f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(5.8,5.8,0, 10.2,10.2,16), + (EdStraightPoleBlock)Registries.getBlock("treated_wood_pole") // TREATED_WOOD_POLE + )); + Registries.addBlock("thin_steel_pole", ()->new EdStraightPoleBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 11f).sound(SoundType.METAL).noOcclusion(), + Auxiliaries.getPixeledAABB(6,6,0, 10,10,16), + null + )); + Registries.addBlock("thin_steel_pole_head", ()->new EdStraightPoleBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_FLIP_PLACEMENT_IF_SAME, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 11f).sound(SoundType.METAL).noOcclusion(), + Auxiliaries.getPixeledAABB(6,6,0, 10,10,16), + (EdStraightPoleBlock)Registries.getBlock("thin_steel_pole") // THIN_STEEL_POLE + )); + Registries.addBlock("thick_steel_pole", ()->new EdStraightPoleBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 11f).sound(SoundType.METAL).noOcclusion(), + Auxiliaries.getPixeledAABB(5,5,0, 11,11,16), + null + )); + Registries.addBlock("thick_steel_pole_head", ()->new EdStraightPoleBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_FLIP_PLACEMENT_IF_SAME, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 11f).sound(SoundType.METAL).noOcclusion(), + Auxiliaries.getPixeledAABB(5,5,0, 11,11,16), + (EdStraightPoleBlock)Registries.getBlock("thin_steel_pole") + )); + Registries.addBlock("steel_double_t_support", ()->new EdHorizontalSupportBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_LOOK_PLACEMENT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.5f, 11f).sound(SoundType.METAL).noOcclusion(), + Auxiliaries.getPixeledAABB( 5,11,0, 11,16,16), // main beam + Auxiliaries.getPixeledAABB(10,11,5, 16,16,11), // east beam (also for west 180deg) + Auxiliaries.getPixeledAABB( 6, 0,6, 10,16,10), // down thin + Auxiliaries.getPixeledAABB( 5, 0,5, 11,16,11) // down thick + )); + + // ------------------------------------------------------------------------------------------------------------------- + + Registries.addBlock("steel_mesh_fence", ()->new EdFenceBlock( + StandardBlocks.CFG_CUTOUT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), + 1.5, 16, 0.25, 0, 16, 16 + )); + Registries.addBlock("steel_mesh_fence_gate", ()->new EdDoubleGateBlock( + StandardBlocks.CFG_CUTOUT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), + Auxiliaries.getPixeledAABB(0,0,6.5, 16,16,9.5) + )); + Registries.addBlock("steel_railing", ()->new EdRailingBlock( + StandardBlocks.CFG_CUTOUT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), + Auxiliaries.getPixeledAABB(0,0,0, 0, 0,0), + Auxiliaries.getPixeledAABB(0,0,0, 16,15.9,1) + )); + Registries.addBlock("steel_catwalk", ()->new EdCatwalkBlock( + StandardBlocks.CFG_CUTOUT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), + Auxiliaries.getPixeledAABB(0,0,0, 16, 2,16), + Auxiliaries.getPixeledAABB(0,0,0, 16,15.9, 1), + Registries.getBlock("steel_railing") + )); + Registries.addBlock("steel_catwalk_ta", ()->new EdCatwalkTopAlignedBlock( + StandardBlocks.CFG_CUTOUT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), + new VoxelShape[]{ + Shapes.create(Auxiliaries.getPixeledAABB(0,14,0, 16, 16,16)), // only base + Auxiliaries.getUnionShape( // base with thick pole + Auxiliaries.getPixeledAABB(0,14,0, 16, 16,16), + Auxiliaries.getPixeledAABB(5, 0,5, 11,15, 11) + ), + Auxiliaries.getUnionShape( // base with thin pole + Auxiliaries.getPixeledAABB(0,14,0, 16, 16,16), + Auxiliaries.getPixeledAABB(6, 0,6, 10,15, 10) + ), + Auxiliaries.getUnionShape( // structure frame-like + Auxiliaries.getPixeledAABB( 0, 0, 0, 16, 2,16), + Auxiliaries.getPixeledAABB( 0,14, 0, 16, 16,16), + Auxiliaries.getPixeledAABB( 0, 0, 0, 1, 16, 1), + Auxiliaries.getPixeledAABB(15, 0, 0, 16, 16, 1), + Auxiliaries.getPixeledAABB(15, 0,15, 16, 16,16), + Auxiliaries.getPixeledAABB( 0, 0,15, 1, 16,16) + ) + } + )); + Registries.addBlock("steel_catwalk_stairs", ()->new EdCatwalkStairsBlock( + StandardBlocks.CFG_CUTOUT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), + new AABB[] { // base + Auxiliaries.getPixeledAABB( 1, 2, 8, 15, 4, 16), + Auxiliaries.getPixeledAABB( 1,10, 0, 15, 12, 8), + }, + new AABB[] { // railing left + Auxiliaries.getPixeledAABB(0.4, 0, 15, 0.6, 15, 16), + Auxiliaries.getPixeledAABB(0.4, 1, 14, 0.6, 16, 15), + Auxiliaries.getPixeledAABB(0.4, 2, 13, 0.6, 17, 14), + Auxiliaries.getPixeledAABB(0.4, 3, 12, 0.6, 18, 13), + Auxiliaries.getPixeledAABB(0.4, 4, 11, 0.6, 19, 12), + Auxiliaries.getPixeledAABB(0.4, 5, 10, 0.6, 20, 11), + Auxiliaries.getPixeledAABB(0.4, 6, 9, 0.6, 21, 10), + Auxiliaries.getPixeledAABB(0.4, 7, 8, 0.6, 22, 9), + Auxiliaries.getPixeledAABB(0.4, 8, 7, 0.6, 23, 8), + Auxiliaries.getPixeledAABB(0.4, 9, 6, 0.6, 24, 7), + Auxiliaries.getPixeledAABB(0.4, 10, 5, 0.6, 25, 6), + Auxiliaries.getPixeledAABB(0.4, 11, 4, 0.6, 26, 5), + Auxiliaries.getPixeledAABB(0.4, 12, 3, 0.6, 27, 4), + Auxiliaries.getPixeledAABB(0.4, 13, 2, 0.6, 28, 3), + Auxiliaries.getPixeledAABB(0.4, 14, 1, 0.6, 29, 2), + Auxiliaries.getPixeledAABB(0.4, 15, 0, 0.6, 30, 1) + } + )); + + // ------------------------------------------------------------------------------------------------------------------- + + Registries.addBlock("sign_decor", ()->new StandardBlocks.DirectedWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_AI_PASSABLE, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.3f, 1000f).sound(SoundType.WOOD).lightLevel((state)->1).noOcclusion(), + Auxiliaries.getPixeledAABB(0,0,15.6, 16,16,16.0) + )); + Registries.addBlock("sign_hotwire", ()->new StandardBlocks.DirectedWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_AI_PASSABLE, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) + )); + Registries.addBlock("sign_danger", ()->new StandardBlocks.DirectedWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_AI_PASSABLE, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) + )); + Registries.addBlock("sign_radioactive", ()->new StandardBlocks.DirectedWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_AI_PASSABLE, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) + )); + Registries.addBlock("sign_laser", ()->new StandardBlocks.DirectedWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_AI_PASSABLE, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) + )); + Registries.addBlock("sign_caution", ()->new StandardBlocks.DirectedWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_AI_PASSABLE, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) + )); + Registries.addBlock("sign_magichazard", ()->new StandardBlocks.DirectedWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_AI_PASSABLE, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) + )); + Registries.addBlock("sign_firehazard", ()->new StandardBlocks.DirectedWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_AI_PASSABLE, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) + )); + Registries.addBlock("sign_hotsurface", ()->new StandardBlocks.DirectedWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_AI_PASSABLE, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) + )); + Registries.addBlock("sign_magneticfield", ()->new StandardBlocks.DirectedWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_AI_PASSABLE, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) + )); + Registries.addBlock("sign_frost", ()->new StandardBlocks.DirectedWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_AI_PASSABLE, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) + )); + Registries.addBlock("sign_exit", ()->new StandardBlocks.DirectedWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_AI_PASSABLE, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(3,7,15.6, 13,13,16) + )); + Registries.addBlock("sign_defense", ()->new StandardBlocks.DirectedWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_AI_PASSABLE, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) + )); + Registries.addBlock("sign_factoryarea", ()->new StandardBlocks.DirectedWaterLoggable( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_AI_PASSABLE, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.2f, 1f).sound(SoundType.WOOD).noOcclusion(), + Auxiliaries.getPixeledAABB(2,2,15.6, 14,14,16) + )); + + // ------------------------------------------------------------------------------------------------------------------- + + Registries.addBlock("labeled_crate", + ()->new EdLabeledCrate.LabeledCrateBlock( + StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_LOOK_PLACEMENT|StandardBlocks.CFG_OPPOSITE_PLACEMENT, + BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.3f, 32f).sound(SoundType.METAL).noOcclusion(), + Auxiliaries.getPixeledAABB(0,0,0, 16,16,16) + ), + EdLabeledCrate.LabeledCrateTileEntity::new, + EdLabeledCrate.LabeledCrateContainer::new + ); + Registries.addBlock("metal_crafting_table", + ()->new EdCraftingTable.CraftingTableBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_LOOK_PLACEMENT|StandardBlocks.CFG_OPPOSITE_PLACEMENT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(), + new AABB[]{ + Auxiliaries.getPixeledAABB(0,15,0, 16,16,16), + Auxiliaries.getPixeledAABB(1, 0,1, 15,16,15) + } + ), + EdCraftingTable.CraftingTableTileEntity::new, + EdCraftingTable.CraftingTableUiContainer::new + //MenuScreens.register(CT_TREATED_WOOD_CRAFTING_TABLE, EdCraftingTable.CraftingTableGui::new); + ); + + Registries.addBlock("small_lab_furnace", + ()->new EdFurnace.FurnaceBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_LOOK_PLACEMENT|StandardBlocks.CFG_OPPOSITE_PLACEMENT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(), + new AABB[]{ + Auxiliaries.getPixeledAABB(1,0,1, 15, 1,15), + Auxiliaries.getPixeledAABB(0,1,1, 16,16,16), + } + ), + EdFurnace.FurnaceTileEntity::new, + EdFurnace.FurnaceContainer::new + ); + Registries.addBlock("small_electrical_furnace", + ()->new EdElectricalFurnace.ElectricalFurnaceBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_LOOK_PLACEMENT|StandardBlocks.CFG_OPPOSITE_PLACEMENT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(), + new AABB[]{ + Auxiliaries.getPixeledAABB(0, 0,0, 16,11,16), + Auxiliaries.getPixeledAABB(1,11,0, 15,12,16), + Auxiliaries.getPixeledAABB(2,12,0, 14,13,16), + Auxiliaries.getPixeledAABB(3,13,0, 13,14,16), + Auxiliaries.getPixeledAABB(4,14,0, 12,16,16), + } + ), + EdElectricalFurnace.ElectricalFurnaceTileEntity::new, + EdElectricalFurnace.ElectricalFurnaceContainer::new + ); + Registries.addBlock("factory_dropper", + ()->new EdDropper.DropperBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_LOOK_PLACEMENT|StandardBlocks.CFG_OPPOSITE_PLACEMENT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(), + Auxiliaries.getPixeledAABB(0,0,1, 16,16,16) + ), + EdDropper.DropperTileEntity::new, + EdDropper.DropperUiContainer::new + ); + Registries.addBlock("factory_placer", + ()->new EdPlacer.PlacerBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_LOOK_PLACEMENT|StandardBlocks.CFG_FLIP_PLACEMENT_SHIFTCLICK|StandardBlocks.CFG_OPPOSITE_PLACEMENT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(), + new AABB[]{ + Auxiliaries.getPixeledAABB(0,0,2, 16,16,16), + Auxiliaries.getPixeledAABB( 0,0,0, 1,16, 2), + Auxiliaries.getPixeledAABB(15,0,0,16,16, 2) + } + ), + EdPlacer.PlacerTileEntity::new, + EdPlacer.PlacerContainer::new + ); + Registries.addBlock("small_block_breaker", + ()->new EdBreaker.BreakerBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_LOOK_PLACEMENT|StandardBlocks.CFG_OPPOSITE_PLACEMENT|StandardBlocks.CFG_FLIP_PLACEMENT_SHIFTCLICK, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(), + new AABB[]{ + Auxiliaries.getPixeledAABB(1,0,0, 15, 4, 7), + Auxiliaries.getPixeledAABB(1,0,7, 15,12,16), + Auxiliaries.getPixeledAABB(0,0,0, 1, 5, 4), + Auxiliaries.getPixeledAABB(0,0,4, 1,12,16), + Auxiliaries.getPixeledAABB(15,0,0, 16, 5, 4), + Auxiliaries.getPixeledAABB(15,0,4, 16,12,16) + } + ), + EdBreaker.BreakerTileEntity::new + ); + Registries.addBlock("factory_hopper", + ()->new EdHopper.HopperBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_OPPOSITE_PLACEMENT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(),()->{ + final AABB[] down_aabbs = new AABB[]{ + Auxiliaries.getPixeledAABB( 5, 0, 5, 11, 1,11), + Auxiliaries.getPixeledAABB( 4, 1, 4, 12, 7,12), + Auxiliaries.getPixeledAABB( 2, 7, 2, 14,10,14), + Auxiliaries.getPixeledAABB( 0,10, 0, 16,16,16), + Auxiliaries.getPixeledAABB( 0, 4, 5, 2,10,11), + Auxiliaries.getPixeledAABB(14, 4, 5, 16,10,11), + Auxiliaries.getPixeledAABB( 5, 4, 0, 11,10, 2), + Auxiliaries.getPixeledAABB( 5, 4,14, 11,10,16), + }; + final AABB[] up_aabbs = new AABB[]{ + Auxiliaries.getPixeledAABB( 5,15, 5, 11,16,11), + Auxiliaries.getPixeledAABB( 4,14, 4, 12, 9,12), + Auxiliaries.getPixeledAABB( 2, 9, 2, 14, 6,14), + Auxiliaries.getPixeledAABB( 0, 6, 0, 16, 0,16), + Auxiliaries.getPixeledAABB( 0,12, 5, 2, 6,11), + Auxiliaries.getPixeledAABB(14,12, 5, 16, 6,11), + Auxiliaries.getPixeledAABB( 5,12, 0, 11, 6, 2), + Auxiliaries.getPixeledAABB( 5,12,14, 11, 6,16), + }; + final AABB[] north_aabbs = new AABB[]{ + Auxiliaries.getPixeledAABB( 5, 0, 5, 11, 1,11), + Auxiliaries.getPixeledAABB( 4, 1, 4, 12, 7,12), + Auxiliaries.getPixeledAABB( 2, 7, 2, 14,10,14), + Auxiliaries.getPixeledAABB( 0,10, 0, 16,16,16), + Auxiliaries.getPixeledAABB( 0, 4, 5, 2,10,11), + Auxiliaries.getPixeledAABB(14, 4, 5, 16,10,11), + Auxiliaries.getPixeledAABB( 5, 1, 0, 11, 7, 4), + Auxiliaries.getPixeledAABB( 5, 4,14, 11,10,16), + }; + return new ArrayList<>(Arrays.asList( + Auxiliaries.getUnionShape(down_aabbs), + Auxiliaries.getUnionShape(up_aabbs), + Auxiliaries.getUnionShape(Auxiliaries.getRotatedAABB(north_aabbs, Direction.NORTH, false)), + Auxiliaries.getUnionShape(Auxiliaries.getRotatedAABB(north_aabbs, Direction.SOUTH, false)), + Auxiliaries.getUnionShape(Auxiliaries.getRotatedAABB(north_aabbs, Direction.WEST, false)), + Auxiliaries.getUnionShape(Auxiliaries.getRotatedAABB(north_aabbs, Direction.EAST, false)), + Shapes.block(), + Shapes.block() + )); + } + ), + EdHopper.HopperTileEntity::new, + EdHopper.HopperContainer::new + ); + Registries.addBlock("small_waste_incinerator", + ()->new EdWasteIncinerator.WasteIncineratorBlock( + StandardBlocks.CFG_DEFAULT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 12f).sound(SoundType.METAL), + Auxiliaries.getPixeledAABB(0,0,0, 16,16,16) + ), + EdWasteIncinerator.WasteIncineratorTileEntity::new, + EdWasteIncinerator.WasteIncineratorContainer::new + ); + Registries.addBlock("small_mineral_smelter", + ()->new EdMineralSmelter.MineralSmelterBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_LOOK_PLACEMENT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(), + Auxiliaries.getPixeledAABB(1.1,0,1.1, 14.9,16,14.9) + ), + EdMineralSmelter.MineralSmelterTileEntity::new + ); + Registries.addBlock("small_freezer", + ()->new EdFreezer.FreezerBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_LOOK_PLACEMENT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 12f).sound(SoundType.METAL).noOcclusion(), + Auxiliaries.getPixeledAABB(1.1,0,1.1, 14.9,16,14.9) + ), + EdFreezer.FreezerTileEntity::new + ); + Registries.addBlock("small_solar_panel", + ()->new EdSolarPanel.SolarPanelBlock( + StandardBlocks.CFG_CUTOUT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), + new AABB[]{ + Auxiliaries.getPixeledAABB(0,0,0, 16,2,16), + Auxiliaries.getPixeledAABB(6,1.5,3, 10,10.5,13), + } + ), + EdSolarPanel.SolarPanelTileEntity::new + ); + Registries.addBlock("small_milking_machine", + ()->new EdMilker.MilkerBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_LOOK_PLACEMENT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), + new AABB[]{ + Auxiliaries.getPixeledAABB( 1, 1,0, 15,14,10), + Auxiliaries.getPixeledAABB( 0,14,0, 16,16,13), + Auxiliaries.getPixeledAABB( 0, 0,0, 16, 1,13), + Auxiliaries.getPixeledAABB( 0, 1,1, 1,14,11), + Auxiliaries.getPixeledAABB(15, 1,1, 16,14,11) + } + ), + EdMilker.MilkerTileEntity::new + ); + Registries.addBlock("small_tree_cutter", + ()->new EdTreeCutter.TreeCutterBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_HORIZIONTAL|StandardBlocks.CFG_LOOK_PLACEMENT|StandardBlocks.CFG_FLIP_PLACEMENT_SHIFTCLICK, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), + new AABB[]{ + Auxiliaries.getPixeledAABB( 0,0, 0, 16,3,16), + Auxiliaries.getPixeledAABB( 0,3, 0, 3,8,16), + Auxiliaries.getPixeledAABB( 3,7, 0, 5,8,16), + Auxiliaries.getPixeledAABB(15,0, 0, 16,6,16), + Auxiliaries.getPixeledAABB( 0,0,13, 16,8,16), + Auxiliaries.getPixeledAABB( 5,6,12, 16,8,13), + } + ), + EdTreeCutter.TreeCutterTileEntity::new + ); + Registries.addBlock("straight_pipe_valve", ()->new EdPipeValve.PipeValveBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_OPPOSITE_PLACEMENT|StandardBlocks.CFG_FLIP_PLACEMENT_SHIFTCLICK, + EdPipeValve.CFG_CHECK_VALVE, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion(), + new AABB[]{ + Auxiliaries.getPixeledAABB(2,2, 0, 14,14, 2), + Auxiliaries.getPixeledAABB(2,2,14, 14,14,16), + Auxiliaries.getPixeledAABB(3,3, 5, 13,13,11), + Auxiliaries.getPixeledAABB(4,4, 2, 12,12,14), + } + )); + Registries.addBlock("straight_pipe_valve_redstone", ()->new EdPipeValve.PipeValveBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_OPPOSITE_PLACEMENT, + EdPipeValve.CFG_REDSTONE_CONTROLLED_VALVE, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion(), + new AABB[]{ + Auxiliaries.getPixeledAABB(2,2, 0, 14,14, 2), + Auxiliaries.getPixeledAABB(2,2,14, 14,14,16), + Auxiliaries.getPixeledAABB(3,3, 5, 13,13,11), + Auxiliaries.getPixeledAABB(4,4, 2, 12,12,14), + } + )); + Registries.addBlock("straight_pipe_valve_redstone_analog", + ()->new EdPipeValve.PipeValveBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_FACING_PLACEMENT|StandardBlocks.CFG_OPPOSITE_PLACEMENT, + EdPipeValve.CFG_REDSTONE_CONTROLLED_VALVE|EdPipeValve.CFG_ANALOG_VALVE, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion(), + new AABB[]{ + Auxiliaries.getPixeledAABB(2,2, 0, 14,14, 2), + Auxiliaries.getPixeledAABB(2,2,14, 14,14,16), + Auxiliaries.getPixeledAABB(3,3, 5, 13,13,11), + Auxiliaries.getPixeledAABB(4,4, 2, 12,12,14), + } + ) + ); + Registries.addBlockEntityType("tet_straight_pipe_valve", + EdPipeValve.PipeValveTileEntity::new, + "straight_pipe_valve", "straight_pipe_valve_redstone", "straight_pipe_valve_redstone_analog" + ); + Registries.addBlock("fluid_barrel", + ()->new EdFluidBarrel.FluidBarrelBlock( + StandardBlocks.CFG_CUTOUT|StandardBlocks.CFG_LOOK_PLACEMENT|StandardBlocks.CFG_OPPOSITE_PLACEMENT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), + new AABB[]{ + Auxiliaries.getPixeledAABB(2, 0,0, 14, 1,16), + Auxiliaries.getPixeledAABB(1, 1,0, 15, 2,16), + Auxiliaries.getPixeledAABB(0, 2,0, 16,14,16), + Auxiliaries.getPixeledAABB(1,14,0, 15,15,16), + Auxiliaries.getPixeledAABB(2,15,0, 14,16,16), + } + ), + EdFluidBarrel.FluidBarrelTileEntity::new + ); + Registries.addBlock("small_fluid_funnel", + ()->new EdFluidFunnel.FluidFunnelBlock( + StandardBlocks.CFG_CUTOUT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), + new AABB[]{ + Auxiliaries.getPixeledAABB(0, 0,0, 16,14,16), + Auxiliaries.getPixeledAABB(1,14,1, 15,15,15), + Auxiliaries.getPixeledAABB(0,15,0, 16,16,16) + } + ), + EdFluidFunnel.FluidFunnelTileEntity::new + ); + + // ------------------------------------------------------------------------------------------------------------------- + + if(Auxiliaries.isModLoaded("immersiveengineeringharddependent")) { + //Registries.addBlock("halfslab_treated_wood", ()->new SlabSliceBlock( + // StandardBlocks.CFG_CUTOUT|DecorBlock.CFG_HARD_IE_DEPENDENT, + // BlockBehaviour.Properties.of(Material.WOOD, MaterialColor.WOOD).strength(0.3f, 4f).sound(SoundType.WOOD).noOcclusion() + //)); + //Registries.addBlock("halfslab_sheetmetal_iron", ()->new SlabSliceBlock( + // StandardBlocks.CFG_CUTOUT|DecorBlock.CFG_HARD_IE_DEPENDENT, + // BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion() + //)); + //Registries.addBlock("halfslab_sheetmetal_steel", ()->new SlabSliceBlock( + // StandardBlocks.CFG_CUTOUT|DecorBlock.CFG_HARD_IE_DEPENDENT, + // BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion() + //)); + //Registries.addBlock("halfslab_sheetmetal_copper", ()->new SlabSliceBlock( + // StandardBlocks.CFG_CUTOUT|DecorBlock.CFG_HARD_IE_DEPENDENT, + // BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion() + //)); + //Registries.addBlock("halfslab_sheetmetal_gold", ()->new SlabSliceBlock( + // StandardBlocks.CFG_CUTOUT|DecorBlock.CFG_HARD_IE_DEPENDENT, + // BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion() + //)); + //Registries.addBlock("halfslab_sheetmetal_aluminum", ()->new SlabSliceBlock( + // StandardBlocks.CFG_CUTOUT|DecorBlock.CFG_HARD_IE_DEPENDENT, + // BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 8f).sound(SoundType.METAL).noOcclusion() + //)); } - )).setRegistryName(new ResourceLocation(MODID, "steel_catwalk_ta")); - public static final EdCatwalkStairsBlock STEEL_CATWALK_STAIRS = (EdCatwalkStairsBlock)(new EdCatwalkStairsBlock( - DecorBlock.CFG_CUTOUT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0.3f, 10f).sound(SoundType.METAL).noOcclusion(), - new AABB[] { // base - Auxiliaries.getPixeledAABB( 1, 2, 8, 15, 4, 16), - Auxiliaries.getPixeledAABB( 1,10, 0, 15, 12, 8), - }, - new AABB[] { // railing left - Auxiliaries.getPixeledAABB(0.4, 0, 15, 0.6, 15, 16), - Auxiliaries.getPixeledAABB(0.4, 1, 14, 0.6, 16, 15), - Auxiliaries.getPixeledAABB(0.4, 2, 13, 0.6, 17, 14), - Auxiliaries.getPixeledAABB(0.4, 3, 12, 0.6, 18, 13), - Auxiliaries.getPixeledAABB(0.4, 4, 11, 0.6, 19, 12), - Auxiliaries.getPixeledAABB(0.4, 5, 10, 0.6, 20, 11), - Auxiliaries.getPixeledAABB(0.4, 6, 9, 0.6, 21, 10), - Auxiliaries.getPixeledAABB(0.4, 7, 8, 0.6, 22, 9), - Auxiliaries.getPixeledAABB(0.4, 8, 7, 0.6, 23, 8), - Auxiliaries.getPixeledAABB(0.4, 9, 6, 0.6, 24, 7), - Auxiliaries.getPixeledAABB(0.4, 10, 5, 0.6, 25, 6), - Auxiliaries.getPixeledAABB(0.4, 11, 4, 0.6, 26, 5), - Auxiliaries.getPixeledAABB(0.4, 12, 3, 0.6, 27, 4), - Auxiliaries.getPixeledAABB(0.4, 13, 2, 0.6, 28, 3), - Auxiliaries.getPixeledAABB(0.4, 14, 1, 0.6, 29, 2), - Auxiliaries.getPixeledAABB(0.4, 15, 0, 0.6, 30, 1) - } - )).setRegistryName(new ResourceLocation(MODID, "steel_catwalk_stairs")); + // ------------------------------------------------------------------------------------------------------------------- - // ------------------------------------------------------------------------------------------------------------------- + Registries.addBlock("test_block", + ()->new EdTestBlock.TestBlock( + StandardBlocks.CFG_LOOK_PLACEMENT, + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0f, 32000f).sound(SoundType.METAL), + Auxiliaries.getPixeledAABB(0,0,0, 16,16,16) + ), + EdTestBlock.TestTileEntity::new + ); - public static final EdTestBlock.TestBlock TEST_BLOCK = (EdTestBlock.TestBlock)(new EdTestBlock.TestBlock( - DecorBlock.CFG_LOOK_PLACEMENT, - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.METAL).strength(0f, 32000f).sound(SoundType.METAL), - Auxiliaries.getPixeledAABB(0,0,0, 16,16,16) - )).setRegistryName(new ResourceLocation(MODID, "test_block")); - - // ------------------------------------------------------------------------------------------------------------------- - - private static final Block[] modBlocks = { - CRAFTING_TABLE, - LABELED_CRATE, - SMALL_LAB_FURNACE, - SMALL_ELECTRICAL_FURNACE, - FACTORY_HOPPER, - FACTORY_DROPPER, - FACTORY_PLACER, - SMALL_BLOCK_BREAKER, - SMALL_TREE_CUTTER, - SMALL_SOLAR_PANEL, - SMALL_WASTE_INCINERATOR, -//>>>> untested - SMALL_MINERAL_SMELTER, - SMALL_FREEZER, - SMALL_MILKING_MACHINE, -//<<<< /untested - FLUID_BARREL, - STRAIGHT_CHECK_VALVE, - STRAIGHT_REDSTONE_VALVE, - STRAIGHT_REDSTONE_ANALOG_VALVE, - SMALL_FLUID_FUNNEL, - DENSE_GRIT_SAND, - DENSE_GRIT_DIRT, - CLINKER_BRICK_BLOCK, - CLINKER_BRICK_SLAB, - CLINKER_BRICK_STAIRS, - CLINKER_BRICK_WALL, - CLINKER_BRICK_SASTOR_CORNER, - CLINKER_BRICK_STAINED_BLOCK, - CLINKER_BRICK_STAINED_SLAB, - CLINKER_BRICK_STAINED_STAIRS, - CLINKER_BRICK_SASTOR_VERTICAL_SLOTTED, - CLINKER_BRICK_RECESSED, - CLINKER_BRICK_VERTICAL_SLAB_STRUCTURED, - SLAG_BRICK_BLOCK, - SLAG_BRICK_SLAB, - SLAG_BRICK_STAIRS, - SLAG_BRICK_WALL, - REBAR_CONCRETE_BLOCK, - REBAR_CONCRETE_SLAB, - REBAR_CONCRETE_STAIRS, - REBAR_CONCRETE_WALL, - REBAR_CONCRETE_TILE, - REBAR_CONCRETE_TILE_SLAB, - REBAR_CONCRETE_TILE_STAIRS, - HALFSLAB_REBARCONCRETE, - HALFSLAB_TREATEDWOOD, - HALFSLAB_SHEETMETALIRON, - HALFSLAB_SHEETMETALSTEEL, - HALFSLAB_SHEETMETALCOPPER, - HALFSLAB_SHEETMETALGOLD, - HALFSLAB_SHEETMETALALUMINIUM, - PANZERGLASS_BLOCK, - PANZERGLASS_SLAB, - DARK_CERAMIC_SHINGLE_ROOF, - DARK_CERAMIC_SHINGLE_ROOF_METALIZED, - DARK_CERAMIC_SHINGLE_ROOF_SKYLIGHT, - DARK_CERAMIC_SHINGLE_ROOF_CHIMNEYTRUNK, - DARK_CERAMIC_SHINGLE_ROOF_WIRECONDUIT, - DARK_CERAMIC_SHINGLE_ROOF_BLOCK, - DARK_CERAMIC_SHINGLE_ROOF_SLAB, - HALFSLAB_DARK_CERAMIC_SHINGLE_ROOF, - DARK_CERAMIC_SHINGLE_ROOF_CHIMNEY, - METAL_RUNG_LADDER, - METAL_RUNG_STEPS, - TREATED_WOOD_LADDER, - METAL_SLIDING_DOOR, - IRON_HATCH, - OLD_INDUSTRIAL_PLANKS, - OLD_INDUSTRIAL_SLAB, - OLD_INDUSTRIAL_STAIRS, - OLD_INDUSTRIAL_SLABSLICE, - OLD_INDUSTRIAL_WOOD_DOOR, - TREATED_WOOD_TABLE, - TREATED_WOOD_STOOL, - TREATED_WOOD_WINDOWSILL, - TREATED_WOOD_BROAD_WINDOWSILL, - TREATED_WOOD_WINDOW, - STEEL_FRAMED_WINDOW, - STEEL_TABLE, - INSET_LIGHT_IRON, - FLOOR_EDGE_LIGHT_IRON, - CEILING_EDGE_LIGHT_IRON, - BULB_LIGHT_IRON, - STEEL_FLOOR_GRATING, - STEEL_MESH_FENCE, - STEEL_MESH_FENCE_GATE, - STEEL_CATWALK, - STEEL_RAILING, - STEEL_CATWALK_TOP_ALIGNED, - STEEL_CATWALK_STAIRS, - TREATED_WOOD_POLE, - TREATED_WOOD_POLE_HEAD, - TREATED_WOOD_POLE_SUPPORT, - THIN_STEEL_POLE, - THIN_STEEL_POLE_HEAD, - THICK_STEEL_POLE, - THICK_STEEL_POLE_HEAD, - STEEL_DOUBLE_T_SUPPORT, - SIGN_HOTWIRE, - SIGN_DANGER, - SIGN_DEFENSE, - SIGN_FACTORY_AREA, - SIGN_EXIT, - SIGN_RADIOACTIVE, - SIGN_LASER, - SIGN_CAUTION, - SIGN_MAGIC_HAZARD, - SIGN_FIRE_HAZARD, - SIGN_HOT_SURFACE, - SIGN_MAGNETIC_FIELD, - SIGN_FROST_WARNING, - SIGN_MODLOGO, - }; - - private static final Block[] devBlocks = { - TEST_BLOCK - }; - - //-------------------------------------------------------------------------------------------------------------------- - // Tile entities bound exclusively to the blocks above - //-------------------------------------------------------------------------------------------------------------------- - - public static final BlockEntityType TET_CRAFTING_TABLE = ModRegistry.register("te_treated_wood_crafting_table", EdCraftingTable.CraftingTableTileEntity::new, CRAFTING_TABLE); - public static final BlockEntityType TET_LABELED_CRATE = ModRegistry.register("te_labeled_crate", EdLabeledCrate.LabeledCrateTileEntity::new, LABELED_CRATE); - public static final BlockEntityType TET_SMALL_LAB_FURNACE = ModRegistry.register("te_small_lab_furnace", EdFurnace.FurnaceTileEntity::new, SMALL_LAB_FURNACE); - public static final BlockEntityType TET_SMALL_ELECTRICAL_FURNACE = ModRegistry.register("te_small_electrical_furnace", EdElectricalFurnace.ElectricalFurnaceTileEntity::new, SMALL_ELECTRICAL_FURNACE); - public static final BlockEntityType TET_FACTORY_DROPPER = ModRegistry.register("te_factory_dropper", EdDropper.DropperTileEntity::new, FACTORY_DROPPER); - public static final BlockEntityType TET_FACTORY_PLACER = ModRegistry.register("te_factory_placer", EdPlacer.PlacerTileEntity::new, FACTORY_PLACER); - public static final BlockEntityType TET_SMALL_BLOCK_BREAKER = ModRegistry.register("te_small_block_breaker", EdBreaker.BreakerTileEntity::new, SMALL_BLOCK_BREAKER); - public static final BlockEntityType TET_FACTORY_HOPPER = ModRegistry.register("te_factory_hopper", EdHopper.HopperTileEntity::new, FACTORY_HOPPER); - public static final BlockEntityType TET_WASTE_INCINERATOR = ModRegistry.register("te_small_waste_incinerator", EdWasteIncinerator.WasteIncineratorTileEntity::new, SMALL_WASTE_INCINERATOR); - public static final BlockEntityType TET_STRAIGHT_PIPE_VALVE = ModRegistry.register("te_pipe_valve", EdPipeValve.PipeValveTileEntity::new, STRAIGHT_CHECK_VALVE, STRAIGHT_REDSTONE_VALVE, STRAIGHT_REDSTONE_ANALOG_VALVE); - public static final BlockEntityType TET_FLUID_BARREL = ModRegistry.register("te_fluid_barrel", EdFluidBarrel.FluidBarrelTileEntity::new, FLUID_BARREL); - public static final BlockEntityType TET_SMALL_FLUID_FUNNEL = ModRegistry.register("te_small_fluid_funnel", EdFluidFunnel.FluidFunnelTileEntity::new, SMALL_FLUID_FUNNEL); - public static final BlockEntityType TET_MINERAL_SMELTER = ModRegistry.register("te_small_mineral_smelter", EdMineralSmelter.MineralSmelterTileEntity::new, SMALL_MINERAL_SMELTER); - public static final BlockEntityType TET_FREEZER = ModRegistry.register("te_small_freezer", EdFreezer.FreezerTileEntity::new, SMALL_FREEZER); - public static final BlockEntityType TET_SMALL_SOLAR_PANEL = ModRegistry.register("te_small_solar_panel", EdSolarPanel.SolarPanelTileEntity::new, SMALL_SOLAR_PANEL); - public static final BlockEntityType TET_SMALL_MILKING_MACHINE = ModRegistry.register("te_small_milking_machine", EdMilker.MilkerTileEntity::new, SMALL_MILKING_MACHINE); - public static final BlockEntityType TET_SMALL_TREE_CUTTER = ModRegistry.register("te_small_tree_cutter", EdTreeCutter.TreeCutterTileEntity::new, SMALL_TREE_CUTTER); - public static final BlockEntityType TET_TEST_BLOCK = ModRegistry.register("te_test_block", EdTestBlock.TestTileEntity::new, TEST_BLOCK); - - private static final BlockEntityType[] tile_entity_types = { - TET_CRAFTING_TABLE, - TET_LABELED_CRATE, - TET_SMALL_LAB_FURNACE, - TET_SMALL_ELECTRICAL_FURNACE, - TET_FACTORY_HOPPER, - TET_FACTORY_DROPPER, - TET_FACTORY_PLACER, - TET_SMALL_BLOCK_BREAKER, - TET_SMALL_TREE_CUTTER, - TET_WASTE_INCINERATOR, - TET_MINERAL_SMELTER, - TET_FREEZER, - TET_SMALL_SOLAR_PANEL, - TET_SMALL_MILKING_MACHINE, - TET_STRAIGHT_PIPE_VALVE, - TET_FLUID_BARREL, - TET_SMALL_FLUID_FUNNEL, - TET_TEST_BLOCK - }; - - //-------------------------------------------------------------------------------------------------------------------- - // Items - //-------------------------------------------------------------------------------------------------------------------- - - private static Item.Properties default_item_properties() - { return (new Item.Properties()).tab(ModEngineersDecor.ITEMGROUP); } - - public static final EdItem METAL_BAR_ITEM = (EdItem)((new EdItem(default_item_properties()).setRegistryName(MODID, "metal_bar"))); - - private static final EdItem[] modItems = { - METAL_BAR_ITEM - }; - - //-------------------------------------------------------------------------------------------------------------------- - // Entities bound exclusively to the blocks above - //-------------------------------------------------------------------------------------------------------------------- - - public static final EntityType ET_CHAIR = ModRegistry.register("et_chair", - EntityType.Builder.of(EdChair.EntityChair::new, MobCategory.MISC) - .fireImmune().sized(1e-3f, 1e-3f).noSave() - .setShouldReceiveVelocityUpdates(false).setUpdateInterval(4) - .setCustomClientFactory(EdChair.EntityChair::customClientFactory) - ); - - private static final EntityType[] entity_types = { - ET_CHAIR - }; - - //-------------------------------------------------------------------------------------------------------------------- - // Container registration - //-------------------------------------------------------------------------------------------------------------------- - - public static final MenuType CT_TREATED_WOOD_CRAFTING_TABLE; - public static final MenuType CT_FACTORY_DROPPER; - public static final MenuType CT_FACTORY_PLACER; - public static final MenuType CT_FACTORY_HOPPER; - public static final MenuType CT_SMALL_LAB_FURNACE; - public static final MenuType CT_SMALL_ELECTRICAL_FURNACE; - public static final MenuType CT_WASTE_INCINERATOR; - public static final MenuType CT_LABELED_CRATE; - - static { - CT_TREATED_WOOD_CRAFTING_TABLE = (new MenuType<>(EdCraftingTable.CraftingTableUiContainer::new)); - CT_TREATED_WOOD_CRAFTING_TABLE.setRegistryName(MODID,"ct_treated_wood_crafting_table"); - CT_FACTORY_DROPPER = (new MenuType<>(EdDropper.DropperUiContainer::new)); - CT_FACTORY_DROPPER.setRegistryName(MODID,"ct_factory_dropper"); - CT_FACTORY_PLACER = (new MenuType<>(EdPlacer.PlacerContainer::new)); - CT_FACTORY_PLACER.setRegistryName(MODID,"ct_factory_placer"); - CT_FACTORY_HOPPER = (new MenuType<>(EdHopper.HopperContainer::new)); - CT_FACTORY_HOPPER.setRegistryName(MODID,"ct_factory_hopper"); - CT_SMALL_LAB_FURNACE = (new MenuType<>(EdFurnace.FurnaceContainer::new)); - CT_SMALL_LAB_FURNACE.setRegistryName(MODID,"ct_small_lab_furnace"); - CT_SMALL_ELECTRICAL_FURNACE = (new MenuType<>(EdElectricalFurnace.ElectricalFurnaceContainer::new)); - CT_SMALL_ELECTRICAL_FURNACE.setRegistryName(MODID,"ct_small_electrical_furnace"); - CT_WASTE_INCINERATOR = (new MenuType<>(EdWasteIncinerator.WasteIncineratorContainer::new)); - CT_WASTE_INCINERATOR.setRegistryName(MODID,"ct_small_waste_incinerator"); - CT_LABELED_CRATE = (new MenuType<>(EdLabeledCrate.LabeledCrateContainer::new)); - CT_LABELED_CRATE.setRegistryName(MODID,"ct_labeled_crate"); } - private static final MenuType[] container_types = { - CT_TREATED_WOOD_CRAFTING_TABLE, - CT_LABELED_CRATE, - CT_FACTORY_DROPPER, - CT_FACTORY_PLACER, - CT_FACTORY_HOPPER, - CT_SMALL_LAB_FURNACE, - CT_SMALL_ELECTRICAL_FURNACE, - CT_WASTE_INCINERATOR - }; + public static void initItems() + { + Registries.addItem("metal_bar", ()->new EdItem((new Item.Properties()).tab(Registries.getCreativeModeTab()))); + } + + public static void initEntities() + { + Registries.addEntityType("et_chair", ()-> + EntityType.Builder.of(EdChair.EntityChair::new, MobCategory.MISC) + .fireImmune().sized(1e-3f, 1e-3f).noSave() + .setShouldReceiveVelocityUpdates(false).setUpdateInterval(4) + .setCustomClientFactory(EdChair.EntityChair::customClientFactory) + .build(new ResourceLocation(Auxiliaries.modid(), "et_chair").toString()) + ); + } + + //-------------------------------------------------------------------------------------------------------------------- + // Registry wrappers + //-------------------------------------------------------------------------------------------------------------------- + + public static Block getBlock(String name) + { return Registries.getBlock(name); } + + public static Item getItem(String name) + { return Registries.getItem(name); } + + public static TagKey getBlockTagKey(String name) + { return Registries.getBlockTagKey(name); } + + public static TagKey getItemTagKey(String name) + { return Registries.getItemTagKey(name); } + + public static BlockEntityType getBlockEntityTypeOfBlock(String block_name) + { return Registries.getBlockEntityTypeOfBlock(block_name); } + + public static EntityType getEntityType(String name) + { return Registries.getEntityType(name); } + + public static MenuType getMenuType(String block_name) + { return Registries.getMenuTypeOfBlock(block_name); } + + @SuppressWarnings("deprecation") + public static boolean isExperimentalBlock(Block block) + { return (block instanceof StandardBlocks.IStandardBlock) && (((((StandardBlocks.IStandardBlock)block).config() & DecorBlock.CFG_EXPERIMENTAL))!=0); } + + @Nonnull + public static List getRegisteredBlocks() + { return Registries.getRegisteredBlocks(); } + + @Nonnull + public static List getRegisteredItems() + { return Registries.getRegisteredItems(); } //-------------------------------------------------------------------------------------------------------------------- // Initialisation events //-------------------------------------------------------------------------------------------------------------------- - private static final ArrayList registeredBlocks = new ArrayList<>(); - - public static ArrayList allBlocks() - { - ArrayList blocks = new ArrayList<>(); - Collections.addAll(blocks, modBlocks); - Collections.addAll(blocks, devBlocks); - return blocks; - } - - @SuppressWarnings("deprecation") - public static boolean isExperimentalBlock(Block block) - { return ArrayUtils.contains(devBlocks, block) || ((block instanceof StandardBlocks.IStandardBlock) && ((((StandardBlocks.IStandardBlock)block).config() & DecorBlock.CFG_EXPERIMENTAL))!=0); } - - @Nonnull - public static List getRegisteredBlocks() - { return Collections.unmodifiableList(registeredBlocks); } - - @Nonnull - public static List getRegisteredItems() - { return new ArrayList<>(); } - public static void registerBlocks(final RegistryEvent.Register event) { - boolean ie_available = Auxiliaries.isModLoaded("immersiveengineering"); - if(ie_available) { - Auxiliaries.logInfo("Immersive Engineering also installed ..."); - registeredBlocks.addAll(allBlocks()); - } else { - registeredBlocks.addAll(allBlocks().stream() - .filter(block-> - ((!(block instanceof StandardBlocks.IStandardBlock)) || ((((StandardBlocks.IStandardBlock)block).config() & DecorBlock.CFG_HARD_IE_DEPENDENT)==0)) - ) - .collect(Collectors.toList()) - ); - } - for(Block e:registeredBlocks) event.getRegistry().register(e); - Auxiliaries.logInfo("Registered " + (registeredBlocks.size()) + " blocks."); - } - - public static void registerBlockItems(final RegistryEvent.Register event) - { - int n = 0; - for(Block e:registeredBlocks) { - ResourceLocation rl = e.getRegistryName(); - if(rl == null) continue; - if(e instanceof StandardBlocks.IBlockItemFactory) { - event.getRegistry().register(((StandardBlocks.IBlockItemFactory)e).getBlockItem(e, (new Item.Properties().tab(ModEngineersDecor.ITEMGROUP))).setRegistryName(rl)); - } else { - event.getRegistry().register(new BlockItem(e, (new Item.Properties().tab(ModEngineersDecor.ITEMGROUP))).setRegistryName(rl)); - } - ++n; - } + final boolean ie_available = Auxiliaries.isModLoaded("immersiveengineering"); + if(ie_available) Auxiliaries.logInfo("Immersive Engineering also installed ..."); + Registries.onBlockRegistry((rl, block)->event.getRegistry().register(block)); } public static void registerItems(final RegistryEvent.Register event) - { for(Item e:modItems) event.getRegistry().register(e); } + { Registries.onItemRegistry((rl, item)->event.getRegistry().register(item)); } - public static void registerTileEntities(final RegistryEvent.Register> event) - { - int n_registered = 0; - for(final BlockEntityType e:tile_entity_types) { - event.getRegistry().register(e); - ++n_registered; - } - Auxiliaries.logInfo("Registered " + (n_registered) + " tile entities."); - } + public static void registerBlockEntityTypes(final RegistryEvent.Register> event) + { Registries.onBlockEntityRegistry((rl, tet)->event.getRegistry().register(tet)); } - public static void registerEntities(final RegistryEvent.Register> event) - { - int n_registered = 0; - for(final EntityType e:entity_types) { - if((e==ET_CHAIR) && (!registeredBlocks.contains(TREATED_WOOD_STOOL))) continue; - event.getRegistry().register(e); - ++n_registered; - } - Auxiliaries.logInfo("Registered " + (n_registered) + " entities bound to blocks."); - } + public static void registerEntityTypes(final RegistryEvent.Register> event) + { Registries.onEntityRegistry((rl, et)->event.getRegistry().register(et)); } - public static void registerContainers(final RegistryEvent.Register> event) - { - int n_registered = 0; - for(final MenuType e:container_types) { - event.getRegistry().register(e); - ++n_registered; - } - Auxiliaries.logInfo("Registered " + (n_registered) + " containers bound to tile entities."); - } + public static void registerMenuTypes(final RegistryEvent.Register> event) + { Registries.onMenuTypeRegistry((rl, ct)->event.getRegistry().register(ct)); } @OnlyIn(Dist.CLIENT) - public static void registerContainerGuis(final FMLClientSetupEvent event) + @SuppressWarnings("unchecked") + public static void registerMenuGuis(final FMLClientSetupEvent event) { - MenuScreens.register(CT_TREATED_WOOD_CRAFTING_TABLE, EdCraftingTable.CraftingTableGui::new); - MenuScreens.register(CT_LABELED_CRATE, EdLabeledCrate.LabeledCrateGui::new); - MenuScreens.register(CT_FACTORY_DROPPER, EdDropper.DropperGui::new); - MenuScreens.register(CT_FACTORY_PLACER, EdPlacer.PlacerGui::new); - MenuScreens.register(CT_FACTORY_HOPPER, EdHopper.HopperGui::new); - MenuScreens.register(CT_SMALL_LAB_FURNACE, EdFurnace.FurnaceGui::new); - MenuScreens.register(CT_SMALL_ELECTRICAL_FURNACE, EdElectricalFurnace.ElectricalFurnaceGui::new); - MenuScreens.register(CT_WASTE_INCINERATOR, EdWasteIncinerator.WasteIncineratorGui::new); + MenuScreens.register((MenuType)Registries.getMenuTypeOfBlock("metal_crafting_table"), EdCraftingTable.CraftingTableGui::new); + MenuScreens.register((MenuType)Registries.getMenuTypeOfBlock("labeled_crate"), EdLabeledCrate.LabeledCrateGui::new); + MenuScreens.register((MenuType)Registries.getMenuTypeOfBlock("factory_dropper"), EdDropper.DropperGui::new); + MenuScreens.register((MenuType)Registries.getMenuTypeOfBlock("factory_placer"), EdPlacer.PlacerGui::new); + MenuScreens.register((MenuType)Registries.getMenuTypeOfBlock("factory_hopper"), EdHopper.HopperGui::new); + MenuScreens.register((MenuType)Registries.getMenuTypeOfBlock("small_lab_furnace"), EdFurnace.FurnaceGui::new); + MenuScreens.register((MenuType)Registries.getMenuTypeOfBlock("small_electrical_furnace"), EdElectricalFurnace.ElectricalFurnaceGui::new); + MenuScreens.register((MenuType)Registries.getMenuTypeOfBlock("small_waste_incinerator"), EdWasteIncinerator.WasteIncineratorGui::new); } @OnlyIn(Dist.CLIENT) @SuppressWarnings("unchecked") - public static void registerTileEntityRenderers(final FMLClientSetupEvent event) + public static void registerBlockEntityRenderers(final FMLClientSetupEvent event) { - BlockEntityRenderers.register(TET_CRAFTING_TABLE, wile.engineersdecor.detail.ModRenderers.CraftingTableTer::new); - BlockEntityRenderers.register(TET_LABELED_CRATE, wile.engineersdecor.detail.ModRenderers.DecorLabeledCrateTer::new); + BlockEntityRenderers.register((BlockEntityType)Registries.getBlockEntityTypeOfBlock("metal_crafting_table"), wile.engineersdecor.detail.ModRenderers.CraftingTableTer::new); + BlockEntityRenderers.register((BlockEntityType)Registries.getBlockEntityTypeOfBlock("labeled_crate"), wile.engineersdecor.detail.ModRenderers.DecorLabeledCrateTer::new); } @OnlyIn(Dist.CLIENT) @@ -1342,7 +1060,7 @@ public class ModContent } } // Entity renderers - EntityRenderers.register(ET_CHAIR, ModRenderers.InvisibleEntityRenderer::new); + EntityRenderers.register(Registries.getEntityType("et_chair"), ModRenderers.InvisibleEntityRenderer::new); } } diff --git a/src/main/java/wile/engineersdecor/ModEngineersDecor.java b/src/main/java/wile/engineersdecor/ModEngineersDecor.java index 214905d..c134b58 100644 --- a/src/main/java/wile/engineersdecor/ModEngineersDecor.java +++ b/src/main/java/wile/engineersdecor/ModEngineersDecor.java @@ -3,13 +3,9 @@ package wile.engineersdecor; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.MenuType; -import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.crafting.CraftingHelper; import net.minecraftforge.event.RegistryEvent; @@ -26,6 +22,7 @@ import org.apache.logging.log4j.Logger; import wile.engineersdecor.blocks.EdLadderBlock; import wile.engineersdecor.libmc.detail.Auxiliaries; import wile.engineersdecor.libmc.detail.OptionalRecipeCondition; +import wile.engineersdecor.libmc.detail.Registries; @Mod("engineersdecor") @@ -40,6 +37,8 @@ public class ModEngineersDecor { Auxiliaries.init(MODID, LOGGER, ModConfig::getServerConfig); Auxiliaries.logGitVersion(MODNAME); + Registries.init(MODID, "sign_decor"); + ModContent.init(MODID); OptionalRecipeCondition.init(MODID, LOGGER); ModLoadingContext.get().registerConfig(net.minecraftforge.fml.config.ModConfig.Type.SERVER, ModConfig.SERVER_CONFIG_SPEC); ModLoadingContext.get().registerConfig(net.minecraftforge.fml.config.ModConfig.Type.COMMON, ModConfig.COMMON_CONFIG_SPEC); @@ -63,8 +62,8 @@ public class ModEngineersDecor private void onClientSetup(final FMLClientSetupEvent event) { - ModContent.registerContainerGuis(event); - ModContent.registerTileEntityRenderers(event); + ModContent.registerMenuGuis(event); + ModContent.registerBlockEntityRenderers(event); ModContent.processContentClientSide(event); wile.engineersdecor.libmc.detail.Overlay.register(); } @@ -73,24 +72,24 @@ public class ModEngineersDecor public static class ForgeEvents { @SubscribeEvent - public static void onBlocksRegistry(final RegistryEvent.Register event) + public static void onRegisterBlocks(final RegistryEvent.Register event) { ModContent.registerBlocks(event); } @SubscribeEvent - public static void onItemRegistry(final RegistryEvent.Register event) - { ModContent.registerItems(event); ModContent.registerBlockItems(event); } + public static void onRegisterItems(final RegistryEvent.Register event) + { ModContent.registerItems(event); } @SubscribeEvent - public static void onTileEntityRegistry(final RegistryEvent.Register> event) - { ModContent.registerTileEntities(event); } + public static void onRegisterBlockEntityTypes(final RegistryEvent.Register> event) + { ModContent.registerBlockEntityTypes(event); } @SubscribeEvent public static void onRegisterEntityTypes(final RegistryEvent.Register> event) - { ModContent.registerEntities(event); } + { ModContent.registerEntityTypes(event); } @SubscribeEvent - public static void onRegisterContainerTypes(final RegistryEvent.Register> event) - { ModContent.registerContainers(event); } + public static void onRegisterMenuTypes(final RegistryEvent.Register> event) + { ModContent.registerMenuTypes(event); } @SubscribeEvent public static void onConfigLoad(final ModConfigEvent.Loading event) @@ -108,15 +107,6 @@ public class ModEngineersDecor } } - // - // Item group / creative tab - // - public static final CreativeModeTab ITEMGROUP = (new CreativeModeTab("tab" + MODID) { - @OnlyIn(Dist.CLIENT) - public ItemStack makeIcon() - { return new ItemStack(ModContent.SIGN_MODLOGO); } - }); - // // Player update event // diff --git a/src/main/java/wile/engineersdecor/blocks/EdBreaker.java b/src/main/java/wile/engineersdecor/blocks/EdBreaker.java index 9373ca6..04a005c 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdBreaker.java +++ b/src/main/java/wile/engineersdecor/blocks/EdBreaker.java @@ -12,6 +12,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; @@ -30,7 +31,6 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; @@ -93,10 +93,9 @@ public class EdBreaker public BreakerBlock(long config, BlockBehaviour.Properties builder, final AABB[] unrotatedAABBs) { super(config, builder, unrotatedAABBs); } - @Nullable @Override - public BlockEntityType getBlockEntityType() - { return ModContent.TET_SMALL_BLOCK_BREAKER; } + public ResourceLocation getBlockRegistryName() + { return getRegistryName(); } @Override public boolean isBlockEntityTicking(Level world, BlockState state) @@ -117,7 +116,7 @@ public class EdBreaker { if((state.getBlock()!=this) || (!state.getValue(ACTIVE))) return; // Sound - if(true || (world.getGameTime() & 0x1) == 0) { + { SoundEvent sound = SoundEvents.WOOD_HIT; BlockState target_state = world.getBlockState(pos.relative(state.getValue(BreakerBlock.HORIZONTAL_FACING))); SoundType stype = target_state.getBlock().getSoundType(target_state); @@ -196,7 +195,7 @@ public class EdBreaker private final LazyOptional energy_handler_ = battery_.createEnergyHandler(); public BreakerTileEntity(BlockPos pos, BlockState state) - { super(ModContent.TET_SMALL_BLOCK_BREAKER, pos, state); } + { super(ModContent.getBlockEntityTypeOfBlock(state.getBlock().getRegistryName().getPath()), pos, state); } public void block_updated() { if(tick_timer_ > 2) tick_timer_ = 2; } @@ -284,7 +283,7 @@ public class EdBreaker // Maybe make a tag for that. The question is if it is actually worth it, or if that would be only // tag spamming the game. So for now only FH and VH. final BlockState state = world.getBlockState(pos); - return (state.getBlock() == ModContent.FACTORY_HOPPER) || (state.getBlock() == Blocks.HOPPER); + return (state.getBlock() == ModContent.getBlock("factory_hopper")) || (state.getBlock() == Blocks.HOPPER); } private boolean breakBlock(BlockState state, BlockPos pos, Level world) diff --git a/src/main/java/wile/engineersdecor/blocks/EdCatwalkBlock.java b/src/main/java/wile/engineersdecor/blocks/EdCatwalkBlock.java index c32b3f3..51d16eb 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdCatwalkBlock.java +++ b/src/main/java/wile/engineersdecor/blocks/EdCatwalkBlock.java @@ -131,7 +131,7 @@ public class EdCatwalkBlock extends StandardBlocks.HorizontalFourWayWaterLoggabl List drops = new ArrayList<>(); drops.add(new ItemStack(state.getBlock().asItem())); int n = (state.getValue(NORTH)?1:0)+(state.getValue(EAST)?1:0)+(state.getValue(SOUTH)?1:0)+(state.getValue(WEST)?1:0); - if(n > 0) drops.add(new ItemStack(ModContent.STEEL_RAILING, n)); + if(n > 0) drops.add(new ItemStack(ModContent.getBlock("steel_railing"), n)); return drops; } diff --git a/src/main/java/wile/engineersdecor/blocks/EdCatwalkStairsBlock.java b/src/main/java/wile/engineersdecor/blocks/EdCatwalkStairsBlock.java index c5069e3..63c8b22 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdCatwalkStairsBlock.java +++ b/src/main/java/wile/engineersdecor/blocks/EdCatwalkStairsBlock.java @@ -127,17 +127,17 @@ public class EdCatwalkStairsBlock extends StandardBlocks.HorizontalWaterLoggable place_state = place_state.setValue(WATERLOGGED,adjacent_state.getFluidState().getType()==Fluids.WATER); EdCatwalkBlock.place_consume(place_state, world, adjacent_pos, player, hand, 1); return world.isClientSide() ? InteractionResult.SUCCESS : InteractionResult.CONSUME; - } else if((block == ModContent.STEEL_CATWALK) || (block == ModContent.STEEL_CATWALK_TOP_ALIGNED)) { + } else if((block == ModContent.getBlock("steel_catwalk")) || (block == ModContent.getBlock("steel_catwalk_ta"))) { BlockPos adjacent_pos; adjacent_pos = pos.relative(facing); final BlockState adjacent_state = world.getBlockState(adjacent_pos); if(adjacent_state == null) return InteractionResult.CONSUME; if(!adjacent_state.canBeReplaced(new DirectionalPlaceContext(world, adjacent_pos, hit.getDirection().getOpposite(), player.getItemInHand(hand), hit.getDirection()))) return InteractionResult.CONSUME; - BlockState place_state = ModContent.STEEL_CATWALK_TOP_ALIGNED.defaultBlockState(); + BlockState place_state = ModContent.getBlock("steel_catwalk_ta").defaultBlockState(); // ModContent.STEEL_CATWALK_TOP_ALIGNED place_state = place_state.setValue(WATERLOGGED,adjacent_state.getFluidState().getType()==Fluids.WATER); EdCatwalkBlock.place_consume(place_state, world, adjacent_pos, player, hand, 1); return world.isClientSide() ? InteractionResult.SUCCESS : InteractionResult.CONSUME; - } else if(block == ModContent.STEEL_RAILING) { + } else if(block == ModContent.getBlock("steel_railing")) { Direction face = hit.getDirection(); int shrink = 0; BlockState place_state = state; @@ -179,7 +179,7 @@ public class EdCatwalkStairsBlock extends StandardBlocks.HorizontalWaterLoggable List drops = new ArrayList<>(); drops.add(new ItemStack(state.getBlock().asItem())); int n = (state.getValue(LEFT_RAILING)?1:0)+(state.getValue(RIGHT_RAILING)?1:0); - if(n > 0) drops.add(new ItemStack(ModContent.STEEL_RAILING, n)); + if(n > 0) drops.add(new ItemStack(ModContent.getBlock("steel_railing"), n)); return drops; } diff --git a/src/main/java/wile/engineersdecor/blocks/EdCatwalkTopAlignedBlock.java b/src/main/java/wile/engineersdecor/blocks/EdCatwalkTopAlignedBlock.java index 770222e..93dd7f5 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdCatwalkTopAlignedBlock.java +++ b/src/main/java/wile/engineersdecor/blocks/EdCatwalkTopAlignedBlock.java @@ -103,8 +103,8 @@ public class EdCatwalkTopAlignedBlock extends StandardBlocks.WaterLoggable { BlockState below = world.getBlockState(pos.below()); if((below == null) || (state == null)) return state; - if((below.getBlock() == ModContent.THICK_STEEL_POLE) || (below.getBlock() == ModContent.THICK_STEEL_POLE_HEAD)) return state.setValue(VARIANT, 1); - if((below.getBlock() == ModContent.THIN_STEEL_POLE) || (below.getBlock() == ModContent.THIN_STEEL_POLE_HEAD)) return state.setValue(VARIANT, 2); + if((below.getBlock() == ModContent.getBlock("thick_steel_pole")) || (below.getBlock() == ModContent.getBlock("thick_steel_pole_head"))) return state.setValue(VARIANT, 1); + if((below.getBlock() == ModContent.getBlock("thin_steel_pole")) || (below.getBlock() == ModContent.getBlock("thin_steel_pole_head"))) return state.setValue(VARIANT, 2); return state; } diff --git a/src/main/java/wile/engineersdecor/blocks/EdChair.java b/src/main/java/wile/engineersdecor/blocks/EdChair.java index 15460bd..7562469 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdChair.java +++ b/src/main/java/wile/engineersdecor/blocks/EdChair.java @@ -114,7 +114,7 @@ public class EdChair } public EntityChair(Level world) - { this(ModContent.ET_CHAIR, world); } + { this(ModContent.getEntityType("et_chair"), world); } public static EntityChair customClientFactory(PlayMessages.SpawnEntity spkt, Level world) { return new EntityChair(world); } diff --git a/src/main/java/wile/engineersdecor/blocks/EdCraftingTable.java b/src/main/java/wile/engineersdecor/blocks/EdCraftingTable.java index 37f6087..f90eb1e 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdCraftingTable.java +++ b/src/main/java/wile/engineersdecor/blocks/EdCraftingTable.java @@ -36,14 +36,13 @@ import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.*; import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelReader; -import net.minecraft.world.ticks.TickPriority; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.ticks.TickPriority; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.event.ForgeEventFactory; @@ -93,10 +92,9 @@ public class EdCraftingTable public CraftingTableBlock(long config, BlockBehaviour.Properties builder, final AABB[] unrotatedAABBs) { super(config, builder, unrotatedAABBs); } - @Nullable @Override - public BlockEntityType getBlockEntityType() - { return ModContent.TET_CRAFTING_TABLE; } + public ResourceLocation getBlockRegistryName() + { return getRegistryName(); } @Override public boolean isBlockEntityTicking(Level world, BlockState state) @@ -179,7 +177,7 @@ public class EdCraftingTable public CraftingTableTileEntity(BlockPos pos, BlockState state) { - super(ModContent.TET_CRAFTING_TABLE, pos, state); + super(ModContent.getBlockEntityTypeOfBlock(state.getBlock().getRegistryName().getPath()), pos, state); inventory_ = new StorageInventory(this, NUM_OF_SLOTS, 1); inventory_.setCloseAction((player)->{ if(getLevel() instanceof Level) { @@ -329,7 +327,7 @@ public class EdCraftingTable private CraftingTableUiContainer(int cid, Inventory pinv, Container block_inventory, ContainerLevelAccess wpc) { - super(ModContent.CT_TREATED_WOOD_CRAFTING_TABLE, cid); + super(ModContent.getMenuType("metal_crafting_table"), cid); // @todo: class mapping, this stuff is continuously changed to break mods. wpc_ = wpc; player_ = pinv.player; inventory_ = block_inventory; @@ -463,7 +461,7 @@ public class EdCraftingTable super.clicked(slotId, button, clickType, player); if((with_outslot_defined_refab) && (slotId == 0) && (clickType == ClickType.PICKUP)) { if((!crafting_matrix_changed_now_) && (!player.level.isClientSide()) && (crafting_grid_empty())) { - final ItemStack dragged = player.inventoryMenu.getCarried(); + final ItemStack dragged = getCarried(); if((dragged != null) && (!dragged.isEmpty())) { try_result_stack_refab(dragged, player.level); } else if(!history().current().isEmpty()) { @@ -803,6 +801,9 @@ public class EdCraftingTable if(recipe != null) { sync(); onCraftMatrixChanged(); + } else { + history().reset_current(); + sync(); } } @@ -1048,7 +1049,8 @@ public class EdCraftingTable } { List tooltips = new ArrayList<>(); - final String prefix = ModContent.CRAFTING_TABLE.getDescriptionId() + ".tooltips."; + final Block block = ModContent.getBlock(getMenu().getType().getRegistryName().getPath().replaceAll("^ct_","")); + final String prefix = block.getDescriptionId() + ".tooltips."; String[] translation_keys = { "next", "prev", "clear", "nextcollisionrecipe", "fromstorage", "tostorage", "fromplayer", "toplayer" }; for(int i=0; (i getBlockEntityType() - { return ModContent.TET_FACTORY_DROPPER; } + public ResourceLocation getBlockRegistryName() + { return getRegistryName(); } @Override public boolean isBlockEntityTicking(Level world, BlockState state) @@ -231,7 +233,7 @@ public class EdDropper protected LazyOptional item_handler_ = Inventories.MappedItemHandler.createGenericHandler(storage_slot_range_); public DropperTileEntity(BlockPos pos, BlockState state) - { super(ModContent.TET_FACTORY_DROPPER, pos, state); reset_rtstate(); } + { super(ModContent.getBlockEntityTypeOfBlock(state.getBlock().getRegistryName().getPath()), pos, state); reset_rtstate(); } public CompoundTag clear_getnbt() { @@ -646,7 +648,7 @@ public class EdDropper private DropperUiContainer(int cid, Inventory player_inventory, Container block_inventory, ContainerLevelAccess wpc, ContainerData fields) { - super(ModContent.CT_FACTORY_DROPPER, cid); + super(ModContent.getMenuType("factory_dropper"), cid); // @todo: class mapping fields_ = fields; wpc_ = wpc; player_ = player_inventory.player; @@ -785,7 +787,8 @@ public class EdDropper { super.init(); { - final String prefix = ModContent.FACTORY_DROPPER.getDescriptionId() + ".tooltips."; + final Block block = ModContent.getBlock(getMenu().getType().getRegistryName().getPath().replaceAll("^ct_","")); + final String prefix = block.getDescriptionId() + ".tooltips."; final int x0 = getGuiLeft(), y0 = getGuiTop(); tooltip_.init( new TipRange(x0+130, y0+10, 12, 25, new TranslatableComponent(prefix + "velocity")), diff --git a/src/main/java/wile/engineersdecor/blocks/EdElectricalFurnace.java b/src/main/java/wile/engineersdecor/blocks/EdElectricalFurnace.java index efee0a4..6d2e763 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdElectricalFurnace.java +++ b/src/main/java/wile/engineersdecor/blocks/EdElectricalFurnace.java @@ -15,6 +15,7 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.TextComponent; import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import net.minecraft.world.*; import net.minecraft.world.entity.ExperienceOrb; @@ -35,7 +36,6 @@ import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; @@ -91,10 +91,9 @@ public class EdElectricalFurnace public ElectricalFurnaceBlock(long config, BlockBehaviour.Properties builder, final AABB[] unrotatedAABBs) { super(config, builder, unrotatedAABBs); } - @Nullable @Override - public BlockEntityType getBlockEntityType() - { return ModContent.TET_SMALL_ELECTRICAL_FURNACE; } + public ResourceLocation getBlockRegistryName() + { return getRegistryName(); } @Override public boolean isBlockEntityTicking(Level world, BlockState state) @@ -252,7 +251,7 @@ public class EdElectricalFurnace public ElectricalFurnaceTileEntity(BlockPos pos, BlockState state) { - super(ModContent.TET_SMALL_ELECTRICAL_FURNACE, pos, state); + super(ModContent.getBlockEntityTypeOfBlock(state.getBlock().getRegistryName().getPath()), pos, state); inventory_ = new StorageInventory(this, NUM_OF_SLOTS) { @Override public void setItem(int index, ItemStack stack) @@ -497,7 +496,7 @@ public class EdElectricalFurnace // Furnace -------------------------------------------------------------------------------------- private boolean is_accepted_hopper(final ItemStack stack) - { return (stack.getItem() == Blocks.HOPPER.asItem()) || (stack.getItem() == ModContent.FACTORY_HOPPER.asItem()); } + { return (stack.getItem() == Blocks.HOPPER.asItem()) || (stack.getItem() == ModContent.getBlock("factory_hopper").asItem()); } private boolean transferItems(final int index_from, final int index_to, int count) { @@ -758,7 +757,7 @@ public class EdElectricalFurnace private ElectricalFurnaceContainer(int cid, Inventory player_inventory, Container block_inventory, ContainerLevelAccess wpc, ContainerData fields) { - super(ModContent.CT_SMALL_ELECTRICAL_FURNACE, cid); + super(ModContent.getMenuType("small_electrical_furnace"), cid); // @todo: class mapping, player_ = player_inventory.player; inventory_ = block_inventory; wpc_ = wpc; @@ -869,7 +868,8 @@ public class EdElectricalFurnace public void init() { super.init(); - final String prefix = ModContent.SMALL_ELECTRICAL_FURNACE.getDescriptionId() + ".tooltips."; + final Block block = ModContent.getBlock(getMenu().getType().getRegistryName().getPath().replaceAll("^ct_","")); + final String prefix = block.getDescriptionId() + ".tooltips."; final int x0 = getGuiLeft(), y0 = getGuiTop(); final Slot aux = menu.getSlot(ElectricalFurnaceTileEntity.SMELTING_AUX_SLOT_NO); tooltip_.init( diff --git a/src/main/java/wile/engineersdecor/blocks/EdFluidBarrel.java b/src/main/java/wile/engineersdecor/blocks/EdFluidBarrel.java index 1e85351..64f82e7 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdFluidBarrel.java +++ b/src/main/java/wile/engineersdecor/blocks/EdFluidBarrel.java @@ -11,8 +11,10 @@ package wile.engineersdecor.blocks; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.Tag; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; @@ -32,7 +34,6 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; @@ -47,7 +48,6 @@ import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.capabilities.ICapabilityProvider; -import net.minecraft.nbt.Tag; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.CapabilityFluidHandler; @@ -99,10 +99,9 @@ public class EdFluidBarrel registerDefaultState(super.defaultBlockState().setValue(FACING, Direction.UP).setValue(FILL_LEVEL, 0)); } - @Nullable @Override - public BlockEntityType getBlockEntityType() - { return ModContent.TET_FLUID_BARREL; } + public ResourceLocation getBlockRegistryName() + { return getRegistryName(); } @Override public boolean isBlockEntityTicking(Level world, BlockState state) @@ -226,7 +225,7 @@ public class EdFluidBarrel private final LazyOptional fluid_handler_ = tank_.createFluidHandler(); public FluidBarrelTileEntity(BlockPos pos, BlockState state) - { super(ModContent.TET_FLUID_BARREL, pos, state); } + { super(ModContent.getBlockEntityTypeOfBlock(state.getBlock().getRegistryName().getPath()), pos, state); } public void readnbt(CompoundTag nbt) { tank_.load(nbt); } diff --git a/src/main/java/wile/engineersdecor/blocks/EdFluidFunnel.java b/src/main/java/wile/engineersdecor/blocks/EdFluidFunnel.java index c390a8b..50ab426 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdFluidFunnel.java +++ b/src/main/java/wile/engineersdecor/blocks/EdFluidFunnel.java @@ -14,6 +14,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Vec3i; import net.minecraft.nbt.CompoundTag; +import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; @@ -27,7 +28,6 @@ import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; @@ -77,10 +77,9 @@ public class EdFluidFunnel public FluidFunnelBlock(long config, BlockBehaviour.Properties builder, final AABB[] unrotatedAABB) { super(config, builder, unrotatedAABB); } - @Nullable @Override - public BlockEntityType getBlockEntityType() - { return ModContent.TET_SMALL_FLUID_FUNNEL; } + public ResourceLocation getBlockRegistryName() + { return getRegistryName(); } @Override public boolean isBlockEntityTicking(Level world, BlockState state) @@ -196,7 +195,7 @@ public class EdFluidFunnel private final LazyOptional fluid_handler_ = tank_.createOutputFluidHandler(); public FluidFunnelTileEntity(BlockPos pos, BlockState state) - { super(ModContent.TET_SMALL_FLUID_FUNNEL, pos, state); } + { super(ModContent.getBlockEntityTypeOfBlock(state.getBlock().getRegistryName().getPath()), pos, state); } public void readnbt(CompoundTag nbt) { diff --git a/src/main/java/wile/engineersdecor/blocks/EdFreezer.java b/src/main/java/wile/engineersdecor/blocks/EdFreezer.java index 39867cf..2e7ca0f 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdFreezer.java +++ b/src/main/java/wile/engineersdecor/blocks/EdFreezer.java @@ -12,6 +12,7 @@ package wile.engineersdecor.blocks; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; +import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import net.minecraft.util.Mth; @@ -27,7 +28,6 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; @@ -76,10 +76,9 @@ public class EdFreezer public FreezerBlock(long config, BlockBehaviour.Properties builder, final AABB unrotatedAABB) { super(config, builder, unrotatedAABB); } - @Nullable @Override - public BlockEntityType getBlockEntityType() - { return ModContent.TET_FREEZER; } + public ResourceLocation getBlockRegistryName() + { return getRegistryName(); } @Override public boolean isBlockEntityTicking(Level world, BlockState state) @@ -208,7 +207,7 @@ public class EdFreezer } public FreezerTileEntity(BlockPos pos, BlockState state) - { super(ModContent.TET_FREEZER, pos, state); } + { super(ModContent.getBlockEntityTypeOfBlock(state.getBlock().getRegistryName().getPath()), pos, state); } public int progress() { return progress_; } diff --git a/src/main/java/wile/engineersdecor/blocks/EdFurnace.java b/src/main/java/wile/engineersdecor/blocks/EdFurnace.java index 560a81f..d48ebdb 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdFurnace.java +++ b/src/main/java/wile/engineersdecor/blocks/EdFurnace.java @@ -38,7 +38,6 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; @@ -90,9 +89,8 @@ public class EdFurnace { super(config, properties, unrotatedAABB); registerDefaultState(super.defaultBlockState().setValue(LIT, false)); } @Override - @Nullable - public BlockEntityType getBlockEntityType() - { return ModContent.TET_SMALL_LAB_FURNACE; } + public ResourceLocation getBlockRegistryName() + { return getRegistryName(); } @Override public boolean isBlockEntityTicking(Level world, BlockState state) @@ -278,7 +276,7 @@ public class EdFurnace public FurnaceTileEntity(BlockPos pos, BlockState state) { - super(ModContent.TET_SMALL_LAB_FURNACE, pos, state); + super(ModContent.getBlockEntityTypeOfBlock(state.getBlock().getRegistryName().getPath()), pos, state); inventory_ = new StorageInventory(this, NUM_OF_SLOTS) { @Override public void setItem(int index, ItemStack stack) @@ -763,7 +761,7 @@ public class EdFurnace private FurnaceContainer(int cid, Inventory player_inventory, Container block_inventory, ContainerLevelAccess wpc, ContainerData fields) { - super(ModContent.CT_SMALL_LAB_FURNACE, cid); + super(ModContent.getMenuType("small_lab_furnace"), cid); // @todo: class mapping player_ = player_inventory.player; inventory_ = block_inventory; wpc_ = wpc; diff --git a/src/main/java/wile/engineersdecor/blocks/EdHopper.java b/src/main/java/wile/engineersdecor/blocks/EdHopper.java index 57f1239..a466401 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdHopper.java +++ b/src/main/java/wile/engineersdecor/blocks/EdHopper.java @@ -15,6 +15,7 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.TextComponent; import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import net.minecraft.world.*; import net.minecraft.world.entity.Entity; @@ -30,7 +31,6 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.AABB; @@ -71,9 +71,8 @@ public class EdHopper { super(config, builder, shape_supplier); } @Override - @Nullable - public BlockEntityType getBlockEntityType() - { return ModContent.TET_FACTORY_HOPPER; } + public ResourceLocation getBlockRegistryName() + { return getRegistryName(); } @Override public boolean isBlockEntityTicking(Level world, BlockState state) @@ -216,7 +215,7 @@ public class EdHopper public HopperTileEntity(BlockPos pos, BlockState state) { - super(ModContent.TET_FACTORY_HOPPER, pos, state); + super(ModContent.getBlockEntityTypeOfBlock(state.getBlock().getRegistryName().getPath()), pos, state); main_inventory_.setSlotChangeAction((slot,stack)->tick_timer_ = Math.min(tick_timer_, 8)); } @@ -631,7 +630,7 @@ public class EdHopper private HopperContainer(int cid, Inventory player_inventory, Container block_inventory, ContainerLevelAccess wpc, ContainerData fields) { - super(ModContent.CT_FACTORY_HOPPER, cid); + super(ModContent.getMenuType("factory_hopper"), cid); // @todo: class mapping fields_ = fields; wpc_ = wpc; player_ = player_inventory.player; @@ -761,7 +760,8 @@ public class EdHopper { super.init(); { - final String prefix = ModContent.FACTORY_HOPPER.getDescriptionId() + ".tooltips."; + final Block block = ModContent.getBlock(getMenu().getType().getRegistryName().getPath().replaceAll("^ct_","")); + final String prefix = block.getDescriptionId() + ".tooltips."; final int x0 = getGuiLeft(), y0 = getGuiTop(); tooltip_.init( new TooltipDisplay.TipRange(x0+148, y0+22, 3, 3, new TranslatableComponent(prefix + "delayindicator")), diff --git a/src/main/java/wile/engineersdecor/blocks/EdHorizontalSupportBlock.java b/src/main/java/wile/engineersdecor/blocks/EdHorizontalSupportBlock.java index b8f78da..23d1515 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdHorizontalSupportBlock.java +++ b/src/main/java/wile/engineersdecor/blocks/EdHorizontalSupportBlock.java @@ -119,9 +119,9 @@ public class EdHorizontalSupportBlock extends StandardBlocks.WaterLoggable if((dstate.getBlock() instanceof final EdStraightPoleBlock pole)) { final Direction dfacing = dstate.getValue(EdStraightPoleBlock.FACING); if((dfacing.getAxis() == Direction.Axis.Y)) { - if((pole== ModContent.THICK_STEEL_POLE) || ((pole==ModContent.THICK_STEEL_POLE_HEAD) && (dfacing==Direction.UP))) { + if((pole==ModContent.getBlock("thick_steel_pole")) || ((pole==ModContent.getBlock("thick_steel_pole_head")) && (dfacing==Direction.UP))) { down_connector = 2; - } else if((pole==ModContent.THIN_STEEL_POLE) || ((pole==ModContent.THIN_STEEL_POLE_HEAD) && (dfacing==Direction.UP))) { + } else if((pole==ModContent.getBlock("thin_steel_pole")) || ((pole==ModContent.getBlock("thin_steel_pole_head")) && (dfacing==Direction.UP))) { down_connector = 1; } } diff --git a/src/main/java/wile/engineersdecor/blocks/EdLabeledCrate.java b/src/main/java/wile/engineersdecor/blocks/EdLabeledCrate.java index 78a0f32..4ab5e60 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdLabeledCrate.java +++ b/src/main/java/wile/engineersdecor/blocks/EdLabeledCrate.java @@ -13,11 +13,13 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.NonNullList; import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.Tag; import net.minecraft.network.Connection; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.TextComponent; import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; +import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Tuple; import net.minecraft.world.*; import net.minecraft.world.entity.LivingEntity; @@ -33,7 +35,6 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.PushReaction; @@ -41,7 +42,6 @@ import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.BlockHitResult; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraft.nbt.Tag; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; @@ -71,7 +71,7 @@ public class EdLabeledCrate with_gui_mouse_handling = !without_gui_mouse_handling; // Currently no config, using a tag for this small feature may be uselessly stressing the registry. unstorable_containers.clear(); - unstorable_containers.add(ModContent.LABELED_CRATE.asItem()); + unstorable_containers.add(ModContent.getBlock("labeled_crate").asItem()); unstorable_containers.add(Items.SHULKER_BOX); ModConfig.log("Config crate: unstorable:" + unstorable_containers.stream().map(e->e.getRegistryName().toString()).collect(Collectors.joining(","))); } @@ -86,9 +86,8 @@ public class EdLabeledCrate { super(config, builder, unrotatedAABB); } @Override - @Nullable - public BlockEntityType getBlockEntityType() - { return ModContent.TET_LABELED_CRATE; } + public ResourceLocation getBlockRegistryName() + { return getRegistryName(); } @Override public boolean isBlockEntityTicking(Level world, BlockState state) @@ -171,7 +170,7 @@ public class EdLabeledCrate if(stack.hasTag() && stack.getTag().contains("tedata")) { final CompoundTag nbt = stack.getTag().getCompound("tedata"); if(nbt.contains("Items")) { - final NonNullList all_items = Inventories.readNbtStacks(nbt, "Items", LabeledCrateTileEntity.NUM_OF_SLOTS); + final NonNullList all_items = Inventories.readNbtStacks(nbt, LabeledCrateTileEntity.NUM_OF_SLOTS); frameStack = all_items.get(LabeledCrateTileEntity.ITEMFRAME_SLOTNO); all_items.set(LabeledCrateTileEntity.ITEMFRAME_SLOTNO, ItemStack.EMPTY); Map item_map = new HashMap<>(); @@ -224,7 +223,7 @@ public class EdLabeledCrate public LabeledCrateTileEntity(BlockPos pos, BlockState state) { - super(ModContent.TET_LABELED_CRATE, pos, state); + super(ModContent.getBlockEntityTypeOfBlock(state.getBlock().getRegistryName().getPath()), pos, state); main_inventory_.setCloseAction((player)->Networking.PacketTileNotifyServerToClient.sendToPlayers(this, writenbt(new CompoundTag()))); main_inventory_.setSlotChangeAction((index,stack)->{ if(index==ITEMFRAME_SLOTNO) Networking.PacketTileNotifyServerToClient.sendToPlayers(this, writenbt(new CompoundTag())); @@ -422,7 +421,7 @@ public class EdLabeledCrate private LabeledCrateContainer(int cid, Inventory player_inventory, Container block_inventory, ContainerLevelAccess wpc, ContainerData fields) { - super(ModContent.CT_LABELED_CRATE, cid); + super(ModContent.getMenuType("labeled_crate"), cid); // @todo: class mapping player_ = player_inventory.player; inventory_ = block_inventory; wpc_ = wpc; diff --git a/src/main/java/wile/engineersdecor/blocks/EdMilker.java b/src/main/java/wile/engineersdecor/blocks/EdMilker.java index 740679d..adb20c7 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdMilker.java +++ b/src/main/java/wile/engineersdecor/blocks/EdMilker.java @@ -32,7 +32,6 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; @@ -122,9 +121,8 @@ public class EdMilker } @Override - @Nullable - public BlockEntityType getBlockEntityType() - { return ModContent.TET_SMALL_MILKING_MACHINE; } + public ResourceLocation getBlockRegistryName() + { return getRegistryName(); } @Override public boolean isBlockEntityTicking(Level world, BlockState state) @@ -222,7 +220,7 @@ public class EdMilker public MilkerTileEntity(BlockPos pos, BlockState state) { - super(ModContent.TET_SMALL_MILKING_MACHINE, pos, state); + super(ModContent.getBlockEntityTypeOfBlock(state.getBlock().getRegistryName().getPath()), pos, state); tank_ = new Fluidics.Tank(TANK_CAPACITY, 0, BUCKET_SIZE, fs->fs.isFluidEqual(milk_fluid_)); fluid_handler_ = tank_.createOutputFluidHandler(); battery_ = new RfEnergy.Battery(MAX_ENERGY_BUFFER, MAX_ENERGY_TRANSFER, 0); @@ -718,8 +716,8 @@ public class EdMilker @Override public void tick() { - BlockPos testpos = new BlockPos(target_pos_.x(), mob.position().y(), target_pos_.z()); - if(!testpos.closerThan(mob.position(), acceptedDistance())) { + final BlockPos testpos = new BlockPos(target_pos_.x(), mob.position().y(), target_pos_.z()); + if(!testpos.closerToCenterThan(mob.position(), acceptedDistance())) { if((++tryTicks > motion_timeout)) { log("tick() -> abort, timeoutCounter"); abort(); diff --git a/src/main/java/wile/engineersdecor/blocks/EdMineralSmelter.java b/src/main/java/wile/engineersdecor/blocks/EdMineralSmelter.java index 7645545..50ae898 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdMineralSmelter.java +++ b/src/main/java/wile/engineersdecor/blocks/EdMineralSmelter.java @@ -32,7 +32,6 @@ import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; @@ -83,9 +82,8 @@ public class EdMineralSmelter { super(config, builder, unrotatedAABB); } @Override - @Nullable - public BlockEntityType getBlockEntityType() - { return ModContent.TET_MINERAL_SMELTER; } + public ResourceLocation getBlockRegistryName() + { return getRegistryName(); } @Override public boolean isBlockEntityTicking(Level world, BlockState state) @@ -274,7 +272,7 @@ public class EdMineralSmelter public MineralSmelterTileEntity(BlockPos pos, BlockState state) { - super(ModContent.TET_MINERAL_SMELTER, pos, state); + super(ModContent.getBlockEntityTypeOfBlock(state.getBlock().getRegistryName().getPath()), pos, state); main_inventory_ = (new Inventories.StorageInventory(this, NUM_OF_SLOTS, 1)).setStackLimit(1); item_handler_ = Inventories.MappedItemHandler.createGenericHandler( main_inventory_, @@ -312,8 +310,7 @@ public class EdMineralSmelter } else if(bucket_extraction_possible()) { return accepts_lava_container(stack); } else { - if(stack.getItem().getTags().contains(new ResourceLocation(Auxiliaries.modid(), "accepted_mineral_smelter_input"))) return true; - return accepted_minerals.contains(stack.getItem()); + return (accepted_minerals.contains(stack.getItem())) || (Auxiliaries.isInItemTag(stack.getItem(), new ResourceLocation(Auxiliaries.modid(), "accepted_mineral_smelter_input"))); } } diff --git a/src/main/java/wile/engineersdecor/blocks/EdPipeValve.java b/src/main/java/wile/engineersdecor/blocks/EdPipeValve.java index 273a1e6..4f90550 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdPipeValve.java +++ b/src/main/java/wile/engineersdecor/blocks/EdPipeValve.java @@ -11,6 +11,7 @@ package wile.engineersdecor.blocks; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.ItemStack; @@ -75,10 +76,17 @@ public class EdPipeValve public PipeValveBlock(long config, int valve_config, BlockBehaviour.Properties builder, final AABB[] unrotatedAABB) { super(config, builder, unrotatedAABB); this.valve_config = valve_config; } + @Override + public ResourceLocation getBlockRegistryName() + { return getRegistryName(); } + @Override @Nullable - public BlockEntityType getBlockEntityType() - { return ModContent.TET_STRAIGHT_PIPE_VALVE; } + public BlockEntity newBlockEntity(BlockPos pos, BlockState state) + { + final BlockEntityType tet = ModContent.getBlockEntityTypeOfBlock("straight_pipe_valve"); + return (tet==null) ? null : tet.create(pos, state); + } @Override public boolean isBlockEntityTicking(Level world, BlockState state) @@ -175,7 +183,7 @@ public class EdPipeValve private int valve_config_; public PipeValveTileEntity(BlockPos pos, BlockState state) - { super(ModContent.TET_STRAIGHT_PIPE_VALVE, pos, state); } + { super(ModContent.getBlockEntityTypeOfBlock("straight_pipe_valve"), pos, state); } private Direction block_facing() { diff --git a/src/main/java/wile/engineersdecor/blocks/EdPlacer.java b/src/main/java/wile/engineersdecor/blocks/EdPlacer.java index 9a3c329..6dd6fcb 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdPlacer.java +++ b/src/main/java/wile/engineersdecor/blocks/EdPlacer.java @@ -15,6 +15,7 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.TextComponent; import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; @@ -38,7 +39,6 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.Fluids; @@ -84,9 +84,8 @@ public class EdPlacer { super(config, builder, unrotatedAABB); } @Override - @Nullable - public BlockEntityType getBlockEntityType() - { return ModContent.TET_FACTORY_PLACER; } + public ResourceLocation getBlockRegistryName() + { return getRegistryName(); } @Override public boolean isBlockEntityTicking(Level world, BlockState state) @@ -201,12 +200,13 @@ public class EdPlacer private int logic_ = LOGIC_IGNORE_EXT|LOGIC_CONTINUOUS; private int current_slot_index_ = 0; private int tick_timer_ = 0; + private final boolean debug_ = false; // @todo debug stick in `self::use()` toggling. private final Inventories.StorageInventory inventory_ = new Inventories.StorageInventory(this, NUM_OF_SLOTS, 1); private final LazyOptional item_handler_; public PlacerTileEntity(BlockPos pos, BlockState state) { - super(ModContent.TET_FACTORY_PLACER, pos, state); + super(ModContent.getBlockEntityTypeOfBlock(state.getBlock().getRegistryName().getPath()), pos, state); item_handler_ = Inventories.MappedItemHandler.createGenericHandler(inventory_, (stack, slot) -> true, (stack, slot) -> true @@ -383,7 +383,7 @@ public class EdPlacer Block block = Block.byItem(item); if(block == Blocks.AIR) { if(item != null) { - Auxiliaries.logDebug("Placer spit: No block for item " + item.getRegistryName().toString()); + if(debug_) Auxiliaries.logInfo("Placer spit: No block for item " + item.getRegistryName().toString()); return spit_out(facing); // Item not accepted } } else if(block instanceof IPlantable) { @@ -459,7 +459,7 @@ public class EdPlacer } BlockState placement_state = (use_context==null) ? (block.defaultBlockState()) : (block.getStateForPlacement(use_context)); if(placement_state == null) { - Auxiliaries.logDebug("Placer spit: No valid placement state for item " + item.getRegistryName().toString()); + if(debug_) Auxiliaries.logInfo("Placer spit: No valid placement state for item " + item.getRegistryName().toString()); return spit_out(facing); } else if((use_context!=null) && (item instanceof BlockItem)) { if(((BlockItem)item).place(use_context) != InteractionResult.FAIL) { @@ -554,7 +554,7 @@ public class EdPlacer private PlacerContainer(int cid, Inventory player_inventory, Container block_inventory, ContainerLevelAccess wpc, ContainerData fields) { - super(ModContent.CT_FACTORY_PLACER, cid); + super(ModContent.getMenuType("factory_placer"), cid); // @todo: class mapping fields_ = fields; wpc_ = wpc; player_ = player_inventory.player; @@ -683,7 +683,8 @@ public class EdPlacer { super.init(); { - final String prefix = ModContent.FACTORY_PLACER.getDescriptionId() + ".tooltips."; + final Block block = ModContent.getBlock(getMenu().getType().getRegistryName().getPath().replaceAll("^ct_","")); + final String prefix = block.getDescriptionId() + ".tooltips."; final int x0 = getGuiLeft(), y0 = getGuiTop(); tooltip_.init( new TooltipDisplay.TipRange(x0+133, y0+49, 9, 9, new TranslatableComponent(prefix + "rssignal")), diff --git a/src/main/java/wile/engineersdecor/blocks/EdSolarPanel.java b/src/main/java/wile/engineersdecor/blocks/EdSolarPanel.java index 36cd74a..a930975 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdSolarPanel.java +++ b/src/main/java/wile/engineersdecor/blocks/EdSolarPanel.java @@ -11,6 +11,7 @@ package wile.engineersdecor.blocks; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; +import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; @@ -20,7 +21,6 @@ import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LightLayer; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; @@ -77,9 +77,8 @@ public class EdSolarPanel } @Override - @Nullable - public BlockEntityType getBlockEntityType() - { return ModContent.TET_SMALL_SOLAR_PANEL; } + public ResourceLocation getBlockRegistryName() + { return getRegistryName(); } @Override public boolean isBlockEntityTicking(Level world, BlockState state) @@ -126,7 +125,7 @@ public class EdSolarPanel //------------------------------------------------------------------------------------------------------------------ public SolarPanelTileEntity(BlockPos pos, BlockState state) - { super(ModContent.TET_SMALL_SOLAR_PANEL, pos, state); } + { super(ModContent.getBlockEntityTypeOfBlock(state.getBlock().getRegistryName().getPath()), pos, state); } public void readnbt(CompoundTag nbt, boolean update_packet) { battery_.load(nbt); } diff --git a/src/main/java/wile/engineersdecor/blocks/EdTestBlock.java b/src/main/java/wile/engineersdecor/blocks/EdTestBlock.java index b8d6a4d..fddd3b8 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdTestBlock.java +++ b/src/main/java/wile/engineersdecor/blocks/EdTestBlock.java @@ -12,6 +12,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.TextComponent; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; @@ -22,7 +23,6 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.Fluids; @@ -63,9 +63,8 @@ public class EdTestBlock { super(config, builder, unrotatedAABB); } @Override - @Nullable - public BlockEntityType getBlockEntityType() - { return ModContent.TET_TEST_BLOCK; } + public ResourceLocation getBlockRegistryName() + { return getRegistryName(); } @Override public boolean isBlockEntityTicking(Level world, BlockState state) @@ -137,7 +136,7 @@ public class EdTestBlock public TestTileEntity(BlockPos pos, BlockState state) { - super(ModContent.TET_TEST_BLOCK, pos, state); + super(ModContent.getBlockEntityTypeOfBlock(state.getBlock().getRegistryName().getPath()), pos, state); battery_ = new RfEnergy.Battery((int)1e9, (int)1e9, 0, 0); energy_handler_ = battery_.createEnergyHandler(); tank_ = new Fluidics.Tank((int)1e9); @@ -248,7 +247,7 @@ public class EdTestBlock Overlay.show(player, new TextComponent("RF feed rate: " + rf_feed_setting + "rf/t"), 1000); } else { BlockState adjacent_state = level.getBlockState(worldPosition.relative(block_facing)); - if(adjacent_state.getBlock()==Blocks.HOPPER || adjacent_state.getBlock()==ModContent.FACTORY_HOPPER) { + if(adjacent_state.getBlock()==Blocks.HOPPER || adjacent_state.getBlock()==ModContent.getBlock("factory_hopper")) { insertion_item = held.copy(); Overlay.show(player, new TextComponent("Insertion item: " + (insertion_item.getItem()==Items.LEVER ? "random" : insertion_item.toString()) + "/s"), 1000); } @@ -306,7 +305,7 @@ public class EdTestBlock if((tick_timer == 1) && (!insertion_item.isEmpty())) { BlockState adjacent_state = level.getBlockState(worldPosition.relative(block_facing)); ItemStack stack = (insertion_item.getItem()==Items.LEVER) ? getRandomItemstack() : insertion_item.copy(); - if(adjacent_state.getBlock()==Blocks.HOPPER || adjacent_state.getBlock()==ModContent.FACTORY_HOPPER) { + if(adjacent_state.getBlock()==Blocks.HOPPER || adjacent_state.getBlock()==ModContent.getBlock("factory_hopper")) { ItemStack remaining = Inventories.insert(getLevel(), getBlockPos().relative(block_facing), block_facing.getOpposite(), stack, false); int n = stack.getCount() - remaining.getCount(); items_inserted_total += n; diff --git a/src/main/java/wile/engineersdecor/blocks/EdTreeCutter.java b/src/main/java/wile/engineersdecor/blocks/EdTreeCutter.java index 18c1e37..11f7229 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdTreeCutter.java +++ b/src/main/java/wile/engineersdecor/blocks/EdTreeCutter.java @@ -12,6 +12,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; +import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import net.minecraft.util.Mth; @@ -23,7 +24,6 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; @@ -65,9 +65,8 @@ public class EdTreeCutter { super(config, builder, unrotatedAABB); } @Override - @Nullable - public BlockEntityType getBlockEntityType() - { return ModContent.TET_SMALL_TREE_CUTTER; } + public ResourceLocation getBlockRegistryName() + { return getRegistryName(); } @Override public boolean isBlockEntityTicking(Level world, BlockState state) @@ -152,7 +151,7 @@ public class EdTreeCutter } public TreeCutterTileEntity(BlockPos pos, BlockState state) - { super(ModContent.TET_SMALL_TREE_CUTTER, pos, state); } + { super(ModContent.getBlockEntityTypeOfBlock(state.getBlock().getRegistryName().getPath()), pos, state); } public void readnbt(CompoundTag nbt) { energy_ = nbt.getInt("energy"); } diff --git a/src/main/java/wile/engineersdecor/blocks/EdWasteIncinerator.java b/src/main/java/wile/engineersdecor/blocks/EdWasteIncinerator.java index 80e1a10..34ff365 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdWasteIncinerator.java +++ b/src/main/java/wile/engineersdecor/blocks/EdWasteIncinerator.java @@ -14,6 +14,7 @@ import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.TextComponent; +import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import net.minecraft.util.Mth; @@ -28,7 +29,6 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; @@ -83,9 +83,8 @@ public class EdWasteIncinerator { super(config, builder, unrotatedAABB); } @Override - @Nullable - public BlockEntityType getBlockEntityType() - { return ModContent.TET_WASTE_INCINERATOR; } + public ResourceLocation getBlockRegistryName() + { return getRegistryName(); } @Override public boolean isBlockEntityTicking(Level world, BlockState state) @@ -195,7 +194,7 @@ public class EdWasteIncinerator private final LazyOptional energy_handler_ = battery_.createEnergyHandler(); public WasteIncineratorTileEntity(BlockPos pos, BlockState state) - { super(ModContent.TET_WASTE_INCINERATOR, pos, state); reset(); } + { super(ModContent.getBlockEntityTypeOfBlock(state.getBlock().getRegistryName().getPath()), pos, state); reset(); } public CompoundTag getnbt() { return writenbt(new CompoundTag()); } @@ -414,7 +413,7 @@ public class EdWasteIncinerator private WasteIncineratorContainer(int cid, Inventory player_inventory, Container block_inventory, ContainerLevelAccess wpc, ContainerData fields) { - super(ModContent.CT_WASTE_INCINERATOR, cid); + super(ModContent.getMenuType("small_waste_incinerator"), cid); // @todo: class mapping player_ = player_inventory.player; inventory_ = block_inventory; wpc_ = wpc; diff --git a/src/main/java/wile/engineersdecor/detail/TreeCutting.java b/src/main/java/wile/engineersdecor/detail/TreeCutting.java index 8132eb4..a2837b8 100644 --- a/src/main/java/wile/engineersdecor/detail/TreeCutting.java +++ b/src/main/java/wile/engineersdecor/detail/TreeCutting.java @@ -20,6 +20,7 @@ import net.minecraft.world.level.block.LeavesBlock; import net.minecraft.world.level.block.VineBlock; import net.minecraft.world.level.block.state.BlockState; import wile.engineersdecor.ModEngineersDecor; +import wile.engineersdecor.libmc.detail.Auxiliaries; import java.util.*; @@ -40,7 +41,7 @@ public class TreeCutting ); private static boolean isLog(BlockState state) - { return (state.is(BlockTags.LOGS)) || (state.getBlock().getTags().contains(new ResourceLocation("minecraft","logs"))); } + { return (state.is(BlockTags.LOGS)); } private static boolean isSameLog(BlockState a, BlockState b) { return (a.getBlock()==b.getBlock()); } @@ -48,7 +49,7 @@ public class TreeCutting private static boolean isLeaves(BlockState state) { if(state.getBlock() instanceof LeavesBlock) return true; - if(state.getBlock().getTags().contains(new ResourceLocation("minecraft","leaves"))) return true; + if(state.is(BlockTags.LEAVES)) return true; return false; } diff --git a/src/main/java/wile/engineersdecor/eapi/jei/JEIPlugin.java b/src/main/java/wile/engineersdecor/eapi/jei/JEIPlugin.java index 2cb810a..ed0151a 100644 --- a/src/main/java/wile/engineersdecor/eapi/jei/JEIPlugin.java +++ b/src/main/java/wile/engineersdecor/eapi/jei/JEIPlugin.java @@ -10,13 +10,13 @@ package wile.engineersdecor.eapi.jei; /* public class JEIPlugin {} */ +import mezz.jei.api.constants.RecipeTypes; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.Block; import mezz.jei.api.registration.IRecipeCatalystRegistration; -import mezz.jei.api.constants.VanillaRecipeCategoryUid; import mezz.jei.api.registration.IRecipeTransferRegistration; import mezz.jei.api.constants.VanillaTypes; import mezz.jei.api.runtime.IJeiRuntime; @@ -42,11 +42,11 @@ public class JEIPlugin implements mezz.jei.api.IModPlugin @Override public void registerRecipeTransferHandlers(IRecipeTransferRegistration registration) { - if(!ModConfig.isOptedOut(ModContent.CRAFTING_TABLE)) { + if(!ModConfig.isOptedOut(ModContent.getBlock("metal_crafting_table"))) { try { registration.addRecipeTransferHandler( EdCraftingTable.CraftingTableUiContainer.class, - VanillaRecipeCategoryUid.CRAFTING, + RecipeTypes.CRAFTING, 1, 9, 10, 36+CraftingTableTileEntity.NUM_OF_STORAGE_SLOTS ); } catch(Throwable e) { @@ -82,14 +82,14 @@ public class JEIPlugin implements mezz.jei.api.IModPlugin @Override public void registerRecipeCatalysts(IRecipeCatalystRegistration registration) { - if(!ModConfig.isOptedOut(ModContent.CRAFTING_TABLE)) { - registration.addRecipeCatalyst(new ItemStack(ModContent.CRAFTING_TABLE), VanillaRecipeCategoryUid.CRAFTING); + if(!ModConfig.isOptedOut(ModContent.getBlock("metal_crafting_table"))) { + registration.addRecipeCatalyst(new ItemStack(ModContent.getBlock("metal_crafting_table")), RecipeTypes.CRAFTING); } - if(!ModConfig.isOptedOut(ModContent.SMALL_LAB_FURNACE)) { - registration.addRecipeCatalyst(new ItemStack(ModContent.SMALL_LAB_FURNACE), VanillaRecipeCategoryUid.FURNACE); + if(!ModConfig.isOptedOut(ModContent.getBlock("small_lab_furnace"))) { + registration.addRecipeCatalyst(new ItemStack(ModContent.getBlock("small_lab_furnace")), RecipeTypes.SMELTING); } - if(!ModConfig.isOptedOut(ModContent.SMALL_ELECTRICAL_FURNACE)) { - registration.addRecipeCatalyst(new ItemStack(ModContent.SMALL_ELECTRICAL_FURNACE), VanillaRecipeCategoryUid.FURNACE); + if(!ModConfig.isOptedOut(ModContent.getBlock("small_electrical_furnace"))) { + registration.addRecipeCatalyst(new ItemStack(ModContent.getBlock("small_electrical_furnace")), RecipeTypes.SMELTING); } } } diff --git a/src/main/java/wile/engineersdecor/items/EdItem.java b/src/main/java/wile/engineersdecor/items/EdItem.java index af72d56..061c1f4 100644 --- a/src/main/java/wile/engineersdecor/items/EdItem.java +++ b/src/main/java/wile/engineersdecor/items/EdItem.java @@ -16,9 +16,9 @@ import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -import wile.engineersdecor.ModEngineersDecor; import wile.engineersdecor.ModConfig; import wile.engineersdecor.libmc.detail.Auxiliaries; +import wile.engineersdecor.libmc.detail.Registries; import javax.annotation.Nullable; import java.util.ArrayList; @@ -28,11 +28,8 @@ import java.util.List; public class EdItem extends Item { - public static final Collection ENABLED_TABS = Collections.singletonList(ModEngineersDecor.ITEMGROUP); - public static final Collection DISABLED_TABS = new ArrayList(); - public EdItem(Item.Properties properties) - { super(properties.tab(ModEngineersDecor.ITEMGROUP)); } + { super(properties.tab(Registries.getCreativeModeTab())); } @Override @OnlyIn(Dist.CLIENT) @@ -41,6 +38,5 @@ public class EdItem extends Item @Override public Collection getCreativeTabs() - { return ModConfig.isOptedOut(this) ? (DISABLED_TABS) : (ENABLED_TABS); } - + { return ModConfig.isOptedOut(this) ? (new ArrayList<>()) : (Collections.singletonList(Registries.getCreativeModeTab())); } } diff --git a/src/main/java/wile/engineersdecor/libmc/blocks/StandardBlocks.java b/src/main/java/wile/engineersdecor/libmc/blocks/StandardBlocks.java index 0ca749a..99e13eb 100644 --- a/src/main/java/wile/engineersdecor/libmc/blocks/StandardBlocks.java +++ b/src/main/java/wile/engineersdecor/libmc/blocks/StandardBlocks.java @@ -27,7 +27,10 @@ import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelAccessor; -import net.minecraft.world.level.block.*; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Mirror; +import net.minecraft.world.level.block.Rotation; +import net.minecraft.world.level.block.SimpleWaterloggedBlock; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; diff --git a/src/main/java/wile/engineersdecor/libmc/blocks/StandardEntityBlocks.java b/src/main/java/wile/engineersdecor/libmc/blocks/StandardEntityBlocks.java index c30c3a9..eea99e2 100644 --- a/src/main/java/wile/engineersdecor/libmc/blocks/StandardEntityBlocks.java +++ b/src/main/java/wile/engineersdecor/libmc/blocks/StandardEntityBlocks.java @@ -9,6 +9,7 @@ package wile.engineersdecor.libmc.blocks; import net.minecraft.core.BlockPos; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.InteractionResult; import net.minecraft.world.MenuProvider; import net.minecraft.world.entity.player.Player; @@ -20,6 +21,7 @@ import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.gameevent.GameEventListener; import net.minecraftforge.common.util.FakePlayer; +import wile.engineersdecor.libmc.detail.Registries; import javax.annotation.Nullable; @@ -28,8 +30,8 @@ public class StandardEntityBlocks { public interface IStandardEntityBlock extends EntityBlock { - @Nullable - BlockEntityType getBlockEntityType(); + + ResourceLocation getBlockRegistryName(); default boolean isBlockEntityTicking(Level world, BlockState state) { return false; } @@ -46,7 +48,10 @@ public class StandardEntityBlocks @Override @Nullable default BlockEntity newBlockEntity(BlockPos pos, BlockState state) - { return (getBlockEntityType()==null) ? null : getBlockEntityType().create(pos, state); } + { + BlockEntityType tet = Registries.getBlockEntityTypeOfBlock(getBlockRegistryName().getPath()); + return (tet==null) ? null : tet.create(pos, state); + } @Override @Nullable diff --git a/src/main/java/wile/engineersdecor/libmc/blocks/StandardStairsBlock.java b/src/main/java/wile/engineersdecor/libmc/blocks/StandardStairsBlock.java index d771060..5092a26 100644 --- a/src/main/java/wile/engineersdecor/libmc/blocks/StandardStairsBlock.java +++ b/src/main/java/wile/engineersdecor/libmc/blocks/StandardStairsBlock.java @@ -31,9 +31,6 @@ public class StandardStairsBlock extends StairBlock implements StandardBlocks.IS { private final long config; - public StandardStairsBlock(long config, BlockState state, BlockBehaviour.Properties properties) - { super(()->state, properties); this.config = config; } - public StandardStairsBlock(long config, java.util.function.Supplier state, BlockBehaviour.Properties properties) { super(state, properties); this.config = config; } diff --git a/src/main/java/wile/engineersdecor/libmc/blocks/VariantSlabBlock.java b/src/main/java/wile/engineersdecor/libmc/blocks/VariantSlabBlock.java index d9217fc..b333358 100644 --- a/src/main/java/wile/engineersdecor/libmc/blocks/VariantSlabBlock.java +++ b/src/main/java/wile/engineersdecor/libmc/blocks/VariantSlabBlock.java @@ -83,7 +83,7 @@ public class VariantSlabBlock extends StandardBlocks.WaterLoggable implements St public void appendHoverText(ItemStack stack, @Nullable BlockGetter world, List tooltip, TooltipFlag flag) { if(!Auxiliaries.Tooltip.addInformation(stack, world, tooltip, flag, true)) return; - if(with_pickup) Auxiliaries.Tooltip.addInformation("engineersdecor.tooltip.slabpickup", "engineersdecor.tooltip.slabpickup", tooltip, flag, true); + if(with_pickup && Auxiliaries.Tooltip.helpCondition()) Auxiliaries.Tooltip.addInformation("engineersdecor.tooltip.slabpickup", "engineersdecor.tooltip.slabpickup", tooltip, flag, true); } @Override diff --git a/src/main/java/wile/engineersdecor/libmc/detail/Auxiliaries.java b/src/main/java/wile/engineersdecor/libmc/detail/Auxiliaries.java index eae6b9a..40eccb4 100644 --- a/src/main/java/wile/engineersdecor/libmc/detail/Auxiliaries.java +++ b/src/main/java/wile/engineersdecor/libmc/detail/Auxiliaries.java @@ -17,22 +17,25 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.TextComponent; import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.shapes.BooleanOp; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraftforge.fml.ModList; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.fml.ModList; +import net.minecraftforge.registries.ForgeRegistries; import org.apache.logging.log4j.Logger; import org.lwjgl.glfw.GLFW; -import wile.engineersdecor.ModConfig; import javax.annotation.Nullable; import java.io.BufferedReader; @@ -113,9 +116,6 @@ public class Auxiliaries public static void logError(final String msg) { logger.error(msg); } - public static void logDebug(final String msg) - { if(ModConfig.withDebugLogging()) logger.info(msg); } - // ------------------------------------------------------------------------------------------------------------------- // Localization, text formatting // ------------------------------------------------------------------------------------------------------------------- @@ -254,6 +254,20 @@ public class Auxiliaries public static String serializeTextComponent(Component tc) { return (tc==null) ? ("") : (Component.Serializer.toJson(tc)); } + // ------------------------------------------------------------------------------------------------------------------- + // Tag Handling + // ------------------------------------------------------------------------------------------------------------------- + + @SuppressWarnings("deprecation") + public static boolean isInItemTag(Item item, ResourceLocation tag) + { + return ForgeRegistries.ITEMS.tags().stream().filter(tg->tg.getKey().location().equals(tag)).anyMatch(tk->tk.contains(item)); + } + + @SuppressWarnings("deprecation") + public static boolean isInBlockTag(Block block, ResourceLocation tag) + { return ForgeRegistries.BLOCKS.tags().stream().filter(tg->tg.getKey().location().equals(tag)).anyMatch(tk->tk.contains(block)); } + // ------------------------------------------------------------------------------------------------------------------- // Item NBT data // ------------------------------------------------------------------------------------------------------------------- @@ -379,7 +393,7 @@ public class Auxiliaries return shape; } - public static final AABB[] getMappedAABB(AABB[] bbs, Function mapper) { + public static AABB[] getMappedAABB(AABB[] bbs, Function mapper) { final AABB[] transformed = new AABB[bbs.length]; for(int i=0; i readNbtStacks(CompoundTag nbt, String key, int size) { NonNullList stacks = NonNullList.withSize(size, ItemStack.EMPTY); - if((nbt == null) || (!nbt.contains(key,10))) return stacks; + if((nbt == null) || (!nbt.contains(key, Tag.TAG_COMPOUND))) return stacks; CompoundTag stacknbt = nbt.getCompound(key); ContainerHelper.loadAllItems(stacknbt, stacks); return stacks; } + public static NonNullList readNbtStacks(CompoundTag nbt, int size) + { + NonNullList stacks = NonNullList.withSize(size, ItemStack.EMPTY); + if((nbt == null) || (!nbt.contains("Items", Tag.TAG_LIST))) return stacks; + ContainerHelper.loadAllItems(nbt, stacks); + return stacks; + } + + public static CompoundTag writeNbtStacks(CompoundTag nbt, String key, NonNullList stacks, boolean omit_trailing_empty) { CompoundTag stacknbt = new CompoundTag(); diff --git a/src/main/java/wile/engineersdecor/libmc/detail/OptionalRecipeCondition.java b/src/main/java/wile/engineersdecor/libmc/detail/OptionalRecipeCondition.java index 11f4c6a..80f835a 100644 --- a/src/main/java/wile/engineersdecor/libmc/detail/OptionalRecipeCondition.java +++ b/src/main/java/wile/engineersdecor/libmc/detail/OptionalRecipeCondition.java @@ -8,23 +8,21 @@ */ package wile.engineersdecor.libmc.detail; -import net.minecraft.core.Registry; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import net.minecraft.resources.ResourceLocation; -import net.minecraft.tags.*; import net.minecraft.util.GsonHelper; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraftforge.common.crafting.conditions.ICondition; import net.minecraftforge.common.crafting.conditions.IConditionSerializer; import net.minecraftforge.registries.ForgeRegistries; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; import net.minecraftforge.registries.IForgeRegistry; import org.apache.logging.log4j.Logger; + import javax.annotation.Nullable; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import java.util.function.Predicate; @@ -97,11 +95,11 @@ public class OptionalRecipeCondition implements ICondition if(without_recipes) return false; if((experimental) && (!with_experimental)) return false; final IForgeRegistry item_registry = ForgeRegistries.ITEMS; - final Collection item_tags = SerializationTags.getInstance().getOrEmpty(Registry.ITEM_REGISTRY).getAvailableTags(); + //final Collection item_tags = SerializationTags.getInstance().getOrEmpty(Registry.ITEM_REGISTRY).getAvailableTags(); if(result != null) { boolean item_registered = item_registry.containsKey(result); if(!item_registered) return false; // required result not registered - if(item_registered && item_optouts.test(item_registry.getValue(result))) return false; + if(item_optouts.test(item_registry.getValue(result))) return false; if(ForgeRegistries.BLOCKS.containsKey(result) && block_optouts.test(ForgeRegistries.BLOCKS.getValue(result))) return false; } if(!all_required.isEmpty()) { @@ -111,7 +109,7 @@ public class OptionalRecipeCondition implements ICondition } if(!all_required_tags.isEmpty()) { for(ResourceLocation rl:all_required_tags) { - if(!item_tags.contains(rl)) return false; + if(item_registry.tags().getTagNames().noneMatch(tk->tk.location().equals(rl))) return false; // if(!item_tags.contains(rl)) return false; } } if(!any_missing.isEmpty()) { @@ -122,7 +120,7 @@ public class OptionalRecipeCondition implements ICondition } if(!any_missing_tags.isEmpty()) { for(ResourceLocation rl:any_missing_tags) { - if(!item_tags.contains(rl)) return true; + if(item_registry.tags().getTagNames().noneMatch(tk->tk.location().equals(rl))) return true; // if(!item_tags.contains(rl)) return true; } return false; } diff --git a/src/main/java/wile/engineersdecor/libmc/detail/Registries.java b/src/main/java/wile/engineersdecor/libmc/detail/Registries.java new file mode 100644 index 0000000..ae8ab9a --- /dev/null +++ b/src/main/java/wile/engineersdecor/libmc/detail/Registries.java @@ -0,0 +1,265 @@ +/* + * @file Registries.java + * @author Stefan Wilhelm (wile) + * @copyright (C) 2020 Stefan Wilhelm + * @license MIT (see https://opensource.org/licenses/MIT) + * + * Common game registry handling. + */ +package wile.engineersdecor.libmc.detail; + +import net.minecraft.resources.ResourceLocation; +import net.minecraft.tags.TagKey; +import net.minecraft.util.Tuple; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.inventory.MenuType; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.CreativeModeTab; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraftforge.registries.ForgeRegistries; +import wile.engineersdecor.libmc.blocks.StandardBlocks; + +import javax.annotation.Nonnull; +import java.util.*; +import java.util.function.BiConsumer; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +public class Registries +{ + private static String modid = null; + private static String creative_tab_icon = ""; + private static CreativeModeTab creative_tab = null; + + private static final List>> block_suppliers = new ArrayList<>(); + private static final List>> item_suppliers = new ArrayList<>(); + private static final List>>> block_entity_type_suppliers = new ArrayList<>(); + private static final List>>> entity_type_suppliers = new ArrayList<>(); + private static final List>>> menu_type_suppliers = new ArrayList<>(); + private static final List block_item_order = new ArrayList<>(); + + private static final Map registered_blocks = new HashMap<>(); + private static final Map registered_items = new HashMap<>(); + private static final Map> registered_block_entity_types = new HashMap<>(); + private static final Map> registered_entity_types = new HashMap<>(); + private static final Map> registered_menu_types = new HashMap<>(); + private static final Map> registered_block_tag_keys = new HashMap<>(); + private static final Map> registered_item_tag_keys = new HashMap<>(); + + public static void init(String mod_id, String creative_tab_icon_item_name) + { modid = mod_id; creative_tab_icon=creative_tab_icon_item_name; } + + public static CreativeModeTab getCreativeModeTab() + { + if(creative_tab==null) { + creative_tab = (new CreativeModeTab("tab" + modid) { + public ItemStack makeIcon() { return new ItemStack(registered_items.get(creative_tab_icon)); } + }); + } + return creative_tab; + } + + // ------------------------------------------------------------------------------------------------------------- + + public static Block getBlock(String block_name) + { return registered_blocks.get(block_name); } + + public static Item getItem(String name) + { return registered_items.get(name); } + + public static EntityType getEntityType(String name) + { return registered_entity_types.get(name); } + + public static BlockEntityType getBlockEntityType(String block_name) + { return registered_block_entity_types.get(block_name); } + + public static MenuType getMenuType(String name) + { return registered_menu_types.get(name); } + + public static BlockEntityType getBlockEntityTypeOfBlock(String block_name) + { return getBlockEntityType("tet_"+block_name); } + + public static MenuType getMenuTypeOfBlock(String name) + { return getMenuType("ct_"+name); } + + public static TagKey getBlockTagKey(String name) + { return registered_block_tag_keys.get(name); } + + public static TagKey getItemTagKey(String name) + { return registered_item_tag_keys.get(name); } + + // ------------------------------------------------------------------------------------------------------------- + + @Nonnull + public static List getRegisteredBlocks() + { return Collections.unmodifiableList(registered_blocks.values().stream().toList()); } + + @Nonnull + public static List getRegisteredItems() + { return Collections.unmodifiableList(registered_items.values().stream().toList()); } + + @Nonnull + public static List> getRegisteredBlockEntityTypes() + { return Collections.unmodifiableList(registered_block_entity_types.values().stream().toList()); } + + @Nonnull + public static List> getRegisteredEntityTypes() + { return Collections.unmodifiableList(registered_entity_types.values().stream().toList()); } + + // ------------------------------------------------------------------------------------------------------------- + + @SuppressWarnings("unchecked") + public static void addItem(String registry_name, Supplier supplier) + { + item_suppliers.add(new Tuple<>(registry_name, ()->{ + final T instance = supplier.get(); + instance.setRegistryName(new ResourceLocation(modid, registry_name)); + return instance; + })); + } + + @SuppressWarnings("unchecked") + public static void addBlock(String registry_name, Supplier block_supplier) + { + block_suppliers.add(new Tuple<>(registry_name, ()->{ + final T instance = block_supplier.get(); + instance.setRegistryName(new ResourceLocation(modid, registry_name)); + return instance; + })); + } + + @SuppressWarnings("unchecked") + public static void addBlockEntityType(String registry_name, BlockEntityType.BlockEntitySupplier ctor, String... block_names) + { + block_entity_type_suppliers.add(new Tuple<>(registry_name, ()->{ + final Block[] blocks = Arrays.stream(block_names).map(s->{ + Block b = registered_blocks.get(s); + if(b==null) Auxiliaries.logError("registered_blocks does not encompass '" + s + "'"); + return b; + }).filter(Objects::nonNull).collect(Collectors.toList()).toArray(new Block[]{}); + final BlockEntityType instance = BlockEntityType.Builder.of(ctor, blocks).build(null); + instance.setRegistryName(modid, registry_name); + return instance; + })); + } + + @SuppressWarnings("unchecked") + public static > void addEntityType(String registry_name, Supplier> supplier) + { entity_type_suppliers.add(new Tuple<>(registry_name, supplier)); } + + @SuppressWarnings("unchecked") + public static > void addMenuType(String registry_name, MenuType.MenuSupplier supplier) + { + menu_type_suppliers.add(new Tuple<>(registry_name, ()->{ + final MenuType instance = new MenuType<>(supplier); + instance.setRegistryName(modid, registry_name); + return instance; + })); + } + + @SuppressWarnings("unchecked") + public static void addBlock(String registry_name, Supplier block_supplier, BlockEntityType.BlockEntitySupplier block_entity_ctor) + { + addBlock(registry_name, block_supplier); + addBlockEntityType("tet_"+registry_name, block_entity_ctor, registry_name); + } + + @SuppressWarnings("unchecked") + public static void addBlock(String registry_name, Supplier block_supplier, BlockEntityType.BlockEntitySupplier block_entity_ctor, MenuType.MenuSupplier menu_type_supplier) + { + addBlock(registry_name, block_supplier); + addBlockEntityType("tet_"+registry_name, block_entity_ctor, registry_name); + addMenuType("ct_"+registry_name, menu_type_supplier); + } + + public static void addOptionalBlockTag(String tag_name, ResourceLocation... default_blocks) + { + final Set> default_suppliers = new HashSet<>(); + for(ResourceLocation rl: default_blocks) default_suppliers.add(()->ForgeRegistries.BLOCKS.getValue(rl)); + final TagKey key = ForgeRegistries.BLOCKS.tags().createOptionalTagKey(new ResourceLocation(modid, tag_name), default_suppliers); + registered_block_tag_keys.put(tag_name, key); + } + + public static void addOptionaItemTag(String tag_name, ResourceLocation... default_items) + { + final Set> default_suppliers = new HashSet<>(); + for(ResourceLocation rl: default_items) default_suppliers.add(()->ForgeRegistries.ITEMS.getValue(rl)); + final TagKey key = ForgeRegistries.ITEMS.tags().createOptionalTagKey(new ResourceLocation(modid, tag_name), default_suppliers); + registered_item_tag_keys.put(tag_name, key); + } + + // ------------------------------------------------------------------------------------------------------------- + + public static void onBlockRegistry(BiConsumer registration) + { + block_suppliers.forEach(e->{ + final Block block = e.getB().get(); + final ResourceLocation rl = new ResourceLocation(modid, e.getA()); + registration.accept(rl, block); + registered_blocks.put(e.getA(), block); + block_item_order.add(e.getA()); + }); + block_suppliers.clear(); + } + + public static void onItemRegistry(BiConsumer registration) + { + block_item_order.forEach(regname->{ + Block block = registered_blocks.get(regname); + final ResourceLocation rl = block.getRegistryName(); + Item item; + if(block instanceof StandardBlocks.IBlockItemFactory) { + item = ((StandardBlocks.IBlockItemFactory)block).getBlockItem(block, (new Item.Properties().tab(getCreativeModeTab()))); + } else { + item = new BlockItem(block, (new Item.Properties().tab(getCreativeModeTab()))); + } + item.setRegistryName(rl); + registration.accept(rl, item); + registered_items.put(rl.getPath(), item); + }); + item_suppliers.forEach(e->{ + final Item item = e.getB().get(); + registration.accept(new ResourceLocation(modid, e.getA()), item); + registered_items.put(e.getA(), item); + }); + item_suppliers.clear(); + block_item_order.clear(); + } + + public static void onBlockEntityRegistry(BiConsumer> registration) + { + block_entity_type_suppliers.forEach(e->{ + final BlockEntityType tet = e.getB().get(); + registration.accept(new ResourceLocation(modid, e.getA()), tet); + registered_block_entity_types.put(e.getA(), tet); + }); + block_entity_type_suppliers.clear(); + } + + public static void onMenuTypeRegistry(BiConsumer> registration) + { + menu_type_suppliers.forEach(e->{ + final MenuType ct = e.getB().get(); + registration.accept(new ResourceLocation(modid, e.getA()), ct); + registered_menu_types.put(e.getA(), ct); + }); + menu_type_suppliers.clear(); + } + + public static void onEntityRegistry(BiConsumer> registration) + { + entity_type_suppliers.forEach(e->{ + final ResourceLocation rl = new ResourceLocation(modid, e.getA()); + final EntityType et = e.getB().get(); + et.setRegistryName(rl); + registration.accept(rl, et); + registered_entity_types.put(e.getA(), et); + }); + entity_type_suppliers.clear(); + } + +} diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index a9be797..128be40 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -19,13 +19,13 @@ logoFile="logo.png" [[dependencies.engineersdecor]] modId="forge" mandatory=true - versionRange="[39,)" + versionRange="[40,)" ordering="NONE" side="BOTH" [[dependencies.engineersdecor]] modId="minecraft" mandatory=true - versionRange="[1.18.1,1.19)" + versionRange="[1.18.2,1.19)" ordering="NONE" side="BOTH" diff --git a/src/main/resources/assets/engineersdecor/blockstates/halfslab_concrete.json b/src/main/resources/assets/engineersdecor/blockstates/halfslab_concrete.json.disabled similarity index 100% rename from src/main/resources/assets/engineersdecor/blockstates/halfslab_concrete.json rename to src/main/resources/assets/engineersdecor/blockstates/halfslab_concrete.json.disabled diff --git a/src/main/resources/assets/engineersdecor/blockstates/halfslab_sheetmetal_aluminum.json b/src/main/resources/assets/engineersdecor/blockstates/halfslab_sheetmetal_aluminum.json.disabled similarity index 100% rename from src/main/resources/assets/engineersdecor/blockstates/halfslab_sheetmetal_aluminum.json rename to src/main/resources/assets/engineersdecor/blockstates/halfslab_sheetmetal_aluminum.json.disabled diff --git a/src/main/resources/assets/engineersdecor/blockstates/halfslab_sheetmetal_copper.json b/src/main/resources/assets/engineersdecor/blockstates/halfslab_sheetmetal_copper.json.disabled similarity index 100% rename from src/main/resources/assets/engineersdecor/blockstates/halfslab_sheetmetal_copper.json rename to src/main/resources/assets/engineersdecor/blockstates/halfslab_sheetmetal_copper.json.disabled diff --git a/src/main/resources/assets/engineersdecor/blockstates/halfslab_sheetmetal_gold.json b/src/main/resources/assets/engineersdecor/blockstates/halfslab_sheetmetal_gold.json.disabled similarity index 100% rename from src/main/resources/assets/engineersdecor/blockstates/halfslab_sheetmetal_gold.json rename to src/main/resources/assets/engineersdecor/blockstates/halfslab_sheetmetal_gold.json.disabled diff --git a/src/main/resources/assets/engineersdecor/blockstates/halfslab_sheetmetal_iron.json b/src/main/resources/assets/engineersdecor/blockstates/halfslab_sheetmetal_iron.json.disabled similarity index 100% rename from src/main/resources/assets/engineersdecor/blockstates/halfslab_sheetmetal_iron.json rename to src/main/resources/assets/engineersdecor/blockstates/halfslab_sheetmetal_iron.json.disabled diff --git a/src/main/resources/assets/engineersdecor/blockstates/halfslab_sheetmetal_steel.json b/src/main/resources/assets/engineersdecor/blockstates/halfslab_sheetmetal_steel.json.disabled similarity index 100% rename from src/main/resources/assets/engineersdecor/blockstates/halfslab_sheetmetal_steel.json rename to src/main/resources/assets/engineersdecor/blockstates/halfslab_sheetmetal_steel.json.disabled diff --git a/src/main/resources/assets/engineersdecor/blockstates/halfslab_treated_wood.json b/src/main/resources/assets/engineersdecor/blockstates/halfslab_treated_wood.json.disabled similarity index 100% rename from src/main/resources/assets/engineersdecor/blockstates/halfslab_treated_wood.json rename to src/main/resources/assets/engineersdecor/blockstates/halfslab_treated_wood.json.disabled diff --git a/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_concrete_recipe.json b/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_concrete_recipe.json.disabled similarity index 100% rename from src/main/resources/data/engineersdecor/recipes/dependent/halfslab_concrete_recipe.json rename to src/main/resources/data/engineersdecor/recipes/dependent/halfslab_concrete_recipe.json.disabled diff --git a/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_aluminum_recipe.json b/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_aluminum_recipe.json.disabled similarity index 100% rename from src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_aluminum_recipe.json rename to src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_aluminum_recipe.json.disabled diff --git a/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_aluminum_recipe_decompose.json b/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_aluminum_recipe_decompose.json.disabled similarity index 100% rename from src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_aluminum_recipe_decompose.json rename to src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_aluminum_recipe_decompose.json.disabled diff --git a/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_copper_recipe.json b/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_copper_recipe.json.disabled similarity index 100% rename from src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_copper_recipe.json rename to src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_copper_recipe.json.disabled diff --git a/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_copper_recipe_decompose.json b/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_copper_recipe_decompose.json.disabled similarity index 100% rename from src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_copper_recipe_decompose.json rename to src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_copper_recipe_decompose.json.disabled diff --git a/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_gold_recipe.json b/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_gold_recipe.json.disabled similarity index 100% rename from src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_gold_recipe.json rename to src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_gold_recipe.json.disabled diff --git a/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_gold_recipe_decompose.json b/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_gold_recipe_decompose.json.disabled similarity index 100% rename from src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_gold_recipe_decompose.json rename to src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_gold_recipe_decompose.json.disabled diff --git a/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_iron_recipe.json b/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_iron_recipe.json.disabled similarity index 100% rename from src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_iron_recipe.json rename to src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_iron_recipe.json.disabled diff --git a/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_iron_recipe_decompose.json b/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_iron_recipe_decompose.json.disabled similarity index 100% rename from src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_iron_recipe_decompose.json rename to src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_iron_recipe_decompose.json.disabled diff --git a/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_steel_recipe.json b/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_steel_recipe.json.disabled similarity index 100% rename from src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_steel_recipe.json rename to src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_steel_recipe.json.disabled diff --git a/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_steel_recipe_decompose.json b/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_steel_recipe_decompose.json.disabled similarity index 100% rename from src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_steel_recipe_decompose.json rename to src/main/resources/data/engineersdecor/recipes/dependent/halfslab_sheetmetal_steel_recipe_decompose.json.disabled diff --git a/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_treated_wood_recipe.json b/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_treated_wood_recipe.json.disabled similarity index 100% rename from src/main/resources/data/engineersdecor/recipes/dependent/halfslab_treated_wood_recipe.json rename to src/main/resources/data/engineersdecor/recipes/dependent/halfslab_treated_wood_recipe.json.disabled diff --git a/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_treated_wood_recipe_decompose.json b/src/main/resources/data/engineersdecor/recipes/dependent/halfslab_treated_wood_recipe_decompose.json.disabled similarity index 100% rename from src/main/resources/data/engineersdecor/recipes/dependent/halfslab_treated_wood_recipe_decompose.json rename to src/main/resources/data/engineersdecor/recipes/dependent/halfslab_treated_wood_recipe_decompose.json.disabled