mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: b75eeca0 Boost light task priority to ensure it doesnt hold up chunk loads 3d2bc848 Ensure VillagerTrades doesn't load async - fixes #3495 e470f1ef Add more information to Timing Reports f4a47db6 Improve Thread Pool usage to allow single threads for single cpu servers a4fe910f Fix sounds when using worldedit regen command 70ad51a8 Updated Upstream (Bukkit/CraftBukkit) d7cfa4fa Improve legacy format serialization more
53 lines
2.5 KiB
Diff
53 lines
2.5 KiB
Diff
From 136521abd75dada9b5a980379b39c12838c50ff3 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
Date: Fri, 29 Nov 2019 22:37:44 -0600
|
|
Subject: [PATCH] Charged creeper naturally spawn
|
|
|
|
---
|
|
src/main/java/net/minecraft/server/EntityCreeper.java | 11 +++++++++++
|
|
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
|
2 files changed, 13 insertions(+)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java
|
|
index 48fd8e716b..ce366f401f 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityCreeper.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityCreeper.java
|
|
@@ -87,6 +87,17 @@ public class EntityCreeper extends EntityMonster {
|
|
this.datawatcher.register(EntityCreeper.d, false);
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public GroupDataEntity prepare(GeneratorAccess generatoraccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, GroupDataEntity groupdataentity, NBTTagCompound nbttagcompound) {
|
|
+ double chance = generatoraccess.getMinecraftWorld().purpurConfig.creeperChargedChance;
|
|
+ if (chance > 0D && random.nextDouble() <= chance) {
|
|
+ setPowered(true);
|
|
+ }
|
|
+ return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound);
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
@Override
|
|
public void b(NBTTagCompound nbttagcompound) {
|
|
super.b(nbttagcompound);
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 4c7469b903..bbae44ddb5 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -148,10 +148,12 @@ public class PurpurWorldConfig {
|
|
public boolean creeperRidable = false;
|
|
public boolean creeperRidableInWater = false;
|
|
public boolean creeperRequireShiftToMount = true;
|
|
+ public double creeperChargedChance = 0.0D;
|
|
private void creeperSettings() {
|
|
creeperRidable = getBoolean("mobs.creeper.ridable", creeperRidable);
|
|
creeperRidableInWater = getBoolean("mobs.creeper.ridable-in-water", creeperRidableInWater);
|
|
creeperRequireShiftToMount = getBoolean("mobs.creeper.require-shift-to-mount", creeperRequireShiftToMount);
|
|
+ creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
|
}
|
|
|
|
public boolean dolphinRidable = false;
|
|
--
|
|
2.24.0
|
|
|