mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Add ghast allow-griefing option
This commit is contained in:
59
patches/server/0175-Add-ghast-allow-griefing-option.patch
Normal file
59
patches/server/0175-Add-ghast-allow-griefing-option.patch
Normal file
@@ -0,0 +1,59 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 13 Feb 2021 14:02:43 -0600
|
||||
Subject: [PATCH] Add ghast allow-griefing option
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityGhast.java b/src/main/java/net/minecraft/server/EntityGhast.java
|
||||
index 2c0148229283f95bed3c8f33cc02a31d6f682191..db96d2bb02dfeea4136eb587a7bd744c9eb30bf3 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityGhast.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityGhast.java
|
||||
@@ -198,6 +198,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
}
|
||||
|
||||
EntityLargeFireball entitylargefireball = new EntityLargeFireball(world, this.ghast, d2, d3, d4);
|
||||
+ entitylargefireball.canCauseGrief = world.purpurConfig.ghastAllowGriefing; // Purpur
|
||||
|
||||
// CraftBukkit - set bukkitYield when setting explosionpower
|
||||
entitylargefireball.bukkitYield = entitylargefireball.yield = this.ghast.getPower();
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLargeFireball.java b/src/main/java/net/minecraft/server/EntityLargeFireball.java
|
||||
index 3f3be1b2ded6ad118ae7860c1231c7affc0715b6..48174610518af8d053149e609c1b140e1ae6ba61 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLargeFireball.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLargeFireball.java
|
||||
@@ -5,6 +5,7 @@ import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit
|
||||
public class EntityLargeFireball extends EntityFireballFireball {
|
||||
|
||||
public int yield = 1;
|
||||
+ public boolean canCauseGrief = true; // Purpur
|
||||
|
||||
public EntityLargeFireball(EntityTypes<? extends EntityLargeFireball> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -20,7 +21,7 @@ public class EntityLargeFireball extends EntityFireballFireball {
|
||||
protected void a(MovingObjectPosition movingobjectposition) {
|
||||
super.a(movingobjectposition);
|
||||
if (!this.world.isClientSide) {
|
||||
- boolean flag = this.world.purpurConfig.fireballsBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING); // Purpur
|
||||
+ boolean flag = isIncendiary = canCauseGrief && (this.world.purpurConfig.fireballsBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)); // Purpur
|
||||
|
||||
// CraftBukkit start - fire ExplosionPrimeEvent
|
||||
ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) this.getBukkitEntity());
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index a87222235fa3152c64d12c202734816a746d57ca..b8ff5d5e323f1288e35d6cb718a176082709a708 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -866,6 +866,7 @@ public class PurpurWorldConfig {
|
||||
public boolean ghastRidable = false;
|
||||
public boolean ghastRidableInWater = false;
|
||||
public double ghastMaxY = 256D;
|
||||
+ public boolean ghastAllowGriefing = true;
|
||||
public double ghastMaxHealth = 10.0D;
|
||||
private void ghastSettings() {
|
||||
ghastRidable = getBoolean("mobs.ghast.ridable", ghastRidable);
|
||||
@@ -876,6 +877,7 @@ public class PurpurWorldConfig {
|
||||
set("mobs.ghast.attributes.max-health", null);
|
||||
set("mobs.ghast.attributes.max_health", oldValue);
|
||||
}
|
||||
+ ghastAllowGriefing = getBoolean("mobs.ghast.allow-griefing", ghastAllowGriefing);
|
||||
ghastMaxHealth = getDouble("mobs.ghast.attributes.max_health", ghastMaxHealth);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user