mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
Fix multipart breaking
This commit is contained in:
1 parent
3fccbada96
commit
2071cb3760
7 files changed
+301
-59
No files matched your search
@@ -9,6 +9,7 @@ import mekanism.common.block.property.PropertyColor;
|
||||
import mekanism.common.block.states.BlockStateFacing;
|
||||
import mekanism.common.block.states.BlockStateGlowPanel;
|
||||
import mekanism.common.integration.multipart.MultipartMekanism;
|
||||
import mekanism.common.tile.TileEntityBasicBlock;
|
||||
import mekanism.common.tile.TileEntityGlowPanel;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
@@ -52,6 +53,8 @@ public class BlockGlowPanel extends Block implements ITileEntityProvider
|
||||
{
|
||||
super(Material.PISTON);
|
||||
setCreativeTab(Mekanism.tabMekanism);
|
||||
setHardness(1F);
|
||||
setResistance(10F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -145,12 +148,6 @@ public class BlockGlowPanel extends Block implements ITileEntityProvider
|
||||
return super.getBoundingBox(state, world, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBlockHardness(IBlockState state, World world, BlockPos pos)
|
||||
{
|
||||
return 3.5F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockOnSide(World world, BlockPos pos, EnumFacing side)
|
||||
{
|
||||
@@ -170,9 +167,9 @@ public class BlockGlowPanel extends Block implements ITileEntityProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state)
|
||||
public int quantityDropped(Random random)
|
||||
{
|
||||
return ((IExtendedBlockState)state).getValue(PropertyColor.INSTANCE).color.getMetaValue();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -182,6 +179,24 @@ public class BlockGlowPanel extends Block implements ITileEntityProvider
|
||||
return new ItemStack(MekanismBlocks.GlowPanel, 1, tileEntity.colour.getMetaValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
||||
{
|
||||
if(!player.capabilities.isCreativeMode && !world.isRemote && willHarvest)
|
||||
{
|
||||
float motion = 0.7F;
|
||||
double motionX = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
|
||||
double motionY = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
|
||||
double motionZ = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
|
||||
|
||||
EntityItem entityItem = new EntityItem(world, pos.getX() + motionX, pos.getY() + motionY, pos.getZ() + motionZ, getPickBlock(state, null, world, pos, player));
|
||||
|
||||
world.spawnEntity(entityItem);
|
||||
}
|
||||
|
||||
return super.removedByPlayer(state, world, pos, player, willHarvest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user