From 2189dde1a092f3d611fc4586ef2041ea85f06ddf Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 17 Jan 2016 15:09:59 +0100 Subject: [PATCH 01/66] JEI Crusher --- .../mod/jei/JEIActuallyAdditionsPlugin.java | 9 +- .../coffee/CoffeeMachineRecipeWrapper.java | 16 +-- .../jei/crusher/CrusherRecipeCategory.java | 82 +++++++++++++ .../mod/jei/crusher/CrusherRecipeHandler.java | 43 +++++++ .../mod/jei/crusher/CrusherRecipeWrapper.java | 111 ++++++++++++++++++ 5 files changed, 252 insertions(+), 9 deletions(-) create mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeCategory.java create mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeHandler.java create mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java index c5b3ac905..a89d9f1b7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java @@ -15,6 +15,8 @@ import de.ellpeck.actuallyadditions.mod.jei.booklet.BookletRecipeCategory; import de.ellpeck.actuallyadditions.mod.jei.booklet.BookletRecipeHandler; import de.ellpeck.actuallyadditions.mod.jei.coffee.CoffeeMachineRecipeCategory; import de.ellpeck.actuallyadditions.mod.jei.coffee.CoffeeMachineRecipeHandler; +import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherRecipeCategory; +import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherRecipeHandler; import mezz.jei.api.*; @JEIPlugin @@ -36,16 +38,19 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin{ public void register(IModRegistry registry){ registry.addRecipeCategories( new BookletRecipeCategory(this.helpers.getGuiHelper()), - new CoffeeMachineRecipeCategory(this.helpers.getGuiHelper()) + new CoffeeMachineRecipeCategory(this.helpers.getGuiHelper()), + new CrusherRecipeCategory(this.helpers.getGuiHelper()) ); registry.addRecipeHandlers( new BookletRecipeHandler(), - new CoffeeMachineRecipeHandler() + new CoffeeMachineRecipeHandler(), + new CrusherRecipeHandler() ); registry.addRecipes(ActuallyAdditionsAPI.bookletPagesWithItemStackData); registry.addRecipes(ActuallyAdditionsAPI.coffeeMachineIngredients); + registry.addRecipes(ActuallyAdditionsAPI.crusherRecipes); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java index 7b2215f3f..faa60310c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java @@ -72,19 +72,21 @@ public class CoffeeMachineRecipeWrapper extends RecipeWrapperWithButton implemen @Override public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ - if(this.theIngredient.getExtraText() != null){ - Minecraft.getMinecraft().fontRendererObj.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".coffee.special")+":", 2, 4, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); - Minecraft.getMinecraft().fontRendererObj.drawString(this.theIngredient.getExtraText(), 2, 16, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); - } - if(this.theIngredient.maxAmplifier > 0){ - Minecraft.getMinecraft().fontRendererObj.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".coffee.maxAmount")+": "+this.theIngredient.maxAmplifier, 2, 28, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); - } } @Override public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY){ this.updateButton(minecraft, mouseX, mouseY); + + if(this.theIngredient.getExtraText() != null){ + minecraft.fontRendererObj.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".coffee.special")+":", 2, 4, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); + minecraft.fontRendererObj.drawString(this.theIngredient.getExtraText(), 2, 16, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); + } + + if(this.theIngredient.maxAmplifier > 0){ + minecraft.fontRendererObj.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".coffee.maxAmount")+": "+this.theIngredient.maxAmplifier, 2, 28, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); + } } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeCategory.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeCategory.java new file mode 100644 index 000000000..d00501956 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeCategory.java @@ -0,0 +1,82 @@ +/* + * This file ("CrusherRecipeCategor.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 + * + * © 2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.jei.crusher; + +import de.ellpeck.actuallyadditions.mod.util.AssetUtil; +import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import mezz.jei.api.IGuiHelper; +import mezz.jei.api.gui.IDrawable; +import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.recipe.IRecipeCategory; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; + +import javax.annotation.Nonnull; +import java.util.List; + +public class CrusherRecipeCategory implements IRecipeCategory{ + + public static final String NAME = "actuallyadditions.crushing"; + + private IDrawable background; + + public CrusherRecipeCategory(IGuiHelper helper){ + this.background = helper.createDrawable(AssetUtil.getGuiLocation("guiGrinder"), 60, 13, 56, 79); + } + + @Nonnull + @Override + public String getUid(){ + return NAME; + } + + @Nonnull + @Override + public String getTitle(){ + return StringUtil.localize("container.nei."+NAME+".name"); + } + + @Nonnull + @Override + public IDrawable getBackground(){ + return this.background; + } + + @Override + public void drawExtras(Minecraft minecraft){ + + } + + @Override + public void drawAnimations(Minecraft minecraft){ + + } + + @Override + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper){ + if(recipeWrapper instanceof CrusherRecipeWrapper){ + CrusherRecipeWrapper wrapper = (CrusherRecipeWrapper)recipeWrapper; + + recipeLayout.getItemStacks().init(0, true, 19, 7); + recipeLayout.getItemStacks().set(0, wrapper.theRecipe.getRecipeInputs()); + + recipeLayout.getItemStacks().init(1, true, 7, 55); + recipeLayout.getItemStacks().set(1, wrapper.theRecipe.getRecipeOutputOnes()); + + List outputTwos = wrapper.theRecipe.getRecipeOutputTwos(); + if(outputTwos != null && !outputTwos.isEmpty()){ + recipeLayout.getItemStacks().init(2, true, 31, 55); + recipeLayout.getItemStacks().set(2, outputTwos); + } + } + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeHandler.java new file mode 100644 index 000000000..698e59d7a --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeHandler.java @@ -0,0 +1,43 @@ +/* + * This file ("CrusherRecipeHandler.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 + * + * © 2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.jei.crusher; + +import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe; +import mezz.jei.api.recipe.IRecipeHandler; +import mezz.jei.api.recipe.IRecipeWrapper; + +import javax.annotation.Nonnull; + +public class CrusherRecipeHandler implements IRecipeHandler{ + + @Nonnull + @Override + public Class getRecipeClass(){ + return CrusherRecipe.class; + } + + @Nonnull + @Override + public String getRecipeCategoryUid(){ + return CrusherRecipeCategory.NAME; + } + + @Nonnull + @Override + public IRecipeWrapper getRecipeWrapper(@Nonnull CrusherRecipe recipe){ + return new CrusherRecipeWrapper(recipe); + } + + @Override + public boolean isRecipeValid(@Nonnull CrusherRecipe recipe){ + return true; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java new file mode 100644 index 000000000..a668c2c1b --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java @@ -0,0 +1,111 @@ +/* + * This file ("CrusherRecipeWrapper.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 + * + * © 2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.jei.crusher; + +import com.google.common.collect.ImmutableList; +import de.ellpeck.actuallyadditions.api.booklet.BookletPage; +import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe; +import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils; +import de.ellpeck.actuallyadditions.mod.jei.RecipeWrapperWithButton; +import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.List; + +public class CrusherRecipeWrapper extends RecipeWrapperWithButton implements IRecipeWrapper{ + + public CrusherRecipe theRecipe; + + public CrusherRecipeWrapper(CrusherRecipe recipe){ + this.theRecipe = recipe; + } + + @Override + public List getInputs(){ + return this.theRecipe.getRecipeInputs(); + } + + @Override + public List getOutputs(){ + List list = new ArrayList(); + list.addAll(this.theRecipe.getRecipeOutputOnes()); + + List outputTwos = this.theRecipe.getRecipeOutputTwos(); + if(outputTwos != null && !outputTwos.isEmpty()){ + list.addAll(outputTwos); + } + + return list; + } + + @Override + public List getFluidInputs(){ + return ImmutableList.of(); + } + + @Override + public List getFluidOutputs(){ + return ImmutableList.of(); + } + + @Override + public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ + + } + + @Override + public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY){ + this.updateButton(minecraft, mouseX, mouseY); + + List outputTwos = this.theRecipe.getRecipeOutputTwos(); + if(outputTwos != null && !outputTwos.isEmpty()){ + minecraft.fontRendererObj.drawString(this.theRecipe.outputTwoChance+"%", 60, 60, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); + } + } + + @Override + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ + + } + + @Nullable + @Override + public List getTooltipStrings(int mouseX, int mouseY){ + return null; + } + + @Override + public boolean handleClick(@Nonnull Minecraft minecraft, int mouseX, int mouseY, int mouseButton){ + return this.handleClick(minecraft, mouseX, mouseY); + } + + @Override + public BookletPage getPage(){ + return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockGrinder)); + } + + @Override + public int getButtonX(){ + return -5; + } + + @Override + public int getButtonY(){ + return 26; + } +} From 1a258f8ed5a1a60feab33925dfca9f1dce236590 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 17 Jan 2016 19:22:14 +0100 Subject: [PATCH 02/66] Fixed the drill's 3x3 and 5x5 mining acting weird on servers --- .../actuallyadditions/mod/util/WorldUtil.java | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) 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 17cc3c5d8..8ec780ae5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java @@ -53,7 +53,7 @@ public class WorldUtil{ public static BlockPos getCoordsFromSide(EnumFacing side, BlockPos pos, int offset){ return new BlockPos(pos.getX()+side.getFrontOffsetX()*(offset+1), pos.getY()+side.getFrontOffsetY()*(offset+1), pos.getZ()+side.getFrontOffsetZ()*(offset+1)); } - + public static void pushEnergyToAllSides(World world, BlockPos pos, EnergyStorage storage){ pushEnergy(world, pos, EnumFacing.UP, storage); pushEnergy(world, pos, EnumFacing.DOWN, storage); @@ -317,20 +317,19 @@ public class WorldUtil{ } private static MovingObjectPosition getMovingObjectPosWithReachDistance(World world, EntityPlayer player, double distance, boolean p1, boolean p2, boolean p3){ - float f = 1.0F; - float f1 = player.prevRotationPitch+(player.rotationPitch-player.prevRotationPitch)*f; - float f2 = player.prevRotationYaw+(player.rotationYaw-player.prevRotationYaw)*f; - double d0 = player.prevPosX+(player.posX-player.prevPosX)*(double)f; - double d1 = player.prevPosY+(player.posY-player.prevPosY)*(double)f+(double)(world.isRemote ? player.getEyeHeight()-player.getDefaultEyeHeight() : player.getEyeHeight()); - double d2 = player.prevPosZ+(player.posZ-player.prevPosZ)*(double)f; + float f = player.rotationPitch; + float f1 = player.rotationYaw; + double d0 = player.posX; + double d1 = player.posY+(double)player.getEyeHeight(); + double d2 = player.posZ; Vec3 vec3 = new Vec3(d0, d1, d2); - float f3 = MathHelper.cos(-f2*0.017453292F-(float)Math.PI); - float f4 = MathHelper.sin(-f2*0.017453292F-(float)Math.PI); - float f5 = -MathHelper.cos(-f1*0.017453292F); - float f6 = MathHelper.sin(-f1*0.017453292F); - float f7 = f4*f5; - float f8 = f3*f5; - Vec3 vec31 = vec3.addVector((double)f7*distance, (double)f6*distance, (double)f8*distance); + float f2 = MathHelper.cos(-f1*0.017453292F-(float)Math.PI); + float f3 = MathHelper.sin(-f1*0.017453292F-(float)Math.PI); + float f4 = -MathHelper.cos(-f*0.017453292F); + float f5 = MathHelper.sin(-f*0.017453292F); + float f6 = f3*f4; + float f7 = f2*f4; + Vec3 vec31 = vec3.addVector((double)f6*distance, (double)f5*distance, (double)f7*distance); return world.rayTraceBlocks(vec3, vec31, p1, p2, p3); } From 060a4dcbb3848508281c2b4fc67f321ae37a9438 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 17 Jan 2016 20:12:20 +0100 Subject: [PATCH 03/66] red mushroom -> nether wart in Reconstructor --- .../de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java | 2 +- .../mod/items/lens/LensNoneRecipeHandler.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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 a70d268ee..b9dfabc03 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -65,7 +65,7 @@ public class InitBooklet{ new BookletChapter("rf", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(Items.redstone), new PageTextOnly(1)); //Miscellaneous - new BookletChapter("reconstructorLenses", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLens).setNoText(), new PageReconstructor(3, LensNoneRecipeHandler.recipeColorLens), new PageReconstructor(4, LensNoneRecipeHandler.recipeExplosionLens), new PageReconstructor(5, LensNoneRecipeHandler.recipeDamageLens), new PageReconstructor(6, LensNoneRecipeHandler.recipeSoulSand).setNoText(), new PageReconstructor(7, LensNoneRecipeHandler.recipeLeather).setNoText()).setImportant(); + new BookletChapter("reconstructorLenses", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLens).setNoText(), new PageReconstructor(3, LensNoneRecipeHandler.recipeColorLens), new PageReconstructor(4, LensNoneRecipeHandler.recipeExplosionLens), new PageReconstructor(5, LensNoneRecipeHandler.recipeDamageLens), new PageReconstructor(6, LensNoneRecipeHandler.recipeSoulSand).setNoText(), new PageReconstructor(7, LensNoneRecipeHandler.recipeLeather).setNoText(), new PageReconstructor(8, LensNoneRecipeHandler.recipeNetherWart).setNoText()).setImportant(); new BookletChapter("miscDecorStuffsAndThings", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockTestifiBucksGreenWall), new PageTextOnly(1), new PageReconstructor(2, LensNoneRecipeHandler.recipeWhiteWall).setNoText(), new PageReconstructor(3, LensNoneRecipeHandler.recipeGreenWall).setNoText()); new BookletChapter("quartz", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), new PageTextOnly(1).setStack(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal())).addTextReplacement("", OreGen.QUARTZ_MIN).addTextReplacement("", OreGen.QUARTZ_MAX), new PageTextOnly(2).setStack(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()); new BookletChapter("cloud", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockSmileyCloud), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeSmileyCloud).setNoText().setPageStacksWildcard()).setSpecial().setIncomplete(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensNoneRecipeHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensNoneRecipeHandler.java index 4e292ae15..e3f8e4145 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensNoneRecipeHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensNoneRecipeHandler.java @@ -35,6 +35,7 @@ public class LensNoneRecipeHandler{ public static LensNoneRecipe recipeExplosionLens; public static LensNoneRecipe recipeDamageLens; public static LensNoneRecipe recipeLeather; + public static LensNoneRecipe recipeNetherWart; public static void init(){ //Crystal Blocks @@ -86,6 +87,9 @@ public class LensNoneRecipeHandler{ recipeSoulSand = Util.GetRecipes.lastReconstructorRecipe(); ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Items.rotten_flesh), new ItemStack(Items.leather), 8000); recipeLeather = Util.GetRecipes.lastReconstructorRecipe(); + + ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Blocks.red_mushroom), new ItemStack(Items.nether_wart), 150000); + recipeNetherWart = Util.GetRecipes.lastReconstructorRecipe(); } ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Blocks.quartz_block), new ItemStack(InitBlocks.blockTestifiBucksWhiteWall), 10); From 4b835f8df89bd1be3bb10d0bd39358f47b12a99b Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 17 Jan 2016 20:46:51 +0100 Subject: [PATCH 04/66] Custom packet handler for 98.7% less stack traces when joining worlds --- .../mod/network/PacketHandler.java | 1 + .../mod/network/PacketUpdateTileEntity.java | 79 +++++++++++++++++++ .../mod/network/VanillaPacketSyncer.java | 40 ---------- .../mod/tile/TileEntityBase.java | 42 +++++++--- .../mod/tile/TileEntityLaserRelay.java | 13 ++- 5 files changed, 115 insertions(+), 60 deletions(-) create mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketUpdateTileEntity.java delete mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/network/VanillaPacketSyncer.java diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandler.java index 7d5c5fb26..143233276 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandler.java @@ -29,5 +29,6 @@ public class PacketHandler{ theNetwork.registerMessage(PacketGuiNumber.Handler.class, PacketGuiNumber.class, 1, Side.SERVER); theNetwork.registerMessage(PacketGuiString.Handler.class, PacketGuiString.class, 2, Side.SERVER); theNetwork.registerMessage(PacketParticle.Handler.class, PacketParticle.class, 3, Side.CLIENT); + theNetwork.registerMessage(PacketUpdateTileEntity.Handler.class, PacketUpdateTileEntity.class, 4, Side.CLIENT); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketUpdateTileEntity.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketUpdateTileEntity.java new file mode 100644 index 000000000..2f46f58bc --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketUpdateTileEntity.java @@ -0,0 +1,79 @@ +/* + * This file ("PacketUpdateTileEntity.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 + * + * © 2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.network; + +import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; +import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import io.netty.buffer.ByteBuf; +import net.minecraft.client.Minecraft; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.fml.common.network.simpleimpl.IMessage; +import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; +import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +public class PacketUpdateTileEntity implements IMessage{ + + private NBTTagCompound compound; + private BlockPos pos; + + @SuppressWarnings("unused") + public PacketUpdateTileEntity(){ + + } + + public PacketUpdateTileEntity(TileEntityBase tile){ + this.compound = tile.getSyncCompound(); + this.pos = tile.getPos(); + } + + @Override + public void fromBytes(ByteBuf buf){ + PacketBuffer buffer = new PacketBuffer(buf); + try{ + this.compound = buffer.readNBTTagCompoundFromBuffer(); + this.pos = buffer.readBlockPos(); + } + catch(Exception e){ + ModUtil.LOGGER.error("Something went wrong trying to receive a TileEntity packet!", e); + } + } + + @Override + public void toBytes(ByteBuf buf){ + PacketBuffer buffer = new PacketBuffer(buf); + + buffer.writeNBTTagCompoundToBuffer(this.compound); + buffer.writeBlockPos(this.pos); + } + + public static class Handler implements IMessageHandler{ + + @Override + @SideOnly(Side.CLIENT) + public IMessage onMessage(PacketUpdateTileEntity message, MessageContext ctx){ + if(message.pos != null && message.compound != null){ + World world = Minecraft.getMinecraft().theWorld; + + TileEntity tile = world.getTileEntity(message.pos); + if(tile != null && tile instanceof TileEntityBase){ + ((TileEntityBase)tile).receiveSyncCompound(message.compound); + } + } + return null; + } + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/VanillaPacketSyncer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/VanillaPacketSyncer.java deleted file mode 100644 index 05e2b0feb..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/VanillaPacketSyncer.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This file ("VanillaPacketSyncer.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 - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.network; - -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.tileentity.TileEntity; - -import java.util.List; - -public class VanillaPacketSyncer{ - - public static void sendTileToNearbyPlayers(TileEntity tile){ - List allPlayers = tile.getWorld().playerEntities; - for(Object player : allPlayers){ - if(player instanceof EntityPlayerMP){ - sendTileToPlayer(tile, (EntityPlayerMP)player, 64); - } - } - } - - public static void sendTileToPlayer(TileEntity tile, EntityPlayerMP player, int maxDistance){ - if(player.getDistance(tile.getPos().getX(), tile.getPos().getY(), tile.getPos().getZ()) <= maxDistance){ - sendTileToPlayer(tile, player); - } - } - - public static void sendTileToPlayer(TileEntity tile, EntityPlayerMP player){ - if(player.getEntityWorld().getTileEntity(tile.getPos()) == tile){ - player.playerNetServerHandler.sendPacket(tile.getDescriptionPacket()); - } - } -} 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 2309c7621..4d50427eb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java @@ -11,7 +11,8 @@ package de.ellpeck.actuallyadditions.mod.tile; import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; -import de.ellpeck.actuallyadditions.mod.network.VanillaPacketSyncer; +import de.ellpeck.actuallyadditions.mod.network.PacketHandler; +import de.ellpeck.actuallyadditions.mod.network.PacketUpdateTileEntity; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import net.minecraft.block.state.IBlockState; import net.minecraft.nbt.NBTTagCompound; @@ -22,6 +23,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.ITickable; import net.minecraft.world.World; +import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.registry.GameRegistry; public abstract class TileEntityBase extends TileEntity implements ITickable{ @@ -90,7 +92,7 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{ } @Override - public void update(){ + public final void update(){ this.updateEntity(); } @@ -99,15 +101,21 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{ } @Override - public Packet getDescriptionPacket(){ - NBTTagCompound tag = new NBTTagCompound(); - this.writeSyncableNBT(tag, true); - return new S35PacketUpdateTileEntity(this.pos, 3, tag); + public final Packet getDescriptionPacket(){ + NBTTagCompound compound = this.getSyncCompound(); + if(compound != null){ + return new S35PacketUpdateTileEntity(this.pos, 3, compound); + } + else{ + return null; + } } @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt){ - this.readSyncableNBT(pkt.getNbtCompound(), true); + public final void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt){ + if(pkt != null){ + this.receiveSyncCompound(pkt.getNbtCompound()); + } } @Override @@ -127,12 +135,12 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{ } } - public void setRedstonePowered(boolean powered){ + public final void setRedstonePowered(boolean powered){ this.isRedstonePowered = powered; this.markDirty(); } - protected boolean sendUpdateWithInterval(){ + protected final boolean sendUpdateWithInterval(){ if(this.ticksElapsed%ConfigIntValues.TILE_ENTITY_UPDATE_INTERVAL.getValue() == 0){ this.sendUpdate(); return true; @@ -142,7 +150,17 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{ } } - public void sendUpdate(){ - VanillaPacketSyncer.sendTileToNearbyPlayers(this); + public final void sendUpdate(){ + PacketHandler.theNetwork.sendToAllAround(new PacketUpdateTileEntity(this), new NetworkRegistry.TargetPoint(this.worldObj.provider.getDimensionId(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), 64)); + } + + public NBTTagCompound getSyncCompound(){ + NBTTagCompound tag = new NBTTagCompound(); + this.writeSyncableNBT(tag, true); + return tag; + } + + public void receiveSyncCompound(NBTTagCompound compound){ + this.readSyncableNBT(compound, true); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java index 39bf833f4..977d1e20a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java @@ -21,9 +21,6 @@ import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import io.netty.util.internal.ConcurrentSet; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraftforge.fml.relauncher.Side; @@ -58,7 +55,7 @@ public class TileEntityLaserRelay extends TileEntityBase implements IEnergyRecei } @Override - public Packet getDescriptionPacket(){ + public NBTTagCompound getSyncCompound(){ NBTTagCompound compound = new NBTTagCompound(); BlockPos thisPos = this.pos; @@ -70,18 +67,18 @@ public class TileEntityLaserRelay extends TileEntityBase implements IEnergyRecei list.appendTag(pair.writeToNBT()); } compound.setTag("Connections", list); - return new S35PacketUpdateTileEntity(thisPos, 3, compound); + return compound; } return null; } @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt){ + public void receiveSyncCompound(NBTTagCompound compound){ BlockPos thisPos = this.pos; - if(pkt != null && pkt.getNbtCompound() != null){ + if(compound != null){ LaserRelayConnectionHandler.getInstance().removeRelayFromNetwork(thisPos); - NBTTagList list = pkt.getNbtCompound().getTagList("Connections", 10); + NBTTagList list = compound.getTagList("Connections", 10); for(int i = 0; i < list.tagCount(); i++){ LaserRelayConnectionHandler.ConnectionPair pair = LaserRelayConnectionHandler.ConnectionPair.readFromNBT(list.getCompoundTagAt(i)); LaserRelayConnectionHandler.getInstance().addConnection(pair.firstRelay, pair.secondRelay); From 924e7da95fa9bc98b5508755d117fd1058b4cd41 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 17 Jan 2016 20:50:25 +0100 Subject: [PATCH 05/66] to be safe3 --- .../mod/network/PacketUpdateTileEntity.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketUpdateTileEntity.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketUpdateTileEntity.java index 2f46f58bc..d515af4ba 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketUpdateTileEntity.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketUpdateTileEntity.java @@ -67,10 +67,11 @@ public class PacketUpdateTileEntity implements IMessage{ public IMessage onMessage(PacketUpdateTileEntity message, MessageContext ctx){ if(message.pos != null && message.compound != null){ World world = Minecraft.getMinecraft().theWorld; - - TileEntity tile = world.getTileEntity(message.pos); - if(tile != null && tile instanceof TileEntityBase){ - ((TileEntityBase)tile).receiveSyncCompound(message.compound); + if(world != null){ + TileEntity tile = world.getTileEntity(message.pos); + if(tile != null && tile instanceof TileEntityBase){ + ((TileEntityBase)tile).receiveSyncCompound(message.compound); + } } } return null; From 5ca0fd53d31b0e06b57d131b2816534ae24c7eba Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 17 Jan 2016 22:57:32 +0100 Subject: [PATCH 06/66] Reconstructor recipe handler --- .../mod/jei/JEIActuallyAdditionsPlugin.java | 9 +- .../ReconstructorRecipeCategory.java | 77 +++++++++++++++ .../ReconstructorRecipeHandler.java | 44 +++++++++ .../ReconstructorRecipeWrapper.java | 96 +++++++++++++++++++ 4 files changed, 224 insertions(+), 2 deletions(-) create mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeCategory.java create mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeHandler.java create mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java index a89d9f1b7..042ca5965 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java @@ -17,6 +17,8 @@ import de.ellpeck.actuallyadditions.mod.jei.coffee.CoffeeMachineRecipeCategory; import de.ellpeck.actuallyadditions.mod.jei.coffee.CoffeeMachineRecipeHandler; import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherRecipeCategory; import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherRecipeHandler; +import de.ellpeck.actuallyadditions.mod.jei.reconstructor.ReconstructorRecipeCategory; +import de.ellpeck.actuallyadditions.mod.jei.reconstructor.ReconstructorRecipeHandler; import mezz.jei.api.*; @JEIPlugin @@ -39,18 +41,21 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin{ registry.addRecipeCategories( new BookletRecipeCategory(this.helpers.getGuiHelper()), new CoffeeMachineRecipeCategory(this.helpers.getGuiHelper()), - new CrusherRecipeCategory(this.helpers.getGuiHelper()) + new CrusherRecipeCategory(this.helpers.getGuiHelper()), + new ReconstructorRecipeCategory(this.helpers.getGuiHelper()) ); registry.addRecipeHandlers( new BookletRecipeHandler(), new CoffeeMachineRecipeHandler(), - new CrusherRecipeHandler() + new CrusherRecipeHandler(), + new ReconstructorRecipeHandler() ); registry.addRecipes(ActuallyAdditionsAPI.bookletPagesWithItemStackData); registry.addRecipes(ActuallyAdditionsAPI.coffeeMachineIngredients); registry.addRecipes(ActuallyAdditionsAPI.crusherRecipes); + registry.addRecipes(ActuallyAdditionsAPI.reconstructorLensNoneRecipes); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeCategory.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeCategory.java new file mode 100644 index 000000000..04279d3c2 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeCategory.java @@ -0,0 +1,77 @@ +/* + * This file ("ReconstructorRecipeCategory.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 + * + * © 2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.jei.reconstructor; + +import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.nei.NEIReconstructorRecipe; +import de.ellpeck.actuallyadditions.mod.util.AssetUtil; +import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import mezz.jei.api.IGuiHelper; +import mezz.jei.api.gui.IDrawable; +import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.recipe.IRecipeCategory; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; + +import javax.annotation.Nonnull; + +public class ReconstructorRecipeCategory implements IRecipeCategory{ + + private IDrawable background; + private static final ItemStack RECONSTRUCTOR = new ItemStack(InitBlocks.blockAtomicReconstructor); + + public ReconstructorRecipeCategory(IGuiHelper helper){ + this.background = helper.createDrawable(AssetUtil.getGuiLocation("guiNEIAtomicReconstructor"), 0, 0, 96, 60); + } + + @Nonnull + @Override + public String getUid(){ + return NEIReconstructorRecipe.NAME; + } + + @Nonnull + @Override + public String getTitle(){ + return StringUtil.localize("container.nei."+NEIReconstructorRecipe.NAME+".name"); + } + + @Nonnull + @Override + public IDrawable getBackground(){ + return this.background; + } + + @Override + public void drawExtras(Minecraft minecraft){ + AssetUtil.renderStackToGui(RECONSTRUCTOR, 34, 19, 1.0F); + } + + @Override + public void drawAnimations(Minecraft minecraft){ + + } + + @Override + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper){ + if(recipeWrapper instanceof ReconstructorRecipeWrapper){ + ReconstructorRecipeWrapper wrapper = (ReconstructorRecipeWrapper)recipeWrapper; + + recipeLayout.getItemStacks().init(0, true, 4, 18); + recipeLayout.getItemStacks().set(0, wrapper.theRecipe.getInputs()); + + recipeLayout.getItemStacks().init(1, true, 66, 18); + recipeLayout.getItemStacks().set(1, wrapper.theRecipe.getOutputs()); + + } + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeHandler.java new file mode 100644 index 000000000..1d22fec60 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeHandler.java @@ -0,0 +1,44 @@ +/* + * This file ("ReconstructorRecipeHandler.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 + * + * © 2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.jei.reconstructor; + +import de.ellpeck.actuallyadditions.api.recipe.LensNoneRecipe; +import de.ellpeck.actuallyadditions.mod.nei.NEIReconstructorRecipe; +import mezz.jei.api.recipe.IRecipeHandler; +import mezz.jei.api.recipe.IRecipeWrapper; + +import javax.annotation.Nonnull; + +public class ReconstructorRecipeHandler implements IRecipeHandler{ + + @Nonnull + @Override + public Class getRecipeClass(){ + return LensNoneRecipe.class; + } + + @Nonnull + @Override + public String getRecipeCategoryUid(){ + return NEIReconstructorRecipe.NAME; + } + + @Nonnull + @Override + public IRecipeWrapper getRecipeWrapper(@Nonnull LensNoneRecipe recipe){ + return new ReconstructorRecipeWrapper(recipe); + } + + @Override + public boolean isRecipeValid(@Nonnull LensNoneRecipe recipe){ + return true; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java new file mode 100644 index 000000000..33f4b7eaf --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java @@ -0,0 +1,96 @@ +/* + * This file ("ReconstructorRecipeWrapper.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 + * + * © 2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.jei.reconstructor; + +import com.google.common.collect.ImmutableList; +import de.ellpeck.actuallyadditions.api.booklet.BookletPage; +import de.ellpeck.actuallyadditions.api.recipe.LensNoneRecipe; +import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils; +import de.ellpeck.actuallyadditions.mod.jei.RecipeWrapperWithButton; +import mezz.jei.api.recipe.IRecipeWrapper; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.List; + +public class ReconstructorRecipeWrapper extends RecipeWrapperWithButton implements IRecipeWrapper{ + + public LensNoneRecipe theRecipe; + + public ReconstructorRecipeWrapper(LensNoneRecipe recipe){ + this.theRecipe = recipe; + } + + @Override + public List getInputs(){ + return this.theRecipe.getInputs(); + } + + @Override + public List getOutputs(){ + return this.theRecipe.getOutputs(); + } + + @Override + public List getFluidInputs(){ + return ImmutableList.of(); + } + + @Override + public List getFluidOutputs(){ + return ImmutableList.of(); + } + + @Override + public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ + + } + + @Override + public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY){ + this.updateButton(minecraft, mouseX, mouseY); + } + + @Override + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ + + } + + @Nullable + @Override + public List getTooltipStrings(int mouseX, int mouseY){ + return null; + } + + @Override + public boolean handleClick(@Nonnull Minecraft minecraft, int mouseX, int mouseY, int mouseButton){ + return this.handleClick(minecraft, mouseX, mouseY); + } + + @Override + public BookletPage getPage(){ + return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockAtomicReconstructor)); + } + + @Override + public int getButtonX(){ + return 3; + } + + @Override + public int getButtonY(){ + return 40; + } +} From 8990e8cb70051c635fc4b4465510c10cc5027200 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 17 Jan 2016 23:46:31 +0100 Subject: [PATCH 07/66] r24! --- build.gradle | 4 ++-- update/changelog.md | 13 +++++++++++++ update/updateVersions.properties | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 0ccb18688..33f316459 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ buildscript { } apply plugin: 'net.minecraftforge.gradle.forge' -version = "1.8.9-r23" +version = "1.8.9-r24" group = "de.ellpeck.actuallyadditions" archivesBaseName = "ActuallyAdditions" @@ -42,7 +42,7 @@ dependencies { compile "codechicken:CodeChickenCore:1.8-1.0.5.36:dev" compile "codechicken:NotEnoughItems:1.8-1.0.5.104:dev" - deobfCompile "mezz.jei:jei_1.8.9:2.18.1.88" + deobfCompile "mezz.jei:jei_1.8.9:2.19.0.93" } processResources { diff --git a/update/changelog.md b/update/changelog.md index 08ac19511..5dacd56bf 100644 --- a/update/changelog.md +++ b/update/changelog.md @@ -1,3 +1,16 @@ +# 1.8.9-r24 +* Fixed texture names of quartz tools (ssblur) +* Added right-click harvest functionality to all crops. (ssblur) +* Made word count reload when reloading resources +* Fixed Lenses not syncing correctly on the server when converting items +* JEI Implementation for booklet, crusher, coffee machine and reconstructor +* Fixed the drill's 3x3 and 5x5 ming acting weird on servers +* red mushroom -> nether wart in Reconstructor +* Custom packet handler for 98.7% less stack traces when joining worlds +* [API] Removed INEIRecipeHandler +* [API] Removed IHudDisplay +* [API] Removed IEnergyDisplay + # 1.8.9-r23 * Fixed a ginormous bug that screwed over crafting #### DON'T EXPECT EVERYTHING TO WORK PERFECTLY. Seriously, I break lots of stuff probably. diff --git a/update/updateVersions.properties b/update/updateVersions.properties index 9d48179ec..dd0b98f1c 100644 --- a/update/updateVersions.properties +++ b/update/updateVersions.properties @@ -1,2 +1,2 @@ 1.7.10=21 -1.8.9=23 +1.8.9=24 From acc75f5313b45c31ec6c144d50c45ae4a2400f92 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 18 Jan 2016 21:38:18 +0100 Subject: [PATCH 08/66] ..fixed assets derping because of wrong capitalization --- .../actuallyadditions/models/item/itemCrystalLightBLue.json | 2 +- .../assets/actuallyadditions/models/item/itemPotionRIng.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemCrystalLightBLue.json b/src/main/resources/assets/actuallyadditions/models/item/itemCrystalLightBLue.json index e56c5bf1f..4fc6ee310 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemCrystalLightBLue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemCrystalLightBLue.json @@ -15,4 +15,4 @@ "scale": [ 1.7, 1.7, 1.7 ] } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPotionRIng.json b/src/main/resources/assets/actuallyadditions/models/item/itemPotionRIng.json index 7cf725f15..f680f0012 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPotionRIng.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPotionRIng.json @@ -15,4 +15,4 @@ "scale": [ 1.7, 1.7, 1.7 ] } } -} +} \ No newline at end of file From ca30b483e14f0e2618a69a56d7724b9890693584 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 18 Jan 2016 23:38:52 +0100 Subject: [PATCH 09/66] Ignore NBT Tags of Energy items in JEI --- .../actuallyadditions/mod/booklet/InitBooklet.java | 2 +- .../mod/jei/JEIActuallyAdditionsPlugin.java | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) 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 b9dfabc03..397355d12 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -111,7 +111,7 @@ public class InitBooklet{ //RF Generating Blocks new BookletChapter("solarPanel", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockFurnaceSolar), new PageTextOnly(1).addTextReplacement("", TileEntityFurnaceSolar.PRODUCE), new PageCrafting(2, BlockCrafting.recipeSolar).setNoText()); new BookletChapter("heatCollector", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockHeatCollector), 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), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal())).addTextReplacement("", TileEntityCanolaPress.ENERGY_USE).addTextReplacement("", TileEntityCanolaPress.PRODUCE).addTextReplacement("", TileEntityOilGenerator.ENERGY_PRODUCED), new PageCrafting(2, BlockCrafting.recipeCanolaPress).setNoText(), new PageCrafting(3, BlockCrafting.recipeFermentingBarrel).setNoText(), new PageCrafting(4, BlockCrafting.recipeOilGen).setNoText()); + new BookletChapter("canola", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockFermentingBarrel), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal())).addTextReplacement("", TileEntityCanolaPress.ENERGY_USE).addTextReplacement("", TileEntityCanolaPress.PRODUCE).addTextReplacement("", TileEntityOilGenerator.ENERGY_PRODUCED), new PageCrafting(2, BlockCrafting.recipeCanolaPress).setNoText(), new PageCrafting(3, BlockCrafting.recipeFermentingBarrel).setNoText(), new PageCrafting(4, BlockCrafting.recipeOilGen).setNoText().setPageStacksWildcard()); new BookletChapter("leafGen", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockLeafGenerator), new PageTextOnly(1).addTextReplacement("", TileEntityLeafGenerator.ENERGY_PRODUCED).addTextReplacement("", TileEntityLeafGenerator.RANGE), new PageCrafting(2, BlockCrafting.recipeLeafGen)).setImportant(); //No RF Using Items diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java index 042ca5965..32fa2a49d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java @@ -11,6 +11,7 @@ package de.ellpeck.actuallyadditions.mod.jei; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; +import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.jei.booklet.BookletRecipeCategory; import de.ellpeck.actuallyadditions.mod.jei.booklet.BookletRecipeHandler; import de.ellpeck.actuallyadditions.mod.jei.coffee.CoffeeMachineRecipeCategory; @@ -56,6 +57,18 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin{ registry.addRecipes(ActuallyAdditionsAPI.coffeeMachineIngredients); registry.addRecipes(ActuallyAdditionsAPI.crusherRecipes); registry.addRecipes(ActuallyAdditionsAPI.reconstructorLensNoneRecipes); + + INbtIgnoreList ignoreList = this.helpers.getNbtIgnoreList(); + ignoreList.ignoreNbtTagNames(InitItems.itemDrill, "Energy"); + ignoreList.ignoreNbtTagNames(InitItems.itemTeleStaff, "Energy"); + ignoreList.ignoreNbtTagNames(InitItems.itemGrowthRing, "Energy"); + ignoreList.ignoreNbtTagNames(InitItems.itemMagnetRing, "Energy"); + ignoreList.ignoreNbtTagNames(InitItems.itemWaterRemovalRing, "Energy"); + ignoreList.ignoreNbtTagNames(InitItems.itemBattery, "Energy"); + ignoreList.ignoreNbtTagNames(InitItems.itemBatteryDouble, "Energy"); + ignoreList.ignoreNbtTagNames(InitItems.itemBatteryTriple, "Energy"); + ignoreList.ignoreNbtTagNames(InitItems.itemBatteryQuadruple, "Energy"); + ignoreList.ignoreNbtTagNames(InitItems.itemBatteryQuintuple, "Energy"); } @Override From 223db4e04e1c55cab285ede854222948c2b81152 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 19 Jan 2016 21:56:45 +0100 Subject: [PATCH 10/66] Transmaterial Differentiator --- .../mod/blocks/BlockAtomicReconstructor.java | 54 +++++++++++++++++-- .../assets/actuallyadditions/lang/en_US.lang | 32 ++++++++++- 2 files changed, 81 insertions(+), 5 deletions(-) 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 f2438606d..65d86fd8e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java @@ -12,11 +12,10 @@ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.api.lens.ILensItem; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; +import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor; -import de.ellpeck.actuallyadditions.mod.util.AssetUtil; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; -import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import de.ellpeck.actuallyadditions.mod.util.*; +import net.minecraft.block.Block; import net.minecraft.block.BlockPistonBase; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; @@ -37,10 +36,15 @@ import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import java.util.List; + public class BlockAtomicReconstructor extends BlockContainerBase implements IHudDisplay{ private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5); + public static final int NAME_FLAVOR_AMOUNTS_1 = 12; + public static final int NAME_FLAVOR_AMOUNTS_2 = 14; + public BlockAtomicReconstructor(String name){ super(Material.rock, name); this.setHarvestLevel("pickaxe", 0); @@ -129,4 +133,46 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud minecraft.fontRendererObj.drawStringWithShadow(EnumChatFormatting.YELLOW+""+EnumChatFormatting.ITALIC+strg, resolution.getScaledWidth()/2+35, resolution.getScaledHeight()/2-25, StringUtil.DECIMAL_COLOR_WHITE); } } + + @Override + protected Class getItemBlock(){ + return TheItemBlock.class; + } + + public static class TheItemBlock extends ItemBlockBase{ + + private long lastSysTime; + private int toPick1; + private int toPick2; + + public TheItemBlock(Block block){ + super(block); + this.setHasSubtypes(false); + this.setMaxDamage(0); + } + + @Override + public String getUnlocalizedName(ItemStack stack){ + return this.getUnlocalizedName(); + } + + @Override + public int getMetadata(int damage){ + return damage; + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool){ + long sysTime = System.currentTimeMillis(); + + if(this.lastSysTime+3000 < sysTime){ + this.lastSysTime = sysTime; + this.toPick1 = Util.RANDOM.nextInt(NAME_FLAVOR_AMOUNTS_1)+1; + this.toPick2 = Util.RANDOM.nextInt(NAME_FLAVOR_AMOUNTS_2)+1; + } + + String base = "tile."+ModUtil.MOD_ID_LOWER+"."+((BlockAtomicReconstructor)this.block).getBaseName()+".info."; + list.add(StringUtil.localize(base+"1."+this.toPick1)+" "+StringUtil.localize(base+"2."+this.toPick2)); + } + } } \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index 4aa2e9db2..b6aee6706 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -116,7 +116,6 @@ tile.actuallyadditions.blockMiscIronCasing.name=Iron Casing tile.actuallyadditions.blockBlackLotus.name=Black Lotus tile.actuallyadditions.blockTestifiBucksWhiteFence.name=Ethetic Quartz Wall tile.actuallyadditions.blockTestifiBucksGreenFence.name=Ethetic Green Wall -tile.actuallyadditions.blockAtomicReconstructor.name=Atomic Reconstructor tile.actuallyadditions.blockCrystalRed.name=Restonia Crystal Block tile.actuallyadditions.blockCrystalBlue.name=Palis Crystal Block tile.actuallyadditions.blockCrystalLightBlue.name=Diamatine Crystal Block @@ -154,6 +153,37 @@ tile.actuallyadditions.blockInputter.add.13.name=Efficient Sucking Dilettant tile.actuallyadditions.blockInputter.add.14.name=Extreme Sand Digger tile.actuallyadditions.blockInputter.add.15.name=Ending Serious Daughter +#Reconstructor +tile.actuallyadditions.blockAtomicReconstructor.name=Atomic Reconstructor + +tile.actuallyadditions.blockAtomicReconstructor.info.1.1=Molecular +tile.actuallyadditions.blockAtomicReconstructor.info.1.2=Material +tile.actuallyadditions.blockAtomicReconstructor.info.1.3=Quarkal +tile.actuallyadditions.blockAtomicReconstructor.info.1.4=Atomatic +tile.actuallyadditions.blockAtomicReconstructor.info.1.5=Tiny Bit +tile.actuallyadditions.blockAtomicReconstructor.info.1.6=Component +tile.actuallyadditions.blockAtomicReconstructor.info.1.7=Vittle +tile.actuallyadditions.blockAtomicReconstructor.info.1.8=Transmaterial +tile.actuallyadditions.blockAtomicReconstructor.info.1.9=Part +tile.actuallyadditions.blockAtomicReconstructor.info.1.10=Jimmie +tile.actuallyadditions.blockAtomicReconstructor.info.1.11=Chit +tile.actuallyadditions.blockAtomicReconstructor.info.1.12=Cube + +tile.actuallyadditions.blockAtomicReconstructor.info.2.1=Recombobulizer +tile.actuallyadditions.blockAtomicReconstructor.info.2.2=Shiftulator +tile.actuallyadditions.blockAtomicReconstructor.info.2.3=Recombinator +tile.actuallyadditions.blockAtomicReconstructor.info.2.4=Modulator +tile.actuallyadditions.blockAtomicReconstructor.info.2.5=Moleculizer +tile.actuallyadditions.blockAtomicReconstructor.info.2.6=Modificulator +tile.actuallyadditions.blockAtomicReconstructor.info.2.7=Changer +tile.actuallyadditions.blockAtomicReconstructor.info.2.8=Atomizer +tile.actuallyadditions.blockAtomicReconstructor.info.2.9=Makerator +tile.actuallyadditions.blockAtomicReconstructor.info.2.10=Swapper +tile.actuallyadditions.blockAtomicReconstructor.info.2.11=Exchanger +tile.actuallyadditions.blockAtomicReconstructor.info.2.12=Replacer +tile.actuallyadditions.blockAtomicReconstructor.info.2.13=Differentiator +tile.actuallyadditions.blockAtomicReconstructor.info.2.14=Rustler + #Items item.actuallyadditions.itemDrill.name=Drill item.actuallyadditions.itemFoodRice.name=Rice From 037df049656effb5a726411eda1cf295fa2c93ad Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 20 Jan 2016 20:09:03 +0100 Subject: [PATCH 11/66] I don't know what ImmutableList is. So I'm not using it. /shrugs --- .../mod/jei/booklet/BookletRecipeWrapper.java | 6 +++--- .../mod/jei/coffee/CoffeeMachineRecipeWrapper.java | 5 ++--- .../mod/jei/crusher/CrusherRecipeWrapper.java | 5 ++--- .../mod/jei/reconstructor/ReconstructorRecipeWrapper.java | 6 +++--- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java index 757edbea0..8c58e3cd7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java @@ -10,7 +10,6 @@ package de.ellpeck.actuallyadditions.mod.jei.booklet; -import com.google.common.collect.ImmutableList; import de.ellpeck.actuallyadditions.api.booklet.BookletPage; import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter; import de.ellpeck.actuallyadditions.mod.booklet.page.PagePicture; @@ -24,6 +23,7 @@ import net.minecraftforge.fluids.FluidStack; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -47,12 +47,12 @@ public class BookletRecipeWrapper extends RecipeWrapperWithButton implements IRe @Override public List getFluidInputs(){ - return ImmutableList.of(); + return new ArrayList(); } @Override public List getFluidOutputs(){ - return ImmutableList.of(); + return new ArrayList(); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java index faa60310c..0d9683ca1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java @@ -10,7 +10,6 @@ package de.ellpeck.actuallyadditions.mod.jei.coffee; -import com.google.common.collect.ImmutableList; import de.ellpeck.actuallyadditions.api.booklet.BookletPage; import de.ellpeck.actuallyadditions.api.recipe.coffee.CoffeeBrewing; import de.ellpeck.actuallyadditions.api.recipe.coffee.CoffeeIngredient; @@ -62,12 +61,12 @@ public class CoffeeMachineRecipeWrapper extends RecipeWrapperWithButton implemen @Override public List getFluidInputs(){ - return ImmutableList.of(); + return new ArrayList(); } @Override public List getFluidOutputs(){ - return ImmutableList.of(); + return new ArrayList(); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java index a668c2c1b..33013a99b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java @@ -10,7 +10,6 @@ package de.ellpeck.actuallyadditions.mod.jei.crusher; -import com.google.common.collect.ImmutableList; import de.ellpeck.actuallyadditions.api.booklet.BookletPage; import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; @@ -55,12 +54,12 @@ public class CrusherRecipeWrapper extends RecipeWrapperWithButton implements IRe @Override public List getFluidInputs(){ - return ImmutableList.of(); + return new ArrayList(); } @Override public List getFluidOutputs(){ - return ImmutableList.of(); + return new ArrayList(); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java index 33f4b7eaf..a663225df 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java @@ -10,7 +10,6 @@ package de.ellpeck.actuallyadditions.mod.jei.reconstructor; -import com.google.common.collect.ImmutableList; import de.ellpeck.actuallyadditions.api.booklet.BookletPage; import de.ellpeck.actuallyadditions.api.recipe.LensNoneRecipe; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; @@ -23,6 +22,7 @@ import net.minecraftforge.fluids.FluidStack; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import java.util.ArrayList; import java.util.List; public class ReconstructorRecipeWrapper extends RecipeWrapperWithButton implements IRecipeWrapper{ @@ -45,12 +45,12 @@ public class ReconstructorRecipeWrapper extends RecipeWrapperWithButton implemen @Override public List getFluidInputs(){ - return ImmutableList.of(); + return new ArrayList(); } @Override public List getFluidOutputs(){ - return ImmutableList.of(); + return new ArrayList(); } @Override From 2610bb8699d614131dc3eecfad27a29c2bd66ae6 Mon Sep 17 00:00:00 2001 From: XDjackieXD Date: Wed, 20 Jan 2016 20:24:16 +0100 Subject: [PATCH 12/66] Make the floaty special thingie move more awesome! --- .../mod/misc/special/RenderSpecial.java | 23 +++++-------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/RenderSpecial.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/RenderSpecial.java index 3a2f43a67..1d39fb028 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/RenderSpecial.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/RenderSpecial.java @@ -26,7 +26,6 @@ import java.util.Calendar; public class RenderSpecial{ - private double lastTimeForBobbing; private ItemStack theThingToRender; public RenderSpecial(ItemStack stack){ @@ -46,13 +45,8 @@ public class RenderSpecial{ float size = isBlock ? 0.5F : 0.4F; double offsetUp = isBlock ? 0D : 0.1875D; - double bobHeight = 70; - double theTime = Minecraft.getSystemTime(); - double time = theTime/50; - - if(time-bobHeight >= lastTimeForBobbing){ - this.lastTimeForBobbing = time; - } + double bobHeight = 0.3; + double boop = Minecraft.getSystemTime()/1000D; GlStateManager.pushMatrix(); @@ -60,18 +54,13 @@ public class RenderSpecial{ Vec3 playerPos = player.getPositionEyes(partialTicks); GlStateManager.translate(playerPos.xCoord-currentPos.xCoord, playerPos.yCoord-currentPos.yCoord-(player.isSneaking() || Minecraft.getMinecraft().thePlayer.isSneaking() ? 0.125D : 0D), playerPos.zCoord-currentPos.zCoord); - GlStateManager.translate(0D, 2.535D+offsetUp, 0D); + GlStateManager.translate(0D, 2.435D+offsetUp, 0D); GlStateManager.rotate(180F, 1.0F, 0.0F, 1.0F); GlStateManager.scale(size, size, size); - if(time-(bobHeight/2) >= lastTimeForBobbing){ - GlStateManager.translate(0D, (time-this.lastTimeForBobbing)/100D, 0D); - } - else{ - GlStateManager.translate(0D, -(time-lastTimeForBobbing)/100D+bobHeight/100D, 0D); - } - - GlStateManager.rotate((float)(theTime/20), 0, 1, 0); + // Make the floaty stuff look nice using sine waves \o/ + GlStateManager.translate(0D, Math.sin(boop%(2*Math.PI))*bobHeight, 0D); + GlStateManager.rotate((float)(((boop*40D)%360)), 0, 1, 0); GlStateManager.disableLighting(); if(this.theThingToRender != null){ From ac5d789c78d804ec6a090e1b2bc24e9b2cbfd8e7 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 20 Jan 2016 20:30:39 +0100 Subject: [PATCH 13/66] "nice" --- .../actuallyadditions/mod/misc/special/RenderSpecial.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/RenderSpecial.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/RenderSpecial.java index 1d39fb028..7b4909c58 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/RenderSpecial.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/RenderSpecial.java @@ -58,7 +58,8 @@ public class RenderSpecial{ GlStateManager.rotate(180F, 1.0F, 0.0F, 1.0F); GlStateManager.scale(size, size, size); - // Make the floaty stuff look nice using sine waves \o/ + //Make the floaty stuff look nice using sine waves \o/ -xdjackiexd + //Peck edit: What do you mean by "nice" you jackass? >_> GlStateManager.translate(0D, Math.sin(boop%(2*Math.PI))*bobHeight, 0D); GlStateManager.rotate((float)(((boop*40D)%360)), 0, 1, 0); From c4f8e67d64c149e88b9f8b4f929e5c55083b8385 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 21 Jan 2016 19:43:06 +0100 Subject: [PATCH 14/66] Why was that there? --- .../actuallyadditions/mod/blocks/BlockPhantomBooster.java | 2 +- .../de/ellpeck/actuallyadditions/mod/util/FluidStateMapper.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantomBooster.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantomBooster.java index 3f56a5a01..f2f70a3df 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantomBooster.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantomBooster.java @@ -28,7 +28,7 @@ public class BlockPhantomBooster extends BlockContainerBase{ this.setStepSound(soundTypeStone); float f = 1F/16F; - this.setBlockBounds(3*f, 0F, 3*f, 1-3*f, 1F, 1-3*f); + this.setBlockBounds(2*f, 0F, 2*f, 1-2*f, 1F, 1-2*f); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/FluidStateMapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/FluidStateMapper.java index 78b6a624c..cc0bd4652 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/FluidStateMapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/FluidStateMapper.java @@ -32,7 +32,6 @@ public class FluidStateMapper extends StateMapperBase implements ItemMeshDefinit public FluidStateMapper(Fluid fluid){ this.fluid = fluid; - // have each block hold its fluid per nbt? hm this.location = new ModelResourceLocation(new ResourceLocation(ModUtil.MOD_ID_LOWER, "fluids"), fluid.getName()); } From c7ccab75b878a47aba7cd7df7d1ae99138dc049c Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 21 Jan 2016 19:59:26 +0100 Subject: [PATCH 15/66] Cheap workaround for glitching into some blocks with a smaller hitbox causing graphical glitches and damaging the player --- .../actuallyadditions/mod/blocks/BlockCoffeeMachine.java | 5 +++++ .../actuallyadditions/mod/blocks/BlockFishingNet.java | 5 +++++ .../actuallyadditions/mod/blocks/BlockFurnaceSolar.java | 5 +++++ .../actuallyadditions/mod/blocks/BlockLaserRelay.java | 5 +++++ .../actuallyadditions/mod/blocks/BlockPhantomBooster.java | 5 +++++ .../actuallyadditions/mod/blocks/BlockSmileyCloud.java | 5 +++++ 6 files changed, 30 insertions(+) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java index 0bd4b2af7..e8a87f70f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java @@ -54,6 +54,11 @@ public class BlockCoffeeMachine extends BlockContainerBase{ return false; } + @Override + public boolean isFullCube(){ + return false; + } + @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing f6, float f7, float f8, float f9){ if(!world.isRemote){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFishingNet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFishingNet.java index e4aa6604f..174fa7841 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFishingNet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFishingNet.java @@ -39,6 +39,11 @@ public class BlockFishingNet extends BlockContainerBase{ return false; } + @Override + public boolean isFullCube(){ + return false; + } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.RARE; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceSolar.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceSolar.java index a6831a0d3..09a6fe024 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceSolar.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceSolar.java @@ -39,6 +39,11 @@ public class BlockFurnaceSolar extends BlockContainerBase{ return false; } + @Override + public boolean isFullCube(){ + return false; + } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.UNCOMMON; 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 4b3dedbbb..17d9493be 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java @@ -57,6 +57,11 @@ public class BlockLaserRelay extends BlockContainerBase{ return false; } + @Override + public boolean isFullCube(){ + return false; + } + @Override public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, int meta, EntityLivingBase base){ return this.getStateFromMeta(side.ordinal()); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantomBooster.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantomBooster.java index f2f70a3df..864dda1b0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantomBooster.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantomBooster.java @@ -36,6 +36,11 @@ public class BlockPhantomBooster extends BlockContainerBase{ return false; } + @Override + public boolean isFullCube(){ + return false; + } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.EPIC; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java index 3c5f2d85f..2093b07d3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java @@ -57,6 +57,11 @@ public class BlockSmileyCloud extends BlockContainerBase{ return false; } + @Override + public boolean isFullCube(){ + return false; + } + @Override @SideOnly(Side.CLIENT) public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand){ From 263004d4b4e74d1151b07ec7bfaf04929e5213ca Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 21 Jan 2016 21:32:08 +0100 Subject: [PATCH 16/66] Made phantom booster cheaper --- .../ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 43ec404e7..1f5fcde97 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java @@ -260,7 +260,7 @@ public class BlockCrafting{ if(ConfigCrafting.ENDER_CASING.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal()), "WSW", "SRS", "WSW", - 'W', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDERPEARL_BLOCK.ordinal()), + 'W', new ItemStack(Items.ender_pearl), 'R', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal()), 'S', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()))); recipeEnderCase = Util.GetRecipes.lastIRecipe(); From 6d719f781c8f72f34e63a87a073993e276248c52 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 22 Jan 2016 12:25:10 +0100 Subject: [PATCH 17/66] "Fix" smiley cloud bounding box. For now. --- .../mod/blocks/BlockSmileyCloud.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java index 2093b07d3..2290ccd38 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java @@ -21,19 +21,19 @@ import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.*; -import net.minecraft.world.IBlockAccess; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.util.List; import java.util.Random; public class BlockSmileyCloud extends BlockContainerBase{ @@ -88,7 +88,8 @@ public class BlockSmileyCloud extends BlockContainerBase{ return true; } - @Override + //TODO Fix bounding box + /*@Override public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB axis, List list, Entity entity){ this.setBlockBoundsBasedOnState(world, pos); super.addCollisionBoxesToList(world, pos, state, axis, list, entity); @@ -112,6 +113,7 @@ public class BlockSmileyCloud extends BlockContainerBase{ this.setBlockBounds(f*3F, 0F, 0F, 1F, 1F, 1F); } } + */ @Override public TileEntity createNewTileEntity(World world, int meta){ From 6edab422c47240e4d0b1639ffe3166255c97dba7 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 22 Jan 2016 18:27:28 +0100 Subject: [PATCH 18/66] Fix plant right-clicking never returned any seeds --- .../ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java | 4 +++- .../de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java index 5ef231662..6f19e5d1e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java @@ -53,9 +53,11 @@ public class BlockPlant extends BlockCrops{ if(!world.isRemote){ List drops = getDrops(world, pos, state, 0); + boolean deductedSeedSize = false; for(ItemStack stack : drops){ - if(stack != null && stack.getItem() == this.getSeed()){ + if(stack != null && stack.getItem() == this.seedItem && !deductedSeedSize){ stack.stackSize--; + deductedSeedSize = true; } EntityItem entity = new EntityItem(world, pos.getX()+.5, pos.getY()+.5, pos.getZ()+.5, stack); world.spawnEntityInWorld(entity); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java index 163a584fa..0a81def15 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java @@ -21,6 +21,7 @@ import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.oredict.OreDictionary; +//TODO Add meta & nbt info public class TooltipEvent{ private static final String ADVANCED_INFO_TEXT_PRE = EnumChatFormatting.DARK_GRAY+" "; From 0b3201bcf96b6c7b34d4c040edaa692cccc0ae55 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 22 Jan 2016 18:52:38 +0100 Subject: [PATCH 19/66] Ignore some Items in JEI --- .../mod/blocks/base/BlockPlant.java | 15 ++++++++++----- .../mod/jei/JEIActuallyAdditionsPlugin.java | 11 +++++++++++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java index 6f19e5d1e..03f9c8684 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java @@ -55,12 +55,17 @@ public class BlockPlant extends BlockCrops{ List drops = getDrops(world, pos, state, 0); boolean deductedSeedSize = false; for(ItemStack stack : drops){ - if(stack != null && stack.getItem() == this.seedItem && !deductedSeedSize){ - stack.stackSize--; - deductedSeedSize = true; + if(stack != null){ + if(stack.getItem() == this.seedItem && !deductedSeedSize){ + stack.stackSize--; + deductedSeedSize = true; + } + + if(stack.stackSize > 0){ + EntityItem entity = new EntityItem(world, pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5, stack); + world.spawnEntityInWorld(entity); + } } - EntityItem entity = new EntityItem(world, pos.getX()+.5, pos.getY()+.5, pos.getZ()+.5, stack); - world.spawnEntityInWorld(entity); } world.setBlockState(pos, getStateFromMeta(0)); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java index 32fa2a49d..75dc4ac74 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java @@ -11,6 +11,7 @@ package de.ellpeck.actuallyadditions.mod.jei; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; +import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.jei.booklet.BookletRecipeCategory; import de.ellpeck.actuallyadditions.mod.jei.booklet.BookletRecipeHandler; @@ -20,7 +21,9 @@ import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherRecipeCategory; import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherRecipeHandler; import de.ellpeck.actuallyadditions.mod.jei.reconstructor.ReconstructorRecipeCategory; import de.ellpeck.actuallyadditions.mod.jei.reconstructor.ReconstructorRecipeHandler; +import de.ellpeck.actuallyadditions.mod.util.Util; import mezz.jei.api.*; +import net.minecraft.item.ItemStack; @JEIPlugin public class JEIActuallyAdditionsPlugin implements IModPlugin{ @@ -69,6 +72,14 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin{ ignoreList.ignoreNbtTagNames(InitItems.itemBatteryTriple, "Energy"); ignoreList.ignoreNbtTagNames(InitItems.itemBatteryQuadruple, "Energy"); ignoreList.ignoreNbtTagNames(InitItems.itemBatteryQuintuple, "Energy"); + + IItemBlacklist blacklist = this.helpers.getItemBlacklist(); + blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockRice)); + blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockCanola)); + blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockFlax)); + blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockCoffee)); + blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockWildPlant, 1, Util.WILDCARD)); + blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockColoredLampOn, 1, Util.WILDCARD)); } @Override From c9f3b926ccae26637ebc3383f7caea981c3d5d14 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 22 Jan 2016 19:02:04 +0100 Subject: [PATCH 20/66] Fix Coffee Machine and Smiley Cloud bounding box --- .../mod/blocks/BlockCoffeeMachine.java | 5 ++-- .../mod/blocks/BlockSmileyCloud.java | 28 +++++++++---------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java index e8a87f70f..2e29e3185 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java @@ -39,9 +39,8 @@ public class BlockCoffeeMachine extends BlockContainerBase{ this.setResistance(10.0F); this.setStepSound(soundTypeStone); - //TODO Fix bounding box - //float f = 1/16F; - //this.setBlockBounds(f, 0F, f, 1F-f, 1F-2*f, 1F-f); + float f = 1/16F; + this.setBlockBounds(f, 0F, f, 1F-f, 1F-2*f, 1F-f); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java index 2290ccd38..5528a9822 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java @@ -21,19 +21,19 @@ import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumParticleTypes; -import net.minecraft.util.MathHelper; +import net.minecraft.util.*; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import java.util.List; import java.util.Random; public class BlockSmileyCloud extends BlockContainerBase{ @@ -88,8 +88,7 @@ public class BlockSmileyCloud extends BlockContainerBase{ return true; } - //TODO Fix bounding box - /*@Override + @Override public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB axis, List list, Entity entity){ this.setBlockBoundsBasedOnState(world, pos); super.addCollisionBoxesToList(world, pos, state, axis, list, entity); @@ -100,20 +99,19 @@ public class BlockSmileyCloud extends BlockContainerBase{ int meta = PosUtil.getMetadata(pos, world); float f = 0.0625F; - if(meta == 0){ - this.setBlockBounds(0F, 0F, 0F, 1F, 1F, 1F-f*3F); - } if(meta == 1){ - this.setBlockBounds(0F, 0F, 0F, 1F-f*3F, 1F, 1F); - } - if(meta == 2){ - this.setBlockBounds(0F, 0F, f*3F, 1F, 1F, 1F); + this.setBlockBounds(0F, 0F, 0F, 1F, 1F-f*3F, 1F-f*2F); } if(meta == 3){ - this.setBlockBounds(f*3F, 0F, 0F, 1F, 1F, 1F); + this.setBlockBounds(0F, 0F, 0F, 1F-f*2F, 1F-f*3F, 1F); + } + if(meta == 0){ + this.setBlockBounds(0F, 0F, f*2F, 1F, 1F-f*3F, 1F); + } + if(meta == 2){ + this.setBlockBounds(f*2F, 0F, 0F, 1F, 1F-f*3F, 1F); } } - */ @Override public TileEntity createNewTileEntity(World world, int meta){ From 317978787cc5ecdb3deaf382326ba431b6146f4d Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 22 Jan 2016 19:40:00 +0100 Subject: [PATCH 21/66] Added metadata and nbt to the Control info for ItemStacks --- .../mod/event/TooltipEvent.java | 24 +++++++++++++++++++ .../assets/actuallyadditions/lang/en_US.lang | 3 +++ 2 files changed, 27 insertions(+) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java index 0a81def15..7da2a0ad3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java @@ -16,11 +16,14 @@ import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.Minecraft; import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.oredict.OreDictionary; +import java.util.List; + //TODO Add meta & nbt info public class TooltipEvent{ @@ -66,8 +69,29 @@ public class TooltipEvent{ event.toolTip.add(ADVANCED_INFO_TEXT_PRE+metaName); } + //Metadata + int meta = event.itemStack.getItemDamage(); + event.toolTip.add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".meta.desc")+":"); + event.toolTip.add(ADVANCED_INFO_TEXT_PRE+meta); + + //NBT + NBTTagCompound compound = event.itemStack.getTagCompound(); + if(compound != null && !compound.hasNoTags()){ + event.toolTip.add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".nbt.desc")+":"); + if(KeyUtil.isShiftPressed()){ + List strgList = Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(compound.toString(), 200); + for(String strg : strgList){ + event.toolTip.add(ADVANCED_INFO_TEXT_PRE+strg); + } + } + else{ + event.toolTip.add(ADVANCED_INFO_TEXT_PRE+EnumChatFormatting.ITALIC+"["+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".pressShift.desc")+"]"); + } + } + //Disabling Info event.toolTip.addAll(Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(EnumChatFormatting.ITALIC+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".disablingInfo.desc"), 200)); + } else{ if(ConfigBoolValues.CTRL_INFO_FOR_EXTRA_INFO.isEnabled()){ diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index b6aee6706..50df5adb9 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -425,7 +425,10 @@ tooltip.actuallyadditions.oredictName.desc=OreDictionary Entries tooltip.actuallyadditions.noOredictNameAvail.desc=None tooltip.actuallyadditions.codeName.desc=Code Name tooltip.actuallyadditions.baseUnlocName.desc=Item's Unlocalized Name +tooltip.actuallyadditions.meta.desc=Item's Metadata +tooltip.actuallyadditions.nbt.desc=Item's current NBT tooltip.actuallyadditions.unlocName.desc=Meta's Unlocalized Name +tooltip.actuallyadditions.pressShift.desc=Press Shift tooltip.actuallyadditions.disablingInfo.desc=If you don't want this Information to appear, disable it in the Actually Additions Config! tooltip.actuallyadditions.ctrlForMoreInfo.desc=Press CTRL for Advanced Info tooltip.actuallyadditions.extraInfo.desc=Advanced Info From f0046aadc41c58576e53f6ac998023d55530fac5 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 22 Jan 2016 19:40:15 +0100 Subject: [PATCH 22/66] remove todo --- .../de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java index 7da2a0ad3..84329705d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java @@ -24,7 +24,6 @@ import net.minecraftforge.oredict.OreDictionary; import java.util.List; -//TODO Add meta & nbt info public class TooltipEvent{ private static final String ADVANCED_INFO_TEXT_PRE = EnumChatFormatting.DARK_GRAY+" "; From f89c969b24f46aa2bb5167d6bc0da69314e61034 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 22 Jan 2016 21:43:43 +0100 Subject: [PATCH 23/66] remove todo --- .../actuallyadditions/mod/material/InitArmorMaterials.java | 1 - 1 file changed, 1 deletion(-) 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 7157377b7..9a30f371d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitArmorMaterials.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitArmorMaterials.java @@ -30,7 +30,6 @@ public class InitArmorMaterials{ public static void init(){ ModUtil.LOGGER.info("Initializing Armor Materials..."); - //TODO Fix armor textures armorMaterialEmerald = EnumHelper.addArmorMaterial("armorMaterialEmerald", ModUtil.MOD_ID_LOWER+":armorEmerald", 50, new int[]{5, 9, 8, 5}, 15); armorMaterialObsidian = EnumHelper.addArmorMaterial("armorMaterialObsidian", ModUtil.MOD_ID_LOWER+":armorObsidian", 120, new int[]{3, 4, 3, 1}, 10); armorMaterialQuartz = EnumHelper.addArmorMaterial("armorMaterialQuartz", ModUtil.MOD_ID_LOWER+":armorQuartz", 20, new int[]{3, 6, 5, 3}, 8); From 8d59b0119119e1a5437a753db5bc20f51658631f Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 22 Jan 2016 21:48:11 +0100 Subject: [PATCH 24/66] Changing some stuff to the tooltip CTRL thingy so that it looks nicer --- .../actuallyadditions/mod/event/TooltipEvent.java | 10 +++++----- .../resources/assets/actuallyadditions/lang/en_US.lang | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java index 84329705d..2821db6b4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java @@ -61,6 +61,11 @@ public class TooltipEvent{ event.toolTip.add(ADVANCED_INFO_TEXT_PRE+baseName); } + //Metadata + int meta = event.itemStack.getItemDamage(); + event.toolTip.add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".meta.desc")+":"); + event.toolTip.add(ADVANCED_INFO_TEXT_PRE+meta); + //Unlocalized Name String metaName = event.itemStack.getItem().getUnlocalizedName(event.itemStack); if(metaName != null && baseName != null && !metaName.equals(baseName)){ @@ -68,11 +73,6 @@ public class TooltipEvent{ event.toolTip.add(ADVANCED_INFO_TEXT_PRE+metaName); } - //Metadata - int meta = event.itemStack.getItemDamage(); - event.toolTip.add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".meta.desc")+":"); - event.toolTip.add(ADVANCED_INFO_TEXT_PRE+meta); - //NBT NBTTagCompound compound = event.itemStack.getTagCompound(); if(compound != null && !compound.hasNoTags()){ diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index 50df5adb9..480392dce 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -425,8 +425,8 @@ tooltip.actuallyadditions.oredictName.desc=OreDictionary Entries tooltip.actuallyadditions.noOredictNameAvail.desc=None tooltip.actuallyadditions.codeName.desc=Code Name tooltip.actuallyadditions.baseUnlocName.desc=Item's Unlocalized Name -tooltip.actuallyadditions.meta.desc=Item's Metadata -tooltip.actuallyadditions.nbt.desc=Item's current NBT +tooltip.actuallyadditions.meta.desc=Metadata +tooltip.actuallyadditions.nbt.desc=NBT tooltip.actuallyadditions.unlocName.desc=Meta's Unlocalized Name tooltip.actuallyadditions.pressShift.desc=Press Shift tooltip.actuallyadditions.disablingInfo.desc=If you don't want this Information to appear, disable it in the Actually Additions Config! From aa30035cee259afe02040b106490dfacdd633669 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 23 Jan 2016 11:02:35 +0100 Subject: [PATCH 25/66] Added performance settings for bad PCs --- .../actuallyadditions/mod/config/ConfigCategories.java | 1 + .../actuallyadditions/mod/config/ConfigValues.java | 8 ++++++++ .../mod/config/values/ConfigBoolValues.java | 3 --- .../mod/items/ItemChestToCrateUpgrade.java | 5 ++++- .../actuallyadditions/mod/items/ItemLeafBlower.java | 8 +++++--- .../actuallyadditions/mod/items/lens/LensNone.java | 5 ++++- .../mod/tile/TileEntityAtomicReconstructor.java | 7 +++++-- .../actuallyadditions/mod/tile/TileEntityBreaker.java | 5 ++++- .../mod/tile/TileEntityCoffeeMachine.java | 3 ++- .../mod/tile/TileEntityDirectionalBreaker.java | 5 ++++- .../actuallyadditions/mod/tile/TileEntityGrinder.java | 3 ++- .../actuallyadditions/mod/tile/TileEntityLaserRelay.java | 6 +++--- .../mod/tile/TileEntityLeafGenerator.java | 9 +++++++-- .../actuallyadditions/mod/tile/TileEntityMiner.java | 8 ++++++-- .../mod/tile/TileEntityPhantomPlacer.java | 5 ++++- 15 files changed, 59 insertions(+), 22 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigCategories.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigCategories.java index 5633d3056..54c76569e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigCategories.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigCategories.java @@ -12,6 +12,7 @@ package de.ellpeck.actuallyadditions.mod.config; public enum ConfigCategories{ + PERFORMANCE("PERFORMANCE", "Performance Settings"), FOOD_CRAFTING("Food Crafting", "Crafting Recipes for Food Items"), BLOCKS_CRAFTING("Block Crafting", "Crafting Recipes for Blocks"), ITEMS_CRAFTING("Item Crafting", "Crafting Recipes for Items"), diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigValues.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigValues.java index 027c25924..36608a319 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigValues.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigValues.java @@ -33,6 +33,10 @@ public class ConfigValues{ public static String[] minerExtraWhitelist; public static String[] minerBlacklist; + public static boolean lessSound; + public static boolean lessParticles; + public static boolean lessBlockBreakingEffects; + public static void defineConfigValues(Configuration config){ for(ConfigCrafting currConf : craftingConfig){ @@ -53,5 +57,9 @@ public class ConfigValues{ plantDimensionBlacklist = config.get(ConfigCategories.WORLD_GEN.name, "Plant Blacklist", new int[0], "The IDs of the dimensions that Actually Additions Plants (Rice for example) are banned in").getIntList(); minerExtraWhitelist = config.get(ConfigCategories.MACHINE_VALUES.name, "Vertical Digger Extra Whitelist", new String[0], "By default, the Vertical Digger mines everything that starts with 'ore' in the OreDictionary. If there is one that it can't mine, but should be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command. This Config Option only applies if the miner is in Ores Only Mode.").getStringList(); minerBlacklist = config.get(ConfigCategories.MACHINE_VALUES.name, "Vertical Digger Blacklist", new String[0], "By default, the Vertical Digger mines everything that starts with 'ore' in the OreDictionary. If there is one that it can mine, but shouldn't be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command. This Config Option will apply in both modes.").getStringList(); + + lessSound = config.get(ConfigCategories.PERFORMANCE.name, "Less Sound", false, "If blocks in Actually Additions should have less sounds").getBoolean(); + lessParticles = config.get(ConfigCategories.PERFORMANCE.name, "Less Particles", false, "If blocks in Actually Additions should have less particles").getBoolean(); + lessBlockBreakingEffects = config.get(ConfigCategories.PERFORMANCE.name, "Less Block Breaking Effects", false, "If there should not be a sound effect and particles when a block is being destroyed by a breaker or similar").getBoolean(); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigBoolValues.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigBoolValues.java index be7b70a34..2c1f343e2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigBoolValues.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigBoolValues.java @@ -15,8 +15,6 @@ import de.ellpeck.actuallyadditions.mod.config.ConfigurationHandler; public enum ConfigBoolValues{ - LEAF_BLOWER_SOUND("Leaf Blower: Sound", ConfigCategories.TOOL_VALUES, true, "If the Leaf Blower makes Sounds"), - JAM_VILLAGER_EXISTS("Jam Villager: Existence", ConfigCategories.WORLD_GEN, true, "If the Jam Villager and his House exist"), CROP_FIELD_EXISTS("Crop Field: Existence", ConfigCategories.WORLD_GEN, true, "If the Custom Crop Fields exist"), @@ -53,7 +51,6 @@ public enum ConfigBoolValues{ GIVE_BOOKLET_ON_FIRST_CRAFT("Give Booklet on First Craft", ConfigCategories.OTHER, true, "If the booklet should be given to the player when he first crafts something from the Mod"), ENABLE_SEASONAL("Seasonal Mode", ConfigCategories.OTHER, true, "If Seasonal Mode is enabled"), - LESS_LASER_RELAY_PARTICLES("Laser Relay: Particles", ConfigCategories.MACHINE_VALUES, false, "If the Laser Relay should have less laser particles to prevent lag"), DUNGEON_LOOT("Dungeon Loot", ConfigCategories.OTHER, true, "Should Actually Additions Loot spawn in Dungeons"); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemChestToCrateUpgrade.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemChestToCrateUpgrade.java index 98e6e598f..89f748766 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemChestToCrateUpgrade.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemChestToCrateUpgrade.java @@ -11,6 +11,7 @@ package de.ellpeck.actuallyadditions.mod.items; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.config.ConfigValues; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChest; import de.ellpeck.actuallyadditions.mod.util.PosUtil; @@ -51,7 +52,9 @@ public class ItemChestToCrateUpgrade extends ItemBase{ } //Set New Block - world.playAuxSFX(2001, pos, Block.getIdFromBlock(block)+(PosUtil.getMetadata(pos, world) << 12)); + if(!ConfigValues.lessBlockBreakingEffects){ + world.playAuxSFX(2001, pos, Block.getIdFromBlock(block)+(PosUtil.getMetadata(pos, world) << 12)); + } PosUtil.setBlock(pos, world, InitBlocks.blockGiantChest, 0, 2); //Copy Items into new Chest diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLeafBlower.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLeafBlower.java index bf1c922c6..77e77ab4e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLeafBlower.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLeafBlower.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.items; -import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; +import de.ellpeck.actuallyadditions.mod.config.ConfigValues; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import de.ellpeck.actuallyadditions.mod.util.PosUtil; import net.minecraft.block.Block; @@ -66,7 +66,7 @@ public class ItemLeafBlower extends ItemBase{ //Breaks the Blocks this.breakStuff(player.worldObj, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ)); //Plays a Minecart sounds (It really sounds like a Leaf Blower!) - if(ConfigBoolValues.LEAF_BLOWER_SOUND.isEnabled()){ + if(!ConfigValues.lessSound){ player.worldObj.playSoundAtEntity(player, "minecart.base", 0.3F, 0.001F); } } @@ -113,7 +113,9 @@ public class ItemLeafBlower extends ItemBase{ //Deletes the Block world.setBlockToAir(theCoord); //Plays the Breaking Sound - world.playAuxSFX(2001, theCoord, Block.getIdFromBlock(theBlock)+(meta << 12)); + if(!ConfigValues.lessBlockBreakingEffects){ + world.playAuxSFX(2001, theCoord, Block.getIdFromBlock(theBlock)+(meta << 12)); + } for(ItemStack theDrop : drops){ //Drops the Items into the World diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensNone.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensNone.java index d5e6ece46..d37d48401 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensNone.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensNone.java @@ -14,6 +14,7 @@ package de.ellpeck.actuallyadditions.mod.items.lens; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.lens.Lens; import de.ellpeck.actuallyadditions.api.recipe.LensNoneRecipe; +import de.ellpeck.actuallyadditions.mod.config.ConfigValues; import de.ellpeck.actuallyadditions.mod.util.PosUtil; import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; @@ -45,7 +46,9 @@ public class LensNone extends Lens{ if(outputs != null && !outputs.isEmpty()){ ItemStack output = outputs.get(0); if(output.getItem() instanceof ItemBlock){ - tile.getWorldObject().playAuxSFX(2001, pos, Block.getIdFromBlock(PosUtil.getBlock(pos, tile.getWorldObject()))+(PosUtil.getMetadata(pos, tile.getWorldObject()) << 12)); + if(!ConfigValues.lessBlockBreakingEffects){ + tile.getWorldObject().playAuxSFX(2001, pos, Block.getIdFromBlock(PosUtil.getBlock(pos, tile.getWorldObject()))+(PosUtil.getMetadata(pos, tile.getWorldObject()) << 12)); + } PosUtil.setBlock(pos, tile.getWorldObject(), Block.getBlockFromItem(output.getItem()), output.getItemDamage(), 2); } else{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java index 0bd966982..174b604d9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java @@ -15,6 +15,7 @@ import cofh.api.energy.IEnergyReceiver; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.lens.ILensItem; import de.ellpeck.actuallyadditions.api.lens.Lens; +import de.ellpeck.actuallyadditions.mod.config.ConfigValues; import de.ellpeck.actuallyadditions.mod.items.lens.Lenses; import de.ellpeck.actuallyadditions.mod.network.PacketHandler; import de.ellpeck.actuallyadditions.mod.network.PacketParticle; @@ -99,8 +100,10 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple } private void shootLaser(int endX, int endY, int endZ, Lens currentLens){ - this.worldObj.playSoundEffect(this.getX(), this.getY(), this.getZ(), ModUtil.MOD_ID_LOWER+":reconstructor", 0.35F, 1.0F); - PacketHandler.theNetwork.sendToAllAround(new PacketParticle(this.getX(), this.getY(), this.getZ(), endX, endY, endZ, currentLens.getColor(), 8, 2F), new NetworkRegistry.TargetPoint(worldObj.provider.getDimensionId(), this.getX(), this.getY(), this.getZ(), 64)); + if(!ConfigValues.lessSound){ + this.worldObj.playSoundEffect(this.getX(), this.getY(), this.getZ(), ModUtil.MOD_ID_LOWER+":reconstructor", 0.35F, 1.0F); + } + PacketHandler.theNetwork.sendToAllAround(new PacketParticle(this.getX(), this.getY(), this.getZ(), endX, endY, endZ, currentLens.getColor(), ConfigValues.lessParticles ? 2 : 8, 2F), new NetworkRegistry.TargetPoint(worldObj.provider.getDimensionId(), this.getX(), this.getY(), this.getZ(), 64)); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java index f3b5f8f44..009675cbf 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java @@ -11,6 +11,7 @@ package de.ellpeck.actuallyadditions.mod.tile; +import de.ellpeck.actuallyadditions.mod.config.ConfigValues; import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.block.Block; @@ -80,7 +81,9 @@ public class TileEntityBreaker extends TileEntityInventoryBase implements IRedst drops.addAll(blockToBreak.getDrops(worldObj, coordsBlock, worldObj.getBlockState(coordsBlock), 0)); if(WorldUtil.addToInventory(this, drops, false, true)){ - worldObj.playAuxSFX(2001, coordsBlock, Block.getIdFromBlock(blockToBreak)+(meta << 12)); + if(!ConfigValues.lessBlockBreakingEffects){ + worldObj.playAuxSFX(2001, coordsBlock, Block.getIdFromBlock(blockToBreak)+(meta << 12)); + } WorldUtil.breakBlockAtSide(sideToManipulate, worldObj, this.pos); WorldUtil.addToInventory(this, drops, true, true); this.markDirty(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java index 7017dd4d7..e3f11b885 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java @@ -13,6 +13,7 @@ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyReceiver; import de.ellpeck.actuallyadditions.api.recipe.coffee.CoffeeIngredient; +import de.ellpeck.actuallyadditions.mod.config.ConfigValues; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.ItemCoffee; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; @@ -128,7 +129,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements if(!worldObj.isRemote){ if(this.slots[SLOT_INPUT] != null && this.slots[SLOT_INPUT].getItem() == InitItems.itemMisc && this.slots[SLOT_INPUT].getItemDamage() == TheMiscItems.CUP.ordinal() && this.slots[SLOT_OUTPUT] == null && this.coffeeCacheAmount >= CACHE_USE && this.tank.getFluid() != null && this.tank.getFluid().getFluid() == FluidRegistry.WATER && this.tank.getFluidAmount() >= WATER_USE){ if(this.storage.getEnergyStored() >= ENERGY_USED){ - if(this.brewTime%30 == 0){ + if(this.brewTime%30 == 0 && !ConfigValues.lessSound){ this.worldObj.playSoundEffect(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), ModUtil.MOD_ID_LOWER+":coffeeMachine", 0.35F, 1.0F); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java index 255b62b43..b6afd0d03 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java @@ -12,6 +12,7 @@ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyReceiver; +import de.ellpeck.actuallyadditions.mod.config.ConfigValues; import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.block.Block; @@ -76,7 +77,9 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem drops.addAll(blockToBreak.getDrops(worldObj, coordsBlock, worldObj.getBlockState(coordsBlock), 0)); if(WorldUtil.addToInventory(this, drops, false, true)){ - worldObj.playAuxSFX(2001, coordsBlock, Block.getIdFromBlock(blockToBreak)+(meta << 12)); + if(!ConfigValues.lessBlockBreakingEffects){ + worldObj.playAuxSFX(2001, coordsBlock, Block.getIdFromBlock(blockToBreak)+(meta << 12)); + } WorldUtil.breakBlockAtSide(sideToManipulate, worldObj, this.getPos(), i); WorldUtil.addToInventory(this, drops, true, true); this.storage.extractEnergy(ENERGY_USE, false); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java index cb3a03232..2f6cc600d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java @@ -13,6 +13,7 @@ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyReceiver; +import de.ellpeck.actuallyadditions.mod.config.ConfigValues; import de.ellpeck.actuallyadditions.mod.recipe.CrusherRecipeRegistry; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil; @@ -142,7 +143,7 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg this.lastSecondCrush = this.secondCrushTime; } - if(shouldPlaySound){ + if(shouldPlaySound && !ConfigValues.lessSound){ this.worldObj.playSoundEffect(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), ModUtil.MOD_ID_LOWER+":crusher", 0.25F, 1.0F); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java index 977d1e20a..b19304d7f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java @@ -11,7 +11,7 @@ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.IEnergyReceiver; -import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; +import de.ellpeck.actuallyadditions.mod.config.ConfigValues; import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; import de.ellpeck.actuallyadditions.mod.misc.LaserRelayConnectionHandler; import de.ellpeck.actuallyadditions.mod.network.PacketParticle; @@ -41,13 +41,13 @@ public class TileEntityLaserRelay extends TileEntityBase implements IEnergyRecei @SideOnly(Side.CLIENT) public void renderParticles(){ - if(Util.RANDOM.nextInt(ConfigBoolValues.LESS_LASER_RELAY_PARTICLES.isEnabled() ? 15 : 8) == 0){ + if(Util.RANDOM.nextInt(ConfigValues.lessParticles ? 15 : 8) == 0){ BlockPos thisPos = this.pos; LaserRelayConnectionHandler.Network network = LaserRelayConnectionHandler.getInstance().getNetworkFor(thisPos); if(network != null){ for(LaserRelayConnectionHandler.ConnectionPair aPair : network.connections){ if(aPair.contains(thisPos) && PosUtil.areSamePos(thisPos, aPair.firstRelay)){ - PacketParticle.renderParticlesFromAToB(aPair.firstRelay.getX(), aPair.firstRelay.getY(), aPair.firstRelay.getZ(), aPair.secondRelay.getX(), aPair.secondRelay.getY(), aPair.secondRelay.getZ(), ConfigBoolValues.LESS_LASER_RELAY_PARTICLES.isEnabled() ? 1 : Util.RANDOM.nextInt(3)+1, 0.8F, COLOR, 1F); + PacketParticle.renderParticlesFromAToB(aPair.firstRelay.getX(), aPair.firstRelay.getY(), aPair.firstRelay.getZ(), aPair.secondRelay.getX(), aPair.secondRelay.getY(), aPair.secondRelay.getZ(), ConfigValues.lessParticles ? 1 : Util.RANDOM.nextInt(3)+1, 0.8F, COLOR, 1F); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java index c112a7cec..25c61f61a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java @@ -12,6 +12,7 @@ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyProvider; +import de.ellpeck.actuallyadditions.mod.config.ConfigValues; import de.ellpeck.actuallyadditions.mod.network.PacketHandler; import de.ellpeck.actuallyadditions.mod.network.PacketParticle; import de.ellpeck.actuallyadditions.mod.util.PosUtil; @@ -66,13 +67,17 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr Block theBlock = PosUtil.getBlock(theCoord, worldObj); int meta = PosUtil.getMetadata(theCoord, worldObj); - this.worldObj.playAuxSFX(2001, theCoord, Block.getIdFromBlock(theBlock)+(meta << 12)); + if(!ConfigValues.lessBlockBreakingEffects){ + this.worldObj.playAuxSFX(2001, theCoord, Block.getIdFromBlock(theBlock)+(meta << 12)); + } this.worldObj.setBlockToAir(theCoord); this.storage.receiveEnergy(ENERGY_PRODUCED, false); - PacketHandler.theNetwork.sendToAllAround(new PacketParticle(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), theCoord.getX(), theCoord.getY(), theCoord.getZ(), new float[]{62F/255F, 163F/255F, 74F/255F}, 5, 1.0F), new NetworkRegistry.TargetPoint(worldObj.provider.getDimensionId(), this.pos.getX(), this.pos.getY(), this.pos.getZ(), 64)); + if(!ConfigValues.lessParticles){ + PacketHandler.theNetwork.sendToAllAround(new PacketParticle(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), theCoord.getX(), theCoord.getY(), theCoord.getZ(), new float[]{62F/255F, 163F/255F, 74F/255F}, 5, 1.0F), new NetworkRegistry.TargetPoint(worldObj.provider.getDimensionId(), this.pos.getX(), this.pos.getY(), this.pos.getZ(), 64)); + } } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java index dd12287a0..90039a7e2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java @@ -86,7 +86,9 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR drops.addAll(block.getDrops(worldObj, pos, worldObj.getBlockState(pos), 0)); if(WorldUtil.addToInventory(this, drops, false, true)){ - worldObj.playAuxSFX(2001, pos, Block.getIdFromBlock(block)+(meta << 12)); + if(!ConfigValues.lessBlockBreakingEffects){ + worldObj.playAuxSFX(2001, pos, Block.getIdFromBlock(block)+(meta << 12)); + } worldObj.setBlockToAir(pos); WorldUtil.addToInventory(this, drops, true, true); @@ -147,7 +149,9 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR } private void shootParticles(int endX, int endY, int endZ){ - PacketHandler.theNetwork.sendToAllAround(new PacketParticle(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), endX, endY, endZ, new float[]{62F/255F, 163F/255F, 74F/255F}, 5, 1.0F), new NetworkRegistry.TargetPoint(worldObj.provider.getDimensionId(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), 96)); + if(!ConfigValues.lessParticles){ + PacketHandler.theNetwork.sendToAllAround(new PacketParticle(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), endX, endY, endZ, new float[]{62F/255F, 163F/255F, 74F/255F}, 5, 1.0F), new NetworkRegistry.TargetPoint(worldObj.provider.getDimensionId(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), 96)); + } } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java index 272764edc..3a18a51bb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java @@ -11,6 +11,7 @@ package de.ellpeck.actuallyadditions.mod.tile; import de.ellpeck.actuallyadditions.api.tile.IPhantomTile; +import de.ellpeck.actuallyadditions.mod.config.ConfigValues; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.network.PacketParticle; import de.ellpeck.actuallyadditions.mod.util.PosUtil; @@ -105,7 +106,9 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements drops.addAll(blockToBreak.getDrops(worldObj, boundPosition, worldObj.getBlockState(boundPosition), 0)); if(WorldUtil.addToInventory(this, drops, false, true)){ - worldObj.playAuxSFX(2001, this.boundPosition, Block.getIdFromBlock(blockToBreak)+(meta << 12)); + if(!ConfigValues.lessBlockBreakingEffects){ + worldObj.playAuxSFX(2001, this.boundPosition, Block.getIdFromBlock(blockToBreak)+(meta << 12)); + } worldObj.setBlockToAir(this.boundPosition); WorldUtil.addToInventory(this, drops, true, true); this.markDirty(); From 54cc8eedbd99d3a876000cd9a4741fd3e3718e22 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 23 Jan 2016 12:09:29 +0100 Subject: [PATCH 26/66] Remove NEI Recipe Handlers (until it gets properly updated) --- build.gradle | 6 ++-- .../mod/nei/NEIActuallyAdditionsConfig.java | 16 ++------- .../mod/nei/NEIBookletRecipe.java | 28 ++-------------- .../mod/nei/NEICoffeeMachineRecipe.java | 33 ++----------------- .../mod/nei/NEICompostRecipe.java | 26 ++------------- .../mod/nei/NEICrusherRecipe.java | 28 ++-------------- .../mod/nei/NEIFurnaceDoubleRecipe.java | 27 ++------------- .../mod/nei/NEIHairyBallRecipe.java | 26 ++------------- .../mod/nei/NEIReconstructorRecipe.java | 30 ++--------------- .../mod/nei/NEIScreenEvents.java | 15 ++------- .../mod/nei/NEITreasureChestRecipe.java | 26 ++------------- 11 files changed, 32 insertions(+), 229 deletions(-) diff --git a/build.gradle b/build.gradle index 33f316459..691ab961c 100644 --- a/build.gradle +++ b/build.gradle @@ -38,9 +38,9 @@ repositories { } dependencies { - compile "codechicken:CodeChickenLib:1.8-1.1.2.139:dev" - compile "codechicken:CodeChickenCore:1.8-1.0.5.36:dev" - compile "codechicken:NotEnoughItems:1.8-1.0.5.104:dev" + //compile "codechicken:CodeChickenLib:1.8-1.1.2.139:dev" + //compile "codechicken:CodeChickenCore:1.8-1.0.5.36:dev" + //compile "codechicken:NotEnoughItems:1.8-1.0.5.104:dev" deobfCompile "mezz.jei:jei_1.8.9:2.19.0.93" } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIActuallyAdditionsConfig.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIActuallyAdditionsConfig.java index 646910642..37d43ec4d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIActuallyAdditionsConfig.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIActuallyAdditionsConfig.java @@ -10,18 +10,9 @@ package de.ellpeck.actuallyadditions.mod.nei; -import codechicken.nei.api.API; -import codechicken.nei.api.IConfigureNEI; -import codechicken.nei.recipe.DefaultOverlayHandler; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCrafter; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.Util; -import net.minecraft.item.ItemStack; +public class NEIActuallyAdditionsConfig/* implements IConfigureNEI*/{ -public class NEIActuallyAdditionsConfig implements IConfigureNEI{ - - @Override + /*@Override public void loadConfig(){ ModUtil.LOGGER.info("Initializing Not Enough Items Plugin..."); @@ -80,6 +71,5 @@ public class NEIActuallyAdditionsConfig implements IConfigureNEI{ @Override public String getVersion(){ return ModUtil.VERSION; - } - + }*/ } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIBookletRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIBookletRecipe.java index dcffa7320..839347ae2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIBookletRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIBookletRecipe.java @@ -10,33 +10,11 @@ package de.ellpeck.actuallyadditions.mod.nei; -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.RecipeInfo; -import codechicken.nei.recipe.TemplateRecipeHandler; -import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; -import de.ellpeck.actuallyadditions.api.booklet.BookletPage; -import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter; -import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils; -import de.ellpeck.actuallyadditions.mod.booklet.page.PagePicture; -import de.ellpeck.actuallyadditions.mod.util.ItemUtil; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.StringUtil; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; - -import java.awt.*; -import java.util.ArrayList; -import java.util.List; - -public class NEIBookletRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{ +public class NEIBookletRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ public static final String NAME = "actuallyadditions.booklet"; - public NEIBookletRecipe(){ + /*public NEIBookletRecipe(){ RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); } @@ -169,5 +147,5 @@ public class NEIBookletRecipe extends TemplateRecipeHandler implements INEIRecip } return null; } - } + }*/ } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICoffeeMachineRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICoffeeMachineRecipe.java index c4235ef86..cd92dceee 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICoffeeMachineRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICoffeeMachineRecipe.java @@ -10,38 +10,11 @@ package de.ellpeck.actuallyadditions.mod.nei; -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.NEIServerUtils; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.RecipeInfo; -import codechicken.nei.recipe.TemplateRecipeHandler; -import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; -import de.ellpeck.actuallyadditions.api.booklet.BookletPage; -import de.ellpeck.actuallyadditions.api.recipe.coffee.CoffeeBrewing; -import de.ellpeck.actuallyadditions.api.recipe.coffee.CoffeeIngredient; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCoffeeMachine; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.ItemCoffee; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.StringUtil; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.item.ItemStack; - -import java.awt.*; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public class NEICoffeeMachineRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{ +public class NEICoffeeMachineRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ public static final String NAME = "actuallyadditions.coffee"; - public NEICoffeeMachineRecipe(){ + /*public NEICoffeeMachineRecipe(){ super(); RecipeInfo.setGuiOffset(this.getGuiClass(), 35, 3); } @@ -178,5 +151,5 @@ public class NEICoffeeMachineRecipe extends TemplateRecipeHandler implements INE list.add(this.coffeeBeans); return list; } - } + }*/ } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICompostRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICompostRecipe.java index fc7eab9e5..4dff5ca4e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICompostRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICompostRecipe.java @@ -10,31 +10,11 @@ package de.ellpeck.actuallyadditions.mod.nei; -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.NEIServerUtils; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.RecipeInfo; -import codechicken.nei.recipe.TemplateRecipeHandler; -import de.ellpeck.actuallyadditions.api.booklet.BookletPage; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityCompost; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.StringUtil; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.item.ItemStack; - -import java.awt.*; -import java.util.Collections; - -public class NEICompostRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{ +public class NEICompostRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ public static final String NAME = "actuallyadditions.compost"; - public NEICompostRecipe(){ + /*public NEICompostRecipe(){ super(); RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); } @@ -127,5 +107,5 @@ public class NEICompostRecipe extends TemplateRecipeHandler implements INEIRecip public PositionedStack getIngredient(){ return input; } - } + }*/ } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICrusherRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICrusherRecipe.java index 23e12ffd9..6b4569946 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICrusherRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICrusherRecipe.java @@ -10,31 +10,9 @@ package de.ellpeck.actuallyadditions.mod.nei; -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.RecipeInfo; -import codechicken.nei.recipe.TemplateRecipeHandler; -import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; -import de.ellpeck.actuallyadditions.api.booklet.BookletPage; -import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiGrinder; -import de.ellpeck.actuallyadditions.mod.util.ItemUtil; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.StringUtil; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.item.ItemStack; +public class NEICrusherRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ -import java.awt.*; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public class NEICrusherRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{ - - public NEICrusherRecipe(){ + /*public NEICrusherRecipe(){ RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); } @@ -204,5 +182,5 @@ public class NEICrusherRecipe extends TemplateRecipeHandler implements INEIRecip } return list; } - } + }*/ } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIFurnaceDoubleRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIFurnaceDoubleRecipe.java index fd65dcc97..df2d1e05a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIFurnaceDoubleRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIFurnaceDoubleRecipe.java @@ -10,32 +10,11 @@ package de.ellpeck.actuallyadditions.mod.nei; -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.NEIServerUtils; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.RecipeInfo; -import codechicken.nei.recipe.TemplateRecipeHandler; -import de.ellpeck.actuallyadditions.api.booklet.BookletPage; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils; -import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFurnaceDouble; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.StringUtil; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.FurnaceRecipes; - -import java.awt.*; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public class NEIFurnaceDoubleRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{ +public class NEIFurnaceDoubleRecipe /*extends TemplateRecipeHandler implements INEIRecipeHandler*/{ public static final String NAME = "actuallyadditions.furnaceDouble"; - public NEIFurnaceDoubleRecipe(){ + /*public NEIFurnaceDoubleRecipe(){ RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); } @@ -145,5 +124,5 @@ public class NEIFurnaceDoubleRecipe extends TemplateRecipeHandler implements INE public List getIngredients(){ return getCycledIngredients(cycleticks/48, Collections.singletonList(ingredient)); } - } + }*/ } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIHairyBallRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIHairyBallRecipe.java index f25599559..5091b2962 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIHairyBallRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIHairyBallRecipe.java @@ -10,31 +10,11 @@ package de.ellpeck.actuallyadditions.mod.nei; -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.NEIServerUtils; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.RecipeInfo; -import codechicken.nei.recipe.TemplateRecipeHandler; -import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; -import de.ellpeck.actuallyadditions.api.booklet.BookletPage; -import de.ellpeck.actuallyadditions.api.recipe.BallOfFurReturn; -import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.StringUtil; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.item.ItemStack; - -import java.awt.*; -import java.util.Collections; -import java.util.List; - -public class NEIHairyBallRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{ +public class NEIHairyBallRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ public static final String NAME = "actuallyadditions.ballOfHair"; - public NEIHairyBallRecipe(){ + /*public NEIHairyBallRecipe(){ super(); RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); } @@ -148,5 +128,5 @@ public class NEIHairyBallRecipe extends TemplateRecipeHandler implements INEIRec public PositionedStack getIngredient(){ return input; } - } + }*/ } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIReconstructorRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIReconstructorRecipe.java index 2abe18254..5618b8e40 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIReconstructorRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIReconstructorRecipe.java @@ -10,35 +10,11 @@ package de.ellpeck.actuallyadditions.mod.nei; -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.RecipeInfo; -import codechicken.nei.recipe.TemplateRecipeHandler; -import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; -import de.ellpeck.actuallyadditions.api.booklet.BookletPage; -import de.ellpeck.actuallyadditions.api.recipe.LensNoneRecipe; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.lens.LensColor; -import de.ellpeck.actuallyadditions.mod.util.*; -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -import java.awt.*; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public class NEIReconstructorRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{ +public class NEIReconstructorRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ public static final String NAME = "actuallyadditions.reconstructor"; - public NEIReconstructorRecipe(){ + /*public NEIReconstructorRecipe(){ super(); RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); } @@ -192,5 +168,5 @@ public class NEIReconstructorRecipe extends TemplateRecipeHandler implements INE list.addAll(this.getCycledIngredients(cycleticks/48, Collections.singletonList(this.result))); return list; } - } + }*/ } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIScreenEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIScreenEvents.java index 99f2729ac..e18599c9f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIScreenEvents.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIScreenEvents.java @@ -10,25 +10,14 @@ package de.ellpeck.actuallyadditions.mod.nei; -import codechicken.nei.recipe.GuiRecipe; -import codechicken.nei.recipe.IRecipeHandler; -import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; -import de.ellpeck.actuallyadditions.api.booklet.BookletPage; -import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils; -import de.ellpeck.actuallyadditions.mod.booklet.GuiBooklet; import de.ellpeck.actuallyadditions.mod.booklet.button.TexturedButton; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.StringUtil; -import net.minecraft.client.Minecraft; -import net.minecraftforge.client.event.GuiScreenEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class NEIScreenEvents{ private static final int NEI_BUTTON_ID = 123782; private TexturedButton neiButton; - @SuppressWarnings("unchecked") + /*@SuppressWarnings("unchecked") @SubscribeEvent public void onInitGuiForNEI(GuiScreenEvent.InitGuiEvent event){ if(event.gui instanceof GuiRecipe){ @@ -75,5 +64,5 @@ public class NEIScreenEvents{ } } } - } + }*/ } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEITreasureChestRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEITreasureChestRecipe.java index 58486bd8d..4c21fddd2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEITreasureChestRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEITreasureChestRecipe.java @@ -10,31 +10,11 @@ package de.ellpeck.actuallyadditions.mod.nei; -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.NEIServerUtils; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.RecipeInfo; -import codechicken.nei.recipe.TemplateRecipeHandler; -import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; -import de.ellpeck.actuallyadditions.api.booklet.BookletPage; -import de.ellpeck.actuallyadditions.api.recipe.TreasureChestLoot; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.StringUtil; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.item.ItemStack; - -import java.awt.*; -import java.util.Collections; -import java.util.List; - -public class NEITreasureChestRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{ +public class NEITreasureChestRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ public static final String NAME = "actuallyadditions.treasureChest"; - public NEITreasureChestRecipe(){ + /*public NEITreasureChestRecipe(){ super(); RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); } @@ -150,5 +130,5 @@ public class NEITreasureChestRecipe extends TemplateRecipeHandler implements INE public PositionedStack getIngredient(){ return input; } - } + }*/ } \ No newline at end of file From 8e7422df0f7a75600431ffa257d89d60c33ff4d7 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 23 Jan 2016 12:20:06 +0100 Subject: [PATCH 27/66] no --- .../resources/assets/actuallyadditions/lang/en_US.lang | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index 480392dce..d999bd5b1 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -164,10 +164,10 @@ tile.actuallyadditions.blockAtomicReconstructor.info.1.5=Tiny Bit tile.actuallyadditions.blockAtomicReconstructor.info.1.6=Component tile.actuallyadditions.blockAtomicReconstructor.info.1.7=Vittle tile.actuallyadditions.blockAtomicReconstructor.info.1.8=Transmaterial -tile.actuallyadditions.blockAtomicReconstructor.info.1.9=Part -tile.actuallyadditions.blockAtomicReconstructor.info.1.10=Jimmie -tile.actuallyadditions.blockAtomicReconstructor.info.1.11=Chit -tile.actuallyadditions.blockAtomicReconstructor.info.1.12=Cube +tile.actuallyadditions.blockAtomicReconstructor.info.1.9=Partial +tile.actuallyadditions.blockAtomicReconstructor.info.1.10=Spatial +tile.actuallyadditions.blockAtomicReconstructor.info.1.11=Stuffy +tile.actuallyadditions.blockAtomicReconstructor.info.1.12=Interdimensional tile.actuallyadditions.blockAtomicReconstructor.info.2.1=Recombobulizer tile.actuallyadditions.blockAtomicReconstructor.info.2.2=Shiftulator @@ -182,7 +182,7 @@ tile.actuallyadditions.blockAtomicReconstructor.info.2.10=Swapper tile.actuallyadditions.blockAtomicReconstructor.info.2.11=Exchanger tile.actuallyadditions.blockAtomicReconstructor.info.2.12=Replacer tile.actuallyadditions.blockAtomicReconstructor.info.2.13=Differentiator -tile.actuallyadditions.blockAtomicReconstructor.info.2.14=Rustler +tile.actuallyadditions.blockAtomicReconstructor.info.2.14=Receiver #Items item.actuallyadditions.itemDrill.name=Drill From ca68c1afea1ef3d857d1a477344877a5c20920eb Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 23 Jan 2016 14:26:42 +0100 Subject: [PATCH 28/66] updated forge and jei --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 691ab961c..e69289c47 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ group = "de.ellpeck.actuallyadditions" archivesBaseName = "ActuallyAdditions" minecraft { - version = "1.8.9-11.15.0.1697" + version = "1.8.9-11.15.0.1715" runDir = "idea" mappings = "stable_20" @@ -42,7 +42,7 @@ dependencies { //compile "codechicken:CodeChickenCore:1.8-1.0.5.36:dev" //compile "codechicken:NotEnoughItems:1.8-1.0.5.104:dev" - deobfCompile "mezz.jei:jei_1.8.9:2.19.0.93" + deobfCompile "mezz.jei:jei_1.8.9:2.22.3.105" } processResources { From 313c71647186c22e05236595e972ff80779efebb Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 23 Jan 2016 15:26:31 +0100 Subject: [PATCH 29/66] Remove textures to be mae file --- TexturesToBeMade.txt | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 TexturesToBeMade.txt diff --git a/TexturesToBeMade.txt b/TexturesToBeMade.txt deleted file mode 100644 index 67b773e2c..000000000 --- a/TexturesToBeMade.txt +++ /dev/null @@ -1,5 +0,0 @@ -Textures to be made --------------------------------------------------------------------------------------------------------------- -This file is a reminder to Glenthor for what textures he should make or change. -If you want to give making some of these textures a go, go ahead and make a pull request when you're done. --------------------------------------------------------------------------------------------------------------- \ No newline at end of file From fbc5c5240d3715d28b37db9d41dab140cfdee02f Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 23 Jan 2016 22:58:40 +0100 Subject: [PATCH 30/66] Rebalanced canola oil again. Because people were annoying me again. --- .../de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java | 2 +- .../actuallyadditions/mod/tile/TileEntityCanolaPress.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java index 358e51ba8..27d9dacd5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java @@ -162,7 +162,7 @@ public class InitBlocks{ blockFermentingBarrel = new BlockFermentingBarrel("blockFermentingBarrel"); blockRice = new BlockPlant("blockRice", 1, 2); CompatUtil.registerMFRPlant(blockRice); - blockCanola = new BlockPlant("blockCanola", 5, 5); + blockCanola = new BlockPlant("blockCanola", 2, 3); CompatUtil.registerMFRPlant(blockCanola); blockFlax = new BlockPlant("blockFlax", 2, 4); CompatUtil.registerMFRPlant(blockFlax); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java index 9b58198f5..e41b76028 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java @@ -26,7 +26,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class TileEntityCanolaPress extends TileEntityInventoryBase implements IEnergyReceiver, IFluidHandler, IEnergySaver, IFluidSaver{ - public static final int PRODUCE = 120; + public static final int PRODUCE = 80; public static final int ENERGY_USE = 35; private static final int TIME = 30; public EnergyStorage storage = new EnergyStorage(40000); From 7a6fda911f06a1e8f96124bf7ab4f94867169fe3 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 23 Jan 2016 23:29:19 +0100 Subject: [PATCH 31/66] Use getStateID for playAuxSFX --- .../mod/items/ItemChestToCrateUpgrade.java | 2 +- .../actuallyadditions/mod/items/ItemLeafBlower.java | 8 ++++---- .../actuallyadditions/mod/items/lens/LensNone.java | 2 +- .../actuallyadditions/mod/tile/TileEntityBreaker.java | 2 +- .../mod/tile/TileEntityDirectionalBreaker.java | 3 +-- .../mod/tile/TileEntityLeafGenerator.java | 4 +--- .../actuallyadditions/mod/tile/TileEntityMiner.java | 2 +- .../mod/tile/TileEntityPhantomPlacer.java | 3 +-- .../de/ellpeck/actuallyadditions/mod/util/WorldUtil.java | 2 +- 9 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemChestToCrateUpgrade.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemChestToCrateUpgrade.java index 89f748766..41ee8bbe8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemChestToCrateUpgrade.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemChestToCrateUpgrade.java @@ -53,7 +53,7 @@ public class ItemChestToCrateUpgrade extends ItemBase{ //Set New Block if(!ConfigValues.lessBlockBreakingEffects){ - world.playAuxSFX(2001, pos, Block.getIdFromBlock(block)+(PosUtil.getMetadata(pos, world) << 12)); + world.playAuxSFX(2001, pos, Block.getStateId(world.getBlockState(pos))); } PosUtil.setBlock(pos, world, InitBlocks.blockGiantChest, 0, 2); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLeafBlower.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLeafBlower.java index 77e77ab4e..82ac810a9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLeafBlower.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLeafBlower.java @@ -106,17 +106,17 @@ public class ItemLeafBlower extends ItemBase{ Block theBlock = PosUtil.getBlock(theCoord, world); ArrayList drops = new ArrayList(); - int meta = PosUtil.getMetadata(theCoord, world); //Gets all of the Drops the Block should have drops.addAll(theBlock.getDrops(world, theCoord, world.getBlockState(theCoord), 0)); - //Deletes the Block - world.setBlockToAir(theCoord); //Plays the Breaking Sound if(!ConfigValues.lessBlockBreakingEffects){ - world.playAuxSFX(2001, theCoord, Block.getIdFromBlock(theBlock)+(meta << 12)); + world.playAuxSFX(2001, theCoord, Block.getStateId(world.getBlockState(theCoord))); } + //Deletes the Block + world.setBlockToAir(theCoord); + for(ItemStack theDrop : drops){ //Drops the Items into the World world.spawnEntityInWorld(new EntityItem(world, theCoord.getX()+0.5, theCoord.getY()+0.5, theCoord.getZ()+0.5, theDrop)); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensNone.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensNone.java index d37d48401..c3c277920 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensNone.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensNone.java @@ -47,7 +47,7 @@ public class LensNone extends Lens{ ItemStack output = outputs.get(0); if(output.getItem() instanceof ItemBlock){ if(!ConfigValues.lessBlockBreakingEffects){ - tile.getWorldObject().playAuxSFX(2001, pos, Block.getIdFromBlock(PosUtil.getBlock(pos, tile.getWorldObject()))+(PosUtil.getMetadata(pos, tile.getWorldObject()) << 12)); + tile.getWorldObject().playAuxSFX(2001, pos, Block.getStateId(tile.getWorldObject().getBlockState(pos))); } PosUtil.setBlock(pos, tile.getWorldObject(), Block.getBlockFromItem(output.getItem()), output.getItemDamage(), 2); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java index 009675cbf..8085ae47d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java @@ -82,7 +82,7 @@ public class TileEntityBreaker extends TileEntityInventoryBase implements IRedst if(WorldUtil.addToInventory(this, drops, false, true)){ if(!ConfigValues.lessBlockBreakingEffects){ - worldObj.playAuxSFX(2001, coordsBlock, Block.getIdFromBlock(blockToBreak)+(meta << 12)); + worldObj.playAuxSFX(2001, coordsBlock, Block.getStateId(worldObj.getBlockState(coordsBlock))); } WorldUtil.breakBlockAtSide(sideToManipulate, worldObj, this.pos); WorldUtil.addToInventory(this, drops, true, true); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java index b6afd0d03..b450e7f4d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java @@ -73,12 +73,11 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem Block blockToBreak = PosUtil.getBlock(coordsBlock, worldObj); if(blockToBreak != null && !(blockToBreak instanceof BlockAir) && blockToBreak.getBlockHardness(worldObj, pos) > -1.0F){ ArrayList drops = new ArrayList(); - int meta = PosUtil.getMetadata(coordsBlock, worldObj); drops.addAll(blockToBreak.getDrops(worldObj, coordsBlock, worldObj.getBlockState(coordsBlock), 0)); if(WorldUtil.addToInventory(this, drops, false, true)){ if(!ConfigValues.lessBlockBreakingEffects){ - worldObj.playAuxSFX(2001, coordsBlock, Block.getIdFromBlock(blockToBreak)+(meta << 12)); + worldObj.playAuxSFX(2001, coordsBlock, Block.getStateId(worldObj.getBlockState(coordsBlock))); } WorldUtil.breakBlockAtSide(sideToManipulate, worldObj, this.getPos(), i); WorldUtil.addToInventory(this, drops, true, true); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java index 25c61f61a..713f48334 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java @@ -65,10 +65,8 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr Collections.shuffle(breakPositions); BlockPos theCoord = breakPositions.get(0); - Block theBlock = PosUtil.getBlock(theCoord, worldObj); - int meta = PosUtil.getMetadata(theCoord, worldObj); if(!ConfigValues.lessBlockBreakingEffects){ - this.worldObj.playAuxSFX(2001, theCoord, Block.getIdFromBlock(theBlock)+(meta << 12)); + this.worldObj.playAuxSFX(2001, theCoord, Block.getStateId(worldObj.getBlockState(theCoord))); } this.worldObj.setBlockToAir(theCoord); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java index 90039a7e2..d9e1b84ea 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java @@ -87,7 +87,7 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR if(WorldUtil.addToInventory(this, drops, false, true)){ if(!ConfigValues.lessBlockBreakingEffects){ - worldObj.playAuxSFX(2001, pos, Block.getIdFromBlock(block)+(meta << 12)); + worldObj.playAuxSFX(2001, pos, Block.getStateId(worldObj.getBlockState(pos))); } worldObj.setBlockToAir(pos); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java index 3a18a51bb..d79cf8c6c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java @@ -102,12 +102,11 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements Block blockToBreak = PosUtil.getBlock(boundPosition, worldObj); if(blockToBreak != null && blockToBreak.getBlockHardness(worldObj, boundPosition) > -1.0F){ ArrayList drops = new ArrayList(); - int meta = PosUtil.getMetadata(boundPosition, worldObj); drops.addAll(blockToBreak.getDrops(worldObj, boundPosition, worldObj.getBlockState(boundPosition), 0)); if(WorldUtil.addToInventory(this, drops, false, true)){ if(!ConfigValues.lessBlockBreakingEffects){ - worldObj.playAuxSFX(2001, this.boundPosition, Block.getIdFromBlock(blockToBreak)+(meta << 12)); + worldObj.playAuxSFX(2001, this.boundPosition, Block.getStateId(worldObj.getBlockState(this.boundPosition))); } worldObj.setBlockToAir(this.boundPosition); WorldUtil.addToInventory(this, drops, true, true); 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 8ec780ae5..642563d5b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java @@ -366,7 +366,7 @@ public class WorldUtil{ } else{ //Shows the Harvest Particles and plays the Block's Sound - world.playAuxSFX(2001, pos, Block.getIdFromBlock(block)+(meta << 12)); + world.playAuxSFX(2001, pos, Block.getStateId(state)); } //If the Block was actually "removed", meaning it will drop an Item From 235d86ab8c8e99f08ec38483ae086d8f452a3a91 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 25 Jan 2016 13:34:55 +0100 Subject: [PATCH 32/66] Semi-implemented new item system I guess? --- build.gradle | 2 +- .../mod/tile/TileEntityInventoryBase.java | 28 ++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index e69289c47..0d0ec81ee 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ group = "de.ellpeck.actuallyadditions" archivesBaseName = "ActuallyAdditions" minecraft { - version = "1.8.9-11.15.0.1715" + version = "1.8.9-11.15.0.1718" runDir = "idea" mappings = "stable_20" diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java index 17b84f55c..b71af5608 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java @@ -11,22 +11,37 @@ package de.ellpeck.actuallyadditions.mod.tile; import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumFacing; import net.minecraft.util.IChatComponent; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.wrapper.SidedInvWrapper; + +import java.util.HashMap; +import java.util.Map; public abstract class TileEntityInventoryBase extends TileEntityBase implements ISidedInventory{ public ItemStack slots[]; public String name; + private Map itemHandlers = new HashMap(); + public TileEntityInventoryBase(int slots, String name){ this.initializeSlots(slots); this.name = "container."+ModUtil.MOD_ID_LOWER+"."+name; + + for(EnumFacing facing : EnumFacing.values()){ + this.itemHandlers.put(facing, new SidedInvWrapper(this, facing)); + } } public void initializeSlots(int itemAmount){ @@ -198,6 +213,17 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements @Override public IChatComponent getDisplayName(){ - return null; + return new ChatComponentText(StringUtil.localize(this.getName())); } + + @Override + public T getCapability(Capability capability, EnumFacing facing){ + if(facing != null && capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY){ + return (T)this.itemHandlers.get(facing); + } + else{ + return super.getCapability(capability, facing); + } + } + } From a2d719300378d093ac79ed4a1c4d871128e471fd Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 25 Jan 2016 13:42:37 +0100 Subject: [PATCH 33/66] Capabilities for Phantomfaces --- .../mod/tile/TileEntityPhantomItemface.java | 12 ++++++++++++ .../mod/tile/TileEntityPhantomface.java | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java index fd8a5541f..8b81c3962 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java @@ -16,6 +16,7 @@ import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.capabilities.Capability; public class TileEntityPhantomItemface extends TileEntityPhantomface{ @@ -122,4 +123,15 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{ this.getInventory().clear(); } } + + @Override + public T getCapability(Capability capability, EnumFacing facing){ + if(this.isBoundThingInRange()){ + TileEntity tile = worldObj.getTileEntity(this.boundPosition); + if(tile != null){ + return tile.getCapability(capability, facing); + } + } + return super.getCapability(capability, facing); + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java index d93fc32c0..6fdecdc56 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java @@ -23,6 +23,9 @@ import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumParticleTypes; import net.minecraft.world.World; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.CapabilityDispatcher; +import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -37,8 +40,12 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP private BlockPos boundPosBefore; private Block boundBlockBefore; + private CapabilityDispatcher capabilities; + public TileEntityPhantomface(String name){ super(0, name); + + this.capabilities = ForgeEventFactory.gatherCapabilities(this); } @Override @@ -181,4 +188,9 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP public boolean isItemValidForSlot(int slot, ItemStack stack){ return false; } + + @Override + public T getCapability(Capability capability, EnumFacing facing){ + return this.capabilities.getCapability(capability, facing); + } } From bb0338dd551a0be84cfba16f54ba8b0b7fea1ecd Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 25 Jan 2016 19:05:01 +0100 Subject: [PATCH 34/66] //TODO make this work for the stupid new system --- .../mod/tile/TileEntityInputter.java | 23 +++++++++++++++++-- .../actuallyadditions/mod/util/WorldUtil.java | 1 + 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java index 70f672209..b63b9cec8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java @@ -82,10 +82,24 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt this.markDirty(); } + private boolean newPull(){ + //TODO make this work for the stupid new system + return false; + } + + private boolean newPut(){ + //TODO make this work for the stupid new system + return false; + } + /** * Pulls Items from the specified Slots on the specified Side */ - public void pull(){ + private void pull(){ + if(this.newPull()){ + return; + } + //The Inventory to pull from IInventory theInventory = (IInventory)placeToPull; //Does the Inventory even have Slots!? @@ -184,7 +198,11 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt * Puts Items into the specified Slots at the specified Side * (Check pull() for Description, similar to this) */ - public void put(){ + private void put(){ + if(this.newPut()){ + return; + } + IInventory theInventory = (IInventory)placeToPut; if(theInventory.getSizeInventory() > 0){ int theSlotToPut = this.slotToPutStart; @@ -229,6 +247,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt } } if(can){ + System.out.println("Putting old"); if(theStack != null){ ItemStack copiedStack = theStack.copy(); if(copiedStack.isItemEqual(this.slots[0])){ 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 642563d5b..1026607b4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java @@ -243,6 +243,7 @@ public class WorldUtil{ return blocks; } + //TODO make this work for the stupid new system /** * Add an ArrayList of ItemStacks to an Array of slots * From 3c108e3cc9bc65fd73a308e39355cfb2ecc6d908 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 25 Jan 2016 19:33:54 +0100 Subject: [PATCH 35/66] Remove debug output --- .../ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java index b63b9cec8..a6751c5c5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java @@ -247,7 +247,6 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt } } if(can){ - System.out.println("Putting old"); if(theStack != null){ ItemStack copiedStack = theStack.copy(); if(copiedStack.isItemEqual(this.slots[0])){ From a452d9a13f8e3134156832190ff3641b685a7a89 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 25 Jan 2016 22:59:13 +0100 Subject: [PATCH 36/66] Update forge. IInventory is still not deprecated. Fuck this. --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 0d0ec81ee..e1ab405b6 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ group = "de.ellpeck.actuallyadditions" archivesBaseName = "ActuallyAdditions" minecraft { - version = "1.8.9-11.15.0.1718" + version = "1.8.9-11.15.1.1722" runDir = "idea" mappings = "stable_20" From 3f958a07261171acdf65b2450071edc01f0a2d30 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 27 Jan 2016 18:22:44 +0100 Subject: [PATCH 37/66] I don't even know the person But I'm a nice person. --- .../de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 1cd95e0d5..a8ece55bb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java @@ -21,6 +21,7 @@ import de.ellpeck.actuallyadditions.mod.event.InitEvents; import de.ellpeck.actuallyadditions.mod.misc.special.SpecialRenderInit; import de.ellpeck.actuallyadditions.mod.util.FluidStateMapper; import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.playerdata.PersistentClientData; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; @@ -63,7 +64,7 @@ public class ClientProxy implements IProxy{ Calendar c = Calendar.getInstance(); pumpkinBlurPumpkinBlur = c.get(Calendar.MONTH) == Calendar.OCTOBER; jingleAllTheWay = c.get(Calendar.MONTH) == Calendar.DECEMBER && c.get(Calendar.DAY_OF_MONTH) >= 6 && c.get(Calendar.DAY_OF_MONTH) <= 26; - bulletForMyValentine = c.get(Calendar.MONTH) == Calendar.FEBRUARY && c.get(Calendar.DAY_OF_MONTH) >= 12 && c.get(Calendar.DAY_OF_MONTH) <= 16; + bulletForMyValentine = (c.get(Calendar.MONTH) == Calendar.FEBRUARY && c.get(Calendar.DAY_OF_MONTH) >= 12 && c.get(Calendar.DAY_OF_MONTH) <= 16) || StringUtil.equalsToLowerCase(Minecraft.getMinecraft().getSession().getUsername(), "pinkhrya"); } else{ ModUtil.LOGGER.warn("You have turned Seasonal Mode off. Therefore, you are evil."); From 4630c39a136cbcb593a9ad1a940484f21f13d7e0 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 29 Jan 2016 17:38:31 +0100 Subject: [PATCH 38/66] Move Fluids to InitFluids --- .../mod/ActuallyAdditions.java | 2 + .../mod/blocks/InitBlocks.java | 59 --------------- .../mod/event/BucketFillEvent.java | 6 +- .../mod/{blocks => fluids}/FluidAA.java | 2 +- .../mod/fluids/InitFluids.java | 75 +++++++++++++++++++ .../mod/inventory/ContainerCanolaPress.java | 4 +- .../inventory/ContainerFermentingBarrel.java | 6 +- .../mod/inventory/ContainerOilGenerator.java | 4 +- .../mod/items/InitItems.java | 9 ++- .../mod/proxy/ClientProxy.java | 6 +- .../mod/tile/TileEntityCanolaPress.java | 8 +- .../mod/tile/TileEntityFermentingBarrel.java | 18 ++--- .../mod/tile/TileEntityOilGenerator.java | 10 +-- 13 files changed, 114 insertions(+), 95 deletions(-) rename src/main/java/de/ellpeck/actuallyadditions/mod/{blocks => fluids}/FluidAA.java (94%) create mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java index 3df0cc7b9..bbd2131d6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java @@ -18,6 +18,7 @@ import de.ellpeck.actuallyadditions.mod.crafting.CrusherCrafting; import de.ellpeck.actuallyadditions.mod.crafting.InitCrafting; import de.ellpeck.actuallyadditions.mod.crafting.ItemCrafting; import de.ellpeck.actuallyadditions.mod.event.InitEvents; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.gen.InitVillager; import de.ellpeck.actuallyadditions.mod.gen.OreGen; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; @@ -68,6 +69,7 @@ public class ActuallyAdditions{ InitToolMaterials.init(); InitArmorMaterials.init(); InitBlocks.init(); + InitFluids.init(); InitItems.init(); FuelHandler.init(); UpdateChecker.init(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java index 27d9dacd5..4b4d7e727 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java @@ -10,19 +10,13 @@ package de.ellpeck.actuallyadditions.mod.blocks; -import de.ellpeck.actuallyadditions.mod.blocks.base.BlockFluidFlowing; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockPlant; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockStair; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockWallAA; import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks; -import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.util.CompatUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.item.EnumRarity; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; public class InitBlocks{ @@ -52,11 +46,6 @@ public class InitBlocks{ public static Block blockFlax; public static Block blockCoffee; - public static Fluid fluidCanolaOil; - public static Block blockCanolaOil; - public static Fluid fluidOil; - public static Block blockOil; - public static Block blockCanolaPress; public static Block blockFermentingBarrel; @@ -199,53 +188,5 @@ public class InitBlocks{ blockQuartzSlab = new BlockSlabs("blockQuartzSlab", blockMisc, TheMiscBlocks.QUARTZ.ordinal()); blockChiseledQuartzSlab = new BlockSlabs("blockChiseledQuartzSlab", blockMisc, TheMiscBlocks.QUARTZ_CHISELED.ordinal()); blockPillarQuartzSlab = new BlockSlabs("blockPillarQuartzSlab", blockMisc, TheMiscBlocks.QUARTZ_PILLAR.ordinal()); - - registerFluids(); - } - - public static void registerFluids(){ - //Canola Fluid - String canolaOil = "canolaoil"; - if(!FluidRegistry.isFluidRegistered(canolaOil) || ConfigBoolValues.PREVENT_CANOLA_OVERRIDE.isEnabled()){ - fluidCanolaOil = new FluidAA(canolaOil, "blockCanolaOil").setRarity(EnumRarity.UNCOMMON); - FluidRegistry.registerFluid(fluidCanolaOil); - } - else{ - errorAlreadyRegistered("Canola Oil Fluid"); - } - fluidCanolaOil = FluidRegistry.getFluid(canolaOil); - - //Canola Block - if(fluidCanolaOil.getBlock() == null || ConfigBoolValues.PREVENT_CANOLA_BLOCK_OVERRIDE.isEnabled()){ - blockCanolaOil = new BlockFluidFlowing(fluidCanolaOil, Material.water, "blockCanolaOil"); - } - else{ - errorAlreadyRegistered("Canola Oil Block"); - } - blockCanolaOil = fluidCanolaOil.getBlock(); - - //Oil Fluid - String oil = "oil"; - if(!FluidRegistry.isFluidRegistered(oil) || ConfigBoolValues.PREVENT_OIL_OVERRIDE.isEnabled()){ - fluidOil = new FluidAA(oil, "blockOil").setRarity(EnumRarity.UNCOMMON); - FluidRegistry.registerFluid(fluidOil); - } - else{ - errorAlreadyRegistered("Oil Fluid"); - } - fluidOil = FluidRegistry.getFluid(oil); - - //Oil Block - if(fluidOil.getBlock() == null || ConfigBoolValues.PREVENT_OIL_BLOCK_OVERRIDE.isEnabled()){ - blockOil = new BlockFluidFlowing(fluidOil, Material.water, "blockOil"); - } - else{ - errorAlreadyRegistered("Oil Block"); - } - blockOil = fluidOil.getBlock(); - } - - public static void errorAlreadyRegistered(String str){ - ModUtil.LOGGER.warn(str+" from "+ModUtil.NAME+" is not getting used as it has already been registered by another Mod! If this causes Issues (which it shouldn't!), you can turn this off in the Config File!"); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/BucketFillEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/BucketFillEvent.java index 5d6bb78ae..f86ab2dfe 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/BucketFillEvent.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/BucketFillEvent.java @@ -11,7 +11,7 @@ package de.ellpeck.actuallyadditions.mod.event; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.util.PosUtil; import net.minecraft.block.Block; @@ -25,8 +25,8 @@ public class BucketFillEvent{ @SubscribeEvent public void onBucketFilled(FillBucketEvent event){ - this.fillBucket(event, InitItems.itemBucketOil, InitBlocks.blockOil); - this.fillBucket(event, InitItems.itemBucketCanolaOil, InitBlocks.blockCanolaOil); + this.fillBucket(event, InitItems.itemBucketOil, InitFluids.blockOil); + this.fillBucket(event, InitItems.itemBucketCanolaOil, InitFluids.blockCanolaOil); } private void fillBucket(FillBucketEvent event, Item item, Block fluid){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/FluidAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/FluidAA.java similarity index 94% rename from src/main/java/de/ellpeck/actuallyadditions/mod/blocks/FluidAA.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/fluids/FluidAA.java index e38856c67..c71e0a1a6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/FluidAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/FluidAA.java @@ -8,7 +8,7 @@ * © 2016 Ellpeck */ -package de.ellpeck.actuallyadditions.mod.blocks; +package de.ellpeck.actuallyadditions.mod.fluids; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import net.minecraft.util.ResourceLocation; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java new file mode 100644 index 000000000..0bab1171f --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java @@ -0,0 +1,75 @@ +/* + * This file ("InitFluids.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 + * + * © 2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.fluids; + +import de.ellpeck.actuallyadditions.mod.blocks.base.BlockFluidFlowing; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; +import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.item.EnumRarity; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; + +public class InitFluids{ + + public static Fluid fluidCanolaOil; + public static Fluid fluidOil; + + public static Block blockCanolaOil; + public static Block blockOil; + + public static void init(){ + //Canola Fluid + String canolaOil = "canolaoil"; + if(!FluidRegistry.isFluidRegistered(canolaOil) || ConfigBoolValues.PREVENT_CANOLA_OVERRIDE.isEnabled()){ + fluidCanolaOil = new FluidAA(canolaOil, "blockCanolaOil").setRarity(EnumRarity.UNCOMMON); + FluidRegistry.registerFluid(fluidCanolaOil); + } + else{ + errorAlreadyRegistered("Canola Oil Fluid"); + } + fluidCanolaOil = FluidRegistry.getFluid(canolaOil); + + //Canola Block + if(fluidCanolaOil.getBlock() == null || ConfigBoolValues.PREVENT_CANOLA_BLOCK_OVERRIDE.isEnabled()){ + blockCanolaOil = new BlockFluidFlowing(fluidCanolaOil, Material.water, "blockCanolaOil"); + } + else{ + errorAlreadyRegistered("Canola Oil Block"); + } + blockCanolaOil = fluidCanolaOil.getBlock(); + + //Oil Fluid + String oil = "oil"; + if(!FluidRegistry.isFluidRegistered(oil) || ConfigBoolValues.PREVENT_OIL_OVERRIDE.isEnabled()){ + fluidOil = new FluidAA(oil, "blockOil").setRarity(EnumRarity.UNCOMMON); + FluidRegistry.registerFluid(fluidOil); + } + else{ + errorAlreadyRegistered("Oil Fluid"); + } + fluidOil = FluidRegistry.getFluid(oil); + + //Oil Block + if(fluidOil.getBlock() == null || ConfigBoolValues.PREVENT_OIL_BLOCK_OVERRIDE.isEnabled()){ + blockOil = new BlockFluidFlowing(fluidOil, Material.water, "blockOil"); + } + else{ + errorAlreadyRegistered("Oil Block"); + } + blockOil = fluidOil.getBlock(); + } + + public static void errorAlreadyRegistered(String str){ + ModUtil.LOGGER.warn(str+" from "+ModUtil.NAME+" is not getting used as it has already been registered by another Mod! If this causes Issues (which it shouldn't!), you can turn this off in the Config File!"); + } +} 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 741f35f77..dc636f81f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.inventory; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; @@ -68,7 +68,7 @@ public class ContainerCanolaPress extends Container{ return null; } } - else if(FluidContainerRegistry.getContainerCapacity(new FluidStack(InitBlocks.fluidCanolaOil, 1), newStack) > 0){ + else if(FluidContainerRegistry.getContainerCapacity(new FluidStack(InitFluids.fluidCanolaOil, 1), newStack) > 0){ if(!this.mergeItemStack(newStack, 1, 2, false)){ return null; } 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 02cd7b5c0..6a23ad5df 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.inventory; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFermentingBarrel; @@ -62,12 +62,12 @@ public class ContainerFermentingBarrel extends Container{ //Other Slots in Inventory excluded if(slot >= inventoryStart){ //Shift from Inventory - if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(InitBlocks.fluidCanolaOil, 1))){ + if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(InitFluids.fluidCanolaOil, 1))){ if(!this.mergeItemStack(newStack, 0, 1, false)){ return null; } } - else if(FluidContainerRegistry.getContainerCapacity(new FluidStack(InitBlocks.fluidOil, 1), newStack) > 0){ + else if(FluidContainerRegistry.getContainerCapacity(new FluidStack(InitFluids.fluidOil, 1), newStack) > 0){ if(!this.mergeItemStack(newStack, 2, 3, false)){ return null; } 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 657eafe44..a41d04864 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.inventory; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator; @@ -60,7 +60,7 @@ public class ContainerOilGenerator extends Container{ //Other Slots in Inventory excluded if(slot >= inventoryStart){ //Shift from Inventory - if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(InitBlocks.fluidOil, 1))){ + if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(InitFluids.fluidOil, 1))){ if(!this.mergeItemStack(newStack, 0, 1, false)){ return null; } 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 3cd12087b..94b8deb70 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java @@ -11,6 +11,7 @@ package de.ellpeck.actuallyadditions.mod.items; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.items.base.*; import de.ellpeck.actuallyadditions.mod.items.lens.ItemLens; import de.ellpeck.actuallyadditions.mod.items.lens.Lenses; @@ -248,10 +249,10 @@ public class InitItems{ itemDrillUpgradeThreeByThree = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.THREE_BY_THREE, "itemDrillUpgradeThreeByThree"); itemDrillUpgradeFiveByFive = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE, "itemDrillUpgradeFiveByFive"); itemDrillUpgradeBlockPlacing = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.PLACER, "itemDrillUpgradeBlockPlacing"); - itemBucketOil = new ItemBucketAA(InitBlocks.blockOil, "itemBucketOil"); - FluidContainerRegistry.registerFluidContainer(InitBlocks.fluidOil, new ItemStack(itemBucketOil), FluidContainerRegistry.EMPTY_BUCKET); - itemBucketCanolaOil = new ItemBucketAA(InitBlocks.blockCanolaOil, "itemBucketCanolaOil"); - FluidContainerRegistry.registerFluidContainer(InitBlocks.fluidCanolaOil, new ItemStack(itemBucketCanolaOil), FluidContainerRegistry.EMPTY_BUCKET); + itemBucketOil = new ItemBucketAA(InitFluids.blockOil, "itemBucketOil"); + FluidContainerRegistry.registerFluidContainer(InitFluids.fluidOil, new ItemStack(itemBucketOil), FluidContainerRegistry.EMPTY_BUCKET); + itemBucketCanolaOil = new ItemBucketAA(InitFluids.blockCanolaOil, "itemBucketCanolaOil"); + FluidContainerRegistry.registerFluidContainer(InitFluids.fluidCanolaOil, new ItemStack(itemBucketCanolaOil), FluidContainerRegistry.EMPTY_BUCKET); itemFertilizer = new ItemFertilizer("itemFertilizer"); itemCoffee = new ItemCoffee("itemCoffee"); itemPhantomConnector = new ItemPhantomConnector("itemPhantomConnector"); 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 a8ece55bb..86bb4a359 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java @@ -15,9 +15,9 @@ import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.booklet.BookletPage; import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter; import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.event.InitEvents; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.misc.special.SpecialRenderInit; import de.ellpeck.actuallyadditions.mod.util.FluidStateMapper; import de.ellpeck.actuallyadditions.mod.util.ModUtil; @@ -75,8 +75,8 @@ public class ClientProxy implements IProxy{ for(Map.Entry entry : modelVariantsForRegistering.entrySet()){ ModelBakery.registerItemVariants(entry.getKey(), entry.getValue()); } - this.registerCustomFluidBlockRenderer(InitBlocks.fluidCanolaOil); - this.registerCustomFluidBlockRenderer(InitBlocks.fluidOil); + this.registerCustomFluidBlockRenderer(InitFluids.fluidCanolaOil); + this.registerCustomFluidBlockRenderer(InitFluids.fluidOil); IResourceManager manager = Minecraft.getMinecraft().getResourceManager(); if(manager instanceof IReloadableResourceManager){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java index e41b76028..b7d038f50 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java @@ -12,7 +12,7 @@ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyReceiver; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +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.util.WorldUtil; @@ -72,7 +72,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE this.slots[0] = null; } - this.tank.fill(new FluidStack(InitBlocks.fluidCanolaOil, PRODUCE), true); + this.tank.fill(new FluidStack(InitFluids.fluidCanolaOil, PRODUCE), true); this.markDirty(); } } @@ -133,7 +133,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ - return slot == 2 && FluidContainerRegistry.containsFluid(this.slots[0], new FluidStack(InitBlocks.fluidCanolaOil, FluidContainerRegistry.BUCKET_VOLUME)); + return slot == 2 && FluidContainerRegistry.containsFluid(this.slots[0], new FluidStack(InitFluids.fluidCanolaOil, FluidContainerRegistry.BUCKET_VOLUME)); } @Override @@ -163,7 +163,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE @Override public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain){ - if(resource.getFluid() == InitBlocks.fluidCanolaOil){ + if(resource.getFluid() == InitFluids.fluidCanolaOil){ return this.tank.drain(resource.amount, doDrain); } return null; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java index 3d221ae4b..9a4a2f8e4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.tile; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -45,7 +45,7 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen if(this.currentProcessTime >= PROCESS_TIME){ this.currentProcessTime = 0; - this.oilTank.fill(new FluidStack(InitBlocks.fluidOil, produce), true); + this.oilTank.fill(new FluidStack(InitFluids.fluidOil, produce), true); this.canolaTank.drain(produce, true); this.markDirty(); } @@ -54,7 +54,7 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen this.currentProcessTime = 0; } - WorldUtil.emptyBucket(canolaTank, slots, 0, 1, InitBlocks.fluidCanolaOil); + WorldUtil.emptyBucket(canolaTank, slots, 0, 1, InitFluids.fluidCanolaOil); WorldUtil.fillBucket(oilTank, slots, 2, 3); if(this.oilTank.getFluidAmount() > 0){ @@ -115,17 +115,17 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen @Override public boolean isItemValidForSlot(int i, ItemStack stack){ - return (i == 0 && FluidContainerRegistry.containsFluid(stack, new FluidStack(InitBlocks.fluidCanolaOil, FluidContainerRegistry.BUCKET_VOLUME))) || (i == 2 && stack.getItem() == Items.bucket); + return (i == 0 && FluidContainerRegistry.containsFluid(stack, new FluidStack(InitFluids.fluidCanolaOil, FluidContainerRegistry.BUCKET_VOLUME))) || (i == 2 && stack.getItem() == Items.bucket); } @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ - return (slot == 1 && stack.getItem() == Items.bucket) || (slot == 3 && FluidContainerRegistry.containsFluid(stack, new FluidStack(InitBlocks.fluidOil, FluidContainerRegistry.BUCKET_VOLUME))); + return (slot == 1 && stack.getItem() == Items.bucket) || (slot == 3 && FluidContainerRegistry.containsFluid(stack, new FluidStack(InitFluids.fluidOil, FluidContainerRegistry.BUCKET_VOLUME))); } @Override public int fill(EnumFacing from, FluidStack resource, boolean doFill){ - if(from != EnumFacing.DOWN && resource.getFluid() == InitBlocks.fluidCanolaOil){ + if(from != EnumFacing.DOWN && resource.getFluid() == InitFluids.fluidCanolaOil){ return this.canolaTank.fill(resource, doFill); } return 0; @@ -133,7 +133,7 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen @Override public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain){ - if(resource.getFluid() == InitBlocks.fluidOil){ + if(resource.getFluid() == InitFluids.fluidOil){ return this.oilTank.drain(resource.amount, doDrain); } return null; @@ -146,12 +146,12 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen @Override public boolean canFill(EnumFacing from, Fluid fluid){ - return from != EnumFacing.DOWN && fluid == InitBlocks.fluidCanolaOil; + return from != EnumFacing.DOWN && fluid == InitFluids.fluidCanolaOil; } @Override public boolean canDrain(EnumFacing from, Fluid fluid){ - return from != EnumFacing.UP && fluid == InitBlocks.fluidOil; + return from != EnumFacing.UP && fluid == InitFluids.fluidOil; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java index bb2eb5f00..3434e2ec8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java @@ -12,7 +12,7 @@ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyProvider; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.item.ItemStack; @@ -72,7 +72,7 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I } } - WorldUtil.emptyBucket(tank, slots, 0, 1, InitBlocks.fluidOil); + WorldUtil.emptyBucket(tank, slots, 0, 1, InitFluids.fluidOil); if(this.storage.getEnergyStored() > 0){ WorldUtil.pushEnergyToAllSides(worldObj, this.pos, this.storage); @@ -122,7 +122,7 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I @Override public boolean isItemValidForSlot(int i, ItemStack stack){ - return FluidContainerRegistry.containsFluid(stack, new FluidStack(InitBlocks.fluidOil, FluidContainerRegistry.BUCKET_VOLUME)) && i == 0; + return FluidContainerRegistry.containsFluid(stack, new FluidStack(InitFluids.fluidOil, FluidContainerRegistry.BUCKET_VOLUME)) && i == 0; } @Override @@ -152,7 +152,7 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I @Override public int fill(EnumFacing from, FluidStack resource, boolean doFill){ - if(resource.getFluid() == InitBlocks.fluidOil){ + if(resource.getFluid() == InitFluids.fluidOil){ return this.tank.fill(resource, doFill); } return 0; @@ -170,7 +170,7 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I @Override public boolean canFill(EnumFacing from, Fluid fluid){ - return from != EnumFacing.DOWN && fluid == InitBlocks.fluidOil; + return from != EnumFacing.DOWN && fluid == InitFluids.fluidOil; } @Override From e312ce1f74ba8f8fc240b30e79964108e4ef6dc7 Mon Sep 17 00:00:00 2001 From: Kristian295 Date: Fri, 29 Jan 2016 23:14:03 +0100 Subject: [PATCH 39/66] Matching de_DE.lang with en_US.lang yet untranslated lines: 157-186, 429-430, 572-773 --- .../assets/actuallyadditions/lang/de_DE.lang | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/src/main/resources/assets/actuallyadditions/lang/de_DE.lang b/src/main/resources/assets/actuallyadditions/lang/de_DE.lang index ae56c8e0d..1564b4342 100644 --- a/src/main/resources/assets/actuallyadditions/lang/de_DE.lang +++ b/src/main/resources/assets/actuallyadditions/lang/de_DE.lang @@ -18,7 +18,6 @@ container.nei.actuallyadditions.treasureChest.info=Gegenstände zu container.nei.actuallyadditions.coffee.name=Kaffeemaschine container.nei.actuallyadditions.coffee.special=Spezialfunktion container.nei.actuallyadditions.coffee.maxAmount=Maximale Menge -container.nei.actuallyadditions.coffee.shift=[UMSCHALT]! container.nei.actuallyadditions.coffee.extra.milk=+01:00, -1 Level container.nei.actuallyadditions.reconstructor.name=Atomarer Umwandler @@ -117,7 +116,6 @@ tile.actuallyadditions.blockMiscIronCasing.name=Eisengehäuse tile.actuallyadditions.blockBlackLotus.name=Schwarze Lotos tile.actuallyadditions.blockTestifiBucksWhiteFence.name=Ethetische Quarz Wand tile.actuallyadditions.blockTestifiBucksGreenFence.name=Ethetische Grüne Wand -tile.actuallyadditions.blockAtomicReconstructor.name=Atomarer Umwandler tile.actuallyadditions.blockCrystalRed.name=Restonia Kristallblock tile.actuallyadditions.blockCrystalBlue.name=Palis Kristallblock tile.actuallyadditions.blockCrystalLightBlue.name=Diamatin Kristallblock @@ -156,6 +154,37 @@ tile.actuallyadditions.blockInputter.add.13.name=Eingelaugtes Salz-Gebäck tile.actuallyadditions.blockInputter.add.14.name=Eierlegendes Schreck-Gebilde tile.actuallyadditions.blockInputter.add.15.name=Exzellentes Spaghetti-Gericht +#Reconstructor + tile.actuallyadditions.blockAtomicReconstructor.name=Atomic Reconstructor + + tile.actuallyadditions.blockAtomicReconstructor.info.1.1=Molecular + tile.actuallyadditions.blockAtomicReconstructor.info.1.2=Material + tile.actuallyadditions.blockAtomicReconstructor.info.1.3=Quarkal + tile.actuallyadditions.blockAtomicReconstructor.info.1.4=Atomatic + tile.actuallyadditions.blockAtomicReconstructor.info.1.5=Tiny Bit + tile.actuallyadditions.blockAtomicReconstructor.info.1.6=Component + tile.actuallyadditions.blockAtomicReconstructor.info.1.7=Vittle + tile.actuallyadditions.blockAtomicReconstructor.info.1.8=Transmaterial + tile.actuallyadditions.blockAtomicReconstructor.info.1.9=Partial + tile.actuallyadditions.blockAtomicReconstructor.info.1.10=Spatial + tile.actuallyadditions.blockAtomicReconstructor.info.1.11=Stuffy + tile.actuallyadditions.blockAtomicReconstructor.info.1.12=Interdimensional + + tile.actuallyadditions.blockAtomicReconstructor.info.2.1=Recombobulizer + tile.actuallyadditions.blockAtomicReconstructor.info.2.2=Shiftulator + tile.actuallyadditions.blockAtomicReconstructor.info.2.3=Recombinator + tile.actuallyadditions.blockAtomicReconstructor.info.2.4=Modulator + tile.actuallyadditions.blockAtomicReconstructor.info.2.5=Moleculizer + tile.actuallyadditions.blockAtomicReconstructor.info.2.6=Modificulator + tile.actuallyadditions.blockAtomicReconstructor.info.2.7=Changer + tile.actuallyadditions.blockAtomicReconstructor.info.2.8=Atomizer + tile.actuallyadditions.blockAtomicReconstructor.info.2.9=Makerator + tile.actuallyadditions.blockAtomicReconstructor.info.2.10=Swapper + tile.actuallyadditions.blockAtomicReconstructor.info.2.11=Exchanger + tile.actuallyadditions.blockAtomicReconstructor.info.2.12=Replacer + tile.actuallyadditions.blockAtomicReconstructor.info.2.13=Differentiator + tile.actuallyadditions.blockAtomicReconstructor.info.2.14=Receiver + #Items / Gegenstände item.actuallyadditions.itemDrill.name=Bohrer item.actuallyadditions.itemFoodRice.name=Reis @@ -397,6 +426,8 @@ tooltip.actuallyadditions.oredictName.desc=OreDictionary-Einträge tooltip.actuallyadditions.noOredictNameAvail.desc=Keine tooltip.actuallyadditions.codeName.desc=Codename tooltip.actuallyadditions.baseUnlocName.desc=Unlokalisierter Name des Gegenstands +tooltip.actuallyadditions.meta.desc=Metadata +tooltip.actuallyadditions.nbt.desc=NBT tooltip.actuallyadditions.unlocName.desc=Unlokalisierter Name der Meta tooltip.actuallyadditions.disablingInfo.desc=Wenn du diese Informationen nicht sehen möchtest, deaktiviere sie in den Actually Additions-Einstellungen! tooltip.actuallyadditions.ctrlForMoreInfo.desc=Drücke STRG für weitere Informationen From d1924045c07a448425dad4f8a3365c98404d4cdc Mon Sep 17 00:00:00 2001 From: Kristian295 Date: Fri, 29 Jan 2016 23:53:29 +0100 Subject: [PATCH 40/66] Translation of ll. 157-186, 429, 430 yet untranslated lines: 572-773 --- .../assets/actuallyadditions/lang/de_DE.lang | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/main/resources/assets/actuallyadditions/lang/de_DE.lang b/src/main/resources/assets/actuallyadditions/lang/de_DE.lang index 1564b4342..3fe156d93 100644 --- a/src/main/resources/assets/actuallyadditions/lang/de_DE.lang +++ b/src/main/resources/assets/actuallyadditions/lang/de_DE.lang @@ -154,36 +154,36 @@ tile.actuallyadditions.blockInputter.add.13.name=Eingelaugtes Salz-Gebäck tile.actuallyadditions.blockInputter.add.14.name=Eierlegendes Schreck-Gebilde tile.actuallyadditions.blockInputter.add.15.name=Exzellentes Spaghetti-Gericht -#Reconstructor - tile.actuallyadditions.blockAtomicReconstructor.name=Atomic Reconstructor +#Reconstructor / Umwandler + tile.actuallyadditions.blockAtomicReconstructor.name=Atomarer Umwandler - tile.actuallyadditions.blockAtomicReconstructor.info.1.1=Molecular - tile.actuallyadditions.blockAtomicReconstructor.info.1.2=Material + tile.actuallyadditions.blockAtomicReconstructor.info.1.1=Molekular + tile.actuallyadditions.blockAtomicReconstructor.info.1.2=Materiell tile.actuallyadditions.blockAtomicReconstructor.info.1.3=Quarkal - tile.actuallyadditions.blockAtomicReconstructor.info.1.4=Atomatic - tile.actuallyadditions.blockAtomicReconstructor.info.1.5=Tiny Bit - tile.actuallyadditions.blockAtomicReconstructor.info.1.6=Component - tile.actuallyadditions.blockAtomicReconstructor.info.1.7=Vittle - tile.actuallyadditions.blockAtomicReconstructor.info.1.8=Transmaterial - tile.actuallyadditions.blockAtomicReconstructor.info.1.9=Partial - tile.actuallyadditions.blockAtomicReconstructor.info.1.10=Spatial - tile.actuallyadditions.blockAtomicReconstructor.info.1.11=Stuffy + tile.actuallyadditions.blockAtomicReconstructor.info.1.4=Atomar + tile.actuallyadditions.blockAtomicReconstructor.info.1.5=Kleines Bisschen + tile.actuallyadditions.blockAtomicReconstructor.info.1.6=Komponente + tile.actuallyadditions.blockAtomicReconstructor.info.1.7=Vittell + tile.actuallyadditions.blockAtomicReconstructor.info.1.8=Transmateriell + tile.actuallyadditions.blockAtomicReconstructor.info.1.9=Partiell + tile.actuallyadditions.blockAtomicReconstructor.info.1.10=Räumlich + tile.actuallyadditions.blockAtomicReconstructor.info.1.11=Stickig tile.actuallyadditions.blockAtomicReconstructor.info.1.12=Interdimensional - tile.actuallyadditions.blockAtomicReconstructor.info.2.1=Recombobulizer - tile.actuallyadditions.blockAtomicReconstructor.info.2.2=Shiftulator - tile.actuallyadditions.blockAtomicReconstructor.info.2.3=Recombinator + tile.actuallyadditions.blockAtomicReconstructor.info.2.1=Vermischer + tile.actuallyadditions.blockAtomicReconstructor.info.2.2=Verschieber + tile.actuallyadditions.blockAtomicReconstructor.info.2.3=Rekombinierer tile.actuallyadditions.blockAtomicReconstructor.info.2.4=Modulator - tile.actuallyadditions.blockAtomicReconstructor.info.2.5=Moleculizer - tile.actuallyadditions.blockAtomicReconstructor.info.2.6=Modificulator - tile.actuallyadditions.blockAtomicReconstructor.info.2.7=Changer - tile.actuallyadditions.blockAtomicReconstructor.info.2.8=Atomizer - tile.actuallyadditions.blockAtomicReconstructor.info.2.9=Makerator + tile.actuallyadditions.blockAtomicReconstructor.info.2.5=Molekülisator + tile.actuallyadditions.blockAtomicReconstructor.info.2.6=Modifikulisator + tile.actuallyadditions.blockAtomicReconstructor.info.2.7=Veränderer + tile.actuallyadditions.blockAtomicReconstructor.info.2.8=Atomisierer + tile.actuallyadditions.blockAtomicReconstructor.info.2.9=Zerhacker tile.actuallyadditions.blockAtomicReconstructor.info.2.10=Swapper - tile.actuallyadditions.blockAtomicReconstructor.info.2.11=Exchanger - tile.actuallyadditions.blockAtomicReconstructor.info.2.12=Replacer - tile.actuallyadditions.blockAtomicReconstructor.info.2.13=Differentiator - tile.actuallyadditions.blockAtomicReconstructor.info.2.14=Receiver + tile.actuallyadditions.blockAtomicReconstructor.info.2.11=Vertauscher + tile.actuallyadditions.blockAtomicReconstructor.info.2.12=Austauscher + tile.actuallyadditions.blockAtomicReconstructor.info.2.13=Differenzierer + tile.actuallyadditions.blockAtomicReconstructor.info.2.14=Empfänger #Items / Gegenstände item.actuallyadditions.itemDrill.name=Bohrer @@ -426,8 +426,8 @@ tooltip.actuallyadditions.oredictName.desc=OreDictionary-Einträge tooltip.actuallyadditions.noOredictNameAvail.desc=Keine tooltip.actuallyadditions.codeName.desc=Codename tooltip.actuallyadditions.baseUnlocName.desc=Unlokalisierter Name des Gegenstands -tooltip.actuallyadditions.meta.desc=Metadata -tooltip.actuallyadditions.nbt.desc=NBT +tooltip.actuallyadditions.meta.desc=Metadaten +tooltip.actuallyadditions.nbt.desc=NBT-Daten tooltip.actuallyadditions.unlocName.desc=Unlokalisierter Name der Meta tooltip.actuallyadditions.disablingInfo.desc=Wenn du diese Informationen nicht sehen möchtest, deaktiviere sie in den Actually Additions-Einstellungen! tooltip.actuallyadditions.ctrlForMoreInfo.desc=Drücke STRG für weitere Informationen From a0aa92fc4cc192965d439e112b8b22cb78352127 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 31 Jan 2016 01:14:57 +0100 Subject: [PATCH 41/66] Update Forge and stuff --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index e1ab405b6..2e3b634fe 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ group = "de.ellpeck.actuallyadditions" archivesBaseName = "ActuallyAdditions" minecraft { - version = "1.8.9-11.15.1.1722" + version = "1.8.9-11.15.1.1726" runDir = "idea" mappings = "stable_20" @@ -42,7 +42,7 @@ dependencies { //compile "codechicken:CodeChickenCore:1.8-1.0.5.36:dev" //compile "codechicken:NotEnoughItems:1.8-1.0.5.104:dev" - deobfCompile "mezz.jei:jei_1.8.9:2.22.3.105" + deobfCompile "mezz.jei:jei_1.8.9:2.24.0.109" } processResources { From 7586b7cd56df2ca76cd8b4e95167545a7abbf694 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 31 Jan 2016 03:31:39 +0100 Subject: [PATCH 42/66] Made the placer be able to apply bonemeal and do some more awesome stuffz --- .../mod/tile/TileEntityBreaker.java | 4 +-- .../mod/tile/TileEntityFluidCollector.java | 7 ++--- .../mod/tile/TileEntityPhantomPlacer.java | 10 +++---- .../actuallyadditions/mod/util/WorldUtil.java | 28 +++++++++++-------- 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java index 8085ae47d..d15f9e6d0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java @@ -89,9 +89,9 @@ public class TileEntityBreaker extends TileEntityInventoryBase implements IRedst this.markDirty(); } } - else if(this.isPlacer && PosUtil.getBlock(coordsBlock, worldObj).isReplaceable(worldObj, coordsBlock)){ + else if(this.isPlacer){ int theSlot = WorldUtil.findFirstFilledSlot(this.slots); - this.setInventorySlotContents(theSlot, WorldUtil.placeBlockAtSide(sideToManipulate, worldObj, this.pos, this.slots[theSlot])); + this.setInventorySlotContents(theSlot, WorldUtil.useItemAtSide(sideToManipulate, worldObj, this.pos, this.slots[theSlot])); if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0){ this.slots[theSlot] = null; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java index 49fb8cc59..510fb124d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java @@ -84,11 +84,8 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements else if(this.isPlacer && PosUtil.getBlock(coordsBlock, worldObj).isReplaceable(worldObj, coordsBlock)){ if(this.tank.getFluidAmount() >= FluidContainerRegistry.BUCKET_VOLUME){ if(this.tank.getFluid().getFluid().getBlock() != null){ - Block block = PosUtil.getBlock(coordsBlock, worldObj); - if(!(block instanceof IFluidBlock) && block != Blocks.lava && block != Blocks.water && block != Blocks.flowing_lava && block != Blocks.flowing_water){ - WorldUtil.placeBlockAtSide(sideToManipulate, worldObj, this.pos, new ItemStack(this.tank.getFluid().getFluid().getBlock())); - this.tank.drain(FluidContainerRegistry.BUCKET_VOLUME, true); - } + WorldUtil.useItemAtSide(sideToManipulate, worldObj, this.pos, new ItemStack(this.tank.getFluid().getFluid().getBlock())); + this.tank.drain(FluidContainerRegistry.BUCKET_VOLUME, true); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java index d79cf8c6c..7d022dfd6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java @@ -115,12 +115,10 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements } } else{ - if(PosUtil.getBlock(boundPosition, worldObj).isReplaceable(worldObj, boundPosition)){ - int theSlot = WorldUtil.findFirstFilledSlot(this.slots); - this.setInventorySlotContents(theSlot, WorldUtil.placeBlockAtSide(EnumFacing.UP, worldObj, boundPosition, this.slots[theSlot])); - if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0){ - this.slots[theSlot] = null; - } + int theSlot = WorldUtil.findFirstFilledSlot(this.slots); + this.setInventorySlotContents(theSlot, WorldUtil.useItemAtSide(EnumFacing.UP, worldObj, boundPosition, this.slots[theSlot])); + if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0){ + this.slots[theSlot] = null; } } } 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 1026607b4..e28134d04 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java @@ -13,6 +13,7 @@ package de.ellpeck.actuallyadditions.mod.util; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyReceiver; import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; @@ -109,43 +110,45 @@ public class WorldUtil{ } } - public static ItemStack placeBlockAtSide(EnumFacing side, World world, BlockPos pos, ItemStack stack){ + public static ItemStack useItemAtSide(EnumFacing side, World world, BlockPos pos, ItemStack stack){ if(world instanceof WorldServer && stack != null && stack.getItem() != null){ BlockPos offsetPos = pos.offset(side); + Block block = PosUtil.getBlock(offsetPos, world); + boolean replaceable = block.isReplaceable(world, offsetPos); //Fluids - FluidStack fluid = FluidContainerRegistry.getFluidForFilledItem(stack); - if(fluid != null && fluid.getFluid().getBlock() != null && fluid.getFluid().getBlock().canPlaceBlockAt(world, offsetPos)){ - Block block = PosUtil.getBlock(offsetPos, world); - if(!(block instanceof IFluidBlock) && block != Blocks.lava && block != Blocks.water && block != Blocks.flowing_lava && block != Blocks.flowing_water){ - if(PosUtil.setBlock(pos, world, fluid.getFluid().getBlock(), 0, 2)){ + if(replaceable && FluidContainerRegistry.isFilledContainer(stack) && !(block instanceof IFluidBlock) && !(block instanceof BlockLiquid)){ + FluidStack fluid = FluidContainerRegistry.getFluidForFilledItem(stack); + if(fluid != null && fluid.getFluid().getBlock() != null && fluid.getFluid().getBlock().canPlaceBlockAt(world, offsetPos)){ + if(PosUtil.setBlock(offsetPos, world, fluid.getFluid().getBlock(), 0, 2)){ return stack.getItem().getContainerItem(stack); } } } //Redstone - else if(stack.getItem() == Items.redstone){ - PosUtil.setBlock(pos, world, Blocks.redstone_wire, 0, 2); + else if(replaceable && stack.getItem() == Items.redstone){ + PosUtil.setBlock(offsetPos, world, Blocks.redstone_wire, 0, 2); stack.stackSize--; } //Plants - else if(stack.getItem() instanceof IPlantable){ + else if(replaceable && stack.getItem() instanceof IPlantable){ if(((IPlantable)stack.getItem()).getPlant(world, offsetPos).getBlock().canPlaceBlockAt(world, offsetPos)){ if(world.setBlockState(offsetPos, ((IPlantable)stack.getItem()).getPlant(world, offsetPos), 2)){ stack.stackSize--; } } } + + //Everything else else{ try{ - //Blocks - stack.onItemUse(FakePlayerUtil.getFakePlayer(world), world, pos, side, 0, 0, 0); + stack.onItemUse(FakePlayerUtil.getFakePlayer(world), world, offsetPos, side.getOpposite(), 0.5F, 0.5F, 0.5F); return stack; } catch(Exception e){ - ModUtil.LOGGER.error("Something that places Blocks at "+offsetPos.getX()+", "+offsetPos.getY()+", "+offsetPos.getZ()+" in World "+world.provider.getDimensionId()+" threw an Exception! Don't let that happen again!"); + ModUtil.LOGGER.error("Something that places Blocks at "+offsetPos.getX()+", "+offsetPos.getY()+", "+offsetPos.getZ()+" in World "+world.provider.getDimensionId()+" threw an Exception! Don't let that happen again!", e); } } } @@ -244,6 +247,7 @@ public class WorldUtil{ } //TODO make this work for the stupid new system + /** * Add an ArrayList of ItemStacks to an Array of slots * From 4ac5007279e7e77c7ee3a2ed66d2ba40d526ffff Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 31 Jan 2016 10:53:27 +0100 Subject: [PATCH 43/66] Made handler compatible with old JEI versions. Just in case. --- .../actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java | 2 +- .../mod/jei/coffee/CoffeeMachineRecipeWrapper.java | 2 +- .../actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java | 2 +- .../mod/jei/reconstructor/ReconstructorRecipeWrapper.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java index 8c58e3cd7..ea12d13ab 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java @@ -57,7 +57,7 @@ public class BookletRecipeWrapper extends RecipeWrapperWithButton implements IRe @Override public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ - + this.drawInfo(minecraft, recipeWidth, recipeHeight, 0, 0); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java index 0d9683ca1..4e3ebf742 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java @@ -71,7 +71,7 @@ public class CoffeeMachineRecipeWrapper extends RecipeWrapperWithButton implemen @Override public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ - + this.drawInfo(minecraft, recipeWidth, recipeHeight, 0, 0); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java index 33013a99b..2fb853e41 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java @@ -64,7 +64,7 @@ public class CrusherRecipeWrapper extends RecipeWrapperWithButton implements IRe @Override public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ - + this.drawInfo(minecraft, recipeWidth, recipeHeight, 0, 0); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java index a663225df..3845b81fa 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java @@ -55,7 +55,7 @@ public class ReconstructorRecipeWrapper extends RecipeWrapperWithButton implemen @Override public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ - + this.drawInfo(minecraft, recipeWidth, recipeHeight, 0, 0); } @Override From 1e3f0dbe4544b6ab65277bcce1e262b030e07307 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 31 Jan 2016 10:54:07 +0100 Subject: [PATCH 44/66] Revert that. --- .../actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java | 2 +- .../mod/jei/coffee/CoffeeMachineRecipeWrapper.java | 2 +- .../actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java | 2 +- .../mod/jei/reconstructor/ReconstructorRecipeWrapper.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java index ea12d13ab..8c58e3cd7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java @@ -57,7 +57,7 @@ public class BookletRecipeWrapper extends RecipeWrapperWithButton implements IRe @Override public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ - this.drawInfo(minecraft, recipeWidth, recipeHeight, 0, 0); + } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java index 4e3ebf742..0d9683ca1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java @@ -71,7 +71,7 @@ public class CoffeeMachineRecipeWrapper extends RecipeWrapperWithButton implemen @Override public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ - this.drawInfo(minecraft, recipeWidth, recipeHeight, 0, 0); + } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java index 2fb853e41..33013a99b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java @@ -64,7 +64,7 @@ public class CrusherRecipeWrapper extends RecipeWrapperWithButton implements IRe @Override public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ - this.drawInfo(minecraft, recipeWidth, recipeHeight, 0, 0); + } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java index 3845b81fa..a663225df 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java @@ -55,7 +55,7 @@ public class ReconstructorRecipeWrapper extends RecipeWrapperWithButton implemen @Override public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ - this.drawInfo(minecraft, recipeWidth, recipeHeight, 0, 0); + } @Override From 091b6cbfc3f5dbc4fc3288f47b5b19c6cf8339bf Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 1 Feb 2016 17:40:17 +0100 Subject: [PATCH 45/66] Fix capabilities --- .../actuallyadditions/mod/tile/TileEntityInventoryBase.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java index b71af5608..cf2f10a9d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java @@ -216,6 +216,11 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements return new ChatComponentText(StringUtil.localize(this.getName())); } + @Override + public boolean hasCapability(net.minecraftforge.common.capabilities.Capability capability, net.minecraft.util.EnumFacing facing){ + return this.getCapability(capability, facing) != null; + } + @Override public T getCapability(Capability capability, EnumFacing facing){ if(facing != null && capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY){ From c92aebfe0a5096384541621d3ca5abdc3d53b4e0 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 1 Feb 2016 17:43:14 +0100 Subject: [PATCH 46/66] Fixed Compost and Reconstructor syncing with hoppers. Closes #59 --- .../mod/blocks/BlockCompost.java | 4 ++-- .../tile/TileEntityAtomicReconstructor.java | 18 ++++++------------ .../mod/tile/TileEntityCompost.java | 18 ++++++------------ 3 files changed, 14 insertions(+), 26 deletions(-) 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 b872af821..6023cdf34 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java @@ -83,7 +83,7 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{ if(!player.capabilities.isCreativeMode){ player.inventory.getCurrentItem().stackSize--; } - tile.sendUpdate(); + tile.markDirty(); } //Add Fertilizer to player's inventory @@ -95,7 +95,7 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{ player.getCurrentEquippedItem().stackSize += tile.slots[0].stackSize; } tile.slots[0] = null; - tile.sendUpdate(); + tile.markDirty(); } } return true; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java index 174b604d9..74d65bdc2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java @@ -113,6 +113,12 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple this.storage.writeToNBT(compound); } + @Override + public void markDirty(){ + super.markDirty(); + this.sendUpdate(); + } + @Override public boolean shouldSyncSlots(){ return true; @@ -125,18 +131,6 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple this.storage.readFromNBT(compound); } - @Override - public void setInventorySlotContents(int i, ItemStack stack){ - super.setInventorySlotContents(i, stack); - this.sendUpdate(); - } - - @Override - public ItemStack decrStackSize(int i, int j){ - this.sendUpdate(); - return super.decrStackSize(i, j); - } - @Override public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate){ return this.storage.receiveEnergy(maxReceive, simulate); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java index 4f09fb2d3..969678b18 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java @@ -62,18 +62,6 @@ public class TileEntityCompost extends TileEntityInventoryBase{ this.conversionTime = compound.getInteger("ConversionTime"); } - @Override - public void setInventorySlotContents(int i, ItemStack stack){ - super.setInventorySlotContents(i, stack); - this.sendUpdate(); - } - - @Override - public ItemStack decrStackSize(int i, int j){ - this.sendUpdate(); - return super.decrStackSize(i, j); - } - @Override public int getInventoryStackLimit(){ return AMOUNT; @@ -93,4 +81,10 @@ public class TileEntityCompost extends TileEntityInventoryBase{ public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return stack.getItem() instanceof ItemFertilizer; } + + @Override + public void markDirty(){ + super.markDirty(); + this.sendUpdate(); + } } From 0540313e75c45340ae792862ad991a68a6de2de0 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 1 Feb 2016 17:49:55 +0100 Subject: [PATCH 47/66] Cleanup ~ --- .../api/booklet/IBookletEntry.java | 4 +- .../actuallyadditions/api/lens/Lens.java | 3 +- .../mod/blocks/BlockAtomicReconstructor.java | 39 ++++--- .../mod/blocks/BlockBreaker.java | 12 +- .../mod/blocks/BlockCoalGenerator.java | 10 +- .../mod/blocks/BlockCoffeeMachine.java | 14 +-- .../mod/blocks/BlockColoredLamp.java | 29 +++-- .../mod/blocks/BlockCrystal.java | 26 ++--- .../mod/blocks/BlockDirectionalBreaker.java | 10 +- .../mod/blocks/BlockDropper.java | 9 +- .../mod/blocks/BlockFishingNet.java | 4 +- .../mod/blocks/BlockFluidCollector.java | 10 +- .../mod/blocks/BlockFurnaceDouble.java | 10 +- .../mod/blocks/BlockFurnaceSolar.java | 4 +- .../mod/blocks/BlockGreenhouseGlass.java | 30 ++--- .../mod/blocks/BlockGrinder.java | 12 +- .../mod/blocks/BlockLampPowerer.java | 10 +- .../mod/blocks/BlockLaserRelay.java | 14 +-- .../mod/blocks/BlockMisc.java | 26 ++--- .../mod/blocks/BlockOilGenerator.java | 10 +- .../mod/blocks/BlockPhantomBooster.java | 4 +- .../mod/blocks/BlockSlabs.java | 13 +-- .../mod/blocks/BlockSmileyCloud.java | 25 +++-- .../mod/blocks/BlockTreasureChest.java | 20 ++-- .../mod/blocks/BlockWildPlant.java | 56 ++++----- .../mod/blocks/BlockXPSolidifier.java | 10 +- .../mod/blocks/base/BlockBase.java | 18 +-- .../mod/blocks/base/BlockBushBase.java | 18 +-- .../mod/blocks/base/BlockContainerBase.java | 100 ++++++++--------- .../mod/blocks/base/BlockPlant.java | 106 +++++++++--------- .../mod/blocks/base/BlockStair.java | 8 +- .../mod/blocks/base/BlockWallAA.java | 58 +++++----- .../mod/booklet/GuiBooklet.java | 10 +- .../mod/booklet/InitBooklet.java | 2 +- .../mod/booklet/chapter/BookletChapter.java | 10 +- .../mod/booklet/entry/BookletEntry.java | 24 ++-- .../booklet/entry/BookletEntryAllSearch.java | 12 +- .../mod/booklet/page/BookletPageAA.java | 34 +++--- .../mod/booklet/page/PageCrafting.java | 18 +-- .../mod/booklet/page/PageCrusherRecipe.java | 10 +- .../mod/booklet/page/PageFurnace.java | 18 +-- .../mod/booklet/page/PageReconstructor.java | 28 ++--- .../mod/creative/CreativeTab.java | 2 +- .../mod/items/InitItems.java | 4 +- .../mod/items/ItemBooklet.java | 20 ++-- .../mod/items/ItemCrystal.java | 16 +-- .../mod/items/ItemDrill.java | 22 ++-- .../mod/items/ItemPhantomConnector.java | 16 +-- .../mod/items/base/ItemAllToolAA.java | 20 ++-- .../mod/items/base/ItemArmorAA.java | 16 +-- .../mod/items/base/ItemAxeAA.java | 8 +- .../mod/items/base/ItemBase.java | 8 +- .../mod/items/base/ItemBucketAA.java | 8 +- .../mod/items/base/ItemEnergy.java | 20 ++-- .../mod/items/base/ItemFoodBase.java | 8 +- .../mod/items/base/ItemHoeAA.java | 8 +- .../mod/items/base/ItemPickaxeAA.java | 8 +- .../mod/items/base/ItemSeed.java | 8 +- .../mod/items/base/ItemShovelAA.java | 8 +- .../mod/items/base/ItemSwordAA.java | 8 +- .../mod/jei/JEIActuallyAdditionsPlugin.java | 2 +- .../mod/jei/RecipeWrapperWithButton.java | 11 +- .../mod/jei/booklet/BookletRecipeWrapper.java | 10 +- .../coffee/CoffeeMachineRecipeWrapper.java | 10 +- .../mod/jei/crusher/CrusherRecipeWrapper.java | 10 +- .../ReconstructorRecipeCategory.java | 2 +- .../ReconstructorRecipeWrapper.java | 10 +- .../mod/ore/InitOreDict.java | 12 +- .../mod/proxy/ClientProxy.java | 46 ++++---- .../tile/TileEntityAtomicReconstructor.java | 92 +++++++-------- .../mod/tile/TileEntityBase.java | 40 +++---- .../mod/tile/TileEntityBreaker.java | 10 +- .../mod/tile/TileEntityCanolaPress.java | 10 +- .../mod/tile/TileEntityCoalGenerator.java | 8 +- .../mod/tile/TileEntityCoffeeMachine.java | 10 +- .../mod/tile/TileEntityCompost.java | 30 ++--- .../tile/TileEntityDirectionalBreaker.java | 32 +++--- .../mod/tile/TileEntityDropper.java | 10 +- .../mod/tile/TileEntityEnergizer.java | 8 +- .../mod/tile/TileEntityEnervator.java | 10 +- .../mod/tile/TileEntityFeeder.java | 10 +- .../mod/tile/TileEntityFermentingBarrel.java | 40 +++---- .../mod/tile/TileEntityFireworkBox.java | 24 ++-- .../mod/tile/TileEntityFishingNet.java | 24 ++-- .../mod/tile/TileEntityFluidCollector.java | 48 ++++---- .../mod/tile/TileEntityFurnaceDouble.java | 10 +- .../mod/tile/TileEntityFurnaceSolar.java | 24 ++-- .../mod/tile/TileEntityGreenhouseGlass.java | 24 ++-- .../mod/tile/TileEntityGrinder.java | 10 +- .../mod/tile/TileEntityHeatCollector.java | 24 ++-- .../mod/tile/TileEntityInputter.java | 8 +- .../mod/tile/TileEntityInventoryBase.java | 63 +++++------ .../mod/tile/TileEntityItemRepairer.java | 10 +- .../mod/tile/TileEntityLaserRelay.java | 58 +++++----- .../tile/TileEntityLavaFactoryController.java | 28 ++--- .../mod/tile/TileEntityLeafGenerator.java | 24 ++-- .../mod/tile/TileEntityMiner.java | 22 ++-- .../mod/tile/TileEntityOilGenerator.java | 8 +- .../mod/tile/TileEntityPhantomItemface.java | 58 +++++----- .../mod/tile/TileEntityPhantomPlacer.java | 52 ++++----- .../mod/tile/TileEntityPhantomface.java | 20 ++-- .../mod/tile/TileEntityRangedCollector.java | 28 ++--- .../mod/tile/TileEntitySmileyCloud.java | 22 ++-- .../mod/tile/TileEntityXPSolidifier.java | 9 +- .../actuallyadditions/mod/util/AssetUtil.java | 10 +- .../actuallyadditions/mod/util/PosUtil.java | 8 +- .../actuallyadditions/mod/util/WorldUtil.java | 16 +-- 107 files changed, 1075 insertions(+), 1076 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletEntry.java b/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletEntry.java index 65bfe09b3..c053dfa1f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletEntry.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletEntry.java @@ -16,14 +16,14 @@ public interface IBookletEntry{ List getChapters(); + void setChapters(List chapters); + String getUnlocalizedName(); String getLocalizedName(); String getLocalizedNameWithFormatting(); - void setChapters(List chapters); - void addChapter(IBookletChapter chapter); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/lens/Lens.java b/src/main/java/de/ellpeck/actuallyadditions/api/lens/Lens.java index 8c0bb48be..cf6693465 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/lens/Lens.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/lens/Lens.java @@ -28,8 +28,9 @@ public abstract class Lens{ /** * Invokes the lens type's behavior on a block + * * @param hitBlock The block that was hit - * @param tile The tile the lens was invoked from + * @param tile The tile the lens was invoked from * @return If the Reconstructor should stop continuing (return false if you want it to go through blocks) */ public abstract boolean invoke(BlockPos hitBlock, IAtomicReconstructor tile); 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 65d86fd8e..e96154ccf 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java @@ -40,10 +40,9 @@ import java.util.List; public class BlockAtomicReconstructor extends BlockContainerBase implements IHudDisplay{ - private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5); - public static final int NAME_FLAVOR_AMOUNTS_1 = 12; public static final int NAME_FLAVOR_AMOUNTS_2 = 14; + private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5); public BlockAtomicReconstructor(String name){ super(Material.rock, name); @@ -53,24 +52,6 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud this.setStepSound(soundTypeStone); } - @Override - protected PropertyInteger getMetaProperty(){ - return META; - } - - @Override - public EnumRarity getRarity(ItemStack stack){ - return EnumRarity.EPIC; - } - - @Override - public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ - int rotation = BlockPistonBase.getFacingFromEntity(world, pos, player).ordinal(); - PosUtil.setMetadata(pos, world, rotation, 2); - - super.onBlockPlacedBy(world, pos, state, player, stack); - } - @Override public boolean isOpaqueCube(){ return false; @@ -139,6 +120,24 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud return TheItemBlock.class; } + @Override + public EnumRarity getRarity(ItemStack stack){ + return EnumRarity.EPIC; + } + + @Override + public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ + int rotation = BlockPistonBase.getFacingFromEntity(world, pos, player).ordinal(); + PosUtil.setMetadata(pos, world, rotation, 2); + + super.onBlockPlacedBy(world, pos, state, player, stack); + } + + @Override + protected PropertyInteger getMetaProperty(){ + return META; + } + public static class TheItemBlock extends ItemBlockBase{ private long lastSysTime; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBreaker.java index 1077968f8..a09f346c6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBreaker.java @@ -31,8 +31,8 @@ import net.minecraft.world.World; public class BlockBreaker extends BlockContainerBase{ - private boolean isPlacer; private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5); + private boolean isPlacer; public BlockBreaker(boolean isPlacer, String name){ super(Material.rock, name); @@ -43,11 +43,6 @@ public class BlockBreaker extends BlockContainerBase{ this.setStepSound(soundTypeStone); } - @Override - protected PropertyInteger getMetaProperty(){ - return META; - } - @Override public TileEntity createNewTileEntity(World world, int par2){ return this.isPlacer ? new TileEntityBreaker.TileEntityPlacer() : new TileEntityBreaker(); @@ -81,6 +76,11 @@ public class BlockBreaker extends BlockContainerBase{ super.onBlockPlacedBy(world, pos, state, player, stack); } + @Override + protected PropertyInteger getMetaProperty(){ + return META; + } + @Override public void breakBlock(World world, BlockPos pos, IBlockState state){ this.dropInventory(world, pos); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoalGenerator.java index 7017e7e06..9bb60e771 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoalGenerator.java @@ -46,11 +46,6 @@ public class BlockCoalGenerator extends BlockContainerBase{ this.setTickRandomly(true); } - @Override - protected PropertyInteger getMetaProperty(){ - return META; - } - @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityCoalGenerator(); @@ -85,6 +80,11 @@ public class BlockCoalGenerator extends BlockContainerBase{ return EnumRarity.RARE; } + @Override + protected PropertyInteger getMetaProperty(){ + return META; + } + @Override public void breakBlock(World world, BlockPos pos, IBlockState state){ this.dropInventory(world, pos); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java index 2e29e3185..7c49c7e23 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java @@ -44,17 +44,12 @@ public class BlockCoffeeMachine extends BlockContainerBase{ } @Override - protected PropertyInteger getMetaProperty(){ - return META; - } - - @Override - public boolean isOpaqueCube(){ + public boolean isFullCube(){ return false; } @Override - public boolean isFullCube(){ + public boolean isOpaqueCube(){ return false; } @@ -105,4 +100,9 @@ public class BlockCoffeeMachine extends BlockContainerBase{ super.onBlockPlacedBy(world, pos, state, player, stack); } + + @Override + protected PropertyInteger getMetaProperty(){ + return META; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java index 267c23653..44018f892 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java @@ -53,11 +53,6 @@ public class BlockColoredLamp extends BlockBase{ this.isOn = isOn; } - @Override - protected PropertyInteger getMetaProperty(){ - return META; - } - @Override public Item getItemDropped(IBlockState state, Random rand, int par3){ return Item.getItemFromBlock(InitBlocks.blockColoredLamp); @@ -128,16 +123,6 @@ public class BlockColoredLamp extends BlockBase{ return this.isOn ? 15 : 0; } - @Override - public Class getItemBlock(){ - return TheItemBlock.class; - } - - @Override - public EnumRarity getRarity(ItemStack stack){ - return EnumRarity.RARE; - } - @Override protected void registerRendering(){ ResourceLocation[] resLocs = new ResourceLocation[allLampTypes.length]; @@ -149,6 +134,20 @@ public class BlockColoredLamp extends BlockBase{ ActuallyAdditions.proxy.addRenderVariant(Item.getItemFromBlock(this), resLocs); } + @Override + public Class getItemBlock(){ + return TheItemBlock.class; + } + + @Override + public EnumRarity getRarity(ItemStack stack){ + return EnumRarity.RARE; + } + + @Override + protected PropertyInteger getMetaProperty(){ + return META; + } public static class TheItemBlock extends ItemBlockBase{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java index 68cc30514..7b3104bc3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java @@ -42,11 +42,6 @@ public class BlockCrystal extends BlockBase{ this.setHarvestLevel("pickaxe", 1); } - @Override - protected PropertyInteger getMetaProperty(){ - return META; - } - @Override public int damageDropped(IBlockState state){ return this.getMetaFromState(state); @@ -60,6 +55,17 @@ public class BlockCrystal extends BlockBase{ } } + @Override + protected void registerRendering(){ + ResourceLocation[] resLocs = new ResourceLocation[allCrystals.length]; + for(int i = 0; i < allCrystals.length; i++){ + String name = this.getBaseName()+allCrystals[i].name; + resLocs[i] = new ResourceLocation(ModUtil.MOD_ID_LOWER, name); + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(ModUtil.MOD_ID_LOWER, name)); + } + ActuallyAdditions.proxy.addRenderVariant(Item.getItemFromBlock(this), resLocs); + } + @Override public Class getItemBlock(){ return TheItemBlock.class; @@ -71,14 +77,8 @@ public class BlockCrystal extends BlockBase{ } @Override - protected void registerRendering(){ - ResourceLocation[] resLocs = new ResourceLocation[allCrystals.length]; - for(int i = 0; i < allCrystals.length; i++){ - String name = this.getBaseName()+allCrystals[i].name; - resLocs[i] = new ResourceLocation(ModUtil.MOD_ID_LOWER, name); - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(ModUtil.MOD_ID_LOWER, name)); - } - ActuallyAdditions.proxy.addRenderVariant(Item.getItemFromBlock(this), resLocs); + protected PropertyInteger getMetaProperty(){ + return META; } public static class TheItemBlock extends ItemBlockBase{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDirectionalBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDirectionalBreaker.java index 0082f798a..bbc3db8cf 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDirectionalBreaker.java @@ -41,11 +41,6 @@ public class BlockDirectionalBreaker extends BlockContainerBase{ this.setStepSound(soundTypeStone); } - @Override - protected PropertyInteger getMetaProperty(){ - return META; - } - @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityDirectionalBreaker(); @@ -79,6 +74,11 @@ public class BlockDirectionalBreaker extends BlockContainerBase{ super.onBlockPlacedBy(world, pos, state, player, stack); } + @Override + protected PropertyInteger getMetaProperty(){ + return META; + } + @Override public void breakBlock(World world, BlockPos pos, IBlockState state){ this.dropInventory(world, pos); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDropper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDropper.java index 67e26bea4..44d0e2c50 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDropper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDropper.java @@ -39,10 +39,6 @@ public class BlockDropper extends BlockContainerBase{ this.setResistance(10.0F); this.setStepSound(soundTypeStone); } - @Override - protected PropertyInteger getMetaProperty(){ - return META; - } @Override public TileEntity createNewTileEntity(World world, int par2){ @@ -77,6 +73,11 @@ public class BlockDropper extends BlockContainerBase{ super.onBlockPlacedBy(world, pos, state, player, stack); } + @Override + protected PropertyInteger getMetaProperty(){ + return META; + } + @Override public void breakBlock(World world, BlockPos pos, IBlockState state){ this.dropInventory(world, pos); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFishingNet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFishingNet.java index 174fa7841..e1edeea3b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFishingNet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFishingNet.java @@ -35,12 +35,12 @@ public class BlockFishingNet extends BlockContainerBase{ } @Override - public boolean isOpaqueCube(){ + public boolean isFullCube(){ return false; } @Override - public boolean isFullCube(){ + public boolean isOpaqueCube(){ return false; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFluidCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFluidCollector.java index 84fb63f54..431e0c54d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFluidCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFluidCollector.java @@ -44,11 +44,6 @@ public class BlockFluidCollector extends BlockContainerBase{ this.setStepSound(soundTypeStone); } - @Override - protected PropertyInteger getMetaProperty(){ - return META; - } - @Override public TileEntity createNewTileEntity(World world, int par2){ return this.isPlacer ? new TileEntityFluidCollector.TileEntityFluidPlacer() : new TileEntityFluidCollector(); @@ -82,6 +77,11 @@ public class BlockFluidCollector extends BlockContainerBase{ super.onBlockPlacedBy(world, pos, state, player, stack); } + @Override + protected PropertyInteger getMetaProperty(){ + return META; + } + @Override public void breakBlock(World world, BlockPos pos, IBlockState state){ this.dropInventory(world, pos); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceDouble.java index 1b44fe834..815b9fe56 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceDouble.java @@ -48,11 +48,6 @@ public class BlockFurnaceDouble extends BlockContainerBase{ this.setTickRandomly(true); } - @Override - protected PropertyInteger getMetaProperty(){ - return META; - } - @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityFurnaceDouble(); @@ -135,6 +130,11 @@ public class BlockFurnaceDouble extends BlockContainerBase{ super.onBlockPlacedBy(world, pos, state, player, stack); } + @Override + protected PropertyInteger getMetaProperty(){ + return META; + } + @Override public void breakBlock(World world, BlockPos pos, IBlockState state){ this.dropInventory(world, pos); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceSolar.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceSolar.java index 09a6fe024..391bf1903 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceSolar.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceSolar.java @@ -35,12 +35,12 @@ public class BlockFurnaceSolar extends BlockContainerBase{ } @Override - public boolean isOpaqueCube(){ + public boolean isFullCube(){ return false; } @Override - public boolean isFullCube(){ + public boolean isOpaqueCube(){ return false; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGreenhouseGlass.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGreenhouseGlass.java index 4812e0bd0..b23451304 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGreenhouseGlass.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGreenhouseGlass.java @@ -36,22 +36,31 @@ public class BlockGreenhouseGlass extends BlockContainerBase{ this.setStepSound(soundTypeStone); } - @Override - @SideOnly(Side.CLIENT) - public EnumWorldBlockLayer getBlockLayer(){ - return EnumWorldBlockLayer.CUTOUT; - } - @Override public boolean isFullCube(){ return false; } + @Override + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side){ + IBlockState state = worldIn.getBlockState(pos); + Block block = state.getBlock(); + return worldIn.getBlockState(pos.offset(side.getOpposite())) != state || block != this && block != this && super.shouldSideBeRendered(worldIn, pos, side); + + } + @Override public boolean isOpaqueCube(){ return false; } + @Override + @SideOnly(Side.CLIENT) + public EnumWorldBlockLayer getBlockLayer(){ + return EnumWorldBlockLayer.CUTOUT; + } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.EPIC; @@ -61,13 +70,4 @@ public class BlockGreenhouseGlass extends BlockContainerBase{ public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityGreenhouseGlass(); } - - @Override - @SideOnly(Side.CLIENT) - public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side){ - IBlockState state = worldIn.getBlockState(pos); - Block block = state.getBlock(); - return worldIn.getBlockState(pos.offset(side.getOpposite())) != state || block != this && block != this && super.shouldSideBeRendered(worldIn, pos, side); - - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGrinder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGrinder.java index fc2805758..bf4c3571b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGrinder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGrinder.java @@ -35,8 +35,8 @@ import java.util.Random; public class BlockGrinder extends BlockContainerBase{ - private final boolean isDouble; private static final PropertyInteger META = PropertyInteger.create("meta", 0, 1); + private final boolean isDouble; public BlockGrinder(boolean isDouble, String name){ super(Material.rock, name); @@ -48,11 +48,6 @@ public class BlockGrinder extends BlockContainerBase{ this.setTickRandomly(true); } - @Override - protected PropertyInteger getMetaProperty(){ - return META; - } - @Override public TileEntity createNewTileEntity(World world, int par2){ return this.isDouble ? new TileEntityGrinder.TileEntityGrinderDouble() : new TileEntityGrinder(); @@ -95,6 +90,11 @@ public class BlockGrinder extends BlockContainerBase{ return EnumRarity.EPIC; } + @Override + protected PropertyInteger getMetaProperty(){ + return META; + } + @Override public void breakBlock(World world, BlockPos pos, IBlockState state){ this.dropInventory(world, pos); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLampPowerer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLampPowerer.java index 710afc2dd..73b9d2f89 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLampPowerer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLampPowerer.java @@ -37,11 +37,6 @@ public class BlockLampPowerer extends BlockBase{ this.setStepSound(soundTypeStone); } - @Override - protected PropertyInteger getMetaProperty(){ - return META; - } - @Override public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block neighborBlock){ this.updateLamp(world, pos); @@ -82,4 +77,9 @@ public class BlockLampPowerer extends BlockBase{ public EnumRarity getRarity(ItemStack stack){ return EnumRarity.RARE; } + + @Override + protected PropertyInteger getMetaProperty(){ + return META; + } } 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 17d9493be..2b02cccb3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java @@ -42,8 +42,8 @@ public class BlockLaserRelay extends BlockContainerBase{ } @Override - protected PropertyInteger getMetaProperty(){ - return META; + public boolean isFullCube(){ + return false; } @Override @@ -57,11 +57,6 @@ public class BlockLaserRelay extends BlockContainerBase{ return false; } - @Override - public boolean isFullCube(){ - return false; - } - @Override public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, int meta, EntityLivingBase base){ return this.getStateFromMeta(side.ordinal()); @@ -97,6 +92,11 @@ public class BlockLaserRelay extends BlockContainerBase{ return EnumRarity.EPIC; } + @Override + protected PropertyInteger getMetaProperty(){ + return META; + } + @Override public TileEntity createNewTileEntity(World world, int i){ return new TileEntityLaserRelay(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMisc.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMisc.java index df65d4e48..6bc48c865 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMisc.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMisc.java @@ -42,16 +42,19 @@ public class BlockMisc extends BlockBase{ this.setHarvestLevel("pickaxe", 1); } - @Override - protected PropertyInteger getMetaProperty(){ - return META; - } - @Override public int damageDropped(IBlockState state){ return this.getMetaFromState(state); } + @SuppressWarnings("all") + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item item, CreativeTabs tab, List list){ + for(int j = 0; j < allMiscBlocks.length; j++){ + list.add(new ItemStack(item, 1, j)); + } + } + @Override protected void registerRendering(){ ResourceLocation[] resLocs = new ResourceLocation[allMiscBlocks.length]; @@ -63,14 +66,6 @@ public class BlockMisc extends BlockBase{ ActuallyAdditions.proxy.addRenderVariant(Item.getItemFromBlock(this), resLocs); } - @SuppressWarnings("all") - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item item, CreativeTabs tab, List list){ - for(int j = 0; j < allMiscBlocks.length; j++){ - list.add(new ItemStack(item, 1, j)); - } - } - @Override public Class getItemBlock(){ return TheItemBlock.class; @@ -81,6 +76,11 @@ public class BlockMisc extends BlockBase{ return stack.getItemDamage() >= allMiscBlocks.length ? EnumRarity.COMMON : allMiscBlocks[stack.getItemDamage()].rarity; } + @Override + protected PropertyInteger getMetaProperty(){ + return META; + } + public static class TheItemBlock extends ItemBlockBase{ public TheItemBlock(Block block){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java index fe4a88625..8b72114ef 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java @@ -46,11 +46,6 @@ public class BlockOilGenerator extends BlockContainerBase{ this.setTickRandomly(true); } - @Override - protected PropertyInteger getMetaProperty(){ - return META; - } - @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityOilGenerator(); @@ -83,6 +78,11 @@ public class BlockOilGenerator extends BlockContainerBase{ return EnumRarity.RARE; } + @Override + protected PropertyInteger getMetaProperty(){ + return META; + } + @Override public void breakBlock(World world, BlockPos pos, IBlockState state){ this.dropInventory(world, pos); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantomBooster.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantomBooster.java index 864dda1b0..eef04cd9d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantomBooster.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantomBooster.java @@ -32,12 +32,12 @@ public class BlockPhantomBooster extends BlockContainerBase{ } @Override - public boolean isOpaqueCube(){ + public boolean isFullCube(){ return false; } @Override - public boolean isFullCube(){ + public boolean isOpaqueCube(){ return false; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSlabs.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSlabs.java index 29d1da66f..4bc6355c8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSlabs.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSlabs.java @@ -31,6 +31,7 @@ import java.util.List; public class BlockSlabs extends BlockBase{ + private static final PropertyInteger META = PropertyInteger.create("meta", 0, 1); private Block fullBlock; private int meta; @@ -38,8 +39,6 @@ public class BlockSlabs extends BlockBase{ this(name, fullBlock, 0); } - private static final PropertyInteger META = PropertyInteger.create("meta", 0, 1); - public BlockSlabs(String name, Block fullBlock, int meta){ super(fullBlock.getMaterial(), name); this.setHardness(1.5F); @@ -48,11 +47,6 @@ public class BlockSlabs extends BlockBase{ this.meta = meta; } - @Override - protected PropertyInteger getMetaProperty(){ - return META; - } - @Override public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB axis, List list, Entity entity){ this.setBlockBoundsBasedOnState(world, pos); @@ -98,6 +92,11 @@ public class BlockSlabs extends BlockBase{ return EnumRarity.COMMON; } + @Override + protected PropertyInteger getMetaProperty(){ + return META; + } + public static class TheItemBlock extends ItemBlockBase{ public TheItemBlock(Block block){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java index 5528a9822..dadc6f880 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java @@ -47,18 +47,20 @@ public class BlockSmileyCloud extends BlockContainerBase{ this.setStepSound(soundTypeCloth); this.setTickRandomly(true); } - @Override - protected PropertyInteger getMetaProperty(){ - return META; - } @Override - public boolean isOpaqueCube(){ + public boolean isFullCube(){ return false; } @Override - public boolean isFullCube(){ + public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB axis, List list, Entity entity){ + this.setBlockBoundsBasedOnState(world, pos); + super.addCollisionBoxesToList(world, pos, state, axis, list, entity); + } + + @Override + public boolean isOpaqueCube(){ return false; } @@ -88,12 +90,6 @@ public class BlockSmileyCloud extends BlockContainerBase{ return true; } - @Override - public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB axis, List list, Entity entity){ - this.setBlockBoundsBasedOnState(world, pos); - super.addCollisionBoxesToList(world, pos, state, axis, list, entity); - } - @Override public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos pos){ int meta = PosUtil.getMetadata(pos, world); @@ -148,4 +144,9 @@ public class BlockSmileyCloud extends BlockContainerBase{ super.onBlockPlacedBy(world, pos, state, player, stack); } + + @Override + protected PropertyInteger getMetaProperty(){ + return META; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockTreasureChest.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockTreasureChest.java index d8eed6bc5..18e4745fc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockTreasureChest.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockTreasureChest.java @@ -46,11 +46,6 @@ public class BlockTreasureChest extends BlockBase{ this.setTickRandomly(true); } - @Override - protected PropertyInteger getMetaProperty(){ - return META; - } - @Override @SideOnly(Side.CLIENT) public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand){ @@ -80,11 +75,6 @@ public class BlockTreasureChest extends BlockBase{ return true; } - @Override - public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player){ - return false; - } - @Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3; @@ -103,6 +93,11 @@ public class BlockTreasureChest extends BlockBase{ } } + @Override + public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player){ + return false; + } + private void dropItems(World world, BlockPos pos){ for(int i = 0; i < MathHelper.getRandomIntegerInRange(Util.RANDOM, 3, 6); i++){ TreasureChestLoot theReturn = WeightedRandom.getRandomItem(Util.RANDOM, ActuallyAdditionsAPI.treasureChestLoot); @@ -129,4 +124,9 @@ public class BlockTreasureChest extends BlockBase{ public EnumRarity getRarity(ItemStack stack){ return EnumRarity.EPIC; } + + @Override + protected PropertyInteger getMetaProperty(){ + return META; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java index ac790f06f..a76346f84 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java @@ -48,37 +48,12 @@ public class BlockWildPlant extends BlockBushBase{ this.setStepSound(soundTypeGrass); } - @Override - protected PropertyInteger getMetaProperty(){ - return META; - } - @Override public boolean canBlockStay(World world, BlockPos pos, IBlockState state){ BlockPos offset = PosUtil.offset(pos, 0, -1, 0); return PosUtil.getMetadata(pos, world) == TheWildPlants.RICE.ordinal() ? PosUtil.getMaterial(offset, world) == Material.water : PosUtil.getBlock(offset, world).canSustainPlant(world, offset, EnumFacing.UP, this); } - @Override - public Class getItemBlock(){ - return TheItemBlock.class; - } - - @Override - public boolean shouldAddCreative(){ - return false; - } - - @Override - public EnumRarity getRarity(ItemStack stack){ - return stack.getItemDamage() >= allWildPlants.length ? EnumRarity.COMMON : allWildPlants[stack.getItemDamage()].rarity; - } - - @Override - public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player){ - return false; - } - @Override @SideOnly(Side.CLIENT) public Item getItem(World world, BlockPos pos){ @@ -94,6 +69,17 @@ public class BlockWildPlant extends BlockBushBase{ } } + @Override + public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune){ + int metadata = state.getBlock().getMetaFromState(state); + return metadata >= allWildPlants.length ? null : allWildPlants[metadata].wildVersionOf.getDrops(world, pos, allWildPlants[metadata].wildVersionOf.getStateFromMeta(7), fortune); + } + + @Override + public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player){ + return false; + } + @Override protected void registerRendering(){ ResourceLocation[] resLocs = new ResourceLocation[allWildPlants.length]; @@ -106,9 +92,23 @@ public class BlockWildPlant extends BlockBushBase{ } @Override - public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune){ - int metadata = state.getBlock().getMetaFromState(state); - return metadata >= allWildPlants.length ? null : allWildPlants[metadata].wildVersionOf.getDrops(world, pos, allWildPlants[metadata].wildVersionOf.getStateFromMeta(7), fortune); + public Class getItemBlock(){ + return TheItemBlock.class; + } + + @Override + public boolean shouldAddCreative(){ + return false; + } + + @Override + public EnumRarity getRarity(ItemStack stack){ + return stack.getItemDamage() >= allWildPlants.length ? EnumRarity.COMMON : allWildPlants[stack.getItemDamage()].rarity; + } + + @Override + protected PropertyInteger getMetaProperty(){ + return META; } public static class TheItemBlock extends ItemBlockBase{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockXPSolidifier.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockXPSolidifier.java index b9fc6797d..ab5dc92d0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockXPSolidifier.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockXPSolidifier.java @@ -44,11 +44,6 @@ public class BlockXPSolidifier extends BlockContainerBase{ this.setStepSound(soundTypeStone); } - @Override - protected PropertyInteger getMetaProperty(){ - return META; - } - @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityXPSolidifier(); @@ -91,6 +86,11 @@ public class BlockXPSolidifier extends BlockContainerBase{ super.onBlockPlacedBy(world, pos, state, player, stack); } + @Override + protected PropertyInteger getMetaProperty(){ + return META; + } + @Override public void breakBlock(World world, BlockPos pos, IBlockState state){ this.dropInventory(world, pos); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBase.java index b420cb2d6..9cefdf4b2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBase.java @@ -47,10 +47,6 @@ public class BlockBase extends Block{ this.registerRendering(); } - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); - } - protected String getBaseName(){ return this.name; } @@ -63,13 +59,12 @@ public class BlockBase extends Block{ return true; } - public EnumRarity getRarity(ItemStack stack){ - return EnumRarity.COMMON; + protected void registerRendering(){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); } - @Override - protected BlockState createBlockState(){ - return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty()); + public EnumRarity getRarity(ItemStack stack){ + return EnumRarity.COMMON; } @Override @@ -82,6 +77,11 @@ public class BlockBase extends Block{ return this.getMetaProperty() == null ? super.getMetaFromState(state) : state.getValue(this.getMetaProperty()); } + @Override + protected BlockState createBlockState(){ + return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty()); + } + protected PropertyInteger getMetaProperty(){ return null; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBushBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBushBase.java index ded9017f7..e06ec6201 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBushBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBushBase.java @@ -46,10 +46,6 @@ public class BlockBushBase extends BlockBush{ this.registerRendering(); } - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); - } - protected String getBaseName(){ return this.name; } @@ -62,13 +58,12 @@ public class BlockBushBase extends BlockBush{ return true; } - public EnumRarity getRarity(ItemStack stack){ - return EnumRarity.COMMON; + protected void registerRendering(){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); } - @Override - protected BlockState createBlockState(){ - return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty()); + public EnumRarity getRarity(ItemStack stack){ + return EnumRarity.COMMON; } @Override @@ -81,6 +76,11 @@ public class BlockBushBase extends BlockBush{ return this.getMetaProperty() == null ? super.getMetaFromState(state) : state.getValue(this.getMetaProperty()); } + @Override + protected BlockState createBlockState(){ + return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty()); + } + protected PropertyInteger getMetaProperty(){ return null; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java index 2090ac41c..abc4adbdf 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java @@ -65,10 +65,6 @@ public abstract class BlockContainerBase extends BlockContainer{ this.registerRendering(); } - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); - } - protected String getBaseName(){ return this.name; } @@ -81,6 +77,10 @@ public abstract class BlockContainerBase extends BlockContainer{ return true; } + protected void registerRendering(){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + } + public EnumRarity getRarity(ItemStack stack){ return EnumRarity.COMMON; } @@ -117,6 +117,45 @@ public abstract class BlockContainerBase extends BlockContainer{ } } + public boolean tryToggleRedstone(World world, BlockPos pos, EntityPlayer player){ + ItemStack stack = player.getCurrentEquippedItem(); + if(stack != null && Block.getBlockFromItem(stack.getItem()) instanceof BlockRedstoneTorch){ + TileEntity tile = world.getTileEntity(pos); + if(tile instanceof IRedstoneToggle){ + if(!world.isRemote){ + ((IRedstoneToggle)tile).toggle(!((IRedstoneToggle)tile).isPulseMode()); + tile.markDirty(); + + if(tile instanceof TileEntityBase){ + ((TileEntityBase)tile).sendUpdate(); + } + } + return true; + } + } + return false; + } + + @Override + public IBlockState getStateFromMeta(int meta){ + return this.getMetaProperty() == null ? super.getStateFromMeta(meta) : this.getDefaultState().withProperty(this.getMetaProperty(), meta); + } + + @Override + public int getMetaFromState(IBlockState state){ + return this.getMetaProperty() == null ? super.getMetaFromState(state) : state.getValue(this.getMetaProperty()); + } + + @Override + public void updateTick(World world, BlockPos pos, IBlockState state, Random random){ + if(!world.isRemote){ + TileEntity tile = world.getTileEntity(pos); + if(tile instanceof IRedstoneToggle && ((IRedstoneToggle)tile).isPulseMode()){ + ((IRedstoneToggle)tile).activateOnPulse(); + } + } + } + @Override public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block neighborBlock){ this.updateRedstoneState(world, pos); @@ -142,13 +181,8 @@ public abstract class BlockContainerBase extends BlockContainer{ } @Override - public void updateTick(World world, BlockPos pos, IBlockState state, Random random){ - if(!world.isRemote){ - TileEntity tile = world.getTileEntity(pos); - if(tile instanceof IRedstoneToggle && ((IRedstoneToggle)tile).isPulseMode()){ - ((IRedstoneToggle)tile).activateOnPulse(); - } - } + public void onBlockAdded(World world, BlockPos pos, IBlockState state){ + this.updateRedstoneState(world, pos); } @Override @@ -203,6 +237,11 @@ public abstract class BlockContainerBase extends BlockContainer{ return 0; } + @Override + protected BlockState createBlockState(){ + return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty()); + } + @Override public ArrayList getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune){ ArrayList drops = new ArrayList(); @@ -246,45 +285,6 @@ public abstract class BlockContainerBase extends BlockContainer{ return drops; } - @Override - public void onBlockAdded(World world, BlockPos pos, IBlockState state){ - this.updateRedstoneState(world, pos); - } - - public boolean tryToggleRedstone(World world, BlockPos pos, EntityPlayer player){ - ItemStack stack = player.getCurrentEquippedItem(); - if(stack != null && Block.getBlockFromItem(stack.getItem()) instanceof BlockRedstoneTorch){ - TileEntity tile = world.getTileEntity(pos); - if(tile instanceof IRedstoneToggle){ - if(!world.isRemote){ - ((IRedstoneToggle)tile).toggle(!((IRedstoneToggle)tile).isPulseMode()); - tile.markDirty(); - - if(tile instanceof TileEntityBase){ - ((TileEntityBase)tile).sendUpdate(); - } - } - return true; - } - } - return false; - } - - @Override - protected BlockState createBlockState(){ - return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty()); - } - - @Override - public IBlockState getStateFromMeta(int meta){ - return this.getMetaProperty() == null ? super.getStateFromMeta(meta) : this.getDefaultState().withProperty(this.getMetaProperty(), meta); - } - - @Override - public int getMetaFromState(IBlockState state){ - return this.getMetaProperty() == null ? super.getMetaFromState(state) : state.getValue(this.getMetaProperty()); - } - protected PropertyInteger getMetaProperty(){ return null; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java index 03f9c8684..d38943865 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java @@ -47,6 +47,49 @@ public class BlockPlant extends BlockCrops{ this.register(); } + private void register(){ + this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); + GameRegistry.registerBlock(this, this.getItemBlock(), this.getBaseName()); + if(this.shouldAddCreative()){ + this.setCreativeTab(CreativeTab.instance); + } + else{ + this.setCreativeTab(null); + } + + this.registerRendering(); + } + + protected String getBaseName(){ + return this.name; + } + + protected Class getItemBlock(){ + return ItemBlockBase.class; + } + + public boolean shouldAddCreative(){ + return false; + } + + protected void registerRendering(){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + } + + public EnumRarity getRarity(ItemStack stack){ + return EnumRarity.RARE; + } + + @Override + public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos){ + return EnumPlantType.Crop; + } + + @Override + public int damageDropped(IBlockState state){ + return this.getMetaFromState(state) >= 7 ? this.returnMeta : 0; + } + @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing facing, float hitX, float hitY, float hitZ){ if(getMetaFromState(state) >= 7){ @@ -73,73 +116,30 @@ public class BlockPlant extends BlockCrops{ return true; } return false; - } - - private void register(){ - this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); - GameRegistry.registerBlock(this, this.getItemBlock(), this.getBaseName()); - if(this.shouldAddCreative()){ - this.setCreativeTab(CreativeTab.instance); - } - else{ - this.setCreativeTab(null); - } - - this.registerRendering(); - } - - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); - } - - protected String getBaseName(){ - return this.name; - } - - protected Class getItemBlock(){ - return ItemBlockBase.class; - } - - public boolean shouldAddCreative(){ - return false; - } - - public EnumRarity getRarity(ItemStack stack){ - return EnumRarity.RARE; - } - - @Override - public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos){ - return EnumPlantType.Crop; - } - - @Override + } @Override public Item getSeed(){ return this.seedItem; } @Override + public int getDamageValue(World world, BlockPos pos){ + return 0; + } @Override public Item getCrop(){ return this.returnItem; } @Override + public int quantityDropped(IBlockState state, int fortune, Random random){ + return this.getMetaFromState(state) >= 7 ? random.nextInt(addDropAmount)+minDropAmount : super.quantityDropped(state, fortune, random); + } @Override public Item getItemDropped(IBlockState state, Random rand, int par3){ return this.getMetaFromState(state) >= 7 ? this.getCrop() : this.getSeed(); } - @Override - public int damageDropped(IBlockState state){ - return this.getMetaFromState(state) >= 7 ? this.returnMeta : 0; - } - @Override - public int getDamageValue(World world, BlockPos pos){ - return 0; - } - @Override - public int quantityDropped(IBlockState state, int fortune, Random random){ - return this.getMetaFromState(state) >= 7 ? random.nextInt(addDropAmount)+minDropAmount : super.quantityDropped(state, fortune, random); - } + + + } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockStair.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockStair.java index 0717d9014..6b1d3f824 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockStair.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockStair.java @@ -50,10 +50,6 @@ public class BlockStair extends BlockStairs{ this.registerRendering(); } - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); - } - protected String getBaseName(){ return this.name; } @@ -66,6 +62,10 @@ public class BlockStair extends BlockStairs{ return true; } + protected void registerRendering(){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + } + public EnumRarity getRarity(ItemStack stack){ return EnumRarity.COMMON; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockWallAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockWallAA.java index 64270b3b3..3b9ef2ed9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockWallAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockWallAA.java @@ -49,16 +49,9 @@ public class BlockWallAA extends BlockBase{ this.setDefaultState(this.blockState.getBaseState().withProperty(BlockWall.UP, false).withProperty(BlockWall.NORTH, false).withProperty(BlockWall.EAST, false).withProperty(BlockWall.SOUTH, false).withProperty(BlockWall.WEST, false)); } - @SuppressWarnings("unchecked") @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item item, CreativeTabs tab, List list){ - list.add(new ItemStack(item, 1, 0)); - } - - @Override - public int damageDropped(IBlockState state){ - return meta; + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos){ + return state.withProperty(BlockWall.UP, !worldIn.isAirBlock(pos.up())).withProperty(BlockWall.NORTH, this.canConnectTo(worldIn, pos.north())).withProperty(BlockWall.EAST, this.canConnectTo(worldIn, pos.east())).withProperty(BlockWall.SOUTH, this.canConnectTo(worldIn, pos.south())).withProperty(BlockWall.WEST, this.canConnectTo(worldIn, pos.west())); } @Override @@ -71,11 +64,29 @@ public class BlockWallAA extends BlockBase{ return false; } + @Override + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side){ + return side != EnumFacing.DOWN || super.shouldSideBeRendered(worldIn, pos, side); + } + + @Override + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state){ + this.setBlockBoundsBasedOnState(worldIn, pos); + this.maxY = 1.5D; + return super.getCollisionBoundingBox(worldIn, pos, state); + } + @Override public boolean isOpaqueCube(){ return false; } + @Override + public int damageDropped(IBlockState state){ + return meta; + } + @Override public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos){ boolean flag = this.canConnectTo(worldIn, pos.north()); @@ -115,11 +126,11 @@ public class BlockWallAA extends BlockBase{ this.setBlockBounds(f, 0.0F, f2, f1, f4, f3); } + @SuppressWarnings("unchecked") @Override - public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state){ - this.setBlockBoundsBasedOnState(worldIn, pos); - this.maxY = 1.5D; - return super.getCollisionBoundingBox(worldIn, pos, state); + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item item, CreativeTabs tab, List list){ + list.add(new ItemStack(item, 1, 0)); } public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos){ @@ -127,22 +138,6 @@ public class BlockWallAA extends BlockBase{ return block != Blocks.barrier && (!(block != this && !(block instanceof BlockFenceGate)) || ((block.getMaterial().isOpaque() && block.isFullCube()) && block.getMaterial() != Material.gourd)); } - @Override - @SideOnly(Side.CLIENT) - public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side){ - return side != EnumFacing.DOWN || super.shouldSideBeRendered(worldIn, pos, side); - } - - @Override - public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos){ - return state.withProperty(BlockWall.UP, !worldIn.isAirBlock(pos.up())).withProperty(BlockWall.NORTH, this.canConnectTo(worldIn, pos.north())).withProperty(BlockWall.EAST, this.canConnectTo(worldIn, pos.east())).withProperty(BlockWall.SOUTH, this.canConnectTo(worldIn, pos.south())).withProperty(BlockWall.WEST, this.canConnectTo(worldIn, pos.west())); - } - - @Override - protected BlockState createBlockState(){ - return new BlockState(this, BlockWall.UP, BlockWall.NORTH, BlockWall.EAST, BlockWall.WEST, BlockWall.SOUTH); - } - @Override public IBlockState getStateFromMeta(int meta){ return this.getDefaultState(); @@ -152,4 +147,9 @@ public class BlockWallAA extends BlockBase{ public int getMetaFromState(IBlockState state){ return 0; } + + @Override + protected BlockState createBlockState(){ + return new BlockState(this, BlockWall.UP, BlockWall.NORTH, BlockWall.EAST, BlockWall.WEST, BlockWall.SOUTH); + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiBooklet.java index 75424b4d9..e1e4de69d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiBooklet.java @@ -91,11 +91,6 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{ this.saveOnClose = saveOnClose; } - @Override - public void drawHoveringText(List list, int x, int y){ - super.drawHoveringText(list, x, y); - } - public FontRenderer getFontRenderer(){ return this.fontRendererObj; } @@ -197,6 +192,11 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{ } } + @Override + public void drawHoveringText(List list, int x, int y){ + super.drawHoveringText(list, x, y); + } + @Override protected void mouseClicked(int par1, int par2, int par3) throws IOException{ this.searchField.mouseClicked(par1, par2, par3); 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 397355d12..abc86dfdd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -50,7 +50,7 @@ public class InitBooklet{ ActuallyAdditionsAPI.entryMisc = new BookletEntry("misc"); ActuallyAdditionsAPI.allAndSearch = new BookletEntryAllSearch("allAndSearch").setSpecial(); } - + public static void postInit(){ initChapters(); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapter.java index 62c0e29a9..3eb2144af 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapter.java @@ -50,11 +50,6 @@ public class BookletChapter implements IBookletChapter{ return this.pages; } - public BookletChapter setIncomplete(){ - this.isIncomplete = true; - return this; - } - @Override public String getUnlocalizedName(){ return this.unlocalizedName; @@ -80,6 +75,11 @@ public class BookletChapter implements IBookletChapter{ return this.displayStack; } + public BookletChapter setIncomplete(){ + this.isIncomplete = true; + return this; + } + public BookletChapter setImportant(){ this.color = EnumChatFormatting.DARK_GREEN; return this; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/BookletEntry.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/BookletEntry.java index e28709ee5..74011bbc3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/BookletEntry.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/BookletEntry.java @@ -33,29 +33,19 @@ public class BookletEntry implements IBookletEntry{ this.color = EnumChatFormatting.RESET; } - @Override - public String getUnlocalizedName(){ - return this.unlocalizedName; - } - @Override public List getChapters(){ return this.chapters; } - @Override - public String getLocalizedNameWithFormatting(){ - return this.color+this.getLocalizedName(); - } - @Override public void setChapters(List chapters){ this.chapters = chapters; } @Override - public void addChapter(IBookletChapter chapter){ - this.chapters.add(chapter); + public String getUnlocalizedName(){ + return this.unlocalizedName; } @Override @@ -63,6 +53,16 @@ public class BookletEntry implements IBookletEntry{ return StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".indexEntry."+this.unlocalizedName+".name"); } + @Override + public String getLocalizedNameWithFormatting(){ + return this.color+this.getLocalizedName(); + } + + @Override + public void addChapter(IBookletChapter chapter){ + this.chapters.add(chapter); + } + public BookletEntry setImportant(){ this.color = EnumChatFormatting.DARK_GREEN; return this; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/BookletEntryAllSearch.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/BookletEntryAllSearch.java index 89611c055..52599f884 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/BookletEntryAllSearch.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/BookletEntryAllSearch.java @@ -23,16 +23,16 @@ public class BookletEntryAllSearch extends BookletEntry{ super(unlocalizedName); } + @Override + public void setChapters(List chapters){ + this.allChapters = (ArrayList)chapters; + this.chapters = (ArrayList)this.allChapters.clone(); + } + @SuppressWarnings("unchecked") @Override public void addChapter(IBookletChapter chapter){ this.allChapters.add(chapter); this.chapters = (ArrayList)this.allChapters.clone(); } - - @Override - public void setChapters(List chapters){ - this.allChapters = (ArrayList)chapters; - this.chapters = (ArrayList)this.allChapters.clone(); - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/BookletPageAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/BookletPageAA.java index 1e3a6af9a..4eef6f123 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/BookletPageAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/BookletPageAA.java @@ -32,26 +32,11 @@ public class BookletPageAA extends BookletPage{ this.localizationKey = localizationKey; } - @Override - public ItemStack[] getItemStacksForPage(){ - return null; - } - - @Override - public String getClickToSeeRecipeString(){ - return EnumChatFormatting.GOLD+StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".clickToSeeRecipe"); - } - @Override public int getID(){ return Util.arrayContains(this.chapter.getPages(), this)+1; } - public BookletPage setNoText(){ - this.hasNoText = true; - return this; - } - @Override public final String getText(){ if(this.hasNoText){ @@ -74,12 +59,12 @@ public class BookletPageAA extends BookletPage{ } @Override - public void render(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ + public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ } @Override - public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ + public void render(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ } @@ -88,6 +73,21 @@ public class BookletPageAA extends BookletPage{ } + @Override + public ItemStack[] getItemStacksForPage(){ + return null; + } + + @Override + public String getClickToSeeRecipeString(){ + return EnumChatFormatting.GOLD+StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".clickToSeeRecipe"); + } + + public BookletPage setNoText(){ + this.hasNoText = true; + return this; + } + public BookletPageAA addTextReplacement(String text, int replacement){ return this.addTextReplacement(text, Integer.toString(replacement)); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java index a731d02a6..f8fd72b89 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java @@ -72,15 +72,6 @@ public class PageCrafting extends BookletPageAA{ return null; } - @Override - @SideOnly(Side.CLIENT) - public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ - if(this.recipes[this.recipePos] != null){ - Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc); - gui.drawRect(gui.getGuiLeft()+27, gui.getGuiTop()+20, 146, 20, 99, 60); - } - } - @SuppressWarnings("unchecked") @Override @SideOnly(Side.CLIENT) @@ -175,6 +166,15 @@ public class PageCrafting extends BookletPageAA{ } } + @Override + @SideOnly(Side.CLIENT) + public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ + if(this.recipes[this.recipePos] != null){ + Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc); + gui.drawRect(gui.getGuiLeft()+27, gui.getGuiTop()+20, 146, 20, 99, 60); + } + } + @Override @SideOnly(Side.CLIENT) public void updateScreen(int ticksElapsed){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrusherRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrusherRecipe.java index efb564d88..288d874f9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrusherRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrusherRecipe.java @@ -39,11 +39,6 @@ public class PageCrusherRecipe extends BookletPageAA{ this.addToPagesWithItemStackData(); } - @Override - public ItemStack[] getItemStacksForPage(){ - return this.recipe == null ? new ItemStack[0] : this.recipe.getRecipeOutputOnes().toArray(new ItemStack[this.recipe.getRecipeOutputOnes().size()]); - } - @Override @SideOnly(Side.CLIENT) public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ @@ -129,4 +124,9 @@ public class PageCrusherRecipe extends BookletPageAA{ } } } + + @Override + public ItemStack[] getItemStacksForPage(){ + return this.recipe == null ? new ItemStack[0] : this.recipe.getRecipeOutputOnes().toArray(new ItemStack[this.recipe.getRecipeOutputOnes().size()]); + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java index e86abfee7..91cdb638a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java @@ -47,15 +47,6 @@ public class PageFurnace extends BookletPageAA{ return this.result == null ? new ItemStack[0] : new ItemStack[]{this.result}; } - @Override - @SideOnly(Side.CLIENT) - public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ - if(this.input != null || this.getInputForOutput(this.result) != null){ - Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc); - gui.drawRect(gui.getGuiLeft()+37, gui.getGuiTop()+20, 0, 180, 60, 60); - } - } - @SuppressWarnings("unchecked") @Override @SideOnly(Side.CLIENT) @@ -98,6 +89,15 @@ public class PageFurnace extends BookletPageAA{ } } + @Override + @SideOnly(Side.CLIENT) + public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ + if(this.input != null || this.getInputForOutput(this.result) != null){ + Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc); + gui.drawRect(gui.getGuiLeft()+37, gui.getGuiTop()+20, 0, 180, 60, 60); + } + } + private ItemStack getInputForOutput(ItemStack output){ for(Map.Entry o : FurnaceRecipes.instance().getSmeltingList().entrySet()){ ItemStack stack = (ItemStack)(o).getValue(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageReconstructor.java index e61f7b7b8..d74c04856 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageReconstructor.java @@ -43,20 +43,6 @@ public class PageReconstructor extends BookletPageAA{ this.addToPagesWithItemStackData(); } - @Override - public ItemStack[] getItemStacksForPage(){ - if(this.recipes != null){ - ArrayList stacks = new ArrayList(); - for(LensNoneRecipe recipe : this.recipes){ - if(recipe != null){ - stacks.addAll(recipe.getOutputs()); - } - } - return stacks.toArray(new ItemStack[stacks.size()]); - } - return null; - } - @Override @SideOnly(Side.CLIENT) public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ @@ -125,4 +111,18 @@ public class PageReconstructor extends BookletPageAA{ } } } + + @Override + public ItemStack[] getItemStacksForPage(){ + if(this.recipes != null){ + ArrayList stacks = new ArrayList(); + for(LensNoneRecipe recipe : this.recipes){ + if(recipe != null){ + stacks.addAll(recipe.getOutputs()); + } + } + return stacks.toArray(new ItemStack[stacks.size()]); + } + return null; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java b/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java index 1c0dc34f6..fb9c016fd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java @@ -191,7 +191,7 @@ public class CreativeTab extends CreativeTabs{ add(InitItems.itemPaxelCrystalGreen); add(InitItems.itemPaxelCrystalWhite); InitForeignPaxels.addToCreativeTab(); - + add(InitBlocks.blockCrystal); add(InitItems.itemCrystal); 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 94b8deb70..6ccded60d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java @@ -171,7 +171,7 @@ public class InitItems{ public static Item itemPantsCrystalLightBlue; public static Item itemBootsCrystalLightBlue; public static Item itemPaxelCrystalLightBlue; - + public static Item itemPickaxeCrystalBlack; public static Item itemAxeCrystalBlack; public static Item itemShovelCrystalBlack; @@ -204,7 +204,7 @@ public class InitItems{ public static Item itemPantsCrystalWhite; public static Item itemBootsCrystalWhite; public static Item itemPaxelCrystalWhite; - + public static void init(){ ModUtil.LOGGER.info("Initializing Items..."); 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 3d57e3ae7..f805811d6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java @@ -52,16 +52,6 @@ public class ItemBooklet extends ItemBase implements IHudDisplay{ this.setMaxDamage(0); } - @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){ - player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.BOOK.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ); - - if(!world.isRemote){ - player.triggerAchievement(TheAchievements.OPEN_BOOKLET.ach); - } - return stack; - } - @Override public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing face, float hitX, float hitY, float hitZ){ if(player.isSneaking()){ @@ -81,6 +71,16 @@ public class ItemBooklet extends ItemBase implements IHudDisplay{ return false; } + @Override + public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.BOOK.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ); + + if(!world.isRemote){ + player.triggerAchievement(TheAchievements.OPEN_BOOKLET.ach); + } + return stack; + } + @SuppressWarnings("unchecked") @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrystal.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrystal.java index 0dd4a3aa8..3640fd7e9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrystal.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrystal.java @@ -48,6 +48,14 @@ public class ItemCrystal extends ItemBase{ return stack.getItemDamage() >= BlockCrystal.allCrystals.length ? EnumRarity.COMMON : BlockCrystal.allCrystals[stack.getItemDamage()].rarity; } + @SuppressWarnings("all") + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs tab, List list){ + for(int j = 0; j < BlockCrystal.allCrystals.length; j++){ + list.add(new ItemStack(this, 1, j)); + } + } + @Override protected void registerRendering(){ ResourceLocation[] resLocs = new ResourceLocation[BlockCrystal.allCrystals.length]; @@ -58,12 +66,4 @@ public class ItemCrystal extends ItemBase{ } ActuallyAdditions.proxy.addRenderVariant(this, resLocs); } - - @SuppressWarnings("all") - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs tab, List list){ - for(int j = 0; j < BlockCrystal.allCrystals.length; j++){ - list.add(new ItemStack(this, 1, j)); - } - } } \ No newline at end of file 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 556d45123..6421dda39 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java @@ -107,17 +107,6 @@ public class ItemDrill extends ItemEnergy{ return false; } - @Override - protected void registerRendering(){ - ResourceLocation[] resLocs = new ResourceLocation[16]; - for(int i = 0; i < 16; i++){ - String name = this.getBaseName()+TheColoredLampColors.values()[i].name; - resLocs[i] = new ResourceLocation(ModUtil.MOD_ID_LOWER, name); - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(ModUtil.MOD_ID_LOWER, name)); - } - ActuallyAdditions.proxy.addRenderVariant(this, resLocs); - } - /** * Checks if a certain Upgrade is installed and returns it as an ItemStack * @@ -342,6 +331,17 @@ public class ItemDrill extends ItemEnergy{ return this.getHasUpgradeAsStack(stack, upgrade) != null; } + @Override + protected void registerRendering(){ + ResourceLocation[] resLocs = new ResourceLocation[16]; + for(int i = 0; i < 16; i++){ + String name = this.getBaseName()+TheColoredLampColors.values()[i].name; + resLocs[i] = new ResourceLocation(ModUtil.MOD_ID_LOWER, name); + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(ModUtil.MOD_ID_LOWER, name)); + } + ActuallyAdditions.proxy.addRenderVariant(this, resLocs); + } + @Override @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java index 3167d7bbd..e8bb77c13 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java @@ -79,6 +79,14 @@ public class ItemPhantomConnector extends ItemBase{ } } + public static World getStoredWorld(ItemStack stack){ + NBTTagCompound tag = stack.getTagCompound(); + if(tag != null){ + return DimensionManager.getWorld(tag.getInteger("WorldOfTileStored")); + } + return null; + } + public static BlockPos getStoredPosition(ItemStack stack){ NBTTagCompound tag = stack.getTagCompound(); if(tag != null){ @@ -92,14 +100,6 @@ public class ItemPhantomConnector extends ItemBase{ return null; } - public static World getStoredWorld(ItemStack stack){ - NBTTagCompound tag = stack.getTagCompound(); - if(tag != null){ - return DimensionManager.getWorld(tag.getInteger("WorldOfTileStored")); - } - return null; - } - public static void clearStorage(ItemStack stack){ stack.setTagCompound(new NBTTagCompound()); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemAllToolAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemAllToolAA.java index 58f30faa6..8c794b77b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemAllToolAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemAllToolAA.java @@ -47,6 +47,11 @@ public class ItemAllToolAA extends ItemTool{ private ItemStack repairItem; private String repairOredict; + public ItemAllToolAA(ToolMaterial toolMat, String repairItem, String unlocalizedName, EnumRarity rarity, int color){ + this(toolMat, (ItemStack)null, unlocalizedName, rarity, color); + this.repairOredict = repairItem; + } + public ItemAllToolAA(ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, EnumRarity rarity, int color){ super(4.0F, toolMat, new HashSet()); @@ -60,11 +65,6 @@ public class ItemAllToolAA extends ItemTool{ this.register(); } - public ItemAllToolAA(ToolMaterial toolMat, String repairItem, String unlocalizedName, EnumRarity rarity, int color){ - this(toolMat, (ItemStack)null, unlocalizedName, rarity, color); - this.repairOredict = repairItem; - } - private void register(){ this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); GameRegistry.registerItem(this, this.getBaseName()); @@ -79,11 +79,6 @@ public class ItemAllToolAA extends ItemTool{ this.registerRendering(); } - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, "itemPaxel")); - ActuallyAdditions.proxy.addRenderVariant(this, new ResourceLocation(ModUtil.MOD_ID_LOWER, "itemPaxel")); - } - protected String getBaseName(){ return this.name; } @@ -92,6 +87,11 @@ public class ItemAllToolAA extends ItemTool{ return true; } + protected void registerRendering(){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, "itemPaxel")); + ActuallyAdditions.proxy.addRenderVariant(this, new ResourceLocation(ModUtil.MOD_ID_LOWER, "itemPaxel")); + } + @Override public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ){ if(!playerIn.canPlayerEdit(pos.offset(side), side, stack)){ 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 d622568c9..02c77af81 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 @@ -26,6 +26,10 @@ public class ItemArmorAA extends ItemArmor{ private String name; private EnumRarity rarity; + public ItemArmorAA(String name, ArmorMaterial material, int type, ItemStack repairItem, String textureBase){ + this(name, material, type, repairItem, textureBase, EnumRarity.RARE); + } + public ItemArmorAA(String name, ArmorMaterial material, int type, ItemStack repairItem, String textureBase, EnumRarity rarity){ super(material, 0, type); this.repairItem = repairItem; @@ -35,10 +39,6 @@ public class ItemArmorAA extends ItemArmor{ this.register(); } - public ItemArmorAA(String name, ArmorMaterial material, int type, ItemStack repairItem, String textureBase){ - this(name, material, type, repairItem, textureBase, EnumRarity.RARE); - } - private void register(){ this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); GameRegistry.registerItem(this, this.getBaseName()); @@ -52,10 +52,6 @@ public class ItemArmorAA extends ItemArmor{ this.registerRendering(); } - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); - } - protected String getBaseName(){ return this.name; } @@ -64,6 +60,10 @@ public class ItemArmorAA extends ItemArmor{ return true; } + protected void registerRendering(){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + } + @Override public EnumRarity getRarity(ItemStack stack){ return this.rarity; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemAxeAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemAxeAA.java index 0d0aaac5f..88dcd4e7b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemAxeAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemAxeAA.java @@ -49,10 +49,6 @@ public class ItemAxeAA extends ItemAxe{ this.registerRendering(); } - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); - } - protected String getBaseName(){ return this.name; } @@ -61,6 +57,10 @@ public class ItemAxeAA extends ItemAxe{ return true; } + protected void registerRendering(){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + } + @Override public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){ return ItemUtil.areItemsEqual(this.repairItem, stack, false); 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 c06a5fea5..f54470f57 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 @@ -42,10 +42,6 @@ public class ItemBase extends Item{ this.registerRendering(); } - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); - } - protected String getBaseName(){ return this.name; } @@ -53,4 +49,8 @@ public class ItemBase extends Item{ public boolean shouldAddCreative(){ return true; } + + protected void registerRendering(){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemBucketAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemBucketAA.java index db657d632..509c89a7c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemBucketAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemBucketAA.java @@ -46,10 +46,6 @@ public class ItemBucketAA extends ItemBucket{ this.registerRendering(); } - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); - } - protected String getBaseName(){ return this.name; } @@ -58,6 +54,10 @@ public class ItemBucketAA extends ItemBucket{ return true; } + protected void registerRendering(){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.UNCOMMON; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemEnergy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemEnergy.java index 01b3b36d0..129ebc385 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemEnergy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemEnergy.java @@ -53,10 +53,6 @@ public abstract class ItemEnergy extends ItemEnergyContainer{ this.registerRendering(); } - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); - } - protected String getBaseName(){ return this.name; } @@ -65,6 +61,10 @@ public abstract class ItemEnergy extends ItemEnergyContainer{ return true; } + protected void registerRendering(){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + } + @Override public boolean getShareTag(){ return true; @@ -81,6 +81,12 @@ public abstract class ItemEnergy extends ItemEnergyContainer{ list.add(this.getEnergyStored(stack)+"/"+this.getMaxEnergyStored(stack)+" RF"); } + @Override + @SideOnly(Side.CLIENT) + public boolean hasEffect(ItemStack stack){ + return false; + } + @Override @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) @@ -106,12 +112,6 @@ public abstract class ItemEnergy extends ItemEnergyContainer{ return energyDif/maxAmount; } - @Override - @SideOnly(Side.CLIENT) - public boolean hasEffect(ItemStack stack){ - return false; - } - public void setEnergy(ItemStack stack, int energy){ NBTTagCompound compound = stack.getTagCompound(); if(compound == null){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemFoodBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemFoodBase.java index 963c357ed..a185c9f5d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemFoodBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemFoodBase.java @@ -43,10 +43,6 @@ public class ItemFoodBase extends ItemFood{ this.registerRendering(); } - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); - } - protected String getBaseName(){ return this.name; } @@ -54,4 +50,8 @@ public class ItemFoodBase extends ItemFood{ public boolean shouldAddCreative(){ return true; } + + protected void registerRendering(){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + } } 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 15c227873..03ed69239 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 @@ -50,10 +50,6 @@ public class ItemHoeAA extends ItemHoe{ this.registerRendering(); } - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); - } - protected String getBaseName(){ return this.name; } @@ -62,6 +58,10 @@ public class ItemHoeAA extends ItemHoe{ return true; } + protected void registerRendering(){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + } + @Override public EnumRarity getRarity(ItemStack stack){ return this.rarity; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemPickaxeAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemPickaxeAA.java index ea8a11b27..a9d084248 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemPickaxeAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemPickaxeAA.java @@ -49,10 +49,6 @@ public class ItemPickaxeAA extends ItemPickaxe{ this.registerRendering(); } - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); - } - protected String getBaseName(){ return this.name; } @@ -61,6 +57,10 @@ public class ItemPickaxeAA extends ItemPickaxe{ return true; } + protected void registerRendering(){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + } + @Override public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){ return ItemUtil.areItemsEqual(this.repairItem, stack, false); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemSeed.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemSeed.java index 6ade78b73..0a02f544d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemSeed.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemSeed.java @@ -57,10 +57,6 @@ public class ItemSeed extends ItemSeeds{ this.registerRendering(); } - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); - } - protected String getBaseName(){ return this.name; } @@ -69,6 +65,10 @@ public class ItemSeed extends ItemSeeds{ return true; } + protected void registerRendering(){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.RARE; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemShovelAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemShovelAA.java index eab2eed72..8fb0a68ea 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemShovelAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemShovelAA.java @@ -50,10 +50,6 @@ public class ItemShovelAA extends ItemSpade{ this.registerRendering(); } - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); - } - protected String getBaseName(){ return this.name; } @@ -62,6 +58,10 @@ public class ItemShovelAA extends ItemSpade{ return true; } + protected void registerRendering(){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + } + @Override public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){ return ItemUtil.areItemsEqual(this.repairItem, stack, false); 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 6f19ca07c..90ec82529 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 @@ -50,10 +50,6 @@ public class ItemSwordAA extends ItemSword{ this.registerRendering(); } - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); - } - protected String getBaseName(){ return this.name; } @@ -62,6 +58,10 @@ public class ItemSwordAA extends ItemSword{ return true; } + protected void registerRendering(){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + } + protected Class getItemBlock(){ return ItemBlockBase.class; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java index 75dc4ac74..5639d7455 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java @@ -72,7 +72,7 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin{ ignoreList.ignoreNbtTagNames(InitItems.itemBatteryTriple, "Energy"); ignoreList.ignoreNbtTagNames(InitItems.itemBatteryQuadruple, "Energy"); ignoreList.ignoreNbtTagNames(InitItems.itemBatteryQuintuple, "Energy"); - + IItemBlacklist blacklist = this.helpers.getItemBlacklist(); blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockRice)); blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockCanola)); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/RecipeWrapperWithButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/RecipeWrapperWithButton.java index df015a254..d55566354 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/RecipeWrapperWithButton.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/RecipeWrapperWithButton.java @@ -36,6 +36,10 @@ public abstract class RecipeWrapperWithButton{ }; } + public abstract int getButtonX(); + + public abstract int getButtonY(); + public boolean handleClick(Minecraft mc, int mouseX, int mouseY){ if(this.theButton.mousePressed(mc, mouseX, mouseY)){ this.theButton.playPressSound(mc.getSoundHandler()); @@ -52,12 +56,9 @@ public abstract class RecipeWrapperWithButton{ return false; } + public abstract BookletPage getPage(); + public void updateButton(Minecraft mc, int mouseX, int mouseY){ this.theButton.drawButton(mc, mouseX, mouseY); } - - public abstract BookletPage getPage(); - - public abstract int getButtonX(); - public abstract int getButtonY(); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java index 8c58e3cd7..8c7f099c3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java @@ -96,11 +96,6 @@ public class BookletRecipeWrapper extends RecipeWrapperWithButton implements IRe return this.handleClick(minecraft, mouseX, mouseY); } - @Override - public BookletPage getPage(){ - return this.thePage; - } - @Override public int getButtonX(){ return 0; @@ -110,4 +105,9 @@ public class BookletRecipeWrapper extends RecipeWrapperWithButton implements IRe public int getButtonY(){ return 84; } + + @Override + public BookletPage getPage(){ + return this.thePage; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java index 0d9683ca1..11086038f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java @@ -104,11 +104,6 @@ public class CoffeeMachineRecipeWrapper extends RecipeWrapperWithButton implemen return this.handleClick(minecraft, mouseX, mouseY); } - @Override - public BookletPage getPage(){ - return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockCoffeeMachine)); - } - @Override public int getButtonX(){ return 0; @@ -118,4 +113,9 @@ public class CoffeeMachineRecipeWrapper extends RecipeWrapperWithButton implemen public int getButtonY(){ return 70; } + + @Override + public BookletPage getPage(){ + return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockCoffeeMachine)); + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java index 33013a99b..7191d2ffe 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java @@ -93,11 +93,6 @@ public class CrusherRecipeWrapper extends RecipeWrapperWithButton implements IRe return this.handleClick(minecraft, mouseX, mouseY); } - @Override - public BookletPage getPage(){ - return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockGrinder)); - } - @Override public int getButtonX(){ return -5; @@ -107,4 +102,9 @@ public class CrusherRecipeWrapper extends RecipeWrapperWithButton implements IRe public int getButtonY(){ return 26; } + + @Override + public BookletPage getPage(){ + return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockGrinder)); + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeCategory.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeCategory.java index 04279d3c2..6608d1111 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeCategory.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeCategory.java @@ -26,8 +26,8 @@ import javax.annotation.Nonnull; public class ReconstructorRecipeCategory implements IRecipeCategory{ - private IDrawable background; private static final ItemStack RECONSTRUCTOR = new ItemStack(InitBlocks.blockAtomicReconstructor); + private IDrawable background; public ReconstructorRecipeCategory(IGuiHelper helper){ this.background = helper.createDrawable(AssetUtil.getGuiLocation("guiNEIAtomicReconstructor"), 0, 0, 96, 60); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java index a663225df..8813147f6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java @@ -79,11 +79,6 @@ public class ReconstructorRecipeWrapper extends RecipeWrapperWithButton implemen return this.handleClick(minecraft, mouseX, mouseY); } - @Override - public BookletPage getPage(){ - return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockAtomicReconstructor)); - } - @Override public int getButtonX(){ return 3; @@ -93,4 +88,9 @@ public class ReconstructorRecipeWrapper extends RecipeWrapperWithButton implemen public int getButtonY(){ return 40; } + + @Override + public BookletPage getPage(){ + return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockAtomicReconstructor)); + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/ore/InitOreDict.java b/src/main/java/de/ellpeck/actuallyadditions/mod/ore/InitOreDict.java index ac79e6366..6d66e3be0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/ore/InitOreDict.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/ore/InitOreDict.java @@ -64,10 +64,6 @@ public class InitOreDict{ addOre(InitItems.itemCrystal, TheCrystals.REDSTONE.ordinal(), "actAddCrystalRed"); } - private static void addOre(ItemStack stack, String name){ - OreDictionary.registerOre(name, stack); - } - private static void addOre(Item item, int meta, String name){ addOre(new ItemStack(item, 1, meta), name); } @@ -76,11 +72,15 @@ public class InitOreDict{ addOre(item, 0, name); } + private static void addOre(Block block, String name){ + addOre(block, 0, name); + } + private static void addOre(Block block, int meta, String name){ addOre(new ItemStack(block, 1, meta), name); } - private static void addOre(Block block, String name){ - addOre(block, 0, name); + private static void addOre(ItemStack stack, String name){ + OreDictionary.registerOre(name, stack); } } 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 86bb4a359..2c7e01d30 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java @@ -46,15 +46,13 @@ import java.util.Map; public class ClientProxy implements IProxy{ - private static Map modelLocationsForRegistering = new HashMap(); - private static Map modelVariantsForRegistering = new HashMap(); - public static boolean pumpkinBlurPumpkinBlur; public static boolean jingleAllTheWay; public static boolean bulletForMyValentine; - public static int bookletWordCount; public static int bookletCharCount; + private static Map modelLocationsForRegistering = new HashMap(); + private static Map modelVariantsForRegistering = new HashMap(); @Override public void preInit(FMLPreInitializationEvent event){ @@ -101,6 +99,26 @@ public class ClientProxy implements IProxy{ ModelLoader.setCustomStateMapper(block, mapper); } + private static void countBookletWords(){ + bookletWordCount = 0; + bookletCharCount = 0; + + for(IBookletEntry entry : ActuallyAdditionsAPI.bookletEntries){ + for(IBookletChapter chapter : entry.getChapters()){ + for(BookletPage page : chapter.getPages()){ + if(page.getText() != null){ + bookletWordCount += page.getText().split(" ").length; + bookletCharCount += page.getText().length(); + } + } + bookletWordCount += chapter.getLocalizedName().split(" ").length; + bookletCharCount += chapter.getLocalizedName().length(); + } + bookletWordCount += entry.getLocalizedName().split(" ").length; + bookletCharCount += entry.getLocalizedName().length(); + } + } + @Override public void init(FMLInitializationEvent event){ ModUtil.LOGGER.info("Initializing ClientProxy..."); @@ -144,24 +162,4 @@ public class ClientProxy implements IProxy{ public void addRenderVariant(Item item, ResourceLocation... location){ modelVariantsForRegistering.put(item, location); } - - private static void countBookletWords(){ - bookletWordCount = 0; - bookletCharCount = 0; - - for(IBookletEntry entry : ActuallyAdditionsAPI.bookletEntries){ - for(IBookletChapter chapter : entry.getChapters()){ - for(BookletPage page : chapter.getPages()){ - if(page.getText() != null){ - bookletWordCount += page.getText().split(" ").length; - bookletCharCount += page.getText().length(); - } - } - bookletWordCount += chapter.getLocalizedName().split(" ").length; - bookletCharCount += chapter.getLocalizedName().length(); - } - bookletWordCount += entry.getLocalizedName().split(" ").length; - bookletCharCount += entry.getLocalizedName().length(); - } - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java index 74d65bdc2..c6bf6c649 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java @@ -43,6 +43,25 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple super(1, "reconstructor"); } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + super.writeSyncableNBT(compound, sync); + compound.setInteger("CurrentTime", this.currentTime); + this.storage.writeToNBT(compound); + } + + @Override + public boolean shouldSyncSlots(){ + return true; + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + super.readSyncableNBT(compound, sync); + this.currentTime = compound.getInteger("CurrentTime"); + this.storage.readFromNBT(compound); + } + @Override @SuppressWarnings("unchecked") public void updateEntity(){ @@ -107,10 +126,33 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("CurrentTime", this.currentTime); - this.storage.writeToNBT(compound); + public int getX(){ + return this.getPos().getX(); + } + + @Override + public int getY(){ + return this.getPos().getY(); + } + + @Override + public int getZ(){ + return this.getPos().getZ(); + } + + @Override + public World getWorldObject(){ + return this.getWorld(); + } + + @Override + public void extractEnergy(int amount){ + this.storage.extractEnergy(amount, false); + } + + @Override + public boolean isItemValidForSlot(int i, ItemStack stack){ + return stack != null && stack.getItem() instanceof ILensItem; } @Override @@ -119,18 +161,6 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple this.sendUpdate(); } - @Override - public boolean shouldSyncSlots(){ - return true; - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.currentTime = compound.getInteger("CurrentTime"); - this.storage.readFromNBT(compound); - } - @Override public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate){ return this.storage.receiveEnergy(maxReceive, simulate); @@ -156,41 +186,11 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple return this.isItemValidForSlot(slot, stack); } - @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return stack != null && stack.getItem() instanceof ILensItem; - } - @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return true; } - @Override - public int getX(){ - return this.getPos().getX(); - } - - @Override - public int getY(){ - return this.getPos().getY(); - } - - @Override - public int getZ(){ - return this.getPos().getZ(); - } - - @Override - public World getWorldObject(){ - return this.getWorld(); - } - - @Override - public void extractEnergy(int amount){ - this.storage.extractEnergy(amount, false); - } - @Override public int getEnergy(){ return this.storage.getEnergyStored(); 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 4d50427eb..5ee48df56 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java @@ -28,8 +28,8 @@ import net.minecraftforge.fml.common.registry.GameRegistry; public abstract class TileEntityBase extends TileEntity implements ITickable{ - protected int ticksElapsed; public boolean isRedstonePowered; + protected int ticksElapsed; public static void init(){ ModUtil.LOGGER.info("Registering TileEntities..."); @@ -91,15 +91,6 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{ this.writeSyncableNBT(compound, false); } - @Override - public final void update(){ - this.updateEntity(); - } - - public void updateEntity(){ - this.ticksElapsed++; - } - @Override public final Packet getDescriptionPacket(){ NBTTagCompound compound = this.getSyncCompound(); @@ -123,6 +114,16 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{ return !(oldState.getBlock().isAssociatedBlock(newState.getBlock())); } + public void receiveSyncCompound(NBTTagCompound compound){ + this.readSyncableNBT(compound, true); + } + + public NBTTagCompound getSyncCompound(){ + NBTTagCompound tag = new NBTTagCompound(); + this.writeSyncableNBT(tag, true); + return tag; + } + public void writeSyncableNBT(NBTTagCompound compound, boolean isForSync){ if(this instanceof IRedstoneToggle){ compound.setBoolean("IsPulseMode", ((IRedstoneToggle)this).isPulseMode()); @@ -135,6 +136,15 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{ } } + @Override + public final void update(){ + this.updateEntity(); + } + + public void updateEntity(){ + this.ticksElapsed++; + } + public final void setRedstonePowered(boolean powered){ this.isRedstonePowered = powered; this.markDirty(); @@ -153,14 +163,4 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{ public final void sendUpdate(){ PacketHandler.theNetwork.sendToAllAround(new PacketUpdateTileEntity(this), new NetworkRegistry.TargetPoint(this.worldObj.provider.getDimensionId(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), 64)); } - - public NBTTagCompound getSyncCompound(){ - NBTTagCompound tag = new NBTTagCompound(); - this.writeSyncableNBT(tag, true); - return tag; - } - - public void receiveSyncCompound(NBTTagCompound compound){ - this.readSyncableNBT(compound, true); - } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java index d15f9e6d0..9c0510015 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java @@ -69,6 +69,11 @@ public class TileEntityBreaker extends TileEntityInventoryBase implements IRedst this.currentTime = compound.getInteger("CurrentTime"); } + @Override + public boolean isItemValidForSlot(int i, ItemStack stack){ + return this.isPlacer; + } + private void doWork(){ EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(PosUtil.getMetadata(this.pos, worldObj)); @@ -104,11 +109,6 @@ public class TileEntityBreaker extends TileEntityInventoryBase implements IRedst return this.isItemValidForSlot(slot, stack); } - @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return this.isPlacer; - } - @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return true; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java index b7d038f50..9c3297dfe 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java @@ -117,6 +117,11 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE super.readSyncableNBT(compound, sync); } + @Override + public boolean isItemValidForSlot(int i, ItemStack stack){ + return (i == 0 && stack.getItem() == InitItems.itemMisc && stack.getItemDamage() == TheMiscItems.CANOLA.ordinal()) || (i == 1 && stack.getItem() == Items.bucket); + } + public boolean isCanola(int slot){ return this.slots[slot] != null && this.slots[slot].getItem() == InitItems.itemMisc && this.slots[slot].getItemDamage() == TheMiscItems.CANOLA.ordinal(); } @@ -126,11 +131,6 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE return this.isItemValidForSlot(slot, stack); } - @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return (i == 0 && stack.getItem() == InitItems.itemMisc && stack.getItemDamage() == TheMiscItems.CANOLA.ordinal()) || (i == 1 && stack.getItem() == Items.bucket); - } - @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return slot == 2 && FluidContainerRegistry.containsFluid(this.slots[0], new FluidStack(InitFluids.fluidCanolaOil, FluidContainerRegistry.BUCKET_VOLUME)); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java index e8e5dc3cd..435a0e5fc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java @@ -110,13 +110,13 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements } @Override - public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ - return this.isItemValidForSlot(slot, stack); + public boolean isItemValidForSlot(int i, ItemStack stack){ + return TileEntityFurnace.getItemBurnTime(stack) > 0; } @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return TileEntityFurnace.getItemBurnTime(stack) > 0; + public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ + return this.isItemValidForSlot(slot, stack); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java index e3f11b885..e893a73a4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java @@ -110,6 +110,11 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements this.brewTime = compound.getInteger("Time"); } + @Override + public boolean isItemValidForSlot(int i, ItemStack stack){ + return (i >= 3 && ItemCoffee.getIngredientFromStack(stack) != null) || (i == SLOT_COFFEE_BEANS && stack.getItem() == InitItems.itemCoffeeBean) || (i == SLOT_INPUT && stack.getItem() == InitItems.itemMisc && stack.getItemDamage() == TheMiscItems.CUP.ordinal()) || (i == SLOT_WATER_INPUT && FluidContainerRegistry.containsFluid(stack, new FluidStack(FluidRegistry.WATER, 1))); + } + public void storeCoffee(){ if(this.slots[SLOT_COFFEE_BEANS] != null && this.slots[SLOT_COFFEE_BEANS].getItem() == InitItems.itemCoffeeBean){ int toAdd = 2; @@ -172,11 +177,6 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements return this.isItemValidForSlot(slot, stack); } - @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return (i >= 3 && ItemCoffee.getIngredientFromStack(stack) != null) || (i == SLOT_COFFEE_BEANS && stack.getItem() == InitItems.itemCoffeeBean) || (i == SLOT_INPUT && stack.getItem() == InitItems.itemMisc && stack.getItemDamage() == TheMiscItems.CUP.ordinal()) || (i == SLOT_WATER_INPUT && FluidContainerRegistry.containsFluid(stack, new FluidStack(FluidRegistry.WATER, 1))); - } - @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return slot == SLOT_OUTPUT || (slot >= 3 && slot < this.slots.length-2 && ItemCoffee.getIngredientFromStack(stack) == null) || slot == SLOT_WATER_OUTPUT; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java index 969678b18..6a66fea65 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java @@ -45,17 +45,17 @@ public class TileEntityCompost extends TileEntityInventoryBase{ } } - @Override - public boolean shouldSyncSlots(){ - return true; - } - @Override public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ super.writeSyncableNBT(compound, sync); compound.setInteger("ConversionTime", this.conversionTime); } + @Override + public boolean shouldSyncSlots(){ + return true; + } + @Override public void readSyncableNBT(NBTTagCompound compound, boolean sync){ super.readSyncableNBT(compound, sync); @@ -67,24 +67,24 @@ public class TileEntityCompost extends TileEntityInventoryBase{ return AMOUNT; } - @Override - public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ - return this.isItemValidForSlot(slot, stack); - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ return stack.getItem() instanceof ItemMisc && stack.getItemDamage() == TheMiscItems.MASHED_FOOD.ordinal(); } - @Override - public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ - return stack.getItem() instanceof ItemFertilizer; - } - @Override public void markDirty(){ super.markDirty(); this.sendUpdate(); } + + @Override + public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ + return this.isItemValidForSlot(slot, stack); + } + + @Override + public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ + return stack.getItem() instanceof ItemFertilizer; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java index b450e7f4d..ebd6d63f2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java @@ -39,6 +39,20 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem super(9, "directionalBreaker"); } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + super.writeSyncableNBT(compound, sync); + this.storage.writeToNBT(compound); + compound.setInteger("CurrentTime", this.currentTime); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + super.readSyncableNBT(compound, sync); + this.storage.readFromNBT(compound); + this.currentTime = compound.getInteger("CurrentTime"); + } + @Override @SuppressWarnings("unchecked") public void updateEntity(){ @@ -90,17 +104,8 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - this.storage.writeToNBT(compound); - compound.setInteger("CurrentTime", this.currentTime); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.storage.readFromNBT(compound); - this.currentTime = compound.getInteger("CurrentTime"); + public boolean isItemValidForSlot(int i, ItemStack stack){ + return false; } @SideOnly(Side.CLIENT) @@ -113,11 +118,6 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem return this.isItemValidForSlot(slot, stack); } - @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return false; - } - @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return true; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDropper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDropper.java index 8fd2a6139..c6116f01d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDropper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDropper.java @@ -56,6 +56,11 @@ public class TileEntityDropper extends TileEntityInventoryBase implements IRedst this.currentTime = compound.getInteger("CurrentTime"); } + @Override + public boolean isItemValidForSlot(int i, ItemStack stack){ + return true; + } + private void doWork(){ if(this.removeFromInventory(false) != null){ ItemStack stack = this.removeFromInventory(true); @@ -85,11 +90,6 @@ public class TileEntityDropper extends TileEntityInventoryBase implements IRedst return this.isItemValidForSlot(slot, stack); } - @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return true; - } - @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return true; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnergizer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnergizer.java index faed346ed..aaeb34d8f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnergizer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnergizer.java @@ -66,13 +66,13 @@ public class TileEntityEnergizer extends TileEntityInventoryBase implements IEne } @Override - public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ - return this.isItemValidForSlot(slot, stack); + public boolean isItemValidForSlot(int i, ItemStack stack){ + return i == 0 && stack.getItem() instanceof IEnergyContainerItem; } @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return i == 0 && stack.getItem() instanceof IEnergyContainerItem; + public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ + return this.isItemValidForSlot(slot, stack); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java index d02151c62..52518e7f9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java @@ -70,6 +70,11 @@ public class TileEntityEnervator extends TileEntityInventoryBase implements IEne super.readSyncableNBT(compound, sync); } + @Override + public boolean isItemValidForSlot(int i, ItemStack stack){ + return i == 0 && stack.getItem() instanceof IEnergyContainerItem; + } + @Override public int extractEnergy(EnumFacing from, int maxExtract, boolean simulate){ return this.storage.extractEnergy(maxExtract, simulate); @@ -100,11 +105,6 @@ public class TileEntityEnervator extends TileEntityInventoryBase implements IEne return this.isItemValidForSlot(slot, stack); } - @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return i == 0 && stack.getItem() instanceof IEnergyContainerItem; - } - @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return slot == 1; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFeeder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFeeder.java index a755d6f94..204bc0410 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFeeder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFeeder.java @@ -109,6 +109,11 @@ public class TileEntityFeeder extends TileEntityInventoryBase{ } } + @Override + public boolean isItemValidForSlot(int i, ItemStack stack){ + return true; + } + public void feedAnimal(EntityAnimal animal){ animal.setInLove(null); for(int i = 0; i < 7; i++){ @@ -124,11 +129,6 @@ public class TileEntityFeeder extends TileEntityInventoryBase{ return this.isItemValidForSlot(slot, stack); } - @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return true; - } - @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return false; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java index 9a4a2f8e4..4bfb1694f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java @@ -34,6 +34,24 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen super(4, "fermentingBarrel"); } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + compound.setInteger("ProcessTime", this.currentProcessTime); + this.canolaTank.writeToNBT(compound); + NBTTagCompound tag = new NBTTagCompound(); + this.oilTank.writeToNBT(tag); + compound.setTag("OilTank", tag); + super.writeSyncableNBT(compound, sync); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + this.currentProcessTime = compound.getInteger("ProcessTime"); + this.canolaTank.readFromNBT(compound); + this.oilTank.readFromNBT((NBTTagCompound)compound.getTag("OilTank")); + super.readSyncableNBT(compound, sync); + } + @Override @SuppressWarnings("unchecked") public void updateEntity(){ @@ -76,21 +94,8 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - compound.setInteger("ProcessTime", this.currentProcessTime); - this.canolaTank.writeToNBT(compound); - NBTTagCompound tag = new NBTTagCompound(); - this.oilTank.writeToNBT(tag); - compound.setTag("OilTank", tag); - super.writeSyncableNBT(compound, sync); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - this.currentProcessTime = compound.getInteger("ProcessTime"); - this.canolaTank.readFromNBT(compound); - this.oilTank.readFromNBT((NBTTagCompound)compound.getTag("OilTank")); - super.readSyncableNBT(compound, sync); + public boolean isItemValidForSlot(int i, ItemStack stack){ + return (i == 0 && FluidContainerRegistry.containsFluid(stack, new FluidStack(InitFluids.fluidCanolaOil, FluidContainerRegistry.BUCKET_VOLUME))) || (i == 2 && stack.getItem() == Items.bucket); } @SideOnly(Side.CLIENT) @@ -113,11 +118,6 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen return this.isItemValidForSlot(slot, stack); } - @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return (i == 0 && FluidContainerRegistry.containsFluid(stack, new FluidStack(InitFluids.fluidCanolaOil, FluidContainerRegistry.BUCKET_VOLUME))) || (i == 2 && stack.getItem() == Items.bucket); - } - @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return (slot == 1 && stack.getItem() == Items.bucket) || (slot == 3 && FluidContainerRegistry.containsFluid(stack, new FluidStack(InitFluids.fluidOil, FluidContainerRegistry.BUCKET_VOLUME))); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java index 7b1dd60b5..57707f626 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java @@ -32,6 +32,18 @@ public class TileEntityFireworkBox extends TileEntityBase implements IEnergyRece private boolean activateOnceWithSignal; private int oldEnergy; + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + super.writeSyncableNBT(compound, sync); + this.storage.writeToNBT(compound); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + super.readSyncableNBT(compound, sync); + this.storage.readFromNBT(compound); + } + @Override public void updateEntity(){ if(!this.worldObj.isRemote){ @@ -113,18 +125,6 @@ public class TileEntityFireworkBox extends TileEntityBase implements IEnergyRece return compound; } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - this.storage.writeToNBT(compound); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.storage.readFromNBT(compound); - } - @Override public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate){ return this.storage.receiveEnergy(maxReceive, simulate); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFishingNet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFishingNet.java index 79db068e3..e8cbcec01 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFishingNet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFishingNet.java @@ -29,6 +29,18 @@ public class TileEntityFishingNet extends TileEntityBase{ public int timeUntilNextDrop; + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + super.writeSyncableNBT(compound, sync); + compound.setInteger("TimeUntilNextDrop", this.timeUntilNextDrop); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + super.readSyncableNBT(compound, sync); + this.timeUntilNextDrop = compound.getInteger("TimeUntilNextDrop"); + } + @Override public void updateEntity(){ super.updateEntity(); @@ -60,16 +72,4 @@ public class TileEntityFishingNet extends TileEntityBase{ } } } - - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("TimeUntilNextDrop", this.timeUntilNextDrop); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.timeUntilNextDrop = compound.getInteger("TimeUntilNextDrop"); - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java index 510fb124d..ca810aac3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java @@ -131,6 +131,20 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements return new FluidTankInfo[]{this.tank.getInfo()}; } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + super.writeSyncableNBT(compound, sync); + compound.setInteger("CurrentTime", this.currentTime); + this.tank.writeToNBT(compound); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + super.readSyncableNBT(compound, sync); + this.currentTime = compound.getInteger("CurrentTime"); + this.tank.readFromNBT(compound); + } + @Override @SuppressWarnings("unchecked") public void updateEntity(){ @@ -171,30 +185,6 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements } } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("CurrentTime", this.currentTime); - this.tank.writeToNBT(compound); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.currentTime = compound.getInteger("CurrentTime"); - this.tank.readFromNBT(compound); - } - - @SideOnly(Side.CLIENT) - public int getTankScaled(int i){ - return this.tank.getFluidAmount()*i/this.tank.getCapacity(); - } - - @Override - public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ - return this.isItemValidForSlot(slot, stack); - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ if(i == 0){ @@ -208,6 +198,16 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements return false; } + @SideOnly(Side.CLIENT) + public int getTankScaled(int i){ + return this.tank.getFluidAmount()*i/this.tank.getCapacity(); + } + + @Override + public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ + return this.isItemValidForSlot(slot, stack); + } + @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return slot == 1; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java index 0eca889d2..1e3d8f74e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java @@ -116,6 +116,11 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements this.storage.readFromNBT(compound); } + @Override + public boolean isItemValidForSlot(int i, ItemStack stack){ + return (i == SLOT_INPUT_1 || i == SLOT_INPUT_2) && FurnaceRecipes.instance().getSmeltingResult(stack) != null; + } + public boolean canSmeltOn(int theInput, int theOutput){ if(this.slots[theInput] != null){ ItemStack output = FurnaceRecipes.instance().getSmeltingResult(this.slots[theInput]); @@ -165,11 +170,6 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements return this.isItemValidForSlot(slot, stack); } - @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return (i == SLOT_INPUT_1 || i == SLOT_INPUT_2) && FurnaceRecipes.instance().getSmeltingResult(stack) != null; - } - @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return slot == SLOT_OUTPUT_1 || slot == SLOT_OUTPUT_2; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java index 356acf99f..213ec304e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java @@ -46,6 +46,18 @@ public class TileEntityFurnaceSolar extends TileEntityBase implements IEnergyPro return from != EnumFacing.UP; } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + super.writeSyncableNBT(compound, sync); + this.storage.writeToNBT(compound); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + super.readSyncableNBT(compound, sync); + this.storage.readFromNBT(compound); + } + @Override public void updateEntity(){ super.updateEntity(); @@ -67,18 +79,6 @@ public class TileEntityFurnaceSolar extends TileEntityBase implements IEnergyPro } } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - this.storage.writeToNBT(compound); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.storage.readFromNBT(compound); - } - public boolean hasBlockAbove(){ for(int y = 1; y <= worldObj.getHeight(); y++){ BlockPos offset = PosUtil.offset(this.pos, 0, y, 0); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGreenhouseGlass.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGreenhouseGlass.java index 7d60df32c..5d0cb8ace 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGreenhouseGlass.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGreenhouseGlass.java @@ -24,6 +24,18 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{ private int timeUntilNextFert; + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean isForSync){ + super.writeSyncableNBT(compound, isForSync); + this.timeUntilNextFert = compound.getInteger("Time"); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean isForSync){ + super.readSyncableNBT(compound, isForSync); + compound.setInteger("Time", this.timeUntilNextFert); + } + @Override public void updateEntity(){ super.updateEntity(); @@ -66,16 +78,4 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{ } return null; } - - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean isForSync){ - super.writeSyncableNBT(compound, isForSync); - this.timeUntilNextFert = compound.getInteger("Time"); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean isForSync){ - super.readSyncableNBT(compound, isForSync); - compound.setInteger("Time", this.timeUntilNextFert); - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java index 2f6cc600d..9ba427066 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java @@ -165,6 +165,11 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg super.readSyncableNBT(compound, sync); } + @Override + public boolean isItemValidForSlot(int i, ItemStack stack){ + return (i == SLOT_INPUT_1 || i == SLOT_INPUT_2) && CrusherRecipeRegistry.getRecipeFromInput(stack) != null; + } + public boolean canCrushOn(int theInput, int theFirstOutput, int theSecondOutput){ if(this.slots[theInput] != null){ List outputOnes = CrusherRecipeRegistry.getOutputOnes(this.slots[theInput]); @@ -258,11 +263,6 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg return this.isItemValidForSlot(slot, stack); } - @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return (i == SLOT_INPUT_1 || i == SLOT_INPUT_2) && CrusherRecipeRegistry.getRecipeFromInput(stack) != null; - } - @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return slot == SLOT_OUTPUT_1_1 || slot == SLOT_OUTPUT_1_2 || slot == SLOT_OUTPUT_2_1 || slot == SLOT_OUTPUT_2_2; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java index 9f0dfb8d7..7f99db7ab 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java @@ -32,6 +32,18 @@ public class TileEntityHeatCollector extends TileEntityBase implements IEnergyPr public EnergyStorage storage = new EnergyStorage(30000); private int oldEnergy; + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean isForSync){ + super.writeSyncableNBT(compound, isForSync); + this.storage.writeToNBT(compound); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean isForSync){ + super.readSyncableNBT(compound, isForSync); + this.storage.readFromNBT(compound); + } + @Override public void updateEntity(){ super.updateEntity(); @@ -69,18 +81,6 @@ public class TileEntityHeatCollector extends TileEntityBase implements IEnergyPr } } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean isForSync){ - super.writeSyncableNBT(compound, isForSync); - this.storage.writeToNBT(compound); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean isForSync){ - super.readSyncableNBT(compound, isForSync); - this.storage.readFromNBT(compound); - } - @Override public int extractEnergy(EnumFacing from, int maxExtract, boolean simulate){ return this.storage.extractEnergy(maxExtract, simulate); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java index a6751c5c5..5030cc83a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java @@ -447,13 +447,13 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt } @Override - public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ - return this.isItemValidForSlot(slot, stack); + public boolean isItemValidForSlot(int i, ItemStack stack){ + return i == 0; } @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return i == 0; + public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ + return this.isItemValidForSlot(slot, stack); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java index cf2f10a9d..672c98799 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java @@ -48,11 +48,6 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements this.slots = new ItemStack[itemAmount]; } - @Override - public void updateEntity(){ - super.updateEntity(); - } - @Override public void writeSyncableNBT(NBTTagCompound compound, boolean isForSync){ super.writeSyncableNBT(compound, isForSync); @@ -94,17 +89,44 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements } @Override + public void updateEntity(){ + super.updateEntity(); + } + + @Override + public int[] getSlotsForFace(EnumFacing side){ + if(this.slots.length > 0){ + int[] theInt = new int[slots.length]; + for(int i = 0; i < theInt.length; i++){ + theInt[i] = i; + } + return theInt; + } + else{ + return new int[0]; + } + } @Override public int getInventoryStackLimit(){ return 64; } - @Override + public boolean hasCapability(net.minecraftforge.common.capabilities.Capability capability, net.minecraft.util.EnumFacing facing){ + return this.getCapability(capability, facing) != null; + } @Override public boolean isUseableByPlayer(EntityPlayer player){ return player.getDistanceSq(this.getPos().getX()+0.5D, this.pos.getY()+0.5D, this.pos.getZ()+0.5D) <= 64 && !this.isInvalid() && this.worldObj.getTileEntity(this.pos) == this; } @Override + public T getCapability(Capability capability, EnumFacing facing){ + if(facing != null && capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY){ + return (T)this.itemHandlers.get(facing); + } + else{ + return super.getCapability(capability, facing); + } + } @Override public void openInventory(EntityPlayer player){ } @@ -187,19 +209,7 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements return stack; } - @Override - public int[] getSlotsForFace(EnumFacing side){ - if(this.slots.length > 0){ - int[] theInt = new int[slots.length]; - for(int i = 0; i < theInt.length; i++){ - theInt[i] = i; - } - return theInt; - } - else{ - return new int[0]; - } - } + @Override public String getName(){ @@ -216,19 +226,8 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements return new ChatComponentText(StringUtil.localize(this.getName())); } - @Override - public boolean hasCapability(net.minecraftforge.common.capabilities.Capability capability, net.minecraft.util.EnumFacing facing){ - return this.getCapability(capability, facing) != null; - } - @Override - public T getCapability(Capability capability, EnumFacing facing){ - if(facing != null && capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY){ - return (T)this.itemHandlers.get(facing); - } - else{ - return super.getCapability(capability, facing); - } - } + + } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemRepairer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemRepairer.java index 22f721bf7..5b1a5412d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemRepairer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemRepairer.java @@ -77,6 +77,11 @@ public class TileEntityItemRepairer extends TileEntityInventoryBase implements I this.storage.readFromNBT(compound); } + @Override + public boolean isItemValidForSlot(int i, ItemStack stack){ + return i == SLOT_INPUT; + } + public static boolean canBeRepaired(ItemStack stack){ return stack != null && stack.getItem().isRepairable(); } @@ -99,11 +104,6 @@ public class TileEntityItemRepairer extends TileEntityInventoryBase implements I return this.isItemValidForSlot(slot, stack); } - @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return i == SLOT_INPUT; - } - @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return slot == SLOT_OUTPUT; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java index b19304d7f..976991cc0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java @@ -32,26 +32,20 @@ public class TileEntityLaserRelay extends TileEntityBase implements IEnergyRecei private static final float[] COLOR = new float[]{1F, 0F, 0F}; @Override - public void updateEntity(){ - super.updateEntity(); - if(this.worldObj.isRemote){ - this.renderParticles(); - } - } + public void receiveSyncCompound(NBTTagCompound compound){ + BlockPos thisPos = this.pos; + if(compound != null){ + LaserRelayConnectionHandler.getInstance().removeRelayFromNetwork(thisPos); - @SideOnly(Side.CLIENT) - public void renderParticles(){ - if(Util.RANDOM.nextInt(ConfigValues.lessParticles ? 15 : 8) == 0){ - BlockPos thisPos = this.pos; - LaserRelayConnectionHandler.Network network = LaserRelayConnectionHandler.getInstance().getNetworkFor(thisPos); - if(network != null){ - for(LaserRelayConnectionHandler.ConnectionPair aPair : network.connections){ - if(aPair.contains(thisPos) && PosUtil.areSamePos(thisPos, aPair.firstRelay)){ - PacketParticle.renderParticlesFromAToB(aPair.firstRelay.getX(), aPair.firstRelay.getY(), aPair.firstRelay.getZ(), aPair.secondRelay.getX(), aPair.secondRelay.getY(), aPair.secondRelay.getZ(), ConfigValues.lessParticles ? 1 : Util.RANDOM.nextInt(3)+1, 0.8F, COLOR, 1F); - } - } + NBTTagList list = compound.getTagList("Connections", 10); + for(int i = 0; i < list.tagCount(); i++){ + LaserRelayConnectionHandler.ConnectionPair pair = LaserRelayConnectionHandler.ConnectionPair.readFromNBT(list.getCompoundTagAt(i)); + LaserRelayConnectionHandler.getInstance().addConnection(pair.firstRelay, pair.secondRelay); } } + else{ + LaserRelayConnectionHandler.getInstance().removeRelayFromNetwork(thisPos); + } } @Override @@ -73,19 +67,25 @@ public class TileEntityLaserRelay extends TileEntityBase implements IEnergyRecei } @Override - public void receiveSyncCompound(NBTTagCompound compound){ - BlockPos thisPos = this.pos; - if(compound != null){ - LaserRelayConnectionHandler.getInstance().removeRelayFromNetwork(thisPos); - - NBTTagList list = compound.getTagList("Connections", 10); - for(int i = 0; i < list.tagCount(); i++){ - LaserRelayConnectionHandler.ConnectionPair pair = LaserRelayConnectionHandler.ConnectionPair.readFromNBT(list.getCompoundTagAt(i)); - LaserRelayConnectionHandler.getInstance().addConnection(pair.firstRelay, pair.secondRelay); - } + public void updateEntity(){ + super.updateEntity(); + if(this.worldObj.isRemote){ + this.renderParticles(); } - else{ - LaserRelayConnectionHandler.getInstance().removeRelayFromNetwork(thisPos); + } + + @SideOnly(Side.CLIENT) + public void renderParticles(){ + if(Util.RANDOM.nextInt(ConfigValues.lessParticles ? 15 : 8) == 0){ + BlockPos thisPos = this.pos; + LaserRelayConnectionHandler.Network network = LaserRelayConnectionHandler.getInstance().getNetworkFor(thisPos); + if(network != null){ + for(LaserRelayConnectionHandler.ConnectionPair aPair : network.connections){ + if(aPair.contains(thisPos) && PosUtil.areSamePos(thisPos, aPair.firstRelay)){ + PacketParticle.renderParticlesFromAToB(aPair.firstRelay.getX(), aPair.firstRelay.getY(), aPair.firstRelay.getZ(), aPair.secondRelay.getX(), aPair.secondRelay.getY(), aPair.secondRelay.getZ(), ConfigValues.lessParticles ? 1 : Util.RANDOM.nextInt(3)+1, 0.8F, COLOR, 1F); + } + } + } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java index 0396749c7..b0ff839a3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java @@ -33,6 +33,20 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I private int currentWorkTime; private int oldEnergy; + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + super.writeSyncableNBT(compound, sync); + this.storage.writeToNBT(compound); + compound.setInteger("WorkTime", this.currentWorkTime); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + super.readSyncableNBT(compound, sync); + this.storage.readFromNBT(compound); + this.currentWorkTime = compound.getInteger("WorkTime"); + } + @Override @SuppressWarnings("unchecked") public void updateEntity(){ @@ -56,20 +70,6 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I } } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - this.storage.writeToNBT(compound); - compound.setInteger("WorkTime", this.currentWorkTime); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.storage.readFromNBT(compound); - this.currentWorkTime = compound.getInteger("WorkTime"); - } - public int isMultiblock(){ BlockPos thisPos = this.pos; BlockPos[] positions = new BlockPos[]{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java index 713f48334..ed5a5bf1d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java @@ -36,6 +36,18 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr private int nextUseCounter; private int oldEnergy; + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + super.writeSyncableNBT(compound, sync); + this.storage.writeToNBT(compound); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + super.readSyncableNBT(compound, sync); + this.storage.readFromNBT(compound); + } + @Override @SuppressWarnings("unchecked") public void updateEntity(){ @@ -94,18 +106,6 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr } } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - this.storage.writeToNBT(compound); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.storage.readFromNBT(compound); - } - @Override public int extractEnergy(EnumFacing from, int maxReceive, boolean simulate){ return this.storage.extractEnergy(maxReceive, simulate); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java index d9e1b84ea..a155eabef 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java @@ -136,6 +136,12 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR return false; } + private void shootParticles(int endX, int endY, int endZ){ + if(!ConfigValues.lessParticles){ + PacketHandler.theNetwork.sendToAllAround(new PacketParticle(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), endX, endY, endZ, new float[]{62F/255F, 163F/255F, 74F/255F}, 5, 1.0F), new NetworkRegistry.TargetPoint(worldObj.provider.getDimensionId(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), 96)); + } + } + private boolean isBlacklisted(Block block){ String reg = block.getRegistryName(); if(reg != null && !reg.isEmpty()){ @@ -148,12 +154,6 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR return false; } - private void shootParticles(int endX, int endY, int endZ){ - if(!ConfigValues.lessParticles){ - PacketHandler.theNetwork.sendToAllAround(new PacketParticle(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), endX, endY, endZ, new float[]{62F/255F, 163F/255F, 74F/255F}, 5, 1.0F), new NetworkRegistry.TargetPoint(worldObj.provider.getDimensionId(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), 96)); - } - } - @Override public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ super.writeSyncableNBT(compound, sync); @@ -170,6 +170,11 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR this.onlyMineOres = compound.getBoolean("OnlyOres"); } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack){ + return false; + } + @Override public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate){ return this.storage.receiveEnergy(maxReceive, simulate); @@ -200,11 +205,6 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR return true; } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack){ - return false; - } - @Override public void onButtonPressed(int buttonID, EntityPlayer player){ if(buttonID == 0){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java index 3434e2ec8..a1fed052f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java @@ -116,13 +116,13 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I } @Override - public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ - return this.isItemValidForSlot(slot, stack); + public boolean isItemValidForSlot(int i, ItemStack stack){ + return FluidContainerRegistry.containsFluid(stack, new FluidStack(InitFluids.fluidOil, FluidContainerRegistry.BUCKET_VOLUME)) && i == 0; } @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return FluidContainerRegistry.containsFluid(stack, new FluidStack(InitFluids.fluidOil, FluidContainerRegistry.BUCKET_VOLUME)) && i == 0; + public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ + return this.isItemValidForSlot(slot, stack); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java index 8b81c3962..396341479 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java @@ -47,6 +47,13 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{ return this.isBoundThingInRange() ? this.getInventory().getInventoryStackLimit() : 0; } + @Override + public void clear(){ + if(this.isBoundThingInRange()){ + this.getInventory().clear(); + } + } + @Override public void setInventorySlotContents(int i, ItemStack stack){ if(this.isBoundThingInRange()){ @@ -71,13 +78,16 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{ } @Override - public String getName(){ - return this.name; + public ItemStack removeStackFromSlot(int index){ + if(this.isBoundThingInRange()){ + return this.getInventory().removeStackFromSlot(index); + } + return null; } @Override - public boolean isBoundThingInRange(){ - return super.isBoundThingInRange() && worldObj.getTileEntity(boundPosition) instanceof IInventory; + public String getName(){ + return this.name; } public ISidedInventory getSided(){ @@ -94,36 +104,11 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{ return null; } - @Override - public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ - return this.isBoundThingInRange() && (this.getSided() == null || this.getSided().canInsertItem(slot, stack, side)); - } - - @Override - public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ - return this.isBoundThingInRange() && (this.getSided() == null || this.getSided().canExtractItem(slot, stack, side)); - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ return this.isBoundThingInRange() && this.getInventory().isItemValidForSlot(i, stack); } - @Override - public ItemStack removeStackFromSlot(int index){ - if(this.isBoundThingInRange()){ - return this.getInventory().removeStackFromSlot(index); - } - return null; - } - - @Override - public void clear(){ - if(this.isBoundThingInRange()){ - this.getInventory().clear(); - } - } - @Override public T getCapability(Capability capability, EnumFacing facing){ if(this.isBoundThingInRange()){ @@ -134,4 +119,19 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{ } return super.getCapability(capability, facing); } + + @Override + public boolean isBoundThingInRange(){ + return super.isBoundThingInRange() && worldObj.getTileEntity(boundPosition) instanceof IInventory; + } + + @Override + public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ + return this.isBoundThingInRange() && (this.getSided() == null || this.getSided().canInsertItem(slot, stack, side)); + } + + @Override + public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ + return this.isBoundThingInRange() && (this.getSided() == null || this.getSided().canExtractItem(slot, stack, side)); + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java index 7d022dfd6..07bc698f8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java @@ -48,6 +48,30 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements this.isBreaker = false; } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + super.writeSyncableNBT(compound, sync); + compound.setInteger("Range", this.range); + if(this.boundPosition != null){ + compound.setInteger("XCoordOfTileStored", boundPosition.getX()); + compound.setInteger("YCoordOfTileStored", boundPosition.getY()); + compound.setInteger("ZCoordOfTileStored", boundPosition.getZ()); + } + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + super.readSyncableNBT(compound, sync); + int x = compound.getInteger("XCoordOfTileStored"); + int y = compound.getInteger("YCoordOfTileStored"); + int z = compound.getInteger("ZCoordOfTileStored"); + this.range = compound.getInteger("Range"); + if(!(x == 0 && y == 0 && z == 0)){ + this.boundPosition = new BlockPos(x, y, z); + this.markDirty(); + } + } + @Override public void updateEntity(){ super.updateEntity(); @@ -168,27 +192,8 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("Range", this.range); - if(this.boundPosition != null){ - compound.setInteger("XCoordOfTileStored", boundPosition.getX()); - compound.setInteger("YCoordOfTileStored", boundPosition.getY()); - compound.setInteger("ZCoordOfTileStored", boundPosition.getZ()); - } - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - int x = compound.getInteger("XCoordOfTileStored"); - int y = compound.getInteger("YCoordOfTileStored"); - int z = compound.getInteger("ZCoordOfTileStored"); - this.range = compound.getInteger("Range"); - if(!(x == 0 && y == 0 && z == 0)){ - this.boundPosition = new BlockPos(x, y, z); - this.markDirty(); - } + public boolean isItemValidForSlot(int i, ItemStack stack){ + return !this.isBreaker; } @Override @@ -196,11 +201,6 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements return this.isItemValidForSlot(slot, stack); } - @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return !this.isBreaker; - } - @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return this.isBreaker; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java index 6fdecdc56..18b411e04 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java @@ -104,6 +104,16 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP } } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack){ + return false; + } + + @Override + public T getCapability(Capability capability, EnumFacing facing){ + return this.capabilities.getCapability(capability, facing); + } + public static int upgradeRange(int defaultRange, World world, BlockPos pos){ int newRange = defaultRange; for(int i = 0; i < 3; i++){ @@ -183,14 +193,4 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return false; } - - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack){ - return false; - } - - @Override - public T getCapability(Capability capability, EnumFacing facing){ - return this.capabilities.getCapability(capability, facing); - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityRangedCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityRangedCollector.java index 3ded41dec..bad0d1d95 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityRangedCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityRangedCollector.java @@ -32,6 +32,18 @@ public class TileEntityRangedCollector extends TileEntityInventoryBase implement super(18, "rangedCollector"); } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + super.writeSyncableNBT(compound, sync); + compound.setBoolean("Whitelist", this.isWhitelist); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + super.readSyncableNBT(compound, sync); + this.isWhitelist = compound.getBoolean("Whitelist"); + } + @Override @SuppressWarnings("unchecked") public void updateEntity(){ @@ -74,15 +86,8 @@ public class TileEntityRangedCollector extends TileEntityInventoryBase implement } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setBoolean("Whitelist", this.isWhitelist); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.isWhitelist = compound.getBoolean("Whitelist"); + public boolean isItemValidForSlot(int i, ItemStack stack){ + return false; } @Override @@ -90,11 +95,6 @@ public class TileEntityRangedCollector extends TileEntityInventoryBase implement return this.isItemValidForSlot(slot, stack); } - @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return false; - } - @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return slot < WHITELIST_START; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntitySmileyCloud.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntitySmileyCloud.java index e3569d266..db120168a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntitySmileyCloud.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntitySmileyCloud.java @@ -27,17 +27,6 @@ public class TileEntitySmileyCloud extends TileEntityBase implements IStringReac public int flyHeight; private String nameBefore; - @Override - public void updateEntity(){ - super.updateEntity(); - if(!worldObj.isRemote){ - if(!Objects.equals(this.name, this.nameBefore) && this.sendUpdateWithInterval()){ - this.nameBefore = this.name; - this.markDirty(); - } - } - } - @Override public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ super.writeSyncableNBT(compound, sync); @@ -52,6 +41,17 @@ public class TileEntitySmileyCloud extends TileEntityBase implements IStringReac this.name = compound.getString("Name"); } + @Override + public void updateEntity(){ + super.updateEntity(); + if(!worldObj.isRemote){ + if(!Objects.equals(this.name, this.nameBefore) && this.sendUpdateWithInterval()){ + this.nameBefore = this.name; + this.markDirty(); + } + } + } + @Override public void onTextReceived(String text, int textID, EntityPlayer player){ this.name = text; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityXPSolidifier.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityXPSolidifier.java index 8561761f6..89d008ee9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityXPSolidifier.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityXPSolidifier.java @@ -66,13 +66,13 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I } @Override - public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ - return this.isItemValidForSlot(slot, stack); + public boolean isItemValidForSlot(int i, ItemStack stack){ + return false; } @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return false; + public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ + return this.isItemValidForSlot(slot, stack); } @Override @@ -96,6 +96,7 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I } //TODO Fix XP System to fit points needed in 1.8 (OpenBlocks?) + /** * Gets the Player's XP * (Excerpted from OpenBlocks' XP system with permission, thanks guys!) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java index 4b3593340..9babd4f7f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java @@ -43,6 +43,11 @@ public class AssetUtil{ font.drawString(localMachineName, xSize/2-font.getStringWidth(localMachineName)/2, yPositionOfMachineText, StringUtil.DECIMAL_COLOR_WHITE); } + @SideOnly(Side.CLIENT) + public static void renderBlockInWorld(Block block, int meta){ + renderItemInWorld(new ItemStack(block, 1, meta)); + } + @SideOnly(Side.CLIENT) public static void renderItemInWorld(ItemStack stack){ GlStateManager.pushMatrix(); @@ -56,11 +61,6 @@ public class AssetUtil{ GlStateManager.popMatrix(); } - @SideOnly(Side.CLIENT) - public static void renderBlockInWorld(Block block, int meta){ - renderItemInWorld(new ItemStack(block, 1, meta)); - } - @SideOnly(Side.CLIENT) public static void renderStackToGui(ItemStack stack, int x, int y, float scale){ GlStateManager.pushMatrix(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/PosUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/PosUtil.java index 2e97727b4..cf56f862d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/PosUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/PosUtil.java @@ -22,6 +22,10 @@ import net.minecraft.world.World; public class PosUtil{ + public static Material getMaterial(BlockPos pos, IBlockAccess world){ + return getBlock(pos, world).getMaterial(); + } + public static Block getBlock(BlockPos pos, IBlockAccess world){ if(pos != null){ IBlockState state = world.getBlockState(pos); @@ -32,10 +36,6 @@ public class PosUtil{ return null; } - public static Material getMaterial(BlockPos pos, IBlockAccess world){ - return getBlock(pos, world).getMaterial(); - } - public static int getMetadata(BlockPos pos, IBlockAccess world){ return getBlock(pos, world).getMetaFromState(world.getBlockState(pos)); } 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 e28134d04..2f9e52d50 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java @@ -248,6 +248,14 @@ public class WorldUtil{ //TODO make this work for the stupid new system + public static boolean addToInventory(IInventory inventory, ArrayList stacks, boolean actuallyDo, boolean shouldAlwaysWork){ + return addToInventory(inventory, stacks, EnumFacing.UP, actuallyDo, shouldAlwaysWork); + } + + public static boolean addToInventory(IInventory inventory, ArrayList stacks, EnumFacing side, boolean actuallyDo, boolean shouldAlwaysWork){ + return addToInventory(inventory, 0, inventory.getSizeInventory(), stacks, side, actuallyDo, shouldAlwaysWork); + } + /** * Add an ArrayList of ItemStacks to an Array of slots * @@ -300,14 +308,6 @@ public class WorldUtil{ return working >= stacks.size(); } - public static boolean addToInventory(IInventory inventory, ArrayList stacks, boolean actuallyDo, boolean shouldAlwaysWork){ - return addToInventory(inventory, stacks, EnumFacing.UP, actuallyDo, shouldAlwaysWork); - } - - public static boolean addToInventory(IInventory inventory, ArrayList stacks, EnumFacing side, boolean actuallyDo, boolean shouldAlwaysWork){ - return addToInventory(inventory, 0, inventory.getSizeInventory(), stacks, side, actuallyDo, shouldAlwaysWork); - } - public static int findFirstFilledSlot(ItemStack[] slots){ for(int i = 0; i < slots.length; i++){ if(slots[i] != null){ From 2d476a0b6dff5a5407f8bb1cc89eb9f37cfe2b9e Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 1 Feb 2016 20:30:15 +0100 Subject: [PATCH 48/66] What the fuck IntelliJ --- .../actuallyadditions/mod/tile/TileEntityInventoryBase.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java index 672c98799..15107de4e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java @@ -209,8 +209,6 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements return stack; } - - @Override public String getName(){ return this.name; @@ -226,8 +224,4 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements return new ChatComponentText(StringUtil.localize(this.getName())); } - - - - } From 348dc518c67c9e5c47d25e220d959534f1b00865 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 1 Feb 2016 20:31:27 +0100 Subject: [PATCH 49/66] The heck!? --- .../mod/tile/TileEntityInventoryBase.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java index 15107de4e..1f0ef165c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java @@ -105,7 +105,9 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements else{ return new int[0]; } - } @Override + } + + @Override public int getInventoryStackLimit(){ return 64; } @@ -113,7 +115,9 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements @Override public boolean hasCapability(net.minecraftforge.common.capabilities.Capability capability, net.minecraft.util.EnumFacing facing){ return this.getCapability(capability, facing) != null; - } @Override + } + + @Override public boolean isUseableByPlayer(EntityPlayer player){ return player.getDistanceSq(this.getPos().getX()+0.5D, this.pos.getY()+0.5D, this.pos.getZ()+0.5D) <= 64 && !this.isInvalid() && this.worldObj.getTileEntity(this.pos) == this; } From 228ecd50bd4ac158b0b7fac7143a3535a45f62cc Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 1 Feb 2016 20:32:49 +0100 Subject: [PATCH 50/66] More cleanup. I hope this fixes the fuckery. God damn it. --- .../mod/blocks/BlockColoredLamp.java | 10 ++-- .../mod/blocks/BlockCrystal.java | 10 ++-- .../mod/blocks/BlockMisc.java | 10 ++-- .../mod/blocks/BlockWildPlant.java | 20 +++---- .../mod/blocks/base/BlockPlant.java | 22 +++---- .../mod/booklet/page/PageCrafting.java | 58 +++++++++---------- .../mod/booklet/page/PageFurnace.java | 16 ++--- .../mod/booklet/page/PageTextOnly.java | 10 ++-- .../mod/tile/TileEntityBreaker.java | 24 ++++---- .../mod/tile/TileEntityCanolaPress.java | 32 +++++----- .../mod/tile/TileEntityCoalGenerator.java | 32 +++++----- .../mod/tile/TileEntityCoffeeMachine.java | 36 ++++++------ .../mod/tile/TileEntityCompost.java | 34 +++++------ .../mod/tile/TileEntityDropper.java | 24 ++++---- .../mod/tile/TileEntityEnergizer.java | 24 ++++---- .../mod/tile/TileEntityEnervator.java | 24 ++++---- .../mod/tile/TileEntityFeeder.java | 36 ++++++------ .../mod/tile/TileEntityFurnaceDouble.java | 32 +++++----- .../mod/tile/TileEntityGrinder.java | 32 +++++----- .../mod/tile/TileEntityInputter.java | 52 ++++++++--------- .../mod/tile/TileEntityInventoryBase.java | 24 ++++---- .../mod/tile/TileEntityItemRepairer.java | 28 ++++----- .../mod/tile/TileEntityMiner.java | 32 +++++----- .../mod/tile/TileEntityOilGenerator.java | 32 +++++----- .../mod/tile/TileEntityPhantomItemface.java | 10 ++-- .../mod/tile/TileEntityPhantomface.java | 52 ++++++++--------- .../mod/tile/TileEntityXPSolidifier.java | 24 ++++---- 27 files changed, 372 insertions(+), 368 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java index 44018f892..743dc70d8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java @@ -123,6 +123,11 @@ public class BlockColoredLamp extends BlockBase{ return this.isOn ? 15 : 0; } + @Override + public Class getItemBlock(){ + return TheItemBlock.class; + } + @Override protected void registerRendering(){ ResourceLocation[] resLocs = new ResourceLocation[allLampTypes.length]; @@ -134,11 +139,6 @@ public class BlockColoredLamp extends BlockBase{ ActuallyAdditions.proxy.addRenderVariant(Item.getItemFromBlock(this), resLocs); } - @Override - public Class getItemBlock(){ - return TheItemBlock.class; - } - @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.RARE; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java index 7b3104bc3..99f96dc5e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java @@ -55,6 +55,11 @@ public class BlockCrystal extends BlockBase{ } } + @Override + public Class getItemBlock(){ + return TheItemBlock.class; + } + @Override protected void registerRendering(){ ResourceLocation[] resLocs = new ResourceLocation[allCrystals.length]; @@ -66,11 +71,6 @@ public class BlockCrystal extends BlockBase{ ActuallyAdditions.proxy.addRenderVariant(Item.getItemFromBlock(this), resLocs); } - @Override - public Class getItemBlock(){ - return TheItemBlock.class; - } - @Override public EnumRarity getRarity(ItemStack stack){ return stack.getItemDamage() >= allCrystals.length ? EnumRarity.COMMON : allCrystals[stack.getItemDamage()].rarity; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMisc.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMisc.java index 6bc48c865..a9aa228cb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMisc.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMisc.java @@ -55,6 +55,11 @@ public class BlockMisc extends BlockBase{ } } + @Override + public Class getItemBlock(){ + return TheItemBlock.class; + } + @Override protected void registerRendering(){ ResourceLocation[] resLocs = new ResourceLocation[allMiscBlocks.length]; @@ -66,11 +71,6 @@ public class BlockMisc extends BlockBase{ ActuallyAdditions.proxy.addRenderVariant(Item.getItemFromBlock(this), resLocs); } - @Override - public Class getItemBlock(){ - return TheItemBlock.class; - } - @Override public EnumRarity getRarity(ItemStack stack){ return stack.getItemDamage() >= allMiscBlocks.length ? EnumRarity.COMMON : allMiscBlocks[stack.getItemDamage()].rarity; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java index a76346f84..92dad16a1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java @@ -80,6 +80,16 @@ public class BlockWildPlant extends BlockBushBase{ return false; } + @Override + public Class getItemBlock(){ + return TheItemBlock.class; + } + + @Override + public boolean shouldAddCreative(){ + return false; + } + @Override protected void registerRendering(){ ResourceLocation[] resLocs = new ResourceLocation[allWildPlants.length]; @@ -91,16 +101,6 @@ public class BlockWildPlant extends BlockBushBase{ ActuallyAdditions.proxy.addRenderVariant(Item.getItemFromBlock(this), resLocs); } - @Override - public Class getItemBlock(){ - return TheItemBlock.class; - } - - @Override - public boolean shouldAddCreative(){ - return false; - } - @Override public EnumRarity getRarity(ItemStack stack){ return stack.getItemDamage() >= allWildPlants.length ? EnumRarity.COMMON : allWildPlants[stack.getItemDamage()].rarity; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java index d38943865..105bc1bdc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java @@ -116,30 +116,32 @@ public class BlockPlant extends BlockCrops{ return true; } return false; - } @Override - public Item getSeed(){ - return this.seedItem; } @Override public int getDamageValue(World world, BlockPos pos){ return 0; } @Override - public Item getCrop(){ - return this.returnItem; + public Item getSeed(){ + return this.seedItem; } @Override public int quantityDropped(IBlockState state, int fortune, Random random){ return this.getMetaFromState(state) >= 7 ? random.nextInt(addDropAmount)+minDropAmount : super.quantityDropped(state, fortune, random); - } @Override + } + + @Override + public Item getCrop(){ + return this.returnItem; + } + + + + @Override public Item getItemDropped(IBlockState state, Random rand, int par3){ return this.getMetaFromState(state) >= 7 ? this.getCrop() : this.getSeed(); } - - - - } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java index f8fd72b89..3f512c03f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java @@ -49,27 +49,12 @@ public class PageCrafting extends BookletPageAA{ } @Override - public ItemStack[] getItemStacksForPage(){ - if(this.recipes != null){ - ItemStack[] stacks = new ItemStack[this.recipes.length]; - for(int i = 0; i < this.recipes.length; i++){ - if(this.recipes[i] != null){ - ItemStack output = this.recipes[i].getRecipeOutput(); - if(output != null){ - if(!this.arePageStacksWildcard){ - stacks[i] = output; - } - else{ - ItemStack wildcardOutput = output.copy(); - wildcardOutput.setItemDamage(Util.WILDCARD); - stacks[i] = wildcardOutput; - } - } - } - } - return stacks; + @SideOnly(Side.CLIENT) + public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ + if(this.recipes[this.recipePos] != null){ + Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc); + gui.drawRect(gui.getGuiLeft()+27, gui.getGuiTop()+20, 146, 20, 99, 60); } - return null; } @SuppressWarnings("unchecked") @@ -166,15 +151,6 @@ public class PageCrafting extends BookletPageAA{ } } - @Override - @SideOnly(Side.CLIENT) - public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ - if(this.recipes[this.recipePos] != null){ - Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc); - gui.drawRect(gui.getGuiLeft()+27, gui.getGuiTop()+20, 146, 20, 99, 60); - } - } - @Override @SideOnly(Side.CLIENT) public void updateScreen(int ticksElapsed){ @@ -187,4 +163,28 @@ public class PageCrafting extends BookletPageAA{ } } } + + @Override + public ItemStack[] getItemStacksForPage(){ + if(this.recipes != null){ + ItemStack[] stacks = new ItemStack[this.recipes.length]; + for(int i = 0; i < this.recipes.length; i++){ + if(this.recipes[i] != null){ + ItemStack output = this.recipes[i].getRecipeOutput(); + if(output != null){ + if(!this.arePageStacksWildcard){ + stacks[i] = output; + } + else{ + ItemStack wildcardOutput = output.copy(); + wildcardOutput.setItemDamage(Util.WILDCARD); + stacks[i] = wildcardOutput; + } + } + } + } + return stacks; + } + return null; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java index 91cdb638a..f8cde97b0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java @@ -43,8 +43,12 @@ public class PageFurnace extends BookletPageAA{ } @Override - public ItemStack[] getItemStacksForPage(){ - return this.result == null ? new ItemStack[0] : new ItemStack[]{this.result}; + @SideOnly(Side.CLIENT) + public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ + if(this.input != null || this.getInputForOutput(this.result) != null){ + Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc); + gui.drawRect(gui.getGuiLeft()+37, gui.getGuiTop()+20, 0, 180, 60, 60); + } } @SuppressWarnings("unchecked") @@ -90,12 +94,8 @@ public class PageFurnace extends BookletPageAA{ } @Override - @SideOnly(Side.CLIENT) - public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ - if(this.input != null || this.getInputForOutput(this.result) != null){ - Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc); - gui.drawRect(gui.getGuiLeft()+37, gui.getGuiTop()+20, 0, 180, 60, 60); - } + public ItemStack[] getItemStacksForPage(){ + return this.result == null ? new ItemStack[0] : new ItemStack[]{this.result}; } private ItemStack getInputForOutput(ItemStack output){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageTextOnly.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageTextOnly.java index 18155443e..8ebdfa28c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageTextOnly.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageTextOnly.java @@ -31,11 +31,6 @@ public class PageTextOnly extends BookletPageAA{ return this; } - @Override - public ItemStack[] getItemStacksForPage(){ - return this.stack == null ? new ItemStack[0] : new ItemStack[]{this.stack}; - } - @Override @SideOnly(Side.CLIENT) public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ @@ -44,4 +39,9 @@ public class PageTextOnly extends BookletPageAA{ StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, text, gui.getGuiLeft()+14, gui.getGuiTop()+9, 115, 0, false); } } + + @Override + public ItemStack[] getItemStacksForPage(){ + return this.stack == null ? new ItemStack[0] : new ItemStack[]{this.stack}; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java index 9c0510015..56ece8b7c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java @@ -38,6 +38,18 @@ public class TileEntityBreaker extends TileEntityInventoryBase implements IRedst this.isPlacer = false; } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + super.writeSyncableNBT(compound, sync); + compound.setInteger("CurrentTime", this.currentTime); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + super.readSyncableNBT(compound, sync); + this.currentTime = compound.getInteger("CurrentTime"); + } + @Override @SuppressWarnings("unchecked") public void updateEntity(){ @@ -57,18 +69,6 @@ public class TileEntityBreaker extends TileEntityInventoryBase implements IRedst } } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("CurrentTime", this.currentTime); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.currentTime = compound.getInteger("CurrentTime"); - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ return this.isPlacer; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java index 9c3297dfe..f56e4361e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java @@ -55,6 +55,22 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE return this.storage.getEnergyStored()*i/this.storage.getMaxEnergyStored(); } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + compound.setInteger("ProcessTime", this.currentProcessTime); + this.storage.writeToNBT(compound); + this.tank.writeToNBT(compound); + super.writeSyncableNBT(compound, sync); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + this.currentProcessTime = compound.getInteger("ProcessTime"); + this.storage.readFromNBT(compound); + this.tank.readFromNBT(compound); + super.readSyncableNBT(compound, sync); + } + @Override @SuppressWarnings("unchecked") public void updateEntity(){ @@ -101,22 +117,6 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE } } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - compound.setInteger("ProcessTime", this.currentProcessTime); - this.storage.writeToNBT(compound); - this.tank.writeToNBT(compound); - super.writeSyncableNBT(compound, sync); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - this.currentProcessTime = compound.getInteger("ProcessTime"); - this.storage.readFromNBT(compound); - this.tank.readFromNBT(compound); - super.readSyncableNBT(compound, sync); - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ return (i == 0 && stack.getItem() == InitItems.itemMisc && stack.getItemDamage() == TheMiscItems.CANOLA.ordinal()) || (i == 1 && stack.getItem() == Items.bucket); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java index 435a0e5fc..ef75b1688 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java @@ -45,6 +45,22 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements return this.currentBurnTime*i/this.maxBurnTime; } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + compound.setInteger("BurnTime", this.currentBurnTime); + compound.setInteger("MaxBurnTime", this.maxBurnTime); + this.storage.writeToNBT(compound); + super.writeSyncableNBT(compound, sync); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + this.currentBurnTime = compound.getInteger("BurnTime"); + this.maxBurnTime = compound.getInteger("MaxBurnTime"); + this.storage.readFromNBT(compound); + super.readSyncableNBT(compound, sync); + } + @Override @SuppressWarnings("unchecked") public void updateEntity(){ @@ -93,22 +109,6 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements } } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - compound.setInteger("BurnTime", this.currentBurnTime); - compound.setInteger("MaxBurnTime", this.maxBurnTime); - this.storage.writeToNBT(compound); - super.writeSyncableNBT(compound, sync); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - this.currentBurnTime = compound.getInteger("BurnTime"); - this.maxBurnTime = compound.getInteger("MaxBurnTime"); - this.storage.readFromNBT(compound); - super.readSyncableNBT(compound, sync); - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ return TileEntityFurnace.getItemBurnTime(stack) > 0; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java index e893a73a4..82652e39c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java @@ -73,6 +73,24 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements return this.brewTime*i/TIME_USED; } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + super.writeSyncableNBT(compound, sync); + this.storage.writeToNBT(compound); + this.tank.writeToNBT(compound); + compound.setInteger("Cache", this.coffeeCacheAmount); + compound.setInteger("Time", this.brewTime); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + super.readSyncableNBT(compound, sync); + this.storage.readFromNBT(compound); + this.tank.readFromNBT(compound); + this.coffeeCacheAmount = compound.getInteger("Cache"); + this.brewTime = compound.getInteger("Time"); + } + @Override public void updateEntity(){ super.updateEntity(); @@ -92,24 +110,6 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements } } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - this.storage.writeToNBT(compound); - this.tank.writeToNBT(compound); - compound.setInteger("Cache", this.coffeeCacheAmount); - compound.setInteger("Time", this.brewTime); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.storage.readFromNBT(compound); - this.tank.readFromNBT(compound); - this.coffeeCacheAmount = compound.getInteger("Cache"); - this.brewTime = compound.getInteger("Time"); - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ return (i >= 3 && ItemCoffee.getIngredientFromStack(stack) != null) || (i == SLOT_COFFEE_BEANS && stack.getItem() == InitItems.itemCoffeeBean) || (i == SLOT_INPUT && stack.getItem() == InitItems.itemMisc && stack.getItemDamage() == TheMiscItems.CUP.ordinal()) || (i == SLOT_WATER_INPUT && FluidContainerRegistry.containsFluid(stack, new FluidStack(FluidRegistry.WATER, 1))); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java index 6a66fea65..6b31c5228 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java @@ -27,6 +27,23 @@ public class TileEntityCompost extends TileEntityInventoryBase{ super(1, "compost"); } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + super.writeSyncableNBT(compound, sync); + compound.setInteger("ConversionTime", this.conversionTime); + } + + @Override + public boolean shouldSyncSlots(){ + return true; + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + super.readSyncableNBT(compound, sync); + this.conversionTime = compound.getInteger("ConversionTime"); + } + @Override public void updateEntity(){ super.updateEntity(); @@ -45,23 +62,6 @@ public class TileEntityCompost extends TileEntityInventoryBase{ } } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("ConversionTime", this.conversionTime); - } - - @Override - public boolean shouldSyncSlots(){ - return true; - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.conversionTime = compound.getInteger("ConversionTime"); - } - @Override public int getInventoryStackLimit(){ return AMOUNT; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDropper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDropper.java index c6116f01d..60a4982b0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDropper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDropper.java @@ -25,6 +25,18 @@ public class TileEntityDropper extends TileEntityInventoryBase implements IRedst super(9, "dropper"); } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + super.writeSyncableNBT(compound, sync); + compound.setInteger("CurrentTime", this.currentTime); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + super.readSyncableNBT(compound, sync); + this.currentTime = compound.getInteger("CurrentTime"); + } + @Override @SuppressWarnings("unchecked") public void updateEntity(){ @@ -44,18 +56,6 @@ public class TileEntityDropper extends TileEntityInventoryBase implements IRedst } } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("CurrentTime", this.currentTime); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.currentTime = compound.getInteger("CurrentTime"); - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ return true; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnergizer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnergizer.java index aaeb34d8f..33131aeb2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnergizer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnergizer.java @@ -28,6 +28,18 @@ public class TileEntityEnergizer extends TileEntityInventoryBase implements IEne super(2, "energizer"); } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + this.storage.writeToNBT(compound); + super.writeSyncableNBT(compound, sync); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + this.storage.readFromNBT(compound); + super.readSyncableNBT(compound, sync); + } + @Override public void updateEntity(){ super.updateEntity(); @@ -53,18 +65,6 @@ public class TileEntityEnergizer extends TileEntityInventoryBase implements IEne } } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - this.storage.writeToNBT(compound); - super.writeSyncableNBT(compound, sync); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - this.storage.readFromNBT(compound); - super.readSyncableNBT(compound, sync); - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ return i == 0 && stack.getItem() instanceof IEnergyContainerItem; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java index 52518e7f9..2d9f66303 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java @@ -29,6 +29,18 @@ public class TileEntityEnervator extends TileEntityInventoryBase implements IEne super(2, "enervator"); } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + this.storage.writeToNBT(compound); + super.writeSyncableNBT(compound, sync); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + this.storage.readFromNBT(compound); + super.readSyncableNBT(compound, sync); + } + @Override public void updateEntity(){ super.updateEntity(); @@ -58,18 +70,6 @@ public class TileEntityEnervator extends TileEntityInventoryBase implements IEne } } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - this.storage.writeToNBT(compound); - super.writeSyncableNBT(compound, sync); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - this.storage.readFromNBT(compound); - super.readSyncableNBT(compound, sync); - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ return i == 0 && stack.getItem() instanceof IEnergyContainerItem; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFeeder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFeeder.java index 204bc0410..3b42009d9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFeeder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFeeder.java @@ -40,6 +40,24 @@ public class TileEntityFeeder extends TileEntityInventoryBase{ return this.currentTimer*i/TIME; } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + super.writeSyncableNBT(compound, sync); + compound.setInteger("Timer", this.currentTimer); + if(sync){ + compound.setInteger("Animals", this.currentAnimalAmount); + } + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + super.readSyncableNBT(compound, sync); + this.currentTimer = compound.getInteger("Timer"); + if(sync){ + this.currentAnimalAmount = compound.getInteger("Animals"); + } + } + @Override @SuppressWarnings("unchecked") public void updateEntity(){ @@ -91,24 +109,6 @@ public class TileEntityFeeder extends TileEntityInventoryBase{ } } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("Timer", this.currentTimer); - if(sync){ - compound.setInteger("Animals", this.currentAnimalAmount); - } - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.currentTimer = compound.getInteger("Timer"); - if(sync){ - this.currentAnimalAmount = compound.getInteger("Animals"); - } - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ return true; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java index 1e3d8f74e..3be5c827d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java @@ -39,6 +39,22 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements super(4, "furnaceDouble"); } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + super.writeSyncableNBT(compound, sync); + compound.setInteger("FirstSmeltTime", this.firstSmeltTime); + compound.setInteger("SecondSmeltTime", this.secondSmeltTime); + this.storage.writeToNBT(compound); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + super.readSyncableNBT(compound, sync); + this.firstSmeltTime = compound.getInteger("FirstSmeltTime"); + this.secondSmeltTime = compound.getInteger("SecondSmeltTime"); + this.storage.readFromNBT(compound); + } + @Override @SuppressWarnings("unchecked") public void updateEntity(){ @@ -100,22 +116,6 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements } } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("FirstSmeltTime", this.firstSmeltTime); - compound.setInteger("SecondSmeltTime", this.secondSmeltTime); - this.storage.writeToNBT(compound); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.firstSmeltTime = compound.getInteger("FirstSmeltTime"); - this.secondSmeltTime = compound.getInteger("SecondSmeltTime"); - this.storage.readFromNBT(compound); - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ return (i == SLOT_INPUT_1 || i == SLOT_INPUT_2) && FurnaceRecipes.instance().getSmeltingResult(stack) != null; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java index 9ba427066..f55b00d5e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java @@ -71,6 +71,22 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg return true; } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + compound.setInteger("FirstCrushTime", this.firstCrushTime); + compound.setInteger("SecondCrushTime", this.secondCrushTime); + this.storage.writeToNBT(compound); + super.writeSyncableNBT(compound, sync); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + this.firstCrushTime = compound.getInteger("FirstCrushTime"); + this.secondCrushTime = compound.getInteger("SecondCrushTime"); + this.storage.readFromNBT(compound); + super.readSyncableNBT(compound, sync); + } + @Override @SuppressWarnings("unchecked") public void updateEntity(){ @@ -149,22 +165,6 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg } } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - compound.setInteger("FirstCrushTime", this.firstCrushTime); - compound.setInteger("SecondCrushTime", this.secondCrushTime); - this.storage.writeToNBT(compound); - super.writeSyncableNBT(compound, sync); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - this.firstCrushTime = compound.getInteger("FirstCrushTime"); - this.secondCrushTime = compound.getInteger("SecondCrushTime"); - this.storage.readFromNBT(compound); - super.readSyncableNBT(compound, sync); - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ return (i == SLOT_INPUT_1 || i == SLOT_INPUT_2) && CrusherRecipeRegistry.getRecipeFromInput(stack) != null; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java index 5030cc83a..fa65ebde6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java @@ -388,6 +388,32 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt this.markDirty(); } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + super.writeSyncableNBT(compound, sync); + compound.setInteger("SideToPut", this.sideToPut); + compound.setInteger("SlotToPut", this.slotToPutStart); + compound.setInteger("SlotToPutEnd", this.slotToPutEnd); + compound.setInteger("SideToPull", this.sideToPull); + compound.setInteger("SlotToPull", this.slotToPullStart); + compound.setInteger("SlotToPullEnd", this.slotToPullEnd); + compound.setBoolean("PullWhitelist", this.isPullWhitelist); + compound.setBoolean("PutWhitelist", this.isPutWhitelist); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + this.sideToPut = compound.getInteger("SideToPut"); + this.slotToPutStart = compound.getInteger("SlotToPut"); + this.slotToPutEnd = compound.getInteger("SlotToPutEnd"); + this.sideToPull = compound.getInteger("SideToPull"); + this.slotToPullStart = compound.getInteger("SlotToPull"); + this.slotToPullEnd = compound.getInteger("SlotToPullEnd"); + this.isPullWhitelist = compound.getBoolean("PullWhitelist"); + this.isPutWhitelist = compound.getBoolean("PutWhitelist"); + super.readSyncableNBT(compound, sync); + } + @Override public void updateEntity(){ super.updateEntity(); @@ -420,32 +446,6 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt } } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("SideToPut", this.sideToPut); - compound.setInteger("SlotToPut", this.slotToPutStart); - compound.setInteger("SlotToPutEnd", this.slotToPutEnd); - compound.setInteger("SideToPull", this.sideToPull); - compound.setInteger("SlotToPull", this.slotToPullStart); - compound.setInteger("SlotToPullEnd", this.slotToPullEnd); - compound.setBoolean("PullWhitelist", this.isPullWhitelist); - compound.setBoolean("PutWhitelist", this.isPutWhitelist); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - this.sideToPut = compound.getInteger("SideToPut"); - this.slotToPutStart = compound.getInteger("SlotToPut"); - this.slotToPutEnd = compound.getInteger("SlotToPutEnd"); - this.sideToPull = compound.getInteger("SideToPull"); - this.slotToPullStart = compound.getInteger("SlotToPull"); - this.slotToPullEnd = compound.getInteger("SlotToPullEnd"); - this.isPullWhitelist = compound.getBoolean("PullWhitelist"); - this.isPutWhitelist = compound.getBoolean("PutWhitelist"); - super.readSyncableNBT(compound, sync); - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ return i == 0; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java index 1f0ef165c..588f4a1c6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java @@ -107,19 +107,12 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements } } - @Override - public int getInventoryStackLimit(){ - return 64; - } - @Override public boolean hasCapability(net.minecraftforge.common.capabilities.Capability capability, net.minecraft.util.EnumFacing facing){ return this.getCapability(capability, facing) != null; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer player){ - return player.getDistanceSq(this.getPos().getX()+0.5D, this.pos.getY()+0.5D, this.pos.getZ()+0.5D) <= 64 && !this.isInvalid() && this.worldObj.getTileEntity(this.pos) == this; + } @Override + public int getInventoryStackLimit(){ + return 64; } @Override @@ -130,7 +123,16 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements else{ return super.getCapability(capability, facing); } - } @Override + } + + @Override + public boolean isUseableByPlayer(EntityPlayer player){ + return player.getDistanceSq(this.getPos().getX()+0.5D, this.pos.getY()+0.5D, this.pos.getZ()+0.5D) <= 64 && !this.isInvalid() && this.worldObj.getTileEntity(this.pos) == this; + } + + + + @Override public void openInventory(EntityPlayer player){ } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemRepairer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemRepairer.java index 5b1a5412d..209f091c4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemRepairer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemRepairer.java @@ -31,6 +31,20 @@ public class TileEntityItemRepairer extends TileEntityInventoryBase implements I super(2, "repairer"); } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + compound.setInteger("NextRepairTick", this.nextRepairTick); + super.writeSyncableNBT(compound, sync); + this.storage.writeToNBT(compound); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + this.nextRepairTick = compound.getInteger("NextRepairTick"); + super.readSyncableNBT(compound, sync); + this.storage.readFromNBT(compound); + } + @Override @SuppressWarnings("unchecked") public void updateEntity(){ @@ -63,20 +77,6 @@ public class TileEntityItemRepairer extends TileEntityInventoryBase implements I } } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - compound.setInteger("NextRepairTick", this.nextRepairTick); - super.writeSyncableNBT(compound, sync); - this.storage.writeToNBT(compound); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - this.nextRepairTick = compound.getInteger("NextRepairTick"); - super.readSyncableNBT(compound, sync); - this.storage.readFromNBT(compound); - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ return i == SLOT_INPUT; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java index a155eabef..1ed6d9606 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java @@ -47,6 +47,22 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR super(9, "miner"); } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + super.writeSyncableNBT(compound, sync); + this.storage.writeToNBT(compound); + compound.setInteger("Layer", this.layerAt); + compound.setBoolean("OnlyOres", this.onlyMineOres); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + super.readSyncableNBT(compound, sync); + this.storage.readFromNBT(compound); + this.layerAt = compound.getInteger("Layer"); + this.onlyMineOres = compound.getBoolean("OnlyOres"); + } + @Override public void updateEntity(){ super.updateEntity(); @@ -154,22 +170,6 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR return false; } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - this.storage.writeToNBT(compound); - compound.setInteger("Layer", this.layerAt); - compound.setBoolean("OnlyOres", this.onlyMineOres); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.storage.readFromNBT(compound); - this.layerAt = compound.getInteger("Layer"); - this.onlyMineOres = compound.getBoolean("OnlyOres"); - } - @Override public boolean isItemValidForSlot(int slot, ItemStack stack){ return false; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java index a1fed052f..8f6806283 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java @@ -52,6 +52,22 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I return this.currentBurnTime*i/BURN_TIME; } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + compound.setInteger("BurnTime", this.currentBurnTime); + this.storage.writeToNBT(compound); + this.tank.writeToNBT(compound); + super.writeSyncableNBT(compound, sync); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + this.currentBurnTime = compound.getInteger("BurnTime"); + this.storage.readFromNBT(compound); + this.tank.readFromNBT(compound); + super.readSyncableNBT(compound, sync); + } + @Override @SuppressWarnings("unchecked") public void updateEntity(){ @@ -99,22 +115,6 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I } } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - compound.setInteger("BurnTime", this.currentBurnTime); - this.storage.writeToNBT(compound); - this.tank.writeToNBT(compound); - super.writeSyncableNBT(compound, sync); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - this.currentBurnTime = compound.getInteger("BurnTime"); - this.storage.readFromNBT(compound); - this.tank.readFromNBT(compound); - super.readSyncableNBT(compound, sync); - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ return FluidContainerRegistry.containsFluid(stack, new FluidStack(InitFluids.fluidOil, FluidContainerRegistry.BUCKET_VOLUME)) && i == 0; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java index 396341479..e654ac7ed 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java @@ -104,11 +104,6 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{ return null; } - @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return this.isBoundThingInRange() && this.getInventory().isItemValidForSlot(i, stack); - } - @Override public T getCapability(Capability capability, EnumFacing facing){ if(this.isBoundThingInRange()){ @@ -120,6 +115,11 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{ return super.getCapability(capability, facing); } + @Override + public boolean isItemValidForSlot(int i, ItemStack stack){ + return this.isBoundThingInRange() && this.getInventory().isItemValidForSlot(i, stack); + } + @Override public boolean isBoundThingInRange(){ return super.isBoundThingInRange() && worldObj.getTileEntity(boundPosition) instanceof IInventory; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java index 18b411e04..fa9dee768 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java @@ -48,6 +48,30 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP this.capabilities = ForgeEventFactory.gatherCapabilities(this); } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + super.writeSyncableNBT(compound, sync); + compound.setInteger("Range", this.range); + if(this.boundPosition != null){ + compound.setInteger("XCoordOfTileStored", boundPosition.getX()); + compound.setInteger("YCoordOfTileStored", boundPosition.getY()); + compound.setInteger("ZCoordOfTileStored", boundPosition.getZ()); + } + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + super.readSyncableNBT(compound, sync); + int x = compound.getInteger("XCoordOfTileStored"); + int y = compound.getInteger("YCoordOfTileStored"); + int z = compound.getInteger("ZCoordOfTileStored"); + this.range = compound.getInteger("Range"); + if(!(x == 0 && y == 0 && z == 0)){ + this.boundPosition = new BlockPos(x, y, z); + this.markDirty(); + } + } + @Override public void updateEntity(){ super.updateEntity(); @@ -81,27 +105,8 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("Range", this.range); - if(this.boundPosition != null){ - compound.setInteger("XCoordOfTileStored", boundPosition.getX()); - compound.setInteger("YCoordOfTileStored", boundPosition.getY()); - compound.setInteger("ZCoordOfTileStored", boundPosition.getZ()); - } - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - int x = compound.getInteger("XCoordOfTileStored"); - int y = compound.getInteger("YCoordOfTileStored"); - int z = compound.getInteger("ZCoordOfTileStored"); - this.range = compound.getInteger("Range"); - if(!(x == 0 && y == 0 && z == 0)){ - this.boundPosition = new BlockPos(x, y, z); - this.markDirty(); - } + public T getCapability(Capability capability, EnumFacing facing){ + return this.capabilities.getCapability(capability, facing); } @Override @@ -109,11 +114,6 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP return false; } - @Override - public T getCapability(Capability capability, EnumFacing facing){ - return this.capabilities.getCapability(capability, facing); - } - public static int upgradeRange(int defaultRange, World world, BlockPos pos){ int newRange = defaultRange; for(int i = 0; i < 3; i++){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityXPSolidifier.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityXPSolidifier.java index 89d008ee9..bc1617e78 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityXPSolidifier.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityXPSolidifier.java @@ -29,6 +29,18 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I super(1, "xpSolidifier"); } + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + super.writeSyncableNBT(compound, sync); + compound.setShort("Amount", this.amount); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + super.readSyncableNBT(compound, sync); + this.amount = compound.getShort("Amount"); + } + @Override public void updateEntity(){ super.updateEntity(); @@ -53,18 +65,6 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I } } - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setShort("Amount", this.amount); - } - - @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.amount = compound.getShort("Amount"); - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ return false; From 56489b362a47bf519a7ed0bfd41494b1c051ef52 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 1 Feb 2016 20:39:11 +0100 Subject: [PATCH 51/66] There we go. I fixed it. --- .../api/internal/EntrySet.java | 14 ++-- .../mod/blocks/base/BlockPlant.java | 5 +- .../mod/event/PlayerObtainEvents.java | 26 +++--- .../mod/inventory/gui/GuiGrinder.java | 1 + .../mod/items/ItemCoffee.java | 18 ++--- .../mod/items/ItemPhantomConnector.java | 80 +++++++++---------- .../mod/proxy/ClientProxy.java | 40 +++++----- .../mod/recipe/FuelHandler.java | 10 +-- .../mod/tile/TileEntityGrinder.java | 8 +- .../mod/tile/TileEntityInventoryBase.java | 5 +- .../mod/tile/TileEntityItemRepairer.java | 8 +- .../mod/tile/TileEntityPhantomface.java | 28 +++---- .../actuallyadditions/mod/util/ModUtil.java | 1 + 13 files changed, 124 insertions(+), 120 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/internal/EntrySet.java b/src/main/java/de/ellpeck/actuallyadditions/api/internal/EntrySet.java index f3b91b773..fb67d6e6f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/internal/EntrySet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/internal/EntrySet.java @@ -31,13 +31,6 @@ public class EntrySet{ this.setEntry(page, chapter, entry, pageInIndex); } - public void setEntry(BookletPage page, IBookletChapter chapter, IBookletEntry entry, int pageInIndex){ - this.page = page; - this.chapter = chapter; - this.entry = entry; - this.pageInIndex = pageInIndex; - } - public static EntrySet readFromNBT(NBTTagCompound compound){ if(compound != null){ if(compound.hasKey("Entry")){ @@ -56,6 +49,13 @@ public class EntrySet{ return new EntrySet(null); } + public void setEntry(BookletPage page, IBookletChapter chapter, IBookletEntry entry, int pageInIndex){ + this.page = page; + this.chapter = chapter; + this.entry = entry; + this.pageInIndex = pageInIndex; + } + public void removeEntry(){ this.setEntry(null, null, null, 1); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java index 105bc1bdc..665a8baa6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java @@ -121,7 +121,9 @@ public class BlockPlant extends BlockCrops{ @Override public int getDamageValue(World world, BlockPos pos){ return 0; - } @Override + } + + @Override public Item getSeed(){ return this.seedItem; } @@ -137,7 +139,6 @@ public class BlockPlant extends BlockCrops{ } - @Override public Item getItemDropped(IBlockState state, Random rand, int par3){ return this.getMetaFromState(state) >= 7 ? this.getCrop() : this.getSeed(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/PlayerObtainEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/PlayerObtainEvents.java index 1ca2eefd8..d8f009d22 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/PlayerObtainEvents.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/PlayerObtainEvents.java @@ -28,6 +28,19 @@ import java.util.Locale; public class PlayerObtainEvents{ + public static void checkAchievements(ItemStack gotten, EntityPlayer player, InitAchievements.Type type){ + for(int i = 0; i < TheAchievements.values().length; i++){ + TheAchievements ach = TheAchievements.values()[i]; + if(ach.type == type){ + if(gotten != null && ach.ach.theItemStack != null && gotten.getItem() == ach.ach.theItemStack.getItem()){ + if(gotten.getItemDamage() == ach.ach.theItemStack.getItemDamage()){ + player.addStat(ach.ach, 1); + } + } + } + } + } + @SubscribeEvent public void onCraftedEvent(PlayerEvent.ItemCraftedEvent event){ checkAchievements(event.crafting, event.player, InitAchievements.Type.CRAFTING); @@ -51,19 +64,6 @@ public class PlayerObtainEvents{ } } - public static void checkAchievements(ItemStack gotten, EntityPlayer player, InitAchievements.Type type){ - for(int i = 0; i < TheAchievements.values().length; i++){ - TheAchievements ach = TheAchievements.values()[i]; - if(ach.type == type){ - if(gotten != null && ach.ach.theItemStack != null && gotten.getItem() == ach.ach.theItemStack.getItem()){ - if(gotten.getItemDamage() == ach.ach.theItemStack.getItemDamage()){ - player.addStat(ach.ach, 1); - } - } - } - } - } - @SubscribeEvent public void onSmeltedEvent(PlayerEvent.ItemSmeltedEvent event){ checkAchievements(event.smelting, event.player, InitAchievements.Type.SMELTING); 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 e6436a084..db7c2e000 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 @@ -84,6 +84,7 @@ public class GuiGrinder extends GuiContainer{ } public static class GuiGrinderDouble extends GuiGrinder{ + public GuiGrinderDouble(InventoryPlayer inventory, TileEntityBase tile){ super(inventory, tile, true); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCoffee.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCoffee.java index 58400ae70..492f9f6d1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCoffee.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCoffee.java @@ -72,6 +72,15 @@ public class ItemCoffee extends ItemFoodBase{ return null; } + public static void applyPotionEffectsFromStack(ItemStack stack, EntityPlayer player){ + PotionEffect[] effects = CoffeeBrewing.getEffectsFromStack(stack); + if(effects != null && effects.length > 0){ + for(PotionEffect effect : effects){ + player.addPotionEffect(new PotionEffect(effect.getPotionID(), effect.getDuration()*20, effect.getAmplifier())); + } + } + } + @Override public ItemStack onItemUseFinish(ItemStack stack, World world, EntityPlayer player){ ItemStack theStack = stack.copy(); @@ -86,15 +95,6 @@ public class ItemCoffee extends ItemFoodBase{ } } - public static void applyPotionEffectsFromStack(ItemStack stack, EntityPlayer player){ - PotionEffect[] effects = CoffeeBrewing.getEffectsFromStack(stack); - if(effects != null && effects.length > 0){ - for(PotionEffect effect : effects){ - player.addPotionEffect(new PotionEffect(effect.getPotionID(), effect.getDuration()*20, effect.getAmplifier())); - } - } - } - @Override public EnumAction getItemUseAction(ItemStack stack){ return EnumAction.DRINK; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java index e8bb77c13..6ae2a195e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java @@ -39,46 +39,6 @@ public class ItemPhantomConnector extends ItemBase{ this.setMaxStackSize(1); } - @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing par7, float par8, float par9, float par10){ - if(!world.isRemote){ - //Passing Data to Phantoms - TileEntity tile = world.getTileEntity(pos); - if(tile != null){ - //Passing to Phantom - if(tile instanceof IPhantomTile){ - if(this.checkHasConnection(stack, player, tile) && getStoredWorld(stack) == world){ - ((IPhantomTile)tile).setBoundPosition(getStoredPosition(stack)); - if(tile instanceof TileEntityBase){ - ((TileEntityBase)tile).sendUpdate(); - } - clearStorage(stack); - player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connected.desc"))); - return true; - } - return false; - } - } - //Storing Connections - storeConnection(stack, pos.getX(), pos.getY(), pos.getZ(), world); - player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.stored.desc"))); - } - return true; - } - - public boolean checkHasConnection(ItemStack stack, EntityPlayer player, TileEntity tile){ - if(getStoredPosition(stack) != null){ - return true; - } - else{ - if(tile instanceof IPhantomTile){ - ((IPhantomTile)tile).setBoundPosition(null); - } - player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.unbound.desc"))); - return false; - } - } - public static World getStoredWorld(ItemStack stack){ NBTTagCompound tag = stack.getTagCompound(); if(tag != null){ @@ -118,6 +78,46 @@ public class ItemPhantomConnector extends ItemBase{ stack.setTagCompound(tag); } + @Override + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing par7, float par8, float par9, float par10){ + if(!world.isRemote){ + //Passing Data to Phantoms + TileEntity tile = world.getTileEntity(pos); + if(tile != null){ + //Passing to Phantom + if(tile instanceof IPhantomTile){ + if(this.checkHasConnection(stack, player, tile) && getStoredWorld(stack) == world){ + ((IPhantomTile)tile).setBoundPosition(getStoredPosition(stack)); + if(tile instanceof TileEntityBase){ + ((TileEntityBase)tile).sendUpdate(); + } + clearStorage(stack); + player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connected.desc"))); + return true; + } + return false; + } + } + //Storing Connections + storeConnection(stack, pos.getX(), pos.getY(), pos.getZ(), world); + player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.stored.desc"))); + } + return true; + } + + public boolean checkHasConnection(ItemStack stack, EntityPlayer player, TileEntity tile){ + if(getStoredPosition(stack) != null){ + return true; + } + else{ + if(tile instanceof IPhantomTile){ + ((IPhantomTile)tile).setBoundPosition(null); + } + player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.unbound.desc"))); + return false; + } + } + @Override public boolean getShareTag(){ return true; 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 2c7e01d30..a33b7322e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java @@ -54,6 +54,26 @@ public class ClientProxy implements IProxy{ private static Map modelLocationsForRegistering = new HashMap(); private static Map modelVariantsForRegistering = new HashMap(); + private static void countBookletWords(){ + bookletWordCount = 0; + bookletCharCount = 0; + + for(IBookletEntry entry : ActuallyAdditionsAPI.bookletEntries){ + for(IBookletChapter chapter : entry.getChapters()){ + for(BookletPage page : chapter.getPages()){ + if(page.getText() != null){ + bookletWordCount += page.getText().split(" ").length; + bookletCharCount += page.getText().length(); + } + } + bookletWordCount += chapter.getLocalizedName().split(" ").length; + bookletCharCount += chapter.getLocalizedName().length(); + } + bookletWordCount += entry.getLocalizedName().split(" ").length; + bookletCharCount += entry.getLocalizedName().length(); + } + } + @Override public void preInit(FMLPreInitializationEvent event){ ModUtil.LOGGER.info("PreInitializing ClientProxy..."); @@ -99,26 +119,6 @@ public class ClientProxy implements IProxy{ ModelLoader.setCustomStateMapper(block, mapper); } - private static void countBookletWords(){ - bookletWordCount = 0; - bookletCharCount = 0; - - for(IBookletEntry entry : ActuallyAdditionsAPI.bookletEntries){ - for(IBookletChapter chapter : entry.getChapters()){ - for(BookletPage page : chapter.getPages()){ - if(page.getText() != null){ - bookletWordCount += page.getText().split(" ").length; - bookletCharCount += page.getText().length(); - } - } - bookletWordCount += chapter.getLocalizedName().split(" ").length; - bookletCharCount += chapter.getLocalizedName().length(); - } - bookletWordCount += entry.getLocalizedName().split(" ").length; - bookletCharCount += entry.getLocalizedName().length(); - } - } - @Override public void init(FMLInitializationEvent event){ ModUtil.LOGGER.info("Initializing ClientProxy..."); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/FuelHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/FuelHandler.java index dd8cdb85a..080f057f9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/FuelHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/FuelHandler.java @@ -50,11 +50,6 @@ public class FuelHandler implements IFuelHandler{ addFuel(Item.getItemFromBlock(block), metadata, value); } - @Override - public int getBurnTime(ItemStack fuel){ - return getFuelValue(fuel); - } - private static int getFuelValue(ItemStack stack){ if(stack != null && stack.getItem() != null){ Pair pair = Pair.of(stack.getItem(), stack.getItemDamage()); @@ -71,4 +66,9 @@ public class FuelHandler implements IFuelHandler{ } return 0; } + + @Override + public int getBurnTime(ItemStack fuel){ + return getFuelValue(fuel); + } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java index f55b00d5e..90d944eeb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java @@ -51,6 +51,10 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg this.isDouble = false; } + public static int getEnergyUse(boolean isDouble){ + return isDouble ? 60 : 40; + } + @Override public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate){ return this.storage.receiveEnergy(maxReceive, simulate); @@ -193,10 +197,6 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg return false; } - public static int getEnergyUse(boolean isDouble){ - return isDouble ? 60 : 40; - } - private int getMaxCrushTime(){ return this.isDouble ? 150 : 100; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java index 588f4a1c6..8af8f3240 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java @@ -110,7 +110,9 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements @Override public boolean hasCapability(net.minecraftforge.common.capabilities.Capability capability, net.minecraft.util.EnumFacing facing){ return this.getCapability(capability, facing) != null; - } @Override + } + + @Override public int getInventoryStackLimit(){ return 64; } @@ -131,7 +133,6 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements } - @Override public void openInventory(EntityPlayer player){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemRepairer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemRepairer.java index 209f091c4..b0abbbe7f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemRepairer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemRepairer.java @@ -31,6 +31,10 @@ public class TileEntityItemRepairer extends TileEntityInventoryBase implements I super(2, "repairer"); } + public static boolean canBeRepaired(ItemStack stack){ + return stack != null && stack.getItem().isRepairable(); + } + @Override public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ compound.setInteger("NextRepairTick", this.nextRepairTick); @@ -82,10 +86,6 @@ public class TileEntityItemRepairer extends TileEntityInventoryBase implements I return i == SLOT_INPUT; } - public static boolean canBeRepaired(ItemStack stack){ - return stack != null && stack.getItem().isRepairable(); - } - @SideOnly(Side.CLIENT) public int getEnergyScaled(int i){ return this.storage.getEnergyStored()*i/this.storage.getMaxEnergyStored(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java index fa9dee768..5950f7ab0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java @@ -48,6 +48,20 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP this.capabilities = ForgeEventFactory.gatherCapabilities(this); } + public static int upgradeRange(int defaultRange, World world, BlockPos pos){ + int newRange = defaultRange; + for(int i = 0; i < 3; i++){ + Block block = PosUtil.getBlock(PosUtil.offset(pos, 0, 1+i, 0), world); + if(block == InitBlocks.blockPhantomBooster){ + newRange = newRange*2; + } + else{ + break; + } + } + return newRange; + } + @Override public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ super.writeSyncableNBT(compound, sync); @@ -114,20 +128,6 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP return false; } - public static int upgradeRange(int defaultRange, World world, BlockPos pos){ - int newRange = defaultRange; - for(int i = 0; i < 3; i++){ - Block block = PosUtil.getBlock(PosUtil.offset(pos, 0, 1+i, 0), world); - if(block == InitBlocks.blockPhantomBooster){ - newRange = newRange*2; - } - else{ - break; - } - } - return newRange; - } - @Override public boolean hasBoundPosition(){ if(this.boundPosition != null){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ModUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ModUtil.java index ddc3cce50..0f052f5e3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ModUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ModUtil.java @@ -17,6 +17,7 @@ import org.apache.logging.log4j.Logger; import java.util.Locale; public class ModUtil{ + public static final String VERSION = "@VERSION@"; //build.gradle public static final String MOD_ID = ActuallyAdditionsAPI.MOD_ID; From 34dbefc9e6739c3535972f102647a75ce70b99d2 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 1 Feb 2016 21:14:17 +0100 Subject: [PATCH 52/66] ESD Compat for new item system --- .../mod/tile/TileEntityInputter.java | 75 +++++++++++++++---- .../actuallyadditions/mod/util/ItemUtil.java | 4 + 2 files changed, 63 insertions(+), 16 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java index fa65ebde6..f4aa743a6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java @@ -13,6 +13,7 @@ package de.ellpeck.actuallyadditions.mod.tile; import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor; import de.ellpeck.actuallyadditions.mod.network.gui.INumberReactor; +import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; @@ -21,6 +22,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandler; public class TileEntityInputter extends TileEntityInventoryBase implements IButtonReactor, INumberReactor{ @@ -61,34 +64,74 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt @Override public void onNumberReceived(int text, int textID, EntityPlayer player){ if(text != -1){ - if(this.placeToPut instanceof IInventory){ - if(textID == 0){ - this.slotToPutStart = Math.max(Math.min(text, ((IInventory)this.placeToPut).getSizeInventory()-1), 0); - } - if(textID == 1){ - this.slotToPutEnd = Math.max(Math.min(text, ((IInventory)this.placeToPut).getSizeInventory()), 0); - } + //TODO Find a better solution for the Math.max and Math.min stuff here (also below in initVars()!) + if(textID == 0){ + this.slotToPutStart = this.placeToPut instanceof IInventory ? Math.max(Math.min(text, ((IInventory)this.placeToPut).getSizeInventory()-1), 0) : text; + } + if(textID == 1){ + this.slotToPutEnd = this.placeToPut instanceof IInventory ? Math.max(Math.min(text, ((IInventory)this.placeToPut).getSizeInventory()), 0) : text; } - if(this.placeToPull instanceof IInventory){ - if(textID == 2){ - this.slotToPullStart = Math.max(Math.min(text, ((IInventory)this.placeToPull).getSizeInventory()-1), 0); - } - if(textID == 3){ - this.slotToPullEnd = Math.max(Math.min(text, ((IInventory)this.placeToPull).getSizeInventory()), 0); - } + if(textID == 2){ + this.slotToPullStart = this.placeToPull instanceof IInventory ? Math.max(Math.min(text, ((IInventory)this.placeToPull).getSizeInventory()-1), 0) : text; + } + if(textID == 3){ + this.slotToPullEnd = this.placeToPull instanceof IInventory ? Math.max(Math.min(text, ((IInventory)this.placeToPull).getSizeInventory()), 0) : text; } } this.markDirty(); } private boolean newPull(){ - //TODO make this work for the stupid new system + for(EnumFacing facing : EnumFacing.values()){ + IItemHandler handler = this.placeToPull.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, facing); + if(handler != null){ + for(int i = Math.max(this.lastPullStart, 0); i < Math.min(this.slotToPullEnd, handler.getSlots()); i++){ + ItemStack stackInOtherInv = handler.getStackInSlot(i); + if(stackInOtherInv != null){ + if(this.slots[0] == null || ItemUtil.areItemsEqual(stackInOtherInv, this.slots[0], false)){ + + ItemStack pulled = handler.extractItem(i, this.slots[0] == null ? stackInOtherInv.stackSize : Math.min(stackInOtherInv.stackSize, this.slots[0].getMaxStackSize()-this.slots[0].stackSize), false); + if(pulled != null){ + ItemStack slotCopy = this.slots[0] == null ? null : this.slots[0].copy(); + + if(this.slots[0] == null){ + this.slots[0] = pulled.copy(); + } + else{ + this.slots[0].stackSize+=pulled.stackSize; + } + + if(!ItemUtil.areStacksEqualAndSameSize(slotCopy, this.slots[0], false)){ + return true; + } + } + } + } + } + } + } return false; } private boolean newPut(){ - //TODO make this work for the stupid new system + if(this.slots[0] != null){ + for(EnumFacing facing : EnumFacing.values()){ + IItemHandler handler = this.placeToPut.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, facing); + if(handler != null){ + for(int i = Math.max(this.slotToPutStart, 0); i < Math.min(this.slotToPutEnd, handler.getSlots()); i++){ + ItemStack slotCopy = this.slots[0].copy(); + + ItemStack remaining = handler.insertItem(i, slotCopy, false); + this.slots[0] = remaining == null ? null : remaining.copy(); + + if(!ItemUtil.areStacksEqualAndSameSize(slotCopy, this.slots[0], false)){ + return true; + } + } + } + } + } return false; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemUtil.java index e62ac4e4f..63ad713fd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemUtil.java @@ -54,6 +54,10 @@ public class ItemUtil{ return stack1 != null && stack2 != null && (stack1.isItemEqual(stack2) || (checkWildcard && stack1.getItem() == stack2.getItem() && (stack1.getItemDamage() == Util.WILDCARD || stack2.getItemDamage() == Util.WILDCARD))); } + public static boolean areStacksEqualAndSameSize(ItemStack stack1, ItemStack stack2, boolean checkWildcard){ + return areItemsEqual(stack1, stack2, checkWildcard) && stack1.stackSize == stack2.stackSize; + } + /** * Returns true if list contains stack or if both contain null */ From 0d7340474f8eb605eeb349fc699a23a9bc37ddc4 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 1 Feb 2016 21:20:05 +0100 Subject: [PATCH 53/66] Update JEI properly damn it --- build.gradle | 2 +- .../mod/jei/JEIActuallyAdditionsPlugin.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 2e3b634fe..5e13c81aa 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ buildscript { } apply plugin: 'net.minecraftforge.gradle.forge' -version = "1.8.9-r24" +version = "1.8.9-r25" group = "de.ellpeck.actuallyadditions" archivesBaseName = "ActuallyAdditions" diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java index 5639d7455..6a2c86120 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java @@ -86,4 +86,9 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin{ public void onRecipeRegistryAvailable(IRecipeRegistry recipeRegistry){ } + + @Override + public void onRuntimeAvailable(IJeiRuntime jeiRuntime){ + + } } From 58286063ed3e64a07c87f69d781e3943544280a1 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 1 Feb 2016 21:26:44 +0100 Subject: [PATCH 54/66] r25! --- update/changelog.md | 18 ++++++++++++++++++ update/updateVersions.properties | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/update/changelog.md b/update/changelog.md index 5dacd56bf..8524c2366 100644 --- a/update/changelog.md +++ b/update/changelog.md @@ -1,3 +1,21 @@ +# 1.8.9-r25 +* Fixed assets derping because of wrong capitalization +* Ignore NBT Tags of Energy items in JEI +* Added some fun naming stuff to the Reconstructor that makes it have fun stuffz +* Make the floaty special thingie move more awesome! (xdjackiexd) +* Cheap workaround for glitching into some blocks with a smaller hitbox causing graphical glitches and damanging the player +* Fix Smiley Cloud bounding box +* Fix right-clicking never returned any seeds from plants +* Ignore some Items in JEI +* Fix Coffee Machine bounding box +* Added metadata and NBT to the Control Info for ItemStacks +* Added performance settings for bad PCs +* Remove NEI Recipe Handlers until it gets properly updated +* Rebalanced canola oil +* Made a placer be able to apply bonemeal and do other awesome stuff +* Fixed compost and reconstructor syncing with hoppers going wrong +* Updated stuff for the new item system [This is not important for you if you don't make mods!] + # 1.8.9-r24 * Fixed texture names of quartz tools (ssblur) * Added right-click harvest functionality to all crops. (ssblur) diff --git a/update/updateVersions.properties b/update/updateVersions.properties index dd0b98f1c..f00da2961 100644 --- a/update/updateVersions.properties +++ b/update/updateVersions.properties @@ -1,2 +1,2 @@ 1.7.10=21 -1.8.9=24 +1.8.9=25 From 9c4056ed522659ee2a5a50f3ea36d0a980a8c8ec Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 2 Feb 2016 07:25:26 +0100 Subject: [PATCH 55/66] Made the knife not repairable. Closes #69 (hehehehe) --- .../java/de/ellpeck/actuallyadditions/mod/items/ItemKnife.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemKnife.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemKnife.java index 7cd298423..ecaad022b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemKnife.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemKnife.java @@ -24,6 +24,7 @@ public class ItemKnife extends ItemBase{ this.setMaxDamage(100); this.setMaxStackSize(1); this.setContainerItem(this); + this.setNoRepair(); } @Override From 2007732fdc2f0461fc384ab60db3aafdc52136e7 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 3 Feb 2016 18:16:24 +0100 Subject: [PATCH 56/66] Changed download link to be the redirect so that it changes everywhere when it actually changes --- .../de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java index 75cab1a33..cf2d896ab 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java @@ -16,7 +16,7 @@ import de.ellpeck.actuallyadditions.mod.util.Util; public class UpdateChecker{ - public static final String DOWNLOAD_LINK = "http://minecraft.curseforge.com/mc-mods/228404-actually-additions/files"; + public static final String DOWNLOAD_LINK = "http://ellpeck.de/actadddownload"; public static final String CHANGELOG_LINK = "http://ellpeck.de/actaddchangelog/"; public static boolean checkFailed; public static boolean needsUpdateNotify; From 2856c01cce3b97832e97bf991d2d9480cd39df9b Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 3 Feb 2016 23:43:44 +0100 Subject: [PATCH 57/66] Removed Lens registry. It wasn't needed. --- .../actuallyadditions/api/ActuallyAdditionsAPI.java | 2 -- .../java/de/ellpeck/actuallyadditions/api/lens/Lens.java | 9 --------- .../ellpeck/actuallyadditions/mod/items/lens/Lenses.java | 8 ++++---- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java b/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java index 82acde7b5..79ecd9e3b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java @@ -12,7 +12,6 @@ package de.ellpeck.actuallyadditions.api; import de.ellpeck.actuallyadditions.api.booklet.BookletPage; import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry; -import de.ellpeck.actuallyadditions.api.lens.Lens; import de.ellpeck.actuallyadditions.api.recipe.BallOfFurReturn; import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe; import de.ellpeck.actuallyadditions.api.recipe.LensNoneRecipe; @@ -33,7 +32,6 @@ public class ActuallyAdditionsAPI{ public static List crusherRecipes = new ArrayList(); public static List ballOfFurReturnItems = new ArrayList(); public static List treasureChestLoot = new ArrayList(); - public static List reconstructorLenses = new ArrayList(); public static List reconstructorLensNoneRecipes = new ArrayList(); public static List coffeeMachineIngredients = new ArrayList(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/lens/Lens.java b/src/main/java/de/ellpeck/actuallyadditions/api/lens/Lens.java index cf6693465..de2bd038c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/lens/Lens.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/lens/Lens.java @@ -10,7 +10,6 @@ package de.ellpeck.actuallyadditions.api.lens; -import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import net.minecraft.item.Item; import net.minecraft.util.BlockPos; @@ -45,14 +44,6 @@ public abstract class Lens{ */ public abstract int getDistance(); - /** - * Registers the lense type - */ - public Lens register(){ - ActuallyAdditionsAPI.reconstructorLenses.add(this); - return this; - } - /** * Sets the item corresponding to the lense */ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/Lenses.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/Lenses.java index 1d4a143fb..f09d0c45d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/Lenses.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/Lenses.java @@ -14,8 +14,8 @@ import de.ellpeck.actuallyadditions.api.lens.Lens; public class Lenses{ - public static final Lens LENS_NONE = new LensNone().register(); - public static final Lens LENS_DETONATION = new LensDetonation().register(); - public static final Lens LENS_DEATH = new LensDeath().register(); - public static final Lens LENS_COLOR = new LensColor().register(); + public static final Lens LENS_NONE = new LensNone(); + public static final Lens LENS_DETONATION = new LensDetonation(); + public static final Lens LENS_DEATH = new LensDeath(); + public static final Lens LENS_COLOR = new LensColor(); } From d593a05cca68f474d3da34f7af6cdb85e09f8a98 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 3 Feb 2016 23:46:22 +0100 Subject: [PATCH 58/66] bump api version --- .../de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java b/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java index 79ecd9e3b..840c6e8cc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java @@ -27,7 +27,7 @@ public class ActuallyAdditionsAPI{ public static final String MOD_ID = "ActuallyAdditions"; public static final String API_ID = MOD_ID+"API"; - public static final String API_VERSION = "7"; + public static final String API_VERSION = "8"; public static List crusherRecipes = new ArrayList(); public static List ballOfFurReturnItems = new ArrayList(); From d2721e09795d42ebbdf59a8e4c6b9c0eb2c65980 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 5 Feb 2016 11:19:02 +0100 Subject: [PATCH 59/66] added click areas to JEI for easy recipe access --- .../mod/jei/JEIActuallyAdditionsPlugin.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java index 6a2c86120..695977f42 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java @@ -12,6 +12,9 @@ package de.ellpeck.actuallyadditions.mod.jei; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCoffeeMachine; +import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFurnaceDouble; +import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiGrinder; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.jei.booklet.BookletRecipeCategory; import de.ellpeck.actuallyadditions.mod.jei.booklet.BookletRecipeHandler; @@ -21,8 +24,10 @@ import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherRecipeCategory; import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherRecipeHandler; import de.ellpeck.actuallyadditions.mod.jei.reconstructor.ReconstructorRecipeCategory; import de.ellpeck.actuallyadditions.mod.jei.reconstructor.ReconstructorRecipeHandler; +import de.ellpeck.actuallyadditions.mod.nei.NEICoffeeMachineRecipe; import de.ellpeck.actuallyadditions.mod.util.Util; import mezz.jei.api.*; +import mezz.jei.api.recipe.VanillaRecipeCategoryUid; import net.minecraft.item.ItemStack; @JEIPlugin @@ -61,6 +66,11 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin{ registry.addRecipes(ActuallyAdditionsAPI.crusherRecipes); registry.addRecipes(ActuallyAdditionsAPI.reconstructorLensNoneRecipes); + registry.addRecipeClickArea(GuiCoffeeMachine.class, 53, 42, 22, 16, NEICoffeeMachineRecipe.NAME); + registry.addRecipeClickArea(GuiGrinder.class, 80, 40, 24, 22, CrusherRecipeCategory.NAME); + registry.addRecipeClickArea(GuiGrinder.GuiGrinderDouble.class, 51, 40, 74, 22, CrusherRecipeCategory.NAME); + registry.addRecipeClickArea(GuiFurnaceDouble.class, 51, 40, 74, 22, VanillaRecipeCategoryUid.SMELTING); + INbtIgnoreList ignoreList = this.helpers.getNbtIgnoreList(); ignoreList.ignoreNbtTagNames(InitItems.itemDrill, "Energy"); ignoreList.ignoreNbtTagNames(InitItems.itemTeleStaff, "Energy"); From 63641f9520e40d26b9e34b9f8671d9f46a9bcb21 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 6 Feb 2016 20:55:19 +0100 Subject: [PATCH 60/66] Update Forge and JEI and shit --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 5e13c81aa..922d1dfb2 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ group = "de.ellpeck.actuallyadditions" archivesBaseName = "ActuallyAdditions" minecraft { - version = "1.8.9-11.15.1.1726" + version = "1.8.9-11.15.1.1732" runDir = "idea" mappings = "stable_20" @@ -42,7 +42,7 @@ dependencies { //compile "codechicken:CodeChickenCore:1.8-1.0.5.36:dev" //compile "codechicken:NotEnoughItems:1.8-1.0.5.104:dev" - deobfCompile "mezz.jei:jei_1.8.9:2.24.0.109" + deobfCompile "mezz.jei:jei_1.8.9:2.25.6.140" } processResources { From e15c09778e5fdc5cf662066d31b4c7d669cd55fa Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 6 Feb 2016 21:56:00 +0100 Subject: [PATCH 61/66] Set ESD incomplete --- .../de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 abc86dfdd..e41d6ebed 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -87,7 +87,7 @@ public class InitBooklet{ new BookletChapter("dropper", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockDropper), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeDropper).setNoText()); new BookletChapter("phantomfaces", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockPhantomLiquiface), new PageTextOnly(1).addTextReplacement("", TileEntityPhantomface.RANGE), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipePhantomface), new PageCrafting(4, BlockCrafting.recipeLiquiface), new PageCrafting(5, BlockCrafting.recipeEnergyface), new PageCrafting(6, ItemCrafting.recipePhantomConnector).setNoText(), new PageCrafting(7, BlockCrafting.recipePhantomBooster)).setImportant(); new BookletChapter("phantomBreaker", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockPhantomBreaker), 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), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeESD).setNoText(), new PageCrafting(3, BlockCrafting.recipeAdvancedESD).setNoText()).setSpecial(); + new BookletChapter("esd", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockInputterAdvanced), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeESD).setNoText(), new PageCrafting(3, BlockCrafting.recipeAdvancedESD).setNoText()).setSpecial().setIncomplete(); new BookletChapter("xpSolidifier", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockXPSolidifier), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemSolidifiedExperience)), new PageCrafting(2, BlockCrafting.recipeSolidifier).setNoText()).setSpecial().setIncomplete(); new BookletChapter("greenhouseGlass", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockGreenhouseGlass), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeGlass)); new BookletChapter("fishingNet", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFishingNet), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFisher).setNoText()); From 32c10c5bebc246a34006f08e7a244216cd02a176 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 6 Feb 2016 22:07:12 +0100 Subject: [PATCH 62/66] Haphazardly revert implementation of new item system for ESD as it completely broke pulling items for sided inventories --- .../mod/tile/TileEntityInputter.java | 12 +++++------- .../mod/tile/TileEntityPhantomItemface.java | 1 + .../actuallyadditions/mod/util/WorldUtil.java | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java index f4aa743a6..a1e750691 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java @@ -13,7 +13,6 @@ package de.ellpeck.actuallyadditions.mod.tile; import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor; import de.ellpeck.actuallyadditions.mod.network.gui.INumberReactor; -import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; @@ -22,8 +21,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; -import net.minecraftforge.items.CapabilityItemHandler; -import net.minecraftforge.items.IItemHandler; public class TileEntityInputter extends TileEntityInventoryBase implements IButtonReactor, INumberReactor{ @@ -82,8 +79,9 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt this.markDirty(); } + //TODO Fix for new item system private boolean newPull(){ - for(EnumFacing facing : EnumFacing.values()){ + /*for(EnumFacing facing : EnumFacing.values()){ IItemHandler handler = this.placeToPull.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, facing); if(handler != null){ for(int i = Math.max(this.lastPullStart, 0); i < Math.min(this.slotToPullEnd, handler.getSlots()); i++){ @@ -110,12 +108,12 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt } } } - } + }*/ return false; } private boolean newPut(){ - if(this.slots[0] != null){ + /*if(this.slots[0] != null){ for(EnumFacing facing : EnumFacing.values()){ IItemHandler handler = this.placeToPut.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, facing); if(handler != null){ @@ -131,7 +129,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt } } } - } + }*/ return false; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java index e654ac7ed..f2307db89 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java @@ -18,6 +18,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraftforge.common.capabilities.Capability; +//TODO completely adapt to new item system? public class TileEntityPhantomItemface extends TileEntityPhantomface{ public TileEntityPhantomItemface(){ 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 2f9e52d50..a0a47372c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java @@ -246,7 +246,7 @@ public class WorldUtil{ return blocks; } - //TODO make this work for the stupid new system + //TODO make this work for the stupid new item system public static boolean addToInventory(IInventory inventory, ArrayList stacks, boolean actuallyDo, boolean shouldAlwaysWork){ return addToInventory(inventory, stacks, EnumFacing.UP, actuallyDo, shouldAlwaysWork); From 8caecdfd235c517da365c697754a9081de937720 Mon Sep 17 00:00:00 2001 From: Kristian295 Date: Tue, 9 Feb 2016 18:19:11 +0100 Subject: [PATCH 63/66] de_DE.lang : ll. 572 - 579 Translated: - booklet.actuallyadditions.chapter.intro.* - booklet.actuallyadditions.chapter.craftingIngs.* --- .../assets/actuallyadditions/lang/de_DE.lang | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/resources/assets/actuallyadditions/lang/de_DE.lang b/src/main/resources/assets/actuallyadditions/lang/de_DE.lang index 3fe156d93..c24d7ccd8 100644 --- a/src/main/resources/assets/actuallyadditions/lang/de_DE.lang +++ b/src/main/resources/assets/actuallyadditions/lang/de_DE.lang @@ -569,14 +569,14 @@ booklet.actuallyadditions.clickToSeeRecipe=Klicke, um weitere Informationen zu e booklet.actuallyadditions.amountOfWords=%s Wörter insgesamt booklet.actuallyadditions.amountOfChars=%s Zeichen insgesamt -#Booklet Chapters -booklet.actuallyadditions.chapter.intro.name=An Introduction to ActAdd -booklet.actuallyadditions.chapter.intro.text.1=For too long have the people of Minecraftia toiled under a relentless whip. A whip more hurtful and more injurious than that of any slave-master: inconvenience. Aye, the thousand million inconveniences that make up the grind, that force players to waste hours- nay, days!- chopping wood and farming wheat and other such mundane tasks, just to momentarily escape the remorseless tedium and experience the true joys of Minecraftia, building, caving and adventuring into the beautiful uncharted abundance -booklet.actuallyadditions.chapter.intro.text.2=of the world. Yet no sooner has one immersed oneself in this creative enterprise than the inconveniences return, like millions of furious bees pestering, stinging, swarming all over you until the game ceases to be enjoyable, and you are driven away from it forever. To that end, a certain Ellpeck has created this Actual Addition to the world of Minecraft, that will allow the player to better engage with the core experiences of the game- building and adventuring- by automating and streamlining the monotony that -booklet.actuallyadditions.chapter.intro.text.3=is grinding in Minecraft. Therefore, Ellpeck humbly presents to you this Actually Additions Manual, that shall teach you the ways of this modification and, ultimately, allow you to transcend inconvenience and attain enlightenment. ~by Tulkas +#Booklet Chapters / Handbuch-Kapitel +booklet.actuallyadditions.chapter.intro.name=Einführung zu ActAdd +booklet.actuallyadditions.chapter.intro.text.1=Für eine zu lange Zeit haben die Bewohner von Minecraftien unter der Gewalt einer unerbittlichen Peitsche geschuftet. Eine Peitsche so verletzend und schädlich: einfach lästig. Ja, die millionenfachen Lästigkeiten aus denen diese Plage besteht, die die Spieler dazu zwingt Stunden - nein, sogar Tage! - Bäume zu fällen, Weizen zu farmen und anderen solch stumpfsinnigen Tätigkeiten nachzugehen, nur um augenblicklich der erbarmungslosen Langeweile zu entfliehen und die wirklichen Freuden in Minecraftien zu erleben, zu bauen und die tiefen und fernen Welten zu entdecken bis hin zum unerforschten Reichtum, +booklet.actuallyadditions.chapter.intro.text.2=der in dieser Welt steckt. Noch nicht früher ist jemand in diese kreative Unternehmung eingetaucht als die Unannehmlichkeiten zurückkerhren, wie millionen rasende, lästige Binen, stechend, um dich herrum schwirred bis das Spiel aufhört Spaß zu machen, und du bist bis in alle Ewigkeit vertrieben. Zu diesem Zweck hat ein gewisser Ellpeck dieses Actually Additions geschaffen, welches dem Spieler erlaubt, sich mehr mit den Kernerlebnissen Minecrafts zu beschäftigen - bauen und abenteuern - indem die Monotonie automatisiert und rationalisiert wird, +booklet.actuallyadditions.chapter.intro.text.3=die Minecraft plagt. Deshalb präsentiert dir Ellpeck demütig dieses Handbuch, welches dir die Funktionen dieser Modifikation zeigen und, ultimativ, dir erlauben wird, die Unbequemlichkeiten zu überwinden und Erleuchtung zu erlangen. ~by Tulkas -booklet.actuallyadditions.chapter.craftingIngs.name=Crafting Ingredients -booklet.actuallyadditions.chapter.craftingIngs.text.1=Actually Additions has lots of items that use certain basic crafting items to be crafted. This chapter has all of these basic items grouped up so that you can see all of them at once. +booklet.actuallyadditions.chapter.craftingIngs.name=Werkel-Zutaten +booklet.actuallyadditions.chapter.craftingIngs.text.1=Actually Additions hat viele Gegenstände, die elementare Werkel-Gegenstände benötigen um hergestellt zu werden. In diesem Kapitel sind diese alle gruppiert, so kannst du sie alle auf einem Mal sehen. booklet.actuallyadditions.chapter.quartz.name=Black Quartz booklet.actuallyadditions.chapter.quartz.text.1=Black Quartz is an Ore that generates in the world between layer and . When broken, it can be smelted in a furnace or crushed in a crusher to get broken down into Black Quartz. From ef07e2d72595f599d05c69a4705cb2284828d67b Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 9 Feb 2016 18:29:48 +0100 Subject: [PATCH 64/66] Revert #72. Text is too long for the pages. --- .../assets/actuallyadditions/lang/de_DE.lang | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/resources/assets/actuallyadditions/lang/de_DE.lang b/src/main/resources/assets/actuallyadditions/lang/de_DE.lang index c24d7ccd8..3fe156d93 100644 --- a/src/main/resources/assets/actuallyadditions/lang/de_DE.lang +++ b/src/main/resources/assets/actuallyadditions/lang/de_DE.lang @@ -569,14 +569,14 @@ booklet.actuallyadditions.clickToSeeRecipe=Klicke, um weitere Informationen zu e booklet.actuallyadditions.amountOfWords=%s Wörter insgesamt booklet.actuallyadditions.amountOfChars=%s Zeichen insgesamt -#Booklet Chapters / Handbuch-Kapitel -booklet.actuallyadditions.chapter.intro.name=Einführung zu ActAdd -booklet.actuallyadditions.chapter.intro.text.1=Für eine zu lange Zeit haben die Bewohner von Minecraftien unter der Gewalt einer unerbittlichen Peitsche geschuftet. Eine Peitsche so verletzend und schädlich: einfach lästig. Ja, die millionenfachen Lästigkeiten aus denen diese Plage besteht, die die Spieler dazu zwingt Stunden - nein, sogar Tage! - Bäume zu fällen, Weizen zu farmen und anderen solch stumpfsinnigen Tätigkeiten nachzugehen, nur um augenblicklich der erbarmungslosen Langeweile zu entfliehen und die wirklichen Freuden in Minecraftien zu erleben, zu bauen und die tiefen und fernen Welten zu entdecken bis hin zum unerforschten Reichtum, -booklet.actuallyadditions.chapter.intro.text.2=der in dieser Welt steckt. Noch nicht früher ist jemand in diese kreative Unternehmung eingetaucht als die Unannehmlichkeiten zurückkerhren, wie millionen rasende, lästige Binen, stechend, um dich herrum schwirred bis das Spiel aufhört Spaß zu machen, und du bist bis in alle Ewigkeit vertrieben. Zu diesem Zweck hat ein gewisser Ellpeck dieses Actually Additions geschaffen, welches dem Spieler erlaubt, sich mehr mit den Kernerlebnissen Minecrafts zu beschäftigen - bauen und abenteuern - indem die Monotonie automatisiert und rationalisiert wird, -booklet.actuallyadditions.chapter.intro.text.3=die Minecraft plagt. Deshalb präsentiert dir Ellpeck demütig dieses Handbuch, welches dir die Funktionen dieser Modifikation zeigen und, ultimativ, dir erlauben wird, die Unbequemlichkeiten zu überwinden und Erleuchtung zu erlangen. ~by Tulkas +#Booklet Chapters +booklet.actuallyadditions.chapter.intro.name=An Introduction to ActAdd +booklet.actuallyadditions.chapter.intro.text.1=For too long have the people of Minecraftia toiled under a relentless whip. A whip more hurtful and more injurious than that of any slave-master: inconvenience. Aye, the thousand million inconveniences that make up the grind, that force players to waste hours- nay, days!- chopping wood and farming wheat and other such mundane tasks, just to momentarily escape the remorseless tedium and experience the true joys of Minecraftia, building, caving and adventuring into the beautiful uncharted abundance +booklet.actuallyadditions.chapter.intro.text.2=of the world. Yet no sooner has one immersed oneself in this creative enterprise than the inconveniences return, like millions of furious bees pestering, stinging, swarming all over you until the game ceases to be enjoyable, and you are driven away from it forever. To that end, a certain Ellpeck has created this Actual Addition to the world of Minecraft, that will allow the player to better engage with the core experiences of the game- building and adventuring- by automating and streamlining the monotony that +booklet.actuallyadditions.chapter.intro.text.3=is grinding in Minecraft. Therefore, Ellpeck humbly presents to you this Actually Additions Manual, that shall teach you the ways of this modification and, ultimately, allow you to transcend inconvenience and attain enlightenment. ~by Tulkas -booklet.actuallyadditions.chapter.craftingIngs.name=Werkel-Zutaten -booklet.actuallyadditions.chapter.craftingIngs.text.1=Actually Additions hat viele Gegenstände, die elementare Werkel-Gegenstände benötigen um hergestellt zu werden. In diesem Kapitel sind diese alle gruppiert, so kannst du sie alle auf einem Mal sehen. +booklet.actuallyadditions.chapter.craftingIngs.name=Crafting Ingredients +booklet.actuallyadditions.chapter.craftingIngs.text.1=Actually Additions has lots of items that use certain basic crafting items to be crafted. This chapter has all of these basic items grouped up so that you can see all of them at once. booklet.actuallyadditions.chapter.quartz.name=Black Quartz booklet.actuallyadditions.chapter.quartz.text.1=Black Quartz is an Ore that generates in the world between layer and . When broken, it can be smelted in a furnace or crushed in a crusher to get broken down into Black Quartz. From 5272d572befbe6c3d75e57bbf2245cd37b34e532 Mon Sep 17 00:00:00 2001 From: Glenthor Date: Wed, 10 Feb 2016 21:06:25 +0100 Subject: [PATCH 65/66] -Added Rounded Prism --- .../textures/items/itemRoundedPrism.png | Bin 0 -> 802 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/main/resources/assets/actuallyadditions/textures/items/itemRoundedPrism.png diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemRoundedPrism.png b/src/main/resources/assets/actuallyadditions/textures/items/itemRoundedPrism.png new file mode 100644 index 0000000000000000000000000000000000000000..a2de4029f1a56ead01cf1766d351fb19c1516f28 GIT binary patch literal 802 zcmV+-1Ks?IP)%03B&m zSad^gZEa<4bN~PV002XBWnpw>WFU8GbZ8()Nlj2>E@cM*00M?dL_t(I%Waasi(OR| zg}<}+Irq)HXN+krRS>jD5go8eZyf?6ii}B&VrRr6iV_V2V}=kER4mLNU}0|&1tCs? zDI{XRQ6v6HBO<|h@7{aP*=Jh}OdNGpt61M+6)W&RI{MUQPy40}!-7C0P%wl~EP)(XG-%#o zW_43!dKZC|dTn@~KMpXFmmqt{j>y(e)JB8@Z_;6%( z)6bq>LBzp@Qk|b}1tKt1Be+s>A$E}m@7sY=0yE>p^Xo{%XI5s3I z0jJNE=`3<%3mT0^MBPyBw)6rP~rBrp|Q|frL+jOqn}s$(UBl{8+VTM z#EC0@?3op|d#E`hA+S6Z#-S3!1Q#d Date: Wed, 10 Feb 2016 21:07:48 +0100 Subject: [PATCH 66/66] Revert https://github.com/Ellpeck/ActuallyAdditions/commit/5272d572befbe6c3d75e57bbf2245cd37b34e532 --- .../textures/items/itemRoundedPrism.png | Bin 802 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/main/resources/assets/actuallyadditions/textures/items/itemRoundedPrism.png diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemRoundedPrism.png b/src/main/resources/assets/actuallyadditions/textures/items/itemRoundedPrism.png deleted file mode 100644 index a2de4029f1a56ead01cf1766d351fb19c1516f28..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 802 zcmV+-1Ks?IP)%03B&m zSad^gZEa<4bN~PV002XBWnpw>WFU8GbZ8()Nlj2>E@cM*00M?dL_t(I%Waasi(OR| zg}<}+Irq)HXN+krRS>jD5go8eZyf?6ii}B&VrRr6iV_V2V}=kER4mLNU}0|&1tCs? zDI{XRQ6v6HBO<|h@7{aP*=Jh}OdNGpt61M+6)W&RI{MUQPy40}!-7C0P%wl~EP)(XG-%#o zW_43!dKZC|dTn@~KMpXFmmqt{j>y(e)JB8@Z_;6%( z)6bq>LBzp@Qk|b}1tKt1Be+s>A$E}m@7sY=0yE>p^Xo{%XI5s3I z0jJNE=`3<%3mT0^MBPyBw)6rP~rBrp|Q|frL+jOqn}s$(UBl{8+VTM z#EC0@?3op|d#E`hA+S6Z#-S3!1Q#d