From 04df1cd1622735b511f687f6cc978d8d45be9f18 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 18 Nov 2013 04:16:17 +1300 Subject: [PATCH] Changed a string to a class as I'm likely to forget to update it. Also added in warnings for myself for updating. --- src/me/libraryaddict/disguise/LibsDisguises.java | 4 +++- .../libraryaddict/disguise/disguisetypes/DisguiseSound.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/me/libraryaddict/disguise/LibsDisguises.java b/src/me/libraryaddict/disguise/LibsDisguises.java index ff775fc1..dd1fdf5f 100644 --- a/src/me/libraryaddict/disguise/LibsDisguises.java +++ b/src/me/libraryaddict/disguise/LibsDisguises.java @@ -16,6 +16,7 @@ import me.libraryaddict.disguise.disguisetypes.watchers.AgeableWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.LivingWatcher; import net.minecraft.server.v1_6_R3.ChatMessage; import net.minecraft.server.v1_6_R3.ChunkCoordinates; +import net.minecraft.server.v1_6_R3.Entity; import net.minecraft.server.v1_6_R3.EntityHuman; import net.minecraft.server.v1_6_R3.EntityLiving; import net.minecraft.server.v1_6_R3.GenericAttributes; @@ -201,7 +202,7 @@ public class LibsDisguises extends JavaPlugin { entityClass = EntityHuman.class; entity = new DisguiseHuman(world); } else { - entityClass = Class.forName("net.minecraft.server.v1_6_R3.Entity" + name); + entityClass = Class.forName(Entity.class.getName() + name); entity = (net.minecraft.server.v1_6_R3.Entity) entityClass.getConstructor(World.class).newInstance(world); } Values value = new Values(disguiseType, entityClass, entity.at); @@ -216,6 +217,7 @@ public class LibsDisguises extends JavaPlugin { DisguiseSound sound = DisguiseSound.getType(disguiseType.name()); if (sound != null) { Method soundStrength = EntityLiving.class.getDeclaredMethod("ba"); + // TODO Update this each update! soundStrength.setAccessible(true); sound.setDamageSoundVolume((Float) soundStrength.invoke(entity)); } diff --git a/src/me/libraryaddict/disguise/disguisetypes/DisguiseSound.java b/src/me/libraryaddict/disguise/disguisetypes/DisguiseSound.java index ab951893..2707fcb6 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/DisguiseSound.java +++ b/src/me/libraryaddict/disguise/disguisetypes/DisguiseSound.java @@ -41,7 +41,9 @@ public enum DisguiseSound { GIANT(Sound.HURT_FLESH, Sound.STEP_GRASS), HORSE(Sound.HORSE_HIT, Sound.STEP_GRASS, "mob.horse.death", Sound.HORSE_IDLE, Sound.HORSE_GALLOP, Sound.HORSE_ANGRY, - Sound.HORSE_ARMOR, Sound.HORSE_JUMP, Sound.HORSE_LAND, Sound.HORSE_SADDLE, Sound.HORSE_SOFT, Sound.HORSE_WOOD), + Sound.HORSE_ARMOR, Sound.HORSE_JUMP, Sound.HORSE_LAND, Sound.HORSE_SADDLE, Sound.HORSE_SOFT, Sound.HORSE_WOOD, + "mob.horse.leather"), // TODO I really should finish adding all the sounds. Lazy bukkit didn't add all of them either. + // -.- IRON_GOLEM(Sound.IRONGOLEM_HIT, Sound.IRONGOLEM_WALK, Sound.IRONGOLEM_DEATH, Sound.IRONGOLEM_THROW),