Block ignition for protected creepers
This commit is contained in:
parent
c22916bb70
commit
98e95b6ffb
|
@ -111,6 +111,13 @@ public class CreeperController extends MobEntityController {
|
||||||
return npc == null ? super.d(save) : false;
|
return npc == null ? super.d(save) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dh() {
|
||||||
|
if (npc == null || !npc.isProtected()) {
|
||||||
|
super.dh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void e(float f, float f1) {
|
public void e(float f, float f1) {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
|
|
@ -103,6 +103,13 @@ public class CreeperController extends MobEntityController {
|
||||||
return npc == null ? super.d(save) : false;
|
return npc == null ? super.d(save) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dk() {
|
||||||
|
if (npc == null || !npc.isProtected()) {
|
||||||
|
super.dk();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void e(float f, float f1) {
|
public void e(float f, float f1) {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
|
|
@ -113,6 +113,13 @@ public class CreeperController extends MobEntityController {
|
||||||
return npc == null ? super.d(save) : false;
|
return npc == null ? super.d(save) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void do_() {
|
||||||
|
if (npc == null || !npc.isProtected()) {
|
||||||
|
super.do_();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void e(float f, float f1) {
|
public void e(float f, float f1) {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
|
|
@ -134,6 +134,13 @@ public class CreeperController extends MobEntityController {
|
||||||
return NMSImpl.getSoundEffect(npc, super.D(), NPC.Metadata.AMBIENT_SOUND);
|
return NMSImpl.getSoundEffect(npc, super.D(), NPC.Metadata.AMBIENT_SOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dB() {
|
||||||
|
if (npc == null || !npc.isProtected()) {
|
||||||
|
super.dB();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||||
NMS.enderTeleportTo(npc, () -> super.enderTeleportTo(d0, d1, d2));
|
NMS.enderTeleportTo(npc, () -> super.enderTeleportTo(d0, d1, d2));
|
||||||
|
|
|
@ -169,6 +169,13 @@ public class CreeperController extends MobEntityController {
|
||||||
return NMSImpl.getSoundEffect(npc, super.getSoundHurt(damagesource), NPC.Metadata.HURT_SOUND);
|
return NMSImpl.getSoundEffect(npc, super.getSoundHurt(damagesource), NPC.Metadata.HURT_SOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ignite() {
|
||||||
|
if (npc == null || !npc.isProtected()) {
|
||||||
|
super.ignite();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isClimbing() {
|
public boolean isClimbing() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
|
|
@ -163,6 +163,13 @@ public class CreeperController extends MobEntityController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ignite() {
|
||||||
|
if (npc == null || !npc.isProtected()) {
|
||||||
|
super.ignite();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isClimbing() {
|
public boolean isClimbing() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
|
|
@ -164,6 +164,13 @@ public class CreeperController extends MobEntityController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ignite() {
|
||||||
|
if (npc == null || !npc.isProtected()) {
|
||||||
|
super.ignite();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isClimbing() {
|
public boolean isClimbing() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
|
|
@ -133,6 +133,13 @@ public class CreeperController extends MobEntityController {
|
||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ignite() {
|
||||||
|
if (npc == null || !npc.isProtected()) {
|
||||||
|
super.ignite();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMSImpl.isLeashed(npc, super::isLeashed, this);
|
return NMSImpl.isLeashed(npc, super::isLeashed, this);
|
||||||
|
|
|
@ -133,6 +133,13 @@ public class CreeperController extends MobEntityController {
|
||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ignite() {
|
||||||
|
if (npc == null || !npc.isProtected()) {
|
||||||
|
super.ignite();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMSImpl.isLeashed(npc, super::isLeashed, this);
|
return NMSImpl.isLeashed(npc, super::isLeashed, this);
|
||||||
|
|
|
@ -134,6 +134,13 @@ public class CreeperController extends MobEntityController {
|
||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ignite() {
|
||||||
|
if (npc == null || !npc.isProtected()) {
|
||||||
|
super.ignite();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMSImpl.isLeashed(npc, super::isLeashed, this);
|
return NMSImpl.isLeashed(npc, super::isLeashed, this);
|
||||||
|
|
|
@ -6,6 +6,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreeper;
|
||||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||||
import org.bukkit.entity.Creeper;
|
import org.bukkit.entity.Creeper;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.nms.v1_8_R3.util.NMSBoundingBox;
|
import net.citizensnpcs.nms.v1_8_R3.util.NMSBoundingBox;
|
||||||
import net.citizensnpcs.nms.v1_8_R3.util.NMSImpl;
|
import net.citizensnpcs.nms.v1_8_R3.util.NMSImpl;
|
||||||
|
@ -98,6 +99,13 @@ public class CreeperController extends MobEntityController {
|
||||||
return NMSImpl.isLeashed(npc, super::cc, this);
|
return NMSImpl.isLeashed(npc, super::cc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void co() {
|
||||||
|
if (npc == null || !npc.isProtected()) {
|
||||||
|
super.co();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_8_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_8_R3.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
|
|
Loading…
Reference in New Issue