provide a configurable option to disable creeper lingering effect spawns

This commit is contained in:
Shane Freeder 2017-06-11 21:01:18 +01:00
parent 52c71f2edc
commit 918da37691

View File

@ -22,7 +22,7 @@
public Creeper(EntityType<? extends Creeper> type, Level world) {
super(type, world);
@@ -214,8 +222,19 @@
@@ -214,9 +222,20 @@
@Override
public void thunderHit(ServerLevel world, LightningBolt lightning) {
super.thunderHit(world, lightning);
@ -33,15 +33,16 @@
+ // CraftBukkit end
this.entityData.set(Creeper.DATA_IS_POWERED, true);
}
+
+ // CraftBukkit start
+ public void setPowered(boolean powered) {
+ this.entityData.set(Creeper.DATA_IS_POWERED, powered);
+ }
+ // CraftBukkit end
+
@Override
protected InteractionResult mobInteract(Player player, InteractionHand hand) {
ItemStack itemstack = player.getItemInHand(hand);
@@ -226,8 +245,9 @@
this.level().playSound(player, this.getX(), this.getY(), this.getZ(), soundeffect, this.getSoundSource(), 1.0F, this.random.nextFloat() * 0.4F + 0.8F);
@ -76,8 +77,12 @@
}
}
@@ -261,6 +290,7 @@
if (!collection.isEmpty()) {
@@ -258,9 +287,10 @@
private void spawnLingeringCloud() {
Collection<MobEffectInstance> collection = this.getActiveEffects();
- if (!collection.isEmpty()) {
+ if (!collection.isEmpty() && !this.level().paperConfig().entities.behavior.disableCreeperLingeringEffect) { // Paper - Option to disable creeper lingering effect
AreaEffectCloud entityareaeffectcloud = new AreaEffectCloud(this.level(), this.getX(), this.getY(), this.getZ());
+ entityareaeffectcloud.setOwner(this); // CraftBukkit