diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java index a0692c623..afd8985bd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java @@ -11,14 +11,15 @@ package de.ellpeck.actuallyadditions.mod; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; +import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.booklet.InitBooklet; -import de.ellpeck.actuallyadditions.mod.config.ConfigurationHandler; import de.ellpeck.actuallyadditions.mod.crafting.CrusherCrafting; 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.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.ItemCoffee; @@ -32,40 +33,39 @@ import de.ellpeck.actuallyadditions.mod.misc.DungeonLoot; import de.ellpeck.actuallyadditions.mod.misc.apiimpl.LaserRelayConnectionHandler; import de.ellpeck.actuallyadditions.mod.misc.apiimpl.MethodHandler; import de.ellpeck.actuallyadditions.mod.network.PacketHandler; -import de.ellpeck.actuallyadditions.mod.proxy.IProxy; import de.ellpeck.actuallyadditions.mod.recipe.EmpowererHandler; import de.ellpeck.actuallyadditions.mod.recipe.HairyBallHandler; import de.ellpeck.actuallyadditions.mod.recipe.TreasureChestHandler; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; +import de.ellpeck.actuallyadditions.mod.tile.ActuallyTiles; import de.ellpeck.actuallyadditions.mod.update.UpdateChecker; import de.ellpeck.actuallyadditions.mod.util.compat.CompatUtil; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; -import net.minecraft.launchwrapper.Launch; -import net.minecraft.server.MinecraftServer; -import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fml.common.FMLCommonHandler; -import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.Mod.EventHandler; -import net.minecraftforge.fml.common.Mod.Instance; -import net.minecraftforge.fml.common.SidedProxy; -import net.minecraftforge.fml.common.event.*; -import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.fml.event.server.FMLServerStartedEvent; +import net.minecraftforge.fml.event.server.FMLServerStoppedEvent; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@Mod(modid = ActuallyAdditions.MODID, name = ActuallyAdditions.NAME, version = ActuallyAdditions.VERSION, guiFactory = ActuallyAdditions.GUIFACTORY, dependencies = ActuallyAdditions.DEPS) +//@Mod(modid = ActuallyAdditions.MODID, name = ActuallyAdditions.NAME, version = ActuallyAdditions.VERSION, guiFactory = ActuallyAdditions.GUIFACTORY, dependencies = ActuallyAdditions.DEPS) +@Mod(ActuallyAdditions.MODID) public class ActuallyAdditions { public static final String MODID = ActuallyAdditionsAPI.MOD_ID; + + @Deprecated public static final String NAME = "Actually Additions"; + @Deprecated public static final String VERSION = "@VERSION@"; + @Deprecated public static final String GUIFACTORY = "de.ellpeck.actuallyadditions.mod.config.GuiFactory"; public static final String DEPS = "required:forge@[14.23.5.2836,);before:craftingtweaks;after:fastbench@[1.3.2,)"; - public static final boolean DEOBF = (boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"); + // public static final boolean DEOBF = (boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"); public static final ItemGroup GROUP = new ItemGroup(MODID) { @Override @@ -74,70 +74,52 @@ public class ActuallyAdditions { } }; - @Instance + @Deprecated public static ActuallyAdditions INSTANCE; - @SidedProxy(clientSide = "de.ellpeck.actuallyadditions.mod.proxy.ClientProxy", serverSide = "de.ellpeck.actuallyadditions.mod.proxy.ServerProxy") - public static IProxy PROXY; - public static final Logger LOGGER = LogManager.getLogger(NAME); - static { - FluidRegistry.enableUniversalBucket(); - } + // TODO: [port] eval + // static { + // FluidRegistry.enableUniversalBucket(); + // } public static boolean commonCapsLoaded; - @EventHandler - public void preInit(FMLPreInitializationEvent event) { - ActuallyAdditions.LOGGER.info("Starting PreInitialization Phase..."); + public ActuallyAdditions() { + IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus(); + + InitBlocks.BLOCKS.register(eventBus); + ActuallyTiles.TILES.register(eventBus); + ActuallyContainers.CONTAINERS.register(eventBus); + + MinecraftForge.EVENT_BUS.addListener(this::serverStarted); + MinecraftForge.EVENT_BUS.addListener(this::serverStopped); + MinecraftForge.EVENT_BUS.register(new CommonEvents()); + MinecraftForge.EVENT_BUS.register(new DungeonLoot()); + + eventBus.addListener(this::setup); + eventBus.addListener(this::clientSetup); + } + + private void setup(FMLCommonSetupEvent event) { + PacketHandler.init(); ActuallyAdditionsAPI.methodHandler = new MethodHandler(); ActuallyAdditionsAPI.connectionHandler = new LaserRelayConnectionHandler(); Lenses.init(); - InitBooklet.preInit(); CompatUtil.registerCraftingTweaks(); - commonCapsLoaded = Loader.isModLoaded("commoncapabilities"); - MinecraftForge.EVENT_BUS.register(new RegistryHandler()); + commonCapsLoaded = false; // Loader.isModLoaded("commoncapabilities"); - new ConfigurationHandler(event.getSuggestedConfigurationFile()); - PacketHandler.init(); InitToolMaterials.init(); InitArmorMaterials.init(); InitFluids.init(); new UpdateChecker(); - PROXY.preInit(event); - - ActuallyAdditions.LOGGER.info("PreInitialization Finished."); - } - - @EventHandler - public void init(FMLInitializationEvent event) { - ActuallyAdditions.LOGGER.info("Starting Initialization Phase..."); - BannerHelper.init(); - //InitAchievements.init(); GuiHandler.init(); + InitEntities.init(); // todo: [port] replace AAWorldGen gen = new AAWorldGen(); - GameRegistry.registerWorldGenerator(gen, 10000); - MinecraftForge.TERRAIN_GEN_BUS.register(gen); - TileEntityBase.init(); - MinecraftForge.EVENT_BUS.register(new CommonEvents()); - MinecraftForge.EVENT_BUS.register(new DungeonLoot()); - InitEntities.init(); - - PROXY.init(event); - - RegistryHandler.BLOCKS_TO_REGISTER.clear(); - - ActuallyAdditions.LOGGER.info("Initialization Finished."); - } - - @EventHandler - public void postInit(FMLPostInitializationEvent event) { - ActuallyAdditions.LOGGER.info("Starting PostInitialization Phase..."); - ItemCoffee.initIngredients(); CrusherCrafting.init(); HairyBallHandler.init(); @@ -145,28 +127,26 @@ public class ActuallyAdditions { LensRecipeHandler.init(); EmpowererHandler.init(); LensMining.init(); - - InitBooklet.postInit(); - PROXY.postInit(event); - - ConfigurationHandler.redefineConfigs(); - - ActuallyAdditions.LOGGER.info("PostInitialization Finished."); + InitBooklet.init(); + } + + private void clientSetup(FMLClientSetupEvent event) { + ActuallyAdditionsClient.setup(); } - @EventHandler public void serverStarted(FMLServerStartedEvent event) { - MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance(); - if (server != null) { - World world = server.getEntityWorld(); - if (world != null && !world.isRemote) { - WorldData.get(world, true).markDirty(); - } - } + // TODO: [port] check if this is needed + + // if (event.getServer() != null) { + // World world = event.getServer().getWorld(OVERWORLD); + // if (world != null && !world.isRemote) { + // WorldData.get(world, true).markDirty(); + // } + // } } - @EventHandler public void serverStopped(FMLServerStoppedEvent event) { + // TODO: [port] check if this is needed WorldData.clear(); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditionsClient.java b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditionsClient.java new file mode 100644 index 000000000..969823f71 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditionsClient.java @@ -0,0 +1,67 @@ +/* + * This file ("ActuallyAdditions.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; + +import de.ellpeck.actuallyadditions.mod.blocks.render.*; +import de.ellpeck.actuallyadditions.mod.entity.InitEntities; +import de.ellpeck.actuallyadditions.mod.entity.RenderWorm; +import de.ellpeck.actuallyadditions.mod.event.ClientEvents; +import de.ellpeck.actuallyadditions.mod.inventory.ActuallyContainers; +import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiBag; +import de.ellpeck.actuallyadditions.mod.misc.special.SpecialRenderInit; +import de.ellpeck.actuallyadditions.mod.tile.ActuallyTiles; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScreenManager; +import net.minecraft.client.network.play.ClientPlayNetHandler; +import net.minecraft.network.play.client.CPlayerDiggingPacket; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.BlockRayTraceResult; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.client.registry.ClientRegistry; + +public class ActuallyAdditionsClient { + + public static void setup() { + ScreenManager.registerFactory(ActuallyContainers.BAG_CONTAINER.get(), GuiBag::new); + + // From old proxy + InitEntities.initClient(); + MinecraftForge.EVENT_BUS.register(new ClientEvents()); + MinecraftForge.EVENT_BUS.register(new ClientRegistryHandler()); + MinecraftForge.EVENT_BUS.register(new SpecialRenderInit()); + + setupSpecialRenders(); + + RenderWorm.fixItemStack();// todo: remove + } + + private static void setupSpecialRenders() { + ClientRegistry.bindTileEntityRenderer(ActuallyTiles.ATOMICRECONSTRUCTOR_TILE.get(), RenderReconstructorLens::new); + ClientRegistry.bindTileEntityRenderer(ActuallyTiles.DISPLAYSTAND_TILE.get(), RenderDisplayStand::new); + ClientRegistry.bindTileEntityRenderer(ActuallyTiles.EMPOWERER_TILE.get(), RenderEmpowerer::new); + ClientRegistry.bindTileEntityRenderer(ActuallyTiles.BATTERYBOX_TILE.get(), RenderBatteryBox::new); + + ClientRegistry.bindTileEntityRenderer(ActuallyTiles.LASERRELAYENERGY_TILE.get(), RenderLaserRelay::new); + ClientRegistry.bindTileEntityRenderer(ActuallyTiles.LASERRELAYENERGYADVANCED_TILE.get(), RenderLaserRelay::new); + ClientRegistry.bindTileEntityRenderer(ActuallyTiles.LASERRELAYENERGYEXTREME_TILE.get(), RenderLaserRelay::new); + ClientRegistry.bindTileEntityRenderer(ActuallyTiles.LASERRELAYITEM_TILE.get(), RenderLaserRelay::new); + ClientRegistry.bindTileEntityRenderer(ActuallyTiles.LASERRELAYITEMWHITELIST_TILE.get(), RenderLaserRelay::new); + ClientRegistry.bindTileEntityRenderer(ActuallyTiles.LASERRELAYFLUIDS_TILE.get(), RenderLaserRelay::new); + } + + // TODO: [port] validate that this works + public void sendBreakPacket(BlockPos pos) { + ClientPlayNetHandler connection = Minecraft.getInstance().getConnection(); + assert connection != null; + assert Minecraft.getInstance().objectMouseOver != null; + connection.sendPacket(new CPlayerDiggingPacket(CPlayerDiggingPacket.Action.STOP_DESTROY_BLOCK, pos, ((BlockRayTraceResult) Minecraft.getInstance().objectMouseOver).getFace())); + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/ClientRegistryHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/ClientRegistryHandler.java index 73e405e6b..9fb2eb56d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/ClientRegistryHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/ClientRegistryHandler.java @@ -1,24 +1,18 @@ package de.ellpeck.actuallyadditions.mod; -import de.ellpeck.actuallyadditions.mod.blocks.render.ActualCompostModel; -import de.ellpeck.actuallyadditions.mod.blocks.render.CompostModel; -import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; -import de.ellpeck.actuallyadditions.mod.util.FluidStateMapper; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.block.model.ModelBakery; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.item.Item; +import net.minecraft.client.renderer.model.ModelResourceLocation; +import net.minecraft.fluid.Fluid; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.ModelBakeEvent; import net.minecraftforge.client.event.ModelRegistryEvent; -import net.minecraftforge.client.model.ModelLoader; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; import java.util.HashMap; import java.util.Map; +/** + * TODO: [port] eval all of this class + */ public class ClientRegistryHandler { public static final Map MODEL_LOCATIONS_FOR_REGISTERING = new HashMap<>(); @@ -27,36 +21,36 @@ public class ClientRegistryHandler { * (Excerpted from Tinkers' Construct with permission, thanks guys!) */ private static void registerCustomFluidBlockRenderer(Fluid fluid) { - Block block = fluid.getBlock(); - Item item = Item.getItemFromBlock(block); - FluidStateMapper mapper = new FluidStateMapper(fluid); - ModelBakery.registerItemVariants(item); - ModelLoader.setCustomMeshDefinition(item, mapper); - ModelLoader.setCustomStateMapper(block, mapper); + // Block block = fluid.getBlock(); + // Item item = Item.getItemFromBlock(block); + // FluidStateMapper mapper = new FluidStateMapper(fluid); + // ModelBakery.registerItemVariants(item); + // ModelLoader.setCustomMeshDefinition(item, mapper); + // ModelLoader.setCustomStateMapper(block, mapper); } @SubscribeEvent public void onModelRegistry(ModelRegistryEvent event) { - for (Block block : RegistryHandler.BLOCKS_TO_REGISTER) { - if (block instanceof IHasModel) { - ((IHasModel) block).registerRendering(); - } - } - - for (Map.Entry entry : MODEL_LOCATIONS_FOR_REGISTERING.entrySet()) { - ModelLoader.setCustomModelResourceLocation(entry.getKey().getItem(), entry.getKey().getItemDamage(), entry.getValue()); - } - - registerCustomFluidBlockRenderer(InitFluids.fluidCanolaOil); - registerCustomFluidBlockRenderer(InitFluids.fluidRefinedCanolaOil); - registerCustomFluidBlockRenderer(InitFluids.fluidCrystalOil); - registerCustomFluidBlockRenderer(InitFluids.fluidEmpoweredOil); + // for (Block block : RegistryHandler.BLOCKS_TO_REGISTER) { + // if (block instanceof IHasModel) { + // ((IHasModel) block).registerRendering(); + // } + // } + // + // for (Map.Entry entry : MODEL_LOCATIONS_FOR_REGISTERING.entrySet()) { + // ModelLoader.setCustomModelResourceLocation(entry.getKey().getItem(), entry.getKey().getItemDamage(), entry.getValue()); + // } + // + // registerCustomFluidBlockRenderer(InitFluids.fluidCanolaOil); + // registerCustomFluidBlockRenderer(InitFluids.fluidRefinedCanolaOil); + // registerCustomFluidBlockRenderer(InitFluids.fluidCrystalOil); + // registerCustomFluidBlockRenderer(InitFluids.fluidEmpoweredOil); } @SubscribeEvent public void onModelBake(ModelBakeEvent e) { - ModelResourceLocation mrl = new ModelResourceLocation(new ResourceLocation(ActuallyAdditions.MODID, "block_compost"), "normal"); - CompostModel.compostBase = e.getModelRegistry().getObject(mrl); - e.getModelRegistry().putObject(mrl, new ActualCompostModel()); + // ModelResourceLocation mrl = new ModelResourceLocation(new ResourceLocation(ActuallyAdditions.MODID, "block_compost"), "normal"); + // CompostModel.compostBase = e.getModelRegistry().getObject(mrl); + // e.getModelRegistry().putObject(mrl, new ActualCompostModel()); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/RegistryHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/RegistryHandler.java index 0f4ed0d25..0b878cf71 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/RegistryHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/RegistryHandler.java @@ -1,78 +1,79 @@ -package de.ellpeck.actuallyadditions.mod; - -import java.util.ArrayList; -import java.util.List; - -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; -import de.ellpeck.actuallyadditions.mod.crafting.InitCrafting; -import de.ellpeck.actuallyadditions.mod.gen.village.InitVillager; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.misc.SoundHandler; -import de.ellpeck.actuallyadditions.mod.ore.InitOreDict; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.util.SoundEvent; -import net.minecraftforge.event.RegistryEvent.Register; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession; - -//Class to wrap around the trainwreck that is the new registry system -public class RegistryHandler { - - public static final List BLOCKS_TO_REGISTER = new ArrayList<>(); - public static final List ITEMS_TO_REGISTER = new ArrayList<>(); - public static final List SOUNDS_TO_REGISTER = new ArrayList<>(); - public static final List RECIPES_TO_REGISTER = new ArrayList<>(); - - @SubscribeEvent - public void onBlockRegistry(Register event) { - InitBlocks.init(); - - for (Block block : BLOCKS_TO_REGISTER) { - event.getRegistry().register(block); - } - } - - @SubscribeEvent - public void onItemRegistry(Register event) { - InitItems.init(); - - for (Item item : ITEMS_TO_REGISTER) { - event.getRegistry().register(item); - } - ITEMS_TO_REGISTER.clear(); - - //Hack to make this register before recipes :> - InitOreDict.init(); - } - - @SubscribeEvent - public void onVillagerRegistry(Register event) { - InitVillager.init(); - - if (ConfigBoolValues.JAM_VILLAGER_EXISTS.isEnabled()) event.getRegistry().register(InitVillager.jamProfession); - if (ConfigBoolValues.ENGINEER_VILLAGER_EXISTS.isEnabled()) event.getRegistry().register(InitVillager.engineerProfession); - } - - @SubscribeEvent - public void onCraftingRegistry(Register event) { - InitCrafting.init(); - - for (IRecipe recipe : RECIPES_TO_REGISTER) { - event.getRegistry().register(recipe); - } - RECIPES_TO_REGISTER.clear(); - } - - @SubscribeEvent - public void onSoundRegistry(Register event) { - SoundHandler.init(); - - for (SoundEvent sound : SOUNDS_TO_REGISTER) { - event.getRegistry().register(sound); - } - SOUNDS_TO_REGISTER.clear(); - } -} +// TODO: [port] remove all of this +//package de.ellpeck.actuallyadditions.mod; +// +//import java.util.ArrayList; +//import java.util.List; +// +//import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +//import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; +//import de.ellpeck.actuallyadditions.mod.crafting.InitCrafting; +//import de.ellpeck.actuallyadditions.mod.gen.village.InitVillager; +//import de.ellpeck.actuallyadditions.mod.items.InitItems; +//import de.ellpeck.actuallyadditions.mod.misc.SoundHandler; +//import de.ellpeck.actuallyadditions.mod.ore.InitOreDict; +//import net.minecraft.block.Block; +//import net.minecraft.item.Item; +//import net.minecraft.item.crafting.IRecipe; +//import net.minecraft.util.SoundEvent; +//import net.minecraftforge.event.RegistryEvent.Register; +//import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +//import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession; +// +////Class to wrap around the trainwreck that is the new registry system +//public class RegistryHandler { +// +// public static final List BLOCKS_TO_REGISTER = new ArrayList<>(); +// public static final List ITEMS_TO_REGISTER = new ArrayList<>(); +// public static final List SOUNDS_TO_REGISTER = new ArrayList<>(); +// public static final List RECIPES_TO_REGISTER = new ArrayList<>(); +// +// @SubscribeEvent +// public void onBlockRegistry(Register event) { +// InitBlocks.init(); +// +// for (Block block : BLOCKS_TO_REGISTER) { +// event.getRegistry().register(block); +// } +// } +// +// @SubscribeEvent +// public void onItemRegistry(Register event) { +// InitItems.init(); +// +// for (Item item : ITEMS_TO_REGISTER) { +// event.getRegistry().register(item); +// } +// ITEMS_TO_REGISTER.clear(); +// +// //Hack to make this register before recipes :> +// InitOreDict.init(); +// } +// +// @SubscribeEvent +// public void onVillagerRegistry(Register event) { +// InitVillager.init(); +// +// if (ConfigBoolValues.JAM_VILLAGER_EXISTS.isEnabled()) event.getRegistry().register(InitVillager.jamProfession); +// if (ConfigBoolValues.ENGINEER_VILLAGER_EXISTS.isEnabled()) event.getRegistry().register(InitVillager.engineerProfession); +// } +// +// @SubscribeEvent +// public void onCraftingRegistry(Register event) { +// InitCrafting.init(); +// +// for (IRecipe recipe : RECIPES_TO_REGISTER) { +// event.getRegistry().register(recipe); +// } +// RECIPES_TO_REGISTER.clear(); +// } +// +// @SubscribeEvent +// public void onSoundRegistry(Register event) { +// SoundHandler.init(); +// +// for (SoundEvent sound : SOUNDS_TO_REGISTER) { +// event.getRegistry().register(sound); +// } +// SOUNDS_TO_REGISTER.clear(); +// } +//} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java index a4d84e24b..d490f8e6d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java @@ -10,12 +10,13 @@ package de.ellpeck.actuallyadditions.mod.blocks; +import com.mojang.blaze3d.matrix.MatrixStack; import de.ellpeck.actuallyadditions.api.lens.ILensItem; -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; +import de.ellpeck.actuallyadditions.mod.util.Help; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.Block; @@ -40,6 +41,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextFormatting; import net.minecraft.world.IBlockReader; import net.minecraft.world.World; @@ -116,19 +118,23 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud @Override @OnlyIn(Dist.CLIENT) - public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, MainWindow resolution) { - TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos()); + public void displayHud(MatrixStack matrices, Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult rayCast, MainWindow resolution) { + if (!(rayCast instanceof BlockRayTraceResult) || minecraft.world == null) { + return; + } + + TileEntity tile = minecraft.world.getTileEntity(((BlockRayTraceResult) rayCast).getPos()); if (tile instanceof TileEntityAtomicReconstructor) { ItemStack slot = ((TileEntityAtomicReconstructor) tile).inv.getStackInSlot(0); - String strg; + ITextComponent strg; if (!StackUtil.isValid(slot)) { - strg = StringUtil.localize("info." + ActuallyAdditions.MODID + ".noLens"); + strg = Help.Trans("info", "nolens"); } else { - strg = slot.getItem().getItemStackDisplayName(slot); + strg = slot.getItem().getDisplayName(slot); AssetUtil.renderStackToGui(slot, resolution.getScaledWidth() / 2 + 15, resolution.getScaledHeight() / 2 - 19, 1F); } - minecraft.fontRenderer.drawStringWithShadow(TextFormatting.YELLOW + "" + TextFormatting.ITALIC + strg, resolution.getScaledWidth() / 2 + 35, resolution.getScaledHeight() / 2 - 15, StringUtil.DECIMAL_COLOR_WHITE); + minecraft.fontRenderer.drawStringWithShadow(matrices, strg.copyRaw().mergeStyle(TextFormatting.YELLOW).mergeStyle(TextFormatting.ITALIC).getString(), resolution.getScaledWidth() / 2 + 35, resolution.getScaledHeight() / 2f - 15, StringUtil.DECIMAL_COLOR_WHITE); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBioReactor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBioReactor.java index f58ed840f..e491ccd60 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBioReactor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBioReactor.java @@ -14,45 +14,41 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBioReactor; +import net.minecraft.block.BlockState; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemStack; +import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Direction; +import net.minecraft.util.ActionResultType; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.BlockRayTraceResult; +import net.minecraft.world.IBlockReader; import net.minecraft.world.World; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.fml.network.NetworkHooks; public class BlockBioReactor extends BlockContainerBase { public BlockBioReactor() { - super(Material.ROCK, this.name); - - this.setHarvestLevel("pickaxe", 0); - this.setHardness(2.0F); - this.setResistance(10.0F); - this.setSoundType(SoundType.STONE); + super(Properties.create(Material.ROCK).harvestTool(ToolType.PICKAXE).hardnessAndResistance(2.0F, 10.0F).sound(SoundType.STONE)); } @Override - public TileEntity createNewTileEntity(World worldIn, int meta) { + public TileEntity createNewTileEntity(IBlockReader worldIn) { return new TileEntityBioReactor(); } @Override - public boolean onBlockActivated(World world, BlockPos pos, BlockState state, PlayerEntity player, Hand hand, Direction par6, float par7, float par8, float par9) { + public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) { if (!world.isRemote) { - if (world.getTileEntity(pos) instanceof TileEntityBioReactor) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity instanceof TileEntityBioReactor) { + NetworkHooks.openGui((ServerPlayerEntity) player, tileEntity, pos); player.openGui(ActuallyAdditions.INSTANCE, GuiHandler.GuiTypes.BIO_REACTOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); } } return true; } - - @Override - public EnumRarity getRarity(ItemStack stack) { - return EnumRarity.EPIC; - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java index 8e16eed73..303bad1a3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod.blocks; +import com.mojang.blaze3d.matrix.MatrixStack; import de.ellpeck.actuallyadditions.api.recipe.CompostRecipe; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCompost; @@ -157,8 +158,8 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay { @Override @OnlyIn(Dist.CLIENT) - public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, MainWindow resolution) { - TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos()); + public void displayHud(MatrixStack matrices, Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult rayCast, MainWindow resolution) { + TileEntity tile = minecraft.world.getTileEntity(rayCast.getBlockPos()); if (tile instanceof TileEntityCompost) { ItemStack slot = ((TileEntityCompost) tile).inv.getStackInSlot(0); String strg; 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 004637240..216a146eb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod.blocks; +import com.mojang.blaze3d.matrix.MatrixStack; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.laser.Network; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; @@ -244,13 +245,13 @@ public class BlockLaserRelay extends BlockContainerBase implements IHudDisplay { @Override @OnlyIn(Dist.CLIENT) - public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, MainWindow resolution) { - if (posHit != null && posHit.getBlockPos() != null && minecraft.world != null) { + public void displayHud(MatrixStack matrices, Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult rayCast, MainWindow resolution) { + if (rayCast != null && rayCast.getBlockPos() != null && minecraft.world != null) { boolean wearing = ItemEngineerGoggles.isWearing(player); if (wearing || StackUtil.isValid(stack)) { boolean compass = stack.getItem() == ConfigValues.itemCompassConfigurator; if (wearing || compass || stack.getItem() instanceof ItemLaserWrench) { - TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos()); + TileEntity tile = minecraft.world.getTileEntity(rayCast.getBlockPos()); if (tile instanceof TileEntityLaserRelay) { TileEntityLaserRelay relay = (TileEntityLaserRelay) tile; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLavaFactoryController.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLavaFactoryController.java index 5a0997760..7cb91b9f3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLavaFactoryController.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLavaFactoryController.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod.blocks; +import com.mojang.blaze3d.matrix.MatrixStack; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityLavaFactoryController; @@ -49,8 +50,8 @@ public class BlockLavaFactoryController extends BlockContainerBase implements IH @Override @OnlyIn(Dist.CLIENT) - public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, MainWindow resolution) { - TileEntityLavaFactoryController factory = (TileEntityLavaFactoryController) minecraft.world.getTileEntity(posHit.getBlockPos()); + public void displayHud(MatrixStack matrices, Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult rayCast, MainWindow resolution) { + TileEntityLavaFactoryController factory = (TileEntityLavaFactoryController) minecraft.world.getTileEntity(rayCast.getBlockPos()); if (factory != null) { int state = factory.isMultiblock(); if (state == TileEntityLavaFactoryController.NOT_MULTI) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMiner.java index bdf38167a..bc7a01f09 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMiner.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod.blocks; +import com.mojang.blaze3d.matrix.MatrixStack; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; @@ -69,8 +70,8 @@ public class BlockMiner extends BlockContainerBase implements IHudDisplay { @Override @OnlyIn(Dist.CLIENT) - public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, MainWindow resolution) { - TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos()); + public void displayHud(MatrixStack matrices, Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult rayCast, MainWindow resolution) { + TileEntity tile = minecraft.world.getTileEntity(rayCast.getBlockPos()); if (tile instanceof TileEntityMiner) { TileEntityMiner miner = (TileEntityMiner) tile; String info = miner.checkY == 0 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 c1c502e99..9218a4d76 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod.blocks; +import com.mojang.blaze3d.matrix.MatrixStack; import de.ellpeck.actuallyadditions.api.tile.IPhantomTile; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; @@ -121,14 +122,14 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay { @Override @OnlyIn(Dist.CLIENT) - public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, MainWindow resolution) { - TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos()); + public void displayHud(MatrixStack matrices, Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult rayCast, MainWindow resolution) { + TileEntity tile = minecraft.world.getTileEntity(rayCast.getBlockPos()); if (tile != null) { if (tile instanceof IPhantomTile) { IPhantomTile phantom = (IPhantomTile) tile; minecraft.fontRenderer.drawStringWithShadow(TextFormatting.GOLD + StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".blockPhantomRange.desc") + ": " + phantom.getRange(), resolution.getScaledWidth() / 2 + 5, resolution.getScaledHeight() / 2 - 40, StringUtil.DECIMAL_COLOR_WHITE); if (phantom.hasBoundPosition()) { - int distance = MathHelper.ceil(new Vec3d(posHit.getBlockPos()).distanceTo(new Vec3d(phantom.getBoundPosition()))); + int distance = MathHelper.ceil(new Vec3d(rayCast.getBlockPos()).distanceTo(new Vec3d(phantom.getBoundPosition()))); BlockState state = minecraft.world.getBlockState(phantom.getBoundPosition()); Block block = state.getBlock(); Item item = Item.getItemFromBlock(block); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPlayerInterface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPlayerInterface.java index 1ebbb1ed2..4216894ca 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPlayerInterface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPlayerInterface.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod.blocks; +import com.mojang.blaze3d.matrix.MatrixStack; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityPlayerInterface; import de.ellpeck.actuallyadditions.mod.util.StringUtil; @@ -67,8 +68,8 @@ public class BlockPlayerInterface extends BlockContainerBase implements IHudDisp @Override @OnlyIn(Dist.CLIENT) - public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, MainWindow resolution) { - TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos()); + public void displayHud(MatrixStack matrices, Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult rayCast, MainWindow resolution) { + TileEntity tile = minecraft.world.getTileEntity(rayCast.getBlockPos()); if (tile != null) { if (tile instanceof TileEntityPlayerInterface) { TileEntityPlayerInterface face = (TileEntityPlayerInterface) tile; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/IHudDisplay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/IHudDisplay.java index 41a154450..7dcd2ef8c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/IHudDisplay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/IHudDisplay.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod.blocks; +import com.mojang.blaze3d.matrix.MatrixStack; import net.minecraft.client.MainWindow; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.PlayerEntity; @@ -21,6 +22,6 @@ import net.minecraftforge.api.distmarker.OnlyIn; public interface IHudDisplay { @OnlyIn(Dist.CLIENT) - void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, MainWindow resolution); + void displayHud(MatrixStack matrices, Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult rayCast, MainWindow resolution); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderDisplayStand.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderDisplayStand.java index a29e07872..d76f6127b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderDisplayStand.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderDisplayStand.java @@ -10,20 +10,23 @@ package de.ellpeck.actuallyadditions.mod.blocks.render; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.platform.GlStateManager; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.tile.TileEntityDisplayStand; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.item.ItemBlock; +import net.minecraft.client.renderer.IRenderTypeBuffer; +import net.minecraft.client.renderer.tileentity.TileEntityRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.item.ItemStack; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.fml.relauncher.OnlyIn; -@OnlyIn(Dist.CLIENT) -public class RenderDisplayStand extends TileEntitySpecialRenderer { +public class RenderDisplayStand extends TileEntityRenderer { + + public RenderDisplayStand(TileEntityRendererDispatcher rendererDispatcherIn) { + super(rendererDispatcherIn); + } @Override public void render(TileEntityDisplayStand tile, double x, double y, double z, float par5, int par6, float f) { @@ -53,4 +56,9 @@ public class RenderDisplayStand extends TileEntitySpecialRenderer { +public class RenderEmpowerer extends TileEntityRenderer { @Override public void render(TileEntityEmpowerer tile, double x, double y, double z, float par5, int par6, float f) { @@ -70,4 +69,13 @@ public class RenderEmpowerer extends TileEntitySpecialRenderer { +public class RenderLaserRelay extends TileEntityRenderer { private static final float[] COLOR = new float[]{1F, 0F, 0F}; private static final float[] COLOR_ITEM = new float[]{0F, 124F / 255F, 16F / 255F}; @@ -105,6 +105,15 @@ public class RenderLaserRelay extends TileEntitySpecialRenderer { +public class RenderReconstructorLens extends TileEntityRenderer { + + public RenderReconstructorLens(TileEntityRendererDispatcher rendererDispatcherIn) { + super(rendererDispatcherIn); + } + + @Override + public void render(TileEntityAtomicReconstructor tileEntityIn, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) { + + } @Override public void render(TileEntityAtomicReconstructor tile, double x, double y, double z, float par5, int par6, float f) { 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 717d33a6e..3f6cde2fd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -36,7 +36,6 @@ import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.ItemWingsOfTheBats; import de.ellpeck.actuallyadditions.mod.items.lens.LensDisenchanting; import de.ellpeck.actuallyadditions.mod.items.lens.LensRecipeHandler; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.recipe.EmpowererHandler; @@ -61,7 +60,7 @@ public final class InitBooklet { public static BookletChapter[] chaptersIntroduction = new BookletChapter[11]; - public static void preInit() { + public static void init() { ActuallyAdditionsAPI.entryAllAndSearch = new BookletEntryAllItems("allAndSearch").setImportant(); ActuallyAdditionsAPI.entryTrials = new BookletEntryTrials("trials"); @@ -75,9 +74,7 @@ public final class InitBooklet { ActuallyAdditionsAPI.entryItemsRF = new BookletEntry("itemsRF"); ActuallyAdditionsAPI.entryMisc = new BookletEntry("misc"); ActuallyAdditionsAPI.entryUpdatesAndInfos = new BookletEntry("updatesAndInfos").setSpecial(); - } - public static void postInit() { initChapters(); int chapCount = 0; @@ -129,9 +126,9 @@ public final class InitBooklet { private static void initChapters() { //Getting Started - chaptersIntroduction[0] = new BookletChapter("bookTutorial", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemBooklet), new PageTextOnly(1), new PageTextOnly(2), new PageTextOnly(3), new PageCrafting(4, ItemCrafting.recipeBook).setNoText()); - chaptersIntroduction[1] = new BookletChapter("videoGuide", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.YOUTUBE_ICON.ordinal()), new PageLinkButton(1, "https://www.youtube.com/watch?v=fhjz0Ew56pM"), new PageLinkButton(2, "https://www.youtube.com/playlist?list=PLJeFZ64pT89MrTRZYzD_rtHFajPVlt6cF")).setImportant(); - new BookletChapter("intro", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemBooklet), new PageTextOnly(1), new PageTextOnly(2), new PageTextOnly(3)); + chaptersIntroduction[0] = new BookletChapter("bookTutorial", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemBooklet.get()), new PageTextOnly(1), new PageTextOnly(2), new PageTextOnly(3), new PageCrafting(4, ItemCrafting.recipeBook).setNoText()); + chaptersIntroduction[1] = new BookletChapter("videoGuide", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemMisc.get(), 1, TheMiscItems.YOUTUBE_ICON.ordinal()), new PageLinkButton(1, "https://www.youtube.com/watch?v=fhjz0Ew56pM"), new PageLinkButton(2, "https://www.youtube.com/playlist?list=PLJeFZ64pT89MrTRZYzD_rtHFajPVlt6cF")).setImportant(); + new BookletChapter("intro", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemBooklet.get()), new PageTextOnly(1), new PageTextOnly(2), new PageTextOnly(3)); ArrayList crystalPages = new ArrayList<>(); crystalPages.addAll(Arrays.asList(new PageTextOnly(1).addTextReplacement("", TileEntityAtomicReconstructor.ENERGY_USE), new PageTextOnly(2), new PageTextOnly(3), new PagePicture(4, "page_atomic_reconstructor", 0).setNoText(), new PageTextOnly(5), new PageCrafting(6, BlockCrafting.recipeAtomicReconstructor).setWildcard())); for (int i = 0; i < LensRecipeHandler.MAIN_PAGE_RECIPES.size(); i++) { @@ -150,18 +147,18 @@ public final class InitBooklet { empowererPages.add(new PageCrafting(empowererPages.size() + 1, MiscCrafting.RECIPES_EMPOWERED_CRYSTALS).setNoText()); empowererPages.add(new PageCrafting(empowererPages.size() + 1, MiscCrafting.RECIPES_EMPOWERED_CRYSTAL_BLOCKS).setNoText()); new BookletChapter("empowerer", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockEmpowerer.get()), empowererPages.toArray(new BookletPage[empowererPages.size()])).setSpecial(); - new BookletChapter("craftingIngs", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeCoil).setNoText(), new PageCrafting(3, ItemCrafting.recipeCoilAdvanced).setNoText(), new PageCrafting(4, BlockCrafting.recipeCase).setNoText(), new PageCrafting(5, BlockCrafting.recipeEnderPearlBlock).setNoText(), new PageCrafting(6, BlockCrafting.recipeEnderCase).setNoText(), new PageCrafting(7, ItemCrafting.recipeRing).setNoText(), new PageCrafting(8, ItemCrafting.recipeKnifeHandle).setNoText(), new PageCrafting(9, ItemCrafting.recipeKnifeBlade).setNoText(), new PageCrafting(10, ItemCrafting.recipeKnife).setNoText(), new PageCrafting(11, ItemCrafting.recipeDough).setNoText(), new PageCrafting(12, ItemCrafting.recipeRiceDough).setNoText(), new PageCrafting(13, BlockCrafting.recipeIronCase).setNoText(), new PageCrafting(14, ItemCrafting.recipeLens).setNoText()); + new BookletChapter("craftingIngs", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemMisc.get(), 1, TheMiscItems.COIL.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeCoil).setNoText(), new PageCrafting(3, ItemCrafting.recipeCoilAdvanced).setNoText(), new PageCrafting(4, BlockCrafting.recipeCase).setNoText(), new PageCrafting(5, BlockCrafting.recipeEnderPearlBlock).setNoText(), new PageCrafting(6, BlockCrafting.recipeEnderCase).setNoText(), new PageCrafting(7, ItemCrafting.recipeRing).setNoText(), new PageCrafting(8, ItemCrafting.recipeKnifeHandle).setNoText(), new PageCrafting(9, ItemCrafting.recipeKnifeBlade).setNoText(), new PageCrafting(10, ItemCrafting.recipeKnife).setNoText(), new PageCrafting(11, ItemCrafting.recipeDough).setNoText(), new PageCrafting(12, ItemCrafting.recipeRiceDough).setNoText(), new PageCrafting(13, BlockCrafting.recipeIronCase).setNoText(), new PageCrafting(14, ItemCrafting.recipeLens).setNoText()); chaptersIntroduction[4] = new BookletChapter("rf", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(Items.REDSTONE), new PageTextOnly(1), new PageTextOnly(2)).setImportant(); //Miscellaneous - new BookletChapter("worms", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemWorm), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemWorm)), new PagePicture(2, "page_worms", 145)).setImportant(); + new BookletChapter("worms", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemWorm.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemWorm.get())), new PagePicture(2, "page_worms", 145)).setImportant(); new BookletChapter("lushCaves", ActuallyAdditionsAPI.entryMisc, new ItemStack(Blocks.STONE), new PageTextOnly(1), new PagePicture(2, "page_lush_caves", 0).setNoText()); new BookletChapter("crystalClusters", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockCrystalClusterEmerald), new PageTextOnly(1).addItemsToPage(WorldGenLushCaves.CRYSTAL_CLUSTERS), new PageCrafting(2, MiscCrafting.RECIPES_CRYSTAL_SHARDS).setNoText(), new PageCrafting(3, MiscCrafting.RECIPES_CRYSTAL_SHARDS_BACK).setNoText()).setSpecial(); new BookletChapter("banners", ActuallyAdditionsAPI.entryMisc, new ItemStack(Items.BLUE_BANNER, 1), new PageTextOnly(1)); new BookletChapter("miscDecorStuffsAndThings", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockTestifiBucksGreenWall), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeWhiteWall).setNoText(), new PageReconstructor(3, LensRecipeHandler.recipeGreenWall).setNoText()); - chaptersIntroduction[3] = new BookletChapter("quartz", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal())).addTextReplacement("", AAWorldGen.QUARTZ_MIN).addTextReplacement("", AAWorldGen.QUARTZ_MAX), new PageTextOnly(2).addItemsToPage(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())), new PageCrafting(3, BlockCrafting.recipeQuartzBlock).setNoText(), new PageCrafting(4, BlockCrafting.recipeQuartzPillar).setNoText(), new PageCrafting(5, BlockCrafting.recipeQuartzChiseled).setNoText()); + chaptersIntroduction[3] = new BookletChapter("quartz", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc.get(), 1, TheMiscItems.QUARTZ.ordinal()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal())).addTextReplacement("", AAWorldGen.QUARTZ_MIN).addTextReplacement("", AAWorldGen.QUARTZ_MAX), new PageTextOnly(2).addItemsToPage(new ItemStack(InitItems.itemMisc.get(), 1, TheMiscItems.QUARTZ.ordinal())), new PageCrafting(3, BlockCrafting.recipeQuartzBlock).setNoText(), new PageCrafting(4, BlockCrafting.recipeQuartzPillar).setNoText(), new PageCrafting(5, BlockCrafting.recipeQuartzChiseled).setNoText()); new BookletChapter("cloud", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockSmileyCloud), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeSmileyCloud).setWildcard()).setSpecial(); - new BookletChapter("coalStuff", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.TINY_COAL.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeTinyCoal).setNoText(), new PageCrafting(3, ItemCrafting.recipeTinyChar).setNoText(), new PageCrafting(4, BlockCrafting.recipeBlockChar).setNoText()); + new BookletChapter("coalStuff", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc.get(), 1, TheMiscItems.TINY_COAL.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeTinyCoal).setNoText(), new PageCrafting(3, ItemCrafting.recipeTinyChar).setNoText(), new PageCrafting(4, BlockCrafting.recipeBlockChar).setNoText()); ArrayList lampPages = new ArrayList<>(); lampPages.add(new PageTextOnly(lampPages.size() + 1)); lampPages.add(new PageTextOnly(lampPages.size() + 1)); @@ -170,35 +167,35 @@ public final class InitBooklet { lampPages.add(new PageCrafting(lampPages.size() + 1, recipe).setNoText()); } new BookletChapter("lamps", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockColoredLampOn.get(), 1, TheColoredLampColors.GREEN.ordinal()), lampPages.toArray(new BookletPage[lampPages.size()])); - new BookletChapter("enderStar", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.ENDER_STAR.ordinal()), new PageCrafting(1, ItemCrafting.recipeEnderStar)); - new BookletChapter("spawnerShard", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.SPAWNER_SHARD.ordinal()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.SPAWNER_SHARD.ordinal()))); + new BookletChapter("enderStar", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc.get(), 1, TheMiscItems.ENDER_STAR.ordinal()), new PageCrafting(1, ItemCrafting.recipeEnderStar)); + new BookletChapter("spawnerShard", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc.get(), 1, TheMiscItems.SPAWNER_SHARD.ordinal()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemMisc.get(), 1, TheMiscItems.SPAWNER_SHARD.ordinal()))); // new BookletChapter("treasureChest", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockTreasureChest.get()), new PagePicture(1, "page_treasure_chest", 150).addItemsToPage(new ItemStack(InitBlocks.blockTreasureChest.get())), new PageTextOnly(2)).setSpecial(); - new BookletChapter("hairBalls", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemHairyBall), new PagePicture(1, "page_fur_balls", 110).addItemsToPage(new ItemStack(InitItems.itemHairyBall)), new PageTextOnly(2)).setSpecial(); + new BookletChapter("hairBalls", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemHairyBall.get()), new PagePicture(1, "page_fur_balls", 110).addItemsToPage(new ItemStack(InitItems.itemHairyBall.get())), new PageTextOnly(2)).setSpecial(); new BookletChapter("blackLotus", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockBlackLotus.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitBlocks.blockBlackLotus.get())), new PageCrafting(2, ItemCrafting.recipeBlackDye)); - new BookletChapter("waterBowl", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemWaterBowl), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemWaterBowl))); + new BookletChapter("waterBowl", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemWaterBowl.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemWaterBowl.get()))); new BookletChapter("tinyTorch", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockTinyTorch.get()), new PageCrafting(1, BlockCrafting.recipesTinyTorch).setWildcard()).setSpecial(); //Reconstruction - chaptersIntroduction[7] = new BookletChapter("reconstructorLenses", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), new PageTextOnly(1)).setImportant(); + chaptersIntroduction[7] = new BookletChapter("reconstructorLenses", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemMisc.get(), 1, TheMiscItems.LENS.ordinal()), new PageTextOnly(1)).setImportant(); new BookletChapter("additionalRecipes", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(Items.LEATHER), new PageReconstructor(1, LensRecipeHandler.recipeSoulSand).setNoText(), new PageReconstructor(2, LensRecipeHandler.recipeLeather).setNoText(), new PageReconstructor(3, LensRecipeHandler.recipeNetherWart).setNoText(), new PageReconstructor(4, LensRecipeHandler.recipePrismarine).setNoText()).setSpecial(); new BookletChapter("bookSplitting", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(Items.ENCHANTED_BOOK), new PageTextOnly(1), new PageReconstructor(2, new LensConversionRecipe(Ingredient.fromItem(Items.ENCHANTED_BOOK), new ItemStack(Items.ENCHANTED_BOOK), 0, ActuallyAdditionsAPI.lensDefaultConversion)).setNoText()); - new BookletChapter("lensColor", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemColorLens), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeColorLens).setNoText()); - new BookletChapter("lensDeath", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemDamageLens), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeDamageLens).setNoText()); - new BookletChapter("lensMoreDeath", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemMoreDamageLens), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLensMoreDeath).setNoText()); - new BookletChapter("lensDetonation", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemExplosionLens), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeExplosionLens).setNoText()); - new BookletChapter("lensDisenchanting", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemDisenchantingLens), new PageTextOnly(1).addTextReplacement("", LensDisenchanting.ENERGY_USE), new PageCrafting(2, ItemCrafting.recipeDisenchantingLens).setNoText()).setSpecial(); - new BookletChapter("lensMining", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemMiningLens), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.MINING_LENS_USE.getValue()), new PageCrafting(2, ItemCrafting.recipeMiningLens).setNoText()).setImportant(); + new BookletChapter("lensColor", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemColorLens.get()), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeColorLens).setNoText()); + new BookletChapter("lensDeath", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemDamageLens.get()), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeDamageLens).setNoText()); + new BookletChapter("lensMoreDeath", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemMoreDamageLens.get()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLensMoreDeath).setNoText()); + new BookletChapter("lensDetonation", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemExplosionLens.get()), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeExplosionLens).setNoText()); + new BookletChapter("lensDisenchanting", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemDisenchantingLens.get()), new PageTextOnly(1).addTextReplacement("", LensDisenchanting.ENERGY_USE), new PageCrafting(2, ItemCrafting.recipeDisenchantingLens).setNoText()).setSpecial(); + new BookletChapter("lensMining", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemMiningLens.get()), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.MINING_LENS_USE.getValue()), new PageCrafting(2, ItemCrafting.recipeMiningLens).setNoText()).setImportant(); //Laser Relays - chaptersIntroduction[8] = new BookletChapter("laserIntro", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitItems.itemLaserWrench), new PageTextOnly(1), new PageTextOnly(2).addTextReplacement("", TileEntityLaserRelay.MAX_DISTANCE), new PageCrafting(3, ItemCrafting.recipeLaserWrench)).setImportant(); + chaptersIntroduction[8] = new BookletChapter("laserIntro", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitItems.itemLaserWrench.get()), new PageTextOnly(1), new PageTextOnly(2).addTextReplacement("", TileEntityLaserRelay.MAX_DISTANCE), new PageCrafting(3, ItemCrafting.recipeLaserWrench)).setImportant(); new BookletChapter("laserRelays", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockLaserRelay.get()), new PageTextOnly(1), new PageTextOnly(2).addTextReplacement("", TileEntityLaserRelayEnergy.CAP).addTextReplacement("", TileEntityLaserRelayEnergyAdvanced.CAP).addTextReplacement("", TileEntityLaserRelayEnergyExtreme.CAP), new PagePicture(3, "page_laser_relay", 0).setNoText(), new PageCrafting(4, BlockCrafting.recipeLaserRelay).setWildcard().setNoText(), new PageCrafting(5, BlockCrafting.recipeLaserRelayAdvanced).setWildcard().setNoText(), new PageCrafting(6, BlockCrafting.recipeLaserRelayExtreme).setWildcard().setNoText()); new BookletChapter("fluidLaser", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockLaserRelayFluids.get()), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeFluidLaser).setWildcard().setNoText()); new BookletChapter("itemRelays", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockLaserRelayItem.get()), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeItemLaser).setWildcard().setNoText()).setSpecial(); new BookletChapter("itemInterfaces", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockItemViewer.get()), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipeItemInterface).setNoText()); new BookletChapter("itemRelaysAdvanced", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockLaserRelayItemWhitelist.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeLaserRelayItemWhitelist).setWildcard()); new BookletChapter("itemInterfacesHopping", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockItemViewerHopping.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeItemInterfaceHopping).setWildcard().setNoText()); - new BookletChapter("laserUpgradeInvisibility", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitItems.itemLaserUpgradeInvisibility), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLaserUpgradeInvisibility).setNoText()).setImportant(); - new BookletChapter("laserUpgradeRange", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitItems.itemLaserUpgradeRange), new PageTextOnly(1).addTextReplacement("", TileEntityLaserRelay.MAX_DISTANCE).addTextReplacement("", TileEntityLaserRelay.MAX_DISTANCE_RANGED), new PageCrafting(2, ItemCrafting.recipeLaserUpgradeRange).setNoText()).setImportant(); + new BookletChapter("laserUpgradeInvisibility", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitItems.itemLaserUpgradeInvisibility.get()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLaserUpgradeInvisibility).setNoText()).setImportant(); + new BookletChapter("laserUpgradeRange", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitItems.itemLaserUpgradeRange.get()), new PageTextOnly(1).addTextReplacement("", TileEntityLaserRelay.MAX_DISTANCE).addTextReplacement("", TileEntityLaserRelay.MAX_DISTANCE_RANGED), new PageCrafting(2, ItemCrafting.recipeLaserUpgradeRange).setNoText()).setImportant(); //No RF Using Blocks new BookletChapter("breaker", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockBreaker.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()); @@ -207,20 +204,20 @@ public final class InitBooklet { new BookletChapter("phantomRedstoneface", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockPhantomRedstoneface.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipePhantomRedstoneface).setNoText()); new BookletChapter("phantomBreaker", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockPhantomBreaker.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(InitBlocks.blockInputterAdvanced.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeESD).setNoText(), new PageCrafting(3, BlockCrafting.recipeAdvancedESD).setNoText()).setSpecial(); - new BookletChapter("xpSolidifier", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockXPSolidifier.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemSolidifiedExperience)), new PageCrafting(2, BlockCrafting.recipeSolidifier).setNoText()).setImportant(); + new BookletChapter("xpSolidifier", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockXPSolidifier.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemSolidifiedExperience.get())), new PageCrafting(2, BlockCrafting.recipeSolidifier).setNoText()).setImportant(); new BookletChapter("greenhouseGlass", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockGreenhouseGlass.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeGlass)); new BookletChapter("fishingNet", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFishingNet.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFisher).setNoText()); new BookletChapter("feeder", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFeeder.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFeeder).setNoText()); - new BookletChapter("compost", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockCompost.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemFertilizer)), new PageCrafting(2, BlockCrafting.recipeCompost).setNoText(), new PageTextOnly(3).addItemsToPage(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.MASHED_FOOD.ordinal()))); + new BookletChapter("compost", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockCompost.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemFertilizer.get())), new PageCrafting(2, BlockCrafting.recipeCompost).setNoText(), new PageTextOnly(3).addItemsToPage(new ItemStack(InitItems.itemMisc.get(), 1, TheMiscItems.MASHED_FOOD.ordinal()))); new BookletChapter("crate", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockGiantChest.get()), new PageCrafting(1, BlockCrafting.recipeCrate), new PageCrafting(2, BlockCrafting.recipeCrateMedium).setNoText(), new PageCrafting(3, BlockCrafting.recipeCrateLarge).setNoText(), new PageCrafting(4, ItemCrafting.recipeCrateKeeper), new PageCrafting(5, ItemCrafting.recipeChestToCrateUpgrade), new PageCrafting(6, ItemCrafting.recipeSmallToMediumCrateUpgrade), new PageCrafting(7, ItemCrafting.recipeMediumToLargeCrateUpgrade)); new BookletChapter("rangedCollector", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockRangedCollector.get()), new PageTextOnly(1).addTextReplacement("", TileEntityRangedCollector.RANGE), new PageCrafting(2, BlockCrafting.recipeRangedCollector).setNoText()); //RF Using Blocks new BookletChapter("fireworkBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFireworkBox.get()), new PageTextOnly(1).addTextReplacement("", TileEntityFireworkBox.USE_PER_SHOT), new PageCrafting(2, BlockCrafting.recipeFireworkBox)).setSpecial(); new BookletChapter("batteryBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockBatteryBox.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeBatteryBox).setNoText()).setSpecial(); - new BookletChapter("farmer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFarmer.get()), new PageTextOnly(1), new PagePicture(2, "page_farmer_crops", 95).addItemsToPage(new ItemStack(Items.WHEAT_SEEDS)).addItemsToPage(new ItemStack(InitItems.itemCanolaSeed)), 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("farmer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFarmer.get()), new PageTextOnly(1), new PagePicture(2, "page_farmer_crops", 95).addItemsToPage(new ItemStack(Items.WHEAT_SEEDS)).addItemsToPage(new ItemStack(InitItems.itemCanolaSeed.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(InitBlocks.blockMiner.get()), new PageTextOnly(1).addTextReplacement("", TileEntityMiner.ENERGY_USE_PER_BLOCK).addTextReplacement("", TileEntityMiner.DEFAULT_RANGE), new PageCrafting(2, BlockCrafting.recipeMiner)).setSpecial(); - new BookletChapterCoffee("coffeeMachine", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockCoffeeMachine.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemCoffeeBean)).addTextReplacement("", TileEntityCoffeeMachine.ENERGY_USED).addTextReplacement("", TileEntityCoffeeMachine.CACHE_USE).addTextReplacement("", TileEntityCoffeeMachine.WATER_USE), new PageTextOnly(2).addItemsToPage(new ItemStack(InitItems.itemCoffee)), new PagePicture(3, "page_coffee_machine", 115), new PageCrafting(4, BlockCrafting.recipeCoffeeMachine).setWildcard().setNoText(), new PageCrafting(5, ItemCrafting.recipeCup).setNoText()).setImportant(); + new BookletChapterCoffee("coffeeMachine", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockCoffeeMachine.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemCoffeeBean.get())).addTextReplacement("", TileEntityCoffeeMachine.ENERGY_USED).addTextReplacement("", TileEntityCoffeeMachine.CACHE_USE).addTextReplacement("", TileEntityCoffeeMachine.WATER_USE), new PageTextOnly(2).addItemsToPage(new ItemStack(InitItems.itemCoffee.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)); @@ -249,56 +246,56 @@ public final class InitBooklet { //RF Generating Blocks new BookletChapter("solarPanel", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockFurnaceSolar.get()), new PageTextOnly(1).addTextReplacement("", TileEntityFurnaceSolar.PRODUCE), new PageCrafting(2, BlockCrafting.recipeSolar).setNoText()); new BookletChapter("heatCollector", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockHeatCollector.get()), new PageTextOnly(1).addTextReplacement("", TileEntityHeatCollector.ENERGY_PRODUCE).addTextReplacement("", TileEntityHeatCollector.BLOCKS_NEEDED), new PageCrafting(2, BlockCrafting.recipeHeatCollector).setNoText()); - new BookletChapter("canola", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockFermentingBarrel.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal())).addItemsToPage(new ItemStack(InitItems.itemCanolaSeed)).addFluidToPage(InitFluids.fluidCanolaOil), new PageTextOnly(2).addFluidToPage(InitFluids.fluidRefinedCanolaOil).addFluidToPage(InitFluids.fluidCrystalOil).addFluidToPage(InitFluids.fluidEmpoweredOil), new PageCrafting(3, BlockCrafting.recipeCanolaPress).setNoText(), new PageCrafting(4, BlockCrafting.recipeFermentingBarrel), new PageCrafting(5, BlockCrafting.recipeOilGen), new PageReconstructor(6, LensRecipeHandler.recipeCrystallizedCanolaSeed).setNoText(), new PageEmpowerer(7, EmpowererHandler.recipeEmpoweredCanolaSeed).setNoText()); + new BookletChapter("canola", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockFermentingBarrel.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemMisc.get(), 1, TheMiscItems.CANOLA.ordinal())).addItemsToPage(new ItemStack(InitItems.itemCanolaSeed.get())).addFluidToPage(InitFluids.fluidCanolaOil), new PageTextOnly(2).addFluidToPage(InitFluids.fluidRefinedCanolaOil).addFluidToPage(InitFluids.fluidCrystalOil).addFluidToPage(InitFluids.fluidEmpoweredOil), new PageCrafting(3, BlockCrafting.recipeCanolaPress).setNoText(), new PageCrafting(4, BlockCrafting.recipeFermentingBarrel), new PageCrafting(5, BlockCrafting.recipeOilGen), new PageReconstructor(6, LensRecipeHandler.recipeCrystallizedCanolaSeed).setNoText(), new PageEmpowerer(7, EmpowererHandler.recipeEmpoweredCanolaSeed).setNoText()); new BookletChapter("leafGen", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockLeafGenerator.get()), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.LEAF_GENERATOR_CF_PER_LEAF.getValue()).addTextReplacement("", ConfigIntValues.LEAF_GENERATOR_AREA.getValue()), new PageCrafting(2, BlockCrafting.recipeLeafGen)).setImportant(); new BookletChapter("bioReactor", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockBioReactor.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeBioReactor).setNoText()).setSpecial(); //No RF Using Items - chaptersIntroduction[9] = new BookletChapter("goggles", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemEngineerGoggles), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeGoggles).setNoText(), new PageCrafting(3, ItemCrafting.recipeGogglesAdvanced).setNoText()).setImportant(); - new BookletChapter("bags", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemBag), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeBag), new PageCrafting(3, ItemCrafting.recipeVoidBag).setNoText()).setImportant(); - new BookletChapter("wings", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemWingsOfTheBats), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.BAT_WING.ordinal())).addTextReplacement("", ItemWingsOfTheBats.MAX_FLY_TIME / 20), new PageCrafting(2, ItemCrafting.recipeWings).setNoText()).setSpecial(); - new BookletChapter("foods", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemFoods, 1, TheFoods.HAMBURGER.ordinal()), new PageCrafting(1, FoodCrafting.recipeBacon).setNoText(), new PageFurnace(2, new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE_BREAD.ordinal())).setNoText(), new PageCrafting(3, FoodCrafting.recipeHamburger).setNoText(), new PageCrafting(4, FoodCrafting.recipeBigCookie).setNoText(), new PageCrafting(5, FoodCrafting.recipeSubSandwich).setNoText(), new PageCrafting(6, FoodCrafting.recipeFrenchFry).setNoText(), new PageCrafting(7, FoodCrafting.recipeFrenchFries).setNoText(), new PageCrafting(8, FoodCrafting.recipeFishNChips).setNoText(), new PageCrafting(9, FoodCrafting.recipeCheese).setNoText(), new PageCrafting(10, FoodCrafting.recipePumpkinStew).setNoText(), new PageCrafting(11, FoodCrafting.recipeCarrotJuice).setNoText(), new PageCrafting(12, FoodCrafting.recipeSpaghetti).setNoText(), new PageCrafting(13, FoodCrafting.recipeNoodle).setNoText(), new PageCrafting(14, FoodCrafting.recipeChocolate).setNoText(), new PageCrafting(15, FoodCrafting.recipeChocolateCake).setNoText(), new PageCrafting(16, FoodCrafting.recipeToast).setNoText(), new PageFurnace(17, new ItemStack(InitItems.itemFoods, 1, TheFoods.BAGUETTE.ordinal())).setNoText(), new PageCrafting(18, FoodCrafting.recipeChocolateToast).setNoText(), new PageCrafting(1, FoodCrafting.recipePizza).setNoText()); - new BookletChapter("leafBlower", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemLeafBlowerAdvanced), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLeafBlower).setNoText(), new PageCrafting(3, ItemCrafting.recipeLeafBlowerAdvanced).setNoText()).setImportant(); - new BookletChapter("playerProbe", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemPlayerProbe), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipePlayerProbe).setNoText()).setSpecial(); + chaptersIntroduction[9] = new BookletChapter("goggles", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemEngineerGoggles.get()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeGoggles).setNoText(), new PageCrafting(3, ItemCrafting.recipeGogglesAdvanced).setNoText()).setImportant(); + new BookletChapter("bags", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemBag.get()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeBag), new PageCrafting(3, ItemCrafting.recipeVoidBag).setNoText()).setImportant(); + new BookletChapter("wings", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemWingsOfTheBats.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemMisc.get(), 1, TheMiscItems.BAT_WING.ordinal())).addTextReplacement("", ItemWingsOfTheBats.MAX_FLY_TIME / 20), new PageCrafting(2, ItemCrafting.recipeWings).setNoText()).setSpecial(); + new BookletChapter("foods", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemFoods.get(), 1, TheFoods.HAMBURGER.ordinal()), new PageCrafting(1, FoodCrafting.recipeBacon).setNoText(), new PageFurnace(2, new ItemStack(InitItems.itemFoods.get(), 1, TheFoods.RICE_BREAD.ordinal())).setNoText(), new PageCrafting(3, FoodCrafting.recipeHamburger).setNoText(), new PageCrafting(4, FoodCrafting.recipeBigCookie).setNoText(), new PageCrafting(5, FoodCrafting.recipeSubSandwich).setNoText(), new PageCrafting(6, FoodCrafting.recipeFrenchFry).setNoText(), new PageCrafting(7, FoodCrafting.recipeFrenchFries).setNoText(), new PageCrafting(8, FoodCrafting.recipeFishNChips).setNoText(), new PageCrafting(9, FoodCrafting.recipeCheese).setNoText(), new PageCrafting(10, FoodCrafting.recipePumpkinStew).setNoText(), new PageCrafting(11, FoodCrafting.recipeCarrotJuice).setNoText(), new PageCrafting(12, FoodCrafting.recipeSpaghetti).setNoText(), new PageCrafting(13, FoodCrafting.recipeNoodle).setNoText(), new PageCrafting(14, FoodCrafting.recipeChocolate).setNoText(), new PageCrafting(15, FoodCrafting.recipeChocolateCake).setNoText(), new PageCrafting(16, FoodCrafting.recipeToast).setNoText(), new PageFurnace(17, new ItemStack(InitItems.itemFoods.get(), 1, TheFoods.BAGUETTE.ordinal())).setNoText(), new PageCrafting(18, FoodCrafting.recipeChocolateToast).setNoText(), new PageCrafting(1, FoodCrafting.recipePizza).setNoText()); + new BookletChapter("leafBlower", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemLeafBlowerAdvanced.get()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLeafBlower).setNoText(), new PageCrafting(3, ItemCrafting.recipeLeafBlowerAdvanced).setNoText()).setImportant(); + new BookletChapter("playerProbe", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemPlayerProbe.get()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipePlayerProbe).setNoText()).setSpecial(); ArrayList aiotPages = new ArrayList<>(); aiotPages.add(new PageTextOnly(aiotPages.size() + 1)); for (IRecipe recipe : ToolCrafting.RECIPES_PAXELS) { aiotPages.add(new PageCrafting(aiotPages.size() + 1, recipe).setWildcard().setNoText()); } - new BookletChapter("aiots", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.emeraldPaxel), aiotPages.toArray(new BookletPage[aiotPages.size()])).setImportant(); + new BookletChapter("aiots", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.emeraldPaxel.get()), aiotPages.toArray(new BookletPage[aiotPages.size()])).setImportant(); - new BookletChapter("jams", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemJams), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemJams, 1, Util.WILDCARD)), new PagePicture(2, "page_jam_house", 150), new PageTextOnly(3)); + new BookletChapter("jams", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemJams.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemJams.get(), 1, Util.WILDCARD)), new PagePicture(2, "page_jam_house", 150), new PageTextOnly(3)); ArrayList potionRingPages = new ArrayList<>(); potionRingPages.add(new PageTextOnly(potionRingPages.size() + 1)); for (IRecipe recipe : ItemCrafting.RECIPES_POTION_RINGS) { potionRingPages.add(new PageCrafting(potionRingPages.size() + 1, recipe).setNoText()); } - new BookletChapter("potionRings", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemPotionRing), potionRingPages.toArray(new BookletPage[potionRingPages.size()])); - new BookletChapter("spawnerChanger", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemSpawnerChanger), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeSpawnerChanger).setNoText()); - new BookletChapter("itemFilter", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitItems.itemFilter), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeFilter).setNoText()).setImportant(); + new BookletChapter("potionRings", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemPotionRing.get()), potionRingPages.toArray(new BookletPage[potionRingPages.size()])); + new BookletChapter("spawnerChanger", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemSpawnerChanger.get()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeSpawnerChanger).setNoText()); + new BookletChapter("itemFilter", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitItems.itemFilter.get()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeFilter).setNoText()).setImportant(); //RF Using Items - new BookletChapter("drill", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemDrill, 1, TheColoredLampColors.LIGHT_BLUE.ordinal()), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, ItemCrafting.recipeDrill).setNoText(), new PageCrafting(4, ItemCrafting.RECIPES_DRILL_COLORING), new PageCrafting(4, ItemCrafting.recipeDrillCore).setNoText(), new PageCrafting(5, ItemCrafting.recipeDrillSpeedI).setNoText(), new PageCrafting(6, ItemCrafting.recipeDrillSpeedII).setNoText(), new PageCrafting(7, ItemCrafting.recipeDrillSpeedIII).setNoText(), new PageCrafting(8, ItemCrafting.recipeDrillFortuneI).setNoText(), new PageCrafting(9, ItemCrafting.recipeDrillFortuneII).setNoText(), new PageCrafting(10, ItemCrafting.recipeDrillSilk).setNoText(), new PageCrafting(11, ItemCrafting.recipeDrillThree).setNoText(), new PageCrafting(12, ItemCrafting.recipeDrillFive).setNoText(), new PageCrafting(13, ItemCrafting.recipeDrillPlacing).setNoText()).setSpecial(); - new BookletChapter("fillingWand", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemFillingWand), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeFillingWand).setNoText()).setSpecial(); - new BookletChapter("staff", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemTeleStaff), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeStaff).setNoText()).setImportant(); - new BookletChapter("magnetRing", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemMagnetRing), new PageCrafting(1, ItemCrafting.recipeMagnetRing)); - new BookletChapter("growthRing", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemGrowthRing), new PageCrafting(1, ItemCrafting.recipeGrowthRing)); - new BookletChapter("waterRemovalRing", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemWaterRemovalRing), new PageCrafting(1, ItemCrafting.recipeWaterRing)); - new BookletChapter("batteries", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemBatteryTriple), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeBattery).setNoText(), new PageCrafting(3, ItemCrafting.recipeBatteryDouble).setNoText(), new PageCrafting(4, ItemCrafting.recipeBatteryTriple).setNoText(), new PageCrafting(5, ItemCrafting.recipeBatteryQuadruple).setNoText(), new PageCrafting(6, ItemCrafting.recipeBatteryQuintuple).setNoText()); + new BookletChapter("drill", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemDrill.get(), 1, TheColoredLampColors.LIGHT_BLUE.ordinal()), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, ItemCrafting.recipeDrill).setNoText(), new PageCrafting(4, ItemCrafting.RECIPES_DRILL_COLORING), new PageCrafting(4, ItemCrafting.recipeDrillCore).setNoText(), new PageCrafting(5, ItemCrafting.recipeDrillSpeedI).setNoText(), new PageCrafting(6, ItemCrafting.recipeDrillSpeedII).setNoText(), new PageCrafting(7, ItemCrafting.recipeDrillSpeedIII).setNoText(), new PageCrafting(8, ItemCrafting.recipeDrillFortuneI).setNoText(), new PageCrafting(9, ItemCrafting.recipeDrillFortuneII).setNoText(), new PageCrafting(10, ItemCrafting.recipeDrillSilk).setNoText(), new PageCrafting(11, ItemCrafting.recipeDrillThree).setNoText(), new PageCrafting(12, ItemCrafting.recipeDrillFive).setNoText(), new PageCrafting(13, ItemCrafting.recipeDrillPlacing).setNoText()).setSpecial(); + new BookletChapter("fillingWand", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemFillingWand.get()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeFillingWand).setNoText()).setSpecial(); + new BookletChapter("staff", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemTeleStaff.get()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeStaff).setNoText()).setImportant(); + new BookletChapter("magnetRing", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemMagnetRing.get()), new PageCrafting(1, ItemCrafting.recipeMagnetRing)); + new BookletChapter("growthRing", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemGrowthRing.get()), new PageCrafting(1, ItemCrafting.recipeGrowthRing)); + new BookletChapter("waterRemovalRing", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemWaterRemovalRing.get()), new PageCrafting(1, ItemCrafting.recipeWaterRing)); + new BookletChapter("batteries", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemBatteryTriple.get()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeBattery).setNoText(), new PageCrafting(3, ItemCrafting.recipeBatteryDouble).setNoText(), new PageCrafting(4, ItemCrafting.recipeBatteryTriple).setNoText(), new PageCrafting(5, ItemCrafting.recipeBatteryQuadruple).setNoText(), new PageCrafting(6, ItemCrafting.recipeBatteryQuintuple).setNoText()); //Updates and infos new BookletChapter("changelog", ActuallyAdditionsAPI.entryUpdatesAndInfos, new ItemStack(Items.CLOCK), new PageLinkButton(1, UpdateChecker.CHANGELOG_LINK)); new BookletChapter("curse", ActuallyAdditionsAPI.entryUpdatesAndInfos, new ItemStack(Items.FLINT_AND_STEEL), new PageLinkButton(1, "http://ellpeck.de/actadd")); - new BookletChapter("patreon", ActuallyAdditionsAPI.entryUpdatesAndInfos, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), new PageLinkButton(1, "http://patreon.com/Ellpeck"), new PagePicture(2, "page_patreon", 153)).setImportant(); - new BookletChapter("website", ActuallyAdditionsAPI.entryUpdatesAndInfos, new ItemStack(InitItems.itemBooklet), new PageLinkButton(1, "http://ellpeck.de")); + new BookletChapter("patreon", ActuallyAdditionsAPI.entryUpdatesAndInfos, new ItemStack(InitItems.EMERADIC_CRYSTAL.get(), 1), new PageLinkButton(1, "http://patreon.com/Ellpeck"), new PagePicture(2, "page_patreon", 153)).setImportant(); + new BookletChapter("website", ActuallyAdditionsAPI.entryUpdatesAndInfos, new ItemStack(InitItems.itemBooklet.get()), new PageLinkButton(1, "http://ellpeck.de")); //Trials chaptersIntroduction[10] = new BookletChapter("trialsIntro", ActuallyAdditionsAPI.entryTrials, new ItemStack(Items.GOLD_INGOT), new PageTextOnly(1), new PageTextOnly(2)).setSpecial(); - new BookletChapterTrials("crystalProduction", new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), false); + new BookletChapterTrials("crystalProduction", new ItemStack(InitItems.EMERADIC_CRYSTAL.get()), false); new BookletChapterTrials("leatherProduction", new ItemStack(Items.LEATHER), false); new BookletChapterTrials("crystalOil", FluidUtil.getFilledBucket(new FluidStack(InitFluids.fluidCrystalOil, Fluid.BUCKET_VOLUME)), false); - new BookletChapterTrials("autoDisenchanter", new ItemStack(InitItems.itemDisenchantingLens), false); + new BookletChapterTrials("autoDisenchanter", new ItemStack(InitItems.itemDisenchantingLens.get()), false); new BookletChapterTrials("empoweredOil", FluidUtil.getFilledBucket(new FluidStack(InitFluids.fluidEmpoweredOil, Fluid.BUCKET_VOLUME)), false); new BookletChapterTrials("mobFarm", new ItemStack(Items.ROTTEN_FLESH), false); new BookletChapterTrials("empowererAutomation", new ItemStack(InitBlocks.blockEmpowerer.get()), false); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java index e6a576e75..26fdc7f8c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java @@ -10,415 +10,398 @@ package de.ellpeck.actuallyadditions.mod.crafting; -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.blocks.BlockColoredLamp; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks; -import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; -import de.ellpeck.actuallyadditions.mod.util.RecipeUtil; -import de.ellpeck.actuallyadditions.mod.util.Util; -import de.ellpeck.actuallyadditions.mod.util.crafting.RecipeHandler; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.item.crafting.Ingredient; -import net.minecraft.util.ResourceLocation; - +// TODO: [port] MOVE TO DATA_GENERATOR +@Deprecated public final class BlockCrafting { - - public static final IRecipe[] RECIPES_LAMPS = new IRecipe[BlockColoredLamp.ALL_LAMP_TYPES.length]; - public static IRecipe recipeSmileyCloud; - public static IRecipe recipePhantomface; - public static IRecipe recipeLiquiface; - public static IRecipe recipeEnergyface; - public static IRecipe recipePhantomBreaker; - public static IRecipe recipePhantomPlacer; - public static IRecipe recipeBreaker; - public static IRecipe recipePlacer; - public static IRecipe recipeLiquidPlacer; - public static IRecipe recipeLiquidCollector; - public static IRecipe recipeCase; - public static IRecipe recipeIronCase; - public static IRecipe recipeEnderCase; - public static IRecipe recipeEnderPearlBlock; - public static IRecipe recipeESD; - public static IRecipe recipeAdvancedESD; - public static IRecipe recipePhantomBooster; - public static IRecipe recipeCoffeeMachine; - public static IRecipe recipeCrusher; - public static IRecipe recipeDoubleCrusher; - public static IRecipe recipeFurnace; - public static IRecipe recipeSolidifier; - public static IRecipe recipeCasing; - public static IRecipe recipeGlass; - public static IRecipe recipeLavaFactory; - public static IRecipe recipeEnergizer; - public static IRecipe recipeEnervator; - public static IRecipe recipeSolar; - public static IRecipe recipeHeatCollector; - public static IRecipe recipeCoalGen; - public static IRecipe recipeOilGen; - public static IRecipe recipeRepairer; - public static IRecipe recipeFisher; - public static IRecipe recipeQuartzBlock; - public static IRecipe recipeQuartzChiseled; - public static IRecipe recipeQuartzPillar; - public static IRecipe recipeBlockChar; - public static IRecipe recipeFeeder; - public static IRecipe recipeCompost; - public static IRecipe recipeCrate; - public static IRecipe recipeCrateMedium; - public static IRecipe recipeCrateLarge; - public static IRecipe recipeFermentingBarrel; - public static IRecipe recipeCanolaPress; - public static IRecipe recipePowerer; - public static IRecipe recipeLeafGen; - public static IRecipe recipeDirectionalBreaker; - public static IRecipe recipeDropper; - public static IRecipe recipeRangedCollector; - public static IRecipe recipeLaserRelay; - public static IRecipe recipeLaserRelayAdvanced; - public static IRecipe recipeLaserRelayExtreme; - public static IRecipe recipeAtomicReconstructor; - public static IRecipe recipeMiner; - public static IRecipe recipeFireworkBox; - public static IRecipe recipePhantomRedstoneface; - public static IRecipe recipeLaserRelayItemWhitelist; - public static IRecipe recipeItemInterface; - public static IRecipe recipeItemInterfaceHopping; - public static IRecipe recipePlayerInterface; - public static IRecipe recipeDisplayStand; - public static IRecipe recipeShockSuppressor; - public static IRecipe recipeEmpowerer; - public static IRecipe[] recipesTinyTorch = new IRecipe[2]; - public static IRecipe recipeBioReactor; - public static IRecipe recipeFarmer; - public static IRecipe recipeBatteryBox; - - private static class FireworkIngredient extends Ingredient { - - ItemStack firework = new ItemStack(Items.FIREWORKS); - ItemStack[] fireworks = new ItemStack[] { this.firework }; - - @Override - public ItemStack[] getMatchingStacks() { - return this.fireworks; - } - - @Override - public boolean apply(ItemStack stack) { - return stack.getItem() == Items.FIREWORKS; - } - } - - public static void init() { - - Block[] removeNBTBlocks = new Block[] { InitBlocks.blockOilGenerator, InitBlocks.blockFluidPlacer, InitBlocks.blockFluidCollector, InitBlocks.blockCanolaPress, InitBlocks.blockFermentingBarrel }; - - for (Block b : removeNBTBlocks) - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(b), new ItemStack(b)); - - //Battery Box - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitBlocks.blockBatteryBox), new ItemStack(InitBlocks.blockEnergizer), new ItemStack(InitBlocks.blockEnervator), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal())); - recipeBatteryBox = RecipeUtil.lastIRecipe(); - - //Farmer - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockFarmer), "ISI", "SCS", "ISI", 'I', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal()), 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'S', new ItemStack(Items.WHEAT_SEEDS)); - recipeFarmer = RecipeUtil.lastIRecipe(); - - //Empowerer - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockEmpowerer), " R ", " B ", "CDC", 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'B', new ItemStack(InitItems.itemBatteryDouble, 1, Util.WILDCARD), 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'D', new ItemStack(InitBlocks.blockDisplayStand)); - recipeEmpowerer = RecipeUtil.lastIRecipe(); - - //Tiny Torch - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockTinyTorch, 2), "C", "W", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.TINY_COAL.ordinal()), 'W', "stickWood"); - recipesTinyTorch[0] = RecipeUtil.lastIRecipe(); - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockTinyTorch, 2), "C", "W", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.TINY_CHAR.ordinal()), 'W', "stickWood"); - recipesTinyTorch[1] = RecipeUtil.lastIRecipe(); - - //Firework Box - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockFireworkBox), "GFG", "SAS", "CCC", 'G', new ItemStack(Items.GUNPOWDER), 'S', new ItemStack(Items.STICK), 'A', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'F', new FireworkIngredient(), 'C', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal())); - recipeFireworkBox = RecipeUtil.lastIRecipe(); - - //Shock Suppressor - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockShockSuppressor), "OAO", "ACA", "OAO", 'A', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.COAL.ordinal()), 'O', new ItemStack(Blocks.OBSIDIAN), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); - recipeShockSuppressor = RecipeUtil.lastIRecipe(); - - //Display Stand - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockDisplayStand), " R ", "EEE", "GGG", 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'E', new ItemStack(InitBlocks.blockTestifiBucksGreenWall), 'G', new ItemStack(InitBlocks.blockTestifiBucksWhiteWall)); - recipeDisplayStand = RecipeUtil.lastIRecipe(); - - //Miner - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockMiner), "IRI", "RCR", "IDI", 'R', "blockRedstone", 'I', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'C', new ItemStack(InitBlocks.blockCrystalEmpowered, 1, TheCrystals.COAL.ordinal()), 'D', new ItemStack(InitItems.itemDrill, 1, Util.WILDCARD)); - recipeMiner = RecipeUtil.lastIRecipe(); - - //Quartz - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockQuartzWall, 6), "XXX", "XXX", 'X', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal())); - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockQuartzSlab, 6), "XXX", 'X', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal())); - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockQuartzStair, 6), "X ", "XX ", "XXX", 'X', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal())); - - //PillarQuartz - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockPillarQuartzWall, 6), "XXX", "XXX", 'X', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_PILLAR.ordinal())); - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockPillarQuartzSlab, 6), "XXX", 'X', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_PILLAR.ordinal())); - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockPillarQuartzStair, 6), "X ", "XX ", "XXX", 'X', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_PILLAR.ordinal())); - - //ChiseledQuartz - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockChiseledQuartzWall, 6), "XXX", "XXX", 'X', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_CHISELED.ordinal())); - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockChiseledQuartzSlab, 6), "XXX", 'X', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_CHISELED.ordinal())); - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockChiseledQuartzStair, 6), "X ", "XX ", "XXX", 'X', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_CHISELED.ordinal())); - - //White Ethetic Blocks - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockTestifiBucksWhiteFence, 6), "XXX", "XXX", 'X', new ItemStack(InitBlocks.blockTestifiBucksWhiteWall)); - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockTestifiBucksWhiteSlab, 6), "XXX", 'X', new ItemStack(InitBlocks.blockTestifiBucksWhiteWall)); - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockTestifiBucksWhiteStairs, 6), "X ", "XX ", "XXX", 'X', new ItemStack(InitBlocks.blockTestifiBucksWhiteWall)); - - //Green Ethetic Blocks - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockTestifiBucksGreenFence, 6), "XXX", "XXX", 'X', new ItemStack(InitBlocks.blockTestifiBucksGreenWall)); - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockTestifiBucksGreenSlab, 6), "XXX", 'X', new ItemStack(InitBlocks.blockTestifiBucksGreenWall)); - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockTestifiBucksGreenStairs, 6), "X ", "XX ", "XXX", 'X', new ItemStack(InitBlocks.blockTestifiBucksGreenWall)); - - //Atomic Reconstructor - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockAtomicReconstructor), "IRI", "RCR", "IRI", 'R', "dustRedstone", 'I', "ingotIron", 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal())); - recipeAtomicReconstructor = RecipeUtil.lastIRecipe(); - - //Laser Relay - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockLaserRelay, 4), "OBO", "RCR", "OBO", 'B', new ItemStack(Blocks.REDSTONE_BLOCK), 'O', new ItemStack(Blocks.OBSIDIAN), 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); - recipeLaserRelay = RecipeUtil.lastIRecipe(); - - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockLaserRelayAdvanced), " I ", "XRX", " I ", 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'R', new ItemStack(InitBlocks.blockLaserRelay), 'X', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal())); - recipeLaserRelayAdvanced = RecipeUtil.lastIRecipe(); - - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockLaserRelayExtreme), " I ", "XRX", " I ", 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()), 'R', new ItemStack(InitBlocks.blockLaserRelayAdvanced), 'X', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal())); - recipeLaserRelayExtreme = RecipeUtil.lastIRecipe(); - - //Whitelist Item Laser Relay - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitBlocks.blockLaserRelayItemWhitelist), new ItemStack(InitBlocks.blockLaserRelayItem), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), "gemQuartzBlack", new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal())); - recipeLaserRelayItemWhitelist = RecipeUtil.lastIRecipe(); - - //Item Interface - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockItemViewer), "OBO", "RCR", "OBO", 'B', new ItemStack(Items.REDSTONE), 'O', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'C', "chestWood"); - recipeItemInterface = RecipeUtil.lastIRecipe(); - - //Hopping Item Interface - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitBlocks.blockItemViewerHopping), new ItemStack(InitBlocks.blockItemViewer), new ItemStack(Blocks.HOPPER)); - recipeItemInterfaceHopping = RecipeUtil.lastIRecipe(); - - //Ranged Collector - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockRangedCollector), " A ", "EHE", " C ", 'E', new ItemStack(Items.ENDER_PEARL), 'H', new ItemStack(Blocks.HOPPER), 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'A', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal())); - recipeRangedCollector = RecipeUtil.lastIRecipe(); - - //Directional Breaker - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockDirectionalBreaker), "BBB", " C ", 'C', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), 'B', new ItemStack(InitBlocks.blockBreaker)); - recipeDirectionalBreaker = RecipeUtil.lastIRecipe(); - - //Smiley Cloud - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockSmileyCloud), " W ", "WXW", " W ", 'W', new ItemStack(Blocks.WOOL, 1, Util.WILDCARD), 'X', new ItemStack(InitItems.itemSolidifiedExperience)); - recipeSmileyCloud = RecipeUtil.lastIRecipe(); - - //Compost - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockCompost), "W W", "W W", "WCW", 'W', "plankWood", 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal())); - recipeCompost = RecipeUtil.lastIRecipe(); - - //XP Solidifier - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockXPSolidifier), "XXX", "DCD", "XXX", 'X', new ItemStack(InitItems.itemSolidifiedExperience), 'D', new ItemStack(InitBlocks.blockCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); - recipeSolidifier = RecipeUtil.lastIRecipe(); - - //Charcoal Block - RecipeHandler.addShapedRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.CHARCOAL_BLOCK.ordinal()), "CCC", "CCC", "CCC", 'C', new ItemStack(Items.COAL, 1, 1)); - recipeBlockChar = RecipeUtil.lastIRecipe(); - RecipeHandler.addShapelessRecipe(new ItemStack(Items.COAL, 9, 1), new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.CHARCOAL_BLOCK.ordinal())); - - //Wood Casing - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal()), "WSW", "SRS", "WSW", 'W', "plankWood", 'R', "logWood", 'S', ConfigBoolValues.SUPER_DUPER_HARD_MODE.isEnabled() ? new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal()) : "stickWood"); - recipeCase = RecipeUtil.lastIRecipe(); - - //Iron Casing - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), "WSW", "SQS", "WSW", 'Q', "gemQuartzBlack", 'W', "ingotIron", 'S', ConfigBoolValues.SUPER_DUPER_HARD_MODE.isEnabled() ? new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal()) : "stickWood"); - recipeIronCase = RecipeUtil.lastIRecipe(); - - //Ender Casing - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal()), "WSW", "SRS", "WSW", 'W', ConfigBoolValues.SUPER_DUPER_HARD_MODE.isEnabled() ? new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDERPEARL_BLOCK.ordinal()) : new ItemStack(Items.ENDER_PEARL), 'R', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal()), 'S', ConfigBoolValues.SUPER_DUPER_HARD_MODE.isEnabled() ? new ItemStack(Blocks.DIAMOND_BLOCK) : new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal())); - recipeEnderCase = RecipeUtil.lastIRecipe(); - - //Phantom Booster - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockPhantomBooster), "RDR", "DCD", "RDR", 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal())); - recipePhantomBooster = RecipeUtil.lastIRecipe(); - - //Coffee Machine - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockCoffeeMachine), " C ", " S ", "AMA", 'M', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), 'C', "cropCoffee", 'S', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'A', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal())); - recipeCoffeeMachine = RecipeUtil.lastIRecipe(); - - //Energizer - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockEnergizer), "I I", "CAC", "I I", 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'A', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal())); - recipeEnergizer = RecipeUtil.lastIRecipe(); - - //Enervator - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockEnervator), " I ", "CAC", " I ", 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'A', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal())); - recipeEnervator = RecipeUtil.lastIRecipe(); - - //Lava Factory - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockLavaFactoryController), "SCS", "ISI", "LLL", 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'S', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'I', new ItemStack(InitBlocks.blockCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'L', Items.LAVA_BUCKET); - recipeLavaFactory = RecipeUtil.lastIRecipe(); - - //Casing - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockMisc, 32, TheMiscBlocks.LAVA_FACTORY_CASE.ordinal()), "ICI", 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'I', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal())); - recipeCasing = RecipeUtil.lastIRecipe(); - - //Canola Press - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockCanolaPress), "CHC", "CDC", "CRC", 'C', "cobblestone", 'H', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal())); - recipeCanolaPress = RecipeUtil.lastIRecipe(); - - //Fermenting Barrel - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockFermentingBarrel), "CHC", "CDC", "CRC", 'C', "logWood", 'H', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'R', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal()), 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal())); - recipeFermentingBarrel = RecipeUtil.lastIRecipe(); - - //Phantomface - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockPhantomface), " C ", "EBE", " S ", 'E', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()), 'C', "chestWood", 'S', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'B', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDERPEARL_BLOCK.ordinal())); - recipePhantomface = RecipeUtil.lastIRecipe(); - - //Player Interface - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockPlayerInterface), "BCB", "EBE", "BSB", 'E', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(Items.SKULL, 1, 1), 'S', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'B', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal())); - recipePlayerInterface = RecipeUtil.lastIRecipe(); - - //Phantom Placer - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitBlocks.blockPhantomPlacer), InitBlocks.blockPlacer, InitBlocks.blockPhantomface); - recipePhantomPlacer = RecipeUtil.lastIRecipe(); - - //Phantom Breaker - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitBlocks.blockPhantomBreaker), InitBlocks.blockBreaker, InitBlocks.blockPhantomface); - recipePhantomBreaker = RecipeUtil.lastIRecipe(); - - //Phantom Energyface - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockPhantomEnergyface), " R ", "RFR", " R ", 'R', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.REDSTONE.ordinal()), 'F', InitBlocks.blockPhantomface); - recipeEnergyface = RecipeUtil.lastIRecipe(); - - //Phantom Redstoneface - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockPhantomRedstoneface), "SRS", "RFR", "SRS", 'R', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.REDSTONE.ordinal()), 'S', new ItemStack(Items.REDSTONE), 'F', InitBlocks.blockPhantomface); - recipePhantomRedstoneface = RecipeUtil.lastIRecipe(); - - //Phantom Liquiface - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockPhantomLiquiface), "RFR", 'R', Items.BUCKET, 'F', InitBlocks.blockPhantomface); - recipeLiquiface = RecipeUtil.lastIRecipe(); - - //Liquid Placer - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockFluidPlacer), "RFR", 'R', Items.BUCKET, 'F', InitBlocks.blockPlacer); - recipeLiquidPlacer = RecipeUtil.lastIRecipe(); - - //Liquid Breaker - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockFluidCollector), "RFR", 'R', Items.BUCKET, 'F', InitBlocks.blockBreaker); - recipeLiquidCollector = RecipeUtil.lastIRecipe(); - - //Oil Generator - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockOilGenerator), "CRC", "CBC", "CRC", 'C', "cobblestone", 'R', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'B', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal())); - recipeOilGen = RecipeUtil.lastIRecipe(); - - //Bio Reactor - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockBioReactor), "CRC", "CBC", "CRC", 'C', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'R', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'B', new ItemStack(Blocks.SAPLING, 1, Util.WILDCARD)); - recipeBioReactor = RecipeUtil.lastIRecipe(); - - //Coal Generator - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockCoalGenerator), "CRC", "CBC", "CRC", 'C', "cobblestone", 'B', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'R', new ItemStack(Items.COAL, 1, Util.WILDCARD)); - recipeCoalGen = RecipeUtil.lastIRecipe(); - - //Leaf Generator - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockLeafGenerator), "IEI", "GLG", "ICI", 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'G', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.REDSTONE.ordinal()), 'E', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'L', "treeLeaves", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); - recipeLeafGen = RecipeUtil.lastIRecipe(); - - //Enderpearl Block - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDERPEARL_BLOCK.ordinal()), "EE", "EE", 'E', Items.ENDER_PEARL); - recipeEnderPearlBlock = RecipeUtil.lastIRecipe(); - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(Items.ENDER_PEARL, 4), new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDERPEARL_BLOCK.ordinal())); - - //Quartz Block - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal()), "QQ", "QQ", 'Q', "gemQuartzBlack"); - recipeQuartzBlock = RecipeUtil.lastIRecipe(); - - //Fishing Net - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockFishingNet), "SSS", "SDS", "SSS", 'D', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.EMERALD.ordinal()), 'S', Items.STRING); - recipeFisher = RecipeUtil.lastIRecipe(); - - //Repairer - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockItemRepairer), "DID", "OCO", "DID", 'D', new ItemStack(InitBlocks.blockCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()), 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'O', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal())); - recipeRepairer = RecipeUtil.lastIRecipe(); - - //Solar Panel - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockFurnaceSolar), "IQI", "CDC", "IBI", 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'Q', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'B', new ItemStack(Blocks.IRON_BARS)); - recipeSolar = RecipeUtil.lastIRecipe(); - - //Heat Collector - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockHeatCollector), "BRB", "CDC", "BQB", 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'R', new ItemStack(Items.REPEATER), 'Q', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'B', new ItemStack(Blocks.IRON_BARS)); - recipeHeatCollector = RecipeUtil.lastIRecipe(); - - //Quartz Pillar - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_PILLAR.ordinal()), "Q", "Q", 'Q', "gemQuartzBlack"); - recipeQuartzPillar = RecipeUtil.lastIRecipe(); - - //Chiseled Quartz - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockMisc, 2, TheMiscBlocks.QUARTZ_CHISELED.ordinal()), "Q", "Q", 'Q', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal())); - recipeQuartzChiseled = RecipeUtil.lastIRecipe(); - - //Inputter - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockInputter), "WWW", "CHC", "WWW", 'W', "plankWood", 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal()), 'H', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal())); - recipeESD = RecipeUtil.lastIRecipe(); - - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitBlocks.blockInputterAdvanced), InitBlocks.blockInputter, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), "gemQuartzBlack", new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal())); - recipeAdvancedESD = RecipeUtil.lastIRecipe(); - - //Crusher - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockGrinder), "MFC", "DQD", "CFM", 'M', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'C', "cobblestone", 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'Q', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'F', new ItemStack(Items.FLINT)); - recipeCrusher = RecipeUtil.lastIRecipe(); - - //Double Crusher - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockGrinderDouble), "CDC", "RFR", "CDC", 'C', "cobblestone", 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'R', InitBlocks.blockGrinder, 'F', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal())); - recipeDoubleCrusher = RecipeUtil.lastIRecipe(); - - //Double Furnace - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockFurnaceDouble), "PDC", "RFR", "CDP", 'C', "cobblestone", 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'R', new ItemStack(Blocks.FURNACE), 'F', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'P', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal())); - recipeFurnace = RecipeUtil.lastIRecipe(); - - //Feeder - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockFeeder), "WCW", "DHD", "WCW", 'W', "plankWood", 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'C', new ItemStack(Items.GOLDEN_CARROT), 'H', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal())); - recipeFeeder = RecipeUtil.lastIRecipe(); - - //Giant Chest - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockGiantChest), "CWC", "WDW", "CWC", 'C', "chestWood", 'D', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal()), 'W', "plankWood"); - recipeCrate = RecipeUtil.lastIRecipe(); - - new RecipeKeepDataShaped(new ResourceLocation(ActuallyAdditions.MODID, "giant_chest_media"), new ItemStack(InitBlocks.blockGiantChestMedium), new ItemStack(InitBlocks.blockGiantChest), "CWC", "WDW", "CWC", 'C', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.COAL.ordinal()), 'D', new ItemStack(InitBlocks.blockGiantChest), 'W', "plankWood"); - recipeCrateMedium = RecipeUtil.lastIRecipe(); - - new RecipeKeepDataShaped(new ResourceLocation(ActuallyAdditions.MODID, "giant_chest_large"), new ItemStack(InitBlocks.blockGiantChestLarge), new ItemStack(InitBlocks.blockGiantChestMedium), "CWC", "WDW", "CWC", 'C', new ItemStack(InitBlocks.blockCrystalEmpowered, 1, TheCrystals.COAL.ordinal()), 'D', new ItemStack(InitBlocks.blockGiantChestMedium), 'W', "plankWood"); - recipeCrateLarge = RecipeUtil.lastIRecipe(); - - //Greenhouse Glass - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockGreenhouseGlass, 2), "GSG", "SDS", "GSG", 'G', "blockGlass", 'D', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.LAPIS.ordinal()), 'S', "treeSapling"); - recipeGlass = RecipeUtil.lastIRecipe(); - - //Placer - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockPlacer), "CCC", "CRP", "CCC", 'C', "cobblestone", 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'P', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal())); - recipePlacer = RecipeUtil.lastIRecipe(); - - //Breaker - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockBreaker), "CCC", "CRP", "CCC", 'C', "cobblestone", 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'P', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal())); - recipeBreaker = RecipeUtil.lastIRecipe(); - - //Dropper - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockDropper), "CBC", "CDR", "CBC", 'B', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), 'C', "cobblestone", 'D', Blocks.DROPPER, 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); - recipeDropper = RecipeUtil.lastIRecipe(); - - for (int i = 0; i < BlockColoredLamp.ALL_LAMP_TYPES.length; i++) { - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockColoredLamp, 6, i), "GCG", "DQD", "GCG", 'C', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), 'G', "glowstone", 'D', "dye" + BlockColoredLamp.ALL_LAMP_TYPES[i].oreName, 'Q', "gemQuartzBlack"); - RECIPES_LAMPS[i] = RecipeUtil.lastIRecipe(); - } - - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockLampPowerer, 4), "XXX", "XLX", "XXX", 'X', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'L', new ItemStack(InitBlocks.blockColoredLamp, 1, Util.WILDCARD)); - recipePowerer = RecipeUtil.lastIRecipe(); - - } - -} \ No newline at end of file + // + // public static final IRecipe[] RECIPES_LAMPS = new IRecipe[BlockColoredLamp.ALL_LAMP_TYPES.length]; + // public static IRecipe recipeSmileyCloud; + // public static IRecipe recipePhantomface; + // public static IRecipe recipeLiquiface; + // public static IRecipe recipeEnergyface; + // public static IRecipe recipePhantomBreaker; + // public static IRecipe recipePhantomPlacer; + // public static IRecipe recipeBreaker; + // public static IRecipe recipePlacer; + // public static IRecipe recipeLiquidPlacer; + // public static IRecipe recipeLiquidCollector; + // public static IRecipe recipeCase; + // public static IRecipe recipeIronCase; + // public static IRecipe recipeEnderCase; + // public static IRecipe recipeEnderPearlBlock; + // public static IRecipe recipeESD; + // public static IRecipe recipeAdvancedESD; + // public static IRecipe recipePhantomBooster; + // public static IRecipe recipeCoffeeMachine; + // public static IRecipe recipeCrusher; + // public static IRecipe recipeDoubleCrusher; + // public static IRecipe recipeFurnace; + // public static IRecipe recipeSolidifier; + // public static IRecipe recipeCasing; + // public static IRecipe recipeGlass; + // public static IRecipe recipeLavaFactory; + // public static IRecipe recipeEnergizer; + // public static IRecipe recipeEnervator; + // public static IRecipe recipeSolar; + // public static IRecipe recipeHeatCollector; + // public static IRecipe recipeCoalGen; + // public static IRecipe recipeOilGen; + // public static IRecipe recipeRepairer; + // public static IRecipe recipeFisher; + // public static IRecipe recipeQuartzBlock; + // public static IRecipe recipeQuartzChiseled; + // public static IRecipe recipeQuartzPillar; + // public static IRecipe recipeBlockChar; + // public static IRecipe recipeFeeder; + // public static IRecipe recipeCompost; + // public static IRecipe recipeCrate; + // public static IRecipe recipeCrateMedium; + // public static IRecipe recipeCrateLarge; + // public static IRecipe recipeFermentingBarrel; + // public static IRecipe recipeCanolaPress; + // public static IRecipe recipePowerer; + // public static IRecipe recipeLeafGen; + // public static IRecipe recipeDirectionalBreaker; + // public static IRecipe recipeDropper; + // public static IRecipe recipeRangedCollector; + // public static IRecipe recipeLaserRelay; + // public static IRecipe recipeLaserRelayAdvanced; + // public static IRecipe recipeLaserRelayExtreme; + // public static IRecipe recipeAtomicReconstructor; + // public static IRecipe recipeMiner; + // public static IRecipe recipeFireworkBox; + // public static IRecipe recipePhantomRedstoneface; + // public static IRecipe recipeLaserRelayItemWhitelist; + // public static IRecipe recipeItemInterface; + // public static IRecipe recipeItemInterfaceHopping; + // public static IRecipe recipePlayerInterface; + // public static IRecipe recipeDisplayStand; + // public static IRecipe recipeShockSuppressor; + // public static IRecipe recipeEmpowerer; + // public static IRecipe[] recipesTinyTorch = new IRecipe[2]; + // public static IRecipe recipeBioReactor; + // public static IRecipe recipeFarmer; + // public static IRecipe recipeBatteryBox; + // + // private static class FireworkIngredient extends Ingredient { + // + // ItemStack firework = new ItemStack(Items.FIREWORKS); + // ItemStack[] fireworks = new ItemStack[] { this.firework }; + // + // @Override + // public ItemStack[] getMatchingStacks() { + // return this.fireworks; + // } + // + // @Override + // public boolean apply(ItemStack stack) { + // return stack.getItem() == Items.FIREWORKS; + // } + // } + // + // public static void init() { + // + // Block[] removeNBTBlocks = new Block[] { InitBlocks.blockOilGenerator, InitBlocks.blockFluidPlacer, InitBlocks.blockFluidCollector, InitBlocks.blockCanolaPress, InitBlocks.blockFermentingBarrel }; + // + // for (Block b : removeNBTBlocks) + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(b), new ItemStack(b)); + // + // //Battery Box + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitBlocks.blockBatteryBox), new ItemStack(InitBlocks.blockEnergizer), new ItemStack(InitBlocks.blockEnervator), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal())); + // recipeBatteryBox = RecipeUtil.lastIRecipe(); + // + // //Farmer + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockFarmer), "ISI", "SCS", "ISI", 'I', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal()), 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'S', new ItemStack(Items.WHEAT_SEEDS)); + // recipeFarmer = RecipeUtil.lastIRecipe(); + // + // //Empowerer + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockEmpowerer), " R ", " B ", "CDC", 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'B', new ItemStack(InitItems.itemBatteryDouble, 1, Util.WILDCARD), 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'D', new ItemStack(InitBlocks.blockDisplayStand)); + // recipeEmpowerer = RecipeUtil.lastIRecipe(); + // + // //Tiny Torch + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockTinyTorch, 2), "C", "W", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.TINY_COAL.ordinal()), 'W', "stickWood"); + // recipesTinyTorch[0] = RecipeUtil.lastIRecipe(); + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockTinyTorch, 2), "C", "W", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.TINY_CHAR.ordinal()), 'W', "stickWood"); + // recipesTinyTorch[1] = RecipeUtil.lastIRecipe(); + // + // //Firework Box + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockFireworkBox), "GFG", "SAS", "CCC", 'G', new ItemStack(Items.GUNPOWDER), 'S', new ItemStack(Items.STICK), 'A', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'F', new FireworkIngredient(), 'C', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal())); + // recipeFireworkBox = RecipeUtil.lastIRecipe(); + // + // //Shock Suppressor + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockShockSuppressor), "OAO", "ACA", "OAO", 'A', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.COAL.ordinal()), 'O', new ItemStack(Blocks.OBSIDIAN), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); + // recipeShockSuppressor = RecipeUtil.lastIRecipe(); + // + // //Display Stand + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockDisplayStand), " R ", "EEE", "GGG", 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'E', new ItemStack(InitBlocks.blockTestifiBucksGreenWall), 'G', new ItemStack(InitBlocks.blockTestifiBucksWhiteWall)); + // recipeDisplayStand = RecipeUtil.lastIRecipe(); + // + // //Miner + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockMiner), "IRI", "RCR", "IDI", 'R', "blockRedstone", 'I', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'C', new ItemStack(InitBlocks.blockCrystalEmpowered, 1, TheCrystals.COAL.ordinal()), 'D', new ItemStack(InitItems.itemDrill, 1, Util.WILDCARD)); + // recipeMiner = RecipeUtil.lastIRecipe(); + // + // //Quartz + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockQuartzWall, 6), "XXX", "XXX", 'X', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal())); + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockQuartzSlab, 6), "XXX", 'X', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal())); + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockQuartzStair, 6), "X ", "XX ", "XXX", 'X', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal())); + // + // //PillarQuartz + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockPillarQuartzWall, 6), "XXX", "XXX", 'X', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_PILLAR.ordinal())); + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockPillarQuartzSlab, 6), "XXX", 'X', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_PILLAR.ordinal())); + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockPillarQuartzStair, 6), "X ", "XX ", "XXX", 'X', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_PILLAR.ordinal())); + // + // //ChiseledQuartz + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockChiseledQuartzWall, 6), "XXX", "XXX", 'X', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_CHISELED.ordinal())); + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockChiseledQuartzSlab, 6), "XXX", 'X', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_CHISELED.ordinal())); + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockChiseledQuartzStair, 6), "X ", "XX ", "XXX", 'X', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_CHISELED.ordinal())); + // + // //White Ethetic Blocks + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockTestifiBucksWhiteFence, 6), "XXX", "XXX", 'X', new ItemStack(InitBlocks.blockTestifiBucksWhiteWall)); + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockTestifiBucksWhiteSlab, 6), "XXX", 'X', new ItemStack(InitBlocks.blockTestifiBucksWhiteWall)); + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockTestifiBucksWhiteStairs, 6), "X ", "XX ", "XXX", 'X', new ItemStack(InitBlocks.blockTestifiBucksWhiteWall)); + // + // //Green Ethetic Blocks + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockTestifiBucksGreenFence, 6), "XXX", "XXX", 'X', new ItemStack(InitBlocks.blockTestifiBucksGreenWall)); + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockTestifiBucksGreenSlab, 6), "XXX", 'X', new ItemStack(InitBlocks.blockTestifiBucksGreenWall)); + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockTestifiBucksGreenStairs, 6), "X ", "XX ", "XXX", 'X', new ItemStack(InitBlocks.blockTestifiBucksGreenWall)); + // + // //Atomic Reconstructor + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockAtomicReconstructor), "IRI", "RCR", "IRI", 'R', "dustRedstone", 'I', "ingotIron", 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal())); + // recipeAtomicReconstructor = RecipeUtil.lastIRecipe(); + // + // //Laser Relay + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockLaserRelay, 4), "OBO", "RCR", "OBO", 'B', new ItemStack(Blocks.REDSTONE_BLOCK), 'O', new ItemStack(Blocks.OBSIDIAN), 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); + // recipeLaserRelay = RecipeUtil.lastIRecipe(); + // + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockLaserRelayAdvanced), " I ", "XRX", " I ", 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'R', new ItemStack(InitBlocks.blockLaserRelay), 'X', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal())); + // recipeLaserRelayAdvanced = RecipeUtil.lastIRecipe(); + // + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockLaserRelayExtreme), " I ", "XRX", " I ", 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()), 'R', new ItemStack(InitBlocks.blockLaserRelayAdvanced), 'X', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal())); + // recipeLaserRelayExtreme = RecipeUtil.lastIRecipe(); + // + // //Whitelist Item Laser Relay + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitBlocks.blockLaserRelayItemWhitelist), new ItemStack(InitBlocks.blockLaserRelayItem), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), "gemQuartzBlack", new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal())); + // recipeLaserRelayItemWhitelist = RecipeUtil.lastIRecipe(); + // + // //Item Interface + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockItemViewer), "OBO", "RCR", "OBO", 'B', new ItemStack(Items.REDSTONE), 'O', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'C', "chestWood"); + // recipeItemInterface = RecipeUtil.lastIRecipe(); + // + // //Hopping Item Interface + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitBlocks.blockItemViewerHopping), new ItemStack(InitBlocks.blockItemViewer), new ItemStack(Blocks.HOPPER)); + // recipeItemInterfaceHopping = RecipeUtil.lastIRecipe(); + // + // //Ranged Collector + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockRangedCollector), " A ", "EHE", " C ", 'E', new ItemStack(Items.ENDER_PEARL), 'H', new ItemStack(Blocks.HOPPER), 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'A', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal())); + // recipeRangedCollector = RecipeUtil.lastIRecipe(); + // + // //Directional Breaker + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockDirectionalBreaker), "BBB", " C ", 'C', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), 'B', new ItemStack(InitBlocks.blockBreaker)); + // recipeDirectionalBreaker = RecipeUtil.lastIRecipe(); + // + // //Smiley Cloud + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockSmileyCloud), " W ", "WXW", " W ", 'W', new ItemStack(Blocks.WOOL, 1, Util.WILDCARD), 'X', new ItemStack(InitItems.itemSolidifiedExperience)); + // recipeSmileyCloud = RecipeUtil.lastIRecipe(); + // + // //Compost + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockCompost), "W W", "W W", "WCW", 'W', "plankWood", 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal())); + // recipeCompost = RecipeUtil.lastIRecipe(); + // + // //XP Solidifier + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockXPSolidifier), "XXX", "DCD", "XXX", 'X', new ItemStack(InitItems.itemSolidifiedExperience), 'D', new ItemStack(InitBlocks.blockCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); + // recipeSolidifier = RecipeUtil.lastIRecipe(); + // + // //Charcoal Block + // RecipeHandler.addShapedRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.CHARCOAL_BLOCK.ordinal()), "CCC", "CCC", "CCC", 'C', new ItemStack(Items.COAL, 1, 1)); + // recipeBlockChar = RecipeUtil.lastIRecipe(); + // RecipeHandler.addShapelessRecipe(new ItemStack(Items.COAL, 9, 1), new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.CHARCOAL_BLOCK.ordinal())); + // + // //Wood Casing + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal()), "WSW", "SRS", "WSW", 'W', "plankWood", 'R', "logWood", 'S', ConfigBoolValues.SUPER_DUPER_HARD_MODE.isEnabled() ? new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal()) : "stickWood"); + // recipeCase = RecipeUtil.lastIRecipe(); + // + // //Iron Casing + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), "WSW", "SQS", "WSW", 'Q', "gemQuartzBlack", 'W', "ingotIron", 'S', ConfigBoolValues.SUPER_DUPER_HARD_MODE.isEnabled() ? new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal()) : "stickWood"); + // recipeIronCase = RecipeUtil.lastIRecipe(); + // + // //Ender Casing + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal()), "WSW", "SRS", "WSW", 'W', ConfigBoolValues.SUPER_DUPER_HARD_MODE.isEnabled() ? new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDERPEARL_BLOCK.ordinal()) : new ItemStack(Items.ENDER_PEARL), 'R', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal()), 'S', ConfigBoolValues.SUPER_DUPER_HARD_MODE.isEnabled() ? new ItemStack(Blocks.DIAMOND_BLOCK) : new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal())); + // recipeEnderCase = RecipeUtil.lastIRecipe(); + // + // //Phantom Booster + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockPhantomBooster), "RDR", "DCD", "RDR", 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal())); + // recipePhantomBooster = RecipeUtil.lastIRecipe(); + // + // //Coffee Machine + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockCoffeeMachine), " C ", " S ", "AMA", 'M', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), 'C', "cropCoffee", 'S', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'A', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal())); + // recipeCoffeeMachine = RecipeUtil.lastIRecipe(); + // + // //Energizer + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockEnergizer), "I I", "CAC", "I I", 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'A', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal())); + // recipeEnergizer = RecipeUtil.lastIRecipe(); + // + // //Enervator + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockEnervator), " I ", "CAC", " I ", 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'A', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal())); + // recipeEnervator = RecipeUtil.lastIRecipe(); + // + // //Lava Factory + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockLavaFactoryController), "SCS", "ISI", "LLL", 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'S', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'I', new ItemStack(InitBlocks.blockCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'L', Items.LAVA_BUCKET); + // recipeLavaFactory = RecipeUtil.lastIRecipe(); + // + // //Casing + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockMisc, 32, TheMiscBlocks.LAVA_FACTORY_CASE.ordinal()), "ICI", 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'I', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal())); + // recipeCasing = RecipeUtil.lastIRecipe(); + // + // //Canola Press + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockCanolaPress), "CHC", "CDC", "CRC", 'C', "cobblestone", 'H', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal())); + // recipeCanolaPress = RecipeUtil.lastIRecipe(); + // + // //Fermenting Barrel + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockFermentingBarrel), "CHC", "CDC", "CRC", 'C', "logWood", 'H', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'R', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal()), 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal())); + // recipeFermentingBarrel = RecipeUtil.lastIRecipe(); + // + // //Phantomface + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockPhantomface), " C ", "EBE", " S ", 'E', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()), 'C', "chestWood", 'S', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'B', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDERPEARL_BLOCK.ordinal())); + // recipePhantomface = RecipeUtil.lastIRecipe(); + // + // //Player Interface + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockPlayerInterface), "BCB", "EBE", "BSB", 'E', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(Items.SKULL, 1, 1), 'S', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'B', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal())); + // recipePlayerInterface = RecipeUtil.lastIRecipe(); + // + // //Phantom Placer + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitBlocks.blockPhantomPlacer), InitBlocks.blockPlacer, InitBlocks.blockPhantomface); + // recipePhantomPlacer = RecipeUtil.lastIRecipe(); + // + // //Phantom Breaker + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitBlocks.blockPhantomBreaker), InitBlocks.blockBreaker, InitBlocks.blockPhantomface); + // recipePhantomBreaker = RecipeUtil.lastIRecipe(); + // + // //Phantom Energyface + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockPhantomEnergyface), " R ", "RFR", " R ", 'R', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.REDSTONE.ordinal()), 'F', InitBlocks.blockPhantomface); + // recipeEnergyface = RecipeUtil.lastIRecipe(); + // + // //Phantom Redstoneface + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockPhantomRedstoneface), "SRS", "RFR", "SRS", 'R', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.REDSTONE.ordinal()), 'S', new ItemStack(Items.REDSTONE), 'F', InitBlocks.blockPhantomface); + // recipePhantomRedstoneface = RecipeUtil.lastIRecipe(); + // + // //Phantom Liquiface + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockPhantomLiquiface), "RFR", 'R', Items.BUCKET, 'F', InitBlocks.blockPhantomface); + // recipeLiquiface = RecipeUtil.lastIRecipe(); + // + // //Liquid Placer + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockFluidPlacer), "RFR", 'R', Items.BUCKET, 'F', InitBlocks.blockPlacer); + // recipeLiquidPlacer = RecipeUtil.lastIRecipe(); + // + // //Liquid Breaker + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockFluidCollector), "RFR", 'R', Items.BUCKET, 'F', InitBlocks.blockBreaker); + // recipeLiquidCollector = RecipeUtil.lastIRecipe(); + // + // //Oil Generator + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockOilGenerator), "CRC", "CBC", "CRC", 'C', "cobblestone", 'R', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'B', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal())); + // recipeOilGen = RecipeUtil.lastIRecipe(); + // + // //Bio Reactor + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockBioReactor), "CRC", "CBC", "CRC", 'C', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'R', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'B', new ItemStack(Blocks.SAPLING, 1, Util.WILDCARD)); + // recipeBioReactor = RecipeUtil.lastIRecipe(); + // + // //Coal Generator + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockCoalGenerator), "CRC", "CBC", "CRC", 'C', "cobblestone", 'B', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'R', new ItemStack(Items.COAL, 1, Util.WILDCARD)); + // recipeCoalGen = RecipeUtil.lastIRecipe(); + // + // //Leaf Generator + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockLeafGenerator), "IEI", "GLG", "ICI", 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'G', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.REDSTONE.ordinal()), 'E', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'L', "treeLeaves", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); + // recipeLeafGen = RecipeUtil.lastIRecipe(); + // + // //Enderpearl Block + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDERPEARL_BLOCK.ordinal()), "EE", "EE", 'E', Items.ENDER_PEARL); + // recipeEnderPearlBlock = RecipeUtil.lastIRecipe(); + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(Items.ENDER_PEARL, 4), new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDERPEARL_BLOCK.ordinal())); + // + // //Quartz Block + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal()), "QQ", "QQ", 'Q', "gemQuartzBlack"); + // recipeQuartzBlock = RecipeUtil.lastIRecipe(); + // + // //Fishing Net + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockFishingNet), "SSS", "SDS", "SSS", 'D', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.EMERALD.ordinal()), 'S', Items.STRING); + // recipeFisher = RecipeUtil.lastIRecipe(); + // + // //Repairer + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockItemRepairer), "DID", "OCO", "DID", 'D', new ItemStack(InitBlocks.blockCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()), 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'O', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal())); + // recipeRepairer = RecipeUtil.lastIRecipe(); + // + // //Solar Panel + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockFurnaceSolar), "IQI", "CDC", "IBI", 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'Q', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'B', new ItemStack(Blocks.IRON_BARS)); + // recipeSolar = RecipeUtil.lastIRecipe(); + // + // //Heat Collector + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockHeatCollector), "BRB", "CDC", "BQB", 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'R', new ItemStack(Items.REPEATER), 'Q', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'B', new ItemStack(Blocks.IRON_BARS)); + // recipeHeatCollector = RecipeUtil.lastIRecipe(); + // + // //Quartz Pillar + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_PILLAR.ordinal()), "Q", "Q", 'Q', "gemQuartzBlack"); + // recipeQuartzPillar = RecipeUtil.lastIRecipe(); + // + // //Chiseled Quartz + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockMisc, 2, TheMiscBlocks.QUARTZ_CHISELED.ordinal()), "Q", "Q", 'Q', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal())); + // recipeQuartzChiseled = RecipeUtil.lastIRecipe(); + // + // //Inputter + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockInputter), "WWW", "CHC", "WWW", 'W', "plankWood", 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal()), 'H', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal())); + // recipeESD = RecipeUtil.lastIRecipe(); + // + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitBlocks.blockInputterAdvanced), InitBlocks.blockInputter, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), "gemQuartzBlack", new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal())); + // recipeAdvancedESD = RecipeUtil.lastIRecipe(); + // + // //Crusher + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockGrinder), "MFC", "DQD", "CFM", 'M', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'C', "cobblestone", 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'Q', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'F', new ItemStack(Items.FLINT)); + // recipeCrusher = RecipeUtil.lastIRecipe(); + // + // //Double Crusher + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockGrinderDouble), "CDC", "RFR", "CDC", 'C', "cobblestone", 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'R', InitBlocks.blockGrinder, 'F', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal())); + // recipeDoubleCrusher = RecipeUtil.lastIRecipe(); + // + // //Double Furnace + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockFurnaceDouble), "PDC", "RFR", "CDP", 'C', "cobblestone", 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'R', new ItemStack(Blocks.FURNACE), 'F', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'P', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal())); + // recipeFurnace = RecipeUtil.lastIRecipe(); + // + // //Feeder + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockFeeder), "WCW", "DHD", "WCW", 'W', "plankWood", 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'C', new ItemStack(Items.GOLDEN_CARROT), 'H', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal())); + // recipeFeeder = RecipeUtil.lastIRecipe(); + // + // //Giant Chest + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockGiantChest), "CWC", "WDW", "CWC", 'C', "chestWood", 'D', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal()), 'W', "plankWood"); + // recipeCrate = RecipeUtil.lastIRecipe(); + // + // new RecipeKeepDataShaped(new ResourceLocation(ActuallyAdditions.MODID, "giant_chest_media"), new ItemStack(InitBlocks.blockGiantChestMedium), new ItemStack(InitBlocks.blockGiantChest), "CWC", "WDW", "CWC", 'C', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.COAL.ordinal()), 'D', new ItemStack(InitBlocks.blockGiantChest), 'W', "plankWood"); + // recipeCrateMedium = RecipeUtil.lastIRecipe(); + // + // new RecipeKeepDataShaped(new ResourceLocation(ActuallyAdditions.MODID, "giant_chest_large"), new ItemStack(InitBlocks.blockGiantChestLarge), new ItemStack(InitBlocks.blockGiantChestMedium), "CWC", "WDW", "CWC", 'C', new ItemStack(InitBlocks.blockCrystalEmpowered, 1, TheCrystals.COAL.ordinal()), 'D', new ItemStack(InitBlocks.blockGiantChestMedium), 'W', "plankWood"); + // recipeCrateLarge = RecipeUtil.lastIRecipe(); + // + // //Greenhouse Glass + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockGreenhouseGlass, 2), "GSG", "SDS", "GSG", 'G', "blockGlass", 'D', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.LAPIS.ordinal()), 'S', "treeSapling"); + // recipeGlass = RecipeUtil.lastIRecipe(); + // + // //Placer + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockPlacer), "CCC", "CRP", "CCC", 'C', "cobblestone", 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'P', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal())); + // recipePlacer = RecipeUtil.lastIRecipe(); + // + // //Breaker + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockBreaker), "CCC", "CRP", "CCC", 'C', "cobblestone", 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'P', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal())); + // recipeBreaker = RecipeUtil.lastIRecipe(); + // + // //Dropper + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockDropper), "CBC", "CDR", "CBC", 'B', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), 'C', "cobblestone", 'D', Blocks.DROPPER, 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); + // recipeDropper = RecipeUtil.lastIRecipe(); + // + // for (int i = 0; i < BlockColoredLamp.ALL_LAMP_TYPES.length; i++) { + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockColoredLamp, 6, i), "GCG", "DQD", "GCG", 'C', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), 'G', "glowstone", 'D', "dye" + BlockColoredLamp.ALL_LAMP_TYPES[i].oreName, 'Q', "gemQuartzBlack"); + // RECIPES_LAMPS[i] = RecipeUtil.lastIRecipe(); + // } + // + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockLampPowerer, 4), "XXX", "XLX", "XXX", 'X', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'L', new ItemStack(InitBlocks.blockColoredLamp, 1, Util.WILDCARD)); + // recipePowerer = RecipeUtil.lastIRecipe(); + // + // } + +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/CrusherCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/CrusherCrafting.java index 7eadac814..8f146a813 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/CrusherCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/CrusherCrafting.java @@ -10,125 +10,108 @@ package de.ellpeck.actuallyadditions.mod.crafting; -import java.util.ArrayList; -import java.util.List; - -import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; -import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe; -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheDusts; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods; -import de.ellpeck.actuallyadditions.mod.recipe.CrusherRecipeRegistry; -import de.ellpeck.actuallyadditions.mod.util.RecipeUtil; -import de.ellpeck.actuallyadditions.mod.util.StackUtil; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.NonNullList; -import net.minecraftforge.oredict.OreDictionary; -import net.minecraftforge.oredict.OreIngredient; - +// TODO: [port] MOVE TO DATA_GENERATOR +@Deprecated public final class CrusherCrafting { - - public static final ArrayList MISC_RECIPES = new ArrayList<>(); - public static CrusherRecipe recipeIronHorseArmor; - public static CrusherRecipe recipeGoldHorseArmor; - public static CrusherRecipe recipeDiamondHorseArmor; - - public static void init() { - ActuallyAdditions.LOGGER.info("Initializing Crusher Recipes..."); - - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.BONE), new ItemStack(Items.DYE, 6, 15), StackUtil.getEmpty(), 0); - MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.REEDS), new ItemStack(Items.SUGAR, 3), StackUtil.getEmpty(), 0); - MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.BLAZE_ROD), new ItemStack(Items.BLAZE_POWDER, 4), StackUtil.getEmpty(), 0); - MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.YELLOW_FLOWER), new ItemStack(Items.DYE, 3, 11), StackUtil.getEmpty(), 0); - MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 0), new ItemStack(Items.DYE, 3, 1), StackUtil.getEmpty(), 0); - MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 1), new ItemStack(Items.DYE, 3, 12), StackUtil.getEmpty(), 0); - MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 2), new ItemStack(Items.DYE, 3, 13), StackUtil.getEmpty(), 0); - MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 3), new ItemStack(Items.DYE, 3, 7), StackUtil.getEmpty(), 0); - MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 4), new ItemStack(Items.DYE, 3, 1), StackUtil.getEmpty(), 0); - MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 5), new ItemStack(Items.DYE, 3, 14), StackUtil.getEmpty(), 0); - MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 6), new ItemStack(Items.DYE, 3, 7), StackUtil.getEmpty(), 0); - MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 7), new ItemStack(Items.DYE, 3, 9), StackUtil.getEmpty(), 0); - MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 8), new ItemStack(Items.DYE, 3, 7), StackUtil.getEmpty(), 0); - MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 0), new ItemStack(Items.DYE, 4, 11), StackUtil.getEmpty(), 0); - MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 1), new ItemStack(Items.DYE, 4, 13), StackUtil.getEmpty(), 0); - MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 4), new ItemStack(Items.DYE, 4, 1), StackUtil.getEmpty(), 0); - MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 5), new ItemStack(Items.DYE, 4, 9), StackUtil.getEmpty(), 0); - MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - - if (!CrusherRecipeRegistry.hasException("oreRedstone")) ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("oreRedstone"), new ItemStack(Items.REDSTONE, 10), StackUtil.getEmpty(), 0); - if (!CrusherRecipeRegistry.hasException("oreLapis")) ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("oreLapis"), new ItemStack(Items.DYE, 12, 4), StackUtil.getEmpty(), 0); - if (!CrusherRecipeRegistry.hasException("coal")) ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("coal"), new ItemStack(InitItems.itemDust, 1, TheDusts.COAL.ordinal()), StackUtil.getEmpty(), 0); - if (!CrusherRecipeRegistry.hasException("oreCoal")) ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("oreCoal"), new ItemStack(Items.COAL, 3), StackUtil.getEmpty(), 0); - if (!CrusherRecipeRegistry.hasException("blockCoal")) ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("blockCoal"), new ItemStack(Items.COAL, 9), StackUtil.getEmpty(), 0); - if (!CrusherRecipeRegistry.hasException("oreQuartz")) ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("oreQuartz"), new ItemStack(Items.QUARTZ, 3), StackUtil.getEmpty(), 0); - if (!CrusherRecipeRegistry.hasException("cobblestone")) ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("cobblestone"), new ItemStack(Blocks.SAND), StackUtil.getEmpty(), 0); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.GRAVEL), new ItemStack(Items.FLINT), new ItemStack(Items.FLINT), 50); - if (!CrusherRecipeRegistry.hasException("stone")) ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("stone", false), OreDictionary.getOres("cobblestone", false), 1, NonNullList.withSize(1, StackUtil.getEmpty()), 0, 0); - - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(Items.SUGAR, 2), StackUtil.getEmpty(), 0); - MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.GLOWSTONE), new ItemStack(Items.GLOWSTONE_DUST, 4), StackUtil.getEmpty(), 0); - MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - - if (!CrusherRecipeRegistry.hasException("oreNickel")) ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("oreNickel", false), OreDictionary.getOres("dustNickel", false), 2, OreDictionary.getOres("dustPlatinum", false), 1, 15); - if (!CrusherRecipeRegistry.hasException("oreIron")) ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("oreIron", false), OreDictionary.getOres("dustIron", false), 2, OreDictionary.getOres("dustGold", false), 1, 20); - - ItemStack temp = getStack("dustIron"); - if (!temp.isEmpty()) { - temp.setCount(6); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.IRON_HORSE_ARMOR), temp, StackUtil.getEmpty(), 0); - recipeIronHorseArmor = RecipeUtil.lastCrusherRecipe(); - } - - temp = getStack("dustGold"); - if (!temp.isEmpty()) { - temp.setCount(6); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.GOLDEN_HORSE_ARMOR), temp, StackUtil.getEmpty(), 0); - recipeGoldHorseArmor = RecipeUtil.lastCrusherRecipe(); - } - - temp = getStack("dustDiamond"); - if (!temp.isEmpty()) { - temp.setCount(6); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.DIAMOND_HORSE_ARMOR), temp, StackUtil.getEmpty(), 0); - recipeDiamondHorseArmor = RecipeUtil.lastCrusherRecipe(); - } - - CrusherRecipeRegistry.SEARCH_CASES.add(new CrusherRecipeRegistry.SearchCase("oreNether", 6)); - CrusherRecipeRegistry.SEARCH_CASES.add(new CrusherRecipeRegistry.SearchCase("orePoor", 4, "nugget")); - CrusherRecipeRegistry.SEARCH_CASES.add(new CrusherRecipeRegistry.SearchCase("denseore", 8)); - CrusherRecipeRegistry.SEARCH_CASES.add(new CrusherRecipeRegistry.SearchCase("gem", 1)); - CrusherRecipeRegistry.SEARCH_CASES.add(new CrusherRecipeRegistry.SearchCase("ingot", 1)); - CrusherRecipeRegistry.SEARCH_CASES.add(new CrusherRecipeRegistry.SearchCase("ore", 2, "gem")); //Search for gems first so removeDuplicates doesn't clear gem recipes. - CrusherRecipeRegistry.SEARCH_CASES.add(new CrusherRecipeRegistry.SearchCase("ore", 2)); - - CrusherRecipeRegistry.registerFinally(); - } - - private static ItemStack getStack(String ore) { - List stacks = OreDictionary.getOres(ore); - if (stacks.isEmpty()) return StackUtil.getEmpty(); - return stacks.get(0).copy(); - } + // + // public static final ArrayList MISC_RECIPES = new ArrayList<>(); + // public static CrusherRecipe recipeIronHorseArmor; + // public static CrusherRecipe recipeGoldHorseArmor; + // public static CrusherRecipe recipeDiamondHorseArmor; + // + // public static void init() { + // ActuallyAdditions.LOGGER.info("Initializing Crusher Recipes..."); + // + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.BONE), new ItemStack(Items.DYE, 6, 15), StackUtil.getEmpty(), 0); + // MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.REEDS), new ItemStack(Items.SUGAR, 3), StackUtil.getEmpty(), 0); + // MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.BLAZE_ROD), new ItemStack(Items.BLAZE_POWDER, 4), StackUtil.getEmpty(), 0); + // MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + // + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.YELLOW_FLOWER), new ItemStack(Items.DYE, 3, 11), StackUtil.getEmpty(), 0); + // MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 0), new ItemStack(Items.DYE, 3, 1), StackUtil.getEmpty(), 0); + // MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 1), new ItemStack(Items.DYE, 3, 12), StackUtil.getEmpty(), 0); + // MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 2), new ItemStack(Items.DYE, 3, 13), StackUtil.getEmpty(), 0); + // MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 3), new ItemStack(Items.DYE, 3, 7), StackUtil.getEmpty(), 0); + // MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 4), new ItemStack(Items.DYE, 3, 1), StackUtil.getEmpty(), 0); + // MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 5), new ItemStack(Items.DYE, 3, 14), StackUtil.getEmpty(), 0); + // MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 6), new ItemStack(Items.DYE, 3, 7), StackUtil.getEmpty(), 0); + // MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 7), new ItemStack(Items.DYE, 3, 9), StackUtil.getEmpty(), 0); + // MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 8), new ItemStack(Items.DYE, 3, 7), StackUtil.getEmpty(), 0); + // MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 0), new ItemStack(Items.DYE, 4, 11), StackUtil.getEmpty(), 0); + // MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 1), new ItemStack(Items.DYE, 4, 13), StackUtil.getEmpty(), 0); + // MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 4), new ItemStack(Items.DYE, 4, 1), StackUtil.getEmpty(), 0); + // MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 5), new ItemStack(Items.DYE, 4, 9), StackUtil.getEmpty(), 0); + // MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + // + // if (!CrusherRecipeRegistry.hasException("oreRedstone")) ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("oreRedstone"), new ItemStack(Items.REDSTONE, 10), StackUtil.getEmpty(), 0); + // if (!CrusherRecipeRegistry.hasException("oreLapis")) ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("oreLapis"), new ItemStack(Items.DYE, 12, 4), StackUtil.getEmpty(), 0); + // if (!CrusherRecipeRegistry.hasException("coal")) ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("coal"), new ItemStack(InitItems.itemDust, 1, TheDusts.COAL.ordinal()), StackUtil.getEmpty(), 0); + // if (!CrusherRecipeRegistry.hasException("oreCoal")) ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("oreCoal"), new ItemStack(Items.COAL, 3), StackUtil.getEmpty(), 0); + // if (!CrusherRecipeRegistry.hasException("blockCoal")) ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("blockCoal"), new ItemStack(Items.COAL, 9), StackUtil.getEmpty(), 0); + // if (!CrusherRecipeRegistry.hasException("oreQuartz")) ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("oreQuartz"), new ItemStack(Items.QUARTZ, 3), StackUtil.getEmpty(), 0); + // if (!CrusherRecipeRegistry.hasException("cobblestone")) ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("cobblestone"), new ItemStack(Blocks.SAND), StackUtil.getEmpty(), 0); + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.GRAVEL), new ItemStack(Items.FLINT), new ItemStack(Items.FLINT), 50); + // if (!CrusherRecipeRegistry.hasException("stone")) ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("stone", false), OreDictionary.getOres("cobblestone", false), 1, NonNullList.withSize(1, StackUtil.getEmpty()), 0, 0); + // + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(Items.SUGAR, 2), StackUtil.getEmpty(), 0); + // MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + // + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.GLOWSTONE), new ItemStack(Items.GLOWSTONE_DUST, 4), StackUtil.getEmpty(), 0); + // MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + // + // if (!CrusherRecipeRegistry.hasException("oreNickel")) ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("oreNickel", false), OreDictionary.getOres("dustNickel", false), 2, OreDictionary.getOres("dustPlatinum", false), 1, 15); + // if (!CrusherRecipeRegistry.hasException("oreIron")) ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("oreIron", false), OreDictionary.getOres("dustIron", false), 2, OreDictionary.getOres("dustGold", false), 1, 20); + // + // ItemStack temp = getStack("dustIron"); + // if (!temp.isEmpty()) { + // temp.setCount(6); + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.IRON_HORSE_ARMOR), temp, StackUtil.getEmpty(), 0); + // recipeIronHorseArmor = RecipeUtil.lastCrusherRecipe(); + // } + // + // temp = getStack("dustGold"); + // if (!temp.isEmpty()) { + // temp.setCount(6); + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.GOLDEN_HORSE_ARMOR), temp, StackUtil.getEmpty(), 0); + // recipeGoldHorseArmor = RecipeUtil.lastCrusherRecipe(); + // } + // + // temp = getStack("dustDiamond"); + // if (!temp.isEmpty()) { + // temp.setCount(6); + // ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.DIAMOND_HORSE_ARMOR), temp, StackUtil.getEmpty(), 0); + // recipeDiamondHorseArmor = RecipeUtil.lastCrusherRecipe(); + // } + // + // CrusherRecipeRegistry.SEARCH_CASES.add(new CrusherRecipeRegistry.SearchCase("oreNether", 6)); + // CrusherRecipeRegistry.SEARCH_CASES.add(new CrusherRecipeRegistry.SearchCase("orePoor", 4, "nugget")); + // CrusherRecipeRegistry.SEARCH_CASES.add(new CrusherRecipeRegistry.SearchCase("denseore", 8)); + // CrusherRecipeRegistry.SEARCH_CASES.add(new CrusherRecipeRegistry.SearchCase("gem", 1)); + // CrusherRecipeRegistry.SEARCH_CASES.add(new CrusherRecipeRegistry.SearchCase("ingot", 1)); + // CrusherRecipeRegistry.SEARCH_CASES.add(new CrusherRecipeRegistry.SearchCase("ore", 2, "gem")); //Search for gems first so removeDuplicates doesn't clear gem recipes. + // CrusherRecipeRegistry.SEARCH_CASES.add(new CrusherRecipeRegistry.SearchCase("ore", 2)); + // + // CrusherRecipeRegistry.registerFinally(); + // } + // + // private static ItemStack getStack(String ore) { + // List stacks = OreDictionary.getOres(ore); + // if (stacks.isEmpty()) return StackUtil.getEmpty(); + // return stacks.get(0).copy(); + // } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/FoodCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/FoodCrafting.java index 03fc7168f..fae787e98 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/FoodCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/FoodCrafting.java @@ -10,116 +10,105 @@ package de.ellpeck.actuallyadditions.mod.crafting; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; -import de.ellpeck.actuallyadditions.mod.util.RecipeUtil; -import de.ellpeck.actuallyadditions.mod.util.Util; -import de.ellpeck.actuallyadditions.mod.util.crafting.RecipeHandler; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.item.crafting.Ingredient; -import net.minecraftforge.fml.common.registry.GameRegistry; - +// TODO: [port] MOVE TO DATA_GENERATOR +@Deprecated public final class FoodCrafting { - - public static IRecipe recipePizza; - public static IRecipe recipeHamburger; - public static IRecipe recipeBigCookie; - public static IRecipe recipeSubSandwich; - public static IRecipe recipeFrenchFry; - public static IRecipe recipeFrenchFries; - public static IRecipe recipeFishNChips; - public static IRecipe recipeCheese; - public static IRecipe recipePumpkinStew; - public static IRecipe recipeCarrotJuice; - public static IRecipe recipeSpaghetti; - public static IRecipe recipeNoodle; - public static IRecipe recipeChocolate; - public static IRecipe recipeChocolateCake; - public static IRecipe recipeToast; - public static IRecipe recipeChocolateToast; - public static IRecipe recipeBacon; - - public static void init() { - - Ingredient knife = Ingredient.fromItem(InitItems.itemKnife); - - //Rice Bread - GameRegistry.addSmelting(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RICE_DOUGH.ordinal()), new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE_BREAD.ordinal()), 1F); - - //Bacon - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemFoods, 3, TheFoods.BACON.ordinal()), knife, new ItemStack(Items.COOKED_PORKCHOP)); - recipeBacon = RecipeUtil.lastIRecipe(); - - //Baguette - GameRegistry.addSmelting(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DOUGH.ordinal()), new ItemStack(InitItems.itemFoods, 1, TheFoods.BAGUETTE.ordinal()), 1F); - - //Pizza - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.PIZZA.ordinal()), "HKH", "MCF", " D ", 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DOUGH.ordinal()), 'M', new ItemStack(Blocks.BROWN_MUSHROOM), 'C', "cropCarrot", 'F', new ItemStack(Items.COOKED_FISH, 1, Util.WILDCARD), 'K', knife, 'H', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal())); - recipePizza = RecipeUtil.lastIRecipe(); - - //Hamburger - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.HAMBURGER.ordinal()), "KT ", "CB ", " T ", 'T', new ItemStack(InitItems.itemFoods, 1, TheFoods.TOAST.ordinal()), 'C', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()), 'K', knife, 'B', new ItemStack(Items.COOKED_BEEF)); - recipeHamburger = RecipeUtil.lastIRecipe(); - - //Big Cookie - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.BIG_COOKIE.ordinal()), "DCD", "CDC", "DCD", 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DOUGH.ordinal()), 'C', new ItemStack(Items.DYE, 1, 3)); - recipeBigCookie = RecipeUtil.lastIRecipe(); - - //Sub Sandwich - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.SUBMARINE_SANDWICH.ordinal()), "KCP", "FB ", "PCP", 'P', new ItemStack(Items.PAPER), 'C', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()), 'F', new ItemStack(Items.COOKED_BEEF, 1, Util.WILDCARD), 'B', new ItemStack(InitItems.itemFoods, 1, TheFoods.BAGUETTE.ordinal()), 'K', knife); - recipeSubSandwich = RecipeUtil.lastIRecipe(); - - //French Fry - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemFoods, 2, TheFoods.FRENCH_FRY.ordinal()), new ItemStack(Items.BAKED_POTATO), knife); - recipeFrenchFry = RecipeUtil.lastIRecipe(); - - //French Fries - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.FRENCH_FRIES.ordinal()), "FFF", " P ", 'P', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.PAPER_CONE.ordinal()), 'F', new ItemStack(InitItems.itemFoods, 1, TheFoods.FRENCH_FRY.ordinal())); - recipeFrenchFries = RecipeUtil.lastIRecipe(); - - //Fish N Chips - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.FISH_N_CHIPS.ordinal()), "FIF", " P ", 'I', new ItemStack(Items.COOKED_FISH, 1, Util.WILDCARD), 'P', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.PAPER_CONE.ordinal()), 'F', new ItemStack(InitItems.itemFoods, 1, TheFoods.FRENCH_FRY.ordinal())); - recipeFishNChips = RecipeUtil.lastIRecipe(); - - //Cheese - RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()), new ItemStack(Items.MILK_BUCKET), new ItemStack(Items.EGG)); //I don't know if this makes any actual sense, but whatever - recipeCheese = RecipeUtil.lastIRecipe(); - - //Pumpkin Stew - RecipeHandler.addShapedRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.PUMPKIN_STEW.ordinal()), "P", "B", 'P', new ItemStack(Blocks.PUMPKIN), 'B', new ItemStack(Items.BOWL)); - recipePumpkinStew = RecipeUtil.lastIRecipe(); - - //Carrot Juice - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CARROT_JUICE.ordinal()), new ItemStack(Items.GLASS_BOTTLE), "cropCarrot", knife); - recipeCarrotJuice = RecipeUtil.lastIRecipe(); - - //Spaghetti - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.SPAGHETTI.ordinal()), "NNN", " B ", 'N', new ItemStack(InitItems.itemFoods, 1, TheFoods.NOODLE.ordinal()), 'B', new ItemStack(Items.BOWL)); - recipeSpaghetti = RecipeUtil.lastIRecipe(); - - //Noodle - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.NOODLE.ordinal()), "cropWheat", knife); - recipeNoodle = RecipeUtil.lastIRecipe(); - - //Chocolate - RecipeHandler.addShapedRecipe(new ItemStack(InitItems.itemFoods, 3, TheFoods.CHOCOLATE.ordinal()), "C C", "CMC", "C C", 'C', new ItemStack(Items.DYE, 1, 3), 'M', new ItemStack(Items.MILK_BUCKET)); - recipeChocolate = RecipeUtil.lastIRecipe(); - - //Chocolate Cake - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CHOCOLATE_CAKE.ordinal()), "MMM", "CCC", "EDS", 'M', new ItemStack(Items.MILK_BUCKET), 'E', new ItemStack(Items.EGG), 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DOUGH.ordinal()), 'S', new ItemStack(Items.SUGAR), 'C', new ItemStack(Items.DYE, 1, 3)); - recipeChocolateCake = RecipeUtil.lastIRecipe(); - - //Toast - RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemFoods, 2, TheFoods.TOAST.ordinal()), new ItemStack(Items.BREAD)); - recipeToast = RecipeUtil.lastIRecipe(); - - //Chocolate Toast - RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CHOCOLATE_TOAST.ordinal()), new ItemStack(InitItems.itemFoods, 1, TheFoods.TOAST.ordinal()), new ItemStack(InitItems.itemFoods, 1, TheFoods.CHOCOLATE.ordinal())); - recipeChocolateToast = RecipeUtil.lastIRecipe(); - } + // + // public static IRecipe recipePizza; + // public static IRecipe recipeHamburger; + // public static IRecipe recipeBigCookie; + // public static IRecipe recipeSubSandwich; + // public static IRecipe recipeFrenchFry; + // public static IRecipe recipeFrenchFries; + // public static IRecipe recipeFishNChips; + // public static IRecipe recipeCheese; + // public static IRecipe recipePumpkinStew; + // public static IRecipe recipeCarrotJuice; + // public static IRecipe recipeSpaghetti; + // public static IRecipe recipeNoodle; + // public static IRecipe recipeChocolate; + // public static IRecipe recipeChocolateCake; + // public static IRecipe recipeToast; + // public static IRecipe recipeChocolateToast; + // public static IRecipe recipeBacon; + // + // public static void init() { + // + // Ingredient knife = Ingredient.fromItem(InitItems.itemKnife); + // + // //Rice Bread + // GameRegistry.addSmelting(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RICE_DOUGH.ordinal()), new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE_BREAD.ordinal()), 1F); + // + // //Bacon + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemFoods, 3, TheFoods.BACON.ordinal()), knife, new ItemStack(Items.COOKED_PORKCHOP)); + // recipeBacon = RecipeUtil.lastIRecipe(); + // + // //Baguette + // GameRegistry.addSmelting(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DOUGH.ordinal()), new ItemStack(InitItems.itemFoods, 1, TheFoods.BAGUETTE.ordinal()), 1F); + // + // //Pizza + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.PIZZA.ordinal()), "HKH", "MCF", " D ", 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DOUGH.ordinal()), 'M', new ItemStack(Blocks.BROWN_MUSHROOM), 'C', "cropCarrot", 'F', new ItemStack(Items.COOKED_FISH, 1, Util.WILDCARD), 'K', knife, 'H', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal())); + // recipePizza = RecipeUtil.lastIRecipe(); + // + // //Hamburger + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.HAMBURGER.ordinal()), "KT ", "CB ", " T ", 'T', new ItemStack(InitItems.itemFoods, 1, TheFoods.TOAST.ordinal()), 'C', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()), 'K', knife, 'B', new ItemStack(Items.COOKED_BEEF)); + // recipeHamburger = RecipeUtil.lastIRecipe(); + // + // //Big Cookie + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.BIG_COOKIE.ordinal()), "DCD", "CDC", "DCD", 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DOUGH.ordinal()), 'C', new ItemStack(Items.DYE, 1, 3)); + // recipeBigCookie = RecipeUtil.lastIRecipe(); + // + // //Sub Sandwich + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.SUBMARINE_SANDWICH.ordinal()), "KCP", "FB ", "PCP", 'P', new ItemStack(Items.PAPER), 'C', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()), 'F', new ItemStack(Items.COOKED_BEEF, 1, Util.WILDCARD), 'B', new ItemStack(InitItems.itemFoods, 1, TheFoods.BAGUETTE.ordinal()), 'K', knife); + // recipeSubSandwich = RecipeUtil.lastIRecipe(); + // + // //French Fry + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemFoods, 2, TheFoods.FRENCH_FRY.ordinal()), new ItemStack(Items.BAKED_POTATO), knife); + // recipeFrenchFry = RecipeUtil.lastIRecipe(); + // + // //French Fries + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.FRENCH_FRIES.ordinal()), "FFF", " P ", 'P', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.PAPER_CONE.ordinal()), 'F', new ItemStack(InitItems.itemFoods, 1, TheFoods.FRENCH_FRY.ordinal())); + // recipeFrenchFries = RecipeUtil.lastIRecipe(); + // + // //Fish N Chips + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.FISH_N_CHIPS.ordinal()), "FIF", " P ", 'I', new ItemStack(Items.COOKED_FISH, 1, Util.WILDCARD), 'P', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.PAPER_CONE.ordinal()), 'F', new ItemStack(InitItems.itemFoods, 1, TheFoods.FRENCH_FRY.ordinal())); + // recipeFishNChips = RecipeUtil.lastIRecipe(); + // + // //Cheese + // RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()), new ItemStack(Items.MILK_BUCKET), new ItemStack(Items.EGG)); //I don't know if this makes any actual sense, but whatever + // recipeCheese = RecipeUtil.lastIRecipe(); + // + // //Pumpkin Stew + // RecipeHandler.addShapedRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.PUMPKIN_STEW.ordinal()), "P", "B", 'P', new ItemStack(Blocks.PUMPKIN), 'B', new ItemStack(Items.BOWL)); + // recipePumpkinStew = RecipeUtil.lastIRecipe(); + // + // //Carrot Juice + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CARROT_JUICE.ordinal()), new ItemStack(Items.GLASS_BOTTLE), "cropCarrot", knife); + // recipeCarrotJuice = RecipeUtil.lastIRecipe(); + // + // //Spaghetti + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.SPAGHETTI.ordinal()), "NNN", " B ", 'N', new ItemStack(InitItems.itemFoods, 1, TheFoods.NOODLE.ordinal()), 'B', new ItemStack(Items.BOWL)); + // recipeSpaghetti = RecipeUtil.lastIRecipe(); + // + // //Noodle + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.NOODLE.ordinal()), "cropWheat", knife); + // recipeNoodle = RecipeUtil.lastIRecipe(); + // + // //Chocolate + // RecipeHandler.addShapedRecipe(new ItemStack(InitItems.itemFoods, 3, TheFoods.CHOCOLATE.ordinal()), "C C", "CMC", "C C", 'C', new ItemStack(Items.DYE, 1, 3), 'M', new ItemStack(Items.MILK_BUCKET)); + // recipeChocolate = RecipeUtil.lastIRecipe(); + // + // //Chocolate Cake + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CHOCOLATE_CAKE.ordinal()), "MMM", "CCC", "EDS", 'M', new ItemStack(Items.MILK_BUCKET), 'E', new ItemStack(Items.EGG), 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DOUGH.ordinal()), 'S', new ItemStack(Items.SUGAR), 'C', new ItemStack(Items.DYE, 1, 3)); + // recipeChocolateCake = RecipeUtil.lastIRecipe(); + // + // //Toast + // RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemFoods, 2, TheFoods.TOAST.ordinal()), new ItemStack(Items.BREAD)); + // recipeToast = RecipeUtil.lastIRecipe(); + // + // //Chocolate Toast + // RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CHOCOLATE_TOAST.ordinal()), new ItemStack(InitItems.itemFoods, 1, TheFoods.TOAST.ordinal()), new ItemStack(InitItems.itemFoods, 1, TheFoods.CHOCOLATE.ordinal())); + // recipeChocolateToast = RecipeUtil.lastIRecipe(); + // } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/InitCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/InitCrafting.java index 788057b21..310aa04a1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/InitCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/InitCrafting.java @@ -16,28 +16,24 @@ import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntListValues; import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; -import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.CactusFarmerBehavior; -import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.DefaultFarmerBehavior; -import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.MelonPumpkinFarmerBehavior; -import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.NetherWartFarmerBehavior; -import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.ReedFarmerBehavior; -import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.exu.EnderlillyFarmerBehavior; -import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.exu.RedOrchidFarmerBehavior; +import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.*; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.Ingredient; import net.minecraft.util.ResourceLocation; +// TODO: [port] MOVE TO DATA_GENERATOR +@Deprecated public final class InitCrafting { public static void init() { ActuallyAdditions.LOGGER.info("Initializing Crafting Recipes..."); - ItemCrafting.init(); - BlockCrafting.init(); - MiscCrafting.init(); - FoodCrafting.init(); - ToolCrafting.init(); + // ItemCrafting.init(); + // BlockCrafting.init(); + // MiscCrafting.init(); + // FoodCrafting.init(); + // ToolCrafting.init(); ActuallyAdditionsAPI.addCompostRecipe(Ingredient.fromStacks(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.MASHED_FOOD.ordinal())), Blocks.LEAVES.getDefaultState(), new ItemStack(InitItems.itemFertilizer), Blocks.DIRT.getDefaultState()); ActuallyAdditionsAPI.addCompostRecipe(Ingredient.fromItems(InitItems.itemCanolaSeed), Blocks.DIRT.getDefaultState(), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.BIOMASS.ordinal()), Blocks.SOUL_SAND.getDefaultState()); @@ -54,8 +50,8 @@ public final class InitCrafting { ActuallyAdditionsAPI.addFarmerBehavior(new NetherWartFarmerBehavior()); ActuallyAdditionsAPI.addFarmerBehavior(new ReedFarmerBehavior()); ActuallyAdditionsAPI.addFarmerBehavior(new MelonPumpkinFarmerBehavior()); - ActuallyAdditionsAPI.addFarmerBehavior(new EnderlillyFarmerBehavior()); - ActuallyAdditionsAPI.addFarmerBehavior(new RedOrchidFarmerBehavior()); + // ActuallyAdditionsAPI.addFarmerBehavior(new EnderlillyFarmerBehavior()); + // ActuallyAdditionsAPI.addFarmerBehavior(new RedOrchidFarmerBehavior()); new RecipePotionRingCharging(new ResourceLocation(ActuallyAdditions.MODID, "potion_ring_charging")); new RecipeBioMash(new ResourceLocation(ActuallyAdditions.MODID, "bio_mash")); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java index 762fcaf8f..15c619543 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java @@ -10,377 +10,350 @@ package de.ellpeck.actuallyadditions.mod.crafting; -import java.util.ArrayList; - -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheColoredLampColors; -import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks; -import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheDusts; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; -import de.ellpeck.actuallyadditions.mod.items.metalists.ThePotionRings; -import de.ellpeck.actuallyadditions.mod.util.RecipeUtil; -import de.ellpeck.actuallyadditions.mod.util.Util; -import de.ellpeck.actuallyadditions.mod.util.crafting.RecipeHandler; -import net.minecraft.enchantment.EnchantmentData; -import net.minecraft.init.Blocks; -import net.minecraft.init.Enchantments; -import net.minecraft.init.Items; -import net.minecraft.init.PotionTypes; -import net.minecraft.item.ItemEnchantedBook; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.potion.PotionUtils; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.registry.GameRegistry; -import net.minecraftforge.oredict.OreDictionary; - +// TODO: [port] MOVE TO DATA_GENERATOR +@Deprecated public final class ItemCrafting { - - public static final ArrayList RECIPES_POTION_RINGS = new ArrayList<>(); - public static final ArrayList RECIPES_DRILL_COLORING = new ArrayList<>(); - public static IRecipe recipePhantomConnector; - public static IRecipe recipeCoil; - public static IRecipe recipeCoilAdvanced; - public static IRecipe recipeBook; - public static IRecipe recipeTinyCoal; - public static IRecipe recipeTinyChar; - public static IRecipe recipeDrill; - public static IRecipe recipeDrillSpeedI; - public static IRecipe recipeDrillSpeedII; - public static IRecipe recipeDrillSpeedIII; - public static IRecipe recipeDrillFortuneI; - public static IRecipe recipeDrillFortuneII; - public static IRecipe recipeDrillSilk; - public static IRecipe recipeDrillPlacing; - public static IRecipe recipeDrillThree; - public static IRecipe recipeDrillFive; - public static IRecipe recipeBattery; - public static IRecipe recipeBatteryDouble; - public static IRecipe recipeBatteryTriple; - public static IRecipe recipeBatteryQuadruple; - public static IRecipe recipeBatteryQuintuple; - public static IRecipe recipeStaff; - public static IRecipe recipeGrowthRing; - public static IRecipe recipeMagnetRing; - public static IRecipe recipeWaterRing; - public static IRecipe recipeWings; - public static IRecipe recipeCup; - public static IRecipe recipeKnifeHandle; - public static IRecipe recipeKnifeBlade; - public static IRecipe recipeKnife; - public static IRecipe recipeRing; - public static IRecipe recipeDough; - public static IRecipe recipeRiceDough; - public static IRecipe recipeLeafBlower; - public static IRecipe recipeLeafBlowerAdvanced; - public static IRecipe recipeChestToCrateUpgrade; - public static IRecipe recipeSmallToMediumCrateUpgrade; - public static IRecipe recipeMediumToLargeCrateUpgrade; - public static IRecipe recipeLaserWrench; - public static IRecipe recipeDrillCore; - public static IRecipe recipeBlackDye; - public static IRecipe recipeLens; - public static IRecipe recipeCrateKeeper; - public static IRecipe recipeEnderStar; - public static IRecipe recipeSpawnerChanger; - public static IRecipe recipeFilter; - public static IRecipe recipePlayerProbe; - public static IRecipe recipeDisenchantingLens; - public static IRecipe recipeMiningLens; - public static IRecipe recipeBag; - public static IRecipe recipeVoidBag; - public static IRecipe recipeLensMoreDeath; - public static IRecipe recipeFillingWand; - public static IRecipe recipeLaserUpgradeInvisibility; - public static IRecipe recipeLaserUpgradeRange; - public static IRecipe recipeGoggles; - public static IRecipe recipeGogglesAdvanced; - - public static void init() { - - //Advanced Goggles - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemEngineerGogglesAdvanced), " R ", "IGI", 'R', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.REDSTONE.ordinal()), 'I', new ItemStack(Blocks.IRON_BARS), 'G', new ItemStack(InitItems.itemEngineerGoggles)); - recipeGogglesAdvanced = RecipeUtil.lastIRecipe(); - - //Goggles - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemEngineerGoggles), " R ", "IGI", 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'I', new ItemStack(Blocks.IRON_BARS), 'G', "blockGlass"); - recipeGoggles = RecipeUtil.lastIRecipe(); - - //Laser Invis Upgrade - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemLaserUpgradeInvisibility, 4), "GGG", "RCR", "GGG", 'G', "blockGlassBlack", 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); - recipeLaserUpgradeInvisibility = RecipeUtil.lastIRecipe(); - - //Laser Range Upgrade - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemLaserUpgradeRange, 2), "GGC", "RCR", "CGG", 'R', new ItemStack(Items.COMPASS), 'G', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); - recipeLaserUpgradeRange = RecipeUtil.lastIRecipe(); - - //Filling Wand - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemFillingWand), "IPI", "DCD", " B ", 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'P', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'B', new ItemStack(InitItems.itemBatteryTriple)); - recipeFillingWand = RecipeUtil.lastIRecipe(); - - //Bag - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemBag), "SLS", "SCS", "LVL", 'S', new ItemStack(Items.STRING), 'L', new ItemStack(Items.LEATHER), 'C', "chestWood", 'V', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.COAL.ordinal())); - recipeBag = RecipeUtil.lastIRecipe(); - - //Void Bag - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemVoidBag), new ItemStack(InitItems.itemBag), new ItemStack(Items.ENDER_PEARL), new ItemStack(Blocks.OBSIDIAN), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.COAL.ordinal())); - recipeVoidBag = RecipeUtil.lastIRecipe(); - - //Lens - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), "GGG", "GBG", "GGG", 'G', "blockGlass", 'B', "gemQuartzBlack"); - recipeLens = RecipeUtil.lastIRecipe(); - - //Black Dye - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemMisc, 2, TheMiscItems.BLACK_DYE.ordinal()), new ItemStack(InitBlocks.blockBlackLotus)); - recipeBlackDye = RecipeUtil.lastIRecipe(); - - //Booklet - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemBooklet), new ItemStack(InitItems.itemCanolaSeed), new ItemStack(Items.PAPER)); - recipeBook = RecipeUtil.lastIRecipe(); - - //Clearing NBT Storage - RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemLaserWrench), new ItemStack(InitItems.itemLaserWrench)); - RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemPhantomConnector), new ItemStack(InitItems.itemPhantomConnector)); - RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemSpawnerChanger), new ItemStack(InitItems.itemSpawnerChanger)); - - //Chest To Crate Upgrade - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemChestToCrateUpgrade), " W ", "WCW", " W ", 'C', new ItemStack(InitBlocks.blockGiantChest), 'W', "plankWood"); - recipeChestToCrateUpgrade = RecipeUtil.lastIRecipe(); - - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemSmallToMediumCrateUpgrade), " W ", "WCW", " W ", 'C', new ItemStack(InitBlocks.blockGiantChestMedium), 'W', "plankWood"); - recipeSmallToMediumCrateUpgrade = RecipeUtil.lastIRecipe(); - - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMediumToLargeCrateUpgrade), " W ", "WCW", " W ", 'C', new ItemStack(InitBlocks.blockGiantChestLarge), 'W', "plankWood"); - recipeMediumToLargeCrateUpgrade = RecipeUtil.lastIRecipe(); - - //Disenchanting Lens - ItemStack crystal = new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()); - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemDisenchantingLens), new ItemStack(Blocks.ENCHANTING_TABLE), crystal.copy(), crystal.copy(), crystal.copy(), crystal.copy(), crystal.copy(), crystal.copy(), crystal.copy(), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal())); - recipeDisenchantingLens = RecipeUtil.lastIRecipe(); - - //Mining Lens - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMiningLens), "DGI", "CLB", "QPE", 'D', "gemDiamond", 'G', "ingotGold", 'I', "ingotIron", 'C', "coal", 'L', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), 'B', "gemQuartzBlack", 'Q', "gemQuartz", 'P', "gemLapis", 'E', "gemEmerald"); - recipeMiningLens = RecipeUtil.lastIRecipe(); - - //Killer Lens - ItemStack enchBook = new ItemStack(Items.ENCHANTED_BOOK); - ItemEnchantedBook.addEnchantment(enchBook, new EnchantmentData(Enchantments.SHARPNESS, 5)); - - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemMoreDamageLens), new ItemStack(Items.DIAMOND_SWORD), new ItemStack(InitItems.itemDamageLens), enchBook); - recipeLensMoreDeath = RecipeUtil.lastIRecipe(); - - //Filter - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemFilter), "III", "IQI", "III", 'I', new ItemStack(Blocks.IRON_BARS), 'Q', "gemQuartzBlack"); - recipeFilter = RecipeUtil.lastIRecipe(); - - //Crate Keeper - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemCrateKeeper), "WIW", "IQI", "WIW", 'I', "ingotIron", 'W', "plankWood", 'Q', "gemQuartzBlack"); - recipeCrateKeeper = RecipeUtil.lastIRecipe(); - - //Spawner Changer - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemSpawnerChanger), "MSM", "SDS", "MSM", 'M', new ItemStack(Items.MAGMA_CREAM), 'S', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.SPAWNER_SHARD.ordinal()), 'D', new ItemStack(InitBlocks.blockCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal())); - recipeSpawnerChanger = RecipeUtil.lastIRecipe(); - - //Laser Wrench - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemLaserWrench), "C ", " S ", " S", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'S', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal())); - recipeLaserWrench = RecipeUtil.lastIRecipe(); - - //Rice Stuff - RecipeHandler.addOreDictRecipe(new ItemStack(Items.PAPER, 3), "R ", " R ", " R", 'R', new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal())); - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMisc, 4, TheMiscItems.RICE_SLIME.ordinal()), " R ", "RBR", " R ", 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RICE_DOUGH.ordinal()), 'B', Items.WATER_BUCKET); - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMisc, 4, TheMiscItems.RICE_SLIME.ordinal()), " R ", "RBR", " R ", 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RICE_DOUGH.ordinal()), 'B', new ItemStack(Items.POTIONITEM)); - - //Leaf Blower - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemLeafBlower), " F", "IP", "IC", 'F', new ItemStack(Items.FLINT), 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'P', new ItemStack(Blocks.PISTON), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); - recipeLeafBlower = RecipeUtil.lastIRecipe(); - - //Drill - ItemStack lightBlueDrill = new ItemStack(InitItems.itemDrill, 1, TheColoredLampColors.LIGHT_BLUE.ordinal()); - RecipeHandler.addOreDictRecipe(lightBlueDrill.copy(), "DDD", "CRC", "III", 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DRILL_CORE.ordinal()), 'I', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal())); - recipeDrill = RecipeUtil.lastIRecipe(); - - for (int i = 0; i < 16; i++) { - if (i != TheColoredLampColors.LIGHT_BLUE.ordinal()) { - new RecipeKeepDataShapeless(new ResourceLocation(ActuallyAdditions.MODID, "dril_color_change" + i), new ItemStack(InitItems.itemDrill, 1, i), new ItemStack(InitItems.itemDrill, 1, Util.WILDCARD), lightBlueDrill.copy(), "dye" + TheColoredLampColors.values()[i].oreName); - RECIPES_DRILL_COLORING.add(RecipeUtil.lastIRecipe()); - } - } - - //Drill Core - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DRILL_CORE.ordinal()), "ICI", "CRC", "ICI", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'I', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal())); - recipeDrillCore = RecipeUtil.lastIRecipe(); - - //Tele Staff - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemTeleStaff), " FE", " S ", "SB ", 'F', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()), 'E', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDERPEARL_BLOCK.ordinal()), 'S', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal()), 'B', new ItemStack(InitItems.itemBattery, 1, Util.WILDCARD)); - recipeStaff = RecipeUtil.lastIRecipe(); - - //Drill Speed - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemDrillUpgradeSpeed), "ISI", "SRS", "ISI", 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'S', Items.SUGAR, 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal())); - recipeDrillSpeedI = RecipeUtil.lastIRecipe(); - - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemDrillUpgradeSpeedII), "ISI", "SCS", "ISI", 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'S', Items.SUGAR, 'C', Items.CAKE); - recipeDrillSpeedII = RecipeUtil.lastIRecipe(); - - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemDrillUpgradeSpeedIII), "ISI", "SFS", "ISI", 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'S', Items.SUGAR, 'F', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal())); - recipeDrillSpeedIII = RecipeUtil.lastIRecipe(); - - //Drill Fortune - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemDrillUpgradeFortune), "ISI", "SRS", "ISI", 'I', Blocks.GLOWSTONE, 'S', Items.REDSTONE, 'R', new ItemStack(InitBlocks.blockCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal())); - recipeDrillFortuneI = RecipeUtil.lastIRecipe(); - - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemDrillUpgradeFortuneII), "ISI", "SRS", "ISI", 'I', Blocks.GLOWSTONE, 'S', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.REDSTONE.ordinal()), 'R', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal())); - recipeDrillFortuneII = RecipeUtil.lastIRecipe(); - - //Drill Size - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemDrillUpgradeThreeByThree), "DID", "ICI", "DID", 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal())); - recipeDrillThree = RecipeUtil.lastIRecipe(); - - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemDrillUpgradeFiveByFive), "DID", "ICI", "DID", 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); - recipeDrillFive = RecipeUtil.lastIRecipe(); - - //Drill Silk Touch - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemDrillUpgradeSilkTouch), "DSD", "SCS", "DSD", 'D', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.EMERALD.ordinal()), 'S', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); - recipeDrillSilk = RecipeUtil.lastIRecipe(); - - //Drill Placing - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemDrillUpgradeBlockPlacing), "CEC", "RAR", "CEC", 'C', "cobblestone", 'E', Items.PAPER, 'A', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal())); - recipeDrillPlacing = RecipeUtil.lastIRecipe(); - - //Battery - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemBattery), " R ", "ICI", "III", 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); - recipeBattery = RecipeUtil.lastIRecipe(); - - //Double Battery - new RecipeKeepDataShaped(new ResourceLocation(ActuallyAdditions.MODID, "double_battery"), new ItemStack(InitItems.itemBatteryDouble), new ItemStack(InitItems.itemBattery), " R ", "ICI", "III", 'R', new ItemStack(InitItems.itemBattery), 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); - recipeBatteryDouble = RecipeUtil.lastIRecipe(); - - //Magnet Ring - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMagnetRing), "RIB", "IOI", "BIR", 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'B', new ItemStack(Items.DYE, 1, 4), 'O', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal())); - recipeMagnetRing = RecipeUtil.lastIRecipe(); - - //Growth Ring - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemGrowthRing), "SIS", "IOI", "SIS", 'S', new ItemStack(Items.WHEAT_SEEDS), 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'O', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal())); - recipeGrowthRing = RecipeUtil.lastIRecipe(); - - //Water Ring - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemWaterRemovalRing), "BIB", "IOI", "BIB", 'B', new ItemStack(Items.WATER_BUCKET), 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()), 'O', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal())); - recipeWaterRing = RecipeUtil.lastIRecipe(); - - //Triple Battery - new RecipeKeepDataShaped(new ResourceLocation(ActuallyAdditions.MODID, "triple_battery"), new ItemStack(InitItems.itemBatteryTriple), new ItemStack(InitItems.itemBatteryDouble), " R ", "ICI", "III", 'R', new ItemStack(InitItems.itemBatteryDouble), 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); - recipeBatteryTriple = RecipeUtil.lastIRecipe(); - - //Quadruple Battery - new RecipeKeepDataShaped(new ResourceLocation(ActuallyAdditions.MODID, "quadruple_battery"), new ItemStack(InitItems.itemBatteryQuadruple), new ItemStack(InitItems.itemBatteryTriple), " R ", "ICI", "III", 'R', new ItemStack(InitItems.itemBatteryTriple), 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); - recipeBatteryQuadruple = RecipeUtil.lastIRecipe(); - - //Quintuple Battery - new RecipeKeepDataShaped(new ResourceLocation(ActuallyAdditions.MODID, "quintuple_battery"), new ItemStack(InitItems.itemBatteryQuintuple), new ItemStack(InitItems.itemBatteryQuadruple), " R ", "ICI", "III", 'R', new ItemStack(InitItems.itemBatteryQuadruple), 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); - recipeBatteryQuintuple = RecipeUtil.lastIRecipe(); - - //Bat Wings - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemWingsOfTheBats), "WNW", "WDW", "WNW", 'W', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.BAT_WING.ordinal()), 'N', new ItemStack(InitBlocks.blockCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()), 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.ENDER_STAR.ordinal())); - recipeWings = RecipeUtil.lastIRecipe(); - - //Coil - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), " R ", "RIR", " R ", 'I', ConfigBoolValues.SUPER_DUPER_HARD_MODE.isEnabled() ? new ItemStack(InitItems.itemMisc, 1, TheMiscItems.ENDER_STAR.ordinal()) : "gemQuartzBlack", 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal())); - recipeCoil = RecipeUtil.lastIRecipe(); - - //Cup - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CUP.ordinal()), "S S", "SCS", "SSS", 'S', "stone", 'C', "cropCoffee"); - recipeCup = RecipeUtil.lastIRecipe(); - - //Resonant Rice - if (!OreDictionary.getOres("nuggetEnderium", false).isEmpty()) { - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemResonantRice), new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), "nuggetEnderium", Items.GUNPOWDER); - } - - //Advanced Coil - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), "GGG", "GCG", "GGG", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'G', "nuggetGold"); - recipeCoilAdvanced = RecipeUtil.lastIRecipe(); - - //Advanced Leaf Blower - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemLeafBlowerAdvanced), " F", "DP", "DC", 'F', new ItemStack(Items.FLINT), 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'P', new ItemStack(Blocks.PISTON), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); - recipeLeafBlowerAdvanced = RecipeUtil.lastIRecipe(); - - //Phantom Connector - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemPhantomConnector), "YE", "EY", "S ", 'Y', Items.ENDER_EYE, 'E', Items.ENDER_PEARL, 'S', "stickWood"); - recipePhantomConnector = RecipeUtil.lastIRecipe(); - - //Player Probe - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemPlayerProbe), "A A", "AIA", "RHR", 'A', new ItemStack(Blocks.IRON_BARS), 'R', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.REDSTONE.ordinal()), 'H', new ItemStack(Items.SKULL, 1, 1), 'I', new ItemStack(Items.IRON_HELMET)); - recipePlayerProbe = RecipeUtil.lastIRecipe(); - - //Quartz - GameRegistry.addSmelting(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal()), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), 1F); - - //Knife - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemKnife), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_BLADE.ordinal()), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_HANDLE.ordinal())); - recipeKnife = RecipeUtil.lastIRecipe(); - - //Crafter on a Stick - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemCrafterOnAStick), new ItemStack(Blocks.CRAFTING_TABLE), new ItemStack(Items.SIGN)); - - //Tiny Coal - if (ConfigBoolValues.TINY_COAL_STUFF.isEnabled()) { - RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 8, TheMiscItems.TINY_COAL.ordinal()), new ItemStack(Items.COAL)); - recipeTinyCoal = RecipeUtil.lastIRecipe(); - RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 8, TheMiscItems.TINY_CHAR.ordinal()), new ItemStack(Items.COAL, 1, 1)); - recipeTinyChar = RecipeUtil.lastIRecipe(); - RecipeHandler.addOreDictRecipe(new ItemStack(Items.COAL), "CCC", "C C", "CCC", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.TINY_COAL.ordinal())); - RecipeHandler.addOreDictRecipe(new ItemStack(Items.COAL, 1, 1), "CCC", "C C", "CCC", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.TINY_CHAR.ordinal())); - } - - //Rice Seeds - RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemRiceSeed), new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal())); - - //Canola Seeds - RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemCanolaSeed), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal())); - - //Rings - initPotionRingRecipes(); - - //Ingots from Dusts - GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.IRON.ordinal()), new ItemStack(Items.IRON_INGOT), 1F); - GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.GOLD.ordinal()), new ItemStack(Items.GOLD_INGOT), 1F); - GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.DIAMOND.ordinal()), new ItemStack(Items.DIAMOND), 1F); - GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.EMERALD.ordinal()), new ItemStack(Items.EMERALD), 1F); - GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.LAPIS.ordinal()), new ItemStack(Items.DYE, 1, 4), 1F); - GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.QUARTZ_BLACK.ordinal()), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), 1F); - GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.QUARTZ.ordinal()), new ItemStack(Items.QUARTZ), 1F); - GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.COAL.ordinal()), new ItemStack(Items.COAL), 1F); - - } - - public static void initPotionRingRecipes() { - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal()), "IGI", "GDG", "IGI", 'G', "ingotGold", 'I', "ingotIron", 'D', "dustGlowstone"); - recipeRing = RecipeUtil.lastIRecipe(); - - addRingRecipeWithStack(ThePotionRings.SPEED.craftingItem, ThePotionRings.SPEED.ordinal()); - addRingRecipeWithStack(ThePotionRings.HASTE.craftingItem, ThePotionRings.HASTE.ordinal()); - addRingRecipeWithStack(ThePotionRings.STRENGTH.craftingItem, ThePotionRings.STRENGTH.ordinal()); - addRingRecipeWithStack(ThePotionRings.JUMP_BOOST.craftingItem, ThePotionRings.JUMP_BOOST.ordinal()); - addRingRecipeWithStack(ThePotionRings.REGEN.craftingItem, ThePotionRings.REGEN.ordinal()); - addRingRecipeWithStack(ThePotionRings.RESISTANCE.craftingItem, ThePotionRings.RESISTANCE.ordinal()); - addRingRecipeWithStack(ThePotionRings.FIRE_RESISTANCE.craftingItem, ThePotionRings.FIRE_RESISTANCE.ordinal()); - addRingRecipeWithStack(ThePotionRings.WATER_BREATHING.craftingItem, ThePotionRings.WATER_BREATHING.ordinal()); - addRingRecipeWithStack(ThePotionRings.INVISIBILITY.craftingItem, ThePotionRings.INVISIBILITY.ordinal()); - addRingRecipeWithStack(ThePotionRings.NIGHT_VISION.craftingItem, ThePotionRings.NIGHT_VISION.ordinal()); - } - - public static void addRingRecipeWithStack(ItemStack mainStack, int meta) { - ItemStack potion = new ItemStack(Items.POTIONITEM); - PotionUtils.addPotionToItemStack(potion, PotionTypes.AWKWARD); - - RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemPotionRing, 1, meta), mainStack, mainStack, mainStack, mainStack, new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.DIAMOND.ordinal()), new ItemStack(Items.NETHER_WART), potion, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal())); - RECIPES_POTION_RINGS.add(RecipeUtil.lastIRecipe()); - - RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemPotionRingAdvanced, 1, meta), new ItemStack(InitItems.itemPotionRing, 1, meta), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.ENDER_STAR.ordinal())); - RECIPES_POTION_RINGS.add(RecipeUtil.lastIRecipe()); - } -} \ No newline at end of file + // + // public static final ArrayList RECIPES_POTION_RINGS = new ArrayList<>(); + // public static final ArrayList RECIPES_DRILL_COLORING = new ArrayList<>(); + // public static IRecipe recipePhantomConnector; + // public static IRecipe recipeCoil; + // public static IRecipe recipeCoilAdvanced; + // public static IRecipe recipeBook; + // public static IRecipe recipeTinyCoal; + // public static IRecipe recipeTinyChar; + // public static IRecipe recipeDrill; + // public static IRecipe recipeDrillSpeedI; + // public static IRecipe recipeDrillSpeedII; + // public static IRecipe recipeDrillSpeedIII; + // public static IRecipe recipeDrillFortuneI; + // public static IRecipe recipeDrillFortuneII; + // public static IRecipe recipeDrillSilk; + // public static IRecipe recipeDrillPlacing; + // public static IRecipe recipeDrillThree; + // public static IRecipe recipeDrillFive; + // public static IRecipe recipeBattery; + // public static IRecipe recipeBatteryDouble; + // public static IRecipe recipeBatteryTriple; + // public static IRecipe recipeBatteryQuadruple; + // public static IRecipe recipeBatteryQuintuple; + // public static IRecipe recipeStaff; + // public static IRecipe recipeGrowthRing; + // public static IRecipe recipeMagnetRing; + // public static IRecipe recipeWaterRing; + // public static IRecipe recipeWings; + // public static IRecipe recipeCup; + // public static IRecipe recipeKnifeHandle; + // public static IRecipe recipeKnifeBlade; + // public static IRecipe recipeKnife; + // public static IRecipe recipeRing; + // public static IRecipe recipeDough; + // public static IRecipe recipeRiceDough; + // public static IRecipe recipeLeafBlower; + // public static IRecipe recipeLeafBlowerAdvanced; + // public static IRecipe recipeChestToCrateUpgrade; + // public static IRecipe recipeSmallToMediumCrateUpgrade; + // public static IRecipe recipeMediumToLargeCrateUpgrade; + // public static IRecipe recipeLaserWrench; + // public static IRecipe recipeDrillCore; + // public static IRecipe recipeBlackDye; + // public static IRecipe recipeLens; + // public static IRecipe recipeCrateKeeper; + // public static IRecipe recipeEnderStar; + // public static IRecipe recipeSpawnerChanger; + // public static IRecipe recipeFilter; + // public static IRecipe recipePlayerProbe; + // public static IRecipe recipeDisenchantingLens; + // public static IRecipe recipeMiningLens; + // public static IRecipe recipeBag; + // public static IRecipe recipeVoidBag; + // public static IRecipe recipeLensMoreDeath; + // public static IRecipe recipeFillingWand; + // public static IRecipe recipeLaserUpgradeInvisibility; + // public static IRecipe recipeLaserUpgradeRange; + // public static IRecipe recipeGoggles; + // public static IRecipe recipeGogglesAdvanced; + // + // public static void init() { + // + // //Advanced Goggles + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemEngineerGogglesAdvanced), " R ", "IGI", 'R', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.REDSTONE.ordinal()), 'I', new ItemStack(Blocks.IRON_BARS), 'G', new ItemStack(InitItems.itemEngineerGoggles)); + // recipeGogglesAdvanced = RecipeUtil.lastIRecipe(); + // + // //Goggles + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemEngineerGoggles), " R ", "IGI", 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'I', new ItemStack(Blocks.IRON_BARS), 'G', "blockGlass"); + // recipeGoggles = RecipeUtil.lastIRecipe(); + // + // //Laser Invis Upgrade + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemLaserUpgradeInvisibility, 4), "GGG", "RCR", "GGG", 'G', "blockGlassBlack", 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); + // recipeLaserUpgradeInvisibility = RecipeUtil.lastIRecipe(); + // + // //Laser Range Upgrade + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemLaserUpgradeRange, 2), "GGC", "RCR", "CGG", 'R', new ItemStack(Items.COMPASS), 'G', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); + // recipeLaserUpgradeRange = RecipeUtil.lastIRecipe(); + // + // //Filling Wand + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemFillingWand), "IPI", "DCD", " B ", 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'P', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'B', new ItemStack(InitItems.itemBatteryTriple)); + // recipeFillingWand = RecipeUtil.lastIRecipe(); + // + // //Bag + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemBag), "SLS", "SCS", "LVL", 'S', new ItemStack(Items.STRING), 'L', new ItemStack(Items.LEATHER), 'C', "chestWood", 'V', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.COAL.ordinal())); + // recipeBag = RecipeUtil.lastIRecipe(); + // + // //Void Bag + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemVoidBag), new ItemStack(InitItems.itemBag), new ItemStack(Items.ENDER_PEARL), new ItemStack(Blocks.OBSIDIAN), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.COAL.ordinal())); + // recipeVoidBag = RecipeUtil.lastIRecipe(); + // + // //Lens + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), "GGG", "GBG", "GGG", 'G', "blockGlass", 'B', "gemQuartzBlack"); + // recipeLens = RecipeUtil.lastIRecipe(); + // + // //Black Dye + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemMisc, 2, TheMiscItems.BLACK_DYE.ordinal()), new ItemStack(InitBlocks.blockBlackLotus)); + // recipeBlackDye = RecipeUtil.lastIRecipe(); + // + // //Booklet + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemBooklet), new ItemStack(InitItems.itemCanolaSeed), new ItemStack(Items.PAPER)); + // recipeBook = RecipeUtil.lastIRecipe(); + // + // //Clearing NBT Storage + // RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemLaserWrench), new ItemStack(InitItems.itemLaserWrench)); + // RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemPhantomConnector), new ItemStack(InitItems.itemPhantomConnector)); + // RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemSpawnerChanger), new ItemStack(InitItems.itemSpawnerChanger)); + // + // //Chest To Crate Upgrade + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemChestToCrateUpgrade), " W ", "WCW", " W ", 'C', new ItemStack(InitBlocks.blockGiantChest), 'W', "plankWood"); + // recipeChestToCrateUpgrade = RecipeUtil.lastIRecipe(); + // + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemSmallToMediumCrateUpgrade), " W ", "WCW", " W ", 'C', new ItemStack(InitBlocks.blockGiantChestMedium), 'W', "plankWood"); + // recipeSmallToMediumCrateUpgrade = RecipeUtil.lastIRecipe(); + // + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMediumToLargeCrateUpgrade), " W ", "WCW", " W ", 'C', new ItemStack(InitBlocks.blockGiantChestLarge), 'W', "plankWood"); + // recipeMediumToLargeCrateUpgrade = RecipeUtil.lastIRecipe(); + // + // //Disenchanting Lens + // ItemStack crystal = new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()); + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemDisenchantingLens), new ItemStack(Blocks.ENCHANTING_TABLE), crystal.copy(), crystal.copy(), crystal.copy(), crystal.copy(), crystal.copy(), crystal.copy(), crystal.copy(), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal())); + // recipeDisenchantingLens = RecipeUtil.lastIRecipe(); + // + // //Mining Lens + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMiningLens), "DGI", "CLB", "QPE", 'D', "gemDiamond", 'G', "ingotGold", 'I', "ingotIron", 'C', "coal", 'L', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), 'B', "gemQuartzBlack", 'Q', "gemQuartz", 'P', "gemLapis", 'E', "gemEmerald"); + // recipeMiningLens = RecipeUtil.lastIRecipe(); + // + // //Killer Lens + // ItemStack enchBook = new ItemStack(Items.ENCHANTED_BOOK); + // ItemEnchantedBook.addEnchantment(enchBook, new EnchantmentData(Enchantments.SHARPNESS, 5)); + // + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemMoreDamageLens), new ItemStack(Items.DIAMOND_SWORD), new ItemStack(InitItems.itemDamageLens), enchBook); + // recipeLensMoreDeath = RecipeUtil.lastIRecipe(); + // + // //Filter + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemFilter), "III", "IQI", "III", 'I', new ItemStack(Blocks.IRON_BARS), 'Q', "gemQuartzBlack"); + // recipeFilter = RecipeUtil.lastIRecipe(); + // + // //Crate Keeper + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemCrateKeeper), "WIW", "IQI", "WIW", 'I', "ingotIron", 'W', "plankWood", 'Q', "gemQuartzBlack"); + // recipeCrateKeeper = RecipeUtil.lastIRecipe(); + // + // //Spawner Changer + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemSpawnerChanger), "MSM", "SDS", "MSM", 'M', new ItemStack(Items.MAGMA_CREAM), 'S', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.SPAWNER_SHARD.ordinal()), 'D', new ItemStack(InitBlocks.blockCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal())); + // recipeSpawnerChanger = RecipeUtil.lastIRecipe(); + // + // //Laser Wrench + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemLaserWrench), "C ", " S ", " S", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'S', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal())); + // recipeLaserWrench = RecipeUtil.lastIRecipe(); + // + // //Rice Stuff + // RecipeHandler.addOreDictRecipe(new ItemStack(Items.PAPER, 3), "R ", " R ", " R", 'R', new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal())); + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMisc, 4, TheMiscItems.RICE_SLIME.ordinal()), " R ", "RBR", " R ", 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RICE_DOUGH.ordinal()), 'B', Items.WATER_BUCKET); + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMisc, 4, TheMiscItems.RICE_SLIME.ordinal()), " R ", "RBR", " R ", 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RICE_DOUGH.ordinal()), 'B', new ItemStack(Items.POTIONITEM)); + // + // //Leaf Blower + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemLeafBlower), " F", "IP", "IC", 'F', new ItemStack(Items.FLINT), 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'P', new ItemStack(Blocks.PISTON), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); + // recipeLeafBlower = RecipeUtil.lastIRecipe(); + // + // //Drill + // ItemStack lightBlueDrill = new ItemStack(InitItems.itemDrill, 1, TheColoredLampColors.LIGHT_BLUE.ordinal()); + // RecipeHandler.addOreDictRecipe(lightBlueDrill.copy(), "DDD", "CRC", "III", 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DRILL_CORE.ordinal()), 'I', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal())); + // recipeDrill = RecipeUtil.lastIRecipe(); + // + // for (int i = 0; i < 16; i++) { + // if (i != TheColoredLampColors.LIGHT_BLUE.ordinal()) { + // new RecipeKeepDataShapeless(new ResourceLocation(ActuallyAdditions.MODID, "dril_color_change" + i), new ItemStack(InitItems.itemDrill, 1, i), new ItemStack(InitItems.itemDrill, 1, Util.WILDCARD), lightBlueDrill.copy(), "dye" + TheColoredLampColors.values()[i].oreName); + // RECIPES_DRILL_COLORING.add(RecipeUtil.lastIRecipe()); + // } + // } + // + // //Drill Core + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DRILL_CORE.ordinal()), "ICI", "CRC", "ICI", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'I', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal())); + // recipeDrillCore = RecipeUtil.lastIRecipe(); + // + // //Tele Staff + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemTeleStaff), " FE", " S ", "SB ", 'F', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()), 'E', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDERPEARL_BLOCK.ordinal()), 'S', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal()), 'B', new ItemStack(InitItems.itemBattery, 1, Util.WILDCARD)); + // recipeStaff = RecipeUtil.lastIRecipe(); + // + // //Drill Speed + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemDrillUpgradeSpeed), "ISI", "SRS", "ISI", 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'S', Items.SUGAR, 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal())); + // recipeDrillSpeedI = RecipeUtil.lastIRecipe(); + // + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemDrillUpgradeSpeedII), "ISI", "SCS", "ISI", 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'S', Items.SUGAR, 'C', Items.CAKE); + // recipeDrillSpeedII = RecipeUtil.lastIRecipe(); + // + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemDrillUpgradeSpeedIII), "ISI", "SFS", "ISI", 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'S', Items.SUGAR, 'F', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal())); + // recipeDrillSpeedIII = RecipeUtil.lastIRecipe(); + // + // //Drill Fortune + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemDrillUpgradeFortune), "ISI", "SRS", "ISI", 'I', Blocks.GLOWSTONE, 'S', Items.REDSTONE, 'R', new ItemStack(InitBlocks.blockCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal())); + // recipeDrillFortuneI = RecipeUtil.lastIRecipe(); + // + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemDrillUpgradeFortuneII), "ISI", "SRS", "ISI", 'I', Blocks.GLOWSTONE, 'S', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.REDSTONE.ordinal()), 'R', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal())); + // recipeDrillFortuneII = RecipeUtil.lastIRecipe(); + // + // //Drill Size + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemDrillUpgradeThreeByThree), "DID", "ICI", "DID", 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal())); + // recipeDrillThree = RecipeUtil.lastIRecipe(); + // + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemDrillUpgradeFiveByFive), "DID", "ICI", "DID", 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); + // recipeDrillFive = RecipeUtil.lastIRecipe(); + // + // //Drill Silk Touch + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemDrillUpgradeSilkTouch), "DSD", "SCS", "DSD", 'D', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.EMERALD.ordinal()), 'S', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); + // recipeDrillSilk = RecipeUtil.lastIRecipe(); + // + // //Drill Placing + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemDrillUpgradeBlockPlacing), "CEC", "RAR", "CEC", 'C', "cobblestone", 'E', Items.PAPER, 'A', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal())); + // recipeDrillPlacing = RecipeUtil.lastIRecipe(); + // + // //Battery + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemBattery), " R ", "ICI", "III", 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); + // recipeBattery = RecipeUtil.lastIRecipe(); + // + // //Double Battery + // new RecipeKeepDataShaped(new ResourceLocation(ActuallyAdditions.MODID, "double_battery"), new ItemStack(InitItems.itemBatteryDouble), new ItemStack(InitItems.itemBattery), " R ", "ICI", "III", 'R', new ItemStack(InitItems.itemBattery), 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); + // recipeBatteryDouble = RecipeUtil.lastIRecipe(); + // + // //Magnet Ring + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMagnetRing), "RIB", "IOI", "BIR", 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'B', new ItemStack(Items.DYE, 1, 4), 'O', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal())); + // recipeMagnetRing = RecipeUtil.lastIRecipe(); + // + // //Growth Ring + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemGrowthRing), "SIS", "IOI", "SIS", 'S', new ItemStack(Items.WHEAT_SEEDS), 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'O', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal())); + // recipeGrowthRing = RecipeUtil.lastIRecipe(); + // + // //Water Ring + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemWaterRemovalRing), "BIB", "IOI", "BIB", 'B', new ItemStack(Items.WATER_BUCKET), 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()), 'O', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal())); + // recipeWaterRing = RecipeUtil.lastIRecipe(); + // + // //Triple Battery + // new RecipeKeepDataShaped(new ResourceLocation(ActuallyAdditions.MODID, "triple_battery"), new ItemStack(InitItems.itemBatteryTriple), new ItemStack(InitItems.itemBatteryDouble), " R ", "ICI", "III", 'R', new ItemStack(InitItems.itemBatteryDouble), 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); + // recipeBatteryTriple = RecipeUtil.lastIRecipe(); + // + // //Quadruple Battery + // new RecipeKeepDataShaped(new ResourceLocation(ActuallyAdditions.MODID, "quadruple_battery"), new ItemStack(InitItems.itemBatteryQuadruple), new ItemStack(InitItems.itemBatteryTriple), " R ", "ICI", "III", 'R', new ItemStack(InitItems.itemBatteryTriple), 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); + // recipeBatteryQuadruple = RecipeUtil.lastIRecipe(); + // + // //Quintuple Battery + // new RecipeKeepDataShaped(new ResourceLocation(ActuallyAdditions.MODID, "quintuple_battery"), new ItemStack(InitItems.itemBatteryQuintuple), new ItemStack(InitItems.itemBatteryQuadruple), " R ", "ICI", "III", 'R', new ItemStack(InitItems.itemBatteryQuadruple), 'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); + // recipeBatteryQuintuple = RecipeUtil.lastIRecipe(); + // + // //Bat Wings + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemWingsOfTheBats), "WNW", "WDW", "WNW", 'W', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.BAT_WING.ordinal()), 'N', new ItemStack(InitBlocks.blockCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()), 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.ENDER_STAR.ordinal())); + // recipeWings = RecipeUtil.lastIRecipe(); + // + // //Coil + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), " R ", "RIR", " R ", 'I', ConfigBoolValues.SUPER_DUPER_HARD_MODE.isEnabled() ? new ItemStack(InitItems.itemMisc, 1, TheMiscItems.ENDER_STAR.ordinal()) : "gemQuartzBlack", 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal())); + // recipeCoil = RecipeUtil.lastIRecipe(); + // + // //Cup + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CUP.ordinal()), "S S", "SCS", "SSS", 'S', "stone", 'C', "cropCoffee"); + // recipeCup = RecipeUtil.lastIRecipe(); + // + // //Resonant Rice + // if (!OreDictionary.getOres("nuggetEnderium", false).isEmpty()) { + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemResonantRice), new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), "nuggetEnderium", Items.GUNPOWDER); + // } + // + // //Advanced Coil + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), "GGG", "GCG", "GGG", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'G', "nuggetGold"); + // recipeCoilAdvanced = RecipeUtil.lastIRecipe(); + // + // //Advanced Leaf Blower + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemLeafBlowerAdvanced), " F", "DP", "DC", 'F', new ItemStack(Items.FLINT), 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'P', new ItemStack(Blocks.PISTON), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal())); + // recipeLeafBlowerAdvanced = RecipeUtil.lastIRecipe(); + // + // //Phantom Connector + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemPhantomConnector), "YE", "EY", "S ", 'Y', Items.ENDER_EYE, 'E', Items.ENDER_PEARL, 'S', "stickWood"); + // recipePhantomConnector = RecipeUtil.lastIRecipe(); + // + // //Player Probe + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemPlayerProbe), "A A", "AIA", "RHR", 'A', new ItemStack(Blocks.IRON_BARS), 'R', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.REDSTONE.ordinal()), 'H', new ItemStack(Items.SKULL, 1, 1), 'I', new ItemStack(Items.IRON_HELMET)); + // recipePlayerProbe = RecipeUtil.lastIRecipe(); + // + // //Quartz + // GameRegistry.addSmelting(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal()), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), 1F); + // + // //Knife + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemKnife), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_BLADE.ordinal()), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_HANDLE.ordinal())); + // recipeKnife = RecipeUtil.lastIRecipe(); + // + // //Crafter on a Stick + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemCrafterOnAStick), new ItemStack(Blocks.CRAFTING_TABLE), new ItemStack(Items.SIGN)); + // + // //Tiny Coal + // if (ConfigBoolValues.TINY_COAL_STUFF.isEnabled()) { + // RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 8, TheMiscItems.TINY_COAL.ordinal()), new ItemStack(Items.COAL)); + // recipeTinyCoal = RecipeUtil.lastIRecipe(); + // RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 8, TheMiscItems.TINY_CHAR.ordinal()), new ItemStack(Items.COAL, 1, 1)); + // recipeTinyChar = RecipeUtil.lastIRecipe(); + // RecipeHandler.addOreDictRecipe(new ItemStack(Items.COAL), "CCC", "C C", "CCC", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.TINY_COAL.ordinal())); + // RecipeHandler.addOreDictRecipe(new ItemStack(Items.COAL, 1, 1), "CCC", "C C", "CCC", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.TINY_CHAR.ordinal())); + // } + // + // //Rice Seeds + // RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemRiceSeed), new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal())); + // + // //Canola Seeds + // RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemCanolaSeed), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal())); + // + // //Rings + // initPotionRingRecipes(); + // + // //Ingots from Dusts + // GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.IRON.ordinal()), new ItemStack(Items.IRON_INGOT), 1F); + // GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.GOLD.ordinal()), new ItemStack(Items.GOLD_INGOT), 1F); + // GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.DIAMOND.ordinal()), new ItemStack(Items.DIAMOND), 1F); + // GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.EMERALD.ordinal()), new ItemStack(Items.EMERALD), 1F); + // GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.LAPIS.ordinal()), new ItemStack(Items.DYE, 1, 4), 1F); + // GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.QUARTZ_BLACK.ordinal()), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), 1F); + // GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.QUARTZ.ordinal()), new ItemStack(Items.QUARTZ), 1F); + // GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.COAL.ordinal()), new ItemStack(Items.COAL), 1F); + // + // } + // + // public static void initPotionRingRecipes() { + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal()), "IGI", "GDG", "IGI", 'G', "ingotGold", 'I', "ingotIron", 'D', "dustGlowstone"); + // recipeRing = RecipeUtil.lastIRecipe(); + // + // addRingRecipeWithStack(ThePotionRings.SPEED.craftingItem, ThePotionRings.SPEED.ordinal()); + // addRingRecipeWithStack(ThePotionRings.HASTE.craftingItem, ThePotionRings.HASTE.ordinal()); + // addRingRecipeWithStack(ThePotionRings.STRENGTH.craftingItem, ThePotionRings.STRENGTH.ordinal()); + // addRingRecipeWithStack(ThePotionRings.JUMP_BOOST.craftingItem, ThePotionRings.JUMP_BOOST.ordinal()); + // addRingRecipeWithStack(ThePotionRings.REGEN.craftingItem, ThePotionRings.REGEN.ordinal()); + // addRingRecipeWithStack(ThePotionRings.RESISTANCE.craftingItem, ThePotionRings.RESISTANCE.ordinal()); + // addRingRecipeWithStack(ThePotionRings.FIRE_RESISTANCE.craftingItem, ThePotionRings.FIRE_RESISTANCE.ordinal()); + // addRingRecipeWithStack(ThePotionRings.WATER_BREATHING.craftingItem, ThePotionRings.WATER_BREATHING.ordinal()); + // addRingRecipeWithStack(ThePotionRings.INVISIBILITY.craftingItem, ThePotionRings.INVISIBILITY.ordinal()); + // addRingRecipeWithStack(ThePotionRings.NIGHT_VISION.craftingItem, ThePotionRings.NIGHT_VISION.ordinal()); + // } + // + // public static void addRingRecipeWithStack(ItemStack mainStack, int meta) { + // ItemStack potion = new ItemStack(Items.POTIONITEM); + // PotionUtils.addPotionToItemStack(potion, PotionTypes.AWKWARD); + // + // RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemPotionRing, 1, meta), mainStack, mainStack, mainStack, mainStack, new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.DIAMOND.ordinal()), new ItemStack(Items.NETHER_WART), potion, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal())); + // RECIPES_POTION_RINGS.add(RecipeUtil.lastIRecipe()); + // + // RecipeHandler.addShapelessRecipe(new ItemStack(InitItems.itemPotionRingAdvanced, 1, meta), new ItemStack(InitItems.itemPotionRing, 1, meta), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.ENDER_STAR.ordinal())); + // RECIPES_POTION_RINGS.add(RecipeUtil.lastIRecipe()); + // } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/MiscCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/MiscCrafting.java index c267f790d..3291847db 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/MiscCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/MiscCrafting.java @@ -10,77 +10,67 @@ package de.ellpeck.actuallyadditions.mod.crafting; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; -import de.ellpeck.actuallyadditions.mod.util.RecipeUtil; -import de.ellpeck.actuallyadditions.mod.util.crafting.RecipeHandler; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; -import net.minecraftforge.fml.common.registry.GameRegistry; - +// TODO: [port] MOVE TO DATA_GENERATOR +@Deprecated public final class MiscCrafting { - - public static final IRecipe[] RECIPES_CRYSTAL_SHARDS = new IRecipe[TheCrystals.values().length]; - public static final IRecipe[] RECIPES_CRYSTAL_SHARDS_BACK = new IRecipe[TheCrystals.values().length]; - - public static final IRecipe[] RECIPES_CRYSTALS = new IRecipe[TheCrystals.values().length]; - public static final IRecipe[] RECIPES_CRYSTAL_BLOCKS = new IRecipe[TheCrystals.values().length]; - - public static final IRecipe[] RECIPES_EMPOWERED_CRYSTALS = new IRecipe[TheCrystals.values().length]; - public static final IRecipe[] RECIPES_EMPOWERED_CRYSTAL_BLOCKS = new IRecipe[TheCrystals.values().length]; - - public static void init() { - - //Bio Coal - GameRegistry.addSmelting(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.BIOMASS.ordinal()), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.BIOCOAL.ordinal()), 1.0F); - - //Crystals - for (int i = 0; i < TheCrystals.values().length; i++) { - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockCrystal, 1, i), "XXX", "XXX", "XXX", 'X', new ItemStack(InitItems.itemCrystal, 1, i)); - RECIPES_CRYSTAL_BLOCKS[i] = RecipeUtil.lastIRecipe(); - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemCrystal, 9, i), new ItemStack(InitBlocks.blockCrystal, 1, i)); - RECIPES_CRYSTALS[i] = RecipeUtil.lastIRecipe(); - - RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockCrystalEmpowered, 1, i), "XXX", "XXX", "XXX", 'X', new ItemStack(InitItems.itemCrystalEmpowered, 1, i)); - RECIPES_EMPOWERED_CRYSTAL_BLOCKS[i] = RecipeUtil.lastIRecipe(); - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemCrystalEmpowered, 9, i), new ItemStack(InitBlocks.blockCrystalEmpowered, 1, i)); - RECIPES_EMPOWERED_CRYSTALS[i] = RecipeUtil.lastIRecipe(); - - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemCrystal, 1, i), "XXX", "XXX", "XXX", 'X', new ItemStack(InitItems.itemCrystalShard, 1, i)); - RECIPES_CRYSTAL_SHARDS[i] = RecipeUtil.lastIRecipe(); - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemCrystalShard, 9, i), new ItemStack(InitItems.itemCrystal, 1, i)); - RECIPES_CRYSTAL_SHARDS_BACK[i] = RecipeUtil.lastIRecipe(); - } - - //Dough - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemMisc, 2, TheMiscItems.DOUGH.ordinal()), "cropWheat", "cropWheat"); - ItemCrafting.recipeDough = RecipeUtil.lastIRecipe(); - - //Rice Dough - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemMisc, 2, TheMiscItems.RICE_DOUGH.ordinal()), new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal())); - ItemCrafting.recipeRiceDough = RecipeUtil.lastIRecipe(); - - //Paper Cone - RecipeHandler.addShapedRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.PAPER_CONE.ordinal()), "P P", " P ", 'P', new ItemStack(Items.PAPER)); - - //Knife Handle - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_HANDLE.ordinal()), "stickWood", new ItemStack(Items.LEATHER)); - ItemCrafting.recipeKnifeHandle = RecipeUtil.lastIRecipe(); - - //Knife Blade - RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_BLADE.ordinal()), "K", "K", "F", 'K', "ingotIron", 'F', new ItemStack(Items.FLINT)); - ItemCrafting.recipeKnifeBlade = RecipeUtil.lastIRecipe(); - - //Ender Star - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.ENDER_STAR.ordinal()), new ItemStack(Items.NETHER_STAR), new ItemStack(Items.DRAGON_BREATH), "gemQuartzBlack", new ItemStack(Items.PRISMARINE_SHARD)); - ItemCrafting.recipeEnderStar = RecipeUtil.lastIRecipe(); - - //Spawner Shard -> ingot - GameRegistry.addSmelting(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.SPAWNER_SHARD.ordinal()), new ItemStack(Items.IRON_INGOT, 2), 5F); - } + // + // public static final IRecipe[] RECIPES_CRYSTAL_SHARDS = new IRecipe[TheCrystals.values().length]; + // public static final IRecipe[] RECIPES_CRYSTAL_SHARDS_BACK = new IRecipe[TheCrystals.values().length]; + // + // public static final IRecipe[] RECIPES_CRYSTALS = new IRecipe[TheCrystals.values().length]; + // public static final IRecipe[] RECIPES_CRYSTAL_BLOCKS = new IRecipe[TheCrystals.values().length]; + // + // public static final IRecipe[] RECIPES_EMPOWERED_CRYSTALS = new IRecipe[TheCrystals.values().length]; + // public static final IRecipe[] RECIPES_EMPOWERED_CRYSTAL_BLOCKS = new IRecipe[TheCrystals.values().length]; + // + // public static void init() { + // + // //Bio Coal + // GameRegistry.addSmelting(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.BIOMASS.ordinal()), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.BIOCOAL.ordinal()), 1.0F); + // + // //Crystals + // for (int i = 0; i < TheCrystals.values().length; i++) { + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockCrystal, 1, i), "XXX", "XXX", "XXX", 'X', new ItemStack(InitItems.itemCrystal, 1, i)); + // RECIPES_CRYSTAL_BLOCKS[i] = RecipeUtil.lastIRecipe(); + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemCrystal, 9, i), new ItemStack(InitBlocks.blockCrystal, 1, i)); + // RECIPES_CRYSTALS[i] = RecipeUtil.lastIRecipe(); + // + // RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockCrystalEmpowered, 1, i), "XXX", "XXX", "XXX", 'X', new ItemStack(InitItems.itemCrystalEmpowered, 1, i)); + // RECIPES_EMPOWERED_CRYSTAL_BLOCKS[i] = RecipeUtil.lastIRecipe(); + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemCrystalEmpowered, 9, i), new ItemStack(InitBlocks.blockCrystalEmpowered, 1, i)); + // RECIPES_EMPOWERED_CRYSTALS[i] = RecipeUtil.lastIRecipe(); + // + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemCrystal, 1, i), "XXX", "XXX", "XXX", 'X', new ItemStack(InitItems.itemCrystalShard, 1, i)); + // RECIPES_CRYSTAL_SHARDS[i] = RecipeUtil.lastIRecipe(); + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemCrystalShard, 9, i), new ItemStack(InitItems.itemCrystal, 1, i)); + // RECIPES_CRYSTAL_SHARDS_BACK[i] = RecipeUtil.lastIRecipe(); + // } + // + // //Dough + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemMisc, 2, TheMiscItems.DOUGH.ordinal()), "cropWheat", "cropWheat"); + // ItemCrafting.recipeDough = RecipeUtil.lastIRecipe(); + // + // //Rice Dough + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemMisc, 2, TheMiscItems.RICE_DOUGH.ordinal()), new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal())); + // ItemCrafting.recipeRiceDough = RecipeUtil.lastIRecipe(); + // + // //Paper Cone + // RecipeHandler.addShapedRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.PAPER_CONE.ordinal()), "P P", " P ", 'P', new ItemStack(Items.PAPER)); + // + // //Knife Handle + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_HANDLE.ordinal()), "stickWood", new ItemStack(Items.LEATHER)); + // ItemCrafting.recipeKnifeHandle = RecipeUtil.lastIRecipe(); + // + // //Knife Blade + // RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_BLADE.ordinal()), "K", "K", "F", 'K', "ingotIron", 'F', new ItemStack(Items.FLINT)); + // ItemCrafting.recipeKnifeBlade = RecipeUtil.lastIRecipe(); + // + // //Ender Star + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.ENDER_STAR.ordinal()), new ItemStack(Items.NETHER_STAR), new ItemStack(Items.DRAGON_BREATH), "gemQuartzBlack", new ItemStack(Items.PRISMARINE_SHARD)); + // ItemCrafting.recipeEnderStar = RecipeUtil.lastIRecipe(); + // + // //Spawner Shard -> ingot + // GameRegistry.addSmelting(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.SPAWNER_SHARD.ordinal()), new ItemStack(Items.IRON_INGOT, 2), 5F); + // } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/RecipeBioMash.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/RecipeBioMash.java index 90a5c51ff..3844c3c00 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/RecipeBioMash.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/RecipeBioMash.java @@ -10,89 +10,78 @@ package de.ellpeck.actuallyadditions.mod.crafting; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.ItemKnife; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; -import de.ellpeck.actuallyadditions.mod.util.StackUtil; -import de.ellpeck.actuallyadditions.mod.util.crafting.RecipeHelper; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemFood; -import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; -import net.minecraft.util.NonNullList; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.MathHelper; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.registries.IForgeRegistryEntry; +// TODO: [port] MOVE TO DATA_GENERATOR +@Deprecated public class RecipeBioMash extends IForgeRegistryEntry.Impl implements IRecipe { - - public RecipeBioMash(ResourceLocation location) { - RecipeHelper.addRecipe(location.getPath(), this); - } - - @Override - public boolean matches(InventoryCrafting inv, World world) { - boolean foundFood = false; - boolean hasKnife = false; - - for (int i = 0; i < inv.getSizeInventory(); i++) { - ItemStack stack = inv.getStackInSlot(i); - if (StackUtil.isValid(stack)) { - if (stack.getItem() instanceof ItemKnife) { - if (hasKnife) { - return false; - } else { - hasKnife = true; - } - } else if (stack.getItem() instanceof ItemFood) { - foundFood = true; - } else { - return false; - } - } - } - - return foundFood && hasKnife; - } - - @Override - public ItemStack getCraftingResult(InventoryCrafting inv) { - int amount = 0; - - for (int i = 0; i < inv.getSizeInventory(); i++) { - ItemStack stack = inv.getStackInSlot(i); - if (StackUtil.isValid(stack)) { - if (stack.getItem() instanceof ItemFood) { - ItemFood food = (ItemFood) stack.getItem(); - float heal = food.getHealAmount(stack); - float sat = food.getSaturationModifier(stack); - - amount += MathHelper.ceil(heal * sat); - } - } - } - - if (amount > 0 && amount <= 64) { - return new ItemStack(InitItems.itemMisc, amount, TheMiscItems.MASHED_FOOD.ordinal()); - } else { - return StackUtil.getEmpty(); - } - } - - @Override - public boolean canFit(int width, int height) { - return width * height > 5; - } - - @Override - public ItemStack getRecipeOutput() { - return StackUtil.getEmpty(); - } - - @Override - public NonNullList getRemainingItems(InventoryCrafting inv) { - return ForgeHooks.defaultRecipeGetRemainingItems(inv); - } + // + // public RecipeBioMash(ResourceLocation location) { + // RecipeHelper.addRecipe(location.getPath(), this); + // } + // + // @Override + // public boolean matches(InventoryCrafting inv, World world) { + // boolean foundFood = false; + // boolean hasKnife = false; + // + // for (int i = 0; i < inv.getSizeInventory(); i++) { + // ItemStack stack = inv.getStackInSlot(i); + // if (StackUtil.isValid(stack)) { + // if (stack.getItem() instanceof ItemKnife) { + // if (hasKnife) { + // return false; + // } else { + // hasKnife = true; + // } + // } else if (stack.getItem() instanceof ItemFood) { + // foundFood = true; + // } else { + // return false; + // } + // } + // } + // + // return foundFood && hasKnife; + // } + // + // @Override + // public ItemStack getCraftingResult(InventoryCrafting inv) { + // int amount = 0; + // + // for (int i = 0; i < inv.getSizeInventory(); i++) { + // ItemStack stack = inv.getStackInSlot(i); + // if (StackUtil.isValid(stack)) { + // if (stack.getItem() instanceof ItemFood) { + // ItemFood food = (ItemFood) stack.getItem(); + // float heal = food.getHealAmount(stack); + // float sat = food.getSaturationModifier(stack); + // + // amount += MathHelper.ceil(heal * sat); + // } + // } + // } + // + // if (amount > 0 && amount <= 64) { + // return new ItemStack(InitItems.itemMisc, amount, TheMiscItems.MASHED_FOOD.ordinal()); + // } else { + // return StackUtil.getEmpty(); + // } + // } + // + // @Override + // public boolean canFit(int width, int height) { + // return width * height > 5; + // } + // + // @Override + // public ItemStack getRecipeOutput() { + // return StackUtil.getEmpty(); + // } + // + // @Override + // public NonNullList getRemainingItems(InventoryCrafting inv) { + // return ForgeHooks.defaultRecipeGetRemainingItems(inv); + // } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/RecipeKeepDataShaped.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/RecipeKeepDataShaped.java index 58300bf8e..0426c8675 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/RecipeKeepDataShaped.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/RecipeKeepDataShaped.java @@ -10,38 +10,34 @@ package de.ellpeck.actuallyadditions.mod.crafting; -import de.ellpeck.actuallyadditions.mod.util.ItemUtil; -import de.ellpeck.actuallyadditions.mod.util.StackUtil; -import de.ellpeck.actuallyadditions.mod.util.crafting.RecipeHelper; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.oredict.ShapedOreRecipe; +// TODO: [port] MOVE TO DATA_GENERATOR +@Deprecated public class RecipeKeepDataShaped extends ShapedOreRecipe { - - private final ItemStack nbtCopyStack; - - public RecipeKeepDataShaped(ResourceLocation group, ItemStack result, ItemStack nbtCopyStack, Object... recipe) { - super(group, result, recipe); - this.nbtCopyStack = nbtCopyStack; - - RecipeHelper.addRecipe(group.getPath(), this); - } - - @Override - public ItemStack getCraftingResult(InventoryCrafting inventory) { - ItemStack stack = super.getCraftingResult(inventory); - if (StackUtil.isValid(stack)) { - for (int i = 0; i < inventory.getSizeInventory(); i++) { - ItemStack input = inventory.getStackInSlot(i); - if (ItemUtil.areItemsEqual(this.nbtCopyStack, input, true)) { - stack.setTagCompound(input.getTagCompound()); - break; - } - } - } - return stack; - } + // + // private final ItemStack nbtCopyStack; + // + // public RecipeKeepDataShaped(ResourceLocation group, ItemStack result, ItemStack nbtCopyStack, Object... recipe) { + // super(group, result, recipe); + // this.nbtCopyStack = nbtCopyStack; + // + // RecipeHelper.addRecipe(group.getPath(), this); + // } + // + // @Override + // public ItemStack getCraftingResult(InventoryCrafting inventory) { + // ItemStack stack = super.getCraftingResult(inventory); + // if (StackUtil.isValid(stack)) { + // for (int i = 0; i < inventory.getSizeInventory(); i++) { + // ItemStack input = inventory.getStackInSlot(i); + // if (ItemUtil.areItemsEqual(this.nbtCopyStack, input, true)) { + // stack.setTagCompound(input.getTagCompound()); + // break; + // } + // } + // } + // return stack; + // } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/RecipeKeepDataShapeless.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/RecipeKeepDataShapeless.java index fd85a8b56..d7194433e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/RecipeKeepDataShapeless.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/RecipeKeepDataShapeless.java @@ -10,37 +10,33 @@ package de.ellpeck.actuallyadditions.mod.crafting; -import de.ellpeck.actuallyadditions.mod.util.ItemUtil; -import de.ellpeck.actuallyadditions.mod.util.StackUtil; -import de.ellpeck.actuallyadditions.mod.util.crafting.RecipeHelper; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.oredict.ShapelessOreRecipe; +// TODO: [port] MOVE TO DATA_GENERATOR +@Deprecated public class RecipeKeepDataShapeless extends ShapelessOreRecipe { - - private final ItemStack nbtCopyStack; - - public RecipeKeepDataShapeless(ResourceLocation group, ItemStack result, ItemStack nbtCopyStack, Object... recipe) { - super(group, result, recipe); - this.nbtCopyStack = nbtCopyStack; - - RecipeHelper.addRecipe(group.getPath(), this); - } - - @Override - public ItemStack getCraftingResult(InventoryCrafting inventory) { - ItemStack stack = super.getCraftingResult(inventory); - if (StackUtil.isValid(stack)) { - for (int i = 0; i < inventory.getSizeInventory(); i++) { - ItemStack input = inventory.getStackInSlot(i); - if (ItemUtil.areItemsEqual(this.nbtCopyStack, input, true)) { - stack.setTagCompound(input.getTagCompound()); - break; - } - } - } - return stack; - } + // + // private final ItemStack nbtCopyStack; + // + // public RecipeKeepDataShapeless(ResourceLocation group, ItemStack result, ItemStack nbtCopyStack, Object... recipe) { + // super(group, result, recipe); + // this.nbtCopyStack = nbtCopyStack; + // + // RecipeHelper.addRecipe(group.getPath(), this); + // } + // + // @Override + // public ItemStack getCraftingResult(InventoryCrafting inventory) { + // ItemStack stack = super.getCraftingResult(inventory); + // if (StackUtil.isValid(stack)) { + // for (int i = 0; i < inventory.getSizeInventory(); i++) { + // ItemStack input = inventory.getStackInSlot(i); + // if (ItemUtil.areItemsEqual(this.nbtCopyStack, input, true)) { + // stack.setTagCompound(input.getTagCompound()); + // break; + // } + // } + // } + // return stack; + // } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/RecipePotionRingCharging.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/RecipePotionRingCharging.java index 856eaba76..41c48c995 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/RecipePotionRingCharging.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/RecipePotionRingCharging.java @@ -10,86 +10,78 @@ package de.ellpeck.actuallyadditions.mod.crafting; -import de.ellpeck.actuallyadditions.mod.items.ItemPotionRing; -import de.ellpeck.actuallyadditions.mod.util.StackUtil; -import de.ellpeck.actuallyadditions.mod.util.crafting.RecipeHelper; -import net.minecraft.init.Items; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; -import net.minecraft.util.NonNullList; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.registries.IForgeRegistryEntry; +// TODO: [port] MOVE TO DATA_GENERATOR +@Deprecated public class RecipePotionRingCharging extends IForgeRegistryEntry.Impl implements IRecipe { - - public RecipePotionRingCharging(ResourceLocation location) { - RecipeHelper.addRecipe(location.getPath(), this); - } - - @Override - public boolean matches(InventoryCrafting inv, World worldIn) { - boolean hasRing = false; - - for (int i = 0; i < inv.getSizeInventory(); i++) { - ItemStack stack = inv.getStackInSlot(i); - if (StackUtil.isValid(stack)) { - if (stack.getItem() instanceof ItemPotionRing) { - if (!hasRing) { - hasRing = true; - } else { - return false; - } - } else if (stack.getItem() != Items.BLAZE_POWDER) { return false; } - } - } - - return hasRing; - } - - @Override - public ItemStack getCraftingResult(InventoryCrafting inv) { - ItemStack inputRing = StackUtil.getEmpty(); - int totalBlaze = 0; - - for (int i = 0; i < inv.getSizeInventory(); i++) { - ItemStack stack = inv.getStackInSlot(i); - if (StackUtil.isValid(stack)) { - if (stack.getItem() instanceof ItemPotionRing) { - inputRing = stack; - } else if (stack.getItem() == Items.BLAZE_POWDER) { - totalBlaze += 20; - } - } - } - - if (StackUtil.isValid(inputRing) && totalBlaze > 0) { - ItemStack copy = inputRing.copy(); - - int total = ItemPotionRing.getStoredBlaze(copy) + totalBlaze; - if (total <= ItemPotionRing.MAX_BLAZE) { - ItemPotionRing.setStoredBlaze(copy, total); - return copy; - } - } - - return StackUtil.getEmpty(); - } - - @Override - public boolean canFit(int width, int height) { - return width * height > 3; - } - - @Override - public ItemStack getRecipeOutput() { - return StackUtil.getEmpty(); - } - - @Override - public NonNullList getRemainingItems(InventoryCrafting inv) { - return ForgeHooks.defaultRecipeGetRemainingItems(inv); - } + // + // public RecipePotionRingCharging(ResourceLocation location) { + // RecipeHelper.addRecipe(location.getPath(), this); + // } + // + // @Override + // public boolean matches(InventoryCrafting inv, World worldIn) { + // boolean hasRing = false; + // + // for (int i = 0; i < inv.getSizeInventory(); i++) { + // ItemStack stack = inv.getStackInSlot(i); + // if (StackUtil.isValid(stack)) { + // if (stack.getItem() instanceof ItemPotionRing) { + // if (!hasRing) { + // hasRing = true; + // } else { + // return false; + // } + // } else if (stack.getItem() != Items.BLAZE_POWDER) { return false; } + // } + // } + // + // return hasRing; + // } + // + // @Override + // public ItemStack getCraftingResult(InventoryCrafting inv) { + // ItemStack inputRing = StackUtil.getEmpty(); + // int totalBlaze = 0; + // + // for (int i = 0; i < inv.getSizeInventory(); i++) { + // ItemStack stack = inv.getStackInSlot(i); + // if (StackUtil.isValid(stack)) { + // if (stack.getItem() instanceof ItemPotionRing) { + // inputRing = stack; + // } else if (stack.getItem() == Items.BLAZE_POWDER) { + // totalBlaze += 20; + // } + // } + // } + // + // if (StackUtil.isValid(inputRing) && totalBlaze > 0) { + // ItemStack copy = inputRing.copy(); + // + // int total = ItemPotionRing.getStoredBlaze(copy) + totalBlaze; + // if (total <= ItemPotionRing.MAX_BLAZE) { + // ItemPotionRing.setStoredBlaze(copy, total); + // return copy; + // } + // } + // + // return StackUtil.getEmpty(); + // } + // + // @Override + // public boolean canFit(int width, int height) { + // return width * height > 3; + // } + // + // @Override + // public ItemStack getRecipeOutput() { + // return StackUtil.getEmpty(); + // } + // + // @Override + // public NonNullList getRemainingItems(InventoryCrafting inv) { + // return ForgeHooks.defaultRecipeGetRemainingItems(inv); + // } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ToolCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ToolCrafting.java index 2093c6531..0cf8f67e5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ToolCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ToolCrafting.java @@ -10,93 +10,83 @@ package de.ellpeck.actuallyadditions.mod.crafting; -import java.util.ArrayList; - -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; -import de.ellpeck.actuallyadditions.mod.util.RecipeUtil; -import de.ellpeck.actuallyadditions.mod.util.crafting.RecipeHandler; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; - +// TODO: [port] MOVE TO DATA_GENERATOR +@Deprecated public final class ToolCrafting { - - public static final ArrayList RECIPES_PAXELS = new ArrayList<>(); - - public static void init() { - - addToolAndArmorRecipes(new ItemStack(Items.EMERALD), InitItems.itemPickaxeEmerald, InitItems.itemSwordEmerald, InitItems.itemAxeEmerald, InitItems.itemShovelEmerald, InitItems.itemHoeEmerald, InitItems.itemHelmEmerald, InitItems.itemChestEmerald, InitItems.itemPantsEmerald, InitItems.itemBootsEmerald); - addToolAndArmorRecipes("gemQuartzBlack", InitItems.itemPickaxeQuartz, InitItems.itemSwordQuartz, InitItems.itemAxeQuartz, InitItems.itemShovelQuartz, InitItems.itemHoeQuartz, InitItems.itemHelmQuartz, InitItems.itemChestQuartz, InitItems.itemPantsQuartz, InitItems.itemBootsQuartz); - addToolAndArmorRecipes(new ItemStack(Blocks.OBSIDIAN), InitItems.itemPickaxeObsidian, InitItems.itemSwordObsidian, InitItems.itemAxeObsidian, InitItems.itemShovelObsidian, InitItems.itemHoeObsidian, InitItems.itemHelmObsidian, InitItems.itemChestObsidian, InitItems.itemPantsObsidian, InitItems.itemBootsObsidian); - - addToolAndArmorRecipes(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), InitItems.itemPickaxeCrystalRed, InitItems.itemSwordCrystalRed, InitItems.itemAxeCrystalRed, InitItems.itemShovelCrystalRed, InitItems.itemHoeCrystalRed, InitItems.itemHelmCrystalRed, InitItems.itemChestCrystalRed, InitItems.itemPantsCrystalRed, InitItems.itemBootsCrystalRed); - addToolAndArmorRecipes(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), InitItems.itemPickaxeCrystalGreen, InitItems.itemSwordCrystalGreen, InitItems.itemAxeCrystalGreen, InitItems.itemShovelCrystalGreen, InitItems.itemHoeCrystalGreen, InitItems.itemHelmCrystalGreen, InitItems.itemChestCrystalGreen, InitItems.itemPantsCrystalGreen, InitItems.itemBootsCrystalGreen); - addToolAndArmorRecipes(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), InitItems.itemPickaxeCrystalWhite, InitItems.itemSwordCrystalWhite, InitItems.itemAxeCrystalWhite, InitItems.itemShovelCrystalWhite, InitItems.itemHoeCrystalWhite, InitItems.itemHelmCrystalWhite, InitItems.itemChestCrystalWhite, InitItems.itemPantsCrystalWhite, InitItems.itemBootsCrystalWhite); - addToolAndArmorRecipes(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), InitItems.itemPickaxeCrystalLightBlue, InitItems.itemSwordCrystalLightBlue, InitItems.itemAxeCrystalLightBlue, InitItems.itemShovelCrystalLightBlue, InitItems.itemHoeCrystalLightBlue, InitItems.itemHelmCrystalLightBlue, InitItems.itemChestCrystalLightBlue, InitItems.itemPantsCrystalLightBlue, InitItems.itemBootsCrystalLightBlue); - addToolAndArmorRecipes(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), InitItems.itemPickaxeCrystalBlue, InitItems.itemSwordCrystalBlue, InitItems.itemAxeCrystalBlue, InitItems.itemShovelCrystalBlue, InitItems.itemHoeCrystalBlue, InitItems.itemHelmCrystalBlue, InitItems.itemChestCrystalBlue, InitItems.itemPantsCrystalBlue, InitItems.itemBootsCrystalBlue); - addToolAndArmorRecipes(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), InitItems.itemPickaxeCrystalBlack, InitItems.itemSwordCrystalBlack, InitItems.itemAxeCrystalBlack, InitItems.itemShovelCrystalBlack, InitItems.itemHoeCrystalBlack, InitItems.itemHelmCrystalBlack, InitItems.itemChestCrystalBlack, InitItems.itemPantsCrystalBlack, InitItems.itemBootsCrystalBlack); - - //Paxels - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.woodenPaxel), new ItemStack(Items.WOODEN_AXE), new ItemStack(Items.WOODEN_PICKAXE), new ItemStack(Items.WOODEN_SHOVEL), new ItemStack(Items.WOODEN_SWORD), new ItemStack(Items.WOODEN_HOE)); - RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.stonePaxel), new ItemStack(Items.STONE_AXE), new ItemStack(Items.STONE_PICKAXE), new ItemStack(Items.STONE_SHOVEL), new ItemStack(Items.STONE_SWORD), new ItemStack(Items.STONE_HOE)); - RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.ironPaxel), new ItemStack(Items.IRON_AXE), new ItemStack(Items.IRON_PICKAXE), new ItemStack(Items.IRON_SHOVEL), new ItemStack(Items.IRON_SWORD), new ItemStack(Items.IRON_HOE)); - RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.goldPaxel), new ItemStack(Items.GOLDEN_AXE), new ItemStack(Items.GOLDEN_PICKAXE), new ItemStack(Items.GOLDEN_SHOVEL), new ItemStack(Items.GOLDEN_SWORD), new ItemStack(Items.GOLDEN_HOE)); - RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.diamondPaxel), new ItemStack(Items.DIAMOND_AXE), new ItemStack(Items.DIAMOND_PICKAXE), new ItemStack(Items.DIAMOND_SHOVEL), new ItemStack(Items.DIAMOND_SWORD), new ItemStack(Items.DIAMOND_HOE)); - RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.emeraldPaxel), new ItemStack(InitItems.itemAxeEmerald), new ItemStack(InitItems.itemPickaxeEmerald), new ItemStack(InitItems.itemSwordEmerald), new ItemStack(InitItems.itemShovelEmerald), new ItemStack(InitItems.itemHoeEmerald)); - RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.obsidianPaxel), new ItemStack(InitItems.itemAxeObsidian), new ItemStack(InitItems.itemPickaxeObsidian), new ItemStack(InitItems.itemSwordObsidian), new ItemStack(InitItems.itemShovelObsidian), new ItemStack(InitItems.itemHoeObsidian)); - RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.quartzPaxel), new ItemStack(InitItems.itemAxeQuartz), new ItemStack(InitItems.itemPickaxeQuartz), new ItemStack(InitItems.itemSwordQuartz), new ItemStack(InitItems.itemShovelQuartz), new ItemStack(InitItems.itemHoeQuartz)); - RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); - - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemPaxelCrystalRed), new ItemStack(InitItems.itemAxeCrystalRed), new ItemStack(InitItems.itemPickaxeCrystalRed), new ItemStack(InitItems.itemSwordCrystalRed), new ItemStack(InitItems.itemShovelCrystalRed), new ItemStack(InitItems.itemHoeCrystalRed)); - RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemPaxelCrystalGreen), new ItemStack(InitItems.itemAxeCrystalGreen), new ItemStack(InitItems.itemPickaxeCrystalGreen), new ItemStack(InitItems.itemSwordCrystalGreen), new ItemStack(InitItems.itemShovelCrystalGreen), new ItemStack(InitItems.itemHoeCrystalGreen)); - RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemPaxelCrystalBlue), new ItemStack(InitItems.itemAxeCrystalBlue), new ItemStack(InitItems.itemPickaxeCrystalBlue), new ItemStack(InitItems.itemSwordCrystalBlue), new ItemStack(InitItems.itemShovelCrystalBlue), new ItemStack(InitItems.itemHoeCrystalBlue)); - RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemPaxelCrystalLightBlue), new ItemStack(InitItems.itemAxeCrystalLightBlue), new ItemStack(InitItems.itemPickaxeCrystalLightBlue), new ItemStack(InitItems.itemSwordCrystalLightBlue), new ItemStack(InitItems.itemShovelCrystalLightBlue), new ItemStack(InitItems.itemHoeCrystalLightBlue)); - RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemPaxelCrystalBlack), new ItemStack(InitItems.itemAxeCrystalBlack), new ItemStack(InitItems.itemPickaxeCrystalBlack), new ItemStack(InitItems.itemSwordCrystalBlack), new ItemStack(InitItems.itemShovelCrystalBlack), new ItemStack(InitItems.itemHoeCrystalBlack)); - RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); - RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemPaxelCrystalWhite), new ItemStack(InitItems.itemAxeCrystalWhite), new ItemStack(InitItems.itemPickaxeCrystalWhite), new ItemStack(InitItems.itemSwordCrystalWhite), new ItemStack(InitItems.itemShovelCrystalWhite), new ItemStack(InitItems.itemHoeCrystalWhite)); - RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); - } - - public static void addToolAndArmorRecipes(Object base, Item pickaxe, Item sword, Item axe, Item shovel, Item hoe, Item helm, Item chest, Item pants, Item boots) { - //Pickaxe - RecipeHandler.addOreDictRecipe(new ItemStack(pickaxe), "EEE", " S ", " S ", 'E', base, 'S', new ItemStack(Items.STICK)); - - //Sword - RecipeHandler.addOreDictRecipe(new ItemStack(sword), "E", "E", "S", 'E', base, 'S', new ItemStack(Items.STICK)); - - //Axe - RecipeHandler.addOreDictRecipe(new ItemStack(axe), "EE", "ES", " S", 'E', base, 'S', new ItemStack(Items.STICK)); - - //Shovel - RecipeHandler.addOreDictRecipe(new ItemStack(shovel), "E", "S", "S", 'E', base, 'S', new ItemStack(Items.STICK)); - - //Hoe - RecipeHandler.addOreDictRecipe(new ItemStack(hoe), "EE", " S", " S", 'E', base, 'S', new ItemStack(Items.STICK)); - - //Helm - RecipeHandler.addShapedRecipe(new ItemStack(helm), "OOO", "O O", 'O', base); - - //Chest - RecipeHandler.addShapedRecipe(new ItemStack(chest), "O O", "OOO", "OOO", 'O', base); - - //Legs - RecipeHandler.addShapedRecipe(new ItemStack(pants), "OOO", "O O", "O O", 'O', base); - - //Boots - RecipeHandler.addShapedRecipe(new ItemStack(boots), "O O", "O O", 'O', base); - } + // + // public static final ArrayList RECIPES_PAXELS = new ArrayList<>(); + // + // public static void init() { + // + // addToolAndArmorRecipes(new ItemStack(Items.EMERALD), InitItems.itemPickaxeEmerald, InitItems.itemSwordEmerald, InitItems.itemAxeEmerald, InitItems.itemShovelEmerald, InitItems.itemHoeEmerald, InitItems.itemHelmEmerald, InitItems.itemChestEmerald, InitItems.itemPantsEmerald, InitItems.itemBootsEmerald); + // addToolAndArmorRecipes("gemQuartzBlack", InitItems.itemPickaxeQuartz, InitItems.itemSwordQuartz, InitItems.itemAxeQuartz, InitItems.itemShovelQuartz, InitItems.itemHoeQuartz, InitItems.itemHelmQuartz, InitItems.itemChestQuartz, InitItems.itemPantsQuartz, InitItems.itemBootsQuartz); + // addToolAndArmorRecipes(new ItemStack(Blocks.OBSIDIAN), InitItems.itemPickaxeObsidian, InitItems.itemSwordObsidian, InitItems.itemAxeObsidian, InitItems.itemShovelObsidian, InitItems.itemHoeObsidian, InitItems.itemHelmObsidian, InitItems.itemChestObsidian, InitItems.itemPantsObsidian, InitItems.itemBootsObsidian); + // + // addToolAndArmorRecipes(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), InitItems.itemPickaxeCrystalRed, InitItems.itemSwordCrystalRed, InitItems.itemAxeCrystalRed, InitItems.itemShovelCrystalRed, InitItems.itemHoeCrystalRed, InitItems.itemHelmCrystalRed, InitItems.itemChestCrystalRed, InitItems.itemPantsCrystalRed, InitItems.itemBootsCrystalRed); + // addToolAndArmorRecipes(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), InitItems.itemPickaxeCrystalGreen, InitItems.itemSwordCrystalGreen, InitItems.itemAxeCrystalGreen, InitItems.itemShovelCrystalGreen, InitItems.itemHoeCrystalGreen, InitItems.itemHelmCrystalGreen, InitItems.itemChestCrystalGreen, InitItems.itemPantsCrystalGreen, InitItems.itemBootsCrystalGreen); + // addToolAndArmorRecipes(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), InitItems.itemPickaxeCrystalWhite, InitItems.itemSwordCrystalWhite, InitItems.itemAxeCrystalWhite, InitItems.itemShovelCrystalWhite, InitItems.itemHoeCrystalWhite, InitItems.itemHelmCrystalWhite, InitItems.itemChestCrystalWhite, InitItems.itemPantsCrystalWhite, InitItems.itemBootsCrystalWhite); + // addToolAndArmorRecipes(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), InitItems.itemPickaxeCrystalLightBlue, InitItems.itemSwordCrystalLightBlue, InitItems.itemAxeCrystalLightBlue, InitItems.itemShovelCrystalLightBlue, InitItems.itemHoeCrystalLightBlue, InitItems.itemHelmCrystalLightBlue, InitItems.itemChestCrystalLightBlue, InitItems.itemPantsCrystalLightBlue, InitItems.itemBootsCrystalLightBlue); + // addToolAndArmorRecipes(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), InitItems.itemPickaxeCrystalBlue, InitItems.itemSwordCrystalBlue, InitItems.itemAxeCrystalBlue, InitItems.itemShovelCrystalBlue, InitItems.itemHoeCrystalBlue, InitItems.itemHelmCrystalBlue, InitItems.itemChestCrystalBlue, InitItems.itemPantsCrystalBlue, InitItems.itemBootsCrystalBlue); + // addToolAndArmorRecipes(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), InitItems.itemPickaxeCrystalBlack, InitItems.itemSwordCrystalBlack, InitItems.itemAxeCrystalBlack, InitItems.itemShovelCrystalBlack, InitItems.itemHoeCrystalBlack, InitItems.itemHelmCrystalBlack, InitItems.itemChestCrystalBlack, InitItems.itemPantsCrystalBlack, InitItems.itemBootsCrystalBlack); + // + // //Paxels + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.woodenPaxel), new ItemStack(Items.WOODEN_AXE), new ItemStack(Items.WOODEN_PICKAXE), new ItemStack(Items.WOODEN_SHOVEL), new ItemStack(Items.WOODEN_SWORD), new ItemStack(Items.WOODEN_HOE)); + // RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.stonePaxel), new ItemStack(Items.STONE_AXE), new ItemStack(Items.STONE_PICKAXE), new ItemStack(Items.STONE_SHOVEL), new ItemStack(Items.STONE_SWORD), new ItemStack(Items.STONE_HOE)); + // RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.ironPaxel), new ItemStack(Items.IRON_AXE), new ItemStack(Items.IRON_PICKAXE), new ItemStack(Items.IRON_SHOVEL), new ItemStack(Items.IRON_SWORD), new ItemStack(Items.IRON_HOE)); + // RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.goldPaxel), new ItemStack(Items.GOLDEN_AXE), new ItemStack(Items.GOLDEN_PICKAXE), new ItemStack(Items.GOLDEN_SHOVEL), new ItemStack(Items.GOLDEN_SWORD), new ItemStack(Items.GOLDEN_HOE)); + // RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.diamondPaxel), new ItemStack(Items.DIAMOND_AXE), new ItemStack(Items.DIAMOND_PICKAXE), new ItemStack(Items.DIAMOND_SHOVEL), new ItemStack(Items.DIAMOND_SWORD), new ItemStack(Items.DIAMOND_HOE)); + // RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.emeraldPaxel), new ItemStack(InitItems.itemAxeEmerald), new ItemStack(InitItems.itemPickaxeEmerald), new ItemStack(InitItems.itemSwordEmerald), new ItemStack(InitItems.itemShovelEmerald), new ItemStack(InitItems.itemHoeEmerald)); + // RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.obsidianPaxel), new ItemStack(InitItems.itemAxeObsidian), new ItemStack(InitItems.itemPickaxeObsidian), new ItemStack(InitItems.itemSwordObsidian), new ItemStack(InitItems.itemShovelObsidian), new ItemStack(InitItems.itemHoeObsidian)); + // RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.quartzPaxel), new ItemStack(InitItems.itemAxeQuartz), new ItemStack(InitItems.itemPickaxeQuartz), new ItemStack(InitItems.itemSwordQuartz), new ItemStack(InitItems.itemShovelQuartz), new ItemStack(InitItems.itemHoeQuartz)); + // RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); + // + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemPaxelCrystalRed), new ItemStack(InitItems.itemAxeCrystalRed), new ItemStack(InitItems.itemPickaxeCrystalRed), new ItemStack(InitItems.itemSwordCrystalRed), new ItemStack(InitItems.itemShovelCrystalRed), new ItemStack(InitItems.itemHoeCrystalRed)); + // RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemPaxelCrystalGreen), new ItemStack(InitItems.itemAxeCrystalGreen), new ItemStack(InitItems.itemPickaxeCrystalGreen), new ItemStack(InitItems.itemSwordCrystalGreen), new ItemStack(InitItems.itemShovelCrystalGreen), new ItemStack(InitItems.itemHoeCrystalGreen)); + // RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemPaxelCrystalBlue), new ItemStack(InitItems.itemAxeCrystalBlue), new ItemStack(InitItems.itemPickaxeCrystalBlue), new ItemStack(InitItems.itemSwordCrystalBlue), new ItemStack(InitItems.itemShovelCrystalBlue), new ItemStack(InitItems.itemHoeCrystalBlue)); + // RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemPaxelCrystalLightBlue), new ItemStack(InitItems.itemAxeCrystalLightBlue), new ItemStack(InitItems.itemPickaxeCrystalLightBlue), new ItemStack(InitItems.itemSwordCrystalLightBlue), new ItemStack(InitItems.itemShovelCrystalLightBlue), new ItemStack(InitItems.itemHoeCrystalLightBlue)); + // RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemPaxelCrystalBlack), new ItemStack(InitItems.itemAxeCrystalBlack), new ItemStack(InitItems.itemPickaxeCrystalBlack), new ItemStack(InitItems.itemSwordCrystalBlack), new ItemStack(InitItems.itemShovelCrystalBlack), new ItemStack(InitItems.itemHoeCrystalBlack)); + // RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); + // RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitItems.itemPaxelCrystalWhite), new ItemStack(InitItems.itemAxeCrystalWhite), new ItemStack(InitItems.itemPickaxeCrystalWhite), new ItemStack(InitItems.itemSwordCrystalWhite), new ItemStack(InitItems.itemShovelCrystalWhite), new ItemStack(InitItems.itemHoeCrystalWhite)); + // RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); + // } + // + // public static void addToolAndArmorRecipes(Object base, Item pickaxe, Item sword, Item axe, Item shovel, Item hoe, Item helm, Item chest, Item pants, Item boots) { + // //Pickaxe + // RecipeHandler.addOreDictRecipe(new ItemStack(pickaxe), "EEE", " S ", " S ", 'E', base, 'S', new ItemStack(Items.STICK)); + // + // //Sword + // RecipeHandler.addOreDictRecipe(new ItemStack(sword), "E", "E", "S", 'E', base, 'S', new ItemStack(Items.STICK)); + // + // //Axe + // RecipeHandler.addOreDictRecipe(new ItemStack(axe), "EE", "ES", " S", 'E', base, 'S', new ItemStack(Items.STICK)); + // + // //Shovel + // RecipeHandler.addOreDictRecipe(new ItemStack(shovel), "E", "S", "S", 'E', base, 'S', new ItemStack(Items.STICK)); + // + // //Hoe + // RecipeHandler.addOreDictRecipe(new ItemStack(hoe), "EE", " S", " S", 'E', base, 'S', new ItemStack(Items.STICK)); + // + // //Helm + // RecipeHandler.addShapedRecipe(new ItemStack(helm), "OOO", "O O", 'O', base); + // + // //Chest + // RecipeHandler.addShapedRecipe(new ItemStack(chest), "O O", "OOO", "OOO", 'O', base); + // + // //Legs + // RecipeHandler.addShapedRecipe(new ItemStack(pants), "OOO", "O O", "O O", 'O', base); + // + // //Boots + // RecipeHandler.addShapedRecipe(new ItemStack(boots), "O O", "O O", 'O', base); + // } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java index 35e8dd175..1810d7e1c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java @@ -34,7 +34,6 @@ import net.minecraft.util.text.TextFormatting; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.TickEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; @@ -47,10 +46,6 @@ public class ClientEvents { private static EnergyDisplay energyDisplay; - public ClientEvents() { - MinecraftForge.EVENT_BUS.register(this); - } - // TODO: [port] the fuck? @SubscribeEvent public void onClientTick(TickEvent.ClientTickEvent event) { @@ -179,7 +174,7 @@ public class ClientEvents { if (StackUtil.isValid(stack)) { if (stack.getItem() instanceof IHudDisplay) { - ((IHudDisplay) stack.getItem()).displayHud(minecraft, player, stack, posHit, event.getWindow()); + ((IHudDisplay) stack.getItem()).displayHud(event.getMatrixStack(), minecraft, player, stack, posHit, event.getWindow()); } } @@ -189,7 +184,7 @@ public class ClientEvents { TileEntity tileHit = minecraft.world.getTileEntity(rayCast.getPos()); if (blockHit instanceof IHudDisplay) { - ((IHudDisplay) blockHit).displayHud(minecraft, player, stack, posHit, event.getWindow()); + ((IHudDisplay) blockHit).displayHud(event.getMatrixStack(), minecraft, player, stack, posHit, event.getWindow()); } if (tileHit instanceof TileEntityBase) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/InitVillager.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/InitVillager.java index d971d04c5..a25d92e8d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/InitVillager.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/InitVillager.java @@ -10,79 +10,59 @@ package de.ellpeck.actuallyadditions.mod.gen.village; -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks; -import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; -import de.ellpeck.actuallyadditions.mod.gen.village.component.VillageComponentCustomCropField; -import de.ellpeck.actuallyadditions.mod.gen.village.component.VillageComponentEngineerHouse; -import de.ellpeck.actuallyadditions.mod.gen.village.component.VillageComponentJamHouse; -import de.ellpeck.actuallyadditions.mod.gen.village.component.handler.VillageCustomCropFieldHandler; -import de.ellpeck.actuallyadditions.mod.gen.village.component.handler.VillageEngineerHouseHandler; -import de.ellpeck.actuallyadditions.mod.gen.village.component.handler.VillageJamHouseHandler; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheJams; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; -import net.minecraft.entity.passive.EntityVillager.PriceInfo; -import net.minecraft.item.ItemStack; -import net.minecraft.world.gen.structure.MapGenStructureIO; -import net.minecraftforge.fml.common.registry.VillagerRegistry; -import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerCareer; -import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession; - +// TODO: [port] ADD BACK public final class InitVillager { - - public static VillagerProfession jamProfession; - public static VillagerProfession engineerProfession; - - public static void init() { - ActuallyAdditions.LOGGER.info("Initializing Village Addons..."); - - if (ConfigBoolValues.JAM_VILLAGER_EXISTS.isEnabled()) { - initJamVillagePart(); - } - if (ConfigBoolValues.CROP_FIELD_EXISTS.isEnabled()) { - initCustomCropFieldPart(); - } - if (ConfigBoolValues.ENGINEER_VILLAGER_EXISTS.isEnabled()) { - initEngineerVillagePart(); - } - } - - private static void initEngineerVillagePart() { - VillagerRegistry.instance().registerVillageCreationHandler(new VillageEngineerHouseHandler()); - MapGenStructureIO.registerStructureComponent(VillageComponentEngineerHouse.class, ActuallyAdditions.MODID + ":engineerHouseStructure"); - - engineerProfession = new VillagerProfession(ActuallyAdditions.MODID + ":engineer", ActuallyAdditions.MODID + ":textures/entity/villager/engineer_villager.png", ActuallyAdditions.MODID + ":textures/entity/villager/engineer_villager_zombie.png"); - - VillagerCareer crystallizer = new VillagerCareer(engineerProfession, ActuallyAdditions.MODID + ".crystallizer"); - crystallizer.addTrade(1, new BasicTradeList(new PriceInfo(1, 2), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), new PriceInfo(2, 8)), new BasicTradeList(new PriceInfo(1, 3), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), new PriceInfo(2, 6)), new BasicTradeList(new PriceInfo(1, 3), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), new PriceInfo(1, 4)), new BasicTradeList(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), new PriceInfo(10, 16), new PriceInfo(1, 1))); - crystallizer.addTrade(2, new BasicTradeList(new PriceInfo(2, 3), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), new PriceInfo(2, 4)), new BasicTradeList(new PriceInfo(1, 3), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), new PriceInfo(2, 6)), new BasicTradeList(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), new PriceInfo(8, 12), new PriceInfo(1, 1)), new BasicTradeList(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), new PriceInfo(8, 16), new PriceInfo(1, 2))); - crystallizer.addTrade(3, new BasicTradeList(new PriceInfo(2, 4), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), new PriceInfo(2, 3)), new BasicTradeList(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), new PriceInfo(6, 10), new PriceInfo(1, 1)), new BasicTradeList(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), new PriceInfo(4, 6), new PriceInfo(1, 1)), new BasicTradeList(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), new PriceInfo(6, 12), new PriceInfo(1, 2))); - - VillagerCareer engineer = new VillagerCareer(engineerProfession, ActuallyAdditions.MODID + ".engineer"); - engineer.addTrade(1, new BasicTradeList(new PriceInfo(1, 2), new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal()), new PriceInfo(2, 3)), new BasicTradeList(new PriceInfo(1, 2), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), new PriceInfo(6, 8)), new BasicTradeList(new PriceInfo(1, 3), new ItemStack(InitItems.itemLaserWrench), new PriceInfo(1, 1))); - engineer.addTrade(2, new BasicTradeList(new ItemStack(InitItems.itemCoffeeBean), new PriceInfo(20, 30), new PriceInfo(1, 2)), new BasicTradeList(new PriceInfo(3, 5), new ItemStack(InitItems.itemPhantomConnector), new PriceInfo(1, 1)), new BasicTradeList(new PriceInfo(10, 20), new ItemStack(InitBlocks.blockLaserRelay), new PriceInfo(1, 2))); - engineer.addTrade(3, new BasicTradeList(new ItemStack(InitBlocks.blockTinyTorch), new PriceInfo(30, 40), new PriceInfo(1, 2)), new BasicTradeList(new PriceInfo(1, 2), new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal()), new PriceInfo(1, 2))); - engineer.addTrade(4, new BasicTradeList(new PriceInfo(3, 5), new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), new PriceInfo(1, 2)), new BasicTradeList(new ItemStack(InitBlocks.blockEmpowerer), new PriceInfo(1, 1), new PriceInfo(15, 20)), new BasicTradeList(new PriceInfo(30, 40), new ItemStack(InitBlocks.blockLaserRelayExtreme), new PriceInfo(1, 1))); - } - - private static void initJamVillagePart() { - jamProfession = new VillagerProfession(ActuallyAdditions.MODID + ":jamGuy", ActuallyAdditions.MODID + ":textures/entity/villager/jam_villager.png", ActuallyAdditions.MODID + ":textures/entity/villager/jam_villager_zombie.png"); - - VillagerCareer career = new VillagerCareer(jamProfession, ActuallyAdditions.MODID + ".jammer"); - career.addTrade(1, new BasicTradeList(new PriceInfo(1, 4), new ItemStack(InitItems.itemJams, 1, TheJams.CU_BA_RA.ordinal()), new PriceInfo(1, 3)), new BasicTradeList(new PriceInfo(1, 4), new ItemStack(InitItems.itemJams, 1, TheJams.GRA_KI_BA.ordinal()), new PriceInfo(1, 3))); - career.addTrade(2, new BasicTradeList(new PriceInfo(1, 4), new ItemStack(InitItems.itemJams, 1, TheJams.PL_AP_LE.ordinal()), new PriceInfo(1, 3)), new BasicTradeList(new PriceInfo(1, 4), new ItemStack(InitItems.itemJams, 1, TheJams.CH_AP_CI.ordinal()), new PriceInfo(1, 3)), new BasicTradeList(new PriceInfo(1, 4), new ItemStack(InitItems.itemJams, 1, TheJams.HO_ME_KI.ordinal()), new PriceInfo(1, 3))); - career.addTrade(3, new BasicTradeList(new PriceInfo(1, 4), new ItemStack(InitItems.itemJams, 1, TheJams.HO_ME_CO.ordinal()), new PriceInfo(1, 3)), new BasicTradeList(new PriceInfo(1, 4), new ItemStack(InitItems.itemJams, 1, TheJams.PI_CO.ordinal()), new PriceInfo(1, 3))); - - VillagerRegistry.instance().registerVillageCreationHandler(new VillageJamHouseHandler()); - MapGenStructureIO.registerStructureComponent(VillageComponentJamHouse.class, ActuallyAdditions.MODID + ":jamHouseStructure"); - } - - private static void initCustomCropFieldPart() { - VillagerRegistry.instance().registerVillageCreationHandler(new VillageCustomCropFieldHandler()); - MapGenStructureIO.registerStructureComponent(VillageComponentCustomCropField.class, ActuallyAdditions.MODID + ":customCropFieldStructure"); - } + // + // public static VillagerProfession jamProfession; + // public static VillagerProfession engineerProfession; + // + // public static void init() { + // ActuallyAdditions.LOGGER.info("Initializing Village Addons..."); + // + // if (ConfigBoolValues.JAM_VILLAGER_EXISTS.isEnabled()) { + // initJamVillagePart(); + // } + // if (ConfigBoolValues.CROP_FIELD_EXISTS.isEnabled()) { + // initCustomCropFieldPart(); + // } + // if (ConfigBoolValues.ENGINEER_VILLAGER_EXISTS.isEnabled()) { + // initEngineerVillagePart(); + // } + // } + // + // private static void initEngineerVillagePart() { + // VillagerRegistry.instance().registerVillageCreationHandler(new VillageEngineerHouseHandler()); + // MapGenStructureIO.registerStructureComponent(VillageComponentEngineerHouse.class, ActuallyAdditions.MODID + ":engineerHouseStructure"); + // + // engineerProfession = new VillagerProfession(ActuallyAdditions.MODID + ":engineer", ActuallyAdditions.MODID + ":textures/entity/villager/engineer_villager.png", ActuallyAdditions.MODID + ":textures/entity/villager/engineer_villager_zombie.png"); + // + // VillagerCareer crystallizer = new VillagerCareer(engineerProfession, ActuallyAdditions.MODID + ".crystallizer"); + // crystallizer.addTrade(1, new BasicTradeList(new PriceInfo(1, 2), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), new PriceInfo(2, 8)), new BasicTradeList(new PriceInfo(1, 3), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), new PriceInfo(2, 6)), new BasicTradeList(new PriceInfo(1, 3), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), new PriceInfo(1, 4)), new BasicTradeList(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), new PriceInfo(10, 16), new PriceInfo(1, 1))); + // crystallizer.addTrade(2, new BasicTradeList(new PriceInfo(2, 3), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), new PriceInfo(2, 4)), new BasicTradeList(new PriceInfo(1, 3), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), new PriceInfo(2, 6)), new BasicTradeList(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), new PriceInfo(8, 12), new PriceInfo(1, 1)), new BasicTradeList(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), new PriceInfo(8, 16), new PriceInfo(1, 2))); + // crystallizer.addTrade(3, new BasicTradeList(new PriceInfo(2, 4), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), new PriceInfo(2, 3)), new BasicTradeList(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), new PriceInfo(6, 10), new PriceInfo(1, 1)), new BasicTradeList(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), new PriceInfo(4, 6), new PriceInfo(1, 1)), new BasicTradeList(new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), new PriceInfo(6, 12), new PriceInfo(1, 2))); + // + // VillagerCareer engineer = new VillagerCareer(engineerProfession, ActuallyAdditions.MODID + ".engineer"); + // engineer.addTrade(1, new BasicTradeList(new PriceInfo(1, 2), new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal()), new PriceInfo(2, 3)), new BasicTradeList(new PriceInfo(1, 2), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), new PriceInfo(6, 8)), new BasicTradeList(new PriceInfo(1, 3), new ItemStack(InitItems.itemLaserWrench), new PriceInfo(1, 1))); + // engineer.addTrade(2, new BasicTradeList(new ItemStack(InitItems.itemCoffeeBean), new PriceInfo(20, 30), new PriceInfo(1, 2)), new BasicTradeList(new PriceInfo(3, 5), new ItemStack(InitItems.itemPhantomConnector), new PriceInfo(1, 1)), new BasicTradeList(new PriceInfo(10, 20), new ItemStack(InitBlocks.blockLaserRelay), new PriceInfo(1, 2))); + // engineer.addTrade(3, new BasicTradeList(new ItemStack(InitBlocks.blockTinyTorch), new PriceInfo(30, 40), new PriceInfo(1, 2)), new BasicTradeList(new PriceInfo(1, 2), new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal()), new PriceInfo(1, 2))); + // engineer.addTrade(4, new BasicTradeList(new PriceInfo(3, 5), new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), new PriceInfo(1, 2)), new BasicTradeList(new ItemStack(InitBlocks.blockEmpowerer), new PriceInfo(1, 1), new PriceInfo(15, 20)), new BasicTradeList(new PriceInfo(30, 40), new ItemStack(InitBlocks.blockLaserRelayExtreme), new PriceInfo(1, 1))); + // } + // + // private static void initJamVillagePart() { + // jamProfession = new VillagerProfession(ActuallyAdditions.MODID + ":jamGuy", ActuallyAdditions.MODID + ":textures/entity/villager/jam_villager.png", ActuallyAdditions.MODID + ":textures/entity/villager/jam_villager_zombie.png"); + // + // VillagerCareer career = new VillagerCareer(jamProfession, ActuallyAdditions.MODID + ".jammer"); + // career.addTrade(1, new BasicTradeList(new PriceInfo(1, 4), new ItemStack(InitItems.itemJams, 1, TheJams.CU_BA_RA.ordinal()), new PriceInfo(1, 3)), new BasicTradeList(new PriceInfo(1, 4), new ItemStack(InitItems.itemJams, 1, TheJams.GRA_KI_BA.ordinal()), new PriceInfo(1, 3))); + // career.addTrade(2, new BasicTradeList(new PriceInfo(1, 4), new ItemStack(InitItems.itemJams, 1, TheJams.PL_AP_LE.ordinal()), new PriceInfo(1, 3)), new BasicTradeList(new PriceInfo(1, 4), new ItemStack(InitItems.itemJams, 1, TheJams.CH_AP_CI.ordinal()), new PriceInfo(1, 3)), new BasicTradeList(new PriceInfo(1, 4), new ItemStack(InitItems.itemJams, 1, TheJams.HO_ME_KI.ordinal()), new PriceInfo(1, 3))); + // career.addTrade(3, new BasicTradeList(new PriceInfo(1, 4), new ItemStack(InitItems.itemJams, 1, TheJams.HO_ME_CO.ordinal()), new PriceInfo(1, 3)), new BasicTradeList(new PriceInfo(1, 4), new ItemStack(InitItems.itemJams, 1, TheJams.PI_CO.ordinal()), new PriceInfo(1, 3))); + // + // VillagerRegistry.instance().registerVillageCreationHandler(new VillageJamHouseHandler()); + // MapGenStructureIO.registerStructureComponent(VillageComponentJamHouse.class, ActuallyAdditions.MODID + ":jamHouseStructure"); + // } + // + // private static void initCustomCropFieldPart() { + // VillagerRegistry.instance().registerVillageCreationHandler(new VillageCustomCropFieldHandler()); + // MapGenStructureIO.registerStructureComponent(VillageComponentCustomCropField.class, ActuallyAdditions.MODID + ":customCropFieldStructure"); + // } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ActuallyContainers.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ActuallyContainers.java new file mode 100644 index 000000000..2fe63b472 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ActuallyContainers.java @@ -0,0 +1,19 @@ +package de.ellpeck.actuallyadditions.mod.inventory; + +import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; +import net.minecraft.inventory.container.ContainerType; +import net.minecraftforge.common.extensions.IForgeContainerType; +import net.minecraftforge.fml.RegistryObject; +import net.minecraftforge.registries.DeferredRegister; +import net.minecraftforge.registries.ForgeRegistries; + +public class ActuallyContainers { + public static final DeferredRegister> CONTAINERS = DeferredRegister.create(ForgeRegistries.CONTAINERS, ActuallyAdditions.MODID); + + public static final RegistryObject> BAG_CONTAINER + = CONTAINERS.register("bag_container", () -> IForgeContainerType.create(ContainerBag::fromNetwork)); + + public static final RegistryObject> BIO_REACTOR_CONTAINER + = CONTAINERS.register("bioreactor_container", () -> IForgeContainerType.create(ContainerBioReactor::fromNetwork)); + +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBag.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBag.java index 3728e4574..332dafdfb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBag.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBag.java @@ -31,6 +31,7 @@ import net.minecraft.inventory.container.Slot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; +import net.minecraft.network.PacketBuffer; import net.minecraft.util.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -44,24 +45,30 @@ public class ContainerBag extends Container implements IButtonReactor { public final FilterSettings filter = new FilterSettings(4, false, true, false, false, 0, -1000); private final ItemStackHandlerAA bagInventory; - private final InventoryPlayer inventory; - private final boolean isVoid; + private final PlayerInventory inventory; + public final boolean isVoid; public boolean autoInsert; private boolean oldAutoInsert; private final ItemStack sack; - - public ContainerBag(ItemStack sack, PlayerInventory inventory, boolean isVoid) { + + public static ContainerBag fromNetwork(int windowId, PlayerInventory inv, PacketBuffer data) { + return new ContainerBag(windowId, inv, data.readItemStack(), data.readBoolean()); + } + + public ContainerBag(int windowId, PlayerInventory inventory, ItemStack sack, boolean isVoid) { + super(ActuallyContainers.BAG_CONTAINER.get(), windowId); + this.inventory = inventory; this.bagInventory = new ItemStackHandlerAA(getSlotAmount(isVoid), (slot, stack, automation) -> !isBlacklisted(stack), ItemStackHandlerAA.REMOVE_TRUE); this.isVoid = isVoid; this.sack = sack; for (int i = 0; i < 4; i++) { - this.addSlotToContainer(new SlotFilter(this.filter, i, 155, 10 + i * 18)); + this.addSlot(new SlotFilter(this.filter, i, 155, 10 + i * 18)); } if (this.isVoid) { - this.addSlotToContainer(new SlotDeletion(this.bagInventory, 0, 64, 65) { + this.addSlot(new SlotDeletion(this.bagInventory, 0, 64, 65) { @Override public boolean isItemValid(ItemStack stack) { return ContainerBag.this.filter.check(stack); @@ -70,7 +77,7 @@ public class ContainerBag extends Container implements IButtonReactor { } else { for (int i = 0; i < 4; i++) { for (int j = 0; j < 7; j++) { - this.addSlotToContainer(new SlotItemHandlerUnconditioned(this.bagInventory, j + i * 7, 10 + j * 18, 10 + i * 18) { + this.addSlot(new SlotItemHandlerUnconditioned(this.bagInventory, j + i * 7, 10 + j * 18, 10 + i * 18) { @Override public boolean isItemValid(ItemStack stack) { return !isBlacklisted(stack) && ContainerBag.this.filter.check(stack); @@ -82,22 +89,22 @@ public class ContainerBag extends Container implements IButtonReactor { for (int i = 0; i < 3; i++) { for (int j = 0; j < 9; j++) { - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 94 + i * 18)); + this.addSlot(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 94 + i * 18)); } } for (int i = 0; i < 9; i++) { if (i == inventory.currentItem) { - this.addSlotToContainer(new SlotImmovable(inventory, i, 8 + i * 18, 152)); + this.addSlot(new SlotImmovable(inventory, i, 8 + i * 18, 152)); } else { - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 152)); + this.addSlot(new Slot(inventory, i, 8 + i * 18, 152)); } } ItemStack stack = inventory.getCurrentItem(); if (StackUtil.isValid(stack) && stack.getItem() instanceof ItemBag) { ItemDrill.loadSlotsFromNBT(this.bagInventory, inventory.getCurrentItem()); - if (stack.hasTagCompound()) { - CompoundNBT compound = stack.getTagCompound(); + if (stack.hasTag()) { + CompoundNBT compound = stack.getOrCreateTag(); this.filter.readFromNBT(compound, "Filter"); this.autoInsert = compound.getBoolean("AutoInsert"); } @@ -219,7 +226,7 @@ public class ContainerBag extends Container implements IButtonReactor { ItemStack stack = this.inventory.getCurrentItem(); if (StackUtil.isValid(stack) && stack.getItem() instanceof ItemBag) { ItemDrill.writeSlotsToNBT(this.bagInventory, this.inventory.getCurrentItem()); - CompoundNBT compound = stack.getTagCompound(); + CompoundNBT compound = stack.getOrCreateTag(); this.filter.writeToNBT(compound, "Filter"); compound.putBoolean("AutoInsert", this.autoInsert); } @@ -244,6 +251,7 @@ public class ContainerBag extends Container implements IButtonReactor { private static boolean runOnce = false; + // TODO: [port] FIX THIS public static boolean isBlacklisted(ItemStack stack) { if (!runOnce) { runOnce = true; @@ -261,6 +269,6 @@ public class ContainerBag extends Container implements IButtonReactor { } } } - return BLACKLIST.contains(Pair.of(stack.getItem(), stack.getMetadata())); + return BLACKLIST.contains(Pair.of(stack.getItem(), 0)); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBioReactor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBioReactor.java index 099147dff..0e5ee2c74 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBioReactor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBioReactor.java @@ -11,35 +11,42 @@ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotItemHandlerUnconditioned; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBioReactor; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.inventory.container.Container; +import net.minecraft.inventory.container.Slot; import net.minecraft.item.ItemStack; +import net.minecraft.network.PacketBuffer; + +import java.util.Objects; public class ContainerBioReactor extends Container { - private final TileEntityBioReactor tile; - public ContainerBioReactor(InventoryPlayer inventory, TileEntityBase tile) { - this.tile = (TileEntityBioReactor) tile; + public static ContainerBioReactor fromNetwork(int windowId, PlayerInventory inv, PacketBuffer data) { + return new ContainerBioReactor(windowId, inv, (TileEntityBioReactor) Objects.requireNonNull(inv.player.world.getTileEntity(data.readBlockPos()))); + } + + public ContainerBioReactor(int windowId, PlayerInventory inventory, TileEntityBioReactor tile) { + super(ActuallyContainers.BIO_REACTOR_CONTAINER.get(), windowId); + + this.tile = tile; for (int i = 0; i < 4; i++) { for (int j = 0; j < 2; j++) { - this.addSlotToContainer(new SlotItemHandlerUnconditioned(this.tile.inv, j + i * 2, 50 + j * 18, 13 + i * 18)); + this.addSlot(new SlotItemHandlerUnconditioned(this.tile.inv, j + i * 2, 50 + j * 18, 13 + i * 18)); } } for (int i = 0; i < 3; i++) { for (int j = 0; j < 9; j++) { - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); + this.addSlot(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); } } for (int i = 0; i < 9; i++) { - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); + this.addSlot(new Slot(inventory, i, 8 + i * 18, 155)); } } @@ -60,14 +67,22 @@ public class ContainerBioReactor extends Container { if (slot >= inventoryStart) { //Shift from Inventory if (TileEntityBioReactor.isValidItem(newStack)) { - if (!this.mergeItemStack(newStack, 0, 8, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, 0, 8, false)) { + return StackUtil.getEmpty(); + } } // else if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -75,7 +90,9 @@ public class ContainerBioReactor extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBreaker.java index 85f7e71ca..c1278bce8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBreaker.java @@ -15,7 +15,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBreaker; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -24,7 +24,7 @@ public class ContainerBreaker extends Container { private final TileEntityBreaker breaker; - public ContainerBreaker(InventoryPlayer inventory, TileEntityBase tile) { + public ContainerBreaker(PlayerInventory inventory, TileEntityBase tile) { this.breaker = (TileEntityBreaker) tile; for (int i = 0; i < 3; i++) { @@ -62,10 +62,16 @@ public class ContainerBreaker extends Container { if (!this.mergeItemStack(newStack, 0, 9, false)) { // if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -73,7 +79,9 @@ public class ContainerBreaker extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java index 98c7e21ad..9492b1d02 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java @@ -17,7 +17,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCanolaPress; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -26,7 +26,7 @@ public class ContainerCanolaPress extends Container { private final TileEntityCanolaPress press; - public ContainerCanolaPress(InventoryPlayer inventory, TileEntityBase tile) { + public ContainerCanolaPress(PlayerInventory inventory, TileEntityBase tile) { this.press = (TileEntityCanolaPress) tile; this.addSlotToContainer(new SlotItemHandlerUnconditioned(this.press.inv, 0, 81, 10)); @@ -58,14 +58,22 @@ public class ContainerCanolaPress extends Container { if (slot >= inventoryStart) { //Shift from Inventory if (newStack.getItem() == InitItems.itemMisc && newStack.getItemDamage() == TheMiscItems.CANOLA.ordinal()) { - if (!this.mergeItemStack(newStack, 0, 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, 0, 1, false)) { + return StackUtil.getEmpty(); + } } // else if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -73,7 +81,9 @@ public class ContainerCanolaPress extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoalGenerator.java index 7163aeccf..4f2f51fc6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoalGenerator.java @@ -15,7 +15,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoalGenerator; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -25,7 +25,7 @@ public class ContainerCoalGenerator extends Container { private final TileEntityCoalGenerator generator; - public ContainerCoalGenerator(InventoryPlayer inventory, TileEntityBase tile) { + public ContainerCoalGenerator(PlayerInventory inventory, TileEntityBase tile) { this.generator = (TileEntityCoalGenerator) tile; this.addSlotToContainer(new SlotItemHandlerUnconditioned(this.generator.inv, 0, 87, 43)); @@ -57,14 +57,22 @@ public class ContainerCoalGenerator extends Container { if (slot >= inventoryStart) { //Shift from Inventory if (TileEntityFurnace.getItemBurnTime(newStack) > 0) { - if (!this.mergeItemStack(newStack, 0, 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, 0, 1, false)) { + return StackUtil.getEmpty(); + } } // else if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -72,7 +80,9 @@ public class ContainerCoalGenerator extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoffeeMachine.java index 35c84ac71..7f2afadab 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoffeeMachine.java @@ -19,8 +19,8 @@ import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine; import de.ellpeck.actuallyadditions.mod.util.StackUtil; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -29,7 +29,7 @@ public class ContainerCoffeeMachine extends Container { private final TileEntityCoffeeMachine machine; - public ContainerCoffeeMachine(InventoryPlayer inventory, TileEntityBase tile) { + public ContainerCoffeeMachine(PlayerInventory inventory, TileEntityBase tile) { this.machine = (TileEntityCoffeeMachine) tile; this.addSlotToContainer(new SlotItemHandlerUnconditioned(this.machine.inv, TileEntityCoffeeMachine.SLOT_COFFEE_BEANS, 37, 6)); 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 cfc8b0ed0..dc5d5bdc7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDirectionalBreaker.java @@ -15,7 +15,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityDirectionalBreaker; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -24,7 +24,7 @@ public class ContainerDirectionalBreaker extends Container { private final TileEntityDirectionalBreaker breaker; - public ContainerDirectionalBreaker(InventoryPlayer inventory, TileEntityBase tile) { + public ContainerDirectionalBreaker(PlayerInventory inventory, TileEntityBase tile) { this.breaker = (TileEntityDirectionalBreaker) tile; for (int i = 0; i < 3; i++) { @@ -62,10 +62,16 @@ public class ContainerDirectionalBreaker extends Container { if (!this.mergeItemStack(newStack, 0, 9, false)) { // if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -73,7 +79,9 @@ public class ContainerDirectionalBreaker extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDrill.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDrill.java index ca8812089..306c2d9bd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDrill.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDrill.java @@ -17,7 +17,7 @@ import de.ellpeck.actuallyadditions.mod.items.ItemDrillUpgrade; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.ClickType; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; @@ -28,9 +28,9 @@ public class ContainerDrill extends Container { public static final int SLOT_AMOUNT = 5; private final ItemStackHandlerAA drillInventory = new ItemStackHandlerAA(SLOT_AMOUNT); - private final InventoryPlayer inventory; + private final PlayerInventory inventory; - public ContainerDrill(InventoryPlayer inventory) { + public ContainerDrill(PlayerInventory inventory) { this.inventory = inventory; for (int i = 0; i < SLOT_AMOUNT; i++) { @@ -78,14 +78,22 @@ public class ContainerDrill extends Container { if (slot >= inventoryStart) { //Shift from Inventory if (newStack.getItem() instanceof ItemDrillUpgrade) { - if (!this.mergeItemStack(newStack, 0, 5, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, 0, 5, false)) { + return StackUtil.getEmpty(); + } } // else if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -93,7 +101,9 @@ public class ContainerDrill extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDropper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDropper.java index e3d90605c..0c4aa60cd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDropper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDropper.java @@ -16,7 +16,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityDropper; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -29,7 +29,7 @@ public class ContainerDropper extends Container { public ContainerDropper(PlayerEntity player, TileEntityBase tile) { this.dropper = (TileEntityDropper) tile; this.player = player; - InventoryPlayer inventory = player.inventory; + PlayerInventory inventory = player.inventory; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { this.addSlotToContainer(new SlotItemHandlerUnconditioned(this.dropper.inv, j + i * 3, 62 + j * 18, 21 + i * 18)); @@ -65,10 +65,16 @@ public class ContainerDropper extends Container { if (!this.mergeItemStack(newStack, 0, 9, false)) { // if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -76,7 +82,9 @@ public class ContainerDropper extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; @@ -92,6 +100,8 @@ public class ContainerDropper extends Container { @Override public void onContainerClosed(PlayerEntity playerIn) { super.onContainerClosed(playerIn); - if (!this.player.isSpectator()) this.dropper.getWorld().notifyNeighborsOfStateChange(this.dropper.getPos(), InitBlocks.blockDropper, false); + if (!this.player.isSpectator()) { + this.dropper.getWorld().notifyNeighborsOfStateChange(this.dropper.getPos(), InitBlocks.blockDropper, false); + } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java index ecc3efbca..1b06ce37d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java @@ -17,24 +17,23 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnergizer; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Container; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraftforge.energy.CapabilityEnergy; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; public class ContainerEnergizer extends Container { - public static final EntityEquipmentSlot[] VALID_EQUIPMENT_SLOTS = new EntityEquipmentSlot[] { EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET }; + public static final EntityEquipmentSlot[] VALID_EQUIPMENT_SLOTS = new EntityEquipmentSlot[]{EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET}; private final TileEntityEnergizer energizer; - public ContainerEnergizer(final PlayerEntity player, TileEntityBase tile) { + public ContainerEnergizer(PlayerEntity player, TileEntityBase tile) { this.energizer = (TileEntityEnergizer) tile; - InventoryPlayer inventory = player.inventory; + PlayerInventory inventory = player.inventory; this.addSlotToContainer(new SlotItemHandlerUnconditioned(this.energizer.inv, 0, 76, 73) { @Override @@ -54,7 +53,7 @@ public class ContainerEnergizer extends Container { } for (int k = 0; k < 4; ++k) { - final EntityEquipmentSlot slot = VALID_EQUIPMENT_SLOTS[k]; + EntityEquipmentSlot slot = VALID_EQUIPMENT_SLOTS[k]; this.addSlotToContainer(new Slot(player.inventory, 36 + 3 - k, 102, 19 + k * 18) { @Override public int getSlotStackLimit() { @@ -69,7 +68,9 @@ public class ContainerEnergizer extends Container { @Override public boolean canTakeStack(PlayerEntity player) { ItemStack itemstack = this.getStack(); - return !itemstack.isEmpty() && !player.isCreative() && EnchantmentHelper.hasBindingCurse(itemstack) ? false : super.canTakeStack(player); + return !itemstack.isEmpty() && !player.isCreative() && EnchantmentHelper.hasBindingCurse(itemstack) + ? false + : super.canTakeStack(player); } @Override @@ -96,21 +97,31 @@ public class ContainerEnergizer extends Container { //Slots in Inventory to shift from if (slot == 1) { - if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, true)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, true)) { + return StackUtil.getEmpty(); + } theSlot.onSlotChange(newStack, currentStack); } //Other Slots in Inventory excluded else if (slot >= inventoryStart) { //Shift from Inventory if (newStack.hasCapability(CapabilityEnergy.ENERGY, null)) { - if (!this.mergeItemStack(newStack, 0, 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, 0, 1, false)) { + return StackUtil.getEmpty(); + } } // else if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -118,7 +129,9 @@ public class ContainerEnergizer extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java index b2acf7f9d..add88e1e1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java @@ -16,23 +16,22 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnervator; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Container; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraftforge.energy.CapabilityEnergy; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; public class ContainerEnervator extends Container { private final TileEntityEnervator enervator; - public ContainerEnervator(final PlayerEntity player, TileEntityBase tile) { + public ContainerEnervator(PlayerEntity player, TileEntityBase tile) { this.enervator = (TileEntityEnervator) tile; - InventoryPlayer inventory = player.inventory; + PlayerInventory inventory = player.inventory; this.addSlotToContainer(new SlotItemHandlerUnconditioned(this.enervator.inv, 0, 76, 73)); this.addSlotToContainer(new SlotOutput(this.enervator.inv, 1, 76, 42)); @@ -47,7 +46,7 @@ public class ContainerEnervator extends Container { } for (int k = 0; k < 4; ++k) { - final EntityEquipmentSlot slot = ContainerEnergizer.VALID_EQUIPMENT_SLOTS[k]; + EntityEquipmentSlot slot = ContainerEnergizer.VALID_EQUIPMENT_SLOTS[k]; this.addSlotToContainer(new Slot(player.inventory, 36 + 3 - k, 102, 19 + k * 18) { @Override public int getSlotStackLimit() { @@ -83,21 +82,31 @@ public class ContainerEnervator extends Container { //Slots in Inventory to shift from if (slot == 1) { - if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, true)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, true)) { + return StackUtil.getEmpty(); + } theSlot.onSlotChange(newStack, currentStack); } //Other Slots in Inventory excluded else if (slot >= inventoryStart) { //Shift from Inventory if (newStack.hasCapability(CapabilityEnergy.ENERGY, null)) { - if (!this.mergeItemStack(newStack, 0, 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, 0, 1, false)) { + return StackUtil.getEmpty(); + } } // else if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -105,7 +114,9 @@ public class ContainerEnervator extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFarmer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFarmer.java index f024a4829..6f8e855d8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFarmer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFarmer.java @@ -15,7 +15,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFarmer; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -24,7 +24,7 @@ public class ContainerFarmer extends Container { private final TileEntityFarmer farmer; - public ContainerFarmer(InventoryPlayer inventory, TileEntityBase tile) { + public ContainerFarmer(PlayerInventory inventory, TileEntityBase tile) { this.farmer = (TileEntityFarmer) tile; for (int i = 0; i < 3; i++) { @@ -67,10 +67,16 @@ public class ContainerFarmer extends Container { if (!this.mergeItemStack(newStack, 0, 6, false)) { // if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -78,7 +84,9 @@ public class ContainerFarmer extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFeeder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFeeder.java index bff89e9da..5675ebacd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFeeder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFeeder.java @@ -15,7 +15,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFeeder; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -24,7 +24,7 @@ public class ContainerFeeder extends Container { private final TileEntityFeeder tileFeeder; - public ContainerFeeder(InventoryPlayer inventory, TileEntityBase tile) { + public ContainerFeeder(PlayerInventory inventory, TileEntityBase tile) { this.tileFeeder = (TileEntityFeeder) tile; this.addSlotToContainer(new SlotItemHandlerUnconditioned(this.tileFeeder.inv, 0, 80, 45)); @@ -57,10 +57,16 @@ public class ContainerFeeder extends Container { if (!this.mergeItemStack(newStack, 0, 1, false)) { // if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -68,7 +74,9 @@ public class ContainerFeeder extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java index 0fa1a6c0a..46ab7f873 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java @@ -14,7 +14,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFermentingBarrel; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -23,7 +23,7 @@ public class ContainerFermentingBarrel extends Container { private final TileEntityFermentingBarrel barrel; - public ContainerFermentingBarrel(InventoryPlayer inventory, TileEntityBase tile) { + public ContainerFermentingBarrel(PlayerInventory inventory, TileEntityBase tile) { this.barrel = (TileEntityFermentingBarrel) tile; for (int i = 0; i < 3; i++) { @@ -52,9 +52,15 @@ public class ContainerFermentingBarrel extends Container { //Other Slots in Inventory excluded if (slot >= inventoryStart) { if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -62,7 +68,9 @@ public class ContainerFermentingBarrel extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFilter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFilter.java index 550e9e603..0104bc929 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFilter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFilter.java @@ -16,7 +16,7 @@ import de.ellpeck.actuallyadditions.mod.items.ItemDrill; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.ClickType; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; @@ -27,9 +27,9 @@ public class ContainerFilter extends Container { public static final int SLOT_AMOUNT = 24; private final ItemStackHandlerAA filterInventory = new ItemStackHandlerAA(SLOT_AMOUNT); - private final InventoryPlayer inventory; + private final PlayerInventory inventory; - public ContainerFilter(InventoryPlayer inventory) { + public ContainerFilter(PlayerInventory inventory) { this.inventory = inventory; for (int i = 0; i < 4; i++) { @@ -75,9 +75,15 @@ public class ContainerFilter extends Container { //Shift from Inventory // if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -85,7 +91,9 @@ public class ContainerFilter extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFluidCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFluidCollector.java index 78dbca4fb..51a23798c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFluidCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFluidCollector.java @@ -14,7 +14,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFluidCollector; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -23,7 +23,7 @@ public class ContainerFluidCollector extends Container { private final TileEntityFluidCollector collector; - public ContainerFluidCollector(InventoryPlayer inventory, TileEntityBase tile) { + public ContainerFluidCollector(PlayerInventory inventory, TileEntityBase tile) { this.collector = (TileEntityFluidCollector) tile; for (int i = 0; i < 3; i++) { @@ -51,15 +51,23 @@ public class ContainerFluidCollector extends Container { //Slots in Inventory to shift from if (slot == 1) { - if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, true)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, true)) { + return StackUtil.getEmpty(); + } theSlot.onSlotChange(newStack, currentStack); } //Other Slots in Inventory excluded else if (slot >= inventoryStart) { if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -67,7 +75,9 @@ public class ContainerFluidCollector extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; 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 ce1c400d2..180ee4512 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java @@ -16,7 +16,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceDouble; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -26,7 +26,7 @@ public class ContainerFurnaceDouble extends Container { private final TileEntityFurnaceDouble tileFurnace; - public ContainerFurnaceDouble(InventoryPlayer inventory, TileEntityBase tile) { + public ContainerFurnaceDouble(PlayerInventory inventory, TileEntityBase tile) { this.tileFurnace = (TileEntityFurnaceDouble) tile; this.addSlotToContainer(new SlotItemHandlerUnconditioned(this.tileFurnace.inv, TileEntityFurnaceDouble.SLOT_INPUT_1, 51, 21)); @@ -59,7 +59,9 @@ public class ContainerFurnaceDouble extends Container { //Slots in Inventory to shift from if (slot == TileEntityFurnaceDouble.SLOT_OUTPUT_1 || slot == TileEntityFurnaceDouble.SLOT_OUTPUT_2) { - if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, true)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, true)) { + return StackUtil.getEmpty(); + } theSlot.onSlotChange(newStack, currentStack); } //Other Slots in Inventory excluded @@ -67,15 +69,23 @@ public class ContainerFurnaceDouble extends Container { //Shift from Inventory if (StackUtil.isValid(FurnaceRecipes.instance().getSmeltingResult(newStack))) { 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)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, TileEntityFurnaceDouble.SLOT_INPUT_2, TileEntityFurnaceDouble.SLOT_INPUT_2 + 1, false)) { + return StackUtil.getEmpty(); + } } } // else if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -83,7 +93,9 @@ public class ContainerFurnaceDouble extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGiantChest.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGiantChest.java index a5b6d5d8b..37e47d36d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGiantChest.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGiantChest.java @@ -16,7 +16,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChest; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import invtweaks.api.container.ChestContainer; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -26,7 +26,7 @@ public class ContainerGiantChest extends Container { public final TileEntityGiantChest tileChest; - public ContainerGiantChest(InventoryPlayer inventory, TileEntityBase tile, int page) { + public ContainerGiantChest(PlayerInventory inventory, TileEntityBase tile, int page) { this.tileChest = (TileEntityGiantChest) tile; for (int i = 0; i < 9; i++) { @@ -64,10 +64,16 @@ public class ContainerGiantChest extends Container { if (!this.mergeItemStack(newStack, 0, 117, false)) { // if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, true)) { return StackUtil.getEmpty(); } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, true)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -75,7 +81,9 @@ public class ContainerGiantChest extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerInputter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerInputter.java index ab5524672..64afffc7a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerInputter.java @@ -17,7 +17,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityInputter; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.ClickType; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; @@ -29,17 +29,21 @@ public class ContainerInputter extends Container { private final boolean isAdvanced; - public ContainerInputter(InventoryPlayer inventory, TileEntityBase tile, boolean isAdvanced) { + public ContainerInputter(PlayerInventory inventory, TileEntityBase tile, boolean isAdvanced) { this.tileInputter = (TileEntityInputter) tile; this.isAdvanced = isAdvanced; - this.addSlotToContainer(new SlotItemHandlerUnconditioned(this.tileInputter.inv, 0, 80, 21 + (isAdvanced ? 12 : 0))); + this.addSlotToContainer(new SlotItemHandlerUnconditioned(this.tileInputter.inv, 0, 80, 21 + (isAdvanced + ? 12 + : 0))); if (isAdvanced) { for (int i = 0; i < 2; i++) { for (int x = 0; x < 3; x++) { for (int y = 0; y < 4; y++) { - this.addSlotToContainer(new SlotFilter(i == 0 ? this.tileInputter.leftFilter : this.tileInputter.rightFilter, y + x * 4, 20 + i * 84 + x * 18, 6 + y * 18)); + this.addSlotToContainer(new SlotFilter(i == 0 + ? this.tileInputter.leftFilter + : this.tileInputter.rightFilter, y + x * 4, 20 + i * 84 + x * 18, 6 + y * 18)); } } } @@ -47,17 +51,23 @@ public class ContainerInputter extends Container { for (int i = 0; i < 3; i++) { for (int j = 0; j < 9; j++) { - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 101 + i * 18 + (isAdvanced ? GuiInputter.OFFSET_ADVANCED : 0))); + this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 101 + i * 18 + (isAdvanced + ? GuiInputter.OFFSET_ADVANCED + : 0))); } } for (int i = 0; i < 9; i++) { - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 159 + (isAdvanced ? GuiInputter.OFFSET_ADVANCED : 0))); + this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 159 + (isAdvanced + ? GuiInputter.OFFSET_ADVANCED + : 0))); } } @Override public ItemStack transferStackInSlot(PlayerEntity player, int slot) { - int inventoryStart = this.isAdvanced ? 25 : 1; + int inventoryStart = this.isAdvanced + ? 25 + : 1; int inventoryEnd = inventoryStart + 26; int hotbarStart = inventoryEnd + 1; int hotbarEnd = hotbarStart + 8; @@ -74,10 +84,16 @@ public class ContainerInputter extends Container { if (!this.mergeItemStack(newStack, 0, 1, false)) { // if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -85,7 +101,9 @@ public class ContainerInputter extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; 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 cdc715fa9..50fdc4cb3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerLaserRelayItemWhitelist.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerLaserRelayItemWhitelist.java @@ -15,7 +15,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayItemWhitelist; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.ClickType; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; @@ -25,13 +25,15 @@ public class ContainerLaserRelayItemWhitelist extends Container { private final TileEntityLaserRelayItemWhitelist tile; - public ContainerLaserRelayItemWhitelist(InventoryPlayer inventory, TileEntityBase tile) { + public ContainerLaserRelayItemWhitelist(PlayerInventory inventory, TileEntityBase tile) { this.tile = (TileEntityLaserRelayItemWhitelist) tile; for (int i = 0; i < 2; i++) { for (int x = 0; x < 3; x++) { for (int y = 0; y < 4; y++) { - this.addSlotToContainer(new SlotFilter(i == 0 ? this.tile.leftFilter : this.tile.rightFilter, y + x * 4, 20 + i * 84 + x * 18, 6 + y * 18)); + this.addSlotToContainer(new SlotFilter(i == 0 + ? this.tile.leftFilter + : this.tile.rightFilter, y + x * 4, 20 + i * 84 + x * 18, 6 + y * 18)); } } } @@ -62,9 +64,15 @@ public class ContainerLaserRelayItemWhitelist extends Container { //Other Slots in Inventory excluded if (slot >= inventoryStart) { if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -72,7 +80,9 @@ public class ContainerLaserRelayItemWhitelist extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; 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 31902aff3..673a1f291 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerMiner.java @@ -15,7 +15,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityMiner; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -24,7 +24,7 @@ public class ContainerMiner extends Container { private final TileEntityMiner miner; - public ContainerMiner(InventoryPlayer inventory, TileEntityBase tile) { + public ContainerMiner(PlayerInventory inventory, TileEntityBase tile) { this.miner = (TileEntityMiner) tile; for (int i = 0; i < 3; i++) { @@ -62,10 +62,16 @@ public class ContainerMiner extends Container { if (!this.mergeItemStack(newStack, 0, 9, false)) { // if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -73,7 +79,9 @@ public class ContainerMiner extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java index 7aa0a2c95..1baa6b016 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java @@ -14,7 +14,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -23,7 +23,7 @@ public class ContainerOilGenerator extends Container { private final TileEntityOilGenerator generator; - public ContainerOilGenerator(InventoryPlayer inventory, TileEntityBase tile) { + public ContainerOilGenerator(PlayerInventory inventory, TileEntityBase tile) { this.generator = (TileEntityOilGenerator) tile; for (int i = 0; i < 3; i++) { @@ -52,9 +52,15 @@ public class ContainerOilGenerator extends Container { //Other Slots in Inventory excluded if (slot >= inventoryStart) { if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -62,7 +68,9 @@ public class ContainerOilGenerator extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerPhantomPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerPhantomPlacer.java index f32cfe114..3ae06b6e6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerPhantomPlacer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerPhantomPlacer.java @@ -15,7 +15,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomPlacer; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -24,7 +24,7 @@ public class ContainerPhantomPlacer extends Container { private final TileEntityPhantomPlacer placer; - public ContainerPhantomPlacer(InventoryPlayer inventory, TileEntityBase tile) { + public ContainerPhantomPlacer(PlayerInventory inventory, TileEntityBase tile) { this.placer = (TileEntityPhantomPlacer) tile; for (int i = 0; i < 3; i++) { @@ -62,10 +62,16 @@ public class ContainerPhantomPlacer extends Container { if (!this.mergeItemStack(newStack, 0, 9, false)) { // if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -73,7 +79,9 @@ public class ContainerPhantomPlacer extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRangedCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRangedCollector.java index dbfbaa26b..80e532111 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRangedCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRangedCollector.java @@ -16,7 +16,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityRangedCollector; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.ClickType; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; @@ -26,7 +26,7 @@ public class ContainerRangedCollector extends Container { private final TileEntityRangedCollector collector; - public ContainerRangedCollector(InventoryPlayer inventory, TileEntityBase tile) { + public ContainerRangedCollector(PlayerInventory inventory, TileEntityBase tile) { this.collector = (TileEntityRangedCollector) tile; for (int i = 0; i < 2; i++) { @@ -69,10 +69,16 @@ public class ContainerRangedCollector extends Container { if (!this.mergeItemStack(newStack, 0, 6, false)) { // if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -80,7 +86,9 @@ public class ContainerRangedCollector extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRepairer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRepairer.java index c177ff70f..62dcfff1d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRepairer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRepairer.java @@ -16,7 +16,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemRepairer; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -25,7 +25,7 @@ public class ContainerRepairer extends Container { private final TileEntityItemRepairer tileRepairer; - public ContainerRepairer(InventoryPlayer inventory, TileEntityBase tile) { + public ContainerRepairer(PlayerInventory inventory, TileEntityBase tile) { this.tileRepairer = (TileEntityItemRepairer) tile; this.addSlotToContainer(new SlotItemHandlerUnconditioned(this.tileRepairer.inv, TileEntityItemRepairer.SLOT_INPUT, 47, 53)); @@ -58,14 +58,22 @@ public class ContainerRepairer extends Container { if (slot >= inventoryStart) { //Shift from Inventory if (TileEntityItemRepairer.canBeRepaired(newStack)) { - if (!this.mergeItemStack(newStack, TileEntityItemRepairer.SLOT_INPUT, TileEntityItemRepairer.SLOT_INPUT + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, TileEntityItemRepairer.SLOT_INPUT, TileEntityItemRepairer.SLOT_INPUT + 1, false)) { + return StackUtil.getEmpty(); + } } // else if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -73,7 +81,9 @@ public class ContainerRepairer extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerXPSolidifier.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerXPSolidifier.java index 13b795cad..3de239005 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerXPSolidifier.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerXPSolidifier.java @@ -17,7 +17,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityXPSolidifier; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -26,7 +26,7 @@ public class ContainerXPSolidifier extends Container { private final TileEntityXPSolidifier solidifier; - public ContainerXPSolidifier(InventoryPlayer inventory, TileEntityBase tile) { + public ContainerXPSolidifier(PlayerInventory inventory, TileEntityBase tile) { this.solidifier = (TileEntityXPSolidifier) tile; this.addSlotToContainer(new SlotOutput(this.solidifier.inv, 0, 95, 8)); @@ -58,11 +58,19 @@ public class ContainerXPSolidifier extends Container { //Other Slots in Inventory excluded if (slot >= inventoryStart) { if (newStack.getItem() instanceof ItemSolidifiedExperience) { - if (!this.mergeItemStack(newStack, 1, 2, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, 1, 2, false)) { + return StackUtil.getEmpty(); + } } else if (slot >= inventoryStart && slot <= inventoryEnd) { - if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } - } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } + if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { + return StackUtil.getEmpty(); + } + } else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { + return StackUtil.getEmpty(); + } if (!StackUtil.isValid(newStack)) { theSlot.putStack(StackUtil.getEmpty()); @@ -70,7 +78,9 @@ public class ContainerXPSolidifier extends Container { theSlot.onSlotChanged(); } - if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } + if (newStack.getCount() == currentStack.getCount()) { + return StackUtil.getEmpty(); + } theSlot.onTake(player, newStack); return currentStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/GuiHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/GuiHandler.java index 897d5a4c3..d892beaa0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/GuiHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/GuiHandler.java @@ -15,34 +15,7 @@ import de.ellpeck.actuallyadditions.mod.booklet.gui.GuiBooklet; import de.ellpeck.actuallyadditions.mod.booklet.gui.GuiMainPage; import de.ellpeck.actuallyadditions.mod.booklet.misc.BookletUtils; import de.ellpeck.actuallyadditions.mod.data.PlayerData; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiBag; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiBioReactor; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiBreaker; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCanolaPress; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCoalGenerator; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCoffeeMachine; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiDirectionalBreaker; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiDrill; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiDropper; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiEnergizer; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiEnervator; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFarmer; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFeeder; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFermentingBarrel; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFilter; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFluidCollector; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFurnaceDouble; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiGiantChest; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiGrinder; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiInputter; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiLaserRelayItemWhitelist; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiMiner; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiOilGenerator; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiPhantomPlacer; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiRangedCollector; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiRepairer; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiSmileyCloud; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiXPSolidifier; +import de.ellpeck.actuallyadditions.mod.inventory.gui.*; import de.ellpeck.actuallyadditions.mod.items.ItemBooklet; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.util.compat.CompatUtil; @@ -66,78 +39,78 @@ public class GuiHandler implements IGuiHandler { tile = (TileEntityBase) world.getTileEntity(new BlockPos(x, y, z)); } switch (GuiTypes.values()[id]) { - case FEEDER: - return new ContainerFeeder(player.inventory, tile); - case GIANT_CHEST: - return new ContainerGiantChest(player.inventory, tile, 0); - case GIANT_CHEST_PAGE_2: - return new ContainerGiantChest(player.inventory, tile, 1); - case GIANT_CHEST_PAGE_3: - return new ContainerGiantChest(player.inventory, tile, 2); - case CRAFTER: - return CompatUtil.getCrafterContainerElement(player, world, x, y, z); - case GRINDER: - return new ContainerGrinder(player.inventory, tile, false); - case GRINDER_DOUBLE: - return new ContainerGrinder(player.inventory, tile, true); - case FURNACE_DOUBLE: - return new ContainerFurnaceDouble(player.inventory, tile); - case INPUTTER: - return new ContainerInputter(player.inventory, tile, false); - case INPUTTER_ADVANCED: - return new ContainerInputter(player.inventory, tile, true); - case REPAIRER: - return new ContainerRepairer(player.inventory, tile); - case BREAKER: - return new ContainerBreaker(player.inventory, tile); - case DROPPER: - return new ContainerDropper(player, tile); - case CANOLA_PRESS: - return new ContainerCanolaPress(player.inventory, tile); - case FERMENTING_BARREL: - return new ContainerFermentingBarrel(player.inventory, tile); - case COAL_GENERATOR: - return new ContainerCoalGenerator(player.inventory, tile); - case OIL_GENERATOR: - return new ContainerOilGenerator(player.inventory, tile); - case PHANTOM_PLACER: - return new ContainerPhantomPlacer(player.inventory, tile); - case FLUID_COLLECTOR: - return new ContainerFluidCollector(player.inventory, tile); - case COFFEE_MACHINE: - return new ContainerCoffeeMachine(player.inventory, tile); - case DRILL: - return new ContainerDrill(player.inventory); - case FILTER: - return new ContainerFilter(player.inventory); - case ENERGIZER: - return new ContainerEnergizer(player, tile); - case ENERVATOR: - return new ContainerEnervator(player, tile); - case XP_SOLIDIFIER: - return new ContainerXPSolidifier(player.inventory, tile); - case CLOUD: - return new ContainerSmileyCloud(); - case DIRECTIONAL_BREAKER: - return new ContainerDirectionalBreaker(player.inventory, tile); - case RANGED_COLLECTOR: - return new ContainerRangedCollector(player.inventory, tile); - case MINER: - return new ContainerMiner(player.inventory, tile); - case LASER_RELAY_ITEM_WHITELIST: - return new ContainerLaserRelayItemWhitelist(player.inventory, tile); - case BAG: - return new ContainerBag(player.getHeldItemMainhand(), player.inventory, false); - case VOID_BAG: - return new ContainerBag(player.getHeldItemMainhand(), player.inventory, true); - case BIO_REACTOR: - return new ContainerBioReactor(player.inventory, tile); - case FARMER: - return new ContainerFarmer(player.inventory, tile); - case FIREWORK_BOX: - return new ContainerFireworkBox(); - default: - return null; + case FEEDER: + return new ContainerFeeder(player.inventory, tile); + case GIANT_CHEST: + return new ContainerGiantChest(player.inventory, tile, 0); + case GIANT_CHEST_PAGE_2: + return new ContainerGiantChest(player.inventory, tile, 1); + case GIANT_CHEST_PAGE_3: + return new ContainerGiantChest(player.inventory, tile, 2); + case CRAFTER: + return CompatUtil.getCrafterContainerElement(player, world, x, y, z); + case GRINDER: + return new ContainerGrinder(player.inventory, tile, false); + case GRINDER_DOUBLE: + return new ContainerGrinder(player.inventory, tile, true); + case FURNACE_DOUBLE: + return new ContainerFurnaceDouble(player.inventory, tile); + case INPUTTER: + return new ContainerInputter(player.inventory, tile, false); + case INPUTTER_ADVANCED: + return new ContainerInputter(player.inventory, tile, true); + case REPAIRER: + return new ContainerRepairer(player.inventory, tile); + case BREAKER: + return new ContainerBreaker(player.inventory, tile); + case DROPPER: + return new ContainerDropper(player, tile); + case CANOLA_PRESS: + return new ContainerCanolaPress(player.inventory, tile); + case FERMENTING_BARREL: + return new ContainerFermentingBarrel(player.inventory, tile); + case COAL_GENERATOR: + return new ContainerCoalGenerator(player.inventory, tile); + case OIL_GENERATOR: + return new ContainerOilGenerator(player.inventory, tile); + case PHANTOM_PLACER: + return new ContainerPhantomPlacer(player.inventory, tile); + case FLUID_COLLECTOR: + return new ContainerFluidCollector(player.inventory, tile); + case COFFEE_MACHINE: + return new ContainerCoffeeMachine(player.inventory, tile); + case DRILL: + return new ContainerDrill(player.inventory); + case FILTER: + return new ContainerFilter(player.inventory); + case ENERGIZER: + return new ContainerEnergizer(player, tile); + case ENERVATOR: + return new ContainerEnervator(player, tile); + case XP_SOLIDIFIER: + return new ContainerXPSolidifier(player.inventory, tile); + case CLOUD: + return new ContainerSmileyCloud(); + case DIRECTIONAL_BREAKER: + return new ContainerDirectionalBreaker(player.inventory, tile); + case RANGED_COLLECTOR: + return new ContainerRangedCollector(player.inventory, tile); + case MINER: + return new ContainerMiner(player.inventory, tile); + case LASER_RELAY_ITEM_WHITELIST: + return new ContainerLaserRelayItemWhitelist(player.inventory, tile); + case BAG: + return new ContainerBag(player.getHeldItemMainhand(), player.inventory, false); + case VOID_BAG: + return new ContainerBag(player.getHeldItemMainhand(), player.inventory, true); + case BIO_REACTOR: + return new ContainerBioReactor(player.inventory, tile); + case FARMER: + return new ContainerFarmer(player.inventory, tile); + case FIREWORK_BOX: + return new ContainerFireworkBox(); + default: + return null; } } @@ -148,91 +121,91 @@ public class GuiHandler implements IGuiHandler { tile = (TileEntityBase) world.getTileEntity(new BlockPos(x, y, z)); } switch (GuiTypes.values()[id]) { - case FEEDER: - return new GuiFeeder(player.inventory, tile); - case GIANT_CHEST: - return new GuiGiantChest(player.inventory, tile, 0); - case GIANT_CHEST_PAGE_2: - return new GuiGiantChest(player.inventory, tile, 1); - case GIANT_CHEST_PAGE_3: - return new GuiGiantChest(player.inventory, tile, 2); - case CRAFTER: - return CompatUtil.getCrafterGuiElement(player, world, x, y, z); - case GRINDER: - return new GuiGrinder(player.inventory, tile); - case GRINDER_DOUBLE: - return new GuiGrinder.GuiGrinderDouble(player.inventory, tile); - case FURNACE_DOUBLE: - return new GuiFurnaceDouble(player.inventory, tile); - case INPUTTER: - return new GuiInputter(player.inventory, tile, false); - case INPUTTER_ADVANCED: - return new GuiInputter(player.inventory, tile, true); - case REPAIRER: - return new GuiRepairer(player.inventory, tile); - case BREAKER: - return new GuiBreaker(player.inventory, tile); - case DROPPER: - return new GuiDropper(player, tile); - case CANOLA_PRESS: - return new GuiCanolaPress(player.inventory, tile); - case FERMENTING_BARREL: - return new GuiFermentingBarrel(player.inventory, tile); - case COAL_GENERATOR: - return new GuiCoalGenerator(player.inventory, tile); - case OIL_GENERATOR: - return new GuiOilGenerator(player.inventory, tile); - case PHANTOM_PLACER: - return new GuiPhantomPlacer(player.inventory, tile); - case FLUID_COLLECTOR: - return new GuiFluidCollector(player.inventory, tile); - case COFFEE_MACHINE: - return new GuiCoffeeMachine(player.inventory, tile); - case DRILL: - return new GuiDrill(player.inventory); - case FILTER: - return new GuiFilter(player.inventory); - case ENERGIZER: - return new GuiEnergizer(player, tile); - case ENERVATOR: - return new GuiEnervator(player, tile); - case XP_SOLIDIFIER: - return new GuiXPSolidifier(player.inventory, tile); - case CLOUD: - return new GuiSmileyCloud(tile, x, y, z, world); - case BOOK: - if (ItemBooklet.forcedPage != null) { - GuiBooklet gui = BookletUtils.createBookletGuiFromPage(null, ItemBooklet.forcedPage); - ItemBooklet.forcedPage = null; - return gui; - } else { - PlayerData.PlayerSave data = PlayerData.getDataFromPlayer(player); - if (data.lastOpenBooklet != null) { - return data.lastOpenBooklet; + case FEEDER: + return new GuiFeeder(player.inventory, tile); + case GIANT_CHEST: + return new GuiGiantChest(player.inventory, tile, 0); + case GIANT_CHEST_PAGE_2: + return new GuiGiantChest(player.inventory, tile, 1); + case GIANT_CHEST_PAGE_3: + return new GuiGiantChest(player.inventory, tile, 2); + case CRAFTER: + return CompatUtil.getCrafterGuiElement(player, world, x, y, z); + case GRINDER: + return new GuiGrinder(player.inventory, tile); + case GRINDER_DOUBLE: + return new GuiGrinder.GuiGrinderDouble(player.inventory, tile); + case FURNACE_DOUBLE: + return new GuiFurnaceDouble(player.inventory, tile); + case INPUTTER: + return new GuiInputter(player.inventory, tile, false); + case INPUTTER_ADVANCED: + return new GuiInputter(player.inventory, tile, true); + case REPAIRER: + return new GuiRepairer(player.inventory, tile); + case BREAKER: + return new GuiBreaker(player.inventory, tile); + case DROPPER: + return new GuiDropper(player, tile); + case CANOLA_PRESS: + return new GuiCanolaPress(player.inventory, tile); + case FERMENTING_BARREL: + return new GuiFermentingBarrel(player.inventory, tile); + case COAL_GENERATOR: + return new GuiCoalGenerator(player.inventory, tile); + case OIL_GENERATOR: + return new GuiOilGenerator(player.inventory, tile); + case PHANTOM_PLACER: + return new GuiPhantomPlacer(player.inventory, tile); + case FLUID_COLLECTOR: + return new GuiFluidCollector(player.inventory, tile); + case COFFEE_MACHINE: + return new GuiCoffeeMachine(player.inventory, tile); + case DRILL: + return new GuiDrill(player.inventory); + case FILTER: + return new GuiFilter(player.inventory); + case ENERGIZER: + return new GuiEnergizer(player, tile); + case ENERVATOR: + return new GuiEnervator(player, tile); + case XP_SOLIDIFIER: + return new GuiXPSolidifier(player.inventory, tile); + case CLOUD: + return new GuiSmileyCloud(tile, x, y, z, world); + case BOOK: + if (ItemBooklet.forcedPage != null) { + GuiBooklet gui = BookletUtils.createBookletGuiFromPage(null, ItemBooklet.forcedPage); + ItemBooklet.forcedPage = null; + return gui; } else { - return new GuiMainPage(null); + PlayerData.PlayerSave data = PlayerData.getDataFromPlayer(player); + if (data.lastOpenBooklet != null) { + return data.lastOpenBooklet; + } else { + return new GuiMainPage(null); + } } - } - case DIRECTIONAL_BREAKER: - return new GuiDirectionalBreaker(player.inventory, tile); - case RANGED_COLLECTOR: - return new GuiRangedCollector(player.inventory, tile); - case MINER: - return new GuiMiner(player.inventory, tile); - case LASER_RELAY_ITEM_WHITELIST: - return new GuiLaserRelayItemWhitelist(player.inventory, tile); - case BAG: - return new GuiBag(player.getHeldItemMainhand(), player.inventory, false); - case VOID_BAG: - return new GuiBag(player.getHeldItemMainhand(), player.inventory, true); - case BIO_REACTOR: - return new GuiBioReactor(player.inventory, tile); - case FARMER: - return new GuiFarmer(player.inventory, tile); - case FIREWORK_BOX: - return new GuiFireworkBox(tile); - default: - return null; + case DIRECTIONAL_BREAKER: + return new GuiDirectionalBreaker(player.inventory, tile); + case RANGED_COLLECTOR: + return new GuiRangedCollector(player.inventory, tile); + case MINER: + return new GuiMiner(player.inventory, tile); + case LASER_RELAY_ITEM_WHITELIST: + return new GuiLaserRelayItemWhitelist(player.inventory, tile); + // case BAG: + // return new GuiBag(player.getHeldItemMainhand(), player.inventory, false); + // case VOID_BAG: + // return new GuiBag(player.getHeldItemMainhand(), player.inventory, true); + case BIO_REACTOR: + return new GuiBioReactor(player.inventory, tile); + case FARMER: + return new GuiFarmer(player.inventory, tile); + case FIREWORK_BOX: + return new GuiFireworkBox(tile); + default: + return null; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBag.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBag.java index daf5a5383..5baba1480 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBag.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBag.java @@ -10,6 +10,8 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.platform.GlStateManager; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.inventory.ContainerBag; import de.ellpeck.actuallyadditions.mod.network.PacketClientToServer; @@ -17,39 +19,31 @@ import de.ellpeck.actuallyadditions.mod.network.PacketHandler; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; +import net.minecraft.client.gui.widget.button.Button; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextFormatting; -import net.minecraftforge.fml.relauncher.OnlyIn; import java.io.IOException; import java.util.ArrayList; import java.util.List; -@OnlyIn(Dist.CLIENT) -public class GuiBag extends GuiWtfMojang { - +public class GuiBag extends GuiWtfMojang { private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_bag"); private static final ResourceLocation RES_LOC_VOID = AssetUtil.getGuiLocation("gui_void_bag"); private final ContainerBag container; private final boolean isVoid; private FilterSettingsGui filter; - private GuiButton buttonAutoInsert; + private Button buttonAutoInsert; - public GuiBag(ItemStack sack, InventoryPlayer inventory, boolean isVoid) { - this(isVoid, new ContainerBag(sack, inventory, isVoid)); - } - - private GuiBag(boolean isVoid, ContainerBag container) { - super(container); + public GuiBag(ContainerBag container, PlayerInventory inventory, ITextComponent title) { + super(container, inventory); this.xSize = 176; this.ySize = 90 + 86; - this.isVoid = isVoid; + this.isVoid = container.isVoid; this.container = container; } @@ -86,27 +80,14 @@ public class GuiBag extends GuiWtfMojang { @Override public void drawGuiContainerForegroundLayer(int x, int y) { - AssetUtil.displayNameString(this.fontRenderer, this.xSize, -10, StringUtil.localize("container." + ActuallyAdditions.MODID + "." + (this.isVoid + AssetUtil.displayNameString(this.font, this.xSize, -10, StringUtil.localize("container." + ActuallyAdditions.MODID + "." + (this.isVoid ? "voidBag" : "bag") + ".name")); } @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - - this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); - this.drawTexturedModalRect(this.guiLeft, this.guiTop + 90, 0, 0, 176, 86); - - this.mc.getTextureManager().bindTexture(this.isVoid - ? RES_LOC_VOID - : RES_LOC); - this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 90); - } - - @Override - public void drawScreen(int mouseX, int mouseY, float partialTicks) { - super.drawScreen(mouseX, mouseY, partialTicks); + public void render(MatrixStack stack, int mouseX, int mouseY, float partialTicks) { + super.render(stack, mouseX, mouseY, partialTicks); this.filter.drawHover(mouseX, mouseY); if (this.buttonAutoInsert.isMouseOver()) { @@ -114,9 +95,22 @@ public class GuiBag extends GuiWtfMojang { text.add(TextFormatting.BOLD + "Auto-Insert " + (this.container.autoInsert ? "On" : "Off")); - text.addAll(this.mc.fontRenderer.listFormattedStringToWidth("Turn this on to make items that get picked up automatically go into the bag.", 200)); - text.addAll(this.mc.fontRenderer.listFormattedStringToWidth(TextFormatting.GRAY + "" + TextFormatting.ITALIC + "Note that this WON'T work when you are holding the bag in your hand.", 200)); - this.drawHoveringText(text, mouseX, mouseY); + text.addAll(this.font.listFormattedStringToWidth("Turn this on to make items that get picked up automatically go into the bag.", 200)); + text.addAll(this.font.listFormattedStringToWidth(TextFormatting.GRAY + "" + TextFormatting.ITALIC + "Note that this WON'T work when you are holding the bag in your hand.", 200)); + this.renderToolTip(stack, text, mouseX, mouseY, this.getMinecraft().fontRenderer); } } + + @Override + protected void drawGuiContainerBackgroundLayer(MatrixStack matrixStack, float partialTicks, int x, int y) { + GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); + + this.getMinecraft().getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); + this.blit(matrixStack, this.guiLeft, this.guiTop + 90, 0, 0, 176, 86); + + this.getMinecraft().getTextureManager().bindTexture(this.isVoid + ? RES_LOC_VOID + : RES_LOC); + this.blit(matrixStack, this.guiLeft, this.guiTop, 0, 0, 176, 90); + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBioReactor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBioReactor.java index 2f39e853b..65754f9b4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBioReactor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBioReactor.java @@ -16,7 +16,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBioReactor; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.resources.I18n; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; public class GuiBioReactor extends GuiWtfMojang { @@ -25,7 +25,7 @@ public class GuiBioReactor extends GuiWtfMojang { private final TileEntityBioReactor tile; private EnergyDisplay energy; - public GuiBioReactor(InventoryPlayer inventory, TileEntityBase tile) { + public GuiBioReactor(PlayerInventory inventory, TileEntityBase tile) { super(new ContainerBioReactor(inventory, tile)); this.tile = (TileEntityBioReactor) tile; this.xSize = 176; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBreaker.java index 57708c959..5fb45f057 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBreaker.java @@ -15,9 +15,8 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBreaker; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; @OnlyIn(Dist.CLIENT) @@ -26,7 +25,7 @@ public class GuiBreaker extends GuiWtfMojang { private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_breaker"); private final TileEntityBreaker breaker; - public GuiBreaker(InventoryPlayer inventory, TileEntityBase tile) { + public GuiBreaker(PlayerInventory inventory, TileEntityBase tile) { super(new ContainerBreaker(inventory, tile)); this.breaker = (TileEntityBreaker) tile; this.xSize = 176; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java index 2399def12..a466fe953 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java @@ -15,9 +15,8 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCanolaPress; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; @OnlyIn(Dist.CLIENT) @@ -28,7 +27,7 @@ public class GuiCanolaPress extends GuiWtfMojang { private EnergyDisplay energy; private FluidDisplay fluid; - public GuiCanolaPress(InventoryPlayer inventory, TileEntityBase tile) { + public GuiCanolaPress(PlayerInventory inventory, TileEntityBase tile) { super(new ContainerCanolaPress(inventory, tile)); this.press = (TileEntityCanolaPress) tile; this.xSize = 176; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java index a625493dc..12f50b726 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java @@ -15,9 +15,8 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoalGenerator; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; @OnlyIn(Dist.CLIENT) @@ -27,7 +26,7 @@ public class GuiCoalGenerator extends GuiWtfMojang { private final TileEntityCoalGenerator generator; private EnergyDisplay energy; - public GuiCoalGenerator(InventoryPlayer inventory, TileEntityBase tile) { + public GuiCoalGenerator(PlayerInventory inventory, TileEntityBase tile) { super(new ContainerCoalGenerator(inventory, tile)); this.generator = (TileEntityCoalGenerator) tile; this.xSize = 176; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java index 74b81ab84..b25f91f1a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java @@ -10,8 +10,6 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import java.util.Collections; - import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.inventory.ContainerCoffeeMachine; import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper; @@ -21,11 +19,12 @@ import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; +import java.util.Collections; + @OnlyIn(Dist.CLIENT) public class GuiCoffeeMachine extends GuiWtfMojang { @@ -35,7 +34,7 @@ public class GuiCoffeeMachine extends GuiWtfMojang { private EnergyDisplay energy; private FluidDisplay fluid; - public GuiCoffeeMachine(InventoryPlayer inventory, TileEntityBase tile) { + public GuiCoffeeMachine(PlayerInventory inventory, TileEntityBase tile) { super(new ContainerCoffeeMachine(inventory, tile)); this.machine = (TileEntityCoffeeMachine) tile; this.xSize = 176; 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 dafad859a..d5694bf63 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 @@ -15,9 +15,8 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityDirectionalBreaker; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; @OnlyIn(Dist.CLIENT) @@ -27,7 +26,7 @@ public class GuiDirectionalBreaker extends GuiWtfMojang { private final TileEntityDirectionalBreaker breaker; private EnergyDisplay energy; - public GuiDirectionalBreaker(InventoryPlayer inventory, TileEntityBase tile) { + public GuiDirectionalBreaker(PlayerInventory inventory, TileEntityBase tile) { super(new ContainerDirectionalBreaker(inventory, tile)); this.breaker = (TileEntityDirectionalBreaker) tile; this.xSize = 176; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDrill.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDrill.java index 22b194ef4..9ae85dca8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDrill.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDrill.java @@ -15,9 +15,8 @@ import de.ellpeck.actuallyadditions.mod.inventory.ContainerDrill; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; @OnlyIn(Dist.CLIENT) @@ -25,7 +24,7 @@ public class GuiDrill extends GuiWtfMojang { private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_drill"); - public GuiDrill(InventoryPlayer inventory) { + public GuiDrill(PlayerInventory inventory) { super(new ContainerDrill(inventory)); this.xSize = 176; this.ySize = 54 + 86; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFarmer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFarmer.java index 02df0d49d..952351d04 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFarmer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFarmer.java @@ -15,9 +15,8 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFarmer; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; @OnlyIn(Dist.CLIENT) @@ -28,7 +27,7 @@ public class GuiFarmer extends GuiWtfMojang { private EnergyDisplay energy; - public GuiFarmer(InventoryPlayer inventory, TileEntityBase tile) { + public GuiFarmer(PlayerInventory inventory, TileEntityBase tile) { super(new ContainerFarmer(inventory, tile)); this.farmer = (TileEntityFarmer) tile; this.xSize = 176; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFeeder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFeeder.java index 9c6f7d7f5..8550bc60b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFeeder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFeeder.java @@ -10,8 +10,6 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import java.util.Arrays; - import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.inventory.ContainerFeeder; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; @@ -19,18 +17,19 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityFeeder; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; +import java.util.Arrays; + @OnlyIn(Dist.CLIENT) public class GuiFeeder extends GuiWtfMojang { private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_feeder"); public final TileEntityFeeder tileFeeder; - public GuiFeeder(InventoryPlayer inventory, TileEntityBase tile) { + public GuiFeeder(PlayerInventory inventory, TileEntityBase tile) { super(new ContainerFeeder(inventory, tile)); this.tileFeeder = (TileEntityFeeder) tile; this.xSize = 176; @@ -41,7 +40,11 @@ public class GuiFeeder extends GuiWtfMojang { public void drawScreen(int x, int y, float f) { super.drawScreen(x, y, f); if (x >= this.guiLeft + 69 && y >= this.guiTop + 30 && x <= this.guiLeft + 69 + 10 && y <= this.guiTop + 30 + 10) { - String[] array = new String[] { this.tileFeeder.currentAnimalAmount + " " + StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.animals"), this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < TileEntityFeeder.THRESHOLD ? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.enoughToBreed") : this.tileFeeder.currentAnimalAmount >= TileEntityFeeder.THRESHOLD ? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.tooMany") : StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.notEnough") }; + String[] array = new String[]{this.tileFeeder.currentAnimalAmount + " " + StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.animals"), this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < TileEntityFeeder.THRESHOLD + ? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.enoughToBreed") + : this.tileFeeder.currentAnimalAmount >= TileEntityFeeder.THRESHOLD + ? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.tooMany") + : StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.notEnough")}; this.drawHoveringText(Arrays.asList(array), x, y); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFermentingBarrel.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFermentingBarrel.java index 50b04f25b..f359d2f8c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFermentingBarrel.java @@ -15,9 +15,8 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFermentingBarrel; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; @OnlyIn(Dist.CLIENT) @@ -28,7 +27,7 @@ public class GuiFermentingBarrel extends GuiWtfMojang { private FluidDisplay input; private FluidDisplay output; - public GuiFermentingBarrel(InventoryPlayer inventory, TileEntityBase tile) { + public GuiFermentingBarrel(PlayerInventory inventory, TileEntityBase tile) { super(new ContainerFermentingBarrel(inventory, tile)); this.press = (TileEntityFermentingBarrel) tile; this.xSize = 176; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFilter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFilter.java index 05ee8afb5..69de8dfa9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFilter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFilter.java @@ -15,9 +15,8 @@ import de.ellpeck.actuallyadditions.mod.inventory.ContainerFilter; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; @OnlyIn(Dist.CLIENT) @@ -25,7 +24,7 @@ public class GuiFilter extends GuiWtfMojang { private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_filter"); - public GuiFilter(InventoryPlayer inventory) { + public GuiFilter(PlayerInventory inventory) { super(new ContainerFilter(inventory)); this.xSize = 176; this.ySize = 90 + 86; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFluidCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFluidCollector.java index 3b5de96fa..b29fb5aec 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFluidCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFluidCollector.java @@ -15,9 +15,8 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFluidCollector; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; @OnlyIn(Dist.CLIENT) @@ -27,7 +26,7 @@ public class GuiFluidCollector extends GuiWtfMojang { private final TileEntityFluidCollector collector; private FluidDisplay fluid; - public GuiFluidCollector(InventoryPlayer inventory, TileEntityBase tile) { + public GuiFluidCollector(PlayerInventory inventory, TileEntityBase tile) { super(new ContainerFluidCollector(inventory, tile)); this.collector = (TileEntityFluidCollector) tile; this.xSize = 176; 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 dded17f22..3b2745f0e 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 @@ -10,9 +10,6 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import java.io.IOException; -import java.util.Collections; - import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.inventory.ContainerFurnaceDouble; import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper; @@ -22,12 +19,14 @@ import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.TextFormatting; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; +import java.io.IOException; +import java.util.Collections; + @OnlyIn(Dist.CLIENT) public class GuiFurnaceDouble extends GuiWtfMojang { @@ -37,7 +36,7 @@ public class GuiFurnaceDouble extends GuiWtfMojang { private GuiButton buttonAutoSplit; - public GuiFurnaceDouble(InventoryPlayer inventory, TileEntityBase tile) { + public GuiFurnaceDouble(PlayerInventory inventory, TileEntityBase tile) { super(new ContainerFurnaceDouble(inventory, tile)); this.tileFurnace = (TileEntityFurnaceDouble) tile; this.xSize = 176; @@ -50,7 +49,9 @@ public class GuiFurnaceDouble extends GuiWtfMojang { this.energy.drawOverlay(x, y); if (this.buttonAutoSplit.isMouseOver()) { - this.drawHoveringText(Collections.singletonList(TextFormatting.BOLD + (this.tileFurnace.isAutoSplit ? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.autoSplitItems.on") : StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.autoSplitItems.off"))), x, y); + this.drawHoveringText(Collections.singletonList(TextFormatting.BOLD + (this.tileFurnace.isAutoSplit + ? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.autoSplitItems.on") + : StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.autoSplitItems.off"))), x, y); } } @@ -67,7 +68,9 @@ public class GuiFurnaceDouble extends GuiWtfMojang { public void updateScreen() { super.updateScreen(); - this.buttonAutoSplit.displayString = (this.tileFurnace.isAutoSplit ? TextFormatting.DARK_GREEN : TextFormatting.RED) + "S"; + this.buttonAutoSplit.displayString = (this.tileFurnace.isAutoSplit + ? TextFormatting.DARK_GREEN + : TextFormatting.RED) + "S"; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGiantChest.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGiantChest.java index 1d7793d25..5496c01c2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGiantChest.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGiantChest.java @@ -10,8 +10,6 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import java.io.IOException; - import de.ellpeck.actuallyadditions.mod.inventory.ContainerGiantChest; import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; @@ -21,11 +19,12 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChestMedium; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; +import java.io.IOException; + @OnlyIn(Dist.CLIENT) public class GuiGiantChest extends GuiWtfMojang { @@ -34,7 +33,7 @@ public class GuiGiantChest extends GuiWtfMojang { private final TileEntityGiantChest chest; private final int page; - public GuiGiantChest(InventoryPlayer inventory, TileEntityBase tile, int page) { + public GuiGiantChest(PlayerInventory inventory, TileEntityBase tile, int page) { super(new ContainerGiantChest(inventory, tile, page)); this.chest = (TileEntityGiantChest) tile; this.page = page; 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 633bcd7c3..cc9537adf 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 @@ -10,9 +10,6 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import java.io.IOException; -import java.util.Collections; - import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.inventory.ContainerGrinder; import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper; @@ -22,12 +19,14 @@ import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.TextFormatting; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; +import java.io.IOException; +import java.util.Collections; + @OnlyIn(Dist.CLIENT) public class GuiGrinder extends GuiWtfMojang { @@ -39,11 +38,11 @@ public class GuiGrinder extends GuiWtfMojang { private GuiButton buttonAutoSplit; - public GuiGrinder(InventoryPlayer inventoryPlayer, TileEntityBase tile) { + public GuiGrinder(PlayerInventory inventoryPlayer, TileEntityBase tile) { this(inventoryPlayer, tile, false); } - private GuiGrinder(InventoryPlayer inventory, TileEntityBase tile, boolean isDouble) { + private GuiGrinder(PlayerInventory inventory, TileEntityBase tile, boolean isDouble) { super(new ContainerGrinder(inventory, tile, isDouble)); this.tileGrinder = (TileEntityGrinder) tile; this.isDouble = isDouble; @@ -54,7 +53,9 @@ public class GuiGrinder extends GuiWtfMojang { @Override public void initGui() { super.initGui(); - this.energy = new EnergyDisplay(this.guiLeft + (this.isDouble ? 13 : 42), this.guiTop + 5, this.tileGrinder.storage); + this.energy = new EnergyDisplay(this.guiLeft + (this.isDouble + ? 13 + : 42), this.guiTop + 5, this.tileGrinder.storage); if (this.isDouble) { this.buttonAutoSplit = new GuiInputter.SmallerButton(0, this.guiLeft - 10, this.guiTop, "S"); @@ -74,7 +75,9 @@ public class GuiGrinder extends GuiWtfMojang { super.updateScreen(); if (this.isDouble) { - this.buttonAutoSplit.displayString = (this.tileGrinder.isAutoSplit ? TextFormatting.DARK_GREEN : TextFormatting.RED) + "S"; + this.buttonAutoSplit.displayString = (this.tileGrinder.isAutoSplit + ? TextFormatting.DARK_GREEN + : TextFormatting.RED) + "S"; } } @@ -85,7 +88,9 @@ public class GuiGrinder extends GuiWtfMojang { if (this.isDouble && this.buttonAutoSplit.isMouseOver()) { - this.drawHoveringText(Collections.singletonList(TextFormatting.BOLD + (this.tileGrinder.isAutoSplit ? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.autoSplitItems.on") : StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.autoSplitItems.off"))), x, y); + this.drawHoveringText(Collections.singletonList(TextFormatting.BOLD + (this.tileGrinder.isAutoSplit + ? StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.autoSplitItems.on") + : StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.autoSplitItems.off"))), x, y); } } @@ -101,12 +106,16 @@ public class GuiGrinder extends GuiWtfMojang { this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop + 93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(this.isDouble ? RES_LOC_DOUBLE : RES_LOC); + this.mc.getTextureManager().bindTexture(this.isDouble + ? RES_LOC_DOUBLE + : RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if (this.tileGrinder.firstCrushTime > 0) { int i = this.tileGrinder.getFirstTimeToScale(23); - this.drawTexturedModalRect(this.guiLeft + (this.isDouble ? 51 : 80), this.guiTop + 40, 176, 0, 24, i); + this.drawTexturedModalRect(this.guiLeft + (this.isDouble + ? 51 + : 80), this.guiTop + 40, 176, 0, 24, i); } if (this.isDouble) { if (this.tileGrinder.secondCrushTime > 0) { @@ -120,7 +129,7 @@ public class GuiGrinder extends GuiWtfMojang { public static class GuiGrinderDouble extends GuiGrinder { - public GuiGrinderDouble(InventoryPlayer inventory, TileEntityBase tile) { + public GuiGrinderDouble(PlayerInventory inventory, TileEntityBase tile) { super(inventory, tile, true); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiInputter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiInputter.java index ddb12366e..165fd8ba3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiInputter.java @@ -10,10 +10,6 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import java.io.IOException; - -import org.lwjgl.input.Keyboard; - import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.inventory.ContainerInputter; import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper; @@ -25,16 +21,18 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; +import org.lwjgl.input.Keyboard; + +import java.io.IOException; @OnlyIn(Dist.CLIENT) public class GuiInputter extends GuiWtfMojang { public static final int OFFSET_ADVANCED = 12 + 36; - public static final String[] SIDES = new String[] { StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.disabled"), StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.up"), StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.down"), StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.north"), StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.east"), StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.south"), StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.west") }; + public static final String[] SIDES = new String[]{StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.disabled"), StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.up"), StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.down"), StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.north"), StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.east"), StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.south"), StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.west")}; private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_inputter"); private static final ResourceLocation RES_LOC_ADVANCED = AssetUtil.getGuiLocation("gui_inputter_advanced"); public final TileEntityInputter tileInputter; @@ -47,11 +45,13 @@ public class GuiInputter extends GuiWtfMojang { private FilterSettingsGui leftFilter; private FilterSettingsGui rightFilter; - public GuiInputter(InventoryPlayer inventory, TileEntityBase tile, boolean isAdvanced) { + public GuiInputter(PlayerInventory inventory, TileEntityBase tile, boolean isAdvanced) { super(new ContainerInputter(inventory, tile, isAdvanced)); this.tileInputter = (TileEntityInputter) tile; this.xSize = 176; - this.ySize = 97 + 86 + (isAdvanced ? OFFSET_ADVANCED : 0); + this.ySize = 97 + 86 + (isAdvanced + ? OFFSET_ADVANCED + : 0); this.isAdvanced = isAdvanced; } @@ -64,39 +64,59 @@ public class GuiInputter extends GuiWtfMojang { this.rightFilter = new FilterSettingsGui(this.tileInputter.rightFilter, this.guiLeft + 157, this.guiTop + 6, this.buttonList); } - this.fieldPullStart = new GuiTextField(3000, this.fontRenderer, this.guiLeft + 6, this.guiTop + 80 + (this.isAdvanced ? OFFSET_ADVANCED : 0), 34, 8); + this.fieldPullStart = new GuiTextField(3000, this.fontRenderer, this.guiLeft + 6, this.guiTop + 80 + (this.isAdvanced + ? OFFSET_ADVANCED + : 0), 34, 8); this.fieldPullStart.setMaxStringLength(5); this.fieldPullStart.setEnableBackgroundDrawing(false); - this.fieldPullEnd = new GuiTextField(3001, this.fontRenderer, this.guiLeft + 50, this.guiTop + 80 + (this.isAdvanced ? OFFSET_ADVANCED : 0), 34, 8); + this.fieldPullEnd = new GuiTextField(3001, this.fontRenderer, this.guiLeft + 50, this.guiTop + 80 + (this.isAdvanced + ? OFFSET_ADVANCED + : 0), 34, 8); this.fieldPullEnd.setMaxStringLength(5); this.fieldPullEnd.setEnableBackgroundDrawing(false); - this.fieldPutStart = new GuiTextField(3002, this.fontRenderer, this.guiLeft + 91, this.guiTop + 80 + (this.isAdvanced ? OFFSET_ADVANCED : 0), 34, 8); + this.fieldPutStart = new GuiTextField(3002, this.fontRenderer, this.guiLeft + 91, this.guiTop + 80 + (this.isAdvanced + ? OFFSET_ADVANCED + : 0), 34, 8); this.fieldPutStart.setMaxStringLength(5); this.fieldPutStart.setEnableBackgroundDrawing(false); - this.fieldPutEnd = new GuiTextField(3004, this.fontRenderer, this.guiLeft + 135, this.guiTop + 80 + (this.isAdvanced ? OFFSET_ADVANCED : 0), 34, 8); + this.fieldPutEnd = new GuiTextField(3004, this.fontRenderer, this.guiLeft + 135, this.guiTop + 80 + (this.isAdvanced + ? OFFSET_ADVANCED + : 0), 34, 8); this.fieldPutEnd.setMaxStringLength(5); this.fieldPutEnd.setEnableBackgroundDrawing(false); - SmallerButton buttonSidePutP = new SmallerButton(0, this.guiLeft + 155, this.guiTop + 43 + (this.isAdvanced ? OFFSET_ADVANCED : 0), ">"); - SmallerButton buttonSidePutM = new SmallerButton(1, this.guiLeft + 90, this.guiTop + 43 + (this.isAdvanced ? OFFSET_ADVANCED : 0), "<"); + SmallerButton buttonSidePutP = new SmallerButton(0, this.guiLeft + 155, this.guiTop + 43 + (this.isAdvanced + ? OFFSET_ADVANCED + : 0), ">"); + SmallerButton buttonSidePutM = new SmallerButton(1, this.guiLeft + 90, this.guiTop + 43 + (this.isAdvanced + ? OFFSET_ADVANCED + : 0), "<"); - SmallerButton buttonSidePullP = new SmallerButton(2, this.guiLeft + 70, this.guiTop + 43 + (this.isAdvanced ? OFFSET_ADVANCED : 0), ">"); - SmallerButton buttonSidePullM = new SmallerButton(3, this.guiLeft + 5, this.guiTop + 43 + (this.isAdvanced ? OFFSET_ADVANCED : 0), "<"); + SmallerButton buttonSidePullP = new SmallerButton(2, this.guiLeft + 70, this.guiTop + 43 + (this.isAdvanced + ? OFFSET_ADVANCED + : 0), ">"); + SmallerButton buttonSidePullM = new SmallerButton(3, this.guiLeft + 5, this.guiTop + 43 + (this.isAdvanced + ? OFFSET_ADVANCED + : 0), "<"); this.buttonList.add(buttonSidePutP); this.buttonList.add(buttonSidePullP); this.buttonList.add(buttonSidePutM); this.buttonList.add(buttonSidePullM); - this.buttonList.add(new TinyButton(TileEntityInputter.OKAY_BUTTON_ID, this.guiLeft + 84, this.guiTop + 91 + (this.isAdvanced ? OFFSET_ADVANCED : 0))); + this.buttonList.add(new TinyButton(TileEntityInputter.OKAY_BUTTON_ID, this.guiLeft + 84, this.guiTop + 91 + (this.isAdvanced + ? OFFSET_ADVANCED + : 0))); } @Override public void drawScreen(int x, int y, float f) { super.drawScreen(x, y, f); - int newTopOffset = this.guiTop + (this.isAdvanced ? OFFSET_ADVANCED : 0); + int newTopOffset = this.guiTop + (this.isAdvanced + ? OFFSET_ADVANCED + : 0); //Info Mode on! if (x >= this.guiLeft + 4 && y >= newTopOffset + 65 && x <= this.guiLeft + 4 + 38 && y <= newTopOffset + 65 + 12) { this.drawHoveringText(this.fontRenderer.listFormattedStringToWidth(StringUtil.localizeFormatted("info." + ActuallyAdditions.MODID + ".inputter.info.1").replace("

", StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.pull")), 200), x, y); @@ -127,21 +147,43 @@ public class GuiInputter extends GuiWtfMojang { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); - this.drawTexturedModalRect(this.guiLeft, this.guiTop + 97 + (this.isAdvanced ? OFFSET_ADVANCED : 0), 0, 0, 176, 86); + this.drawTexturedModalRect(this.guiLeft, this.guiTop + 97 + (this.isAdvanced + ? OFFSET_ADVANCED + : 0), 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(this.isAdvanced ? RES_LOC_ADVANCED : RES_LOC); - this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 97 + (this.isAdvanced ? OFFSET_ADVANCED : 0)); + this.mc.getTextureManager().bindTexture(this.isAdvanced + ? RES_LOC_ADVANCED + : RES_LOC); + this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 97 + (this.isAdvanced + ? OFFSET_ADVANCED + : 0)); - this.fontRenderer.drawString(StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.inbound"), this.guiLeft + 23 + 3, this.guiTop + 32 + (this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); - this.fontRenderer.drawString(StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.outbound"), this.guiLeft + 104 + 3, this.guiTop + 32 + (this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); + this.fontRenderer.drawString(StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.inbound"), this.guiLeft + 23 + 3, this.guiTop + 32 + (this.isAdvanced + ? OFFSET_ADVANCED + : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); + this.fontRenderer.drawString(StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.outbound"), this.guiLeft + 104 + 3, this.guiTop + 32 + (this.isAdvanced + ? OFFSET_ADVANCED + : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); - this.fontRenderer.drawString(SIDES[this.tileInputter.sideToPull + 1], this.guiLeft + 24 + 1, this.guiTop + 45 + 3 + (this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); - this.fontRenderer.drawString(SIDES[this.tileInputter.sideToPut + 1], this.guiLeft + 109 + 1, this.guiTop + 45 + 3 + (this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); + this.fontRenderer.drawString(SIDES[this.tileInputter.sideToPull + 1], this.guiLeft + 24 + 1, this.guiTop + 45 + 3 + (this.isAdvanced + ? OFFSET_ADVANCED + : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); + this.fontRenderer.drawString(SIDES[this.tileInputter.sideToPut + 1], this.guiLeft + 109 + 1, this.guiTop + 45 + 3 + (this.isAdvanced + ? OFFSET_ADVANCED + : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); - this.fontRenderer.drawString(Integer.toString(this.tileInputter.slotToPutStart), this.guiLeft + 92, this.guiTop + 67 + (this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE); - this.fontRenderer.drawString(Integer.toString(this.tileInputter.slotToPutEnd), this.guiLeft + 136, this.guiTop + 67 + (this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE); - this.fontRenderer.drawString(Integer.toString(this.tileInputter.slotToPullStart), this.guiLeft + 7, this.guiTop + 67 + (this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE); - this.fontRenderer.drawString(Integer.toString(this.tileInputter.slotToPullEnd), this.guiLeft + 51, this.guiTop + 67 + (this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE); + this.fontRenderer.drawString(Integer.toString(this.tileInputter.slotToPutStart), this.guiLeft + 92, this.guiTop + 67 + (this.isAdvanced + ? OFFSET_ADVANCED + : 0), StringUtil.DECIMAL_COLOR_WHITE); + this.fontRenderer.drawString(Integer.toString(this.tileInputter.slotToPutEnd), this.guiLeft + 136, this.guiTop + 67 + (this.isAdvanced + ? OFFSET_ADVANCED + : 0), StringUtil.DECIMAL_COLOR_WHITE); + this.fontRenderer.drawString(Integer.toString(this.tileInputter.slotToPullStart), this.guiLeft + 7, this.guiTop + 67 + (this.isAdvanced + ? OFFSET_ADVANCED + : 0), StringUtil.DECIMAL_COLOR_WHITE); + this.fontRenderer.drawString(Integer.toString(this.tileInputter.slotToPullEnd), this.guiLeft + 51, this.guiTop + 67 + (this.isAdvanced + ? OFFSET_ADVANCED + : 0), StringUtil.DECIMAL_COLOR_WHITE); this.fieldPutStart.drawTextBox(); this.fieldPutEnd.drawTextBox(); @@ -241,7 +283,9 @@ public class GuiInputter extends GuiWtfMojang { } public SmallerButton(int id, int x, int y, String display, boolean smaller) { - super(id, x, y, 16, smaller ? 12 : 16, display); + super(id, x, y, 16, smaller + ? 12 + : 16, display); this.smaller = smaller; } @@ -255,7 +299,9 @@ public class GuiInputter extends GuiWtfMojang { GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); GlStateManager.blendFunc(770, 771); - this.drawTexturedModalRect(this.x, this.y, this.smaller ? 200 : 176, k * this.height, this.width, this.height); + this.drawTexturedModalRect(this.x, this.y, this.smaller + ? 200 + : 176, k * this.height, this.width, this.height); this.mouseDragged(mc, x, y); int color = 14737632; 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 572ddf5ec..28d5fb9c8 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 @@ -10,9 +10,6 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import java.util.ArrayList; -import java.util.List; - import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.inventory.ContainerLaserRelayItemWhitelist; import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiInputter.SmallerButton; @@ -23,12 +20,14 @@ import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.TextFormatting; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; +import java.util.ArrayList; +import java.util.List; + @OnlyIn(Dist.CLIENT) public class GuiLaserRelayItemWhitelist extends GuiWtfMojang { @@ -41,7 +40,7 @@ public class GuiLaserRelayItemWhitelist extends GuiWtfMojang { private GuiButton buttonSmartWhitelistLeft; private GuiButton buttonSmartWhitelistRight; - public GuiLaserRelayItemWhitelist(InventoryPlayer inventory, TileEntityBase tile) { + public GuiLaserRelayItemWhitelist(PlayerInventory inventory, TileEntityBase tile) { super(new ContainerLaserRelayItemWhitelist(inventory, tile)); this.tile = (TileEntityLaserRelayItemWhitelist) tile; this.xSize = 176; 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 be42fe2c8..af9658c1f 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 @@ -18,9 +18,8 @@ import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; @OnlyIn(Dist.CLIENT) @@ -29,7 +28,7 @@ public class GuiMiner extends GuiWtfMojang { private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_breaker"); private final TileEntityMiner miner; - public GuiMiner(InventoryPlayer inventory, TileEntityBase tile) { + public GuiMiner(PlayerInventory inventory, TileEntityBase tile) { super(new ContainerMiner(inventory, tile)); this.miner = (TileEntityMiner) tile; this.xSize = 176; @@ -62,7 +61,9 @@ public class GuiMiner extends GuiWtfMojang { this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); - String mining = this.miner.onlyMineOres ? "Only Mining Ores" : "Mining Everything"; + String mining = this.miner.onlyMineOres + ? "Only Mining Ores" + : "Mining Everything"; this.fontRenderer.drawString(mining, this.guiLeft + this.xSize / 2 - this.fontRenderer.getStringWidth(mining) / 2, this.guiTop + 8, StringUtil.DECIMAL_COLOR_GRAY_TEXT); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java index ff2f34734..2eb4a111f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java @@ -17,9 +17,8 @@ import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.resources.I18n; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; @OnlyIn(Dist.CLIENT) @@ -31,7 +30,7 @@ public class GuiOilGenerator extends GuiWtfMojang { private EnergyDisplay energy; private FluidDisplay fluid; - public GuiOilGenerator(InventoryPlayer inventory, TileEntityBase tile) { + public GuiOilGenerator(PlayerInventory inventory, TileEntityBase tile) { super(new ContainerOilGenerator(inventory, tile)); this.generator = (TileEntityOilGenerator) tile; this.xSize = 176; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiPhantomPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiPhantomPlacer.java index ce1c44a0f..5a18dacf0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiPhantomPlacer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiPhantomPlacer.java @@ -10,10 +10,6 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.inventory.ContainerPhantomPlacer; import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper; @@ -23,19 +19,22 @@ import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.TextFormatting; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + @OnlyIn(Dist.CLIENT) public class GuiPhantomPlacer extends GuiWtfMojang { private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_breaker"); private final TileEntityPhantomPlacer placer; - public GuiPhantomPlacer(InventoryPlayer inventory, TileEntityBase tile) { + public GuiPhantomPlacer(PlayerInventory inventory, TileEntityBase tile) { super(new ContainerPhantomPlacer(inventory, tile)); this.placer = (TileEntityPhantomPlacer) tile; this.xSize = 176; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRangedCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRangedCollector.java index 517a4e5c8..1807333b7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRangedCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRangedCollector.java @@ -17,9 +17,8 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityRangedCollector; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; @OnlyIn(Dist.CLIENT) @@ -30,7 +29,7 @@ public class GuiRangedCollector extends GuiWtfMojang { private FilterSettingsGui filter; - public GuiRangedCollector(InventoryPlayer inventory, TileEntityBase tile) { + public GuiRangedCollector(PlayerInventory inventory, TileEntityBase tile) { super(new ContainerRangedCollector(inventory, tile)); this.collector = (TileEntityRangedCollector) tile; this.xSize = 176; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRepairer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRepairer.java index 23c1d69dd..c5456a8d8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRepairer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRepairer.java @@ -15,9 +15,8 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemRepairer; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.OnlyIn; @OnlyIn(Dist.CLIENT) @@ -27,7 +26,7 @@ public class GuiRepairer extends GuiWtfMojang { private final TileEntityItemRepairer tileRepairer; private EnergyDisplay energy; - public GuiRepairer(InventoryPlayer inventory, TileEntityBase tile) { + public GuiRepairer(PlayerInventory inventory, TileEntityBase tile) { super(new ContainerRepairer(inventory, tile)); this.tileRepairer = (TileEntityItemRepairer) tile; this.xSize = 176; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiWtfMojang.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiWtfMojang.java index 4304dbd44..e26a4ea05 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiWtfMojang.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiWtfMojang.java @@ -10,19 +10,22 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.inventory.Container; +import com.mojang.blaze3d.matrix.MatrixStack; +import net.minecraft.client.gui.screen.inventory.ContainerScreen; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.inventory.container.Container; +import net.minecraft.util.text.StringTextComponent; -public abstract class GuiWtfMojang extends GuiContainer { +public abstract class GuiWtfMojang extends ContainerScreen { - public GuiWtfMojang(Container inventorySlotsIn) { - super(inventorySlotsIn); + public GuiWtfMojang(T inventorySlotsIn, PlayerInventory inventory) { + super(inventorySlotsIn, inventory, StringTextComponent.EMPTY); } @Override - public void drawScreen(int mouseX, int mouseY, float partialTicks) { - this.drawDefaultBackground(); - super.drawScreen(mouseX, mouseY, partialTicks); - this.renderHoveredToolTip(mouseX, mouseY); + public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) { + this.renderBackground(matrixStack); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderHoveredTooltip(matrixStack, mouseX, mouseY); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java index b40a061c8..f1aecc7d9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java @@ -19,7 +19,7 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.OnlyIn; @@ -29,7 +29,7 @@ public class GuiXPSolidifier extends GuiWtfMojang { private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_xp_solidifier"); private final TileEntityXPSolidifier solidifier; - public GuiXPSolidifier(InventoryPlayer inventory, TileEntityBase tile) { + public GuiXPSolidifier(PlayerInventory inventory, TileEntityBase tile) { super(new ContainerXPSolidifier(inventory, tile)); this.solidifier = (TileEntityXPSolidifier) tile; this.xSize = 176; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/slot/SlotImmovable.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/slot/SlotImmovable.java index be9d3099d..0b881de30 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/slot/SlotImmovable.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/slot/SlotImmovable.java @@ -12,7 +12,7 @@ package de.ellpeck.actuallyadditions.mod.inventory.slot; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; +import net.minecraft.inventory.container.Slot; import net.minecraft.item.ItemStack; public class SlotImmovable extends Slot { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java index e4ae3036d..31e4cbaba 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java @@ -15,362 +15,210 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.items.base.*; import de.ellpeck.actuallyadditions.mod.items.lens.ItemLens; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; -import de.ellpeck.actuallyadditions.mod.material.InitArmorMaterials; -import de.ellpeck.actuallyadditions.mod.material.InitToolMaterials; +import de.ellpeck.actuallyadditions.mod.material.ArmorMaterials; +import de.ellpeck.actuallyadditions.mod.material.ToolMaterials; import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChest; import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChestMedium; -import de.ellpeck.actuallyadditions.mod.util.Util; -import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.init.MobEffects; -import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTier; import net.minecraft.potion.PotionEffect; import net.minecraft.tileentity.TileEntityChest; +import net.minecraftforge.fml.RegistryObject; +import net.minecraftforge.registries.DeferredRegister; +import net.minecraftforge.registries.ForgeRegistries; public final class InitItems { + public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, ActuallyAdditions.MODID); - public static Item itemBooklet; - public static Item itemFertilizer; - public static Item itemMisc; - public static Item itemCanola; - public static Item itemCoffeeCup; - public static Item itemFoods; - public static Item itemJams; - public static Item itemKnife; - public static Item itemCrafterOnAStick; - public static Item itemDust; - public static Item itemSolidifiedExperience; - public static Item itemLeafBlower; - public static Item itemLeafBlowerAdvanced; - public static Item itemPotionRing; - public static Item itemPotionRingAdvanced; - public static Item itemPickaxeEmerald; - public static Item itemAxeEmerald; - public static Item itemShovelEmerald; - public static Item itemSwordEmerald; - public static Item itemHoeEmerald; - public static Item itemHelmEmerald; - public static Item itemChestEmerald; - public static Item itemPantsEmerald; - public static Item itemBootsEmerald; - public static Item itemPickaxeObsidian; - public static Item itemAxeObsidian; - public static Item itemShovelObsidian; - public static Item itemSwordObsidian; - public static Item itemHoeObsidian; - public static Item itemPickaxeQuartz; - public static Item itemAxeQuartz; - public static Item itemShovelQuartz; - public static Item itemSwordQuartz; - public static Item itemHoeQuartz; - public static Item itemHelmObsidian; - public static Item itemChestObsidian; - public static Item itemPantsObsidian; - public static Item itemBootsObsidian; - public static Item itemHelmQuartz; - public static Item itemChestQuartz; - public static Item itemPantsQuartz; - public static Item itemBootsQuartz; - public static Item itemHairyBall; - public static Item itemRiceSeed; - public static Item itemCanolaSeed; - public static Item itemFlaxSeed; - public static Item itemCoffeeSeed; - public static Item itemResonantRice; - public static Item itemPhantomConnector; - public static Item itemCoffeeBean; - public static Item itemCoffee; - public static Item woodenPaxel; - public static Item stonePaxel; - public static Item ironPaxel; - public static Item diamondPaxel; - public static Item goldPaxel; - public static Item emeraldPaxel; - public static Item obsidianPaxel; - public static Item quartzPaxel; - public static Item itemDrill; - public static Item itemDrillUpgradeSpeed; - public static Item itemDrillUpgradeSpeedII; - public static Item itemDrillUpgradeSpeedIII; - public static Item itemDrillUpgradeSilkTouch; - public static Item itemDrillUpgradeFortune; - public static Item itemDrillUpgradeFortuneII; - public static Item itemDrillUpgradeThreeByThree; - public static Item itemDrillUpgradeFiveByFive; - public static Item itemDrillUpgradeBlockPlacing; - public static Item itemBattery; - public static Item itemBatteryDouble; - public static Item itemBatteryTriple; - public static Item itemBatteryQuadruple; - public static Item itemBatteryQuintuple; - public static Item itemTeleStaff; - public static Item itemWingsOfTheBats; - public static Item itemGrowthRing; - public static Item itemMagnetRing; - public static Item itemWaterRemovalRing; - public static Item itemChestToCrateUpgrade; - public static Item itemSmallToMediumCrateUpgrade; - public static Item itemMediumToLargeCrateUpgrade; - public static Item itemCrateKeeper; - public static Item itemSpawnerChanger; - public static Item itemLaserWrench; - public static Item itemCrystal; - public static Item itemCrystalEmpowered; - public static Item itemColorLens; - public static Item itemExplosionLens; - public static Item itemDamageLens; - public static Item itemMoreDamageLens; - public static Item itemDisenchantingLens; - public static Item itemMiningLens; - public static Item itemPickaxeCrystalRed; - public static Item itemAxeCrystalRed; - public static Item itemShovelCrystalRed; - public static Item itemSwordCrystalRed; - public static Item itemHoeCrystalRed; - public static Item itemHelmCrystalRed; - public static Item itemChestCrystalRed; - public static Item itemPantsCrystalRed; - public static Item itemBootsCrystalRed; - public static Item itemPaxelCrystalRed; - public static Item itemPickaxeCrystalBlue; - public static Item itemAxeCrystalBlue; - public static Item itemShovelCrystalBlue; - public static Item itemSwordCrystalBlue; - public static Item itemHoeCrystalBlue; - public static Item itemHelmCrystalBlue; - public static Item itemChestCrystalBlue; - public static Item itemPantsCrystalBlue; - public static Item itemBootsCrystalBlue; - public static Item itemPaxelCrystalBlue; - public static Item itemPickaxeCrystalLightBlue; - public static Item itemAxeCrystalLightBlue; - public static Item itemShovelCrystalLightBlue; - public static Item itemSwordCrystalLightBlue; - public static Item itemHoeCrystalLightBlue; - public static Item itemHelmCrystalLightBlue; - public static Item itemChestCrystalLightBlue; - public static Item itemPantsCrystalLightBlue; - public static Item itemBootsCrystalLightBlue; - public static Item itemPaxelCrystalLightBlue; - public static Item itemPickaxeCrystalBlack; - public static Item itemAxeCrystalBlack; - public static Item itemShovelCrystalBlack; - public static Item itemSwordCrystalBlack; - public static Item itemHoeCrystalBlack; - public static Item itemHelmCrystalBlack; - public static Item itemChestCrystalBlack; - public static Item itemPantsCrystalBlack; - public static Item itemBootsCrystalBlack; - public static Item itemPaxelCrystalBlack; - public static Item itemPickaxeCrystalGreen; - public static Item itemAxeCrystalGreen; - public static Item itemShovelCrystalGreen; - public static Item itemSwordCrystalGreen; - public static Item itemHoeCrystalGreen; - public static Item itemHelmCrystalGreen; - public static Item itemChestCrystalGreen; - public static Item itemPantsCrystalGreen; - public static Item itemBootsCrystalGreen; - public static Item itemPaxelCrystalGreen; - public static Item itemPickaxeCrystalWhite; - public static Item itemAxeCrystalWhite; - public static Item itemShovelCrystalWhite; - public static Item itemSwordCrystalWhite; - public static Item itemHoeCrystalWhite; - public static Item itemHelmCrystalWhite; - public static Item itemChestCrystalWhite; - public static Item itemPantsCrystalWhite; - public static Item itemBootsCrystalWhite; - public static Item itemPaxelCrystalWhite; - public static Item itemWaterBowl; - public static Item itemFilter; - public static Item itemPlayerProbe; - public static Item itemWorm; - public static Item itemBag; - public static Item itemVoidBag; - public static Item itemFillingWand; - public static Item itemLaserUpgradeInvisibility; - public static Item itemLaserUpgradeRange; - public static Item itemEngineerGoggles; - public static Item itemEngineerGogglesAdvanced; - public static Item itemCrystalShard; + // REMOVE ME + @Deprecated + public static final RegistryObject itemMisc = ITEMS.register("item_misc", ItemBase::new); - public static void init() { - ActuallyAdditions.LOGGER.info("Initializing Items..."); + // SHARDS + public static final RegistryObject RESTONIA_CRYSTAL_SHARD = ITEMS.register("item_restonia_crystal_shard", ItemBase::new); + public static final RegistryObject PALIS_CRYSTAL_SHARD = ITEMS.register("item_palis_crystal_shard", ItemBase::new); + public static final RegistryObject DIAMATINE_CRYSTAL_SHARD = ITEMS.register("item_diamatine_crystal_shard", ItemBase::new); + public static final RegistryObject VOID_CRYSTAL_SHARD = ITEMS.register("item_void_crystal_shard", ItemBase::new); + public static final RegistryObject EMERADIC_CRYSTAL_SHARD = ITEMS.register("item_emeradic_crystal_shard", ItemBase::new); + public static final RegistryObject ENORI_CRYSTAL_SHARD = ITEMS.register("item_enori_crystal_shard", ItemBase::new); - itemCrystalShard = new ItemCrystalShard("item_crystal_shard"); - itemEngineerGogglesAdvanced = new ItemEngineerGoggles("item_engineer_goggles_advanced", true); - itemEngineerGoggles = new ItemEngineerGoggles("item_engineer_goggles", false); - itemLaserUpgradeRange = new ItemLaserRelayUpgrade("item_laser_upgrade_range"); - itemLaserUpgradeInvisibility = new ItemLaserRelayUpgrade("item_laser_upgrade_invisibility"); - itemFillingWand = new ItemFillingWand("item_filling_wand"); - itemBag = new ItemBag("item_bag", false); - itemVoidBag = new ItemBag("item_void_bag", true); - itemWorm = new ItemWorm("item_worm"); - itemPlayerProbe = new ItemPlayerProbe("item_player_probe"); - itemFilter = new ItemFilter("item_filter"); - itemWaterBowl = new ItemWaterBowl("item_water_bowl"); - itemSpawnerChanger = new ItemSpawnerChanger("item_spawner_changer"); - itemMisc = new ItemMisc("item_misc"); - itemCrateKeeper = new ItemGeneric("item_crate_keeper").setMaxStackSize(1); - itemColorLens = new ItemLens("item_color_lens", ActuallyAdditionsAPI.lensColor); - itemExplosionLens = new ItemLens("item_explosion_lens", ActuallyAdditionsAPI.lensDetonation); - itemDamageLens = new ItemLens("item_damage_lens", ActuallyAdditionsAPI.lensDeath); - itemMoreDamageLens = new ItemLens("item_more_damage_lens", ActuallyAdditionsAPI.lensEvenMoarDeath); - itemDisenchantingLens = new ItemLens("item_disenchanting_lens", ActuallyAdditionsAPI.lensDisenchanting); - itemMiningLens = new ItemLens("item_mining_lens", ActuallyAdditionsAPI.lensMining); - itemCrystal = new ItemCrystal("item_crystal", false); - itemCrystalEmpowered = new ItemCrystal("item_crystal_empowered", true); - itemLaserWrench = new ItemLaserWrench("item_laser_wrench"); - itemChestToCrateUpgrade = new ItemChestToCrateUpgrade("item_chest_to_crate_upgrade", TileEntityChest.class, InitBlocks.blockGiantChest.getDefaultState()); - itemSmallToMediumCrateUpgrade = new ItemChestToCrateUpgrade("item_small_to_medium_crate_upgrade", TileEntityGiantChest.class, InitBlocks.blockGiantChestMedium.getDefaultState()); - itemMediumToLargeCrateUpgrade = new ItemChestToCrateUpgrade("item_medium_to_large_crate_upgrade", TileEntityGiantChestMedium.class, InitBlocks.blockGiantChestLarge.getDefaultState()); - itemBooklet = new ItemBooklet("item_booklet"); - itemGrowthRing = new ItemGrowthRing("item_growth_ring"); - itemMagnetRing = new ItemMagnetRing("item_suction_ring"); - itemWaterRemovalRing = new ItemWaterRemovalRing("item_water_removal_ring"); - itemHelmEmerald = new ItemArmorAA("item_helm_emerald", InitArmorMaterials.armorMaterialEmerald, 0, new ItemStack(Items.EMERALD)); - itemChestEmerald = new ItemArmorAA("item_chest_emerald", InitArmorMaterials.armorMaterialEmerald, 1, new ItemStack(Items.EMERALD)); - itemPantsEmerald = new ItemArmorAA("item_pants_emerald", InitArmorMaterials.armorMaterialEmerald, 2, new ItemStack(Items.EMERALD)); - itemBootsEmerald = new ItemArmorAA("item_boots_emerald", InitArmorMaterials.armorMaterialEmerald, 3, new ItemStack(Items.EMERALD)); - itemHelmObsidian = new ItemArmorAA("item_helm_obsidian", InitArmorMaterials.armorMaterialObsidian, 0, new ItemStack(Blocks.OBSIDIAN)); - itemChestObsidian = new ItemArmorAA("item_chest_obsidian", InitArmorMaterials.armorMaterialObsidian, 1, new ItemStack(Blocks.OBSIDIAN)); - itemPantsObsidian = new ItemArmorAA("item_pants_obsidian", InitArmorMaterials.armorMaterialObsidian, 2, new ItemStack(Blocks.OBSIDIAN)); - itemBootsObsidian = new ItemArmorAA("item_boots_obsidian", InitArmorMaterials.armorMaterialObsidian, 3, new ItemStack(Blocks.OBSIDIAN)); - itemHelmQuartz = new ItemArmorAA("item_helm_quartz", InitArmorMaterials.armorMaterialQuartz, 0, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())); - itemChestQuartz = new ItemArmorAA("item_chest_quartz", InitArmorMaterials.armorMaterialQuartz, 1, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())); - itemPantsQuartz = new ItemArmorAA("item_pants_quartz", InitArmorMaterials.armorMaterialQuartz, 2, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())); - itemBootsQuartz = new ItemArmorAA("item_boots_quartz", InitArmorMaterials.armorMaterialQuartz, 3, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())); - itemTeleStaff = new ItemTeleStaff("item_tele_staff"); - itemWingsOfTheBats = new ItemWingsOfTheBats("item_wings_of_the_bats"); - itemDrill = new ItemDrill("item_drill"); - itemBattery = new ItemBattery("item_battery", 200000, 1000); - itemBatteryDouble = new ItemBattery("item_battery_double", 350000, 5000); - itemBatteryTriple = new ItemBattery("item_battery_triple", 600000, 10000); - itemBatteryQuadruple = new ItemBattery("item_battery_quadruple", 1000000, 30000); - itemBatteryQuintuple = new ItemBattery("item_battery_quintuple", 2000000, 100000); - itemDrillUpgradeSpeed = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.SPEED, "item_drill_upgrade_speed"); - itemDrillUpgradeSpeedII = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.SPEED_II, "item_drill_upgrade_speed_ii"); - itemDrillUpgradeSpeedIII = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.SPEED_III, "item_drill_upgrade_speed_iii"); - itemDrillUpgradeSilkTouch = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.SILK_TOUCH, "item_drill_upgrade_silk_touch"); - itemDrillUpgradeFortune = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.FORTUNE, "item_drill_upgrade_fortune"); - itemDrillUpgradeFortuneII = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.FORTUNE_II, "item_drill_upgrade_fortune_ii"); - itemDrillUpgradeThreeByThree = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.THREE_BY_THREE, "item_drill_upgrade_three_by_three"); - itemDrillUpgradeFiveByFive = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE, "item_drill_upgrade_five_by_five"); - itemDrillUpgradeBlockPlacing = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.PLACER, "item_drill_upgrade_block_placing"); - itemFertilizer = new ItemFertilizer("item_fertilizer"); - itemCoffee = new ItemCoffee("item_coffee"); - itemPhantomConnector = new ItemPhantomConnector("item_phantom_connector"); - itemResonantRice = new ItemResonantRice("item_resonant_rice"); - itemFoods = new ItemFoods("item_food"); - itemJams = new ItemJams("item_jam"); - itemKnife = new ItemKnife("item_knife"); - itemCrafterOnAStick = new ItemCrafterOnAStick("item_crafter_on_a_stick"); - itemDust = new ItemDust("item_dust"); - itemSolidifiedExperience = new ItemSolidifiedExperience("item_solidified_experience"); - itemLeafBlower = new ItemLeafBlower(false, "item_leaf_blower"); - itemLeafBlowerAdvanced = new ItemLeafBlower(true, "item_leaf_blower_advanced"); - itemPotionRing = new ItemPotionRing(false, "item_potion_ring"); - itemPotionRingAdvanced = new ItemPotionRing(true, "item_potion_ring_advanced"); - itemHairyBall = new ItemHairyBall("item_hairy_ball"); - itemCoffeeBean = new ItemCoffeeBean("item_coffee_beans"); - itemRiceSeed = new ItemSeed("item_rice_seed", "seedRice", InitBlocks.blockRice, itemFoods, TheFoods.RICE.ordinal()); - itemCanolaSeed = new ItemFoodSeed("item_canola_seed", "seedCanola", InitBlocks.blockCanola, itemMisc, TheMiscItems.CANOLA.ordinal(), 1, 0.01F, 10).setPotionEffect(new PotionEffect(MobEffects.NAUSEA, 1000, 0), 0.2F); - itemFlaxSeed = new ItemSeed("item_flax_seed", "seedFlax", InitBlocks.blockFlax, Items.STRING, 0); - itemCoffeeSeed = new ItemSeed("item_coffee_seed", "seedCoffeeBeans", InitBlocks.blockCoffee, itemCoffeeBean, 0); - itemPickaxeEmerald = new ItemPickaxeAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.EMERALD), "item_pickaxe_emerald", EnumRarity.EPIC); - itemAxeEmerald = new ItemAxeAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.EMERALD), "item_axe_emerald", EnumRarity.EPIC); - itemShovelEmerald = new ItemShovelAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.EMERALD), "item_shovel_emerald", EnumRarity.EPIC); - itemSwordEmerald = new ItemSwordAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.EMERALD), "item_sword_emerald", EnumRarity.EPIC); - itemHoeEmerald = new ItemHoeAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.EMERALD), "item_hoe_emerald", EnumRarity.EPIC); - itemPickaxeObsidian = new ItemPickaxeAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.OBSIDIAN), "item_pickaxe_obsidian", EnumRarity.UNCOMMON); - itemAxeObsidian = new ItemAxeAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.OBSIDIAN), "item_axe_obsidian", EnumRarity.UNCOMMON); - itemShovelObsidian = new ItemShovelAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.OBSIDIAN), "item_shovel_obsidian", EnumRarity.UNCOMMON); - itemSwordObsidian = new ItemSwordAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.OBSIDIAN), "item_sword_obsidian", EnumRarity.UNCOMMON); - itemHoeObsidian = new ItemHoeAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.OBSIDIAN), "item_hoe_obsidian", EnumRarity.UNCOMMON); - itemPickaxeQuartz = new ItemPickaxeAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "item_pickaxe_quartz", EnumRarity.RARE); - itemAxeQuartz = new ItemAxeAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "item_axe_quartz", EnumRarity.RARE); - itemShovelQuartz = new ItemShovelAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "item_shovel_quartz", EnumRarity.RARE); - itemSwordQuartz = new ItemSwordAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "item_sword_quartz", EnumRarity.RARE); - itemHoeQuartz = new ItemHoeAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "item_hoe_quartz", EnumRarity.RARE); - woodenPaxel = new ItemAllToolAA(Item.ToolMaterial.WOOD, "plank_wood", "wooden_paxel", EnumRarity.UNCOMMON, 5192733); - stonePaxel = new ItemAllToolAA(Item.ToolMaterial.STONE, new ItemStack(Blocks.COBBLESTONE), "stone_paxel", EnumRarity.UNCOMMON, 7040621); - ironPaxel = new ItemAllToolAA(Item.ToolMaterial.IRON, new ItemStack(Items.IRON_INGOT), "iron_paxel", EnumRarity.RARE, 10920613); - goldPaxel = new ItemAllToolAA(Item.ToolMaterial.GOLD, new ItemStack(Items.GOLD_INGOT), "gold_paxel", EnumRarity.RARE, 16770048); - diamondPaxel = new ItemAllToolAA(Item.ToolMaterial.DIAMOND, new ItemStack(Items.DIAMOND), "diamond_paxel", EnumRarity.EPIC, 3250376); - emeraldPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.EMERALD), "emerald_paxel", EnumRarity.EPIC, 7723338); - obsidianPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.OBSIDIAN), "obsidian_paxel", EnumRarity.EPIC, 4166); - quartzPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "quartz_paxel", EnumRarity.RARE, 1710103); + // CRYSTALS + public static final RegistryObject RESTONIA_CRYSTAL = ITEMS.register("restonia_crystal", ItemBase::new); + public static final RegistryObject PALIS_CRYSTAL = ITEMS.register("palis_crystal", ItemBase::new); + public static final RegistryObject DIAMATINE_CRYSTAL = ITEMS.register("diamatine_crystal", ItemBase::new); + public static final RegistryObject VOID_CRYSTAL = ITEMS.register("void_crystal", ItemBase::new); + public static final RegistryObject EMERADIC_CRYSTAL = ITEMS.register("emeradic_crystal", ItemBase::new); + public static final RegistryObject ENORI_CRYSTAL = ITEMS.register("enori_crystal", ItemBase::new); - itemPickaxeCrystalRed = new ItemPickaxeAA(InitToolMaterials.toolMaterialCrystalRed, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), "item_pickaxe_crystal_red", Util.CRYSTAL_RED_RARITY); - itemAxeCrystalRed = new ItemAxeAA(InitToolMaterials.toolMaterialCrystalRed, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), "item_axe_crystal_red", Util.CRYSTAL_RED_RARITY); - itemShovelCrystalRed = new ItemShovelAA(InitToolMaterials.toolMaterialCrystalRed, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), "item_shovel_crystal_red", Util.CRYSTAL_RED_RARITY); - itemSwordCrystalRed = new ItemSwordAA(InitToolMaterials.toolMaterialCrystalRed, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), "item_sword_crystal_red", Util.CRYSTAL_RED_RARITY); - itemHoeCrystalRed = new ItemHoeAA(InitToolMaterials.toolMaterialCrystalRed, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), "item_hoe_crystal_red", Util.CRYSTAL_RED_RARITY); - itemHelmCrystalRed = new ItemArmorAA("item_helm_crystal_red", InitArmorMaterials.armorMaterialCrystalRed, 0, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), Util.CRYSTAL_RED_RARITY); - itemChestCrystalRed = new ItemArmorAA("item_chest_crystal_red", InitArmorMaterials.armorMaterialCrystalRed, 1, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), Util.CRYSTAL_RED_RARITY); - itemPantsCrystalRed = new ItemArmorAA("item_pants_crystal_red", InitArmorMaterials.armorMaterialCrystalRed, 2, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), Util.CRYSTAL_RED_RARITY); - itemBootsCrystalRed = new ItemArmorAA("item_boots_crystal_red", InitArmorMaterials.armorMaterialCrystalRed, 3, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), Util.CRYSTAL_RED_RARITY); - itemPaxelCrystalRed = new ItemAllToolAA(InitToolMaterials.toolMaterialCrystalRed, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), "item_paxel_crystal_red", Util.CRYSTAL_RED_RARITY, 16711689); + public static final RegistryObject RESTONIA_EMPOWERED_CRYSTAL = ITEMS.register("restonia_empowered_crystal", ItemBase::new); + public static final RegistryObject PALIS_EMPOWERED_CRYSTAL = ITEMS.register("palis_empowered_crystal", ItemBase::new); + public static final RegistryObject DIAMATINE_EMPOWERED_CRYSTAL = ITEMS.register("diamatine_empowered_crystal", ItemBase::new); + public static final RegistryObject VOID_EMPOWERED_CRYSTAL = ITEMS.register("void_empowered_crystal", ItemBase::new); + public static final RegistryObject EMERADIC_EMPOWERED_CRYSTAL = ITEMS.register("emeradic_empowered_crystal", ItemBase::new); + public static final RegistryObject ENORI_EMPOWERED_CRYSTAL = ITEMS.register("enori_empowered_crystal", ItemBase::new); - itemPickaxeCrystalBlue = new ItemPickaxeAA(InitToolMaterials.toolMaterialCrystalBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), "item_pickaxe_crystal_blue", Util.CRYSTAL_BLUE_RARITY); - itemAxeCrystalBlue = new ItemAxeAA(InitToolMaterials.toolMaterialCrystalBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), "item_axe_crystal_blue", Util.CRYSTAL_BLUE_RARITY); - itemShovelCrystalBlue = new ItemShovelAA(InitToolMaterials.toolMaterialCrystalBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), "item_shovel_crystal_blue", Util.CRYSTAL_BLUE_RARITY); - itemSwordCrystalBlue = new ItemSwordAA(InitToolMaterials.toolMaterialCrystalBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), "item_sword_crystal_blue", Util.CRYSTAL_BLUE_RARITY); - itemHoeCrystalBlue = new ItemHoeAA(InitToolMaterials.toolMaterialCrystalBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), "item_hoe_crystal_blue", Util.CRYSTAL_BLUE_RARITY); - itemHelmCrystalBlue = new ItemArmorAA("item_helm_crystal_blue", InitArmorMaterials.armorMaterialCrystalBlue, 0, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), Util.CRYSTAL_BLUE_RARITY); - itemChestCrystalBlue = new ItemArmorAA("item_chest_crystal_blue", InitArmorMaterials.armorMaterialCrystalBlue, 1, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), Util.CRYSTAL_BLUE_RARITY); - itemPantsCrystalBlue = new ItemArmorAA("item_pants_crystal_blue", InitArmorMaterials.armorMaterialCrystalBlue, 2, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), Util.CRYSTAL_BLUE_RARITY); - itemBootsCrystalBlue = new ItemArmorAA("item_boots_crystal_blue", InitArmorMaterials.armorMaterialCrystalBlue, 3, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), Util.CRYSTAL_BLUE_RARITY); - itemPaxelCrystalBlue = new ItemAllToolAA(InitToolMaterials.toolMaterialCrystalBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), "item_paxel_crystal_blue", Util.CRYSTAL_BLUE_RARITY, 3014911); + // BLACK QUARTZ + public static final RegistryObject BLACK_QUARTZ = ITEMS.register("black_quartz", ItemBase::new)); - itemPickaxeCrystalLightBlue = new ItemPickaxeAA(InitToolMaterials.toolMaterialCrystalLightBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), "item_pickaxe_crystal_light_blue", Util.CRYSTAL_LIGHT_BLUE_RARITY); - itemAxeCrystalLightBlue = new ItemAxeAA(InitToolMaterials.toolMaterialCrystalLightBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), "item_axe_crystal_light_blue", Util.CRYSTAL_LIGHT_BLUE_RARITY); - itemShovelCrystalLightBlue = new ItemShovelAA(InitToolMaterials.toolMaterialCrystalLightBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), "item_shovel_crystal_light_blue", Util.CRYSTAL_LIGHT_BLUE_RARITY); - itemSwordCrystalLightBlue = new ItemSwordAA(InitToolMaterials.toolMaterialCrystalLightBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), "item_sword_crystal_light_blue", Util.CRYSTAL_LIGHT_BLUE_RARITY); - itemHoeCrystalLightBlue = new ItemHoeAA(InitToolMaterials.toolMaterialCrystalLightBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), "item_hoe_crystal_light_blue", Util.CRYSTAL_LIGHT_BLUE_RARITY); - itemHelmCrystalLightBlue = new ItemArmorAA("item_helm_crystal_light_blue", InitArmorMaterials.armorMaterialCrystalLightBlue, 0, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), Util.CRYSTAL_LIGHT_BLUE_RARITY); - itemChestCrystalLightBlue = new ItemArmorAA("item_chest_crystal_light_blue", InitArmorMaterials.armorMaterialCrystalLightBlue, 1, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), Util.CRYSTAL_LIGHT_BLUE_RARITY); - itemPantsCrystalLightBlue = new ItemArmorAA("item_pants_crystal_light_blue", InitArmorMaterials.armorMaterialCrystalLightBlue, 2, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), Util.CRYSTAL_LIGHT_BLUE_RARITY); - itemBootsCrystalLightBlue = new ItemArmorAA("item_boots_crystal_light_blue", InitArmorMaterials.armorMaterialCrystalLightBlue, 3, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), Util.CRYSTAL_LIGHT_BLUE_RARITY); - itemPaxelCrystalLightBlue = new ItemAllToolAA(InitToolMaterials.toolMaterialCrystalLightBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), "item_paxel_crystal_light_blue", Util.CRYSTAL_LIGHT_BLUE_RARITY, 4093108); + @Deprecated + public static final RegistryObject itemCrystal = ITEMS.register("", new ItemCrystal("item_crystal", false)); + @Deprecated + public static final RegistryObject itemCrystalEmpowered = ITEMS.register("", new ItemCrystal("item_crystal_empowered", true)); - itemPickaxeCrystalBlack = new ItemPickaxeAA(InitToolMaterials.toolMaterialCrystalBlack, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), "item_pickaxe_crystal_black", Util.CRYSTAL_BLACK_RARITY); - itemAxeCrystalBlack = new ItemAxeAA(InitToolMaterials.toolMaterialCrystalBlack, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), "item_axe_crystal_black", Util.CRYSTAL_BLACK_RARITY); - itemShovelCrystalBlack = new ItemShovelAA(InitToolMaterials.toolMaterialCrystalBlack, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), "item_shovel_crystal_black", Util.CRYSTAL_BLACK_RARITY); - itemSwordCrystalBlack = new ItemSwordAA(InitToolMaterials.toolMaterialCrystalBlack, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), "item_sword_crystal_black", Util.CRYSTAL_BLACK_RARITY); - itemHoeCrystalBlack = new ItemHoeAA(InitToolMaterials.toolMaterialCrystalBlack, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), "item_hoe_crystal_black", Util.CRYSTAL_BLACK_RARITY); - itemHelmCrystalBlack = new ItemArmorAA("item_helm_crystal_black", InitArmorMaterials.armorMaterialCrystalBlack, 0, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), Util.CRYSTAL_BLACK_RARITY); - itemChestCrystalBlack = new ItemArmorAA("item_chest_crystal_black", InitArmorMaterials.armorMaterialCrystalBlack, 1, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), Util.CRYSTAL_BLACK_RARITY); - itemPantsCrystalBlack = new ItemArmorAA("item_pants_crystal_black", InitArmorMaterials.armorMaterialCrystalBlack, 2, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), Util.CRYSTAL_BLACK_RARITY); - itemBootsCrystalBlack = new ItemArmorAA("item_boots_crystal_black", InitArmorMaterials.armorMaterialCrystalBlack, 3, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), Util.CRYSTAL_BLACK_RARITY); - itemPaxelCrystalBlack = new ItemAllToolAA(InitToolMaterials.toolMaterialCrystalBlack, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), "item_paxel_crystal_black", Util.CRYSTAL_BLACK_RARITY, 2631982); + public static final RegistryObject itemEngineerGogglesAdvanced = ITEMS.register("", new ItemEngineerGoggles("item_engineer_goggles_advanced", true)); + public static final RegistryObject itemEngineerGoggles = ITEMS.register("", new ItemEngineerGoggles("item_engineer_goggles", false)); + public static final RegistryObject itemLaserUpgradeRange = ITEMS.register("item_laser_upgrade_range", ItemLaserRelayUpgrade::new); + public static final RegistryObject itemLaserUpgradeInvisibility = ITEMS.register("item_laser_upgrade_invisibility", ItemLaserRelayUpgrade::new); + public static final RegistryObject itemFillingWand = ITEMS.register("item_filling_wand", ItemFillingWand::new); + public static final RegistryObject itemBag = ITEMS.register("", new ItemBag("item_bag", false)); + public static final RegistryObject itemVoidBag = ITEMS.register("", new ItemBag("item_void_bag", true)); + public static final RegistryObject itemWorm = ITEMS.register("item_worm", ItemWorm::new); + public static final RegistryObject itemPlayerProbe = ITEMS.register("item_player_probe", ItemPlayerProbe::new); + public static final RegistryObject itemFilter = ITEMS.register("item_filter", ItemFilter::new); + public static final RegistryObject itemWaterBowl = ITEMS.register("item_water_bowl", ItemWaterBowl::new); + public static final RegistryObject itemSpawnerChanger = ITEMS.register("item_spawner_changer", ItemSpawnerChanger::new); + public static final RegistryObject itemCrateKeeper = ITEMS.register("item_crate_keeper", ItemGeneric::new.setMaxStackSize(1)); + public static final RegistryObject itemColorLens = ITEMS.register("", new ItemLens("item_color_lens", ActuallyAdditionsAPI.lensColor)); + public static final RegistryObject itemExplosionLens = ITEMS.register("", new ItemLens("item_explosion_lens", ActuallyAdditionsAPI.lensDetonation)); + public static final RegistryObject itemDamageLens = ITEMS.register("", new ItemLens("item_damage_lens", ActuallyAdditionsAPI.lensDeath)); + public static final RegistryObject itemMoreDamageLens = ITEMS.register("", new ItemLens("item_more_damage_lens", ActuallyAdditionsAPI.lensEvenMoarDeath)); + public static final RegistryObject itemDisenchantingLens = ITEMS.register("", new ItemLens("item_disenchanting_lens", ActuallyAdditionsAPI.lensDisenchanting)); + public static final RegistryObject itemMiningLens = ITEMS.register("", new ItemLens("item_mining_lens", ActuallyAdditionsAPI.lensMining)); + public static final RegistryObject itemLaserWrench = ITEMS.register("item_laser_wrench", ItemLaserWrench::new); + public static final RegistryObject itemChestToCrateUpgrade = ITEMS.register("", new ItemChestToCrateUpgrade("item_chest_to_crate_upgrade", TileEntityChest.class, InitBlocks.blockGiantChest.getDefaultState())); + public static final RegistryObject itemSmallToMediumCrateUpgrade = ITEMS.register("", new ItemChestToCrateUpgrade("item_small_to_medium_crate_upgrade", TileEntityGiantChest.class, InitBlocks.blockGiantChestMedium.getDefaultState())); + public static final RegistryObject itemMediumToLargeCrateUpgrade = ITEMS.register("", new ItemChestToCrateUpgrade("item_medium_to_large_crate_upgrade", TileEntityGiantChestMedium.class, InitBlocks.blockGiantChestLarge.getDefaultState())); + public static final RegistryObject itemBooklet = ITEMS.register("item_booklet", ItemBooklet::new); + public static final RegistryObject itemGrowthRing = ITEMS.register("item_growth_ring", ItemGrowthRing::new); + public static final RegistryObject itemMagnetRing = ITEMS.register("item_suction_ring", ItemMagnetRing::new); + public static final RegistryObject itemWaterRemovalRing = ITEMS.register("item_water_removal_ring", ItemWaterRemovalRing::new); + public static final RegistryObject itemTeleStaff = ITEMS.register("item_tele_staff", ItemTeleStaff::new); + public static final RegistryObject itemWingsOfTheBats = ITEMS.register("item_wings_of_the_bats", ItemWingsOfTheBats::new); + public static final RegistryObject itemDrill = ITEMS.register("item_drill", ItemDrill::new); + public static final RegistryObject itemBattery = ITEMS.register("", new ItemBattery("item_battery", 200000, 1000)); + public static final RegistryObject itemBatteryDouble = ITEMS.register("", new ItemBattery("item_battery_double", 350000, 5000)); + public static final RegistryObject itemBatteryTriple = ITEMS.register("", new ItemBattery("item_battery_triple", 600000, 10000)); + public static final RegistryObject itemBatteryQuadruple = ITEMS.register("", new ItemBattery("item_battery_quadruple", 1000000, 30000)); + public static final RegistryObject itemBatteryQuintuple = ITEMS.register("", new ItemBattery("item_battery_quintuple", 2000000, 100000)); + public static final RegistryObject itemDrillUpgradeSpeed = ITEMS.register("", new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.SPEED, "item_drill_upgrade_speed")); + public static final RegistryObject itemDrillUpgradeSpeedII = ITEMS.register("", new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.SPEED_II, "item_drill_upgrade_speed_ii")); + public static final RegistryObject itemDrillUpgradeSpeedIII = ITEMS.register("", new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.SPEED_III, "item_drill_upgrade_speed_iii")); + public static final RegistryObject itemDrillUpgradeSilkTouch = ITEMS.register("", new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.SILK_TOUCH, "item_drill_upgrade_silk_touch")); + public static final RegistryObject itemDrillUpgradeFortune = ITEMS.register("", new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.FORTUNE, "item_drill_upgrade_fortune")); + public static final RegistryObject itemDrillUpgradeFortuneII = ITEMS.register("", new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.FORTUNE_II, "item_drill_upgrade_fortune_ii")); + public static final RegistryObject itemDrillUpgradeThreeByThree = ITEMS.register("", new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.THREE_BY_THREE, "item_drill_upgrade_three_by_three")); + public static final RegistryObject itemDrillUpgradeFiveByFive = ITEMS.register("", new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE, "item_drill_upgrade_five_by_five")); + public static final RegistryObject itemDrillUpgradeBlockPlacing = ITEMS.register("", new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.PLACER, "item_drill_upgrade_block_placing")); + public static final RegistryObject itemFertilizer = ITEMS.register("item_fertilizer", ItemFertilizer::new); + public static final RegistryObject itemCoffee = ITEMS.register("item_coffee", ItemCoffee::new); + public static final RegistryObject itemPhantomConnector = ITEMS.register("item_phantom_connector", ItemPhantomConnector::new); + public static final RegistryObject itemResonantRice = ITEMS.register("item_resonant_rice", ItemResonantRice::new); + public static final RegistryObject itemFoods = ITEMS.register("item_food", ItemFoods::new); + public static final RegistryObject itemJams = ITEMS.register("item_jam", ItemJams::new); + public static final RegistryObject itemKnife = ITEMS.register("item_knife", ItemKnife::new); + public static final RegistryObject itemCrafterOnAStick = ITEMS.register("item_crafter_on_a_stick", ItemCrafterOnAStick::new); + public static final RegistryObject itemDust = ITEMS.register("item_dust", ItemDust::new); + public static final RegistryObject itemSolidifiedExperience = ITEMS.register("item_solidified_experience", ItemSolidifiedExperience::new); + public static final RegistryObject itemLeafBlower = ITEMS.register("", new ItemLeafBlower(false, "item_leaf_blower")); + public static final RegistryObject itemLeafBlowerAdvanced = ITEMS.register("", new ItemLeafBlower(true, "item_leaf_blower_advanced")); + public static final RegistryObject itemPotionRing = ITEMS.register("", new ItemPotionRing(false, "item_potion_ring")); + public static final RegistryObject itemPotionRingAdvanced = ITEMS.register("", new ItemPotionRing(true, "item_potion_ring_advanced")); + public static final RegistryObject itemHairyBall = ITEMS.register("item_hairy_ball", ItemHairyBall::new); + public static final RegistryObject itemCoffeeBean = ITEMS.register("item_coffee_beans", ItemCoffeeBean::new); + public static final RegistryObject itemRiceSeed = ITEMS.register("", new ItemSeed("item_rice_seed", "seedRice", InitBlocks.blockRice, itemFoods, TheFoods.RICE.ordinal())); + public static final RegistryObject itemCanolaSeed = ITEMS.register("", new ItemFoodSeed("item_canola_seed", "seedCanola", InitBlocks.blockCanola, itemMisc, TheMiscItems.CANOLA.ordinal(), 1, 0.01F, 10).setPotionEffect(new PotionEffect(MobEffects.NAUSEA, 1000, 0), 0.2F)); + public static final RegistryObject itemFlaxSeed = ITEMS.register("", new ItemSeed("item_flax_seed", "seedFlax", InitBlocks.blockFlax, Items.STRING, 0)); + public static final RegistryObject itemCoffeeSeed = ITEMS.register("", new ItemSeed("item_coffee_seed", "seedCoffeeBeans", InitBlocks.blockCoffee, itemCoffeeBean, 0)); - itemPickaxeCrystalGreen = new ItemPickaxeAA(InitToolMaterials.toolMaterialCrystalGreen, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), "item_pickaxe_crystal_green", Util.CRYSTAL_GREEN_RARITY); - itemAxeCrystalGreen = new ItemAxeAA(InitToolMaterials.toolMaterialCrystalGreen, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), "item_axe_crystal_green", Util.CRYSTAL_GREEN_RARITY); - itemShovelCrystalGreen = new ItemShovelAA(InitToolMaterials.toolMaterialCrystalGreen, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), "item_shovel_crystal_green", Util.CRYSTAL_GREEN_RARITY); - itemSwordCrystalGreen = new ItemSwordAA(InitToolMaterials.toolMaterialCrystalGreen, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), "item_sword_crystal_green", Util.CRYSTAL_GREEN_RARITY); - itemHoeCrystalGreen = new ItemHoeAA(InitToolMaterials.toolMaterialCrystalGreen, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), "item_hoe_crystal_green", Util.CRYSTAL_GREEN_RARITY); - itemHelmCrystalGreen = new ItemArmorAA("item_helm_crystal_green", InitArmorMaterials.armorMaterialCrystalGreen, 0, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), Util.CRYSTAL_GREEN_RARITY); - itemChestCrystalGreen = new ItemArmorAA("item_chest_crystal_green", InitArmorMaterials.armorMaterialCrystalGreen, 1, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), Util.CRYSTAL_GREEN_RARITY); - itemPantsCrystalGreen = new ItemArmorAA("item_pants_crystal_green", InitArmorMaterials.armorMaterialCrystalGreen, 2, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), Util.CRYSTAL_GREEN_RARITY); - itemBootsCrystalGreen = new ItemArmorAA("item_boots_crystal_green", InitArmorMaterials.armorMaterialCrystalGreen, 3, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), Util.CRYSTAL_GREEN_RARITY); - itemPaxelCrystalGreen = new ItemAllToolAA(InitToolMaterials.toolMaterialCrystalGreen, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), "item_paxel_crystal_green", Util.CRYSTAL_GREEN_RARITY, 46848); + // TOOLS & ARMOR + public static final RegistryObject itemHelmQuartz = ITEMS.register("item_helm_quartz", () -> new ItemArmorAA(ArmorMaterials.QUARTZ, 0)); + public static final RegistryObject itemChestQuartz = ITEMS.register("item_chest_quartz", () -> new ItemArmorAA(ArmorMaterials.QUARTZ, 1)); + public static final RegistryObject itemPantsQuartz = ITEMS.register("item_pants_quartz", () -> new ItemArmorAA(ArmorMaterials.QUARTZ, 2)); + public static final RegistryObject itemBootsQuartz = ITEMS.register("item_boots_quartz", () -> new ItemArmorAA(ArmorMaterials.QUARTZ, 3)); - itemPickaxeCrystalWhite = new ItemPickaxeAA(InitToolMaterials.toolMaterialCrystalWhite, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), "item_pickaxe_crystal_white", Util.CRYSTAL_WHITE_RARITY); - itemAxeCrystalWhite = new ItemAxeAA(InitToolMaterials.toolMaterialCrystalWhite, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), "item_axe_crystal_white", Util.CRYSTAL_WHITE_RARITY); - itemShovelCrystalWhite = new ItemShovelAA(InitToolMaterials.toolMaterialCrystalWhite, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), "item_shovel_crystal_white", Util.CRYSTAL_WHITE_RARITY); - itemSwordCrystalWhite = new ItemSwordAA(InitToolMaterials.toolMaterialCrystalWhite, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), "item_sword_crystal_white", Util.CRYSTAL_WHITE_RARITY); - itemHoeCrystalWhite = new ItemHoeAA(InitToolMaterials.toolMaterialCrystalWhite, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), "item_hoe_crystal_white", Util.CRYSTAL_WHITE_RARITY); - itemHelmCrystalWhite = new ItemArmorAA("item_helm_crystal_white", InitArmorMaterials.armorMaterialCrystalWhite, 0, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), Util.CRYSTAL_WHITE_RARITY); - itemChestCrystalWhite = new ItemArmorAA("item_chest_crystal_white", InitArmorMaterials.armorMaterialCrystalWhite, 1, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), Util.CRYSTAL_WHITE_RARITY); - itemPantsCrystalWhite = new ItemArmorAA("item_pants_crystal_white", InitArmorMaterials.armorMaterialCrystalWhite, 2, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), Util.CRYSTAL_WHITE_RARITY); - itemBootsCrystalWhite = new ItemArmorAA("item_boots_crystal_white", InitArmorMaterials.armorMaterialCrystalWhite, 3, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), Util.CRYSTAL_WHITE_RARITY); - itemPaxelCrystalWhite = new ItemAllToolAA(InitToolMaterials.toolMaterialCrystalWhite, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), "item_paxel_crystal_white", Util.CRYSTAL_WHITE_RARITY, 14606302); + public static final RegistryObject itemPickaxeQuartz = ITEMS.register("item_pickaxe_quartz", () -> new ItemPickaxeAA(ToolMaterials.QUARTZ)); + public static final RegistryObject itemAxeQuartz = ITEMS.register("item_axe_quartz", () -> new ItemAxeAA(ToolMaterials.QUARTZ)); + public static final RegistryObject itemShovelQuartz = ITEMS.register("item_shovel_quartz", () -> new ItemShovelAA(ToolMaterials.QUARTZ)); + public static final RegistryObject itemSwordQuartz = ITEMS.register("item_sword_quartz", () -> new ItemSwordAA(ToolMaterials.QUARTZ)); + public static final RegistryObject itemHoeQuartz = ITEMS.register("item_hoe_quartz", () -> new ItemHoeAA(ToolMaterials.QUARTZ)); + public static final RegistryObject woodenPaxel = ITEMS.register("wooden_paxel", () -> new ItemAllToolAA(ItemTier.WOOD)); + public static final RegistryObject stonePaxel = ITEMS.register("stone_paxel", () -> new ItemAllToolAA(ItemTier.STONE)); + public static final RegistryObject ironPaxel = ITEMS.register("iron_paxel", () -> new ItemAllToolAA(ItemTier.IRON)); + public static final RegistryObject goldPaxel = ITEMS.register("gold_paxel", () -> new ItemAllToolAA(ItemTier.GOLD)); + public static final RegistryObject diamondPaxel = ITEMS.register("diamond_paxel", () -> new ItemAllToolAA(ItemTier.DIAMOND)); + public static final RegistryObject quartzPaxel = ITEMS.register("quartz_paxel", () -> new ItemAllToolAA(ToolMaterials.QUARTZ)); + + public static final RegistryObject itemPickaxeCrystalRed = ITEMS.register("item_pickaxe_crystal_restonia", () -> new ItemPickaxeAA(ToolMaterials.RESTONIA)); + public static final RegistryObject itemAxeCrystalRed = ITEMS.register("item_axe_crystal_restonia", () -> new ItemAxeAA(ToolMaterials.RESTONIA)); + public static final RegistryObject itemShovelCrystalRed = ITEMS.register("item_shovel_crystal_restonia", () -> new ItemShovelAA(ToolMaterials.RESTONIA)); + public static final RegistryObject itemSwordCrystalRed = ITEMS.register("item_sword_crystal_restonia", () -> new ItemSwordAA(ToolMaterials.RESTONIA)); + public static final RegistryObject itemHoeCrystalRed = ITEMS.register("item_hoe_crystal_restonia", () -> new ItemHoeAA(ToolMaterials.RESTONIA)); + public static final RegistryObject itemHelmCrystalRed = ITEMS.register("item_helm_crystal_red", () -> new ItemArmorAA(ArmorMaterials.RESTONIA, 0)); + public static final RegistryObject itemChestCrystalRed = ITEMS.register("item_chest_crystal_red", () -> new ItemArmorAA(ArmorMaterials.RESTONIA, 1)); + public static final RegistryObject itemPantsCrystalRed = ITEMS.register("item_pants_crystal_red", () -> new ItemArmorAA(ArmorMaterials.RESTONIA, 2)); + public static final RegistryObject itemBootsCrystalRed = ITEMS.register("item_boots_crystal_red", () -> new ItemArmorAA(ArmorMaterials.RESTONIA, 3)); + public static final RegistryObject itemPaxelCrystalRed = ITEMS.register("item_paxel_crystal_red", () -> new ItemAllToolAA(ToolMaterials.RESTONIA)); + + public static final RegistryObject itemPickaxeCrystalBlue = ITEMS.register("item_pickaxe_crystal_blue", () -> new ItemPickaxeAA(ToolMaterials.PALIS)); + public static final RegistryObject itemAxeCrystalBlue = ITEMS.register("item_axe_crystal_blue", () -> new ItemAxeAA(ToolMaterials.PALIS)); + public static final RegistryObject itemShovelCrystalBlue = ITEMS.register("item_shovel_crystal_blue", () -> new ItemShovelAA(ToolMaterials.PALIS)); + public static final RegistryObject itemSwordCrystalBlue = ITEMS.register("item_sword_crystal_blue", () -> new ItemSwordAA(ToolMaterials.PALIS)); + public static final RegistryObject itemHoeCrystalBlue = ITEMS.register("item_hoe_crystal_blue", () -> new ItemHoeAA(ToolMaterials.PALIS)); + public static final RegistryObject itemHelmCrystalBlue = ITEMS.register("item_helm_crystal_blue", () -> new ItemArmorAA(ArmorMaterials.PALIS, 0)); + public static final RegistryObject itemChestCrystalBlue = ITEMS.register("item_chest_crystal_blue", () -> new ItemArmorAA(ArmorMaterials.PALIS, 1)); + public static final RegistryObject itemPantsCrystalBlue = ITEMS.register("item_pants_crystal_blue", () -> new ItemArmorAA(ArmorMaterials.PALIS, 2)); + public static final RegistryObject itemBootsCrystalBlue = ITEMS.register("item_boots_crystal_blue", () -> new ItemArmorAA(ArmorMaterials.PALIS, 3)); + public static final RegistryObject itemPaxelCrystalBlue = ITEMS.register("item_paxel_crystal_blue", () -> new ItemAllToolAA(ToolMaterials.PALIS)); + + public static final RegistryObject itemPickaxeCrystalLightBlue = ITEMS.register("item_pickaxe_crystal_light_blue", () -> new ItemPickaxeAA(ToolMaterials.DIAMATINE)); + public static final RegistryObject itemAxeCrystalLightBlue = ITEMS.register("item_axe_crystal_light_blue", () -> new ItemAxeAA(ToolMaterials.DIAMATINE)); + public static final RegistryObject itemShovelCrystalLightBlue = ITEMS.register("item_shovel_crystal_light_blue", () -> new ItemShovelAA(ToolMaterials.DIAMATINE)); + public static final RegistryObject itemSwordCrystalLightBlue = ITEMS.register("item_sword_crystal_light_blue", () -> new ItemSwordAA(ToolMaterials.DIAMATINE)); + public static final RegistryObject itemHoeCrystalLightBlue = ITEMS.register("item_hoe_crystal_light_blue", () -> new ItemHoeAA(ToolMaterials.DIAMATINE)); + public static final RegistryObject itemHelmCrystalLightBlue = ITEMS.register("item_helm_crystal_light_blue", () -> new ItemArmorAA(ArmorMaterials.DIAMATINE, 0)); + public static final RegistryObject itemChestCrystalLightBlue = ITEMS.register("item_chest_crystal_light_blue", () -> new ItemArmorAA(ArmorMaterials.DIAMATINE, 1)); + public static final RegistryObject itemPantsCrystalLightBlue = ITEMS.register("item_pants_crystal_light_blue", () -> new ItemArmorAA(ArmorMaterials.DIAMATINE, 2)); + public static final RegistryObject itemBootsCrystalLightBlue = ITEMS.register("item_boots_crystal_light_blue", () -> new ItemArmorAA(ArmorMaterials.DIAMATINE, 3)); + public static final RegistryObject itemPaxelCrystalLightBlue = ITEMS.register("item_paxel_crystal_light_blue", () -> new ItemAllToolAA(ToolMaterials.DIAMATINE)); + + public static final RegistryObject itemPickaxeCrystalBlack = ITEMS.register("item_pickaxe_crystal_black", () -> new ItemPickaxeAA(ToolMaterials.VOID)); + public static final RegistryObject itemAxeCrystalBlack = ITEMS.register("item_axe_crystal_black", () -> new ItemAxeAA(ToolMaterials.VOID)); + public static final RegistryObject itemShovelCrystalBlack = ITEMS.register("item_shovel_crystal_black", () -> new ItemShovelAA(ToolMaterials.VOID)); + public static final RegistryObject itemSwordCrystalBlack = ITEMS.register("item_sword_crystal_black", () -> new ItemSwordAA(ToolMaterials.VOID)); + public static final RegistryObject itemHoeCrystalBlack = ITEMS.register("item_hoe_crystal_black", () -> new ItemHoeAA(ToolMaterials.VOID)); + public static final RegistryObject itemHelmCrystalBlack = ITEMS.register("item_helm_crystal_black", () -> new ItemArmorAA(ArmorMaterials.VOID, 0)); + public static final RegistryObject itemChestCrystalBlack = ITEMS.register("item_chest_crystal_black", () -> new ItemArmorAA(ArmorMaterials.VOID, 1)); + public static final RegistryObject itemPantsCrystalBlack = ITEMS.register("item_pants_crystal_black", () -> new ItemArmorAA(ArmorMaterials.VOID, 2)); + public static final RegistryObject itemBootsCrystalBlack = ITEMS.register("item_boots_crystal_black", () -> new ItemArmorAA(ArmorMaterials.VOID, 3)); + public static final RegistryObject itemPaxelCrystalBlack = ITEMS.register("item_paxel_crystal_black", () -> new ItemAllToolAA(ToolMaterials.VOID)); + + public static final RegistryObject itemPickaxeCrystalGreen = ITEMS.register("item_pickaxe_crystal_green", () -> new ItemPickaxeAA(ToolMaterials.EMERADIC)); + public static final RegistryObject itemAxeCrystalGreen = ITEMS.register("item_axe_crystal_green", () -> new ItemAxeAA(ToolMaterials.EMERADIC)); + public static final RegistryObject itemShovelCrystalGreen = ITEMS.register("item_shovel_crystal_green", () -> new ItemShovelAA(ToolMaterials.EMERADIC)); + public static final RegistryObject itemSwordCrystalGreen = ITEMS.register("item_sword_crystal_green", () -> new ItemSwordAA(ToolMaterials.EMERADIC)); + public static final RegistryObject itemHoeCrystalGreen = ITEMS.register("item_hoe_crystal_green", () -> new ItemHoeAA(ToolMaterials.EMERADIC)); + public static final RegistryObject itemHelmCrystalGreen = ITEMS.register("item_helm_crystal_green", () -> new ItemArmorAA(ArmorMaterials.DIAMATINE, 0)); + public static final RegistryObject itemChestCrystalGreen = ITEMS.register("item_chest_crystal_green", () -> new ItemArmorAA(ArmorMaterials.DIAMATINE, 1)); + public static final RegistryObject itemPantsCrystalGreen = ITEMS.register("item_pants_crystal_green", () -> new ItemArmorAA(ArmorMaterials.DIAMATINE, 2)); + public static final RegistryObject itemBootsCrystalGreen = ITEMS.register("item_boots_crystal_green", () -> new ItemArmorAA(ArmorMaterials.DIAMATINE, 3)); + public static final RegistryObject itemPaxelCrystalGreen = ITEMS.register("item_paxel_crystal_green", () -> new ItemAllToolAA(ToolMaterials.EMERADIC)); + + public static final RegistryObject itemPickaxeCrystalWhite = ITEMS.register("item_pickaxe_crystal_white", () -> new ItemPickaxeAA(ToolMaterials.ENORI)); + public static final RegistryObject itemAxeCrystalWhite = ITEMS.register("item_axe_crystal_white", () -> new ItemAxeAA(ToolMaterials.ENORI)); + public static final RegistryObject itemShovelCrystalWhite = ITEMS.register("item_shovel_crystal_white", () -> new ItemShovelAA(ToolMaterials.ENORI)); + public static final RegistryObject itemSwordCrystalWhite = ITEMS.register("item_sword_crystal_white", () -> new ItemSwordAA(ToolMaterials.ENORI)); + public static final RegistryObject itemHoeCrystalWhite = ITEMS.register("item_hoe_crystal_white", () -> new ItemHoeAA(ToolMaterials.ENORI)); + public static final RegistryObject itemHelmCrystalWhite = ITEMS.register("item_helm_crystal_white", () -> new ItemArmorAA(ArmorMaterials.ENORI, 0)); + public static final RegistryObject itemChestCrystalWhite = ITEMS.register("item_chest_crystal_white", () -> new ItemArmorAA(ArmorMaterials.ENORI, 1)); + public static final RegistryObject itemPantsCrystalWhite = ITEMS.register("item_pants_crystal_white", () -> new ItemArmorAA(ArmorMaterials.ENORI, 2)); + public static final RegistryObject itemBootsCrystalWhite = ITEMS.register("item_boots_crystal_white", () -> new ItemArmorAA(ArmorMaterials.ENORI, 3)); + public static final RegistryObject itemPaxelCrystalWhite = ITEMS.register("item_paxel_crystal_white", () -> new ItemAllToolAA(ToolMaterials.ENORI)); + + public static Item.Properties defaultProps() { + return new Item.Properties().group(ActuallyAdditions.GROUP); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAllToolAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAllToolAA.java index 84aaf0a91..1cc6848eb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAllToolAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAllToolAA.java @@ -16,12 +16,14 @@ import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues; import de.ellpeck.actuallyadditions.mod.items.base.ItemToolAA; import de.ellpeck.actuallyadditions.mod.util.IColorProvidingItem; import net.minecraft.block.Block; +import net.minecraft.block.BlockState; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.color.IItemColor; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.init.Blocks; import net.minecraft.init.Items; +import net.minecraft.item.IItemTier; import net.minecraft.item.ItemStack; import net.minecraft.util.Direction; import net.minecraft.util.EnumActionResult; @@ -29,7 +31,7 @@ import net.minecraft.util.Hand; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.common.IRarity; +import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.fml.relauncher.OnlyIn; import java.util.HashSet; @@ -39,17 +41,9 @@ public class ItemAllToolAA extends ItemToolAA implements IColorProvidingItem { public final int color; - public ItemAllToolAA(ToolMaterial toolMat, String repairItem, String unlocalizedName, IRarity rarity, int color) { - super(4.0F, -2F, toolMat, repairItem, unlocalizedName, rarity, new HashSet<>()); - this.color = color; - - this.setMaxDamage(toolMat.getMaxUses() * 4); - this.setHarvestLevels(toolMat.getHarvestLevel()); - } - - public ItemAllToolAA(ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, IRarity rarity, int color) { - super(4.0F, -2F, toolMat, repairItem, unlocalizedName, rarity, new HashSet<>()); - this.color = color; + public ItemAllToolAA(IItemTier toolMat) { + super(4.0F, -2F, toolMat, this.repairItem, unlocalizedName, this.rarity, new HashSet<>()); + this.color = this.color; this.setMaxDamage(toolMat.getMaxUses() * 4); this.setHarvestLevels(toolMat.getHarvestLevel()); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAxeAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAxeAA.java index 32496931c..2e1b12eb0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAxeAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAxeAA.java @@ -13,11 +13,11 @@ package de.ellpeck.actuallyadditions.mod.items; import com.google.common.collect.Sets; import de.ellpeck.actuallyadditions.mod.items.base.ItemToolAA; import net.minecraft.block.Block; +import net.minecraft.block.BlockState; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; -import net.minecraft.item.Item; +import net.minecraft.item.IItemTier; import net.minecraft.item.ItemStack; -import net.minecraftforge.common.IRarity; import java.util.Collections; import java.util.Set; @@ -26,13 +26,8 @@ public class ItemAxeAA extends ItemToolAA { private static final Set EFFECTIVE_ON = Sets.newHashSet(Blocks.PLANKS, Blocks.BOOKSHELF, Blocks.LOG, Blocks.LOG2, Blocks.CHEST, Blocks.PUMPKIN, Blocks.LIT_PUMPKIN, Blocks.MELON_BLOCK, Blocks.LADDER, Blocks.WOODEN_BUTTON, Blocks.WOODEN_PRESSURE_PLATE); - public ItemAxeAA(Item.ToolMaterial material, String repairItem, String unlocalizedName, IRarity rarity) { - super(6.0F, -3.0F, material, repairItem, unlocalizedName, rarity, EFFECTIVE_ON); - this.setHarvestLevel("axe", material.getHarvestLevel()); - } - - public ItemAxeAA(Item.ToolMaterial material, ItemStack repairItem, String unlocalizedName, IRarity rarity) { - super(6.0F, -3.0F, material, repairItem, unlocalizedName, rarity, EFFECTIVE_ON); + public ItemAxeAA(IItemTier material) { + super(6.0F, -3.0F, material, this.repairItem, unlocalizedName, this.rarity, EFFECTIVE_ON); this.setHarvestLevel("axe", material.getHarvestLevel()); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java index 15deaa553..51e71b805 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod.items; +import com.mojang.blaze3d.matrix.MatrixStack; import de.ellpeck.actuallyadditions.api.booklet.IBookletPage; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.IHudDisplay; @@ -20,6 +21,7 @@ import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.Block; +import net.minecraft.block.BlockState; import net.minecraft.client.MainWindow; import net.minecraft.client.Minecraft; import net.minecraft.client.util.ITooltipFlag; @@ -34,6 +36,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; +import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.fml.relauncher.OnlyIn; import javax.annotation.Nullable; @@ -98,11 +101,11 @@ public class ItemBooklet extends ItemBase implements IHudDisplay { @Override @OnlyIn(Dist.CLIENT) - public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, MainWindow resolution) { - if (posHit != null && posHit.getBlockPos() != null) { - BlockState state = minecraft.world.getBlockState(posHit.getBlockPos()); + public void displayHud(MatrixStack matrices, Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult rayCast, MainWindow resolution) { + if (rayCast != null && rayCast.getBlockPos() != null) { + BlockState state = minecraft.world.getBlockState(rayCast.getBlockPos()); Block block = state.getBlock(); - if (block != null && !block.isAir(minecraft.world.getBlockState(posHit.getBlockPos()), minecraft.world, posHit.getBlockPos())) { + if (block != null && !block.isAir(minecraft.world.getBlockState(rayCast.getBlockPos()), minecraft.world, rayCast.getBlockPos())) { ItemStack blockStack = new ItemStack(block, 1, block.getMetaFromState(state)); int height = resolution.getScaledHeight() / 5 * 3; if (player.isSneaking()) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java index 311d744df..ed47d1f9a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java @@ -95,7 +95,7 @@ public class ItemDrill extends ItemEnergy { ItemStack upgrade = this.getHasUpgradeAsStack(stack, ItemDrillUpgrade.UpgradeType.PLACER); if (StackUtil.isValid(upgrade)) { int slot = ItemDrillUpgrade.getSlotToPlaceFrom(upgrade); - if (slot >= 0 && slot < InventoryPlayer.getHotbarSize()) { + if (slot >= 0 && slot < PlayerInventory.getHotbarSize()) { ItemStack equip = player.inventory.getStackInSlot(slot); if (StackUtil.isValid(equip) && equip != stack) { ItemStack toPlaceStack = equip.copy(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemGeneric.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemGeneric.java index fe9ddab4a..e7ac98a4c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemGeneric.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemGeneric.java @@ -11,18 +11,9 @@ package de.ellpeck.actuallyadditions.mod.items; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemStack; public class ItemGeneric extends ItemBase { - - public ItemGeneric(String name) { - super(name); - this.setMaxDamage(0); + public ItemGeneric(Properties props) { + super(props.maxDamage(0)); } - - @Override - public EnumRarity getRarity(ItemStack stack) { - return EnumRarity.UNCOMMON; - } -} \ No newline at end of file +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPickaxeAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPickaxeAA.java index da62b4a5e..09ffa43d2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPickaxeAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPickaxeAA.java @@ -13,11 +13,11 @@ package de.ellpeck.actuallyadditions.mod.items; import com.google.common.collect.Sets; import de.ellpeck.actuallyadditions.mod.items.base.ItemToolAA; import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; +import net.minecraft.item.IItemTier; import net.minecraft.item.ItemStack; -import net.minecraftforge.common.IRarity; import java.util.Collections; import java.util.Set; @@ -26,13 +26,8 @@ public class ItemPickaxeAA extends ItemToolAA { private static final Set EFFECTIVE_ON = Sets.newHashSet(Blocks.ACTIVATOR_RAIL, Blocks.COAL_ORE, Blocks.COBBLESTONE, Blocks.DETECTOR_RAIL, Blocks.DIAMOND_BLOCK, Blocks.DIAMOND_ORE, Blocks.DOUBLE_STONE_SLAB, Blocks.GOLDEN_RAIL, Blocks.GOLD_BLOCK, Blocks.GOLD_ORE, Blocks.ICE, Blocks.IRON_BLOCK, Blocks.IRON_ORE, Blocks.LAPIS_BLOCK, Blocks.LAPIS_ORE, Blocks.LIT_REDSTONE_ORE, Blocks.MOSSY_COBBLESTONE, Blocks.NETHERRACK, Blocks.PACKED_ICE, Blocks.RAIL, Blocks.REDSTONE_ORE, Blocks.SANDSTONE, Blocks.RED_SANDSTONE, Blocks.STONE, Blocks.STONE_SLAB, Blocks.STONE_BUTTON, Blocks.STONE_PRESSURE_PLATE); - public ItemPickaxeAA(Item.ToolMaterial material, String repairItem, String unlocalizedName, IRarity rarity) { - super(1.0F, -2.8F, material, repairItem, unlocalizedName, rarity, EFFECTIVE_ON); - this.setHarvestLevel("pickaxe", material.getHarvestLevel()); - } - - public ItemPickaxeAA(Item.ToolMaterial material, ItemStack repairItem, String unlocalizedName, IRarity rarity) { - super(1.0F, -2.8F, material, repairItem, unlocalizedName, rarity, EFFECTIVE_ON); + public ItemPickaxeAA(IItemTier material) { + super(1.0F, -2.8F, material, this.repairItem, unlocalizedName, this.rarity, EFFECTIVE_ON); this.setHarvestLevel("pickaxe", material.getHarvestLevel()); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemShovelAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemShovelAA.java index 326fce725..4240e6498 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemShovelAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemShovelAA.java @@ -13,17 +13,17 @@ package de.ellpeck.actuallyadditions.mod.items; import com.google.common.collect.Sets; import de.ellpeck.actuallyadditions.mod.items.base.ItemToolAA; import net.minecraft.block.Block; +import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.init.Blocks; import net.minecraft.init.Items; -import net.minecraft.item.Item; +import net.minecraft.item.IItemTier; import net.minecraft.item.ItemStack; import net.minecraft.util.Direction; import net.minecraft.util.EnumActionResult; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.common.IRarity; import java.util.Collections; import java.util.Set; @@ -32,13 +32,8 @@ public class ItemShovelAA extends ItemToolAA { private static final Set EFFECTIVE_ON = Sets.newHashSet(Blocks.CLAY, Blocks.DIRT, Blocks.FARMLAND, Blocks.GRASS, Blocks.GRAVEL, Blocks.MYCELIUM, Blocks.SAND, Blocks.SNOW, Blocks.SNOW_LAYER, Blocks.SOUL_SAND, Blocks.GRASS_PATH); - public ItemShovelAA(Item.ToolMaterial material, String repairItem, String unlocalizedName, IRarity rarity) { - super(1.5F, -3.0F, material, repairItem, unlocalizedName, rarity, EFFECTIVE_ON); - this.setHarvestLevel("shovel", material.getHarvestLevel()); - } - - public ItemShovelAA(Item.ToolMaterial material, ItemStack repairItem, String unlocalizedName, IRarity rarity) { - super(1.5F, -3.0F, material, repairItem, unlocalizedName, rarity, EFFECTIVE_ON); + public ItemShovelAA(IItemTier material) { + super(1.5F, -3.0F, material, this.repairItem, unlocalizedName, this.rarity, EFFECTIVE_ON); this.setHarvestLevel("shovel", material.getHarvestLevel()); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemArmorAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemArmorAA.java index da2fe2b04..adc6d68c7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemArmorAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemArmorAA.java @@ -17,29 +17,27 @@ import de.ellpeck.actuallyadditions.mod.inventory.ContainerEnergizer; import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemArmor; +import net.minecraft.item.ArmorItem; +import net.minecraft.item.IArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraftforge.common.IRarity; -public class ItemArmorAA extends ItemArmor implements IDisableableItem { +public class ItemArmorAA extends ArmorItem implements IDisableableItem { private final ItemStack repairItem; private final String name; private final IRarity rarity; private final boolean disabled; - public ItemArmorAA(String name, ArmorMaterial material, int type, ItemStack repairItem) { - this(name, material, type, repairItem, EnumRarity.RARE); - } - - public ItemArmorAA(String name, ArmorMaterial material, int type, ItemStack repairItem, IRarity rarity) { + public ItemArmorAA(IArmorMaterial material, int type) { super(material, 0, ContainerEnergizer.VALID_EQUIPMENT_SLOTS[type]); - this.repairItem = repairItem; - this.name = name; - this.rarity = rarity; - this.disabled = ConfigurationHandler.config.getBoolean("Disable: " + StringUtil.badTranslate(name), "Tool Control", false, "This will disable the " + StringUtil.badTranslate(name) + ". It will not be registered."); - if (!this.disabled) this.register(); + this.repairItem = this.repairItem; + this.name = this.name; + this.rarity = this.rarity; + this.disabled = ConfigurationHandler.config.getBoolean("Disable: " + StringUtil.badTranslate(this.name), "Tool Control", false, "This will disable the " + StringUtil.badTranslate(this.name) + ". It will not be registered."); + if (!this.disabled) { + this.register(); + } } private void register() { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemBase.java index db0256b6a..4e40d5c7a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemBase.java @@ -10,36 +10,15 @@ package de.ellpeck.actuallyadditions.mod.items.base; -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.util.ItemUtil; +import de.ellpeck.actuallyadditions.mod.items.InitItems; import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; public class ItemBase extends Item { - - private final String name; - - public ItemBase(String name) { - this.name = name; - - this.register(); + public ItemBase(Properties props) { + super(props); } - private void register() { - ItemUtil.registerItem(this, this.getBaseName(), this.shouldAddCreative()); - - this.registerRendering(); - } - - protected String getBaseName() { - return this.name; - } - - public boolean shouldAddCreative() { - return true; - } - - protected void registerRendering() { - ActuallyAdditions.PROXY.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory"); + public ItemBase() { + super(InitItems.defaultProps()); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemHoeAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemHoeAA.java index 705810399..a827b4153 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemHoeAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemHoeAA.java @@ -15,27 +15,29 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.config.ConfigurationHandler; import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; -import net.minecraft.item.Item; -import net.minecraft.item.ItemHoe; +import net.minecraft.item.HoeItem; +import net.minecraft.item.IItemTier; import net.minecraft.item.ItemStack; import net.minecraftforge.common.IRarity; -public class ItemHoeAA extends ItemHoe implements IDisableableItem { +public class ItemHoeAA extends HoeItem implements IDisableableItem { private final String name; private final IRarity rarity; private final ItemStack repairItem; private final boolean disabled; - public ItemHoeAA(Item.ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, IRarity rarity) { + public ItemHoeAA(IItemTier toolMat) { super(toolMat); - this.repairItem = repairItem; + this.repairItem = this.repairItem; this.name = unlocalizedName; - this.rarity = rarity; + this.rarity = this.rarity; this.disabled = ConfigurationHandler.config.getBoolean("Disable: " + StringUtil.badTranslate(this.name), "Tool Control", false, "This will disable the " + StringUtil.badTranslate(this.name) + ". It will not be registered."); - if (!this.disabled) this.register(); + if (!this.disabled) { + this.register(); + } } private void register() { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemSwordAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemSwordAA.java index 051a80b54..fde2aabb1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemSwordAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemSwordAA.java @@ -16,26 +16,29 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; import de.ellpeck.actuallyadditions.mod.config.ConfigurationHandler; import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import net.minecraft.item.IItemTier; import net.minecraft.item.ItemStack; -import net.minecraft.item.ItemSword; +import net.minecraft.item.SwordItem; import net.minecraftforge.common.IRarity; -public class ItemSwordAA extends ItemSword implements IDisableableItem { +public class ItemSwordAA extends SwordItem implements IDisableableItem { private final String name; private final IRarity rarity; private final ItemStack repairItem; private final boolean disabled; - public ItemSwordAA(ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, IRarity rarity) { + public ItemSwordAA(IItemTier toolMat) { super(toolMat); - this.repairItem = repairItem; + this.repairItem = this.repairItem; this.name = unlocalizedName; - this.rarity = rarity; + this.rarity = this.rarity; this.disabled = ConfigurationHandler.config.getBoolean("Disable: " + StringUtil.badTranslate(this.name), "Tool Control", false, "This will disable the " + StringUtil.badTranslate(this.name) + ". It will not be registered."); - if (!this.disabled) this.register(); + if (!this.disabled) { + this.register(); + } } private void register() { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemToolAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemToolAA.java index b72fa70fd..e5c499b27 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemToolAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemToolAA.java @@ -10,8 +10,6 @@ package de.ellpeck.actuallyadditions.mod.items.base; -import java.util.Set; - import de.ellpeck.actuallyadditions.api.misc.IDisableableItem; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.config.ConfigurationHandler; @@ -20,11 +18,13 @@ import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; -import net.minecraft.item.ItemTool; +import net.minecraft.item.ToolItem; import net.minecraftforge.common.IRarity; import net.minecraftforge.oredict.OreDictionary; -public class ItemToolAA extends ItemTool implements IDisableableItem { +import java.util.Set; + +public class ItemToolAA extends ToolItem implements IDisableableItem { private final String name; private final IRarity rarity; @@ -44,7 +44,9 @@ public class ItemToolAA extends ItemTool implements IDisableableItem { this.name = unlocalizedName; this.rarity = rarity; this.disabled = ConfigurationHandler.config.getBoolean("Disable: " + StringUtil.badTranslate(unlocalizedName), "Tool Control", false, "This will disable the " + StringUtil.badTranslate(unlocalizedName) + ". It will not be registered."); - if (!this.disabled) this.register(); + if (!this.disabled) { + this.register(); + } } private void register() { @@ -77,7 +79,9 @@ public class ItemToolAA extends ItemTool implements IDisableableItem { } else if (this.repairOredict != null) { int[] idsStack = OreDictionary.getOreIDs(stack); for (int id : idsStack) { - if (OreDictionary.getOreName(id).equals(this.repairOredict)) { return true; } + if (OreDictionary.getOreName(id).equals(this.repairOredict)) { + return true; + } } } return false; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensRecipeHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensRecipeHandler.java index 1df55b711..e49d0356c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensRecipeHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensRecipeHandler.java @@ -10,160 +10,134 @@ package de.ellpeck.actuallyadditions.mod.items.lens; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Nullable; - -import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; -import de.ellpeck.actuallyadditions.api.lens.Lens; -import de.ellpeck.actuallyadditions.api.recipe.ColorLensChangerByDyeMeta; -import de.ellpeck.actuallyadditions.api.recipe.IColorLensChanger; -import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; -import de.ellpeck.actuallyadditions.mod.recipe.ColorLensRotator; -import de.ellpeck.actuallyadditions.mod.recipe.EnchBookConversion; -import de.ellpeck.actuallyadditions.mod.util.RecipeUtil; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.Ingredient; -import net.minecraft.util.NonNullList; -import net.minecraftforge.oredict.OreDictionary; - +// TODO: [port] ADD BACK WITH DATA GENS public final class LensRecipeHandler { - - public static final ArrayList MAIN_PAGE_RECIPES = new ArrayList<>(); - public static LensConversionRecipe recipeColorLens; - public static LensConversionRecipe recipeSoulSand; - public static LensConversionRecipe recipeGreenWall; - public static LensConversionRecipe recipeWhiteWall; - public static LensConversionRecipe recipeExplosionLens; - public static LensConversionRecipe recipeDamageLens; - public static LensConversionRecipe recipeLeather; - public static LensConversionRecipe recipeNetherWart; - public static LensConversionRecipe recipePrismarine; - public static LensConversionRecipe recipeCrystallizedCanolaSeed; - public static LensConversionRecipe recipeItemLaser; - public static LensConversionRecipe recipeFluidLaser; - public static EnchBookConversion recipeEnchBook; - + // + // public static final ArrayList MAIN_PAGE_RECIPES = new ArrayList<>(); + // public static LensConversionRecipe recipeColorLens; + // public static LensConversionRecipe recipeSoulSand; + // public static LensConversionRecipe recipeGreenWall; + // public static LensConversionRecipe recipeWhiteWall; + // public static LensConversionRecipe recipeExplosionLens; + // public static LensConversionRecipe recipeDamageLens; + // public static LensConversionRecipe recipeLeather; + // public static LensConversionRecipe recipeNetherWart; + // public static LensConversionRecipe recipePrismarine; + // public static LensConversionRecipe recipeCrystallizedCanolaSeed; + // public static LensConversionRecipe recipeItemLaser; + // public static LensConversionRecipe recipeFluidLaser; + // public static EnchBookConversion recipeEnchBook; + // public static void init() { - //Crystal Blocks - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(Blocks.REDSTONE_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.REDSTONE.ordinal()), 400); - MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(Blocks.LAPIS_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.LAPIS.ordinal()), 400); - MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(Blocks.DIAMOND_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.DIAMOND.ordinal()), 600); - MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(Blocks.EMERALD_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.EMERALD.ordinal()), 1000); - MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(Blocks.COAL_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.COAL.ordinal()), 600); - MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(Blocks.IRON_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal()), 800); - MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); - - //Crystal Items - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(Items.REDSTONE), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 40); - MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromStacks(new ItemStack(Items.DYE, 1, 4)), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), 40); - MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(Items.DIAMOND), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 60); - MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(Items.EMERALD), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), 100); - MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(Items.COAL), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), 60); - MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(Items.IRON_INGOT), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 80); - MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); - - //Lenses - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromStacks(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal())), new ItemStack(InitItems.itemColorLens), 5000); - recipeColorLens = RecipeUtil.lastReconstructorRecipe(); - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(InitItems.itemColorLens), new ItemStack(InitItems.itemExplosionLens), 5000); - recipeExplosionLens = RecipeUtil.lastReconstructorRecipe(); - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(InitItems.itemExplosionLens), new ItemStack(InitItems.itemDamageLens), 5000); - recipeDamageLens = RecipeUtil.lastReconstructorRecipe(); - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(InitItems.itemDamageLens), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), 5000); - - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(InitBlocks.blockLaserRelay), new ItemStack(InitBlocks.blockLaserRelayFluids), 2000); - recipeFluidLaser = RecipeUtil.lastReconstructorRecipe(); - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(InitBlocks.blockLaserRelayFluids), new ItemStack(InitBlocks.blockLaserRelayItem), 2000); - recipeItemLaser = RecipeUtil.lastReconstructorRecipe(); - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(InitBlocks.blockLaserRelayItem), new ItemStack(InitBlocks.blockLaserRelay), 2000); - - //Misc - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(Blocks.SAND), new ItemStack(Blocks.SOUL_SAND), 20000); - recipeSoulSand = RecipeUtil.lastReconstructorRecipe(); - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(Items.ROTTEN_FLESH), new ItemStack(Items.LEATHER), 8000); - recipeLeather = RecipeUtil.lastReconstructorRecipe(); - - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(Blocks.RED_MUSHROOM), new ItemStack(Items.NETHER_WART), 150000); - recipeNetherWart = RecipeUtil.lastReconstructorRecipe(); - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(Items.QUARTZ), new ItemStack(Items.PRISMARINE_SHARD), 30000); - recipePrismarine = RecipeUtil.lastReconstructorRecipe(); - - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(InitItems.itemCanolaSeed), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CRYSTALLIZED_CANOLA_SEED.ordinal()), 2000); - recipeCrystallizedCanolaSeed = RecipeUtil.lastReconstructorRecipe(); - - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(Blocks.QUARTZ_BLOCK), new ItemStack(InitBlocks.blockTestifiBucksWhiteWall), 10); - recipeWhiteWall = RecipeUtil.lastReconstructorRecipe(); - ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromStacks(new ItemStack(Blocks.QUARTZ_BLOCK, 1, 1)), new ItemStack(InitBlocks.blockTestifiBucksGreenWall), 10); - recipeGreenWall = RecipeUtil.lastReconstructorRecipe(); - - ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES.add(recipeEnchBook = new EnchBookConversion()); - - IColorLensChanger changer = new ColorLensChangerByDyeMeta(); - if (ConfigBoolValues.COLOR_LENS_USES_OREDICT.isEnabled()) { - initOredictDyeRotator(); - } else { - ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Items.DYE, changer); - } - ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.WOOL), changer); - ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.STAINED_GLASS), changer); - ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.STAINED_GLASS_PANE), changer); - ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.STAINED_HARDENED_CLAY), changer); - ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.CARPET), changer); - ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(InitBlocks.blockColoredLamp), changer); - ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(InitBlocks.blockColoredLampOn), changer); - } - - @Deprecated //Use lens-checking method below. - public static List getRecipesFor(ItemStack input) { - List possibleRecipes = new ArrayList<>(); - for (LensConversionRecipe recipe : ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES) - if (recipe.getInput().apply(input)) possibleRecipes.add(recipe); - return possibleRecipes; - } - - @Nullable - public static LensConversionRecipe findMatchingRecipe(ItemStack input, Lens lens) { - for (LensConversionRecipe recipe : ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES) - if (recipe.matches(input, lens)) return recipe; - return null; - } - - private static Ingredient fromBlock(Block b) { - return Ingredient.fromItems(Item.getItemFromBlock(b)); - } - - private static void initOredictDyeRotator() { - List stacks = NonNullList.withSize(16, ItemStack.EMPTY); - List dyeItems = new ArrayList<>(); - String[] dyes = { "White", "Orange", "Magenta", "LightBlue", "Yellow", "Lime", "Pink", "Gray", "LightGray", "Cyan", "Purple", "Blue", "Brown", "Green", "Red", "Black" }; - for (int i = 0; i < dyes.length; i++) { - List ores = OreDictionary.getOres("dye" + dyes[i]); - dyeItems.addAll(ores); - stacks.set(i, ores.get(ores.size() - 1)); - } - ColorLensRotator rotator = new ColorLensRotator(stacks); - for (ItemStack s : dyeItems) - ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(s.getItem(), rotator); + // //Crystal Blocks + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(Blocks.REDSTONE_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.REDSTONE.ordinal()), 400); + // MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(Blocks.LAPIS_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.LAPIS.ordinal()), 400); + // MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(Blocks.DIAMOND_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.DIAMOND.ordinal()), 600); + // MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(Blocks.EMERALD_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.EMERALD.ordinal()), 1000); + // MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(Blocks.COAL_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.COAL.ordinal()), 600); + // MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(Blocks.IRON_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal()), 800); + // MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + // + // //Crystal Items + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(Items.REDSTONE), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 40); + // MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromStacks(new ItemStack(Items.DYE, 1, 4)), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), 40); + // MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(Items.DIAMOND), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 60); + // MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(Items.EMERALD), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), 100); + // MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(Items.COAL), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), 60); + // MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(Items.IRON_INGOT), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 80); + // MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + // + // //Lenses + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromStacks(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal())), new ItemStack(InitItems.itemColorLens), 5000); + // recipeColorLens = RecipeUtil.lastReconstructorRecipe(); + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(InitItems.itemColorLens), new ItemStack(InitItems.itemExplosionLens), 5000); + // recipeExplosionLens = RecipeUtil.lastReconstructorRecipe(); + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(InitItems.itemExplosionLens), new ItemStack(InitItems.itemDamageLens), 5000); + // recipeDamageLens = RecipeUtil.lastReconstructorRecipe(); + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(InitItems.itemDamageLens), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), 5000); + // + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(InitBlocks.blockLaserRelay), new ItemStack(InitBlocks.blockLaserRelayFluids), 2000); + // recipeFluidLaser = RecipeUtil.lastReconstructorRecipe(); + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(InitBlocks.blockLaserRelayFluids), new ItemStack(InitBlocks.blockLaserRelayItem), 2000); + // recipeItemLaser = RecipeUtil.lastReconstructorRecipe(); + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(InitBlocks.blockLaserRelayItem), new ItemStack(InitBlocks.blockLaserRelay), 2000); + // + // //Misc + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(Blocks.SAND), new ItemStack(Blocks.SOUL_SAND), 20000); + // recipeSoulSand = RecipeUtil.lastReconstructorRecipe(); + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(Items.ROTTEN_FLESH), new ItemStack(Items.LEATHER), 8000); + // recipeLeather = RecipeUtil.lastReconstructorRecipe(); + // + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(Blocks.RED_MUSHROOM), new ItemStack(Items.NETHER_WART), 150000); + // recipeNetherWart = RecipeUtil.lastReconstructorRecipe(); + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(Items.QUARTZ), new ItemStack(Items.PRISMARINE_SHARD), 30000); + // recipePrismarine = RecipeUtil.lastReconstructorRecipe(); + // + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromItems(InitItems.itemCanolaSeed), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CRYSTALLIZED_CANOLA_SEED.ordinal()), 2000); + // recipeCrystallizedCanolaSeed = RecipeUtil.lastReconstructorRecipe(); + // + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(fromBlock(Blocks.QUARTZ_BLOCK), new ItemStack(InitBlocks.blockTestifiBucksWhiteWall), 10); + // recipeWhiteWall = RecipeUtil.lastReconstructorRecipe(); + // ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(Ingredient.fromStacks(new ItemStack(Blocks.QUARTZ_BLOCK, 1, 1)), new ItemStack(InitBlocks.blockTestifiBucksGreenWall), 10); + // recipeGreenWall = RecipeUtil.lastReconstructorRecipe(); + // + // ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES.add(recipeEnchBook = new EnchBookConversion()); + // + // IColorLensChanger changer = new ColorLensChangerByDyeMeta(); + // if (ConfigBoolValues.COLOR_LENS_USES_OREDICT.isEnabled()) { + // initOredictDyeRotator(); + // } else { + // ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Items.DYE, changer); + // } + // ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.WOOL), changer); + // ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.STAINED_GLASS), changer); + // ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.STAINED_GLASS_PANE), changer); + // ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.STAINED_HARDENED_CLAY), changer); + // ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.CARPET), changer); + // ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(InitBlocks.blockColoredLamp), changer); + // ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(InitBlocks.blockColoredLampOn), changer); } + // + // @Deprecated //Use lens-checking method below. + // public static List getRecipesFor(ItemStack input) { + // List possibleRecipes = new ArrayList<>(); + // for (LensConversionRecipe recipe : ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES) + // if (recipe.getInput().apply(input)) possibleRecipes.add(recipe); + // return possibleRecipes; + // } + // + // @Nullable + // public static LensConversionRecipe findMatchingRecipe(ItemStack input, Lens lens) { + // for (LensConversionRecipe recipe : ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES) + // if (recipe.matches(input, lens)) return recipe; + // return null; + // } + // + // private static Ingredient fromBlock(Block b) { + // return Ingredient.fromItems(Item.getItemFromBlock(b)); + // } + // + // private static void initOredictDyeRotator() { + // List stacks = NonNullList.withSize(16, ItemStack.EMPTY); + // List dyeItems = new ArrayList<>(); + // String[] dyes = { "White", "Orange", "Magenta", "LightBlue", "Yellow", "Lime", "Pink", "Gray", "LightGray", "Cyan", "Purple", "Blue", "Brown", "Green", "Red", "Black" }; + // for (int i = 0; i < dyes.length; i++) { + // List ores = OreDictionary.getOres("dye" + dyes[i]); + // dyeItems.addAll(ores); + // stacks.set(i, ores.get(ores.size() - 1)); + // } + // ColorLensRotator rotator = new ColorLensRotator(stacks); + // for (ItemStack s : dyeItems) + // ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(s.getItem(), rotator); + // } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheCrystals.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheCrystals.java index 39b17f42a..3ae04abef 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheCrystals.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheCrystals.java @@ -14,6 +14,7 @@ import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.util.IStringSerializable; import net.minecraftforge.common.IRarity; +@Deprecated public enum TheCrystals implements IStringSerializable { REDSTONE("red", Util.CRYSTAL_RED_RARITY, 0xFF2F21, 158F / 255F, 43F / 255F, 39F / 255F), @@ -39,4 +40,4 @@ public enum TheCrystals implements IStringSerializable { public String getName() { return this.name; } -} \ No newline at end of file +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/material/ArmorMaterials.java b/src/main/java/de/ellpeck/actuallyadditions/mod/material/ArmorMaterials.java new file mode 100644 index 000000000..91cc2d219 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/material/ArmorMaterials.java @@ -0,0 +1,98 @@ +package de.ellpeck.actuallyadditions.mod.material; + +import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; +import de.ellpeck.actuallyadditions.mod.items.InitItems; +import net.minecraft.inventory.EquipmentSlotType; +import net.minecraft.item.IArmorMaterial; +import net.minecraft.item.crafting.Ingredient; +import net.minecraft.util.LazyValue; +import net.minecraft.util.SoundEvent; +import net.minecraft.util.SoundEvents; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; + +import java.util.function.Supplier; + +/** + * Complete copy paste from {@link net.minecraft.item.ArmorMaterial} + *

+ * todo validate all values refect correctly + */ +public enum ArmorMaterials implements IArmorMaterial { + // EMERALD("emerald_armor_material", 30, new int[] { 5, 8, 9, 4 }, 15, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 2, 0f, () -> Ingredient.fromItems(Items.EMERALD)), + // OBSIDIAN("obsidian_armor_material", 28, new int[] { 1, 3, 4, 3 }, 10, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 1, 0f, () -> Ingredient.fromItems(Items.OBSIDIAN)), + + QUARTZ("quartz_armor_material", 15, new int[]{3, 5, 6, 3}, 8, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 1, 0f, () -> Ingredient.fromItems(InitItems.BLACK_QUARTZ.get())), + RESTONIA("restonia_armor_material", 18, new int[]{3, 6, 7, 3}, 9, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0, 0f, () -> Ingredient.fromItems(InitItems.RESTONIA_CRYSTAL.get())), + PALIS("palis_armor_material", 10, new int[]{3, 6, 7, 3}, 10, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0, 0f, () -> Ingredient.fromItems(InitItems.PALIS_CRYSTAL.get())), + DIAMATINE("diamatine_armor_material", 36, new int[]{4, 7, 8, 4}, 12, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 3, 0f, () -> Ingredient.fromItems(InitItems.DIAMATINE_CRYSTAL.get())), + VOID("void_armor_material", 23, new int[]{1, 3, 4, 1}, 13, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0, 0f, () -> Ingredient.fromItems(InitItems.VOID_CRYSTAL.get())), + EMERADIC("emeradic_armor_material", 32, new int[]{6, 9, 9, 4}, 18, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 3, 0f, () -> Ingredient.fromItems(InitItems.EMERADIC_CRYSTAL.get())), + ENORI("enori_armor_material", 24, new int[]{3, 6, 6, 3}, 11, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0, 0f, () -> Ingredient.fromItems(InitItems.ENORI_CRYSTAL.get())); + + // HMMM Tasty stolen code from MC, how lovely. + private static final int[] MAX_DAMAGE_ARRAY = new int[]{13, 15, 16, 11}; + private final String name; + private final int maxDamageFactor; + private final int[] damageReductionAmountArray; + private final int enchantability; + private final SoundEvent soundEvent; + private final float toughness; + private final float knockbackResistance; + private final LazyValue repairMaterial; + + ArmorMaterials(String name, int maxDamageFactor, int[] damageReductionAmountArray, int enchantability, SoundEvent soundEvent, float toughness, float knockbackResistance, Supplier repairMaterial) { + this.name = String.format("%s:%s", ActuallyAdditions.MODID, name); + this.maxDamageFactor = maxDamageFactor; + this.damageReductionAmountArray = damageReductionAmountArray; + this.enchantability = enchantability; + this.soundEvent = soundEvent; + this.toughness = toughness; + this.knockbackResistance = knockbackResistance; + this.repairMaterial = new LazyValue<>(repairMaterial); + } + + @Override + public int getDurability(EquipmentSlotType slotIn) { + return MAX_DAMAGE_ARRAY[slotIn.getIndex()] * this.maxDamageFactor; + } + + @Override + public int getDamageReductionAmount(EquipmentSlotType slotIn) { + return this.damageReductionAmountArray[slotIn.getIndex()]; + } + + @Override + public int getEnchantability() { + return this.enchantability; + } + + @Override + public SoundEvent getSoundEvent() { + return this.soundEvent; + } + + @Override + public Ingredient getRepairMaterial() { + return this.repairMaterial.getValue(); + } + + @Override + @OnlyIn(Dist.CLIENT) + public String getName() { + return this.name; + } + + @Override + public float getToughness() { + return this.toughness; + } + + /** + * Gets the percentage of knockback resistance provided by armor of the material. + */ + @Override + public float getKnockbackResistance() { + return this.knockbackResistance; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitArmorMaterials.java b/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitArmorMaterials.java index 93457d79f..d367ba159 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitArmorMaterials.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitArmorMaterials.java @@ -10,47 +10,40 @@ package de.ellpeck.actuallyadditions.mod.material; -import java.util.Locale; - -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import net.minecraft.init.SoundEvents; -import net.minecraft.item.ItemArmor.ArmorMaterial; -import net.minecraft.util.SoundEvent; -import net.minecraftforge.common.util.EnumHelper; - +@Deprecated public final class InitArmorMaterials { - - public static ArmorMaterial armorMaterialEmerald; - public static ArmorMaterial armorMaterialObsidian; - public static ArmorMaterial armorMaterialQuartz; - - public static ArmorMaterial armorMaterialCrystalRed; - public static ArmorMaterial armorMaterialCrystalBlue; - public static ArmorMaterial armorMaterialCrystalLightBlue; - public static ArmorMaterial armorMaterialCrystalBlack; - public static ArmorMaterial armorMaterialCrystalGreen; - public static ArmorMaterial armorMaterialCrystalWhite; - - public static ArmorMaterial armorMaterialGoggles; - - public static void init() { - ActuallyAdditions.LOGGER.info("Initializing Armor Materials..."); - - armorMaterialEmerald = addArmorMaterial("armorMaterialEmerald", ActuallyAdditions.MODID + ":armor_emerald", 50, new int[] { 5, 8, 9, 4 }, 15, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 2); - armorMaterialObsidian = addArmorMaterial("armorMaterialObsidian", ActuallyAdditions.MODID + ":armor_obsidian", 120, new int[] { 1, 3, 4, 3 }, 10, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 1); - armorMaterialQuartz = addArmorMaterial("armorMaterialQuartz", ActuallyAdditions.MODID + ":armor_quartz", 20, new int[] { 3, 5, 6, 3 }, 8, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 1); - - armorMaterialCrystalRed = addArmorMaterial("armorMaterialCrystalRed", ActuallyAdditions.MODID + ":armor_crystal_red", 18, new int[] { 3, 6, 7, 3 }, 9, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0); - armorMaterialCrystalBlue = addArmorMaterial("armorMaterialCrystalBlue", ActuallyAdditions.MODID + ":armor_crystal_blue", 18, new int[] { 3, 6, 7, 3 }, 10, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0); - armorMaterialCrystalLightBlue = addArmorMaterial("armorMaterialCrystalLightBlue", ActuallyAdditions.MODID + ":armor_crystal_light_blue", 35, new int[] { 4, 7, 8, 4 }, 12, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 3); - armorMaterialCrystalBlack = addArmorMaterial("armorMaterialCrystalBlack", ActuallyAdditions.MODID + ":armor_crystal_black", 12, new int[] { 1, 3, 4, 1 }, 13, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0); - armorMaterialCrystalGreen = addArmorMaterial("armorMaterialCrystalGreen", ActuallyAdditions.MODID + ":armor_crystal_green", 60, new int[] { 6, 9, 9, 4 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 3); - armorMaterialCrystalWhite = addArmorMaterial("armorMaterialCrystalWhite", ActuallyAdditions.MODID + ":armor_crystal_white", 18, new int[] { 3, 6, 6, 3 }, 11, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0); - - armorMaterialGoggles = addArmorMaterial("armorMaterialGoggles", ActuallyAdditions.MODID + ":armor_goggles", 0, new int[] { 0, 0, 0, 0 }, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0); - } - - private static ArmorMaterial addArmorMaterial(String name, String textureName, int durability, int[] reductionAmounts, int enchantability, SoundEvent soundOnEquip, float toughness) { - return EnumHelper.addArmorMaterial((ActuallyAdditions.MODID + "_" + name).toUpperCase(Locale.ROOT), textureName, durability, reductionAmounts, enchantability, soundOnEquip, toughness); - } + // + // public static ArmorMaterial armorMaterialEmerald; + // public static ArmorMaterial armorMaterialObsidian; + // public static ArmorMaterial armorMaterialQuartz; + // + // public static ArmorMaterial armorMaterialCrystalRed; + // public static ArmorMaterial armorMaterialCrystalBlue; + // public static ArmorMaterial armorMaterialCrystalLightBlue; + // public static ArmorMaterial armorMaterialCrystalBlack; + // public static ArmorMaterial armorMaterialCrystalGreen; + // public static ArmorMaterial armorMaterialCrystalWhite; + // + // public static ArmorMaterial armorMaterialGoggles; + // + // public static void init() { + // ActuallyAdditions.LOGGER.info("Initializing Armor Materials..."); + // + // armorMaterialEmerald = addArmorMaterial("armorMaterialEmerald", ActuallyAdditions.MODID + ":armor_emerald", 50, new int[] { 5, 8, 9, 4 }, 15, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 2); + // armorMaterialObsidian = addArmorMaterial("armorMaterialObsidian", ActuallyAdditions.MODID + ":armor_obsidian", 120, new int[] { 1, 3, 4, 3 }, 10, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 1); + // armorMaterialQuartz = addArmorMaterial("armorMaterialQuartz", ActuallyAdditions.MODID + ":armor_quartz", 20, new int[] { 3, 5, 6, 3 }, 8, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 1); + // + // armorMaterialCrystalRed = addArmorMaterial("armorMaterialCrystalRed", ActuallyAdditions.MODID + ":armor_crystal_red", 18, new int[] { 3, 6, 7, 3 }, 9, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0); + // armorMaterialCrystalBlue = addArmorMaterial("armorMaterialCrystalBlue", ActuallyAdditions.MODID + ":armor_crystal_blue", 18, new int[] { 3, 6, 7, 3 }, 10, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0); + // armorMaterialCrystalLightBlue = addArmorMaterial("armorMaterialCrystalLightBlue", ActuallyAdditions.MODID + ":armor_crystal_light_blue", 35, new int[] { 4, 7, 8, 4 }, 12, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 3); + // armorMaterialCrystalBlack = addArmorMaterial("armorMaterialCrystalBlack", ActuallyAdditions.MODID + ":armor_crystal_black", 12, new int[] { 1, 3, 4, 1 }, 13, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0); + // armorMaterialCrystalGreen = addArmorMaterial("armorMaterialCrystalGreen", ActuallyAdditions.MODID + ":armor_crystal_green", 60, new int[] { 6, 9, 9, 4 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 3); + // armorMaterialCrystalWhite = addArmorMaterial("armorMaterialCrystalWhite", ActuallyAdditions.MODID + ":armor_crystal_white", 18, new int[] { 3, 6, 6, 3 }, 11, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0); + // + // armorMaterialGoggles = addArmorMaterial("armorMaterialGoggles", ActuallyAdditions.MODID + ":armor_goggles", 0, new int[] { 0, 0, 0, 0 }, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0); + // } + // + // private static ArmorMaterial addArmorMaterial(String name, String textureName, int durability, int[] reductionAmounts, int enchantability, SoundEvent soundOnEquip, float toughness) { + // return EnumHelper.addArmorMaterial((ActuallyAdditions.MODID + "_" + name).toUpperCase(Locale.ROOT), textureName, durability, reductionAmounts, enchantability, soundOnEquip, toughness); + // } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitToolMaterials.java b/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitToolMaterials.java index 366f19d87..47d49e977 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitToolMaterials.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitToolMaterials.java @@ -10,43 +10,38 @@ package de.ellpeck.actuallyadditions.mod.material; -import java.util.Locale; - -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import net.minecraft.item.Item.ToolMaterial; -import net.minecraftforge.common.util.EnumHelper; - +@Deprecated public final class InitToolMaterials { - - public static ToolMaterial toolMaterialEmerald; - public static ToolMaterial toolMaterialObsidian; - public static ToolMaterial toolMaterialQuartz; - - public static ToolMaterial toolMaterialCrystalRed; - public static ToolMaterial toolMaterialCrystalBlue; - public static ToolMaterial toolMaterialCrystalLightBlue; - public static ToolMaterial toolMaterialCrystalBlack; - public static ToolMaterial toolMaterialCrystalGreen; - public static ToolMaterial toolMaterialCrystalWhite; - - public static void init() { - ActuallyAdditions.LOGGER.info("Initializing Tool Materials..."); - - toolMaterialEmerald = addToolMaterial("toolMaterialEmerald", 3, 2000, 9.0F, 5.0F, 15); - toolMaterialObsidian = addToolMaterial("toolMaterialObsidian", 3, 8000, 4.0F, 2.0F, 15); - toolMaterialQuartz = addToolMaterial("toolMaterialQuartz", 2, 280, 6.5F, 2.0F, 10); - - toolMaterialCrystalRed = addToolMaterial("toolMaterialCrystalRed", 2, 300, 7.0F, 2.25F, 12); - toolMaterialCrystalBlue = addToolMaterial("toolMaterialCrystalBlue", 2, 300, 7.0F, 2.25F, 12); - toolMaterialCrystalLightBlue = addToolMaterial("toolMaterialCrystalLightBlue", 3, 1600, 9.0F, 4.0F, 14); - toolMaterialCrystalBlack = addToolMaterial("toolMaterialCrystalBlack", 2, 280, 6.0F, 2.0F, 8); - toolMaterialCrystalGreen = addToolMaterial("toolMaterialCrystalGreen", 4, 2200, 9.5F, 5.5F, 18); - toolMaterialCrystalWhite = addToolMaterial("toolMaterialCrystalWhite", 2, 280, 6.25F, 2.5F, 15); - - } - - private static ToolMaterial addToolMaterial(String name, int harvestLevel, int maxUses, float efficiency, float damage, int enchantability) { - return EnumHelper.addToolMaterial((ActuallyAdditions.MODID + "_" + name).toUpperCase(Locale.ROOT), harvestLevel, maxUses, efficiency, damage, enchantability); - } + // + // public static ToolMaterial toolMaterialEmerald; + // public static ToolMaterial toolMaterialObsidian; + // public static ToolMaterial toolMaterialQuartz; + // + // public static ToolMaterial toolMaterialCrystalRed; + // public static ToolMaterial toolMaterialCrystalBlue; + // public static ToolMaterial toolMaterialCrystalLightBlue; + // public static ToolMaterial toolMaterialCrystalBlack; + // public static ToolMaterial toolMaterialCrystalGreen; + // public static ToolMaterial toolMaterialCrystalWhite; + // + // public static void init() { + // ActuallyAdditions.LOGGER.info("Initializing Tool Materials..."); + // + // toolMaterialEmerald = addToolMaterial("toolMaterialEmerald", 3, 2000, 9.0F, 5.0F, 15); + // toolMaterialObsidian = addToolMaterial("toolMaterialObsidian", 3, 8000, 4.0F, 2.0F, 15); + // toolMaterialQuartz = addToolMaterial("toolMaterialQuartz", 2, 280, 6.5F, 2.0F, 10); + // + // toolMaterialCrystalRed = addToolMaterial("toolMaterialCrystalRed", 2, 300, 7.0F, 2.25F, 12); + // toolMaterialCrystalBlue = addToolMaterial("toolMaterialCrystalBlue", 2, 300, 7.0F, 2.25F, 12); + // toolMaterialCrystalLightBlue = addToolMaterial("toolMaterialCrystalLightBlue", 3, 1600, 9.0F, 4.0F, 14); + // toolMaterialCrystalBlack = addToolMaterial("toolMaterialCrystalBlack", 2, 280, 6.0F, 2.0F, 8); + // toolMaterialCrystalGreen = addToolMaterial("toolMaterialCrystalGreen", 4, 2200, 9.5F, 5.5F, 18); + // toolMaterialCrystalWhite = addToolMaterial("toolMaterialCrystalWhite", 2, 280, 6.25F, 2.5F, 15); + // + // } + // + // private static ToolMaterial addToolMaterial(String name, int harvestLevel, int maxUses, float efficiency, float damage, int enchantability) { + // return EnumHelper.addToolMaterial((ActuallyAdditions.MODID + "_" + name).toUpperCase(Locale.ROOT), harvestLevel, maxUses, efficiency, damage, enchantability); + // } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/material/ToolMaterials.java b/src/main/java/de/ellpeck/actuallyadditions/mod/material/ToolMaterials.java new file mode 100644 index 000000000..84bfa2e3b --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/material/ToolMaterials.java @@ -0,0 +1,69 @@ +package de.ellpeck.actuallyadditions.mod.material; + +import de.ellpeck.actuallyadditions.mod.items.InitItems; +import net.minecraft.item.IItemTier; +import net.minecraft.item.crafting.Ingredient; +import net.minecraft.util.LazyValue; + +import java.util.function.Supplier; + +/** + * Complete copy paste from {@link net.minecraft.item.ItemTier} + *

+ * todo: review to ensure all values act as intended + */ +public enum ToolMaterials implements IItemTier { + QUARTZ(2, 280, 6.5f, 2.0f, 10, () -> Ingredient.fromItems(InitItems.BLACK_QUARTZ.get())), + RESTONIA(2, 300, 7.0f, 2.25f, 12, () -> Ingredient.fromItems(InitItems.RESTONIA_CRYSTAL.get())), + PALIS(2, 300, 7.0f, 2.25f, 12, () -> Ingredient.fromItems(InitItems.PALIS_CRYSTAL.get())), + DIAMATINE(3, 1600, 9.0f, 4.0f, 14, () -> Ingredient.fromItems(InitItems.DIAMATINE_CRYSTAL.get())), + VOID(2, 280, 6.0f, 2.0f, 8, () -> Ingredient.fromItems(InitItems.VOID_CRYSTAL.get())), + EMERADIC(4, 2200, 9.5f, 5.55f, 18, () -> Ingredient.fromItems(InitItems.EMERADIC_CRYSTAL.get())), + ENORI(2, 280, 6.25f, 6.25f, 15, () -> Ingredient.fromItems(InitItems.ENORI_CRYSTAL.get())); + + private final int harvestLevel; + private final int maxUses; + private final float efficiency; + private final float attackDamage; + private final int enchantability; + private final LazyValue repairMaterial; + + ToolMaterials(int harvestLevelIn, int maxUsesIn, float efficiencyIn, float attackDamageIn, int enchantabilityIn, Supplier repairMaterialIn) { + this.harvestLevel = harvestLevelIn; + this.maxUses = maxUsesIn; + this.efficiency = efficiencyIn; + this.attackDamage = attackDamageIn; + this.enchantability = enchantabilityIn; + this.repairMaterial = new LazyValue<>(repairMaterialIn); + } + + @Override + public int getMaxUses() { + return this.maxUses; + } + + @Override + public float getEfficiency() { + return this.efficiency; + } + + @Override + public float getAttackDamage() { + return this.attackDamage; + } + + @Override + public int getHarvestLevel() { + return this.harvestLevel; + } + + @Override + public int getEnchantability() { + return this.enchantability; + } + + @Override + public Ingredient getRepairMaterial() { + return this.repairMaterial.getValue(); + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DungeonLoot.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DungeonLoot.java index 92de05e09..6213849d9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DungeonLoot.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DungeonLoot.java @@ -10,161 +10,139 @@ package de.ellpeck.actuallyadditions.mod.misc; -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks; -import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheJams; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.storage.loot.LootEntry; -import net.minecraft.world.storage.loot.LootEntryItem; -import net.minecraft.world.storage.loot.LootPool; -import net.minecraft.world.storage.loot.LootTableList; -import net.minecraft.world.storage.loot.RandomValueRange; -import net.minecraft.world.storage.loot.conditions.LootCondition; -import net.minecraft.world.storage.loot.functions.LootFunction; -import net.minecraft.world.storage.loot.functions.SetCount; -import net.minecraft.world.storage.loot.functions.SetDamage; -import net.minecraft.world.storage.loot.functions.SetMetadata; -import net.minecraftforge.event.LootTableLoadEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - +// TODO: [port] MOVE OVER TO DATA GENS +@Deprecated public class DungeonLoot { - - public static final ResourceLocation JAM_HOUSE = new ResourceLocation(ActuallyAdditions.MODID, "jam_house"); - public static final ResourceLocation LUSH_CAVES = new ResourceLocation(ActuallyAdditions.MODID, "lush_caves"); - public static final ResourceLocation ENGINEER_HOUSE = new ResourceLocation(ActuallyAdditions.MODID, "engineer_house"); - - public DungeonLoot() { - LootTableList.register(JAM_HOUSE); - LootTableList.register(LUSH_CAVES); - LootTableList.register(ENGINEER_HOUSE); - } - - @SubscribeEvent - public void onLootTableLoad(LootTableLoadEvent event) { - if (event.getName() != null && event.getTable() != null) { - LootCondition[] noCondition = new LootCondition[0]; - - LootPool pool = event.getTable().getPool("main"); - if (pool == null) { - pool = new LootPool(new LootEntry[0], noCondition, new RandomValueRange(5, 10), new RandomValueRange(0), "main"); - event.getTable().addPool(pool); - } - - boolean addCrystals = false; - boolean addDrillCore = false; - boolean addQuartz = false; - boolean addBatWings = false; - - if (ConfigBoolValues.DUNGEON_LOOT.isEnabled()) { - if (LootTableList.CHESTS_SIMPLE_DUNGEON.equals(event.getName())) { - addCrystals = true; - addDrillCore = true; - addQuartz = true; - } else if (LootTableList.CHESTS_ABANDONED_MINESHAFT.equals(event.getName())) { - addCrystals = true; - addDrillCore = true; - } else if (LootTableList.CHESTS_VILLAGE_BLACKSMITH.equals(event.getName())) { - addDrillCore = true; - addQuartz = true; - } else if (LootTableList.CHESTS_STRONGHOLD_LIBRARY.equals(event.getName())) { - addBatWings = true; - } else if (LootTableList.CHESTS_IGLOO_CHEST.equals(event.getName())) { - addBatWings = true; - } else if (LootTableList.CHESTS_DESERT_PYRAMID.equals(event.getName())) { - addDrillCore = true; - addBatWings = true; - } else if (LootTableList.CHESTS_NETHER_BRIDGE.equals(event.getName())) { - addBatWings = true; - addCrystals = true; - addDrillCore = true; - } else if (LootTableList.CHESTS_END_CITY_TREASURE.equals(event.getName())) { - addBatWings = true; - addCrystals = true; - addDrillCore = true; - addQuartz = true; - } else if (LootTableList.CHESTS_WOODLAND_MANSION.equals(event.getName())) { - addBatWings = true; - addCrystals = true; - addDrillCore = true; - addQuartz = true; - } - } - - if (JAM_HOUSE.equals(event.getName())) { - LootFunction jamDamage = new SetMetadata(noCondition, new RandomValueRange(0, TheJams.values().length - 1)); - LootFunction jamAmount = new SetCount(noCondition, new RandomValueRange(3, 5)); - pool.addEntry(new LootEntryItem(InitItems.itemJams, 2, 0, new LootFunction[] { jamDamage, jamAmount }, noCondition, ActuallyAdditions.MODID + ":jams")); - - LootFunction glassAmount = new SetCount(noCondition, new RandomValueRange(2)); - pool.addEntry(new LootEntryItem(Items.GLASS_BOTTLE, 1, 0, new LootFunction[] { glassAmount }, noCondition, ActuallyAdditions.MODID + ":bottles")); - } else if (LUSH_CAVES.equals(event.getName())) { - addQuartz = true; - addBatWings = true; - addCrystals = true; - - pool.addEntry(new LootEntryItem(Items.BOOK, 50, 0, new LootFunction[0], noCondition, ActuallyAdditions.MODID + ":book")); - - LootFunction bonesAmount = new SetCount(noCondition, new RandomValueRange(1, 12)); - pool.addEntry(new LootEntryItem(Items.BONE, 100, 0, new LootFunction[] { bonesAmount }, noCondition, ActuallyAdditions.MODID + ":bones")); - - Item[] aiots = new Item[] { InitItems.woodenPaxel, InitItems.stonePaxel, InitItems.quartzPaxel, InitItems.itemPaxelCrystalBlack, InitItems.itemPaxelCrystalWhite }; - for (int i = 0; i < aiots.length; i++) { - LootFunction damage = new SetDamage(noCondition, new RandomValueRange(0F, 0.25F)); - pool.addEntry(new LootEntryItem(aiots[i], 30 - i * 5, 0, new LootFunction[] { damage }, noCondition, ActuallyAdditions.MODID + ":aiot" + i)); - } - - Item[] armor = new Item[] { Items.LEATHER_HELMET, Items.LEATHER_CHESTPLATE, Items.LEATHER_LEGGINGS, Items.LEATHER_BOOTS }; - for (int i = 0; i < armor.length; i++) { - LootFunction damage = new SetDamage(noCondition, new RandomValueRange(0F, 0.75F)); - pool.addEntry(new LootEntryItem(armor[i], 50, 0, new LootFunction[] { damage }, noCondition, ActuallyAdditions.MODID + ":armor" + i)); - } - } else if (ENGINEER_HOUSE.equals(event.getName())) { - addQuartz = true; - addBatWings = true; - addCrystals = true; - addDrillCore = true; - - LootFunction woodCaseAmount = new SetCount(noCondition, new RandomValueRange(3, 10)); - LootFunction woodCaseDamage = new SetMetadata(noCondition, new RandomValueRange(TheMiscBlocks.WOOD_CASING.ordinal())); - pool.addEntry(new LootEntryItem(Item.getItemFromBlock(InitBlocks.blockMisc), 60, 0, new LootFunction[] { woodCaseAmount, woodCaseDamage }, noCondition, ActuallyAdditions.MODID + ":woodenCase")); - - LootFunction ironCaseAmount = new SetCount(noCondition, new RandomValueRange(1, 3)); - LootFunction ironCaseDamage = new SetMetadata(noCondition, new RandomValueRange(TheMiscBlocks.IRON_CASING.ordinal())); - pool.addEntry(new LootEntryItem(Item.getItemFromBlock(InitBlocks.blockMisc), 40, 0, new LootFunction[] { ironCaseAmount, ironCaseDamage }, noCondition, ActuallyAdditions.MODID + ":ironCase")); - } - - if (addCrystals) { - LootFunction damage = new SetMetadata(noCondition, new RandomValueRange(0, TheCrystals.values().length - 1)); - LootFunction amount = new SetCount(noCondition, new RandomValueRange(1, 3)); - LootFunction[] functions = new LootFunction[] { damage, amount }; - - pool.addEntry(new LootEntryItem(InitItems.itemCrystal, 20, 0, functions, noCondition, ActuallyAdditions.MODID + ":crystalItems")); - pool.addEntry(new LootEntryItem(Item.getItemFromBlock(InitBlocks.blockCrystal), 3, 0, functions, noCondition, ActuallyAdditions.MODID + ":crystalBlocks")); - } - - if (addDrillCore) { - LootFunction damage = new SetMetadata(noCondition, new RandomValueRange(TheMiscItems.DRILL_CORE.ordinal())); - pool.addEntry(new LootEntryItem(InitItems.itemMisc, 5, 0, new LootFunction[] { damage }, noCondition, ActuallyAdditions.MODID + ":drillCore")); - } - - if (addQuartz) { - LootFunction damage = new SetMetadata(noCondition, new RandomValueRange(TheMiscItems.QUARTZ.ordinal())); - LootFunction amount = new SetCount(noCondition, new RandomValueRange(1, 5)); - pool.addEntry(new LootEntryItem(InitItems.itemMisc, 20, 0, new LootFunction[] { damage, amount }, noCondition, ActuallyAdditions.MODID + ":quartz")); - } - - if (addBatWings) { - LootFunction damage = new SetMetadata(noCondition, new RandomValueRange(TheMiscItems.BAT_WING.ordinal())); - LootFunction amount = new SetCount(noCondition, new RandomValueRange(1, 2)); - pool.addEntry(new LootEntryItem(InitItems.itemMisc, 5, 0, new LootFunction[] { damage, amount }, noCondition, ActuallyAdditions.MODID + ":batWings")); - } - } - } + // + // public static final ResourceLocation JAM_HOUSE = new ResourceLocation(ActuallyAdditions.MODID, "jam_house"); + // public static final ResourceLocation LUSH_CAVES = new ResourceLocation(ActuallyAdditions.MODID, "lush_caves"); + // public static final ResourceLocation ENGINEER_HOUSE = new ResourceLocation(ActuallyAdditions.MODID, "engineer_house"); + // + // public DungeonLoot() { + // LootTableList.register(JAM_HOUSE); + // LootTableList.register(LUSH_CAVES); + // LootTableList.register(ENGINEER_HOUSE); + // } + // + // @SubscribeEvent + // public void onLootTableLoad(LootTableLoadEvent event) { + // if (event.getName() != null && event.getTable() != null) { + // LootCondition[] noCondition = new LootCondition[0]; + // + // LootPool pool = event.getTable().getPool("main"); + // if (pool == null) { + // pool = new LootPool(new LootEntry[0], noCondition, new RandomValueRange(5, 10), new RandomValueRange(0), "main"); + // event.getTable().addPool(pool); + // } + // + // boolean addCrystals = false; + // boolean addDrillCore = false; + // boolean addQuartz = false; + // boolean addBatWings = false; + // + // if (ConfigBoolValues.DUNGEON_LOOT.isEnabled()) { + // if (LootTableList.CHESTS_SIMPLE_DUNGEON.equals(event.getName())) { + // addCrystals = true; + // addDrillCore = true; + // addQuartz = true; + // } else if (LootTableList.CHESTS_ABANDONED_MINESHAFT.equals(event.getName())) { + // addCrystals = true; + // addDrillCore = true; + // } else if (LootTableList.CHESTS_VILLAGE_BLACKSMITH.equals(event.getName())) { + // addDrillCore = true; + // addQuartz = true; + // } else if (LootTableList.CHESTS_STRONGHOLD_LIBRARY.equals(event.getName())) { + // addBatWings = true; + // } else if (LootTableList.CHESTS_IGLOO_CHEST.equals(event.getName())) { + // addBatWings = true; + // } else if (LootTableList.CHESTS_DESERT_PYRAMID.equals(event.getName())) { + // addDrillCore = true; + // addBatWings = true; + // } else if (LootTableList.CHESTS_NETHER_BRIDGE.equals(event.getName())) { + // addBatWings = true; + // addCrystals = true; + // addDrillCore = true; + // } else if (LootTableList.CHESTS_END_CITY_TREASURE.equals(event.getName())) { + // addBatWings = true; + // addCrystals = true; + // addDrillCore = true; + // addQuartz = true; + // } else if (LootTableList.CHESTS_WOODLAND_MANSION.equals(event.getName())) { + // addBatWings = true; + // addCrystals = true; + // addDrillCore = true; + // addQuartz = true; + // } + // } + // + // if (JAM_HOUSE.equals(event.getName())) { + // LootFunction jamDamage = new SetMetadata(noCondition, new RandomValueRange(0, TheJams.values().length - 1)); + // LootFunction jamAmount = new SetCount(noCondition, new RandomValueRange(3, 5)); + // pool.addEntry(new LootEntryItem(InitItems.itemJams, 2, 0, new LootFunction[] { jamDamage, jamAmount }, noCondition, ActuallyAdditions.MODID + ":jams")); + // + // LootFunction glassAmount = new SetCount(noCondition, new RandomValueRange(2)); + // pool.addEntry(new LootEntryItem(Items.GLASS_BOTTLE, 1, 0, new LootFunction[] { glassAmount }, noCondition, ActuallyAdditions.MODID + ":bottles")); + // } else if (LUSH_CAVES.equals(event.getName())) { + // addQuartz = true; + // addBatWings = true; + // addCrystals = true; + // + // pool.addEntry(new LootEntryItem(Items.BOOK, 50, 0, new LootFunction[0], noCondition, ActuallyAdditions.MODID + ":book")); + // + // LootFunction bonesAmount = new SetCount(noCondition, new RandomValueRange(1, 12)); + // pool.addEntry(new LootEntryItem(Items.BONE, 100, 0, new LootFunction[] { bonesAmount }, noCondition, ActuallyAdditions.MODID + ":bones")); + // + // Item[] aiots = new Item[] { InitItems.woodenPaxel, InitItems.stonePaxel, InitItems.quartzPaxel, InitItems.itemPaxelCrystalBlack, InitItems.itemPaxelCrystalWhite }; + // for (int i = 0; i < aiots.length; i++) { + // LootFunction damage = new SetDamage(noCondition, new RandomValueRange(0F, 0.25F)); + // pool.addEntry(new LootEntryItem(aiots[i], 30 - i * 5, 0, new LootFunction[] { damage }, noCondition, ActuallyAdditions.MODID + ":aiot" + i)); + // } + // + // Item[] armor = new Item[] { Items.LEATHER_HELMET, Items.LEATHER_CHESTPLATE, Items.LEATHER_LEGGINGS, Items.LEATHER_BOOTS }; + // for (int i = 0; i < armor.length; i++) { + // LootFunction damage = new SetDamage(noCondition, new RandomValueRange(0F, 0.75F)); + // pool.addEntry(new LootEntryItem(armor[i], 50, 0, new LootFunction[] { damage }, noCondition, ActuallyAdditions.MODID + ":armor" + i)); + // } + // } else if (ENGINEER_HOUSE.equals(event.getName())) { + // addQuartz = true; + // addBatWings = true; + // addCrystals = true; + // addDrillCore = true; + // + // LootFunction woodCaseAmount = new SetCount(noCondition, new RandomValueRange(3, 10)); + // LootFunction woodCaseDamage = new SetMetadata(noCondition, new RandomValueRange(TheMiscBlocks.WOOD_CASING.ordinal())); + // pool.addEntry(new LootEntryItem(Item.getItemFromBlock(InitBlocks.blockMisc), 60, 0, new LootFunction[] { woodCaseAmount, woodCaseDamage }, noCondition, ActuallyAdditions.MODID + ":woodenCase")); + // + // LootFunction ironCaseAmount = new SetCount(noCondition, new RandomValueRange(1, 3)); + // LootFunction ironCaseDamage = new SetMetadata(noCondition, new RandomValueRange(TheMiscBlocks.IRON_CASING.ordinal())); + // pool.addEntry(new LootEntryItem(Item.getItemFromBlock(InitBlocks.blockMisc), 40, 0, new LootFunction[] { ironCaseAmount, ironCaseDamage }, noCondition, ActuallyAdditions.MODID + ":ironCase")); + // } + // + // if (addCrystals) { + // LootFunction damage = new SetMetadata(noCondition, new RandomValueRange(0, TheCrystals.values().length - 1)); + // LootFunction amount = new SetCount(noCondition, new RandomValueRange(1, 3)); + // LootFunction[] functions = new LootFunction[] { damage, amount }; + // + // pool.addEntry(new LootEntryItem(InitItems.itemCrystal, 20, 0, functions, noCondition, ActuallyAdditions.MODID + ":crystalItems")); + // pool.addEntry(new LootEntryItem(Item.getItemFromBlock(InitBlocks.blockCrystal), 3, 0, functions, noCondition, ActuallyAdditions.MODID + ":crystalBlocks")); + // } + // + // if (addDrillCore) { + // LootFunction damage = new SetMetadata(noCondition, new RandomValueRange(TheMiscItems.DRILL_CORE.ordinal())); + // pool.addEntry(new LootEntryItem(InitItems.itemMisc, 5, 0, new LootFunction[] { damage }, noCondition, ActuallyAdditions.MODID + ":drillCore")); + // } + // + // if (addQuartz) { + // LootFunction damage = new SetMetadata(noCondition, new RandomValueRange(TheMiscItems.QUARTZ.ordinal())); + // LootFunction amount = new SetCount(noCondition, new RandomValueRange(1, 5)); + // pool.addEntry(new LootEntryItem(InitItems.itemMisc, 20, 0, new LootFunction[] { damage, amount }, noCondition, ActuallyAdditions.MODID + ":quartz")); + // } + // + // if (addBatWings) { + // LootFunction damage = new SetMetadata(noCondition, new RandomValueRange(TheMiscItems.BAT_WING.ordinal())); + // LootFunction amount = new SetCount(noCondition, new RandomValueRange(1, 2)); + // pool.addEntry(new LootEntryItem(InitItems.itemMisc, 5, 0, new LootFunction[] { damage, amount }, noCondition, ActuallyAdditions.MODID + ":batWings")); + // } + // } + // } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/SpecialRenderInit.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/SpecialRenderInit.java index f7ca4b0be..5777ec81d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/SpecialRenderInit.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/SpecialRenderInit.java @@ -10,27 +10,25 @@ package de.ellpeck.actuallyadditions.mod.misc.special; -import java.util.HashMap; -import java.util.Locale; -import java.util.Properties; - import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.RenderPlayerEvent; -import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import java.util.HashMap; +import java.util.Locale; +import java.util.Properties; + public class SpecialRenderInit { public static final HashMap SPECIAL_LIST = new HashMap<>(); public SpecialRenderInit() { new ThreadSpecialFetcher(); - MinecraftForge.EVENT_BUS.register(this); } public static void parse(Properties properties) { @@ -73,10 +71,14 @@ public class SpecialRenderInit { private static ItemStack findItem(ResourceLocation resLoc, int meta) { if (Item.REGISTRY.containsKey(resLoc)) { Item item = Item.REGISTRY.getObject(resLoc); - if (item != null) { return new ItemStack(item, 1, meta); } + if (item != null) { + return new ItemStack(item, 1, meta); + } } else if (Block.REGISTRY.containsKey(resLoc)) { Block block = Block.REGISTRY.getObject(resLoc); - if (block != null) { return new ItemStack(block, 1, meta); } + if (block != null) { + return new ItemStack(block, 1, meta); + } } return StackUtil.getEmpty(); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/particle/ParticleBeam.java b/src/main/java/de/ellpeck/actuallyadditions/mod/particle/ParticleBeam.java index a1fa6195b..fc34a4c44 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/particle/ParticleBeam.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/particle/ParticleBeam.java @@ -10,15 +10,13 @@ package de.ellpeck.actuallyadditions.mod.particle; +import com.mojang.blaze3d.vertex.IVertexBuilder; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; +import net.minecraft.client.particle.IParticleRenderType; import net.minecraft.client.particle.Particle; -import net.minecraft.client.renderer.BufferBuilder; -import net.minecraft.entity.Entity; -import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.OnlyIn; +import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.client.world.ClientWorld; -@OnlyIn(Dist.CLIENT) public class ParticleBeam extends Particle { private final double endX; @@ -29,7 +27,7 @@ public class ParticleBeam extends Particle { private final float size; private final float alpha; - public ParticleBeam(World world, double startX, double startY, double startZ, double endX, double endY, double endZ, float[] color, int maxAge, double rotationTime, float size, float alpha) { + public ParticleBeam(ClientWorld world, double startX, double startY, double startZ, double endX, double endY, double endZ, float[] color, int maxAge, double rotationTime, float size, float alpha) { super(world, startX, startY, startZ); this.endX = endX; this.endY = endY; @@ -37,19 +35,19 @@ public class ParticleBeam extends Particle { this.color = color; this.rotationTime = rotationTime; this.size = size; - this.particleMaxAge = maxAge; + this.maxAge = maxAge; this.alpha = alpha; } @Override - public void renderParticle(BufferBuilder buffer, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) { - float ageRatio = (float) this.particleAge / (float) this.particleMaxAge; + public void renderParticle(IVertexBuilder buffer, ActiveRenderInfo renderInfo, float partialTicks) { + float ageRatio = (float) this.age / (float) this.maxAge; float currAlpha = this.alpha - ageRatio * this.alpha; AssetUtil.renderLaser(this.posX + 0.5, this.posY + 0.5, this.posZ + 0.5, this.endX + 0.5, this.endY + 0.5, this.endZ + 0.5, this.rotationTime, currAlpha, this.size, this.color); } @Override - public int getFXLayer() { - return 3; + public IParticleRenderType getRenderType() { + return IParticleRenderType.PARTICLE_SHEET_TRANSLUCENT; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/particle/ParticleLaserItem.java b/src/main/java/de/ellpeck/actuallyadditions/mod/particle/ParticleLaserItem.java index b78020c1c..005a46de5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/particle/ParticleLaserItem.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/particle/ParticleLaserItem.java @@ -10,34 +10,33 @@ package de.ellpeck.actuallyadditions.mod.particle; +import com.mojang.blaze3d.platform.GlStateManager; +import com.mojang.blaze3d.systems.RenderSystem; +import com.mojang.blaze3d.vertex.IVertexBuilder; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.IParticleRenderType; import net.minecraft.client.particle.Particle; -import net.minecraft.client.renderer.BufferBuilder; -import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.ActiveRenderInfo; import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.entity.Entity; +import net.minecraft.client.world.ClientWorld; import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.OnlyIn; -import org.lwjgl.opengl.GL11; +import net.minecraft.util.Util; +import net.minecraft.util.math.vector.Vector3d; import org.lwjgl.opengl.GL14; -@OnlyIn(Dist.CLIENT) public class ParticleLaserItem extends Particle { - private final double otherX; private final double otherY; private final double otherZ; private final ItemStack stack; - private ParticleLaserItem(World world, double posX, double posY, double posZ, ItemStack stack, double motionY) { + private ParticleLaserItem(ClientWorld world, double posX, double posY, double posZ, ItemStack stack, double motionY) { this(world, posX, posY, posZ, stack, motionY, 0, 0, 0); } - public ParticleLaserItem(World world, double posX, double posY, double posZ, ItemStack stack, double motionY, double otherX, double otherY, double otherZ) { + public ParticleLaserItem(ClientWorld world, double posX, double posY, double posZ, ItemStack stack, double motionY, double otherX, double otherY, double otherZ) { super(world, posX + (world.rand.nextDouble() - 0.5) / 8, posY, posZ + (world.rand.nextDouble() - 0.5) / 8); this.stack = stack; this.otherX = otherX; @@ -48,7 +47,7 @@ public class ParticleLaserItem extends Particle { this.motionY = motionY; this.motionZ = 0; - this.particleMaxAge = 10; + this.maxAge = 10; this.canCollide = false; } @@ -58,25 +57,26 @@ public class ParticleLaserItem extends Particle { if (this.otherX != 0 || this.otherY != 0 || this.otherZ != 0) { Particle fx = new ParticleLaserItem(this.world, this.otherX, this.otherY, this.otherZ, this.stack, -0.025); - Minecraft.getInstance().effectRenderer.addEffect(fx); + Minecraft.getInstance().particles.addEffect(fx); } } @Override - public void renderParticle(BufferBuilder buffer, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) { - GlStateManager.pushMatrix(); + public void renderParticle(IVertexBuilder buffer, ActiveRenderInfo renderInfo, float partialTicks) { + RenderSystem.pushMatrix(); RenderHelper.enableStandardItemLighting(); - GlStateManager.translate(this.posX - TileEntityRendererDispatcher.staticPlayerX, this.posY - TileEntityRendererDispatcher.staticPlayerY, this.posZ - TileEntityRendererDispatcher.staticPlayerZ); - GlStateManager.scale(0.3F, 0.3F, 0.3F); + Vector3d cam = renderInfo.getProjectedView(); + RenderSystem.translated(this.posX - cam.getX(), this.posY - cam.getY(), this.posZ - cam.getZ()); + RenderSystem.scalef(0.3F, 0.3F, 0.3F); - double boop = Minecraft.getSystemTime() / 600D; - GlStateManager.rotate((float) (boop * 40D % 360), 0, 1, 0); + double boop = Util.milliTime(); + RenderSystem.rotatef((float) (boop * 40D % 360), 0, 1, 0); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_CONSTANT_COLOR, GlStateManager.SourceFactor.ONE.factor, GlStateManager.DestFactor.ZERO.factor); + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderSystem.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA.param, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA.param, GlStateManager.SourceFactor.ONE.param, GlStateManager.DestFactor.ZERO.param); - float ageRatio = (float) this.particleAge / (float) this.particleMaxAge; + float ageRatio = (float) this.age / (float) this.maxAge; float color = this.motionY < 0 ? 1F - ageRatio : ageRatio; @@ -85,11 +85,11 @@ public class ParticleLaserItem extends Particle { AssetUtil.renderItemWithoutScrewingWithColors(this.stack); RenderHelper.disableStandardItemLighting(); - GlStateManager.popMatrix(); + RenderSystem.popMatrix(); } @Override - public int getFXLayer() { - return 3; + public IParticleRenderType getRenderType() { + return IParticleRenderType.PARTICLE_SHEET_TRANSLUCENT; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java index b42d5fbd4..b298482bf 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java @@ -10,135 +10,79 @@ package de.ellpeck.actuallyadditions.mod.proxy; -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.ClientRegistryHandler; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.blocks.render.*; -import de.ellpeck.actuallyadditions.mod.entity.InitEntities; -import de.ellpeck.actuallyadditions.mod.entity.RenderWorm; -import de.ellpeck.actuallyadditions.mod.event.ClientEvents; -import de.ellpeck.actuallyadditions.mod.misc.special.SpecialRenderInit; -import de.ellpeck.actuallyadditions.mod.tile.*; -import de.ellpeck.actuallyadditions.mod.util.IColorProvidingBlock; -import de.ellpeck.actuallyadditions.mod.util.IColorProvidingItem; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; -import net.minecraft.client.network.NetHandlerPlayClient; -import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.client.renderer.color.IBlockColor; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.network.play.client.CPacketPlayerDigging; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.BlockPos; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.client.registry.ClientRegistry; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import java.util.ArrayList; import java.util.List; -public class ClientProxy implements IProxy { +public class ClientProxy { private static final List COLOR_PRODIVIDING_ITEMS_FOR_REGISTERING = new ArrayList<>(); private static final List COLOR_PRODIVIDING_BLOCKS_FOR_REGISTERING = new ArrayList<>(); - @Override - public void preInit(FMLPreInitializationEvent event) { - ActuallyAdditions.LOGGER.info("PreInitializing ClientProxy..."); - MinecraftForge.EVENT_BUS.register(new ClientRegistryHandler()); + // TODO: [port] add remaining color + // @Override + // public void init(FMLInitializationEvent event) { + // ActuallyAdditions.LOGGER.info("Initializing ClientProxy..."); + // + // + // //ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCompost.class, new RenderCompost()); + // + // + // for (Item item : COLOR_PRODIVIDING_ITEMS_FOR_REGISTERING) { + // if (item instanceof IColorProvidingItem) { + // Minecraft.getInstance().getItemColors().registerItemColorHandler(((IColorProvidingItem) item).getItemColor(), item); + // } + // } + // + // for (Block block : COLOR_PRODIVIDING_BLOCKS_FOR_REGISTERING) { + // if (block instanceof IColorProvidingBlock) { + // Minecraft.getInstance().getBlockColors().registerBlockColorHandler(((IColorProvidingBlock) block).getBlockColor(), block); + // } + // if (block instanceof IColorProvidingItem) { + // Minecraft.getInstance().getItemColors().registerItemColorHandler(((IColorProvidingItem) block).getItemColor(), block); + // } + // } + // + // IBlockColor color = (state, world, pos, tint) -> { + // if (world != null && pos != null) { + // TileEntity tileentity = world.getTileEntity(pos); + // if (tileentity instanceof TileEntityCompost && ((TileEntityCompost) tileentity).getCurrentDisplay().getBlock() != state.getBlock()) { + // BlockState iblockstate = ((TileEntityCompost) tileentity).getCurrentDisplay(); + // return Minecraft.getInstance().getBlockColors().colorMultiplier(iblockstate, world, pos, tint); + // } + // } + // return -1; + // }; + // Minecraft.getInstance().getBlockColors().registerBlockColorHandler(color, InitBlocks.blockCompost); + // } - InitEntities.initClient(); - } + // @Override + // public void postInit(FMLPostInitializationEvent event) { + // ActuallyAdditions.LOGGER.info("PostInitializing ClientProxy..."); + // } + // + // @Override + // public void addRenderRegister(ItemStack stack, ResourceLocation location, String variant) { + // ClientRegistryHandler.MODEL_LOCATIONS_FOR_REGISTERING.put(stack, new ModelResourceLocation(location, variant)); + // } - @Override - public void init(FMLInitializationEvent event) { - ActuallyAdditions.LOGGER.info("Initializing ClientProxy..."); + // @Override + // public void addColoredItem(Item item) { + // COLOR_PRODIVIDING_ITEMS_FOR_REGISTERING.add(item); + // } + // + // @Override + // public void addColoredBlock(Block block) { + // COLOR_PRODIVIDING_BLOCKS_FOR_REGISTERING.add(block); + // } - RenderWorm.fixItemStack(); - - new ClientEvents(); - - //ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCompost.class, new RenderCompost()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAtomicReconstructor.class, new RenderReconstructorLens()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmileyCloud.class, new RenderSmileyCloud()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayStand.class, new RenderDisplayStand()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEmpowerer.class, new RenderEmpowerer()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBatteryBox.class, new RenderBatteryBox()); - - TileEntitySpecialRenderer laser = new RenderLaserRelay(); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLaserRelayEnergy.class, laser); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLaserRelayEnergyAdvanced.class, laser); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLaserRelayEnergyExtreme.class, laser); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLaserRelayItem.class, laser); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLaserRelayItemWhitelist.class, laser); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLaserRelayFluids.class, laser); - - for (Item item : COLOR_PRODIVIDING_ITEMS_FOR_REGISTERING) { - if (item instanceof IColorProvidingItem) { - Minecraft.getInstance().getItemColors().registerItemColorHandler(((IColorProvidingItem) item).getItemColor(), item); - } - } - - for (Block block : COLOR_PRODIVIDING_BLOCKS_FOR_REGISTERING) { - if (block instanceof IColorProvidingBlock) { - Minecraft.getInstance().getBlockColors().registerBlockColorHandler(((IColorProvidingBlock) block).getBlockColor(), block); - } - if (block instanceof IColorProvidingItem) { - Minecraft.getInstance().getItemColors().registerItemColorHandler(((IColorProvidingItem) block).getItemColor(), block); - } - } - - IBlockColor color = (state, world, pos, tint) -> { - if (world != null && pos != null) { - TileEntity tileentity = world.getTileEntity(pos); - if (tileentity instanceof TileEntityCompost && ((TileEntityCompost) tileentity).getCurrentDisplay().getBlock() != state.getBlock()) { - BlockState iblockstate = ((TileEntityCompost) tileentity).getCurrentDisplay(); - return Minecraft.getInstance().getBlockColors().colorMultiplier(iblockstate, world, pos, tint); - } - } - return -1; - }; - Minecraft.getInstance().getBlockColors().registerBlockColorHandler(color, InitBlocks.blockCompost); - } - - @Override - public void postInit(FMLPostInitializationEvent event) { - ActuallyAdditions.LOGGER.info("PostInitializing ClientProxy..."); - - new SpecialRenderInit(); - } - - @Override - public void addRenderRegister(ItemStack stack, ResourceLocation location, String variant) { - ClientRegistryHandler.MODEL_LOCATIONS_FOR_REGISTERING.put(stack, new ModelResourceLocation(location, variant)); - } - - @Override - public void addColoredItem(Item item) { - COLOR_PRODIVIDING_ITEMS_FOR_REGISTERING.add(item); - } - - @Override - public void addColoredBlock(Block block) { - COLOR_PRODIVIDING_BLOCKS_FOR_REGISTERING.add(block); - } - - @Override + @Deprecated public PlayerEntity getCurrentPlayer() { return Minecraft.getInstance().player; } - - @Override - public void sendBreakPacket(BlockPos pos) { - NetHandlerPlayClient netHandlerPlayClient = Minecraft.getInstance().getConnection(); - assert netHandlerPlayClient != null; - netHandlerPlayClient.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.STOP_DESTROY_BLOCK, pos, Minecraft.getInstance().objectMouseOver.sideHit)); - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/IProxy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/IProxy.java deleted file mode 100644 index 557777f38..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/IProxy.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file ("IProxy.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.proxy; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.BlockPos; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; - -public interface IProxy { - - void preInit(FMLPreInitializationEvent event); - - void init(FMLInitializationEvent event); - - void postInit(FMLPostInitializationEvent event); - - void addRenderRegister(ItemStack stack, ResourceLocation location, String variant); - - void addColoredItem(Item item); - - void addColoredBlock(Block block); - - PlayerEntity getCurrentPlayer(); - - default void sendBreakPacket(BlockPos pos) { - }; - -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ServerProxy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ServerProxy.java deleted file mode 100644 index 24f55c01e..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ServerProxy.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This file ("ServerProxy.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.proxy; - -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import net.minecraft.block.Block; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; - -public class ServerProxy implements IProxy { - - @Override - public void preInit(FMLPreInitializationEvent event) { - ActuallyAdditions.LOGGER.info("PreInitializing ServerProxy..."); - } - - @Override - public void init(FMLInitializationEvent event) { - ActuallyAdditions.LOGGER.info("Initializing ServerProxy..."); - } - - @Override - public void postInit(FMLPostInitializationEvent event) { - ActuallyAdditions.LOGGER.info("PostInitializing ServerProxy..."); - } - - @Override - public void addRenderRegister(ItemStack stack, ResourceLocation location, String variant) { - - } - - @Override - public void addColoredItem(Item item) { - - } - - @Override - public void addColoredBlock(Block block) { - - } - - @Override - public PlayerEntity getCurrentPlayer() { - return null; - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/EmpowererHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/EmpowererHandler.java index b8d8c667f..4ff0e8b16 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/EmpowererHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/EmpowererHandler.java @@ -10,62 +10,44 @@ package de.ellpeck.actuallyadditions.mod.recipe; -import java.util.ArrayList; -import java.util.List; - -import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; -import de.ellpeck.actuallyadditions.api.recipe.EmpowererRecipe; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; -import de.ellpeck.actuallyadditions.mod.util.RecipeUtil; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.Ingredient; -import net.minecraftforge.oredict.OreDictionary; -import net.minecraftforge.oredict.OreIngredient; - +// TODO: [port] ADD BACK public final class EmpowererHandler { - - public static final ArrayList MAIN_PAGE_RECIPES = new ArrayList<>(); - public static EmpowererRecipe recipeEmpoweredCanolaSeed; - + // + // public static final ArrayList MAIN_PAGE_RECIPES = new ArrayList<>(); + // public static EmpowererRecipe recipeEmpoweredCanolaSeed; + // public static void init() { - addCrystalEmpowering(TheCrystals.REDSTONE, "dyeRed", Ingredient.fromItems(Items.NETHERBRICK), Ingredient.fromItems(Items.REDSTONE), Ingredient.fromItems(Items.BRICK)); - addCrystalEmpowering(TheCrystals.LAPIS, "dyeCyan", Ingredient.fromItems(Items.PRISMARINE_SHARD), Ingredient.fromItems(Items.PRISMARINE_SHARD), Ingredient.fromItems(Items.PRISMARINE_SHARD)); - addCrystalEmpowering(TheCrystals.DIAMOND, "dyeLightBlue", Ingredient.fromItems(Items.CLAY_BALL), Ingredient.fromItems(Items.CLAY_BALL), fromBlock(Blocks.CLAY)); - addCrystalEmpowering(TheCrystals.IRON, "dyeGray", Ingredient.fromItems(Items.SNOWBALL), fromBlock(Blocks.STONE_BUTTON), fromBlock(Blocks.COBBLESTONE)); - - addCrystalEmpowering(TheCrystals.COAL, "dyeBlack", igd(new ItemStack(Items.COAL, 1, 1)), Ingredient.fromItems(Items.FLINT), fromBlock(Blocks.STONE)); - - List balls = OreDictionary.getOres("slimeball"); - for (ItemStack ball : balls) { - addCrystalEmpowering(TheCrystals.EMERALD, "dyeLime", igd(new ItemStack(Blocks.TALLGRASS, 1, 1)), igd(new ItemStack(Blocks.SAPLING)), igd(ball.copy())); - } - - Ingredient seed = Ingredient.fromItems(InitItems.itemCanolaSeed); - ActuallyAdditionsAPI.addEmpowererRecipe(Ingredient.fromStacks(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CRYSTALLIZED_CANOLA_SEED.ordinal())), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.EMPOWERED_CANOLA_SEED.ordinal()), seed, seed, seed, seed, 1000, 30, new float[] { 1F, 91F / 255F, 76F / 255F }); - recipeEmpoweredCanolaSeed = RecipeUtil.lastEmpowererRecipe(); - } - - private static void addCrystalEmpowering(TheCrystals type, String dye, Ingredient modifier1, Ingredient modifier2, Ingredient modifier3) { - float[] color = type.conversionColorParticles; - - ActuallyAdditionsAPI.addEmpowererRecipe(Ingredient.fromStacks(new ItemStack(InitItems.itemCrystal, 1, type.ordinal())), new ItemStack(InitItems.itemCrystalEmpowered, 1, type.ordinal()), new OreIngredient(dye), modifier1, modifier2, modifier3, 5000, 50, color); - MAIN_PAGE_RECIPES.add(RecipeUtil.lastEmpowererRecipe()); - ActuallyAdditionsAPI.addEmpowererRecipe(Ingredient.fromStacks(new ItemStack(InitBlocks.blockCrystal, 1, type.ordinal())), new ItemStack(InitBlocks.blockCrystalEmpowered, 1, type.ordinal()), new OreIngredient(dye), modifier1, modifier2, modifier3, 50000, 500, color); - MAIN_PAGE_RECIPES.add(RecipeUtil.lastEmpowererRecipe()); - } - - private static Ingredient igd(ItemStack s) { - return Ingredient.fromStacks(s); - } - - private static Ingredient fromBlock(Block b) { - return Ingredient.fromItems(Item.getItemFromBlock(b)); + // addCrystalEmpowering(TheCrystals.REDSTONE, "dyeRed", Ingredient.fromItems(Items.NETHERBRICK), Ingredient.fromItems(Items.REDSTONE), Ingredient.fromItems(Items.BRICK)); + // addCrystalEmpowering(TheCrystals.LAPIS, "dyeCyan", Ingredient.fromItems(Items.PRISMARINE_SHARD), Ingredient.fromItems(Items.PRISMARINE_SHARD), Ingredient.fromItems(Items.PRISMARINE_SHARD)); + // addCrystalEmpowering(TheCrystals.DIAMOND, "dyeLightBlue", Ingredient.fromItems(Items.CLAY_BALL), Ingredient.fromItems(Items.CLAY_BALL), fromBlock(Blocks.CLAY)); + // addCrystalEmpowering(TheCrystals.IRON, "dyeGray", Ingredient.fromItems(Items.SNOWBALL), fromBlock(Blocks.STONE_BUTTON), fromBlock(Blocks.COBBLESTONE)); + // + // addCrystalEmpowering(TheCrystals.COAL, "dyeBlack", igd(new ItemStack(Items.COAL, 1, 1)), Ingredient.fromItems(Items.FLINT), fromBlock(Blocks.STONE)); + // + // List balls = OreDictionary.getOres("slimeball"); + // for (ItemStack ball : balls) { + // addCrystalEmpowering(TheCrystals.EMERALD, "dyeLime", igd(new ItemStack(Blocks.TALLGRASS, 1, 1)), igd(new ItemStack(Blocks.SAPLING)), igd(ball.copy())); + // } + // + // Ingredient seed = Ingredient.fromItems(InitItems.itemCanolaSeed); + // ActuallyAdditionsAPI.addEmpowererRecipe(Ingredient.fromStacks(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CRYSTALLIZED_CANOLA_SEED.ordinal())), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.EMPOWERED_CANOLA_SEED.ordinal()), seed, seed, seed, seed, 1000, 30, new float[]{1F, 91F / 255F, 76F / 255F}); + // recipeEmpoweredCanolaSeed = RecipeUtil.lastEmpowererRecipe(); } + // + // private static void addCrystalEmpowering(TheCrystals type, String dye, Ingredient modifier1, Ingredient modifier2, Ingredient modifier3) { + // float[] color = type.conversionColorParticles; + // + // ActuallyAdditionsAPI.addEmpowererRecipe(Ingredient.fromStacks(new ItemStack(InitItems.itemCrystal, 1, type.ordinal())), new ItemStack(InitItems.itemCrystalEmpowered, 1, type.ordinal()), new OreIngredient(dye), modifier1, modifier2, modifier3, 5000, 50, color); + // MAIN_PAGE_RECIPES.add(RecipeUtil.lastEmpowererRecipe()); + // ActuallyAdditionsAPI.addEmpowererRecipe(Ingredient.fromStacks(new ItemStack(InitBlocks.blockCrystal, 1, type.ordinal())), new ItemStack(InitBlocks.blockCrystalEmpowered, 1, type.ordinal()), new OreIngredient(dye), modifier1, modifier2, modifier3, 50000, 500, color); + // MAIN_PAGE_RECIPES.add(RecipeUtil.lastEmpowererRecipe()); + // } + // + // private static Ingredient igd(ItemStack s) { + // return Ingredient.fromStacks(s); + // } + // + // private static Ingredient fromBlock(Block b) { + // return Ingredient.fromItems(Item.getItemFromBlock(b)); + // } } 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 3a39a90a0..92c41ebe0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/ActuallyTiles.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/ActuallyTiles.java @@ -10,61 +10,61 @@ 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, InitBlocks.blockFeeder.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, InitBlocks.blockGrinder.get()).build(null)); - public static final RegistryObject> FURNACE_DOUBLE_TILE = TILES.register("furnaceDouble", () -> TileEntityType.Builder.create(TileEntityFurnaceDouble::new, InitBlocks.blockFurnaceDouble.get()).build(null)); - public static final RegistryObject> INPUTTER_TILE = TILES.register("inputter", () -> TileEntityType.Builder.create(TileEntityInputter::new, InitBlocks.blockInputter.get()).build(null)); - public static final RegistryObject> FISHINGNET_TILE = TILES.register("fishingNet", () -> TileEntityType.Builder.create(TileEntityFishingNet::new, InitBlocks.blockFishingNet.get()).build(null)); - public static final RegistryObject> SOLAR_TILE = TILES.register("solarPanel", () -> TileEntityType.Builder.create(TileEntityFurnaceSolar::new, InitBlocks.blockFurnaceSolar.get()).build(null)); - public static final RegistryObject> HEATCOLLECTOR_TILE = TILES.register("heatCollector", () -> TileEntityType.Builder.create(TileEntityHeatCollector::new, InitBlocks.blockHeatCollector.get()).build(null)); - public static final RegistryObject> ITEMREPAIRER_TILE = TILES.register("repairer", () -> TileEntityType.Builder.create(TileEntityItemRepairer::new, InitBlocks.blockItemRepairer.get()).build(null)); - public static final RegistryObject> BREAKER_TILE = TILES.register("breaker", () -> TileEntityType.Builder.create(TileEntityBreaker::new, InitBlocks.blockBreaker.get()).build(null)); - public static final RegistryObject> DROPPER_TILE = TILES.register("dropper", () -> TileEntityType.Builder.create(TileEntityDropper::new, InitBlocks.blockDropper.get()).build(null)); - public static final RegistryObject> INPUTTERADVANCED_TILE = TILES.register("inputterAdvanced", () -> TileEntityType.Builder.create(TileEntityInputterAdvanced::new, InitBlocks.blockInputterAdvanced.get()).build(null)); - public static final RegistryObject> PLACER_TILE = TILES.register("placer", () -> TileEntityType.Builder.create(TileEntityPlacer::new, InitBlocks.blockPlacer.get()).build(null)); - public static final RegistryObject> GRINDER_DOUBLE_TILE = TILES.register("grinderDouble", () -> TileEntityType.Builder.create(TileEntityGrinderDouble::new, InitBlocks.blockGrinderDouble.get()).build(null)); - public static final RegistryObject> CANOLAPRESS_TILE = TILES.register("canolaPress", () -> TileEntityType.Builder.create(TileEntityCanolaPress::new, InitBlocks.blockCanolaPress.get()).build(null)); - public static final RegistryObject> FERMENTINGBARREL_TILE = TILES.register("fermentingBarrel", () -> TileEntityType.Builder.create(TileEntityFermentingBarrel::new, InitBlocks.blockFermentingBarrel.get()).build(null)); - public static final RegistryObject> OILGENERATOR_TILE = TILES.register("oilGenerator", () -> TileEntityType.Builder.create(TileEntityOilGenerator::new, InitBlocks.blockOilGenerator.get()).build(null)); - public static final RegistryObject> COALGENERATOR_TILE = TILES.register("coalGenerator", () -> TileEntityType.Builder.create(TileEntityCoalGenerator::new, InitBlocks.blockCoalGenerator.get()).build(null)); - public static final RegistryObject> PHANTOMITEMFACE_TILE = TILES.register("phantomface", () -> TileEntityType.Builder.create(TileEntityPhantomItemface::new, InitBlocks.blockPhantomface.get()).build(null)); - public static final RegistryObject> PHANTOMLIQUIFACE_TILE = TILES.register("liquiface", () -> TileEntityType.Builder.create(TileEntityPhantomLiquiface::new, InitBlocks.blockPhantomLiquiface.get()).build(null)); - public static final RegistryObject> PHANTOMENERGYFACE_TILE = TILES.register("energyface", () -> TileEntityType.Builder.create(TileEntityPhantomEnergyface::new, InitBlocks.blockPhantomEnergyface.get()).build(null)); - public static final RegistryObject> PLAYERINTERFACE_TILE = TILES.register("playerInterface", () -> TileEntityType.Builder.create(TileEntityPlayerInterface::new, InitBlocks.blockPlayerInterface.get()).build(null)); - public static final RegistryObject> PHANTOMPLACER_TILE = TILES.register("phantomPlacer", () -> TileEntityType.Builder.create(TileEntityPhantomPlacer::new, InitBlocks.blockPhantomPlacer.get()).build(null)); - public static final RegistryObject> PHANTOMBREAKER_TILE = TILES.register("phantomBreaker", () -> TileEntityType.Builder.create(TileEntityPhantomBreaker::new, InitBlocks.blockPhantomBreaker.get()).build(null)); - public static final RegistryObject> FLUIDCOLLECTOR_TILE = TILES.register("fluidCollector", () -> TileEntityType.Builder.create(TileEntityFluidCollector::new, InitBlocks.blockFluidCollector.get()).build(null)); - public static final RegistryObject> FLUIDPLACER_TILE = TILES.register("fluidPlacer", () -> TileEntityType.Builder.create(TileEntityFluidPlacer::new, InitBlocks.blockFluidPlacer.get()).build(null)); - public static final RegistryObject> LAVAFACTORYCONTROLLER_TILE = TILES.register("lavaFactory", () -> TileEntityType.Builder.create(TileEntityLavaFactoryController::new, InitBlocks.blockLavaFactoryController.get()).build(null)); - public static final RegistryObject> COFFEEMACHINE_TILE = TILES.register("coffeeMachine", () -> TileEntityType.Builder.create(TileEntityCoffeeMachine::new, InitBlocks.blockCoffeeMachine.get()).build(null)); - public static final RegistryObject> PHANTOM_BOOSTER_TILE = TILES.register("phantomBooster", () -> TileEntityType.Builder.create(TileEntityPhantomBooster::new, InitBlocks.blockPhantomBooster.get()).build(null)); - public static final RegistryObject> ENERGIZER_TILE = TILES.register("energizer", () -> TileEntityType.Builder.create(TileEntityEnergizer::new, InitBlocks.blockEnergizer.get()).build(null)); - public static final RegistryObject> ENERVATOR_TILE = TILES.register("enervator", () -> TileEntityType.Builder.create(TileEntityEnervator::new, InitBlocks.blockEnervator.get()).build(null)); - public static final RegistryObject> XPSOLIDIFIER_TILE = TILES.register("xpSolidifier", () -> TileEntityType.Builder.create(TileEntityXPSolidifier::new, InitBlocks.blockXPSolidifier.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, InitBlocks.blockLeafGenerator.get()).build(null)); - public static final RegistryObject> DIRECTIONALBREAKER_TILE = TILES.register("directionalBreaker", () -> TileEntityType.Builder.create(TileEntityDirectionalBreaker::new, InitBlocks.blockDirectionalBreaker.get()).build(null)); - public static final RegistryObject> RANGEDCOLLECTOR_TILE = TILES.register("rangedCollector", () -> TileEntityType.Builder.create(TileEntityRangedCollector::new, InitBlocks.blockRangedCollector.get()).build(null)); - public static final RegistryObject> ATOMICRECONSTRUCTOR_TILE = TILES.register("reconstructor", () -> TileEntityType.Builder.create(TileEntityAtomicReconstructor::new, InitBlocks.blockAtomicReconstructor.get()).build(null)); - public static final RegistryObject> MINER_TILE = TILES.register("miner", () -> TileEntityType.Builder.create(TileEntityMiner::new, InitBlocks.blockMiner.get()).build(null)); - public static final RegistryObject> FIREWORKBOX_TILE = TILES.register("fireworkBox", () -> TileEntityType.Builder.create(TileEntityFireworkBox::new, InitBlocks.blockFireworkBox.get()).build(null)); - public static final RegistryObject> PHANTOMREDSTONEFACE_TILE = TILES.register("redstoneface", () -> TileEntityType.Builder.create(TileEntityPhantomRedstoneface::new, InitBlocks.blockPhantomRedstoneface.get()).build(null)); - public static final RegistryObject> LASERRELAYITEM_TILE = TILES.register("laserRelayItem", () -> TileEntityType.Builder.create(TileEntityLaserRelayItem::new, InitBlocks.blockLaserRelayItem.get()).build(null)); - public static final RegistryObject> LASERRELAYENERGY_TILE = TILES.register("laserRelay", () -> TileEntityType.Builder.create(TileEntityLaserRelayEnergy::new, InitBlocks.blockLaserRelay.get()).build(null)); - public static final RegistryObject> LASERRELAYENERGYADVANCED_TILE = TILES.register("laserRelayAdvanced", () -> TileEntityType.Builder.create(TileEntityLaserRelayEnergyAdvanced::new, InitBlocks.blockLaserRelayAdvanced.get()).build(null)); - public static final RegistryObject> LASERRELAYENERGYEXTREME_TILE = TILES.register("laserRelayExtreme", () -> TileEntityType.Builder.create(TileEntityLaserRelayEnergyExtreme::new, InitBlocks.blockLaserRelayExtreme.get()).build(null)); - public static final RegistryObject> LASERRELAYITEMWHITELIST_TILE = TILES.register("laserRelayItemWhitelist", () -> TileEntityType.Builder.create(TileEntityLaserRelayItemWhitelist::new, InitBlocks.blockLaserRelayItemWhitelist.get()).build(null)); - public static final RegistryObject> ITEMVIEWER_TILE = TILES.register("itemViewer", () -> TileEntityType.Builder.create(TileEntityItemViewer::new, InitBlocks.blockItemViewer.get()).build(null)); - public static final RegistryObject> DISPLAYSTAND_TILE = TILES.register("displayStand", () -> TileEntityType.Builder.create(TileEntityDisplayStand::new, InitBlocks.blockDisplayStand.get()).build(null)); - public static final RegistryObject> SHOCKSUPPRESSOR_TILE = TILES.register("shockSuppressor", () -> TileEntityType.Builder.create(TileEntityShockSuppressor::new, InitBlocks.blockShockSuppressor.get()).build(null)); - public static final RegistryObject> EMPOWERER_TILE = TILES.register("empowerer", () -> TileEntityType.Builder.create(TileEntityEmpowerer::new, InitBlocks.blockEmpowerer.get()).build(null)); - public static final RegistryObject> LASERRELAYFLUIDS_TILE = TILES.register("laserRelayFluids", () -> TileEntityType.Builder.create(TileEntityLaserRelayFluids::new, InitBlocks.blockLaserRelayFluids.get()).build(null)); - public static final RegistryObject> BIOREACTOR_TILE = TILES.register("bioReactor", () -> TileEntityType.Builder.create(TileEntityBioReactor::new, InitBlocks.blockBioReactor.get()).build(null)); - public static final RegistryObject> FARMER_TILE = TILES.register("farmer", () -> TileEntityType.Builder.create(TileEntityFarmer::new, InitBlocks.blockFarmer.get()).build(null)); - public static final RegistryObject> ITEMVIEWERHOPPING_TILE = TILES.register("itemViewerHopping", () -> TileEntityType.Builder.create(TileEntityItemViewerHopping::new, InitBlocks.blockItemViewer.get()).build(null)); - public static final RegistryObject> BATTERYBOX_TILE = TILES.register("batteryBox", () -> TileEntityType.Builder.create(TileEntityBatteryBox::new, InitBlocks.blockBatteryBox.get()).build(null)); + // 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, InitBlocks.blockFeeder.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, InitBlocks.blockGrinder.get()).build(null)); + public static final RegistryObject> FURNACE_DOUBLE_TILE = TILES.register("furnaceDouble", () -> TileEntityType.Builder.create(TileEntityFurnaceDouble::new, InitBlocks.blockFurnaceDouble.get()).build(null)); + public static final RegistryObject> INPUTTER_TILE = TILES.register("inputter", () -> TileEntityType.Builder.create(TileEntityInputter::new, InitBlocks.blockInputter.get()).build(null)); + public static final RegistryObject> FISHINGNET_TILE = TILES.register("fishingNet", () -> TileEntityType.Builder.create(TileEntityFishingNet::new, InitBlocks.blockFishingNet.get()).build(null)); + public static final RegistryObject> SOLAR_TILE = TILES.register("solarPanel", () -> TileEntityType.Builder.create(TileEntityFurnaceSolar::new, InitBlocks.blockFurnaceSolar.get()).build(null)); + public static final RegistryObject> HEATCOLLECTOR_TILE = TILES.register("heatCollector", () -> TileEntityType.Builder.create(TileEntityHeatCollector::new, InitBlocks.blockHeatCollector.get()).build(null)); + public static final RegistryObject> ITEMREPAIRER_TILE = TILES.register("repairer", () -> TileEntityType.Builder.create(TileEntityItemRepairer::new, InitBlocks.blockItemRepairer.get()).build(null)); + public static final RegistryObject> BREAKER_TILE = TILES.register("breaker", () -> TileEntityType.Builder.create(TileEntityBreaker::new, InitBlocks.blockBreaker.get()).build(null)); + public static final RegistryObject> DROPPER_TILE = TILES.register("dropper", () -> TileEntityType.Builder.create(TileEntityDropper::new, InitBlocks.blockDropper.get()).build(null)); + public static final RegistryObject> INPUTTERADVANCED_TILE = TILES.register("inputterAdvanced", () -> TileEntityType.Builder.create(TileEntityInputterAdvanced::new, InitBlocks.blockInputterAdvanced.get()).build(null)); + public static final RegistryObject> PLACER_TILE = TILES.register("placer", () -> TileEntityType.Builder.create(TileEntityPlacer::new, InitBlocks.blockPlacer.get()).build(null)); + public static final RegistryObject> GRINDER_DOUBLE_TILE = TILES.register("grinderDouble", () -> TileEntityType.Builder.create(TileEntityGrinderDouble::new, InitBlocks.blockGrinderDouble.get()).build(null)); + public static final RegistryObject> CANOLAPRESS_TILE = TILES.register("canolaPress", () -> TileEntityType.Builder.create(TileEntityCanolaPress::new, InitBlocks.blockCanolaPress.get()).build(null)); + public static final RegistryObject> FERMENTINGBARREL_TILE = TILES.register("fermentingBarrel", () -> TileEntityType.Builder.create(TileEntityFermentingBarrel::new, InitBlocks.blockFermentingBarrel.get()).build(null)); + public static final RegistryObject> OILGENERATOR_TILE = TILES.register("oilGenerator", () -> TileEntityType.Builder.create(TileEntityOilGenerator::new, InitBlocks.blockOilGenerator.get()).build(null)); + public static final RegistryObject> COALGENERATOR_TILE = TILES.register("coalGenerator", () -> TileEntityType.Builder.create(TileEntityCoalGenerator::new, InitBlocks.blockCoalGenerator.get()).build(null)); + public static final RegistryObject> PHANTOMITEMFACE_TILE = TILES.register("phantomface", () -> TileEntityType.Builder.create(TileEntityPhantomItemface::new, InitBlocks.blockPhantomface.get()).build(null)); + public static final RegistryObject> PHANTOMLIQUIFACE_TILE = TILES.register("liquiface", () -> TileEntityType.Builder.create(TileEntityPhantomLiquiface::new, InitBlocks.blockPhantomLiquiface.get()).build(null)); + public static final RegistryObject> PHANTOMENERGYFACE_TILE = TILES.register("energyface", () -> TileEntityType.Builder.create(TileEntityPhantomEnergyface::new, InitBlocks.blockPhantomEnergyface.get()).build(null)); + public static final RegistryObject> PLAYERINTERFACE_TILE = TILES.register("playerInterface", () -> TileEntityType.Builder.create(TileEntityPlayerInterface::new, InitBlocks.blockPlayerInterface.get()).build(null)); + public static final RegistryObject> PHANTOMPLACER_TILE = TILES.register("phantomPlacer", () -> TileEntityType.Builder.create(TileEntityPhantomPlacer::new, InitBlocks.blockPhantomPlacer.get()).build(null)); + public static final RegistryObject> PHANTOMBREAKER_TILE = TILES.register("phantomBreaker", () -> TileEntityType.Builder.create(TileEntityPhantomBreaker::new, InitBlocks.blockPhantomBreaker.get()).build(null)); + public static final RegistryObject> FLUIDCOLLECTOR_TILE = TILES.register("fluidCollector", () -> TileEntityType.Builder.create(TileEntityFluidCollector::new, InitBlocks.blockFluidCollector.get()).build(null)); + public static final RegistryObject> FLUIDPLACER_TILE = TILES.register("fluidPlacer", () -> TileEntityType.Builder.create(TileEntityFluidPlacer::new, InitBlocks.blockFluidPlacer.get()).build(null)); + public static final RegistryObject> LAVAFACTORYCONTROLLER_TILE = TILES.register("lavaFactory", () -> TileEntityType.Builder.create(TileEntityLavaFactoryController::new, InitBlocks.blockLavaFactoryController.get()).build(null)); + public static final RegistryObject> COFFEEMACHINE_TILE = TILES.register("coffeeMachine", () -> TileEntityType.Builder.create(TileEntityCoffeeMachine::new, InitBlocks.blockCoffeeMachine.get()).build(null)); + public static final RegistryObject> PHANTOM_BOOSTER_TILE = TILES.register("phantomBooster", () -> TileEntityType.Builder.create(TileEntityPhantomBooster::new, InitBlocks.blockPhantomBooster.get()).build(null)); + public static final RegistryObject> ENERGIZER_TILE = TILES.register("energizer", () -> TileEntityType.Builder.create(TileEntityEnergizer::new, InitBlocks.blockEnergizer.get()).build(null)); + public static final RegistryObject> ENERVATOR_TILE = TILES.register("enervator", () -> TileEntityType.Builder.create(TileEntityEnervator::new, InitBlocks.blockEnervator.get()).build(null)); + public static final RegistryObject> XPSOLIDIFIER_TILE = TILES.register("xpSolidifier", () -> TileEntityType.Builder.create(TileEntityXPSolidifier::new, InitBlocks.blockXPSolidifier.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, InitBlocks.blockLeafGenerator.get()).build(null)); + public static final RegistryObject> DIRECTIONALBREAKER_TILE = TILES.register("directionalBreaker", () -> TileEntityType.Builder.create(TileEntityDirectionalBreaker::new, InitBlocks.blockDirectionalBreaker.get()).build(null)); + public static final RegistryObject> RANGEDCOLLECTOR_TILE = TILES.register("rangedCollector", () -> TileEntityType.Builder.create(TileEntityRangedCollector::new, InitBlocks.blockRangedCollector.get()).build(null)); + public static final RegistryObject> ATOMICRECONSTRUCTOR_TILE = TILES.register("reconstructor", () -> TileEntityType.Builder.create(TileEntityAtomicReconstructor::new, InitBlocks.blockAtomicReconstructor.get()).build(null)); + public static final RegistryObject> MINER_TILE = TILES.register("miner", () -> TileEntityType.Builder.create(TileEntityMiner::new, InitBlocks.blockMiner.get()).build(null)); + public static final RegistryObject> FIREWORKBOX_TILE = TILES.register("fireworkBox", () -> TileEntityType.Builder.create(TileEntityFireworkBox::new, InitBlocks.blockFireworkBox.get()).build(null)); + public static final RegistryObject> PHANTOMREDSTONEFACE_TILE = TILES.register("redstoneface", () -> TileEntityType.Builder.create(TileEntityPhantomRedstoneface::new, InitBlocks.blockPhantomRedstoneface.get()).build(null)); + public static final RegistryObject> LASERRELAYITEM_TILE = TILES.register("laserRelayItem", () -> TileEntityType.Builder.create(TileEntityLaserRelayItem::new, InitBlocks.blockLaserRelayItem.get()).build(null)); + public static final RegistryObject> LASERRELAYENERGY_TILE = TILES.register("laserRelay", () -> TileEntityType.Builder.create(TileEntityLaserRelayEnergy::new, InitBlocks.blockLaserRelay.get()).build(null)); + public static final RegistryObject> LASERRELAYENERGYADVANCED_TILE = TILES.register("laserRelayAdvanced", () -> TileEntityType.Builder.create(TileEntityLaserRelayEnergyAdvanced::new, InitBlocks.blockLaserRelayAdvanced.get()).build(null)); + public static final RegistryObject> LASERRELAYENERGYEXTREME_TILE = TILES.register("laserRelayExtreme", () -> TileEntityType.Builder.create(TileEntityLaserRelayEnergyExtreme::new, InitBlocks.blockLaserRelayExtreme.get()).build(null)); + public static final RegistryObject> LASERRELAYITEMWHITELIST_TILE = TILES.register("laserRelayItemWhitelist", () -> TileEntityType.Builder.create(TileEntityLaserRelayItemWhitelist::new, InitBlocks.blockLaserRelayItemWhitelist.get()).build(null)); + public static final RegistryObject> ITEMVIEWER_TILE = TILES.register("itemViewer", () -> TileEntityType.Builder.create(TileEntityItemViewer::new, InitBlocks.blockItemViewer.get()).build(null)); + public static final RegistryObject> DISPLAYSTAND_TILE = TILES.register("displayStand", () -> TileEntityType.Builder.create(TileEntityDisplayStand::new, InitBlocks.blockDisplayStand.get()).build(null)); + public static final RegistryObject> SHOCKSUPPRESSOR_TILE = TILES.register("shockSuppressor", () -> TileEntityType.Builder.create(TileEntityShockSuppressor::new, InitBlocks.blockShockSuppressor.get()).build(null)); + public static final RegistryObject> EMPOWERER_TILE = TILES.register("empowerer", () -> TileEntityType.Builder.create(TileEntityEmpowerer::new, InitBlocks.blockEmpowerer.get()).build(null)); + public static final RegistryObject> LASERRELAYFLUIDS_TILE = TILES.register("laserRelayFluids", () -> TileEntityType.Builder.create(TileEntityLaserRelayFluids::new, InitBlocks.blockLaserRelayFluids.get()).build(null)); + public static final RegistryObject> BIOREACTOR_TILE = TILES.register("bioReactor", () -> TileEntityType.Builder.create(TileEntityBioReactor::new, InitBlocks.blockBioReactor.get()).build(null)); + public static final RegistryObject> FARMER_TILE = TILES.register("farmer", () -> TileEntityType.Builder.create(TileEntityFarmer::new, InitBlocks.blockFarmer.get()).build(null)); + public static final RegistryObject> ITEMVIEWERHOPPING_TILE = TILES.register("itemViewerHopping", () -> TileEntityType.Builder.create(TileEntityItemViewerHopping::new, InitBlocks.blockItemViewer.get()).build(null)); + public static final RegistryObject> BATTERYBOX_TILE = TILES.register("batteryBox", () -> TileEntityType.Builder.create(TileEntityBatteryBox::new, InitBlocks.blockBatteryBox.get()).build(null)); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java index ccb12e85a..c4fc47355 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java @@ -10,7 +10,6 @@ package de.ellpeck.actuallyadditions.mod.tile; -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; import de.ellpeck.actuallyadditions.mod.util.VanillaPacketDispatcher; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; @@ -49,10 +48,6 @@ public abstract class TileEntityBase extends TileEntity implements ITickable { super(type); } - public static void init() { - ActuallyAdditions.LOGGER.info("Registering TileEntities..."); - } - private static void register(Class tileClass) { // TODO: [port] migrate to register system. // try { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBioReactor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBioReactor.java index 107d0ce65..42ea4664d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBioReactor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBioReactor.java @@ -15,20 +15,27 @@ import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.block.Block; import net.minecraft.block.IGrowable; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.inventory.container.Container; +import net.minecraft.inventory.container.INamedContainerProvider; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; import net.minecraftforge.common.IPlantable; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.energy.IEnergyStorage; +import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; -public class TileEntityBioReactor extends TileEntityInventoryBase implements ISharingEnergyProvider { +public class TileEntityBioReactor extends TileEntityInventoryBase implements INamedContainerProvider, ISharingEnergyProvider { public final CustomEnergyStorage storage = new CustomEnergyStorage(200000, 0, 800); public final LazyOptional lazyEnergy = LazyOptional.of(() -> this.storage); @@ -168,4 +175,15 @@ public class TileEntityBioReactor extends TileEntityInventoryBase implements ISh float calc = (float) this.storage.getEnergyStored() / (float) this.storage.getMaxEnergyStored() * 15F; return (int) calc; } + + @Override + public ITextComponent getDisplayName() { + return StringTextComponent.EMPTY; + } + + @Nullable + @Override + public Container createMenu(int windowId, PlayerInventory playerInventory, PlayerEntity playerEntity) { + return new; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java index 6db1a4434..731ace0b0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java @@ -11,6 +11,7 @@ package de.ellpeck.actuallyadditions.mod.util; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; +import de.ellpeck.actuallyadditions.mod.ActuallyAdditionsClient; import de.ellpeck.actuallyadditions.mod.tile.FilterSettings; import de.ellpeck.actuallyadditions.mod.util.compat.SlotlessableItemHandlerWrapper; import net.minecraft.block.Block; @@ -362,7 +363,8 @@ public final class WorldUtil { stack.onBlockDestroyed(world, state, pos, player); // send an update to the server, so we get an update back - ActuallyAdditions.PROXY.sendBreakPacket(pos); + + ActuallyAdditionsClient.sendBreakPacket(pos); return true; } }