Archiviert
13
0

Simplify a few diffs

Dieser Commit ist enthalten in:
md_5 2016-07-15 20:08:04 +10:00
Ursprung 301db84d3d
Commit 7f9fbe54ba
8 geänderte Dateien mit 76 neuen und 124 gelöschten Zeilen

Datei anzeigen

@ -8,7 +8,7 @@
if (this.getDropType(iblockdata, world.random, i) != Item.getItemOf(this)) { if (this.getDropType(iblockdata, world.random, i) != Item.getItemOf(this)) {
int j = 0; int j = 0;
@@ -56,13 +57,42 @@ @@ -56,9 +57,34 @@
this.dropExperience(world, blockposition, j); this.dropExperience(world, blockposition, j);
} }
@ -43,11 +43,3 @@
public ItemStack a(World world, BlockPosition blockposition, IBlockData iblockdata) { public ItemStack a(World world, BlockPosition blockposition, IBlockData iblockdata) {
return new ItemStack(this); return new ItemStack(this);
} }
+ public int getDropData(World world, BlockPosition blockposition) {
+ return 0;
+ }
+
public int getDropData(IBlockData iblockdata) {
return this == Blocks.LAPIS_ORE ? EnumColor.BLUE.getInvColorIndex() : 0;
}

Datei anzeigen

@ -97,17 +97,16 @@
if (chunk == null) { if (chunk == null) {
long k = ChunkCoordIntPair.a(i, j); long k = ChunkCoordIntPair.a(i, j);
@@ -100,7 +168,8 @@ @@ -100,7 +168,7 @@
this.chunks.put(k, chunk); this.chunks.put(k, chunk);
chunk.addEntities(); chunk.addEntities();
- chunk.loadNearby(this, this.chunkGenerator); - chunk.loadNearby(this, this.chunkGenerator);
+
+ chunk.loadNearby(this, this.chunkGenerator, true); // CraftBukkit + chunk.loadNearby(this, this.chunkGenerator, true); // CraftBukkit
} }
return chunk; return chunk;
@@ -146,10 +215,12 @@ @@ -146,10 +214,12 @@
public boolean a(boolean flag) { public boolean a(boolean flag) {
int i = 0; int i = 0;
@ -123,7 +122,7 @@
if (flag) { if (flag) {
this.saveChunkNOP(chunk); this.saveChunkNOP(chunk);
@@ -182,10 +253,12 @@ @@ -182,10 +252,12 @@
Chunk chunk = (Chunk) this.chunks.get(olong); Chunk chunk = (Chunk) this.chunks.get(olong);
if (chunk != null && chunk.d) { if (chunk != null && chunk.d) {
@ -140,7 +139,7 @@
++i; ++i;
} }
} }
@@ -197,6 +270,40 @@ @@ -197,6 +269,40 @@
return false; return false;
} }

Datei anzeigen

