diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java index 3df0cc7b9..bbd2131d6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java @@ -18,6 +18,7 @@ import de.ellpeck.actuallyadditions.mod.crafting.CrusherCrafting; import de.ellpeck.actuallyadditions.mod.crafting.InitCrafting; import de.ellpeck.actuallyadditions.mod.crafting.ItemCrafting; import de.ellpeck.actuallyadditions.mod.event.InitEvents; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.gen.InitVillager; import de.ellpeck.actuallyadditions.mod.gen.OreGen; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; @@ -68,6 +69,7 @@ public class ActuallyAdditions{ InitToolMaterials.init(); InitArmorMaterials.init(); InitBlocks.init(); + InitFluids.init(); InitItems.init(); FuelHandler.init(); UpdateChecker.init(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java index 27d9dacd5..4b4d7e727 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java @@ -10,19 +10,13 @@ package de.ellpeck.actuallyadditions.mod.blocks; -import de.ellpeck.actuallyadditions.mod.blocks.base.BlockFluidFlowing; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockPlant; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockStair; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockWallAA; import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks; -import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.util.CompatUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.item.EnumRarity; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; public class InitBlocks{ @@ -52,11 +46,6 @@ public class InitBlocks{ public static Block blockFlax; public static Block blockCoffee; - public static Fluid fluidCanolaOil; - public static Block blockCanolaOil; - public static Fluid fluidOil; - public static Block blockOil; - public static Block blockCanolaPress; public static Block blockFermentingBarrel; @@ -199,53 +188,5 @@ public class InitBlocks{ blockQuartzSlab = new BlockSlabs("blockQuartzSlab", blockMisc, TheMiscBlocks.QUARTZ.ordinal()); blockChiseledQuartzSlab = new BlockSlabs("blockChiseledQuartzSlab", blockMisc, TheMiscBlocks.QUARTZ_CHISELED.ordinal()); blockPillarQuartzSlab = new BlockSlabs("blockPillarQuartzSlab", blockMisc, TheMiscBlocks.QUARTZ_PILLAR.ordinal()); - - registerFluids(); - } - - public static void registerFluids(){ - //Canola Fluid - String canolaOil = "canolaoil"; - if(!FluidRegistry.isFluidRegistered(canolaOil) || ConfigBoolValues.PREVENT_CANOLA_OVERRIDE.isEnabled()){ - fluidCanolaOil = new FluidAA(canolaOil, "blockCanolaOil").setRarity(EnumRarity.UNCOMMON); - FluidRegistry.registerFluid(fluidCanolaOil); - } - else{ - errorAlreadyRegistered("Canola Oil Fluid"); - } - fluidCanolaOil = FluidRegistry.getFluid(canolaOil); - - //Canola Block - if(fluidCanolaOil.getBlock() == null || ConfigBoolValues.PREVENT_CANOLA_BLOCK_OVERRIDE.isEnabled()){ - blockCanolaOil = new BlockFluidFlowing(fluidCanolaOil, Material.water, "blockCanolaOil"); - } - else{ - errorAlreadyRegistered("Canola Oil Block"); - } - blockCanolaOil = fluidCanolaOil.getBlock(); - - //Oil Fluid - String oil = "oil"; - if(!FluidRegistry.isFluidRegistered(oil) || ConfigBoolValues.PREVENT_OIL_OVERRIDE.isEnabled()){ - fluidOil = new FluidAA(oil, "blockOil").setRarity(EnumRarity.UNCOMMON); - FluidRegistry.registerFluid(fluidOil); - } - else{ - errorAlreadyRegistered("Oil Fluid"); - } - fluidOil = FluidRegistry.getFluid(oil); - - //Oil Block - if(fluidOil.getBlock() == null || ConfigBoolValues.PREVENT_OIL_BLOCK_OVERRIDE.isEnabled()){ - blockOil = new BlockFluidFlowing(fluidOil, Material.water, "blockOil"); - } - else{ - errorAlreadyRegistered("Oil Block"); - } - blockOil = fluidOil.getBlock(); - } - - public static void errorAlreadyRegistered(String str){ - ModUtil.LOGGER.warn(str+" from "+ModUtil.NAME+" is not getting used as it has already been registered by another Mod! If this causes Issues (which it shouldn't!), you can turn this off in the Config File!"); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/BucketFillEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/BucketFillEvent.java index 5d6bb78ae..f86ab2dfe 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/BucketFillEvent.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/BucketFillEvent.java @@ -11,7 +11,7 @@ package de.ellpeck.actuallyadditions.mod.event; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.util.PosUtil; import net.minecraft.block.Block; @@ -25,8 +25,8 @@ public class BucketFillEvent{ @SubscribeEvent public void onBucketFilled(FillBucketEvent event){ - this.fillBucket(event, InitItems.itemBucketOil, InitBlocks.blockOil); - this.fillBucket(event, InitItems.itemBucketCanolaOil, InitBlocks.blockCanolaOil); + this.fillBucket(event, InitItems.itemBucketOil, InitFluids.blockOil); + this.fillBucket(event, InitItems.itemBucketCanolaOil, InitFluids.blockCanolaOil); } private void fillBucket(FillBucketEvent event, Item item, Block fluid){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/FluidAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/FluidAA.java similarity index 94% rename from src/main/java/de/ellpeck/actuallyadditions/mod/blocks/FluidAA.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/fluids/FluidAA.java index e38856c67..c71e0a1a6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/FluidAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/FluidAA.java @@ -8,7 +8,7 @@ * © 2016 Ellpeck */ -package de.ellpeck.actuallyadditions.mod.blocks; +package de.ellpeck.actuallyadditions.mod.fluids; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import net.minecraft.util.ResourceLocation; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java new file mode 100644 index 000000000..0bab1171f --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java @@ -0,0 +1,75 @@ +/* + * This file ("InitFluids.java") is part of the Actually Additions Mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense/ + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.fluids; + +import de.ellpeck.actuallyadditions.mod.blocks.base.BlockFluidFlowing; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; +import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.item.EnumRarity; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; + +public class InitFluids{ + + public static Fluid fluidCanolaOil; + public static Fluid fluidOil; + + public static Block blockCanolaOil; + public static Block blockOil; + + public static void init(){ + //Canola Fluid + String canolaOil = "canolaoil"; + if(!FluidRegistry.isFluidRegistered(canolaOil) || ConfigBoolValues.PREVENT_CANOLA_OVERRIDE.isEnabled()){ + fluidCanolaOil = new FluidAA(canolaOil, "blockCanolaOil").setRarity(EnumRarity.UNCOMMON); + FluidRegistry.registerFluid(fluidCanolaOil); + } + else{ + errorAlreadyRegistered("Canola Oil Fluid"); + } + fluidCanolaOil = FluidRegistry.getFluid(canolaOil); + + //Canola Block + if(fluidCanolaOil.getBlock() == null || ConfigBoolValues.PREVENT_CANOLA_BLOCK_OVERRIDE.isEnabled()){ + blockCanolaOil = new BlockFluidFlowing(fluidCanolaOil, Material.water, "blockCanolaOil"); + } + else{ + errorAlreadyRegistered("Canola Oil Block"); + } + blockCanolaOil = fluidCanolaOil.getBlock(); + + //Oil Fluid + String oil = "oil"; + if(!FluidRegistry.isFluidRegistered(oil) || ConfigBoolValues.PREVENT_OIL_OVERRIDE.isEnabled()){ + fluidOil = new FluidAA(oil, "blockOil").setRarity(EnumRarity.UNCOMMON); + FluidRegistry.registerFluid(fluidOil); + } + else{ + errorAlreadyRegistered("Oil Fluid"); + } + fluidOil = FluidRegistry.getFluid(oil); + + //Oil Block + if(fluidOil.getBlock() == null || ConfigBoolValues.PREVENT_OIL_BLOCK_OVERRIDE.isEnabled()){ + blockOil = new BlockFluidFlowing(fluidOil, Material.water, "blockOil"); + } + else{ + errorAlreadyRegistered("Oil Block"); + } + blockOil = fluidOil.getBlock(); + } + + public static void errorAlreadyRegistered(String str){ + ModUtil.LOGGER.warn(str+" from "+ModUtil.NAME+" is not getting used as it has already been registered by another Mod! If this causes Issues (which it shouldn't!), you can turn this off in the Config File!"); + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java index 741f35f77..dc636f81f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.inventory; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; @@ -68,7 +68,7 @@ public class ContainerCanolaPress extends Container{ return null; } } - else if(FluidContainerRegistry.getContainerCapacity(new FluidStack(InitBlocks.fluidCanolaOil, 1), newStack) > 0){ + else if(FluidContainerRegistry.getContainerCapacity(new FluidStack(InitFluids.fluidCanolaOil, 1), newStack) > 0){ if(!this.mergeItemStack(newStack, 1, 2, false)){ return null; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java index 02cd7b5c0..6a23ad5df 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.inventory; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFermentingBarrel; @@ -62,12 +62,12 @@ public class ContainerFermentingBarrel extends Container{ //Other Slots in Inventory excluded if(slot >= inventoryStart){ //Shift from Inventory - if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(InitBlocks.fluidCanolaOil, 1))){ + if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(InitFluids.fluidCanolaOil, 1))){ if(!this.mergeItemStack(newStack, 0, 1, false)){ return null; } } - else if(FluidContainerRegistry.getContainerCapacity(new FluidStack(InitBlocks.fluidOil, 1), newStack) > 0){ + else if(FluidContainerRegistry.getContainerCapacity(new FluidStack(InitFluids.fluidOil, 1), newStack) > 0){ if(!this.mergeItemStack(newStack, 2, 3, false)){ return null; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java index 657eafe44..a41d04864 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.inventory; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator; @@ -60,7 +60,7 @@ public class ContainerOilGenerator extends Container{ //Other Slots in Inventory excluded if(slot >= inventoryStart){ //Shift from Inventory - if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(InitBlocks.fluidOil, 1))){ + if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(InitFluids.fluidOil, 1))){ if(!this.mergeItemStack(newStack, 0, 1, false)){ return null; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java index 3cd12087b..94b8deb70 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java @@ -11,6 +11,7 @@ package de.ellpeck.actuallyadditions.mod.items; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.items.base.*; import de.ellpeck.actuallyadditions.mod.items.lens.ItemLens; import de.ellpeck.actuallyadditions.mod.items.lens.Lenses; @@ -248,10 +249,10 @@ public class InitItems{ itemDrillUpgradeThreeByThree = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.THREE_BY_THREE, "itemDrillUpgradeThreeByThree"); itemDrillUpgradeFiveByFive = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE, "itemDrillUpgradeFiveByFive"); itemDrillUpgradeBlockPlacing = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.PLACER, "itemDrillUpgradeBlockPlacing"); - itemBucketOil = new ItemBucketAA(InitBlocks.blockOil, "itemBucketOil"); - FluidContainerRegistry.registerFluidContainer(InitBlocks.fluidOil, new ItemStack(itemBucketOil), FluidContainerRegistry.EMPTY_BUCKET); - itemBucketCanolaOil = new ItemBucketAA(InitBlocks.blockCanolaOil, "itemBucketCanolaOil"); - FluidContainerRegistry.registerFluidContainer(InitBlocks.fluidCanolaOil, new ItemStack(itemBucketCanolaOil), FluidContainerRegistry.EMPTY_BUCKET); + itemBucketOil = new ItemBucketAA(InitFluids.blockOil, "itemBucketOil"); + FluidContainerRegistry.registerFluidContainer(InitFluids.fluidOil, new ItemStack(itemBucketOil), FluidContainerRegistry.EMPTY_BUCKET); + itemBucketCanolaOil = new ItemBucketAA(InitFluids.blockCanolaOil, "itemBucketCanolaOil"); + FluidContainerRegistry.registerFluidContainer(InitFluids.fluidCanolaOil, new ItemStack(itemBucketCanolaOil), FluidContainerRegistry.EMPTY_BUCKET); itemFertilizer = new ItemFertilizer("itemFertilizer"); itemCoffee = new ItemCoffee("itemCoffee"); itemPhantomConnector = new ItemPhantomConnector("itemPhantomConnector"); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java index a8ece55bb..86bb4a359 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java @@ -15,9 +15,9 @@ import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.booklet.BookletPage; import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter; import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.event.InitEvents; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.misc.special.SpecialRenderInit; import de.ellpeck.actuallyadditions.mod.util.FluidStateMapper; import de.ellpeck.actuallyadditions.mod.util.ModUtil; @@ -75,8 +75,8 @@ public class ClientProxy implements IProxy{ for(Map.Entry entry : modelVariantsForRegistering.entrySet()){ ModelBakery.registerItemVariants(entry.getKey(), entry.getValue()); } - this.registerCustomFluidBlockRenderer(InitBlocks.fluidCanolaOil); - this.registerCustomFluidBlockRenderer(InitBlocks.fluidOil); + this.registerCustomFluidBlockRenderer(InitFluids.fluidCanolaOil); + this.registerCustomFluidBlockRenderer(InitFluids.fluidOil); IResourceManager manager = Minecraft.getMinecraft().getResourceManager(); if(manager instanceof IReloadableResourceManager){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java index e41b76028..b7d038f50 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java @@ -12,7 +12,7 @@ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyReceiver; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; @@ -72,7 +72,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE this.slots[0] = null; } - this.tank.fill(new FluidStack(InitBlocks.fluidCanolaOil, PRODUCE), true); + this.tank.fill(new FluidStack(InitFluids.fluidCanolaOil, PRODUCE), true); this.markDirty(); } } @@ -133,7 +133,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ - return slot == 2 && FluidContainerRegistry.containsFluid(this.slots[0], new FluidStack(InitBlocks.fluidCanolaOil, FluidContainerRegistry.BUCKET_VOLUME)); + return slot == 2 && FluidContainerRegistry.containsFluid(this.slots[0], new FluidStack(InitFluids.fluidCanolaOil, FluidContainerRegistry.BUCKET_VOLUME)); } @Override @@ -163,7 +163,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE @Override public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain){ - if(resource.getFluid() == InitBlocks.fluidCanolaOil){ + if(resource.getFluid() == InitFluids.fluidCanolaOil){ return this.tank.drain(resource.amount, doDrain); } return null; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java index 3d221ae4b..9a4a2f8e4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.tile; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -45,7 +45,7 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen if(this.currentProcessTime >= PROCESS_TIME){ this.currentProcessTime = 0; - this.oilTank.fill(new FluidStack(InitBlocks.fluidOil, produce), true); + this.oilTank.fill(new FluidStack(InitFluids.fluidOil, produce), true); this.canolaTank.drain(produce, true); this.markDirty(); } @@ -54,7 +54,7 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen this.currentProcessTime = 0; } - WorldUtil.emptyBucket(canolaTank, slots, 0, 1, InitBlocks.fluidCanolaOil); + WorldUtil.emptyBucket(canolaTank, slots, 0, 1, InitFluids.fluidCanolaOil); WorldUtil.fillBucket(oilTank, slots, 2, 3); if(this.oilTank.getFluidAmount() > 0){ @@ -115,17 +115,17 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen @Override public boolean isItemValidForSlot(int i, ItemStack stack){ - return (i == 0 && FluidContainerRegistry.containsFluid(stack, new FluidStack(InitBlocks.fluidCanolaOil, FluidContainerRegistry.BUCKET_VOLUME))) || (i == 2 && stack.getItem() == Items.bucket); + return (i == 0 && FluidContainerRegistry.containsFluid(stack, new FluidStack(InitFluids.fluidCanolaOil, FluidContainerRegistry.BUCKET_VOLUME))) || (i == 2 && stack.getItem() == Items.bucket); } @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ - return (slot == 1 && stack.getItem() == Items.bucket) || (slot == 3 && FluidContainerRegistry.containsFluid(stack, new FluidStack(InitBlocks.fluidOil, FluidContainerRegistry.BUCKET_VOLUME))); + return (slot == 1 && stack.getItem() == Items.bucket) || (slot == 3 && FluidContainerRegistry.containsFluid(stack, new FluidStack(InitFluids.fluidOil, FluidContainerRegistry.BUCKET_VOLUME))); } @Override public int fill(EnumFacing from, FluidStack resource, boolean doFill){ - if(from != EnumFacing.DOWN && resource.getFluid() == InitBlocks.fluidCanolaOil){ + if(from != EnumFacing.DOWN && resource.getFluid() == InitFluids.fluidCanolaOil){ return this.canolaTank.fill(resource, doFill); } return 0; @@ -133,7 +133,7 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen @Override public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain){ - if(resource.getFluid() == InitBlocks.fluidOil){ + if(resource.getFluid() == InitFluids.fluidOil){ return this.oilTank.drain(resource.amount, doDrain); } return null; @@ -146,12 +146,12 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen @Override public boolean canFill(EnumFacing from, Fluid fluid){ - return from != EnumFacing.DOWN && fluid == InitBlocks.fluidCanolaOil; + return from != EnumFacing.DOWN && fluid == InitFluids.fluidCanolaOil; } @Override public boolean canDrain(EnumFacing from, Fluid fluid){ - return from != EnumFacing.UP && fluid == InitBlocks.fluidOil; + return from != EnumFacing.UP && fluid == InitFluids.fluidOil; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java index bb2eb5f00..3434e2ec8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java @@ -12,7 +12,7 @@ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyProvider; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.item.ItemStack; @@ -72,7 +72,7 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I } } - WorldUtil.emptyBucket(tank, slots, 0, 1, InitBlocks.fluidOil); + WorldUtil.emptyBucket(tank, slots, 0, 1, InitFluids.fluidOil); if(this.storage.getEnergyStored() > 0){ WorldUtil.pushEnergyToAllSides(worldObj, this.pos, this.storage); @@ -122,7 +122,7 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I @Override public boolean isItemValidForSlot(int i, ItemStack stack){ - return FluidContainerRegistry.containsFluid(stack, new FluidStack(InitBlocks.fluidOil, FluidContainerRegistry.BUCKET_VOLUME)) && i == 0; + return FluidContainerRegistry.containsFluid(stack, new FluidStack(InitFluids.fluidOil, FluidContainerRegistry.BUCKET_VOLUME)) && i == 0; } @Override @@ -152,7 +152,7 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I @Override public int fill(EnumFacing from, FluidStack resource, boolean doFill){ - if(resource.getFluid() == InitBlocks.fluidOil){ + if(resource.getFluid() == InitFluids.fluidOil){ return this.tank.fill(resource, doFill); } return 0; @@ -170,7 +170,7 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I @Override public boolean canFill(EnumFacing from, Fluid fluid){ - return from != EnumFacing.DOWN && fluid == InitBlocks.fluidOil; + return from != EnumFacing.DOWN && fluid == InitFluids.fluidOil; } @Override