mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 09:57:43 +01:00
Remove Add-back-EntityCreatePortalEvent-for-EnderDragon.patch
This commit is contained in:
68
patches/server/0082-Add-charged-creeper-spawn-chance.patch
Normal file
68
patches/server/0082-Add-charged-creeper-spawn-chance.patch
Normal file
@@ -0,0 +1,68 @@
|
||||
From 0ddcaa13c2b1d7dd3a4f57fec987731661dc1d2e 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] Add charged creeper spawn chance
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/EntityCreeper.java | 16 ++++++++++++++++
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
|
||||
2 files changed, 21 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java
|
||||
index d1acd38f9..cc155fa34 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityCreeper.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityCreeper.java
|
||||
@@ -1,11 +1,16 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
+import java.time.LocalDate;
|
||||
+import java.time.temporal.ChronoField;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
+import java.util.List;
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
||||
+
|
||||
+import javax.annotation.Nullable;
|
||||
// CraftBukkit end
|
||||
|
||||
public class EntityCreeper extends EntityMonster {
|
||||
@@ -70,6 +75,17 @@ public class EntityCreeper extends EntityMonster {
|
||||
this.datawatcher.register(EntityCreeper.d, false);
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ @Nullable
|
||||
+ @Override
|
||||
+ public GroupDataEntity prepare(GeneratorAccess generatoraccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) {
|
||||
+ if (net.pl3x.purpur.PurpurConfig.chargedCreeperChance > 0D && net.pl3x.purpur.PurpurConfig.chargedCreeperChance > random.nextDouble()) {
|
||||
+ 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/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 81f41ccc7..544c68b0d 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -208,6 +208,11 @@ public class PurpurConfig {
|
||||
feedMushroomsToCows = getInt("settings.mobs.cow.feed-mushrooms-for-mooshroom", feedMushroomsToCows);
|
||||
}
|
||||
|
||||
+ public static double chargedCreeperChance = 0.0D;
|
||||
+ private static void creeperSettings() {
|
||||
+ chargedCreeperChance = getDouble("settings.mobs.creeper.naturally-charged-chance", chargedCreeperChance);
|
||||
+ }
|
||||
+
|
||||
public static boolean giantsNaturallySpawn = true;
|
||||
public static boolean giantsHaveAI = true;
|
||||
private static void giantsSettings() {
|
||||
--
|
||||
2.24.0
|
||||
|
||||
Reference in New Issue
Block a user