@ -1,18 +1,6 @@
--- a/net/minecraft/server/DedicatedServer.java --- a/net/minecraft/server/DedicatedServer.java
+++ b/net/minecraft/server/DedicatedServer.java +++ b/net/minecraft/server/DedicatedServer.java
@@ -4,10 +4,9 @@ @@ -18,11 +18,21 @@
import com.mojang.authlib.GameProfileRepository;
import com.mojang.authlib.minecraft.MinecraftSessionService;
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
-import java.io.BufferedReader;
+
import java.io.File;
import java.io.IOException;
-import java.io.InputStreamReader;
import java.net.InetAddress;
import java.net.Proxy;
import java.util.Collections;
@@ -18,11 +17,21 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -35,7 +23,7 @@
private RemoteStatusListener n; private RemoteStatusListener n;
public final RemoteControlCommandListener remoteControlCommandListener = new RemoteControlCommandListener(this); public final RemoteControlCommandListener remoteControlCommandListener = new RemoteControlCommandListener(this);
private RemoteControlListener p; private RemoteControlListener p;
@@ -32,8 +41,10 @@ @@ -32,8 +42,10 @@
private EnumGamemode t; private EnumGamemode t;
private boolean u; private boolean u;
@ -48,7 +36,7 @@
Thread thread = new Thread("Server Infinisleeper") { Thread thread = new Thread("Server Infinisleeper") {
{ {
this.setDaemon(true); this.setDaemon(true);
@@ -52,16 +63,30 @@ @@ -52,16 +64,30 @@
}; };
} }
@ -83,7 +71,7 @@
} }
} catch (IOException ioexception) { } catch (IOException ioexception) {
DedicatedServer.LOGGER.error("Exception handling console input", ioexception); DedicatedServer.LOGGER.error("Exception handling console input", ioexception);
@@ -70,6 +95,27 @@ @@ -70,6 +96,27 @@
} }
}; };
@ -111,7 +99,7 @@
thread.setDaemon(true); thread.setDaemon(true);
thread.start(); thread.start();
DedicatedServer.LOGGER.info("Starting minecraft server version 1.10.2"); DedicatedServer.LOGGER.info("Starting minecraft server version 1.10.2");
@@ -78,7 +124,7 @@ @@ -78,7 +125,7 @@
} }
DedicatedServer.LOGGER.info("Loading properties"); DedicatedServer.LOGGER.info("Loading properties");
@ -120,7 +108,7 @@
this.r = new EULA(new File("eula.txt")); this.r = new EULA(new File("eula.txt"));
if (!this.r.a()) { if (!this.r.a()) {
DedicatedServer.LOGGER.info("You need to agree to the EULA in order to run the server. Go to eula.txt for more info."); DedicatedServer.LOGGER.info("You need to agree to the EULA in order to run the server. Go to eula.txt for more info.");
@@ -134,6 +180,8 @@ @@ -134,6 +181,8 @@
return false; return false;
} }
@ -129,7 +117,7 @@
if (!this.getOnlineMode()) { if (!this.getOnlineMode()) {
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!"); DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware."); DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
@@ -148,7 +196,7 @@ @@ -148,7 +197,7 @@
if (!NameReferencingFileConverter.a(this.propertyManager)) { if (!NameReferencingFileConverter.a(this.propertyManager)) {
return false; return false;
} else { } else {
@ -138,7 +126,7 @@
long j = System.nanoTime(); long j = System.nanoTime();
if (this.S() == null) { if (this.S() == null) {
@@ -206,7 +254,18 @@ @@ -206,7 +255,18 @@
DedicatedServer.LOGGER.info("Starting remote control listener"); DedicatedServer.LOGGER.info("Starting remote control listener");
this.p = new RemoteControlListener(this); this.p = new RemoteControlListener(this);
this.p.a(); this.p.a();
@ -157,7 +145,7 @@
if (this.aP() > 0L) { if (this.aP() > 0L) {
Thread thread1 = new Thread(new ThreadWatchdog(this)); Thread thread1 = new Thread(new ThreadWatchdog(this));
@@ -266,7 +325,7 @@ @@ -266,7 +326,7 @@
return this.propertyManager.getBoolean("hardcore", false); return this.propertyManager.getBoolean("hardcore", false);
} }
@ -166,7 +154,7 @@
public CrashReport b(CrashReport crashreport) { public CrashReport b(CrashReport crashreport) {
crashreport = super.b(crashreport); crashreport = super.b(crashreport);
@@ -293,11 +352,11 @@ @@ -293,11 +353,11 @@
return crashreport; return crashreport;
} }
@ -180,7 +168,7 @@
super.D(); super.D();
this.aL(); this.aL();
} }
@@ -328,7 +387,15 @@ @@ -328,7 +388,15 @@
while (!this.serverCommandQueue.isEmpty()) { while (!this.serverCommandQueue.isEmpty()) {
ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0); ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0);
@ -197,7 +185,7 @@
} }
} }
@@ -535,16 +602,70 @@ @@ -535,16 +603,70 @@
} }
public String getPlugins() { public String getPlugins() {
@ -218,17 +206,17 @@
+ if (i > 0) { + if (i > 0) {
+ result.append("; "); + result.append("; ");
+ } + }
+
+ result.append(plugins[i].getDescription().getName());
+ result.append(" ");
+ result.append(plugins[i].getDescription().getVersion().replaceAll(";", ","));
+ }
+ }
- public String executeRemoteCommand(String s) { - public String executeRemoteCommand(String s) {
- this.remoteControlCommandListener.clearMessages(); - this.remoteControlCommandListener.clearMessages();
- this.b.a(this.remoteControlCommandListener, s); - this.b.a(this.remoteControlCommandListener, s);
- return this.remoteControlCommandListener.getMessages(); - return this.remoteControlCommandListener.getMessages();
+ result.append(plugins[i].getDescription().getName());
+ result.append(" ");
+ result.append(plugins[i].getDescription().getVersion().replaceAll(";", ","));
+ }
+ }
+
+ return result.toString(); + return result.toString();
+ // CraftBukkit end + // CraftBukkit end
+ } + }

