Better redstone support, fixed fuse sound
This commit is contained in:
parent
8728531f77
commit
7016268cbc
2 changed files with 21 additions and 9 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -252,23 +252,35 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
|
|||
{
|
||||
return redstoneLastTick;
|
||||
}
|
||||
|
||||
public void onPowerChange() {}
|
||||
|
||||
public void onNeighborChange(Block block)
|
||||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
boolean power = worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord);
|
||||
|
||||
if(redstone != power)
|
||||
{
|
||||
redstone = power;
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
}
|
||||
updatePower();
|
||||
}
|
||||
}
|
||||
|
||||
public void onAdded()
|
||||
private void updatePower()
|
||||
{
|
||||
boolean power = worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord);
|
||||
|
||||
if(redstone != power)
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue