Files
Purpur/patches/server/0147-Add-mobGriefing-bypass-to-everything-affected.patch
2021-08-12 14:43:21 -07:00

699 lines
50 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Encode42 <me@encode42.dev>
Date: Tue, 5 Jan 2021 22:21:56 -0500
Subject: [PATCH] Add mobGriefing bypass to everything affected
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 91fd6709e66ee9c999ba7be3bec2689a5a01528c..a343738d971994c91ac42e41558ca05d6f9f8f57 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1682,7 +1682,7 @@ public abstract class LivingEntity extends Entity {
boolean flag = false;
if (this.dead && adversary instanceof WitherBoss) { // Paper
- if (this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
+ if (this.level.purpurConfig.witherBypassMobGriefing || this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur
BlockPos blockposition = this.blockPosition();
BlockState iblockdata = Blocks.WITHER_ROSE.defaultBlockState();
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 5128ee7630096ae87e2ce703b099057e9f769ee6..5bf98ddae4d3b141c3db3892a50638f1a4988e92 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -661,7 +661,7 @@ public abstract class Mob extends LivingEntity {
public void aiStep() {
super.aiStep();
this.level.getProfiler().push("looting");
- if (!this.level.isClientSide && this.canPickUpLoot() && this.isAlive() && !this.dead && this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
+ if (!this.level.isClientSide && this.canPickUpLoot() && this.isAlive() && !this.dead && (this.level.purpurConfig.entitiesPickUpLootBypassMobGriefing || this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) {
List<ItemEntity> list = this.level.getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate(1.0D, 0.0D, 1.0D));
Iterator iterator = list.iterator();
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java b/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java
index 8d6d47456ce6f9870f1a682665780a301b92fec5..b67b877e3fa9c00a0b88dbe3e8b0f0e9702537ed 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java
@@ -41,7 +41,7 @@ public class HarvestFarmland extends Behavior<Villager> {
}
protected boolean checkExtraStartConditions(ServerLevel world, Villager entity) {
- if (!world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
+ if (!world.purpurConfig.villagerBypassMobGriefing && !world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur
return false;
} else if (entity.getVillagerData().getProfession() != VillagerProfession.FARMER && !(world.purpurConfig.villagerClericsFarmWarts && entity.getVillagerData().getProfession() == VillagerProfession.CLERIC)) { // Purpur
return false;
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java
index 03bc86c776596ca5964c22adb757115d60980311..2eda2dc7f234c068f48af5b35803bc92321ee58a 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java
@@ -35,7 +35,7 @@ public class BreakDoorGoal extends DoorInteractGoal {
@Override
public boolean canUse() {
- return !super.canUse() ? false : (!this.mob.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? false : this.isValidDifficulty(this.mob.level.getDifficulty()) && !this.isOpen());
+ return !super.canUse() ? false : ((!this.mob.level.purpurConfig.zombieBypassMobGriefing && !this.mob.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) ? false : this.isValidDifficulty(this.mob.level.getDifficulty()) && !this.isOpen()); // Purpur
}
@Override
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java
index 0b745cdb751530794bf9d988c37aff17e2999114..044b2d63cbe95ac47dd1e2aa0786017dfbf3e831 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java
@@ -70,7 +70,7 @@ public class EatBlockGoal extends Goal {
if (EatBlockGoal.IS_TALL_GRASS.test(this.level.getBlockState(blockposition))) {
// CraftBukkit
- if (!CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition, Blocks.AIR.defaultBlockState(), !this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)).isCancelled()) {
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition, Blocks.AIR.defaultBlockState(), !this.level.purpurConfig.sheepBypassMobGriefing && !this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)).isCancelled()) { // Purpur
this.level.destroyBlock(blockposition, false);
}
@@ -81,7 +81,7 @@ public class EatBlockGoal extends Goal {
if (this.level.getBlockState(blockposition1).is(Blocks.GRASS_BLOCK)) {
// CraftBukkit
- if (!CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition, Blocks.AIR.defaultBlockState(), !this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)).isCancelled()) {
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition, Blocks.AIR.defaultBlockState(), !this.level.purpurConfig.sheepBypassMobGriefing && !this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)).isCancelled()) { // Purpur
this.level.levelEvent(2001, blockposition1, Block.getId(Blocks.GRASS_BLOCK.defaultBlockState()));
this.level.setBlock(blockposition1, Blocks.DIRT.defaultBlockState(), 2);
}
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java
index ac5779319081a6894373877067edf958da8a9cf5..24227a18ea1d0c06e2049542c8ca9c82ec7ce046 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java
@@ -40,7 +40,7 @@ public class RemoveBlockGoal extends MoveToBlockGoal {
@Override
public boolean canUse() {
- if (!this.removerMob.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
+ if (!this.removerMob.level.purpurConfig.zombieBypassMobGriefing && !this.removerMob.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur
return false;
} else if (this.nextStartTick > 0) {
--this.nextStartTick;
diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java
index ba1bfad397d62dd6feccdbbe3288997cfe16ce84..5750b42a3f522402e9cea573204cf31f6ab0c287 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Fox.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java
@@ -1346,7 +1346,7 @@ public class Fox extends Animal {
}
protected void onReachedTarget() {
- if (Fox.this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
+ if (Fox.this.level.purpurConfig.foxBypassMobGriefing || Fox.this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur
BlockState iblockdata = Fox.this.level.getBlockState(this.blockPos);
if (iblockdata.is(Blocks.SWEET_BERRY_BUSH)) {
diff --git a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
index 8d15e7ec0ae4bcdfd5628f41c0fc236eaa85d548..f2d5c9e5c93d2b93d5188491d0f6239bbdf84e78 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
@@ -611,7 +611,7 @@ public class Rabbit extends Animal {
@Override
public boolean canUse() {
if (this.nextStartTick <= 0) {
- if (!this.rabbit.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
+ if (!this.rabbit.level.purpurConfig.rabbitBypassMobGriefing && !this.rabbit.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur
return false;
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java b/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java
index 5e370d5137564ddcfb76a81b92d43e254f4a0ac4..0549e3d3cd3a9fddcb0d8edc56fb1fddc1c19802 100644
--- a/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java
+++ b/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java
@@ -125,7 +125,7 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
this.hurt(CraftEventFactory.MELTING, 1.0F); // CraftBukkit - DamageSource.BURN -> CraftEventFactory.MELTING
}
- if (!this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
+ if (!this.level.purpurConfig.snowGolemBypassMobGriefing && !this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur
return;
}
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
index f637cd740ec3801ce1c387473b5c4ff6080e76ec..3247f3f3c9d53953f8268c8f9575275126cf33a3 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
@@ -560,7 +560,7 @@ public class EnderDragon extends Mob implements Enemy {
BlockState iblockdata = this.level.getBlockState(blockposition);
if (!iblockdata.isAir() && iblockdata.getMaterial() != Material.FIRE) {
- if (this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) && !iblockdata.is((Tag) BlockTags.DRAGON_IMMUNE)) {
+ if ((this.level.purpurConfig.enderDragonBypassMobGriefing || this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) && !iblockdata.is((Tag) BlockTags.DRAGON_IMMUNE)) { // Purpur
// CraftBukkit start - Add blocks to list rather than destroying them
// flag1 = this.level.a(blockposition, false) || flag1;
flag1 = true;
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
index ee13bdfb5cfc9992d26126804c0a0bb512c2eb1e..bdcbe92cbe431727f5879a04bf734811ffd03c3d 100644
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
@@ -375,7 +375,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
i = this.getInvulnerableTicks() - 1;
this.bossEvent.setProgress(1.0F - (float) i / 220.0F);
if (i <= 0) {
- Explosion.BlockInteraction explosion_effect = this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.NONE;
+ Explosion.BlockInteraction explosion_effect = (this.level.purpurConfig.witherBypassMobGriefing || this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.NONE; // Purpur
// CraftBukkit start
// this.world.createExplosion(this, this.locX(), this.getHeadY(), this.locZ(), 7.0F, false, explosion_effect);
ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 7.0F, false);
@@ -471,7 +471,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
if (this.destroyBlocksTick > 0) {
--this.destroyBlocksTick;
- if (this.destroyBlocksTick == 0 && this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
+ if (this.destroyBlocksTick == 0 && (this.level.purpurConfig.witherBypassMobGriefing || this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // Purpur
i = Mth.floor(this.getY());
j = Mth.floor(this.getX());
int i1 = Mth.floor(this.getZ());
diff --git a/src/main/java/net/minecraft/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
index c7554c6c1a1787d976ad1fe0c78d86562464947e..c550b8c19837ed9bf730a3eb777bc00de4e7ceb2 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
@@ -340,7 +340,7 @@ public class Creeper extends Monster implements PowerableMob {
public void explodeCreeper() {
if (!this.level.isClientSide) {
- Explosion.BlockInteraction explosion_effect = this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) && level.purpurConfig.creeperAllowGriefing ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.NONE; // Purpur
+ Explosion.BlockInteraction explosion_effect = (this.level.purpurConfig.creeperBypassMobGriefing || this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) && level.purpurConfig.creeperAllowGriefing ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.NONE; // Purpur
float f = this.isPowered() ? 2.0F : 1.0F;
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
index c99d295b999a28dd1eb504179250445d1b61d099..96ad40de21a4f00df15ec5c0c8c130566ac27cd1 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
@@ -476,7 +476,7 @@ public class EnderMan extends Monster implements NeutralMob {
@Override
public boolean canUse() {
if (!enderman.level.purpurConfig.endermanAllowGriefing) return false; // Purpur
- return this.enderman.getCarriedBlock() == null ? false : (!this.enderman.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? false : this.enderman.getRandom().nextInt(2000) == 0);
+ return this.enderman.getCarriedBlock() != null ? false : (!this.enderman.level.purpurConfig.endermanBypassMobGriefing && !this.enderman.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? false : this.enderman.getRandom().nextInt(2000) == 0); // Purpur
}
@Override
@@ -524,7 +524,7 @@ public class EnderMan extends Monster implements NeutralMob {
@Override
public boolean canUse() {
if (!enderman.level.purpurConfig.endermanAllowGriefing) return false; // Purpur
- return this.enderman.getCarriedBlock() != null ? false : (!this.enderman.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? false : this.enderman.getRandom().nextInt(20) == 0);
+ return this.enderman.getCarriedBlock() == null ? false : (!this.enderman.level.purpurConfig.endermanBypassMobGriefing && !this.enderman.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? false : this.enderman.getRandom().nextInt(2000) == 0); // Purpur
}
@Override
diff --git a/src/main/java/net/minecraft/world/entity/monster/Evoker.java b/src/main/java/net/minecraft/world/entity/monster/Evoker.java
index 0ae0a49da681c6603d6f1504ee58f99b8f345e44..01b5a4e75af2aa4f9c59ca77fd91fe62d10fe39b 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Evoker.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Evoker.java
@@ -316,7 +316,7 @@ public class Evoker extends SpellcasterIllager {
return false;
} else if (Evoker.this.tickCount < this.nextAttackTickCount) {
return false;
- } else if (!Evoker.this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
+ } else if (!Evoker.this.level.purpurConfig.evokerBypassMobGriefing && !Evoker.this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur
return false;
} else {
List<Sheep> list = Evoker.this.level.getNearbyEntities(Sheep.class, this.wololoTargeting, Evoker.this, Evoker.this.getBoundingBox().inflate(16.0D, 4.0D, 16.0D));
diff --git a/src/main/java/net/minecraft/world/entity/monster/Ravager.java b/src/main/java/net/minecraft/world/entity/monster/Ravager.java
index b8c753a574487cdc045ea334229aafd257d6e223..4e72c6876dff1a03bb6736c8e90463cd51dadcb5 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Ravager.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Ravager.java
@@ -184,7 +184,7 @@ public class Ravager extends Raider {
this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(Mth.lerp(0.1D, d1, d0));
}
- if (this.horizontalCollision && this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
+ if (this.horizontalCollision && (this.level.purpurConfig.ravagerBypassMobGriefing || this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // Purpur
boolean flag = false;
AABB axisalignedbb = this.getBoundingBox().inflate(0.2D);
Iterator iterator = BlockPos.betweenClosed(Mth.floor(axisalignedbb.minX), Mth.floor(axisalignedbb.minY), Mth.floor(axisalignedbb.minZ), Mth.floor(axisalignedbb.maxX), Mth.floor(axisalignedbb.maxY), Mth.floor(axisalignedbb.maxZ)).iterator();
diff --git a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
index 0d60d6352294fadc1a26579a712b01cf0da681af..b9d5a03000b3b0759d786ac69e30d6a9d25146b3 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
@@ -195,7 +195,7 @@ public class Silverfish extends Monster {
continue;
}
// CraftBukkit end
- if (world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
+ if (world.purpurConfig.silverfishBypassMobGriefing || world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur
world.destroyBlock(blockposition1, true, this.silverfish);
} else {
world.setBlock(blockposition1, ((InfestedBlock) block).hostStateByInfested(world.getBlockState(blockposition1)), 3);
@@ -232,7 +232,7 @@ public class Silverfish extends Monster {
} else {
Random random = this.mob.getRandom();
- if (this.mob.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) && random.nextInt(10) == 0) {
+ if ((this.mob.level.purpurConfig.silverfishBypassMobGriefing || this.mob.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) && random.nextInt(10) == 0) { // Purpur
this.selectedDirection = Direction.getRandom(random);
BlockPos blockposition = (new BlockPos(this.mob.getX(), this.mob.getY() + 0.5D, this.mob.getZ())).relative(this.selectedDirection);
BlockState iblockdata = this.mob.level.getBlockState(blockposition);
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
index 073736808188218429c2612c06d7af82e81d0f83..e51d4254170a68900e95e697120d24b2b8b0ade4 100644
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
@@ -407,7 +407,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
@Override
public boolean wantsToPickUp(ItemStack stack) {
- return this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) && this.canPickUpLoot() && PiglinAi.wantsToPickup(this, stack);
+ return (this.level.purpurConfig.piglinBypassMobGriefing || this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) && this.canPickUpLoot() && PiglinAi.wantsToPickup(this, stack);
}
protected boolean canReplaceCurrentItem(ItemStack stack) {
diff --git a/src/main/java/net/minecraft/world/entity/projectile/LargeFireball.java b/src/main/java/net/minecraft/world/entity/projectile/LargeFireball.java
index e69213b43c8aa5a7c04add7a87482d531fbf52d2..f51ea103238b4a50439f5162a248cd9aa7f1a19b 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/LargeFireball.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/LargeFireball.java
@@ -18,20 +18,20 @@ public class LargeFireball extends Fireball {
public LargeFireball(EntityType<? extends LargeFireball> type, Level world) {
super(type, world);
- isIncendiary = this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // CraftBukkit
+ isIncendiary = this.level.purpurConfig.fireballsBypassMobGriefing || this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // CraftBukkit // Purpur
}
public LargeFireball(Level world, LivingEntity owner, double velocityX, double velocityY, double velocityZ, int explosionPower) {
super(EntityType.FIREBALL, owner, velocityX, velocityY, velocityZ, world);
this.explosionPower = explosionPower;
- isIncendiary = this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // CraftBukkit
+ isIncendiary = this.level.purpurConfig.fireballsBypassMobGriefing || this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // CraftBukkit // Purpur
}
@Override
protected void onHit(HitResult hitResult) {
super.onHit(hitResult);
if (!this.level.isClientSide) {
- boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
+ boolean flag = this.level.purpurConfig.fireballsBypassMobGriefing || this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // Purpur
// CraftBukkit start - fire ExplosionPrimeEvent
ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) this.getBukkitEntity());
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
index cecdafb496669419911ac7ea6db5a69f71f9be13..facd45496e966fe973de2e4cde93f01297932669 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
@@ -290,6 +290,6 @@ public abstract class Projectile extends Entity {
public boolean mayInteract(Level world, BlockPos pos) {
Entity entity = this.getOwner();
- return entity instanceof Player ? entity.mayInteract(world, pos) : entity == null || world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
+ return entity instanceof Player ? entity.mayInteract(world, pos) : entity == null || world.purpurConfig.projectilesBypassMobGriefing || world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
}
}
diff --git a/src/main/java/net/minecraft/world/entity/projectile/SmallFireball.java b/src/main/java/net/minecraft/world/entity/projectile/SmallFireball.java
index a6d75f20d6b7679d53c3c081c6632e9c303e2d74..af130b70b073939ceef70fa1b72841c511203dfc 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/SmallFireball.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/SmallFireball.java
@@ -25,7 +25,7 @@ public class SmallFireball extends Fireball {
super(EntityType.SMALL_FIREBALL, owner, velocityX, velocityY, velocityZ, world);
// CraftBukkit start
if (this.getOwner() != null && this.getOwner() instanceof Mob) {
- isIncendiary = this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
+ isIncendiary = this.level.purpurConfig.fireballsBypassMobGriefing || this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // Purpur
}
// CraftBukkit end
}
diff --git a/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java b/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java
index 46b74271ce5f614f07754db14d2a552c36f73226..430aa10101d9f21561155941ff24441fd0c4103a 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java
@@ -93,7 +93,7 @@ public class WitherSkull extends AbstractHurtingProjectile {
protected void onHit(HitResult hitResult) {
super.onHit(hitResult);
if (!this.level.isClientSide) {
- Explosion.BlockInteraction explosion_effect = this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.NONE;
+ Explosion.BlockInteraction explosion_effect = (this.level.purpurConfig.witherBypassMobGriefing || this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.NONE; // Purpur
// CraftBukkit start
// this.level.createExplosion(this, this.locX(), this.locY(), this.locZ(), 1.0F, false, explosion_effect);
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java
index 54b5cfa35e5fe9138d39a73f2085f594f1987cda..4efc0870fadc291260491b9cc4e048916633185f 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java
@@ -314,7 +314,7 @@ public abstract class Raider extends PatrollingMonster {
@Override
public boolean canUse() {
- if (!this.mob.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) || !this.mob.canPickUpLoot()) return false; // Paper - respect game and entity rules for picking up items
+ if ((!this.mob.level.purpurConfig.pillagerBypassMobGriefing && !this.mob.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) || !this.mob.canPickUpLoot()) return false; // Paper - respect game and entity rules for picking up items // Purpur
Raid raid = this.mob.getCurrentRaid();
if (this.mob.hasActiveRaid() && !this.mob.getCurrentRaid().isOver() && this.mob.canBeLeader() && !ItemStack.matches(this.mob.getItemBySlot(EquipmentSlot.HEAD), Raid.getLeaderBannerInstance())) {
diff --git a/src/main/java/net/minecraft/world/level/block/CropBlock.java b/src/main/java/net/minecraft/world/level/block/CropBlock.java
index 6dda5eeca4e310eceb2598322803bfafc184e9c7..3c51e6d419a244b9270119590aa299527163c331 100644
--- a/src/main/java/net/minecraft/world/level/block/CropBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CropBlock.java
@@ -164,7 +164,7 @@ public class CropBlock extends BushBlock implements BonemealableBlock {
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper
- if (entity instanceof Ravager && !CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState(), !world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)).isCancelled()) { // CraftBukkit
+ if (entity instanceof Ravager && !CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState(), (!world.purpurConfig.ravagerBypassMobGriefing && !world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))).isCancelled()) { // CraftBukkit // Purpur
world.destroyBlock(pos, true, entity);
}
diff --git a/src/main/java/net/minecraft/world/level/block/FarmBlock.java b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
index f2ddc1c9c4fa029544866b779b4b035924014048..2a33fbdc1d047584b0cd4b3da5892ccd7efc6943 100644
--- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
@@ -99,7 +99,7 @@ public class FarmBlock extends Block {
@Override
public void fallOn(Level world, BlockState state, BlockPos pos, Entity entity, float fallDistance) {
super.fallOn(world, state, pos, entity, fallDistance); // CraftBukkit - moved here as game rules / events shouldn't affect fall damage.
- if (!world.isClientSide && world.random.nextFloat() < fallDistance - 0.5F && entity instanceof LivingEntity && (entity instanceof Player || world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) && entity.getBbWidth() * entity.getBbWidth() * entity.getBbHeight() > 0.512F) {
+ if (!world.isClientSide && world.random.nextFloat() < fallDistance - 0.5F && entity instanceof LivingEntity && (entity instanceof Player || world.purpurConfig.farmlandBypassMobGriefing || world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) && entity.getBbWidth() * entity.getBbWidth() * entity.getBbHeight() > 0.512F) { // Purpur
// CraftBukkit start - Interact soil
org.bukkit.event.Cancellable cancellable;
if (entity instanceof Player) {
diff --git a/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java b/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java
index 1187a7382b8849524f99bbd8d12b43677f1053cd..ddce552c4374715e9652cfda3622b70d9be854f9 100644
--- a/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java
@@ -71,7 +71,7 @@ public class PowderSnowBlock extends Block implements BucketPickup {
if (!world.isClientSide) {
// CraftBukkit start
if (entity.isOnFire() && entity.mayInteract(world, pos)) {
- if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState(), !(world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) || entity instanceof Player)).isCancelled()) {
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState(), !((world.purpurConfig.powderSnowBypassMobGriefing || world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) || entity instanceof Player)).isCancelled()) {
return;
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java
index e98fc3c235f9160f1928a8afb0d7991a6d3430cb..db35f756b7adb6b113659ae13b08ab8921944c21 100644
--- a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java
@@ -205,7 +205,7 @@ public class TurtleEggBlock extends Block {
return false;
}
if (entity instanceof LivingEntity && !(entity instanceof Player)) {
- return world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
+ return world.purpurConfig.turtleEggsBypassMobGriefing || world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
}
return true;
// Purpur end
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index e1d0c95da94274d6c9bfbf05490a94c0c39cbd19..56689e99f3f11cc91b9b01bf22bbce6407d90122 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -368,9 +368,12 @@ public class PurpurWorldConfig {
public boolean boatsDoFallDamage = true;
public boolean disableDropsOnCrammingDeath = false;
public boolean entitiesCanUsePortals = true;
+ public boolean entitiesPickUpLootBypassMobGriefing = false;
+ public boolean fireballsBypassMobGriefing = false;
public boolean milkCuresBadOmen = true;
public boolean persistentTileEntityDisplayNames = false;
public boolean persistentDroppableEntityDisplayNames = false;
+ public boolean projectilesBypassMobGriefing = false;
public double tridentLoyaltyVoidReturnHeight = 0.0D;
public double voidDamageHeight = -64.0D;
public double voidDamageDealt = 4.0D;
@@ -382,9 +385,12 @@ public class PurpurWorldConfig {
boatsDoFallDamage = getBoolean("gameplay-mechanics.boat.do-fall-damage", boatsDoFallDamage);
disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
entitiesCanUsePortals = getBoolean("gameplay-mechanics.entities-can-use-portals", entitiesCanUsePortals);
+ entitiesPickUpLootBypassMobGriefing = getBoolean("gameplay-mechanics.entities-pick-up-loot-bypass-mob-griefing", entitiesPickUpLootBypassMobGriefing);
+ fireballsBypassMobGriefing = getBoolean("gameplay-mechanics.fireballs-bypass-mob-griefing", fireballsBypassMobGriefing);
milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen);
persistentTileEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-tileentity-display-names-and-lore", persistentTileEntityDisplayNames);
persistentDroppableEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-droppable-entity-display-names", persistentDroppableEntityDisplayNames);
+ projectilesBypassMobGriefing = getBoolean("gameplay-mechanics.projectiles-bypass-mob-griefing", projectilesBypassMobGriefing);
tridentLoyaltyVoidReturnHeight = getDouble("gameplay-mechanics.trident-loyalty-void-return-height", tridentLoyaltyVoidReturnHeight);
voidDamageHeight = getDouble("gameplay-mechanics.void-damage-height", voidDamageHeight);
voidDamageDealt = getDouble("gameplay-mechanics.void-damage-dealt", voidDamageDealt);
@@ -454,9 +460,11 @@ public class PurpurWorldConfig {
dispenserPlaceAnvils = getBoolean("blocks.dispenser.place-anvils", dispenserPlaceAnvils);
}
+ public boolean farmlandBypassMobGriefing = false;
public boolean farmlandGetsMoistFromBelow = false;
public boolean farmlandAlpha = false;
private void farmlandSettings() {
+ farmlandBypassMobGriefing = getBoolean("blocks.farmland.bypass-mob-griefing", farmlandBypassMobGriefing);
farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow);
farmlandAlpha = getBoolean("blocks.farmland.use-alpha-farmland", farmlandAlpha);
}
@@ -488,6 +496,11 @@ public class PurpurWorldConfig {
kelpMaxGrowthAge = getInt("blocks.kelp.max-growth-age", kelpMaxGrowthAge);
}
+ public boolean powderSnowBypassMobGriefing = false;
+ private void powderSnowSettings() {
+ powderSnowBypassMobGriefing = getBoolean("blocks.powder_snow.bypass-mob-griefing", powderSnowBypassMobGriefing);
+ }
+
public boolean respawnAnchorExplode = true;
public double respawnAnchorExplosionPower = 5.0D;
public boolean respawnAnchorExplosionFire = true;
@@ -521,6 +534,11 @@ public class PurpurWorldConfig {
stonecutterDamage = (float) getDouble("blocks.stonecutter.damage", stonecutterDamage);
}
+ public boolean turtleEggsBypassMobGriefing = false;
+ private void turtleSettings() {
+ turtleEggsBypassMobGriefing = getBoolean("blocks.turtle_egg.bypass-mob-griefing", turtleEggsBypassMobGriefing);
+ }
+
public double twistingVinesGrowthModifier = 0.10D;
public int twistingVinesMaxGrowthAge = 25;
private void twistingVinesSettings() {
@@ -705,6 +723,7 @@ public class PurpurWorldConfig {
public double creeperMaxHealth = 20.0D;
public double creeperChargedChance = 0.0D;
public boolean creeperAllowGriefing = true;
+ public boolean creeperBypassMobGriefing = false;
private void creeperSettings() {
creeperRidable = getBoolean("mobs.creeper.ridable", creeperRidable);
creeperRidableInWater = getBoolean("mobs.creeper.ridable-in-water", creeperRidableInWater);
@@ -716,6 +735,7 @@ public class PurpurWorldConfig {
creeperMaxHealth = getDouble("mobs.creeper.attributes.max_health", creeperMaxHealth);
creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
creeperAllowGriefing = getBoolean("mobs.creeper.allow-griefing", creeperAllowGriefing);
+ creeperBypassMobGriefing = getBoolean("mobs.creeper.bypass-mob-griefing", creeperBypassMobGriefing);
}
public boolean dolphinRidable = false;
@@ -803,6 +823,7 @@ public class PurpurWorldConfig {
public double enderDragonMaxY = 256D;
public double enderDragonMaxHealth = 200.0D;
public boolean enderDragonAlwaysDropsFullExp = false;
+ public boolean enderDragonBypassMobGriefing = false;
private void enderDragonSettings() {
enderDragonRidable = getBoolean("mobs.ender_dragon.ridable", enderDragonRidable);
enderDragonRidableInWater = getBoolean("mobs.ender_dragon.ridable-in-water", enderDragonRidableInWater);
@@ -818,6 +839,7 @@ public class PurpurWorldConfig {
}
enderDragonMaxHealth = getDouble("mobs.ender_dragon.attributes.max_health", enderDragonMaxHealth);
enderDragonAlwaysDropsFullExp = getBoolean("mobs.ender_dragon.always-drop-full-exp", enderDragonAlwaysDropsFullExp);
+ enderDragonBypassMobGriefing = getBoolean("mobs.ender_dragon.bypass-mob-griefing", enderDragonBypassMobGriefing);
}
public boolean endermanRidable = false;
@@ -825,6 +847,7 @@ public class PurpurWorldConfig {
public double endermanMaxHealth = 40.0D;
public boolean endermanAllowGriefing = true;
public boolean endermanDespawnEvenWithBlock = false;
+ public boolean endermanBypassMobGriefing = false;
private void endermanSettings() {
endermanRidable = getBoolean("mobs.enderman.ridable", endermanRidable);
endermanRidableInWater = getBoolean("mobs.enderman.ridable-in-water", endermanRidableInWater);
@@ -836,6 +859,7 @@ public class PurpurWorldConfig {
endermanMaxHealth = getDouble("mobs.enderman.attributes.max_health", endermanMaxHealth);
endermanAllowGriefing = getBoolean("mobs.enderman.allow-griefing", endermanAllowGriefing);
endermanDespawnEvenWithBlock = getBoolean("mobs.enderman.can-despawn-with-held-block", endermanDespawnEvenWithBlock);
+ endermanBypassMobGriefing = getBoolean("mobs.enderman.bypass-mob-griefing", endermanBypassMobGriefing);
}
public boolean endermiteRidable = false;
@@ -855,6 +879,7 @@ public class PurpurWorldConfig {
public boolean evokerRidable = false;
public boolean evokerRidableInWater = false;
public double evokerMaxHealth = 24.0D;
+ public boolean evokerBypassMobGriefing = false;
private void evokerSettings() {
evokerRidable = getBoolean("mobs.evoker.ridable", evokerRidable);
evokerRidableInWater = getBoolean("mobs.evoker.ridable-in-water", evokerRidableInWater);
@@ -864,6 +889,7 @@ public class PurpurWorldConfig {
set("mobs.evoker.attributes.max_health", oldValue);
}
evokerMaxHealth = getDouble("mobs.evoker.attributes.max_health", evokerMaxHealth);
+ evokerBypassMobGriefing = getBoolean("mobs.evoker.bypass-mob-griefing", evokerBypassMobGriefing);
}
public boolean foxRidable = false;
@@ -871,6 +897,7 @@ public class PurpurWorldConfig {
public double foxMaxHealth = 10.0D;
public boolean foxTypeChangesWithTulips = false;
public int foxBreedingTicks = 6000;
+ public boolean foxBypassMobGriefing = false;
private void foxSettings() {
foxRidable = getBoolean("mobs.fox.ridable", foxRidable);
foxRidableInWater = getBoolean("mobs.fox.ridable-in-water", foxRidableInWater);
@@ -882,6 +909,7 @@ public class PurpurWorldConfig {
foxMaxHealth = getDouble("mobs.fox.attributes.max_health", foxMaxHealth);
foxTypeChangesWithTulips = getBoolean("mobs.fox.tulips-change-type", foxTypeChangesWithTulips);
foxBreedingTicks = getInt("mobs.fox.breeding-delay-ticks", foxBreedingTicks);
+ foxBypassMobGriefing = getBoolean("mobs.fox.bypass-mob-griefing", foxBypassMobGriefing);
}
public boolean ghastRidable = false;
@@ -1277,6 +1305,7 @@ public class PurpurWorldConfig {
public boolean piglinRidable = false;
public boolean piglinRidableInWater = false;
public double piglinMaxHealth = 16.0D;
+ public boolean piglinBypassMobGriefing = false;
private void piglinSettings() {
piglinRidable = getBoolean("mobs.piglin.ridable", piglinRidable);
piglinRidableInWater = getBoolean("mobs.piglin.ridable-in-water", piglinRidableInWater);
@@ -1286,6 +1315,7 @@ public class PurpurWorldConfig {
set("mobs.piglin.attributes.max_health", oldValue);
}
piglinMaxHealth = getDouble("mobs.piglin.attributes.max_health", piglinMaxHealth);
+ piglinBypassMobGriefing = getBoolean("mobs.piglin.bypass-mob-griefing", piglinBypassMobGriefing);
}
public boolean piglinBruteRidable = false;
@@ -1305,6 +1335,7 @@ public class PurpurWorldConfig {
public boolean pillagerRidable = false;
public boolean pillagerRidableInWater = false;
public double pillagerMaxHealth = 24.0D;
+ public boolean pillagerBypassMobGriefing = false;
private void pillagerSettings() {
pillagerRidable = getBoolean("mobs.pillager.ridable", pillagerRidable);
pillagerRidableInWater = getBoolean("mobs.pillager.ridable-in-water", pillagerRidableInWater);
@@ -1314,6 +1345,7 @@ public class PurpurWorldConfig {
set("mobs.pillager.attributes.max_health", oldValue);
}
pillagerMaxHealth = getDouble("mobs.pillager.attributes.max_health", pillagerMaxHealth);
+ pillagerBypassMobGriefing = getBoolean("mobs.pillager.bypass-mob-griefing", pillagerBypassMobGriefing);
}
public boolean polarBearRidable = false;
@@ -1355,6 +1387,7 @@ public class PurpurWorldConfig {
public double rabbitNaturalToast = 0.0D;
public double rabbitNaturalKiller = 0.0D;
public int rabbitBreedingTicks = 6000;
+ public boolean rabbitBypassMobGriefing = false;
private void rabbitSettings() {
rabbitRidable = getBoolean("mobs.rabbit.ridable", rabbitRidable);
rabbitRidableInWater = getBoolean("mobs.rabbit.ridable-in-water", rabbitRidableInWater);
@@ -1367,11 +1400,13 @@ public class PurpurWorldConfig {
rabbitNaturalToast = getDouble("mobs.rabbit.spawn-toast-chance", rabbitNaturalToast);
rabbitNaturalKiller = getDouble("mobs.rabbit.spawn-killer-rabbit-chance", rabbitNaturalKiller);
rabbitBreedingTicks = getInt("mobs.rabbit.breeding-delay-ticks", rabbitBreedingTicks);
+ rabbitBypassMobGriefing = getBoolean("mobs.rabbit.bypass-mob-griefing", rabbitBypassMobGriefing);
}
public boolean ravagerRidable = false;
public boolean ravagerRidableInWater = false;
public double ravagerMaxHealth = 100.0D;
+ public boolean ravagerBypassMobGriefing = false;
private void ravagerSettings() {
ravagerRidable = getBoolean("mobs.ravager.ridable", ravagerRidable);
ravagerRidableInWater = getBoolean("mobs.ravager.ridable-in-water", ravagerRidableInWater);
@@ -1381,6 +1416,7 @@ public class PurpurWorldConfig {
set("mobs.ravager.attributes.max_health", oldValue);
}
ravagerMaxHealth = getDouble("mobs.ravager.attributes.max_health", ravagerMaxHealth);
+ ravagerBypassMobGriefing = getBoolean("mobs.ravager.bypass-mob-griefing", ravagerBypassMobGriefing);
}
public boolean salmonRidable = false;
@@ -1399,6 +1435,7 @@ public class PurpurWorldConfig {
public boolean sheepRidableInWater = false;
public double sheepMaxHealth = 8.0D;
public int sheepBreedingTicks = 6000;
+ public boolean sheepBypassMobGriefing = false;
private void sheepSettings() {
sheepRidable = getBoolean("mobs.sheep.ridable", sheepRidable);
sheepRidableInWater = getBoolean("mobs.sheep.ridable-in-water", sheepRidableInWater);
@@ -1409,6 +1446,7 @@ public class PurpurWorldConfig {
}
sheepMaxHealth = getDouble("mobs.sheep.attributes.max_health", sheepMaxHealth);
sheepBreedingTicks = getInt("mobs.sheep.breeding-delay-ticks", sheepBreedingTicks);
+ sheepBypassMobGriefing = getBoolean("mobs.sheep.bypass-mob-griefing", sheepBypassMobGriefing);
}
public boolean shulkerRidable = false;
@@ -1428,6 +1466,7 @@ public class PurpurWorldConfig {
public boolean silverfishRidable = false;
public boolean silverfishRidableInWater = false;
public double silverfishMaxHealth = 8.0D;
+ public boolean silverfishBypassMobGriefing = false;
private void silverfishSettings() {
silverfishRidable = getBoolean("mobs.silverfish.ridable", silverfishRidable);
silverfishRidableInWater = getBoolean("mobs.silverfish.ridable-in-water", silverfishRidableInWater);
@@ -1437,6 +1476,7 @@ public class PurpurWorldConfig {
set("mobs.silverfish.attributes.max_health", oldValue);
}
silverfishMaxHealth = getDouble("mobs.silverfish.attributes.max_health", silverfishMaxHealth);
+ silverfishBypassMobGriefing = getBoolean("mobs.silverfish.bypass-mob-griefing", silverfishBypassMobGriefing);
}
public boolean skeletonRidable = false;
@@ -1504,6 +1544,7 @@ public class PurpurWorldConfig {
public int snowGolemSnowBallMax = 20;
public float snowGolemSnowBallModifier = 10.0F;
public double snowGolemAttackDistance = 1.25D;
+ public boolean snowGolemBypassMobGriefing = false;
private void snowGolemSettings() {
snowGolemRidable = getBoolean("mobs.snow_golem.ridable", snowGolemRidable);
snowGolemRidableInWater = getBoolean("mobs.snow_golem.ridable-in-water", snowGolemRidableInWater);
@@ -1520,6 +1561,7 @@ public class PurpurWorldConfig {
snowGolemSnowBallMax = getInt("mobs.snow_golem.max-shoot-interval-ticks", snowGolemSnowBallMax);
snowGolemSnowBallModifier = (float) getDouble("mobs.snow_golem.snow-ball-modifier", snowGolemSnowBallModifier);
snowGolemAttackDistance = getDouble("mobs.snow_golem.attack-distance", snowGolemAttackDistance);
+ snowGolemBypassMobGriefing = getBoolean("mobs.snow_golem.bypass-mob-griefing", snowGolemBypassMobGriefing);
}
public boolean squidRidable = false;
@@ -1679,6 +1721,7 @@ public class PurpurWorldConfig {
public int villagerLobotomizeCheck = 60;
public boolean villagerClericsFarmWarts = false;
public boolean villagerClericFarmersThrowWarts = true;
+ public boolean villagerBypassMobGriefing = false;
private void villagerSettings() {
villagerRidable = getBoolean("mobs.villager.ridable", villagerRidable);
villagerRidableInWater = getBoolean("mobs.villager.ridable-in-water", villagerRidableInWater);
@@ -1705,6 +1748,7 @@ public class PurpurWorldConfig {
villagerLobotomizeCheck = getInt("mobs.villager.lobotomize.check-interval", villagerLobotomizeCheck);
villagerClericsFarmWarts = getBoolean("mobs.villager.clerics-farm-warts", villagerClericsFarmWarts);
villagerClericFarmersThrowWarts = getBoolean("mobs.villager.cleric-wart-farmers-throw-warts-at-villagers", villagerClericFarmersThrowWarts);
+ villagerBypassMobGriefing = getBoolean("mobs.villager.bypass-mob-griefing", villagerBypassMobGriefing);
}
public boolean vindicatorRidable = false;
@@ -1761,6 +1805,7 @@ public class PurpurWorldConfig {
public double witherMaxHealth = 300.0D;
public float witherHealthRegenAmount = 1.0f;
public int witherHealthRegenDelay = 20;
+ public boolean witherBypassMobGriefing = false;
private void witherSettings() {
witherRidable = getBoolean("mobs.wither.ridable", witherRidable);
witherRidableInWater = getBoolean("mobs.wither.ridable-in-water", witherRidableInWater);
@@ -1777,6 +1822,7 @@ public class PurpurWorldConfig {
witherMaxHealth = getDouble("mobs.wither.attributes.max_health", witherMaxHealth);
witherHealthRegenAmount = (float) getDouble("mobs.wither.health-regen-amount", witherHealthRegenAmount);
witherHealthRegenDelay = getInt("mobs.wither.health-regen-delay", witherHealthRegenDelay);
+ witherBypassMobGriefing = getBoolean("mobs.wither.bypass-mob-griefing", witherBypassMobGriefing);
}
public boolean witherSkeletonRidable = false;
@@ -1842,6 +1888,7 @@ public class PurpurWorldConfig {
public boolean zombieJockeyTryExistingChickens = true;
public boolean zombieAggressiveTowardsVillagerWhenLagging = true;
public Difficulty zombieBreakDoorMinDifficulty = Difficulty.HARD;
+ public boolean zombieBypassMobGriefing = false;
private void zombieSettings() {
zombieRidable = getBoolean("mobs.zombie.ridable", zombieRidable);
zombieRidableInWater = getBoolean("mobs.zombie.ridable-in-water", zombieRidableInWater);
@@ -1861,6 +1908,7 @@ public class PurpurWorldConfig {
} catch (IllegalArgumentException ignore) {
zombieBreakDoorMinDifficulty = Difficulty.HARD;
}
+ zombieBypassMobGriefing = getBoolean("mobs.zombie.bypass-mob-griefing", zombieBypassMobGriefing);
}
public boolean zombieHorseRidableInWater = false;