Datei anzeigen

@ -48,7 +48,7 @@
+ // CraftBukkit end + // CraftBukkit end
world.addEntity((Entity) iprojectile); world.addEntity((Entity) iprojectile);
- itemstack.cloneAndSubtract(1); - itemstack.cloneAndSubtract(1);
+ // itemstack.a(1); // CraftBukkit - Handled during event processing + // itemstack.cloneAndSubtract(1); // CraftBukkit - Handled during event processing
return itemstack; return itemstack;
} }

Datei anzeigen

@ -52,7 +52,7 @@
world.addEntity(entityminecartabstract); world.addEntity(entityminecartabstract);
- itemstack.cloneAndSubtract(1); - itemstack.cloneAndSubtract(1);
+ // itemstack.a(1); // CraftBukkit - handled during event processing + // itemstack.cloneAndSubtract(1); // CraftBukkit - handled during event processing
+ // CraftBukkit end + // CraftBukkit end
return itemstack; return itemstack;
} }

Datei anzeigen

@ -1,42 +1,20 @@
--- a/net/minecraft/server/MinecraftServer.java --- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java
@@ -14,7 +14,15 @@ @@ -38,6 +38,13 @@
import io.netty.buffer.ByteBufOutputStream; import org.apache.commons.lang3.Validate;
import io.netty.buffer.Unpooled;
import io.netty.handler.codec.base64.Base64;
-import java.awt.GraphicsEnvironment;
+import jline.console.ConsoleReader;
+import joptsimple.OptionSet;
+import org.apache.commons.lang3.Validate;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.bukkit.craftbukkit.Main;
+
+import javax.imageio.ImageIO;
+import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
@@ -25,7 +33,6 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
-import java.util.Iterator;
import java.util.List;
import java.util.Queue;
import java.util.Random;
@@ -39,6 +46,10 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
+// CraftBukkit start +// CraftBukkit start
+import jline.console.ConsoleReader;
+import joptsimple.OptionSet;
+import org.bukkit.Bukkit; +import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.craftbukkit.CraftServer;
+import org.bukkit.craftbukkit.Main;
+// CraftBukkit end +// CraftBukkit end
public abstract class MinecraftServer implements Runnable, ICommandListener, IAsyncTaskHandler, IMojangStatistics { public abstract class MinecraftServer implements Runnable, ICommandListener, IAsyncTaskHandler, IMojangStatistics {
public static final Logger LOGGER = LogManager.getLogger(); @@ -94,19 +101,61 @@
@@ -94,19 +105,61 @@
private Thread serverThread; private Thread serverThread;
private long aa = av(); private long aa = av();
@ -101,7 +79,7 @@
protected CommandDispatcher i() { protected CommandDispatcher i() {
return new CommandDispatcher(this); return new CommandDispatcher(this);
} }
@@ -144,6 +197,7 @@ @@ -144,6 +193,7 @@
this.a(s); this.a(s);
this.b("menu.loadingLevel"); this.b("menu.loadingLevel");
this.worldServer = new WorldServer[3]; this.worldServer = new WorldServer[3];
@ -109,7 +87,7 @@
this.i = new long[this.worldServer.length][100]; this.i = new long[this.worldServer.length][100];
IDataManager idatamanager = this.convertable.a(s, true); IDataManager idatamanager = this.convertable.a(s, true);
@@ -167,36 +221,108 @@ @@ -167,36 +217,108 @@
worlddata.a(s1); worlddata.a(s1);
worldsettings = new WorldSettings(worlddata); worldsettings = new WorldSettings(worlddata);
} }
@ -229,7 +207,7 @@
this.v.setPlayerFileData(this.worldServer); this.v.setPlayerFileData(this.worldServer);
this.a(this.getDifficulty()); this.a(this.getDifficulty());
this.l(); this.l();
@@ -212,25 +338,38 @@ @@ -212,25 +334,38 @@
this.b("menu.generatingTerrain"); this.b("menu.generatingTerrain");
boolean flag4 = false; boolean flag4 = false;
@ -283,7 +261,7 @@
this.t(); this.t();
} }
@@ -266,14 +405,17 @@ @@ -266,14 +401,17 @@
protected void t() { protected void t() {
this.f = null; this.f = null;
this.g = 0; this.g = 0;
@ -303,7 +281,7 @@
if (worldserver != null) { if (worldserver != null) {
if (!flag) { if (!flag) {
@@ -282,6 +424,7 @@ @@ -282,6 +420,7 @@
try { try {
worldserver.save(true, (IProgressUpdate) null); worldserver.save(true, (IProgressUpdate) null);
@ -311,7 +289,7 @@
} catch (ExceptionWorldConflict exceptionworldconflict) { } catch (ExceptionWorldConflict exceptionworldconflict) {
MinecraftServer.LOGGER.warn(exceptionworldconflict.getMessage()); MinecraftServer.LOGGER.warn(exceptionworldconflict.getMessage());
} }
@@ -290,8 +433,24 @@ @@ -290,8 +429,24 @@
} }
@ -337,7 +315,7 @@
if (this.am() != null) { if (this.am() != null) {
this.am().b(); this.am().b();
} }
@@ -300,6 +459,7 @@ @@ -300,6 +455,7 @@
MinecraftServer.LOGGER.info("Saving players"); MinecraftServer.LOGGER.info("Saving players");
this.v.savePlayers(); this.v.savePlayers();
this.v.u(); this.v.u();
@ -345,7 +323,7 @@
} }
if (this.worldServer != null) { if (this.worldServer != null) {
@@ -321,12 +481,14 @@ @@ -321,12 +477,14 @@
aworldserver = this.worldServer; aworldserver = this.worldServer;
i = aworldserver.length; i = aworldserver.length;
@ -360,7 +338,7 @@
} }
if (this.m.d()) { if (this.m.d()) {
@@ -366,6 +528,7 @@ @@ -366,6 +524,7 @@
long k = j - this.aa; long k = j - this.aa;
if (k > 2000L && this.aa - this.Q >= 15000L) { if (k > 2000L && this.aa - this.Q >= 15000L) {
@ -368,7 +346,7 @@
MinecraftServer.LOGGER.warn("Can\'t keep up! Did the system time change, or is the server overloaded? Running {}ms behind, skipping {} tick(s)", new Object[] { Long.valueOf(k), Long.valueOf(k / 50L)}); MinecraftServer.LOGGER.warn("Can\'t keep up! Did the system time change, or is the server overloaded? Running {}ms behind, skipping {} tick(s)", new Object[] { Long.valueOf(k), Long.valueOf(k / 50L)});
k = 2000L; k = 2000L;
this.Q = this.aa; this.Q = this.aa;
@@ -378,11 +541,12 @@ @@ -378,11 +537,12 @@
i += k; i += k;
this.aa = j; this.aa = j;
@ -382,7 +360,7 @@
i -= 50L; i -= 50L;
this.C(); this.C();
} }
@@ -420,6 +584,12 @@ @@ -420,6 +580,12 @@
} catch (Throwable throwable1) { } catch (Throwable throwable1) {
MinecraftServer.LOGGER.error("Exception stopping the server", throwable1); MinecraftServer.LOGGER.error("Exception stopping the server", throwable1);
} finally { } finally {
@ -395,7 +373,7 @@
this.B(); this.B();
} }
@@ -463,7 +633,7 @@ @@ -463,7 +629,7 @@
public void B() {} public void B() {}
@ -404,7 +382,7 @@
long i = System.nanoTime(); long i = System.nanoTime();
++this.ticks; ++this.ticks;
@@ -489,7 +659,7 @@ @@ -489,7 +655,7 @@
this.q.b().a(agameprofile); this.q.b().a(agameprofile);
} }
@ -413,7 +391,7 @@
this.methodProfiler.a("save"); this.methodProfiler.a("save");
this.v.savePlayers(); this.v.savePlayers();
this.saveChunks(true); this.saveChunks(true);
@@ -513,6 +683,7 @@ @@ -513,6 +679,7 @@
} }
public void D() { public void D() {
@ -421,7 +399,7 @@
this.methodProfiler.a("jobs"); this.methodProfiler.a("jobs");
Queue queue = this.j; Queue queue = this.j;
@@ -524,20 +695,38 @@ @@ -524,20 +691,38 @@
this.methodProfiler.c("levels"); this.methodProfiler.c("levels");
@ -463,7 +441,7 @@
this.methodProfiler.a("tick"); this.methodProfiler.a("tick");
@@ -564,9 +753,9 @@ @@ -564,9 +749,9 @@
worldserver.getTracker().updatePlayers(); worldserver.getTracker().updatePlayers();
this.methodProfiler.b(); this.methodProfiler.b();
this.methodProfiler.b(); this.methodProfiler.b();
@ -475,7 +453,7 @@
} }
this.methodProfiler.c("connection"); this.methodProfiler.c("connection");
@@ -590,10 +779,11 @@ @@ -590,10 +775,11 @@
this.o.add(itickable); this.o.add(itickable);
} }
@ -488,7 +466,7 @@
boolean flag = true; boolean flag = true;
String s = null; String s = null;
String s1 = "."; String s1 = ".";
@@ -638,13 +828,16 @@ @@ -638,13 +824,16 @@
++j; ++j;
} }
} }
@ -506,7 +484,7 @@
if (s != null) { if (s != null) {
dedicatedserver.i(s); dedicatedserver.i(s);
} }
@@ -675,6 +868,25 @@ @@ -675,6 +864,25 @@
dedicatedserver.stop(); dedicatedserver.stop();
} }
}); });
@ -532,7 +510,7 @@
} catch (Exception exception) { } catch (Exception exception) {
MinecraftServer.LOGGER.fatal("Failed to start the minecraft server", exception); MinecraftServer.LOGGER.fatal("Failed to start the minecraft server", exception);
} }
@@ -682,8 +894,10 @@ @@ -682,8 +890,10 @@
} }
public void F() { public void F() {
@ -543,7 +521,7 @@
} }
public File d(String s) { public File d(String s) {
@@ -699,7 +913,14 @@ @@ -699,7 +909,14 @@
} }
public WorldServer getWorldServer(int i) { public WorldServer getWorldServer(int i) {
@ -559,7 +537,7 @@
} }
public String getVersion() { public String getVersion() {
@@ -723,7 +944,7 @@ @@ -723,7 +940,7 @@
} }
public boolean isDebugging() { public boolean isDebugging() {
@ -568,7 +546,7 @@
} }
public void g(String s) { public void g(String s) {
@@ -738,7 +959,7 @@ @@ -738,7 +955,7 @@
} }
public String getServerModName() { public String getServerModName() {
@ -577,7 +555,7 @@
} }
public CrashReport b(CrashReport crashreport) { public CrashReport b(CrashReport crashreport) {
@@ -767,6 +988,7 @@ @@ -767,6 +984,7 @@
} }
public List<String> tabCompleteCommand(ICommandListener icommandlistener, String s, @Nullable BlockPosition blockposition, boolean flag) { public List<String> tabCompleteCommand(ICommandListener icommandlistener, String s, @Nullable BlockPosition blockposition, boolean flag) {
@ -585,7 +563,7 @@
ArrayList arraylist = Lists.newArrayList(); ArrayList arraylist = Lists.newArrayList();
boolean flag1 = s.startsWith("/"); boolean flag1 = s.startsWith("/");
@@ -809,10 +1031,13 @@ @@ -809,10 +1027,13 @@
return arraylist; return arraylist;
} }
@ -600,7 +578,7 @@
} }
public String getName() { public String getName() {
@@ -868,11 +1093,13 @@ @@ -868,11 +1089,13 @@
} }
public void a(EnumDifficulty enumdifficulty) { public void a(EnumDifficulty enumdifficulty) {
@ -617,7 +595,7 @@
if (worldserver != null) { if (worldserver != null) {
if (worldserver.getWorldData().isHardcore()) { if (worldserver.getWorldData().isHardcore()) {
@@ -939,13 +1166,11 @@ @@ -939,13 +1162,11 @@
int i = 0; int i = 0;
if (this.worldServer != null) { if (this.worldServer != null) {
@ -635,7 +613,7 @@
WorldData worlddata = worldserver.getWorldData(); WorldData worlddata = worldserver.getWorldData();
mojangstatisticsgenerator.a("world[" + i + "][dimension]", Integer.valueOf(worldserver.worldProvider.getDimensionManager().getDimensionID())); mojangstatisticsgenerator.a("world[" + i + "][dimension]", Integer.valueOf(worldserver.worldProvider.getDimensionManager().getDimensionID()));
@@ -978,7 +1203,7 @@ @@ -978,7 +1199,7 @@
public abstract boolean aa(); public abstract boolean aa();
public boolean getOnlineMode() { public boolean getOnlineMode() {
@ -644,7 +622,7 @@
} }
public void setOnlineMode(boolean flag) { public void setOnlineMode(boolean flag) {
@@ -1050,13 +1275,9 @@ @@ -1050,13 +1271,9 @@
} }
public void setGamemode(EnumGamemode enumgamemode) { public void setGamemode(EnumGamemode enumgamemode) {
@ -661,7 +639,7 @@
} }
} }
@@ -1088,7 +1309,7 @@ @@ -1088,7 +1305,7 @@
} }
public World getWorld() { public World getWorld() {
@ -670,7 +648,7 @@
} }
public Entity f() { public Entity f() {
@@ -1160,8 +1381,10 @@ @@ -1160,8 +1377,10 @@
WorldServer[] aworldserver = this.worldServer; WorldServer[] aworldserver = this.worldServer;
int i = aworldserver.length; int i = aworldserver.length;
@ -683,7 +661,7 @@
if (worldserver != null) { if (worldserver != null) {
Entity entity = worldserver.getEntity(uuid); Entity entity = worldserver.getEntity(uuid);
@@ -1176,7 +1399,7 @@ @@ -1176,7 +1395,7 @@
} }
public boolean getSendCommandFeedback() { public boolean getSendCommandFeedback() {
@ -692,7 +670,7 @@
} }
public void a(CommandObjectiveExecutor.EnumCommandResult commandobjectiveexecutor_enumcommandresult, int i) {} public void a(CommandObjectiveExecutor.EnumCommandResult commandobjectiveexecutor_enumcommandresult, int i) {}
@@ -1191,7 +1414,7 @@ @@ -1191,7 +1410,7 @@
public <V> ListenableFuture<V> a(Callable<V> callable) { public <V> ListenableFuture<V> a(Callable<V> callable) {
Validate.notNull(callable); Validate.notNull(callable);
@ -701,7 +679,7 @@
ListenableFutureTask listenablefuturetask = ListenableFutureTask.create(callable); ListenableFutureTask listenablefuturetask = ListenableFutureTask.create(callable);
Queue queue = this.j; Queue queue = this.j;
@@ -1236,4 +1459,11 @@ @@ -1236,4 +1455,11 @@
public int a(@Nullable WorldServer worldserver) { public int a(@Nullable WorldServer worldserver) {
return worldserver != null ? worldserver.getGameRules().c("spawnRadius") : 10; return worldserver != null ? worldserver.getGameRules().c("spawnRadius") : 10;
} }

Datei anzeigen

@ -1,20 +1,15 @@
--- a/net/minecraft/server/SpawnerCreature.java --- a/net/minecraft/server/SpawnerCreature.java
+++ b/net/minecraft/server/SpawnerCreature.java +++ b/net/minecraft/server/SpawnerCreature.java
@@ -1,15 +1,19 @@ @@ -6,10 +6,16 @@
package net.minecraft.server;
-import com.google.common.collect.Sets;
import java.util.Iterator;
import java.util.List;
import java.util.Random; import java.util.Random;
-import java.util.Set; import java.util.Set;
+
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.craftbukkit.util.LongHash; +import org.bukkit.craftbukkit.util.LongHash;
+import org.bukkit.craftbukkit.util.LongHashSet; +import org.bukkit.craftbukkit.util.LongHashSet;
+import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; +import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
+// CraftBukkit end +// CraftBukkit end
+
public final class SpawnerCreature { public final class SpawnerCreature {
private static final int a = (int) Math.pow(17.0D, 2.0D); private static final int a = (int) Math.pow(17.0D, 2.0D);
@ -23,7 +18,7 @@
public SpawnerCreature() {} public SpawnerCreature() {}
@@ -36,15 +40,18 @@ @@ -36,15 +42,18 @@
for (int i1 = -8; i1 <= 8; ++i1) { for (int i1 = -8; i1 <= 8; ++i1) {
for (k = -8; k <= 8; ++k) { for (k = -8; k <= 8; ++k) {
boolean flag4 = i1 == -8 || i1 == 8 || k == -8 || k == 8; boolean flag4 = i1 == -8 || i1 == 8 || k == -8 || k == 8;
@ -47,7 +42,7 @@
} }
} }
} }
@@ -62,9 +69,31 @@ @@ -62,9 +71,31 @@
for (int k1 = 0; k1 < j; ++k1) { for (int k1 = 0; k1 < j; ++k1) {
EnumCreatureType enumcreaturetype = aenumcreaturetype[k1]; EnumCreatureType enumcreaturetype = aenumcreaturetype[k1];
@ -80,7 +75,7 @@
if (k <= l1) { if (k <= l1) {
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
@@ -72,8 +101,10 @@ @@ -72,8 +103,10 @@
label120: label120:
while (iterator1.hasNext()) { while (iterator1.hasNext()) {
@ -93,7 +88,7 @@
int i2 = blockposition1.getX(); int i2 = blockposition1.getX();
int j2 = blockposition1.getY(); int j2 = blockposition1.getY();
int k2 = blockposition1.getZ(); int k2 = blockposition1.getZ();
@@ -126,7 +157,7 @@ @@ -126,7 +159,7 @@
groupdataentity = entityinsentient.prepare(worldserver.D(new BlockPosition(entityinsentient)), groupdataentity); groupdataentity = entityinsentient.prepare(worldserver.D(new BlockPosition(entityinsentient)), groupdataentity);
if (entityinsentient.canSpawn()) { if (entityinsentient.canSpawn()) {
++l2; ++l2;
@ -102,7 +97,7 @@
} else { } else {
entityinsentient.die(); entityinsentient.die();
} }
@@ -226,8 +257,10 @@ @@ -226,8 +259,10 @@
} }
entityinsentient.setPositionRotation((double) ((float) j1 + 0.5F), (double) blockposition.getY(), (double) ((float) k1 + 0.5F), random.nextFloat() * 360.0F, 0.0F); entityinsentient.setPositionRotation((double) ((float) j1 + 0.5F), (double) blockposition.getY(), (double) ((float) k1 + 0.5F), random.nextFloat() * 360.0F, 0.0F);