mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-28 12:07:38 +01:00
Initial working version of 1.9
This commit is contained in:
parent
31e83a904b
commit
07dbc46276
@ -16,6 +16,7 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.EntityBat;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -62,14 +63,16 @@ public class BatController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,8 +125,9 @@ public class BatController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -16,6 +16,7 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.EntityBlaze;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -61,14 +62,16 @@ public class BlazeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -121,8 +124,9 @@ public class BlazeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntityCaveSpider;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -70,14 +71,16 @@ public class CaveSpiderController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -146,8 +149,9 @@ public class CaveSpiderController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntityChicken;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -81,14 +82,16 @@ public class ChickenController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -157,8 +160,9 @@ public class ChickenController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntityCow;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -82,14 +83,16 @@ public class CowController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -158,8 +161,9 @@ public class CowController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -16,6 +16,7 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.EntityEnderDragon;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -61,14 +62,16 @@ public class EnderDragonController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -120,8 +123,9 @@ public class EnderDragonController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntityEnderman;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -70,14 +71,16 @@ public class EndermanController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -145,8 +148,9 @@ public class EndermanController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntityEndermite;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -70,14 +71,16 @@ public class EndermiteController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -145,8 +148,9 @@ public class EndermiteController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -3,6 +3,7 @@ package net.citizensnpcs.npc.entity;
|
||||
import java.io.IOException;
|
||||
import java.net.Socket;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -15,6 +16,7 @@ import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.citizensnpcs.Settings.Setting;
|
||||
@ -53,11 +55,13 @@ import net.minecraft.server.v1_9_R1.NetworkManager;
|
||||
import net.minecraft.server.v1_9_R1.Packet;
|
||||
import net.minecraft.server.v1_9_R1.PacketPlayOutEntityEquipment;
|
||||
import net.minecraft.server.v1_9_R1.PacketPlayOutEntityHeadRotation;
|
||||
import net.minecraft.server.v1_9_R1.PathType;
|
||||
import net.minecraft.server.v1_9_R1.PlayerInteractManager;
|
||||
import net.minecraft.server.v1_9_R1.WorldServer;
|
||||
import net.minecraft.server.v1_9_R1.WorldSettings.EnumGamemode;
|
||||
|
||||
public class EntityHumanNPC extends EntityPlayer implements NPCHolder, SkinnableEntity {
|
||||
private final Map<PathType, Float> bz = Maps.newEnumMap(PathType.class);
|
||||
private PlayerControllerJump controllerJump;
|
||||
private PlayerControllerLook controllerLook;
|
||||
private PlayerControllerMove controllerMove;
|
||||
@ -90,6 +94,14 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
}
|
||||
}
|
||||
|
||||
public float a(PathType pathtype) {
|
||||
return this.bz.containsKey(pathtype) ? this.bz.get(pathtype).floatValue() : pathtype.a();
|
||||
}
|
||||
|
||||
public void a(PathType pathtype, float f) {
|
||||
this.bz.put(pathtype, Float.valueOf(f));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_9_R1.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
@ -351,7 +363,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
if (updateCounter++ > Setting.PACKET_UPDATE_DELAY.asInt()) {
|
||||
updateCounter = 0;
|
||||
Location current = getBukkitEntity().getLocation(packetLocationCache);
|
||||
Packet<?>[] packets = new Packet[navigating ? 5 : 6];
|
||||
Packet<?>[] packets = new Packet[navigating ? EnumItemSlot.values().length
|
||||
: EnumItemSlot.values().length + 1];
|
||||
if (!navigating) {
|
||||
packets[5] = new PacketPlayOutEntityHeadRotation(this,
|
||||
(byte) MathHelper.d(NMS.getHeadYaw(this) * 256.0F / 360.0F));
|
||||
|
@ -16,6 +16,7 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.EntityGhast;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -47,14 +48,16 @@ public class GhastController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -111,8 +114,9 @@ public class GhastController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntityGiantZombie;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -56,14 +57,16 @@ public class GiantController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -131,8 +134,9 @@ public class GiantController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntityGuardian;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -56,14 +57,16 @@ public class GuardianController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -132,8 +135,9 @@ public class GuardianController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,6 +20,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntityHorse;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -76,14 +77,16 @@ public class HorseController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -160,8 +163,9 @@ public class HorseController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntityIronGolem;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -56,14 +57,16 @@ public class IronGolemController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -131,8 +134,9 @@ public class IronGolemController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@ import net.citizensnpcs.util.nms.PlayerControllerMove;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntityMagmaCube;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -59,14 +60,16 @@ public class MagmaCubeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -141,8 +144,9 @@ public class MagmaCubeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntityMushroomCow;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -68,14 +69,16 @@ public class MushroomCowController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -143,8 +146,9 @@ public class MushroomCowController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntityOcelot;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -67,14 +68,16 @@ public class OcelotController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,8 +145,9 @@ public class OcelotController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@ import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntityLightning;
|
||||
import net.minecraft.server.v1_9_R1.EntityPig;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -68,14 +69,16 @@ public class PigController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -144,8 +147,9 @@ public class PigController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntityPigZombie;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -57,14 +58,16 @@ public class PigZombieController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -133,8 +136,9 @@ public class PigZombieController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@ import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntityLiving;
|
||||
import net.minecraft.server.v1_9_R1.EntityRabbit;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -68,14 +69,16 @@ public class RabbitController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -144,8 +147,9 @@ public class RabbitController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntitySheep;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -67,14 +68,16 @@ public class SheepController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,8 +145,9 @@ public class SheepController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntitySilverfish;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -56,14 +57,16 @@ public class SilverfishController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -131,8 +134,9 @@ public class SilverfishController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntitySkeleton;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -56,14 +57,16 @@ public class SkeletonController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -131,8 +134,9 @@ public class SkeletonController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,6 +20,7 @@ import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntityHuman;
|
||||
import net.minecraft.server.v1_9_R1.EntitySlime;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -61,14 +62,16 @@ public class SlimeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -151,8 +154,9 @@ public class SlimeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntitySnowman;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -56,14 +57,16 @@ public class SnowmanController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -131,8 +134,9 @@ public class SnowmanController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntitySpider;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -56,14 +57,16 @@ public class SpiderController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -131,8 +134,9 @@ public class SpiderController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntitySquid;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -56,14 +57,16 @@ public class SquidController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -131,8 +134,9 @@ public class SquidController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@ import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntityHuman;
|
||||
import net.minecraft.server.v1_9_R1.EntityVillager;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -75,14 +76,16 @@ public class VillagerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -151,8 +154,9 @@ public class VillagerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntityWitch;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -56,14 +57,16 @@ public class WitchController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -131,8 +134,9 @@ public class WitchController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -16,6 +16,7 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.EntityWither;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -47,14 +48,16 @@ public class WitherController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -106,8 +109,9 @@ public class WitherController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntityWolf;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -67,14 +68,16 @@ public class WolfController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -143,8 +146,9 @@ public class WolfController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.EntityZombie;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_9_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_9_R1.SoundEffect;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
@ -56,14 +57,16 @@ public class ZombieController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bR() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bR()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.HURT_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bS() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bS()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bR()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -131,8 +134,9 @@ public class ZombieController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return (SoundEffect) (npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString()));
|
||||
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.G()
|
||||
: SoundEffect.a.get(new MinecraftKey(
|
||||
npc.data().get(NPC.AMBIENT_SOUND_METADATA, SoundEffect.a.b(super.G()).toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -7,7 +7,6 @@ import java.net.SocketAddress;
|
||||
import java.net.URL;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
@ -162,7 +161,7 @@ public class NMS {
|
||||
return;
|
||||
for (PathfinderGoalSelector selector : goalSelectors) {
|
||||
try {
|
||||
List<?> list = (List<?>) NMS.GOAL_FIELD.get(selector);
|
||||
Collection<?> list = (Collection<?>) NMS.GOAL_FIELD.get(selector);
|
||||
list.clear();
|
||||
} catch (Exception e) {
|
||||
Messaging.logTr(Messages.ERROR_CLEARING_GOALS, e.getLocalizedMessage());
|
||||
@ -824,7 +823,7 @@ public class NMS {
|
||||
}
|
||||
|
||||
public static void updateNavigation(NavigationAbstract navigation) {
|
||||
navigation.k();
|
||||
navigation.l();
|
||||
}
|
||||
|
||||
public static void updateNavigationWorld(org.bukkit.entity.Entity entity, org.bukkit.World world) {
|
||||
@ -877,7 +876,7 @@ public class NMS {
|
||||
private static Field NAVIGATION_WORLD_FIELD = getField(NavigationAbstract.class, "b");
|
||||
private static Field NETWORK_ADDRESS = getField(NetworkManager.class, "l");
|
||||
private static final Location PACKET_CACHE_LOCATION = new Location(null, 0, 0, 0);
|
||||
private static Field PATHFINDING_RANGE = getField(NavigationAbstract.class, "o");
|
||||
private static Field PATHFINDING_RANGE = getField(NavigationAbstract.class, "g");
|
||||
private static final Field RABBIT_FIELD = getField(EntityRabbit.class, "bv");
|
||||
private static final Random RANDOM = Util.getFastRandom();
|
||||
private static Field SKULL_PROFILE_FIELD;
|
||||
|
@ -18,17 +18,12 @@ import net.minecraft.server.v1_9_R1.PathEntity;
|
||||
import net.minecraft.server.v1_9_R1.PathPoint;
|
||||
import net.minecraft.server.v1_9_R1.PathType;
|
||||
import net.minecraft.server.v1_9_R1.Pathfinder;
|
||||
import net.minecraft.server.v1_9_R1.PathfinderAbstract;
|
||||
import net.minecraft.server.v1_9_R1.PathfinderNormal;
|
||||
import net.minecraft.server.v1_9_R1.Vec3D;
|
||||
import net.minecraft.server.v1_9_R1.World;
|
||||
|
||||
public class PlayerNavigation extends NavigationAbstract {
|
||||
protected EntityHumanNPC a;
|
||||
protected World b;
|
||||
protected PathEntity c;
|
||||
protected double d;
|
||||
protected PathfinderAbstract e;
|
||||
protected PlayerPathfinderNormal e;
|
||||
private boolean f2;
|
||||
private final AttributeInstance g;
|
||||
private int h;
|
||||
@ -42,23 +37,23 @@ public class PlayerNavigation extends NavigationAbstract {
|
||||
private boolean p;
|
||||
private long q;
|
||||
private BlockPosition r;
|
||||
private final Pathfinder s;
|
||||
private final PlayerPathfinder s;
|
||||
|
||||
public PlayerNavigation(EntityHumanNPC entityinsentient, World world) {
|
||||
super(getDummyInsentient(entityinsentient), world);
|
||||
super(getDummyInsentient(entityinsentient, world), world);
|
||||
this.a = entityinsentient;
|
||||
this.b = world;
|
||||
this.g = entityinsentient.getAttributeInstance(GenericAttributes.FOLLOW_RANGE);
|
||||
this.g.setValue(24);
|
||||
this.s = a();
|
||||
this.e = new PlayerPathfinderNormal();
|
||||
this.e.a(true);
|
||||
this.s = new PlayerPathfinder(this.e);
|
||||
this.b.C().a(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Pathfinder a() {
|
||||
this.e = new PathfinderNormal();
|
||||
this.e.a(true);
|
||||
return new Pathfinder(this.e);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -503,8 +498,8 @@ public class PlayerNavigation extends NavigationAbstract {
|
||||
this.g.setValue(pathfindingRange);
|
||||
}
|
||||
|
||||
private static EntityInsentient getDummyInsentient(EntityHumanNPC from) {
|
||||
return new EntityInsentient(null) {
|
||||
private static EntityInsentient getDummyInsentient(EntityHumanNPC from, World world) {
|
||||
return new EntityInsentient(world) {
|
||||
};
|
||||
}
|
||||
|
||||
|
121
src/main/java/net/citizensnpcs/util/nms/PlayerPathfinder.java
Normal file
121
src/main/java/net/citizensnpcs/util/nms/PlayerPathfinder.java
Normal file
@ -0,0 +1,121 @@
|
||||
package net.citizensnpcs.util.nms;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.citizensnpcs.npc.entity.EntityHumanNPC;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.Entity;
|
||||
import net.minecraft.server.v1_9_R1.IBlockAccess;
|
||||
import net.minecraft.server.v1_9_R1.Path;
|
||||
import net.minecraft.server.v1_9_R1.PathEntity;
|
||||
import net.minecraft.server.v1_9_R1.PathPoint;
|
||||
|
||||
public class PlayerPathfinder {
|
||||
private final Path a = new Path();
|
||||
private final Set<PathPoint> b = new HashSet<PathPoint>();
|
||||
private final PathPoint[] c = new PathPoint[32];
|
||||
private final PlayerPathfinderNormal d;
|
||||
|
||||
public PlayerPathfinder(PlayerPathfinderNormal paramPathfinderAbstract) {
|
||||
this.d = paramPathfinderAbstract;
|
||||
}
|
||||
|
||||
public PathEntity a(IBlockAccess paramIBlockAccess, EntityHumanNPC paramEntityInsentient,
|
||||
BlockPosition paramBlockPosition, float paramFloat) {
|
||||
return a(paramIBlockAccess, paramEntityInsentient, paramBlockPosition.getX() + 0.5F,
|
||||
paramBlockPosition.getY() + 0.5F, paramBlockPosition.getZ() + 0.5F, paramFloat);
|
||||
}
|
||||
|
||||
private PathEntity a(IBlockAccess paramIBlockAccess, EntityHumanNPC paramEntityInsentient, double paramDouble1,
|
||||
double paramDouble2, double paramDouble3, float paramFloat) {
|
||||
this.a.a();
|
||||
this.d.a(paramIBlockAccess, paramEntityInsentient);
|
||||
PathPoint localPathPoint1 = this.d.b();
|
||||
PathPoint localPathPoint2 = this.d.a(paramDouble1, paramDouble2, paramDouble3);
|
||||
|
||||
PathEntity localPathEntity = a(localPathPoint1, localPathPoint2, paramFloat);
|
||||
|
||||
this.d.a();
|
||||
return localPathEntity;
|
||||
}
|
||||
|
||||
public PathEntity a(IBlockAccess paramIBlockAccess, EntityHumanNPC paramEntityInsentient, Entity paramEntity,
|
||||
float paramFloat) {
|
||||
return a(paramIBlockAccess, paramEntityInsentient, paramEntity.locX, paramEntity.getBoundingBox().b,
|
||||
paramEntity.locZ, paramFloat);
|
||||
}
|
||||
|
||||
private PathEntity a(PathPoint paramPathPoint1, PathPoint paramPathPoint2) {
|
||||
int i = 1;
|
||||
PathPoint localPathPoint = paramPathPoint2;
|
||||
while (localPathPoint.h != null) {
|
||||
i++;
|
||||
localPathPoint = localPathPoint.h;
|
||||
}
|
||||
PathPoint[] arrayOfPathPoint = new PathPoint[i];
|
||||
localPathPoint = paramPathPoint2;
|
||||
arrayOfPathPoint[(--i)] = localPathPoint;
|
||||
while (localPathPoint.h != null) {
|
||||
localPathPoint = localPathPoint.h;
|
||||
arrayOfPathPoint[(--i)] = localPathPoint;
|
||||
}
|
||||
return new PathEntity(arrayOfPathPoint);
|
||||
}
|
||||
|
||||
private PathEntity a(PathPoint paramPathPoint1, PathPoint paramPathPoint2, float paramFloat) {
|
||||
paramPathPoint1.e = 0.0F;
|
||||
paramPathPoint1.f = paramPathPoint1.c(paramPathPoint2);
|
||||
paramPathPoint1.g = paramPathPoint1.f;
|
||||
|
||||
this.a.a();
|
||||
this.b.clear();
|
||||
this.a.a(paramPathPoint1);
|
||||
|
||||
Object localObject1 = paramPathPoint1;
|
||||
int i = 0;
|
||||
while (!this.a.e()) {
|
||||
i++;
|
||||
if (i >= 2000) {
|
||||
break;
|
||||
}
|
||||
PathPoint localObject2 = this.a.c();
|
||||
if (localObject2.equals(paramPathPoint2)) {
|
||||
localObject1 = paramPathPoint2;
|
||||
break;
|
||||
}
|
||||
if (localObject2.c(paramPathPoint2) < ((PathPoint) localObject1).c(paramPathPoint2)) {
|
||||
localObject1 = localObject2;
|
||||
}
|
||||
localObject2.i = true;
|
||||
|
||||
int j = this.d.a(this.c, localObject2, paramPathPoint2, paramFloat);
|
||||
for (int k = 0; k < j; k++) {
|
||||
PathPoint localPathPoint = this.c[k];
|
||||
|
||||
float f1 = localObject2.c(localPathPoint);
|
||||
localPathPoint.j = (localObject2.j + f1);
|
||||
localPathPoint.k = (f1 + localPathPoint.l);
|
||||
|
||||
float f2 = localObject2.e + localPathPoint.k;
|
||||
if ((localPathPoint.j < paramFloat) && ((!localPathPoint.a()) || (f2 < localPathPoint.e))) {
|
||||
localPathPoint.h = (localObject2);
|
||||
localPathPoint.e = f2;
|
||||
localPathPoint.f = (localPathPoint.c(paramPathPoint2) + localPathPoint.l);
|
||||
if (localPathPoint.a()) {
|
||||
this.a.a(localPathPoint, localPathPoint.e + localPathPoint.f);
|
||||
} else {
|
||||
localPathPoint.g = (localPathPoint.e + localPathPoint.f);
|
||||
this.a.a(localPathPoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (localObject1 == paramPathPoint1) {
|
||||
return null;
|
||||
}
|
||||
Object localObject2 = a(paramPathPoint1, (PathPoint) localObject1);
|
||||
|
||||
return (PathEntity) localObject2;
|
||||
}
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
package net.citizensnpcs.util.nms;
|
||||
|
||||
import net.citizensnpcs.npc.entity.EntityHumanNPC;
|
||||
import net.minecraft.server.v1_9_R1.EntityInsentient;
|
||||
import net.minecraft.server.v1_9_R1.IBlockAccess;
|
||||
import net.minecraft.server.v1_9_R1.IntHashMap;
|
||||
import net.minecraft.server.v1_9_R1.MathHelper;
|
||||
import net.minecraft.server.v1_9_R1.PathPoint;
|
||||
import net.minecraft.server.v1_9_R1.PathType;
|
||||
import net.minecraft.server.v1_9_R1.PathfinderAbstract;
|
||||
|
||||
public abstract class PlayerPathfinderAbstract extends PathfinderAbstract {
|
||||
protected IBlockAccess a;
|
||||
protected EntityHumanNPC b;
|
||||
protected final IntHashMap<PathPoint> c = new IntHashMap();
|
||||
protected int d;
|
||||
protected int e;
|
||||
protected int f;
|
||||
protected boolean g;
|
||||
protected boolean h;
|
||||
protected boolean i;
|
||||
|
||||
public void a() {
|
||||
}
|
||||
|
||||
public void a(boolean paramBoolean) {
|
||||
this.g = paramBoolean;
|
||||
}
|
||||
|
||||
public abstract PathPoint a(double paramDouble1, double paramDouble2, double paramDouble3);
|
||||
|
||||
public void a(IBlockAccess paramIBlockAccess, EntityHumanNPC paramEntityInsentient) {
|
||||
this.a = paramIBlockAccess;
|
||||
this.b = paramEntityInsentient;
|
||||
this.c.c();
|
||||
|
||||
this.d = MathHelper.d(paramEntityInsentient.width + 1.0F);
|
||||
this.e = MathHelper.d(paramEntityInsentient.length + 1.0F);
|
||||
this.f = MathHelper.d(paramEntityInsentient.width + 1.0F);
|
||||
}
|
||||
|
||||
public abstract PathType a(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3,
|
||||
EntityHumanNPC paramEntityInsentient, int paramInt4, int paramInt5, int paramInt6, boolean paramBoolean1,
|
||||
boolean paramBoolean2);
|
||||
|
||||
public abstract PathType a(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3,
|
||||
EntityInsentient paramEntityInsentient, int paramInt4, int paramInt5, int paramInt6, boolean paramBoolean1,
|
||||
boolean paramBoolean2);
|
||||
|
||||
protected PathPoint a(int paramInt1, int paramInt2, int paramInt3) {
|
||||
int j = PathPoint.b(paramInt1, paramInt2, paramInt3);
|
||||
PathPoint localPathPoint = this.c.get(j);
|
||||
if (localPathPoint == null) {
|
||||
localPathPoint = new PathPoint(paramInt1, paramInt2, paramInt3);
|
||||
this.c.a(j, localPathPoint);
|
||||
}
|
||||
return localPathPoint;
|
||||
}
|
||||
|
||||
public abstract int a(PathPoint[] paramArrayOfPathPoint, PathPoint paramPathPoint1, PathPoint paramPathPoint2,
|
||||
float paramFloat);
|
||||
|
||||
public abstract PathPoint b();
|
||||
|
||||
public void b(boolean paramBoolean) {
|
||||
this.h = paramBoolean;
|
||||
}
|
||||
|
||||
public boolean c() {
|
||||
return this.g;
|
||||
}
|
||||
|
||||
public void c(boolean paramBoolean) {
|
||||
this.i = paramBoolean;
|
||||
}
|
||||
|
||||
public boolean d() {
|
||||
return this.h;
|
||||
}
|
||||
|
||||
public boolean e() {
|
||||
return this.i;
|
||||
}
|
||||
}
|
@ -0,0 +1,430 @@
|
||||
package net.citizensnpcs.util.nms;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashSet;
|
||||
|
||||
import net.citizensnpcs.npc.entity.EntityHumanNPC;
|
||||
import net.minecraft.server.v1_9_R1.AxisAlignedBB;
|
||||
import net.minecraft.server.v1_9_R1.Block;
|
||||
import net.minecraft.server.v1_9_R1.BlockCobbleWall;
|
||||
import net.minecraft.server.v1_9_R1.BlockDoor;
|
||||
import net.minecraft.server.v1_9_R1.BlockFence;
|
||||
import net.minecraft.server.v1_9_R1.BlockFenceGate;
|
||||
import net.minecraft.server.v1_9_R1.BlockMinecartTrackAbstract;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.BlockPosition.MutableBlockPosition;
|
||||
import net.minecraft.server.v1_9_R1.Blocks;
|
||||
import net.minecraft.server.v1_9_R1.EntityInsentient;
|
||||
import net.minecraft.server.v1_9_R1.EnumDirection;
|
||||
import net.minecraft.server.v1_9_R1.IBlockAccess;
|
||||
import net.minecraft.server.v1_9_R1.IBlockData;
|
||||
import net.minecraft.server.v1_9_R1.Material;
|
||||
import net.minecraft.server.v1_9_R1.MathHelper;
|
||||
import net.minecraft.server.v1_9_R1.PathPoint;
|
||||
import net.minecraft.server.v1_9_R1.PathType;
|
||||
|
||||
public class PlayerPathfinderNormal extends PlayerPathfinderAbstract {
|
||||
private float j;
|
||||
|
||||
@Override
|
||||
public void a() {
|
||||
super.a();
|
||||
this.b.a(PathType.WATER, this.j);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PathPoint a(double paramDouble1, double paramDouble2, double paramDouble3) {
|
||||
return a(MathHelper.floor(paramDouble1 - this.b.width / 2.0F), MathHelper.floor(paramDouble2),
|
||||
MathHelper.floor(paramDouble3 - this.b.width / 2.0F));
|
||||
}
|
||||
|
||||
private PathType a(EntityHumanNPC paramEntityInsentient, BlockPosition paramBlockPosition) {
|
||||
return a(this.a, paramBlockPosition.getX(), paramBlockPosition.getY(), paramBlockPosition.getZ(),
|
||||
paramEntityInsentient, this.d, this.e, this.f, d(), c());
|
||||
}
|
||||
|
||||
private PathType a(EntityHumanNPC paramEntityInsentient, int paramInt1, int paramInt2, int paramInt3) {
|
||||
return a(this.a, paramInt1, paramInt2, paramInt3, paramEntityInsentient, this.d, this.e, this.f, d(), c());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(IBlockAccess paramIBlockAccess, EntityHumanNPC paramEntityInsentient) {
|
||||
super.a(paramIBlockAccess, paramEntityInsentient);
|
||||
this.j = paramEntityInsentient.a(PathType.WATER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PathType a(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3,
|
||||
EntityHumanNPC paramEntityInsentient, int paramInt4, int paramInt5, int paramInt6, boolean paramBoolean1,
|
||||
boolean paramBoolean2) {
|
||||
EnumSet<PathType> localEnumSet = EnumSet.noneOf(PathType.class);
|
||||
Object localObject1 = PathType.BLOCKED;
|
||||
|
||||
double d = paramEntityInsentient.width / 2.0D;
|
||||
BlockPosition localBlockPosition = new BlockPosition(paramEntityInsentient);
|
||||
for (int i = paramInt1; i < paramInt1 + paramInt4; i++) {
|
||||
for (int k = paramInt2; k < paramInt2 + paramInt5; k++) {
|
||||
for (int m = paramInt3; m < paramInt3 + paramInt6; m++) {
|
||||
PathType localPathType2 = a(paramIBlockAccess, i, k, m);
|
||||
if ((localPathType2 == PathType.DOOR_WOOD_CLOSED) && (paramBoolean1) && (paramBoolean2)) {
|
||||
localPathType2 = PathType.WALKABLE;
|
||||
}
|
||||
if ((localPathType2 == PathType.DOOR_OPEN) && (!paramBoolean2)) {
|
||||
localPathType2 = PathType.BLOCKED;
|
||||
}
|
||||
if ((localPathType2 == PathType.RAIL)
|
||||
&& (!(paramIBlockAccess.getType(localBlockPosition)
|
||||
.getBlock() instanceof BlockMinecartTrackAbstract))
|
||||
&& (!(paramIBlockAccess.getType(localBlockPosition.down())
|
||||
.getBlock() instanceof BlockMinecartTrackAbstract))) {
|
||||
localPathType2 = PathType.FENCE;
|
||||
}
|
||||
if ((i == paramInt1) && (k == paramInt2) && (m == paramInt3)) {
|
||||
localObject1 = localPathType2;
|
||||
}
|
||||
if ((k > paramInt2) && (localPathType2 != PathType.OPEN)) {
|
||||
AxisAlignedBB localAxisAlignedBB = new AxisAlignedBB(i - d + 0.5D, paramInt2 + 0.001D,
|
||||
m - d + 0.5D, i + d + 0.5D, paramInt2 + paramEntityInsentient.length, m + d + 0.5D);
|
||||
if (!paramEntityInsentient.world.b(localAxisAlignedBB)) {
|
||||
localPathType2 = PathType.OPEN;
|
||||
}
|
||||
}
|
||||
localEnumSet.add(localPathType2);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (localEnumSet.contains(PathType.FENCE)) {
|
||||
return PathType.FENCE;
|
||||
}
|
||||
Object localObject2 = PathType.BLOCKED;
|
||||
for (PathType localPathType1 : localEnumSet) {
|
||||
if (paramEntityInsentient.a(localPathType1) < 0.0F) {
|
||||
return localPathType1;
|
||||
}
|
||||
if (paramEntityInsentient.a(localPathType1) >= paramEntityInsentient.a((PathType) localObject2)) {
|
||||
localObject2 = localPathType1;
|
||||
}
|
||||
}
|
||||
if ((localObject1 == PathType.OPEN) && (paramEntityInsentient.a((PathType) localObject2) == 0.0F)) {
|
||||
return PathType.OPEN;
|
||||
}
|
||||
return (PathType) localObject2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PathType a(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3,
|
||||
EntityInsentient paramEntityInsentient, int paramInt4, int paramInt5, int paramInt6, boolean paramBoolean1,
|
||||
boolean paramBoolean2) {
|
||||
EnumSet<PathType> localEnumSet = EnumSet.noneOf(PathType.class);
|
||||
Object localObject1 = PathType.BLOCKED;
|
||||
|
||||
double d = paramEntityInsentient.width / 2.0D;
|
||||
BlockPosition localBlockPosition = new BlockPosition(paramEntityInsentient);
|
||||
for (int i = paramInt1; i < paramInt1 + paramInt4; i++) {
|
||||
for (int k = paramInt2; k < paramInt2 + paramInt5; k++) {
|
||||
for (int m = paramInt3; m < paramInt3 + paramInt6; m++) {
|
||||
PathType localPathType2 = a(paramIBlockAccess, i, k, m);
|
||||
if ((localPathType2 == PathType.DOOR_WOOD_CLOSED) && (paramBoolean1) && (paramBoolean2)) {
|
||||
localPathType2 = PathType.WALKABLE;
|
||||
}
|
||||
if ((localPathType2 == PathType.DOOR_OPEN) && (!paramBoolean2)) {
|
||||
localPathType2 = PathType.BLOCKED;
|
||||
}
|
||||
if ((localPathType2 == PathType.RAIL)
|
||||
&& (!(paramIBlockAccess.getType(localBlockPosition)
|
||||
.getBlock() instanceof BlockMinecartTrackAbstract))
|
||||
&& (!(paramIBlockAccess.getType(localBlockPosition.down())
|
||||
.getBlock() instanceof BlockMinecartTrackAbstract))) {
|
||||
localPathType2 = PathType.FENCE;
|
||||
}
|
||||
if ((i == paramInt1) && (k == paramInt2) && (m == paramInt3)) {
|
||||
localObject1 = localPathType2;
|
||||
}
|
||||
if ((k > paramInt2) && (localPathType2 != PathType.OPEN)) {
|
||||
AxisAlignedBB localAxisAlignedBB = new AxisAlignedBB(i - d + 0.5D, paramInt2 + 0.001D,
|
||||
m - d + 0.5D, i + d + 0.5D, paramInt2 + paramEntityInsentient.length, m + d + 0.5D);
|
||||
if (!paramEntityInsentient.world.b(localAxisAlignedBB)) {
|
||||
localPathType2 = PathType.OPEN;
|
||||
}
|
||||
}
|
||||
localEnumSet.add(localPathType2);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (localEnumSet.contains(PathType.FENCE)) {
|
||||
return PathType.FENCE;
|
||||
}
|
||||
Object localObject2 = PathType.BLOCKED;
|
||||
for (PathType localPathType1 : localEnumSet) {
|
||||
if (paramEntityInsentient.a(localPathType1) < 0.0F) {
|
||||
return localPathType1;
|
||||
}
|
||||
if (paramEntityInsentient.a(localPathType1) >= paramEntityInsentient.a((PathType) localObject2)) {
|
||||
localObject2 = localPathType1;
|
||||
}
|
||||
}
|
||||
if ((localObject1 == PathType.OPEN) && (paramEntityInsentient.a((PathType) localObject2) == 0.0F)) {
|
||||
return PathType.OPEN;
|
||||
}
|
||||
return (PathType) localObject2;
|
||||
}
|
||||
|
||||
private PathPoint a(int paramInt1, int paramInt2, int paramInt3, int paramInt4, double paramDouble,
|
||||
EnumDirection paramEnumDirection) {
|
||||
PathPoint localPathPoint = null;
|
||||
|
||||
BlockPosition localBlockPosition1 = new BlockPosition(paramInt1, paramInt2, paramInt3);
|
||||
BlockPosition localBlockPosition2 = localBlockPosition1.down();
|
||||
double d1 = paramInt2 - (1.0D - this.a.getType(localBlockPosition2).c(this.a, localBlockPosition2).e);
|
||||
if (d1 - paramDouble > 1.0D) {
|
||||
return null;
|
||||
}
|
||||
PathType localPathType = a(this.b, paramInt1, paramInt2, paramInt3);
|
||||
float f = this.b.a(localPathType);
|
||||
double d2 = this.b.width / 2.0D;
|
||||
if (f >= 0.0F) {
|
||||
localPathPoint = a(paramInt1, paramInt2, paramInt3);
|
||||
localPathPoint.m = localPathType;
|
||||
localPathPoint.l = Math.max(localPathPoint.l, f);
|
||||
}
|
||||
if (localPathType == PathType.WALKABLE) {
|
||||
return localPathPoint;
|
||||
}
|
||||
if ((localPathPoint == null) && (paramInt4 > 0) && (localPathType != PathType.FENCE)
|
||||
&& (localPathType != PathType.TRAPDOOR)) {
|
||||
localPathPoint = a(paramInt1, paramInt2 + 1, paramInt3, paramInt4 - 1, paramDouble, paramEnumDirection);
|
||||
if ((localPathPoint != null)
|
||||
&& ((localPathPoint.m == PathType.OPEN) || (localPathPoint.m == PathType.WALKABLE))) {
|
||||
double d3 = paramInt1 - paramEnumDirection.getAdjacentX() + 0.5D;
|
||||
double d4 = paramInt3 - paramEnumDirection.getAdjacentZ() + 0.5D;
|
||||
|
||||
AxisAlignedBB localAxisAlignedBB1 = new AxisAlignedBB(d3 - d2, paramInt2 + 0.001D, d4 - d2, d3 + d2,
|
||||
paramInt2 + this.b.length, d4 + d2);
|
||||
AxisAlignedBB localAxisAlignedBB2 = this.a.getType(localBlockPosition1).c(this.a, localBlockPosition1);
|
||||
|
||||
AxisAlignedBB localAxisAlignedBB3 = localAxisAlignedBB1.a(0.0D, localAxisAlignedBB2.e - 0.002D, 0.0D);
|
||||
if (this.b.world.b(localAxisAlignedBB3)) {
|
||||
localPathPoint = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (localPathType == PathType.OPEN) {
|
||||
AxisAlignedBB localAxisAlignedBB4 = new AxisAlignedBB(paramInt1 - d2 + 0.5D, paramInt2 + 0.001D,
|
||||
paramInt3 - d2 + 0.5D, paramInt1 + d2 + 0.5D, paramInt2 + this.b.length, paramInt3 + d2 + 0.5D);
|
||||
if (this.b.world.b(localAxisAlignedBB4)) {
|
||||
return null;
|
||||
}
|
||||
int i = 0;
|
||||
while ((paramInt2 > 0) && (localPathType == PathType.OPEN)) {
|
||||
paramInt2--;
|
||||
if (i++ >= this.b.aW()) {
|
||||
return null;
|
||||
}
|
||||
localPathType = a(this.b, paramInt1, paramInt2, paramInt3);
|
||||
f = this.b.a(localPathType);
|
||||
if ((localPathType != PathType.OPEN) && (f >= 0.0F)) {
|
||||
localPathPoint = a(paramInt1, paramInt2, paramInt3);
|
||||
localPathPoint.m = localPathType;
|
||||
localPathPoint.l = Math.max(localPathPoint.l, f);
|
||||
} else if (f < 0.0F) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return localPathPoint;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int a(PathPoint[] paramArrayOfPathPoint, PathPoint paramPathPoint1, PathPoint paramPathPoint2,
|
||||
float paramFloat) {
|
||||
int i = 0;
|
||||
|
||||
int k = 0;
|
||||
PathType localPathType = a(this.b, paramPathPoint1.a, paramPathPoint1.b + 1, paramPathPoint1.c);
|
||||
if (this.b.a(localPathType) >= 0.0F) {
|
||||
k = 1;
|
||||
}
|
||||
BlockPosition localBlockPosition = new BlockPosition(paramPathPoint1.a, paramPathPoint1.b, paramPathPoint1.c)
|
||||
.down();
|
||||
double d = paramPathPoint1.b - (1.0D - this.a.getType(localBlockPosition).c(this.a, localBlockPosition).e);
|
||||
|
||||
PathPoint localPathPoint1 = a(paramPathPoint1.a, paramPathPoint1.b, paramPathPoint1.c + 1, k, d,
|
||||
EnumDirection.SOUTH);
|
||||
PathPoint localPathPoint2 = a(paramPathPoint1.a - 1, paramPathPoint1.b, paramPathPoint1.c, k, d,
|
||||
EnumDirection.WEST);
|
||||
PathPoint localPathPoint3 = a(paramPathPoint1.a + 1, paramPathPoint1.b, paramPathPoint1.c, k, d,
|
||||
EnumDirection.EAST);
|
||||
PathPoint localPathPoint4 = a(paramPathPoint1.a, paramPathPoint1.b, paramPathPoint1.c - 1, k, d,
|
||||
EnumDirection.NORTH);
|
||||
if ((localPathPoint1 != null) && (!localPathPoint1.i) && (localPathPoint1.a(paramPathPoint2) < paramFloat)) {
|
||||
paramArrayOfPathPoint[(i++)] = localPathPoint1;
|
||||
}
|
||||
if ((localPathPoint2 != null) && (!localPathPoint2.i) && (localPathPoint2.a(paramPathPoint2) < paramFloat)) {
|
||||
paramArrayOfPathPoint[(i++)] = localPathPoint2;
|
||||
}
|
||||
if ((localPathPoint3 != null) && (!localPathPoint3.i) && (localPathPoint3.a(paramPathPoint2) < paramFloat)) {
|
||||
paramArrayOfPathPoint[(i++)] = localPathPoint3;
|
||||
}
|
||||
if ((localPathPoint4 != null) && (!localPathPoint4.i) && (localPathPoint4.a(paramPathPoint2) < paramFloat)) {
|
||||
paramArrayOfPathPoint[(i++)] = localPathPoint4;
|
||||
}
|
||||
int m = (localPathPoint4 == null) || (localPathPoint4.m == PathType.OPEN) || (localPathPoint4.l != 0.0F) ? 1
|
||||
: 0;
|
||||
int n = (localPathPoint1 == null) || (localPathPoint1.m == PathType.OPEN) || (localPathPoint1.l != 0.0F) ? 1
|
||||
: 0;
|
||||
int i1 = (localPathPoint3 == null) || (localPathPoint3.m == PathType.OPEN) || (localPathPoint3.l != 0.0F) ? 1
|
||||
: 0;
|
||||
int i2 = (localPathPoint2 == null) || (localPathPoint2.m == PathType.OPEN) || (localPathPoint2.l != 0.0F) ? 1
|
||||
: 0;
|
||||
PathPoint localPathPoint5;
|
||||
if ((m != 0) && (i2 != 0)) {
|
||||
localPathPoint5 = a(paramPathPoint1.a - 1, paramPathPoint1.b, paramPathPoint1.c - 1, k, d,
|
||||
EnumDirection.NORTH);
|
||||
if ((localPathPoint5 != null) && (!localPathPoint5.i)
|
||||
&& (localPathPoint5.a(paramPathPoint2) < paramFloat)) {
|
||||
paramArrayOfPathPoint[(i++)] = localPathPoint5;
|
||||
}
|
||||
}
|
||||
if ((m != 0) && (i1 != 0)) {
|
||||
localPathPoint5 = a(paramPathPoint1.a + 1, paramPathPoint1.b, paramPathPoint1.c - 1, k, d,
|
||||
EnumDirection.NORTH);
|
||||
if ((localPathPoint5 != null) && (!localPathPoint5.i)
|
||||
&& (localPathPoint5.a(paramPathPoint2) < paramFloat)) {
|
||||
paramArrayOfPathPoint[(i++)] = localPathPoint5;
|
||||
}
|
||||
}
|
||||
if ((n != 0) && (i2 != 0)) {
|
||||
localPathPoint5 = a(paramPathPoint1.a - 1, paramPathPoint1.b, paramPathPoint1.c + 1, k, d,
|
||||
EnumDirection.SOUTH);
|
||||
if ((localPathPoint5 != null) && (!localPathPoint5.i)
|
||||
&& (localPathPoint5.a(paramPathPoint2) < paramFloat)) {
|
||||
paramArrayOfPathPoint[(i++)] = localPathPoint5;
|
||||
}
|
||||
}
|
||||
if ((n != 0) && (i1 != 0)) {
|
||||
localPathPoint5 = a(paramPathPoint1.a + 1, paramPathPoint1.b, paramPathPoint1.c + 1, k, d,
|
||||
EnumDirection.SOUTH);
|
||||
if ((localPathPoint5 != null) && (!localPathPoint5.i)
|
||||
&& (localPathPoint5.a(paramPathPoint2) < paramFloat)) {
|
||||
paramArrayOfPathPoint[(i++)] = localPathPoint5;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PathPoint b() {
|
||||
int i;
|
||||
BlockPosition localObject1;
|
||||
if ((e()) && (this.b.isInWater())) {
|
||||
i = (int) this.b.getBoundingBox().b;
|
||||
localObject1 = new BlockPosition.MutableBlockPosition(MathHelper.floor(this.b.locX), i,
|
||||
MathHelper.floor(this.b.locZ));
|
||||
Block localObject2 = this.a.getType(localObject1).getBlock();
|
||||
while ((localObject2 == Blocks.FLOWING_WATER) || (localObject2 == Blocks.WATER)) {
|
||||
i++;
|
||||
((MutableBlockPosition) localObject1).c(MathHelper.floor(this.b.locX), i,
|
||||
MathHelper.floor(this.b.locZ));
|
||||
localObject2 = this.a.getType(localObject1).getBlock();
|
||||
}
|
||||
} else if (!this.b.onGround) {
|
||||
localObject1 = new BlockPosition(this.b);
|
||||
while (((this.a.getType(localObject1).getMaterial() == Material.AIR)
|
||||
|| (this.a.getType(localObject1).getBlock().b(this.a, localObject1)))
|
||||
&& (localObject1.getY() > 0)) {
|
||||
localObject1 = localObject1.down();
|
||||
}
|
||||
i = localObject1.up().getY();
|
||||
} else {
|
||||
i = MathHelper.floor(this.b.getBoundingBox().b + 0.5D);
|
||||
}
|
||||
localObject1 = new BlockPosition(this.b);
|
||||
Object localObject2 = a(this.b, localObject1.getX(), i, localObject1.getZ());
|
||||
if (this.b.a((PathType) localObject2) < 0.0F) {
|
||||
HashSet<BlockPosition> localHashSet = new HashSet();
|
||||
localHashSet.add(new BlockPosition(this.b.getBoundingBox().a, i, this.b.getBoundingBox().c));
|
||||
localHashSet.add(new BlockPosition(this.b.getBoundingBox().a, i, this.b.getBoundingBox().f));
|
||||
localHashSet.add(new BlockPosition(this.b.getBoundingBox().d, i, this.b.getBoundingBox().c));
|
||||
localHashSet.add(new BlockPosition(this.b.getBoundingBox().d, i, this.b.getBoundingBox().f));
|
||||
for (BlockPosition localBlockPosition : localHashSet) {
|
||||
PathType localPathType = a(this.b, localBlockPosition);
|
||||
if (this.b.a(localPathType) >= 0.0F) {
|
||||
return a(localBlockPosition.getX(), localBlockPosition.getY(), localBlockPosition.getZ());
|
||||
}
|
||||
}
|
||||
}
|
||||
return a(localObject1.getX(), i, localObject1.getZ());
|
||||
}
|
||||
|
||||
public static PathType a(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3) {
|
||||
BlockPosition localBlockPosition = new BlockPosition(paramInt1, paramInt2, paramInt3);
|
||||
IBlockData localIBlockData = paramIBlockAccess.getType(localBlockPosition);
|
||||
Block localBlock1 = localIBlockData.getBlock();
|
||||
Material localMaterial = localIBlockData.getMaterial();
|
||||
|
||||
PathType localPathType1 = PathType.BLOCKED;
|
||||
if ((localBlock1 == Blocks.TRAPDOOR) || (localBlock1 == Blocks.IRON_TRAPDOOR)
|
||||
|| (localBlock1 == Blocks.WATERLILY)) {
|
||||
return PathType.TRAPDOOR;
|
||||
}
|
||||
if (localBlock1 == Blocks.FIRE) {
|
||||
return PathType.DAMAGE_FIRE;
|
||||
}
|
||||
if (localBlock1 == Blocks.CACTUS) {
|
||||
return PathType.DAMAGE_CACTUS;
|
||||
}
|
||||
if (((localBlock1 instanceof BlockDoor)) && (localMaterial == Material.WOOD)
|
||||
&& (!localIBlockData.get(BlockDoor.OPEN).booleanValue())) {
|
||||
return PathType.DOOR_WOOD_CLOSED;
|
||||
}
|
||||
if (((localBlock1 instanceof BlockDoor)) && (localMaterial == Material.ORE)
|
||||
&& (!localIBlockData.get(BlockDoor.OPEN).booleanValue())) {
|
||||
return PathType.DOOR_IRON_CLOSED;
|
||||
}
|
||||
if (((localBlock1 instanceof BlockDoor)) && (localIBlockData.get(BlockDoor.OPEN).booleanValue())) {
|
||||
return PathType.DOOR_OPEN;
|
||||
}
|
||||
if ((localBlock1 instanceof BlockMinecartTrackAbstract)) {
|
||||
return PathType.RAIL;
|
||||
}
|
||||
if (((localBlock1 instanceof BlockFence)) || ((localBlock1 instanceof BlockCobbleWall))
|
||||
|| (((localBlock1 instanceof BlockFenceGate))
|
||||
&& (!localIBlockData.get(BlockFenceGate.OPEN).booleanValue()))) {
|
||||
return PathType.FENCE;
|
||||
}
|
||||
if (localMaterial == Material.AIR) {
|
||||
localPathType1 = PathType.OPEN;
|
||||
} else {
|
||||
if (localMaterial == Material.WATER) {
|
||||
return PathType.WATER;
|
||||
}
|
||||
if (localMaterial == Material.LAVA) {
|
||||
return PathType.LAVA;
|
||||
}
|
||||
}
|
||||
if ((localBlock1.b(paramIBlockAccess, localBlockPosition)) && (localPathType1 == PathType.BLOCKED)) {
|
||||
localPathType1 = PathType.OPEN;
|
||||
}
|
||||
if ((localPathType1 == PathType.OPEN) && (paramInt2 >= 1)) {
|
||||
PathType localPathType2 = a(paramIBlockAccess, paramInt1, paramInt2 - 1, paramInt3);
|
||||
localPathType1 = (localPathType2 == PathType.WALKABLE) || (localPathType2 == PathType.OPEN)
|
||||
|| (localPathType2 == PathType.WATER) || (localPathType2 == PathType.LAVA) ? PathType.OPEN
|
||||
: PathType.WALKABLE;
|
||||
}
|
||||
if (localPathType1 == PathType.WALKABLE) {
|
||||
for (int i = paramInt1 - 1; i <= paramInt1 + 1; i++) {
|
||||
for (int k = paramInt3 - 1; k <= paramInt3 + 1; k++) {
|
||||
if ((i != paramInt1) || (k != paramInt3)) {
|
||||
Block localBlock2 = paramIBlockAccess.getType(new BlockPosition(i, paramInt2, k)).getBlock();
|
||||
if (localBlock2 == Blocks.CACTUS) {
|
||||
localPathType1 = PathType.DANGER_CACTUS;
|
||||
} else if (localBlock2 == Blocks.FIRE) {
|
||||
localPathType1 = PathType.DANGER_FIRE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return localPathType1;
|
||||
}
|
||||
}
|
@ -12,12 +12,15 @@ import net.minecraft.server.v1_9_R1.EntityPlayer;
|
||||
import net.minecraft.server.v1_9_R1.EntityTrackerEntry;
|
||||
|
||||
public class PlayerlistTrackerEntry extends EntityTrackerEntry {
|
||||
public PlayerlistTrackerEntry(Entity entity, int i, int j, boolean flag) {
|
||||
super(entity, i, j, flag);
|
||||
private final Entity tracker;
|
||||
|
||||
public PlayerlistTrackerEntry(Entity entity, int i, int j, int k, boolean flag) {
|
||||
super(entity, i, j, k, flag);
|
||||
this.tracker = entity;
|
||||
}
|
||||
|
||||
public PlayerlistTrackerEntry(EntityTrackerEntry entry) {
|
||||
this(entry.tracker, entry.b, entry.c, getU(entry));
|
||||
this(getTracker(entry), getE(entry), getF(entry), getG(entry), getU(entry));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -27,11 +30,9 @@ public class PlayerlistTrackerEntry extends EntityTrackerEntry {
|
||||
return;
|
||||
|
||||
if (entityplayer != this.tracker && c(entityplayer)) {
|
||||
|
||||
if (!this.trackedPlayers.contains(entityplayer)
|
||||
&& ((entityplayer.u().getPlayerChunkMap().a(entityplayer, this.tracker.ae, this.tracker.ag))
|
||||
&& ((entityplayer.x().getPlayerChunkMap().a(entityplayer, this.tracker.ab, this.tracker.ad))
|
||||
|| (this.tracker.attachedToPlayer))) {
|
||||
|
||||
if ((this.tracker instanceof SkinnableEntity)) {
|
||||
|
||||
SkinnableEntity skinnable = (SkinnableEntity) this.tracker;
|
||||
@ -47,6 +48,50 @@ public class PlayerlistTrackerEntry extends EntityTrackerEntry {
|
||||
super.updatePlayer(entityplayer);
|
||||
}
|
||||
|
||||
private static int getE(EntityTrackerEntry entry) {
|
||||
try {
|
||||
return (Integer) E.get(entry);
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static int getF(EntityTrackerEntry entry) {
|
||||
try {
|
||||
return (Integer) F.get(entry);
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static int getG(EntityTrackerEntry entry) {
|
||||
try {
|
||||
return (Integer) G.get(entry);
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static Entity getTracker(EntityTrackerEntry entry) {
|
||||
try {
|
||||
return (Entity) TRACKER.get(entry);
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean getU(EntityTrackerEntry entry) {
|
||||
try {
|
||||
return (Boolean) U.get(entry);
|
||||
@ -58,5 +103,9 @@ public class PlayerlistTrackerEntry extends EntityTrackerEntry {
|
||||
return false;
|
||||
}
|
||||
|
||||
private static Field E = NMS.getField(EntityTrackerEntry.class, "e");
|
||||
private static Field F = NMS.getField(EntityTrackerEntry.class, "f");
|
||||
private static Field G = NMS.getField(EntityTrackerEntry.class, "g");
|
||||
private static Field TRACKER = NMS.getField(EntityTrackerEntry.class, "tracker");
|
||||
private static Field U = NMS.getField(EntityTrackerEntry.class, "u");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user