mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: eb11845f8 Fix creating worlds with "invalid" names (Fixes #5331) e4d8a6279 Implement Keyed on World bcb63dab7 [CI-SKIP] [Auto] Rebuild Patches 48342b06c Allow signs that are inside of the spawn protection to be right clicked to use their run_command tag c229f90c1 Add Block#isValidTool 20e709c1d Add recipe to cook events 2dcf8bff4 legacy formatting will be the death of me f597fea0d legacy formatting is worse than walking around in wet socks 7f72c4675 Use implementation-provided legacy serializer for events 27a8d99ec Adventure 4.7.0 e65bd35a1 Respect teams in legacy chat name if configured (#5321) b31089a92 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5325) a52b30814 Fix title swapping fadeIn and stay 54ec85949 Prevent grindstones from overstacking items d7795080c Fix NPE for AIR in meta operations in ItemStack 2e70796c7 [CI-SKIP] Improve documentation of PreCreatureSpawnEvent (#5244) 7bb92e750 [CI-SKIP] Add JavaDoc links to Tag class pointing to custom Paper tags (#5285) 28cd686bf fix per-world difficulty command (#5306) be7cde2c7 [CI-SKIP] Always check PATH for JDK (#5315)
71 lines
4.8 KiB
Diff
71 lines
4.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Encode42 <me@encode42.dev>
|
|
Date: Sun, 7 Mar 2021 19:08:16 -0500
|
|
Subject: [PATCH] Configurable Ender Pearl cooldown, damage, and Endermite RNG
|
|
|
|
- Survival and Creative Cooldown speed
|
|
- Damage dealt on pearl usage
|
|
- Endermite spawn chance
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityEnderPearl.java b/src/main/java/net/minecraft/server/EntityEnderPearl.java
|
|
index 44dbe818b19c927098c1e6b2bcb556378be5637c..a1a070e786a7b587d103809957ec4f70f30f999a 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityEnderPearl.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityEnderPearl.java
|
|
@@ -54,7 +54,7 @@ public class EntityEnderPearl extends EntityProjectileThrowable {
|
|
Bukkit.getPluginManager().callEvent(teleEvent);
|
|
|
|
if (!teleEvent.isCancelled() && !entityplayer.playerConnection.isDisconnected()) {
|
|
- if (this.random.nextFloat() < 0.05F && this.world.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING)) {
|
|
+ if (this.random.nextFloat() < this.world.purpurConfig.enderPearlEndermiteChance && this.world.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING)) { // Purpur
|
|
EntityEndermite entityendermite = (EntityEndermite) EntityTypes.ENDERMITE.a(this.world);
|
|
|
|
entityendermite.setPlayerSpawned(true);
|
|
@@ -69,7 +69,7 @@ public class EntityEnderPearl extends EntityProjectileThrowable {
|
|
entityplayer.playerConnection.teleport(teleEvent.getTo());
|
|
entity.fallDistance = 0.0F;
|
|
CraftEventFactory.entityDamage = this;
|
|
- entity.damageEntity(DamageSource.FALL, 5.0F);
|
|
+ entity.damageEntity(DamageSource.FALL, this.world.purpurConfig.enderPearlDamage); // Purpur
|
|
CraftEventFactory.entityDamage = null;
|
|
}
|
|
// CraftBukkit end
|
|
diff --git a/src/main/java/net/minecraft/server/ItemEnderPearl.java b/src/main/java/net/minecraft/server/ItemEnderPearl.java
|
|
index 0e154ee2976694dacf8d41fcd831f21fbbda13af..f2cafb9f9365a3428f8fa0c35e9b6045d5729a8f 100644
|
|
--- a/src/main/java/net/minecraft/server/ItemEnderPearl.java
|
|
+++ b/src/main/java/net/minecraft/server/ItemEnderPearl.java
|
|
@@ -27,7 +27,7 @@ public class ItemEnderPearl extends Item {
|
|
|
|
world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F));
|
|
entityhuman.b(StatisticList.ITEM_USED.b(this));
|
|
- entityhuman.getCooldownTracker().setCooldown(this, 20);
|
|
+ entityhuman.getCooldownTracker().setCooldown(this, entityhuman.abilities.canInstantlyBuild ? world.purpurConfig.enderPearlCooldownCreative : world.purpurConfig.enderPearlCooldown); // Purpur
|
|
} else {
|
|
// Paper end
|
|
if (entityhuman instanceof EntityPlayer) {
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index bf8a842e7c43946c87c8f27afdf364b1475cf44e..9b7c1b16ad191f58fea0625ebf547431a6e8ddad 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -170,6 +170,10 @@ public class PurpurWorldConfig {
|
|
public List<Item> itemImmuneToFire = new ArrayList<>();
|
|
public boolean dontRunWithScissors = false;
|
|
public double scissorsRunningDamage = 1D;
|
|
+ public float enderPearlDamage = 5.0F;
|
|
+ public int enderPearlCooldown = 20;
|
|
+ public int enderPearlCooldownCreative = 20;
|
|
+ public float enderPearlEndermiteChance = 0.05F;
|
|
private void itemSettings() {
|
|
itemImmuneToCactus.clear();
|
|
getList("gameplay-mechanics.item.immune.cactus", new ArrayList<>()).forEach(key -> {
|
|
@@ -200,6 +204,10 @@ public class PurpurWorldConfig {
|
|
});
|
|
dontRunWithScissors = getBoolean("gameplay-mechanics.item.shears.damage-if-sprinting", dontRunWithScissors);
|
|
scissorsRunningDamage = getDouble("gameplay-mechanics.item.shears.sprinting-damage", scissorsRunningDamage);
|
|
+ enderPearlDamage = (float) getDouble("gameplay-mechanics.item.ender-pearl.damage", enderPearlDamage);
|
|
+ enderPearlCooldown = getInt("gameplay-mechanics.item.ender-pearl.cooldown", enderPearlCooldown);
|
|
+ enderPearlCooldownCreative = getInt("gameplay-mechanics.item.ender-pearl.creative-cooldown", enderPearlCooldownCreative);
|
|
+ enderPearlEndermiteChance = (float) getDouble("gameplay-mechanics.item.ender-pearl.endermite-spawn-chance", enderPearlEndermiteChance);
|
|
}
|
|
|
|
public boolean idleTimeoutKick = true;
|