Move Fluids to InitFluids

This commit is contained in:
Ellpeck 2016-01-29 17:38:31 +01:00
parent 3f958a0726
commit 4630c39a13
13 changed files with 114 additions and 95 deletions

View file

@ -18,6 +18,7 @@ import de.ellpeck.actuallyadditions.mod.crafting.CrusherCrafting;
import de.ellpeck.actuallyadditions.mod.crafting.InitCrafting; import de.ellpeck.actuallyadditions.mod.crafting.InitCrafting;
import de.ellpeck.actuallyadditions.mod.crafting.ItemCrafting; import de.ellpeck.actuallyadditions.mod.crafting.ItemCrafting;
import de.ellpeck.actuallyadditions.mod.event.InitEvents; 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.InitVillager;
import de.ellpeck.actuallyadditions.mod.gen.OreGen; import de.ellpeck.actuallyadditions.mod.gen.OreGen;
import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
@ -68,6 +69,7 @@ public class ActuallyAdditions{
InitToolMaterials.init(); InitToolMaterials.init();
InitArmorMaterials.init(); InitArmorMaterials.init();
InitBlocks.init(); InitBlocks.init();
InitFluids.init();
InitItems.init(); InitItems.init();
FuelHandler.init(); FuelHandler.init();
UpdateChecker.init(); UpdateChecker.init();

View file

@ -10,19 +10,13 @@
package de.ellpeck.actuallyadditions.mod.blocks; 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.BlockPlant;
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockStair; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockStair;
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockWallAA; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockWallAA;
import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks; 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.CompatUtil;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import net.minecraft.block.Block; 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{ public class InitBlocks{
@ -52,11 +46,6 @@ public class InitBlocks{
public static Block blockFlax; public static Block blockFlax;
public static Block blockCoffee; 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 blockCanolaPress;
public static Block blockFermentingBarrel; public static Block blockFermentingBarrel;
@ -199,53 +188,5 @@ public class InitBlocks{
blockQuartzSlab = new BlockSlabs("blockQuartzSlab", blockMisc, TheMiscBlocks.QUARTZ.ordinal()); blockQuartzSlab = new BlockSlabs("blockQuartzSlab", blockMisc, TheMiscBlocks.QUARTZ.ordinal());
blockChiseledQuartzSlab = new BlockSlabs("blockChiseledQuartzSlab", blockMisc, TheMiscBlocks.QUARTZ_CHISELED.ordinal()); blockChiseledQuartzSlab = new BlockSlabs("blockChiseledQuartzSlab", blockMisc, TheMiscBlocks.QUARTZ_CHISELED.ordinal());
blockPillarQuartzSlab = new BlockSlabs("blockPillarQuartzSlab", blockMisc, TheMiscBlocks.QUARTZ_PILLAR.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!");
} }
} }

View file

@ -11,7 +11,7 @@
package de.ellpeck.actuallyadditions.mod.event; 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.items.InitItems;
import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
@ -25,8 +25,8 @@ public class BucketFillEvent{
@SubscribeEvent @SubscribeEvent
public void onBucketFilled(FillBucketEvent event){ public void onBucketFilled(FillBucketEvent event){
this.fillBucket(event, InitItems.itemBucketOil, InitBlocks.blockOil); this.fillBucket(event, InitItems.itemBucketOil, InitFluids.blockOil);
this.fillBucket(event, InitItems.itemBucketCanolaOil, InitBlocks.blockCanolaOil); this.fillBucket(event, InitItems.itemBucketCanolaOil, InitFluids.blockCanolaOil);
} }
private void fillBucket(FillBucketEvent event, Item item, Block fluid){ private void fillBucket(FillBucketEvent event, Item item, Block fluid){

View file

@ -8,7 +8,7 @@
* © 2016 Ellpeck * © 2016 Ellpeck
*/ */
package de.ellpeck.actuallyadditions.mod.blocks; package de.ellpeck.actuallyadditions.mod.fluids;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;

View file

@ -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!");
}
}

View file

@ -10,7 +10,7 @@
package de.ellpeck.actuallyadditions.mod.inventory; 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.inventory.slot.SlotOutput;
import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.InitItems;
import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems;
@ -68,7 +68,7 @@ public class ContainerCanolaPress extends Container{
return null; 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)){ if(!this.mergeItemStack(newStack, 1, 2, false)){
return null; return null;
} }

View file

@ -10,7 +10,7 @@
package de.ellpeck.actuallyadditions.mod.inventory; 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.inventory.slot.SlotOutput;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFermentingBarrel; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFermentingBarrel;
@ -62,12 +62,12 @@ public class ContainerFermentingBarrel extends Container{
//Other Slots in Inventory excluded //Other Slots in Inventory excluded
if(slot >= inventoryStart){ if(slot >= inventoryStart){
//Shift from Inventory //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)){ if(!this.mergeItemStack(newStack, 0, 1, false)){
return null; 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)){ if(!this.mergeItemStack(newStack, 2, 3, false)){
return null; return null;
} }

View file

@ -10,7 +10,7 @@
package de.ellpeck.actuallyadditions.mod.inventory; 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.inventory.slot.SlotOutput;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator; import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator;
@ -60,7 +60,7 @@ public class ContainerOilGenerator extends Container{
//Other Slots in Inventory excluded //Other Slots in Inventory excluded
if(slot >= inventoryStart){ if(slot >= inventoryStart){
//Shift from Inventory //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)){ if(!this.mergeItemStack(newStack, 0, 1, false)){
return null; return null;
} }

View file

@ -11,6 +11,7 @@
package de.ellpeck.actuallyadditions.mod.items; package de.ellpeck.actuallyadditions.mod.items;
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; 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.base.*;
import de.ellpeck.actuallyadditions.mod.items.lens.ItemLens; import de.ellpeck.actuallyadditions.mod.items.lens.ItemLens;
import de.ellpeck.actuallyadditions.mod.items.lens.Lenses; import de.ellpeck.actuallyadditions.mod.items.lens.Lenses;
@ -248,10 +249,10 @@ public class InitItems{
itemDrillUpgradeThreeByThree = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.THREE_BY_THREE, "itemDrillUpgradeThreeByThree"); itemDrillUpgradeThreeByThree = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.THREE_BY_THREE, "itemDrillUpgradeThreeByThree");
itemDrillUpgradeFiveByFive = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE, "itemDrillUpgradeFiveByFive"); itemDrillUpgradeFiveByFive = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE, "itemDrillUpgradeFiveByFive");
itemDrillUpgradeBlockPlacing = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.PLACER, "itemDrillUpgradeBlockPlacing"); itemDrillUpgradeBlockPlacing = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.PLACER, "itemDrillUpgradeBlockPlacing");
itemBucketOil = new ItemBucketAA(InitBlocks.blockOil, "itemBucketOil"); itemBucketOil = new ItemBucketAA(InitFluids.blockOil, "itemBucketOil");
FluidContainerRegistry.registerFluidContainer(InitBlocks.fluidOil, new ItemStack(itemBucketOil), FluidContainerRegistry.EMPTY_BUCKET); FluidContainerRegistry.registerFluidContainer(InitFluids.fluidOil, new ItemStack(itemBucketOil), FluidContainerRegistry.EMPTY_BUCKET);
itemBucketCanolaOil = new ItemBucketAA(InitBlocks.blockCanolaOil, "itemBucketCanolaOil"); itemBucketCanolaOil = new ItemBucketAA(InitFluids.blockCanolaOil, "itemBucketCanolaOil");
FluidContainerRegistry.registerFluidContainer(InitBlocks.fluidCanolaOil, new ItemStack(itemBucketCanolaOil), FluidContainerRegistry.EMPTY_BUCKET); FluidContainerRegistry.registerFluidContainer(InitFluids.fluidCanolaOil, new ItemStack(itemBucketCanolaOil), FluidContainerRegistry.EMPTY_BUCKET);
itemFertilizer = new ItemFertilizer("itemFertilizer"); itemFertilizer = new ItemFertilizer("itemFertilizer");
itemCoffee = new ItemCoffee("itemCoffee"); itemCoffee = new ItemCoffee("itemCoffee");
itemPhantomConnector = new ItemPhantomConnector("itemPhantomConnector"); itemPhantomConnector = new ItemPhantomConnector("itemPhantomConnector");

View file

@ -15,9 +15,9 @@ import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.booklet.BookletPage; import de.ellpeck.actuallyadditions.api.booklet.BookletPage;
import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter; import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter;
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry; 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.config.values.ConfigBoolValues;
import de.ellpeck.actuallyadditions.mod.event.InitEvents; 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.misc.special.SpecialRenderInit;
import de.ellpeck.actuallyadditions.mod.util.FluidStateMapper; import de.ellpeck.actuallyadditions.mod.util.FluidStateMapper;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
@ -75,8 +75,8 @@ public class ClientProxy implements IProxy{
for(Map.Entry<Item, ResourceLocation[]> entry : modelVariantsForRegistering.entrySet()){ for(Map.Entry<Item, ResourceLocation[]> entry : modelVariantsForRegistering.entrySet()){
ModelBakery.registerItemVariants(entry.getKey(), entry.getValue()); ModelBakery.registerItemVariants(entry.getKey(), entry.getValue());
} }
this.registerCustomFluidBlockRenderer(InitBlocks.fluidCanolaOil); this.registerCustomFluidBlockRenderer(InitFluids.fluidCanolaOil);
this.registerCustomFluidBlockRenderer(InitBlocks.fluidOil); this.registerCustomFluidBlockRenderer(InitFluids.fluidOil);
IResourceManager manager = Minecraft.getMinecraft().getResourceManager(); IResourceManager manager = Minecraft.getMinecraft().getResourceManager();
if(manager instanceof IReloadableResourceManager){ if(manager instanceof IReloadableResourceManager){

View file

@ -12,7 +12,7 @@ package de.ellpeck.actuallyadditions.mod.tile;
import cofh.api.energy.EnergyStorage; import cofh.api.energy.EnergyStorage;
import cofh.api.energy.IEnergyReceiver; 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.InitItems;
import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems;
import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
@ -72,7 +72,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE
this.slots[0] = null; this.slots[0] = null;
} }
this.tank.fill(new FluidStack(InitBlocks.fluidCanolaOil, PRODUCE), true); this.tank.fill(new FluidStack(InitFluids.fluidCanolaOil, PRODUCE), true);
this.markDirty(); this.markDirty();
} }
} }
@ -133,7 +133,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE
@Override @Override
public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ 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 @Override
@ -163,7 +163,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE
@Override @Override
public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain){ 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 this.tank.drain(resource.amount, doDrain);
} }
return null; return null;

