mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-26 21:09:23 +01:00
Move Fluids to InitFluids
This commit is contained in:
parent
3f958a0726
commit
4630c39a13
13 changed files with 114 additions and 95 deletions
|
@ -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();
|
||||
|
|
|
@ -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!");
|
||||
}
|
||||
}
|
|
@ -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){
|
||||
|
|
|
@ -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;
|
|
@ -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!");
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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<Item, ResourceLocation[]> 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){
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue