Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-21 05:50:05 +01:00
7b0c576798
Allows us much greater control over the Spigot portion of the code and makes us more "proper" Credit to @Dmck2b for originally passing the idea along a while back
50 Zeilen
2.1 KiB
Diff
50 Zeilen
2.1 KiB
Diff
From 63e82d929f85e503904764ba2f41585336bbeae1 Mon Sep 17 00:00:00 2001
|
|
From: Zach Brown <Zbob750@live.com>
|
|
Date: Tue, 24 Jun 2014 22:55:30 -0500
|
|
Subject: [PATCH] Fix zombie sieges and their spawn mechanics
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/VillageSiege.java b/src/main/java/net/minecraft/server/VillageSiege.java
|
|
index 93e1a1e..549d390 100644
|
|
--- a/src/main/java/net/minecraft/server/VillageSiege.java
|
|
+++ b/src/main/java/net/minecraft/server/VillageSiege.java
|
|
@@ -50,6 +50,12 @@ public class VillageSiege {
|
|
return;
|
|
}
|
|
}
|
|
+
|
|
+ // PaperSpigot start - Siege manager initial state is -1
|
|
+ if (this.c == -1) {
|
|
+ return;
|
|
+ }
|
|
+ // PaperSpigot end
|
|
}
|
|
|
|
if (!this.b) {
|
|
@@ -89,9 +95,12 @@ public class VillageSiege {
|
|
|
|
while (true) {
|
|
if (i < 10) {
|
|
- this.g = chunkcoordinates.x + (int) ((double) (MathHelper.cos(this.world.random.nextFloat() * 3.1415927F * 2.0F) * f) * 0.9D);
|
|
+ // PaperSpigot start - Zombies should spawn near the perimeter of the village not in the center of it
|
|
+ float angle = this.world.random.nextFloat() * (float) Math.PI * 2.0F;
|
|
+ this.g = chunkcoordinates.x + (int) ((double) (MathHelper.cos(angle) * f) * 0.9D);
|
|
this.h = chunkcoordinates.y;
|
|
- this.i = chunkcoordinates.z + (int) ((double) (MathHelper.sin(this.world.random.nextFloat() * 3.1415927F * 2.0F) * f) * 0.9D);
|
|
+ this.i = chunkcoordinates.z + (int) ((double) (MathHelper.sin(angle) * f) * 0.9D);
|
|
+ // PaperSpigot end
|
|
flag = false;
|
|
Iterator iterator1 = this.world.villages.getVillages().iterator();
|
|
|
|
@@ -165,6 +174,7 @@ public class VillageSiege {
|
|
// CraftBukkit - add Return
|
|
return Vec3D.a((double) i1, (double) j1, (double) k1);
|
|
}
|
|
+
|
|
}
|
|
|
|
return null;
|
|
--
|
|
1.9.1
|
|
|