Added sound disguise for DisguiseBase

Small desc tweak on server monitor.
This commit is contained in:
Jonathan Williams 2013-11-14 00:01:41 -05:00
parent 980ce0a5a3
commit 115109e5b8
3 changed files with 19 additions and 14 deletions

View File

@ -387,7 +387,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
velocityPacket.c = (int) (.8 * lastVelocityPacket.c);
velocityPacket.d = (int) (.8 * lastVelocityPacket.d);
}
_movePacketMap.put(movePacket.a, velocityPacket);
packetList.forceAdd(velocityPacket);
@ -405,8 +405,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
if (_spawnPacketMap.get(movePacket.a) instanceof DisguiseBlock)
{
packetList.forceAdd(velocityPacket);
packetList.forceAdd(velocityPacket);
}
}
else if (packet instanceof Packet33RelEntityMoveLook)
@ -440,7 +439,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
velocityPacket.c = (int) (.8 * lastVelocityPacket.c);
velocityPacket.d = (int) (.8 * lastVelocityPacket.d);
}
_movePacketMap.put(movePacket.a, velocityPacket);
packetList.forceAdd(velocityPacket);
@ -455,12 +454,6 @@ public class DisguiseManager extends MiniPlugin implements IPacketRunnable
}
});
}
if (_spawnPacketMap.get(movePacket.a) instanceof DisguiseBlock)
{
packetList.forceAdd(velocityPacket);
packetList.forceAdd(velocityPacket);
}
}
else if (packet instanceof Packet62NamedSoundEffect)
{

View File

@ -13,6 +13,8 @@ public abstract class DisguiseBase
protected Entity Entity;
protected DataWatcher DataWatcher;
private DisguiseBase _soundDisguise;
public DisguiseBase(org.bukkit.entity.Entity entity)
{
Entity = ((CraftEntity)entity).getHandle();
@ -20,6 +22,8 @@ public abstract class DisguiseBase
DataWatcher.a(0, Byte.valueOf((byte)0));
DataWatcher.a(1, Short.valueOf((short)300));
_soundDisguise = this;
}
public void UpdateDataWatcher()
@ -40,15 +44,23 @@ public abstract class DisguiseBase
UpdateDataWatcher();
return new Packet40EntityMetadata(Entity.id, DataWatcher, true);
}
public void setSoundDisguise(DisguiseBase soundDisguise)
{
_soundDisguise = soundDisguise;
if (_soundDisguise == null)
_soundDisguise = this;
}
public void playHurtSound()
{
Entity.world.makeSound(Entity, getHurtSound(), getVolume(), getPitch());
Entity.world.makeSound(Entity, _soundDisguise.getHurtSound(), _soundDisguise.getVolume(), _soundDisguise.getPitch());
}
public void playHurtSound(Location location)
{
Entity.world.makeSound(location.getX(), location.getY(), location.getZ(), getHurtSound(), getVolume(), getPitch());
Entity.world.makeSound(location.getX(), location.getY(), location.getZ(), _soundDisguise.getHurtSound(), _soundDisguise.getVolume(), _soundDisguise.getPitch());
}
public void UpdateEntity(Entity entity)

View File

@ -23,7 +23,7 @@ public class ServerMonitor
{
for (ServerStatusData statusData : _repository.retrieveOldServerStatuses())
{
System.out.println("----Old Server Status----");
System.out.println("----Old Server Status----> " + statusData.Address + ", " + statusData.Name);
killServer(statusData);
}
@ -133,7 +133,7 @@ public class ServerMonitor
}
}
catch (Exception e)
{
{
e.printStackTrace();
}
finally