Add other BOP fluids, blood and poison, no rendering yet

This commit is contained in:
Cheeserolls 2015-05-04 10:30:06 +01:00
parent fc3c423523
commit 43390b5dd0
13 changed files with 125 additions and 3 deletions

View File

@ -134,4 +134,8 @@ public class BOPBlocks
public static Block honey;
public static Fluid honey_fluid;
public static Block blood;
public static Fluid blood_fluid;
public static Block poison;
public static Fluid poison_fluid;
}

View File

@ -0,0 +1,15 @@
package biomesoplenty.common.fluids.blocks;
import net.minecraft.block.material.Material;
import net.minecraftforge.fluids.BlockFluidFinite;
import net.minecraftforge.fluids.Fluid;
public class BlockBloodFluid extends BlockFluidFinite
{
public BlockBloodFluid(Fluid fluid)
{
super(fluid, Material.water);
}
}

View File

@ -19,7 +19,6 @@ public class BlockHoneyFluid extends BlockFluidFinite
this.setLightOpacity(1);
}
// TODO: check we need this - Does Forge's fluid already handle it through viscosity?
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, Entity entity)
{

View File

@ -0,0 +1,33 @@
package biomesoplenty.common.fluids.blocks;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidFinite;
import net.minecraftforge.fluids.Fluid;
public class BlockPoisonFluid extends BlockFluidFinite
{
public BlockPoisonFluid(Fluid fluid)
{
super(fluid, Material.water);
this.setLightOpacity(3);
this.quantaPerBlock = 4;
}
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, Entity entity)
{
if (entity instanceof EntityLivingBase)
{
((EntityLivingBase)entity).addPotionEffect(new PotionEffect(Potion.poison.id, 100));
((EntityLivingBase)entity).addPotionEffect(new PotionEffect(Potion.hunger.id, 100));
}
}
}

View File

@ -28,7 +28,7 @@ import biomesoplenty.api.block.IBOPBlock;
import biomesoplenty.api.item.BOPItems;
import biomesoplenty.common.block.*;
import biomesoplenty.common.command.BOPCommand;
import biomesoplenty.common.fluids.blocks.BlockHoneyFluid;
import biomesoplenty.common.fluids.blocks.*;
import biomesoplenty.common.util.block.BlockStateUtils;
import biomesoplenty.common.util.inventory.CreativeTabBOP;
import biomesoplenty.core.BiomesOPlenty;
@ -185,12 +185,23 @@ public class ModBlocks
honey_block = registerBlock( new BlockHoney(), "honey_block" );
// TODO: make the honey render! at the moment, no forge fluids are rendering in 1.8, they're invisible
// fluids
// TODO: make the fluids render! at the moment, no forge fluids are rendering in 1.8, they're invisible
honey_fluid = new Fluid("honey");
honey_fluid.setViscosity(1500);
FluidRegistry.registerFluid(honey_fluid);
honey = registerFluidBlock(honey_fluid, new BlockHoneyFluid(honey_fluid), "honey");
blood_fluid = new Fluid("blood");
FluidRegistry.registerFluid(blood_fluid);
blood = registerFluidBlock(blood_fluid, new BlockBloodFluid(blood_fluid), "blood");
poison_fluid = new Fluid("poison");
FluidRegistry.registerFluid(poison_fluid);
poison = registerFluidBlock(poison_fluid, new BlockPoisonFluid(poison_fluid), "poison");
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,5 @@
{
"animation": {
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,5 @@
{
"animation": {
"frametime": 2
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@ -0,0 +1,5 @@
{
"animation": {
"frametime": 3
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@ -0,0 +1,45 @@
{
"animation": {
"frametime": 2,
"frames": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
18,
17,
16,
15,
14,
13,
12,
11,
10,
9,
8,
7,
6,
5,
4,
3,
2,
1
]
}
}