Fixed drop projector name always showing as 'half'

This commit is contained in:
LemADEC 2016-06-26 15:19:59 +02:00
parent d53bad70bb
commit 0e83953519
2 changed files with 8 additions and 1 deletions

View file

@ -1,6 +1,5 @@
package cr0s.warpdrive.block;
import cr0s.warpdrive.block.forcefield.TileEntityForceFieldProjector;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
@ -87,6 +86,7 @@ public abstract class BlockAbstractContainer extends BlockContainer {
@Override
protected void dropBlockAsItem(World world, int x, int y, int z, ItemStack itemStack) {
itemStack.setItemDamage(getDamageValue(world, x, y, z));
TileEntity tileEntity = world.getTileEntity(x, y, z);
if (tileEntity == null) {
WarpDrive.logger.error("Missing tile entity for " + this + " at " + world + " " + x + " " + y + " " + z);

View file

@ -84,6 +84,13 @@ public class BlockForceFieldProjector extends BlockAbstractForceField {
}
}
@Override
public int getDamageValue(World world, int x, int y, int z) {
super.getDamageValue(world, x, y, z);
TileEntityForceFieldProjector tileEntityForceFieldProjector = (TileEntityForceFieldProjector)world.getTileEntity(x, y, z);
return tileEntityForceFieldProjector.isDoubleSided ? 1 : 0;
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack itemStack) {
super.onBlockPlacedBy(world, x, y, z, entityLiving, itemStack);