mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 09:57:43 +01:00
progress
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 13 Feb 2021 14:02:43 -0600
|
||||
Subject: [PATCH] Add ghast allow-griefing option
|
||||
|
||||
fireball griefing is already covered by another patch
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityGhast.java b/src/main/java/net/minecraft/world/entity/monster/EntityGhast.java
|
||||
index e83d9aae4a04fc67587d40cec1f24ba5ebb58e10..5834b38ab206a9db6d3e336074095ce85bdbcc50 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntityGhast.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityGhast.java
|
||||
@@ -230,6 +230,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/world/entity/projectile/EntityLargeFireball.java b/src/main/java/net/minecraft/world/entity/projectile/EntityLargeFireball.java
|
||||
index 61f06eacb4ea4ef869b60c9014cc23b25583eead..627915ee205fdcc93c5424ad7d7ea05783bc07ad 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/EntityLargeFireball.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/EntityLargeFireball.java
|
||||
@@ -16,6 +16,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);
|
||||
@@ -31,7 +32,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 266b64abb949fca2cc667395d175c962c55435db..23f7a3af8f92fd6e89601b0e1b4b2d1635dfe0b0 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -926,6 +926,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);
|
||||
@@ -936,6 +937,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