diff --git a/src/main/java/biomesoplenty/api/block/BOPBlocks.java b/src/main/java/biomesoplenty/api/block/BOPBlocks.java index 19be24f6c..6b7246bdd 100644 --- a/src/main/java/biomesoplenty/api/block/BOPBlocks.java +++ b/src/main/java/biomesoplenty/api/block/BOPBlocks.java @@ -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; } diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockBloodFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockBloodFluid.java new file mode 100644 index 000000000..3726acb8a --- /dev/null +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockBloodFluid.java @@ -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); + } + +} \ No newline at end of file diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java index 12ae29f38..d22977c11 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java @@ -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) { diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockPoisonFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockPoisonFluid.java new file mode 100644 index 000000000..ede4df291 --- /dev/null +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockPoisonFluid.java @@ -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)); + } + } + +} \ No newline at end of file diff --git a/src/main/java/biomesoplenty/common/init/ModBlocks.java b/src/main/java/biomesoplenty/common/init/ModBlocks.java index f3d8760bf..0d1b56985 100644 --- a/src/main/java/biomesoplenty/common/init/ModBlocks.java +++ b/src/main/java/biomesoplenty/common/init/ModBlocks.java @@ -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"); + + } diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/blood_flowing.png b/src/main/resources/assets/biomesoplenty/textures/blocks/blood_flowing.png new file mode 100644 index 000000000..02f9b1c6e Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/blood_flowing.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/blood_flowing.png.mcmeta.txt b/src/main/resources/assets/biomesoplenty/textures/blocks/blood_flowing.png.mcmeta.txt new file mode 100644 index 000000000..472c7ff43 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/textures/blocks/blood_flowing.png.mcmeta.txt @@ -0,0 +1,5 @@ +{ + "animation": { + + } +} diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/blood_still.png b/src/main/resources/assets/biomesoplenty/textures/blocks/blood_still.png new file mode 100644 index 000000000..caf04aaed Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/blood_still.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/blood_still.png.mcmeta.txt b/src/main/resources/assets/biomesoplenty/textures/blocks/blood_still.png.mcmeta.txt new file mode 100644 index 000000000..0645f48c6 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/textures/blocks/blood_still.png.mcmeta.txt @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/poison_flowing.png b/src/main/resources/assets/biomesoplenty/textures/blocks/poison_flowing.png new file mode 100644 index 000000000..3c2a1899e Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/poison_flowing.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/poison_flowing.png.mcmeta.txt b/src/main/resources/assets/biomesoplenty/textures/blocks/poison_flowing.png.mcmeta.txt new file mode 100644 index 000000000..8e55e43ba --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/textures/blocks/poison_flowing.png.mcmeta.txt @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 3 + } +} diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/poison_still.png b/src/main/resources/assets/biomesoplenty/textures/blocks/poison_still.png new file mode 100644 index 000000000..a0e0db737 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/poison_still.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/poison_still.png.mcmeta.txt b/src/main/resources/assets/biomesoplenty/textures/blocks/poison_still.png.mcmeta.txt new file mode 100644 index 000000000..7ceb36394 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/textures/blocks/poison_still.png.mcmeta.txt @@ -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 + ] + } +} \ No newline at end of file