View file

@ -10,7 +10,7 @@
package de.ellpeck.actuallyadditions.mod.tile; 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 de.ellpeck.actuallyadditions.mod.util.WorldUtil;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -45,7 +45,7 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen
if(this.currentProcessTime >= PROCESS_TIME){ if(this.currentProcessTime >= PROCESS_TIME){
this.currentProcessTime = 0; 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.canolaTank.drain(produce, true);
this.markDirty(); this.markDirty();
} }
@ -54,7 +54,7 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen
this.currentProcessTime = 0; 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); WorldUtil.fillBucket(oilTank, slots, 2, 3);
if(this.oilTank.getFluidAmount() > 0){ if(this.oilTank.getFluidAmount() > 0){
@ -115,17 +115,17 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen
@Override @Override
public boolean isItemValidForSlot(int i, ItemStack stack){ 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 @Override
public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ 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 @Override
public int fill(EnumFacing from, FluidStack resource, boolean doFill){ 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 this.canolaTank.fill(resource, doFill);
} }
return 0; return 0;
@ -133,7 +133,7 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen
@Override @Override
public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain){ 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 this.oilTank.drain(resource.amount, doDrain);
} }
return null; return null;
@ -146,12 +146,12 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen
@Override @Override
public boolean canFill(EnumFacing from, Fluid fluid){ public boolean canFill(EnumFacing from, Fluid fluid){
return from != EnumFacing.DOWN && fluid == InitBlocks.fluidCanolaOil; return from != EnumFacing.DOWN && fluid == InitFluids.fluidCanolaOil;
} }
@Override @Override
public boolean canDrain(EnumFacing from, Fluid fluid){ public boolean canDrain(EnumFacing from, Fluid fluid){
return from != EnumFacing.UP && fluid == InitBlocks.fluidOil; return from != EnumFacing.UP && fluid == InitFluids.fluidOil;
} }
@Override @Override

View file

@ -12,7 +12,7 @@ package de.ellpeck.actuallyadditions.mod.tile;
import cofh.api.energy.EnergyStorage; import cofh.api.energy.EnergyStorage;
import cofh.api.energy.IEnergyProvider; 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.PosUtil;
import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
import net.minecraft.item.ItemStack; 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){ if(this.storage.getEnergyStored() > 0){
WorldUtil.pushEnergyToAllSides(worldObj, this.pos, this.storage); WorldUtil.pushEnergyToAllSides(worldObj, this.pos, this.storage);
@ -122,7 +122,7 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I
@Override @Override
public boolean isItemValidForSlot(int i, ItemStack stack){ 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 @Override
@ -152,7 +152,7 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I
@Override @Override
public int fill(EnumFacing from, FluidStack resource, boolean doFill){ 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 this.tank.fill(resource, doFill);
} }
return 0; return 0;
@ -170,7 +170,7 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I
@Override @Override
public boolean canFill(EnumFacing from, Fluid fluid){ public boolean canFill(EnumFacing from, Fluid fluid){
return from != EnumFacing.DOWN && fluid == InitBlocks.fluidOil; return from != EnumFacing.DOWN && fluid == InitFluids.fluidOil;
} }
@Override @Override