mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 10:36:10 +01:00
Backport to 1.13/14
This commit is contained in:
parent
310c1ce52f
commit
b68782d661
@ -15,7 +15,10 @@ import net.citizensnpcs.npc.CitizensNPC;
|
|||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
import net.minecraft.server.v1_13_R2.EntityBat;
|
import net.minecraft.server.v1_13_R2.EntityBat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_13_R2.SoundEffect;
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
import net.minecraft.server.v1_13_R2.World;
|
import net.minecraft.server.v1_13_R2.World;
|
||||||
@ -60,11 +63,6 @@ public class BatController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect cs() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_13_R2.Entity entity) {
|
public void collide(net.minecraft.server.v1_13_R2.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
@ -75,6 +73,11 @@ public class BatController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -85,6 +88,11 @@ public class BatController extends MobEntityController {
|
|||||||
return npc == null ? super.d(save) : false;
|
return npc == null ? super.d(save) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SoundEffect D() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
@ -120,11 +128,6 @@ public class BatController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
||||||
@ -138,6 +141,13 @@ public class BatController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
@ -152,13 +162,6 @@ public class BatController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
@ -169,6 +172,14 @@ public class BatController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
public void setFlying(boolean flying) {
|
public void setFlying(boolean flying) {
|
||||||
setAsleep(flying);
|
setAsleep(flying);
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,10 @@ import net.citizensnpcs.npc.CitizensNPC;
|
|||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
import net.minecraft.server.v1_13_R2.EntityBlaze;
|
import net.minecraft.server.v1_13_R2.EntityBlaze;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_13_R2.SoundEffect;
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
import net.minecraft.server.v1_13_R2.World;
|
import net.minecraft.server.v1_13_R2.World;
|
||||||
@ -59,11 +62,6 @@ public class BlazeController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect cs() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_13_R2.Entity entity) {
|
public void collide(net.minecraft.server.v1_13_R2.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
@ -74,6 +72,11 @@ public class BlazeController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -84,6 +87,11 @@ public class BlazeController extends MobEntityController {
|
|||||||
return npc == null ? super.d(save) : false;
|
return npc == null ? super.d(save) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect D() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
@ -119,11 +127,6 @@ public class BlazeController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
||||||
@ -137,6 +140,13 @@ public class BlazeController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -150,18 +160,19 @@ public class BlazeController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
if (npc != null) {
|
if (npc != null) {
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -16,7 +16,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityCaveSpider;
|
import net.minecraft.server.v1_13_R2.EntityCaveSpider;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_13_R2.SoundEffect;
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
@ -78,8 +81,10 @@ public class CaveSpiderController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -92,6 +97,11 @@ public class CaveSpiderController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -103,10 +113,8 @@ public class CaveSpiderController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -144,11 +152,6 @@ public class CaveSpiderController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
||||||
@ -162,6 +165,13 @@ public class CaveSpiderController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
@ -177,13 +187,6 @@ public class CaveSpiderController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -192,6 +195,23 @@ public class CaveSpiderController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSize(float f, float f1) {
|
||||||
|
if (npc == null) {
|
||||||
|
super.setSize(f, f1);
|
||||||
|
} else {
|
||||||
|
NMSImpl.setSize(this, f, f1, justCreated);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
@ -200,14 +220,5 @@ public class CaveSpiderController extends MobEntityController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSize(float f, float f1) {
|
|
||||||
if (npc == null) {
|
|
||||||
super.setSize(f, f1);
|
|
||||||
} else {
|
|
||||||
NMSImpl.setSize(this, f, f1, justCreated);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
package net.citizensnpcs.nms.v1_13_R2.entity;
|
package net.citizensnpcs.nms.v1_13_R2.entity;
|
||||||
|
|
||||||
import net.citizensnpcs.util.NMS;
|
import java.lang.reflect.Method;
|
||||||
import net.minecraft.server.v1_13_R2.*;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_13_R2.CraftServer;
|
import org.bukkit.craftbukkit.v1_13_R2.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftChicken;
|
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftChicken;
|
||||||
@ -15,9 +15,18 @@ import net.citizensnpcs.api.npc.NPC;
|
|||||||
import net.citizensnpcs.nms.v1_13_R2.util.NMSImpl;
|
import net.citizensnpcs.nms.v1_13_R2.util.NMSImpl;
|
||||||
import net.citizensnpcs.npc.CitizensNPC;
|
import net.citizensnpcs.npc.CitizensNPC;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import java.lang.reflect.Method;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityChicken;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
|
import net.minecraft.server.v1_13_R2.World;
|
||||||
|
|
||||||
public class ChickenController extends MobEntityController {
|
public class ChickenController extends MobEntityController {
|
||||||
public ChickenController() {
|
public ChickenController() {
|
||||||
@ -190,6 +199,14 @@ public class ChickenController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mobTick() {
|
||||||
|
super.mobTick();
|
||||||
|
if (npc != null) {
|
||||||
|
npc.update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void movementTick() {
|
public void movementTick() {
|
||||||
if (npc != null) {
|
if (npc != null) {
|
||||||
@ -206,14 +223,12 @@ public class ChickenController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Method MOVEMENT_TICK = NMS.getMethod(EntityChicken.class, "k", false);
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
protected boolean n(Entity entity) {
|
||||||
super.mobTick();
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
if (npc != null) {
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
npc.update();
|
|
||||||
}
|
}
|
||||||
|
return super.n(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -224,5 +239,7 @@ public class ChickenController extends MobEntityController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Method MOVEMENT_TICK = NMS.getMethod(EntityChicken.class, "k", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,10 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.ControllerMove;
|
import net.minecraft.server.v1_13_R2.ControllerMove;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityCod;
|
import net.minecraft.server.v1_13_R2.EntityCod;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_13_R2.SoundEffect;
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
@ -205,6 +208,14 @@ public class CodController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -16,8 +16,11 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityCow;
|
import net.minecraft.server.v1_13_R2.EntityCow;
|
||||||
import net.minecraft.server.v1_13_R2.EntityHuman;
|
import net.minecraft.server.v1_13_R2.EntityHuman;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EnumHand;
|
import net.minecraft.server.v1_13_R2.EnumHand;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.ItemStack;
|
import net.minecraft.server.v1_13_R2.ItemStack;
|
||||||
@ -217,6 +220,14 @@ public class CowController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -16,8 +16,11 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityCreeper;
|
import net.minecraft.server.v1_13_R2.EntityCreeper;
|
||||||
import net.minecraft.server.v1_13_R2.EntityLightning;
|
import net.minecraft.server.v1_13_R2.EntityLightning;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_13_R2.SoundEffect;
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
@ -80,8 +83,10 @@ public class CreeperController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -93,6 +98,11 @@ public class CreeperController extends MobEntityController {
|
|||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -104,10 +114,8 @@ public class CreeperController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -146,11 +154,6 @@ public class CreeperController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
||||||
@ -164,6 +167,13 @@ public class CreeperController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -177,13 +187,6 @@ public class CreeperController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -193,12 +196,11 @@ public class CreeperController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
protected boolean n(Entity entity) {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
return super.z_();
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return super.n(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -220,5 +222,14 @@ public class CreeperController extends MobEntityController {
|
|||||||
NMSImpl.setSize(this, f, f1, justCreated);
|
NMSImpl.setSize(this, f, f1, justCreated);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean z_() {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
return super.z_();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -16,7 +16,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityDolphin;
|
import net.minecraft.server.v1_13_R2.EntityDolphin;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_13_R2.SoundEffect;
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
@ -181,6 +184,14 @@ public class DolphinController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
super.tick();
|
super.tick();
|
||||||
|
@ -16,7 +16,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityDrowned;
|
import net.minecraft.server.v1_13_R2.EntityDrowned;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_13_R2.SoundEffect;
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
@ -188,6 +191,14 @@ public class DrownedController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package net.citizensnpcs.nms.v1_13_R2.entity;
|
package net.citizensnpcs.nms.v1_13_R2.entity;
|
||||||
|
|
||||||
import net.citizensnpcs.util.NMS;
|
import java.lang.reflect.Method;
|
||||||
import net.minecraft.server.v1_13_R2.*;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_13_R2.CraftServer;
|
import org.bukkit.craftbukkit.v1_13_R2.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEnderDragon;
|
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEnderDragon;
|
||||||
@ -15,9 +15,16 @@ import net.citizensnpcs.api.npc.NPC;
|
|||||||
import net.citizensnpcs.nms.v1_13_R2.util.NMSImpl;
|
import net.citizensnpcs.nms.v1_13_R2.util.NMSImpl;
|
||||||
import net.citizensnpcs.npc.CitizensNPC;
|
import net.citizensnpcs.npc.CitizensNPC;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
import java.lang.reflect.Method;
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityEnderDragon;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
|
import net.minecraft.server.v1_13_R2.World;
|
||||||
|
|
||||||
public class EnderDragonController extends MobEntityController {
|
public class EnderDragonController extends MobEntityController {
|
||||||
public EnderDragonController() {
|
public EnderDragonController() {
|
||||||
@ -58,11 +65,6 @@ public class EnderDragonController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect cs() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_13_R2.Entity entity) {
|
public void collide(net.minecraft.server.v1_13_R2.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
@ -72,6 +74,11 @@ public class EnderDragonController extends MobEntityController {
|
|||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -82,6 +89,11 @@ public class EnderDragonController extends MobEntityController {
|
|||||||
return npc == null ? super.d(save) : false;
|
return npc == null ? super.d(save) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect D() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
@ -117,11 +129,6 @@ public class EnderDragonController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
||||||
@ -144,6 +151,13 @@ public class EnderDragonController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -157,13 +171,6 @@ public class EnderDragonController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void movementTick() {
|
public void movementTick() {
|
||||||
if (npc != null) {
|
if (npc != null) {
|
||||||
@ -188,6 +195,14 @@ public class EnderDragonController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
private static final Method MOVEMENT_TICK = NMS.getMethod(EntityEnderDragon.class, "k", false);
|
private static final Method MOVEMENT_TICK = NMS.getMethod(EntityEnderDragon.class, "k", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityEnderman;
|
import net.minecraft.server.v1_13_R2.EntityEnderman;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_13_R2.SoundEffect;
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
@ -78,8 +81,10 @@ public class EndermanController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -91,6 +96,11 @@ public class EndermanController extends MobEntityController {
|
|||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -102,10 +112,8 @@ public class EndermanController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -143,11 +151,6 @@ public class EndermanController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
||||||
@ -161,6 +164,13 @@ public class EndermanController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -182,13 +192,6 @@ public class EndermanController extends MobEntityController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -197,6 +200,23 @@ public class EndermanController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSize(float f, float f1) {
|
||||||
|
if (npc == null) {
|
||||||
|
super.setSize(f, f1);
|
||||||
|
} else {
|
||||||
|
NMSImpl.setSize(this, f, f1, justCreated);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
@ -205,14 +225,5 @@ public class EndermanController extends MobEntityController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSize(float f, float f1) {
|
|
||||||
if (npc == null) {
|
|
||||||
super.setSize(f, f1);
|
|
||||||
} else {
|
|
||||||
NMSImpl.setSize(this, f, f1, justCreated);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -16,7 +16,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityEndermite;
|
import net.minecraft.server.v1_13_R2.EntityEndermite;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_13_R2.SoundEffect;
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
@ -78,8 +81,10 @@ public class EndermiteController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -91,6 +96,11 @@ public class EndermiteController extends MobEntityController {
|
|||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -102,10 +112,8 @@ public class EndermiteController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -143,11 +151,6 @@ public class EndermiteController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
||||||
@ -161,6 +164,13 @@ public class EndermiteController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -174,13 +184,6 @@ public class EndermiteController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -189,12 +192,11 @@ public class EndermiteController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
protected boolean n(Entity entity) {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
return super.z_();
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return super.n(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -205,5 +207,14 @@ public class EndermiteController extends MobEntityController {
|
|||||||
NMSImpl.setSize(this, f, f1, justCreated);
|
NMSImpl.setSize(this, f, f1, justCreated);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean z_() {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
return super.z_();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -16,7 +16,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityEvoker;
|
import net.minecraft.server.v1_13_R2.EntityEvoker;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_13_R2.SoundEffect;
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
@ -176,6 +179,14 @@ public class EvokerController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -15,7 +15,10 @@ import net.citizensnpcs.npc.CitizensNPC;
|
|||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityGhast;
|
import net.minecraft.server.v1_13_R2.EntityGhast;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_13_R2.SoundEffect;
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
import net.minecraft.server.v1_13_R2.World;
|
import net.minecraft.server.v1_13_R2.World;
|
||||||
@ -45,16 +48,6 @@ public class GhastController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isRiptiding() {
|
|
||||||
return npc != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect cs() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_13_R2.Entity entity) {
|
public void collide(net.minecraft.server.v1_13_R2.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
@ -65,6 +58,11 @@ public class GhastController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -75,6 +73,11 @@ public class GhastController extends MobEntityController {
|
|||||||
return npc == null ? super.d(save) : false;
|
return npc == null ? super.d(save) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect D() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
@ -110,11 +113,6 @@ public class GhastController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
||||||
@ -128,6 +126,13 @@ public class GhastController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -142,10 +147,8 @@ public class GhastController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void I() {
|
public boolean isRiptiding() {
|
||||||
if (npc == null) {
|
return npc != null;
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -155,6 +158,14 @@ public class GhastController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class GhastNPC extends CraftGhast implements NPCHolder {
|
public static class GhastNPC extends CraftGhast implements NPCHolder {
|
||||||
|
@ -16,7 +16,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityGiantZombie;
|
import net.minecraft.server.v1_13_R2.EntityGiantZombie;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_13_R2.SoundEffect;
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
@ -64,8 +67,10 @@ public class GiantController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -77,6 +82,11 @@ public class GiantController extends MobEntityController {
|
|||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -88,10 +98,8 @@ public class GiantController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -129,11 +137,6 @@ public class GiantController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
||||||
@ -147,6 +150,13 @@ public class GiantController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -160,13 +170,6 @@ public class GiantController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -175,6 +178,23 @@ public class GiantController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSize(float f, float f1) {
|
||||||
|
if (npc == null) {
|
||||||
|
super.setSize(f, f1);
|
||||||
|
} else {
|
||||||
|
NMSImpl.setSize(this, f, f1, justCreated);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
@ -183,15 +203,6 @@ public class GiantController extends MobEntityController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSize(float f, float f1) {
|
|
||||||
if (npc == null) {
|
|
||||||
super.setSize(f, f1);
|
|
||||||
} else {
|
|
||||||
NMSImpl.setSize(this, f, f1, justCreated);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class GiantNPC extends CraftGiant implements NPCHolder {
|
public static class GiantNPC extends CraftGiant implements NPCHolder {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package net.citizensnpcs.nms.v1_13_R2.entity;
|
package net.citizensnpcs.nms.v1_13_R2.entity;
|
||||||
|
|
||||||
import net.citizensnpcs.util.NMS;
|
import java.lang.reflect.Method;
|
||||||
import net.minecraft.server.v1_13_R2.*;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_13_R2.CraftServer;
|
import org.bukkit.craftbukkit.v1_13_R2.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity;
|
||||||
@ -15,9 +15,18 @@ import net.citizensnpcs.api.npc.NPC;
|
|||||||
import net.citizensnpcs.nms.v1_13_R2.util.NMSImpl;
|
import net.citizensnpcs.nms.v1_13_R2.util.NMSImpl;
|
||||||
import net.citizensnpcs.npc.CitizensNPC;
|
import net.citizensnpcs.npc.CitizensNPC;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import java.lang.reflect.Method;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityGuardian;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
|
import net.minecraft.server.v1_13_R2.World;
|
||||||
|
|
||||||
public class GuardianController extends MobEntityController {
|
public class GuardianController extends MobEntityController {
|
||||||
public GuardianController() {
|
public GuardianController() {
|
||||||
@ -61,8 +70,10 @@ public class GuardianController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -75,6 +86,11 @@ public class GuardianController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -86,10 +102,8 @@ public class GuardianController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -127,11 +141,6 @@ public class GuardianController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
||||||
@ -145,6 +154,13 @@ public class GuardianController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -158,22 +174,6 @@ public class GuardianController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean z_() {
|
|
||||||
if (npc == null || !npc.isFlyable()) {
|
|
||||||
return super.z_();
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void movementTick() {
|
public void movementTick() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
@ -192,7 +192,13 @@ public class GuardianController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Method MOVEMENT_TICK = NMS.getMethod(EntityGuardian.class, "k", false);
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSize(float f, float f1) {
|
public void setSize(float f, float f1) {
|
||||||
@ -202,6 +208,17 @@ public class GuardianController extends MobEntityController {
|
|||||||
NMSImpl.setSize(this, f, f1, justCreated);
|
NMSImpl.setSize(this, f, f1, justCreated);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean z_() {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
return super.z_();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Method MOVEMENT_TICK = NMS.getMethod(EntityGuardian.class, "k", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class GuardianNPC extends CraftGuardian implements NPCHolder {
|
public static class GuardianNPC extends CraftGuardian implements NPCHolder {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package net.citizensnpcs.nms.v1_13_R2.entity;
|
package net.citizensnpcs.nms.v1_13_R2.entity;
|
||||||
|
|
||||||
import net.citizensnpcs.util.NMS;
|
import java.lang.reflect.Method;
|
||||||
import net.minecraft.server.v1_13_R2.*;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_13_R2.CraftServer;
|
import org.bukkit.craftbukkit.v1_13_R2.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftElderGuardian;
|
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftElderGuardian;
|
||||||
@ -15,9 +15,18 @@ import net.citizensnpcs.api.npc.NPC;
|
|||||||
import net.citizensnpcs.nms.v1_13_R2.util.NMSImpl;
|
import net.citizensnpcs.nms.v1_13_R2.util.NMSImpl;
|
||||||
import net.citizensnpcs.npc.CitizensNPC;
|
import net.citizensnpcs.npc.CitizensNPC;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import java.lang.reflect.Method;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityGuardianElder;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
|
import net.minecraft.server.v1_13_R2.World;
|
||||||
|
|
||||||
public class GuardianElderController extends MobEntityController {
|
public class GuardianElderController extends MobEntityController {
|
||||||
public GuardianElderController() {
|
public GuardianElderController() {
|
||||||
@ -61,8 +70,10 @@ public class GuardianElderController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -75,6 +86,11 @@ public class GuardianElderController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -86,10 +102,8 @@ public class GuardianElderController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -127,11 +141,6 @@ public class GuardianElderController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
||||||
@ -145,6 +154,13 @@ public class GuardianElderController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -158,22 +174,6 @@ public class GuardianElderController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean z_() {
|
|
||||||
if (npc == null || !npc.isFlyable()) {
|
|
||||||
return super.z_();
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void movementTick() {
|
public void movementTick() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
@ -192,7 +192,13 @@ public class GuardianElderController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Method MOVEMENT_TICK = NMS.getMethod(EntityGuardianElder.class, "k", false);
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSize(float f, float f1) {
|
public void setSize(float f, float f1) {
|
||||||
@ -202,6 +208,17 @@ public class GuardianElderController extends MobEntityController {
|
|||||||
NMSImpl.setSize(this, f, f1, justCreated);
|
NMSImpl.setSize(this, f, f1, justCreated);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean z_() {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
return super.z_();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Method MOVEMENT_TICK = NMS.getMethod(EntityGuardianElder.class, "k", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class GuardianElderNPC extends CraftElderGuardian implements NPCHolder {
|
public static class GuardianElderNPC extends CraftElderGuardian implements NPCHolder {
|
||||||
|
@ -20,7 +20,10 @@ import net.citizensnpcs.util.NMS;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityHorse;
|
import net.minecraft.server.v1_13_R2.EntityHorse;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.GenericAttributes;
|
import net.minecraft.server.v1_13_R2.GenericAttributes;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -221,6 +224,14 @@ public class HorseController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -20,7 +20,10 @@ import net.citizensnpcs.util.NMS;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityHorseDonkey;
|
import net.minecraft.server.v1_13_R2.EntityHorseDonkey;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.GenericAttributes;
|
import net.minecraft.server.v1_13_R2.GenericAttributes;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -221,6 +224,14 @@ public class HorseDonkeyController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -20,7 +20,10 @@ import net.citizensnpcs.util.NMS;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityHorseMule;
|
import net.minecraft.server.v1_13_R2.EntityHorseMule;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.GenericAttributes;
|
import net.minecraft.server.v1_13_R2.GenericAttributes;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -45,9 +48,7 @@ public class HorseMuleController extends MobEntityController {
|
|||||||
|
|
||||||
public static class EntityHorseMuleNPC extends EntityHorseMule implements NPCHolder {
|
public static class EntityHorseMuleNPC extends EntityHorseMule implements NPCHolder {
|
||||||
private double baseMovementSpeed;
|
private double baseMovementSpeed;
|
||||||
|
|
||||||
private final CitizensNPC npc;
|
private final CitizensNPC npc;
|
||||||
|
|
||||||
private boolean riding;
|
private boolean riding;
|
||||||
|
|
||||||
public EntityHorseMuleNPC(World world) {
|
public EntityHorseMuleNPC(World world) {
|
||||||
@ -223,6 +224,14 @@ public class HorseMuleController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -20,7 +20,10 @@ import net.citizensnpcs.util.NMS;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityHorseSkeleton;
|
import net.minecraft.server.v1_13_R2.EntityHorseSkeleton;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.GenericAttributes;
|
import net.minecraft.server.v1_13_R2.GenericAttributes;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -222,6 +225,14 @@ public class HorseSkeletonController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -20,7 +20,10 @@ import net.citizensnpcs.util.NMS;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityHorseZombie;
|
import net.minecraft.server.v1_13_R2.EntityHorseZombie;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.GenericAttributes;
|
import net.minecraft.server.v1_13_R2.GenericAttributes;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -222,6 +225,14 @@ public class HorseZombieController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -16,7 +16,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityIllagerIllusioner;
|
import net.minecraft.server.v1_13_R2.EntityIllagerIllusioner;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_13_R2.SoundEffect;
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
@ -64,8 +67,10 @@ public class IllusionerController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -78,6 +83,11 @@ public class IllusionerController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -89,10 +99,8 @@ public class IllusionerController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -130,11 +138,6 @@ public class IllusionerController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
||||||
@ -147,6 +150,13 @@ public class IllusionerController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -160,13 +170,6 @@ public class IllusionerController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -175,6 +178,14 @@ public class IllusionerController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -16,7 +16,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityIronGolem;
|
import net.minecraft.server.v1_13_R2.EntityIronGolem;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_13_R2.SoundEffect;
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
@ -64,8 +67,10 @@ public class IronGolemController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -77,6 +82,11 @@ public class IronGolemController extends MobEntityController {
|
|||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -88,10 +98,8 @@ public class IronGolemController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -129,11 +137,6 @@ public class IronGolemController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
||||||
@ -147,6 +150,13 @@ public class IronGolemController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -160,13 +170,6 @@ public class IronGolemController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -175,6 +178,23 @@ public class IronGolemController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSize(float f, float f1) {
|
||||||
|
if (npc == null) {
|
||||||
|
super.setSize(f, f1);
|
||||||
|
} else {
|
||||||
|
NMSImpl.setSize(this, f, f1, justCreated);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
@ -183,15 +203,6 @@ public class IronGolemController extends MobEntityController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSize(float f, float f1) {
|
|
||||||
if (npc == null) {
|
|
||||||
super.setSize(f, f1);
|
|
||||||
} else {
|
|
||||||
NMSImpl.setSize(this, f, f1, justCreated);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class IronGolemNPC extends CraftIronGolem implements NPCHolder {
|
public static class IronGolemNPC extends CraftIronGolem implements NPCHolder {
|
||||||
|
@ -19,7 +19,10 @@ import net.citizensnpcs.util.NMS;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityLlama;
|
import net.minecraft.server.v1_13_R2.EntityLlama;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_13_R2.SoundEffect;
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
@ -85,8 +88,10 @@ public class LlamaController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -99,6 +104,11 @@ public class LlamaController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -110,10 +120,8 @@ public class LlamaController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -151,11 +159,6 @@ public class LlamaController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
||||||
@ -169,6 +172,13 @@ public class LlamaController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -182,13 +192,6 @@ public class LlamaController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
@ -199,6 +202,14 @@ public class LlamaController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -17,8 +17,11 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityHuman;
|
import net.minecraft.server.v1_13_R2.EntityHuman;
|
||||||
import net.minecraft.server.v1_13_R2.EntityMagmaCube;
|
import net.minecraft.server.v1_13_R2.EntityMagmaCube;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_13_R2.SoundEffect;
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
@ -68,18 +71,12 @@ public class MagmaCubeController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void c(float f, float f1) {
|
||||||
super.tick();
|
if (npc == null || !npc.isFlyable()) {
|
||||||
if (npc != null) {
|
super.c(f, f1);
|
||||||
npc.update();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect cs() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_13_R2.Entity entity) {
|
public void collide(net.minecraft.server.v1_13_R2.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
@ -89,6 +86,11 @@ public class MagmaCubeController extends MobEntityController {
|
|||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -107,10 +109,8 @@ public class MagmaCubeController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -148,11 +148,6 @@ public class MagmaCubeController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
||||||
@ -166,6 +161,13 @@ public class MagmaCubeController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -180,9 +182,27 @@ public class MagmaCubeController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void I() {
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSize(float f, float f1) {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
super.I();
|
super.setSize(f, f1);
|
||||||
|
} else {
|
||||||
|
NMSImpl.setSize(this, f, f1, justCreated);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void tick() {
|
||||||
|
super.tick();
|
||||||
|
if (npc != null) {
|
||||||
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,15 +214,6 @@ public class MagmaCubeController extends MobEntityController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSize(float f, float f1) {
|
|
||||||
if (npc == null) {
|
|
||||||
super.setSize(f, f1);
|
|
||||||
} else {
|
|
||||||
NMSImpl.setSize(this, f, f1, justCreated);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class MagmaCubeNPC extends CraftMagmaCube implements NPCHolder {
|
public static class MagmaCubeNPC extends CraftMagmaCube implements NPCHolder {
|
||||||
|
@ -16,7 +16,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityHuman;
|
import net.minecraft.server.v1_13_R2.EntityHuman;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntityMushroomCow;
|
import net.minecraft.server.v1_13_R2.EntityMushroomCow;
|
||||||
import net.minecraft.server.v1_13_R2.EnumHand;
|
import net.minecraft.server.v1_13_R2.EnumHand;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
@ -195,6 +198,14 @@ public class MushroomCowController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -16,6 +16,9 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntityOcelot;
|
import net.minecraft.server.v1_13_R2.EntityOcelot;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -194,6 +197,14 @@ public class OcelotController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -15,7 +15,10 @@ import net.citizensnpcs.npc.CitizensNPC;
|
|||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityHuman;
|
import net.minecraft.server.v1_13_R2.EntityHuman;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntityParrot;
|
import net.minecraft.server.v1_13_R2.EntityParrot;
|
||||||
import net.minecraft.server.v1_13_R2.EnumHand;
|
import net.minecraft.server.v1_13_R2.EnumHand;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -56,11 +59,6 @@ public class ParrotController extends MobEntityController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect cs() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_13_R2.Entity entity) {
|
public void collide(net.minecraft.server.v1_13_R2.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
@ -71,6 +69,11 @@ public class ParrotController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -81,6 +84,11 @@ public class ParrotController extends MobEntityController {
|
|||||||
return npc == null ? super.d(save) : false;
|
return npc == null ? super.d(save) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SoundEffect D() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
@ -116,11 +124,6 @@ public class ParrotController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
||||||
@ -134,6 +137,13 @@ public class ParrotController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
@ -148,13 +158,6 @@ public class ParrotController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
@ -164,6 +167,14 @@ public class ParrotController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ParrotNPC extends CraftParrot implements NPCHolder {
|
public static class ParrotNPC extends CraftParrot implements NPCHolder {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package net.citizensnpcs.nms.v1_13_R2.entity;
|
package net.citizensnpcs.nms.v1_13_R2.entity;
|
||||||
|
|
||||||
import net.citizensnpcs.util.NMS;
|
import java.lang.reflect.Method;
|
||||||
import net.minecraft.server.v1_13_R2.*;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_13_R2.CraftServer;
|
import org.bukkit.craftbukkit.v1_13_R2.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity;
|
||||||
@ -15,9 +15,21 @@ import net.citizensnpcs.api.npc.NPC;
|
|||||||
import net.citizensnpcs.nms.v1_13_R2.util.NMSImpl;
|
import net.citizensnpcs.nms.v1_13_R2.util.NMSImpl;
|
||||||
import net.citizensnpcs.npc.CitizensNPC;
|
import net.citizensnpcs.npc.CitizensNPC;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import java.lang.reflect.Method;
|
import net.minecraft.server.v1_13_R2.ControllerLook;
|
||||||
|
import net.minecraft.server.v1_13_R2.ControllerMove;
|
||||||
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityPhantom;
|
||||||
|
import net.minecraft.server.v1_13_R2.EnumDifficulty;
|
||||||
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
|
import net.minecraft.server.v1_13_R2.World;
|
||||||
|
|
||||||
public class PhantomController extends MobEntityController {
|
public class PhantomController extends MobEntityController {
|
||||||
public PhantomController() {
|
public PhantomController() {
|
||||||
@ -193,7 +205,13 @@ public class PhantomController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Method MOVEMENT_TICK = NMS.getMethod(EntityPhantom.class, "k", false);
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
@ -216,6 +234,8 @@ public class PhantomController extends MobEntityController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Method MOVEMENT_TICK = NMS.getMethod(EntityPhantom.class, "k", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class PhantomNPC extends CraftPhantom implements NPCHolder {
|
public static class PhantomNPC extends CraftPhantom implements NPCHolder {
|
||||||
|
@ -16,7 +16,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityLightning;
|
import net.minecraft.server.v1_13_R2.EntityLightning;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntityPig;
|
import net.minecraft.server.v1_13_R2.EntityPig;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -194,6 +197,14 @@ public class PigController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLightningStrike(EntityLightning entitylightning) {
|
public void onLightningStrike(EntityLightning entitylightning) {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
|
@ -16,6 +16,9 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntityPigZombie;
|
import net.minecraft.server.v1_13_R2.EntityPigZombie;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -65,8 +68,10 @@ public class PigZombieController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -78,6 +83,11 @@ public class PigZombieController extends MobEntityController {
|
|||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -89,10 +99,8 @@ public class PigZombieController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -131,11 +139,6 @@ public class PigZombieController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
||||||
@ -149,6 +152,13 @@ public class PigZombieController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -162,13 +172,6 @@ public class PigZombieController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -177,6 +180,14 @@ public class PigZombieController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -15,6 +15,9 @@ import net.citizensnpcs.npc.CitizensNPC;
|
|||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntityPolarBear;
|
import net.minecraft.server.v1_13_R2.EntityPolarBear;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_13_R2.SoundEffect;
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
@ -56,11 +59,6 @@ public class PolarBearController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect cs() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_13_R2.Entity entity) {
|
public void collide(net.minecraft.server.v1_13_R2.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
@ -71,6 +69,11 @@ public class PolarBearController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -81,6 +84,11 @@ public class PolarBearController extends MobEntityController {
|
|||||||
return npc == null ? super.d(save) : false;
|
return npc == null ? super.d(save) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect D() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
@ -116,11 +124,6 @@ public class PolarBearController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
||||||
@ -134,6 +137,13 @@ public class PolarBearController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
@ -148,13 +158,6 @@ public class PolarBearController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -162,6 +165,14 @@ public class PolarBearController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class PolarBearNPC extends CraftPolarBear implements NPCHolder {
|
public static class PolarBearNPC extends CraftPolarBear implements NPCHolder {
|
||||||
|
@ -18,6 +18,9 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.ControllerMove;
|
import net.minecraft.server.v1_13_R2.ControllerMove;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntityPufferFish;
|
import net.minecraft.server.v1_13_R2.EntityPufferFish;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -193,6 +196,14 @@ public class PufferFishController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -17,7 +17,10 @@ import net.citizensnpcs.util.NMS;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityLiving;
|
import net.minecraft.server.v1_13_R2.EntityLiving;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntityRabbit;
|
import net.minecraft.server.v1_13_R2.EntityRabbit;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -199,6 +202,14 @@ public class RabbitController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setRabbitType(int i) {
|
public void setRabbitType(int i) {
|
||||||
if (npc != null) {
|
if (npc != null) {
|
||||||
|
@ -17,6 +17,9 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.ControllerMove;
|
import net.minecraft.server.v1_13_R2.ControllerMove;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntitySalmon;
|
import net.minecraft.server.v1_13_R2.EntitySalmon;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -191,6 +194,14 @@ public class SalmonController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -16,6 +16,9 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntitySheep;
|
import net.minecraft.server.v1_13_R2.EntitySheep;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -75,8 +78,10 @@ public class SheepController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -88,6 +93,11 @@ public class SheepController extends MobEntityController {
|
|||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -99,10 +109,8 @@ public class SheepController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -140,11 +148,6 @@ public class SheepController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
if (npc != null && !(bukkitEntity instanceof NPCHolder)) {
|
||||||
@ -158,6 +161,13 @@ public class SheepController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -171,13 +181,6 @@ public class SheepController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -185,6 +188,14 @@ public class SheepController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package net.citizensnpcs.nms.v1_13_R2.entity;
|
package net.citizensnpcs.nms.v1_13_R2.entity;
|
||||||
|
|
||||||
import net.citizensnpcs.util.NMS;
|
import java.lang.reflect.Method;
|
||||||
import net.minecraft.server.v1_13_R2.*;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_13_R2.CraftServer;
|
import org.bukkit.craftbukkit.v1_13_R2.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity;
|
||||||
@ -15,9 +15,19 @@ import net.citizensnpcs.api.npc.NPC;
|
|||||||
import net.citizensnpcs.nms.v1_13_R2.util.NMSImpl;
|
import net.citizensnpcs.nms.v1_13_R2.util.NMSImpl;
|
||||||
import net.citizensnpcs.npc.CitizensNPC;
|
import net.citizensnpcs.npc.CitizensNPC;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import java.lang.reflect.Method;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityAIBodyControl;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityShulker;
|
||||||
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
|
import net.minecraft.server.v1_13_R2.World;
|
||||||
|
|
||||||
public class ShulkerController extends MobEntityController {
|
public class ShulkerController extends MobEntityController {
|
||||||
public ShulkerController() {
|
public ShulkerController() {
|
||||||
@ -178,7 +188,13 @@ public class ShulkerController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Method MOVEMENT_TICK = NMS.getMethod(EntityShulker.class, "k", false);
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected EntityAIBodyControl o() {
|
protected EntityAIBodyControl o() {
|
||||||
@ -211,6 +227,8 @@ public class ShulkerController extends MobEntityController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Method MOVEMENT_TICK = NMS.getMethod(EntityShulker.class, "k", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ShulkerNPC extends CraftShulker implements NPCHolder {
|
public static class ShulkerNPC extends CraftShulker implements NPCHolder {
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package net.citizensnpcs.nms.v1_13_R2.entity;
|
package net.citizensnpcs.nms.v1_13_R2.entity;
|
||||||
|
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_13_R2.CraftServer;
|
import org.bukkit.craftbukkit.v1_13_R2.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity;
|
||||||
@ -17,6 +15,10 @@ import net.citizensnpcs.npc.CitizensNPC;
|
|||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntitySilverfish;
|
import net.minecraft.server.v1_13_R2.EntitySilverfish;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -56,13 +58,19 @@ public class SilverfishController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void a(float f, float f1, float f2) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.a(f, f1, f2);
|
||||||
|
} else {
|
||||||
|
NMSImpl.flyingMoveLogic(this, f, f1, f2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -74,16 +82,24 @@ public class SilverfishController extends MobEntityController {
|
|||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean d(NBTTagCompound save) {
|
public boolean d(NBTTagCompound save) {
|
||||||
return npc == null ? super.d(save) : false;
|
return npc == null ? super.d(save) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -119,20 +135,6 @@ public class SilverfishController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void a(float f, float f1, float f2) {
|
|
||||||
if (npc == null || !npc.isFlyable()) {
|
|
||||||
super.a(f, f1, f2);
|
|
||||||
} else {
|
|
||||||
NMSImpl.flyingMoveLogic(this, f, f1, f2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
||||||
@ -145,6 +147,13 @@ public class SilverfishController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -158,13 +167,6 @@ public class SilverfishController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -173,12 +175,11 @@ public class SilverfishController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
protected boolean n(Entity entity) {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
return super.z_();
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return super.n(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -189,6 +190,15 @@ public class SilverfishController extends MobEntityController {
|
|||||||
NMSImpl.setSize(this, f, f1, justCreated);
|
NMSImpl.setSize(this, f, f1, justCreated);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean z_() {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
return super.z_();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SilverfishNPC extends CraftSilverfish implements NPCHolder {
|
public static class SilverfishNPC extends CraftSilverfish implements NPCHolder {
|
||||||
|
@ -16,6 +16,9 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntitySkeleton;
|
import net.minecraft.server.v1_13_R2.EntitySkeleton;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -64,8 +67,10 @@ public class SkeletonController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -77,6 +82,11 @@ public class SkeletonController extends MobEntityController {
|
|||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -88,10 +98,8 @@ public class SkeletonController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -129,11 +137,6 @@ public class SkeletonController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
||||||
@ -146,6 +149,13 @@ public class SkeletonController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -159,13 +169,6 @@ public class SkeletonController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -174,6 +177,23 @@ public class SkeletonController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSize(float f, float f1) {
|
||||||
|
if (npc == null) {
|
||||||
|
super.setSize(f, f1);
|
||||||
|
} else {
|
||||||
|
NMSImpl.setSize(this, f, f1, justCreated);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
@ -182,15 +202,6 @@ public class SkeletonController extends MobEntityController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSize(float f, float f1) {
|
|
||||||
if (npc == null) {
|
|
||||||
super.setSize(f, f1);
|
|
||||||
} else {
|
|
||||||
NMSImpl.setSize(this, f, f1, justCreated);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SkeletonNPC extends CraftSkeleton implements NPCHolder {
|
public static class SkeletonNPC extends CraftSkeleton implements NPCHolder {
|
||||||
|
@ -16,6 +16,9 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntitySkeletonStray;
|
import net.minecraft.server.v1_13_R2.EntitySkeletonStray;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -64,8 +67,10 @@ public class SkeletonStrayController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -77,6 +82,11 @@ public class SkeletonStrayController extends MobEntityController {
|
|||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -88,10 +98,8 @@ public class SkeletonStrayController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -129,11 +137,6 @@ public class SkeletonStrayController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
||||||
@ -146,6 +149,13 @@ public class SkeletonStrayController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -159,13 +169,6 @@ public class SkeletonStrayController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -174,6 +177,23 @@ public class SkeletonStrayController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSize(float f, float f1) {
|
||||||
|
if (npc == null) {
|
||||||
|
super.setSize(f, f1);
|
||||||
|
} else {
|
||||||
|
NMSImpl.setSize(this, f, f1, justCreated);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
@ -182,15 +202,6 @@ public class SkeletonStrayController extends MobEntityController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSize(float f, float f1) {
|
|
||||||
if (npc == null) {
|
|
||||||
super.setSize(f, f1);
|
|
||||||
} else {
|
|
||||||
NMSImpl.setSize(this, f, f1, justCreated);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class StrayNPC extends CraftStray implements NPCHolder {
|
public static class StrayNPC extends CraftStray implements NPCHolder {
|
||||||
|
@ -16,6 +16,9 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntitySkeletonWither;
|
import net.minecraft.server.v1_13_R2.EntitySkeletonWither;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -64,8 +67,10 @@ public class SkeletonWitherController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -77,6 +82,11 @@ public class SkeletonWitherController extends MobEntityController {
|
|||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -88,10 +98,8 @@ public class SkeletonWitherController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -129,11 +137,6 @@ public class SkeletonWitherController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
||||||
@ -146,6 +149,13 @@ public class SkeletonWitherController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -159,13 +169,6 @@ public class SkeletonWitherController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -174,6 +177,23 @@ public class SkeletonWitherController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSize(float f, float f1) {
|
||||||
|
if (npc == null) {
|
||||||
|
super.setSize(f, f1);
|
||||||
|
} else {
|
||||||
|
NMSImpl.setSize(this, f, f1, justCreated);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
@ -182,15 +202,6 @@ public class SkeletonWitherController extends MobEntityController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSize(float f, float f1) {
|
|
||||||
if (npc == null) {
|
|
||||||
super.setSize(f, f1);
|
|
||||||
} else {
|
|
||||||
NMSImpl.setSize(this, f, f1, justCreated);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SkeletonWitherNPC extends CraftWitherSkeleton implements NPCHolder {
|
public static class SkeletonWitherNPC extends CraftWitherSkeleton implements NPCHolder {
|
||||||
|
@ -17,7 +17,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityHuman;
|
import net.minecraft.server.v1_13_R2.EntityHuman;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntitySlime;
|
import net.minecraft.server.v1_13_R2.EntitySlime;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -68,18 +71,12 @@ public class SlimeController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void c(float f, float f1) {
|
||||||
super.tick();
|
if (npc == null || !npc.isFlyable()) {
|
||||||
if (npc != null) {
|
super.c(f, f1);
|
||||||
npc.update();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect cs() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_13_R2.Entity entity) {
|
public void collide(net.minecraft.server.v1_13_R2.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
@ -90,6 +87,11 @@ public class SlimeController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -108,10 +110,8 @@ public class SlimeController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -149,11 +149,6 @@ public class SlimeController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
||||||
@ -166,6 +161,13 @@ public class SlimeController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -180,9 +182,27 @@ public class SlimeController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void I() {
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSize(float f, float f1) {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
super.I();
|
super.setSize(f, f1);
|
||||||
|
} else {
|
||||||
|
NMSImpl.setSize(this, f, f1, justCreated);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void tick() {
|
||||||
|
super.tick();
|
||||||
|
if (npc != null) {
|
||||||
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,15 +214,6 @@ public class SlimeController extends MobEntityController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSize(float f, float f1) {
|
|
||||||
if (npc == null) {
|
|
||||||
super.setSize(f, f1);
|
|
||||||
} else {
|
|
||||||
NMSImpl.setSize(this, f, f1, justCreated);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SlimeNPC extends CraftSlime implements NPCHolder {
|
public static class SlimeNPC extends CraftSlime implements NPCHolder {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package net.citizensnpcs.nms.v1_13_R2.entity;
|
package net.citizensnpcs.nms.v1_13_R2.entity;
|
||||||
|
|
||||||
import net.citizensnpcs.util.NMS;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_13_R2.CraftServer;
|
import org.bukkit.craftbukkit.v1_13_R2.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity;
|
||||||
@ -14,17 +15,19 @@ import net.citizensnpcs.api.npc.NPC;
|
|||||||
import net.citizensnpcs.nms.v1_13_R2.util.NMSImpl;
|
import net.citizensnpcs.nms.v1_13_R2.util.NMSImpl;
|
||||||
import net.citizensnpcs.npc.CitizensNPC;
|
import net.citizensnpcs.npc.CitizensNPC;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntitySnowman;
|
import net.minecraft.server.v1_13_R2.EntitySnowman;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_13_R2.SoundEffect;
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
import net.minecraft.server.v1_13_R2.World;
|
import net.minecraft.server.v1_13_R2.World;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
|
|
||||||
public class SnowmanController extends MobEntityController {
|
public class SnowmanController extends MobEntityController {
|
||||||
public SnowmanController() {
|
public SnowmanController() {
|
||||||
super(EntitySnowmanNPC.class);
|
super(EntitySnowmanNPC.class);
|
||||||
@ -169,6 +172,14 @@ public class SnowmanController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mobTick() {
|
||||||
|
super.mobTick();
|
||||||
|
if (npc != null) {
|
||||||
|
npc.update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void movementTick() {
|
public void movementTick() {
|
||||||
boolean allowsGriefing = this.world.getGameRules().getBoolean("mobGriefing");
|
boolean allowsGriefing = this.world.getGameRules().getBoolean("mobGriefing");
|
||||||
@ -190,14 +201,12 @@ public class SnowmanController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Method MOVEMENT_TICK = NMS.getMethod(EntitySnowman.class, "k", false);
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
protected boolean n(Entity entity) {
|
||||||
super.mobTick();
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
if (npc != null) {
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
npc.update();
|
|
||||||
}
|
}
|
||||||
|
return super.n(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -217,6 +226,8 @@ public class SnowmanController extends MobEntityController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Method MOVEMENT_TICK = NMS.getMethod(EntitySnowman.class, "k", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SnowmanNPC extends CraftSnowman implements NPCHolder {
|
public static class SnowmanNPC extends CraftSnowman implements NPCHolder {
|
||||||
|
@ -16,6 +16,9 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntitySpider;
|
import net.minecraft.server.v1_13_R2.EntitySpider;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -64,8 +67,10 @@ public class SpiderController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -77,6 +82,11 @@ public class SpiderController extends MobEntityController {
|
|||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -88,10 +98,8 @@ public class SpiderController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -129,11 +137,6 @@ public class SpiderController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
||||||
@ -146,6 +149,13 @@ public class SpiderController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -159,13 +169,6 @@ public class SpiderController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -174,12 +177,11 @@ public class SpiderController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
protected boolean n(Entity entity) {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
return super.z_();
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return super.n(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -191,6 +193,15 @@ public class SpiderController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean z_() {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
return super.z_();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SpiderNPC extends CraftSpider implements NPCHolder {
|
public static class SpiderNPC extends CraftSpider implements NPCHolder {
|
||||||
|
@ -16,6 +16,9 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntitySquid;
|
import net.minecraft.server.v1_13_R2.EntitySquid;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -174,6 +177,14 @@ public class SquidController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSize(float f, float f1) {
|
public void setSize(float f, float f1) {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
|
@ -17,6 +17,9 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.ControllerMove;
|
import net.minecraft.server.v1_13_R2.ControllerMove;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntityTropicalFish;
|
import net.minecraft.server.v1_13_R2.EntityTropicalFish;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -191,6 +194,14 @@ public class TropicalFishController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -18,7 +18,10 @@ import net.minecraft.server.v1_13_R2.BlockPosition;
|
|||||||
import net.minecraft.server.v1_13_R2.ControllerJump;
|
import net.minecraft.server.v1_13_R2.ControllerJump;
|
||||||
import net.minecraft.server.v1_13_R2.ControllerMove;
|
import net.minecraft.server.v1_13_R2.ControllerMove;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityInsentient;
|
import net.minecraft.server.v1_13_R2.EntityInsentient;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntityTurtle;
|
import net.minecraft.server.v1_13_R2.EntityTurtle;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -189,6 +192,14 @@ public class TurtleController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -15,6 +15,9 @@ import net.citizensnpcs.npc.CitizensNPC;
|
|||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntityVex;
|
import net.minecraft.server.v1_13_R2.EntityVex;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_13_R2.SoundEffect;
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
@ -151,6 +154,14 @@ public class VexController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class VexNPC extends CraftVex implements NPCHolder {
|
public static class VexNPC extends CraftVex implements NPCHolder {
|
||||||
|
@ -18,8 +18,11 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityHuman;
|
import net.minecraft.server.v1_13_R2.EntityHuman;
|
||||||
import net.minecraft.server.v1_13_R2.EntityLightning;
|
import net.minecraft.server.v1_13_R2.EntityLightning;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntityVillager;
|
import net.minecraft.server.v1_13_R2.EntityVillager;
|
||||||
import net.minecraft.server.v1_13_R2.EnumHand;
|
import net.minecraft.server.v1_13_R2.EnumHand;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
@ -219,6 +222,14 @@ public class VillagerController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLightningStrike(EntityLightning entitylightning) {
|
public void onLightningStrike(EntityLightning entitylightning) {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
|
@ -16,6 +16,9 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntityVindicator;
|
import net.minecraft.server.v1_13_R2.EntityVindicator;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -75,8 +78,10 @@ public class VindicatorController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -89,6 +94,11 @@ public class VindicatorController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -100,10 +110,8 @@ public class VindicatorController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -141,11 +149,6 @@ public class VindicatorController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
||||||
@ -158,6 +161,13 @@ public class VindicatorController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -171,13 +181,6 @@ public class VindicatorController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -186,6 +189,14 @@ public class VindicatorController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -16,6 +16,9 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntityWitch;
|
import net.minecraft.server.v1_13_R2.EntityWitch;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -64,8 +67,10 @@ public class WitchController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -77,6 +82,11 @@ public class WitchController extends MobEntityController {
|
|||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -88,10 +98,8 @@ public class WitchController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -129,11 +137,6 @@ public class WitchController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
||||||
@ -146,6 +149,13 @@ public class WitchController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -159,13 +169,6 @@ public class WitchController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -174,12 +177,11 @@ public class WitchController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
protected boolean n(Entity entity) {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
return super.z_();
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return super.n(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -190,6 +192,15 @@ public class WitchController extends MobEntityController {
|
|||||||
NMSImpl.setSize(this, f, f1, justCreated);
|
NMSImpl.setSize(this, f, f1, justCreated);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean z_() {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
return super.z_();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class WitchNPC extends CraftWitch implements NPCHolder {
|
public static class WitchNPC extends CraftWitch implements NPCHolder {
|
||||||
|
@ -15,6 +15,9 @@ import net.citizensnpcs.npc.CitizensNPC;
|
|||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntityWither;
|
import net.minecraft.server.v1_13_R2.EntityWither;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_13_R2.SoundEffect;
|
import net.minecraft.server.v1_13_R2.SoundEffect;
|
||||||
@ -154,6 +157,14 @@ public class WitherController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class WitherNPC extends CraftWither implements NPCHolder {
|
public static class WitherNPC extends CraftWither implements NPCHolder {
|
||||||
|
@ -17,7 +17,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
import net.minecraft.server.v1_13_R2.EntityLiving;
|
import net.minecraft.server.v1_13_R2.EntityLiving;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntityWolf;
|
import net.minecraft.server.v1_13_R2.EntityWolf;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -77,8 +80,10 @@ public class WolfController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -91,6 +96,11 @@ public class WolfController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -102,10 +112,8 @@ public class WolfController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -143,11 +151,6 @@ public class WolfController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
||||||
@ -160,6 +163,13 @@ public class WolfController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -173,13 +183,6 @@ public class WolfController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -188,6 +191,19 @@ public class WolfController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean setGoalTarget(EntityLiving entityliving, EntityTargetEvent.TargetReason reason, boolean fire) {
|
||||||
|
return npc == null || this.equals(entityliving) ? super.setGoalTarget(entityliving, reason, fire) : false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
@ -196,11 +212,6 @@ public class WolfController extends MobEntityController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean setGoalTarget(EntityLiving entityliving, EntityTargetEvent.TargetReason reason, boolean fire) {
|
|
||||||
return npc == null || this.equals(entityliving) ? super.setGoalTarget(entityliving, reason, fire) : false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class WolfNPC extends CraftWolf implements NPCHolder {
|
public static class WolfNPC extends CraftWolf implements NPCHolder {
|
||||||
|
@ -16,6 +16,9 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntityZombie;
|
import net.minecraft.server.v1_13_R2.EntityZombie;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -64,8 +67,10 @@ public class ZombieController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -77,6 +82,11 @@ public class ZombieController extends MobEntityController {
|
|||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -88,10 +98,8 @@ public class ZombieController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -129,11 +137,6 @@ public class ZombieController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
||||||
@ -146,6 +149,13 @@ public class ZombieController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -159,13 +169,6 @@ public class ZombieController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -174,6 +177,14 @@ public class ZombieController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -16,6 +16,9 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntityZombieHusk;
|
import net.minecraft.server.v1_13_R2.EntityZombieHusk;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -64,8 +67,10 @@ public class ZombieHuskController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -77,6 +82,11 @@ public class ZombieHuskController extends MobEntityController {
|
|||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEffect d(DamageSource damagesource) {
|
protected SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -88,10 +98,8 @@ public class ZombieHuskController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
protected SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -129,11 +137,6 @@ public class ZombieHuskController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
||||||
@ -146,6 +149,13 @@ public class ZombieHuskController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -159,13 +169,6 @@ public class ZombieHuskController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -174,6 +177,14 @@ public class ZombieHuskController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -16,6 +16,9 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||||
import net.minecraft.server.v1_13_R2.DamageSource;
|
import net.minecraft.server.v1_13_R2.DamageSource;
|
||||||
|
import net.minecraft.server.v1_13_R2.Entity;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_13_R2.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_13_R2.EntityZombieVillager;
|
import net.minecraft.server.v1_13_R2.EntityZombieVillager;
|
||||||
import net.minecraft.server.v1_13_R2.IBlockData;
|
import net.minecraft.server.v1_13_R2.IBlockData;
|
||||||
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
@ -64,8 +67,10 @@ public class ZombieVillagerController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SoundEffect cs() {
|
public void c(float f, float f1) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.c(f, f1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -77,6 +82,11 @@ public class ZombieVillagerController extends MobEntityController {
|
|||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SoundEffect cs() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SoundEffect d(DamageSource damagesource) {
|
public SoundEffect d(DamageSource damagesource) {
|
||||||
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
@ -88,10 +98,8 @@ public class ZombieVillagerController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(float f, float f1) {
|
public SoundEffect D() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.c(f, f1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -129,11 +137,6 @@ public class ZombieVillagerController extends MobEntityController {
|
|||||||
// cancelled.
|
// cancelled.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public SoundEffect D() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CraftEntity getBukkitEntity() {
|
public CraftEntity getBukkitEntity() {
|
||||||
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
if (npc != null && !(bukkitEntity instanceof NPCHolder))
|
||||||
@ -146,6 +149,13 @@ public class ZombieVillagerController extends MobEntityController {
|
|||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void I() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.I();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -159,13 +169,6 @@ public class ZombieVillagerController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void I() {
|
|
||||||
if (npc == null) {
|
|
||||||
super.I();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mobTick() {
|
public void mobTick() {
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
@ -174,6 +177,14 @@ public class ZombieVillagerController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean z_() {
|
public boolean z_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package net.citizensnpcs.nms.v1_14_R1.entity;
|
package net.citizensnpcs.nms.v1_14_R1.entity;
|
||||||
|
|
||||||
import net.minecraft.server.v1_14_R1.Vec3D;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;
|
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftBat;
|
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftBat;
|
||||||
@ -17,7 +15,10 @@ import net.citizensnpcs.npc.CitizensNPC;
|
|||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
import net.minecraft.server.v1_14_R1.EntityBat;
|
import net.minecraft.server.v1_14_R1.EntityBat;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_14_R1.SoundEffect;
|
import net.minecraft.server.v1_14_R1.SoundEffect;
|
||||||
@ -63,6 +64,13 @@ public class BatController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void checkDespawn() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.checkDespawn();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_14_R1.Entity entity) {
|
public void collide(net.minecraft.server.v1_14_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
@ -73,26 +81,11 @@ public class BatController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect getSoundDeath() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.getSoundDeath(), NPC.DEATH_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected SoundEffect getSoundHurt(DamageSource damagesource) {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.getSoundHurt(damagesource), NPC.HURT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean d(NBTTagCompound save) {
|
public boolean d(NBTTagCompound save) {
|
||||||
return npc == null ? super.d(save) : false;
|
return npc == null ? super.d(save) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public SoundEffect getSoundAmbient() {
|
|
||||||
return NMSImpl.getSoundEffect(npc, super.getSoundAmbient(), NPC.AMBIENT_SOUND_METADATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
@ -142,10 +135,18 @@ public class BatController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void checkDespawn() {
|
public SoundEffect getSoundAmbient() {
|
||||||
if (npc == null) {
|
return NMSImpl.getSoundEffect(npc, super.getSoundAmbient(), NPC.AMBIENT_SOUND_METADATA);
|
||||||
super.checkDespawn();
|
}
|
||||||
}
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect getSoundDeath() {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.getSoundDeath(), NPC.DEATH_SOUND_METADATA);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SoundEffect getSoundHurt(DamageSource damagesource) {
|
||||||
|
return NMSImpl.getSoundEffect(npc, super.getSoundHurt(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -172,6 +173,14 @@ public class BatController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
public void setFlying(boolean flying) {
|
public void setFlying(boolean flying) {
|
||||||
setAsleep(flying);
|
setAsleep(flying);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package net.citizensnpcs.nms.v1_14_R1.entity;
|
package net.citizensnpcs.nms.v1_14_R1.entity;
|
||||||
|
|
||||||
import net.minecraft.server.v1_14_R1.Vec3D;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;
|
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftBlaze;
|
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftBlaze;
|
||||||
@ -17,7 +15,10 @@ import net.citizensnpcs.npc.CitizensNPC;
|
|||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
import net.minecraft.server.v1_14_R1.EntityBlaze;
|
import net.minecraft.server.v1_14_R1.EntityBlaze;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_14_R1.SoundEffect;
|
import net.minecraft.server.v1_14_R1.SoundEffect;
|
||||||
@ -166,5 +167,14 @@ public class BlazeController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,10 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityCat;
|
import net.minecraft.server.v1_14_R1.EntityCat;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
@ -213,5 +216,13 @@ public class CatController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityCaveSpider;
|
import net.minecraft.server.v1_14_R1.EntityCaveSpider;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
@ -203,6 +206,14 @@ public class CaveSpiderController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateSize() {
|
public void updateSize() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
|
@ -17,7 +17,10 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityChicken;
|
import net.minecraft.server.v1_14_R1.EntityChicken;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
@ -51,7 +54,6 @@ public class ChickenController extends MobEntityController {
|
|||||||
|
|
||||||
public static class EntityChickenNPC extends EntityChicken implements NPCHolder {
|
public static class EntityChickenNPC extends EntityChicken implements NPCHolder {
|
||||||
boolean calledNMSHeight = false;
|
boolean calledNMSHeight = false;
|
||||||
|
|
||||||
private final CitizensNPC npc;
|
private final CitizensNPC npc;
|
||||||
|
|
||||||
public EntityChickenNPC(EntityTypes<? extends EntityChicken> types, World world) {
|
public EntityChickenNPC(EntityTypes<? extends EntityChicken> types, World world) {
|
||||||
@ -222,5 +224,13 @@ public class ChickenController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
super.movementTick();
|
super.movementTick();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,10 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.ControllerMove;
|
import net.minecraft.server.v1_14_R1.ControllerMove;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityCod;
|
import net.minecraft.server.v1_14_R1.EntityCod;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
@ -216,5 +219,13 @@ public class CodController extends MobEntityController {
|
|||||||
this.y = lastInWater;
|
this.y = lastInWater;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,8 +17,11 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityCow;
|
import net.minecraft.server.v1_14_R1.EntityCow;
|
||||||
import net.minecraft.server.v1_14_R1.EntityHuman;
|
import net.minecraft.server.v1_14_R1.EntityHuman;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.EnumHand;
|
import net.minecraft.server.v1_14_R1.EnumHand;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
@ -227,5 +230,13 @@ public class CowController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,11 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityCreeper;
|
import net.minecraft.server.v1_14_R1.EntityCreeper;
|
||||||
import net.minecraft.server.v1_14_R1.EntityLightning;
|
import net.minecraft.server.v1_14_R1.EntityLightning;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
@ -203,6 +206,14 @@ public class CreeperController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLightningStrike(EntityLightning entitylightning) {
|
public void onLightningStrike(EntityLightning entitylightning) {
|
||||||
if (npc == null || allowPowered) {
|
if (npc == null || allowPowered) {
|
||||||
|
@ -17,7 +17,10 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.ControllerMove;
|
import net.minecraft.server.v1_14_R1.ControllerMove;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityDolphin;
|
import net.minecraft.server.v1_14_R1.EntityDolphin;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
@ -211,6 +214,14 @@ public class DolphinController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
super.tick();
|
super.tick();
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package net.citizensnpcs.nms.v1_14_R1.entity;
|
package net.citizensnpcs.nms.v1_14_R1.entity;
|
||||||
|
|
||||||
import net.minecraft.server.v1_14_R1.Vec3D;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;
|
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftDrowned;
|
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftDrowned;
|
||||||
@ -18,11 +16,15 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityDrowned;
|
import net.minecraft.server.v1_14_R1.EntityDrowned;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_14_R1.SoundEffect;
|
import net.minecraft.server.v1_14_R1.SoundEffect;
|
||||||
|
import net.minecraft.server.v1_14_R1.Vec3D;
|
||||||
import net.minecraft.server.v1_14_R1.World;
|
import net.minecraft.server.v1_14_R1.World;
|
||||||
|
|
||||||
public class DrownedController extends MobEntityController {
|
public class DrownedController extends MobEntityController {
|
||||||
@ -71,15 +73,6 @@ public class DrownedController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void e(Vec3D vec3d) {
|
|
||||||
if (npc == null || !npc.isFlyable()) {
|
|
||||||
super.e(vec3d);
|
|
||||||
} else {
|
|
||||||
NMSImpl.flyingMoveLogic(this, vec3d);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void b(float f, float f1) {
|
public void b(float f, float f1) {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
@ -108,6 +101,15 @@ public class DrownedController extends MobEntityController {
|
|||||||
return npc == null ? super.d(save) : false;
|
return npc == null ? super.d(save) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void e(Vec3D vec3d) {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.e(vec3d);
|
||||||
|
} else {
|
||||||
|
NMSImpl.flyingMoveLogic(this, vec3d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
@ -171,6 +173,15 @@ public class DrownedController extends MobEntityController {
|
|||||||
return NMSImpl.getSoundEffect(npc, super.getSoundHurt(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.getSoundHurt(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isClimbing() {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
return super.isClimbing();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -193,12 +204,11 @@ public class DrownedController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isClimbing() {
|
protected boolean n(Entity entity) {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
return super.isClimbing();
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return super.n(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,10 @@ import net.citizensnpcs.npc.CitizensNPC;
|
|||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityEnderDragon;
|
import net.minecraft.server.v1_14_R1.EntityEnderDragon;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_14_R1.SoundEffect;
|
import net.minecraft.server.v1_14_R1.SoundEffect;
|
||||||
@ -182,5 +185,13 @@ public class EnderDragonController extends MobEntityController {
|
|||||||
super.movementTick();
|
super.movementTick();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityEnderman;
|
import net.minecraft.server.v1_14_R1.EntityEnderman;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
@ -208,6 +211,14 @@ public class EndermanController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateSize() {
|
public void updateSize() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
|
@ -16,7 +16,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityEndermite;
|
import net.minecraft.server.v1_14_R1.EntityEndermite;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
@ -199,6 +202,14 @@ public class EndermiteController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateSize() {
|
public void updateSize() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package net.citizensnpcs.nms.v1_14_R1.entity;
|
package net.citizensnpcs.nms.v1_14_R1.entity;
|
||||||
|
|
||||||
import net.minecraft.server.v1_14_R1.Vec3D;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;
|
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity;
|
||||||
@ -18,11 +16,15 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityEvoker;
|
import net.minecraft.server.v1_14_R1.EntityEvoker;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_14_R1.SoundEffect;
|
import net.minecraft.server.v1_14_R1.SoundEffect;
|
||||||
|
import net.minecraft.server.v1_14_R1.Vec3D;
|
||||||
import net.minecraft.server.v1_14_R1.World;
|
import net.minecraft.server.v1_14_R1.World;
|
||||||
|
|
||||||
public class EvokerController extends MobEntityController {
|
public class EvokerController extends MobEntityController {
|
||||||
@ -57,15 +59,6 @@ public class EvokerController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void e(Vec3D vec3d) {
|
|
||||||
if (npc == null || !npc.isFlyable()) {
|
|
||||||
super.e(vec3d);
|
|
||||||
} else {
|
|
||||||
NMSImpl.flyingMoveLogic(this, vec3d);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void b(float f, float f1) {
|
public void b(float f, float f1) {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
@ -95,6 +88,15 @@ public class EvokerController extends MobEntityController {
|
|||||||
return npc == null ? super.d(save) : false;
|
return npc == null ? super.d(save) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void e(Vec3D vec3d) {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.e(vec3d);
|
||||||
|
} else {
|
||||||
|
NMSImpl.flyingMoveLogic(this, vec3d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
@ -158,6 +160,15 @@ public class EvokerController extends MobEntityController {
|
|||||||
return NMSImpl.getSoundEffect(npc, super.getSoundHurt(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.getSoundHurt(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isClimbing() {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
return super.isClimbing();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -180,12 +191,11 @@ public class EvokerController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isClimbing() {
|
protected boolean n(Entity entity) {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
return super.isClimbing();
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return super.n(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,10 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityFox;
|
import net.minecraft.server.v1_14_R1.EntityFox;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
@ -199,6 +202,14 @@ public class FoxController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class FoxNPC extends CraftFox implements NPCHolder {
|
public static class FoxNPC extends CraftFox implements NPCHolder {
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package net.citizensnpcs.nms.v1_14_R1.entity;
|
package net.citizensnpcs.nms.v1_14_R1.entity;
|
||||||
|
|
||||||
import net.minecraft.server.v1_14_R1.Vec3D;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;
|
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity;
|
||||||
@ -17,7 +15,10 @@ import net.citizensnpcs.npc.CitizensNPC;
|
|||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityGhast;
|
import net.minecraft.server.v1_14_R1.EntityGhast;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_14_R1.SoundEffect;
|
import net.minecraft.server.v1_14_R1.SoundEffect;
|
||||||
@ -158,6 +159,14 @@ public class GhastController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
super.mobTick();
|
super.mobTick();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class GhastNPC extends CraftGhast implements NPCHolder {
|
public static class GhastNPC extends CraftGhast implements NPCHolder {
|
||||||
|
@ -16,7 +16,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityGiantZombie;
|
import net.minecraft.server.v1_14_R1.EntityGiantZombie;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
@ -186,6 +189,14 @@ public class GiantController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateSize() {
|
public void updateSize() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
|
@ -16,7 +16,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityGuardian;
|
import net.minecraft.server.v1_14_R1.EntityGuardian;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
@ -189,6 +192,14 @@ public class GuardianController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateSize() {
|
public void updateSize() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
|
@ -16,7 +16,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityGuardianElder;
|
import net.minecraft.server.v1_14_R1.EntityGuardianElder;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
@ -189,6 +192,14 @@ public class GuardianElderController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateSize() {
|
public void updateSize() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
|
@ -21,7 +21,10 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityHorse;
|
import net.minecraft.server.v1_14_R1.EntityHorse;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.GenericAttributes;
|
import net.minecraft.server.v1_14_R1.GenericAttributes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
@ -243,6 +246,14 @@ public class HorseController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class HorseNPC extends CraftHorse implements NPCHolder {
|
public static class HorseNPC extends CraftHorse implements NPCHolder {
|
||||||
|
@ -21,7 +21,10 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityHorseDonkey;
|
import net.minecraft.server.v1_14_R1.EntityHorseDonkey;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.GenericAttributes;
|
import net.minecraft.server.v1_14_R1.GenericAttributes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
@ -242,6 +245,14 @@ public class HorseDonkeyController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class HorseDonkeyNPC extends CraftDonkey implements NPCHolder {
|
public static class HorseDonkeyNPC extends CraftDonkey implements NPCHolder {
|
||||||
|
@ -21,7 +21,10 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityHorseMule;
|
import net.minecraft.server.v1_14_R1.EntityHorseMule;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.GenericAttributes;
|
import net.minecraft.server.v1_14_R1.GenericAttributes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
@ -242,6 +245,14 @@ public class HorseMuleController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class HorseMuleNPC extends CraftMule implements NPCHolder {
|
public static class HorseMuleNPC extends CraftMule implements NPCHolder {
|
||||||
|
@ -21,7 +21,10 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityHorseSkeleton;
|
import net.minecraft.server.v1_14_R1.EntityHorseSkeleton;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.GenericAttributes;
|
import net.minecraft.server.v1_14_R1.GenericAttributes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
@ -243,6 +246,14 @@ public class HorseSkeletonController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class HorseSkeletonNPC extends CraftSkeletonHorse implements NPCHolder {
|
public static class HorseSkeletonNPC extends CraftSkeletonHorse implements NPCHolder {
|
||||||
|
@ -21,7 +21,10 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityHorseZombie;
|
import net.minecraft.server.v1_14_R1.EntityHorseZombie;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.GenericAttributes;
|
import net.minecraft.server.v1_14_R1.GenericAttributes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
@ -243,6 +246,14 @@ public class HorseZombieController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class HorseZombieNPC extends CraftZombieHorse implements NPCHolder {
|
public static class HorseZombieNPC extends CraftZombieHorse implements NPCHolder {
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package net.citizensnpcs.nms.v1_14_R1.entity;
|
package net.citizensnpcs.nms.v1_14_R1.entity;
|
||||||
|
|
||||||
import net.minecraft.server.v1_14_R1.Vec3D;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;
|
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity;
|
||||||
@ -18,11 +16,15 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityIllagerIllusioner;
|
import net.minecraft.server.v1_14_R1.EntityIllagerIllusioner;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_14_R1.SoundEffect;
|
import net.minecraft.server.v1_14_R1.SoundEffect;
|
||||||
|
import net.minecraft.server.v1_14_R1.Vec3D;
|
||||||
import net.minecraft.server.v1_14_R1.World;
|
import net.minecraft.server.v1_14_R1.World;
|
||||||
|
|
||||||
public class IllusionerController extends MobEntityController {
|
public class IllusionerController extends MobEntityController {
|
||||||
@ -57,15 +59,6 @@ public class IllusionerController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void e(Vec3D vec3d) {
|
|
||||||
if (npc == null || !npc.isFlyable()) {
|
|
||||||
super.e(vec3d);
|
|
||||||
} else {
|
|
||||||
NMSImpl.flyingMoveLogic(this, vec3d);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void b(float f, float f1) {
|
public void b(float f, float f1) {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
@ -95,6 +88,15 @@ public class IllusionerController extends MobEntityController {
|
|||||||
return npc == null ? super.d(save) : false;
|
return npc == null ? super.d(save) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void e(Vec3D vec3d) {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.e(vec3d);
|
||||||
|
} else {
|
||||||
|
NMSImpl.flyingMoveLogic(this, vec3d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
@ -158,6 +160,15 @@ public class IllusionerController extends MobEntityController {
|
|||||||
return NMSImpl.getSoundEffect(npc, super.getSoundHurt(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.getSoundHurt(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isClimbing() {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
return super.isClimbing();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -180,12 +191,11 @@ public class IllusionerController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isClimbing() {
|
protected boolean n(Entity entity) {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
return super.isClimbing();
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return super.n(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityIronGolem;
|
import net.minecraft.server.v1_14_R1.EntityIronGolem;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
@ -186,6 +189,14 @@ public class IronGolemController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateSize() {
|
public void updateSize() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
|
@ -20,7 +20,10 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityLlama;
|
import net.minecraft.server.v1_14_R1.EntityLlama;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
@ -212,6 +215,14 @@ public class LlamaController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class LlamaNPC extends CraftLlama implements NPCHolder {
|
public static class LlamaNPC extends CraftLlama implements NPCHolder {
|
||||||
|
@ -17,8 +17,11 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityHuman;
|
import net.minecraft.server.v1_14_R1.EntityHuman;
|
||||||
import net.minecraft.server.v1_14_R1.EntityMagmaCube;
|
import net.minecraft.server.v1_14_R1.EntityMagmaCube;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
@ -182,6 +185,14 @@ public class MagmaCubeController extends MobEntityController {
|
|||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void pickup(EntityHuman human) {
|
public void pickup(EntityHuman human) {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
|
@ -17,7 +17,10 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityHuman;
|
import net.minecraft.server.v1_14_R1.EntityHuman;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityMushroomCow;
|
import net.minecraft.server.v1_14_R1.EntityMushroomCow;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.EnumHand;
|
import net.minecraft.server.v1_14_R1.EnumHand;
|
||||||
@ -207,6 +210,14 @@ public class MushroomCowController extends MobEntityController {
|
|||||||
if (npc != null)
|
if (npc != null)
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class MushroomCowNPC extends CraftMushroomCow implements NPCHolder {
|
public static class MushroomCowNPC extends CraftMushroomCow implements NPCHolder {
|
||||||
|
@ -17,6 +17,9 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityOcelot;
|
import net.minecraft.server.v1_14_R1.EntityOcelot;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
@ -206,6 +209,14 @@ public class OcelotController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class OcelotNPC extends CraftOcelot implements NPCHolder {
|
public static class OcelotNPC extends CraftOcelot implements NPCHolder {
|
||||||
|
@ -17,6 +17,9 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityPanda;
|
import net.minecraft.server.v1_14_R1.EntityPanda;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
@ -199,6 +202,14 @@ public class PandaController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class PandaNPC extends CraftPanda implements NPCHolder {
|
public static class PandaNPC extends CraftPanda implements NPCHolder {
|
||||||
|
@ -15,7 +15,10 @@ import net.citizensnpcs.npc.CitizensNPC;
|
|||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityHuman;
|
import net.minecraft.server.v1_14_R1.EntityHuman;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityParrot;
|
import net.minecraft.server.v1_14_R1.EntityParrot;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.EnumHand;
|
import net.minecraft.server.v1_14_R1.EnumHand;
|
||||||
@ -165,6 +168,14 @@ public class ParrotController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ParrotNPC extends CraftParrot implements NPCHolder {
|
public static class ParrotNPC extends CraftParrot implements NPCHolder {
|
||||||
|
@ -18,6 +18,9 @@ import net.minecraft.server.v1_14_R1.BlockPosition;
|
|||||||
import net.minecraft.server.v1_14_R1.ControllerLook;
|
import net.minecraft.server.v1_14_R1.ControllerLook;
|
||||||
import net.minecraft.server.v1_14_R1.ControllerMove;
|
import net.minecraft.server.v1_14_R1.ControllerMove;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityPhantom;
|
import net.minecraft.server.v1_14_R1.EntityPhantom;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.EnumDifficulty;
|
import net.minecraft.server.v1_14_R1.EnumDifficulty;
|
||||||
@ -203,6 +206,14 @@ public class PhantomController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
// avoid suicide
|
// avoid suicide
|
||||||
|
@ -17,7 +17,10 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityLightning;
|
import net.minecraft.server.v1_14_R1.EntityLightning;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityPig;
|
import net.minecraft.server.v1_14_R1.EntityPig;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
@ -207,6 +210,14 @@ public class PigController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLightningStrike(EntityLightning entitylightning) {
|
public void onLightningStrike(EntityLightning entitylightning) {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package net.citizensnpcs.nms.v1_14_R1.entity;
|
package net.citizensnpcs.nms.v1_14_R1.entity;
|
||||||
|
|
||||||
import net.minecraft.server.v1_14_R1.Vec3D;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;
|
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity;
|
||||||
@ -18,11 +16,15 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityPigZombie;
|
import net.minecraft.server.v1_14_R1.EntityPigZombie;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_14_R1.SoundEffect;
|
import net.minecraft.server.v1_14_R1.SoundEffect;
|
||||||
|
import net.minecraft.server.v1_14_R1.Vec3D;
|
||||||
import net.minecraft.server.v1_14_R1.World;
|
import net.minecraft.server.v1_14_R1.World;
|
||||||
|
|
||||||
public class PigZombieController extends MobEntityController {
|
public class PigZombieController extends MobEntityController {
|
||||||
@ -58,15 +60,6 @@ public class PigZombieController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void e(Vec3D vec3d) {
|
|
||||||
if (npc == null || !npc.isFlyable()) {
|
|
||||||
super.e(vec3d);
|
|
||||||
} else {
|
|
||||||
NMSImpl.flyingMoveLogic(this, vec3d);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void b(float f, float f1) {
|
public void b(float f, float f1) {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
@ -95,6 +88,15 @@ public class PigZombieController extends MobEntityController {
|
|||||||
return npc == null ? super.d(save) : false;
|
return npc == null ? super.d(save) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void e(Vec3D vec3d) {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
super.e(vec3d);
|
||||||
|
} else {
|
||||||
|
NMSImpl.flyingMoveLogic(this, vec3d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
@ -159,6 +161,15 @@ public class PigZombieController extends MobEntityController {
|
|||||||
return NMSImpl.getSoundEffect(npc, super.getSoundHurt(damagesource), NPC.HURT_SOUND_METADATA);
|
return NMSImpl.getSoundEffect(npc, super.getSoundHurt(damagesource), NPC.HURT_SOUND_METADATA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isClimbing() {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
return super.isClimbing();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
@ -181,12 +192,11 @@ public class PigZombieController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isClimbing() {
|
protected boolean n(Entity entity) {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
return super.isClimbing();
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return super.n(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@ package net.citizensnpcs.nms.v1_14_R1.entity;
|
|||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;
|
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftPillager;
|
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity;
|
||||||
|
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftPillager;
|
||||||
import org.bukkit.entity.Pillager;
|
import org.bukkit.entity.Pillager;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
@ -17,6 +17,9 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityPillager;
|
import net.minecraft.server.v1_14_R1.EntityPillager;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
@ -35,20 +38,6 @@ public class PillagerController extends MobEntityController {
|
|||||||
return (Pillager) super.getBukkitEntity();
|
return (Pillager) super.getBukkitEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class PillagerNPC extends CraftPillager implements NPCHolder {
|
|
||||||
private final CitizensNPC npc;
|
|
||||||
|
|
||||||
public PillagerNPC(EntityPillagerNPC entity) {
|
|
||||||
super((CraftServer) Bukkit.getServer(), entity);
|
|
||||||
this.npc = entity.npc;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NPC getNPC() {
|
|
||||||
return npc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class EntityPillagerNPC extends EntityPillager implements NPCHolder {
|
public static class EntityPillagerNPC extends EntityPillager implements NPCHolder {
|
||||||
boolean calledNMSHeight = false;
|
boolean calledNMSHeight = false;
|
||||||
private final CitizensNPC npc;
|
private final CitizensNPC npc;
|
||||||
@ -213,5 +202,27 @@ public class PillagerController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class PillagerNPC extends CraftPillager implements NPCHolder {
|
||||||
|
private final CitizensNPC npc;
|
||||||
|
|
||||||
|
public PillagerNPC(EntityPillagerNPC entity) {
|
||||||
|
super((CraftServer) Bukkit.getServer(), entity);
|
||||||
|
this.npc = entity.npc;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NPC getNPC() {
|
||||||
|
return npc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,9 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityPolarBear;
|
import net.minecraft.server.v1_14_R1.EntityPolarBear;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
import net.minecraft.server.v1_14_R1.NBTTagCompound;
|
||||||
@ -166,6 +169,14 @@ public class PolarBearController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class PolarBearNPC extends CraftPolarBear implements NPCHolder {
|
public static class PolarBearNPC extends CraftPolarBear implements NPCHolder {
|
||||||
|
@ -18,6 +18,9 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.ControllerMove;
|
import net.minecraft.server.v1_14_R1.ControllerMove;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityPose;
|
import net.minecraft.server.v1_14_R1.EntityPose;
|
||||||
import net.minecraft.server.v1_14_R1.EntityPufferFish;
|
import net.minecraft.server.v1_14_R1.EntityPufferFish;
|
||||||
import net.minecraft.server.v1_14_R1.EntitySize;
|
import net.minecraft.server.v1_14_R1.EntitySize;
|
||||||
@ -215,6 +218,14 @@ public class PufferFishController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
if (npc != null) {
|
if (npc != null) {
|
||||||
|
@ -18,7 +18,10 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
import net.minecraft.server.v1_14_R1.EntityLiving;
|
import net.minecraft.server.v1_14_R1.EntityLiving;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityRabbit;
|
import net.minecraft.server.v1_14_R1.EntityRabbit;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
@ -213,6 +216,14 @@ public class RabbitController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setRabbitType(int i) {
|
public void setRabbitType(int i) {
|
||||||
if (npc != null) {
|
if (npc != null) {
|
||||||
|
@ -2,8 +2,8 @@ package net.citizensnpcs.nms.v1_14_R1.entity;
|
|||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;
|
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftRavager;
|
|
||||||
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity;
|
||||||
|
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftRavager;
|
||||||
import org.bukkit.entity.Ravager;
|
import org.bukkit.entity.Ravager;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
@ -17,6 +17,9 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityRavager;
|
import net.minecraft.server.v1_14_R1.EntityRavager;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
@ -35,20 +38,6 @@ public class RavagerController extends MobEntityController {
|
|||||||
return (Ravager) super.getBukkitEntity();
|
return (Ravager) super.getBukkitEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class RavagerNPC extends CraftRavager implements NPCHolder {
|
|
||||||
private final CitizensNPC npc;
|
|
||||||
|
|
||||||
public RavagerNPC(EntityRavagerNPC entity) {
|
|
||||||
super((CraftServer) Bukkit.getServer(), entity);
|
|
||||||
this.npc = entity.npc;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NPC getNPC() {
|
|
||||||
return npc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class EntityRavagerNPC extends EntityRavager implements NPCHolder {
|
public static class EntityRavagerNPC extends EntityRavager implements NPCHolder {
|
||||||
boolean calledNMSHeight = false;
|
boolean calledNMSHeight = false;
|
||||||
private final CitizensNPC npc;
|
private final CitizensNPC npc;
|
||||||
@ -213,5 +202,27 @@ public class RavagerController extends MobEntityController {
|
|||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class RavagerNPC extends CraftRavager implements NPCHolder {
|
||||||
|
private final CitizensNPC npc;
|
||||||
|
|
||||||
|
public RavagerNPC(EntityRavagerNPC entity) {
|
||||||
|
super((CraftServer) Bukkit.getServer(), entity);
|
||||||
|
this.npc = entity.npc;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NPC getNPC() {
|
||||||
|
return npc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,9 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.ControllerMove;
|
import net.minecraft.server.v1_14_R1.ControllerMove;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntitySalmon;
|
import net.minecraft.server.v1_14_R1.EntitySalmon;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
@ -202,6 +205,14 @@ public class SalmonController extends MobEntityController {
|
|||||||
this.y = lastInWater;
|
this.y = lastInWater;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SalmonNPC extends CraftSalmon implements NPCHolder {
|
public static class SalmonNPC extends CraftSalmon implements NPCHolder {
|
||||||
|
@ -17,6 +17,9 @@ import net.citizensnpcs.util.Util;
|
|||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
import net.minecraft.server.v1_14_R1.DataWatcherObject;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntitySheep;
|
import net.minecraft.server.v1_14_R1.EntitySheep;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
@ -198,6 +201,14 @@ public class SheepController extends MobEntityController {
|
|||||||
if (npc != null)
|
if (npc != null)
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SheepNPC extends CraftSheep implements NPCHolder {
|
public static class SheepNPC extends CraftSheep implements NPCHolder {
|
||||||
|
@ -16,7 +16,10 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||||
import net.minecraft.server.v1_14_R1.DamageSource;
|
import net.minecraft.server.v1_14_R1.DamageSource;
|
||||||
|
import net.minecraft.server.v1_14_R1.Entity;
|
||||||
import net.minecraft.server.v1_14_R1.EntityAIBodyControl;
|
import net.minecraft.server.v1_14_R1.EntityAIBodyControl;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityBoat;
|
||||||
|
import net.minecraft.server.v1_14_R1.EntityMinecartAbstract;
|
||||||
import net.minecraft.server.v1_14_R1.EntityShulker;
|
import net.minecraft.server.v1_14_R1.EntityShulker;
|
||||||
import net.minecraft.server.v1_14_R1.EntityTypes;
|
import net.minecraft.server.v1_14_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_14_R1.IBlockData;
|
import net.minecraft.server.v1_14_R1.IBlockData;
|
||||||
@ -186,6 +189,14 @@ public class ShulkerController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean n(Entity entity) {
|
||||||
|
if (npc != null && (entity instanceof EntityBoat || entity instanceof EntityMinecartAbstract)) {
|
||||||
|
return !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
|
}
|
||||||
|
return super.n(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected EntityAIBodyControl o() {
|
protected EntityAIBodyControl o() {
|
||||||
return new EntityAIBodyControl(this);
|
return new EntityAIBodyControl(this);
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user