From d46801a0f1aad60d548c5301ffa87874bf7a6bb1 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 30 Mar 2015 15:08:19 +0200 Subject: [PATCH] Furnace Solar & Fishing Net --- .../ellpeck/actuallyadditions/PLANNED.txt | 69 +++++++++++ .../achievement/AchievementAA.java | 4 +- .../achievement/InitAchievements.java | 21 +--- .../blocks/BlockCompost.java | 7 +- .../blocks/BlockFishingNet.java | 106 +++++++++++++++++ .../blocks/BlockFurnaceSolar.java | 106 +++++++++++++++++ .../actuallyadditions/blocks/InitBlocks.java | 8 ++ .../blocks/render/ModelFishingNet.java | 109 ++++++++++++++++++ .../blocks/render/ModelFurnaceSolar.java | 26 +++++ .../config/ConfigValues.java | 10 +- .../config/ConfigurationHandler.java | 6 +- .../crafting/BlockCrafting.java | 22 ++++ .../creative/CreativeTab.java | 2 + .../actuallyadditions/event/CraftEvent.java | 10 +- .../actuallyadditions/event/SmeltEvent.java | 7 +- .../items/metalists/TheSpecialDrops.java | 4 +- .../actuallyadditions/proxy/ClientProxy.java | 12 +- .../tile/TileEntityBase.java | 2 + .../tile/TileEntityFishingNet.java | 44 +++++++ .../tile/TileEntityFurnaceSolar.java | 50 ++++++++ .../tile/TileEntityGrinder.java | 3 +- .../tile/TileEntityInputter.java | 19 +-- .../tile/TileEntityInventoryBase.java | 13 ++- .../assets/actuallyadditions/lang/en_US.lang | 4 + 24 files changed, 603 insertions(+), 61 deletions(-) create mode 100644 src/main/java/ellpeck/actuallyadditions/PLANNED.txt create mode 100644 src/main/java/ellpeck/actuallyadditions/blocks/BlockFishingNet.java create mode 100644 src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceSolar.java create mode 100644 src/main/java/ellpeck/actuallyadditions/blocks/render/ModelFishingNet.java create mode 100644 src/main/java/ellpeck/actuallyadditions/blocks/render/ModelFurnaceSolar.java create mode 100644 src/main/java/ellpeck/actuallyadditions/tile/TileEntityFishingNet.java create mode 100644 src/main/java/ellpeck/actuallyadditions/tile/TileEntityFurnaceSolar.java diff --git a/src/main/java/ellpeck/actuallyadditions/PLANNED.txt b/src/main/java/ellpeck/actuallyadditions/PLANNED.txt new file mode 100644 index 000000000..53d310489 --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/PLANNED.txt @@ -0,0 +1,69 @@ +-Redstone Control for the ESD + +-Quartz Enchanter + -Lets you enchant Tools with Black Quartz + -Doesn't use Levels + -Needs Quartz and Diamond Blocks instead of Bookcases around + +-Advanced ESD + -Has a Filter + +-Heat Collector + -Powers Furnaces when next to them + -Needs Warmth Sources around it + +-Instant Teleport Device + -Teleports Players to where they look (Much like the Bukkit Compass) + +-Magnet + -Pulls Mobs and Items towards it + -Has a certain Redstone Output depending on Mob Amount + -Can be toggled On and Off + +-Void Bag + -Sucks up picked up Items + -Has a Filter + -Destroys excess Items (also determined by a Filter) + -Gets emptied into Chest on Right-Click + +-Rice + -Gets planted in the Water + -Used to make Rice Flour and Rice Bread + +-Auto-Crafting Item + -Has a Recipe saved + -Crafts Recipe on Shift-Right-Click if all Items are in Inventory + +-Repair Station + -Powered by Coal + -Repairs Items slowly + +-TNT Arrows + +-Teleport Arrows + -Teleport hit Entities randomly + +-Thorn Plant + -Grows on the Floor + -Damages Entities walking on it + -Has Thorn Armor which damages the Enemy + +-Cobblestone and Stone Signs + +-Potion Rings + -Give certain Potion Effects when held + +-Binoculars + -Allow you to see farther and closer + -With Night Vision Addon + +-Sound Irritation Device + -Plays Random or Configured Sounds randomly + +-Uncrafting Table + +-Decorative Lead + -Can be placed between two Fences for Decoration + +-Greenhouse Glass + -Gives Plants below more Growth Ticks \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/achievement/AchievementAA.java b/src/main/java/ellpeck/actuallyadditions/achievement/AchievementAA.java index bb092eb4b..07642d0c4 100644 --- a/src/main/java/ellpeck/actuallyadditions/achievement/AchievementAA.java +++ b/src/main/java/ellpeck/actuallyadditions/achievement/AchievementAA.java @@ -8,8 +8,8 @@ public class AchievementAA extends Achievement{ public AchievementAA(String name, int x, int y, ItemStack displayStack, Achievement hasToHaveBefore){ super("achievement." + ModUtil.MOD_ID_LOWER + "." + name, ModUtil.MOD_ID_LOWER + "." + name, x, y, displayStack, hasToHaveBefore); - InitAchievements.achievementList.add(this); + /*InitAchievements.achievementList.add(this); if(hasToHaveBefore == null) this.initIndependentStat(); - this.registerStat(); + this.registerStat();*/ } } \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/achievement/InitAchievements.java b/src/main/java/ellpeck/actuallyadditions/achievement/InitAchievements.java index 9930f8109..41fa1f9d6 100644 --- a/src/main/java/ellpeck/actuallyadditions/achievement/InitAchievements.java +++ b/src/main/java/ellpeck/actuallyadditions/achievement/InitAchievements.java @@ -1,21 +1,8 @@ package ellpeck.actuallyadditions.achievement; -import ellpeck.actuallyadditions.blocks.InitBlocks; -import ellpeck.actuallyadditions.items.InitItems; -import ellpeck.actuallyadditions.items.metalists.TheFoods; -import ellpeck.actuallyadditions.items.metalists.TheMiscItems; -import ellpeck.actuallyadditions.util.ModUtil; -import ellpeck.actuallyadditions.util.Util; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.Achievement; -import net.minecraft.util.StatCollector; -import net.minecraftforge.common.AchievementPage; - -import java.util.ArrayList; - public class InitAchievements{ - public static AchievementPage theAchievementPage; + /*public static AchievementPage theAchievementPage; public static ArrayList achievementList = new ArrayList(); public static Achievement achievementCraftKnifeBlade; @@ -32,10 +19,10 @@ public class InitAchievements{ public static Achievement achievementCraftPaperCone; public static Achievement achievementCraftFrenchFry; public static Achievement achievementCraftFrenchFries; - public static Achievement achievementCraftFishNChips; + public static Achievement achievementCraftFishNChips;*/ public static void init(){ - Util.logInfo("Initializing Achievements..."); + /*Util.logInfo("Initializing Achievements..."); achievementCraftKnifeBlade = new AchievementAA("craftKnifeBlade", -2, 0, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_BLADE.ordinal()), null); achievementCraftKnife = new AchievementAA("craftKnife", 0, 0, new ItemStack(InitItems.itemKnife), achievementCraftKnifeBlade); @@ -55,7 +42,7 @@ public class InitAchievements{ theAchievementPage = new AchievementPage(StatCollector.translateToLocal("achievement.page." + ModUtil.MOD_ID_LOWER), achievementList.toArray(new Achievement[achievementList.size()])); - AchievementPage.registerAchievementPage(theAchievementPage); + AchievementPage.registerAchievementPage(theAchievementPage);*/ } } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCompost.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCompost.java index b1b9220d1..f4592931e 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCompost.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCompost.java @@ -3,7 +3,7 @@ package ellpeck.actuallyadditions.blocks; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ellpeck.actuallyadditions.achievement.InitAchievements; +import ellpeck.actuallyadditions.config.ConfigValues; import ellpeck.actuallyadditions.items.ItemFertilizer; import ellpeck.actuallyadditions.items.ItemMisc; import ellpeck.actuallyadditions.items.metalists.TheMiscItems; @@ -44,7 +44,7 @@ public class BlockCompost extends BlockContainerBase implements IName{ ItemStack stackPlayer = player.getCurrentEquippedItem(); TileEntityCompost tile = (TileEntityCompost)world.getTileEntity(x, y, z); //Add items to be composted - if(stackPlayer != null && stackPlayer.getItem() instanceof ItemMisc && stackPlayer.getItemDamage() == TheMiscItems.MASHED_FOOD.ordinal() && (tile.slots[0] == null || (!(tile.slots[0].getItem() instanceof ItemFertilizer) && tile.slots[0].stackSize < tile.amountNeededToConvert))){ + if(stackPlayer != null && stackPlayer.getItem() instanceof ItemMisc && stackPlayer.getItemDamage() == TheMiscItems.MASHED_FOOD.ordinal() && (tile.slots[0] == null || (!(tile.slots[0].getItem() instanceof ItemFertilizer) && tile.slots[0].stackSize < ConfigValues.tileEntityCompostAmountNeededToConvert))){ if(tile.slots[0] == null) tile.slots[0] = new ItemStack(stackPlayer.getItem(), 1, TheMiscItems.MASHED_FOOD.ordinal()); else tile.slots[0].stackSize++; if(!player.capabilities.isCreativeMode) player.inventory.getCurrentItem().stackSize--; @@ -53,7 +53,8 @@ public class BlockCompost extends BlockContainerBase implements IName{ else if(tile.slots[0] != null && (stackPlayer == null || (stackPlayer.getItem() instanceof ItemFertilizer && stackPlayer.stackSize <= stackPlayer.getMaxStackSize() - tile.slots[0].stackSize)) && tile.slots[0].getItem() instanceof ItemFertilizer){ if(stackPlayer == null) player.inventory.setInventorySlotContents(player.inventory.currentItem, tile.slots[0].copy()); else player.getCurrentEquippedItem().stackSize+=tile.slots[0].stackSize; - player.addStat(InitAchievements.achievementCraftFertilizer, 1); + //TODO Add again when readding Achievements + //player.addStat(InitAchievements.achievementCraftFertilizer, 1); tile.slots[0] = null; } } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFishingNet.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFishingNet.java new file mode 100644 index 000000000..3431050ca --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFishingNet.java @@ -0,0 +1,106 @@ +package ellpeck.actuallyadditions.blocks; + +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ellpeck.actuallyadditions.tile.TileEntityFishingNet; +import ellpeck.actuallyadditions.util.IName; +import ellpeck.actuallyadditions.util.ItemUtil; +import ellpeck.actuallyadditions.util.KeyUtil; +import ellpeck.actuallyadditions.util.ModUtil; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +import java.util.List; + +public class BlockFishingNet extends BlockContainerBase implements IName{ + + public BlockFishingNet(){ + super(Material.wood); + this.setHarvestLevel("axe", 0); + this.setHardness(1.0F); + this.setStepSound(soundTypeWood); + this.setBlockBounds(0F, 0F, 0F, 1F, 1F/16F, 1F); + } + + @Override + public TileEntity createNewTileEntity(World world, int par2){ + return new TileEntityFishingNet(); + } + + @Override + public IIcon getIcon(int side, int metadata){ + return this.blockIcon; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconReg){ + this.blockIcon = Blocks.planks.getIcon(0, 0); + } + + @Override + public boolean isOpaqueCube(){ + return false; + } + + @Override + public boolean renderAsNormalBlock(){ + return false; + } + + @Override + public int getRenderType(){ + return RenderingRegistry.getNextAvailableRenderId(); + } + + @Override + public String getName(){ + return "blockFishingNet"; + } + + public static class TheItemBlock extends ItemBlock{ + + private Block theBlock; + + public TheItemBlock(Block block){ + super(block); + this.theBlock = block; + this.setHasSubtypes(false); + this.setMaxDamage(0); + } + + @Override + public EnumRarity getRarity(ItemStack stack){ + return EnumRarity.uncommon; + } + + @Override + public String getUnlocalizedName(ItemStack stack){ + return this.getUnlocalizedName(); + } + + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc")); + else list.add(ItemUtil.shiftForInfo()); + } + + @Override + public int getMetadata(int meta){ + return meta; + } + } +} diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceSolar.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceSolar.java new file mode 100644 index 000000000..f38b339db --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceSolar.java @@ -0,0 +1,106 @@ +package ellpeck.actuallyadditions.blocks; + +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ellpeck.actuallyadditions.tile.TileEntityFurnaceSolar; +import ellpeck.actuallyadditions.util.IName; +import ellpeck.actuallyadditions.util.ItemUtil; +import ellpeck.actuallyadditions.util.KeyUtil; +import ellpeck.actuallyadditions.util.ModUtil; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +import java.util.List; + +public class BlockFurnaceSolar extends BlockContainerBase implements IName{ + + public BlockFurnaceSolar(){ + super(Material.wood); + this.setHarvestLevel("axe", 0); + this.setHardness(1.0F); + this.setStepSound(soundTypeWood); + this.setBlockBounds(0F, 0F, 0F, 1F, 3F/16F, 1F); + } + + @Override + public TileEntity createNewTileEntity(World world, int par2){ + return new TileEntityFurnaceSolar(); + } + + @Override + public IIcon getIcon(int side, int metadata){ + return this.blockIcon; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconReg){ + this.blockIcon = Blocks.daylight_detector.getIcon(0, 0); + } + + @Override + public boolean isOpaqueCube(){ + return false; + } + + @Override + public boolean renderAsNormalBlock(){ + return false; + } + + @Override + public int getRenderType(){ + return RenderingRegistry.getNextAvailableRenderId(); + } + + @Override + public String getName(){ + return "blockFurnaceSolar"; + } + + public static class TheItemBlock extends ItemBlock{ + + private Block theBlock; + + public TheItemBlock(Block block){ + super(block); + this.theBlock = block; + this.setHasSubtypes(false); + this.setMaxDamage(0); + } + + @Override + public EnumRarity getRarity(ItemStack stack){ + return EnumRarity.rare; + } + + @Override + public String getUnlocalizedName(ItemStack stack){ + return this.getUnlocalizedName(); + } + + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc")); + else list.add(ItemUtil.shiftForInfo()); + } + + @Override + public int getMetadata(int meta){ + return meta; + } + } +} diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java b/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java index 7e6c96900..e504131d9 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java @@ -15,6 +15,8 @@ public class InitBlocks{ public static Block blockGrinderDouble; public static Block blockFurnaceDouble; public static Block blockInputter; + public static Block blockFishingNet; + public static Block blockFurnaceSolar; public static void init(){ Util.logInfo("Initializing Blocks..."); @@ -42,5 +44,11 @@ public class InitBlocks{ blockInputter = new BlockInputter(); BlockUtil.register(blockInputter, BlockInputter.TheItemBlock.class); + + blockFishingNet = new BlockFishingNet(); + BlockUtil.register(blockFishingNet, BlockFishingNet.TheItemBlock.class); + + blockFurnaceSolar = new BlockFurnaceSolar(); + BlockUtil.register(blockFurnaceSolar, BlockFurnaceSolar.TheItemBlock.class); } } \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/render/ModelFishingNet.java b/src/main/java/ellpeck/actuallyadditions/blocks/render/ModelFishingNet.java new file mode 100644 index 000000000..a705d732a --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/blocks/render/ModelFishingNet.java @@ -0,0 +1,109 @@ +package ellpeck.actuallyadditions.blocks.render; + +import net.minecraft.client.model.ModelRenderer; + +public class ModelFishingNet extends ModelBaseAA{ + + public ModelRenderer s1; + public ModelRenderer s2; + public ModelRenderer s3; + public ModelRenderer s4; + public ModelRenderer s5; + public ModelRenderer s6; + public ModelRenderer s7; + public ModelRenderer s8; + public ModelRenderer s9; + public ModelRenderer s10; + public ModelRenderer s11; + public ModelRenderer s12; + public ModelRenderer s13; + public ModelRenderer s14; + public ModelRenderer s15; + public ModelRenderer s16; + + public ModelFishingNet(){ + this.textureWidth = 64; + this.textureHeight = 64; + this.s11 = new ModelRenderer(this, 0, 0); + this.s11.mirror = true; + this.s11.setRotationPoint(-3.5F, 23.0F, -8.0F); + this.s11.addBox(0.0F, 0.0F, 0.0F, 1, 1, 16, 0.0F); + this.s9 = new ModelRenderer(this, 0, 0); + this.s9.mirror = true; + this.s9.setRotationPoint(-7.5F, 23.0F, -8.0F); + this.s9.addBox(0.0F, 0.0F, 0.0F, 1, 1, 16, 0.0F); + this.s8 = new ModelRenderer(this, 0, 0); + this.s8.setRotationPoint(-8.0F, 23.0F, 6.5F); + this.s8.addBox(0.0F, 0.0F, 0.0F, 16, 1, 1, 0.0F); + this.s3 = new ModelRenderer(this, 0, 0); + this.s3.setRotationPoint(-8.0F, 23.0F, -3.5F); + this.s3.addBox(0.0F, 0.0F, 0.0F, 16, 1, 1, 0.0F); + this.s1 = new ModelRenderer(this, 0, 0); + this.s1.setRotationPoint(-8.0F, 23.0F, -7.5F); + this.s1.addBox(0.0F, 0.0F, 0.0F, 16, 1, 1, 0.0F); + this.s14 = new ModelRenderer(this, 0, 0); + this.s14.mirror = true; + this.s14.setRotationPoint(2.5F, 23.0F, -8.0F); + this.s14.addBox(0.0F, 0.0F, 0.0F, 1, 1, 16, 0.0F); + this.s15 = new ModelRenderer(this, 0, 0); + this.s15.mirror = true; + this.s15.setRotationPoint(4.5F, 23.0F, -8.0F); + this.s15.addBox(0.0F, 0.0F, 0.0F, 1, 1, 16, 0.0F); + this.s4 = new ModelRenderer(this, 0, 0); + this.s4.setRotationPoint(-8.0F, 23.0F, -1.5F); + this.s4.addBox(0.0F, 0.0F, 0.0F, 16, 1, 1, 0.0F); + this.s13 = new ModelRenderer(this, 0, 0); + this.s13.mirror = true; + this.s13.setRotationPoint(0.5F, 23.0F, -8.0F); + this.s13.addBox(0.0F, 0.0F, 0.0F, 1, 1, 16, 0.0F); + this.s5 = new ModelRenderer(this, 0, 0); + this.s5.setRotationPoint(-8.0F, 23.0F, 0.5F); + this.s5.addBox(0.0F, 0.0F, 0.0F, 16, 1, 1, 0.0F); + this.s6 = new ModelRenderer(this, 0, 0); + this.s6.setRotationPoint(-8.0F, 23.0F, 2.5F); + this.s6.addBox(0.0F, 0.0F, 0.0F, 16, 1, 1, 0.0F); + this.s12 = new ModelRenderer(this, 0, 0); + this.s12.mirror = true; + this.s12.setRotationPoint(-1.5F, 23.0F, -8.0F); + this.s12.addBox(0.0F, 0.0F, 0.0F, 1, 1, 16, 0.0F); + this.s16 = new ModelRenderer(this, 0, 0); + this.s16.mirror = true; + this.s16.setRotationPoint(6.5F, 23.0F, -8.0F); + this.s16.addBox(0.0F, 0.0F, 0.0F, 1, 1, 16, 0.0F); + this.s2 = new ModelRenderer(this, 0, 0); + this.s2.setRotationPoint(-8.0F, 23.0F, -5.5F); + this.s2.addBox(0.0F, 0.0F, 0.0F, 16, 1, 1, 0.0F); + this.s7 = new ModelRenderer(this, 0, 0); + this.s7.setRotationPoint(-8.0F, 23.0F, 4.5F); + this.s7.addBox(0.0F, 0.0F, 0.0F, 16, 1, 1, 0.0F); + this.s10 = new ModelRenderer(this, 0, 0); + this.s10.mirror = true; + this.s10.setRotationPoint(-5.5F, 23.0F, -8.0F); + this.s10.addBox(0.0F, 0.0F, 0.0F, 1, 1, 16, 0.0F); + } + + @Override + public void render(float f){ + this.s11.render(f); + this.s9.render(f); + this.s8.render(f); + this.s3.render(f); + this.s1.render(f); + this.s14.render(f); + this.s15.render(f); + this.s4.render(f); + this.s13.render(f); + this.s5.render(f); + this.s6.render(f); + this.s12.render(f); + this.s16.render(f); + this.s2.render(f); + this.s7.render(f); + this.s10.render(f); + } + + @Override + public String getName(){ + return "modelFishingNet"; + } +} diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/render/ModelFurnaceSolar.java b/src/main/java/ellpeck/actuallyadditions/blocks/render/ModelFurnaceSolar.java new file mode 100644 index 000000000..af150a390 --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/blocks/render/ModelFurnaceSolar.java @@ -0,0 +1,26 @@ +package ellpeck.actuallyadditions.blocks.render; + +import net.minecraft.client.model.ModelRenderer; + +public class ModelFurnaceSolar extends ModelBaseAA{ + + public ModelRenderer s; + + public ModelFurnaceSolar(){ + this.textureWidth = 64; + this.textureHeight = 32; + this.s = new ModelRenderer(this, 0, 0); + this.s.setRotationPoint(-8.0F, 21.0F, -8.0F); + this.s.addBox(0.0F, 0.0F, 0.0F, 16, 3, 16, 0.0F); + } + + @Override + public void render(float f){ + this.s.render(f); + } + + @Override + public String getName(){ + return "modelFurnaceSolar"; + } +} diff --git a/src/main/java/ellpeck/actuallyadditions/config/ConfigValues.java b/src/main/java/ellpeck/actuallyadditions/config/ConfigValues.java index 20505d2e5..7b6ba2e6d 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/ConfigValues.java +++ b/src/main/java/ellpeck/actuallyadditions/config/ConfigValues.java @@ -25,6 +25,8 @@ public class ConfigValues{ public static int tileEntityFeederTimeNeeded; public static int tileEntityFeederThreshold; + public static int tileFishingNetTime; + public static int itemKnifeMaxDamage; public static int toolEmeraldHarvestLevel; @@ -91,12 +93,12 @@ public class ConfigValues{ blackQuartzMinHeight = config.getInt("Black Quartz Min Height", ConfigurationHandler.CATEGORY_WORLD_GEN, 0, 0, 256, "How high the Black Quartz starts to generate"); blackQuartzMaxHeight = config.getInt("Black Quartz Max Height", ConfigurationHandler.CATEGORY_WORLD_GEN, 25, 0, 256, "How high the Black Quartz stops to generate at"); - enableExperienceDrop = config.getBoolean("Solidified Experience", ConfigurationHandler.CATEGORY_MOB_DROPS, false, "If the Solidified Experience drops from Mobs"); + enableExperienceDrop = config.getBoolean("Solidified Experience", ConfigurationHandler.CATEGORY_MOB_DROPS, true, "If the Solidified Experience drops from Mobs"); enableBloodDrop = config.getBoolean("Blood Fragments", ConfigurationHandler.CATEGORY_MOB_DROPS, false, "If the Blood Fragments drop from Mobs"); enableHeartDrop = config.getBoolean("Heart Parts", ConfigurationHandler.CATEGORY_MOB_DROPS, false, "If the Heart Parts drop from Mobs"); enableSubstanceDrop = config.getBoolean("Unknown Substance", ConfigurationHandler.CATEGORY_MOB_DROPS, false, "If the Unknown Substance drops from Mobs"); - enablePearlShardDrop = config.getBoolean("Ender Pearl Shard", ConfigurationHandler.CATEGORY_MOB_DROPS, false, "If the Ender Pearl Shard drops from Mobs"); - enableEmeraldShardDrop = config.getBoolean("Emerald Shard", ConfigurationHandler.CATEGORY_MOB_DROPS, false, "If the Emerald Shard drops from Mobs"); + enablePearlShardDrop = config.getBoolean("Ender Pearl Shard", ConfigurationHandler.CATEGORY_MOB_DROPS, true, "If the Ender Pearl Shard drops from Mobs"); + enableEmeraldShardDrop = config.getBoolean("Emerald Shard", ConfigurationHandler.CATEGORY_MOB_DROPS, true, "If the Emerald Shard drops from Mobs"); enableCompostRecipe = config.getBoolean("Compost", ConfigurationHandler.CATEGORY_BLOCKS_CRAFTING, true, "If the Crafting Recipe for the Compost is Enabled"); enableKnifeRecipe = config.getBoolean("Knife", ConfigurationHandler.CATEGORY_ITEMS_CRAFTING, true, "If the Crafting Recipe for the Knife is Enabled"); @@ -111,6 +113,8 @@ public class ConfigValues{ tileEntityCompostAmountNeededToConvert = config.getInt("Compost: Amount Needed To Convert", ConfigurationHandler.CATEGORY_MACHINE_VALUES, 10, 1, 64, "How many items are needed in the Compost to convert to Fertilizer"); tileEntityCompostConversionTimeNeeded = config.getInt("Compost: Conversion Time Needed", ConfigurationHandler.CATEGORY_MACHINE_VALUES, 1000, 30, 10000, "How long the Compost needs to convert to Fertilizer"); + tileFishingNetTime = config.getInt("Fishing Net: Time Needed", ConfigurationHandler.CATEGORY_MACHINE_VALUES, 2000, 50, 50000, "How long it takes on Average until the Fishing Net catches a Fish"); + tileEntityFeederReach = config.getInt("Feeder: Reach", ConfigurationHandler.CATEGORY_MACHINE_VALUES, 5, 1, 20, "The Radius of Action of the Feeder"); tileEntityFeederTimeNeeded = config.getInt("Feeder: Time Needed", ConfigurationHandler.CATEGORY_MACHINE_VALUES, 100, 50, 5000, "The time spent between feeding animals with the Feeder"); tileEntityFeederThreshold = config.getInt("Feeder: Threshold", ConfigurationHandler.CATEGORY_MACHINE_VALUES, 30, 3, 500, "How many animals need to be in the area for the Feeder to stop"); diff --git a/src/main/java/ellpeck/actuallyadditions/config/ConfigurationHandler.java b/src/main/java/ellpeck/actuallyadditions/config/ConfigurationHandler.java index 076c7f6dd..8c2680c1b 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/ConfigurationHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/config/ConfigurationHandler.java @@ -29,8 +29,10 @@ public class ConfigurationHandler{ e.printStackTrace(); } finally{ - config.save(); + if(config.hasChanged()){ + config.save(); + } } } -} +} \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java index 1e2a96f48..8c974698c 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java @@ -2,6 +2,7 @@ package ellpeck.actuallyadditions.crafting; import cpw.mods.fml.common.registry.GameRegistry; import ellpeck.actuallyadditions.blocks.InitBlocks; +import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks; import ellpeck.actuallyadditions.config.ConfigValues; import ellpeck.actuallyadditions.items.InitItems; import ellpeck.actuallyadditions.items.metalists.TheMiscItems; @@ -21,6 +22,27 @@ public class BlockCrafting{ 'W', new ItemStack(Blocks.planks, 1, Util.WILDCARD), 'F', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.MASHED_FOOD.ordinal())); + //Quartz Block + GameRegistry.addRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal()), + "QQ", "QQ", + 'Q', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())); + + //Fishing Net + GameRegistry.addRecipe(new ItemStack(InitBlocks.blockFishingNet), + "SSS", "SDS", "SSS", + 'D', new ItemStack(Items.diamond), + 'S', new ItemStack(Items.string)); + + //Quartz Pillar + GameRegistry.addRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_PILLAR.ordinal()), + "Q", "Q", + 'Q', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())); + + //Chiseled Quartz + GameRegistry.addRecipe(new ItemStack(InitBlocks.blockMisc, 2, TheMiscBlocks.QUARTZ_CHISELED.ordinal()), + "Q", "Q", + 'Q', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal())); + //Inputter if(ConfigValues.enableInputterRecipe) GameRegistry.addRecipe(new ItemStack(InitBlocks.blockInputter), diff --git a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java index 774e63afa..7ab1eea9a 100644 --- a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java +++ b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java @@ -30,6 +30,8 @@ public class CreativeTab extends CreativeTabs{ this.addBlock(InitBlocks.blockGrinder); this.addBlock(InitBlocks.blockGrinderDouble); this.addBlock(InitBlocks.blockFurnaceDouble); + this.addBlock(InitBlocks.blockFurnaceSolar); + this.addBlock(InitBlocks.blockFishingNet); this.addBlock(InitBlocks.blockMisc); this.addBlock(InitBlocks.blockFeeder); diff --git a/src/main/java/ellpeck/actuallyadditions/event/CraftEvent.java b/src/main/java/ellpeck/actuallyadditions/event/CraftEvent.java index 861072e89..32026b10e 100644 --- a/src/main/java/ellpeck/actuallyadditions/event/CraftEvent.java +++ b/src/main/java/ellpeck/actuallyadditions/event/CraftEvent.java @@ -2,18 +2,12 @@ package ellpeck.actuallyadditions.event; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent; -import ellpeck.actuallyadditions.achievement.InitAchievements; -import ellpeck.actuallyadditions.blocks.InitBlocks; -import ellpeck.actuallyadditions.items.InitItems; -import ellpeck.actuallyadditions.items.metalists.TheFoods; -import ellpeck.actuallyadditions.items.metalists.TheMiscItems; -import net.minecraft.item.Item; public class CraftEvent{ @SubscribeEvent public void onCraftedEvent(PlayerEvent.ItemCraftedEvent event){ - if(event.crafting.getItem() == InitItems.itemMisc && event.crafting.getItemDamage() == TheMiscItems.DOUGH.ordinal()){ + /*if(event.crafting.getItem() == InitItems.itemMisc && event.crafting.getItemDamage() == TheMiscItems.DOUGH.ordinal()){ event.player.addStat(InitAchievements.achievementCraftDough, 1); } if(event.crafting.getItem() == InitItems.itemMisc && event.crafting.getItemDamage() == TheMiscItems.MASHED_FOOD.ordinal()){ @@ -42,6 +36,6 @@ public class CraftEvent{ } if(event.crafting.getItem()== Item.getItemFromBlock(InitBlocks.blockCompost)){ event.player.addStat(InitAchievements.achievementCraftCompost, 1); - } + }*/ } } diff --git a/src/main/java/ellpeck/actuallyadditions/event/SmeltEvent.java b/src/main/java/ellpeck/actuallyadditions/event/SmeltEvent.java index e45e8db0f..a88ba7606 100644 --- a/src/main/java/ellpeck/actuallyadditions/event/SmeltEvent.java +++ b/src/main/java/ellpeck/actuallyadditions/event/SmeltEvent.java @@ -2,16 +2,13 @@ package ellpeck.actuallyadditions.event; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent; -import ellpeck.actuallyadditions.achievement.InitAchievements; -import ellpeck.actuallyadditions.items.InitItems; -import ellpeck.actuallyadditions.items.metalists.TheFoods; public class SmeltEvent{ @SubscribeEvent public void onSmeltedEvent(PlayerEvent.ItemSmeltedEvent event){ - if(event.smelting.getItem() == InitItems.itemFoods && event.smelting.getItemDamage() == TheFoods.BAGUETTE.ordinal()){ + /*if(event.smelting.getItem() == InitItems.itemFoods && event.smelting.getItemDamage() == TheFoods.BAGUETTE.ordinal()){ event.player.addStat(InitAchievements.achievementSmeltBaguette, 1); - } + }*/ } } diff --git a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheSpecialDrops.java b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheSpecialDrops.java index f2717f35d..9ac0b6268 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheSpecialDrops.java +++ b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheSpecialDrops.java @@ -14,8 +14,8 @@ public enum TheSpecialDrops implements IName{ BLOOD_FRAGMENT("BloodFragment", 15, 1, EntityCreature.class, EnumRarity.uncommon, ConfigValues.enableBloodDrop), HEART_PART("HeartPart", 5, 1, EntityCreature.class, EnumRarity.rare, ConfigValues.enableHeartDrop), UNKNOWN_SUBSTANCE("UnknownSubstance", 3, 1, EntitySkeleton.class, EnumRarity.epic, ConfigValues.enableSubstanceDrop), - PEARL_SHARD("PearlShard", 20, 3, EntityEnderman.class, EnumRarity.epic, ConfigValues.enablePearlShardDrop), - EMERALD_SHARD("EmeraldShard", 15, 1, EntityCreeper.class, EnumRarity.rare, ConfigValues.enableEmeraldShardDrop); + PEARL_SHARD("PearlShard", 30, 3, EntityEnderman.class, EnumRarity.epic, ConfigValues.enablePearlShardDrop), + EMERALD_SHARD("EmeraldShard", 30, 3, EntityCreeper.class, EnumRarity.rare, ConfigValues.enableEmeraldShardDrop); public final String name; public final int chance; diff --git a/src/main/java/ellpeck/actuallyadditions/proxy/ClientProxy.java b/src/main/java/ellpeck/actuallyadditions/proxy/ClientProxy.java index 7f84ee781..ec1c2ddaf 100644 --- a/src/main/java/ellpeck/actuallyadditions/proxy/ClientProxy.java +++ b/src/main/java/ellpeck/actuallyadditions/proxy/ClientProxy.java @@ -3,10 +3,10 @@ package ellpeck.actuallyadditions.proxy; import cpw.mods.fml.client.registry.ClientRegistry; import ellpeck.actuallyadditions.blocks.InitBlocks; -import ellpeck.actuallyadditions.blocks.render.ModelCompost; -import ellpeck.actuallyadditions.blocks.render.RenderItems; -import ellpeck.actuallyadditions.blocks.render.RenderTileEntity; +import ellpeck.actuallyadditions.blocks.render.*; import ellpeck.actuallyadditions.tile.TileEntityCompost; +import ellpeck.actuallyadditions.tile.TileEntityFishingNet; +import ellpeck.actuallyadditions.tile.TileEntityFurnaceSolar; import net.minecraft.item.Item; import net.minecraftforge.client.MinecraftForgeClient; @@ -22,6 +22,12 @@ public class ClientProxy implements IProxy{ public void init(){ ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCompost.class, new RenderTileEntity(new ModelCompost())); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(InitBlocks.blockCompost), new RenderItems(new ModelCompost())); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFishingNet.class, new RenderTileEntity(new ModelFishingNet())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(InitBlocks.blockFishingNet), new RenderItems(new ModelFishingNet())); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFurnaceSolar.class, new RenderTileEntity(new ModelFurnaceSolar())); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(InitBlocks.blockFurnaceSolar), new RenderItems(new ModelFurnaceSolar())); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityBase.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityBase.java index d60125a48..41dc14b35 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityBase.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityBase.java @@ -35,6 +35,8 @@ public class TileEntityBase extends TileEntity{ GameRegistry.registerTileEntity(TileEntityGrinder.class, ModUtil.MOD_ID_LOWER + ":tileEntityGrinder"); GameRegistry.registerTileEntity(TileEntityFurnaceDouble.class, ModUtil.MOD_ID_LOWER + ":tileEntityFurnaceDouble"); GameRegistry.registerTileEntity(TileEntityInputter.class, ModUtil.MOD_ID_LOWER + ":tileEntityInputter"); + GameRegistry.registerTileEntity(TileEntityFishingNet.class, ModUtil.MOD_ID_LOWER + ":tileEntityFishingNet"); + GameRegistry.registerTileEntity(TileEntityFurnaceSolar.class, ModUtil.MOD_ID_LOWER + ":tileEntityFurnaceSolar"); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFishingNet.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFishingNet.java new file mode 100644 index 000000000..2b2a36557 --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFishingNet.java @@ -0,0 +1,44 @@ +package ellpeck.actuallyadditions.tile; + +import ellpeck.actuallyadditions.config.ConfigValues; +import net.minecraft.block.material.Material; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.FishingHooks; + +import java.util.Random; + +public class TileEntityFishingNet extends TileEntityBase{ + + public int timeUntilNextDropToSet = ConfigValues.tileFishingNetTime; + + public int timeUntilNextDrop; + + @Override + public void updateEntity(){ + if(!worldObj.isRemote){ + if(worldObj.getBlock(xCoord, yCoord-1, zCoord).getMaterial() == Material.water){ + Random rand = new Random(); + if(this.timeUntilNextDrop > 0){ + this.timeUntilNextDrop--; + if(timeUntilNextDrop <= 0){ + worldObj.spawnEntityInWorld(new EntityItem(worldObj, xCoord+0.5, yCoord+1.8, zCoord+0.5, FishingHooks.getRandomFishable(rand, this.worldObj.rand.nextFloat()))); + } + } + else this.timeUntilNextDrop = this.timeUntilNextDropToSet + rand.nextInt(this.timeUntilNextDropToSet/2); + } + } + } + + @Override + public void writeToNBT(NBTTagCompound compound){ + super.writeToNBT(compound); + compound.setInteger("TimeUntilNextDrop", this.timeUntilNextDrop); + } + + @Override + public void readFromNBT(NBTTagCompound compound){ + super.readFromNBT(compound); + this.timeUntilNextDrop = compound.getInteger("TimeUntilNextDrop"); + } +} diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFurnaceSolar.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFurnaceSolar.java new file mode 100644 index 000000000..e58f9ec02 --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFurnaceSolar.java @@ -0,0 +1,50 @@ +package ellpeck.actuallyadditions.tile; + +import net.minecraft.block.BlockFurnace; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityFurnace; + +public class TileEntityFurnaceSolar extends TileEntityBase{ + + @Override + public void updateEntity(){ + if(!worldObj.isRemote){ + if(worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord) && worldObj.isDaytime()){ + TileEntity tileBelow = TileEntityInputter.getTileEntityFromSide(1, worldObj, xCoord, yCoord, zCoord); + + if(tileBelow instanceof TileEntityFurnace){ + TileEntityFurnace furnaceBelow = (TileEntityFurnace)tileBelow; + int burnTimeBefore = furnaceBelow.furnaceBurnTime; + furnaceBelow.furnaceBurnTime = 42; + furnaceBelow.currentItemBurnTime = 42; + if(burnTimeBefore == 0){ + BlockFurnace.updateFurnaceBlockState(true, this.worldObj, furnaceBelow.xCoord, furnaceBelow.yCoord, furnaceBelow.zCoord); + } + return; + } + + if(tileBelow instanceof TileEntityFurnaceDouble){ + TileEntityFurnaceDouble doubleBelow = (TileEntityFurnaceDouble)tileBelow; + int coalTimeBefore = doubleBelow.coalTime; + doubleBelow.coalTime = 42; + doubleBelow.coalTimeLeft = 42; + if(coalTimeBefore == 0){ + int metaBefore = worldObj.getBlockMetadata(doubleBelow.xCoord, doubleBelow.yCoord, doubleBelow.zCoord); + worldObj.setBlockMetadataWithNotify(doubleBelow.xCoord, doubleBelow.yCoord, doubleBelow.zCoord, metaBefore+4, 2); + } + return; + } + + if(tileBelow instanceof TileEntityGrinder){ + TileEntityGrinder grinderBelow = (TileEntityGrinder)tileBelow; + int coalTimeBefore = grinderBelow.coalTime; + grinderBelow.coalTime = 42; + grinderBelow.coalTimeLeft = 42; + if(coalTimeBefore == 0){ + worldObj.setBlockMetadataWithNotify(grinderBelow.xCoord, grinderBelow.yCoord, grinderBelow.zCoord, 1, 2); + } + } + } + } + } +} diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGrinder.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGrinder.java index c7614f0b4..490e6f0cc 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGrinder.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGrinder.java @@ -136,7 +136,6 @@ public class TileEntityGrinder extends TileEntityInventoryBase{ compound.setInteger("CoalTimeLeft", this.coalTimeLeft); compound.setInteger("FirstCrushTime", this.firstCrushTime); compound.setInteger("SecondCrushTime", this.secondCrushTime); - compound.setInteger("MaxCrushTime", this.maxCrushTime); compound.setBoolean("IsDouble", this.isDouble); compound.setString("Name", this.name); compound.setInteger("Slots", this.slots.length); @@ -149,9 +148,9 @@ public class TileEntityGrinder extends TileEntityInventoryBase{ this.coalTimeLeft = compound.getInteger("CoalTimeLeft"); this.firstCrushTime = compound.getInteger("FirstCrushTime"); this.secondCrushTime = compound.getInteger("SecondCrushTime"); - this.maxCrushTime = compound.getInteger("MaxCrushTime"); this.isDouble = compound.getBoolean("IsDouble"); this.name = compound.getString("Name"); + this.maxCrushTime = isDouble ? ConfigValues.grinderDoubleCrushTime : ConfigValues.grinderCrushTime; this.initializeSlots(compound.getInteger("Slots")); super.readFromNBT(compound); } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java index b09a17857..ac7e8c798 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java @@ -5,6 +5,7 @@ import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; public class TileEntityInputter extends TileEntityInventoryBase{ @@ -152,8 +153,8 @@ public class TileEntityInputter extends TileEntityInventoryBase{ } public void initVars(){ - this.placeToPull = this.getTileEntityFromSide(this.sideToPull); - this.placeToPut = this.getTileEntityFromSide(this.sideToPut); + this.placeToPull = getTileEntityFromSide(this.sideToPull, this.worldObj, this.xCoord, this.yCoord, this.zCoord); + this.placeToPut = getTileEntityFromSide(this.sideToPut, this.worldObj, this.xCoord, this.yCoord, this.zCoord); if(this.placeToPull != null && this.placeToPull instanceof IInventory){ this.placeToPullSlotAmount = ((IInventory)this.placeToPull).getSizeInventory(); @@ -172,13 +173,13 @@ public class TileEntityInputter extends TileEntityInventoryBase{ } } - public TileEntity getTileEntityFromSide(int side){ - if(side == 0) return worldObj.getTileEntity(xCoord, yCoord+1, zCoord); - if(side == 1) return worldObj.getTileEntity(xCoord, yCoord-1, zCoord); - if(side == 2) return worldObj.getTileEntity(xCoord, yCoord, zCoord-1); - if(side == 3) return worldObj.getTileEntity(xCoord-1, yCoord, zCoord); - if(side == 4) return worldObj.getTileEntity(xCoord, yCoord, zCoord+1); - if(side == 5) return worldObj.getTileEntity(xCoord+1, yCoord, zCoord); + public static TileEntity getTileEntityFromSide(int side, World world, int x, int y, int z){ + if(side == 0) return world.getTileEntity(x, y+1, z); + if(side == 1) return world.getTileEntity(x, y-1, z); + if(side == 2) return world.getTileEntity(x, y, z-1); + if(side == 3) return world.getTileEntity(x-1, y, z); + if(side == 4) return world.getTileEntity(x, y, z+1); + if(side == 5) return world.getTileEntity(x+1, y, z); else return null; } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInventoryBase.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInventoryBase.java index 4614c6f8c..7097320f8 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInventoryBase.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInventoryBase.java @@ -67,6 +67,7 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements @Override public void setInventorySlotContents(int i, ItemStack stack){ this.slots[i] = stack; + this.markDirty(); } @Override @@ -81,16 +82,18 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements @Override public ItemStack decrStackSize(int i, int j){ - if (slots[i] != null) { + if (slots[i] != null){ ItemStack stackAt; - if (slots[i].stackSize <= j) { + if(slots[i].stackSize <= j){ stackAt = slots[i]; slots[i] = null; + this.markDirty(); return stackAt; - } else { + } + else{ stackAt = slots[i].splitStack(j); - if (slots[i].stackSize == 0) - slots[i] = null; + if (slots[i].stackSize == 0) slots[i] = null; + this.markDirty(); return stackAt; } } diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index 9529e45f3..fc171cbe9 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -11,6 +11,8 @@ tile.actuallyadditions.blockGiantChest.name=Giant Chest tile.actuallyadditions.blockGrinder.name=Crusher tile.actuallyadditions.blockGrinderDouble.name=Double Crusher tile.actuallyadditions.blockFurnaceDouble.name=Double Furnace +tile.actuallyadditions.blockFishingNet.name=Fishing Net +tile.actuallyadditions.blockFurnaceSolar.name=Solar Panel tile.actuallyadditions.blockInputter.name=ESD tile.actuallyadditions.blockInputter.add.0.name=Ellpeck's Slot Device @@ -109,6 +111,8 @@ tooltip.actuallyadditions.blockInputter.desc.2=Acts like a more advanced Hopper tooltip.actuallyadditions.blockInputter.desc.3=Configurable: tooltip.actuallyadditions.blockInputter.desc.4=-Side to Output to and Input from tooltip.actuallyadditions.blockInputter.desc.5=-Slot in the other Inventory to Output to and Input from +tooltip.actuallyadditions.blockFishingNet.desc=Catches Fish automatically when placed above Water +tooltip.actuallyadditions.blockFurnaceSolar.desc=Powers Furnaces and Crushers below it in Daylight tooltip.actuallyadditions.itemMiscMashedFood.desc=Used to make Fertilizer tooltip.actuallyadditions.itemFertilizer.desc=Om nom nom. Don't eat it. Made in a Compost.