Fix skeleton horse spawn chance ignoring difficulty modifier if custom set

Also reduce diff
This commit is contained in:
Aikar 2016-05-30 12:50:57 -04:00
parent 44857e00e2
commit a9ec7b3a75
6 changed files with 10 additions and 18 deletions

View file

@ -43,6 +43,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
}
--
2.7.4 (Apple Git-66)
--

View file

@ -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);

View file

@ -728,6 +728,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private final CraftInventory inventory;
CraftMinecartHopper(CraftServer server, EntityMinecartHopper entity) {
--
2.7.4 (Apple Git-66)
--

View file

@ -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;

View file

@ -390,6 +390,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (entity instanceof EntityHuman) {
EntityHuman entityhuman = (EntityHuman) entity;
--
2.7.4 (Apple Git-66)
--

View file

@ -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)
--