mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Pufferfish Changes: pufferfish-gg/Pufferfish@f05b0e9 Updated Upstream (Paper) pufferfish-gg/Pufferfish@9a82b86 Updated Upstream (Paper) pufferfish-gg/Pufferfish@c6ec7a0 Updated Upstream (Paper) pufferfish-gg/Pufferfish@c789f72 Updated Upstream (Paper) pufferfish-gg/Pufferfish@9ddaa1a Updated Upstream (Paper) pufferfish-gg/Pufferfish@3554f78 Updated Upstream (Paper) pufferfish-gg/Pufferfish@a9e9d99 Updated Upstream (Paper) pufferfish-gg/Pufferfish@09a2f81 Updated Upstream (Paper) pufferfish-gg/Pufferfish@63ce67d Updated Upstream (Paper) pufferfish-gg/Pufferfish@8abd47b Updated Upstream (Paper) pufferfish-gg/Pufferfish@3415da0 Updated Upstream (Paper) pufferfish-gg/Pufferfish@cfa3c61 Updated Upstream (Paper) pufferfish-gg/Pufferfish@0a8641d 1.21.3 Update pufferfish-gg/Pufferfish@784d72f Updated Upstream (Paper) pufferfish-gg/Pufferfish@40e1ad0 Updated Upstream (Paper) pufferfish-gg/Pufferfish@95ef348 Make iterator counting in IteratorSafeOrderedReferenceSet thread-safe for async mob spawning (#109) pufferfish-gg/Pufferfish@34c0042 Updated Upstream (Paper)
46 lines
2.6 KiB
Diff
46 lines
2.6 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/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
|
index 3ea4763a34447761e73d8643dce8c386fa7501c3..e95afb70fa13f7f2617cbd42b7f5d17b9bc1ec4f 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
|
@@ -257,6 +257,14 @@ public class Creeper extends Monster {
|
|
this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.creeperScale);
|
|
}
|
|
|
|
+ public net.minecraft.world.entity.SpawnGroupData finalizeSpawn(net.minecraft.world.level.ServerLevelAccessor world, net.minecraft.world.DifficultyInstance difficulty, net.minecraft.world.entity.EntitySpawnReason spawnReason, @Nullable net.minecraft.world.entity.SpawnGroupData entityData) {
|
|
+ double chance = world.getLevel().purpurConfig.creeperChargedChance;
|
|
+ if (chance > 0D && random.nextDouble() <= chance) {
|
|
+ setPowered(true);
|
|
+ }
|
|
+ return super.finalizeSpawn(world, difficulty, spawnReason, entityData);
|
|
+ }
|
|
+
|
|
@Override
|
|
protected SoundEvent getHurtSound(DamageSource source) {
|
|
return SoundEvents.CREEPER_HURT;
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index 7c7fce74431a52de80a29c0e4ca87b45e2ce892c..3ec1852cc481572e87204ca800edae94e6890e05 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -408,6 +408,7 @@ public class PurpurWorldConfig {
|
|
public boolean creeperControllable = true;
|
|
public double creeperMaxHealth = 20.0D;
|
|
public double creeperScale = 1.0D;
|
|
+ public double creeperChargedChance = 0.0D;
|
|
private void creeperSettings() {
|
|
creeperRidable = getBoolean("mobs.creeper.ridable", creeperRidable);
|
|
creeperRidableInWater = getBoolean("mobs.creeper.ridable-in-water", creeperRidableInWater);
|
|
@@ -419,6 +420,7 @@ public class PurpurWorldConfig {
|
|
}
|
|
creeperMaxHealth = getDouble("mobs.creeper.attributes.max_health", creeperMaxHealth);
|
|
creeperScale = Mth.clamp(getDouble("mobs.creeper.attributes.scale", creeperScale), 0.0625D, 16.0D);
|
|
+ creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
|
}
|
|
|
|
public boolean dolphinRidable = false;
|