From aecea40bb98b9375ebf157a4c675af09b4b73991 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 6 Jun 2015 01:25:53 +0200 Subject: [PATCH] -Added Lava Factory --- .../ellpeck/actuallyadditions/PLANNED.txt | 14 +-- .../blocks/BlockLavaFactoryController.java | 118 ++++++++++++++++++ .../blocks/BlockPhantomface.java | 16 ++- .../actuallyadditions/blocks/BlockPlant.java | 16 ++- .../actuallyadditions/blocks/InitBlocks.java | 21 +++- .../blocks/metalists/TheMiscBlocks.java | 3 +- .../config/values/ConfigBoolValues.java | 3 +- .../config/values/ConfigIntValues.java | 10 +- .../creative/CreativeTab.java | 2 + .../event/RenderPlayerEventAA.java | 6 - .../event/WorldDecorationEvent.java | 16 ++- .../ellpeck/actuallyadditions/gen/OreGen.java | 2 +- .../inventory/ContainerFermentingBarrel.java | 4 +- .../inventory/ContainerOilGenerator.java | 4 +- .../inventory/GuiCanolaPress.java | 2 +- .../inventory/GuiFermentingBarrel.java | 2 +- .../actuallyadditions/items/InitItems.java | 7 ++ .../nei/NEIActuallyAdditionsConfig.java | 1 + .../recipe/GrinderRecipeRegistry.java | 4 +- .../recipe/HairyBallHandler.java | 6 +- .../tile/TileEntityBase.java | 1 + .../tile/TileEntityCanolaPress.java | 2 +- .../tile/TileEntityFermentingBarrel.java | 6 +- .../tile/TileEntityFluidCollector.java | 2 +- .../tile/TileEntityGreenhouseGlass.java | 13 +- .../tile/TileEntityLavaFactoryController.java | 102 +++++++++++++++ .../tile/TileEntityOilGenerator.java | 5 +- .../update/UpdateChecker.java | 2 +- .../actuallyadditions/util/ModUtil.java | 2 +- .../ellpeck/actuallyadditions/util/Util.java | 2 +- .../actuallyadditions/util/WorldUtil.java | 2 +- .../assets/actuallyadditions/lang/en_US.lang | 15 ++- .../blocks/blockLavaFactoryController.png | Bin 0 -> 773 bytes .../blocks/blockLavaFactoryControllerTop.png | Bin 0 -> 780 bytes .../blocks/blockMiscLavaFactoryCase.png | Bin 0 -> 773 bytes .../blocks/models/special/modelLordi.png | Bin 610 -> 0 bytes 36 files changed, 340 insertions(+), 71 deletions(-) create mode 100644 src/main/java/ellpeck/actuallyadditions/blocks/BlockLavaFactoryController.java create mode 100644 src/main/java/ellpeck/actuallyadditions/tile/TileEntityLavaFactoryController.java create mode 100644 src/main/resources/assets/actuallyadditions/textures/blocks/blockLavaFactoryController.png create mode 100644 src/main/resources/assets/actuallyadditions/textures/blocks/blockLavaFactoryControllerTop.png create mode 100644 src/main/resources/assets/actuallyadditions/textures/blocks/blockMiscLavaFactoryCase.png delete mode 100644 src/main/resources/assets/actuallyadditions/textures/blocks/models/special/modelLordi.png diff --git a/src/main/java/ellpeck/actuallyadditions/PLANNED.txt b/src/main/java/ellpeck/actuallyadditions/PLANNED.txt index a1a0366ed..2557bf0da 100644 --- a/src/main/java/ellpeck/actuallyadditions/PLANNED.txt +++ b/src/main/java/ellpeck/actuallyadditions/PLANNED.txt @@ -69,13 +69,6 @@ -You can mark an area -On Activation, all blocks in the area get a Signal --Lava Factory - -Bowl-Looking Multi Block - -Requires Energy - -Produces Lava - -Has a Controller in the Middle - -Places produced Lava Blocks on top of the Controller - -Thermopile -Needs a hot and a cold fluid -Depending on the fluids, it generates more power @@ -88,4 +81,9 @@ -Ring of Aquadive: Fast underwater movement -Ring of Suction: Sucks up Items in the area -Ring of Water Absorption: Removes Water around - -Ring of Striptease (Or something like that): Attacker lose parts of their Armor \ No newline at end of file + -Ring of Striptease (Or something like that): Attacker lose parts of their Armor + +-Coffee + -Coffee Machine + -Coffee Cup + -Bedrockium Coffee Cup diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockLavaFactoryController.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockLavaFactoryController.java new file mode 100644 index 000000000..782eb30f2 --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockLavaFactoryController.java @@ -0,0 +1,118 @@ +package ellpeck.actuallyadditions.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ellpeck.actuallyadditions.tile.TileEntityLavaFactoryController; +import ellpeck.actuallyadditions.util.BlockUtil; +import ellpeck.actuallyadditions.util.INameableItem; +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.item.EnumRarity; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +import java.util.List; + +public class BlockLavaFactoryController extends BlockContainerBase implements INameableItem{ + + private IIcon topIcon; + + public BlockLavaFactoryController(){ + super(Material.rock); + this.setHarvestLevel("pickaxe", 0); + this.setHardness(1.0F); + this.setStepSound(soundTypeStone); + } + + @Override + public String getOredictName(){ + return this.getName(); + } + + @Override + public TileEntity createNewTileEntity(World world, int par2){ + return new TileEntityLavaFactoryController(); + } + + @Override + public IIcon getIcon(int side, int meta){ + return side == 1 ? this.topIcon : this.blockIcon; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconReg){ + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ + if(!world.isRemote){ + TileEntityLavaFactoryController factory = (TileEntityLavaFactoryController)world.getTileEntity(x, y, z); + if(factory != null){ + int state = factory.isMultiblock(); + if(state == TileEntityLavaFactoryController.NOT_MULTI){ + player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".factory.notPart.desc"))); + } + if(state == TileEntityLavaFactoryController.HAS_AIR || state == TileEntityLavaFactoryController.HAS_LAVA){ + player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".factory.works.desc"))); + } + player.addChatComponentMessage(new ChatComponentText(factory.storage.getEnergyStored() + "/" + factory.storage.getMaxEnergyStored() + " RF")); + } + return true; + } + return true; + } + + @Override + public String getName(){ + return "blockLavaFactoryController"; + } + + 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) { + BlockUtil.addInformation(theBlock, list, 3, ""); + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".uses.desc") + " " + TileEntityLavaFactoryController.energyNeededToProduceLava + " RF/B"); + } + } + + @Override + public int getMetadata(int damage){ + return damage; + } + } +} diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockPhantomface.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockPhantomface.java index c07966ee2..85407eaec 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockPhantomface.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockPhantomface.java @@ -3,6 +3,7 @@ package ellpeck.actuallyadditions.blocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.ActuallyAdditions; +import ellpeck.actuallyadditions.config.values.ConfigIntValues; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.tile.TileEntityPhantomPlacer; import ellpeck.actuallyadditions.tile.TileEntityPhantomface; @@ -31,6 +32,7 @@ public class BlockPhantomface extends BlockContainerBase implements INameableIte public static final int ENERGYFACE = 4; public int type; + public int range; public BlockPhantomface(int type){ super(Material.rock); @@ -38,6 +40,9 @@ public class BlockPhantomface extends BlockContainerBase implements INameableIte this.setHarvestLevel("pickaxe", 0); this.setHardness(1.0F); this.setStepSound(soundTypeStone); + + if(type == FACE || type == LIQUIFACE || type == ENERGYFACE) this.range = ConfigIntValues.PHANTOMFACE_RANGE.getValue(); + else if(type == BREAKER || type == PLACER) this.range = ConfigIntValues.PHANTOM_PLACER_RANGE.getValue(); } @Override @@ -150,10 +155,13 @@ public class BlockPhantomface extends BlockContainerBase implements INameableIte @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { BlockUtil.addInformation(theBlock, list, 2, ""); - if(KeyUtil.isShiftPressed() && ((BlockPhantomface)this.theBlock).type == LIQUIFACE){ - list.add(StringUtil.ORANGE+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomLiquiface.desc.3")); - list.add(StringUtil.ORANGE+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomLiquiface.desc.4")); - list.add(StringUtil.ORANGE+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomLiquiface.desc.5")); + if(KeyUtil.isShiftPressed()){ + if(((BlockPhantomface)this.theBlock).type == LIQUIFACE){ + list.add(StringUtil.ORANGE+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomLiquiface.desc.3")); + list.add(StringUtil.ORANGE+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomLiquiface.desc.4")); + list.add(StringUtil.ORANGE+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomLiquiface.desc.5")); + } + list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomRange.desc") + ": " + ((BlockPhantomface)theBlock).range); } } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockPlant.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockPlant.java index 0dc51ac07..f9298b9ac 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockPlant.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockPlant.java @@ -32,10 +32,14 @@ public class BlockPlant extends BlockCrops implements INameableItem, IFactoryHar private String name; public Item seedItem; public ItemStack returnItem; + private int minDropAmount; + private int addDropAmount; - public BlockPlant(String name, int stages){ + public BlockPlant(String name, int stages, int minDropAmount, int addDropAmount){ this.name = name; this.textures = new IIcon[stages]; + this.minDropAmount = minDropAmount; + this.addDropAmount = addDropAmount; } @Override @@ -48,12 +52,14 @@ public class BlockPlant extends BlockCrops implements INameableItem, IFactoryHar ArrayList ret = super.getDrops(world, x, y, z, metadata, fortune); if(metadata >= 7){ for(int i = 0; i < 3; ++i){ - if(world.rand.nextInt(15) <= metadata) ret.add(new ItemStack(this.seedItem)); + if(world.rand.nextInt(6) == 0) ret.add(new ItemStack(this.seedItem)); } - if(this == InitBlocks.blockCanola) ret.add(new ItemStack(this.returnItem.getItem(), new Random().nextInt(3)+3, this.returnItem.getItemDamage())); - else ret.add(this.returnItem.copy()); + + ItemStack stack = this.returnItem.copy(); + stack.stackSize = new Random().nextInt(addDropAmount)+minDropAmount; + ret.add(stack); } - else ret.add(new ItemStack(this.seedItem)); + else ret.add(new ItemStack(this.seedItem)); return ret; } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java b/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java index 8333e9419..599857a19 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java @@ -33,6 +33,7 @@ public class InitBlocks{ public static Block blockRice; public static Block blockCanola; + public static Block blockFlax; public static Fluid fluidCanolaOil; public static Block blockCanolaOil; @@ -54,16 +55,25 @@ public class InitBlocks{ public static Block blockFluidPlacer; public static Block blockFluidCollector; + public static Block blockLavaFactoryController; + public static void init(){ Util.logInfo("Initializing Blocks..."); - fluidCanolaOil = new FluidAA("canolaOil").setDensity(1200).setViscosity(1500).setTemperature(300).setRarity(EnumRarity.uncommon); + blockLavaFactoryController = new BlockLavaFactoryController(); + BlockUtil.register(blockLavaFactoryController, BlockLavaFactoryController.TheItemBlock.class); + + fluidCanolaOil = new FluidAA("canolaoil").setDensity(1200).setViscosity(1500).setTemperature(300).setRarity(EnumRarity.uncommon); FluidRegistry.registerFluid(fluidCanolaOil); + fluidCanolaOil = FluidRegistry.getFluid(fluidCanolaOil.getName()); + blockCanolaOil = new BlockFluidFlowing(fluidCanolaOil, Material.water, "blockCanolaOil"); BlockUtil.register(blockCanolaOil, BlockFluidFlowing.TheItemBlock.class, false); fluidOil = new FluidAA("oil").setDensity(1200).setViscosity(1500).setTemperature(300).setRarity(EnumRarity.uncommon); FluidRegistry.registerFluid(fluidOil); + fluidOil = FluidRegistry.getFluid(fluidOil.getName()); + blockOil = new BlockFluidFlowing(fluidOil, Material.water, "blockOil"); BlockUtil.register(blockOil, BlockFluidFlowing.TheItemBlock.class, false); @@ -94,16 +104,21 @@ public class InitBlocks{ blockFermentingBarrel = new BlockFermentingBarrel(); BlockUtil.register(blockFermentingBarrel, BlockFermentingBarrel.TheItemBlock.class); - blockRice = new BlockPlant("blockRice", 6); + blockRice = new BlockPlant("blockRice", 6, 1, 2); BlockUtil.register(blockRice, BlockPlant.TheItemBlock.class, false); FactoryRegistry.sendMessage("registerHarvestable", blockRice); FactoryRegistry.sendMessage("registerFertilizable", blockRice); - blockCanola = new BlockPlant("blockCanola", 4); + blockCanola = new BlockPlant("blockCanola", 4, 3, 3); BlockUtil.register(blockCanola, BlockPlant.TheItemBlock.class, false); FactoryRegistry.sendMessage("registerHarvestable", blockCanola); FactoryRegistry.sendMessage("registerFertilizable", blockCanola); + blockFlax = new BlockPlant("blockFlax", 6, 2, 4); + BlockUtil.register(blockFlax, BlockPlant.TheItemBlock.class); + FactoryRegistry.sendMessage("registerHarvestable", blockFlax); + FactoryRegistry.sendMessage("registerFertilizable", blockFlax); + blockCompost = new BlockCompost(); BlockUtil.register(blockCompost, BlockCompost.TheItemBlock.class); diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/metalists/TheMiscBlocks.java b/src/main/java/ellpeck/actuallyadditions/blocks/metalists/TheMiscBlocks.java index a007cda29..1eb1dfa4d 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/metalists/TheMiscBlocks.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/metalists/TheMiscBlocks.java @@ -12,7 +12,8 @@ public enum TheMiscBlocks implements INameableItem{ WOOD_CASING("WoodCasing", EnumRarity.common, "blockCasingWood"), STONE_CASING("StoneCasing", EnumRarity.uncommon, "blockCasingStone"), CHARCOAL_BLOCK("Charcoal", EnumRarity.common, "blockCharcoal"), - ENDERPEARL_BLOCK("Enderpearl", EnumRarity.rare, "blockEnderpearl"); + ENDERPEARL_BLOCK("Enderpearl", EnumRarity.rare, "blockEnderpearl"), + LAVA_FACTORY_CASE("LavaFactoryCase", EnumRarity.uncommon, "blockLavaFactoryCase"); public final String name; public final String oredictName; diff --git a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigBoolValues.java b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigBoolValues.java index 6c89187ec..0d400efbb 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigBoolValues.java +++ b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigBoolValues.java @@ -26,7 +26,8 @@ public enum ConfigBoolValues{ DO_WAILA_INFO("Waila Display Info", ConfigCategories.OTHER, true, "If the Shift Description should display in Waila too"), DO_RICE_GEN("Rice Gen", ConfigCategories.WORLD_GEN, true, "If Rice should generate in the World"), - DO_CANOLA_GEN("Canola Gen", ConfigCategories.WORLD_GEN, true, "If Canola should generate in the World"); + DO_CANOLA_GEN("Canola Gen", ConfigCategories.WORLD_GEN, true, "If Canola should generate in the World"), + DO_FLAX_GEN("Flax Gen", ConfigCategories.WORLD_GEN, true, "If Flax should generate in the World"); public final String name; public final String category; diff --git a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java index ccbae20e9..fe3b2b4d8 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java +++ b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java @@ -43,7 +43,7 @@ public enum ConfigIntValues{ HEAT_COLLECTOR_BLOCKS("Heat Collector: Blocks Needed", ConfigCategories.MACHINE_VALUES, 4, 1, 5, "How many Blocks are needed for the Heat Collector to power Machines above it"), HEAT_COLLECTOR_LAVA_CHANCE("Heat Collector: Random Chance", ConfigCategories.MACHINE_VALUES, 10000, 10, 100000, "The Chance of the Heat Collector destroying a Lava Block around (Default Value 2000 meaning a 1/2000 Chance!)"), - GLASS_TIME_NEEDED("Greenhouse Glass: Time", ConfigCategories.MACHINE_VALUES, 5000, 10, 1000000, "The Time Needed for the Greenhouse Glass to grow a Plant below it"), + GLASS_TIME_NEEDED("Greenhouse Glass: Time", ConfigCategories.MACHINE_VALUES, 300, 1, 10000, "Time Needed for the Greenhouse Glass to grow a Plant below it"), BREAKER_TIME_NEEDED("Breaker and Placer: Time Needed", ConfigCategories.MACHINE_VALUES, 15, 1, 10000, "The Time Needed for the Breaker and the Placer to place or break a Block"), DROPPER_TIME_NEEDED("Dropper: Time Needed", ConfigCategories.MACHINE_VALUES, 10, 1, 10000, "The Time Needed for the Dropper to drop an Item"), @@ -51,7 +51,8 @@ public enum ConfigIntValues{ CAT_DROP_CHANCE("Cat Drops: Chance", ConfigCategories.OTHER, 5000, 5, 10000000, "The 1 in X chance for a Hairy Ball to Drop from a Cat with X being this value"), RICE_AMOUNT("Rice Amount", ConfigCategories.WORLD_GEN, 15, 1, 100, "The Chance of Rice generating"), - CANOLA_AMOUNT("Canola Amount", ConfigCategories.WORLD_GEN, 2, 1, 50, "The Chance of Canola generating"), + CANOLA_AMOUNT("Canola Amount", ConfigCategories.WORLD_GEN, 10, 1, 50, "The Chance of Canola generating"), + FLAX_AMOUNT("Flax Amount", ConfigCategories.WORLD_GEN, 5, 1, 50, "The Chance of Flax generating"), GRINDER_ENERGY_USED("Energy Use: Crusher", ConfigCategories.MACHINE_VALUES, 40, 1, 500, "The Amount of Energy used by the Crusher per Tick"), GRINDER_DOUBLE_ENERGY_USED("Energy Use: Double Crusher", ConfigCategories.MACHINE_VALUES, 60, 1, 500, "The Amount of Energy used by the Double Crusher per Tick"), @@ -75,7 +76,10 @@ public enum ConfigIntValues{ OIL_GEN_BURN_TIME("Oil Generator: Burn Time", ConfigCategories.MACHINE_VALUES, 100, 1, 1000, "The Amount of Time Fuel keeps burning for"), PHANTOM_PLACER_TIME("Phantom Placer and Breaker: Time Needed", ConfigCategories.MACHINE_VALUES, 30, 1, 500, "The Amount of Time a Phantom Placer/Breaker needs"), - PHANTOM_PLACER_RANGE("Phantom Placer and Breaker: Range", ConfigCategories.MACHINE_VALUES, 3, 1, 100, "The Default Range of the Phantom Placer/Breaker"); + PHANTOM_PLACER_RANGE("Phantom Placer and Breaker: Range", ConfigCategories.MACHINE_VALUES, 3, 1, 100, "The Default Range of the Phantom Placer/Breaker"), + + LAVA_FACTORY_ENERGY_USED("Lava Factory: Energy Used", ConfigCategories.MACHINE_VALUES, 150000, 10, 3000000, "The amount of Energy used by the Lava Factory per Bucket of Lava produced"), + LAVA_FACTORY_TIME("Lava Factory: Production Time", ConfigCategories.MACHINE_VALUES, 200, 5, 10000, "The amount of time it takes for the Lava Factory to produce one Bucket"); public final String name; public final String category; diff --git a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java index c5e17c237..7f7d1b70e 100644 --- a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java +++ b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java @@ -38,6 +38,7 @@ public class CreativeTab extends CreativeTabs{ this.addBlock(InitBlocks.blockGrinder); this.addBlock(InitBlocks.blockGrinderDouble); this.addBlock(InitBlocks.blockFurnaceDouble); + this.addBlock(InitBlocks.blockLavaFactoryController); this.addBlock(InitBlocks.blockFurnaceSolar); this.addBlock(InitBlocks.blockHeatCollector); @@ -64,6 +65,7 @@ public class CreativeTab extends CreativeTabs{ this.addItem(InitItems.itemRiceSeed); this.addItem(InitItems.itemCanolaSeed); + this.addItem(InitItems.itemFlaxSeed); this.addItem(InitItems.itemHairyBall); this.addItem(InitItems.itemMisc); this.addItem(InitItems.itemResonantRice); diff --git a/src/main/java/ellpeck/actuallyadditions/event/RenderPlayerEventAA.java b/src/main/java/ellpeck/actuallyadditions/event/RenderPlayerEventAA.java index 8508dd86b..e5d0b7037 100644 --- a/src/main/java/ellpeck/actuallyadditions/event/RenderPlayerEventAA.java +++ b/src/main/java/ellpeck/actuallyadditions/event/RenderPlayerEventAA.java @@ -15,7 +15,6 @@ public class RenderPlayerEventAA{ private RenderSpecial hoseRender = new RenderSpecial(new ModelTorch()); //private RenderSpecial paktoRender = new RenderSpecial(new ModelStandardBlock("Pakto")); private RenderSpecial glenRender = new RenderSpecial(new ModelStandardBlock("Glenthor")); - private RenderSpecial lordiRender = new RenderSpecial(new ModelStandardBlock("Lordi")); @SubscribeEvent(priority = EventPriority.HIGHEST) public void RenderPlayerEvent(RenderPlayerEvent.Pre event){ @@ -42,11 +41,6 @@ public class RenderPlayerEventAA{ if(event.entityPlayer.getUniqueID().equals(UUID.fromString("cb7b293a-5031-484e-b5be-b4f2f4e92726"))){ hoseRender.render(event.entityPlayer, event.partialRenderTick, 0.5F, 1.3F); } - - //Lordhallo - if(event.entityPlayer.getUniqueID().equals(UUID.fromString("990ecf6d-15dd-442c-b91b-323a6420c78e"))){ - lordiRender.render(event.entityPlayer, event.partialRenderTick, 0.3F, 1F); - } } } } diff --git a/src/main/java/ellpeck/actuallyadditions/event/WorldDecorationEvent.java b/src/main/java/ellpeck/actuallyadditions/event/WorldDecorationEvent.java index 1d36159fc..4c3ff7cda 100644 --- a/src/main/java/ellpeck/actuallyadditions/event/WorldDecorationEvent.java +++ b/src/main/java/ellpeck/actuallyadditions/event/WorldDecorationEvent.java @@ -4,6 +4,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent; import ellpeck.actuallyadditions.blocks.InitBlocks; import ellpeck.actuallyadditions.config.values.ConfigBoolValues; import ellpeck.actuallyadditions.config.values.ConfigIntValues; +import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.world.World; import net.minecraftforge.event.terraingen.DecorateBiomeEvent; @@ -35,15 +36,20 @@ public class WorldDecorationEvent{ } } - if(ConfigBoolValues.DO_CANOLA_GEN.isEnabled()){ - for(int i = 0; i < ConfigIntValues.CANOLA_AMOUNT.getValue(); i++){ - if(new Random().nextInt(50) == 0){ + this.genPlantNormally(InitBlocks.blockCanola, ConfigIntValues.CANOLA_AMOUNT.getValue(), ConfigBoolValues.DO_CANOLA_GEN.isEnabled(), Material.grass, event); + this.genPlantNormally(InitBlocks.blockFlax, ConfigIntValues.FLAX_AMOUNT.getValue(), ConfigBoolValues.DO_FLAX_GEN.isEnabled(), Material.grass, event); + } + + public void genPlantNormally(Block plant, int amount, boolean doIt, Material blockBelow, DecorateBiomeEvent event){ + if(doIt){ + for(int i = 0; i < amount; i++){ + if(new Random().nextInt(100) == 0){ int genX = event.chunkX+event.rand.nextInt(16)+8; int genZ = event.chunkZ+event.rand.nextInt(16)+8; int genY = event.world.getTopSolidOrLiquidBlock(genX, genZ)-1; - if(event.world.getBlock(genX, genY, genZ).getMaterial() == Material.grass){ - event.world.setBlock(genX, genY+1, genZ, InitBlocks.blockCanola, event.rand.nextInt(8), 2); + if(event.world.getBlock(genX, genY, genZ).getMaterial() == blockBelow){ + event.world.setBlock(genX, genY+1, genZ, plant, event.rand.nextInt(8), 2); } } } diff --git a/src/main/java/ellpeck/actuallyadditions/gen/OreGen.java b/src/main/java/ellpeck/actuallyadditions/gen/OreGen.java index 1559282b5..92c700067 100644 --- a/src/main/java/ellpeck/actuallyadditions/gen/OreGen.java +++ b/src/main/java/ellpeck/actuallyadditions/gen/OreGen.java @@ -55,7 +55,7 @@ public class OreGen implements IWorldGenerator{ new WorldGenMinable(block, meta, maxVeinSize, blockIn).generate(world, random, posX, posY, posZ); } } - else ModUtil.AA_LOGGER.log(Level.FATAL, "Couldn't generate '" + block.getUnlocalizedName() + "' into the world because the Min Y coordinate is bigger than the Max! This is definitely a Config Error! Check the Files!"); + else ModUtil.LOGGER.log(Level.FATAL, "Couldn't generate '" + block.getUnlocalizedName() + "' into the world because the Min Y coordinate is bigger than the Max! This is definitely a Config Error! Check the Files!"); } public int getRandom(int base, int extra, Random rand){ diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFermentingBarrel.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFermentingBarrel.java index f1c01935c..24ed5f1dd 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFermentingBarrel.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFermentingBarrel.java @@ -4,7 +4,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.blocks.InitBlocks; import ellpeck.actuallyadditions.inventory.slot.SlotOutput; -import ellpeck.actuallyadditions.items.InitItems; import ellpeck.actuallyadditions.tile.TileEntityBase; import ellpeck.actuallyadditions.tile.TileEntityFermentingBarrel; import invtweaks.api.container.InventoryContainer; @@ -15,6 +14,7 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; @InventoryContainer @@ -95,7 +95,7 @@ public class ContainerFermentingBarrel extends Container{ if(currentStack.getItem() != null){ if(slot <= hotbarEnd && slot >= inventoryStart){ - if(currentStack.getItem() == InitItems.itemBucketCanolaOil){ + if(FluidContainerRegistry.containsFluid(currentStack, new FluidStack(InitBlocks.fluidCanolaOil, FluidContainerRegistry.BUCKET_VOLUME))){ this.mergeItemStack(newStack, 0, 1, false); } if(currentStack.getItem() == Items.bucket){ diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerOilGenerator.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerOilGenerator.java index fbe538a00..b367c9d33 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerOilGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerOilGenerator.java @@ -4,7 +4,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.blocks.InitBlocks; import ellpeck.actuallyadditions.inventory.slot.SlotOutput; -import ellpeck.actuallyadditions.items.InitItems; import ellpeck.actuallyadditions.tile.TileEntityBase; import ellpeck.actuallyadditions.tile.TileEntityOilGenerator; import invtweaks.api.container.InventoryContainer; @@ -15,6 +14,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; @InventoryContainer @@ -93,7 +93,7 @@ public class ContainerOilGenerator extends Container{ if(currentStack.getItem() != null){ if(slot <= hotbarEnd && slot >= inventoryStart){ - if(currentStack.getItem() == InitItems.itemBucketOil){ + if(FluidContainerRegistry.containsFluid(currentStack, new FluidStack(InitBlocks.fluidOil, FluidContainerRegistry.BUCKET_VOLUME))){ this.mergeItemStack(newStack, 0, 1, false); } } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/GuiCanolaPress.java b/src/main/java/ellpeck/actuallyadditions/inventory/GuiCanolaPress.java index 80afcb98a..5134b91a5 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/GuiCanolaPress.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/GuiCanolaPress.java @@ -67,7 +67,7 @@ public class GuiCanolaPress extends GuiContainer{ this.func_146283_a(Collections.singletonList(text1), x, y); } - String text2 = this.press.tank.getFluidAmount() + "/" + this.press.tank.getCapacity() + " mB " +StatCollector.translateToLocal("fluid.canolaOil"); + String text2 = this.press.tank.getFluidAmount() + "/" + this.press.tank.getCapacity() + " mB " +StatCollector.translateToLocal("fluid.canolaoil"); if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text2), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/GuiFermentingBarrel.java b/src/main/java/ellpeck/actuallyadditions/inventory/GuiFermentingBarrel.java index f15245136..919fcb97d 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/GuiFermentingBarrel.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/GuiFermentingBarrel.java @@ -62,7 +62,7 @@ public class GuiFermentingBarrel extends GuiContainer{ public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text1 = this.press.canolaTank.getFluidAmount() + "/" + this.press.canolaTank.getCapacity() + " mB " +StatCollector.translateToLocal("fluid.canolaOil"); + String text1 = this.press.canolaTank.getFluidAmount() + "/" + this.press.canolaTank.getCapacity() + " mB " +StatCollector.translateToLocal("fluid.canolaoil"); if(x >= guiLeft+61 && y >= guiTop+6 && x <= guiLeft+76 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text1), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java index 5c44e0ddd..4b2ea4ce5 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java +++ b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java @@ -46,8 +46,11 @@ public class InitItems{ public static Item itemHoeObsidian; public static Item itemHairyBall; + public static Item itemRiceSeed; public static Item itemCanolaSeed; + public static Item itemFlaxSeed; + public static Item itemResonantRice; public static Item itemBucketOil; public static Item itemBucketCanolaOil; @@ -119,6 +122,10 @@ public class InitItems{ ItemUtil.register(itemCanolaSeed); FactoryRegistry.sendMessage("registerPlantable", itemCanolaSeed); + itemFlaxSeed = new ItemSeed("itemFlaxSeed", InitBlocks.blockFlax, Blocks.grass, EnumPlantType.Plains, new ItemStack(Items.string)); + ItemUtil.register(itemFlaxSeed); + FactoryRegistry.sendMessage("registerPlantable", itemFlaxSeed); + itemPickaxeEmerald = new ItemPickaxeAA(InitItemMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemPickaxeEmerald", EnumRarity.rare); itemAxeEmerald = new ItemAxeAA(InitItemMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemAxeEmerald", EnumRarity.rare); itemShovelEmerald = new ItemShovelAA(InitItemMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemShovelEmerald", EnumRarity.rare); diff --git a/src/main/java/ellpeck/actuallyadditions/nei/NEIActuallyAdditionsConfig.java b/src/main/java/ellpeck/actuallyadditions/nei/NEIActuallyAdditionsConfig.java index b45733aec..6a8ecaa91 100644 --- a/src/main/java/ellpeck/actuallyadditions/nei/NEIActuallyAdditionsConfig.java +++ b/src/main/java/ellpeck/actuallyadditions/nei/NEIActuallyAdditionsConfig.java @@ -32,6 +32,7 @@ public class NEIActuallyAdditionsConfig implements IConfigureNEI{ API.hideItem(new ItemStack(InitBlocks.blockRice)); API.hideItem(new ItemStack(InitBlocks.blockCanola)); + API.hideItem(new ItemStack(InitBlocks.blockFlax)); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/recipe/GrinderRecipeRegistry.java b/src/main/java/ellpeck/actuallyadditions/recipe/GrinderRecipeRegistry.java index ad3741758..a83769942 100644 --- a/src/main/java/ellpeck/actuallyadditions/recipe/GrinderRecipeRegistry.java +++ b/src/main/java/ellpeck/actuallyadditions/recipe/GrinderRecipeRegistry.java @@ -66,13 +66,13 @@ public class GrinderRecipeRegistry{ } else{ if(ConfigBoolValues.DO_CRUSHER_SPAM.isEnabled()) - ModUtil.AA_LOGGER.log(Level.INFO, "Couldn't register Crusher Recipe! An Item with OreDictionary Registry '" + inputWithDustPrefix + "' doesn't exist! It should correspond to '" + inputName + "'! This is not an Error, just a bit sad :("); + ModUtil.LOGGER.log(Level.INFO, "Couldn't register Crusher Recipe! An Item with OreDictionary Registry '" + inputWithDustPrefix + "' doesn't exist! It should correspond to '" + inputName + "'! This is not an Error, just a bit sad :("); } } else{ if(ConfigBoolValues.DO_CRUSHER_SPAM.isEnabled()) - ModUtil.AA_LOGGER.log(Level.WARN, "Couldn't register Crusher Recipe! Didn't find Items registered as '" + inputName + "'! This shouldn't happen as there is something registered as '" + inputName + "' that doesn't exist!"); + ModUtil.LOGGER.log(Level.WARN, "Couldn't register Crusher Recipe! Didn't find Items registered as '" + inputName + "'! This shouldn't happen as there is something registered as '" + inputName + "' that doesn't exist!"); } } } diff --git a/src/main/java/ellpeck/actuallyadditions/recipe/HairyBallHandler.java b/src/main/java/ellpeck/actuallyadditions/recipe/HairyBallHandler.java index 3f6b01e37..f4ddc7716 100644 --- a/src/main/java/ellpeck/actuallyadditions/recipe/HairyBallHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/recipe/HairyBallHandler.java @@ -18,9 +18,9 @@ public class HairyBallHandler{ addReturn(new ItemStack(Items.diamond), 2); addReturn(new ItemStack(Items.name_tag), 1); addReturn(new ItemStack(Items.fish), 80); - addReturn(new ItemStack(Items.fish, 1), 60); - addReturn(new ItemStack(Items.fish, 2), 10); - addReturn(new ItemStack(Items.fish, 3), 40); + addReturn(new ItemStack(Items.fish, 1, 1), 60); + addReturn(new ItemStack(Items.fish, 1, 2), 10); + addReturn(new ItemStack(Items.fish, 1, 3), 40); addReturn(new ItemStack(Items.feather), 60); addReturn(new ItemStack(Items.leather), 30); addReturn(new ItemStack(Items.dye), 70); diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityBase.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityBase.java index 54bf485cb..3fa3d43dc 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityBase.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityBase.java @@ -38,6 +38,7 @@ public class TileEntityBase extends TileEntity{ GameRegistry.registerTileEntity(TileEntityPhantomPlacer.TileEntityPhantomBreaker.class, ModUtil.MOD_ID_LOWER + ":tileEntityPhantomBreaker"); GameRegistry.registerTileEntity(TileEntityFluidCollector.class, ModUtil.MOD_ID_LOWER + ":tileEntityFluidCollector"); GameRegistry.registerTileEntity(TileEntityFluidCollector.TileEntityFluidPlacer.class, ModUtil.MOD_ID_LOWER + ":tileEntityFluidPlacer"); + GameRegistry.registerTileEntity(TileEntityLavaFactoryController.class, ModUtil.MOD_ID_LOWER + ":tileEntityLavaFactoryController"); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCanolaPress.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCanolaPress.java index f2f868780..757fb4e5b 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCanolaPress.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCanolaPress.java @@ -113,7 +113,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE @Override public boolean canExtractItem(int slot, ItemStack stack, int side){ - return slot == 2 && stack.getItem() == InitItems.itemBucketCanolaOil; + return slot == 2 && FluidContainerRegistry.containsFluid(this.slots[0], new FluidStack(InitBlocks.fluidCanolaOil, FluidContainerRegistry.BUCKET_VOLUME)); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFermentingBarrel.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFermentingBarrel.java index 2768d8a72..18d3315ce 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFermentingBarrel.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFermentingBarrel.java @@ -42,7 +42,7 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen } else this.currentProcessTime = 0; - if(this.slots[0] != null && this.slots[0].getItem() == InitItems.itemBucketCanolaOil && (this.slots[1] == null || (this.slots[1].stackSize < this.slots[1].getMaxStackSize()))){ + if(this.slots[0] != null && FluidContainerRegistry.containsFluid(this.slots[0], new FluidStack(InitBlocks.fluidCanolaOil, FluidContainerRegistry.BUCKET_VOLUME)) && (this.slots[1] == null || (this.slots[1].stackSize < this.slots[1].getMaxStackSize()))){ if(FluidContainerRegistry.BUCKET_VOLUME <= this.canolaTank.getCapacity()-this.canolaTank.getFluidAmount()){ if(this.slots[1] == null) this.slots[1] = new ItemStack(Items.bucket); else this.slots[1].stackSize++; @@ -101,7 +101,7 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen @Override public boolean isItemValidForSlot(int i, ItemStack stack){ - return (i == 0 && stack.getItem() == InitItems.itemBucketCanolaOil) || (i == 2 && stack.getItem() == Items.bucket); + return (i == 0 && FluidContainerRegistry.containsFluid(this.slots[0], new FluidStack(InitBlocks.fluidCanolaOil, FluidContainerRegistry.BUCKET_VOLUME))) || (i == 2 && stack.getItem() == Items.bucket); } @Override @@ -111,7 +111,7 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen @Override public boolean canExtractItem(int slot, ItemStack stack, int side){ - return (slot == 1 && stack.getItem() == Items.bucket) || (slot == 3 && stack.getItem() == InitItems.itemBucketOil); + return (slot == 1 && stack.getItem() == Items.bucket) || (slot == 3 && FluidContainerRegistry.containsFluid(this.slots[0], new FluidStack(InitBlocks.fluidOil, FluidContainerRegistry.BUCKET_VOLUME))); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFluidCollector.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFluidCollector.java index b42cf8589..79550c999 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFluidCollector.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFluidCollector.java @@ -159,7 +159,7 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements } if(this.tank.getFluidAmount() > 0 && !this.isPlacer){ - WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.DOWN, this.tank); + WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.getOrientation(worldObj.getBlockMetadata(xCoord, yCoord, zCoord)).getOpposite(), this.tank); } if(amountBefore != this.tank.getFluidAmount()){ diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGreenhouseGlass.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGreenhouseGlass.java index 9b7439bf4..cdd0f7364 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGreenhouseGlass.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGreenhouseGlass.java @@ -1,14 +1,10 @@ package ellpeck.actuallyadditions.tile; import ellpeck.actuallyadditions.config.values.ConfigIntValues; -import ellpeck.actuallyadditions.util.FakePlayerUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockAir; import net.minecraft.block.BlockGrass; import net.minecraft.block.IGrowable; -import net.minecraft.init.Items; -import net.minecraft.item.ItemDye; -import net.minecraft.item.ItemStack; import net.minecraft.util.ChunkCoordinates; import java.util.Random; @@ -25,14 +21,14 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{ if(worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord) && worldObj.isDaytime()){ ChunkCoordinates blockToFert = this.blockToFertilize(); if(blockToFert != null){ - Random rand = new Random(); if(this.timeUntilNextFert > 0){ this.timeUntilNextFert--; if(timeUntilNextFert <= 0){ - this.applyBonemealEffect(blockToFert); + worldObj.getBlock(blockToFert.posX, blockToFert.posY, blockToFert.posZ).updateTick(worldObj, blockToFert.posX, blockToFert.posY, blockToFert.posZ, worldObj.rand); + worldObj.playAuxSFX(2005, blockToFert.posX, blockToFert.posY, blockToFert.posZ, 0); } } - else this.timeUntilNextFert = this.timeUntilNextFertToSet + rand.nextInt(this.timeUntilNextFertToSet/2); + else this.timeUntilNextFert = this.timeUntilNextFertToSet+new Random().nextInt(this.timeUntilNextFertToSet); } } } @@ -51,7 +47,4 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{ return null; } - public boolean applyBonemealEffect(ChunkCoordinates coords){ - return ItemDye.applyBonemeal(new ItemStack(Items.dye, 1, 15), worldObj, coords.posX, coords.posY, coords.posZ, FakePlayerUtil.newFakePlayer(worldObj)); - } } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLavaFactoryController.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLavaFactoryController.java new file mode 100644 index 000000000..22bdcab53 --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLavaFactoryController.java @@ -0,0 +1,102 @@ +package ellpeck.actuallyadditions.tile; + +import cofh.api.energy.EnergyStorage; +import cofh.api.energy.IEnergyReceiver; +import ellpeck.actuallyadditions.blocks.BlockMisc; +import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks; +import ellpeck.actuallyadditions.config.values.ConfigIntValues; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + +public class TileEntityLavaFactoryController extends TileEntityBase implements IEnergyReceiver{ + + public EnergyStorage storage = new EnergyStorage(3000000, energyNeededToProduceLava*2); + + public static int energyNeededToProduceLava = ConfigIntValues.LAVA_FACTORY_ENERGY_USED.getValue(); + + private final int maxWorkTime = ConfigIntValues.LAVA_FACTORY_TIME.getValue(); + private int currentWorkTime; + + @Override + @SuppressWarnings("unchecked") + public void updateEntity(){ + if(!worldObj.isRemote){ + int isMulti = this.isMultiblock(); + + if(isMulti == HAS_AIR && this.storage.getEnergyStored() >= energyNeededToProduceLava){ + this.currentWorkTime++; + if(this.currentWorkTime >= this.maxWorkTime){ + this.currentWorkTime = 0; + worldObj.setBlock(xCoord, yCoord+1, zCoord, Blocks.lava); + this.storage.extractEnergy(energyNeededToProduceLava, false); + } + } + else this.currentWorkTime = 0; + } + } + + public int isMultiblock(){ + Block blockNorth = worldObj.getBlock(xCoord+ForgeDirection.NORTH.offsetX, yCoord+1, zCoord+ForgeDirection.NORTH.offsetZ); + Block blockEast = worldObj.getBlock(xCoord+ForgeDirection.EAST.offsetX, yCoord+1, zCoord+ForgeDirection.EAST.offsetZ); + Block blockSouth = worldObj.getBlock(xCoord+ForgeDirection.SOUTH.offsetX, yCoord+1, zCoord+ForgeDirection.SOUTH.offsetZ); + Block blockWest = worldObj.getBlock(xCoord+ForgeDirection.WEST.offsetX, yCoord+1, zCoord+ForgeDirection.WEST.offsetZ); + int metaNorth = worldObj.getBlockMetadata(xCoord+ForgeDirection.NORTH.offsetX, yCoord+1, zCoord+ForgeDirection.NORTH.offsetZ); + int metaEast = worldObj.getBlockMetadata(xCoord+ForgeDirection.EAST.offsetX, yCoord+1, zCoord+ForgeDirection.EAST.offsetZ); + int metaSouth = worldObj.getBlockMetadata(xCoord+ForgeDirection.SOUTH.offsetX, yCoord+1, zCoord+ForgeDirection.SOUTH.offsetZ); + int metaWest = worldObj.getBlockMetadata(xCoord+ForgeDirection.WEST.offsetX, yCoord+1, zCoord+ForgeDirection.WEST.offsetZ); + int metaNeeded = TheMiscBlocks.LAVA_FACTORY_CASE.ordinal(); + + if(blockNorth instanceof BlockMisc && blockEast instanceof BlockMisc && blockSouth instanceof BlockMisc && blockWest instanceof BlockMisc){ + if(metaNorth == metaNeeded && metaEast == metaNeeded && metaSouth == metaNeeded && metaWest == metaNeeded){ + if(worldObj.getBlock(xCoord, yCoord+1, zCoord) == Blocks.lava || worldObj.getBlock(xCoord, yCoord+1, zCoord) == Blocks.flowing_lava){ + return HAS_LAVA; + } + if(worldObj.getBlock(xCoord, yCoord+1, zCoord) == null || worldObj.getBlock(xCoord, yCoord+1, zCoord) instanceof BlockAir){ + return HAS_AIR; + } + } + } + return NOT_MULTI; + } + + public static final int NOT_MULTI = 0; + public static final int HAS_LAVA = 1; + public static final int HAS_AIR = 2; + + @Override + public void writeToNBT(NBTTagCompound compound){ + this.storage.writeToNBT(compound); + compound.setInteger("WorkTime", this.currentWorkTime); + super.writeToNBT(compound); + } + + @Override + public void readFromNBT(NBTTagCompound compound){ + this.storage.readFromNBT(compound); + this.currentWorkTime = compound.getInteger("WorkTime"); + super.readFromNBT(compound); + } + + @Override + public int receiveEnergy(ForgeDirection from, int maxExtract, boolean simulate){ + return from != ForgeDirection.UP ? this.storage.receiveEnergy(maxExtract, simulate) : 0; + } + + @Override + public int getEnergyStored(ForgeDirection from){ + return from != ForgeDirection.UP ? this.storage.getEnergyStored() : 0; + } + + @Override + public int getMaxEnergyStored(ForgeDirection from){ + return from != ForgeDirection.UP ? this.storage.getMaxEnergyStored() : 0; + } + + @Override + public boolean canConnectEnergy(ForgeDirection from){ + return from != ForgeDirection.UP; + } +} diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityOilGenerator.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityOilGenerator.java index d536e2c7e..e69445a7a 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityOilGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityOilGenerator.java @@ -6,7 +6,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.blocks.InitBlocks; import ellpeck.actuallyadditions.config.values.ConfigIntValues; -import ellpeck.actuallyadditions.items.InitItems; import ellpeck.actuallyadditions.util.WorldUtil; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -48,7 +47,7 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I } } - if(this.slots[0] != null && this.slots[0].getItem() == InitItems.itemBucketOil && (this.slots[1] == null || (this.slots[1].stackSize < this.slots[1].getMaxStackSize()))){ + if(this.slots[0] != null && FluidContainerRegistry.containsFluid(this.slots[0], new FluidStack(InitBlocks.fluidOil, FluidContainerRegistry.BUCKET_VOLUME)) && (this.slots[1] == null || (this.slots[1].stackSize < this.slots[1].getMaxStackSize()))){ if(FluidContainerRegistry.BUCKET_VOLUME <= this.tank.getCapacity()-this.tank.getFluidAmount()){ if(this.slots[1] == null) this.slots[1] = new ItemStack(Items.bucket); else this.slots[1].stackSize++; @@ -103,7 +102,7 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I @Override public boolean isItemValidForSlot(int i, ItemStack stack){ - return stack.getItem() == InitItems.itemBucketOil && i == 0; + return FluidContainerRegistry.containsFluid(this.slots[0], new FluidStack(InitBlocks.fluidOil, FluidContainerRegistry.BUCKET_VOLUME)) && i == 0; } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/update/UpdateChecker.java b/src/main/java/ellpeck/actuallyadditions/update/UpdateChecker.java index 730717533..d96162836 100644 --- a/src/main/java/ellpeck/actuallyadditions/update/UpdateChecker.java +++ b/src/main/java/ellpeck/actuallyadditions/update/UpdateChecker.java @@ -81,7 +81,7 @@ public class UpdateChecker{ Util.logInfo("Update Check done!"); } catch(Exception e){ - ModUtil.AA_LOGGER.log(Level.ERROR, "Update Check failed!"); + ModUtil.LOGGER.log(Level.ERROR, "Update Check failed!"); checkFailed = true; e.printStackTrace(); } diff --git a/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java b/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java index 73e0741d5..f0580000b 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java @@ -11,6 +11,6 @@ public class ModUtil{ public static final String NAME = "Actually Additions"; public static final String MOD_ID_LOWER = MOD_ID.toLowerCase(); - public static final Logger AA_LOGGER = LogManager.getLogger(MOD_ID); + public static final Logger LOGGER = LogManager.getLogger(MOD_ID); } diff --git a/src/main/java/ellpeck/actuallyadditions/util/Util.java b/src/main/java/ellpeck/actuallyadditions/util/Util.java index 64e5b464a..10afb9096 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/Util.java +++ b/src/main/java/ellpeck/actuallyadditions/util/Util.java @@ -11,7 +11,7 @@ public class Util{ public static final int WILDCARD = OreDictionary.WILDCARD_VALUE; public static void logInfo(String text){ - ModUtil.AA_LOGGER.log(Level.INFO, text); + ModUtil.LOGGER.log(Level.INFO, text); } public static void registerEvent(Object o){ diff --git a/src/main/java/ellpeck/actuallyadditions/util/WorldUtil.java b/src/main/java/ellpeck/actuallyadditions/util/WorldUtil.java index 6352ca447..94485205f 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/WorldUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/WorldUtil.java @@ -85,7 +85,7 @@ public class WorldUtil{ return stack; } catch(Exception e){ - ModUtil.AA_LOGGER.log(Level.ERROR, "Something that places Blocks at "+x+", "+y+", "+z+" in World "+world.provider.dimensionId+" threw an Exception! Don't let that happen again!"); + ModUtil.LOGGER.log(Level.ERROR, "Something that places Blocks at "+x+", "+y+", "+z+" in World "+world.provider.dimensionId+" threw an Exception! Don't let that happen again!"); } } return stack; diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index b4292fae7..62f45993b 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -2,7 +2,7 @@ itemGroup.actuallyadditions=Actually Additions achievement.page.actuallyadditions=Actually Additions fluid.oil=Oil -fluid.canolaOil=Canola Oil +fluid.canolaoil=Canola Oil tile.actuallyadditions.blockCompost.name=Compost tile.actuallyadditions.blockMiscOreBlackQuartz.name=Black Quartz Ore @@ -74,6 +74,14 @@ tile.actuallyadditions.blockPhantomBreaker.name=Phantom Breaker tooltip.actuallyadditions.blockPhantomBreaker.desc.1=Breaks Blocks from a distance! Connect me with a Phantom Connector! tooltip.actuallyadditions.blockPhantomBreaker.desc.2=Sneak-Right-Click with an empty hand to see its Connections! +tile.actuallyadditions.blockLavaFactoryController.name=Lava Factory Controller +tooltip.actuallyadditions.blockLavaFactoryController.desc.1=Place Lava Factory Casings around in the right way to produce Lava: +tooltip.actuallyadditions.blockLavaFactoryController.desc.2=Go one block up above the Controller, that's where Lava is going to land +tooltip.actuallyadditions.blockLavaFactoryController.desc.3=Place 4 Casings around that empty space so that it is encased + +tile.actuallyadditions.blockMiscLavaFactoryCase.name=Lava Factory Casing +tooltip.actuallyadditions.blockMiscLavaFactoryCase.desc=Helps the Lava Factory Controller generate Lava + tile.actuallyadditions.blockFluidPlacer.name=Fluid Placer tooltip.actuallyadditions.blockFluidPlacer.desc=Places Fluids stored inside it @@ -143,6 +151,9 @@ tooltip.actuallyadditions.phantom.connectedBlock.desc=Connected to Block at %s, tooltip.actuallyadditions.phantom.connectedNoRange.desc=Connected to Block at %s, %s, %s but it is not in Range! tooltip.actuallyadditions.phantom.notConnected.desc=This isn't connected to anything! +tooltip.actuallyadditions.factory.notPart.desc=The Controller isn't part of the right Multi-Block! Look at the Controller's Description! +tooltip.actuallyadditions.factory.works.desc=This Lava Factory is complete and can produce Lava! + item.actuallyadditions.itemMiscMashedFood.name=Mashed Food item.actuallyadditions.itemFertilizer.name=Fertilizer item.actuallyadditions.itemMiscDough.name=Dough @@ -242,6 +253,8 @@ tooltip.actuallyadditions.itemUpgradeSpeed.desc.3=-Double Furnace tooltip.actuallyadditions.itemUpgradeSpeed.desc.4=-Crusher tooltip.actuallyadditions.itemUpgradeSpeed.desc.5=-Double Crusher +tooltip.actuallyadditions.blockPhantomRange.desc=Range + tooltip.actuallyadditions.blockCompost.desc=Used to make Fertilizer with Mashed Food tooltip.actuallyadditions.blockMiscOreBlackQuartz.desc=The darkest form of Quartz. tooltip.actuallyadditions.blockMiscBlackQuartz.desc=Black, eerie Quartz! Nice for decorating. diff --git a/src/main/resources/assets/actuallyadditions/textures/blocks/blockLavaFactoryController.png b/src/main/resources/assets/actuallyadditions/textures/blocks/blockLavaFactoryController.png new file mode 100644 index 0000000000000000000000000000000000000000..808eecb19087cc466325ed8383267d7d73263069 GIT binary patch literal 773 zcmV+g1N!`lP)WFU8GbZ8()Nlj2>E@cM*00L=AL_t(I%UzPqZd^qW zMo(4soqKH~B3OW*g0VDX*%K$&EXYG37Cee~tl07}EG#69aD+kxNGu|D5kmaPgPqLZ z?d~cTcQQ!yvKOWAobQt_zxX_^u5akNj)&7Do<9GXaOZR~=DTMouy0h#?Q0A;SyYJNEYWDJ7$taCb_{1W-%C-2tK0iq57-!^KiCGgJ*T#ms1$1_&$}O*2A8 zNKJ#90r2=_g1zCApnBc;ST0vouL$xVjvC0|BLbdWJi;El^X}#EfBZ?f(~J^c0~Nu{SiD}+ z?RDEW1d+i_$(dXVf8Wm0k~4kZ6A|Q19uP`_2->!#@B3Y)Z*VL%)LLlU7QHw-q1H;@ zXG*QqT0o%I3K8U7sQ>dZjBLdD>==9R{lm+bFMmT-2R0uXsO}J8D)c#TS1Lp>3~94r zes@n=tybjP<6f!jHEla$u~^c!Bh1oPu<+{DJqP;-JJC7!bX`aKaCXdkvjGOHUwwUz zi16|G8CTagm>K7@W4`_VIjYKRGUl77ξfPLKE(?x0L+O5KFM00000NkvXXu0mjf D5W!ZJ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/actuallyadditions/textures/blocks/blockLavaFactoryControllerTop.png b/src/main/resources/assets/actuallyadditions/textures/blocks/blockLavaFactoryControllerTop.png new file mode 100644 index 0000000000000000000000000000000000000000..b8719b608de6bcd0b83d299f1bf9590fc3cadc0e GIT binary patch literal 780 zcmV+n1M~ceP)0s$1{9{*fmPg2Wcms2$sM z96M6T9+}*NTe}Sq}NHO zk5>n~19zHaY&N$TBkk>9Y(KtdxPH%M_#24=0x1~+xK~bB2c*yTW5F&^O;f|<~%mC2i z!zJMk64Y=a1XW?yz`TP=1A8rqD4_`?{!5#$Pak6I%PS&ayBV0wrW6k%lz+M}h*aph zmQfNxLeyN)Ea8t&~_bmvO47Q z)oXIjh${2>3{@i`yD9@+*J5Tw>>^j)731Y-zie&8DYo8#EcXg9x{uJ~5lls9vcasb3OqSkakjo7rNqh6KEGaGp{g7%7reN5i3hA6e96D{NnGiFLXHOj0000< KMNUMnLSTa4Urj;) literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/actuallyadditions/textures/blocks/blockMiscLavaFactoryCase.png b/src/main/resources/assets/actuallyadditions/textures/blocks/blockMiscLavaFactoryCase.png new file mode 100644 index 0000000000000000000000000000000000000000..808eecb19087cc466325ed8383267d7d73263069 GIT binary patch literal 773 zcmV+g1N!`lP)WFU8GbZ8()Nlj2>E@cM*00L=AL_t(I%UzPqZd^qW zMo(4soqKH~B3OW*g0VDX*%K$&EXYG37Cee~tl07}EG#69aD+kxNGu|D5kmaPgPqLZ z?d~cTcQQ!yvKOWAobQt_zxX_^u5akNj)&7Do<9GXaOZR~=DTMouy0h#?Q0A;SyYJNEYWDJ7$taCb_{1W-%C-2tK0iq57-!^KiCGgJ*T#ms1$1_&$}O*2A8 zNKJ#90r2=_g1zCApnBc;ST0vouL$xVjvC0|BLbdWJi;El^X}#EfBZ?f(~J^c0~Nu{SiD}+ z?RDEW1d+i_$(dXVf8Wm0k~4kZ6A|Q19uP`_2->!#@B3Y)Z*VL%)LLlU7QHw-q1H;@ zXG*QqT0o%I3K8U7sQ>dZjBLdD>==9R{lm+bFMmT-2R0uXsO}J8D)c#TS1Lp>3~94r zes@n=tybjP<6f!jHEla$u~^c!Bh1oPu<+{DJqP;-JJC7!bX`aKaCXdkvjGOHUwwUz zi16|G8CTagm>K7@W4`_VIjYKRGUl77ξfPLKE(?x0L+O5KFM00000NkvXXu0mjf D5W!ZJ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/actuallyadditions/textures/blocks/models/special/modelLordi.png b/src/main/resources/assets/actuallyadditions/textures/blocks/models/special/modelLordi.png deleted file mode 100644 index e345b3db8319f60e2229227e5118c0000ef5127b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 610 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Ea{HEjtmSN`?>!lvI6;>1s;*b z3=Dh+L6~vJ#O${~L5ULAh?3y^w370~qEv>0#LT=By}Z;C1rt33J=4@yqf`b4#s{7* zjv*CsZ_hhs9dQs~Ir#U#^k4C6ffGxXIEc%$`G_A$eJQee{{DBrKY#uE%%XDPvMYDq z%$18hev;dC>9e%=UtU=G#jVgZHLqUoe!cLMlkdu%H?3`V^-UJf@;ZC=-ph-nbM^!T zXXSnK>tFZyN$aej;?3n%C9>-JSEkIG{r2+Wx|jY_X9WenPWvs_uV=dpC>mvc`+G&n z%Zp2wUAeOB=Dy>Lz5De{moB?@_M5F-Y*oohP1CJ;+unbCacQx)@5+^>n``^sr_04= zdHJrL{kGa>*OwPT!C6^%|K$G4fY<`$dI4P(5Yhv5oF>pDpdH+T*H^`xZ#{qUC8 zg%}RD-@-;yi!R(VX`656n9V+mh5CK{cTF8bk4X2jTWb0(!1Tc2>FVdQ&MBb@08|MS A$N&HU