Fix BOP door hardness and drops
This commit is contained in:
parent
7846b72311
commit
02d17fa03e
|
@ -8,11 +8,14 @@
|
|||
|
||||
package biomesoplenty.common.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import biomesoplenty.api.block.IBOPBlock;
|
||||
import net.minecraft.block.BlockDoor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.util.BlockPos;
|
||||
|
@ -40,6 +43,7 @@ public class BlockBOPDoor extends BlockDoor implements IBOPBlock
|
|||
public BlockBOPDoor()
|
||||
{
|
||||
super(Material.wood);
|
||||
this.setHardness(3.0F);
|
||||
this.setHarvestLevel("axe", 0);
|
||||
}
|
||||
|
||||
|
@ -48,12 +52,22 @@ public class BlockBOPDoor extends BlockDoor implements IBOPBlock
|
|||
this.doorItem = doorItem;
|
||||
}
|
||||
|
||||
public Item getDoorItem()
|
||||
{
|
||||
return this.doorItem == null ? Items.oak_door : this.doorItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World worldIn, BlockPos pos)
|
||||
{
|
||||
return this.doorItem;
|
||||
|
||||
return this.getDoorItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random rand, int fortune)
|
||||
{
|
||||
return state.getValue(HALF) == BlockDoor.EnumDoorHalf.UPPER ? null : this.getDoorItem();
|
||||
}
|
||||
}
|
||||
|
|
@ -206,6 +206,7 @@ public class ModBlocks
|
|||
{
|
||||
door_block = registerBlock( new BlockBOPDoor(), name + "_block", null );
|
||||
door_item = ModItems.registerItem( new ItemDoor(door_block), name );
|
||||
((BlockBOPDoor)door_block).setDoorItem(door_item);
|
||||
return door_block;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue