Fixed flammabilty/fire spread for slabs, planks, logs, foliage/plants, and flowers

This commit is contained in:
Forstride 2016-01-30 20:33:50 -05:00
parent 7bf7f66129
commit 6e45433c9e
6 changed files with 204 additions and 0 deletions

View file

@ -24,10 +24,12 @@ import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
@ -158,4 +160,31 @@ public class BlockBOPDoubleWoodSlab extends BlockSlab implements IBOPBlock
}
}
@Override
public int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face)
{
BOPWoods wood = ((BOPWoods) world.getBlockState(pos).getValue(this.variantProperty));
switch (wood)
{
case HELLBARK:
return 0;
default:
return Blocks.double_wooden_slab.getFlammability(world, pos, face);
}
}
@Override
public int getFireSpreadSpeed(IBlockAccess world, BlockPos pos, EnumFacing face)
{
BOPWoods wood = ((BOPWoods) world.getBlockState(pos).getValue(this.variantProperty));
switch (wood)
{
case HELLBARK:
return 0;
default:
return Blocks.double_wooden_slab.getFireSpreadSpeed(world, pos, face);
}
}
}

View file

@ -15,6 +15,7 @@ import java.util.Random;
import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.common.config.GameplayConfigurationHandler;
import biomesoplenty.common.enums.BOPFlowers;
import biomesoplenty.common.enums.BOPWoods;
import biomesoplenty.common.item.ItemBOPFlower;
import biomesoplenty.common.util.block.VariantPagingHelper;
import net.minecraft.block.Block;
@ -32,6 +33,7 @@ import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@ -320,6 +322,32 @@ public class BlockBOPFlower extends BlockBOPDecoration implements IShearable
super.dropBlockAsItemWithChance(world, pos, state, chance, fortune);
}
@Override
public int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face)
{
BOPFlowers flower = ((BOPFlowers) world.getBlockState(pos).getValue(this.variantProperty));
switch (flower)
{
case BURNING_BLOSSOM:
return 0;
default:
return Blocks.red_flower.getFlammability(world, pos, face);
}
}
@Override
public int getFireSpreadSpeed(IBlockAccess world, BlockPos pos, EnumFacing face)
{
BOPFlowers flower = ((BOPFlowers) world.getBlockState(pos).getValue(this.variantProperty));
switch (flower)
{
case BURNING_BLOSSOM:
return 0;
default:
return Blocks.red_flower.getFireSpreadSpeed(world, pos, face);
}
}
@Override
public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) { return new ArrayList<ItemStack>(); }

View file

@ -22,9 +22,13 @@ import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@ -146,4 +150,30 @@ public class BlockBOPHalfWoodSlab extends BlockSlab implements IBOPBlock
}
}
@Override
public int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face)
{
BOPWoods wood = ((BOPWoods) world.getBlockState(pos).getValue(this.variantProperty));
switch (wood)
{
case HELLBARK:
return 0;
default:
return Blocks.wooden_slab.getFlammability(world, pos, face);
}
}
@Override
public int getFireSpreadSpeed(IBlockAccess world, BlockPos pos, EnumFacing face)
{
BOPWoods wood = ((BOPWoods) world.getBlockState(pos).getValue(this.variantProperty));
switch (wood)
{
case HELLBARK:
return 0;
default:
return Blocks.wooden_slab.getFireSpreadSpeed(world, pos, face);
}
}
}

View file

@ -9,6 +9,7 @@
package biomesoplenty.common.block;
import biomesoplenty.api.block.IBOPBlock;
import biomesoplenty.common.enums.BOPTrees;
import biomesoplenty.common.enums.BOPWoods;
import biomesoplenty.common.item.ItemBOPBlock;
import biomesoplenty.common.util.block.VariantPagingHelper;
@ -16,7 +17,11 @@ import net.minecraft.block.BlockLog;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.IBlockAccess;
public class BlockBOPLog extends BlockLog implements IBOPBlock
{
@ -105,5 +110,31 @@ public class BlockBOPLog extends BlockLog implements IBOPBlock
return this.getMetaFromState(state.withProperty(LOG_AXIS, BlockLog.EnumAxis.Y));
}
@Override
public int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face)
{
BOPWoods wood = ((BOPWoods) world.getBlockState(pos).getValue(this.variantProperty));
switch (wood)
{
case HELLBARK:
return 0;
default:
return Blocks.log.getFlammability(world, pos, face);
}
}
@Override
public int getFireSpreadSpeed(IBlockAccess world, BlockPos pos, EnumFacing face)
{
BOPWoods wood = ((BOPWoods) world.getBlockState(pos).getValue(this.variantProperty));
switch (wood)
{
case HELLBARK:
return 0;
default:
return Blocks.log.getFireSpreadSpeed(world, pos, face);
}
}
}

View file

@ -13,7 +13,11 @@ import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.IBlockAccess;
import biomesoplenty.api.block.IBOPBlock;
import biomesoplenty.common.enums.BOPWoods;
import biomesoplenty.common.item.ItemBOPBlock;
@ -99,4 +103,31 @@ public class BlockBOPPlanks extends Block implements IBOPBlock
return this.getMetaFromState(state);
}
@Override
public int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face)
{
BOPWoods wood = ((BOPWoods) world.getBlockState(pos).getValue(this.variantProperty));
switch (wood)
{
case HELLBARK:
return 0;
default:
return Blocks.planks.getFlammability(world, pos, face);
}
}
@Override
public int getFireSpreadSpeed(IBlockAccess world, BlockPos pos, EnumFacing face)
{
BOPWoods wood = ((BOPWoods) world.getBlockState(pos).getValue(this.variantProperty));
switch (wood)
{
case HELLBARK:
return 0;
default:
return Blocks.planks.getFireSpreadSpeed(world, pos, face);
}
}
}

View file

@ -14,6 +14,7 @@ import java.util.Random;
import biomesoplenty.api.block.BlockQueries;
import biomesoplenty.api.item.BOPItems;
import biomesoplenty.common.enums.BOPPlants;
import biomesoplenty.common.enums.BOPWoods;
import biomesoplenty.common.item.ItemBOPPlant;
import biomesoplenty.common.util.block.VariantPagingHelper;
import net.minecraft.block.Block;
@ -546,6 +547,60 @@ public class BlockBOPPlant extends BlockBOPDecoration implements IShearable
return ret;
}
@Override
public int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face)
{
BOPPlants plant = ((BOPPlants) world.getBlockState(pos).getValue(this.variantProperty));
switch (plant)
{
case WILDRICE:
return 0;
case CATTAIL:
return 0;
case RIVERCANE:
return 0;
case WILDCARROT:
return 0;
case WITHERWART:
return 0;
case REED:
return 0;
case ROOT:
return 0;
case RAFFLESIA:
return 0;
default:
return Blocks.tallgrass.getFlammability(world, pos, face);
}
}
@Override
public int getFireSpreadSpeed(IBlockAccess world, BlockPos pos, EnumFacing face)
{
BOPPlants plant = ((BOPPlants) world.getBlockState(pos).getValue(this.variantProperty));
switch (plant)
{
case WILDRICE:
return 0;
case CATTAIL:
return 0;
case RIVERCANE:
return 0;
case WILDCARROT:
return 0;
case WITHERWART:
return 0;
case REED:
return 0;
case ROOT:
return 0;
case RAFFLESIA:
return 0;
default:
return Blocks.tallgrass.getFireSpreadSpeed(world, pos, face);
}
}
// TODO: pickblock on carrot?