Files
Purpur/patches/server/0029-Charged-creeper-naturally-spawn.patch
BillyGalbreath e581a731bf Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
0514fc4e2 Add missing effects
8f5d9effd Add getMainThreadExecutor to BukkitScheduler
313b5020b Allow adding items to BlockDropItemEvent (#5093)
9a556d9da [CI-SKIP] [Auto] Rebuild Patches
72b2768ad Inline shift fields in EnumDirection (#5082)
ffff53fa7 added option to disable pathfinding updates on block changes (#5123)
b67081fd7 add DragonEggFormEvent (fixes #5110) (#5112)
3eefafbaf Fix javadoc build
0081ed1c4 Add javadoc step to GH Actions
01082503e Add dropLeash variable to EntityUnleashEvent (#5130)
31f9f869a [CI-SKIP] Fix YourKit links in readme, fixes #5091
8ac27aa38 [Auto] Updated Upstream (CraftBukkit)
c4d9cc831 [Auto] Updated Upstream (Bukkit/CraftBukkit)
d0477d326 [Auto] Updated Upstream (CraftBukkit)
d9f5f7018 EntityMoveEvent (#4614)
2021-01-30 20:41:46 -06:00

45 lines
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 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
diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java
index 79ef955070b2982be79cc58e40093624bd088ff0..eb4a0ef0e7a8bc8e0cb648bc369815ce0efb6223 100644
--- a/src/main/java/net/minecraft/server/EntityCreeper.java
+++ b/src/main/java/net/minecraft/server/EntityCreeper.java
@@ -23,6 +23,17 @@ public class EntityCreeper extends EntityMonster {
super(entitytypes, world);
}
+ // Purpur start
+ @Override
+ public GroupDataEntity prepare(WorldAccess worldaccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @javax.annotation.Nullable GroupDataEntity groupdataentity, @javax.annotation.Nullable NBTTagCompound nbttagcompound) {
+ double chance = worldaccess.getMinecraftWorld().purpurConfig.creeperChargedChance;
+ if (chance > 0D && random.nextDouble() <= chance) {
+ setPowered(true);
+ }
+ return super.prepare(worldaccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound);
+ }
+ // Purpur end
+
@Override
protected void initPathfinder() {
this.goalSelector.a(1, new PathfinderGoalFloat(this));
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 04dfb820053925c2835bdcec702d5a467a9fe48e..5b8961a061c4a877cfa856f6d9f6d77060060829 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -113,6 +113,11 @@ public class PurpurWorldConfig {
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
}
+ public double creeperChargedChance = 0.0D;
+ private void creeperSettings() {
+ creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
+ }
+
public float giantStepHeight = 2.0F;
public float giantJumpHeight = 1.0F;
public double giantMovementSpeed = 0.5D;