Fix errors in sounds

This commit is contained in:
libraryaddict 2016-05-15 11:15:24 +12:00
parent 4b01f98f55
commit b17191a462
2 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>LibsDisguises</groupId> <groupId>LibsDisguises</groupId>
<artifactId>LibsDisguises</artifactId> <artifactId>LibsDisguises</artifactId>
<version>9.0.5</version> <version>9.0.5-SNAPSHOT</version>
<build> <build>
<sourceDirectory>src</sourceDirectory> <sourceDirectory>src</sourceDirectory>

View File

@ -186,7 +186,7 @@ public class PacketListenerSounds extends PacketAdapter
int typeId = soundLoc.getWorld().getBlockTypeIdAt(soundLoc.getBlockX(), int typeId = soundLoc.getWorld().getBlockTypeIdAt(soundLoc.getBlockX(),
soundLoc.getBlockY() - 1, soundLoc.getBlockZ()); soundLoc.getBlockY() - 1, soundLoc.getBlockZ());
Object block = ReflectionManager.getNmsMethod("RegistryMaterials", "a", int.class) Object block = ReflectionManager.getNmsMethod("RegistryMaterials", "getId", int.class)
.invoke(ReflectionManager.getNmsField("Block", "REGISTRY").get(null), typeId); .invoke(ReflectionManager.getNmsField("Block", "REGISTRY").get(null), typeId);
if (block != null) if (block != null)
@ -194,7 +194,7 @@ public class PacketListenerSounds extends PacketAdapter
Object step = ReflectionManager.getNmsField("Block", "stepSound").get(block); Object step = ReflectionManager.getNmsField("Block", "stepSound").get(block);
mods.write(0, mods.write(0,
ReflectionManager.getNmsMethod(step.getClass(), "getStepSound").invoke(step)); ReflectionManager.getNmsMethod(step.getClass(), "d").invoke(step));
mods.write(1, ReflectionManager.getSoundCategory(disguise.getType())); mods.write(1, ReflectionManager.getSoundCategory(disguise.getType()));
} }
} }
@ -237,7 +237,7 @@ public class PacketListenerSounds extends PacketAdapter
if (((MobDisguise) disguise).isAdult() == baby) if (((MobDisguise) disguise).isAdult() == baby)
{ {
float pitch = (Integer) mods.read(5); float pitch = (Integer) mods.read(6);
if (baby) if (baby)
{ {