Better redstone support, fixed fuse sound

This commit is contained in:
aidancbrady 2016-01-05 20:35:42 -05:00
parent 8728531f77
commit 7016268cbc
2 changed files with 21 additions and 9 deletions

View file

@ -71,7 +71,7 @@ public class BlockObsidianTNT extends Block
{
EntityObsidianTNT entity = new EntityObsidianTNT(world, x + 0.5F, y + 0.5F, z + 0.5F);
world.spawnEntityInWorld(entity);
world.playSoundAtEntity(entity, "random.fuse", 1.0F, 1.0F);
world.playSoundAtEntity(entity, "game.tnt.primed", 1.0F, 1.0F);
}
}

View file

@ -253,9 +253,17 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
return redstoneLastTick;
}
public void onPowerChange() {}
public void onNeighborChange(Block block)
{
if(!worldObj.isRemote)
{
updatePower();
}
}
private void updatePower()
{
boolean power = worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord);
@ -263,12 +271,16 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
{
redstone = power;
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
}
onPowerChange();
}
}
/**
* Called when block is placed in world
*/
public void onAdded()
{
updatePower();
}
}