Prevent magma cubes from damaging players

This commit is contained in:
fullwall 2018-03-15 17:21:44 +08:00
parent a1d1a6cc13
commit e20e45169a
3 changed files with 24 additions and 0 deletions

View File

@ -16,6 +16,7 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityHuman;
import net.minecraft.server.v1_10_R1.EntityMagmaCube;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -75,6 +76,13 @@ public class MagmaCubeController extends MobEntityController {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
@Override
public void d(EntityHuman human) {
if (npc == null) {
super.d(human);
}
}
@Override
public boolean d(NBTTagCompound save) {
return npc == null ? super.d(save) : false;

View File

@ -16,6 +16,7 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.EntityHuman;
import net.minecraft.server.v1_11_R1.EntityMagmaCube;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
@ -83,6 +84,13 @@ public class MagmaCubeController extends MobEntityController {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
@Override
public void d(EntityHuman human) {
if (npc == null) {
super.d(human);
}
}
@Override
public boolean d(NBTTagCompound save) {
return npc == null ? super.d(save) : false;

View File

@ -17,6 +17,7 @@ import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_12_R1.BlockPosition;
import net.minecraft.server.v1_12_R1.DamageSource;
import net.minecraft.server.v1_12_R1.EntityHuman;
import net.minecraft.server.v1_12_R1.EntityMagmaCube;
import net.minecraft.server.v1_12_R1.IBlockData;
import net.minecraft.server.v1_12_R1.NBTTagCompound;
@ -93,6 +94,13 @@ public class MagmaCubeController extends MobEntityController {
return NMSImpl.getSoundEffect(npc, super.d(damagesource), NPC.HURT_SOUND_METADATA);
}
@Override
public void d(EntityHuman human) {
if (npc == null) {
super.d(human);
}
}
@Override
public boolean d(NBTTagCompound save) {
return npc == null ? super.d(save) : false;