mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 09:57:43 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly
This commit is contained in:
45
patches/server/0032-Charged-creeper-naturally-spawn.patch
Normal file
45
patches/server/0032-Charged-creeper-naturally-spawn.patch
Normal file
@@ -0,0 +1,45 @@
|
||||
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/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||
index 3a14f975e26530e1c4887844ec0c3967bd15a05b..9e05eadd09df031bac8321748f0e89c2701b74a1 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||
@@ -138,6 +138,14 @@ public class Creeper extends Monster implements PowerableMob {
|
||||
public void initAttributes() {
|
||||
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level.purpurConfig.creeperMaxHealth);
|
||||
}
|
||||
+
|
||||
+ public net.minecraft.world.entity.SpawnGroupData finalizeSpawn(net.minecraft.world.level.ServerLevelAccessor world, net.minecraft.world.DifficultyInstance difficulty, net.minecraft.world.entity.MobSpawnType spawnReason, @Nullable net.minecraft.world.entity.SpawnGroupData entityData, @Nullable CompoundTag entityNbt) {
|
||||
+ double chance = world.getMinecraftWorld().purpurConfig.creeperChargedChance;
|
||||
+ if (chance > 0D && random.nextDouble() <= chance) {
|
||||
+ setPowered(true);
|
||||
+ }
|
||||
+ return super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityNbt);
|
||||
+ }
|
||||
// Purpur end
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index e351703bf554425cf978297d90cc8d7ab7beb85c..d47db0fe25ac89c2f5040d7106d9e06b0d415c8a 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -282,6 +282,7 @@ public class PurpurWorldConfig {
|
||||
public boolean creeperRidable = false;
|
||||
public boolean creeperRidableInWater = false;
|
||||
public double creeperMaxHealth = 20.0D;
|
||||
+ public double creeperChargedChance = 0.0D;
|
||||
private void creeperSettings() {
|
||||
creeperRidable = getBoolean("mobs.creeper.ridable", creeperRidable);
|
||||
creeperRidableInWater = getBoolean("mobs.creeper.ridable-in-water", creeperRidableInWater);
|
||||
@@ -291,6 +292,7 @@ public class PurpurWorldConfig {
|
||||
set("mobs.creeper.attributes.max_health", oldValue);
|
||||
}
|
||||
creeperMaxHealth = getDouble("mobs.creeper.attributes.max_health", creeperMaxHealth);
|
||||
+ creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||
}
|
||||
|
||||
public boolean dolphinRidable = false;
|
||||
Reference in New Issue
Block a user