mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-31 20:51:47 +01:00
provide a configurable option to disable creeper lingering effect spawns
This commit is contained in:
parent
52c71f2edc
commit
918da37691
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
public Creeper(EntityType<? extends Creeper> type, Level world) {
|
public Creeper(EntityType<? extends Creeper> type, Level world) {
|
||||||
super(type, world);
|
super(type, world);
|
||||||
@@ -214,8 +222,19 @@
|
@@ -214,9 +222,20 @@
|
||||||
@Override
|
@Override
|
||||||
public void thunderHit(ServerLevel world, LightningBolt lightning) {
|
public void thunderHit(ServerLevel world, LightningBolt lightning) {
|
||||||
super.thunderHit(world, lightning);
|
super.thunderHit(world, lightning);
|
||||||
@ -33,15 +33,16 @@
|
|||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
this.entityData.set(Creeper.DATA_IS_POWERED, true);
|
this.entityData.set(Creeper.DATA_IS_POWERED, true);
|
||||||
}
|
}
|
||||||
+
|
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ public void setPowered(boolean powered) {
|
+ public void setPowered(boolean powered) {
|
||||||
+ this.entityData.set(Creeper.DATA_IS_POWERED, powered);
|
+ this.entityData.set(Creeper.DATA_IS_POWERED, powered);
|
||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
+
|
||||||
@Override
|
@Override
|
||||||
protected InteractionResult mobInteract(Player player, InteractionHand hand) {
|
protected InteractionResult mobInteract(Player player, InteractionHand hand) {
|
||||||
|
ItemStack itemstack = player.getItemInHand(hand);
|
||||||
@@ -226,8 +245,9 @@
|
@@ -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);
|
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 @@
|
@@ -258,9 +287,10 @@
|
||||||
if (!collection.isEmpty()) {
|
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());
|
AreaEffectCloud entityareaeffectcloud = new AreaEffectCloud(this.level(), this.getX(), this.getY(), this.getZ());
|
||||||
|
|
||||||
+ entityareaeffectcloud.setOwner(this); // CraftBukkit
|
+ entityareaeffectcloud.setOwner(this); // CraftBukkit
|
||||||
|
Loading…
Reference in New Issue
Block a user