Created BOPCFluids
This commit is contained in:
parent
a35d20c0d4
commit
aedf304dbc
4 changed files with 24 additions and 15 deletions
10
src/main/java/biomesoplenty/api/content/BOPCFluids.java
Normal file
10
src/main/java/biomesoplenty/api/content/BOPCFluids.java
Normal file
|
@ -0,0 +1,10 @@
|
|||
package biomesoplenty.api.content;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
public class BOPCFluids
|
||||
{
|
||||
public static Fluid poison;
|
||||
public static Fluid spring_water;
|
||||
public static Fluid honey;
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
package biomesoplenty.common.core;
|
||||
|
||||
import static biomesoplenty.api.content.BOPCFluids.*;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import biomesoplenty.api.content.BOPCBlocks;
|
||||
|
@ -9,10 +11,6 @@ import biomesoplenty.common.fluids.SpringWaterFluid;
|
|||
|
||||
public class BOPFluids
|
||||
{
|
||||
public static Fluid poison;
|
||||
public static Fluid spring_water;
|
||||
public static Fluid honey;
|
||||
|
||||
public static void preInit()
|
||||
{
|
||||
registerFluids();
|
||||
|
@ -25,9 +23,9 @@ public class BOPFluids
|
|||
|
||||
private static void registerFluids()
|
||||
{
|
||||
registerFluid(poison = new PoisonFluid("poison"));
|
||||
registerFluid(spring_water = new SpringWaterFluid("spring_water"));
|
||||
registerFluid(honey = new HoneyFluid("honey"));
|
||||
poison = registerFluid(new PoisonFluid("poison"));
|
||||
spring_water = registerFluid(new SpringWaterFluid("spring_water"));
|
||||
honey = registerFluid(new HoneyFluid("honey"));
|
||||
}
|
||||
|
||||
private static void registerFluidBlocks()
|
||||
|
@ -37,8 +35,10 @@ public class BOPFluids
|
|||
honey.setBlock(BOPCBlocks.honey);
|
||||
}
|
||||
|
||||
public static void registerFluid(Fluid fluid)
|
||||
public static Fluid registerFluid(Fluid fluid)
|
||||
{
|
||||
FluidRegistry.registerFluid(fluid);
|
||||
|
||||
return fluid;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,9 +7,8 @@ import net.minecraftforge.fluids.Fluid;
|
|||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import biomesoplenty.api.BOPItemHelper;
|
||||
import biomesoplenty.api.content.BOPCFluids;
|
||||
import biomesoplenty.api.content.BOPCItems;
|
||||
import biomesoplenty.common.core.BOPFluids;
|
||||
import biomesoplenty.common.items.ItemBOPBucket;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
@ -32,7 +31,7 @@ public class BucketEventHandler
|
|||
|
||||
if (fluid != null)
|
||||
{
|
||||
if ((fluid == BOPFluids.poison && world.getBlockMetadata(x, y, z) == 0) || (fluid == BOPFluids.honey && world.getBlockMetadata(x, y, z) == 7))
|
||||
if ((fluid == BOPCFluids.poison && world.getBlockMetadata(x, y, z) == 0) || (fluid == BOPCFluids.honey && world.getBlockMetadata(x, y, z) == 7))
|
||||
{
|
||||
bopBucket.fill(bopBucketStack, new FluidStack(fluid, FluidContainerRegistry.BUCKET_VOLUME), true);
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import net.minecraftforge.fluids.FluidContainerRegistry;
|
|||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.ItemFluidContainer;
|
||||
import biomesoplenty.BiomesOPlenty;
|
||||
import biomesoplenty.common.core.BOPFluids;
|
||||
import biomesoplenty.api.content.BOPCFluids;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
@ -114,7 +114,7 @@ public class ItemBOPBucket extends ItemFluidContainer
|
|||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
|
||||
int meta = fluid.getFluid() == BOPFluids.honey ? 7 : 0;
|
||||
int meta = fluid.getFluid() == BOPCFluids.honey ? 7 : 0;
|
||||
|
||||
world.setBlock(x, y, z, fluid.getFluid().getBlock(), meta, 3);
|
||||
}
|
||||
|
@ -128,9 +128,9 @@ public class ItemBOPBucket extends ItemFluidContainer
|
|||
{
|
||||
ItemStack fluid = new ItemStack(item);
|
||||
|
||||
this.fill(fluid, new FluidStack(BOPFluids.poison, FluidContainerRegistry.BUCKET_VOLUME), true); list.add(fluid);
|
||||
this.fill(fluid, new FluidStack(BOPCFluids.poison, FluidContainerRegistry.BUCKET_VOLUME), true); list.add(fluid);
|
||||
fluid = new ItemStack(item);
|
||||
this.fill(fluid, new FluidStack(BOPFluids.honey, FluidContainerRegistry.BUCKET_VOLUME), true); list.add(fluid);
|
||||
this.fill(fluid, new FluidStack(BOPCFluids.honey, FluidContainerRegistry.BUCKET_VOLUME), true); list.add(fluid);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue