From a9ec7b3a750e5ebdb216f66b9ffbb9f7549829fd Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 30 May 2016 12:50:57 -0400 Subject: [PATCH] Fix skeleton horse spawn chance ignoring difficulty modifier if custom set Also reduce diff --- .../Add-ability-to-configure-frosted_ice-properties.patch | 4 +--- .../Configurable-spawn-chances-for-skeleton-horses.patch | 8 ++++---- .../LootTable-API-Replenishable-Lootables-Feature.patch | 4 +--- ...Option-to-disable-BlockPhysicsEvent-for-Redstone.patch | 4 ++-- .../Optional-old-TNT-cannon-behaviors.patch | 4 +--- ...Re-add-tileEntityTick.startTiming-Spigot-removed.patch | 4 +--- 6 files changed, 10 insertions(+), 18 deletions(-) diff --git a/Spigot-Server-Patches/Add-ability-to-configure-frosted_ice-properties.patch b/Spigot-Server-Patches/Add-ability-to-configure-frosted_ice-properties.patch index 8bccc258c3..188b34420e 100644 --- a/Spigot-Server-Patches/Add-ability-to-configure-frosted_ice-properties.patch +++ b/Spigot-Server-Patches/Add-ability-to-configure-frosted_ice-properties.patch @@ -43,6 +43,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } --- -2.7.4 (Apple Git-66) - +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Configurable-spawn-chances-for-skeleton-horses.patch b/Spigot-Server-Patches/Configurable-spawn-chances-for-skeleton-horses.patch index 86df7ea046..b51f14e9e6 100644 --- a/Spigot-Server-Patches/Configurable-spawn-chances-for-skeleton-horses.patch +++ b/Spigot-Server-Patches/Configurable-spawn-chances-for-skeleton-horses.patch @@ -16,6 +16,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public double skeleHorseSpawnChance; + private void skeleHorseSpawnChance() { + skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", -1.0D); // -1.0D represents a "vanilla" state ++ if (skeleHorseSpawnChance < 0) { ++ skeleHorseSpawnChance = 0.05D; // Vanilla ++ } + } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java @@ -27,10 +30,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 DifficultyDamageScaler difficultydamagescaler = this.D(blockposition); - if (this.random.nextDouble() < (double) difficultydamagescaler.b() * 0.05D) { -+ // Paper start - Configurable skeleton horse spawn chance -+ double chance = this.paperConfig.skeleHorseSpawnChance == -1.0D ? (double) difficultydamagescaler.b() * 0.05D : this.paperConfig.skeleHorseSpawnChance; -+ if (this.random.nextDouble() < chance) { -+ // Paper end ++ if (this.random.nextDouble() < difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance) { // Paper - Configurable skeleton horse spawn chance EntityHorse entityhorse = new EntityHorse(this); entityhorse.setType(EnumHorseType.SKELETON); diff --git a/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch b/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch index b1ea5d261c..442e398954 100644 --- a/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch +++ b/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch @@ -728,6 +728,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private final CraftInventory inventory; CraftMinecartHopper(CraftServer server, EntityMinecartHopper entity) { --- -2.7.4 (Apple Git-66) - +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Option-to-disable-BlockPhysicsEvent-for-Redstone.patch b/Spigot-Server-Patches/Option-to-disable-BlockPhysicsEvent-for-Redstone.patch index bb84b7878d..b1f85c2257 100644 --- a/Spigot-Server-Patches/Option-to-disable-BlockPhysicsEvent-for-Redstone.patch +++ b/Spigot-Server-Patches/Option-to-disable-BlockPhysicsEvent-for-Redstone.patch @@ -15,8 +15,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { - private void skeleHorseSpawnChance() { - skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", -1.0D); // -1.0D represents a "vanilla" state + skeleHorseSpawnChance = 0.05D; // Vanilla + } } + + public boolean firePhysicsEventForRedstone = false; diff --git a/Spigot-Server-Patches/Optional-old-TNT-cannon-behaviors.patch b/Spigot-Server-Patches/Optional-old-TNT-cannon-behaviors.patch index a0ba09a5ed..4473f8c42f 100644 --- a/Spigot-Server-Patches/Optional-old-TNT-cannon-behaviors.patch +++ b/Spigot-Server-Patches/Optional-old-TNT-cannon-behaviors.patch @@ -390,6 +390,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (entity instanceof EntityHuman) { EntityHuman entityhuman = (EntityHuman) entity; --- -2.7.4 (Apple Git-66) - +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Re-add-tileEntityTick.startTiming-Spigot-removed.patch b/Spigot-Server-Patches/Re-add-tileEntityTick.startTiming-Spigot-removed.patch index 35daf564c9..aba554ae65 100644 --- a/Spigot-Server-Patches/Re-add-tileEntityTick.startTiming-Spigot-removed.patch +++ b/Spigot-Server-Patches/Re-add-tileEntityTick.startTiming-Spigot-removed.patch @@ -16,6 +16,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.M = true; // CraftBukkit start - From below, clean up tile entities before ticking them if (!this.tileEntityListUnload.isEmpty()) { --- -2.7.4 (Apple Git-66) - +-- \ No newline at end of file