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 Paper Changes: 8a29f5894 [Auto] Updated Upstream (Bukkit/CraftBukkit) 8756d232c Expose server protocol version (#5416) 4492bc4cc remove l4j class no longer in existence from preload list be1370517 Updated Upstream (CraftBukkit) (#5484) d560151ec Bump mysql-connector-java to 8.0.23 (Fixes #5473) (#5474) 61f400f11 Update log4j to 2.11.2 for JDK 9+ compat (#5400) a98196585 Updated Upstream (Bukkit/CraftBukkit) de138fac4 [Auto] Updated Upstream (Bukkit) 304a216ba [CI-SKIP] Ignore gitignore when adding files in automation d8e384a16 [CI-SKIP] Drop `Allow PlayerEditBookEvent to fire for off hand` (#5471) Tuinity Changes: d5261ad29 Do not load chunks for getCubes by default da9cf9828 Don't read neighbor chunk data off disk when converting chunks a0aa5ab07 Do not load 1 radius neighbors for lighting 5ccfa52a2 Fix terrible patch times af53d703a Stop large move vectors in player packet handling from killing the server 6e56ee735 Fix OBFHELPER for flushHeaderin RegionFile 995d05c1c Do not update TE's in generating chunks Airplane Changes: 8de8e82a2 Update upstream (Tuinity)
70 lines
3.5 KiB
Diff
70 lines
3.5 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/EntityCreeper.java b/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java
|
|
index b47f71ca1f1c8bbd1a521836d9cb5d676a33ec76..63a6b1820f60db9eea49a3a589dd50ad25a3c0a2 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java
|
|
@@ -9,6 +9,7 @@ import net.minecraft.network.syncher.DataWatcherRegistry;
|
|
import net.minecraft.server.level.WorldServer;
|
|
import net.minecraft.sounds.SoundEffect;
|
|
import net.minecraft.sounds.SoundEffects;
|
|
+import net.minecraft.world.DifficultyDamageScaler;
|
|
import net.minecraft.world.EnumHand;
|
|
import net.minecraft.world.EnumInteractionResult;
|
|
import net.minecraft.world.damagesource.DamageSource;
|
|
@@ -17,6 +18,8 @@ import net.minecraft.world.entity.Entity;
|
|
import net.minecraft.world.entity.EntityAreaEffectCloud;
|
|
import net.minecraft.world.entity.EntityLightning;
|
|
import net.minecraft.world.entity.EntityTypes;
|
|
+import net.minecraft.world.entity.EnumMobSpawn;
|
|
+import net.minecraft.world.entity.GroupDataEntity;
|
|
import net.minecraft.world.entity.ai.attributes.AttributeProvider;
|
|
import net.minecraft.world.entity.ai.attributes.GenericAttributes;
|
|
import net.minecraft.world.entity.ai.goal.PathfinderGoalAvoidTarget;
|
|
@@ -39,6 +42,7 @@ import net.minecraft.world.level.IMaterial;
|
|
import net.minecraft.world.level.World;
|
|
|
|
// CraftBukkit start
|
|
+import net.minecraft.world.level.WorldAccess;
|
|
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
|
import org.bukkit.event.entity.CreatureSpawnEvent;
|
|
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
|
@@ -59,6 +63,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 81b0e17a4bc5022ea757f03c2546808148d6e957..638ee71a78d9e75de6ddd7f0aec67a023bb8c06a 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;
|