mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 11:27:35 +01:00
Update to Minecraft 1.12.1
This commit is contained in:
parent
9a1fc1e2ee
commit
2a927e8638
@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/AdvancementDataPlayer.java
|
||||
+++ b/net/minecraft/server/AdvancementDataPlayer.java
|
||||
@@ -30,7 +30,7 @@
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
private static final Logger a = LogManager.getLogger();
|
||||
private static final Gson b = (new GsonBuilder()).registerTypeAdapter(AdvancementProgress.class, new AdvancementProgress.a()).registerTypeAdapter(MinecraftKey.class, new MinecraftKey.a()).setPrettyPrinting().create();
|
||||
@ -9,7 +9,7 @@
|
||||
};
|
||||
private final MinecraftServer d;
|
||||
private final File e;
|
||||
@@ -92,7 +92,7 @@
|
||||
@@ -93,7 +93,7 @@
|
||||
Iterator iterator = this.data.entrySet().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@ -18,25 +18,16 @@
|
||||
|
||||
if (((AdvancementProgress) entry.getValue()).isDone()) {
|
||||
arraylist.add(entry.getKey());
|
||||
@@ -128,13 +128,15 @@
|
||||
@@ -129,7 +129,7 @@
|
||||
if (this.e.isFile()) {
|
||||
try {
|
||||
String s = Files.toString(this.e, StandardCharsets.UTF_8);
|
||||
- Map map = (Map) ChatDeserializer.a(AdvancementDataPlayer.b, s, AdvancementDataPlayer.c.getType());
|
||||
+ // CraftBukkit start
|
||||
+ Map<MinecraftKey, AdvancementProgress> map = (Map) ChatDeserializer.a(AdvancementDataPlayer.b, s, AdvancementDataPlayer.c.getType());
|
||||
+ Map<MinecraftKey, AdvancementProgress> map = (Map) ChatDeserializer.a(AdvancementDataPlayer.b, s, AdvancementDataPlayer.c.getType()); // CraftBukkit
|
||||
|
||||
if (map == null) {
|
||||
throw new JsonParseException("Found null for advancements");
|
||||
}
|
||||
|
||||
- Stream stream = map.entrySet().stream().sorted(Comparator.comparing(apply<invokedynamic>()));
|
||||
+ Stream stream = map.entrySet().stream().sorted(Comparator.comparing(Entry::getValue));
|
||||
+ // CraftBukkit end
|
||||
Iterator iterator = ((List) stream.collect(Collectors.toList())).iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -142,7 +144,11 @@
|
||||
@@ -143,7 +143,11 @@
|
||||
Advancement advancement = this.d.getAdvancementData().a((MinecraftKey) entry.getKey());
|
||||
|
||||
if (advancement == null) {
|
||||
@ -49,7 +40,7 @@
|
||||
} else {
|
||||
this.a(advancement, (AdvancementProgress) entry.getValue());
|
||||
}
|
||||
@@ -194,6 +200,7 @@
|
||||
@@ -195,6 +199,7 @@
|
||||
this.i.add(advancement);
|
||||
flag = true;
|
||||
if (!flag1 && advancementprogress.isDone()) {
|
||||
|
@ -34,7 +34,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -923,7 +930,7 @@
|
||||
@@ -931,7 +938,7 @@
|
||||
|
||||
if (hashset.contains(block16)) {
|
||||
for (int i = 0; i < 15; ++i) {
|
||||
@ -43,7 +43,7 @@
|
||||
|
||||
Block.REGISTRY_ID.a(block16.fromLegacyData(i), j);
|
||||
}
|
||||
@@ -932,7 +939,7 @@
|
||||
@@ -940,7 +947,7 @@
|
||||
|
||||
while (unmodifiableiterator.hasNext()) {
|
||||
IBlockData iblockdata = (IBlockData) unmodifiableiterator.next();
|
||||
@ -52,7 +52,7 @@
|
||||
|
||||
Block.REGISTRY_ID.a(iblockdata, k);
|
||||
}
|
||||
@@ -941,6 +948,12 @@
|
||||
@@ -949,6 +956,12 @@
|
||||
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@
|
||||
}
|
||||
}
|
||||
} else if (inventoryclicktype == InventoryClickType.SWAP && j >= 0 && j < 9) {
|
||||
@@ -575,6 +647,7 @@
|
||||
@@ -564,6 +636,7 @@
|
||||
inventorycraftresult.a(irecipe);
|
||||
itemstack = irecipe.craftItem(inventorycrafting);
|
||||
}
|
||||
|
@ -98,7 +98,7 @@
|
||||
+
|
||||
thread.setDaemon(true);
|
||||
thread.start();
|
||||
DedicatedServer.LOGGER.info("Starting minecraft server version 1.12");
|
||||
DedicatedServer.LOGGER.info("Starting minecraft server version 1.12.1");
|
||||
@@ -79,7 +126,7 @@
|
||||
}
|
||||
|
||||
@ -158,7 +158,7 @@
|
||||
|
||||
if (this.aT() > 0L) {
|
||||
Thread thread1 = new Thread(new ThreadWatchdog(this));
|
||||
@@ -298,11 +362,11 @@
|
||||
@@ -299,11 +363,11 @@
|
||||
return crashreport;
|
||||
}
|
||||
|
||||
@ -172,7 +172,7 @@
|
||||
super.D();
|
||||
this.aP();
|
||||
}
|
||||
@@ -333,7 +397,15 @@
|
||||
@@ -334,7 +398,15 @@
|
||||
while (!this.serverCommandQueue.isEmpty()) {
|
||||
ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0);
|
||||
|
||||
@ -189,7 +189,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -536,16 +608,70 @@
|
||||
@@ -537,16 +609,70 @@
|
||||
}
|
||||
|
||||
public String getPlugins() {
|
||||
|
@ -49,15 +49,6 @@
|
||||
public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) {
|
||||
super(worldserver, gameprofile);
|
||||
playerinteractmanager.player = this;
|
||||
@@ -72,7 +102,7 @@
|
||||
}
|
||||
|
||||
this.server = minecraftserver;
|
||||
- this.bZ = minecraftserver.getPlayerList().a((EntityHuman) this);
|
||||
+ this.bZ = minecraftserver.getPlayerList().getStatisticManager(this); // CraftBukkit
|
||||
this.bY = minecraftserver.getPlayerList().h(this);
|
||||
this.P = 1.0F;
|
||||
this.setPositionRotation(blockposition, 0.0F, 0.0F);
|
||||
@@ -81,6 +111,11 @@
|
||||
this.setPosition(this.locX, this.locY + 1.0D, this.locZ);
|
||||
}
|
||||
|
@ -57,8 +57,8 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
if (packethandshakinginsetprotocol.b() > 335) {
|
||||
chatmessage = new ChatMessage("multiplayer.disconnect.outdated_server", new Object[] { "1.12"});
|
||||
if (packethandshakinginsetprotocol.b() > 338) {
|
||||
chatmessage = new ChatMessage("multiplayer.disconnect.outdated_server", new Object[] { "1.12.1"});
|
||||
this.b.sendPacket(new PacketLoginOutDisconnect(chatmessage));
|
||||
@@ -26,6 +71,7 @@
|
||||
this.b.close(chatmessage);
|
||||
|
@ -1,11 +1,11 @@
|
||||
--- a/net/minecraft/server/IRecipe.java
|
||||
+++ b/net/minecraft/server/IRecipe.java
|
||||
@@ -13,4 +13,8 @@
|
||||
@@ -17,4 +17,8 @@
|
||||
default boolean c() {
|
||||
return false;
|
||||
}
|
||||
+
|
||||
+ org.bukkit.inventory.Recipe toBukkitRecipe(); // CraftBukkit
|
||||
+
|
||||
+
|
||||
+ void setKey(MinecraftKey key); // CraftBukkit
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/ItemSkull.java
|
||||
+++ b/net/minecraft/server/ItemSkull.java
|
||||
@@ -124,6 +124,15 @@
|
||||
@@ -133,6 +133,15 @@
|
||||
nbttagcompound.set("SkullOwner", GameProfileSerializer.serialize(new NBTTagCompound(), gameprofile));
|
||||
return true;
|
||||
} else {
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/MethodProfiler.java
|
||||
+++ b/net/minecraft/server/MethodProfiler.java
|
||||
@@ -12,6 +12,7 @@
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
public class MethodProfiler {
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
private static final Logger b = LogManager.getLogger();
|
||||
private final List<String> c = Lists.newArrayList();
|
||||
private final List<Long> d = Lists.newArrayList();
|
||||
@@ -22,12 +23,14 @@
|
||||
@@ -23,12 +24,14 @@
|
||||
public MethodProfiler() {}
|
||||
|
||||
public void a() {
|
||||
@ -23,7 +23,14 @@
|
||||
if (this.a) {
|
||||
if (!this.e.isEmpty()) {
|
||||
this.e = this.e + ".";
|
||||
@@ -40,6 +43,7 @@
|
||||
@@ -41,12 +44,14 @@
|
||||
}
|
||||
|
||||
public void a(Supplier<String> supplier) {
|
||||
+ if (!ENABLED) return; // CraftBukkit
|
||||
if (this.a) {
|
||||
this.a((String) supplier.get());
|
||||
}
|
||||
}
|
||||
|
||||
public void b() {
|
||||
@ -31,7 +38,7 @@
|
||||
if (this.a) {
|
||||
long i = System.nanoTime();
|
||||
long j = ((Long) this.d.remove(this.d.size() - 1)).longValue();
|
||||
@@ -62,7 +66,7 @@
|
||||
@@ -69,7 +74,7 @@
|
||||
}
|
||||
|
||||
public List<MethodProfiler.ProfilerInfo> b(String s) {
|
||||
@ -40,7 +47,7 @@
|
||||
return Collections.emptyList();
|
||||
} else {
|
||||
long i = this.f.containsKey("root") ? ((Long) this.f.get("root")).longValue() : 0L;
|
||||
@@ -128,11 +132,13 @@
|
||||
@@ -135,11 +140,13 @@
|
||||
}
|
||||
|
||||
public void c(String s) {
|
||||
@ -54,7 +61,7 @@
|
||||
return this.c.isEmpty() ? "[UNKNOWN]" : (String) this.c.get(this.c.size() - 1);
|
||||
}
|
||||
|
||||
@@ -152,7 +158,7 @@
|
||||
@@ -159,7 +166,7 @@
|
||||
return methodprofiler_profilerinfo.a < this.a ? -1 : (methodprofiler_profilerinfo.a > this.a ? 1 : methodprofiler_profilerinfo.c.compareTo(this.c));
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -40,6 +40,13 @@
|
||||
@@ -41,6 +41,13 @@
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
public abstract class MinecraftServer implements ICommandListener, Runnable, IAsyncTaskHandler, IMojangStatistics {
|
||||
|
||||
@@ -97,19 +104,61 @@
|
||||
@@ -98,19 +105,61 @@
|
||||
private Thread serverThread;
|
||||
private long ab = aw();
|
||||
|
||||
@ -79,7 +79,7 @@
|
||||
protected CommandDispatcher i() {
|
||||
return new CommandDispatcher(this);
|
||||
}
|
||||
@@ -147,6 +196,7 @@
|
||||
@@ -148,6 +197,7 @@
|
||||
this.a(s);
|
||||
this.b("menu.loadingLevel");
|
||||
this.worldServer = new WorldServer[3];
|
||||
@ -87,7 +87,7 @@
|
||||
this.i = new long[this.worldServer.length][100];
|
||||
IDataManager idatamanager = this.convertable.a(s, true);
|
||||
|
||||
@@ -170,36 +220,108 @@
|
||||
@@ -171,36 +221,108 @@
|
||||
worlddata.a(s1);
|
||||
worldsettings = new WorldSettings(worlddata);
|
||||
}
|
||||
@ -207,7 +207,7 @@
|
||||
this.v.setPlayerFileData(this.worldServer);
|
||||
this.a(this.getDifficulty());
|
||||
this.l();
|
||||
@@ -215,25 +337,38 @@
|
||||
@@ -216,25 +338,38 @@
|
||||
this.b("menu.generatingTerrain");
|
||||
boolean flag4 = false;
|
||||
|
||||
@ -261,7 +261,7 @@
|
||||
this.t();
|
||||
}
|
||||
|
||||
@@ -273,14 +408,17 @@
|
||||
@@ -274,14 +409,17 @@
|
||||
protected void t() {
|
||||
this.f = null;
|
||||
this.g = 0;
|
||||
@ -281,7 +281,7 @@
|
||||
|
||||
if (worldserver != null) {
|
||||
if (!flag) {
|
||||
@@ -289,6 +427,7 @@
|
||||
@@ -290,6 +428,7 @@
|
||||
|
||||
try {
|
||||
worldserver.save(true, (IProgressUpdate) null);
|
||||
@ -289,7 +289,7 @@
|
||||
} catch (ExceptionWorldConflict exceptionworldconflict) {
|
||||
MinecraftServer.LOGGER.warn(exceptionworldconflict.getMessage());
|
||||
}
|
||||
@@ -297,8 +436,24 @@
|
||||
@@ -298,8 +437,24 @@
|
||||
|
||||
}
|
||||
|
||||
@ -315,7 +315,7 @@
|
||||
if (this.an() != null) {
|
||||
this.an().b();
|
||||
}
|
||||
@@ -307,6 +462,7 @@
|
||||
@@ -308,6 +463,7 @@
|
||||
MinecraftServer.LOGGER.info("Saving players");
|
||||
this.v.savePlayers();
|
||||
this.v.u();
|
||||
@ -323,7 +323,7 @@
|
||||
}
|
||||
|
||||
if (this.worldServer != null) {
|
||||
@@ -328,12 +484,14 @@
|
||||
@@ -329,12 +485,14 @@
|
||||
aworldserver = this.worldServer;
|
||||
i = aworldserver.length;
|
||||
|
||||
@ -338,7 +338,7 @@
|
||||
}
|
||||
|
||||
if (this.m.d()) {
|
||||
@@ -373,6 +531,7 @@
|
||||
@@ -374,6 +532,7 @@
|
||||
long k = j - this.ab;
|
||||
|
||||
if (k > 2000L && this.ab - this.R >= 15000L) {
|
||||
@ -346,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)", Long.valueOf(k), Long.valueOf(k / 50L));
|
||||
k = 2000L;
|
||||
this.R = this.ab;
|
||||
@@ -385,11 +544,12 @@
|
||||
@@ -386,11 +545,12 @@
|
||||
|
||||
i += k;
|
||||
this.ab = j;
|
||||
@ -360,7 +360,7 @@
|
||||
i -= 50L;
|
||||
this.C();
|
||||
}
|
||||
@@ -427,6 +587,12 @@
|
||||
@@ -428,6 +588,12 @@
|
||||
} catch (Throwable throwable1) {
|
||||
MinecraftServer.LOGGER.error("Exception stopping the server", throwable1);
|
||||
} finally {
|
||||
@ -373,7 +373,7 @@
|
||||
this.B();
|
||||
}
|
||||
|
||||
@@ -470,7 +636,7 @@
|
||||
@@ -471,7 +637,7 @@
|
||||
|
||||
public void B() {}
|
||||
|
||||
@ -382,7 +382,7 @@
|
||||
long i = System.nanoTime();
|
||||
|
||||
++this.ticks;
|
||||
@@ -496,7 +662,7 @@
|
||||
@@ -497,7 +663,7 @@
|
||||
this.q.b().a(agameprofile);
|
||||
}
|
||||
|
||||
@ -391,7 +391,7 @@
|
||||
this.methodProfiler.a("save");
|
||||
this.v.savePlayers();
|
||||
this.saveChunks(true);
|
||||
@@ -520,6 +686,7 @@
|
||||
@@ -521,6 +687,7 @@
|
||||
}
|
||||
|
||||
public void D() {
|
||||
@ -399,7 +399,7 @@
|
||||
this.methodProfiler.a("jobs");
|
||||
Queue queue = this.j;
|
||||
|
||||
@@ -531,20 +698,38 @@
|
||||
@@ -532,22 +699,40 @@
|
||||
|
||||
this.methodProfiler.c("levels");
|
||||
|
||||
@ -430,7 +430,9 @@
|
||||
+ // if (i == 0 || this.getAllowNether()) {
|
||||
+ WorldServer worldserver = this.worlds.get(i);
|
||||
|
||||
this.methodProfiler.a(worldserver.getWorldData().getName());
|
||||
this.methodProfiler.a(() -> {
|
||||
return worldserver.getWorldData().getName();
|
||||
});
|
||||
+ /* Drop global time updates
|
||||
if (this.ticks % 20 == 0) {
|
||||
this.methodProfiler.a("timeSync");
|
||||
@ -441,7 +443,7 @@
|
||||
|
||||
this.methodProfiler.a("tick");
|
||||
|
||||
@@ -571,9 +756,9 @@
|
||||
@@ -574,9 +759,9 @@
|
||||
worldserver.getTracker().updatePlayers();
|
||||
this.methodProfiler.b();
|
||||
this.methodProfiler.b();
|
||||
@ -453,7 +455,7 @@
|
||||
}
|
||||
|
||||
this.methodProfiler.c("connection");
|
||||
@@ -599,10 +784,11 @@
|
||||
@@ -602,10 +787,11 @@
|
||||
this.o.add(itickable);
|
||||
}
|
||||
|
||||
@ -466,7 +468,7 @@
|
||||
boolean flag = true;
|
||||
String s = null;
|
||||
String s1 = ".";
|
||||
@@ -647,13 +833,16 @@
|
||||
@@ -650,13 +836,16 @@
|
||||
++j;
|
||||
}
|
||||
}
|
||||
@ -484,7 +486,7 @@
|
||||
if (s != null) {
|
||||
dedicatedserver.i(s);
|
||||
}
|
||||
@@ -684,6 +873,25 @@
|
||||
@@ -687,6 +876,25 @@
|
||||
dedicatedserver.stop();
|
||||
}
|
||||
});
|
||||
@ -510,7 +512,7 @@
|
||||
} catch (Exception exception) {
|
||||
MinecraftServer.LOGGER.fatal("Failed to start the minecraft server", exception);
|
||||
}
|
||||
@@ -691,8 +899,10 @@
|
||||
@@ -694,8 +902,10 @@
|
||||
}
|
||||
|
||||
public void F() {
|
||||
@ -521,7 +523,7 @@
|
||||
}
|
||||
|
||||
public File d(String s) {
|
||||
@@ -708,7 +918,14 @@
|
||||
@@ -711,7 +921,14 @@
|
||||
}
|
||||
|
||||
public WorldServer getWorldServer(int i) {
|
||||
@ -537,7 +539,7 @@
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
@@ -732,7 +949,7 @@
|
||||
@@ -735,7 +952,7 @@
|
||||
}
|
||||
|
||||
public boolean isDebugging() {
|
||||
@ -546,7 +548,7 @@
|
||||
}
|
||||
|
||||
public void g(String s) {
|
||||
@@ -747,7 +964,7 @@
|
||||
@@ -750,7 +967,7 @@
|
||||
}
|
||||
|
||||
public String getServerModName() {
|
||||
@ -555,7 +557,7 @@
|
||||
}
|
||||
|
||||
public CrashReport b(CrashReport crashreport) {
|
||||
@@ -776,6 +993,7 @@
|
||||
@@ -779,6 +996,7 @@
|
||||
}
|
||||
|
||||
public List<String> tabCompleteCommand(ICommandListener icommandlistener, String s, @Nullable BlockPosition blockposition, boolean flag) {
|
||||
@ -563,7 +565,7 @@
|
||||
ArrayList arraylist = Lists.newArrayList();
|
||||
boolean flag1 = s.startsWith("/");
|
||||
|
||||
@@ -818,10 +1036,13 @@
|
||||
@@ -821,10 +1039,13 @@
|
||||
|
||||
return arraylist;
|
||||
}
|
||||
@ -578,7 +580,7 @@
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
@@ -877,11 +1098,13 @@
|
||||
@@ -880,11 +1101,13 @@
|
||||
}
|
||||
|
||||
public void a(EnumDifficulty enumdifficulty) {
|
||||
@ -595,7 +597,7 @@
|
||||
|
||||
if (worldserver != null) {
|
||||
if (worldserver.getWorldData().isHardcore()) {
|
||||
@@ -948,13 +1171,11 @@
|
||||
@@ -951,13 +1174,11 @@
|
||||
int i = 0;
|
||||
|
||||
if (this.worldServer != null) {
|
||||
@ -613,7 +615,7 @@
|
||||
WorldData worlddata = worldserver.getWorldData();
|
||||
|
||||
mojangstatisticsgenerator.a("world[" + i + "][dimension]", Integer.valueOf(worldserver.worldProvider.getDimensionManager().getDimensionID()));
|
||||
@@ -987,7 +1208,7 @@
|
||||
@@ -990,7 +1211,7 @@
|
||||
public abstract boolean aa();
|
||||
|
||||
public boolean getOnlineMode() {
|
||||
@ -622,7 +624,7 @@
|
||||
}
|
||||
|
||||
public void setOnlineMode(boolean flag) {
|
||||
@@ -1067,13 +1288,9 @@
|
||||
@@ -1070,13 +1291,9 @@
|
||||
}
|
||||
|
||||
public void setGamemode(EnumGamemode enumgamemode) {
|
||||
@ -639,7 +641,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1097,7 +1314,7 @@
|
||||
@@ -1100,7 +1317,7 @@
|
||||
}
|
||||
|
||||
public World getWorld() {
|
||||
@ -648,7 +650,7 @@
|
||||
}
|
||||
|
||||
public int getSpawnProtection() {
|
||||
@@ -1157,8 +1374,10 @@
|
||||
@@ -1160,8 +1377,10 @@
|
||||
WorldServer[] aworldserver = this.worldServer;
|
||||
int i = aworldserver.length;
|
||||
|
||||
@ -661,7 +663,7 @@
|
||||
|
||||
if (worldserver != null) {
|
||||
Entity entity = worldserver.getEntity(uuid);
|
||||
@@ -1173,7 +1392,7 @@
|
||||
@@ -1176,7 +1395,7 @@
|
||||
}
|
||||
|
||||
public boolean getSendCommandFeedback() {
|
||||
@ -670,7 +672,7 @@
|
||||
}
|
||||
|
||||
public MinecraftServer C_() {
|
||||
@@ -1186,7 +1405,7 @@
|
||||
@@ -1189,7 +1408,7 @@
|
||||
|
||||
public <V> ListenableFuture<V> a(Callable<V> callable) {
|
||||
Validate.notNull(callable);
|
||||
@ -679,7 +681,7 @@
|
||||
ListenableFutureTask listenablefuturetask = ListenableFutureTask.create(callable);
|
||||
Queue queue = this.j;
|
||||
|
||||
@@ -1229,23 +1448,30 @@
|
||||
@@ -1232,17 +1451,17 @@
|
||||
}
|
||||
|
||||
public AdvancementDataWorld getAdvancementData() {
|
||||
@ -700,9 +702,7 @@
|
||||
this.getAdvancementData().reload();
|
||||
this.aL().f();
|
||||
this.getPlayerList().reload();
|
||||
} else {
|
||||
- this.postToMainThread(run<invokedynamic>(this));
|
||||
+ this.postToMainThread(() -> reload()); // CraftBukkit - decompile error
|
||||
@@ -1251,4 +1470,11 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -62,15 +62,7 @@
|
||||
private int j;
|
||||
private final IntHashMap<Short> k = new IntHashMap();
|
||||
private double l;
|
||||
@@ -50,6 +96,7 @@
|
||||
private int E;
|
||||
private int receivedMovePackets;
|
||||
private int processedMovePackets;
|
||||
+ private boolean processedDisconnect; // CraftBukkit - Added
|
||||
|
||||
public PlayerConnection(MinecraftServer minecraftserver, NetworkManager networkmanager, EntityPlayer entityplayer) {
|
||||
this.minecraftServer = minecraftserver;
|
||||
@@ -57,7 +104,33 @@
|
||||
@@ -58,7 +104,34 @@
|
||||
networkmanager.setPacketListener(this);
|
||||
this.player = entityplayer;
|
||||
entityplayer.playerConnection = this;
|
||||
@ -80,6 +72,7 @@
|
||||
+ }
|
||||
+
|
||||
+ private final org.bukkit.craftbukkit.CraftServer server;
|
||||
+ private boolean processedDisconnect;
|
||||
+ private int lastTick = MinecraftServer.currentTick;
|
||||
+ private int allowedPlayerTicks = 1;
|
||||
+ private int lastDropTick = MinecraftServer.currentTick;
|
||||
@ -104,7 +97,7 @@
|
||||
|
||||
public void e() {
|
||||
this.syncPosition();
|
||||
@@ -109,15 +182,21 @@
|
||||
@@ -110,15 +183,21 @@
|
||||
}
|
||||
|
||||
this.minecraftServer.methodProfiler.b();
|
||||
@ -126,7 +119,7 @@
|
||||
this.disconnect(new ChatMessage("multiplayer.disconnect.idling", new Object[0]));
|
||||
}
|
||||
|
||||
@@ -136,18 +215,48 @@
|
||||
@@ -137,18 +216,48 @@
|
||||
return this.networkManager;
|
||||
}
|
||||
|
||||
@ -181,7 +174,7 @@
|
||||
}
|
||||
|
||||
public void a(PacketPlayInSteerVehicle packetplayinsteervehicle) {
|
||||
@@ -186,7 +295,34 @@
|
||||
@@ -187,7 +296,34 @@
|
||||
double d9 = entity.motX * entity.motX + entity.motY * entity.motY + entity.motZ * entity.motZ;
|
||||
double d10 = d6 * d6 + d7 * d7 + d8 * d8;
|
||||
|
||||
@ -217,7 +210,7 @@
|
||||
PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getName(), this.player.getName(), Double.valueOf(d6), Double.valueOf(d7), Double.valueOf(d8));
|
||||
this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity));
|
||||
return;
|
||||
@@ -224,6 +360,62 @@
|
||||
@@ -225,6 +361,62 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@ -280,7 +273,7 @@
|
||||
this.minecraftServer.getPlayerList().d(this.player);
|
||||
this.player.checkMovement(this.player.locX - d0, this.player.locY - d1, this.player.locZ - d2);
|
||||
this.D = d11 >= -0.03125D && !this.minecraftServer.getAllowFlight() && !worldserver.c(entity.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
|
||||
@@ -282,7 +474,7 @@
|
||||
@@ -283,7 +475,7 @@
|
||||
} else {
|
||||
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
||||
|
||||
@ -289,7 +282,7 @@
|
||||
if (this.e == 0) {
|
||||
this.syncPosition();
|
||||
}
|
||||
@@ -292,13 +484,21 @@
|
||||
@@ -293,13 +485,21 @@
|
||||
this.A = this.e;
|
||||
this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch);
|
||||
}
|
||||
@ -312,7 +305,7 @@
|
||||
double d0 = this.player.locX;
|
||||
double d1 = this.player.locY;
|
||||
double d2 = this.player.locZ;
|
||||
@@ -323,15 +523,33 @@
|
||||
@@ -324,15 +524,33 @@
|
||||
++this.receivedMovePackets;
|
||||
int i = this.receivedMovePackets - this.processedMovePackets;
|
||||
|
||||
@ -348,7 +341,7 @@
|
||||
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getName(), Double.valueOf(d7), Double.valueOf(d8), Double.valueOf(d9));
|
||||
this.a(this.player.locX, this.player.locY, this.player.locZ, this.player.yaw, this.player.pitch);
|
||||
return;
|
||||
@@ -377,6 +595,69 @@
|
||||
@@ -378,6 +596,69 @@
|
||||
}
|
||||
}
|
||||
|
||||
@ -418,7 +411,7 @@
|
||||
this.B = d12 >= -0.03125D;
|
||||
this.B &= !this.minecraftServer.getAllowFlight() && !this.player.abilities.canFly;
|
||||
this.B &= !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.cP() && !worldserver.c(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
|
||||
@@ -394,10 +675,76 @@
|
||||
@@ -395,10 +676,76 @@
|
||||
}
|
||||
|
||||
public void a(double d0, double d1, double d2, float f, float f1) {
|
||||
@ -496,7 +489,7 @@
|
||||
double d3 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.X) ? this.player.locX : 0.0D;
|
||||
double d4 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Y) ? this.player.locY : 0.0D;
|
||||
double d5 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Z) ? this.player.locZ : 0.0D;
|
||||
@@ -414,6 +761,14 @@
|
||||
@@ -415,6 +762,14 @@
|
||||
f3 = f1 + this.player.pitch;
|
||||
}
|
||||
|
||||
@ -511,7 +504,7 @@
|
||||
if (++this.teleportAwait == Integer.MAX_VALUE) {
|
||||
this.teleportAwait = 0;
|
||||
}
|
||||
@@ -425,6 +780,7 @@
|
||||
@@ -426,6 +781,7 @@
|
||||
|
||||
public void a(PacketPlayInBlockDig packetplayinblockdig) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.x());
|
||||
@ -519,7 +512,7 @@
|
||||
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
||||
BlockPosition blockposition = packetplayinblockdig.a();
|
||||
|
||||
@@ -434,7 +790,15 @@
|
||||
@@ -435,7 +791,15 @@
|
||||
if (!this.player.isSpectator()) {
|
||||
ItemStack itemstack = this.player.b(EnumHand.OFF_HAND);
|
||||
|
||||
@ -536,7 +529,7 @@
|
||||
this.player.a(EnumHand.MAIN_HAND, itemstack);
|
||||
}
|
||||
|
||||
@@ -442,6 +806,21 @@
|
||||
@@ -443,6 +807,21 @@
|
||||
|
||||
case DROP_ITEM:
|
||||
if (!this.player.isSpectator()) {
|
||||
@ -558,7 +551,7 @@
|
||||
this.player.a(false);
|
||||
}
|
||||
|
||||
@@ -475,7 +854,15 @@
|
||||
@@ -476,7 +855,15 @@
|
||||
if (!this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) {
|
||||
this.player.playerInteractManager.a(blockposition, packetplayinblockdig.b());
|
||||
} else {
|
||||
@ -574,7 +567,7 @@
|
||||
}
|
||||
} else {
|
||||
if (packetplayinblockdig.c() == PacketPlayInBlockDig.EnumPlayerDigType.STOP_DESTROY_BLOCK) {
|
||||
@@ -495,10 +882,12 @@
|
||||
@@ -496,10 +883,12 @@
|
||||
default:
|
||||
throw new IllegalArgumentException("Invalid player action");
|
||||
}
|
||||
@ -587,7 +580,7 @@
|
||||
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
||||
EnumHand enumhand = packetplayinuseitem.c();
|
||||
ItemStack itemstack = this.player.b(enumhand);
|
||||
@@ -512,6 +901,13 @@
|
||||
@@ -513,6 +902,13 @@
|
||||
chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
|
||||
this.player.playerConnection.sendPacket(new PacketPlayOutChat(chatmessage, ChatMessageType.GAME_INFO));
|
||||
} else if (this.teleportPos == null && this.player.d((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && !this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) {
|
||||
@ -601,7 +594,7 @@
|
||||
this.player.playerInteractManager.a(this.player, worldserver, itemstack, enumhand, blockposition, enumdirection, packetplayinuseitem.d(), packetplayinuseitem.e(), packetplayinuseitem.f());
|
||||
}
|
||||
|
||||
@@ -521,13 +917,52 @@
|
||||
@@ -522,13 +918,52 @@
|
||||
|
||||
public void a(PacketPlayInBlockPlace packetplayinblockplace) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.x());
|
||||
@ -655,7 +648,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -538,8 +973,8 @@
|
||||
@@ -539,8 +974,8 @@
|
||||
WorldServer[] aworldserver = this.minecraftServer.worldServer;
|
||||
int i = aworldserver.length;
|
||||
|
||||
@ -666,7 +659,7 @@
|
||||
|
||||
if (worldserver != null) {
|
||||
entity = packetplayinspectate.a(worldserver);
|
||||
@@ -552,6 +987,8 @@
|
||||
@@ -553,6 +988,8 @@
|
||||
if (entity != null) {
|
||||
this.player.setSpectatorTarget(this.player);
|
||||
this.player.stopRiding();
|
||||
@ -675,7 +668,7 @@
|
||||
if (entity.world == this.player.world) {
|
||||
this.player.enderTeleportTo(entity.locX, entity.locY, entity.locZ);
|
||||
} else {
|
||||
@@ -577,12 +1014,20 @@
|
||||
@@ -578,12 +1015,20 @@
|
||||
this.minecraftServer.getPlayerList().b(this.player, worldserver2);
|
||||
this.minecraftServer.getPlayerList().updateClient(this.player);
|
||||
}
|
||||
@ -697,7 +690,7 @@
|
||||
|
||||
public void a(PacketPlayInBoatMove packetplayinboatmove) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinboatmove, this, this.player.x());
|
||||
@@ -595,14 +1040,29 @@
|
||||
@@ -596,14 +1041,29 @@
|
||||
}
|
||||
|
||||
public void a(IChatBaseComponent ichatbasecomponent) {
|
||||
@ -728,7 +721,7 @@
|
||||
if (this.minecraftServer.R() && this.player.getName().equals(this.minecraftServer.Q())) {
|
||||
PlayerConnection.LOGGER.info("Stopping singleplayer server as player logged out");
|
||||
this.minecraftServer.safeShutdown();
|
||||
@@ -624,6 +1084,15 @@
|
||||
@@ -625,6 +1085,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
@ -744,7 +737,7 @@
|
||||
try {
|
||||
this.networkManager.sendPacket(packet);
|
||||
} catch (Throwable throwable) {
|
||||
@@ -645,17 +1114,32 @@
|
||||
@@ -646,17 +1115,32 @@
|
||||
|
||||
public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinhelditemslot, this, this.player.x());
|
||||
@ -779,7 +772,7 @@
|
||||
ChatMessage chatmessage = new ChatMessage("chat.cannotSend", new Object[0]);
|
||||
|
||||
chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
|
||||
@@ -668,39 +1152,249 @@
|
||||
@@ -669,39 +1153,249 @@
|
||||
|
||||
for (int i = 0; i < s.length(); ++i) {
|
||||
if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) {
|
||||
@ -1036,7 +1029,7 @@
|
||||
this.player.resetIdleTimer();
|
||||
IJumpable ijumpable;
|
||||
|
||||
@@ -772,6 +1466,7 @@
|
||||
@@ -773,6 +1467,7 @@
|
||||
|
||||
public void a(PacketPlayInUseEntity packetplayinuseentity) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.x());
|
||||
@ -1044,7 +1037,7 @@
|
||||
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
||||
Entity entity = packetplayinuseentity.a((World) worldserver);
|
||||
|
||||
@@ -787,20 +1482,68 @@
|
||||
@@ -788,20 +1483,68 @@
|
||||
if (this.player.h(entity) < d0) {
|
||||
EnumHand enumhand;
|
||||
|
||||
@ -1114,7 +1107,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -816,7 +1559,8 @@
|
||||
@@ -817,7 +1560,8 @@
|
||||
case PERFORM_RESPAWN:
|
||||
if (this.player.viewingCredits) {
|
||||
this.player.viewingCredits = false;
|
||||
@ -1124,7 +1117,7 @@
|
||||
CriterionTriggers.u.a(this.player, DimensionManager.THE_END, DimensionManager.OVERWORLD);
|
||||
} else {
|
||||
if (this.player.getHealth() > 0.0F) {
|
||||
@@ -839,14 +1583,20 @@
|
||||
@@ -840,14 +1584,20 @@
|
||||
|
||||
public void a(PacketPlayInCloseWindow packetplayinclosewindow) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.x());
|
||||
@ -1147,7 +1140,7 @@
|
||||
NonNullList nonnulllist = NonNullList.a();
|
||||
|
||||
for (int i = 0; i < this.player.activeContainer.c.size(); ++i) {
|
||||
@@ -855,8 +1605,274 @@
|
||||
@@ -856,8 +1606,274 @@
|
||||
|
||||
this.player.a(this.player.activeContainer, nonnulllist);
|
||||
} else {
|
||||
@ -1159,7 +1152,7 @@
|
||||
+
|
||||
+ InventoryView inventory = this.player.activeContainer.getBukkitView();
|
||||
+ SlotType type = CraftInventoryView.getSlotType(inventory, packetplayinwindowclick.b());
|
||||
|
||||
+
|
||||
+ InventoryClickEvent event;
|
||||
+ ClickType click = ClickType.UNKNOWN;
|
||||
+ InventoryAction action = InventoryAction.UNKNOWN;
|
||||
@ -1412,7 +1405,7 @@
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
|
||||
+ if (event instanceof CraftItemEvent) {
|
||||
+ // Need to update the inventory on crafting to
|
||||
+ // correctly support custom recipes
|
||||
@ -1423,20 +1416,7 @@
|
||||
if (ItemStack.matches(packetplayinwindowclick.e(), itemstack)) {
|
||||
this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.a(), packetplayinwindowclick.d(), true));
|
||||
this.player.f = true;
|
||||
@@ -886,6 +1902,12 @@
|
||||
public void a(PacketPlayInAutoRecipe packetplayinautorecipe) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinautorecipe, this, this.player.x());
|
||||
this.player.resetIdleTimer();
|
||||
+ // CraftBukkit start
|
||||
+ if (!player.getBukkitEntity().hasPermission("minecraft.autocraft")) {
|
||||
+ player.getBukkitEntity().updateInventory();
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
if (this.player.activeContainer.windowId == packetplayinautorecipe.a() && this.player.activeContainer.c(this.player)) {
|
||||
this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinautorecipe.a(), packetplayinautorecipe.b(), true));
|
||||
Iterator iterator;
|
||||
@@ -958,6 +1980,7 @@
|
||||
@@ -894,6 +1910,7 @@
|
||||
|
||||
public void a(PacketPlayInEnchantItem packetplayinenchantitem) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.x());
|
||||
@ -1444,7 +1424,7 @@
|
||||
this.player.resetIdleTimer();
|
||||
if (this.player.activeContainer.windowId == packetplayinenchantitem.a() && this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
|
||||
this.player.activeContainer.a(this.player, packetplayinenchantitem.b());
|
||||
@@ -991,7 +2014,45 @@
|
||||
@@ -927,7 +1944,45 @@
|
||||
}
|
||||
|
||||
boolean flag1 = packetplayinsetcreativeslot.a() >= 1 && packetplayinsetcreativeslot.a() <= 45;
|
||||
@ -1491,7 +1471,7 @@
|
||||
|
||||
if (flag1 && flag2) {
|
||||
if (itemstack.isEmpty()) {
|
||||
@@ -1015,6 +2076,7 @@
|
||||
@@ -951,6 +2006,7 @@
|
||||
|
||||
public void a(PacketPlayInTransaction packetplayintransaction) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.x());
|
||||
@ -1499,7 +1479,7 @@
|
||||
Short oshort = (Short) this.k.get(this.player.activeContainer.windowId);
|
||||
|
||||
if (oshort != null && packetplayintransaction.b() == oshort.shortValue() && this.player.activeContainer.windowId == packetplayintransaction.a() && !this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
|
||||
@@ -1025,6 +2087,7 @@
|
||||
@@ -961,6 +2017,7 @@
|
||||
|
||||
public void a(PacketPlayInUpdateSign packetplayinupdatesign) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.x());
|
||||
@ -1507,7 +1487,7 @@
|
||||
this.player.resetIdleTimer();
|
||||
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
||||
BlockPosition blockposition = packetplayinupdatesign.a();
|
||||
@@ -1041,14 +2104,30 @@
|
||||
@@ -977,14 +2034,30 @@
|
||||
|
||||
if (!tileentitysign.a() || tileentitysign.e() != this.player) {
|
||||
this.minecraftServer.warning("Player " + this.player.getName() + " just tried to change non-editable sign");
|
||||
@ -1539,7 +1519,7 @@
|
||||
|
||||
tileentitysign.update();
|
||||
worldserver.notify(blockposition, iblockdata, iblockdata, 3);
|
||||
@@ -1071,11 +2150,27 @@
|
||||
@@ -1007,11 +2080,27 @@
|
||||
|
||||
public void a(PacketPlayInAbilities packetplayinabilities) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.x());
|
||||
@ -1568,7 +1548,7 @@
|
||||
ArrayList arraylist = Lists.newArrayList();
|
||||
Iterator iterator = this.minecraftServer.tabCompleteCommand(this.player, packetplayintabcomplete.a(), packetplayintabcomplete.b(), packetplayintabcomplete.c()).iterator();
|
||||
|
||||
@@ -1101,6 +2196,13 @@
|
||||
@@ -1037,6 +2126,13 @@
|
||||
ItemStack itemstack1;
|
||||
|
||||
if ("MC|BEdit".equals(s)) {
|
||||
@ -1582,7 +1562,7 @@
|
||||
packetdataserializer = packetplayincustompayload.b();
|
||||
|
||||
try {
|
||||
@@ -1119,15 +2221,25 @@
|
||||
@@ -1055,15 +2151,25 @@
|
||||
}
|
||||
|
||||
if (itemstack.getItem() == Items.WRITABLE_BOOK && itemstack.getItem() == itemstack1.getItem()) {
|
||||
@ -1608,7 +1588,7 @@
|
||||
packetdataserializer = packetplayincustompayload.b();
|
||||
|
||||
try {
|
||||
@@ -1161,10 +2273,11 @@
|
||||
@@ -1097,10 +2203,11 @@
|
||||
}
|
||||
|
||||
itemstack2.a("pages", (NBTBase) nbttaglist);
|
||||
@ -1621,7 +1601,7 @@
|
||||
}
|
||||
} else if ("MC|TrSel".equals(s)) {
|
||||
try {
|
||||
@@ -1176,6 +2289,7 @@
|
||||
@@ -1112,6 +2219,7 @@
|
||||
}
|
||||
} catch (Exception exception2) {
|
||||
PlayerConnection.LOGGER.error("Couldn\'t select trade", exception2);
|
||||
@ -1629,7 +1609,7 @@
|
||||
}
|
||||
} else {
|
||||
TileEntity tileentity;
|
||||
@@ -1225,6 +2339,7 @@
|
||||
@@ -1161,6 +2269,7 @@
|
||||
}
|
||||
} catch (Exception exception3) {
|
||||
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception3);
|
||||
@ -1637,7 +1617,7 @@
|
||||
}
|
||||
} else if ("MC|AutoCmd".equals(s)) {
|
||||
if (!this.minecraftServer.getEnableCommandBlock()) {
|
||||
@@ -1292,6 +2407,7 @@
|
||||
@@ -1228,6 +2337,7 @@
|
||||
}
|
||||
} catch (Exception exception4) {
|
||||
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception4);
|
||||
@ -1645,7 +1625,7 @@
|
||||
}
|
||||
} else {
|
||||
int k;
|
||||
@@ -1315,6 +2431,7 @@
|
||||
@@ -1251,6 +2361,7 @@
|
||||
}
|
||||
} catch (Exception exception5) {
|
||||
PlayerConnection.LOGGER.error("Couldn\'t set beacon", exception5);
|
||||
@ -1653,7 +1633,7 @@
|
||||
}
|
||||
}
|
||||
} else if ("MC|ItemName".equals(s)) {
|
||||
@@ -1401,6 +2518,7 @@
|
||||
@@ -1337,6 +2448,7 @@
|
||||
}
|
||||
} catch (Exception exception6) {
|
||||
PlayerConnection.LOGGER.error("Couldn\'t set structure block", exception6);
|
||||
@ -1661,7 +1641,7 @@
|
||||
}
|
||||
} else if ("MC|PickItem".equals(s)) {
|
||||
packetdataserializer = packetplayincustompayload.b();
|
||||
@@ -1413,11 +2531,49 @@
|
||||
@@ -1349,11 +2461,49 @@
|
||||
this.player.playerConnection.sendPacket(new PacketPlayOutHeldItemSlot(this.player.inventory.itemInHandIndex));
|
||||
} catch (Exception exception7) {
|
||||
PlayerConnection.LOGGER.error("Couldn\'t pick item", exception7);
|
||||
|
@ -90,7 +90,7 @@
|
||||
public int getFirstEmptySlotIndex() {
|
||||
for (int i = 0; i < this.items.size(); ++i) {
|
||||
if (((ItemStack) this.items.get(i)).isEmpty()) {
|
||||
@@ -512,7 +581,7 @@
|
||||
@@ -524,7 +593,7 @@
|
||||
}
|
||||
|
||||
public int getMaxStackSize() {
|
||||
@ -99,7 +99,7 @@
|
||||
}
|
||||
|
||||
public boolean b(IBlockData iblockdata) {
|
||||
@@ -568,6 +637,11 @@
|
||||
@@ -580,6 +649,11 @@
|
||||
}
|
||||
|
||||
public ItemStack getCarried() {
|
||||
|
@ -917,7 +917,7 @@
|
||||
}
|
||||
|
||||
public boolean getHasWhitelist() {
|
||||
@@ -846,26 +1308,41 @@
|
||||
@@ -846,26 +1308,39 @@
|
||||
}
|
||||
|
||||
public void u() {
|
||||
@ -953,9 +953,7 @@
|
||||
this.sendMessage(ichatbasecomponent, true);
|
||||
}
|
||||
|
||||
- public ServerStatisticManager a(EntityHuman entityhuman) {
|
||||
+ // CraftBukkit start
|
||||
+ // PAIL: rename
|
||||
- public ServerStatisticManager getStatisticManager(EntityHuman entityhuman) {
|
||||
+ public ServerStatisticManager getStatisticManager(EntityPlayer entityhuman) {
|
||||
UUID uuid = entityhuman.getUniqueID();
|
||||
- ServerStatisticManager serverstatisticmanager = uuid == null ? null : (ServerStatisticManager) this.o.get(uuid);
|
||||
@ -964,7 +962,7 @@
|
||||
|
||||
if (serverstatisticmanager == null) {
|
||||
File file = new File(this.server.getWorldServer(0).getDataManager().getDirectory(), "stats");
|
||||
@@ -881,7 +1358,7 @@
|
||||
@@ -881,7 +1356,7 @@
|
||||
|
||||
serverstatisticmanager = new ServerStatisticManager(this.server, file1);
|
||||
serverstatisticmanager.a();
|
||||
@ -973,7 +971,7 @@
|
||||
}
|
||||
|
||||
return serverstatisticmanager;
|
||||
@@ -889,14 +1366,14 @@
|
||||
@@ -889,14 +1364,14 @@
|
||||
|
||||
public AdvancementDataPlayer h(EntityPlayer entityplayer) {
|
||||
UUID uuid = entityplayer.getUniqueID();
|
||||
@ -990,7 +988,7 @@
|
||||
}
|
||||
|
||||
advancementdataplayer.a(entityplayer);
|
||||
@@ -909,8 +1386,10 @@
|
||||
@@ -909,8 +1384,10 @@
|
||||
WorldServer[] aworldserver = this.server.worldServer;
|
||||
int j = aworldserver.length;
|
||||
|
||||
@ -1003,7 +1001,7 @@
|
||||
|
||||
if (worldserver != null) {
|
||||
worldserver.getPlayerChunkMap().a(i);
|
||||
@@ -934,13 +1413,20 @@
|
||||
@@ -934,13 +1411,20 @@
|
||||
}
|
||||
|
||||
public void reload() {
|
||||
|
@ -1,7 +1,7 @@
|
||||
--- a/net/minecraft/server/World.java
|
||||
+++ b/net/minecraft/server/World.java
|
||||
@@ -13,6 +13,21 @@
|
||||
import java.util.UUID;
|
||||
@@ -14,6 +14,21 @@
|
||||
import java.util.function.Supplier;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
+// CraftBukkit start
|
||||
@ -22,7 +22,7 @@
|
||||
public abstract class World implements IBlockAccess {
|
||||
|
||||
private int a = 63;
|
||||
@@ -58,7 +73,52 @@
|
||||
@@ -59,7 +74,52 @@
|
||||
private final WorldBorder P;
|
||||
int[] J;
|
||||
|
||||
@ -76,7 +76,7 @@
|
||||
this.u = Lists.newArrayList(new IWorldAccess[] { this.t});
|
||||
this.N = Calendar.getInstance();
|
||||
this.scoreboard = new Scoreboard();
|
||||
@@ -71,6 +131,36 @@
|
||||
@@ -72,6 +132,36 @@
|
||||
this.worldProvider = worldprovider;
|
||||
this.isClientSide = flag;
|
||||
this.P = worldprovider.getWorldBorder();
|
||||
@ -113,7 +113,7 @@
|
||||
}
|
||||
|
||||
public World b() {
|
||||
@@ -208,6 +298,27 @@
|
||||
@@ -209,6 +299,27 @@
|
||||
}
|
||||
|
||||
public boolean setTypeAndData(BlockPosition blockposition, IBlockData iblockdata, int i) {
|
||||
@ -141,7 +141,7 @@
|
||||
if (this.E(blockposition)) {
|
||||
return false;
|
||||
} else if (!this.isClientSide && this.worldData.getType() == WorldType.DEBUG_ALL_BLOCK_STATES) {
|
||||
@@ -215,9 +326,23 @@
|
||||
@@ -216,9 +327,23 @@
|
||||
} else {
|
||||
Chunk chunk = this.getChunkAtWorldCoords(blockposition);
|
||||
Block block = iblockdata.getBlock();
|
||||
@ -165,7 +165,7 @@
|
||||
return false;
|
||||
} else {
|
||||
if (iblockdata.c() != iblockdata1.c() || iblockdata.d() != iblockdata1.d()) {
|
||||
@@ -226,6 +351,7 @@
|
||||
@@ -227,6 +352,7 @@
|
||||
this.methodProfiler.b();
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@
|
||||
if ((i & 2) != 0 && (!this.isClientSide || (i & 4) == 0) && chunk.isReady()) {
|
||||
this.notify(blockposition, iblockdata1, iblockdata, i);
|
||||
}
|
||||
@@ -238,12 +364,37 @@
|
||||
@@ -239,12 +365,37 @@
|
||||
} else if (!this.isClientSide && (i & 16) == 0) {
|
||||
this.c(blockposition, block);
|
||||
}
|
||||
@ -211,7 +211,7 @@
|
||||
public boolean setAir(BlockPosition blockposition) {
|
||||
return this.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 3);
|
||||
}
|
||||
@@ -277,6 +428,11 @@
|
||||
@@ -278,6 +429,11 @@
|
||||
|
||||
public void update(BlockPosition blockposition, Block block, boolean flag) {
|
||||
if (this.worldData.getType() != WorldType.DEBUG_ALL_BLOCK_STATES) {
|
||||
@ -223,7 +223,7 @@
|
||||
this.applyPhysics(blockposition, block, flag);
|
||||
}
|
||||
|
||||
@@ -365,6 +521,17 @@
|
||||
@@ -366,6 +522,17 @@
|
||||
IBlockData iblockdata = this.getType(blockposition);
|
||||
|
||||
try {
|
||||
@ -241,7 +241,7 @@
|
||||
iblockdata.doPhysics(this, blockposition, block, blockposition1);
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.a(throwable, "Exception while updating neighbours");
|
||||
@@ -582,6 +749,17 @@
|
||||
@@ -583,6 +750,17 @@
|
||||
}
|
||||
|
||||
public IBlockData getType(BlockPosition blockposition) {
|
||||
@ -259,7 +259,7 @@
|
||||
if (this.E(blockposition)) {
|
||||
return Blocks.AIR.getBlockData();
|
||||
} else {
|
||||
@@ -787,6 +965,13 @@
|
||||
@@ -788,6 +966,13 @@
|
||||
}
|
||||
|
||||
public boolean addEntity(Entity entity) {
|
||||
@ -273,7 +273,7 @@
|
||||
int i = MathHelper.floor(entity.locX / 16.0D);
|
||||
int j = MathHelper.floor(entity.locZ / 16.0D);
|
||||
boolean flag = entity.attachedToPlayer;
|
||||
@@ -795,6 +980,37 @@
|
||||
@@ -796,6 +981,37 @@
|
||||
flag = true;
|
||||
}
|
||||
|
||||
@ -311,7 +311,7 @@
|
||||
if (!flag && !this.isChunkLoaded(i, j, false)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -817,6 +1033,7 @@
|
||||
@@ -818,6 +1034,7 @@
|
||||
((IWorldAccess) this.u.get(i)).a(entity);
|
||||
}
|
||||
|
||||
@ -319,7 +319,7 @@
|
||||
}
|
||||
|
||||
protected void c(Entity entity) {
|
||||
@@ -824,6 +1041,7 @@
|
||||
@@ -825,6 +1042,7 @@
|
||||
((IWorldAccess) this.u.get(i)).b(entity);
|
||||
}
|
||||
|
||||
@ -327,7 +327,7 @@
|
||||
}
|
||||
|
||||
public void kill(Entity entity) {
|
||||
@@ -859,7 +1077,15 @@
|
||||
@@ -860,7 +1078,15 @@
|
||||
this.getChunkAt(i, j).b(entity);
|
||||
}
|
||||
|
||||
@ -344,7 +344,7 @@
|
||||
this.c(entity);
|
||||
}
|
||||
|
||||
@@ -976,7 +1202,7 @@
|
||||
@@ -977,7 +1203,7 @@
|
||||
}
|
||||
|
||||
public boolean a(AxisAlignedBB axisalignedbb) {
|
||||
@ -353,7 +353,7 @@
|
||||
}
|
||||
|
||||
public int a(float f) {
|
||||
@@ -1046,6 +1272,11 @@
|
||||
@@ -1047,6 +1273,11 @@
|
||||
|
||||
for (i = 0; i < this.j.size(); ++i) {
|
||||
entity = (Entity) this.j.get(i);
|
||||
@ -365,7 +365,7 @@
|
||||
|
||||
try {
|
||||
++entity.ticksLived;
|
||||
@@ -1094,8 +1325,10 @@
|
||||
@@ -1095,8 +1326,10 @@
|
||||
CrashReportSystemDetails crashreportsystemdetails1;
|
||||
CrashReport crashreport1;
|
||||
|
||||
@ -378,7 +378,7 @@
|
||||
Entity entity1 = entity.bJ();
|
||||
|
||||
if (entity1 != null) {
|
||||
@@ -1128,7 +1361,7 @@
|
||||
@@ -1129,7 +1362,7 @@
|
||||
this.getChunkAt(j, l).b(entity);
|
||||
}
|
||||
|
||||
@ -387,7 +387,7 @@
|
||||
this.c(entity);
|
||||
}
|
||||
|
||||
@@ -1137,6 +1370,13 @@
|
||||
@@ -1138,6 +1371,13 @@
|
||||
|
||||
this.methodProfiler.c("blockEntities");
|
||||
this.O = true;
|
||||
@ -401,16 +401,7 @@
|
||||
Iterator iterator = this.tileEntityListTick.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -1147,7 +1387,7 @@
|
||||
|
||||
if (this.isLoaded(blockposition) && this.P.a(blockposition)) {
|
||||
try {
|
||||
- this.methodProfiler.a(tileentity.getClass().getSimpleName());
|
||||
+ this.methodProfiler.a("ticking"/*tileentity.getClass().getSimpleName()*/); // CraftBukkit: SPIGOT-1900
|
||||
((ITickable) tileentity).e();
|
||||
this.methodProfiler.b();
|
||||
} catch (Throwable throwable2) {
|
||||
@@ -1169,11 +1409,13 @@
|
||||
@@ -1172,11 +1412,13 @@
|
||||
}
|
||||
|
||||
this.O = false;
|
||||
@ -424,7 +415,7 @@
|
||||
|
||||
this.methodProfiler.c("pendingBlockEntities");
|
||||
if (!this.b.isEmpty()) {
|
||||
@@ -1181,9 +1423,11 @@
|
||||
@@ -1184,9 +1426,11 @@
|
||||
TileEntity tileentity1 = (TileEntity) this.b.get(i1);
|
||||
|
||||
if (!tileentity1.y()) {
|
||||
@ -436,7 +427,7 @@
|
||||
|
||||
if (this.isLoaded(tileentity1.getPosition())) {
|
||||
Chunk chunk = this.getChunkAtWorldCoords(tileentity1.getPosition());
|
||||
@@ -1191,6 +1435,12 @@
|
||||
@@ -1194,6 +1438,12 @@
|
||||
|
||||
chunk.a(tileentity1.getPosition(), tileentity1);
|
||||
this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3);
|
||||
@ -449,7 +440,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1244,15 +1494,13 @@
|
||||
@@ -1247,15 +1497,13 @@
|
||||
int i;
|
||||
int j;
|
||||
|
||||
@ -471,7 +462,7 @@
|
||||
|
||||
entity.M = entity.locX;
|
||||
entity.N = entity.locY;
|
||||
@@ -1265,6 +1513,7 @@
|
||||
@@ -1268,6 +1516,7 @@
|
||||
entity.aE();
|
||||
} else {
|
||||
entity.B_();
|
||||
@ -479,7 +470,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1556,11 +1805,18 @@
|
||||
@@ -1559,11 +1808,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
@ -498,7 +489,7 @@
|
||||
TileEntity tileentity = null;
|
||||
|
||||
if (this.O) {
|
||||
@@ -1595,6 +1851,14 @@
|
||||
@@ -1598,6 +1854,14 @@
|
||||
public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) {
|
||||
if (!this.E(blockposition)) {
|
||||
if (tileentity != null && !tileentity.y()) {
|
||||
@ -513,7 +504,7 @@
|
||||
if (this.O) {
|
||||
tileentity.setPosition(blockposition);
|
||||
Iterator iterator = this.b.iterator();
|
||||
@@ -1754,6 +2018,14 @@
|
||||
@@ -1757,6 +2021,14 @@
|
||||
}
|
||||
|
||||
this.o = MathHelper.a(this.o, 0.0F, 1.0F);
|
||||
@ -528,7 +519,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1891,7 +2163,10 @@
|
||||
@@ -1894,7 +2166,10 @@
|
||||
}
|
||||
|
||||
public boolean c(EnumSkyBlock enumskyblock, BlockPosition blockposition) {
|
||||
@ -540,7 +531,7 @@
|
||||
return false;
|
||||
} else {
|
||||
int i = 0;
|
||||
@@ -2058,7 +2333,7 @@
|
||||
@@ -2061,7 +2336,7 @@
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
|
||||
@ -549,7 +540,7 @@
|
||||
arraylist.add(entity);
|
||||
}
|
||||
}
|
||||
@@ -2073,7 +2348,7 @@
|
||||
@@ -2076,7 +2351,7 @@
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
|
||||
@ -558,7 +549,7 @@
|
||||
arraylist.add(entity);
|
||||
}
|
||||
}
|
||||
@@ -2122,7 +2397,7 @@
|
||||
@@ -2125,7 +2400,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@ -567,7 +558,7 @@
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -2143,8 +2418,17 @@
|
||||
@@ -2146,8 +2421,17 @@
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
@ -586,7 +577,7 @@
|
||||
++i;
|
||||
}
|
||||
}
|
||||
@@ -2153,12 +2437,18 @@
|
||||
@@ -2156,12 +2440,18 @@
|
||||
}
|
||||
|
||||
public void a(Collection<Entity> collection) {
|
||||
@ -606,7 +597,7 @@
|
||||
this.b(entity);
|
||||
}
|
||||
|
||||
@@ -2172,7 +2462,13 @@
|
||||
@@ -2175,7 +2465,13 @@
|
||||
IBlockData iblockdata = this.getType(blockposition);
|
||||
AxisAlignedBB axisalignedbb = flag ? null : block.getBlockData().d(this, blockposition);
|
||||
|
||||
@ -621,7 +612,7 @@
|
||||
}
|
||||
|
||||
public int getSeaLevel() {
|
||||
@@ -2282,6 +2578,11 @@
|
||||
@@ -2285,6 +2581,11 @@
|
||||
|
||||
for (int i = 0; i < this.players.size(); ++i) {
|
||||
EntityHuman entityhuman1 = (EntityHuman) this.players.get(i);
|
||||
@ -633,7 +624,7 @@
|
||||
|
||||
if (predicate.apply(entityhuman1)) {
|
||||
double d5 = entityhuman1.d(d0, d1, d2);
|
||||
@@ -2450,6 +2751,16 @@
|
||||
@@ -2453,6 +2754,16 @@
|
||||
|
||||
public void everyoneSleeping() {}
|
||||
|
||||
@ -650,7 +641,7 @@
|
||||
public float h(float f) {
|
||||
return (this.p + (this.q - this.p) * f) * this.j(f);
|
||||
}
|
||||
@@ -2667,7 +2978,7 @@
|
||||
@@ -2670,7 +2981,7 @@
|
||||
int l = j * 16 + 8 - blockposition.getZ();
|
||||
boolean flag = true;
|
||||
|
||||
|
12
pom.xml
12
pom.xml
@ -4,14 +4,14 @@
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.12-R0.1-SNAPSHOT</version>
|
||||
<version>1.12.1-R0.1-SNAPSHOT</version>
|
||||
<name>CraftBukkit</name>
|
||||
<url>http://www.bukkit.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<api.version>unknown</api.version>
|
||||
<minecraft.version>1.12</minecraft.version>
|
||||
<minecraft.version>1.12.1</minecraft.version>
|
||||
<minecraft_version>1_12_R1</minecraft_version>
|
||||
<buildtag.prefix>git-Bukkit-</buildtag.prefix>
|
||||
<buildtag.suffix></buildtag.suffix>
|
||||
@ -79,7 +79,13 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<!-- required until fixed plexus-compiler-eclipse is deployed -->
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spigotmc-public</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>spigotmc-public</id>
|
||||
|
@ -207,7 +207,7 @@ public class CraftAreaEffectCloud extends CraftEntity implements AreaEffectCloud
|
||||
}
|
||||
|
||||
public ProjectileSource getSource() {
|
||||
EntityLiving source = getHandle().y(); // PAIL: rename
|
||||
EntityLiving source = getHandle().getSource();
|
||||
return (source == null) ? null : (LivingEntity) source.getBukkitEntity();
|
||||
}
|
||||
|
||||
|
@ -686,7 +686,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
|
||||
@Override
|
||||
public PistonMoveReaction getPistonMoveReaction() {
|
||||
return PistonMoveReaction.getById(getHandle().o_().ordinal()); // PAIL: rename
|
||||
return PistonMoveReaction.getById(getHandle().getPushReaction().ordinal());
|
||||
}
|
||||
|
||||
protected NBTTagCompound save() {
|
||||
|
@ -134,32 +134,6 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
return getEyeHeight();
|
||||
}
|
||||
|
||||
private List<Block> getLineOfSight(HashSet<Byte> transparent, int maxDistance, int maxLength) {
|
||||
if (maxDistance > 120) {
|
||||
maxDistance = 120;
|
||||
}
|
||||
ArrayList<Block> blocks = new ArrayList<Block>();
|
||||
Iterator<Block> itr = new BlockIterator(this, maxDistance);
|
||||
while (itr.hasNext()) {
|
||||
Block block = itr.next();
|
||||
blocks.add(block);
|
||||
if (maxLength != 0 && blocks.size() > maxLength) {
|
||||
blocks.remove(0);
|
||||
}
|
||||
int id = block.getTypeId();
|
||||
if (transparent == null) {
|
||||
if (id != 0) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (!transparent.contains((byte) id)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return blocks;
|
||||
}
|
||||
|
||||
private List<Block> getLineOfSight(Set<Material> transparent, int maxDistance, int maxLength) {
|
||||
if (maxDistance > 120) {
|
||||
maxDistance = 120;
|
||||
@ -186,28 +160,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
return blocks;
|
||||
}
|
||||
|
||||
public List<Block> getLineOfSight(HashSet<Byte> transparent, int maxDistance) {
|
||||
return getLineOfSight(transparent, maxDistance, 0);
|
||||
}
|
||||
|
||||
public List<Block> getLineOfSight(Set<Material> transparent, int maxDistance) {
|
||||
return getLineOfSight(transparent, maxDistance, 0);
|
||||
}
|
||||
|
||||
public Block getTargetBlock(HashSet<Byte> transparent, int maxDistance) {
|
||||
List<Block> blocks = getLineOfSight(transparent, maxDistance, 1);
|
||||
return blocks.get(0);
|
||||
}
|
||||
|
||||
public Block getTargetBlock(Set<Material> transparent, int maxDistance) {
|
||||
List<Block> blocks = getLineOfSight(transparent, maxDistance, 1);
|
||||
return blocks.get(0);
|
||||
}
|
||||
|
||||
public List<Block> getLastTwoTargetBlocks(HashSet<Byte> transparent, int maxDistance) {
|
||||
return getLineOfSight(transparent, maxDistance, 2);
|
||||
}
|
||||
|
||||
public List<Block> getLastTwoTargetBlocks(Set<Material> transparent, int maxDistance) {
|
||||
return getLineOfSight(transparent, maxDistance, 2);
|
||||
}
|
||||
|
@ -245,7 +245,7 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta
|
||||
break;
|
||||
}
|
||||
}
|
||||
TileEntity te = (blockEntityTag == null) ? null : TileEntity.a(null, blockEntityTag);
|
||||
TileEntity te = (blockEntityTag == null) ? null : TileEntity.create(null, blockEntityTag);
|
||||
|
||||
switch (material) {
|
||||
case SIGN:
|
||||
|
Loading…
Reference in New Issue
Block a user