From e2295894a45a5a69141b0b73dfb641038d79a401 Mon Sep 17 00:00:00 2001 From: Flanks255 <32142731+Flanks255@users.noreply.github.com> Date: Sun, 9 May 2021 16:31:24 -0500 Subject: [PATCH 1/4] A few more recipes down. --- .../data/BlockRecipeGenerator.java | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java index 9f7f8078f..8a433240b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java @@ -136,11 +136,36 @@ public class BlockRecipeGenerator extends RecipeProvider { .key('I', Tags.Items.INGOTS_IRON) .key('C', ActuallyBlocks.IRON_CASING.get()) .build(consumer); + + // Laser Relay + Recipe.shaped(ActuallyBlocks.LASER_RELAY.get(), 4) + .pattern("OBO","RCR","OBO") + .key('B', Tags.Items.STORAGE_BLOCKS_REDSTONE) + .key('O', Tags.Items.OBSIDIAN) + .key('R', ActuallyItems.RESTONIA_CRYSTAL.get()) + .key('C', ActuallyItems.COIL_ADVANCED.get()) + .build(consumer); + + // Advanced Laser Relay + Recipe.shaped(ActuallyBlocks.LASER_RELAY_ADVANCED.get()) + .pattern(" I ", "XRX", " I ") + .key('I', ActuallyItems.ENORI_CRYSTAL.get()) + .key('R', ActuallyBlocks.LASER_RELAY.get()) + .key('X', ActuallyItems.RESTONIA_CRYSTAL.get()) + .build(consumer); + + // Extreme Laser Relay + Recipe.shaped(ActuallyBlocks.LASER_RELAY_EXTREME.get()) + .pattern(" I ", "XRX", " I ") + .key('I', ActuallyItems.DIAMATINE_EMPOWERED_CRYSTAL.get()) + .key('R', ActuallyBlocks.LASER_RELAY_ADVANCED.get()) + .key('X', ActuallyItems.RESTONIA_CRYSTAL.get()) + .build(consumer); } @Override protected void saveRecipeAdvancement(DirectoryCache cache, JsonObject cache2, Path advancementJson) { - //Nope... + //Nope... maybe later... } public static class Recipe { From ca3cc00b85cd3d615365a4f72521ebfe36cb7b19 Mon Sep 17 00:00:00 2001 From: Flanks255 <32142731+Flanks255@users.noreply.github.com> Date: Sun, 22 Aug 2021 13:16:04 -0500 Subject: [PATCH 2/4] Oh god so many blocks... Block reg refactor, part 1 --- .../data/BlockRecipeGenerator.java | 21 +- .../mod/ActuallyAdditions.java | 1 - .../mod/blocks/AABlockItem.java | 10 + .../mod/blocks/ActuallyBlock.java | 64 ++++++ .../mod/blocks/ActuallyBlocks.java | 210 +++++++++++------- .../{BlockGrinder.java => BlockCrusher.java} | 16 +- .../mod/blocks/BlockCrystal.java | 14 +- .../mod/blocks/BlockCrystalCluster.java | 38 ---- ...temViewer.java => BlockItemInterface.java} | 8 +- ...ng.java => BlockItemInterfaceHopping.java} | 8 +- .../mod/blocks/CrystalClusterBlock.java | 69 ++++++ .../mod/blocks/IActuallyBlock.java | 20 ++ .../mod/blocks/base/BlockFluidFlowing.java | 3 - .../blocks/base/FullyDirectionalBlock.java | 4 + .../mod/booklet/InitBooklet.java | 4 +- .../mod/booklet/gui/GuiEntry.java | 1 + .../mod/inventory/ContainerGrinder.java | 26 +-- .../mod/inventory/gui/GuiGrinder.java | 4 +- .../{TheCrystals.java => Crystals.java} | 6 +- .../mod/tile/ActuallyTiles.java | 62 +++--- ...ityGrinder.java => TileEntityCrusher.java} | 6 +- ...uble.java => TileEntityCrusherDouble.java} | 4 +- .../mod/tile/TileEntityInputter.java | 4 +- ...ewer.java => TileEntityItemInterface.java} | 28 +-- ...va => TileEntityItemInterfaceHopping.java} | 8 +- .../mod/tile/TileEntityLaserRelayItem.java | 4 +- .../tile/TileEntityLavaFactoryController.java | 2 +- .../mod/tile/TileEntityMiner.java | 2 +- .../mod/tile/TileEntityPhantomEnergyface.java | 2 +- ...omface.java => TileEntityPhantomFace.java} | 4 +- .../mod/tile/TileEntityPhantomItemface.java | 2 +- .../mod/tile/TileEntityPhantomLiquiface.java | 2 +- .../mod/tile/TileEntityPhantomPlacer.java | 2 +- .../tile/TileEntityPhantomRedstoneface.java | 2 +- .../mod/tile/TileEntityPlayerInterface.java | 2 +- 35 files changed, 435 insertions(+), 228 deletions(-) create mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/blocks/AABlockItem.java create mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlock.java rename src/main/java/de/ellpeck/actuallyadditions/mod/blocks/{BlockGrinder.java => BlockCrusher.java} (89%) delete mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystalCluster.java rename src/main/java/de/ellpeck/actuallyadditions/mod/blocks/{BlockItemViewer.java => BlockItemInterface.java} (83%) rename src/main/java/de/ellpeck/actuallyadditions/mod/blocks/{BlockItemViewerHopping.java => BlockItemInterfaceHopping.java} (80%) create mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/blocks/CrystalClusterBlock.java create mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/blocks/IActuallyBlock.java rename src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/{TheCrystals.java => Crystals.java} (88%) rename src/main/java/de/ellpeck/actuallyadditions/mod/tile/{TileEntityGrinder.java => TileEntityCrusher.java} (98%) rename src/main/java/de/ellpeck/actuallyadditions/mod/tile/{TileEntityGrinderDouble.java => TileEntityCrusherDouble.java} (82%) rename src/main/java/de/ellpeck/actuallyadditions/mod/tile/{TileEntityItemViewer.java => TileEntityItemInterface.java} (91%) mode change 100755 => 100644 rename src/main/java/de/ellpeck/actuallyadditions/mod/tile/{TileEntityItemViewerHopping.java => TileEntityItemInterfaceHopping.java} (95%) rename src/main/java/de/ellpeck/actuallyadditions/mod/tile/{TileEntityPhantomface.java => TileEntityPhantomFace.java} (98%) diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java index 8a433240b..b8117b3d1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java @@ -28,7 +28,7 @@ public class BlockRecipeGenerator extends RecipeProvider { //Farmer Recipe.shaped(ActuallyBlocks.FARMER.get()) .pattern("ISI", "SCS", "ISI") - .key('I', ActuallyBlocks.CRYSTAL_ENORI.get()) + .key('I', ActuallyBlocks.ENORI_CRYSTAL.getItem()) .key('C', ActuallyBlocks.IRON_CASING.get()) .key('S', Tags.Items.SEEDS) .build(consumer); @@ -161,6 +161,25 @@ public class BlockRecipeGenerator extends RecipeProvider { .key('R', ActuallyBlocks.LASER_RELAY_ADVANCED.get()) .key('X', ActuallyItems.RESTONIA_CRYSTAL.get()) .build(consumer); + + // Whitelist Item Laser Relay + Recipe.shapeless(ActuallyBlocks.LASER_RELAY_ITEM_WHITELIST.get()) + .ingredients(ActuallyBlocks.LASER_RELAY_ITEM.get(), ActuallyItems.COIL_ADVANCED.get(), ActuallyItems.BLACK_QUARTZ.get()) + .build(consumer); + + // Item Interface + Recipe.shaped(ActuallyBlocks.ITEM_VIEWER.get()) + .pattern("OBO", "RCR", "OBO") + .key('B', Tags.Items.DUSTS_REDSTONE) + .key('O', ActuallyItems.COIL.get()) + .key('R', ActuallyItems.RESTONIA_CRYSTAL.get()) + .key('C', Tags.Items.CHESTS_WOODEN) + .build(consumer); + + // Hopping Item Interface + Recipe.shapeless(ActuallyBlocks.ITEM_VIEWER_HOPPING.get()).ingredients(ActuallyBlocks.ITEM_VIEWER.get()).build(consumer); + + } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java index dc891769c..e3b26a383 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java @@ -18,7 +18,6 @@ import de.ellpeck.actuallyadditions.mod.data.WorldData; import de.ellpeck.actuallyadditions.mod.entity.InitEntities; import de.ellpeck.actuallyadditions.mod.event.CommonEvents; import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; -import de.ellpeck.actuallyadditions.mod.gen.AAWorldGen; import de.ellpeck.actuallyadditions.mod.inventory.ActuallyContainers; import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; import de.ellpeck.actuallyadditions.mod.items.ItemCoffee; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/AABlockItem.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/AABlockItem.java new file mode 100644 index 000000000..1c65933a2 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/AABlockItem.java @@ -0,0 +1,10 @@ +package de.ellpeck.actuallyadditions.mod.blocks; + +import net.minecraft.block.Block; +import net.minecraft.item.BlockItem; + +public class AABlockItem extends BlockItem { + public AABlockItem(Block blockIn, Properties builder) { + super(blockIn, builder); + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlock.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlock.java new file mode 100644 index 000000000..4a6878158 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlock.java @@ -0,0 +1,64 @@ +package de.ellpeck.actuallyadditions.mod.blocks; + +import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.SlabBlock; +import net.minecraft.block.StairsBlock; +import net.minecraft.item.Item; + +import java.util.function.Supplier; + +/** + * Using a custom class here to declare common rules between all of our blocks. + * This also provides a simple instance of check for our blocks. + * + * @implNote Every block should extend this class in some form or use the {@link IActuallyBlock} + */ +public class ActuallyBlock extends Block implements IActuallyBlock { + public ActuallyBlock(Properties properties) { + super(properties); + } + + @Override + public AABlockItem createBlockItem() { + return new AABlockItem(this, this.getItemProperties()); + } + + @Override + public Item.Properties getItemProperties() { + return new Item.Properties().group(ActuallyAdditions.GROUP); + } + + public static class Stairs extends StairsBlock implements IActuallyBlock { + public Stairs(Supplier state, Properties properties) { + super(state, properties); + } + + @Override + public AABlockItem createBlockItem() { + return new AABlockItem(this, this.getItemProperties()); + } + + @Override + public Item.Properties getItemProperties() { + return new Item.Properties().group(ActuallyAdditions.GROUP); + } + } + + public static class Slabs extends SlabBlock implements IActuallyBlock { + public Slabs(Properties properties) { + super(properties); + } + + @Override + public AABlockItem createBlockItem() { + return new AABlockItem(this, this.getItemProperties()); + } + + @Override + public Item.Properties getItemProperties() { + return new Item.Properties().group(ActuallyAdditions.GROUP); + } + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java index eabcca2df..7be7b3c9e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java @@ -13,9 +13,12 @@ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockPlant; import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; +import de.ellpeck.actuallyadditions.mod.items.metalists.Crystals; +import de.ellpeck.actuallyadditions.mod.tile.*; +import de.ellpeck.actuallyadditions.registration.AABlockReg; import net.minecraft.block.*; import net.minecraft.block.material.Material; +import net.minecraft.item.Item; import net.minecraftforge.common.ToolType; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.registries.DeferredRegister; @@ -24,34 +27,136 @@ import net.minecraftforge.registries.ForgeRegistries; public final class ActuallyBlocks { public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, ActuallyAdditions.MODID); + private static final Item.Properties defaultBlockItemProperties = new Item.Properties().group(ActuallyAdditions.GROUP).maxStackSize(64); + public static final AbstractBlock.Properties miscBlockProperties = AbstractBlock.Properties.create(Material.ROCK).harvestLevel(1).harvestTool(ToolType.PICKAXE).hardnessAndResistance(1.5f, 10f); - @Deprecated - public static final RegistryObject blockMisc = BLOCKS.register("misc", () -> new Block(miscBlockProperties)); // TODO this isnt a real block? - public static final RegistryObject WOOD_CASING = BLOCKS.register("wood_casing", () -> new Block(miscBlockProperties)); - public static final RegistryObject IRON_CASING = BLOCKS.register("iron_casing", () -> new Block(miscBlockProperties)); - public static final RegistryObject ENDER_CASING = BLOCKS.register("ender_casing", () -> new Block(miscBlockProperties)); - public static final RegistryObject LAVA_CASING = BLOCKS.register("lava_casing", () -> new Block(miscBlockProperties)); - public static final RegistryObject WILD_PLANT = BLOCKS.register("wild", BlockWildPlant::new); - public static final RegistryObject FEEDER = BLOCKS.register("feeder", BlockFeeder::new); - public static final RegistryObject GRINDER = BLOCKS.register("grinder", () -> new BlockGrinder(false)); - public static final RegistryObject GRINDER_DOUBLE = BLOCKS.register("grinder_double", () -> new BlockGrinder(true)); - - public static final RegistryObject CRYSTAL_CLUSTER_REDSTONE = BLOCKS.register("crystal_cluster_redstone", () -> new BlockCrystalCluster(TheCrystals.REDSTONE)); - public static final RegistryObject CRYSTAL_CLUSTER_LAPIS = BLOCKS.register("crystal_cluster_lapis", () -> new BlockCrystalCluster(TheCrystals.LAPIS)); - public static final RegistryObject CRYSTAL_CLUSTER_DIAMOND = BLOCKS.register("crystal_cluster_diamond", () -> new BlockCrystalCluster(TheCrystals.DIAMOND)); - public static final RegistryObject CRYSTAL_CLUSTER_COAL = BLOCKS.register("crystal_cluster_coal", () -> new BlockCrystalCluster(TheCrystals.COAL)); - public static final RegistryObject CRYSTAL_CLUSTER_EMERALD = BLOCKS.register("crystal_cluster_emerald", () -> new BlockCrystalCluster(TheCrystals.EMERALD)); - public static final RegistryObject CRYSTAL_CLUSTER_IRON = BLOCKS.register("crystal_cluster_iron", () -> new BlockCrystalCluster(TheCrystals.IRON)); - public static final RegistryObject BATTERY_BOX = BLOCKS.register("battery_box", BlockBatteryBox::new); - public static final RegistryObject ITEM_VIEWER_HOPPING = BLOCKS.register("item_viewer_hopping", BlockItemViewerHopping::new); - public static final RegistryObject FARMER = BLOCKS.register("farmer", BlockFarmer::new); - public static final RegistryObject BIOREACTOR = BLOCKS.register("bio_reactor", BlockBioReactor::new); - public static final RegistryObject EMPOWERER = BLOCKS.register("empowerer", BlockEmpowerer::new); + + // Casings + public static final AABlockReg WOOD_CASING = new AABlockReg<>("wood_casing", () -> new ActuallyBlock(miscBlockProperties), ActuallyBlock::createBlockItem); + public static final AABlockReg IRON_CASING = new AABlockReg<>("iron_casing", () -> new ActuallyBlock(miscBlockProperties), ActuallyBlock::createBlockItem); + public static final AABlockReg ENDER_CASING = new AABlockReg<>("ender_casing", () -> new ActuallyBlock(miscBlockProperties), ActuallyBlock::createBlockItem); + public static final AABlockReg LAVA_FACTORY_CASING = new AABlockReg<>("lava_factory_casing", () -> new ActuallyBlock(miscBlockProperties), ActuallyBlock::createBlockItem); + + // Machines + public static final AABlockReg FEEDER = new AABlockReg<>("feeder", BlockFeeder::new, (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityFeeder::new); + public static final AABlockReg CRUSHER = new AABlockReg<>("crusher", () -> new BlockCrusher(false), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityCrusher::new); + public static final AABlockReg CRUSHER_DOUBLE = new AABlockReg<>("crusher_double", () -> new BlockCrusher(false), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityCrusherDouble::new); + + public static final AABlockReg ENERGIZER = new AABlockReg<>("energizer", () -> new BlockEnergizer(true), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityEnergizer::new); + public static final AABlockReg ENERVATOR = new AABlockReg<>("enervator", () -> new BlockEnergizer(false), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityEnergizer::new); + + public static final AABlockReg LAVA_FACTORY_CONTROLLER + = new AABlockReg<>("lava_factory_controller", BlockLavaFactoryController::new, (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityLavaFactoryController::new); + + public static final AABlockReg LAMP_POWERER = new AABlockReg<>("lamp_powerer", BlockLampPowerer::new, (b) -> new AABlockItem(b, defaultBlockItemProperties)); + + public static final AABlockReg CANOLA_PRESS = new AABlockReg<>("canola_press", BlockCanolaPress::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityCanolaPress::new); + + public static final AABlockReg LEAF_GENERATOR = new AABlockReg<>("leaf_generator", BlockLeafGenerator::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties) , TileEntityLeafGenerator::new); + + public static final AABlockReg XP_SOLIDIFIER = new AABlockReg<>("xp_solidifier", BlockXPSolidifier::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityXPSolidifier::new); + + public static final AABlockReg BREAKER = new AABlockReg<>("breaker", () -> new BlockBreaker(false), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityBreaker::new); + public static final AABlockReg PLACER = new AABlockReg<>("placer", () -> new BlockBreaker(true), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPlacer::new); + public static final AABlockReg DROPPER = new AABlockReg<>("dropper", BlockDropper::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityDropper::new); + public static final AABlockReg FLUID_PLACER = new AABlockReg<>("fluid_placer", () -> new BlockFluidCollector(true), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityFluidCollector::new); + public static final AABlockReg FLUID_COLLECTOR = new AABlockReg<>("fluid_collector", () -> new BlockFluidCollector(false), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityFluidPlacer::new); + + public static final AABlockReg FARMER = new AABlockReg<>("farmer", BlockFarmer::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityFarmer::new); + + public static final AABlockReg BIOREACTOR = new AABlockReg<>("bio_reactor", BlockBioReactor::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityBioReactor::new); + + // Crystal Blocks + public static final AABlockReg ENORI_CRYSTAL = new AABlockReg<>("enori_crystal_block", () -> new BlockCrystal(false), BlockCrystal::createBlockItem); + public static final AABlockReg RESTONIA_CRYSTAL = new AABlockReg<>("restonia_crystal_block", () -> new BlockCrystal(false), BlockCrystal::createBlockItem); + public static final AABlockReg PALIS_CRYSTAL = new AABlockReg<>("palis_crystal_block", () -> new BlockCrystal(false), BlockCrystal::createBlockItem); + public static final AABlockReg DIAMATINE_CRYSTAL = new AABlockReg<>("diamatine_crystal_block", () -> new BlockCrystal(false), BlockCrystal::createBlockItem); + public static final AABlockReg VOID_CRYSTAL = new AABlockReg<>("void_crystal_block", () -> new BlockCrystal(false), BlockCrystal::createBlockItem); + public static final AABlockReg EMERADIC_CRYSTAL = new AABlockReg<>("emeradic_crystal_block", () -> new BlockCrystal(false), BlockCrystal::createBlockItem); + // Empowered Crystal Blocks + public static final AABlockReg EMPOWERED_ENORI_CRYSTAL = new AABlockReg<>("empowered_enori_crystal_block", () -> new BlockCrystal(true), BlockCrystal::createBlockItem); + public static final AABlockReg EMPOWERED_RESTONIA_CRYSTAL = new AABlockReg<>("empowered_restonia_crystal_block", () -> new BlockCrystal(true), BlockCrystal::createBlockItem); + public static final AABlockReg EMPOWERED_PALIS_CRYSTAL = new AABlockReg<>("empowered_palis_crystal_block", () -> new BlockCrystal(true), BlockCrystal::createBlockItem); + public static final AABlockReg EMPOWERED_DIAMATINE_CRYSTAL = new AABlockReg<>("empowered_diamatine_crystal_block", () -> new BlockCrystal(true), BlockCrystal::createBlockItem); + public static final AABlockReg EMPOWERED_VOID_CRYSTAL = new AABlockReg<>("empowered_void_crystal_block", () -> new BlockCrystal(true), BlockCrystal::createBlockItem); + public static final AABlockReg EMPOWERED_EMERADIC_CRYSTAL = new AABlockReg<>("empowered_emeradic_crystal_block", () -> new BlockCrystal(true), BlockCrystal::createBlockItem); + // Crystal Clusters + public static final AABlockReg ENORI_CRYSTAL_CLUSTER = new AABlockReg<>("enori_crystal_cluster", () -> new CrystalClusterBlock(Crystals.IRON), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg RESTONIA_CRYSTAL_CLUSTER = new AABlockReg<>("restonia_crystal_cluster", () -> new CrystalClusterBlock(Crystals.REDSTONE), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg PALIS_CRYSTAL_CLUSTER = new AABlockReg<>("palis_crystal_cluster", () -> new CrystalClusterBlock(Crystals.LAPIS), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg DIAMATINE_CRYSTAL_CLUSTER = new AABlockReg<>("diamatine_crystal_cluster", () -> new CrystalClusterBlock(Crystals.DIAMOND), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg VOID_CRYSTAL_CLUSTER = new AABlockReg<>("void_crystal_cluster", () -> new CrystalClusterBlock(Crystals.COAL), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg EMERADIC_CRYSTAL_CLUSTER = new AABlockReg<>("emeradic_crystal_cluster", () -> new CrystalClusterBlock(Crystals.EMERALD), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + + // LAMPS! SO MANY LAMPS + public static final AABlockReg LAMP_WHITE = new AABlockReg<>("lamp_white", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg LAMP_ORANGE = new AABlockReg<>("lamp_orange", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg LAMP_MAGENTA = new AABlockReg<>("lamp_magenta", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg LAMP_LIGHT_BLUE = new AABlockReg<>("lamp_light_blue", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg LAMP_YELLOW = new AABlockReg<>("lamp_yellow", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg LAMP_LIME = new AABlockReg<>("lamp_lime", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg LAMP_PINK = new AABlockReg<>("lamp_pink", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg LAMP_GRAY = new AABlockReg<>("lamp_gray", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg LAMP_LIGHT_GRAY = new AABlockReg<>("lamp_light_gray", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg LAMP_CYAN = new AABlockReg<>("lamp_cyan", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg LAMP_PURPLE = new AABlockReg<>("lamp_purple", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg LAMP_BLUE = new AABlockReg<>("lamp_blue", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg LAMP_BROWN = new AABlockReg<>("lamp_brown", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg LAMP_GREEN = new AABlockReg<>("lamp_green", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg LAMP_RED = new AABlockReg<>("lamp_red", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg LAMP_BLACK = new AABlockReg<>("lamp_black", BlockColoredLamp::new, (b) -> new AABlockItem(b, defaultBlockItemProperties)); + + // Empowerer / Display Stands + public static final AABlockReg EMPOWERER = new AABlockReg<>("empowerer", BlockEmpowerer::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityEmpowerer::new); + public static final AABlockReg DISPLAY_STAND = new AABlockReg<>("display_stand", BlockDisplayStand::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityDisplayStand::new); + + // Interface Blocks + public static final AABlockReg PLAYER_INTERFACE = new AABlockReg<>("player_interface", BlockPlayerInterface::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPlayerInterface::new); + public static final AABlockReg ITEM_VIEWER = new AABlockReg<>("item_viewer", BlockItemInterface::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityItemInterface::new); + public static final AABlockReg ITEM_VIEWER_HOPPING = new AABlockReg<>("item_viewer_hopping", BlockItemInterfaceHopping::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityItemInterfaceHopping::new); + + // Phantom stuff + public static final AABlockReg PHANTOMFACE = new AABlockReg<>("phantomface", () -> new BlockPhantom(BlockPhantom.Type.FACE), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomFace::new); + public static final AABlockReg PHANTOM_PLACER = new AABlockReg<>("phantom_placer", () -> new BlockPhantom(BlockPhantom.Type.PLACER), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomPlacer::new); + public static final AABlockReg PHANTOM_LIQUIFACE = new AABlockReg<>("phantom_liquiface", () -> new BlockPhantom(BlockPhantom.Type.LIQUIFACE), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomLiquiface::new); + public static final AABlockReg PHANTOM_ENERGYFACE = new AABlockReg<>("phantom_energyface", () -> new BlockPhantom(BlockPhantom.Type.ENERGYFACE), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomEnergyface::new); + public static final AABlockReg PHANTOM_REDSTONEFACE = new AABlockReg<>("phantom_redstoneface", () -> new BlockPhantom(BlockPhantom.Type.REDSTONEFACE), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomRedstoneface::new); + public static final AABlockReg PHANTOM_BREAKER = new AABlockReg<>("phantom_breaker", () -> new BlockPhantom(BlockPhantom.Type.BREAKER), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomBreaker::new); + + // Misc Tiles + public static final AABlockReg BATTERY_BOX = new AABlockReg<>("battery_box", BlockBatteryBox::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityBatteryBox::new); + + + + //public static final RegistryObject WILD_PLANT = BLOCKS.register("wild", BlockWildPlant::new); //TODO: what is this? public static final RegistryObject TINY_TORCH = BLOCKS.register("tiny_torch", BlockTinyTorch::new); public static final RegistryObject SHOCK_SUPPRESSOR = BLOCKS.register("shock_suppressor", BlockShockSuppressor::new); - public static final RegistryObject DISPLAY_STAND = BLOCKS.register("display_stand", BlockDisplayStand::new); - public static final RegistryObject PLAYER_INTERFACE = BLOCKS.register("player_interface", BlockPlayerInterface::new); - public static final RegistryObject ITEM_VIEWER = BLOCKS.register("item_viewer", BlockItemViewer::new); public static final RegistryObject FIREWORK_BOX = BLOCKS.register("firework_box", BlockFireworkBox::new); public static final RegistryObject MINER = BLOCKS.register("miner", BlockVerticalDigger::new); public static final RegistryObject ATOMIC_RECONSTRUCTOR = BLOCKS.register("atomic_reconstructor", BlockAtomicReconstructor::new); @@ -63,8 +168,7 @@ public final class ActuallyBlocks { public static final RegistryObject LASER_RELAY_ITEM_WHITELIST = BLOCKS.register("laser_relay_item_whitelist", () -> new BlockLaserRelay(BlockLaserRelay.Type.ITEM_WHITELIST)); public static final RegistryObject RANGED_COLLECTOR = BLOCKS.register("ranged_collector", BlockRangedCollector::new); public static final RegistryObject DIRECTIONAL_BREAKER = BLOCKS.register("directional_breaker", BlockDirectionalBreaker::new); - public static final RegistryObject LEAF_GENERATOR = BLOCKS.register("leaf_generator", BlockLeafGenerator::new); - public static final RegistryObject XP_SOLIDIFIER = BLOCKS.register("xp_solidifier", BlockXPSolidifier::new); + public static final RegistryObject ETHETIC_GREEN_BLOCK = BLOCKS.register("ethetic_green_block", BlockGeneric::new); public static final RegistryObject ETHETIC_WHITE_BLOCK = BLOCKS.register("ethetic_white_block", BlockGeneric::new); public static final RegistryObject ETHETIC_GREEN_STAIRS = BLOCKS.register("ethetic_green_stairs", () -> new StairsBlock(() -> ETHETIC_GREEN_BLOCK.get().getDefaultState(), AbstractBlock.Properties.from(ETHETIC_GREEN_BLOCK.get()))); @@ -74,51 +178,8 @@ public final class ActuallyBlocks { public static final RegistryObject ETHETIC_GREEN_WALL = BLOCKS.register("ethetic_green_wall", () -> new WallBlock(AbstractBlock.Properties.from(ETHETIC_GREEN_BLOCK.get()))); public static final RegistryObject ETHETIC_WHITE_WALL = BLOCKS.register("ethetic_white_wall", () -> new WallBlock(AbstractBlock.Properties.from(ETHETIC_WHITE_BLOCK.get()))); - public static final RegistryObject CRYSTAL_ENORI = BLOCKS.register("crystal_enori_block", () -> new BlockCrystal(false)); - public static final RegistryObject CRYSTAL_RESTONIA = BLOCKS.register("crystal_restonia_block", () -> new BlockCrystal(false)); - public static final RegistryObject CRYSTAL_PALIS = BLOCKS.register("crystal_palis_block", () -> new BlockCrystal(false)); - public static final RegistryObject CRYSTAL_DIAMATINE = BLOCKS.register("crystal_diamatine_block", () -> new BlockCrystal(false)); - public static final RegistryObject CRYSTAL_VOID = BLOCKS.register("crystal_void_block", () -> new BlockCrystal(false)); - public static final RegistryObject CRYSTAL_EMERADIC = BLOCKS.register("crystal_emeradic_block", () -> new BlockCrystal(false)); - public static final RegistryObject CRYSTAL_EMPOWERED_ENORI = BLOCKS.register("crystal_enori_empowered_block", () -> new BlockCrystal(true)); - public static final RegistryObject CRYSTAL_EMPOWERED_RESTONIA = BLOCKS.register("crystal_restonia_empowered_block", () -> new BlockCrystal(true)); - public static final RegistryObject CRYSTAL_EMPOWERED_PALIS = BLOCKS.register("crystal_palis_empowered_block", () -> new BlockCrystal(true)); - public static final RegistryObject CRYSTAL_EMPOWERED_DIAMATINE = BLOCKS.register("crystal_diamatine_empowered_block", () -> new BlockCrystal(true)); - public static final RegistryObject CRYSTAL_EMPOWERED_VOID = BLOCKS.register("crystal_void_empowered_block", () -> new BlockCrystal(true)); - public static final RegistryObject CRYSTAL_EMPOWERED_EMERADIC = BLOCKS.register("crystal_emeradic_empowered_block", () -> new BlockCrystal(true)); - - public static final RegistryObject LAMP_WHITE = BLOCKS.register("lamp_white_block", BlockColoredLamp::new); - public static final RegistryObject LAMP_ORANGE = BLOCKS.register("lamp_orange_block", BlockColoredLamp::new); - public static final RegistryObject LAMP_MAGENTA = BLOCKS.register("lamp_magenta_block", BlockColoredLamp::new); - public static final RegistryObject LAMP_LIGHT_BLUE = BLOCKS.register("lamp_light_blue_block", BlockColoredLamp::new); - public static final RegistryObject LAMP_YELLOW = BLOCKS.register("lamp_yellow_block", BlockColoredLamp::new); - public static final RegistryObject LAMP_LIME = BLOCKS.register("lamp_lime_block", BlockColoredLamp::new); - public static final RegistryObject LAMP_PINK = BLOCKS.register("lamp_pink_block", BlockColoredLamp::new); - public static final RegistryObject LAMP_GRAY = BLOCKS.register("lamp_gray_block", BlockColoredLamp::new); - public static final RegistryObject LAMP_LIGHT_GRAY = BLOCKS.register("lamp_light_gray_block", BlockColoredLamp::new); - public static final RegistryObject LAMP_CYAN = BLOCKS.register("lamp_cyan_block", BlockColoredLamp::new); - public static final RegistryObject LAMP_PURPLE = BLOCKS.register("lamp_purple_block", BlockColoredLamp::new); - public static final RegistryObject LAMP_BLUE = BLOCKS.register("lamp_blue_block", BlockColoredLamp::new); - public static final RegistryObject LAMP_BROWN = BLOCKS.register("lamp_brown_block", BlockColoredLamp::new); - public static final RegistryObject LAMP_GREEN = BLOCKS.register("lamp_green_block", BlockColoredLamp::new); - public static final RegistryObject LAMP_RED = BLOCKS.register("lamp_red_block", BlockColoredLamp::new); - public static final RegistryObject LAMP_BLACK = BLOCKS.register("lamp_black_block", BlockColoredLamp::new); - - // public static final RegistryObject blockColoredLamp = BLOCKS.register("colored_lamp", () -> new BlockColoredLamp()); - // public static final RegistryObject blockColoredLampOn = BLOCKS.register("colored_lamp_on", () -> new BlockColoredLamp()); - public static final RegistryObject LAMP_POWERER = BLOCKS.register("lamp_powerer", BlockLampPowerer::new); // public static final RegistryObject blockTreasureChest = BLOCKS.register("treasure_chest", BlockTreasureChest::new); - public static final RegistryObject ENERGIZER = BLOCKS.register("energizer", () -> new BlockEnergizer(true)); - public static final RegistryObject ENERVATOR = BLOCKS.register("enervator", () -> new BlockEnergizer(false)); - public static final RegistryObject LAVA_FACTORY_CONTROLLER = BLOCKS.register("lava_factory_controller", BlockLavaFactoryController::new); - public static final RegistryObject CANOLA_PRESS = BLOCKS.register("canola_press", BlockCanolaPress::new); - public static final RegistryObject PHANTOMFACE = BLOCKS.register("phantomface", () -> new BlockPhantom(BlockPhantom.Type.FACE)); - public static final RegistryObject PHANTOM_PLACER = BLOCKS.register("phantom_placer", () -> new BlockPhantom(BlockPhantom.Type.PLACER)); - public static final RegistryObject PHANTOM_LIQUIFACE = BLOCKS.register("phantom_liquiface", () -> new BlockPhantom(BlockPhantom.Type.LIQUIFACE)); - public static final RegistryObject PHANTOM_ENERGYFACE = BLOCKS.register("phantom_energyface", () -> new BlockPhantom(BlockPhantom.Type.ENERGYFACE)); - public static final RegistryObject PHANTOM_REDSTONEFACE = BLOCKS.register("phantom_redstoneface", () -> new BlockPhantom(BlockPhantom.Type.REDSTONEFACE)); - public static final RegistryObject PHANTOM_BREAKER = BLOCKS.register("phantom_breaker", () -> new BlockPhantom(BlockPhantom.Type.BREAKER)); public static final RegistryObject COAL_GENERATOR = BLOCKS.register("coal_generator", BlockCoalGenerator::new); public static final RegistryObject OIL_GENERATOR = BLOCKS.register("oil_generator", BlockOilGenerator::new); public static final RegistryObject FERMENTING_BARREL = BLOCKS.register("fermenting_barrel", BlockFermentingBarrel::new); @@ -127,16 +188,9 @@ public final class ActuallyBlocks { public static final RegistryObject FLAX = BLOCKS.register("flax", () -> new BlockPlant(ActuallyItems.FLAX_SEED.get()));// TODO: [port][replace] ensure values match these new BlockPlant(2, 4)); public static final RegistryObject COFFEE = BLOCKS.register("coffee", () -> new BlockPlant(ActuallyItems.COFFEE_SEED.get()));// TODO: [port][replace] ensure values match these new BlockPlant(2, 2)); public static final RegistryObject FURNACE_DOUBLE = BLOCKS.register("furnace_double", BlockFurnaceDouble::new); - public static final RegistryObject INPUTTER = BLOCKS.register("inputter", () -> new BlockInputter(false)); - public static final RegistryObject INPUTTER_ADVANCED = BLOCKS.register("inputter_advanced", () -> new BlockInputter(true)); // public static final RegistryObject blockFurnaceSolar = BLOCKS.register("furnace_solar", BlockFurnaceSolar::new); public static final RegistryObject HEAT_COLLECTOR = BLOCKS.register("heat_collector", BlockHeatCollector::new); public static final RegistryObject GREENHOUSE_GLASS = BLOCKS.register("greenhouse_glass", BlockGreenhouseGlass::new); - public static final RegistryObject BREAKER = BLOCKS.register("breaker", () -> new BlockBreaker(false)); - public static final RegistryObject PLACER = BLOCKS.register("placer", () -> new BlockBreaker(true)); - public static final RegistryObject DROPPER = BLOCKS.register("dropper", BlockDropper::new); - public static final RegistryObject FLUID_PLACER = BLOCKS.register("fluid_placer", () -> new BlockFluidCollector(true)); - public static final RegistryObject FLUID_COLLECTOR = BLOCKS.register("fluid_collector", () -> new BlockFluidCollector(false)); public static final RegistryObject COFFEE_MACHINE = BLOCKS.register("coffee_machine", BlockCoffeeMachine::new); public static final RegistryObject PHANTOM_BOOSTER = BLOCKS.register("phantom_booster", BlockPhantomBooster::new); public static final RegistryObject BLACK_QUARTZ_BLOCK = BLOCKS.register("black_quartz_block", BlockGeneric::new); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGrinder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrusher.java similarity index 89% rename from src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGrinder.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrusher.java index 22aae61c3..dd8af8111 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGrinder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrusher.java @@ -14,8 +14,8 @@ import static net.minecraft.state.properties.BlockStateProperties.HORIZONTAL_FAC import static net.minecraft.state.properties.BlockStateProperties.LIT; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinder; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinderDouble; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityCrusher; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityCrusherDouble; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; @@ -37,10 +37,10 @@ import net.minecraft.world.server.ServerWorld; import java.util.Random; -public class BlockGrinder extends BlockContainerBase { +public class BlockCrusher extends BlockContainerBase { private final boolean isDouble; - public BlockGrinder(boolean isDouble) { + public BlockCrusher(boolean isDouble) { super(ActuallyBlocks.defaultPickProps(0).tickRandomly()); this.isDouble = isDouble; this.setDefaultState(this.stateContainer.getBaseState().with(HORIZONTAL_FACING, Direction.NORTH).with(LIT, false)); @@ -49,8 +49,8 @@ public class BlockGrinder extends BlockContainerBase { @Override public TileEntity createNewTileEntity(IBlockReader worldIn) { return this.isDouble - ? new TileEntityGrinderDouble() - : new TileEntityGrinder(); + ? new TileEntityCrusherDouble() + : new TileEntityCrusher(); } @Override @@ -68,10 +68,10 @@ public class BlockGrinder extends BlockContainerBase { @Override public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if (this.isDouble) { - return this.openGui(world, player, pos, TileEntityGrinderDouble.class); + return this.openGui(world, player, pos, TileEntityCrusherDouble.class); } - return this.openGui(world, player, pos, TileEntityGrinder.class); + return this.openGui(world, player, pos, TileEntityCrusher.class); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java index 504ef06c1..2b2f67e3b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java @@ -10,9 +10,9 @@ package de.ellpeck.actuallyadditions.mod.blocks; -import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase; +import net.minecraft.item.ItemStack; -public class BlockCrystal extends BlockBase { +public class BlockCrystal extends ActuallyBlock { private final boolean isEmpowered; public BlockCrystal(boolean isEmpowered) { @@ -20,6 +20,16 @@ public class BlockCrystal extends BlockBase { this.isEmpowered = isEmpowered; } + @Override + public AABlockItem createBlockItem() { + return new AABlockItem(this, getItemProperties()) { + @Override + public boolean hasEffect(ItemStack stack) { + return isEmpowered; + } + }; + } + // public static class TheItemBlock extends ItemBlockBase { // // public TheItemBlock(Block block) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystalCluster.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystalCluster.java deleted file mode 100644 index 9a5dcf093..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystalCluster.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file ("BlockCrystalCluster.java") is part of the Actually Additions mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2015-2017 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.blocks; - -import de.ellpeck.actuallyadditions.mod.blocks.base.FullyDirectionalBlock; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; -import net.minecraft.block.BlockState; -import net.minecraft.block.SoundType; -import net.minecraft.block.material.Material; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.shapes.ISelectionContext; -import net.minecraft.util.math.shapes.VoxelShape; -import net.minecraft.world.IBlockReader; - -public class BlockCrystalCluster extends FullyDirectionalBlock { - - private final TheCrystals crystal; - - public BlockCrystalCluster(TheCrystals crystal) { - super(Properties.create(Material.GLASS).hardnessAndResistance(0.25F, 1.0F).sound(SoundType.GLASS).setLightLevel(state -> 7)); - this.crystal = crystal; - - // this.setLightOpacity(1); - } - - @Override - public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { - return Shapes.CRYSTAL_CLUSTER_SHAPE; - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemViewer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemInterface.java similarity index 83% rename from src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemViewer.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemInterface.java index 1c8ea4754..5189a4314 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemViewer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemInterface.java @@ -11,7 +11,7 @@ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemViewer; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemInterface; import net.minecraft.block.BlockState; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; @@ -19,14 +19,14 @@ import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; -public class BlockItemViewer extends BlockContainerBase { - public BlockItemViewer() { +public class BlockItemInterface extends BlockContainerBase { + public BlockItemInterface() { super(ActuallyBlocks.defaultPickProps(0)); } @Override public TileEntity createNewTileEntity(IBlockReader worldIn) { - return new TileEntityItemViewer(); + return new TileEntityItemInterface(); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemViewerHopping.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemInterfaceHopping.java similarity index 80% rename from src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemViewerHopping.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemInterfaceHopping.java index f5e98360c..a7d1ea150 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemViewerHopping.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemInterfaceHopping.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.blocks; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemViewerHopping; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemInterfaceHopping; import net.minecraft.block.BlockState; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; @@ -18,8 +18,8 @@ import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; -public class BlockItemViewerHopping extends BlockItemViewer { - public BlockItemViewerHopping() { +public class BlockItemInterfaceHopping extends BlockItemInterface { + public BlockItemInterfaceHopping() { super(); } @@ -30,6 +30,6 @@ public class BlockItemViewerHopping extends BlockItemViewer { @Override public TileEntity createNewTileEntity(IBlockReader worldIn) { - return new TileEntityItemViewerHopping(); + return new TileEntityItemInterfaceHopping(); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/CrystalClusterBlock.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/CrystalClusterBlock.java new file mode 100644 index 000000000..638a9ca42 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/CrystalClusterBlock.java @@ -0,0 +1,69 @@ +/* + * This file ("BlockCrystalCluster.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2017 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.blocks; + +import de.ellpeck.actuallyadditions.mod.blocks.base.FullyDirectionalBlock; +import de.ellpeck.actuallyadditions.mod.items.metalists.Crystals; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.state.DirectionProperty; +import net.minecraft.state.StateContainer; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.util.Direction; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.shapes.IBooleanFunction; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.world.IBlockReader; + +import java.util.stream.Stream; + +public class CrystalClusterBlock extends FullyDirectionalBlock { + public static final DirectionProperty FACING = BlockStateProperties.FACING; + + public static final VoxelShape CRYSTAL_SHAPE = Stream.of( + Block.makeCuboidShape(5, 4, 5, 10, 19, 10), Block.makeCuboidShape(4, 0, 4, 11, 5, 11), + Block.makeCuboidShape(3, 0, 3, 5, 4, 5), Block.makeCuboidShape(10, 0, 3, 12, 2, 5), + Block.makeCuboidShape(12, 0, 4, 13, 1, 5), Block.makeCuboidShape(11, 0, 5, 12, 1, 6), + Block.makeCuboidShape(10, 0, 10, 12, 3, 12), Block.makeCuboidShape(3, 0, 10, 5, 1, 12), + Block.makeCuboidShape(9, 0, 3, 10, 3, 4), Block.makeCuboidShape(8, 0, 2, 11, 1, 4), + Block.makeCuboidShape(4, 0, 2, 5, 2, 3), Block.makeCuboidShape(5, 0, 3, 7, 1, 4), + Block.makeCuboidShape(2, 0, 4, 4, 1, 6), Block.makeCuboidShape(3, 0, 5, 4, 3, 6.5), + Block.makeCuboidShape(3, 0, 9, 4, 2, 10), Block.makeCuboidShape(2, 0, 8, 4, 1, 10), + Block.makeCuboidShape(5, 0, 11, 7, 2, 13), Block.makeCuboidShape(7, 0, 11, 11, 1, 13), + Block.makeCuboidShape(10, 0, 9, 13, 1, 11), Block.makeCuboidShape(11, 0, 7, 12, 3, 9) + ).reduce((v1, v2) -> {return VoxelShapes.combineAndSimplify(v1, v2, IBooleanFunction.OR);}).get(); + + public CrystalClusterBlock(Crystals crystal) { + super(Properties.create(Material.GLASS) + .setLightLevel((e) -> 7) + .sound(SoundType.GLASS) + .hardnessAndResistance(0.25f, 1.0f)); + } + + @Override + public BlockState getBaseConstructorState() { + return this.stateContainer.getBaseState().with(FACING, Direction.UP); + } + + @Override + public boolean isTransparent(BlockState state) { + return true; + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { + return CRYSTAL_SHAPE; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/IActuallyBlock.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/IActuallyBlock.java new file mode 100644 index 000000000..fca0054a3 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/IActuallyBlock.java @@ -0,0 +1,20 @@ +package de.ellpeck.actuallyadditions.mod.blocks; + +import net.minecraft.item.Item; + +public interface IActuallyBlock { + /** + * Defaults to the default class for mc. Don't run this other than on setup + * + * @return this blocks item pair + */ + AABlockItem createBlockItem(); + + /** + * Defines the Block Item properties for all non-custom block items. + * + * @return block item properties for default block item. + * @see for implementation {@link #createBlockItem()} + */ + Item.Properties getItemProperties(); +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockFluidFlowing.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockFluidFlowing.java index f17de6cdf..c981790cd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockFluidFlowing.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockFluidFlowing.java @@ -12,10 +12,7 @@ package de.ellpeck.actuallyadditions.mod.blocks.base; import net.minecraft.block.material.Material; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.fluids.BlockFluidClassic; -import net.minecraftforge.fluids.Fluid; public class BlockFluidFlowing extends BlockFluidClassic implements ItemBlockBase.ICustomRarity { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/FullyDirectionalBlock.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/FullyDirectionalBlock.java index 9cd34f472..c04d9cf15 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/FullyDirectionalBlock.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/FullyDirectionalBlock.java @@ -25,6 +25,10 @@ public abstract class FullyDirectionalBlock extends BlockBase { } + public BlockState getBaseConstructorState() { + return this.stateContainer.getBaseState().with(FACING, Direction.NORTH); + } + @Override protected void fillStateContainer(StateContainer.Builder builder) { builder.add(FACING); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java index 558d156a0..6c90eb179 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -199,7 +199,7 @@ public final class InitBooklet { //No RF Using Blocks new BookletChapter("breaker", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyBlocks.BREAKER.get()), new PageCrafting(1, BlockCrafting.recipeBreaker).setWildcard(), new PageCrafting(2, BlockCrafting.recipePlacer).setWildcard(), new PageCrafting(3, BlockCrafting.recipeLiquidPlacer).setWildcard(), new PageCrafting(4, BlockCrafting.recipeLiquidCollector).setWildcard()); new BookletChapter("dropper", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyBlocks.DROPPER.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeDropper).setNoText()); - new BookletChapter("phantomfaces", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyBlocks.PHANTOM_LIQUIFACE.get()), new PageTextOnly(1).addTextReplacement("", TileEntityPhantomface.RANGE), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipePhantomface), new PageCrafting(4, BlockCrafting.recipeLiquiface), new PageCrafting(5, BlockCrafting.recipeEnergyface), new PageCrafting(6, ItemCrafting.recipePhantomConnector).setNoText(), new PageCrafting(7, BlockCrafting.recipePhantomBooster)).setImportant(); + new BookletChapter("phantomfaces", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyBlocks.PHANTOM_LIQUIFACE.get()), new PageTextOnly(1).addTextReplacement("", TileEntityPhantomFace.RANGE), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipePhantomface), new PageCrafting(4, BlockCrafting.recipeLiquiface), new PageCrafting(5, BlockCrafting.recipeEnergyface), new PageCrafting(6, ItemCrafting.recipePhantomConnector).setNoText(), new PageCrafting(7, BlockCrafting.recipePhantomBooster)).setImportant(); new BookletChapter("phantomRedstoneface", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyBlocks.PHANTOM_REDSTONEFACE.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipePhantomRedstoneface).setNoText()); new BookletChapter("phantomBreaker", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyBlocks.PHANTOM_BREAKER.get()), new PageTextOnly(1).addTextReplacement("", TileEntityPhantomPlacer.RANGE), new PageCrafting(2, BlockCrafting.recipePhantomPlacer).setNoText(), new PageCrafting(3, BlockCrafting.recipePhantomBreaker).setNoText()); new BookletChapter("esd", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyBlocks.INPUTTER_ADVANCED.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeESD).setNoText(), new PageCrafting(3, BlockCrafting.recipeAdvancedESD).setNoText()).setSpecial(); @@ -219,7 +219,7 @@ public final class InitBooklet { new BookletChapterCoffee("coffeeMachine", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.COFFEE_MACHINE.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(ActuallyItems.COFFEE_BEANS.get())).addTextReplacement("", TileEntityCoffeeMachine.ENERGY_USED).addTextReplacement("", TileEntityCoffeeMachine.CACHE_USE).addTextReplacement("", TileEntityCoffeeMachine.WATER_USE), new PageTextOnly(2).addItemsToPage(new ItemStack(ActuallyItems.COFFEE.get())), new PagePicture(3, "page_coffee_machine", 115), new PageCrafting(4, BlockCrafting.recipeCoffeeMachine).setWildcard().setNoText(), new PageCrafting(5, ItemCrafting.recipeCup).setNoText()).setImportant(); List list = new ArrayList<>(); - list.add(new PageTextOnly(1).addTextReplacement("", TileEntityGrinder.ENERGY_USE)); + list.add(new PageTextOnly(1).addTextReplacement("", TileEntityCrusher.ENERGY_USE)); list.add(new PageCrafting(2, BlockCrafting.recipeCrusher).setWildcard().setNoText()); list.add(new PageCrafting(3, BlockCrafting.recipeDoubleCrusher).setWildcard().setNoText()); if (CrusherCrafting.recipeIronHorseArmor != null) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiEntry.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiEntry.java index b90d0a057..27a122548 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiEntry.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiEntry.java @@ -20,6 +20,7 @@ import de.ellpeck.actuallyadditions.mod.booklet.misc.BookletUtils; import net.minecraft.client.gui.screen.Screen; import net.minecraft.item.ItemStack; import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import java.io.IOException; import java.util.List; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGrinder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGrinder.java index d56a777ac..de87989b9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGrinder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGrinder.java @@ -13,7 +13,7 @@ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotItemHandlerUnconditioned; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; import de.ellpeck.actuallyadditions.mod.recipe.CrusherRecipeRegistry; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinder; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityCrusher; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; @@ -25,31 +25,31 @@ import net.minecraft.network.PacketBuffer; import java.util.Objects; public class ContainerGrinder extends Container { - public final TileEntityGrinder tileGrinder; + public final TileEntityCrusher tileGrinder; public final boolean isDouble; public static ContainerGrinder fromNetwork(int windowId, PlayerInventory inv, PacketBuffer data) { - return new ContainerGrinder(windowId, inv, (TileEntityGrinder) Objects.requireNonNull(inv.player.world.getTileEntity(data.readBlockPos()))); + return new ContainerGrinder(windowId, inv, (TileEntityCrusher) Objects.requireNonNull(inv.player.world.getTileEntity(data.readBlockPos()))); } - public ContainerGrinder(int windowId, PlayerInventory inventory, TileEntityGrinder tile) { + public ContainerGrinder(int windowId, PlayerInventory inventory, TileEntityCrusher tile) { super(ActuallyContainers.GRINDER_CONTAINER.get(), windowId); this.tileGrinder = tile; this.isDouble = tile.isDouble; - this.addSlot(new SlotItemHandlerUnconditioned(this.tileGrinder.inv, TileEntityGrinder.SLOT_INPUT_1, this.isDouble + this.addSlot(new SlotItemHandlerUnconditioned(this.tileGrinder.inv, TileEntityCrusher.SLOT_INPUT_1, this.isDouble ? 51 : 80, 21)); - this.addSlot(new SlotOutput(this.tileGrinder.inv, TileEntityGrinder.SLOT_OUTPUT_1_1, this.isDouble + this.addSlot(new SlotOutput(this.tileGrinder.inv, TileEntityCrusher.SLOT_OUTPUT_1_1, this.isDouble ? 37 : 66, 69)); - this.addSlot(new SlotOutput(this.tileGrinder.inv, TileEntityGrinder.SLOT_OUTPUT_1_2, this.isDouble + this.addSlot(new SlotOutput(this.tileGrinder.inv, TileEntityCrusher.SLOT_OUTPUT_1_2, this.isDouble ? 64 : 92, 69)); if (this.isDouble) { - this.addSlot(new SlotItemHandlerUnconditioned(this.tileGrinder.inv, TileEntityGrinder.SLOT_INPUT_2, 109, 21)); - this.addSlot(new SlotOutput(this.tileGrinder.inv, TileEntityGrinder.SLOT_OUTPUT_2_1, 96, 69)); - this.addSlot(new SlotOutput(this.tileGrinder.inv, TileEntityGrinder.SLOT_OUTPUT_2_2, 121, 69)); + this.addSlot(new SlotItemHandlerUnconditioned(this.tileGrinder.inv, TileEntityCrusher.SLOT_INPUT_2, 109, 21)); + this.addSlot(new SlotOutput(this.tileGrinder.inv, TileEntityCrusher.SLOT_OUTPUT_2_1, 96, 69)); + this.addSlot(new SlotOutput(this.tileGrinder.inv, TileEntityCrusher.SLOT_OUTPUT_2_2, 121, 69)); } for (int i = 0; i < 3; i++) { @@ -78,7 +78,7 @@ public class ContainerGrinder extends Container { ItemStack currentStack = newStack.copy(); //Slots in Inventory to shift from - if (slot == TileEntityGrinder.SLOT_OUTPUT_1_1 || slot == TileEntityGrinder.SLOT_OUTPUT_1_2 || this.isDouble && (slot == TileEntityGrinder.SLOT_OUTPUT_2_1 || slot == TileEntityGrinder.SLOT_OUTPUT_2_2)) { + if (slot == TileEntityCrusher.SLOT_OUTPUT_1_1 || slot == TileEntityCrusher.SLOT_OUTPUT_1_2 || this.isDouble && (slot == TileEntityCrusher.SLOT_OUTPUT_2_1 || slot == TileEntityCrusher.SLOT_OUTPUT_2_2)) { if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, true)) { return StackUtil.getEmpty(); } @@ -88,9 +88,9 @@ public class ContainerGrinder extends Container { else if (slot >= inventoryStart) { //Shift from Inventory if (CrusherRecipeRegistry.getRecipeFromInput(newStack) != null) { - if (!this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_1, TileEntityGrinder.SLOT_INPUT_1 + 1, false)) { + if (!this.mergeItemStack(newStack, TileEntityCrusher.SLOT_INPUT_1, TileEntityCrusher.SLOT_INPUT_1 + 1, false)) { if (this.isDouble) { - if (!this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_2, TileEntityGrinder.SLOT_INPUT_2 + 1, false)) { + if (!this.mergeItemStack(newStack, TileEntityCrusher.SLOT_INPUT_2, TileEntityCrusher.SLOT_INPUT_2 + 1, false)) { return StackUtil.getEmpty(); } } else { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGrinder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGrinder.java index 8149a8c01..f23866855 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGrinder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGrinder.java @@ -15,7 +15,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.inventory.ContainerGrinder; import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinder; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityCrusher; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.gui.widget.button.Button; @@ -35,7 +35,7 @@ public class GuiGrinder extends GuiWtfMojang { private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_grinder"); private static final ResourceLocation RES_LOC_DOUBLE = AssetUtil.getGuiLocation("gui_grinder_double"); - private final TileEntityGrinder tileGrinder; + private final TileEntityCrusher tileGrinder; private final boolean isDouble; private EnergyDisplay energy; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheCrystals.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/Crystals.java similarity index 88% rename from src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheCrystals.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/Crystals.java index 7d9465470..b7c03c318 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheCrystals.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/Crystals.java @@ -12,9 +12,7 @@ package de.ellpeck.actuallyadditions.mod.items.metalists; import net.minecraft.util.IStringSerializable; -@Deprecated -public enum TheCrystals implements IStringSerializable { - +public enum Crystals implements IStringSerializable { REDSTONE("red", 0xFF2F21, 158F / 255F, 43F / 255F, 39F / 255F), LAPIS("blue", 0x5171FF, 37F / 255F, 49F / 255F, 147F / 255F), DIAMOND("light_blue", 0x35F1FF, 99F / 255F, 135F / 255F, 210F / 255F), @@ -26,7 +24,7 @@ public enum TheCrystals implements IStringSerializable { public final float[] conversionColorParticles; public final int clusterColor; - TheCrystals(String name, int clusterColor, float... conversionColorParticles) { + Crystals(String name, int clusterColor, float... conversionColorParticles) { this.name = name; this.conversionColorParticles = conversionColorParticles; this.clusterColor = clusterColor; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/ActuallyTiles.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/ActuallyTiles.java index 9d0cdafa1..308ddd3ff 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/ActuallyTiles.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/ActuallyTiles.java @@ -11,58 +11,58 @@ public class ActuallyTiles { public static final DeferredRegister> TILES = DeferredRegister.create(ForgeRegistries.TILE_ENTITIES, ActuallyAdditions.MODID); // public static final RegistryObject<,> COMPOST_TILE = TILES.register("compost", () -> TileEntityType.Builder.create(TileEntityCompost::new, InitBlocks.blockCompost.get()).build(null)); - public static final RegistryObject> FEEDER_TILE = TILES.register("feeder", () -> TileEntityType.Builder.create(TileEntityFeeder::new, ActuallyBlocks.FEEDER.get()).build(null)); + //public static final RegistryObject> FEEDER_TILE = TILES.register("feeder", () -> TileEntityType.Builder.create(TileEntityFeeder::new, ActuallyBlocks.FEEDER.get()).build(null)); // public static final RegistryObject> GIANTCHEST_TILE = TILES.register("", () -> TileEntityType.Builder.create(TileEntityGiantChest::new, ).build(null)); // public static final RegistryObject> GIANTCHESTMEDIUM_TILE = TILES.register("", () -> TileEntityType.Builder.create(TileEntityGiantChestMedium::new, ).build(null)); // public static final RegistryObject> GIANTCHESTLARGE_TILE = TILES.register("", () -> TileEntityType.Builder.create(TileEntityGiantChestLarge::new, ).build(null)); - public static final RegistryObject> GRINDER_TILE = TILES.register("grinder", () -> TileEntityType.Builder.create(TileEntityGrinder::new, ActuallyBlocks.GRINDER.get()).build(null)); - public static final RegistryObject> FURNACE_DOUBLE_TILE = TILES.register("furnaceDouble", () -> TileEntityType.Builder.create(TileEntityFurnaceDouble::new, ActuallyBlocks.FURNACE_DOUBLE.get()).build(null)); - public static final RegistryObject> INPUTTER_TILE = TILES.register("inputter", () -> TileEntityType.Builder.create(TileEntityInputter::new, ActuallyBlocks.INPUTTER.get()).build(null)); + //public static final RegistryObject> GRINDER_TILE = TILES.register("grinder", () -> TileEntityType.Builder.create(TileEntityCrusher::new, ActuallyBlocks.GRINDER.get()).build(null)); + //public static final RegistryObject> FURNACE_DOUBLE_TILE = TILES.register("furnaceDouble", () -> TileEntityType.Builder.create(TileEntityFurnaceDouble::new, ActuallyBlocks.FURNACE_DOUBLE.get()).build(null)); + //public static final RegistryObject> INPUTTER_TILE = TILES.register("inputter", () -> TileEntityType.Builder.create(TileEntityInputter::new, ActuallyBlocks.INPUTTER.get()).build(null)); // public static final RegistryObject> SOLAR_TILE = TILES.register("solarPanel", () -> TileEntityType.Builder.create(TileEntityFurnaceSolar::new, ActuallyBlocks.blockFurnaceSolar.get()).build(null)); public static final RegistryObject> HEATCOLLECTOR_TILE = TILES.register("heatCollector", () -> TileEntityType.Builder.create(TileEntityHeatCollector::new, ActuallyBlocks.HEAT_COLLECTOR.get()).build(null)); - public static final RegistryObject> BREAKER_TILE = TILES.register("breaker", () -> TileEntityType.Builder.create(TileEntityBreaker::new, ActuallyBlocks.BREAKER.get()).build(null)); - public static final RegistryObject> DROPPER_TILE = TILES.register("dropper", () -> TileEntityType.Builder.create(TileEntityDropper::new, ActuallyBlocks.DROPPER.get()).build(null)); - public static final RegistryObject> INPUTTERADVANCED_TILE = TILES.register("inputterAdvanced", () -> TileEntityType.Builder.create(TileEntityInputterAdvanced::new, ActuallyBlocks.INPUTTER_ADVANCED.get()).build(null)); - public static final RegistryObject> PLACER_TILE = TILES.register("placer", () -> TileEntityType.Builder.create(TileEntityPlacer::new, ActuallyBlocks.PLACER.get()).build(null)); - public static final RegistryObject> GRINDER_DOUBLE_TILE = TILES.register("grinderDouble", () -> TileEntityType.Builder.create(TileEntityGrinderDouble::new, ActuallyBlocks.GRINDER_DOUBLE.get()).build(null)); - public static final RegistryObject> CANOLAPRESS_TILE = TILES.register("canolaPress", () -> TileEntityType.Builder.create(TileEntityCanolaPress::new, ActuallyBlocks.CANOLA_PRESS.get()).build(null)); + //public static final RegistryObject> BREAKER_TILE = TILES.register("breaker", () -> TileEntityType.Builder.create(TileEntityBreaker::new, ActuallyBlocks.BREAKER.get()).build(null)); + //public static final RegistryObject> DROPPER_TILE = TILES.register("dropper", () -> TileEntityType.Builder.create(TileEntityDropper::new, ActuallyBlocks.DROPPER.get()).build(null)); + //public static final RegistryObject> INPUTTERADVANCED_TILE = TILES.register("inputterAdvanced", () -> TileEntityType.Builder.create(TileEntityInputterAdvanced::new, ActuallyBlocks.INPUTTER_ADVANCED.get()).build(null)); + //public static final RegistryObject> PLACER_TILE = TILES.register("placer", () -> TileEntityType.Builder.create(TileEntityPlacer::new, ActuallyBlocks.PLACER.get()).build(null)); + //public static final RegistryObject> GRINDER_DOUBLE_TILE = TILES.register("grinderDouble", () -> TileEntityType.Builder.create(TileEntityCrusherDouble::new, ActuallyBlocks.GRINDER_DOUBLE.get()).build(null)); + //public static final RegistryObject> CANOLAPRESS_TILE = TILES.register("canolaPress", () -> TileEntityType.Builder.create(TileEntityCanolaPress::new, ActuallyBlocks.CANOLA_PRESS.get()).build(null)); public static final RegistryObject> FERMENTINGBARREL_TILE = TILES.register("fermentingBarrel", () -> TileEntityType.Builder.create(TileEntityFermentingBarrel::new, ActuallyBlocks.FERMENTING_BARREL.get()).build(null)); public static final RegistryObject> OILGENERATOR_TILE = TILES.register("oilGenerator", () -> TileEntityType.Builder.create(TileEntityOilGenerator::new, ActuallyBlocks.OIL_GENERATOR.get()).build(null)); public static final RegistryObject> COALGENERATOR_TILE = TILES.register("coalGenerator", () -> TileEntityType.Builder.create(TileEntityCoalGenerator::new, ActuallyBlocks.COAL_GENERATOR.get()).build(null)); - public static final RegistryObject> PHANTOMITEMFACE_TILE = TILES.register("phantomface", () -> TileEntityType.Builder.create(TileEntityPhantomItemface::new, ActuallyBlocks.PHANTOMFACE.get()).build(null)); - public static final RegistryObject> PHANTOMLIQUIFACE_TILE = TILES.register("liquiface", () -> TileEntityType.Builder.create(TileEntityPhantomLiquiface::new, ActuallyBlocks.PHANTOM_LIQUIFACE.get()).build(null)); - public static final RegistryObject> PHANTOMENERGYFACE_TILE = TILES.register("energyface", () -> TileEntityType.Builder.create(TileEntityPhantomEnergyface::new, ActuallyBlocks.PHANTOM_ENERGYFACE.get()).build(null)); - public static final RegistryObject> PLAYERINTERFACE_TILE = TILES.register("playerInterface", () -> TileEntityType.Builder.create(TileEntityPlayerInterface::new, ActuallyBlocks.PLAYER_INTERFACE.get()).build(null)); - public static final RegistryObject> PHANTOMPLACER_TILE = TILES.register("phantomPlacer", () -> TileEntityType.Builder.create(TileEntityPhantomPlacer::new, ActuallyBlocks.PHANTOM_PLACER.get()).build(null)); - public static final RegistryObject> PHANTOMBREAKER_TILE = TILES.register("phantomBreaker", () -> TileEntityType.Builder.create(TileEntityPhantomBreaker::new, ActuallyBlocks.PHANTOM_BREAKER.get()).build(null)); - public static final RegistryObject> FLUIDCOLLECTOR_TILE = TILES.register("fluidCollector", () -> TileEntityType.Builder.create(TileEntityFluidCollector::new, ActuallyBlocks.FLUID_COLLECTOR.get()).build(null)); - public static final RegistryObject> FLUIDPLACER_TILE = TILES.register("fluidPlacer", () -> TileEntityType.Builder.create(TileEntityFluidPlacer::new, ActuallyBlocks.FLUID_PLACER.get()).build(null)); - public static final RegistryObject> LAVAFACTORYCONTROLLER_TILE = TILES.register("lavaFactory", () -> TileEntityType.Builder.create(TileEntityLavaFactoryController::new, ActuallyBlocks.LAVA_FACTORY_CONTROLLER.get()).build(null)); + //public static final RegistryObject> PHANTOMITEMFACE_TILE = TILES.register("phantomface", () -> TileEntityType.Builder.create(TileEntityPhantomItemface::new, ActuallyBlocks.PHANTOMFACE.get()).build(null)); + //public static final RegistryObject> PHANTOMLIQUIFACE_TILE = TILES.register("liquiface", () -> TileEntityType.Builder.create(TileEntityPhantomLiquiface::new, ActuallyBlocks.PHANTOM_LIQUIFACE.get()).build(null)); + //public static final RegistryObject> PHANTOMENERGYFACE_TILE = TILES.register("energyface", () -> TileEntityType.Builder.create(TileEntityPhantomEnergyface::new, ActuallyBlocks.PHANTOM_ENERGYFACE.get()).build(null)); + //public static final RegistryObject> PLAYERINTERFACE_TILE = TILES.register("playerInterface", () -> TileEntityType.Builder.create(TileEntityPlayerInterface::new, ActuallyBlocks.PLAYER_INTERFACE.get()).build(null)); + //public static final RegistryObject> PHANTOMPLACER_TILE = TILES.register("phantomPlacer", () -> TileEntityType.Builder.create(TileEntityPhantomPlacer::new, ActuallyBlocks.PHANTOM_PLACER.get()).build(null)); + //public static final RegistryObject> PHANTOMBREAKER_TILE = TILES.register("phantomBreaker", () -> TileEntityType.Builder.create(TileEntityPhantomBreaker::new, ActuallyBlocks.PHANTOM_BREAKER.get()).build(null)); + //public static final RegistryObject> FLUIDCOLLECTOR_TILE = TILES.register("fluidCollector", () -> TileEntityType.Builder.create(TileEntityFluidCollector::new, ActuallyBlocks.FLUID_COLLECTOR.get()).build(null)); + //public static final RegistryObject> FLUIDPLACER_TILE = TILES.register("fluidPlacer", () -> TileEntityType.Builder.create(TileEntityFluidPlacer::new, ActuallyBlocks.FLUID_PLACER.get()).build(null)); + //public static final RegistryObject> LAVAFACTORYCONTROLLER_TILE = TILES.register("lavaFactory", () -> TileEntityType.Builder.create(TileEntityLavaFactoryController::new, ActuallyBlocks.LAVA_FACTORY_CONTROLLER.get()).build(null)); public static final RegistryObject> COFFEEMACHINE_TILE = TILES.register("coffeeMachine", () -> TileEntityType.Builder.create(TileEntityCoffeeMachine::new, ActuallyBlocks.COFFEE_MACHINE.get()).build(null)); public static final RegistryObject> PHANTOM_BOOSTER_TILE = TILES.register("phantomBooster", () -> TileEntityType.Builder.create(TileEntityPhantomBooster::new, ActuallyBlocks.PHANTOM_BOOSTER.get()).build(null)); - public static final RegistryObject> ENERGIZER_TILE = TILES.register("energizer", () -> TileEntityType.Builder.create(TileEntityEnergizer::new, ActuallyBlocks.ENERGIZER.get()).build(null)); - public static final RegistryObject> ENERVATOR_TILE = TILES.register("enervator", () -> TileEntityType.Builder.create(TileEntityEnervator::new, ActuallyBlocks.ENERVATOR.get()).build(null)); - public static final RegistryObject> XPSOLIDIFIER_TILE = TILES.register("xpSolidifier", () -> TileEntityType.Builder.create(TileEntityXPSolidifier::new, ActuallyBlocks.XP_SOLIDIFIER.get()).build(null)); + //public static final RegistryObject> ENERGIZER_TILE = TILES.register("energizer", () -> TileEntityType.Builder.create(TileEntityEnergizer::new, ActuallyBlocks.ENERGIZER.get()).build(null)); + //public static final RegistryObject> ENERVATOR_TILE = TILES.register("enervator", () -> TileEntityType.Builder.create(TileEntityEnervator::new, ActuallyBlocks.ENERVATOR.get()).build(null)); + //public static final RegistryObject> XPSOLIDIFIER_TILE = TILES.register("xpSolidifier", () -> TileEntityType.Builder.create(TileEntityXPSolidifier::new, ActuallyBlocks.XP_SOLIDIFIER.get()).build(null)); // public static final RegistryObject<.> SMILEYCLOUD_TILE = TILES.register("", () -> TileEntityType.Builder.create(TileEntitySmileyCloud::new, InitBlocks.blockSmileyCloud.get()).build(null)); - public static final RegistryObject> LEAFGENERATOR_TILE = TILES.register("leafGenerator", () -> TileEntityType.Builder.create(TileEntityLeafGenerator::new, ActuallyBlocks.LEAF_GENERATOR.get()).build(null)); + //public static final RegistryObject> LEAFGENERATOR_TILE = TILES.register("leafGenerator", () -> TileEntityType.Builder.create(TileEntityLeafGenerator::new, ActuallyBlocks.LEAF_GENERATOR.get()).build(null)); public static final RegistryObject> DIRECTIONALBREAKER_TILE = TILES.register("directionalBreaker", () -> TileEntityType.Builder.create(TileEntityDirectionalBreaker::new, ActuallyBlocks.DIRECTIONAL_BREAKER.get()).build(null)); public static final RegistryObject> RANGEDCOLLECTOR_TILE = TILES.register("rangedCollector", () -> TileEntityType.Builder.create(TileEntityRangedCollector::new, ActuallyBlocks.RANGED_COLLECTOR.get()).build(null)); public static final RegistryObject> ATOMICRECONSTRUCTOR_TILE = TILES.register("reconstructor", () -> TileEntityType.Builder.create(TileEntityAtomicReconstructor::new, ActuallyBlocks.ATOMIC_RECONSTRUCTOR.get()).build(null)); public static final RegistryObject> MINER_TILE = TILES.register("miner", () -> TileEntityType.Builder.create(TileEntityMiner::new, ActuallyBlocks.MINER.get()).build(null)); public static final RegistryObject> FIREWORKBOX_TILE = TILES.register("fireworkBox", () -> TileEntityType.Builder.create(TileEntityFireworkBox::new, ActuallyBlocks.FIREWORK_BOX.get()).build(null)); - public static final RegistryObject> PHANTOMREDSTONEFACE_TILE = TILES.register("redstoneface", () -> TileEntityType.Builder.create(TileEntityPhantomRedstoneface::new, ActuallyBlocks.PHANTOM_REDSTONEFACE.get()).build(null)); + //public static final RegistryObject> PHANTOMREDSTONEFACE_TILE = TILES.register("redstoneface", () -> TileEntityType.Builder.create(TileEntityPhantomRedstoneface::new, ActuallyBlocks.PHANTOM_REDSTONEFACE.get()).build(null)); public static final RegistryObject> LASERRELAYITEM_TILE = TILES.register("laserRelayItem", () -> TileEntityType.Builder.create(TileEntityLaserRelayItem::new, ActuallyBlocks.LASER_RELAY_ITEM.get()).build(null)); public static final RegistryObject> LASERRELAYENERGY_TILE = TILES.register("laserRelay", () -> TileEntityType.Builder.create(TileEntityLaserRelayEnergy::new, ActuallyBlocks.LASER_RELAY.get()).build(null)); public static final RegistryObject> LASERRELAYENERGYADVANCED_TILE = TILES.register("laserRelayAdvanced", () -> TileEntityType.Builder.create(TileEntityLaserRelayEnergyAdvanced::new, ActuallyBlocks.LASER_RELAY_ADVANCED.get()).build(null)); public static final RegistryObject> LASERRELAYENERGYEXTREME_TILE = TILES.register("laserRelayExtreme", () -> TileEntityType.Builder.create(TileEntityLaserRelayEnergyExtreme::new, ActuallyBlocks.LASER_RELAY_EXTREME.get()).build(null)); public static final RegistryObject> LASERRELAYITEMWHITELIST_TILE = TILES.register("laserRelayItemWhitelist", () -> TileEntityType.Builder.create(TileEntityLaserRelayItemWhitelist::new, ActuallyBlocks.LASER_RELAY_ITEM_WHITELIST.get()).build(null)); - public static final RegistryObject> ITEMVIEWER_TILE = TILES.register("itemViewer", () -> TileEntityType.Builder.create(TileEntityItemViewer::new, ActuallyBlocks.ITEM_VIEWER.get()).build(null)); - public static final RegistryObject> DISPLAYSTAND_TILE = TILES.register("displayStand", () -> TileEntityType.Builder.create(TileEntityDisplayStand::new, ActuallyBlocks.DISPLAY_STAND.get()).build(null)); + //public static final RegistryObject> ITEMVIEWER_TILE = TILES.register("itemViewer", () -> TileEntityType.Builder.create(TileEntityItemInterface::new, ActuallyBlocks.ITEM_VIEWER.get()).build(null)); + //public static final RegistryObject> DISPLAYSTAND_TILE = TILES.register("displayStand", () -> TileEntityType.Builder.create(TileEntityDisplayStand::new, ActuallyBlocks.DISPLAY_STAND.get()).build(null)); public static final RegistryObject> SHOCKSUPPRESSOR_TILE = TILES.register("shockSuppressor", () -> TileEntityType.Builder.create(TileEntityShockSuppressor::new, ActuallyBlocks.SHOCK_SUPPRESSOR.get()).build(null)); - public static final RegistryObject> EMPOWERER_TILE = TILES.register("empowerer", () -> TileEntityType.Builder.create(TileEntityEmpowerer::new, ActuallyBlocks.EMPOWERER.get()).build(null)); + //public static final RegistryObject> EMPOWERER_TILE = TILES.register("empowerer", () -> TileEntityType.Builder.create(TileEntityEmpowerer::new, ActuallyBlocks.EMPOWERER.get()).build(null)); public static final RegistryObject> LASERRELAYFLUIDS_TILE = TILES.register("laserRelayFluids", () -> TileEntityType.Builder.create(TileEntityLaserRelayFluids::new, ActuallyBlocks.LASER_RELAY_FLUIDS.get()).build(null)); - public static final RegistryObject> BIOREACTOR_TILE = TILES.register("bioReactor", () -> TileEntityType.Builder.create(TileEntityBioReactor::new, ActuallyBlocks.BIOREACTOR.get()).build(null)); - public static final RegistryObject> FARMER_TILE = TILES.register("farmer", () -> TileEntityType.Builder.create(TileEntityFarmer::new, ActuallyBlocks.FARMER.get()).build(null)); - public static final RegistryObject> ITEMVIEWERHOPPING_TILE = TILES.register("itemViewerHopping", () -> TileEntityType.Builder.create(TileEntityItemViewerHopping::new, ActuallyBlocks.ITEM_VIEWER.get()).build(null)); - public static final RegistryObject> BATTERYBOX_TILE = TILES.register("batteryBox", () -> TileEntityType.Builder.create(TileEntityBatteryBox::new, ActuallyBlocks.BATTERY_BOX.get()).build(null)); + //public static final RegistryObject> BIOREACTOR_TILE = TILES.register("bioReactor", () -> TileEntityType.Builder.create(TileEntityBioReactor::new, ActuallyBlocks.BIOREACTOR.get()).build(null)); + //public static final RegistryObject> FARMER_TILE = TILES.register("farmer", () -> TileEntityType.Builder.create(TileEntityFarmer::new, ActuallyBlocks.FARMER.get()).build(null)); + //public static final RegistryObject> ITEMVIEWERHOPPING_TILE = TILES.register("itemViewerHopping", () -> TileEntityType.Builder.create(TileEntityItemInterfaceHopping::new, ActuallyBlocks.ITEM_VIEWER.get()).build(null)); + //public static final RegistryObject> BATTERYBOX_TILE = TILES.register("batteryBox", () -> TileEntityType.Builder.create(TileEntityBatteryBox::new, ActuallyBlocks.BATTERY_BOX.get()).build(null)); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCrusher.java similarity index 98% rename from src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCrusher.java index cd1bb4cc8..24d236036 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCrusher.java @@ -37,7 +37,7 @@ import net.minecraftforge.energy.IEnergyStorage; import javax.annotation.Nullable; -public class TileEntityGrinder extends TileEntityInventoryBase implements IButtonReactor, INamedContainerProvider { +public class TileEntityCrusher extends TileEntityInventoryBase implements IButtonReactor, INamedContainerProvider { public static final int SLOT_INPUT_1 = 0; public static final int SLOT_OUTPUT_1_1 = 1; @@ -58,11 +58,11 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IButto private boolean lastAutoSplit; private boolean lastCrushed; - public TileEntityGrinder(TileEntityType type, int slots) { + public TileEntityCrusher(TileEntityType type, int slots) { super(type, slots); } - public TileEntityGrinder() { + public TileEntityCrusher() { super(ActuallyTiles.GRINDER_TILE.get(), 3); this.isDouble = false; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinderDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCrusherDouble.java similarity index 82% rename from src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinderDouble.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCrusherDouble.java index b4cba13e3..1f5c9a4c0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinderDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCrusherDouble.java @@ -10,9 +10,9 @@ package de.ellpeck.actuallyadditions.mod.tile; -public class TileEntityGrinderDouble extends TileEntityGrinder { +public class TileEntityCrusherDouble extends TileEntityCrusher { - public TileEntityGrinderDouble() { + public TileEntityCrusherDouble() { super(ActuallyTiles.GRINDER_DOUBLE_TILE.get(), 6); this.isDouble = true; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java index 1fccea4f6..c965defa0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java @@ -97,7 +97,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt ? null : this.leftFilter); - if (this.placeToPull instanceof TileEntityItemViewer) { + if (this.placeToPull instanceof TileEntityItemInterface) { break; } } @@ -109,7 +109,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt for (Direction side : this.placeToPut.keySet()) { WorldUtil.doItemInteraction(this.wrapper, this.placeToPut.get(side), Integer.MAX_VALUE, 0, 1, this.slotToPutStart, this.slotToPutEnd, null); - if (this.placeToPut instanceof TileEntityItemViewer) { + if (this.placeToPut instanceof TileEntityItemInterface) { break; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemInterface.java old mode 100755 new mode 100644 similarity index 91% rename from src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemInterface.java index 5593004ca..df99f735b --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemInterface.java @@ -32,7 +32,7 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.*; -public class TileEntityItemViewer extends TileEntityBase { +public class TileEntityItemInterface extends TileEntityBase { public final List genericInfos = new ArrayList<>(); public final Map itemHandlerInfos = new HashMap<>(); @@ -43,18 +43,18 @@ public class TileEntityItemViewer extends TileEntityBase { private int lastNetworkChangeAmount = -1; private int slotCount; - public TileEntityItemViewer(TileEntityType type) { + public TileEntityItemInterface(TileEntityType type) { super(type); IItemHandler normalHandler = new IItemHandler() { @Override public int getSlots() { - return TileEntityItemViewer.this.getSlotCount(); + return TileEntityItemInterface.this.getSlotCount(); } @Override public ItemStack getStackInSlot(int slot) { - IItemHandlerInfo handler = TileEntityItemViewer.this.getSwitchedIndexHandler(slot); + IItemHandlerInfo handler = TileEntityItemInterface.this.getSwitchedIndexHandler(slot); if (handler != null && handler.isLoaded()) { return handler.handler.getStackInSlot(handler.switchedIndex); } @@ -63,12 +63,12 @@ public class TileEntityItemViewer extends TileEntityBase { @Override public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) { - IItemHandlerInfo info = TileEntityItemViewer.this.getSwitchedIndexHandler(slot); - if (info != null && info.isLoaded() && TileEntityItemViewer.this.isWhitelisted(info, stack, false)) { + IItemHandlerInfo info = TileEntityItemInterface.this.getSwitchedIndexHandler(slot); + if (info != null && info.isLoaded() && TileEntityItemInterface.this.isWhitelisted(info, stack, false)) { ItemStack remain = info.handler.insertItem(info.switchedIndex, stack, simulate); if (!ItemStack.areItemStacksEqual(remain, stack) && !simulate) { - TileEntityItemViewer.this.markDirty(); - TileEntityItemViewer.this.doItemParticle(stack, info.relayInQuestion.getPos(), TileEntityItemViewer.this.connectedRelay.getPos()); + TileEntityItemInterface.this.markDirty(); + TileEntityItemInterface.this.doItemParticle(stack, info.relayInQuestion.getPos(), TileEntityItemInterface.this.connectedRelay.getPos()); } return remain; } @@ -79,12 +79,12 @@ public class TileEntityItemViewer extends TileEntityBase { public ItemStack extractItem(int slot, int amount, boolean simulate) { ItemStack stackIn = this.getStackInSlot(slot); if (StackUtil.isValid(stackIn)) { - IItemHandlerInfo info = TileEntityItemViewer.this.getSwitchedIndexHandler(slot); - if (info != null && info.isLoaded() && TileEntityItemViewer.this.isWhitelisted(info, stackIn, true)) { + IItemHandlerInfo info = TileEntityItemInterface.this.getSwitchedIndexHandler(slot); + if (info != null && info.isLoaded() && TileEntityItemInterface.this.isWhitelisted(info, stackIn, true)) { ItemStack extracted = info.handler.extractItem(info.switchedIndex, amount, simulate); if (StackUtil.isValid(extracted) && !simulate) { - TileEntityItemViewer.this.markDirty(); - TileEntityItemViewer.this.doItemParticle(extracted, TileEntityItemViewer.this.connectedRelay.getPos(), info.relayInQuestion.getPos()); + TileEntityItemInterface.this.markDirty(); + TileEntityItemInterface.this.doItemParticle(extracted, TileEntityItemInterface.this.connectedRelay.getPos(), info.relayInQuestion.getPos()); } return extracted; } @@ -94,7 +94,7 @@ public class TileEntityItemViewer extends TileEntityBase { @Override public int getSlotLimit(int slot) { - IItemHandlerInfo info = TileEntityItemViewer.this.getSwitchedIndexHandler(slot); + IItemHandlerInfo info = TileEntityItemInterface.this.getSwitchedIndexHandler(slot); if (info != null && info.isLoaded()) { return info.handler.getSlotLimit(info.switchedIndex); } else { @@ -117,7 +117,7 @@ public class TileEntityItemViewer extends TileEntityBase { this.itemHandler = new SlotlessableItemHandlerWrapper(this.lazyHandlers, slotlessHandler); } - public TileEntityItemViewer() { + public TileEntityItemInterface() { this(ActuallyTiles.ITEMVIEWER_TILE.get()); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewerHopping.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemInterfaceHopping.java similarity index 95% rename from src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewerHopping.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemInterfaceHopping.java index 6792bdbf6..bb0278660 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewerHopping.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemInterfaceHopping.java @@ -28,12 +28,12 @@ import net.minecraftforge.items.IItemHandler; import java.util.List; -public class TileEntityItemViewerHopping extends TileEntityItemViewer { +public class TileEntityItemInterfaceHopping extends TileEntityItemInterface { private SlotlessableItemHandlerWrapper handlerToPullFrom; private SlotlessableItemHandlerWrapper handlerToPushTo; - public TileEntityItemViewerHopping() { + public TileEntityItemInterfaceHopping() { super(ActuallyTiles.ITEMVIEWERHOPPING_TILE.get()); } @@ -97,7 +97,7 @@ public class TileEntityItemViewerHopping extends TileEntityItemViewer { this.handlerToPushTo = null; TileEntity from = this.world.getTileEntity(this.pos.offset(Direction.UP)); - if (from != null && !(from instanceof TileEntityItemViewer)) { + if (from != null && !(from instanceof TileEntityItemInterface)) { LazyOptional normal = from.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, Direction.DOWN); Object slotless = null; @@ -118,7 +118,7 @@ public class TileEntityItemViewerHopping extends TileEntityItemViewer { BlockPos toPos = this.pos.offset(facing); if (this.world.isBlockLoaded(toPos)) { TileEntity to = this.world.getTileEntity(toPos); - if (to != null && !(to instanceof TileEntityItemViewer)) { + if (to != null && !(to instanceof TileEntityItemInterface)) { LazyOptional normal = to.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, facing.getOpposite()); Object slotless = null; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java index 4d73255b9..36b1a9b21 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java @@ -14,7 +14,7 @@ import de.ellpeck.actuallyadditions.api.laser.IConnectionPair; import de.ellpeck.actuallyadditions.api.laser.LaserType; import de.ellpeck.actuallyadditions.api.laser.Network; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemViewer.GenericItemHandlerInfo; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemInterface.GenericItemHandlerInfo; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import de.ellpeck.actuallyadditions.mod.util.compat.SlotlessableItemHandlerWrapper; @@ -72,7 +72,7 @@ public class TileEntityLaserRelayItem extends TileEntityLaserRelay { BlockPos pos = this.getPos().offset(side); if (this.world.isBlockLoaded(pos)) { TileEntity tile = this.world.getTileEntity(pos); - if (tile != null && !(tile instanceof TileEntityItemViewer) && !(tile instanceof TileEntityLaserRelay)) { + if (tile != null && !(tile instanceof TileEntityItemInterface) && !(tile instanceof TileEntityLaserRelay)) { LazyOptional itemHandler = tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side.getOpposite()); Object slotlessHandler = null; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java index 52ad361cf..b138f94ca 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java @@ -80,7 +80,7 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I BlockPos thisPos = this.pos; BlockPos[] positions = new BlockPos[]{thisPos.add(1, 1, 0), thisPos.add(-1, 1, 0), thisPos.add(0, 1, 1), thisPos.add(0, 1, -1)}; - if (this.world != null && WorldUtil.hasBlocksInPlacesGiven(positions, ActuallyBlocks.LAVA_CASING.get(), this.world)) { + if (this.world != null && WorldUtil.hasBlocksInPlacesGiven(positions, ActuallyBlocks.LAVA_FACTORY_CASING.get(), this.world)) { BlockPos pos = thisPos.up(); BlockState state = this.world.getBlockState(pos); Block block = state.getBlock(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java index cf43c5ed1..ec860c50e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java @@ -94,7 +94,7 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IButtonR if (!this.isRedstonePowered && this.ticksElapsed % 5 == 0) { if (this.checkY != 0) { - int range = TileEntityPhantomface.upgradeRange(DEFAULT_RANGE, this.world, this.pos); + int range = TileEntityPhantomFace.upgradeRange(DEFAULT_RANGE, this.world, this.pos); if (this.checkY < 0) { this.checkY = this.pos.getY() - 1; this.checkX = -range; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java index dcc8e7826..54abf30d2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java @@ -16,7 +16,7 @@ import net.minecraft.util.Direction; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.energy.CapabilityEnergy; -public class TileEntityPhantomEnergyface extends TileEntityPhantomface implements ISharingEnergyProvider { +public class TileEntityPhantomEnergyface extends TileEntityPhantomFace implements ISharingEnergyProvider { public TileEntityPhantomEnergyface() { super(ActuallyTiles.PHANTOMENERGYFACE_TILE.get()); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomFace.java similarity index 98% rename from src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomFace.java index e502479bd..3077d83aa 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomFace.java @@ -30,7 +30,7 @@ import net.minecraftforge.common.util.LazyOptional; import javax.annotation.Nonnull; import javax.annotation.Nullable; -public abstract class TileEntityPhantomface extends TileEntityInventoryBase implements IPhantomTile { +public abstract class TileEntityPhantomFace extends TileEntityInventoryBase implements IPhantomTile { public static final int RANGE = 16; public BlockPos boundPosition; @@ -41,7 +41,7 @@ public abstract class TileEntityPhantomface extends TileEntityInventoryBase impl private Block boundBlockBefore; private int lastStrength; - public TileEntityPhantomface(TileEntityType type) { + public TileEntityPhantomFace(TileEntityType type) { super(type, 0); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java index ee5cb06da..4adb238f0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java @@ -18,7 +18,7 @@ import net.minecraft.util.Direction; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.items.CapabilityItemHandler; -public class TileEntityPhantomItemface extends TileEntityPhantomface { +public class TileEntityPhantomItemface extends TileEntityPhantomFace { public TileEntityPhantomItemface() { super(ActuallyTiles.PHANTOMITEMFACE_TILE.get()); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java index 8f30b61a6..7b9b5f29a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java @@ -16,7 +16,7 @@ import net.minecraft.util.Direction; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.fluids.capability.CapabilityFluidHandler; -public class TileEntityPhantomLiquiface extends TileEntityPhantomface implements ISharingFluidHandler { +public class TileEntityPhantomLiquiface extends TileEntityPhantomFace implements ISharingFluidHandler { public TileEntityPhantomLiquiface() { super(ActuallyTiles.PHANTOMLIQUIFACE_TILE.get()); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java index 3dc3269a2..3d6ebd150 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java @@ -95,7 +95,7 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements public void updateEntity() { super.updateEntity(); if (!this.world.isRemote) { - this.range = TileEntityPhantomface.upgradeRange(RANGE, this.world, this.pos); + this.range = TileEntityPhantomFace.upgradeRange(RANGE, this.world, this.pos); if (!this.hasBoundPosition()) { this.boundPosition = null; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomRedstoneface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomRedstoneface.java index 82aca9372..bcfa6a761 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomRedstoneface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomRedstoneface.java @@ -17,7 +17,7 @@ import net.minecraftforge.common.capabilities.Capability; import java.util.Arrays; -public class TileEntityPhantomRedstoneface extends TileEntityPhantomface { +public class TileEntityPhantomRedstoneface extends TileEntityPhantomFace { public final int[] providesStrong = new int[Direction.values().length]; public final int[] providesWeak = new int[Direction.values().length]; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java index 02f41dad3..23834dc9e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java @@ -73,7 +73,7 @@ public class TileEntityPlayerInterface extends TileEntityBase implements IEnergy if (!this.world.isRemote) { boolean changed = false; - this.range = TileEntityPhantomface.upgradeRange(DEFAULT_RANGE, this.world, this.pos); + this.range = TileEntityPhantomFace.upgradeRange(DEFAULT_RANGE, this.world, this.pos); PlayerEntity player = this.getPlayer(); if (player != null) { From a97715b5ef49397de89e5f9f0b14590cbc607493 Mon Sep 17 00:00:00 2001 From: Flanks255 <32142731+Flanks255@users.noreply.github.com> Date: Sun, 22 Aug 2021 14:09:15 -0500 Subject: [PATCH 3/4] Block Reg Refactor part 2: The Tilening... --- .../data/BlockRecipeGenerator.java | 4 +- .../mod/ActuallyAdditions.java | 2 +- .../mod/blocks/ActuallyBlocks.java | 80 +++++++++++++------ .../mod/blocks/BlockLaserRelay.java | 6 +- ...reaker.java => BlockLongRangeBreaker.java} | 10 +-- .../mod/blocks/BlockPhantom.java | 2 +- ...ceDouble.java => BlockPoweredFurnace.java} | 10 +-- .../mod/blocks/BlockVerticalDigger.java | 10 +-- .../mod/booklet/InitBooklet.java | 8 +- .../ContainerDirectionalBreaker.java | 8 +- .../mod/inventory/ContainerFurnaceDouble.java | 22 ++--- .../ContainerLaserRelayItemWhitelist.java | 8 +- .../mod/inventory/ContainerMiner.java | 8 +- .../inventory/gui/GuiDirectionalBreaker.java | 4 +- .../mod/inventory/gui/GuiFurnaceDouble.java | 4 +- .../gui/GuiLaserRelayItemWhitelist.java | 4 +- .../mod/inventory/gui/GuiMiner.java | 4 +- .../mod/tile/ActuallyTiles.java | 68 ---------------- .../mod/tile/TileEntityCrusher.java | 8 +- ... => TileEntityLaserRelayItemAdvanced.java} | 4 +- ...r.java => TileEntityLongRangeBreaker.java} | 4 +- .../mod/tile/TileEntityPhantomEnergyface.java | 3 +- .../mod/tile/TileEntityPhantomItemface.java | 5 +- .../mod/tile/TileEntityPhantomLiquiface.java | 3 +- .../mod/tile/TileEntityPhantomPlacer.java | 3 +- ...ble.java => TileEntityPoweredFurnace.java} | 4 +- ...ner.java => TileEntityVerticalDigger.java} | 4 +- 27 files changed, 132 insertions(+), 168 deletions(-) rename src/main/java/de/ellpeck/actuallyadditions/mod/blocks/{BlockDirectionalBreaker.java => BlockLongRangeBreaker.java} (86%) rename src/main/java/de/ellpeck/actuallyadditions/mod/blocks/{BlockFurnaceDouble.java => BlockPoweredFurnace.java} (92%) delete mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/tile/ActuallyTiles.java rename src/main/java/de/ellpeck/actuallyadditions/mod/tile/{TileEntityLaserRelayItemWhitelist.java => TileEntityLaserRelayItemAdvanced.java} (96%) rename src/main/java/de/ellpeck/actuallyadditions/mod/tile/{TileEntityDirectionalBreaker.java => TileEntityLongRangeBreaker.java} (97%) rename src/main/java/de/ellpeck/actuallyadditions/mod/tile/{TileEntityFurnaceDouble.java => TileEntityPoweredFurnace.java} (98%) rename src/main/java/de/ellpeck/actuallyadditions/mod/tile/{TileEntityMiner.java => TileEntityVerticalDigger.java} (98%) diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java index b8117b3d1..882174239 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java @@ -76,7 +76,7 @@ public class BlockRecipeGenerator extends RecipeProvider { .build(consumer); //Vertical Digger - Recipe.shaped(ActuallyBlocks.MINER.get()) + Recipe.shaped(ActuallyBlocks.Vertical_DIGGER.get()) .pattern("IRI", "RCR", "IDI") .key('R', Tags.Items.STORAGE_BLOCKS_REDSTONE) .key('I', ActuallyBlocks.IRON_CASING.get()) @@ -163,7 +163,7 @@ public class BlockRecipeGenerator extends RecipeProvider { .build(consumer); // Whitelist Item Laser Relay - Recipe.shapeless(ActuallyBlocks.LASER_RELAY_ITEM_WHITELIST.get()) + Recipe.shapeless(ActuallyBlocks.LASER_RELAY_ITEM_ADVANCED.get()) .ingredients(ActuallyBlocks.LASER_RELAY_ITEM.get(), ActuallyItems.COIL_ADVANCED.get(), ActuallyItems.BLACK_QUARTZ.get()) .build(consumer); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java index e3b26a383..cc3b998d6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java @@ -85,7 +85,7 @@ public class ActuallyAdditions { IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus(); ActuallyBlocks.BLOCKS.register(eventBus); - ActuallyTiles.TILES.register(eventBus); + ActuallyBlocks.TILES.register(eventBus); ActuallyContainers.CONTAINERS.register(eventBus); MinecraftForge.EVENT_BUS.addListener(this::serverStarted); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java index 7be7b3c9e..3093b71f6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java @@ -19,6 +19,7 @@ import de.ellpeck.actuallyadditions.registration.AABlockReg; import net.minecraft.block.*; import net.minecraft.block.material.Material; import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntityType; import net.minecraftforge.common.ToolType; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.registries.DeferredRegister; @@ -26,6 +27,7 @@ import net.minecraftforge.registries.ForgeRegistries; public final class ActuallyBlocks { public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, ActuallyAdditions.MODID); + public static final DeferredRegister> TILES = DeferredRegister.create(ForgeRegistries.TILE_ENTITIES, ActuallyAdditions.MODID); private static final Item.Properties defaultBlockItemProperties = new Item.Properties().group(ActuallyAdditions.GROUP).maxStackSize(64); @@ -57,6 +59,15 @@ public final class ActuallyBlocks { public static final AABlockReg CANOLA_PRESS = new AABlockReg<>("canola_press", BlockCanolaPress::new, (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityCanolaPress::new); + public static final AABlockReg FERMENTING_BARREL = new AABlockReg<>("fermenting_barrel", BlockFermentingBarrel::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityFermentingBarrel::new); + + public static final AABlockReg OIL_GENERATOR = new AABlockReg<>("oil_generator", BlockOilGenerator::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityOilGenerator::new); + + public static final AABlockReg COAL_GENERATOR = new AABlockReg<>("coal_generator", BlockCoalGenerator::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityCoalGenerator::new); + public static final AABlockReg LEAF_GENERATOR = new AABlockReg<>("leaf_generator", BlockLeafGenerator::new, (b) -> new AABlockItem(b, defaultBlockItemProperties) , TileEntityLeafGenerator::new); @@ -80,6 +91,22 @@ public final class ActuallyBlocks { public static final AABlockReg BIOREACTOR = new AABlockReg<>("bio_reactor", BlockBioReactor::new, (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityBioReactor::new); + public static final AABlockReg Vertical_DIGGER = new AABlockReg<>("vertical_digger", BlockVerticalDigger::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityVerticalDigger::new); + + public static final AABlockReg ATOMIC_RECONSTRUCTOR = new AABlockReg<>("atomic_reconstructor", BlockAtomicReconstructor::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityAtomicReconstructor::new); + public static final AABlockReg RANGED_COLLECTOR = new AABlockReg<>("ranged_collector", BlockRangedCollector::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityRangedCollector::new); + public static final AABlockReg LONG_RANGE_BREAKER = new AABlockReg<>("long_range_breaker", BlockLongRangeBreaker::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityLongRangeBreaker::new); + + public static final AABlockReg COFFEE_MACHINE = new AABlockReg<>("coffee_machine", BlockCoffeeMachine::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityCoffeeMachine::new); + public static final AABlockReg POWERED_FURNACE = new AABlockReg<>("powered_furnace", BlockPoweredFurnace::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPoweredFurnace::new); + + // Crystal Blocks public static final AABlockReg ENORI_CRYSTAL = new AABlockReg<>("enori_crystal_block", () -> new BlockCrystal(false), BlockCrystal::createBlockItem); public static final AABlockReg RESTONIA_CRYSTAL = new AABlockReg<>("restonia_crystal_block", () -> new BlockCrystal(false), BlockCrystal::createBlockItem); @@ -135,8 +162,8 @@ public final class ActuallyBlocks { (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityItemInterfaceHopping::new); // Phantom stuff - public static final AABlockReg PHANTOMFACE = new AABlockReg<>("phantomface", () -> new BlockPhantom(BlockPhantom.Type.FACE), - (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomFace::new); + public static final AABlockReg PHANTOM_ITEMFACE = new AABlockReg<>("phantom_itemface", () -> new BlockPhantom(BlockPhantom.Type.ITEMFACE), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomItemface::new); public static final AABlockReg PHANTOM_PLACER = new AABlockReg<>("phantom_placer", () -> new BlockPhantom(BlockPhantom.Type.PLACER), (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomPlacer::new); public static final AABlockReg PHANTOM_LIQUIFACE = new AABlockReg<>("phantom_liquiface", () -> new BlockPhantom(BlockPhantom.Type.LIQUIFACE), @@ -147,28 +174,40 @@ public final class ActuallyBlocks { (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomRedstoneface::new); public static final AABlockReg PHANTOM_BREAKER = new AABlockReg<>("phantom_breaker", () -> new BlockPhantom(BlockPhantom.Type.BREAKER), (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomBreaker::new); + public static final AABlockReg PHANTOM_BOOSTER = new AABlockReg<>("phantom_booster", BlockPhantomBooster::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomBooster::new); // Misc Tiles public static final AABlockReg BATTERY_BOX = new AABlockReg<>("battery_box", BlockBatteryBox::new, (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityBatteryBox::new); + public static final AABlockReg FIREWORK_BOX = new AABlockReg<>("firework_box", BlockFireworkBox::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityFireworkBox::new); + + public static final AABlockReg SHOCK_SUPPRESSOR = new AABlockReg<>("shock_suppressor", BlockShockSuppressor::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityShockSuppressor::new); + public static final AABlockReg HEAT_COLLECTOR = new AABlockReg<>("heat_collector", BlockHeatCollector::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityHeatCollector::new); + + + + // Freakin-Lasers + public static final AABlockReg LASER_RELAY = new AABlockReg<>("laser_relay", () -> new BlockLaserRelay(BlockLaserRelay.Type.ENERGY_BASIC), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityLaserRelayEnergy::new); + public static final AABlockReg LASER_RELAY_ADVANCED = new AABlockReg<>("laser_relay_advanced", () -> new BlockLaserRelay(BlockLaserRelay.Type.ENERGY_ADVANCED), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityLaserRelayEnergyAdvanced::new); + public static final AABlockReg LASER_RELAY_EXTREME = new AABlockReg<>("laser_relay_extreme", () -> new BlockLaserRelay(BlockLaserRelay.Type.ENERGY_EXTREME), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityLaserRelayEnergyExtreme::new); + public static final AABlockReg LASER_RELAY_FLUIDS = new AABlockReg<>("laser_relay_fluids", () -> new BlockLaserRelay(BlockLaserRelay.Type.FLUIDS), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityLaserRelayFluids::new); + public static final AABlockReg LASER_RELAY_ITEM = new AABlockReg<>("laser_relay_item", () -> new BlockLaserRelay(BlockLaserRelay.Type.ITEM), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityLaserRelayItem::new); + public static final AABlockReg LASER_RELAY_ITEM_ADVANCED = new AABlockReg<>("laser_relay_item_advanced", () -> new BlockLaserRelay(BlockLaserRelay.Type.ITEM_WHITELIST), + (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityLaserRelayItemAdvanced::new); //public static final RegistryObject WILD_PLANT = BLOCKS.register("wild", BlockWildPlant::new); //TODO: what is this? public static final RegistryObject TINY_TORCH = BLOCKS.register("tiny_torch", BlockTinyTorch::new); - public static final RegistryObject SHOCK_SUPPRESSOR = BLOCKS.register("shock_suppressor", BlockShockSuppressor::new); - public static final RegistryObject FIREWORK_BOX = BLOCKS.register("firework_box", BlockFireworkBox::new); - public static final RegistryObject MINER = BLOCKS.register("miner", BlockVerticalDigger::new); - public static final RegistryObject ATOMIC_RECONSTRUCTOR = BLOCKS.register("atomic_reconstructor", BlockAtomicReconstructor::new); - public static final RegistryObject LASER_RELAY = BLOCKS.register("laser_relay", () -> new BlockLaserRelay(BlockLaserRelay.Type.ENERGY_BASIC)); - public static final RegistryObject LASER_RELAY_ADVANCED = BLOCKS.register("laser_relay_advanced", () -> new BlockLaserRelay(BlockLaserRelay.Type.ENERGY_ADVANCED)); - public static final RegistryObject LASER_RELAY_EXTREME = BLOCKS.register("laser_relay_extreme", () -> new BlockLaserRelay(BlockLaserRelay.Type.ENERGY_EXTREME)); - public static final RegistryObject LASER_RELAY_FLUIDS = BLOCKS.register("laser_relay_fluids", () -> new BlockLaserRelay(BlockLaserRelay.Type.FLUIDS)); - public static final RegistryObject LASER_RELAY_ITEM = BLOCKS.register("laser_relay_item", () -> new BlockLaserRelay(BlockLaserRelay.Type.ITEM)); - public static final RegistryObject LASER_RELAY_ITEM_WHITELIST = BLOCKS.register("laser_relay_item_whitelist", () -> new BlockLaserRelay(BlockLaserRelay.Type.ITEM_WHITELIST)); - public static final RegistryObject RANGED_COLLECTOR = BLOCKS.register("ranged_collector", BlockRangedCollector::new); - public static final RegistryObject DIRECTIONAL_BREAKER = BLOCKS.register("directional_breaker", BlockDirectionalBreaker::new); - public static final RegistryObject ETHETIC_GREEN_BLOCK = BLOCKS.register("ethetic_green_block", BlockGeneric::new); public static final RegistryObject ETHETIC_WHITE_BLOCK = BLOCKS.register("ethetic_white_block", BlockGeneric::new); public static final RegistryObject ETHETIC_GREEN_STAIRS = BLOCKS.register("ethetic_green_stairs", () -> new StairsBlock(() -> ETHETIC_GREEN_BLOCK.get().getDefaultState(), AbstractBlock.Properties.from(ETHETIC_GREEN_BLOCK.get()))); @@ -177,22 +216,11 @@ public final class ActuallyBlocks { public static final RegistryObject ETHETIC_WHITE_SLAB = BLOCKS.register("ethetic_white_slab", () -> new SlabBlock(AbstractBlock.Properties.from(ETHETIC_WHITE_BLOCK.get()))); public static final RegistryObject ETHETIC_GREEN_WALL = BLOCKS.register("ethetic_green_wall", () -> new WallBlock(AbstractBlock.Properties.from(ETHETIC_GREEN_BLOCK.get()))); public static final RegistryObject ETHETIC_WHITE_WALL = BLOCKS.register("ethetic_white_wall", () -> new WallBlock(AbstractBlock.Properties.from(ETHETIC_WHITE_BLOCK.get()))); - - - // public static final RegistryObject blockTreasureChest = BLOCKS.register("treasure_chest", BlockTreasureChest::new); - public static final RegistryObject COAL_GENERATOR = BLOCKS.register("coal_generator", BlockCoalGenerator::new); - public static final RegistryObject OIL_GENERATOR = BLOCKS.register("oil_generator", BlockOilGenerator::new); - public static final RegistryObject FERMENTING_BARREL = BLOCKS.register("fermenting_barrel", BlockFermentingBarrel::new); public static final RegistryObject RICE = BLOCKS.register("rice", () -> new BlockPlant(ActuallyItems.RICE_SEED.get()));// TODO: [port][replace] ensure values match these new BlockPlant(1, 2)); public static final RegistryObject CANOLA = BLOCKS.register("canola", () -> new BlockPlant(ActuallyItems.CANOLA_SEED.get()));// TODO: [port][replace] ensure values match these new BlockPlant(2, 3)); public static final RegistryObject FLAX = BLOCKS.register("flax", () -> new BlockPlant(ActuallyItems.FLAX_SEED.get()));// TODO: [port][replace] ensure values match these new BlockPlant(2, 4)); public static final RegistryObject COFFEE = BLOCKS.register("coffee", () -> new BlockPlant(ActuallyItems.COFFEE_SEED.get()));// TODO: [port][replace] ensure values match these new BlockPlant(2, 2)); - public static final RegistryObject FURNACE_DOUBLE = BLOCKS.register("furnace_double", BlockFurnaceDouble::new); - // public static final RegistryObject blockFurnaceSolar = BLOCKS.register("furnace_solar", BlockFurnaceSolar::new); - public static final RegistryObject HEAT_COLLECTOR = BLOCKS.register("heat_collector", BlockHeatCollector::new); public static final RegistryObject GREENHOUSE_GLASS = BLOCKS.register("greenhouse_glass", BlockGreenhouseGlass::new); - public static final RegistryObject COFFEE_MACHINE = BLOCKS.register("coffee_machine", BlockCoffeeMachine::new); - public static final RegistryObject PHANTOM_BOOSTER = BLOCKS.register("phantom_booster", BlockPhantomBooster::new); public static final RegistryObject BLACK_QUARTZ_BLOCK = BLOCKS.register("black_quartz_block", BlockGeneric::new); public static final RegistryObject BLACK_QUARTZ_PILLAR_BLOCK = BLOCKS.register("black_quartz_pillar_block", BlockGeneric::new); public static final RegistryObject CHISELED_BLACK_QUARTZ_BLOCK = BLOCKS.register("chiseled_black_quartz_block", BlockGeneric::new); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java index 901ff8eba..de1554762 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java @@ -138,8 +138,8 @@ public class BlockLaserRelay extends FullyDirectionalBlock.Container implements } } - if (relay instanceof TileEntityLaserRelayItemWhitelist) { - return this.openGui(world, player, pos, TileEntityLaserRelayItemWhitelist.class); + if (relay instanceof TileEntityLaserRelayItemAdvanced) { + return this.openGui(world, player, pos, TileEntityLaserRelayItemAdvanced.class); } } return ActionResultType.FAIL; @@ -151,7 +151,7 @@ public class BlockLaserRelay extends FullyDirectionalBlock.Container implements case ITEM: return new TileEntityLaserRelayItem(); case ITEM_WHITELIST: - return new TileEntityLaserRelayItemWhitelist(); + return new TileEntityLaserRelayItemAdvanced(); case ENERGY_ADVANCED: return new TileEntityLaserRelayEnergyAdvanced(); case ENERGY_EXTREME: diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDirectionalBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLongRangeBreaker.java similarity index 86% rename from src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDirectionalBreaker.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLongRangeBreaker.java index f2a5e1344..8e0ee123f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLongRangeBreaker.java @@ -11,7 +11,7 @@ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.blocks.base.FullyDirectionalBlock; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityDirectionalBreaker; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityLongRangeBreaker; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.tileentity.TileEntity; @@ -24,15 +24,15 @@ import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; import net.minecraft.world.World; -public class BlockDirectionalBreaker extends FullyDirectionalBlock.Container { +public class BlockLongRangeBreaker extends FullyDirectionalBlock.Container { - public BlockDirectionalBreaker() { + public BlockLongRangeBreaker() { super(ActuallyBlocks.defaultPickProps(0)); } @Override public TileEntity createNewTileEntity(IBlockReader worldIn) { - return new TileEntityDirectionalBreaker(); + return new TileEntityLongRangeBreaker(); } @Override @@ -41,7 +41,7 @@ public class BlockDirectionalBreaker extends FullyDirectionalBlock.Container { return ActionResultType.PASS; } - return this.openGui(world, player, pos, TileEntityDirectionalBreaker.class); + return this.openGui(world, player, pos, TileEntityLongRangeBreaker.class); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java index cf45c8125..42ab908b1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java @@ -152,7 +152,7 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay { } public enum Type { - FACE, + ITEMFACE, PLACER, BREAKER, LIQUIFACE, diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPoweredFurnace.java similarity index 92% rename from src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceDouble.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPoweredFurnace.java index dcbc23629..5d0ad1fad 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPoweredFurnace.java @@ -14,7 +14,7 @@ import static net.minecraft.state.properties.BlockStateProperties.HORIZONTAL_FAC import static net.minecraft.state.properties.BlockStateProperties.LIT; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceDouble; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityPoweredFurnace; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; @@ -35,8 +35,8 @@ import net.minecraft.world.server.ServerWorld; import java.util.Random; -public class BlockFurnaceDouble extends BlockContainerBase { - public BlockFurnaceDouble() { +public class BlockPoweredFurnace extends BlockContainerBase { + public BlockPoweredFurnace() { // TODO: [port] confirm this is correct for light level... Might not be reactive. super(ActuallyBlocks.defaultPickProps(0).tickRandomly().setLightLevel(state -> state.get(LIT) ? 12 @@ -47,7 +47,7 @@ public class BlockFurnaceDouble extends BlockContainerBase { @Override public TileEntity createNewTileEntity(IBlockReader worldIn) { - return new TileEntityFurnaceDouble(); + return new TileEntityPoweredFurnace(); } @Override @@ -61,7 +61,7 @@ public class BlockFurnaceDouble extends BlockContainerBase { @Override public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { - return this.openGui(worldIn, player, pos, TileEntityFurnaceDouble.class); + return this.openGui(worldIn, player, pos, TileEntityPoweredFurnace.class); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockVerticalDigger.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockVerticalDigger.java index 0f834752f..6948c3086 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockVerticalDigger.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockVerticalDigger.java @@ -12,7 +12,7 @@ package de.ellpeck.actuallyadditions.mod.blocks; import com.mojang.blaze3d.matrix.MatrixStack; import de.ellpeck.actuallyadditions.mod.blocks.base.DirectionalBlock; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityMiner; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityVerticalDigger; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.BlockState; import net.minecraft.client.MainWindow; @@ -41,12 +41,12 @@ public class BlockVerticalDigger extends DirectionalBlock.Container implements I @Override public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { - return this.openGui(worldIn, player, pos, TileEntityMiner.class); + return this.openGui(worldIn, player, pos, TileEntityVerticalDigger.class); } @Override public TileEntity createNewTileEntity(IBlockReader world) { - return new TileEntityMiner(); + return new TileEntityVerticalDigger(); } @Override @@ -56,8 +56,8 @@ public class BlockVerticalDigger extends DirectionalBlock.Container implements I return; } TileEntity tile = minecraft.world.getTileEntity(((BlockRayTraceResult) rayCast).getPos()); - if (tile instanceof TileEntityMiner) { - TileEntityMiner miner = (TileEntityMiner) tile; + if (tile instanceof TileEntityVerticalDigger) { + TileEntityVerticalDigger miner = (TileEntityVerticalDigger) tile; String info = miner.checkY == 0 ? "Done Mining!" : miner.checkY == -1 diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java index 6c90eb179..2ad63711e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -191,7 +191,7 @@ public final class InitBooklet { new BookletChapter("fluidLaser", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(ActuallyBlocks.LASER_RELAY_FLUIDS.get()), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeFluidLaser).setWildcard().setNoText()); new BookletChapter("itemRelays", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(ActuallyBlocks.LASER_RELAY_ITEM.get()), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeItemLaser).setWildcard().setNoText()).setSpecial(); new BookletChapter("itemInterfaces", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(ActuallyBlocks.ITEM_VIEWER.get()), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipeItemInterface).setNoText()); - new BookletChapter("itemRelaysAdvanced", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(ActuallyBlocks.LASER_RELAY_ITEM_WHITELIST.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeLaserRelayItemWhitelist).setWildcard()); + new BookletChapter("itemRelaysAdvanced", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(ActuallyBlocks.LASER_RELAY_ITEM_ADVANCED.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeLaserRelayItemWhitelist).setWildcard()); new BookletChapter("itemInterfacesHopping", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(ActuallyBlocks.ITEM_VIEWER_HOPPING.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeItemInterfaceHopping).setWildcard().setNoText()); new BookletChapter("laserUpgradeInvisibility", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(ActuallyItems.LASER_UPGRADE_INVISIBILITY.get()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLaserUpgradeInvisibility).setNoText()).setImportant(); new BookletChapter("laserUpgradeRange", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(ActuallyItems.LASER_UPGRADE_RANGE.get()), new PageTextOnly(1).addTextReplacement("", TileEntityLaserRelay.MAX_DISTANCE).addTextReplacement("", TileEntityLaserRelay.MAX_DISTANCE_RANGED), new PageCrafting(2, ItemCrafting.recipeLaserUpgradeRange).setNoText()).setImportant(); @@ -215,7 +215,7 @@ public final class InitBooklet { new BookletChapter("fireworkBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.FIREWORK_BOX.get()), new PageTextOnly(1).addTextReplacement("", TileEntityFireworkBox.USE_PER_SHOT), new PageCrafting(2, BlockCrafting.recipeFireworkBox)).setSpecial(); new BookletChapter("batteryBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.BATTERY_BOX.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeBatteryBox).setNoText()).setSpecial(); new BookletChapter("farmer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.FARMER.get()), new PageTextOnly(1), new PagePicture(2, "page_farmer_crops", 95).addItemsToPage(new ItemStack(Items.WHEAT_SEEDS)).addItemsToPage(new ItemStack(ActuallyItems.CANOLA_SEED.get())), new PagePicture(3, "page_farmer_cactus", 105).addItemsToPage(new ItemStack(Blocks.CACTUS)), new PagePicture(4, "page_farmer_wart", 95).addItemsToPage(new ItemStack(Items.NETHER_WART)), new PagePicture(5, "page_farmer_reeds", 105).addItemsToPage(new ItemStack(Items.REEDS)), new PagePicture(6, "page_farmer_melons", 105).addItemsToPage(new ItemStack(Items.MELON), new ItemStack(Blocks.PUMPKIN), new ItemStack(Blocks.MELON_BLOCK)), new PagePicture(7, "page_farmer_enderlilly", 105), new PagePicture(8, "page_farmer_redorchid", 105), new PageCrafting(4, BlockCrafting.recipeFarmer).setWildcard().setNoText()).setImportant(); - new BookletChapter("miner", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.MINER.get()), new PageTextOnly(1).addTextReplacement("", TileEntityMiner.ENERGY_USE_PER_BLOCK).addTextReplacement("", TileEntityMiner.DEFAULT_RANGE), new PageCrafting(2, BlockCrafting.recipeMiner)).setSpecial(); + new BookletChapter("miner", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.Vertical_DIGGER.get()), new PageTextOnly(1).addTextReplacement("", TileEntityVerticalDigger.ENERGY_USE_PER_BLOCK).addTextReplacement("", TileEntityVerticalDigger.DEFAULT_RANGE), new PageCrafting(2, BlockCrafting.recipeMiner)).setSpecial(); new BookletChapterCoffee("coffeeMachine", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.COFFEE_MACHINE.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(ActuallyItems.COFFEE_BEANS.get())).addTextReplacement("", TileEntityCoffeeMachine.ENERGY_USED).addTextReplacement("", TileEntityCoffeeMachine.CACHE_USE).addTextReplacement("", TileEntityCoffeeMachine.WATER_USE), new PageTextOnly(2).addItemsToPage(new ItemStack(ActuallyItems.COFFEE.get())), new PagePicture(3, "page_coffee_machine", 115), new PageCrafting(4, BlockCrafting.recipeCoffeeMachine).setWildcard().setNoText(), new PageCrafting(5, ItemCrafting.recipeCup).setNoText()).setImportant(); List list = new ArrayList<>(); @@ -233,11 +233,11 @@ public final class InitBooklet { } new BookletChapterCrusher("crusher", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.GRINDER_DOUBLE.get()), list.toArray(new IBookletPage[0])); - new BookletChapter("furnaceDouble", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.FURNACE_DOUBLE.get()), new PageCrafting(1, BlockCrafting.recipeFurnace).setWildcard().addTextReplacement("", TileEntityFurnaceDouble.ENERGY_USE)); + new BookletChapter("furnaceDouble", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.POWERED_FURNACE.get()), new PageCrafting(1, BlockCrafting.recipeFurnace).setWildcard().addTextReplacement("", TileEntityPoweredFurnace.ENERGY_USE)); new BookletChapter("lavaFactory", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.LAVA_FACTORY_CONTROLLER.get()), new PageTextOnly(1).addTextReplacement("", TileEntityLavaFactoryController.ENERGY_USE), new PagePicture(2, "page_lava_factory", 0).setNoText(), new PageCrafting(3, BlockCrafting.recipeLavaFactory).setNoText(), new PageCrafting(4, BlockCrafting.recipeCasing).setNoText()); new BookletChapter("energizer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.ENERGIZER.get()), new PageCrafting(1, BlockCrafting.recipeEnergizer), new PageCrafting(2, BlockCrafting.recipeEnervator)); // new BookletChapter("repairer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockItemRepairer.get()), new PageCrafting(1, BlockCrafting.recipeRepairer).addTextReplacement("", TileEntityItemRepairer.ENERGY_USE)); - new BookletChapter("longRangeBreaker", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.DIRECTIONAL_BREAKER.get()), new PageTextOnly(1).addTextReplacement("", TileEntityDirectionalBreaker.ENERGY_USE).addTextReplacement("", TileEntityDirectionalBreaker.RANGE), new PageCrafting(2, BlockCrafting.recipeDirectionalBreaker).setWildcard()); + new BookletChapter("longRangeBreaker", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.LONG_RANGE_BREAKER.get()), new PageTextOnly(1).addTextReplacement("", TileEntityLongRangeBreaker.ENERGY_USE).addTextReplacement("", TileEntityLongRangeBreaker.RANGE), new PageCrafting(2, BlockCrafting.recipeDirectionalBreaker).setWildcard()); new BookletChapter("playerInterface", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.PLAYER_INTERFACE.get()), new PageTextOnly(1).addTextReplacement("", TileEntityPlayerInterface.DEFAULT_RANGE), new PageCrafting(2, BlockCrafting.recipePlayerInterface).setNoText()).setSpecial(); new BookletChapter("displayStand", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.DISPLAY_STAND.get()), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipeDisplayStand).setNoText()).setSpecial(); new BookletChapter("shockSuppressor", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.SHOCK_SUPPRESSOR.get()), new PageTextOnly(1).addTextReplacement("", TileEntityShockSuppressor.RANGE).addTextReplacement("", TileEntityShockSuppressor.USE_PER), new PageCrafting(2, BlockCrafting.recipeShockSuppressor)); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDirectionalBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDirectionalBreaker.java index f6f9158f9..67fc47c30 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDirectionalBreaker.java @@ -11,7 +11,7 @@ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotItemHandlerUnconditioned; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityDirectionalBreaker; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityLongRangeBreaker; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; @@ -24,13 +24,13 @@ import java.util.Objects; public class ContainerDirectionalBreaker extends Container { - public final TileEntityDirectionalBreaker breaker; + public final TileEntityLongRangeBreaker breaker; public static ContainerDirectionalBreaker fromNetwork(int windowId, PlayerInventory inv, PacketBuffer data) { - return new ContainerDirectionalBreaker(windowId, inv, (TileEntityDirectionalBreaker) Objects.requireNonNull(inv.player.world.getTileEntity(data.readBlockPos()))); + return new ContainerDirectionalBreaker(windowId, inv, (TileEntityLongRangeBreaker) Objects.requireNonNull(inv.player.world.getTileEntity(data.readBlockPos()))); } - public ContainerDirectionalBreaker(int windowId, PlayerInventory inventory, TileEntityDirectionalBreaker tile) { + public ContainerDirectionalBreaker(int windowId, PlayerInventory inventory, TileEntityLongRangeBreaker tile) { super(ActuallyContainers.DIRECTIONAL_BREAKER_CONTAINER.get(), windowId); this.breaker = tile; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java index 1ef6893b2..495e14c4e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java @@ -12,7 +12,7 @@ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotItemHandlerUnconditioned; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceDouble; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityPoweredFurnace; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; @@ -28,20 +28,20 @@ import java.util.Objects; public class ContainerFurnaceDouble extends Container { - public final TileEntityFurnaceDouble furnace; + public final TileEntityPoweredFurnace furnace; public static ContainerFurnaceDouble fromNetwork(int windowId, PlayerInventory inv, PacketBuffer data) { - return new ContainerFurnaceDouble(windowId, inv, (TileEntityFurnaceDouble) Objects.requireNonNull(inv.player.world.getTileEntity(data.readBlockPos()))); + return new ContainerFurnaceDouble(windowId, inv, (TileEntityPoweredFurnace) Objects.requireNonNull(inv.player.world.getTileEntity(data.readBlockPos()))); } - public ContainerFurnaceDouble(int windowId, PlayerInventory inventory, TileEntityFurnaceDouble tile) { + public ContainerFurnaceDouble(int windowId, PlayerInventory inventory, TileEntityPoweredFurnace tile) { super(ActuallyContainers.FURNACE_DOUBLE_CONTAINER.get(), windowId); this.furnace = tile; - this.addSlot(new SlotItemHandlerUnconditioned(this.furnace.inv, TileEntityFurnaceDouble.SLOT_INPUT_1, 51, 21)); - this.addSlot(new SlotOutput(this.furnace.inv, TileEntityFurnaceDouble.SLOT_OUTPUT_1, 51, 69)); - this.addSlot(new SlotItemHandlerUnconditioned(this.furnace.inv, TileEntityFurnaceDouble.SLOT_INPUT_2, 109, 21)); - this.addSlot(new SlotOutput(this.furnace.inv, TileEntityFurnaceDouble.SLOT_OUTPUT_2, 108, 69)); + this.addSlot(new SlotItemHandlerUnconditioned(this.furnace.inv, TileEntityPoweredFurnace.SLOT_INPUT_1, 51, 21)); + this.addSlot(new SlotOutput(this.furnace.inv, TileEntityPoweredFurnace.SLOT_OUTPUT_1, 51, 69)); + this.addSlot(new SlotItemHandlerUnconditioned(this.furnace.inv, TileEntityPoweredFurnace.SLOT_INPUT_2, 109, 21)); + this.addSlot(new SlotOutput(this.furnace.inv, TileEntityPoweredFurnace.SLOT_OUTPUT_2, 108, 69)); for (int i = 0; i < 3; i++) { for (int j = 0; j < 9; j++) { @@ -67,7 +67,7 @@ public class ContainerFurnaceDouble extends Container { ItemStack currentStack = newStack.copy(); //Slots in Inventory to shift from - if (slot == TileEntityFurnaceDouble.SLOT_OUTPUT_1 || slot == TileEntityFurnaceDouble.SLOT_OUTPUT_2) { + if (slot == TileEntityPoweredFurnace.SLOT_OUTPUT_1 || slot == TileEntityPoweredFurnace.SLOT_OUTPUT_2) { if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, true)) { return StackUtil.getEmpty(); } @@ -85,8 +85,8 @@ public class ContainerFurnaceDouble extends Container { //Shift from Inventory if (StackUtil.isValid(recipeOutput)) { - if (!this.mergeItemStack(newStack, TileEntityFurnaceDouble.SLOT_INPUT_1, TileEntityFurnaceDouble.SLOT_INPUT_1 + 1, false)) { - if (!this.mergeItemStack(newStack, TileEntityFurnaceDouble.SLOT_INPUT_2, TileEntityFurnaceDouble.SLOT_INPUT_2 + 1, false)) { + if (!this.mergeItemStack(newStack, TileEntityPoweredFurnace.SLOT_INPUT_1, TileEntityPoweredFurnace.SLOT_INPUT_1 + 1, false)) { + if (!this.mergeItemStack(newStack, TileEntityPoweredFurnace.SLOT_INPUT_2, TileEntityPoweredFurnace.SLOT_INPUT_2 + 1, false)) { return StackUtil.getEmpty(); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerLaserRelayItemWhitelist.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerLaserRelayItemWhitelist.java index 62466840a..b61be9d1e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerLaserRelayItemWhitelist.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerLaserRelayItemWhitelist.java @@ -11,7 +11,7 @@ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotFilter; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayItemWhitelist; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayItemAdvanced; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; @@ -25,13 +25,13 @@ import java.util.Objects; public class ContainerLaserRelayItemWhitelist extends Container { - public final TileEntityLaserRelayItemWhitelist tile; + public final TileEntityLaserRelayItemAdvanced tile; public static ContainerLaserRelayItemWhitelist fromNetwork(int windowId, PlayerInventory inv, PacketBuffer data) { - return new ContainerLaserRelayItemWhitelist(windowId, inv, (TileEntityLaserRelayItemWhitelist) Objects.requireNonNull(inv.player.world.getTileEntity(data.readBlockPos()))); + return new ContainerLaserRelayItemWhitelist(windowId, inv, (TileEntityLaserRelayItemAdvanced) Objects.requireNonNull(inv.player.world.getTileEntity(data.readBlockPos()))); } - public ContainerLaserRelayItemWhitelist(int windowId, PlayerInventory inventory, TileEntityLaserRelayItemWhitelist tile) { + public ContainerLaserRelayItemWhitelist(int windowId, PlayerInventory inventory, TileEntityLaserRelayItemAdvanced tile) { super(ActuallyContainers.LASER_RELAY_ITEM_WHITELIST_CONTAINER.get(), windowId); this.tile = tile; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerMiner.java index 55e859942..381dbb254 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerMiner.java @@ -11,7 +11,7 @@ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotItemHandlerUnconditioned; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityMiner; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityVerticalDigger; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; @@ -24,13 +24,13 @@ import java.util.Objects; public class ContainerMiner extends Container { - public final TileEntityMiner miner; + public final TileEntityVerticalDigger miner; public static ContainerMiner fromNetwork(int windowId, PlayerInventory inv, PacketBuffer data) { - return new ContainerMiner(windowId, inv, (TileEntityMiner) Objects.requireNonNull(inv.player.world.getTileEntity(data.readBlockPos()))); + return new ContainerMiner(windowId, inv, (TileEntityVerticalDigger) Objects.requireNonNull(inv.player.world.getTileEntity(data.readBlockPos()))); } - public ContainerMiner(int windowId, PlayerInventory inventory, TileEntityMiner tile) { + public ContainerMiner(int windowId, PlayerInventory inventory, TileEntityVerticalDigger tile) { super(ActuallyContainers.MINER_CONTAINER.get(), windowId); this.miner = tile; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java index 167d8af83..89b70d707 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java @@ -12,7 +12,7 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; import com.mojang.blaze3d.matrix.MatrixStack; import de.ellpeck.actuallyadditions.mod.inventory.ContainerDirectionalBreaker; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityDirectionalBreaker; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityLongRangeBreaker; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; @@ -24,7 +24,7 @@ import net.minecraftforge.api.distmarker.OnlyIn; public class GuiDirectionalBreaker extends GuiWtfMojang { private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_directional_breaker"); - private final TileEntityDirectionalBreaker breaker; + private final TileEntityLongRangeBreaker breaker; private EnergyDisplay energy; public GuiDirectionalBreaker(ContainerDirectionalBreaker container, PlayerInventory inventory, ITextComponent title) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFurnaceDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFurnaceDouble.java index 46bf9c246..dc2ceeb89 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFurnaceDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFurnaceDouble.java @@ -15,7 +15,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.inventory.ContainerFurnaceDouble; import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceDouble; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityPoweredFurnace; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.gui.widget.button.Button; @@ -34,7 +34,7 @@ import java.util.Collections; public class GuiFurnaceDouble extends GuiWtfMojang { private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_furnace_double"); - private final TileEntityFurnaceDouble tileFurnace; + private final TileEntityPoweredFurnace tileFurnace; private EnergyDisplay energy; private Button buttonAutoSplit; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiLaserRelayItemWhitelist.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiLaserRelayItemWhitelist.java index 8ff47e245..1f9b9f3fd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiLaserRelayItemWhitelist.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiLaserRelayItemWhitelist.java @@ -16,7 +16,7 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.inventory.ContainerLaserRelayItemWhitelist; import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiInputter.SmallerButton; import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayItemWhitelist; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayItemAdvanced; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.gui.widget.button.Button; @@ -34,7 +34,7 @@ import java.util.List; public class GuiLaserRelayItemWhitelist extends GuiWtfMojang { private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_laser_relay_item_whitelist"); - private final TileEntityLaserRelayItemWhitelist tile; + private final TileEntityLaserRelayItemAdvanced tile; private FilterSettingsGui leftFilter; private FilterSettingsGui rightFilter; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiMiner.java index 998ba304a..920270b7b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiMiner.java @@ -14,7 +14,7 @@ import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.systems.RenderSystem; import de.ellpeck.actuallyadditions.mod.inventory.ContainerMiner; import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityMiner; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityVerticalDigger; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.gui.widget.button.Button; @@ -29,7 +29,7 @@ import net.minecraftforge.api.distmarker.OnlyIn; public class GuiMiner extends GuiWtfMojang { private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_breaker"); - private final TileEntityMiner miner; + private final TileEntityVerticalDigger miner; public GuiMiner(ContainerMiner container, PlayerInventory inventory, ITextComponent title) { super(container, inventory); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/ActuallyTiles.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/ActuallyTiles.java deleted file mode 100644 index 308ddd3ff..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/ActuallyTiles.java +++ /dev/null @@ -1,68 +0,0 @@ -package de.ellpeck.actuallyadditions.mod.tile; - -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; -import net.minecraft.tileentity.TileEntityType; -import net.minecraftforge.fml.RegistryObject; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; - -public class ActuallyTiles { - public static final DeferredRegister> TILES = DeferredRegister.create(ForgeRegistries.TILE_ENTITIES, ActuallyAdditions.MODID); - - // public static final RegistryObject<,> COMPOST_TILE = TILES.register("compost", () -> TileEntityType.Builder.create(TileEntityCompost::new, InitBlocks.blockCompost.get()).build(null)); - //public static final RegistryObject> FEEDER_TILE = TILES.register("feeder", () -> TileEntityType.Builder.create(TileEntityFeeder::new, ActuallyBlocks.FEEDER.get()).build(null)); - // public static final RegistryObject> GIANTCHEST_TILE = TILES.register("", () -> TileEntityType.Builder.create(TileEntityGiantChest::new, ).build(null)); - // public static final RegistryObject> GIANTCHESTMEDIUM_TILE = TILES.register("", () -> TileEntityType.Builder.create(TileEntityGiantChestMedium::new, ).build(null)); - // public static final RegistryObject> GIANTCHESTLARGE_TILE = TILES.register("", () -> TileEntityType.Builder.create(TileEntityGiantChestLarge::new, ).build(null)); - //public static final RegistryObject> GRINDER_TILE = TILES.register("grinder", () -> TileEntityType.Builder.create(TileEntityCrusher::new, ActuallyBlocks.GRINDER.get()).build(null)); - //public static final RegistryObject> FURNACE_DOUBLE_TILE = TILES.register("furnaceDouble", () -> TileEntityType.Builder.create(TileEntityFurnaceDouble::new, ActuallyBlocks.FURNACE_DOUBLE.get()).build(null)); - //public static final RegistryObject> INPUTTER_TILE = TILES.register("inputter", () -> TileEntityType.Builder.create(TileEntityInputter::new, ActuallyBlocks.INPUTTER.get()).build(null)); - // public static final RegistryObject> SOLAR_TILE = TILES.register("solarPanel", () -> TileEntityType.Builder.create(TileEntityFurnaceSolar::new, ActuallyBlocks.blockFurnaceSolar.get()).build(null)); - public static final RegistryObject> HEATCOLLECTOR_TILE = TILES.register("heatCollector", () -> TileEntityType.Builder.create(TileEntityHeatCollector::new, ActuallyBlocks.HEAT_COLLECTOR.get()).build(null)); - //public static final RegistryObject> BREAKER_TILE = TILES.register("breaker", () -> TileEntityType.Builder.create(TileEntityBreaker::new, ActuallyBlocks.BREAKER.get()).build(null)); - //public static final RegistryObject> DROPPER_TILE = TILES.register("dropper", () -> TileEntityType.Builder.create(TileEntityDropper::new, ActuallyBlocks.DROPPER.get()).build(null)); - //public static final RegistryObject> INPUTTERADVANCED_TILE = TILES.register("inputterAdvanced", () -> TileEntityType.Builder.create(TileEntityInputterAdvanced::new, ActuallyBlocks.INPUTTER_ADVANCED.get()).build(null)); - //public static final RegistryObject> PLACER_TILE = TILES.register("placer", () -> TileEntityType.Builder.create(TileEntityPlacer::new, ActuallyBlocks.PLACER.get()).build(null)); - //public static final RegistryObject> GRINDER_DOUBLE_TILE = TILES.register("grinderDouble", () -> TileEntityType.Builder.create(TileEntityCrusherDouble::new, ActuallyBlocks.GRINDER_DOUBLE.get()).build(null)); - //public static final RegistryObject> CANOLAPRESS_TILE = TILES.register("canolaPress", () -> TileEntityType.Builder.create(TileEntityCanolaPress::new, ActuallyBlocks.CANOLA_PRESS.get()).build(null)); - public static final RegistryObject> FERMENTINGBARREL_TILE = TILES.register("fermentingBarrel", () -> TileEntityType.Builder.create(TileEntityFermentingBarrel::new, ActuallyBlocks.FERMENTING_BARREL.get()).build(null)); - public static final RegistryObject> OILGENERATOR_TILE = TILES.register("oilGenerator", () -> TileEntityType.Builder.create(TileEntityOilGenerator::new, ActuallyBlocks.OIL_GENERATOR.get()).build(null)); - public static final RegistryObject> COALGENERATOR_TILE = TILES.register("coalGenerator", () -> TileEntityType.Builder.create(TileEntityCoalGenerator::new, ActuallyBlocks.COAL_GENERATOR.get()).build(null)); - //public static final RegistryObject> PHANTOMITEMFACE_TILE = TILES.register("phantomface", () -> TileEntityType.Builder.create(TileEntityPhantomItemface::new, ActuallyBlocks.PHANTOMFACE.get()).build(null)); - //public static final RegistryObject> PHANTOMLIQUIFACE_TILE = TILES.register("liquiface", () -> TileEntityType.Builder.create(TileEntityPhantomLiquiface::new, ActuallyBlocks.PHANTOM_LIQUIFACE.get()).build(null)); - //public static final RegistryObject> PHANTOMENERGYFACE_TILE = TILES.register("energyface", () -> TileEntityType.Builder.create(TileEntityPhantomEnergyface::new, ActuallyBlocks.PHANTOM_ENERGYFACE.get()).build(null)); - //public static final RegistryObject> PLAYERINTERFACE_TILE = TILES.register("playerInterface", () -> TileEntityType.Builder.create(TileEntityPlayerInterface::new, ActuallyBlocks.PLAYER_INTERFACE.get()).build(null)); - //public static final RegistryObject> PHANTOMPLACER_TILE = TILES.register("phantomPlacer", () -> TileEntityType.Builder.create(TileEntityPhantomPlacer::new, ActuallyBlocks.PHANTOM_PLACER.get()).build(null)); - //public static final RegistryObject> PHANTOMBREAKER_TILE = TILES.register("phantomBreaker", () -> TileEntityType.Builder.create(TileEntityPhantomBreaker::new, ActuallyBlocks.PHANTOM_BREAKER.get()).build(null)); - //public static final RegistryObject> FLUIDCOLLECTOR_TILE = TILES.register("fluidCollector", () -> TileEntityType.Builder.create(TileEntityFluidCollector::new, ActuallyBlocks.FLUID_COLLECTOR.get()).build(null)); - //public static final RegistryObject> FLUIDPLACER_TILE = TILES.register("fluidPlacer", () -> TileEntityType.Builder.create(TileEntityFluidPlacer::new, ActuallyBlocks.FLUID_PLACER.get()).build(null)); - //public static final RegistryObject> LAVAFACTORYCONTROLLER_TILE = TILES.register("lavaFactory", () -> TileEntityType.Builder.create(TileEntityLavaFactoryController::new, ActuallyBlocks.LAVA_FACTORY_CONTROLLER.get()).build(null)); - public static final RegistryObject> COFFEEMACHINE_TILE = TILES.register("coffeeMachine", () -> TileEntityType.Builder.create(TileEntityCoffeeMachine::new, ActuallyBlocks.COFFEE_MACHINE.get()).build(null)); - public static final RegistryObject> PHANTOM_BOOSTER_TILE = TILES.register("phantomBooster", () -> TileEntityType.Builder.create(TileEntityPhantomBooster::new, ActuallyBlocks.PHANTOM_BOOSTER.get()).build(null)); - //public static final RegistryObject> ENERGIZER_TILE = TILES.register("energizer", () -> TileEntityType.Builder.create(TileEntityEnergizer::new, ActuallyBlocks.ENERGIZER.get()).build(null)); - //public static final RegistryObject> ENERVATOR_TILE = TILES.register("enervator", () -> TileEntityType.Builder.create(TileEntityEnervator::new, ActuallyBlocks.ENERVATOR.get()).build(null)); - //public static final RegistryObject> XPSOLIDIFIER_TILE = TILES.register("xpSolidifier", () -> TileEntityType.Builder.create(TileEntityXPSolidifier::new, ActuallyBlocks.XP_SOLIDIFIER.get()).build(null)); - // public static final RegistryObject<.> SMILEYCLOUD_TILE = TILES.register("", () -> TileEntityType.Builder.create(TileEntitySmileyCloud::new, InitBlocks.blockSmileyCloud.get()).build(null)); - //public static final RegistryObject> LEAFGENERATOR_TILE = TILES.register("leafGenerator", () -> TileEntityType.Builder.create(TileEntityLeafGenerator::new, ActuallyBlocks.LEAF_GENERATOR.get()).build(null)); - public static final RegistryObject> DIRECTIONALBREAKER_TILE = TILES.register("directionalBreaker", () -> TileEntityType.Builder.create(TileEntityDirectionalBreaker::new, ActuallyBlocks.DIRECTIONAL_BREAKER.get()).build(null)); - public static final RegistryObject> RANGEDCOLLECTOR_TILE = TILES.register("rangedCollector", () -> TileEntityType.Builder.create(TileEntityRangedCollector::new, ActuallyBlocks.RANGED_COLLECTOR.get()).build(null)); - public static final RegistryObject> ATOMICRECONSTRUCTOR_TILE = TILES.register("reconstructor", () -> TileEntityType.Builder.create(TileEntityAtomicReconstructor::new, ActuallyBlocks.ATOMIC_RECONSTRUCTOR.get()).build(null)); - public static final RegistryObject> MINER_TILE = TILES.register("miner", () -> TileEntityType.Builder.create(TileEntityMiner::new, ActuallyBlocks.MINER.get()).build(null)); - public static final RegistryObject> FIREWORKBOX_TILE = TILES.register("fireworkBox", () -> TileEntityType.Builder.create(TileEntityFireworkBox::new, ActuallyBlocks.FIREWORK_BOX.get()).build(null)); - //public static final RegistryObject> PHANTOMREDSTONEFACE_TILE = TILES.register("redstoneface", () -> TileEntityType.Builder.create(TileEntityPhantomRedstoneface::new, ActuallyBlocks.PHANTOM_REDSTONEFACE.get()).build(null)); - public static final RegistryObject> LASERRELAYITEM_TILE = TILES.register("laserRelayItem", () -> TileEntityType.Builder.create(TileEntityLaserRelayItem::new, ActuallyBlocks.LASER_RELAY_ITEM.get()).build(null)); - public static final RegistryObject> LASERRELAYENERGY_TILE = TILES.register("laserRelay", () -> TileEntityType.Builder.create(TileEntityLaserRelayEnergy::new, ActuallyBlocks.LASER_RELAY.get()).build(null)); - public static final RegistryObject> LASERRELAYENERGYADVANCED_TILE = TILES.register("laserRelayAdvanced", () -> TileEntityType.Builder.create(TileEntityLaserRelayEnergyAdvanced::new, ActuallyBlocks.LASER_RELAY_ADVANCED.get()).build(null)); - public static final RegistryObject> LASERRELAYENERGYEXTREME_TILE = TILES.register("laserRelayExtreme", () -> TileEntityType.Builder.create(TileEntityLaserRelayEnergyExtreme::new, ActuallyBlocks.LASER_RELAY_EXTREME.get()).build(null)); - public static final RegistryObject> LASERRELAYITEMWHITELIST_TILE = TILES.register("laserRelayItemWhitelist", () -> TileEntityType.Builder.create(TileEntityLaserRelayItemWhitelist::new, ActuallyBlocks.LASER_RELAY_ITEM_WHITELIST.get()).build(null)); - //public static final RegistryObject> ITEMVIEWER_TILE = TILES.register("itemViewer", () -> TileEntityType.Builder.create(TileEntityItemInterface::new, ActuallyBlocks.ITEM_VIEWER.get()).build(null)); - //public static final RegistryObject> DISPLAYSTAND_TILE = TILES.register("displayStand", () -> TileEntityType.Builder.create(TileEntityDisplayStand::new, ActuallyBlocks.DISPLAY_STAND.get()).build(null)); - public static final RegistryObject> SHOCKSUPPRESSOR_TILE = TILES.register("shockSuppressor", () -> TileEntityType.Builder.create(TileEntityShockSuppressor::new, ActuallyBlocks.SHOCK_SUPPRESSOR.get()).build(null)); - //public static final RegistryObject> EMPOWERER_TILE = TILES.register("empowerer", () -> TileEntityType.Builder.create(TileEntityEmpowerer::new, ActuallyBlocks.EMPOWERER.get()).build(null)); - public static final RegistryObject> LASERRELAYFLUIDS_TILE = TILES.register("laserRelayFluids", () -> TileEntityType.Builder.create(TileEntityLaserRelayFluids::new, ActuallyBlocks.LASER_RELAY_FLUIDS.get()).build(null)); - //public static final RegistryObject> BIOREACTOR_TILE = TILES.register("bioReactor", () -> TileEntityType.Builder.create(TileEntityBioReactor::new, ActuallyBlocks.BIOREACTOR.get()).build(null)); - //public static final RegistryObject> FARMER_TILE = TILES.register("farmer", () -> TileEntityType.Builder.create(TileEntityFarmer::new, ActuallyBlocks.FARMER.get()).build(null)); - //public static final RegistryObject> ITEMVIEWERHOPPING_TILE = TILES.register("itemViewerHopping", () -> TileEntityType.Builder.create(TileEntityItemInterfaceHopping::new, ActuallyBlocks.ITEM_VIEWER.get()).build(null)); - //public static final RegistryObject> BATTERYBOX_TILE = TILES.register("batteryBox", () -> TileEntityType.Builder.create(TileEntityBatteryBox::new, ActuallyBlocks.BATTERY_BOX.get()).build(null)); -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCrusher.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCrusher.java index 24d236036..c1e4abeae 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCrusher.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCrusher.java @@ -11,7 +11,7 @@ package de.ellpeck.actuallyadditions.mod.tile; import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe; -import de.ellpeck.actuallyadditions.mod.blocks.BlockFurnaceDouble; +import de.ellpeck.actuallyadditions.mod.blocks.BlockPoweredFurnace; import de.ellpeck.actuallyadditions.mod.inventory.ContainerGrinder; import de.ellpeck.actuallyadditions.mod.misc.SoundHandler; import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor; @@ -94,7 +94,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto super.updateEntity(); if (!this.world.isRemote) { if (this.isDouble && this.isAutoSplit) { - TileEntityFurnaceDouble.autoSplit(this.inv, SLOT_INPUT_1, SLOT_INPUT_2); + TileEntityPoweredFurnace.autoSplit(this.inv, SLOT_INPUT_1, SLOT_INPUT_2); } boolean crushed = false; @@ -144,7 +144,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto } BlockState currState = this.world.getBlockState(this.pos); - boolean current = currState.get(BlockFurnaceDouble.IS_ON); + boolean current = currState.get(BlockPoweredFurnace.IS_ON); boolean changeTo = current; if (this.lastCrushed != crushed) { changeTo = crushed; @@ -157,7 +157,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto } if (changeTo != current) { - this.world.setBlockState(this.pos, currState.with(BlockFurnaceDouble.IS_ON, changeTo)); + this.world.setBlockState(this.pos, currState.with(BlockPoweredFurnace.IS_ON, changeTo)); } this.lastCrushed = crushed; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItemWhitelist.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItemAdvanced.java similarity index 96% rename from src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItemWhitelist.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItemAdvanced.java index 1667af7bb..4cf0ebfb8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItemWhitelist.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItemAdvanced.java @@ -29,12 +29,12 @@ import net.minecraft.util.text.StringTextComponent; import javax.annotation.Nullable; -public class TileEntityLaserRelayItemWhitelist extends TileEntityLaserRelayItem implements IButtonReactor, INamedContainerProvider { +public class TileEntityLaserRelayItemAdvanced extends TileEntityLaserRelayItem implements IButtonReactor, INamedContainerProvider { public FilterSettings leftFilter = new FilterSettings(12, true, true, false, false, 0, -1000); public FilterSettings rightFilter = new FilterSettings(12, true, true, false, false, 0, -2000); - public TileEntityLaserRelayItemWhitelist() { + public TileEntityLaserRelayItemAdvanced() { super(ActuallyTiles.LASERRELAYITEMWHITELIST_TILE.get()); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLongRangeBreaker.java similarity index 97% rename from src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLongRangeBreaker.java index 1987cd915..d67bd346e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLongRangeBreaker.java @@ -34,7 +34,7 @@ import net.minecraftforge.energy.IEnergyStorage; import javax.annotation.Nullable; import java.util.List; -public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implements INamedContainerProvider { +public class TileEntityLongRangeBreaker extends TileEntityInventoryBase implements INamedContainerProvider { public static final int RANGE = 8; public static final int ENERGY_USE = 5; @@ -43,7 +43,7 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem private int lastEnergy; private int currentTime; - public TileEntityDirectionalBreaker() { + public TileEntityLongRangeBreaker() { super(ActuallyTiles.DIRECTIONALBREAKER_TILE.get(), 9); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java index 54abf30d2..ae9d3e07f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod.tile; +import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.blocks.BlockPhantom; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; @@ -19,7 +20,7 @@ import net.minecraftforge.energy.CapabilityEnergy; public class TileEntityPhantomEnergyface extends TileEntityPhantomFace implements ISharingEnergyProvider { public TileEntityPhantomEnergyface() { - super(ActuallyTiles.PHANTOMENERGYFACE_TILE.get()); + super(ActuallyBlocks.PHANTOM_ENERGYFACE.getTileEntityType()); this.type = BlockPhantom.Type.ENERGYFACE; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java index 4adb238f0..02ff42e9c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod.tile; +import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.blocks.BlockPhantom; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover; @@ -21,8 +22,8 @@ import net.minecraftforge.items.CapabilityItemHandler; public class TileEntityPhantomItemface extends TileEntityPhantomFace { public TileEntityPhantomItemface() { - super(ActuallyTiles.PHANTOMITEMFACE_TILE.get()); - this.type = BlockPhantom.Type.FACE; + super(ActuallyBlocks.PHANTOM_ITEMFACE.getTileEntityType()); + this.type = BlockPhantom.Type.ITEMFACE; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java index 7b9b5f29a..06afae213 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod.tile; +import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.blocks.BlockPhantom; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; @@ -19,7 +20,7 @@ import net.minecraftforge.fluids.capability.CapabilityFluidHandler; public class TileEntityPhantomLiquiface extends TileEntityPhantomFace implements ISharingFluidHandler { public TileEntityPhantomLiquiface() { - super(ActuallyTiles.PHANTOMLIQUIFACE_TILE.get()); + super(ActuallyBlocks.PHANTOM_LIQUIFACE.getTileEntityType()); this.type = BlockPhantom.Type.LIQUIFACE; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java index 3d6ebd150..d71edd8ec 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java @@ -11,6 +11,7 @@ package de.ellpeck.actuallyadditions.mod.tile; import de.ellpeck.actuallyadditions.api.tile.IPhantomTile; +import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.inventory.ContainerPhantomPlacer; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor; @@ -53,7 +54,7 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements } public TileEntityPhantomPlacer() { - super(ActuallyTiles.PHANTOMPLACER_TILE.get(), 9); + super(ActuallyBlocks.PHANTOM_PLACER.getTileEntityType(), 9); this.isBreaker = false; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPoweredFurnace.java similarity index 98% rename from src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPoweredFurnace.java index 338f26a3d..154603b0d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPoweredFurnace.java @@ -35,7 +35,7 @@ import net.minecraftforge.energy.IEnergyStorage; import javax.annotation.Nullable; -public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements IButtonReactor, INamedContainerProvider { +public class TileEntityPoweredFurnace extends TileEntityInventoryBase implements IButtonReactor, INamedContainerProvider { public static final int SLOT_INPUT_1 = 0; public static final int SLOT_OUTPUT_1 = 1; @@ -54,7 +54,7 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements private boolean lastAutoSplit; private boolean lastSmelted; - public TileEntityFurnaceDouble() { + public TileEntityPoweredFurnace() { super(ActuallyTiles.FURNACE_DOUBLE_TILE.get(), 4); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityVerticalDigger.java similarity index 98% rename from src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityVerticalDigger.java index ec860c50e..e485960c9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityVerticalDigger.java @@ -42,7 +42,7 @@ import net.minecraftforge.fluids.IFluidBlock; import javax.annotation.Nullable; import java.util.List; -public class TileEntityMiner extends TileEntityInventoryBase implements IButtonReactor, IEnergyDisplay, INamedContainerProvider { +public class TileEntityVerticalDigger extends TileEntityInventoryBase implements IButtonReactor, IEnergyDisplay, INamedContainerProvider { public static final int ENERGY_USE_PER_BLOCK = 650; public static final int DEFAULT_RANGE = 2; @@ -57,7 +57,7 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IButtonR private int oldCheckY; private int oldCheckZ; - public TileEntityMiner() { + public TileEntityVerticalDigger() { super(ActuallyTiles.MINER_TILE.get(), 9); } From db186bcaddd060cc2390d3b7626d68e8ae17cbf5 Mon Sep 17 00:00:00 2001 From: Flanks255 <32142731+Flanks255@users.noreply.github.com> Date: Sun, 22 Aug 2021 14:33:22 -0500 Subject: [PATCH 4/4] Block Reg Refactor part 3: The End... or is it? --- .../mod/blocks/ActuallyBlocks.java | 93 +++++++++++----- .../mod/blocks/metalists/TheWildPlants.java | 8 +- .../registration/AABlockReg.java | 102 ++++++++++++++++++ 3 files changed, 170 insertions(+), 33 deletions(-) create mode 100644 src/main/java/de/ellpeck/actuallyadditions/registration/AABlockReg.java diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java index 3093b71f6..6a568a998 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java @@ -189,8 +189,6 @@ public final class ActuallyBlocks { public static final AABlockReg HEAT_COLLECTOR = new AABlockReg<>("heat_collector", BlockHeatCollector::new, (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityHeatCollector::new); - - // Freakin-Lasers public static final AABlockReg LASER_RELAY = new AABlockReg<>("laser_relay", () -> new BlockLaserRelay(BlockLaserRelay.Type.ENERGY_BASIC), (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityLaserRelayEnergy::new); @@ -206,33 +204,70 @@ public final class ActuallyBlocks { (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityLaserRelayItemAdvanced::new); - //public static final RegistryObject WILD_PLANT = BLOCKS.register("wild", BlockWildPlant::new); //TODO: what is this? - public static final RegistryObject TINY_TORCH = BLOCKS.register("tiny_torch", BlockTinyTorch::new); - public static final RegistryObject ETHETIC_GREEN_BLOCK = BLOCKS.register("ethetic_green_block", BlockGeneric::new); - public static final RegistryObject ETHETIC_WHITE_BLOCK = BLOCKS.register("ethetic_white_block", BlockGeneric::new); - public static final RegistryObject ETHETIC_GREEN_STAIRS = BLOCKS.register("ethetic_green_stairs", () -> new StairsBlock(() -> ETHETIC_GREEN_BLOCK.get().getDefaultState(), AbstractBlock.Properties.from(ETHETIC_GREEN_BLOCK.get()))); - public static final RegistryObject ETHETIC_WHITE_STAIRS = BLOCKS.register("ethetic_white_stairs", () -> new StairsBlock(() -> ETHETIC_WHITE_BLOCK.get().getDefaultState(), AbstractBlock.Properties.from(ETHETIC_WHITE_BLOCK.get()))); - public static final RegistryObject ETHETIC_GREEN_SLAB = BLOCKS.register("ethetic_green_slab", () -> new SlabBlock(AbstractBlock.Properties.from(ETHETIC_GREEN_BLOCK.get()))); - public static final RegistryObject ETHETIC_WHITE_SLAB = BLOCKS.register("ethetic_white_slab", () -> new SlabBlock(AbstractBlock.Properties.from(ETHETIC_WHITE_BLOCK.get()))); - public static final RegistryObject ETHETIC_GREEN_WALL = BLOCKS.register("ethetic_green_wall", () -> new WallBlock(AbstractBlock.Properties.from(ETHETIC_GREEN_BLOCK.get()))); - public static final RegistryObject ETHETIC_WHITE_WALL = BLOCKS.register("ethetic_white_wall", () -> new WallBlock(AbstractBlock.Properties.from(ETHETIC_WHITE_BLOCK.get()))); - public static final RegistryObject RICE = BLOCKS.register("rice", () -> new BlockPlant(ActuallyItems.RICE_SEED.get()));// TODO: [port][replace] ensure values match these new BlockPlant(1, 2)); - public static final RegistryObject CANOLA = BLOCKS.register("canola", () -> new BlockPlant(ActuallyItems.CANOLA_SEED.get()));// TODO: [port][replace] ensure values match these new BlockPlant(2, 3)); - public static final RegistryObject FLAX = BLOCKS.register("flax", () -> new BlockPlant(ActuallyItems.FLAX_SEED.get()));// TODO: [port][replace] ensure values match these new BlockPlant(2, 4)); - public static final RegistryObject COFFEE = BLOCKS.register("coffee", () -> new BlockPlant(ActuallyItems.COFFEE_SEED.get()));// TODO: [port][replace] ensure values match these new BlockPlant(2, 2)); - public static final RegistryObject GREENHOUSE_GLASS = BLOCKS.register("greenhouse_glass", BlockGreenhouseGlass::new); - public static final RegistryObject BLACK_QUARTZ_BLOCK = BLOCKS.register("black_quartz_block", BlockGeneric::new); - public static final RegistryObject BLACK_QUARTZ_PILLAR_BLOCK = BLOCKS.register("black_quartz_pillar_block", BlockGeneric::new); - public static final RegistryObject CHISELED_BLACK_QUARTZ_BLOCK = BLOCKS.register("chiseled_black_quartz_block", BlockGeneric::new); - public static final RegistryObject BLACK_QUARTZ_WALL = BLOCKS.register("black_quartz_wall", () -> new WallBlock(AbstractBlock.Properties.from(blockMisc.get()))); - public static final RegistryObject CHISELED_BLACK_QUARTZ_WALL = BLOCKS.register("chiseled_black_quartz_wall", () -> new WallBlock(AbstractBlock.Properties.from(blockMisc.get()))); - public static final RegistryObject BLACK_QUARTZ_PILLAR_WALL = BLOCKS.register("black_quartz_pillar_wall", () -> new WallBlock(AbstractBlock.Properties.from(blockMisc.get()))); - public static final RegistryObject BLACK_QUARTZ_STAIR = BLOCKS.register("black_quartz_stair", () -> new StairsBlock(() -> blockMisc.get().getDefaultState(), AbstractBlock.Properties.from(blockMisc.get()))); - public static final RegistryObject CHISELED_BLACK_QUARTZ_STAIR = BLOCKS.register("chiseled_black_quartz_stair", () -> new StairsBlock(() -> blockMisc.get().getDefaultState(), AbstractBlock.Properties.from(blockMisc.get()))); - public static final RegistryObject BLACK_QUARTZ_PILLAR_STAIR = BLOCKS.register("black_quartz_pillar_stair", () -> new StairsBlock(() -> blockMisc.get().getDefaultState(), AbstractBlock.Properties.from(blockMisc.get()))); - public static final RegistryObject BLACK_QUARTZ_SLAB = BLOCKS.register("black_quartz_slab", () -> new SlabBlock(AbstractBlock.Properties.from(blockMisc.get()))); - public static final RegistryObject CHISELED_BLACK_QUARTZ_SLAB = BLOCKS.register("chiseled_black_quartz_slab", () -> new SlabBlock(AbstractBlock.Properties.from(blockMisc.get()))); - public static final RegistryObject BLACK_QUARTZ_PILLAR_SLAB = BLOCKS.register("black_quartz_pillar_slab", () -> new SlabBlock(AbstractBlock.Properties.from(blockMisc.get()))); + + // Misc building blocks + public static final AABlockReg ETHETIC_GREEN_BLOCK = new AABlockReg<>("ethetic_green_block", () -> new ActuallyBlock(miscBlockProperties), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg ETHETIC_WHITE_BLOCK = new AABlockReg<>("ethetic_white_block", () -> new ActuallyBlock(miscBlockProperties), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg BLACK_QUARTZ_BLOCK = new AABlockReg<>("black_quartz_block", () -> new ActuallyBlock(miscBlockProperties), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg BLACK_QUARTZ_PILLAR_BLOCK = new AABlockReg<>("black_quartz_pillar_block", () -> new ActuallyBlock(miscBlockProperties), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg CHISELED_BLACK_QUARTZ_BLOCK = new AABlockReg<>("chiseled_black_quartz_block", () -> new ActuallyBlock(miscBlockProperties), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + + public static final AABlockReg ETHETIC_GREEN_STAIRS = new AABlockReg<>("ethetic_green_stairs", () -> new StairsBlock(() -> ETHETIC_GREEN_BLOCK.get().getDefaultState(), AbstractBlock.Properties.from(ETHETIC_GREEN_BLOCK.get())), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg ETHETIC_WHITE_STAIRS = new AABlockReg<>("ethetic_white_stairs", () -> new StairsBlock(() -> ETHETIC_WHITE_BLOCK.get().getDefaultState(), AbstractBlock.Properties.from(ETHETIC_WHITE_BLOCK.get())), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg BLACK_QUARTZ_STAIR = new AABlockReg<>("black_quartz_stair", () -> new StairsBlock(() -> BLACK_QUARTZ_BLOCK.get().getDefaultState(), AbstractBlock.Properties.from(BLACK_QUARTZ_BLOCK.get())), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg CHISELED_BLACK_QUARTZ_STAIR = new AABlockReg<>("chiseled_black_quartz_stair", () -> new StairsBlock(() -> CHISELED_BLACK_QUARTZ_BLOCK.get().getDefaultState(), AbstractBlock.Properties.from(CHISELED_BLACK_QUARTZ_BLOCK.get())), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg BLACK_QUARTZ_PILLAR_STAIR = new AABlockReg<>("black_quartz_pillar_stair", () -> new StairsBlock(() -> BLACK_QUARTZ_PILLAR_BLOCK.get().getDefaultState(), AbstractBlock.Properties.from(BLACK_QUARTZ_PILLAR_BLOCK.get())), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + + public static final AABlockReg ETHETIC_GREEN_WALL = new AABlockReg<>("ethetic_green_wall", () -> new WallBlock(AbstractBlock.Properties.from(ETHETIC_GREEN_BLOCK.get())), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg ETHETIC_WHITE_WALL = new AABlockReg<>("ethetic_white_wall", () -> new WallBlock(AbstractBlock.Properties.from(ETHETIC_WHITE_BLOCK.get())), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg BLACK_QUARTZ_WALL = new AABlockReg<>("black_quartz_wall", () -> new WallBlock(AbstractBlock.Properties.from(BLACK_QUARTZ_BLOCK.get())), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg CHISELED_BLACK_QUARTZ_WALL = new AABlockReg<>("chiseled_black_quartz_wall", () -> new WallBlock(AbstractBlock.Properties.from(CHISELED_BLACK_QUARTZ_BLOCK.get())), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg BLACK_QUARTZ_PILLAR_WALL = new AABlockReg<>("black_quartz_pillar_wall", () -> new WallBlock(AbstractBlock.Properties.from(BLACK_QUARTZ_PILLAR_BLOCK.get())), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + + public static final AABlockReg ETHETIC_GREEN_SLAB = new AABlockReg<>("ethetic_green_slab", () -> new SlabBlock(AbstractBlock.Properties.from(ETHETIC_GREEN_BLOCK.get())), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg ETHETIC_WHITE_SLAB = new AABlockReg<>("ethetic_white_slab", () -> new SlabBlock(AbstractBlock.Properties.from(ETHETIC_WHITE_BLOCK.get())), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg BLACK_QUARTZ_SLAB = new AABlockReg<>("black_quartz_slab", () -> new SlabBlock(AbstractBlock.Properties.from(BLACK_QUARTZ_BLOCK.get())), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg CHISELED_BLACK_QUARTZ_SLAB = new AABlockReg<>("chiseled_black_quartz_slab", () -> new SlabBlock(AbstractBlock.Properties.from(CHISELED_BLACK_QUARTZ_BLOCK.get())), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg BLACK_QUARTZ_PILLAR_SLAB = new AABlockReg<>("black_quartz_pillar_slab", () -> new SlabBlock(AbstractBlock.Properties.from(BLACK_QUARTZ_PILLAR_BLOCK.get())), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + + + // Other Misc Blocks + public static final AABlockReg TINY_TORCH = new AABlockReg<>("tiny_torch", BlockTinyTorch::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + + //public static final AABlockReg<> WILD_PLANT = new AABlockReg<>("wild", BlockWildPlant::new); //TODO: what is this? + + //TODO: Are plants normal blocks / blockitems? i have no idea... news at 11... + public static final AABlockReg RICE = new AABlockReg<>("rice", () -> new BlockPlant(ActuallyItems.RICE_SEED.get()), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg CANOLA = new AABlockReg<>("canola", () -> new BlockPlant(ActuallyItems.CANOLA_SEED.get()), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg FLAX = new AABlockReg<>("flax", () -> new BlockPlant(ActuallyItems.FLAX_SEED.get()), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg COFFEE = new AABlockReg<>("coffee", () -> new BlockPlant(ActuallyItems.COFFEE_SEED.get()), + (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg GREENHOUSE_GLASS = new AABlockReg<>("greenhouse_glass", BlockGreenhouseGlass::new, + (b) -> new AABlockItem(b, defaultBlockItemProperties)); public static AbstractBlock.Properties defaultPickProps(int harvestLevel, float hardness, float resistance) { return AbstractBlock.Properties.create(Material.ROCK).harvestLevel(harvestLevel).harvestTool(ToolType.PICKAXE).hardnessAndResistance(hardness, resistance).sound(SoundType.STONE); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheWildPlants.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheWildPlants.java index 1393c65b1..35cad8991 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheWildPlants.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheWildPlants.java @@ -19,10 +19,10 @@ import net.minecraft.util.IStringSerializable; @Deprecated public enum TheWildPlants implements IStringSerializable { - CANOLA("canola", Rarity.RARE, ActuallyBlocks.CANOLA), - FLAX("flax", Rarity.RARE, ActuallyBlocks.FLAX), - RICE("rice", Rarity.RARE, ActuallyBlocks.RICE), - COFFEE("coffee", Rarity.RARE, ActuallyBlocks.COFFEE); + CANOLA("canola", Rarity.RARE, ActuallyBlocks.CANOLA.getBlock()), + FLAX("flax", Rarity.RARE, ActuallyBlocks.FLAX.getBlock()), + RICE("rice", Rarity.RARE, ActuallyBlocks.RICE.getBlock()), + COFFEE("coffee", Rarity.RARE, ActuallyBlocks.COFFEE.getBlock()); final String name; final Rarity rarity; diff --git a/src/main/java/de/ellpeck/actuallyadditions/registration/AABlockReg.java b/src/main/java/de/ellpeck/actuallyadditions/registration/AABlockReg.java new file mode 100644 index 000000000..9525f63bc --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/registration/AABlockReg.java @@ -0,0 +1,102 @@ +package de.ellpeck.actuallyadditions.registration; + +import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; +import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; +import net.minecraft.block.Block; +import net.minecraft.item.BlockItem; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityType; +import net.minecraftforge.fml.RegistryObject; + +import javax.annotation.Nonnull; +import java.util.Objects; +import java.util.function.Function; +import java.util.function.Supplier; + +public class AABlockReg implements Supplier { +//public class AABlock implements Supplier { + private final String name; + private final RegistryObject block; + private final RegistryObject item; + private RegistryObject> tileEntityType; + + public AABlockReg(String name, Supplier blockSupplier, Function itemSupplier, Supplier tileSupplier) { + this.name = name; + this.block = ActuallyBlocks.BLOCKS.register(name, blockSupplier); + this.item = ActuallyItems.ITEMS.register(name, () -> itemSupplier.apply(block.get())); + this.tileEntityType = ActuallyBlocks.TILES.register(name, () -> TileEntityType.Builder.create(tileSupplier, block.get()).build(null)); + } + public AABlockReg(String name, Supplier blockSupplier, Function itemSupplier) { + this.name = name; + this.block = ActuallyBlocks.BLOCKS.register(name, blockSupplier); + this.item = ActuallyItems.ITEMS.register(name, () -> itemSupplier.apply(block.get())); + } + + /* + public AABlock(BlockBuilder builder) { + this.name = builder.name; + this.block = ActuallyBlocks.BLOCKS.register(name, builder.blockSupplier); + this.item = ActuallyItems.ITEMS.register(name, () -> builder.itemSupplier.apply(block.get())); + if (builder.hasTile) + this.tileEntityType = ActuallyTiles.TILES.register(name, () -> TileEntityType.Builder.create(builder.tileSupplier, block.get()).build(null)); + } + + */ + + public String getName() {return name;} + + @Override + public Block get() { + return block.get(); + } + + public B getBlock() { + return block.get(); + } + + public I getItem() { + return item.get(); + } + + @Nonnull + public TileEntityType getTileEntityType() { return Objects.requireNonNull(tileEntityType.get());} + + + public static class BlockBuilder { + private final String name; + private Supplier blockSupplier; + private Function itemSupplier = (b) -> new BlockItem(b, ActuallyItems.defaultProps()); + private boolean hasTile = false; + private Supplier> tileSupplier; + + private BlockBuilder(String nameIn, Supplier blockSupplierIn) { + this.name = nameIn; + this.blockSupplier = blockSupplierIn; + } + + public static BlockBuilder block(String nameIn, Supplier blockSupplierIn) { + return new BlockBuilder(nameIn, blockSupplierIn); + } + + public BlockBuilder item(Function itemSupplierIn) { + itemSupplier = itemSupplierIn; + + return this; + } + + public BlockBuilder tile(Supplier> tileSupplierIn) { + tileSupplier = tileSupplierIn; + hasTile = true; + + return this; + } +/* + public AABlock build() { + return new AABlock(this); + } + + */ + + } +}