Changed a string to a class as I'm likely to forget to update it. Also added in warnings for myself for updating.
This commit is contained in:
parent
d83c5bcd2c
commit
04df1cd162
@ -16,6 +16,7 @@ import me.libraryaddict.disguise.disguisetypes.watchers.AgeableWatcher;
|
|||||||
import me.libraryaddict.disguise.disguisetypes.watchers.LivingWatcher;
|
import me.libraryaddict.disguise.disguisetypes.watchers.LivingWatcher;
|
||||||
import net.minecraft.server.v1_6_R3.ChatMessage;
|
import net.minecraft.server.v1_6_R3.ChatMessage;
|
||||||
import net.minecraft.server.v1_6_R3.ChunkCoordinates;
|
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.EntityHuman;
|
||||||
import net.minecraft.server.v1_6_R3.EntityLiving;
|
import net.minecraft.server.v1_6_R3.EntityLiving;
|
||||||
import net.minecraft.server.v1_6_R3.GenericAttributes;
|
import net.minecraft.server.v1_6_R3.GenericAttributes;
|
||||||
@ -201,7 +202,7 @@ public class LibsDisguises extends JavaPlugin {
|
|||||||
entityClass = EntityHuman.class;
|
entityClass = EntityHuman.class;
|
||||||
entity = new DisguiseHuman(world);
|
entity = new DisguiseHuman(world);
|
||||||
} else {
|
} 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);
|
entity = (net.minecraft.server.v1_6_R3.Entity) entityClass.getConstructor(World.class).newInstance(world);
|
||||||
}
|
}
|
||||||
Values value = new Values(disguiseType, entityClass, entity.at);
|
Values value = new Values(disguiseType, entityClass, entity.at);
|
||||||
@ -216,6 +217,7 @@ public class LibsDisguises extends JavaPlugin {
|
|||||||
DisguiseSound sound = DisguiseSound.getType(disguiseType.name());
|
DisguiseSound sound = DisguiseSound.getType(disguiseType.name());
|
||||||
if (sound != null) {
|
if (sound != null) {
|
||||||
Method soundStrength = EntityLiving.class.getDeclaredMethod("ba");
|
Method soundStrength = EntityLiving.class.getDeclaredMethod("ba");
|
||||||
|
// TODO Update this each update!
|
||||||
soundStrength.setAccessible(true);
|
soundStrength.setAccessible(true);
|
||||||
sound.setDamageSoundVolume((Float) soundStrength.invoke(entity));
|
sound.setDamageSoundVolume((Float) soundStrength.invoke(entity));
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,9 @@ public enum DisguiseSound {
|
|||||||
GIANT(Sound.HURT_FLESH, Sound.STEP_GRASS),
|
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,
|
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),
|
IRON_GOLEM(Sound.IRONGOLEM_HIT, Sound.IRONGOLEM_WALK, Sound.IRONGOLEM_DEATH, Sound.IRONGOLEM_THROW),
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user