Add /npc sound

This commit is contained in:
fullwall 2014-01-29 21:37:27 +08:00
parent ff42e35649
commit ec0ca4a2f2
30 changed files with 482 additions and 4 deletions

View File

@ -265,7 +265,7 @@ public class NPCCommands {
}
CommandSenderCreateNPCEvent event = sender instanceof Player ? new PlayerCreateNPCEvent((Player) sender, copy)
: new CommandSenderCreateNPCEvent(sender, copy);
: new CommandSenderCreateNPCEvent(sender, copy);
Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled()) {
event.getNPC().destroy();
@ -337,7 +337,7 @@ public class NPCCommands {
spawnLoc = args.getSenderLocation();
}
CommandSenderCreateNPCEvent event = sender instanceof Player ? new PlayerCreateNPCEvent((Player) sender, npc)
: new CommandSenderCreateNPCEvent(sender, npc);
: new CommandSenderCreateNPCEvent(sender, npc);
Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled()) {
npc.destroy();
@ -969,7 +969,7 @@ public class NPCCommands {
@Requirements(selected = true, ownership = true, types = { EntityType.CREEPER })
public void power(CommandContext args, CommandSender sender, NPC npc) {
Messaging
.sendTr(sender, npc.getTrait(Powered.class).toggle() ? Messages.POWERED_SET : Messages.POWERED_STOPPED);
.sendTr(sender, npc.getTrait(Powered.class).toggle() ? Messages.POWERED_SET : Messages.POWERED_STOPPED);
}
@Command(
@ -1139,6 +1139,50 @@ public class NPCCommands {
Messaging.sendTr(sender, Messages.SIZE_SET, npc.getName(), size);
}
@Command(
aliases = { "npc" },
usage = "sound (--death [death sound|d]) (--ambient [ambient sound|d]) (--hurt [hurt sound|d]) (-n(one)) (-d(efault))",
desc = "Sets an NPC's played sounds",
modifiers = { "sound" },
flags = "dn",
min = 1,
max = 1,
permission = "citizens.npc.sound")
@Requirements(selected = true, ownership = true, livingEntity = true, excludedTypes = { EntityType.PLAYER })
public void sound(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
String ambientSound = npc.data().get(NPC.AMBIENT_SOUND_METADATA);
String deathSound = npc.data().get(NPC.DEATH_SOUND_METADATA);
String hurtSound = npc.data().get(NPC.HURT_SOUND_METADATA);
if (args.hasFlag('n')) {
ambientSound = deathSound = hurtSound = "";
}
if (args.hasFlag('d')) {
ambientSound = deathSound = hurtSound = null;
} else {
if (args.hasValueFlag("death")) {
deathSound = args.getFlag("death");
if (deathSound.equals("d")) {
deathSound = null;
}
}
if (args.hasValueFlag("ambient")) {
ambientSound = args.getFlag("ambient");
if (ambientSound.equals("d")) {
ambientSound = null;
}
}
if (args.hasValueFlag("hurt")) {
hurtSound = args.getFlag("hurt");
if (hurtSound.equals("d")) {
hurtSound = null;
}
}
}
npc.data().setPersistent(NPC.DEATH_SOUND_METADATA, deathSound);
npc.data().setPersistent(NPC.HURT_SOUND_METADATA, hurtSound);
npc.data().setPersistent(NPC.AMBIENT_SOUND_METADATA, ambientSound);
}
@Command(
aliases = { "npc" },
usage = "spawn (id|name)",

View File

@ -57,6 +57,16 @@ public class BatController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
public boolean bL() {
if (npc == null) {
@ -140,5 +150,10 @@ public class BatController extends MobEntityController {
public void setFlying(boolean flying) {
a(flying);
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
}

View File

@ -56,6 +56,16 @@ public class BlazeController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
public boolean bL() {
if (npc == null)
@ -127,5 +137,10 @@ public class BlazeController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
}

View File

@ -53,7 +53,6 @@ public class CaveSpiderController extends MobEntityController {
this.npc = (CitizensNPC) npc;
if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector);
}
}
@ -64,6 +63,16 @@ public class CaveSpiderController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -170,5 +179,10 @@ public class CaveSpiderController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
}

View File

@ -63,6 +63,16 @@ public class ChickenController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -155,5 +165,10 @@ public class ChickenController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
}

View File

@ -64,6 +64,16 @@ public class CowController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -158,5 +168,10 @@ public class CowController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
}

View File

@ -71,6 +71,16 @@ public class CreeperController extends MobEntityController {
super.a(entitylightning);
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -168,5 +178,10 @@ public class CreeperController extends MobEntityController {
public void setAllowPowered(boolean allowPowered) {
this.allowPowered = allowPowered;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
}

View File

@ -56,6 +56,16 @@ public class EnderDragonController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
public boolean bL() {
if (npc == null)
@ -148,5 +158,10 @@ public class EnderDragonController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
}

View File

@ -64,6 +64,16 @@ public class EndermanController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -185,6 +195,11 @@ public class EndermanController extends MobEntityController {
return false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
private void updateAIWithMovement() {
NMS.updateAI(this);
// taken from EntityLiving update method

View File

@ -42,6 +42,16 @@ public class GhastController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
public boolean bL() {
if (npc == null)
@ -110,6 +120,11 @@ public class GhastController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
public static class GhastNPC extends CraftGhast implements NPCHolder {

View File

@ -49,6 +49,16 @@ public class GiantController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -144,6 +154,11 @@ public class GiantController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
public static class GiantNPC extends CraftGiant implements NPCHolder {

View File

@ -59,6 +59,16 @@ public class HorseController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -157,6 +167,11 @@ public class HorseController extends MobEntityController {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
private void updateAIWithMovement() {
NMS.updateAI(this);
// taken from EntityLiving update method

View File

@ -49,6 +49,16 @@ public class IronGolemController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -141,6 +151,11 @@ public class IronGolemController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
public static class IronGolemNPC extends CraftIronGolem implements NPCHolder {

View File

@ -50,6 +50,16 @@ public class MagmaCubeController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -152,6 +162,11 @@ public class MagmaCubeController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
public static class MagmaCubeNPC extends CraftMagmaCube implements NPCHolder {

View File

@ -50,6 +50,16 @@ public class MushroomCowController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -142,6 +152,11 @@ public class MushroomCowController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
public static class MushroomCowNPC extends CraftMushroomCow implements NPCHolder {

View File

@ -50,6 +50,16 @@ public class OcelotController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -142,6 +152,11 @@ public class OcelotController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
public static class OcelotNPC extends CraftOcelot implements NPCHolder {

View File

@ -56,6 +56,16 @@ public class PigController extends MobEntityController {
super.a(entitylightning);
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -148,6 +158,11 @@ public class PigController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
public static class PigNPC extends CraftPig implements NPCHolder {

View File

@ -50,6 +50,16 @@ public class PigZombieController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -152,6 +162,11 @@ public class PigZombieController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
public static class PigZombieNPC extends CraftPigZombie implements NPCHolder {

View File

@ -50,6 +50,16 @@ public class SheepController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -142,6 +152,11 @@ public class SheepController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
public static class SheepNPC extends CraftSheep implements NPCHolder {

View File

@ -49,6 +49,16 @@ public class SilverfishController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -151,6 +161,11 @@ public class SilverfishController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
public static class SilverfishNPC extends CraftSilverfish implements NPCHolder {

View File

@ -49,6 +49,16 @@ public class SkeletonController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -141,6 +151,11 @@ public class SkeletonController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
public static class SkeletonNPC extends CraftSkeleton implements NPCHolder {

View File

@ -51,6 +51,16 @@ public class SlimeController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -153,6 +163,11 @@ public class SlimeController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
public static class SlimeNPC extends CraftSlime implements NPCHolder {

View File

@ -49,6 +49,16 @@ public class SnowmanController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -141,6 +151,11 @@ public class SnowmanController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
public static class SnowmanNPC extends CraftSnowman implements NPCHolder {

View File

@ -49,6 +49,16 @@ public class SpiderController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -151,6 +161,11 @@ public class SpiderController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
public static class SpiderNPC extends CraftSpider implements NPCHolder {

View File

@ -49,6 +49,16 @@ public class SquidController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -142,6 +152,11 @@ public class SquidController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
public static class SquidNPC extends CraftSquid implements NPCHolder {

View File

@ -57,6 +57,16 @@ public class VillagerController extends MobEntityController {
// trades
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -159,6 +169,11 @@ public class VillagerController extends MobEntityController {
public void setBlockTrades(boolean blocked) {
this.blockTrades = blocked;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
public static class VillagerNPC extends CraftVillager implements NPCHolder {

View File

@ -49,6 +49,16 @@ public class WitchController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -141,6 +151,11 @@ public class WitchController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
public static class WitchNPC extends CraftWitch implements NPCHolder {

View File

@ -43,6 +43,16 @@ public class WitherController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
public boolean bL() {
if (npc == null)
@ -121,6 +131,11 @@ public class WitherController extends MobEntityController {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
private void updateAIWithMovement() {
NMS.updateAI(this);
// taken from EntityLiving update method

View File

@ -49,6 +49,16 @@ public class WolfController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -144,6 +154,11 @@ public class WolfController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
public static class WolfNPC extends CraftWolf implements NPCHolder {

View File

@ -49,6 +49,16 @@ public class ZombieController extends MobEntityController {
}
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
protected void b(float f) {
if (npc == null || !npc.isFlyable()) {
@ -142,6 +152,11 @@ public class ZombieController extends MobEntityController {
protected boolean isTypeNotPersistent() {
return npc == null ? super.isTypeNotPersistent() : false;
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
}
public static class ZombieNPC extends CraftZombie implements NPCHolder {