geforkt von Mirrors/Paper
Update to Minecraft 1.17.1
By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
Ursprung
0392f45e9c
Commit
e8c9836ec9
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/CrashReport.java
|
--- a/net/minecraft/CrashReport.java
|
||||||
+++ b/net/minecraft/CrashReport.java
|
+++ b/net/minecraft/CrashReport.java
|
||||||
@@ -31,6 +31,7 @@
|
@@ -32,6 +32,7 @@
|
||||||
public CrashReport(String s, Throwable throwable) {
|
public CrashReport(String s, Throwable throwable) {
|
||||||
this.title = s;
|
this.title = s;
|
||||||
this.exception = throwable;
|
this.exception = throwable;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/network/PacketDataSerializer.java
|
--- a/net/minecraft/network/PacketDataSerializer.java
|
||||||
+++ b/net/minecraft/network/PacketDataSerializer.java
|
+++ b/net/minecraft/network/PacketDataSerializer.java
|
||||||
@@ -54,6 +54,8 @@
|
@@ -55,6 +55,8 @@
|
||||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||||
import net.minecraft.world.phys.Vec3D;
|
import net.minecraft.world.phys.Vec3D;
|
||||||
|
|
||||||
@ -9,7 +9,7 @@
|
|||||||
public class PacketDataSerializer extends ByteBuf {
|
public class PacketDataSerializer extends ByteBuf {
|
||||||
|
|
||||||
private static final int MAX_VARINT_SIZE = 5;
|
private static final int MAX_VARINT_SIZE = 5;
|
||||||
@@ -112,7 +114,7 @@
|
@@ -123,7 +125,7 @@
|
||||||
|
|
||||||
public <T, C extends Collection<T>> C a(IntFunction<C> intfunction, Function<PacketDataSerializer, T> function) {
|
public <T, C extends Collection<T>> C a(IntFunction<C> intfunction, Function<PacketDataSerializer, T> function) {
|
||||||
int i = this.j();
|
int i = this.j();
|
||||||
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
for (int j = 0; j < i; ++j) {
|
for (int j = 0; j < i; ++j) {
|
||||||
c0.add(function.apply(this));
|
c0.add(function.apply(this));
|
||||||
@@ -123,7 +125,7 @@
|
@@ -134,7 +136,7 @@
|
||||||
|
|
||||||
public <T> void a(Collection<T> collection, BiConsumer<PacketDataSerializer, T> biconsumer) {
|
public <T> void a(Collection<T> collection, BiConsumer<PacketDataSerializer, T> biconsumer) {
|
||||||
this.d(collection.size());
|
this.d(collection.size());
|
||||||
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
T t0 = iterator.next();
|
T t0 = iterator.next();
|
||||||
@@ -134,7 +136,7 @@
|
@@ -145,7 +147,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> List<T> a(Function<PacketDataSerializer, T> function) {
|
public <T> List<T> a(Function<PacketDataSerializer, T> function) {
|
||||||
@ -36,7 +36,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public IntList a() {
|
public IntList a() {
|
||||||
@@ -150,12 +152,12 @@
|
@@ -161,12 +163,12 @@
|
||||||
|
|
||||||
public void a(IntList intlist) {
|
public void a(IntList intlist) {
|
||||||
this.d(intlist.size());
|
this.d(intlist.size());
|
||||||
@ -51,7 +51,7 @@
|
|||||||
|
|
||||||
for (int j = 0; j < i; ++j) {
|
for (int j = 0; j < i; ++j) {
|
||||||
K k0 = function.apply(this);
|
K k0 = function.apply(this);
|
||||||
@@ -330,7 +332,7 @@
|
@@ -355,7 +357,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T extends Enum<T>> T a(Class<T> oclass) {
|
public <T extends Enum<T>> T a(Class<T> oclass) {
|
||||||
@ -60,7 +60,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public PacketDataSerializer a(Enum<?> oenum) {
|
public PacketDataSerializer a(Enum<?> oenum) {
|
||||||
@@ -407,7 +409,7 @@
|
@@ -432,7 +434,7 @@
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) (new ByteBufOutputStream(this)));
|
NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) (new ByteBufOutputStream(this)));
|
||||||
@ -69,7 +69,7 @@
|
|||||||
throw new EncoderException(ioexception);
|
throw new EncoderException(ioexception);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -444,7 +446,7 @@
|
@@ -469,7 +471,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public PacketDataSerializer a(ItemStack itemstack) {
|
public PacketDataSerializer a(ItemStack itemstack) {
|
||||||
@ -78,7 +78,7 @@
|
|||||||
this.writeBoolean(false);
|
this.writeBoolean(false);
|
||||||
} else {
|
} else {
|
||||||
this.writeBoolean(true);
|
this.writeBoolean(true);
|
||||||
@@ -473,6 +475,11 @@
|
@@ -498,6 +500,11 @@
|
||||||
ItemStack itemstack = new ItemStack(Item.getById(i), b0);
|
ItemStack itemstack = new ItemStack(Item.getById(i), b0);
|
||||||
|
|
||||||
itemstack.setTag(this.m());
|
itemstack.setTag(this.m());
|
||||||
|
@ -127,7 +127,7 @@
|
|||||||
+ boolean flag1 = !optionset.has("nogui") && !optionset.nonOptionArguments().contains("nogui");
|
+ boolean flag1 = !optionset.has("nogui") && !optionset.nonOptionArguments().contains("nogui");
|
||||||
|
|
||||||
if (flag1 && !GraphicsEnvironment.isHeadless()) {
|
if (flag1 && !GraphicsEnvironment.isHeadless()) {
|
||||||
dedicatedserver1.bi();
|
dedicatedserver1.bh();
|
||||||
}
|
}
|
||||||
|
|
||||||
+ if (optionset.has("port")) {
|
+ if (optionset.has("port")) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/server/MinecraftServer.java
|
--- a/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/net/minecraft/server/MinecraftServer.java
|
+++ b/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -166,6 +166,25 @@
|
@@ -163,6 +163,25 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
@ -26,7 +26,7 @@
|
|||||||
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable {
|
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable {
|
||||||
|
|
||||||
public static final Logger LOGGER = LogManager.getLogger();
|
public static final Logger LOGGER = LogManager.getLogger();
|
||||||
@@ -258,6 +277,20 @@
|
@@ -254,6 +273,20 @@
|
||||||
private final DefinedStructureManager structureManager;
|
private final DefinedStructureManager structureManager;
|
||||||
protected SaveData worldData;
|
protected SaveData worldData;
|
||||||
|
|
||||||
@ -47,7 +47,7 @@
|
|||||||
public static <S extends MinecraftServer> S a(Function<Thread, S> function) {
|
public static <S extends MinecraftServer> S a(Function<Thread, S> function) {
|
||||||
AtomicReference<S> atomicreference = new AtomicReference();
|
AtomicReference<S> atomicreference = new AtomicReference();
|
||||||
Thread thread = new Thread(() -> {
|
Thread thread = new Thread(() -> {
|
||||||
@@ -267,14 +300,14 @@
|
@@ -263,14 +296,14 @@
|
||||||
thread.setUncaughtExceptionHandler((thread1, throwable) -> {
|
thread.setUncaughtExceptionHandler((thread1, throwable) -> {
|
||||||
MinecraftServer.LOGGER.error(throwable);
|
MinecraftServer.LOGGER.error(throwable);
|
||||||
});
|
});
|
||||||
@ -64,7 +64,7 @@
|
|||||||
super("Server");
|
super("Server");
|
||||||
this.metricsRecorder = InactiveMetricsRecorder.INSTANCE;
|
this.metricsRecorder = InactiveMetricsRecorder.INSTANCE;
|
||||||
this.profiler = this.metricsRecorder.e();
|
this.profiler = this.metricsRecorder.e();
|
||||||
@@ -286,7 +319,7 @@
|
@@ -282,7 +315,7 @@
|
||||||
this.status = new ServerPing();
|
this.status = new ServerPing();
|
||||||
this.random = new Random();
|
this.random = new Random();
|
||||||
this.port = -1;
|
this.port = -1;
|
||||||
@ -73,7 +73,7 @@
|
|||||||
this.running = true;
|
this.running = true;
|
||||||
this.tickTimes = new long[100];
|
this.tickTimes = new long[100];
|
||||||
this.resourcePack = "";
|
this.resourcePack = "";
|
||||||
@@ -316,13 +349,40 @@
|
@@ -312,13 +345,40 @@
|
||||||
this.structureManager = new DefinedStructureManager(datapackresources.i(), convertable_conversionsession, datafixer);
|
this.structureManager = new DefinedStructureManager(datapackresources.i(), convertable_conversionsession, datafixer);
|
||||||
this.serverThread = thread;
|
this.serverThread = thread;
|
||||||
this.executor = SystemUtils.f();
|
this.executor = SystemUtils.f();
|
||||||
@ -115,7 +115,7 @@
|
|||||||
ScoreboardServer scoreboardserver1 = this.getScoreboard();
|
ScoreboardServer scoreboardserver1 = this.getScoreboard();
|
||||||
|
|
||||||
Objects.requireNonNull(scoreboardserver1);
|
Objects.requireNonNull(scoreboardserver1);
|
||||||
@@ -333,7 +393,7 @@
|
@@ -329,7 +389,7 @@
|
||||||
|
|
||||||
public static void convertWorld(Convertable.ConversionSession convertable_conversionsession) {
|
public static void convertWorld(Convertable.ConversionSession convertable_conversionsession) {
|
||||||
if (convertable_conversionsession.isConvertable()) {
|
if (convertable_conversionsession.isConvertable()) {
|
||||||
@ -124,7 +124,7 @@
|
|||||||
convertable_conversionsession.convert(new IProgressUpdate() {
|
convertable_conversionsession.convert(new IProgressUpdate() {
|
||||||
private long timeStamp = SystemUtils.getMonotonicMillis();
|
private long timeStamp = SystemUtils.getMonotonicMillis();
|
||||||
|
|
||||||
@@ -362,48 +422,198 @@
|
@@ -358,48 +418,198 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -303,7 +303,7 @@
|
|||||||
- this.loadSpawn(worldloadlistener);
|
- this.loadSpawn(worldloadlistener);
|
||||||
+ for (WorldServer worldserver : this.getWorlds()) {
|
+ for (WorldServer worldserver : this.getWorlds()) {
|
||||||
+ this.loadSpawn(worldserver.getChunkProvider().chunkMap.progressListener, worldserver);
|
+ this.loadSpawn(worldserver.getChunkProvider().chunkMap.progressListener, worldserver);
|
||||||
+ worldserver.entityManager.a(); // SPIGOT-6526: Load pending entities so they are available to the API
|
+ worldserver.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API
|
||||||
+ this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld()));
|
+ this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld()));
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@ -354,7 +354,7 @@
|
|||||||
if (!iworlddataserver.p()) {
|
if (!iworlddataserver.p()) {
|
||||||
try {
|
try {
|
||||||
a(worldserver, iworlddataserver, generatorsettings.c(), flag);
|
a(worldserver, iworlddataserver, generatorsettings.c(), flag);
|
||||||
@@ -425,31 +635,8 @@
|
@@ -421,31 +631,8 @@
|
||||||
|
|
||||||
iworlddataserver.c(true);
|
iworlddataserver.c(true);
|
||||||
}
|
}
|
||||||
@ -387,7 +387,7 @@
|
|||||||
|
|
||||||
private static void a(WorldServer worldserver, IWorldDataServer iworlddataserver, boolean flag, boolean flag1) {
|
private static void a(WorldServer worldserver, IWorldDataServer iworlddataserver, boolean flag, boolean flag1) {
|
||||||
if (flag1) {
|
if (flag1) {
|
||||||
@@ -462,6 +649,21 @@
|
@@ -458,6 +645,21 @@
|
||||||
return biomebase.b().b();
|
return biomebase.b().b();
|
||||||
}, random);
|
}, random);
|
||||||
ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
|
ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
|
||||||
@ -409,25 +409,25 @@
|
|||||||
|
|
||||||
if (blockposition == null) {
|
if (blockposition == null) {
|
||||||
MinecraftServer.LOGGER.warn("Unable to find spawn biome");
|
MinecraftServer.LOGGER.warn("Unable to find spawn biome");
|
||||||
@@ -536,8 +738,15 @@
|
@@ -532,8 +734,15 @@
|
||||||
iworlddataserver.setGameType(EnumGamemode.SPECTATOR);
|
iworlddataserver.setGameType(EnumGamemode.SPECTATOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
- public void loadSpawn(WorldLoadListener worldloadlistener) {
|
- public void loadSpawn(WorldLoadListener worldloadlistener) {
|
||||||
- WorldServer worldserver = this.F();
|
- WorldServer worldserver = this.E();
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ public void loadSpawn(WorldLoadListener worldloadlistener, WorldServer worldserver) {
|
+ public void loadSpawn(WorldLoadListener worldloadlistener, WorldServer worldserver) {
|
||||||
+ if (!worldserver.getWorld().getKeepSpawnInMemory()) {
|
+ if (!worldserver.getWorld().getKeepSpawnInMemory()) {
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ // WorldServer worldserver = this.F();
|
+ // WorldServer worldserver = this.E();
|
||||||
+ this.forceTicks = true;
|
+ this.forceTicks = true;
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
|
||||||
MinecraftServer.LOGGER.info("Preparing start region for dimension {}", worldserver.getDimensionKey().a());
|
MinecraftServer.LOGGER.info("Preparing start region for dimension {}", worldserver.getDimensionKey().a());
|
||||||
BlockPosition blockposition = worldserver.getSpawn();
|
BlockPosition blockposition = worldserver.getSpawn();
|
||||||
@@ -550,16 +759,20 @@
|
@@ -546,16 +755,20 @@
|
||||||
chunkproviderserver.addTicket(TicketType.START, new ChunkCoordIntPair(blockposition), 11, Unit.INSTANCE);
|
chunkproviderserver.addTicket(TicketType.START, new ChunkCoordIntPair(blockposition), 11, Unit.INSTANCE);
|
||||||
|
|
||||||
while (chunkproviderserver.b() != 441) {
|
while (chunkproviderserver.b() != 441) {
|
||||||
@ -456,7 +456,7 @@
|
|||||||
ForcedChunk forcedchunk = (ForcedChunk) worldserver1.getWorldPersistentData().a(ForcedChunk::b, "chunks");
|
ForcedChunk forcedchunk = (ForcedChunk) worldserver1.getWorldPersistentData().a(ForcedChunk::b, "chunks");
|
||||||
|
|
||||||
if (forcedchunk != null) {
|
if (forcedchunk != null) {
|
||||||
@@ -574,11 +787,18 @@
|
@@ -570,11 +783,18 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -478,13 +478,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void loadResourcesZip() {
|
protected void loadResourcesZip() {
|
||||||
@@ -623,12 +843,16 @@
|
@@ -619,12 +839,16 @@
|
||||||
worldserver.save((IProgressUpdate) null, flag1, worldserver.noSave && !flag2);
|
worldserver.save((IProgressUpdate) null, flag1, worldserver.noSave && !flag2);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // CraftBukkit start - moved to WorldServer.save
|
+ // CraftBukkit start - moved to WorldServer.save
|
||||||
+ /*
|
+ /*
|
||||||
WorldServer worldserver1 = this.F();
|
WorldServer worldserver1 = this.E();
|
||||||
IWorldDataServer iworlddataserver = this.worldData.H();
|
IWorldDataServer iworlddataserver = this.worldData.H();
|
||||||
|
|
||||||
iworlddataserver.a(worldserver1.getWorldBorder().t());
|
iworlddataserver.a(worldserver1.getWorldBorder().t());
|
||||||
@ -492,10 +492,10 @@
|
|||||||
this.storageSource.a(this.registryHolder, this.worldData, this.getPlayerList().save());
|
this.storageSource.a(this.registryHolder, this.worldData, this.getPlayerList().save());
|
||||||
+ */
|
+ */
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
return flag3;
|
if (flag1) {
|
||||||
}
|
Iterator iterator1 = this.getWorlds().iterator();
|
||||||
|
|
||||||
@@ -637,8 +861,29 @@
|
@@ -645,8 +869,29 @@
|
||||||
this.stop();
|
this.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -525,7 +525,7 @@
|
|||||||
if (this.getServerConnection() != null) {
|
if (this.getServerConnection() != null) {
|
||||||
this.getServerConnection().b();
|
this.getServerConnection().b();
|
||||||
}
|
}
|
||||||
@@ -647,6 +892,7 @@
|
@@ -655,6 +900,7 @@
|
||||||
MinecraftServer.LOGGER.info("Saving players");
|
MinecraftServer.LOGGER.info("Saving players");
|
||||||
this.playerList.savePlayers();
|
this.playerList.savePlayers();
|
||||||
this.playerList.shutdown();
|
this.playerList.shutdown();
|
||||||
@ -533,7 +533,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
MinecraftServer.LOGGER.info("Saving worlds");
|
MinecraftServer.LOGGER.info("Saving worlds");
|
||||||
@@ -724,9 +970,10 @@
|
@@ -732,9 +978,10 @@
|
||||||
while (this.running) {
|
while (this.running) {
|
||||||
long i = SystemUtils.getMonotonicMillis() - this.nextTickTime;
|
long i = SystemUtils.getMonotonicMillis() - this.nextTickTime;
|
||||||
|
|
||||||
@ -545,15 +545,15 @@
|
|||||||
MinecraftServer.LOGGER.warn("Can't keep up! Is the server overloaded? Running {}ms or {} ticks behind", i, j);
|
MinecraftServer.LOGGER.warn("Can't keep up! Is the server overloaded? Running {}ms or {} ticks behind", i, j);
|
||||||
this.nextTickTime += j * 50L;
|
this.nextTickTime += j * 50L;
|
||||||
this.lastOverloadWarning = this.nextTickTime;
|
this.lastOverloadWarning = this.nextTickTime;
|
||||||
@@ -737,6 +984,7 @@
|
@@ -745,6 +992,7 @@
|
||||||
this.debugCommandProfiler = new MinecraftServer.a(SystemUtils.getMonotonicNanos(), this.tickCount);
|
this.debugCommandProfiler = new MinecraftServer.a(SystemUtils.getMonotonicNanos(), this.tickCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit
|
+ MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit
|
||||||
this.nextTickTime += 50L;
|
this.nextTickTime += 50L;
|
||||||
this.bi();
|
this.bh();
|
||||||
this.profiler.enter("tick");
|
this.profiler.enter("tick");
|
||||||
@@ -782,6 +1030,12 @@
|
@@ -790,6 +1038,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 {
|
||||||
@ -566,7 +566,7 @@
|
|||||||
this.exit();
|
this.exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -790,8 +1044,15 @@
|
@@ -798,8 +1052,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean canSleepForTick() {
|
private boolean canSleepForTick() {
|
||||||
@ -583,7 +583,7 @@
|
|||||||
|
|
||||||
protected void sleepForTick() {
|
protected void sleepForTick() {
|
||||||
this.executeAll();
|
this.executeAll();
|
||||||
@@ -906,7 +1167,7 @@
|
@@ -908,7 +1169,7 @@
|
||||||
this.status.b().a(agameprofile);
|
this.status.b().a(agameprofile);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -592,7 +592,7 @@
|
|||||||
MinecraftServer.LOGGER.debug("Autosave started");
|
MinecraftServer.LOGGER.debug("Autosave started");
|
||||||
this.profiler.enter("save");
|
this.profiler.enter("save");
|
||||||
this.playerList.savePlayers();
|
this.playerList.savePlayers();
|
||||||
@@ -936,22 +1197,39 @@
|
@@ -938,22 +1199,39 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void b(BooleanSupplier booleansupplier) {
|
public void b(BooleanSupplier booleansupplier) {
|
||||||
@ -632,7 +632,7 @@
|
|||||||
|
|
||||||
this.profiler.enter("tick");
|
this.profiler.enter("tick");
|
||||||
|
|
||||||
@@ -1040,7 +1318,7 @@
|
@@ -1042,7 +1320,7 @@
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
public String getServerModName() {
|
public String getServerModName() {
|
||||||
@ -641,7 +641,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public SystemReport b(SystemReport systemreport) {
|
public SystemReport b(SystemReport systemreport) {
|
||||||
@@ -1412,16 +1690,17 @@
|
@@ -1414,16 +1692,17 @@
|
||||||
|
|
||||||
public CompletableFuture<Void> a(Collection<String> collection) {
|
public CompletableFuture<Void> a(Collection<String> collection) {
|
||||||
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
|
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
|
||||||
@ -661,7 +661,7 @@
|
|||||||
this.packRepository.a(collection);
|
this.packRepository.a(collection);
|
||||||
this.worldData.a(a(this.packRepository));
|
this.worldData.a(a(this.packRepository));
|
||||||
datapackresources.j();
|
datapackresources.j();
|
||||||
@@ -1766,6 +2045,22 @@
|
@@ -1768,6 +2047,22 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -681,6 +681,6 @@
|
|||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
+
|
+
|
||||||
private void bi() {
|
private void bh() {
|
||||||
if (this.willStartRecordingMetrics) {
|
if (this.willStartRecordingMetrics) {
|
||||||
this.metricsRecorder = ActiveMetricsRecorder.a(new ServerMetricsSamplersProvider(SystemUtils.timeSource, this.k()), SystemUtils.timeSource, SystemUtils.g(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> {
|
this.metricsRecorder = ActiveMetricsRecorder.a(new ServerMetricsSamplersProvider(SystemUtils.timeSource, this.k()), SystemUtils.timeSource, SystemUtils.g(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -64,6 +64,15 @@
|
@@ -65,6 +65,15 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
@ -16,7 +16,7 @@
|
|||||||
public class DedicatedServer extends MinecraftServer implements IMinecraftServer {
|
public class DedicatedServer extends MinecraftServer implements IMinecraftServer {
|
||||||
|
|
||||||
static final Logger LOGGER = LogManager.getLogger();
|
static final Logger LOGGER = LogManager.getLogger();
|
||||||
@@ -82,8 +91,10 @@
|
@@ -83,8 +92,10 @@
|
||||||
@Nullable
|
@Nullable
|
||||||
private final IChatBaseComponent resourcePackPrompt;
|
private final IChatBaseComponent resourcePackPrompt;
|
||||||
|
|
||||||
@ -29,7 +29,7 @@
|
|||||||
this.settings = dedicatedserversettings;
|
this.settings = dedicatedserversettings;
|
||||||
this.rconConsoleSource = new RemoteControlCommandListener(this);
|
this.rconConsoleSource = new RemoteControlCommandListener(this);
|
||||||
this.textFilterClient = TextFilter.a(dedicatedserversettings.getProperties().textFilteringConfig);
|
this.textFilterClient = TextFilter.a(dedicatedserversettings.getProperties().textFilteringConfig);
|
||||||
@@ -94,13 +105,44 @@
|
@@ -95,13 +106,44 @@
|
||||||
public boolean init() throws IOException {
|
public boolean init() throws IOException {
|
||||||
Thread thread = new Thread("Server console handler") {
|
Thread thread = new Thread("Server console handler") {
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -77,7 +77,7 @@
|
|||||||
}
|
}
|
||||||
} catch (IOException ioexception) {
|
} catch (IOException ioexception) {
|
||||||
DedicatedServer.LOGGER.error("Exception handling console input", ioexception);
|
DedicatedServer.LOGGER.error("Exception handling console input", ioexception);
|
||||||
@@ -109,6 +151,27 @@
|
@@ -110,6 +152,27 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -105,16 +105,16 @@
|
|||||||
thread.setDaemon(true);
|
thread.setDaemon(true);
|
||||||
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(DedicatedServer.LOGGER));
|
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(DedicatedServer.LOGGER));
|
||||||
thread.start();
|
thread.start();
|
||||||
@@ -134,7 +197,7 @@
|
@@ -135,7 +198,7 @@
|
||||||
this.setMotd(dedicatedserverproperties.motd);
|
this.setMotd(dedicatedserverproperties.motd);
|
||||||
super.setIdleTimeout((Integer) dedicatedserverproperties.playerIdleTimeout.get());
|
super.setIdleTimeout((Integer) dedicatedserverproperties.playerIdleTimeout.get());
|
||||||
this.h(dedicatedserverproperties.enforceWhitelist);
|
this.setEnforceWhitelist(dedicatedserverproperties.enforceWhitelist);
|
||||||
- this.worldData.setGameType(dedicatedserverproperties.gamemode);
|
- this.worldData.setGameType(dedicatedserverproperties.gamemode);
|
||||||
+ // this.worldData.setGameType(dedicatedserverproperties.gamemode); // CraftBukkit - moved to world loading
|
+ // this.worldData.setGameType(dedicatedserverproperties.gamemode); // CraftBukkit - moved to world loading
|
||||||
DedicatedServer.LOGGER.info("Default game type: {}", dedicatedserverproperties.gamemode);
|
DedicatedServer.LOGGER.info("Default game type: {}", dedicatedserverproperties.gamemode);
|
||||||
InetAddress inetaddress = null;
|
InetAddress inetaddress = null;
|
||||||
|
|
||||||
@@ -158,6 +221,12 @@
|
@@ -159,6 +222,12 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,7 +127,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.");
|
||||||
@@ -172,14 +241,14 @@
|
@@ -173,7 +242,7 @@
|
||||||
if (!NameReferencingFileConverter.e(this)) {
|
if (!NameReferencingFileConverter.e(this)) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@ -136,7 +136,8 @@
|
|||||||
long i = SystemUtils.getMonotonicNanos();
|
long i = SystemUtils.getMonotonicNanos();
|
||||||
|
|
||||||
TileEntitySkull.a(this.getUserCache());
|
TileEntitySkull.a(this.getUserCache());
|
||||||
TileEntitySkull.a(this.getMinecraftSessionService());
|
@@ -181,7 +250,7 @@
|
||||||
|
TileEntitySkull.a((Executor) this);
|
||||||
UserCache.a(this.getOnlineMode());
|
UserCache.a(this.getOnlineMode());
|
||||||
DedicatedServer.LOGGER.info("Preparing level \"{}\"", this.getWorld());
|
DedicatedServer.LOGGER.info("Preparing level \"{}\"", this.getWorld());
|
||||||
- this.loadWorld();
|
- this.loadWorld();
|
||||||
@ -144,7 +145,7 @@
|
|||||||
long j = SystemUtils.getMonotonicNanos() - i;
|
long j = SystemUtils.getMonotonicNanos() - i;
|
||||||
String s = String.format(Locale.ROOT, "%.3fs", (double) j / 1.0E9D);
|
String s = String.format(Locale.ROOT, "%.3fs", (double) j / 1.0E9D);
|
||||||
|
|
||||||
@@ -196,6 +265,7 @@
|
@@ -198,6 +267,7 @@
|
||||||
if (dedicatedserverproperties.enableRcon) {
|
if (dedicatedserverproperties.enableRcon) {
|
||||||
DedicatedServer.LOGGER.info("Starting remote control listener");
|
DedicatedServer.LOGGER.info("Starting remote control listener");
|
||||||
this.rconThread = RemoteControlListener.a((IMinecraftServer) this);
|
this.rconThread = RemoteControlListener.a((IMinecraftServer) this);
|
||||||
@ -152,7 +153,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.getMaxTickTime() > 0L) {
|
if (this.getMaxTickTime() > 0L) {
|
||||||
@@ -345,6 +415,7 @@
|
@@ -347,6 +417,7 @@
|
||||||
this.queryThreadGs4.b();
|
this.queryThreadGs4.b();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,7 +161,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -378,7 +449,15 @@
|
@@ -380,7 +451,15 @@
|
||||||
while (!this.consoleInput.isEmpty()) {
|
while (!this.consoleInput.isEmpty()) {
|
||||||
ServerCommand servercommand = (ServerCommand) this.consoleInput.remove(0);
|
ServerCommand servercommand = (ServerCommand) this.consoleInput.remove(0);
|
||||||
|
|
||||||
@ -177,7 +178,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -583,14 +662,45 @@
|
@@ -585,14 +664,45 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPlugins() {
|
public String getPlugins() {
|
||||||
@ -225,8 +226,8 @@
|
|||||||
});
|
});
|
||||||
return this.rconConsoleSource.getMessages();
|
return this.rconConsoleSource.getMessages();
|
||||||
}
|
}
|
||||||
@@ -663,4 +773,15 @@
|
@@ -665,4 +775,15 @@
|
||||||
public IChatBaseComponent bb() {
|
public IChatBaseComponent ba() {
|
||||||
return this.resourcePackPrompt;
|
return this.resourcePackPrompt;
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
public final String serverIp = this.getString("server-ip", "");
|
public final String serverIp = this.getString("server-ip", "");
|
||||||
@@ -64,8 +70,10 @@
|
@@ -64,8 +70,10 @@
|
||||||
@Nullable
|
@Nullable
|
||||||
public GeneratorSettings worldGenSettings;
|
private GeneratorSettings worldGenSettings;
|
||||||
|
|
||||||
- public DedicatedServerProperties(Properties properties) {
|
- public DedicatedServerProperties(Properties properties) {
|
||||||
- super(properties);
|
- super(properties);
|
||||||
|
@ -132,7 +132,16 @@
|
|||||||
|
|
||||||
this.level.getMethodProfiler().enter("naturalSpawnCount");
|
this.level.getMethodProfiler().enter("naturalSpawnCount");
|
||||||
int l = this.distanceManager.b();
|
int l = this.distanceManager.b();
|
||||||
@@ -548,13 +594,19 @@
|
@@ -394,7 +440,7 @@
|
||||||
|
|
||||||
|
this.level.getMethodProfiler().exitEnter("broadcast");
|
||||||
|
list.forEach((playerchunk) -> {
|
||||||
|
- Optional optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_LEVEL_CHUNK)).left();
|
||||||
|
+ Optional<Chunk> optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_LEVEL_CHUNK)).left(); // CraftBukkit - decompile error
|
||||||
|
|
||||||
|
Objects.requireNonNull(playerchunk);
|
||||||
|
optional.ifPresent(playerchunk::a);
|
||||||
|
@@ -551,13 +597,19 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/server/level/EntityPlayer.java
|
--- a/net/minecraft/server/level/EntityPlayer.java
|
||||||
+++ b/net/minecraft/server/level/EntityPlayer.java
|
+++ b/net/minecraft/server/level/EntityPlayer.java
|
||||||
@@ -140,6 +140,36 @@
|
@@ -141,6 +141,36 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
@ -37,7 +37,7 @@
|
|||||||
public class EntityPlayer extends EntityHuman {
|
public class EntityPlayer extends EntityHuman {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogManager.getLogger();
|
||||||
@@ -187,6 +217,20 @@
|
@@ -188,6 +218,20 @@
|
||||||
public int latency;
|
public int latency;
|
||||||
public boolean wonGame;
|
public boolean wonGame;
|
||||||
|
|
||||||
@ -58,7 +58,7 @@
|
|||||||
public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile) {
|
public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile) {
|
||||||
super(worldserver, worldserver.getSpawn(), worldserver.x(), gameprofile);
|
super(worldserver, worldserver.getSpawn(), worldserver.x(), gameprofile);
|
||||||
this.chatVisibility = EnumChatVisibility.FULL;
|
this.chatVisibility = EnumChatVisibility.FULL;
|
||||||
@@ -253,12 +297,56 @@
|
@@ -249,12 +293,56 @@
|
||||||
this.advancements = minecraftserver.getPlayerList().f(this);
|
this.advancements = minecraftserver.getPlayerList().f(this);
|
||||||
this.maxUpStep = 1.0F;
|
this.maxUpStep = 1.0F;
|
||||||
this.d(worldserver);
|
this.d(worldserver);
|
||||||
@ -116,7 +116,7 @@
|
|||||||
int i = Math.max(0, this.server.a(worldserver));
|
int i = Math.max(0, this.server.a(worldserver));
|
||||||
int j = MathHelper.floor(worldserver.getWorldBorder().b((double) blockposition.getX(), (double) blockposition.getZ()));
|
int j = MathHelper.floor(worldserver.getWorldBorder().b((double) blockposition.getX(), (double) blockposition.getZ()));
|
||||||
|
|
||||||
@@ -316,11 +404,20 @@
|
@@ -312,11 +400,20 @@
|
||||||
if (nbttagcompound.hasKeyOfType("recipeBook", 10)) {
|
if (nbttagcompound.hasKeyOfType("recipeBook", 10)) {
|
||||||
this.recipeBook.a(nbttagcompound.getCompound("recipeBook"), this.server.getCraftingManager());
|
this.recipeBook.a(nbttagcompound.getCompound("recipeBook"), this.server.getCraftingManager());
|
||||||
}
|
}
|
||||||
@ -137,7 +137,7 @@
|
|||||||
if (nbttagcompound.hasKeyOfType("SpawnX", 99) && nbttagcompound.hasKeyOfType("SpawnY", 99) && nbttagcompound.hasKeyOfType("SpawnZ", 99)) {
|
if (nbttagcompound.hasKeyOfType("SpawnX", 99) && nbttagcompound.hasKeyOfType("SpawnY", 99) && nbttagcompound.hasKeyOfType("SpawnZ", 99)) {
|
||||||
this.respawnPosition = new BlockPosition(nbttagcompound.getInt("SpawnX"), nbttagcompound.getInt("SpawnY"), nbttagcompound.getInt("SpawnZ"));
|
this.respawnPosition = new BlockPosition(nbttagcompound.getInt("SpawnX"), nbttagcompound.getInt("SpawnY"), nbttagcompound.getInt("SpawnZ"));
|
||||||
this.respawnForced = nbttagcompound.getBoolean("SpawnForced");
|
this.respawnForced = nbttagcompound.getBoolean("SpawnForced");
|
||||||
@@ -353,7 +450,20 @@
|
@@ -349,7 +446,20 @@
|
||||||
Entity entity = this.getRootVehicle();
|
Entity entity = this.getRootVehicle();
|
||||||
Entity entity1 = this.getVehicle();
|
Entity entity1 = this.getVehicle();
|
||||||
|
|
||||||
@ -159,7 +159,7 @@
|
|||||||
NBTTagCompound nbttagcompound2 = new NBTTagCompound();
|
NBTTagCompound nbttagcompound2 = new NBTTagCompound();
|
||||||
NBTTagCompound nbttagcompound3 = new NBTTagCompound();
|
NBTTagCompound nbttagcompound3 = new NBTTagCompound();
|
||||||
|
|
||||||
@@ -371,7 +481,7 @@
|
@@ -367,7 +477,7 @@
|
||||||
nbttagcompound.setInt("SpawnZ", this.respawnPosition.getZ());
|
nbttagcompound.setInt("SpawnZ", this.respawnPosition.getZ());
|
||||||
nbttagcompound.setBoolean("SpawnForced", this.respawnForced);
|
nbttagcompound.setBoolean("SpawnForced", this.respawnForced);
|
||||||
nbttagcompound.setFloat("SpawnAngle", this.respawnAngle);
|
nbttagcompound.setFloat("SpawnAngle", this.respawnAngle);
|
||||||
@ -168,7 +168,7 @@
|
|||||||
Logger logger = EntityPlayer.LOGGER;
|
Logger logger = EntityPlayer.LOGGER;
|
||||||
|
|
||||||
Objects.requireNonNull(logger);
|
Objects.requireNonNull(logger);
|
||||||
@@ -379,9 +489,33 @@
|
@@ -375,9 +485,33 @@
|
||||||
nbttagcompound.set("SpawnDimension", nbtbase);
|
nbttagcompound.set("SpawnDimension", nbtbase);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -202,7 +202,7 @@
|
|||||||
public void a(int i) {
|
public void a(int i) {
|
||||||
float f = (float) this.getExpToLevel();
|
float f = (float) this.getExpToLevel();
|
||||||
float f1 = (f - 1.0F) / f;
|
float f1 = (f - 1.0F) / f;
|
||||||
@@ -440,6 +574,11 @@
|
@@ -436,6 +570,11 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
@ -214,7 +214,7 @@
|
|||||||
this.gameMode.a();
|
this.gameMode.a();
|
||||||
--this.spawnInvulnerableTime;
|
--this.spawnInvulnerableTime;
|
||||||
if (this.invulnerableTime > 0) {
|
if (this.invulnerableTime > 0) {
|
||||||
@@ -493,7 +632,7 @@
|
@@ -489,7 +628,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.getHealth() != this.lastSentHealth || this.lastSentFood != this.foodData.getFoodLevel() || this.foodData.getSaturationLevel() == 0.0F != this.lastFoodSaturationZero) {
|
if (this.getHealth() != this.lastSentHealth || this.lastSentFood != this.foodData.getFoodLevel() || this.foodData.getSaturationLevel() == 0.0F != this.lastFoodSaturationZero) {
|
||||||
@ -223,7 +223,7 @@
|
|||||||
this.lastSentHealth = this.getHealth();
|
this.lastSentHealth = this.getHealth();
|
||||||
this.lastSentFood = this.foodData.getFoodLevel();
|
this.lastSentFood = this.foodData.getFoodLevel();
|
||||||
this.lastFoodSaturationZero = this.foodData.getSaturationLevel() == 0.0F;
|
this.lastFoodSaturationZero = this.foodData.getSaturationLevel() == 0.0F;
|
||||||
@@ -524,6 +663,12 @@
|
@@ -520,6 +659,12 @@
|
||||||
this.a(IScoreboardCriteria.EXPERIENCE, MathHelper.f((float) this.lastRecordedExperience));
|
this.a(IScoreboardCriteria.EXPERIENCE, MathHelper.f((float) this.lastRecordedExperience));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,7 +236,7 @@
|
|||||||
if (this.experienceLevel != this.lastRecordedLevel) {
|
if (this.experienceLevel != this.lastRecordedLevel) {
|
||||||
this.lastRecordedLevel = this.experienceLevel;
|
this.lastRecordedLevel = this.experienceLevel;
|
||||||
this.a(IScoreboardCriteria.LEVEL, MathHelper.f((float) this.lastRecordedLevel));
|
this.a(IScoreboardCriteria.LEVEL, MathHelper.f((float) this.lastRecordedLevel));
|
||||||
@@ -538,6 +683,16 @@
|
@@ -534,6 +679,16 @@
|
||||||
CriterionTriggers.LOCATION.a(this);
|
CriterionTriggers.LOCATION.a(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -253,7 +253,7 @@
|
|||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
CrashReport crashreport = CrashReport.a(throwable, "Ticking player");
|
CrashReport crashreport = CrashReport.a(throwable, "Ticking player");
|
||||||
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Player being ticked");
|
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Player being ticked");
|
||||||
@@ -548,7 +703,8 @@
|
@@ -544,7 +699,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
private void a(IScoreboardCriteria iscoreboardcriteria, int i) {
|
private void a(IScoreboardCriteria iscoreboardcriteria, int i) {
|
||||||
@ -263,7 +263,7 @@
|
|||||||
scoreboardscore.setScore(i);
|
scoreboardscore.setScore(i);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -556,9 +712,46 @@
|
@@ -552,9 +708,46 @@
|
||||||
@Override
|
@Override
|
||||||
public void die(DamageSource damagesource) {
|
public void die(DamageSource damagesource) {
|
||||||
boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES);
|
boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES);
|
||||||
@ -312,9 +312,9 @@
|
|||||||
|
|
||||||
this.connection.a((Packet) (new ClientboundPlayerCombatKillPacket(this.getCombatTracker(), ichatbasecomponent)), (future) -> {
|
this.connection.a((Packet) (new ClientboundPlayerCombatKillPacket(this.getCombatTracker(), ichatbasecomponent)), (future) -> {
|
||||||
if (!future.isSuccess()) {
|
if (!future.isSuccess()) {
|
||||||
@@ -592,12 +785,18 @@
|
@@ -588,12 +781,18 @@
|
||||||
if (this.level.getGameRules().getBoolean(GameRules.RULE_FORGIVE_DEAD_PLAYERS)) {
|
if (this.level.getGameRules().getBoolean(GameRules.RULE_FORGIVE_DEAD_PLAYERS)) {
|
||||||
this.fH();
|
this.fI();
|
||||||
}
|
}
|
||||||
-
|
-
|
||||||
- if (!this.isSpectator()) {
|
- if (!this.isSpectator()) {
|
||||||
@ -335,7 +335,7 @@
|
|||||||
EntityLiving entityliving = this.getKillingEntity();
|
EntityLiving entityliving = this.getKillingEntity();
|
||||||
|
|
||||||
if (entityliving != null) {
|
if (entityliving != null) {
|
||||||
@@ -634,10 +833,12 @@
|
@@ -630,10 +829,12 @@
|
||||||
String s = this.getName();
|
String s = this.getName();
|
||||||
String s1 = entity.getName();
|
String s1 = entity.getName();
|
||||||
|
|
||||||
@ -350,7 +350,7 @@
|
|||||||
} else {
|
} else {
|
||||||
this.a(StatisticList.MOB_KILLS);
|
this.a(StatisticList.MOB_KILLS);
|
||||||
}
|
}
|
||||||
@@ -655,7 +856,8 @@
|
@@ -651,7 +852,8 @@
|
||||||
int i = scoreboardteam.getColor().b();
|
int i = scoreboardteam.getColor().b();
|
||||||
|
|
||||||
if (i >= 0 && i < aiscoreboardcriteria.length) {
|
if (i >= 0 && i < aiscoreboardcriteria.length) {
|
||||||
@ -360,7 +360,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -699,18 +901,20 @@
|
@@ -695,18 +897,20 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean canPvP() {
|
private boolean canPvP() {
|
||||||
@ -384,7 +384,7 @@
|
|||||||
} else {
|
} else {
|
||||||
return shapedetectorshape;
|
return shapedetectorshape;
|
||||||
}
|
}
|
||||||
@@ -719,11 +923,20 @@
|
@@ -715,11 +919,20 @@
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public Entity b(WorldServer worldserver) {
|
public Entity b(WorldServer worldserver) {
|
||||||
@ -408,7 +408,7 @@
|
|||||||
this.decouple();
|
this.decouple();
|
||||||
this.getWorldServer().a(this, Entity.RemovalReason.CHANGED_DIMENSION);
|
this.getWorldServer().a(this, Entity.RemovalReason.CHANGED_DIMENSION);
|
||||||
if (!this.wonGame) {
|
if (!this.wonGame) {
|
||||||
@@ -734,6 +947,8 @@
|
@@ -730,6 +943,8 @@
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
} else {
|
} else {
|
||||||
@ -417,7 +417,7 @@
|
|||||||
WorldData worlddata = worldserver.getWorldData();
|
WorldData worlddata = worldserver.getWorldData();
|
||||||
|
|
||||||
this.connection.sendPacket(new PacketPlayOutRespawn(worldserver.getDimensionManager(), worldserver.getDimensionKey(), BiomeManager.a(worldserver.getSeed()), this.gameMode.getGameMode(), this.gameMode.c(), worldserver.isDebugWorld(), worldserver.isFlatWorld(), true));
|
this.connection.sendPacket(new PacketPlayOutRespawn(worldserver.getDimensionManager(), worldserver.getDimensionKey(), BiomeManager.a(worldserver.getSeed()), this.gameMode.getGameMode(), this.gameMode.c(), worldserver.isDebugWorld(), worldserver.isFlatWorld(), true));
|
||||||
@@ -743,22 +958,52 @@
|
@@ -739,22 +954,52 @@
|
||||||
playerlist.d(this);
|
playerlist.d(this);
|
||||||
worldserver1.a(this, Entity.RemovalReason.CHANGED_DIMENSION);
|
worldserver1.a(this, Entity.RemovalReason.CHANGED_DIMENSION);
|
||||||
this.unsetRemoved();
|
this.unsetRemoved();
|
||||||
@ -476,7 +476,7 @@
|
|||||||
worldserver1.getMethodProfiler().exit();
|
worldserver1.getMethodProfiler().exit();
|
||||||
this.triggerDimensionAdvancements(worldserver1);
|
this.triggerDimensionAdvancements(worldserver1);
|
||||||
this.connection.sendPacket(new PacketPlayOutAbilities(this.getAbilities()));
|
this.connection.sendPacket(new PacketPlayOutAbilities(this.getAbilities()));
|
||||||
@@ -776,12 +1021,31 @@
|
@@ -772,12 +1017,31 @@
|
||||||
this.lastSentExp = -1;
|
this.lastSentExp = -1;
|
||||||
this.lastSentHealth = -1.0F;
|
this.lastSentHealth = -1.0F;
|
||||||
this.lastSentFood = -1;
|
this.lastSentFood = -1;
|
||||||
@ -508,7 +508,7 @@
|
|||||||
private void a(WorldServer worldserver, BlockPosition blockposition) {
|
private void a(WorldServer worldserver, BlockPosition blockposition) {
|
||||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = blockposition.i();
|
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = blockposition.i();
|
||||||
|
|
||||||
@@ -798,17 +1062,17 @@
|
@@ -794,17 +1058,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -531,7 +531,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
return optional1;
|
return optional1;
|
||||||
@@ -818,13 +1082,21 @@
|
@@ -814,13 +1078,21 @@
|
||||||
public void triggerDimensionAdvancements(WorldServer worldserver) {
|
public void triggerDimensionAdvancements(WorldServer worldserver) {
|
||||||
ResourceKey<World> resourcekey = worldserver.getDimensionKey();
|
ResourceKey<World> resourcekey = worldserver.getDimensionKey();
|
||||||
ResourceKey<World> resourcekey1 = this.level.getDimensionKey();
|
ResourceKey<World> resourcekey1 = this.level.getDimensionKey();
|
||||||
@ -556,7 +556,7 @@
|
|||||||
this.enteredNetherPosition = null;
|
this.enteredNetherPosition = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -852,10 +1124,8 @@
|
@@ -848,10 +1120,8 @@
|
||||||
this.containerMenu.d();
|
this.containerMenu.d();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -569,7 +569,7 @@
|
|||||||
if (!this.isSleeping() && this.isAlive()) {
|
if (!this.isSleeping() && this.isAlive()) {
|
||||||
if (!this.level.getDimensionManager().isNatural()) {
|
if (!this.level.getDimensionManager().isNatural()) {
|
||||||
return Either.left(EntityHuman.EnumBedResult.NOT_POSSIBLE_HERE);
|
return Either.left(EntityHuman.EnumBedResult.NOT_POSSIBLE_HERE);
|
||||||
@@ -881,7 +1151,36 @@
|
@@ -877,7 +1147,36 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -607,7 +607,7 @@
|
|||||||
this.a(StatisticList.SLEEP_IN_BED);
|
this.a(StatisticList.SLEEP_IN_BED);
|
||||||
CriterionTriggers.SLEPT_IN_BED.a(this);
|
CriterionTriggers.SLEPT_IN_BED.a(this);
|
||||||
});
|
});
|
||||||
@@ -894,9 +1193,8 @@
|
@@ -890,9 +1189,8 @@
|
||||||
return either;
|
return either;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -618,7 +618,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -923,6 +1221,24 @@
|
@@ -919,6 +1217,24 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void wakeup(boolean flag, boolean flag1) {
|
public void wakeup(boolean flag, boolean flag1) {
|
||||||
@ -643,7 +643,7 @@
|
|||||||
if (this.isSleeping()) {
|
if (this.isSleeping()) {
|
||||||
this.getWorldServer().getChunkProvider().broadcastIncludingSelf(this, new PacketPlayOutAnimation(this, 2));
|
this.getWorldServer().getChunkProvider().broadcastIncludingSelf(this, new PacketPlayOutAnimation(this, 2));
|
||||||
}
|
}
|
||||||
@@ -1004,8 +1320,9 @@
|
@@ -1000,8 +1316,9 @@
|
||||||
this.connection.sendPacket(new PacketPlayOutOpenSignEditor(tileentitysign.getPosition()));
|
this.connection.sendPacket(new PacketPlayOutOpenSignEditor(tileentitysign.getPosition()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -654,7 +654,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1020,6 +1337,24 @@
|
@@ -1016,6 +1333,24 @@
|
||||||
this.nextContainerCounter();
|
this.nextContainerCounter();
|
||||||
Container container = itileinventory.createMenu(this.containerCounter, this.getInventory(), this);
|
Container container = itileinventory.createMenu(this.containerCounter, this.getInventory(), this);
|
||||||
|
|
||||||
@ -679,7 +679,7 @@
|
|||||||
if (container == null) {
|
if (container == null) {
|
||||||
if (this.isSpectator()) {
|
if (this.isSpectator()) {
|
||||||
this.a((IChatBaseComponent) (new ChatMessage("container.spectatorCantOpen")).a(EnumChatFormat.RED), true);
|
this.a((IChatBaseComponent) (new ChatMessage("container.spectatorCantOpen")).a(EnumChatFormat.RED), true);
|
||||||
@@ -1027,9 +1362,11 @@
|
@@ -1023,9 +1358,11 @@
|
||||||
|
|
||||||
return OptionalInt.empty();
|
return OptionalInt.empty();
|
||||||
} else {
|
} else {
|
||||||
@ -693,7 +693,7 @@
|
|||||||
return OptionalInt.of(this.containerCounter);
|
return OptionalInt.of(this.containerCounter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1042,13 +1379,24 @@
|
@@ -1038,13 +1375,24 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void openHorseInventory(EntityHorseAbstract entityhorseabstract, IInventory iinventory) {
|
public void openHorseInventory(EntityHorseAbstract entityhorseabstract, IInventory iinventory) {
|
||||||
@ -720,7 +720,7 @@
|
|||||||
this.initMenu(this.containerMenu);
|
this.initMenu(this.containerMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1072,6 +1420,7 @@
|
@@ -1068,6 +1416,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeInventory() {
|
public void closeInventory() {
|
||||||
@ -728,7 +728,7 @@
|
|||||||
this.connection.sendPacket(new PacketPlayOutCloseWindow(this.containerMenu.containerId));
|
this.connection.sendPacket(new PacketPlayOutCloseWindow(this.containerMenu.containerId));
|
||||||
this.o();
|
this.o();
|
||||||
}
|
}
|
||||||
@@ -1101,7 +1450,7 @@
|
@@ -1097,7 +1446,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void a(Statistic<?> statistic, int i) {
|
public void a(Statistic<?> statistic, int i) {
|
||||||
this.stats.b(this, statistic, i);
|
this.stats.b(this, statistic, i);
|
||||||
@ -737,7 +737,7 @@
|
|||||||
scoreboardscore.addScore(i);
|
scoreboardscore.addScore(i);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1109,7 +1458,7 @@
|
@@ -1105,7 +1454,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void a(Statistic<?> statistic) {
|
public void a(Statistic<?> statistic) {
|
||||||
this.stats.setStatistic(this, statistic, 0);
|
this.stats.setStatistic(this, statistic, 0);
|
||||||
@ -746,7 +746,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1125,7 +1474,7 @@
|
@@ -1121,7 +1470,7 @@
|
||||||
|
|
||||||
for (int j = 0; j < i; ++j) {
|
for (int j = 0; j < i; ++j) {
|
||||||
MinecraftKey minecraftkey = aminecraftkey1[j];
|
MinecraftKey minecraftkey = aminecraftkey1[j];
|
||||||
@ -755,7 +755,7 @@
|
|||||||
|
|
||||||
Objects.requireNonNull(list);
|
Objects.requireNonNull(list);
|
||||||
optional.ifPresent(list::add);
|
optional.ifPresent(list::add);
|
||||||
@@ -1160,7 +1509,16 @@
|
@@ -1156,7 +1505,16 @@
|
||||||
|
|
||||||
public void triggerHealthUpdate() {
|
public void triggerHealthUpdate() {
|
||||||
this.lastSentHealth = -1.0E8F;
|
this.lastSentHealth = -1.0E8F;
|
||||||
@ -772,7 +772,7 @@
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void a(IChatBaseComponent ichatbasecomponent, boolean flag) {
|
public void a(IChatBaseComponent ichatbasecomponent, boolean flag) {
|
||||||
@@ -1215,11 +1573,12 @@
|
@@ -1211,11 +1569,12 @@
|
||||||
this.lastSentExp = -1;
|
this.lastSentExp = -1;
|
||||||
this.lastSentHealth = -1.0F;
|
this.lastSentHealth = -1.0F;
|
||||||
this.lastSentFood = -1;
|
this.lastSentFood = -1;
|
||||||
@ -786,7 +786,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1341,7 +1700,20 @@
|
@@ -1337,7 +1696,20 @@
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -807,7 +807,7 @@
|
|||||||
this.chatVisibility = packetplayinsettings.d();
|
this.chatVisibility = packetplayinsettings.d();
|
||||||
this.canChatColor = packetplayinsettings.e();
|
this.canChatColor = packetplayinsettings.e();
|
||||||
this.textFilteringEnabled = packetplayinsettings.h();
|
this.textFilteringEnabled = packetplayinsettings.h();
|
||||||
@@ -1411,7 +1783,7 @@
|
@@ -1407,7 +1779,7 @@
|
||||||
this.camera = (Entity) (entity == null ? this : entity);
|
this.camera = (Entity) (entity == null ? this : entity);
|
||||||
if (entity1 != this.camera) {
|
if (entity1 != this.camera) {
|
||||||
this.connection.sendPacket(new PacketPlayOutCamera(this.camera));
|
this.connection.sendPacket(new PacketPlayOutCamera(this.camera));
|
||||||
@ -816,7 +816,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1440,7 +1812,7 @@
|
@@ -1436,7 +1808,7 @@
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public IChatBaseComponent getPlayerListName() {
|
public IChatBaseComponent getPlayerListName() {
|
||||||
@ -825,7 +825,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1461,9 +1833,16 @@
|
@@ -1457,9 +1829,16 @@
|
||||||
return this.advancements;
|
return this.advancements;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -842,7 +842,7 @@
|
|||||||
if (worldserver == this.level) {
|
if (worldserver == this.level) {
|
||||||
this.connection.b(d0, d1, d2, f, f1);
|
this.connection.b(d0, d1, d2, f, f1);
|
||||||
} else {
|
} else {
|
||||||
@@ -1483,6 +1862,9 @@
|
@@ -1479,6 +1858,9 @@
|
||||||
this.server.getPlayerList().a(this, worldserver);
|
this.server.getPlayerList().a(this, worldserver);
|
||||||
this.server.getPlayerList().updateClient(this);
|
this.server.getPlayerList().updateClient(this);
|
||||||
}
|
}
|
||||||
@ -852,9 +852,9 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1628,4 +2010,144 @@
|
@@ -1634,4 +2016,144 @@
|
||||||
CriterionTriggers.USING_ITEM.a(this, itemstack);
|
});
|
||||||
super.a(itemstack);
|
return this.a(itemstack, false, true) != null;
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ // CraftBukkit start - Add per-player time and weather.
|
+ // CraftBukkit start - Add per-player time and weather.
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
public PlayerChunkMap(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator chunkgenerator, WorldLoadListener worldloadlistener, ChunkStatusUpdateListener chunkstatusupdatelistener, Supplier<WorldPersistentData> supplier, int i, boolean flag) {
|
public PlayerChunkMap(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator chunkgenerator, WorldLoadListener worldloadlistener, ChunkStatusUpdateListener chunkstatusupdatelistener, Supplier<WorldPersistentData> supplier, int i, boolean flag) {
|
||||||
super(new File(convertable_conversionsession.a(worldserver.getDimensionKey()), "region"), datafixer, flag);
|
super(new File(convertable_conversionsession.a(worldserver.getDimensionKey()), "region"), datafixer, flag);
|
||||||
this.visibleChunkMap = this.updatingChunkMap.clone();
|
this.visibleChunkMap = this.updatingChunkMap.clone();
|
||||||
@@ -279,9 +302,12 @@
|
@@ -281,9 +304,12 @@
|
||||||
|
|
||||||
return completablefuture1.thenApply((list1) -> {
|
return completablefuture1.thenApply((list1) -> {
|
||||||
List<IChunkAccess> list2 = Lists.newArrayList();
|
List<IChunkAccess> list2 = Lists.newArrayList();
|
||||||
@ -52,8 +52,8 @@
|
|||||||
final Either<IChunkAccess, PlayerChunk.Failure> either = (Either) iterator.next();
|
final Either<IChunkAccess, PlayerChunk.Failure> either = (Either) iterator.next();
|
||||||
Optional<IChunkAccess> optional = either.left();
|
Optional<IChunkAccess> optional = either.left();
|
||||||
|
|
||||||
@@ -389,7 +415,7 @@
|
@@ -390,7 +416,7 @@
|
||||||
PlayerChunkMap.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.storageFolder.getName());
|
this.j();
|
||||||
} else {
|
} else {
|
||||||
this.visibleChunkMap.values().stream().filter(PlayerChunk::hasBeenLoaded).forEach((playerchunk) -> {
|
this.visibleChunkMap.values().stream().filter(PlayerChunk::hasBeenLoaded).forEach((playerchunk) -> {
|
||||||
- IChunkAccess ichunkaccess = (IChunkAccess) playerchunk.getChunkSave().getNow((Object) null);
|
- IChunkAccess ichunkaccess = (IChunkAccess) playerchunk.getChunkSave().getNow((Object) null);
|
||||||
@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
if (ichunkaccess instanceof ProtoChunkExtension || ichunkaccess instanceof Chunk) {
|
if (ichunkaccess instanceof ProtoChunkExtension || ichunkaccess instanceof Chunk) {
|
||||||
this.saveChunk(ichunkaccess);
|
this.saveChunk(ichunkaccess);
|
||||||
@@ -400,7 +426,6 @@
|
@@ -401,7 +427,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@
|
|||||||
protected void unloadChunks(BooleanSupplier booleansupplier) {
|
protected void unloadChunks(BooleanSupplier booleansupplier) {
|
||||||
GameProfilerFiller gameprofilerfiller = this.level.getMethodProfiler();
|
GameProfilerFiller gameprofilerfiller = this.level.getMethodProfiler();
|
||||||
|
|
||||||
@@ -439,7 +464,7 @@
|
@@ -440,7 +465,7 @@
|
||||||
|
|
||||||
private void a(long i, PlayerChunk playerchunk) {
|
private void a(long i, PlayerChunk playerchunk) {
|
||||||
CompletableFuture<IChunkAccess> completablefuture = playerchunk.getChunkSave();
|
CompletableFuture<IChunkAccess> completablefuture = playerchunk.getChunkSave();
|
||||||
@ -78,7 +78,7 @@
|
|||||||
CompletableFuture<IChunkAccess> completablefuture1 = playerchunk.getChunkSave();
|
CompletableFuture<IChunkAccess> completablefuture1 = playerchunk.getChunkSave();
|
||||||
|
|
||||||
if (completablefuture1 != completablefuture) {
|
if (completablefuture1 != completablefuture) {
|
||||||
@@ -615,7 +640,21 @@
|
@@ -616,7 +641,21 @@
|
||||||
|
|
||||||
private static void a(WorldServer worldserver, List<NBTTagCompound> list) {
|
private static void a(WorldServer worldserver, List<NBTTagCompound> list) {
|
||||||
if (!list.isEmpty()) {
|
if (!list.isEmpty()) {
|
||||||
@ -101,7 +101,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -843,7 +882,8 @@
|
@@ -844,7 +883,8 @@
|
||||||
return ichunkaccess instanceof Chunk ? Optional.of((Chunk) ichunkaccess) : Optional.empty();
|
return ichunkaccess instanceof Chunk ? Optional.of((Chunk) ichunkaccess) : Optional.empty();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -111,7 +111,7 @@
|
|||||||
return chunk.getTileEntities().size();
|
return chunk.getTileEntities().size();
|
||||||
}).orElse(0));
|
}).orElse(0));
|
||||||
}
|
}
|
||||||
@@ -852,7 +892,7 @@
|
@@ -853,7 +893,7 @@
|
||||||
|
|
||||||
private static String a(CompletableFuture<Either<Chunk, PlayerChunk.Failure>> completablefuture) {
|
private static String a(CompletableFuture<Either<Chunk, PlayerChunk.Failure>> completablefuture) {
|
||||||
try {
|
try {
|
||||||
@ -120,7 +120,7 @@
|
|||||||
|
|
||||||
return either != null ? (String) either.map((chunk) -> {
|
return either != null ? (String) either.map((chunk) -> {
|
||||||
return "done";
|
return "done";
|
||||||
@@ -870,7 +910,7 @@
|
@@ -871,7 +911,7 @@
|
||||||
private NBTTagCompound readChunkData(ChunkCoordIntPair chunkcoordintpair) throws IOException {
|
private NBTTagCompound readChunkData(ChunkCoordIntPair chunkcoordintpair) throws IOException {
|
||||||
NBTTagCompound nbttagcompound = this.read(chunkcoordintpair);
|
NBTTagCompound nbttagcompound = this.read(chunkcoordintpair);
|
||||||
|
|
||||||
@ -129,7 +129,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean isOutsideOfRange(ChunkCoordIntPair chunkcoordintpair) {
|
boolean isOutsideOfRange(ChunkCoordIntPair chunkcoordintpair) {
|
||||||
@@ -1233,7 +1273,7 @@
|
@@ -1238,7 +1278,7 @@
|
||||||
public final Set<ServerPlayerConnection> seenBy = Sets.newIdentityHashSet();
|
public final Set<ServerPlayerConnection> seenBy = Sets.newIdentityHashSet();
|
||||||
|
|
||||||
public EntityTracker(Entity entity, int i, int j, boolean flag) {
|
public EntityTracker(Entity entity, int i, int j, boolean flag) {
|
||||||
@ -138,7 +138,7 @@
|
|||||||
this.entity = entity;
|
this.entity = entity;
|
||||||
this.range = i;
|
this.range = i;
|
||||||
this.lastSectionPos = SectionPosition.a(entity);
|
this.lastSectionPos = SectionPosition.a(entity);
|
||||||
@@ -1286,10 +1326,18 @@
|
@@ -1291,10 +1331,18 @@
|
||||||
|
|
||||||
public void updatePlayer(EntityPlayer entityplayer) {
|
public void updatePlayer(EntityPlayer entityplayer) {
|
||||||
if (entityplayer != this.entity) {
|
if (entityplayer != this.entity) {
|
||||||
|
@ -23,18 +23,15 @@
|
|||||||
public class WorldServer extends World implements GeneratorAccessSeed {
|
public class WorldServer extends World implements GeneratorAccessSeed {
|
||||||
|
|
||||||
public static final BlockPosition END_SPAWN_POINT = new BlockPosition(100, 50, 0);
|
public static final BlockPosition END_SPAWN_POINT = new BlockPosition(100, 50, 0);
|
||||||
@@ -160,9 +176,9 @@
|
@@ -160,7 +176,7 @@
|
||||||
final List<EntityPlayer> players;
|
final List<EntityPlayer> players;
|
||||||
private final ChunkProviderServer chunkSource;
|
private final ChunkProviderServer chunkSource;
|
||||||
private final MinecraftServer server;
|
private final MinecraftServer server;
|
||||||
- public final IWorldDataServer serverLevelData;
|
- public final IWorldDataServer serverLevelData;
|
||||||
+ public final WorldDataServer serverLevelData; // CraftBukkit - type
|
+ public final WorldDataServer serverLevelData; // CraftBukkit - type
|
||||||
final EntityTickList entityTickList;
|
final EntityTickList entityTickList;
|
||||||
- private final PersistentEntitySectionManager<Entity> entityManager;
|
public final PersistentEntitySectionManager<Entity> entityManager;
|
||||||
+ public final PersistentEntitySectionManager<Entity> entityManager;
|
|
||||||
public boolean noSave;
|
public boolean noSave;
|
||||||
private final SleepStatus sleepStatus;
|
|
||||||
private int emptyTime;
|
|
||||||
@@ -180,31 +196,52 @@
|
@@ -180,31 +196,52 @@
|
||||||
private final StructureManager structureFeatureManager;
|
private final StructureManager structureFeatureManager;
|
||||||
private final boolean tickTime;
|
private final boolean tickTime;
|
||||||
@ -543,8 +540,8 @@
|
|||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public WorldMap a(String s) {
|
public WorldMap a(String s) {
|
||||||
- return (WorldMap) this.getMinecraftServer().F().getWorldPersistentData().a(WorldMap::b, s);
|
- return (WorldMap) this.getMinecraftServer().E().getWorldPersistentData().a(WorldMap::b, s);
|
||||||
+ return (WorldMap) this.getMinecraftServer().F().getWorldPersistentData().a((nbttagcompound) -> {
|
+ return (WorldMap) this.getMinecraftServer().E().getWorldPersistentData().a((nbttagcompound) -> {
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ // We only get here when the data file exists, but is not a valid map
|
+ // We only get here when the data file exists, but is not a valid map
|
||||||
+ WorldMap newMap = WorldMap.b(nbttagcompound);
|
+ WorldMap newMap = WorldMap.b(nbttagcompound);
|
||||||
@ -559,7 +556,7 @@
|
|||||||
@Override
|
@Override
|
||||||
public void a(String s, WorldMap worldmap) {
|
public void a(String s, WorldMap worldmap) {
|
||||||
+ worldmap.id = s; // CraftBukkit
|
+ worldmap.id = s; // CraftBukkit
|
||||||
this.getMinecraftServer().F().getWorldPersistentData().a(s, (PersistentBase) worldmap);
|
this.getMinecraftServer().E().getWorldPersistentData().a(s, (PersistentBase) worldmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1432,6 +1655,11 @@
|
@@ -1432,6 +1655,11 @@
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
} else {
|
} else {
|
||||||
this.state = LoginListener.EnumProtocolState.ACCEPTED;
|
this.state = LoginListener.EnumProtocolState.ACCEPTED;
|
||||||
if (this.server.aw() >= 0 && !this.connection.isLocal()) {
|
if (this.server.av() >= 0 && !this.connection.isLocal()) {
|
||||||
@@ -117,7 +141,7 @@
|
@@ -117,7 +141,7 @@
|
||||||
EntityPlayer entityplayer = this.server.getPlayerList().getPlayer(this.gameProfile.getId());
|
EntityPlayer entityplayer = this.server.getPlayerList().getPlayer(this.gameProfile.getId());
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/server/network/PlayerConnection.java
|
--- a/net/minecraft/server/network/PlayerConnection.java
|
||||||
+++ b/net/minecraft/server/network/PlayerConnection.java
|
+++ b/net/minecraft/server/network/PlayerConnection.java
|
||||||
@@ -158,6 +158,62 @@
|
@@ -157,6 +157,62 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
@ -63,7 +63,7 @@
|
|||||||
public class PlayerConnection implements ServerPlayerConnection, PacketListenerPlayIn {
|
public class PlayerConnection implements ServerPlayerConnection, PacketListenerPlayIn {
|
||||||
|
|
||||||
static final Logger LOGGER = LogManager.getLogger();
|
static final Logger LOGGER = LogManager.getLogger();
|
||||||
@@ -169,7 +225,9 @@
|
@@ -168,7 +224,9 @@
|
||||||
private long keepAliveTime;
|
private long keepAliveTime;
|
||||||
private boolean keepAlivePending;
|
private boolean keepAlivePending;
|
||||||
private long keepAliveChallenge;
|
private long keepAliveChallenge;
|
||||||
@ -74,7 +74,7 @@
|
|||||||
private int dropSpamTickCount;
|
private int dropSpamTickCount;
|
||||||
private double firstGoodX;
|
private double firstGoodX;
|
||||||
private double firstGoodY;
|
private double firstGoodY;
|
||||||
@@ -203,7 +261,33 @@
|
@@ -202,7 +260,33 @@
|
||||||
this.player = entityplayer;
|
this.player = entityplayer;
|
||||||
entityplayer.connection = this;
|
entityplayer.connection = this;
|
||||||
entityplayer.Q().a();
|
entityplayer.Q().a();
|
||||||
@ -108,7 +108,7 @@
|
|||||||
|
|
||||||
public void tick() {
|
public void tick() {
|
||||||
this.syncPosition();
|
this.syncPosition();
|
||||||
@@ -252,7 +336,7 @@
|
@@ -251,7 +335,7 @@
|
||||||
this.server.getMethodProfiler().enter("keepAlive");
|
this.server.getMethodProfiler().enter("keepAlive");
|
||||||
long i = SystemUtils.getMonotonicMillis();
|
long i = SystemUtils.getMonotonicMillis();
|
||||||
|
|
||||||
@ -117,7 +117,7 @@
|
|||||||
if (this.keepAlivePending) {
|
if (this.keepAlivePending) {
|
||||||
this.disconnect(new ChatMessage("disconnect.timeout"));
|
this.disconnect(new ChatMessage("disconnect.timeout"));
|
||||||
} else {
|
} else {
|
||||||
@@ -264,15 +348,21 @@
|
@@ -263,15 +347,21 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.server.getMethodProfiler().exit();
|
this.server.getMethodProfiler().exit();
|
||||||
@ -139,7 +139,7 @@
|
|||||||
this.disconnect(new ChatMessage("multiplayer.disconnect.idling"));
|
this.disconnect(new ChatMessage("multiplayer.disconnect.idling"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -296,16 +386,46 @@
|
@@ -295,16 +385,46 @@
|
||||||
return this.server.a(this.player.getProfile());
|
return this.server.a(this.player.getProfile());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +187,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
private <T, R> void a(T t0, Consumer<R> consumer, BiFunction<ITextFilter, T, CompletableFuture<R>> bifunction) {
|
private <T, R> void a(T t0, Consumer<R> consumer, BiFunction<ITextFilter, T, CompletableFuture<R>> bifunction) {
|
||||||
@@ -323,11 +443,11 @@
|
@@ -322,11 +442,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
private void a(String s, Consumer<ITextFilter.a> consumer) {
|
private void a(String s, Consumer<ITextFilter.a> consumer) {
|
||||||
@ -201,7 +201,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -372,7 +492,34 @@
|
@@ -371,7 +491,34 @@
|
||||||
double d9 = entity.getMot().g();
|
double d9 = entity.getMot().g();
|
||||||
double d10 = d6 * d6 + d7 * d7 + d8 * d8;
|
double d10 = d6 * d6 + d7 * d7 + d8 * d8;
|
||||||
|
|
||||||
@ -237,7 +237,7 @@
|
|||||||
PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getDisplayName().getString(), this.player.getDisplayName().getString(), d6, d7, d8);
|
PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getDisplayName().getString(), this.player.getDisplayName().getString(), d6, d7, d8);
|
||||||
this.connection.sendPacket(new PacketPlayOutVehicleMove(entity));
|
this.connection.sendPacket(new PacketPlayOutVehicleMove(entity));
|
||||||
return;
|
return;
|
||||||
@@ -402,14 +549,72 @@
|
@@ -401,14 +548,72 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
entity.setLocation(d3, d4, d5, f, f1);
|
entity.setLocation(d3, d4, d5, f, f1);
|
||||||
@ -310,7 +310,7 @@
|
|||||||
this.player.getWorldServer().getChunkProvider().movePlayer(this.player);
|
this.player.getWorldServer().getChunkProvider().movePlayer(this.player);
|
||||||
this.player.checkMovement(this.player.locX() - d0, this.player.locY() - d1, this.player.locZ() - d2);
|
this.player.checkMovement(this.player.locX() - d0, this.player.locY() - d1, this.player.locZ() - d2);
|
||||||
this.clientVehicleIsFloating = d11 >= -0.03125D && !this.server.getAllowFlight() && this.a(entity);
|
this.clientVehicleIsFloating = d11 >= -0.03125D && !this.server.getAllowFlight() && this.a(entity);
|
||||||
@@ -428,7 +633,7 @@
|
@@ -427,7 +632,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void a(PacketPlayInTeleportAccept packetplayinteleportaccept) {
|
public void a(PacketPlayInTeleportAccept packetplayinteleportaccept) {
|
||||||
PlayerConnectionUtils.ensureMainThread(packetplayinteleportaccept, this, this.player.getWorldServer());
|
PlayerConnectionUtils.ensureMainThread(packetplayinteleportaccept, this, this.player.getWorldServer());
|
||||||
@ -319,7 +319,7 @@
|
|||||||
this.player.setLocation(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot());
|
this.player.setLocation(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot());
|
||||||
this.lastGoodX = this.awaitingPositionFromClient.x;
|
this.lastGoodX = this.awaitingPositionFromClient.x;
|
||||||
this.lastGoodY = this.awaitingPositionFromClient.y;
|
this.lastGoodY = this.awaitingPositionFromClient.y;
|
||||||
@@ -438,6 +643,7 @@
|
@@ -437,6 +642,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.awaitingPositionFromClient = null;
|
this.awaitingPositionFromClient = null;
|
||||||
@ -327,7 +327,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -445,7 +651,7 @@
|
@@ -444,7 +650,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void a(PacketPlayInRecipeDisplayed packetplayinrecipedisplayed) {
|
public void a(PacketPlayInRecipeDisplayed packetplayinrecipedisplayed) {
|
||||||
PlayerConnectionUtils.ensureMainThread(packetplayinrecipedisplayed, this, this.player.getWorldServer());
|
PlayerConnectionUtils.ensureMainThread(packetplayinrecipedisplayed, this, this.player.getWorldServer());
|
||||||
@ -336,7 +336,7 @@
|
|||||||
RecipeBookServer recipebookserver = this.player.getRecipeBook();
|
RecipeBookServer recipebookserver = this.player.getRecipeBook();
|
||||||
|
|
||||||
Objects.requireNonNull(recipebookserver);
|
Objects.requireNonNull(recipebookserver);
|
||||||
@@ -475,6 +681,12 @@
|
@@ -474,6 +680,12 @@
|
||||||
@Override
|
@Override
|
||||||
public void a(PacketPlayInTabComplete packetplayintabcomplete) {
|
public void a(PacketPlayInTabComplete packetplayintabcomplete) {
|
||||||
PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer());
|
PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer());
|
||||||
@ -349,7 +349,7 @@
|
|||||||
StringReader stringreader = new StringReader(packetplayintabcomplete.c());
|
StringReader stringreader = new StringReader(packetplayintabcomplete.c());
|
||||||
|
|
||||||
if (stringreader.canRead() && stringreader.peek() == '/') {
|
if (stringreader.canRead() && stringreader.peek() == '/') {
|
||||||
@@ -484,6 +696,7 @@
|
@@ -483,6 +695,7 @@
|
||||||
ParseResults<CommandListenerWrapper> parseresults = this.server.getCommandDispatcher().a().parse(stringreader, this.player.getCommandListener());
|
ParseResults<CommandListenerWrapper> parseresults = this.server.getCommandDispatcher().a().parse(stringreader, this.player.getCommandListener());
|
||||||
|
|
||||||
this.server.getCommandDispatcher().a().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
|
this.server.getCommandDispatcher().a().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
|
||||||
@ -357,7 +357,7 @@
|
|||||||
this.connection.sendPacket(new PacketPlayOutTabComplete(packetplayintabcomplete.b(), suggestions));
|
this.connection.sendPacket(new PacketPlayOutTabComplete(packetplayintabcomplete.b(), suggestions));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -716,6 +929,7 @@
|
@@ -715,6 +928,7 @@
|
||||||
|
|
||||||
if (container instanceof ContainerMerchant) {
|
if (container instanceof ContainerMerchant) {
|
||||||
ContainerMerchant containermerchant = (ContainerMerchant) container;
|
ContainerMerchant containermerchant = (ContainerMerchant) container;
|
||||||
@ -365,7 +365,7 @@
|
|||||||
|
|
||||||
containermerchant.d(i);
|
containermerchant.d(i);
|
||||||
containermerchant.g(i);
|
containermerchant.g(i);
|
||||||
@@ -725,6 +939,13 @@
|
@@ -724,6 +938,13 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void a(PacketPlayInBEdit packetplayinbedit) {
|
public void a(PacketPlayInBEdit packetplayinbedit) {
|
||||||
@ -379,7 +379,16 @@
|
|||||||
int i = packetplayinbedit.d();
|
int i = packetplayinbedit.d();
|
||||||
|
|
||||||
if (PlayerInventory.d(i) || i == 40) {
|
if (PlayerInventory.d(i) || i == 40) {
|
||||||
@@ -761,7 +982,7 @@
|
@@ -732,7 +953,7 @@
|
||||||
|
|
||||||
|
Objects.requireNonNull(list);
|
||||||
|
optional.ifPresent(list::add);
|
||||||
|
- Stream stream = packetplayinbedit.b().stream().limit(100L);
|
||||||
|
+ Stream<String> stream = packetplayinbedit.b().stream().limit(100L); // CraftBukkit - decompile error
|
||||||
|
|
||||||
|
Objects.requireNonNull(list);
|
||||||
|
stream.forEach(list::add);
|
||||||
|
@@ -748,7 +969,7 @@
|
||||||
ItemStack itemstack = this.player.getInventory().getItem(i);
|
ItemStack itemstack = this.player.getInventory().getItem(i);
|
||||||
|
|
||||||
if (itemstack.a(Items.WRITABLE_BOOK)) {
|
if (itemstack.a(Items.WRITABLE_BOOK)) {
|
||||||
@ -388,7 +397,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -786,16 +1007,16 @@
|
@@ -773,16 +994,16 @@
|
||||||
|
|
||||||
this.a(list, (s) -> {
|
this.a(list, (s) -> {
|
||||||
return IChatBaseComponent.ChatSerializer.a((IChatBaseComponent) (new ChatComponentText(s)));
|
return IChatBaseComponent.ChatSerializer.a((IChatBaseComponent) (new ChatComponentText(s)));
|
||||||
@ -409,7 +418,7 @@
|
|||||||
return NBTTagString.a((String) unaryoperator.apply(itextfilter_a.b()));
|
return NBTTagString.a((String) unaryoperator.apply(itextfilter_a.b()));
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -823,6 +1044,7 @@
|
@@ -810,6 +1031,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
itemstack.a("pages", (NBTBase) nbttaglist);
|
itemstack.a("pages", (NBTBase) nbttaglist);
|
||||||
@ -417,7 +426,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -859,7 +1081,7 @@
|
@@ -846,7 +1068,7 @@
|
||||||
} else {
|
} else {
|
||||||
WorldServer worldserver = this.player.getWorldServer();
|
WorldServer worldserver = this.player.getWorldServer();
|
||||||
|
|
||||||
@ -426,7 +435,7 @@
|
|||||||
if (this.tickCount == 0) {
|
if (this.tickCount == 0) {
|
||||||
this.syncPosition();
|
this.syncPosition();
|
||||||
}
|
}
|
||||||
@@ -869,7 +1091,7 @@
|
@@ -856,7 +1078,7 @@
|
||||||
this.awaitingTeleportTime = this.tickCount;
|
this.awaitingTeleportTime = this.tickCount;
|
||||||
this.b(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot());
|
this.b(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot());
|
||||||
}
|
}
|
||||||
@ -435,7 +444,7 @@
|
|||||||
} else {
|
} else {
|
||||||
this.awaitingTeleportTime = this.tickCount;
|
this.awaitingTeleportTime = this.tickCount;
|
||||||
double d0 = a(packetplayinflying.a(this.player.locX()));
|
double d0 = a(packetplayinflying.a(this.player.locX()));
|
||||||
@@ -881,7 +1103,15 @@
|
@@ -868,7 +1090,15 @@
|
||||||
if (this.player.isPassenger()) {
|
if (this.player.isPassenger()) {
|
||||||
this.player.setLocation(this.player.locX(), this.player.locY(), this.player.locZ(), f, f1);
|
this.player.setLocation(this.player.locX(), this.player.locY(), this.player.locZ(), f, f1);
|
||||||
this.player.getWorldServer().getChunkProvider().movePlayer(this.player);
|
this.player.getWorldServer().getChunkProvider().movePlayer(this.player);
|
||||||
@ -451,7 +460,7 @@
|
|||||||
double d3 = this.player.locX();
|
double d3 = this.player.locX();
|
||||||
double d4 = this.player.locY();
|
double d4 = this.player.locY();
|
||||||
double d5 = this.player.locZ();
|
double d5 = this.player.locZ();
|
||||||
@@ -901,15 +1131,33 @@
|
@@ -888,15 +1118,33 @@
|
||||||
++this.receivedMovePacketCount;
|
++this.receivedMovePacketCount;
|
||||||
int i = this.receivedMovePacketCount - this.knownMovePacketCount;
|
int i = this.receivedMovePacketCount - this.knownMovePacketCount;
|
||||||
|
|
||||||
@ -487,7 +496,7 @@
|
|||||||
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getDisplayName().getString(), d7, d8, d9);
|
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getDisplayName().getString(), d7, d8, d9);
|
||||||
this.b(this.player.locX(), this.player.locY(), this.player.locZ(), this.player.getYRot(), this.player.getXRot());
|
this.b(this.player.locX(), this.player.locY(), this.player.locZ(), this.player.getYRot(), this.player.getXRot());
|
||||||
return;
|
return;
|
||||||
@@ -928,6 +1176,7 @@
|
@@ -915,6 +1163,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.player.move(EnumMoveType.PLAYER, new Vec3D(d7, d8, d9));
|
this.player.move(EnumMoveType.PLAYER, new Vec3D(d7, d8, d9));
|
||||||
@ -495,7 +504,7 @@
|
|||||||
double d12 = d8;
|
double d12 = d8;
|
||||||
|
|
||||||
d7 = d0 - this.player.locX();
|
d7 = d0 - this.player.locX();
|
||||||
@@ -949,10 +1198,74 @@
|
@@ -936,10 +1185,74 @@
|
||||||
if (!this.player.noPhysics && !this.player.isSleeping() && (flag1 && worldserver.getCubes(this.player, axisalignedbb) || this.a((IWorldReader) worldserver, axisalignedbb))) {
|
if (!this.player.noPhysics && !this.player.isSleeping() && (flag1 && worldserver.getCubes(this.player, axisalignedbb) || this.a((IWorldReader) worldserver, axisalignedbb))) {
|
||||||
this.b(d3, d4, d5, f, f1);
|
this.b(d3, d4, d5, f, f1);
|
||||||
} else {
|
} else {
|
||||||
@ -572,7 +581,7 @@
|
|||||||
if (flag) {
|
if (flag) {
|
||||||
this.player.fallDistance = 0.0F;
|
this.player.fallDistance = 0.0F;
|
||||||
}
|
}
|
||||||
@@ -980,19 +1293,80 @@
|
@@ -967,19 +1280,80 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -657,7 +666,7 @@
|
|||||||
double d3 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.X) ? this.player.locX() : 0.0D;
|
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 d4 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Y) ? this.player.locY() : 0.0D;
|
||||||
double d5 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Z) ? this.player.locZ() : 0.0D;
|
double d5 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Z) ? this.player.locZ() : 0.0D;
|
||||||
@@ -1004,6 +1378,14 @@
|
@@ -991,6 +1365,14 @@
|
||||||
this.awaitingTeleport = 0;
|
this.awaitingTeleport = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -672,7 +681,7 @@
|
|||||||
this.awaitingTeleportTime = this.tickCount;
|
this.awaitingTeleportTime = this.tickCount;
|
||||||
this.player.setLocation(d0, d1, d2, f, f1);
|
this.player.setLocation(d0, d1, d2, f, f1);
|
||||||
this.player.connection.sendPacket(new PacketPlayOutPosition(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport, flag));
|
this.player.connection.sendPacket(new PacketPlayOutPosition(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport, flag));
|
||||||
@@ -1012,6 +1394,7 @@
|
@@ -999,6 +1381,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void a(PacketPlayInBlockDig packetplayinblockdig) {
|
public void a(PacketPlayInBlockDig packetplayinblockdig) {
|
||||||
PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.getWorldServer());
|
PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.getWorldServer());
|
||||||
@ -680,7 +689,7 @@
|
|||||||
BlockPosition blockposition = packetplayinblockdig.b();
|
BlockPosition blockposition = packetplayinblockdig.b();
|
||||||
|
|
||||||
this.player.resetIdleTimer();
|
this.player.resetIdleTimer();
|
||||||
@@ -1022,14 +1405,46 @@
|
@@ -1009,14 +1392,46 @@
|
||||||
if (!this.player.isSpectator()) {
|
if (!this.player.isSpectator()) {
|
||||||
ItemStack itemstack = this.player.b(EnumHand.OFF_HAND);
|
ItemStack itemstack = this.player.b(EnumHand.OFF_HAND);
|
||||||
|
|
||||||
@ -729,7 +738,7 @@
|
|||||||
this.player.dropItem(false);
|
this.player.dropItem(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1066,6 +1481,7 @@
|
@@ -1053,6 +1468,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void a(PacketPlayInUseItem packetplayinuseitem) {
|
public void a(PacketPlayInUseItem packetplayinuseitem) {
|
||||||
PlayerConnectionUtils.ensureMainThread(packetplayinuseitem, this, this.player.getWorldServer());
|
PlayerConnectionUtils.ensureMainThread(packetplayinuseitem, this, this.player.getWorldServer());
|
||||||
@ -737,7 +746,7 @@
|
|||||||
WorldServer worldserver = this.player.getWorldServer();
|
WorldServer worldserver = this.player.getWorldServer();
|
||||||
EnumHand enumhand = packetplayinuseitem.b();
|
EnumHand enumhand = packetplayinuseitem.b();
|
||||||
ItemStack itemstack = this.player.b(enumhand);
|
ItemStack itemstack = this.player.b(enumhand);
|
||||||
@@ -1078,6 +1494,14 @@
|
@@ -1065,6 +1481,14 @@
|
||||||
|
|
||||||
if (blockposition.getY() < i) {
|
if (blockposition.getY() < i) {
|
||||||
if (this.awaitingPositionFromClient == null && this.player.h((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.a((EntityHuman) this.player, blockposition)) {
|
if (this.awaitingPositionFromClient == null && this.player.h((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.a((EntityHuman) this.player, blockposition)) {
|
||||||
@ -752,7 +761,7 @@
|
|||||||
EnumInteractionResult enuminteractionresult = this.player.gameMode.a(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock);
|
EnumInteractionResult enuminteractionresult = this.player.gameMode.a(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock);
|
||||||
|
|
||||||
if (enumdirection == EnumDirection.UP && !enuminteractionresult.a() && blockposition.getY() >= i - 1 && a(this.player, itemstack)) {
|
if (enumdirection == EnumDirection.UP && !enuminteractionresult.a() && blockposition.getY() >= i - 1 && a(this.player, itemstack)) {
|
||||||
@@ -1101,12 +1525,51 @@
|
@@ -1088,12 +1512,51 @@
|
||||||
@Override
|
@Override
|
||||||
public void a(PacketPlayInBlockPlace packetplayinblockplace) {
|
public void a(PacketPlayInBlockPlace packetplayinblockplace) {
|
||||||
PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.getWorldServer());
|
PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.getWorldServer());
|
||||||
@ -804,7 +813,7 @@
|
|||||||
EnumInteractionResult enuminteractionresult = this.player.gameMode.a(this.player, worldserver, itemstack, enumhand);
|
EnumInteractionResult enuminteractionresult = this.player.gameMode.a(this.player, worldserver, itemstack, enumhand);
|
||||||
|
|
||||||
if (enuminteractionresult.b()) {
|
if (enuminteractionresult.b()) {
|
||||||
@@ -1127,7 +1590,7 @@
|
@@ -1114,7 +1577,7 @@
|
||||||
Entity entity = packetplayinspectate.a(worldserver);
|
Entity entity = packetplayinspectate.a(worldserver);
|
||||||
|
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
@ -813,7 +822,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1142,6 +1605,7 @@
|
@@ -1129,6 +1592,7 @@
|
||||||
PlayerConnection.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getDisplayName());
|
PlayerConnection.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getDisplayName());
|
||||||
this.disconnect(new ChatMessage("multiplayer.requiredTexturePrompt.disconnect"));
|
this.disconnect(new ChatMessage("multiplayer.requiredTexturePrompt.disconnect"));
|
||||||
}
|
}
|
||||||
@ -821,7 +830,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1161,11 +1625,26 @@
|
@@ -1148,11 +1612,26 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void a(IChatBaseComponent ichatbasecomponent) {
|
public void a(IChatBaseComponent ichatbasecomponent) {
|
||||||
@ -849,7 +858,7 @@
|
|||||||
this.player.Q().b();
|
this.player.Q().b();
|
||||||
if (this.isExemptPlayer()) {
|
if (this.isExemptPlayer()) {
|
||||||
PlayerConnection.LOGGER.info("Stopping singleplayer server as player logged out");
|
PlayerConnection.LOGGER.info("Stopping singleplayer server as player logged out");
|
||||||
@@ -1180,6 +1659,15 @@
|
@@ -1167,6 +1646,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void a(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> genericfuturelistener) {
|
public void a(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> genericfuturelistener) {
|
||||||
@ -865,7 +874,7 @@
|
|||||||
try {
|
try {
|
||||||
this.connection.sendPacket(packet, genericfuturelistener);
|
this.connection.sendPacket(packet, genericfuturelistener);
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
@@ -1196,7 +1684,16 @@
|
@@ -1183,7 +1671,16 @@
|
||||||
@Override
|
@Override
|
||||||
public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
|
public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
|
||||||
PlayerConnectionUtils.ensureMainThread(packetplayinhelditemslot, this, this.player.getWorldServer());
|
PlayerConnectionUtils.ensureMainThread(packetplayinhelditemslot, this, this.player.getWorldServer());
|
||||||
@ -882,7 +891,7 @@
|
|||||||
if (this.player.getInventory().selected != packetplayinhelditemslot.b() && this.player.getRaisedHand() == EnumHand.MAIN_HAND) {
|
if (this.player.getInventory().selected != packetplayinhelditemslot.b() && this.player.getRaisedHand() == EnumHand.MAIN_HAND) {
|
||||||
this.player.clearActiveItem();
|
this.player.clearActiveItem();
|
||||||
}
|
}
|
||||||
@@ -1205,11 +1702,18 @@
|
@@ -1192,11 +1689,18 @@
|
||||||
this.player.resetIdleTimer();
|
this.player.resetIdleTimer();
|
||||||
} else {
|
} else {
|
||||||
PlayerConnection.LOGGER.warn("{} tried to set an invalid carried item", this.player.getDisplayName().getString());
|
PlayerConnection.LOGGER.warn("{} tried to set an invalid carried item", this.player.getDisplayName().getString());
|
||||||
@ -901,7 +910,7 @@
|
|||||||
String s = StringUtils.normalizeSpace(packetplayinchat.b());
|
String s = StringUtils.normalizeSpace(packetplayinchat.b());
|
||||||
|
|
||||||
for (int i = 0; i < s.length(); ++i) {
|
for (int i = 0; i < s.length(); ++i) {
|
||||||
@@ -1223,20 +1727,42 @@
|
@@ -1210,20 +1714,42 @@
|
||||||
PlayerConnectionUtils.ensureMainThread(packetplayinchat, this, this.player.getWorldServer());
|
PlayerConnectionUtils.ensureMainThread(packetplayinchat, this, this.player.getWorldServer());
|
||||||
this.a(ITextFilter.a.a(s));
|
this.a(ITextFilter.a.a(s));
|
||||||
} else {
|
} else {
|
||||||
@ -948,7 +957,7 @@
|
|||||||
} else {
|
} else {
|
||||||
String s1 = itextfilter_a.b();
|
String s1 = itextfilter_a.b();
|
||||||
ChatMessage chatmessage = s1.isEmpty() ? null : new ChatMessage("chat.type.text", new Object[]{this.player.getScoreboardDisplayName(), s1});
|
ChatMessage chatmessage = s1.isEmpty() ? null : new ChatMessage("chat.type.text", new Object[]{this.player.getScoreboardDisplayName(), s1});
|
||||||
@@ -1247,28 +1773,198 @@
|
@@ -1234,28 +1760,198 @@
|
||||||
}, ChatMessageType.CHAT, this.player.getUniqueID());
|
}, ChatMessageType.CHAT, this.player.getUniqueID());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1151,7 +1160,7 @@
|
|||||||
this.player.resetIdleTimer();
|
this.player.resetIdleTimer();
|
||||||
IJumpable ijumpable;
|
IJumpable ijumpable;
|
||||||
|
|
||||||
@@ -1326,6 +2022,7 @@
|
@@ -1313,6 +2009,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void a(PacketPlayInUseEntity packetplayinuseentity) {
|
public void a(PacketPlayInUseEntity packetplayinuseentity) {
|
||||||
PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.getWorldServer());
|
PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.getWorldServer());
|
||||||
@ -1159,7 +1168,7 @@
|
|||||||
WorldServer worldserver = this.player.getWorldServer();
|
WorldServer worldserver = this.player.getWorldServer();
|
||||||
final Entity entity = packetplayinuseentity.a(worldserver);
|
final Entity entity = packetplayinuseentity.a(worldserver);
|
||||||
|
|
||||||
@@ -1336,10 +2033,44 @@
|
@@ -1323,10 +2020,44 @@
|
||||||
|
|
||||||
if (this.player.f(entity) < 36.0D) {
|
if (this.player.f(entity) < 36.0D) {
|
||||||
packetplayinuseentity.a(new PacketPlayInUseEntity.c() {
|
packetplayinuseentity.a(new PacketPlayInUseEntity.c() {
|
||||||
@ -1205,7 +1214,7 @@
|
|||||||
if (enuminteractionresult.a()) {
|
if (enuminteractionresult.a()) {
|
||||||
CriterionTriggers.PLAYER_INTERACTED_WITH_ENTITY.a(PlayerConnection.this.player, itemstack, entity);
|
CriterionTriggers.PLAYER_INTERACTED_WITH_ENTITY.a(PlayerConnection.this.player, itemstack, entity);
|
||||||
if (enuminteractionresult.b()) {
|
if (enuminteractionresult.b()) {
|
||||||
@@ -1351,20 +2082,27 @@
|
@@ -1338,20 +2069,27 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void a(EnumHand enumhand) {
|
public void a(EnumHand enumhand) {
|
||||||
@ -1236,7 +1245,7 @@
|
|||||||
} else {
|
} else {
|
||||||
PlayerConnection.this.disconnect(new ChatMessage("multiplayer.disconnect.invalid_entity_attacked"));
|
PlayerConnection.this.disconnect(new ChatMessage("multiplayer.disconnect.invalid_entity_attacked"));
|
||||||
PlayerConnection.LOGGER.warn("Player {} tried to attack an invalid entity", PlayerConnection.this.player.getDisplayName().getString());
|
PlayerConnection.LOGGER.warn("Player {} tried to attack an invalid entity", PlayerConnection.this.player.getDisplayName().getString());
|
||||||
@@ -1409,19 +2147,302 @@
|
@@ -1396,21 +2134,304 @@
|
||||||
@Override
|
@Override
|
||||||
public void a(PacketPlayInCloseWindow packetplayinclosewindow) {
|
public void a(PacketPlayInCloseWindow packetplayinclosewindow) {
|
||||||
PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.getWorldServer());
|
PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.getWorldServer());
|
||||||
@ -1259,7 +1268,9 @@
|
|||||||
+ if (false/*this.player.isSpectator()*/) { // CraftBukkit
|
+ if (false/*this.player.isSpectator()*/) { // CraftBukkit
|
||||||
this.player.containerMenu.updateInventory();
|
this.player.containerMenu.updateInventory();
|
||||||
} else {
|
} else {
|
||||||
this.player.containerMenu.g();
|
boolean flag = packetplayinwindowclick.h() != this.player.containerMenu.getStateId();
|
||||||
|
|
||||||
|
this.player.containerMenu.h();
|
||||||
- this.player.containerMenu.a(packetplayinwindowclick.c(), packetplayinwindowclick.d(), packetplayinwindowclick.g(), this.player);
|
- this.player.containerMenu.a(packetplayinwindowclick.c(), packetplayinwindowclick.d(), packetplayinwindowclick.g(), this.player);
|
||||||
+ // CraftBukkit start - Call InventoryClickEvent
|
+ // CraftBukkit start - Call InventoryClickEvent
|
||||||
+ if (packetplayinwindowclick.c() < -1 && packetplayinwindowclick.c() != -999) {
|
+ if (packetplayinwindowclick.c() < -1 && packetplayinwindowclick.c() != -999) {
|
||||||
@ -1512,19 +1523,19 @@
|
|||||||
+ case PLACE_SOME:
|
+ case PLACE_SOME:
|
||||||
+ case PLACE_ONE:
|
+ case PLACE_ONE:
|
||||||
+ case SWAP_WITH_CURSOR:
|
+ case SWAP_WITH_CURSOR:
|
||||||
+ this.player.connection.sendPacket(new PacketPlayOutSetSlot(-1, -1, this.player.containerMenu.getCarried()));
|
+ this.player.connection.sendPacket(new PacketPlayOutSetSlot(-1, -1, this.player.inventoryMenu.incrementStateId(), this.player.containerMenu.getCarried()));
|
||||||
+ this.player.connection.sendPacket(new PacketPlayOutSetSlot(this.player.containerMenu.containerId, packetplayinwindowclick.c(), this.player.containerMenu.getSlot(packetplayinwindowclick.c()).getItem()));
|
+ this.player.connection.sendPacket(new PacketPlayOutSetSlot(this.player.containerMenu.containerId, this.player.inventoryMenu.incrementStateId(), packetplayinwindowclick.c(), this.player.containerMenu.getSlot(packetplayinwindowclick.c()).getItem()));
|
||||||
+ break;
|
+ break;
|
||||||
+ // Modified clicked only
|
+ // Modified clicked only
|
||||||
+ case DROP_ALL_SLOT:
|
+ case DROP_ALL_SLOT:
|
||||||
+ case DROP_ONE_SLOT:
|
+ case DROP_ONE_SLOT:
|
||||||
+ this.player.connection.sendPacket(new PacketPlayOutSetSlot(this.player.containerMenu.containerId, packetplayinwindowclick.c(), this.player.containerMenu.getSlot(packetplayinwindowclick.c()).getItem()));
|
+ this.player.connection.sendPacket(new PacketPlayOutSetSlot(this.player.containerMenu.containerId, this.player.inventoryMenu.incrementStateId(), packetplayinwindowclick.c(), this.player.containerMenu.getSlot(packetplayinwindowclick.c()).getItem()));
|
||||||
+ break;
|
+ break;
|
||||||
+ // Modified cursor only
|
+ // Modified cursor only
|
||||||
+ case DROP_ALL_CURSOR:
|
+ case DROP_ALL_CURSOR:
|
||||||
+ case DROP_ONE_CURSOR:
|
+ case DROP_ONE_CURSOR:
|
||||||
+ case CLONE_STACK:
|
+ case CLONE_STACK:
|
||||||
+ this.player.connection.sendPacket(new PacketPlayOutSetSlot(-1, -1, this.player.containerMenu.getCarried()));
|
+ this.player.connection.sendPacket(new PacketPlayOutSetSlot(-1, -1, this.player.inventoryMenu.incrementStateId(), this.player.containerMenu.getCarried()));
|
||||||
+ break;
|
+ break;
|
||||||
+ // Nothing
|
+ // Nothing
|
||||||
+ case NOTHING:
|
+ case NOTHING:
|
||||||
@ -1542,7 +1553,7 @@
|
|||||||
ObjectIterator objectiterator = Int2ObjectMaps.fastIterable(packetplayinwindowclick.f()).iterator();
|
ObjectIterator objectiterator = Int2ObjectMaps.fastIterable(packetplayinwindowclick.f()).iterator();
|
||||||
|
|
||||||
while (objectiterator.hasNext()) {
|
while (objectiterator.hasNext()) {
|
||||||
@@ -1452,6 +2473,7 @@
|
@@ -1445,6 +2466,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void a(PacketPlayInEnchantItem packetplayinenchantitem) {
|
public void a(PacketPlayInEnchantItem packetplayinenchantitem) {
|
||||||
PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.getWorldServer());
|
PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.getWorldServer());
|
||||||
@ -1550,7 +1561,7 @@
|
|||||||
this.player.resetIdleTimer();
|
this.player.resetIdleTimer();
|
||||||
if (this.player.containerMenu.containerId == packetplayinenchantitem.b() && !this.player.isSpectator()) {
|
if (this.player.containerMenu.containerId == packetplayinenchantitem.b() && !this.player.isSpectator()) {
|
||||||
this.player.containerMenu.a((EntityHuman) this.player, packetplayinenchantitem.c());
|
this.player.containerMenu.a((EntityHuman) this.player, packetplayinenchantitem.c());
|
||||||
@@ -1484,6 +2506,43 @@
|
@@ -1477,6 +2499,43 @@
|
||||||
|
|
||||||
boolean flag1 = packetplayinsetcreativeslot.b() >= 1 && packetplayinsetcreativeslot.b() <= 45;
|
boolean flag1 = packetplayinsetcreativeslot.b() >= 1 && packetplayinsetcreativeslot.b() <= 45;
|
||||||
boolean flag2 = itemstack.isEmpty() || itemstack.getDamage() >= 0 && itemstack.getCount() <= 64 && !itemstack.isEmpty();
|
boolean flag2 = itemstack.isEmpty() || itemstack.getDamage() >= 0 && itemstack.getCount() <= 64 && !itemstack.isEmpty();
|
||||||
@ -1584,8 +1595,8 @@
|
|||||||
+ case DENY:
|
+ case DENY:
|
||||||
+ // Reset the slot
|
+ // Reset the slot
|
||||||
+ if (packetplayinsetcreativeslot.b() >= 0) {
|
+ if (packetplayinsetcreativeslot.b() >= 0) {
|
||||||
+ this.player.connection.sendPacket(new PacketPlayOutSetSlot(this.player.inventoryMenu.containerId, packetplayinsetcreativeslot.b(), this.player.inventoryMenu.getSlot(packetplayinsetcreativeslot.b()).getItem()));
|
+ this.player.connection.sendPacket(new PacketPlayOutSetSlot(this.player.inventoryMenu.containerId, this.player.inventoryMenu.incrementStateId(), packetplayinsetcreativeslot.b(), this.player.inventoryMenu.getSlot(packetplayinsetcreativeslot.b()).getItem()));
|
||||||
+ this.player.connection.sendPacket(new PacketPlayOutSetSlot(-1, -1, ItemStack.EMPTY));
|
+ this.player.connection.sendPacket(new PacketPlayOutSetSlot(-1, this.player.inventoryMenu.incrementStateId(), -1, ItemStack.EMPTY));
|
||||||
+ }
|
+ }
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
@ -1593,8 +1604,8 @@
|
|||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
|
||||||
if (flag1 && flag2) {
|
if (flag1 && flag2) {
|
||||||
if (itemstack.isEmpty()) {
|
this.player.inventoryMenu.getSlot(packetplayinsetcreativeslot.b()).set(itemstack);
|
||||||
@@ -1511,6 +2570,7 @@
|
@@ -1499,6 +2558,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
private void a(PacketPlayInUpdateSign packetplayinupdatesign, List<ITextFilter.a> list) {
|
private void a(PacketPlayInUpdateSign packetplayinupdatesign, List<ITextFilter.a> list) {
|
||||||
@ -1602,7 +1613,7 @@
|
|||||||
this.player.resetIdleTimer();
|
this.player.resetIdleTimer();
|
||||||
WorldServer worldserver = this.player.getWorldServer();
|
WorldServer worldserver = this.player.getWorldServer();
|
||||||
BlockPosition blockposition = packetplayinupdatesign.b();
|
BlockPosition blockposition = packetplayinupdatesign.b();
|
||||||
@@ -1527,18 +2587,37 @@
|
@@ -1515,18 +2575,37 @@
|
||||||
|
|
||||||
if (!tileentitysign.d() || !this.player.getUniqueID().equals(tileentitysign.f())) {
|
if (!tileentitysign.d() || !this.player.getUniqueID().equals(tileentitysign.f())) {
|
||||||
PlayerConnection.LOGGER.warn("Player {} just tried to change non-editable sign", this.player.getDisplayName().getString());
|
PlayerConnection.LOGGER.warn("Player {} just tried to change non-editable sign", this.player.getDisplayName().getString());
|
||||||
@ -1642,7 +1653,7 @@
|
|||||||
|
|
||||||
tileentitysign.update();
|
tileentitysign.update();
|
||||||
worldserver.notify(blockposition, iblockdata, iblockdata, 3);
|
worldserver.notify(blockposition, iblockdata, iblockdata, 3);
|
||||||
@@ -1548,6 +2627,7 @@
|
@@ -1536,6 +2615,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void a(PacketPlayInKeepAlive packetplayinkeepalive) {
|
public void a(PacketPlayInKeepAlive packetplayinkeepalive) {
|
||||||
@ -1650,7 +1661,7 @@
|
|||||||
if (this.keepAlivePending && packetplayinkeepalive.b() == this.keepAliveChallenge) {
|
if (this.keepAlivePending && packetplayinkeepalive.b() == this.keepAliveChallenge) {
|
||||||
int i = (int) (SystemUtils.getMonotonicMillis() - this.keepAliveTime);
|
int i = (int) (SystemUtils.getMonotonicMillis() - this.keepAliveTime);
|
||||||
|
|
||||||
@@ -1562,7 +2642,17 @@
|
@@ -1550,7 +2630,17 @@
|
||||||
@Override
|
@Override
|
||||||
public void a(PacketPlayInAbilities packetplayinabilities) {
|
public void a(PacketPlayInAbilities packetplayinabilities) {
|
||||||
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.getWorldServer());
|
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.getWorldServer());
|
||||||
@ -1669,7 +1680,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1571,8 +2661,50 @@
|
@@ -1559,8 +2649,50 @@
|
||||||
this.player.a(packetplayinsettings);
|
this.player.a(packetplayinsettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/server/players/NameReferencingFileConverter.java
|
--- a/net/minecraft/server/players/NameReferencingFileConverter.java
|
||||||
+++ b/net/minecraft/server/players/NameReferencingFileConverter.java
|
+++ b/net/minecraft/server/players/NameReferencingFileConverter.java
|
||||||
@@ -27,6 +27,11 @@
|
@@ -28,6 +28,11 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
@ -12,7 +12,7 @@
|
|||||||
public class NameReferencingFileConverter {
|
public class NameReferencingFileConverter {
|
||||||
|
|
||||||
static final Logger LOGGER = LogManager.getLogger();
|
static final Logger LOGGER = LogManager.getLogger();
|
||||||
@@ -87,7 +92,7 @@
|
@@ -88,7 +93,7 @@
|
||||||
try {
|
try {
|
||||||
gameprofilebanlist.load();
|
gameprofilebanlist.load();
|
||||||
} catch (IOException ioexception) {
|
} catch (IOException ioexception) {
|
||||||
@ -21,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,7 +150,7 @@
|
@@ -146,7 +151,7 @@
|
||||||
try {
|
try {
|
||||||
ipbanlist.load();
|
ipbanlist.load();
|
||||||
} catch (IOException ioexception) {
|
} catch (IOException ioexception) {
|
||||||
@ -30,7 +30,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,7 +191,7 @@
|
@@ -187,7 +192,7 @@
|
||||||
try {
|
try {
|
||||||
oplist.load();
|
oplist.load();
|
||||||
} catch (IOException ioexception) {
|
} catch (IOException ioexception) {
|
||||||
@ -39,7 +39,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,7 +235,7 @@
|
@@ -231,7 +236,7 @@
|
||||||
try {
|
try {
|
||||||
whitelist.load();
|
whitelist.load();
|
||||||
} catch (IOException ioexception) {
|
} catch (IOException ioexception) {
|
||||||
@ -48,7 +48,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,6 +358,30 @@
|
@@ -354,6 +359,30 @@
|
||||||
File file5 = new File(file, s2 + ".dat");
|
File file5 = new File(file, s2 + ".dat");
|
||||||
File file6 = new File(file4, s3 + ".dat");
|
File file6 = new File(file4, s3 + ".dat");
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/server/players/PlayerList.java
|
--- a/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/net/minecraft/server/players/PlayerList.java
|
+++ b/net/minecraft/server/players/PlayerList.java
|
||||||
@@ -93,6 +93,26 @@
|
@@ -95,6 +95,26 @@
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
@ -27,7 +27,7 @@
|
|||||||
public abstract class PlayerList {
|
public abstract class PlayerList {
|
||||||
|
|
||||||
public static final File USERBANLIST_FILE = new File("banned-players.json");
|
public static final File USERBANLIST_FILE = new File("banned-players.json");
|
||||||
@@ -103,14 +123,16 @@
|
@@ -105,14 +125,16 @@
|
||||||
private static final int SEND_PLAYER_INFO_INTERVAL = 600;
|
private static final int SEND_PLAYER_INFO_INTERVAL = 600;
|
||||||
private static final SimpleDateFormat BAN_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
|
private static final SimpleDateFormat BAN_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
|
||||||
private final MinecraftServer server;
|
private final MinecraftServer server;
|
||||||
@ -47,7 +47,7 @@
|
|||||||
public final WorldNBTStorage playerIo;
|
public final WorldNBTStorage playerIo;
|
||||||
private boolean doWhiteList;
|
private boolean doWhiteList;
|
||||||
private final IRegistryCustom.Dimension registryHolder;
|
private final IRegistryCustom.Dimension registryHolder;
|
||||||
@@ -120,13 +142,23 @@
|
@@ -122,13 +144,23 @@
|
||||||
private static final boolean ALLOW_LOGOUTIVATOR = false;
|
private static final boolean ALLOW_LOGOUTIVATOR = false;
|
||||||
private int sendAllPlayerInfoIn;
|
private int sendAllPlayerInfoIn;
|
||||||
|
|
||||||
@ -73,7 +73,7 @@
|
|||||||
this.server = minecraftserver;
|
this.server = minecraftserver;
|
||||||
this.registryHolder = iregistrycustom_dimension;
|
this.registryHolder = iregistrycustom_dimension;
|
||||||
this.maxPlayers = i;
|
this.maxPlayers = i;
|
||||||
@@ -142,6 +174,12 @@
|
@@ -144,6 +176,12 @@
|
||||||
usercache.a(gameprofile);
|
usercache.a(gameprofile);
|
||||||
NBTTagCompound nbttagcompound = this.a(entityplayer);
|
NBTTagCompound nbttagcompound = this.a(entityplayer);
|
||||||
ResourceKey resourcekey;
|
ResourceKey resourcekey;
|
||||||
@ -86,7 +86,7 @@
|
|||||||
|
|
||||||
if (nbttagcompound != null) {
|
if (nbttagcompound != null) {
|
||||||
DataResult dataresult = DimensionManager.a(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.get("Dimension")));
|
DataResult dataresult = DimensionManager.a(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.get("Dimension")));
|
||||||
@@ -171,7 +209,8 @@
|
@@ -173,7 +211,8 @@
|
||||||
s1 = networkmanager.getSocketAddress().toString();
|
s1 = networkmanager.getSocketAddress().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,15 +96,15 @@
|
|||||||
WorldData worlddata = worldserver1.getWorldData();
|
WorldData worlddata = worldserver1.getWorldData();
|
||||||
|
|
||||||
entityplayer.c(nbttagcompound);
|
entityplayer.c(nbttagcompound);
|
||||||
@@ -181,6 +220,7 @@
|
@@ -183,6 +222,7 @@
|
||||||
boolean flag1 = gamerules.getBoolean(GameRules.RULE_REDUCEDDEBUGINFO);
|
boolean flag1 = gamerules.getBoolean(GameRules.RULE_REDUCEDDEBUGINFO);
|
||||||
|
|
||||||
playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.gameMode.getGameMode(), entityplayer.gameMode.c(), BiomeManager.a(worldserver1.getSeed()), worlddata.isHardcore(), this.server.G(), this.registryHolder, worldserver1.getDimensionManager(), worldserver1.getDimensionKey(), this.getMaxPlayers(), this.viewDistance, flag1, !flag, worldserver1.isDebugWorld(), worldserver1.isFlatWorld()));
|
playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.gameMode.getGameMode(), entityplayer.gameMode.c(), BiomeManager.a(worldserver1.getSeed()), worlddata.isHardcore(), this.server.F(), this.registryHolder, worldserver1.getDimensionManager(), worldserver1.getDimensionKey(), this.getMaxPlayers(), this.viewDistance, flag1, !flag, worldserver1.isDebugWorld(), worldserver1.isFlatWorld()));
|
||||||
+ entityplayer.getBukkitEntity().sendSupportedChannels(); // CraftBukkit
|
+ entityplayer.getBukkitEntity().sendSupportedChannels(); // CraftBukkit
|
||||||
playerconnection.sendPacket(new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.BRAND, (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName())));
|
playerconnection.sendPacket(new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.BRAND, (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName())));
|
||||||
playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
|
playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
|
||||||
playerconnection.sendPacket(new PacketPlayOutAbilities(entityplayer.getAbilities()));
|
playerconnection.sendPacket(new PacketPlayOutAbilities(entityplayer.getAbilities()));
|
||||||
@@ -199,19 +239,66 @@
|
@@ -201,19 +241,66 @@
|
||||||
} else {
|
} else {
|
||||||
chatmessage = new ChatMessage("multiplayer.player.joined.renamed", new Object[]{entityplayer.getScoreboardDisplayName(), s});
|
chatmessage = new ChatMessage("multiplayer.player.joined.renamed", new Object[]{entityplayer.getScoreboardDisplayName(), s});
|
||||||
}
|
}
|
||||||
@ -175,8 +175,8 @@
|
|||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
this.a(entityplayer, worldserver1);
|
this.a(entityplayer, worldserver1);
|
||||||
if (!this.server.getResourcePack().isEmpty()) {
|
if (!this.server.getResourcePack().isEmpty()) {
|
||||||
entityplayer.setResourcePack(this.server.getResourcePack(), this.server.getResourcePackHash(), this.server.aY(), this.server.bb());
|
entityplayer.setResourcePack(this.server.getResourcePack(), this.server.getResourcePackHash(), this.server.aX(), this.server.ba());
|
||||||
@@ -227,8 +314,11 @@
|
@@ -229,8 +316,11 @@
|
||||||
|
|
||||||
if (nbttagcompound != null && nbttagcompound.hasKeyOfType("RootVehicle", 10)) {
|
if (nbttagcompound != null && nbttagcompound.hasKeyOfType("RootVehicle", 10)) {
|
||||||
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("RootVehicle");
|
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("RootVehicle");
|
||||||
@ -190,7 +190,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
@@ -271,6 +361,8 @@
|
@@ -273,6 +363,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
entityplayer.syncInventory();
|
entityplayer.syncInventory();
|
||||||
@ -199,7 +199,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void sendScoreboard(ScoreboardServer scoreboardserver, EntityPlayer entityplayer) {
|
public void sendScoreboard(ScoreboardServer scoreboardserver, EntityPlayer entityplayer) {
|
||||||
@@ -303,30 +395,31 @@
|
@@ -305,30 +397,31 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPlayerFileData(WorldServer worldserver) {
|
public void setPlayerFileData(WorldServer worldserver) {
|
||||||
@ -236,7 +236,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -354,14 +447,15 @@
|
@@ -356,14 +449,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void savePlayerFile(EntityPlayer entityplayer) {
|
protected void savePlayerFile(EntityPlayer entityplayer) {
|
||||||
@ -254,7 +254,7 @@
|
|||||||
|
|
||||||
if (advancementdataplayer != null) {
|
if (advancementdataplayer != null) {
|
||||||
advancementdataplayer.b();
|
advancementdataplayer.b();
|
||||||
@@ -369,10 +463,24 @@
|
@@ -371,10 +465,24 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,7 +280,7 @@
|
|||||||
this.savePlayerFile(entityplayer);
|
this.savePlayerFile(entityplayer);
|
||||||
if (entityplayer.isPassenger()) {
|
if (entityplayer.isPassenger()) {
|
||||||
Entity entity = entityplayer.getRootVehicle();
|
Entity entity = entityplayer.getRootVehicle();
|
||||||
@@ -396,18 +504,66 @@
|
@@ -398,18 +506,66 @@
|
||||||
|
|
||||||
if (entityplayer1 == entityplayer) {
|
if (entityplayer1 == entityplayer) {
|
||||||
this.playersByUUID.remove(uuid);
|
this.playersByUUID.remove(uuid);
|
||||||
@ -353,7 +353,7 @@
|
|||||||
GameProfileBanEntry gameprofilebanentry = (GameProfileBanEntry) this.bans.get(gameprofile);
|
GameProfileBanEntry gameprofilebanentry = (GameProfileBanEntry) this.bans.get(gameprofile);
|
||||||
|
|
||||||
chatmessage = new ChatMessage("multiplayer.disconnect.banned.reason", new Object[]{gameprofilebanentry.getReason()});
|
chatmessage = new ChatMessage("multiplayer.disconnect.banned.reason", new Object[]{gameprofilebanentry.getReason()});
|
||||||
@@ -415,10 +571,12 @@
|
@@ -417,10 +573,12 @@
|
||||||
chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned.expiration", new Object[]{PlayerList.BAN_DATE_FORMAT.format(gameprofilebanentry.getExpires())}));
|
chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned.expiration", new Object[]{PlayerList.BAN_DATE_FORMAT.format(gameprofilebanentry.getExpires())}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -369,7 +369,7 @@
|
|||||||
IpBanEntry ipbanentry = this.ipBans.get(socketaddress);
|
IpBanEntry ipbanentry = this.ipBans.get(socketaddress);
|
||||||
|
|
||||||
chatmessage = new ChatMessage("multiplayer.disconnect.banned_ip.reason", new Object[]{ipbanentry.getReason()});
|
chatmessage = new ChatMessage("multiplayer.disconnect.banned_ip.reason", new Object[]{ipbanentry.getReason()});
|
||||||
@@ -426,13 +584,25 @@
|
@@ -428,13 +586,25 @@
|
||||||
chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned_ip.expiration", new Object[]{PlayerList.BAN_DATE_FORMAT.format(ipbanentry.getExpires())}));
|
chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned_ip.expiration", new Object[]{PlayerList.BAN_DATE_FORMAT.format(ipbanentry.getExpires())}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -398,10 +398,10 @@
|
|||||||
UUID uuid = EntityHuman.a(gameprofile);
|
UUID uuid = EntityHuman.a(gameprofile);
|
||||||
List<EntityPlayer> list = Lists.newArrayList();
|
List<EntityPlayer> list = Lists.newArrayList();
|
||||||
|
|
||||||
@@ -459,14 +629,24 @@
|
@@ -461,14 +631,24 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
return new EntityPlayer(this.server, this.server.F(), gameprofile);
|
return new EntityPlayer(this.server, this.server.E(), gameprofile);
|
||||||
+ */
|
+ */
|
||||||
+ return player;
|
+ return player;
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
@ -423,9 +423,9 @@
|
|||||||
WorldServer worldserver = this.server.getWorldServer(entityplayer.getSpawnDimension());
|
WorldServer worldserver = this.server.getWorldServer(entityplayer.getSpawnDimension());
|
||||||
Optional optional;
|
Optional optional;
|
||||||
|
|
||||||
@@ -478,6 +658,11 @@
|
@@ -480,6 +660,11 @@
|
||||||
|
|
||||||
WorldServer worldserver1 = worldserver != null && optional.isPresent() ? worldserver : this.server.F();
|
WorldServer worldserver1 = worldserver != null && optional.isPresent() ? worldserver : this.server.E();
|
||||||
EntityPlayer entityplayer1 = new EntityPlayer(this.server, worldserver1, entityplayer.getProfile());
|
EntityPlayer entityplayer1 = new EntityPlayer(this.server, worldserver1, entityplayer.getProfile());
|
||||||
+ // */
|
+ // */
|
||||||
+ EntityPlayer entityplayer1 = entityplayer;
|
+ EntityPlayer entityplayer1 = entityplayer;
|
||||||
@ -435,7 +435,7 @@
|
|||||||
|
|
||||||
entityplayer1.connection = entityplayer.connection;
|
entityplayer1.connection = entityplayer.connection;
|
||||||
entityplayer1.copyFrom(entityplayer, flag);
|
entityplayer1.copyFrom(entityplayer, flag);
|
||||||
@@ -493,49 +678,110 @@
|
@@ -495,49 +680,110 @@
|
||||||
|
|
||||||
boolean flag2 = false;
|
boolean flag2 = false;
|
||||||
|
|
||||||
@ -570,7 +570,7 @@
|
|||||||
return entityplayer1;
|
return entityplayer1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -548,7 +794,18 @@
|
@@ -550,7 +796,18 @@
|
||||||
|
|
||||||
public void tick() {
|
public void tick() {
|
||||||
if (++this.sendAllPlayerInfoIn > 600) {
|
if (++this.sendAllPlayerInfoIn > 600) {
|
||||||
@ -590,7 +590,7 @@
|
|||||||
this.sendAllPlayerInfoIn = 0;
|
this.sendAllPlayerInfoIn = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -565,6 +822,25 @@
|
@@ -567,6 +824,25 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -616,7 +616,7 @@
|
|||||||
public void a(Packet<?> packet, ResourceKey<World> resourcekey) {
|
public void a(Packet<?> packet, ResourceKey<World> resourcekey) {
|
||||||
Iterator iterator = this.players.iterator();
|
Iterator iterator = this.players.iterator();
|
||||||
|
|
||||||
@@ -667,6 +943,7 @@
|
@@ -669,6 +945,7 @@
|
||||||
entityplayer.connection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, b0));
|
entityplayer.connection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, b0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -624,7 +624,7 @@
|
|||||||
this.server.getCommandDispatcher().a(entityplayer);
|
this.server.getCommandDispatcher().a(entityplayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -699,6 +976,12 @@
|
@@ -701,6 +978,12 @@
|
||||||
for (int i = 0; i < this.players.size(); ++i) {
|
for (int i = 0; i < this.players.size(); ++i) {
|
||||||
EntityPlayer entityplayer = (EntityPlayer) this.players.get(i);
|
EntityPlayer entityplayer = (EntityPlayer) this.players.get(i);
|
||||||
|
|
||||||
@ -637,11 +637,11 @@
|
|||||||
if (entityplayer != entityhuman && entityplayer.level.getDimensionKey() == resourcekey) {
|
if (entityplayer != entityhuman && entityplayer.level.getDimensionKey() == resourcekey) {
|
||||||
double d4 = d0 - entityplayer.locX();
|
double d4 = d0 - entityplayer.locX();
|
||||||
double d5 = d1 - entityplayer.locY();
|
double d5 = d1 - entityplayer.locY();
|
||||||
@@ -738,23 +1021,34 @@
|
@@ -740,23 +1023,34 @@
|
||||||
public void reloadWhitelist() {}
|
public void reloadWhitelist() {}
|
||||||
|
|
||||||
public void a(EntityPlayer entityplayer, WorldServer worldserver) {
|
public void a(EntityPlayer entityplayer, WorldServer worldserver) {
|
||||||
- WorldBorder worldborder = this.server.F().getWorldBorder();
|
- WorldBorder worldborder = this.server.E().getWorldBorder();
|
||||||
+ WorldBorder worldborder = entityplayer.level.getWorldBorder(); // CraftBukkit
|
+ WorldBorder worldborder = entityplayer.level.getWorldBorder(); // CraftBukkit
|
||||||
|
|
||||||
entityplayer.connection.sendPacket(new ClientboundInitializeBorderPacket(worldborder));
|
entityplayer.connection.sendPacket(new ClientboundInitializeBorderPacket(worldborder));
|
||||||
@ -677,7 +677,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getPlayerCount() {
|
public int getPlayerCount() {
|
||||||
@@ -805,12 +1099,22 @@
|
@@ -807,12 +1101,22 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void shutdown() {
|
public void shutdown() {
|
||||||
@ -702,7 +702,7 @@
|
|||||||
public void sendMessage(IChatBaseComponent ichatbasecomponent, ChatMessageType chatmessagetype, UUID uuid) {
|
public void sendMessage(IChatBaseComponent ichatbasecomponent, ChatMessageType chatmessagetype, UUID uuid) {
|
||||||
this.server.sendMessage(ichatbasecomponent, uuid);
|
this.server.sendMessage(ichatbasecomponent, uuid);
|
||||||
Iterator iterator = this.players.iterator();
|
Iterator iterator = this.players.iterator();
|
||||||
@@ -838,24 +1142,32 @@
|
@@ -840,16 +1144,23 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -727,12 +727,10 @@
|
|||||||
if (!file1.exists()) {
|
if (!file1.exists()) {
|
||||||
- File file2 = new File(file, entityhuman.getDisplayName().getString() + ".json");
|
- File file2 = new File(file, entityhuman.getDisplayName().getString() + ".json");
|
||||||
+ File file2 = new File(file, displayName + ".json"); // CraftBukkit
|
+ File file2 = new File(file, displayName + ".json"); // CraftBukkit
|
||||||
+ java.nio.file.Path path = file2.toPath();
|
Path path = file2.toPath();
|
||||||
|
|
||||||
- if (file2.exists() && file2.isFile()) {
|
if (FileUtils.a(path) && FileUtils.b(path) && path.startsWith(file.getPath()) && file2.isFile()) {
|
||||||
+ if (net.minecraft.FileUtils.a(path) && net.minecraft.FileUtils.b(path) && path.startsWith(file.getPath()) && file2.isFile()) {
|
@@ -858,7 +1169,7 @@
|
||||||
file2.renameTo(file1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
serverstatisticmanager = new ServerStatisticManager(this.server, file1);
|
serverstatisticmanager = new ServerStatisticManager(this.server, file1);
|
||||||
@ -741,7 +739,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
return serverstatisticmanager;
|
return serverstatisticmanager;
|
||||||
@@ -863,14 +1175,14 @@
|
@@ -866,14 +1177,14 @@
|
||||||
|
|
||||||
public AdvancementDataPlayer f(EntityPlayer entityplayer) {
|
public AdvancementDataPlayer f(EntityPlayer entityplayer) {
|
||||||
UUID uuid = entityplayer.getUniqueID();
|
UUID uuid = entityplayer.getUniqueID();
|
||||||
@ -758,7 +756,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
advancementdataplayer.a(entityplayer);
|
advancementdataplayer.a(entityplayer);
|
||||||
@@ -906,13 +1218,20 @@
|
@@ -909,13 +1220,20 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reload() {
|
public void reload() {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
package net.minecraft.server.players;
|
package net.minecraft.server.players;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
@@ -92,7 +93,7 @@
|
@@ -93,7 +94,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onProfileLookupFailed(GameProfile gameprofile, Exception exception) {
|
public void onProfileLookupFailed(GameProfile gameprofile, Exception exception) {
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
public abstract class EntityInsentient extends EntityLiving {
|
public abstract class EntityInsentient extends EntityLiving {
|
||||||
|
|
||||||
private static final DataWatcherObject<Byte> DATA_MOB_FLAGS_ID = DataWatcher.a(EntityInsentient.class, DataWatcherRegistry.BYTE);
|
private static final DataWatcherObject<Byte> DATA_MOB_FLAGS_ID = DataWatcher.a(EntityInsentient.class, DataWatcherRegistry.BYTE);
|
||||||
@@ -112,6 +125,8 @@
|
@@ -113,6 +126,8 @@
|
||||||
private BlockPosition restrictCenter;
|
private BlockPosition restrictCenter;
|
||||||
private float restrictRadius;
|
private float restrictRadius;
|
||||||
|
|
||||||
@ -29,7 +29,7 @@
|
|||||||
protected EntityInsentient(EntityTypes<? extends EntityInsentient> entitytypes, World world) {
|
protected EntityInsentient(EntityTypes<? extends EntityInsentient> entitytypes, World world) {
|
||||||
super(entitytypes, world);
|
super(entitytypes, world);
|
||||||
this.handItems = NonNullList.a(2, ItemStack.EMPTY);
|
this.handItems = NonNullList.a(2, ItemStack.EMPTY);
|
||||||
@@ -135,6 +150,9 @@
|
@@ -136,6 +151,9 @@
|
||||||
this.initPathfinder();
|
this.initPathfinder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,7 +39,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void initPathfinder() {}
|
protected void initPathfinder() {}
|
||||||
@@ -215,7 +233,38 @@
|
@@ -216,7 +234,38 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGoalTarget(@Nullable EntityLiving entityliving) {
|
public void setGoalTarget(@Nullable EntityLiving entityliving) {
|
||||||
@ -78,7 +78,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -442,16 +491,26 @@
|
@@ -443,16 +492,26 @@
|
||||||
nbttagcompound.setBoolean("NoAI", this.isNoAI());
|
nbttagcompound.setBoolean("NoAI", this.isNoAI());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +107,7 @@
|
|||||||
NBTTagList nbttaglist;
|
NBTTagList nbttaglist;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -498,6 +557,11 @@
|
@@ -499,6 +558,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setNoAI(nbttagcompound.getBoolean("NoAI"));
|
this.setNoAI(nbttagcompound.getBoolean("NoAI"));
|
||||||
@ -119,7 +119,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -561,7 +625,7 @@
|
@@ -562,7 +626,7 @@
|
||||||
protected void b(EntityItem entityitem) {
|
protected void b(EntityItem entityitem) {
|
||||||
ItemStack itemstack = entityitem.getItemStack();
|
ItemStack itemstack = entityitem.getItemStack();
|
||||||
|
|
||||||
@ -128,7 +128,7 @@
|
|||||||
this.a(entityitem);
|
this.a(entityitem);
|
||||||
this.receive(entityitem, itemstack.getCount());
|
this.receive(entityitem, itemstack.getCount());
|
||||||
entityitem.die();
|
entityitem.die();
|
||||||
@@ -570,15 +634,29 @@
|
@@ -571,15 +635,29 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean j(ItemStack itemstack) {
|
public boolean j(ItemStack itemstack) {
|
||||||
@ -159,7 +159,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.b(enumitemslot, itemstack);
|
this.b(enumitemslot, itemstack);
|
||||||
@@ -691,18 +769,18 @@
|
@@ -692,18 +770,18 @@
|
||||||
EntityHuman entityhuman = this.level.findNearbyPlayer(this, -1.0D);
|
EntityHuman entityhuman = this.level.findNearbyPlayer(this, -1.0D);
|
||||||
|
|
||||||
if (entityhuman != null) {
|
if (entityhuman != null) {
|
||||||
@ -181,7 +181,7 @@
|
|||||||
this.die();
|
this.die();
|
||||||
} else if (d0 < (double) l) {
|
} else if (d0 < (double) l) {
|
||||||
this.noActionTime = 0;
|
this.noActionTime = 0;
|
||||||
@@ -717,6 +795,7 @@
|
@@ -718,6 +796,7 @@
|
||||||
@Override
|
@Override
|
||||||
protected final void doTick() {
|
protected final void doTick() {
|
||||||
++this.noActionTime;
|
++this.noActionTime;
|
||||||
@ -189,7 +189,7 @@
|
|||||||
this.level.getMethodProfiler().enter("sensing");
|
this.level.getMethodProfiler().enter("sensing");
|
||||||
this.sensing.a();
|
this.sensing.a();
|
||||||
this.level.getMethodProfiler().exit();
|
this.level.getMethodProfiler().exit();
|
||||||
@@ -1100,6 +1179,12 @@
|
@@ -1101,6 +1180,12 @@
|
||||||
if (!this.isAlive()) {
|
if (!this.isAlive()) {
|
||||||
return EnumInteractionResult.PASS;
|
return EnumInteractionResult.PASS;
|
||||||
} else if (this.getLeashHolder() == entityhuman) {
|
} else if (this.getLeashHolder() == entityhuman) {
|
||||||
@ -202,7 +202,7 @@
|
|||||||
this.unleash(true, !entityhuman.getAbilities().instabuild);
|
this.unleash(true, !entityhuman.getAbilities().instabuild);
|
||||||
return EnumInteractionResult.a(this.level.isClientSide);
|
return EnumInteractionResult.a(this.level.isClientSide);
|
||||||
} else {
|
} else {
|
||||||
@@ -1118,6 +1203,12 @@
|
@@ -1119,6 +1204,12 @@
|
||||||
ItemStack itemstack = entityhuman.b(enumhand);
|
ItemStack itemstack = entityhuman.b(enumhand);
|
||||||
|
|
||||||
if (itemstack.a(Items.LEAD) && this.a(entityhuman)) {
|
if (itemstack.a(Items.LEAD) && this.a(entityhuman)) {
|
||||||
@ -215,7 +215,7 @@
|
|||||||
this.setLeashHolder(entityhuman, true);
|
this.setLeashHolder(entityhuman, true);
|
||||||
itemstack.subtract(1);
|
itemstack.subtract(1);
|
||||||
return EnumInteractionResult.a(this.level.isClientSide);
|
return EnumInteractionResult.a(this.level.isClientSide);
|
||||||
@@ -1133,7 +1224,7 @@
|
@@ -1134,7 +1225,7 @@
|
||||||
if (itemstack.getItem() instanceof ItemMonsterEgg) {
|
if (itemstack.getItem() instanceof ItemMonsterEgg) {
|
||||||
if (this.level instanceof WorldServer) {
|
if (this.level instanceof WorldServer) {
|
||||||
ItemMonsterEgg itemmonsteregg = (ItemMonsterEgg) itemstack.getItem();
|
ItemMonsterEgg itemmonsteregg = (ItemMonsterEgg) itemstack.getItem();
|
||||||
@ -224,7 +224,7 @@
|
|||||||
|
|
||||||
optional.ifPresent((entityinsentient) -> {
|
optional.ifPresent((entityinsentient) -> {
|
||||||
this.a(entityhuman, entityinsentient);
|
this.a(entityhuman, entityinsentient);
|
||||||
@@ -1183,12 +1274,19 @@
|
@@ -1184,12 +1275,19 @@
|
||||||
return this.restrictRadius != -1.0F;
|
return this.restrictRadius != -1.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,7 +245,7 @@
|
|||||||
|
|
||||||
t0.s(this);
|
t0.s(this);
|
||||||
t0.setBaby(this.isBaby());
|
t0.setBaby(this.isBaby());
|
||||||
@@ -1220,7 +1318,12 @@
|
@@ -1221,7 +1319,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,7 +259,7 @@
|
|||||||
if (this.isPassenger()) {
|
if (this.isPassenger()) {
|
||||||
Entity entity = this.getVehicle();
|
Entity entity = this.getVehicle();
|
||||||
|
|
||||||
@@ -1240,6 +1343,7 @@
|
@@ -1241,6 +1344,7 @@
|
||||||
|
|
||||||
if (this.leashHolder != null) {
|
if (this.leashHolder != null) {
|
||||||
if (!this.isAlive() || !this.leashHolder.isAlive()) {
|
if (!this.isAlive() || !this.leashHolder.isAlive()) {
|
||||||
@ -267,7 +267,7 @@
|
|||||||
this.unleash(true, true);
|
this.unleash(true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1251,7 +1355,9 @@
|
@@ -1252,7 +1356,9 @@
|
||||||
this.leashHolder = null;
|
this.leashHolder = null;
|
||||||
this.leashInfoTag = null;
|
this.leashInfoTag = null;
|
||||||
if (!this.level.isClientSide && flag1) {
|
if (!this.level.isClientSide && flag1) {
|
||||||
@ -277,7 +277,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this.level.isClientSide && flag && this.level instanceof WorldServer) {
|
if (!this.level.isClientSide && flag && this.level instanceof WorldServer) {
|
||||||
@@ -1301,6 +1407,7 @@
|
@@ -1302,6 +1408,7 @@
|
||||||
boolean flag1 = super.a(entity, flag);
|
boolean flag1 = super.a(entity, flag);
|
||||||
|
|
||||||
if (flag1 && this.isLeashed()) {
|
if (flag1 && this.isLeashed()) {
|
||||||
@ -285,7 +285,7 @@
|
|||||||
this.unleash(true, true);
|
this.unleash(true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1396,7 +1503,14 @@
|
@@ -1397,7 +1504,14 @@
|
||||||
int i = EnchantmentManager.getFireAspectEnchantmentLevel(this);
|
int i = EnchantmentManager.getFireAspectEnchantmentLevel(this);
|
||||||
|
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
@ -301,7 +301,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean flag = entity.damageEntity(DamageSource.mobAttack(this), f);
|
boolean flag = entity.damageEntity(DamageSource.mobAttack(this), f);
|
||||||
@@ -1464,9 +1578,10 @@
|
@@ -1465,9 +1579,10 @@
|
||||||
@Override
|
@Override
|
||||||
protected void cc() {
|
protected void cc() {
|
||||||
super.cc();
|
super.cc();
|
||||||
|
@ -497,7 +497,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1374,6 +1615,13 @@
|
@@ -1378,6 +1619,13 @@
|
||||||
if (!flag) {
|
if (!flag) {
|
||||||
EntityItem entityitem = new EntityItem(this.level, this.locX(), this.locY(), this.locZ(), new ItemStack(Items.WITHER_ROSE));
|
EntityItem entityitem = new EntityItem(this.level, this.locX(), this.locY(), this.locZ(), new ItemStack(Items.WITHER_ROSE));
|
||||||
|
|
||||||
@ -511,7 +511,7 @@
|
|||||||
this.level.addEntity(entityitem);
|
this.level.addEntity(entityitem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1393,21 +1641,40 @@
|
@@ -1397,21 +1645,40 @@
|
||||||
|
|
||||||
boolean flag = this.lastHurtByPlayerTime > 0;
|
boolean flag = this.lastHurtByPlayerTime > 0;
|
||||||
|
|
||||||
@ -555,7 +555,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1523,9 +1790,14 @@
|
@@ -1527,9 +1794,14 @@
|
||||||
int i = this.d(f, f1);
|
int i = this.d(f, f1);
|
||||||
|
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
@ -571,7 +571,7 @@
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return flag;
|
return flag;
|
||||||
@@ -1574,7 +1846,7 @@
|
@@ -1578,7 +1850,7 @@
|
||||||
|
|
||||||
protected float applyArmorModifier(DamageSource damagesource, float f) {
|
protected float applyArmorModifier(DamageSource damagesource, float f) {
|
||||||
if (!damagesource.ignoresArmor()) {
|
if (!damagesource.ignoresArmor()) {
|
||||||
@ -580,7 +580,7 @@
|
|||||||
f = CombatMath.a(f, (float) this.getArmorStrength(), (float) this.b(GenericAttributes.ARMOR_TOUGHNESS));
|
f = CombatMath.a(f, (float) this.getArmorStrength(), (float) this.b(GenericAttributes.ARMOR_TOUGHNESS));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1587,7 +1859,8 @@
|
@@ -1591,7 +1863,8 @@
|
||||||
} else {
|
} else {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -590,7 +590,7 @@
|
|||||||
i = (this.getEffect(MobEffects.DAMAGE_RESISTANCE).getAmplifier() + 1) * 5;
|
i = (this.getEffect(MobEffects.DAMAGE_RESISTANCE).getAmplifier() + 1) * 5;
|
||||||
int j = 25 - i;
|
int j = 25 - i;
|
||||||
float f1 = f * (float) j;
|
float f1 = f * (float) j;
|
||||||
@@ -1618,29 +1891,172 @@
|
@@ -1622,29 +1895,172 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -773,7 +773,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CombatTracker getCombatTracker() {
|
public CombatTracker getCombatTracker() {
|
||||||
@@ -1661,8 +2077,18 @@
|
@@ -1665,8 +2081,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setArrowCount(int i) {
|
public final void setArrowCount(int i) {
|
||||||
@ -793,7 +793,7 @@
|
|||||||
|
|
||||||
public final int eh() {
|
public final int eh() {
|
||||||
return (Integer) this.entityData.get(EntityLiving.DATA_STINGER_COUNT_ID);
|
return (Integer) this.entityData.get(EntityLiving.DATA_STINGER_COUNT_ID);
|
||||||
@@ -1958,6 +2384,12 @@
|
@@ -1962,6 +2388,12 @@
|
||||||
|
|
||||||
public abstract ItemStack getEquipment(EnumItemSlot enumitemslot);
|
public abstract ItemStack getEquipment(EnumItemSlot enumitemslot);
|
||||||
|
|
||||||
@ -806,7 +806,7 @@
|
|||||||
@Override
|
@Override
|
||||||
public abstract void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack);
|
public abstract void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack);
|
||||||
|
|
||||||
@@ -2202,6 +2634,7 @@
|
@@ -2205,6 +2637,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.onGround && !this.level.isClientSide) {
|
if (this.onGround && !this.level.isClientSide) {
|
||||||
@ -814,7 +814,7 @@
|
|||||||
this.setFlag(7, false);
|
this.setFlag(7, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -2732,6 +3165,7 @@
|
@@ -2735,6 +3168,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.level.isClientSide) {
|
if (!this.level.isClientSide) {
|
||||||
@ -822,7 +822,7 @@
|
|||||||
this.setFlag(7, flag);
|
this.setFlag(7, flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2899,14 +3333,21 @@
|
@@ -2902,14 +3336,21 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isInteractable() {
|
public boolean isInteractable() {
|
||||||
@ -846,7 +846,7 @@
|
|||||||
@Override
|
@Override
|
||||||
protected void velocityChanged() {
|
protected void velocityChanged() {
|
||||||
this.hurtMarked = this.random.nextDouble() >= this.b(GenericAttributes.KNOCKBACK_RESISTANCE);
|
this.hurtMarked = this.random.nextDouble() >= this.b(GenericAttributes.KNOCKBACK_RESISTANCE);
|
||||||
@@ -3104,7 +3545,25 @@
|
@@ -3107,7 +3548,25 @@
|
||||||
} else {
|
} else {
|
||||||
if (!this.useItem.isEmpty() && this.isHandRaised()) {
|
if (!this.useItem.isEmpty() && this.isHandRaised()) {
|
||||||
this.b(this.useItem, 16);
|
this.b(this.useItem, 16);
|
||||||
@ -873,7 +873,7 @@
|
|||||||
|
|
||||||
if (itemstack != this.useItem) {
|
if (itemstack != this.useItem) {
|
||||||
this.a(enumhand, itemstack);
|
this.a(enumhand, itemstack);
|
||||||
@@ -3176,6 +3635,12 @@
|
@@ -3179,6 +3638,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean a(double d0, double d1, double d2, boolean flag) {
|
public boolean a(double d0, double d1, double d2, boolean flag) {
|
||||||
@ -886,7 +886,7 @@
|
|||||||
double d3 = this.locX();
|
double d3 = this.locX();
|
||||||
double d4 = this.locY();
|
double d4 = this.locY();
|
||||||
double d5 = this.locZ();
|
double d5 = this.locZ();
|
||||||
@@ -3200,16 +3665,41 @@
|
@@ -3203,16 +3668,41 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag2) {
|
if (flag2) {
|
||||||
@ -931,7 +931,7 @@
|
|||||||
} else {
|
} else {
|
||||||
if (flag) {
|
if (flag) {
|
||||||
world.broadcastEntityEffect(this, (byte) 46);
|
world.broadcastEntityEffect(this, (byte) 46);
|
||||||
@@ -3219,7 +3709,7 @@
|
@@ -3222,7 +3712,7 @@
|
||||||
((EntityCreature) this).getNavigation().o();
|
((EntityCreature) this).getNavigation().o();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -940,7 +940,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3302,7 +3792,7 @@
|
@@ -3305,7 +3795,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void entityWakeup() {
|
public void entityWakeup() {
|
||||||
@ -949,16 +949,16 @@
|
|||||||
World world = this.level;
|
World world = this.level;
|
||||||
|
|
||||||
java.util.Objects.requireNonNull(this.level);
|
java.util.Objects.requireNonNull(this.level);
|
||||||
@@ -3334,7 +3824,7 @@
|
@@ -3337,7 +3827,7 @@
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public EnumDirection eW() {
|
public EnumDirection eX() {
|
||||||
- BlockPosition blockposition = (BlockPosition) this.getBedPosition().orElse((Object) null);
|
- BlockPosition blockposition = (BlockPosition) this.getBedPosition().orElse((Object) null);
|
||||||
+ BlockPosition blockposition = (BlockPosition) this.getBedPosition().orElse(null); // CraftBukkit - decompile error
|
+ BlockPosition blockposition = (BlockPosition) this.getBedPosition().orElse(null); // CraftBukkit - decompile error
|
||||||
|
|
||||||
return blockposition != null ? BlockBed.a((IBlockAccess) this.level, blockposition) : null;
|
return blockposition != null ? BlockBed.a((IBlockAccess) this.level, blockposition) : null;
|
||||||
}
|
}
|
||||||
@@ -3383,7 +3873,7 @@
|
@@ -3386,7 +3876,7 @@
|
||||||
Pair<MobEffect, Float> pair = (Pair) iterator.next();
|
Pair<MobEffect, Float> pair = (Pair) iterator.next();
|
||||||
|
|
||||||
if (!world.isClientSide && pair.getFirst() != null && world.random.nextFloat() < (Float) pair.getSecond()) {
|
if (!world.isClientSide && pair.getFirst() != null && world.random.nextFloat() < (Float) pair.getSecond()) {
|
||||||
|
@ -7,5 +7,5 @@
|
|||||||
- if (!entity1.isCollidable()) {
|
- if (!entity1.isCollidable()) {
|
||||||
+ if (!entity1.canCollideWithBukkit(entity) || !entity.canCollideWithBukkit(entity1)) { // CraftBukkit - collidable API
|
+ if (!entity1.canCollideWithBukkit(entity) || !entity.canCollideWithBukkit(entity1)) { // CraftBukkit - collidable API
|
||||||
return false;
|
return false;
|
||||||
} else if (entity.level.isClientSide && (!(entity1 instanceof EntityHuman) || !((EntityHuman) entity1).fh())) {
|
} else if (entity.level.isClientSide && (!(entity1 instanceof EntityHuman) || !((EntityHuman) entity1).fi())) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
public interface Bucketable {
|
public interface Bucketable {
|
||||||
|
|
||||||
boolean isFromBucket();
|
boolean isFromBucket();
|
||||||
@@ -90,10 +98,22 @@
|
@@ -92,10 +100,22 @@
|
||||||
ItemStack itemstack = entityhuman.b(enumhand);
|
ItemStack itemstack = entityhuman.b(enumhand);
|
||||||
|
|
||||||
if (itemstack.getItem() == Items.WATER_BUCKET && t0.isAlive()) {
|
if (itemstack.getItem() == Items.WATER_BUCKET && t0.isAlive()) {
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
+ if (flag && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(EntityBee.this, blockposition, iblockdata.set(blockstateinteger, (Integer) iblockdata.get(blockstateinteger) + 1)).isCancelled()) { // Spigot
|
+ if (flag && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(EntityBee.this, blockposition, iblockdata.set(blockstateinteger, (Integer) iblockdata.get(blockstateinteger) + 1)).isCancelled()) { // Spigot
|
||||||
EntityBee.this.level.triggerEffect(2005, blockposition, 0);
|
EntityBee.this.level.triggerEffect(2005, blockposition, 0);
|
||||||
EntityBee.this.level.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(blockstateinteger, (Integer) iblockdata.get(blockstateinteger) + 1));
|
EntityBee.this.level.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(blockstateinteger, (Integer) iblockdata.get(blockstateinteger) + 1));
|
||||||
EntityBee.this.fR();
|
EntityBee.this.fS();
|
||||||
@@ -1289,7 +1293,7 @@
|
@@ -1289,7 +1293,7 @@
|
||||||
@Override
|
@Override
|
||||||
protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) {
|
protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) {
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
hashmap.put(2, new MinecraftKey("textures/entity/cat/red.png"));
|
hashmap.put(2, new MinecraftKey("textures/entity/cat/red.png"));
|
||||||
@@ -433,7 +433,7 @@
|
@@ -433,7 +433,7 @@
|
||||||
}
|
}
|
||||||
} else if (this.n(itemstack)) {
|
} else if (this.isBreedItem(itemstack)) {
|
||||||
this.a(entityhuman, enumhand, itemstack);
|
this.a(entityhuman, enumhand, itemstack);
|
||||||
- if (this.random.nextInt(3) == 0) {
|
- if (this.random.nextInt(3) == 0) {
|
||||||
+ if (this.random.nextInt(3) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) { // CraftBukkit
|
+ if (this.random.nextInt(3) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) { // CraftBukkit
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
+ this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityGuardian.class})).a(new Class[0])); // CraftBukkit - decompile error
|
+ this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityGuardian.class})).a(new Class[0])); // CraftBukkit - decompile error
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AttributeProvider.Builder fv() {
|
public static AttributeProvider.Builder fw() {
|
||||||
@@ -243,6 +243,12 @@
|
@@ -243,6 +243,12 @@
|
||||||
ItemStack itemstack = entityitem.getItemStack();
|
ItemStack itemstack = entityitem.getItemStack();
|
||||||
|
|
||||||
|
@ -1,19 +1,5 @@
|
|||||||
--- a/net/minecraft/world/entity/animal/EntityOcelot.java
|
--- a/net/minecraft/world/entity/animal/EntityOcelot.java
|
||||||
+++ b/net/minecraft/world/entity/animal/EntityOcelot.java
|
+++ b/net/minecraft/world/entity/animal/EntityOcelot.java
|
||||||
@@ -68,11 +68,11 @@
|
|
||||||
this.t();
|
|
||||||
}
|
|
||||||
|
|
||||||
- boolean isTrusting() {
|
|
||||||
+ public boolean isTrusting() {
|
|
||||||
return (Boolean) this.entityData.get(EntityOcelot.DATA_TRUSTING);
|
|
||||||
}
|
|
||||||
|
|
||||||
- private void setTrusting(boolean flag) {
|
|
||||||
+ public void setTrusting(boolean flag) {
|
|
||||||
this.entityData.set(EntityOcelot.DATA_TRUSTING, flag);
|
|
||||||
this.t();
|
|
||||||
}
|
|
||||||
@@ -133,7 +133,7 @@
|
@@ -133,7 +133,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -24,7 +10,7 @@
|
|||||||
|
|
||||||
public static AttributeProvider.Builder p() {
|
public static AttributeProvider.Builder p() {
|
||||||
@@ -182,7 +182,8 @@
|
@@ -182,7 +182,8 @@
|
||||||
if ((this.temptGoal == null || this.temptGoal.h()) && !this.isTrusting() && this.n(itemstack) && entityhuman.f((Entity) this) < 9.0D) {
|
if ((this.temptGoal == null || this.temptGoal.h()) && !this.isTrusting() && this.isBreedItem(itemstack) && entityhuman.f((Entity) this) < 9.0D) {
|
||||||
this.a(entityhuman, enumhand, itemstack);
|
this.a(entityhuman, enumhand, itemstack);
|
||||||
if (!this.level.isClientSide) {
|
if (!this.level.isClientSide) {
|
||||||
- if (this.random.nextInt(3) == 0) {
|
- if (this.random.nextInt(3) == 0) {
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
private static final DataWatcherObject<Integer> DATA_VARIANT = DataWatcher.a(Axolotl.class, DataWatcherRegistry.INT);
|
private static final DataWatcherObject<Integer> DATA_VARIANT = DataWatcher.a(Axolotl.class, DataWatcherRegistry.INT);
|
||||||
private static final DataWatcherObject<Boolean> DATA_PLAYING_DEAD = DataWatcher.a(Axolotl.class, DataWatcherRegistry.BOOLEAN);
|
private static final DataWatcherObject<Boolean> DATA_PLAYING_DEAD = DataWatcher.a(Axolotl.class, DataWatcherRegistry.BOOLEAN);
|
||||||
private static final DataWatcherObject<Boolean> FROM_BUCKET = DataWatcher.a(Axolotl.class, DataWatcherRegistry.BOOLEAN);
|
private static final DataWatcherObject<Boolean> FROM_BUCKET = DataWatcher.a(Axolotl.class, DataWatcherRegistry.BOOLEAN);
|
||||||
@@ -239,6 +240,7 @@
|
@@ -235,6 +236,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void setFromBucket(boolean flag) {
|
public void setFromBucket(boolean flag) {
|
||||||
this.entityData.set(Axolotl.FROM_BUCKET, flag);
|
this.entityData.set(Axolotl.FROM_BUCKET, flag);
|
||||||
@ -18,7 +18,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@@ -280,7 +282,7 @@
|
@@ -276,7 +278,7 @@
|
||||||
@Override
|
@Override
|
||||||
protected void mobTick() {
|
protected void mobTick() {
|
||||||
this.level.getMethodProfiler().enter("axolotlBrain");
|
this.level.getMethodProfiler().enter("axolotlBrain");
|
||||||
@ -27,7 +27,7 @@
|
|||||||
this.level.getMethodProfiler().exit();
|
this.level.getMethodProfiler().exit();
|
||||||
this.level.getMethodProfiler().enter("axolotlActivityUpdate");
|
this.level.getMethodProfiler().enter("axolotlActivityUpdate");
|
||||||
AxolotlAi.a(this);
|
AxolotlAi.a(this);
|
||||||
@@ -422,7 +424,7 @@
|
@@ -418,7 +420,7 @@
|
||||||
|
|
||||||
if (i < 2400) {
|
if (i < 2400) {
|
||||||
i = Math.min(2400, 100 + i);
|
i = Math.min(2400, 100 + i);
|
||||||
@ -36,7 +36,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
entityhuman.removeEffect(MobEffects.DIG_SLOWDOWN);
|
entityhuman.removeEffect(MobEffects.DIG_SLOWDOWN);
|
||||||
@@ -472,7 +474,7 @@
|
@@ -468,7 +470,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BehaviorController<Axolotl> getBehaviorController() {
|
public BehaviorController<Axolotl> getBehaviorController() {
|
||||||
@ -45,7 +45,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -505,7 +507,7 @@
|
@@ -501,7 +503,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isTypeNotPersistent(double d0) {
|
public boolean isTypeNotPersistent(double d0) {
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
public class Goat extends EntityAnimal {
|
public class Goat extends EntityAnimal {
|
||||||
|
|
||||||
public static final EntitySize LONG_JUMPING_DIMENSIONS = EntitySize.b(0.9F, 1.3F).a(0.7F);
|
public static final EntitySize LONG_JUMPING_DIMENSIONS = EntitySize.b(0.9F, 1.3F).a(0.7F);
|
||||||
@@ -123,13 +128,13 @@
|
@@ -137,13 +142,13 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BehaviorController<Goat> getBehaviorController() {
|
public BehaviorController<Goat> getBehaviorController() {
|
||||||
@ -28,7 +28,7 @@
|
|||||||
this.level.getMethodProfiler().exit();
|
this.level.getMethodProfiler().exit();
|
||||||
this.level.getMethodProfiler().enter("goatActivityUpdate");
|
this.level.getMethodProfiler().enter("goatActivityUpdate");
|
||||||
GoatAi.b(this);
|
GoatAi.b(this);
|
||||||
@@ -161,8 +166,15 @@
|
@@ -175,8 +180,15 @@
|
||||||
ItemStack itemstack = entityhuman.b(enumhand);
|
ItemStack itemstack = entityhuman.b(enumhand);
|
||||||
|
|
||||||
if (itemstack.a(Items.BUCKET) && !this.isBaby()) {
|
if (itemstack.a(Items.BUCKET) && !this.isBaby()) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java
|
--- a/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java
|
||||||
+++ b/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java
|
+++ b/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java
|
||||||
@@ -70,6 +70,8 @@
|
@@ -69,6 +69,8 @@
|
||||||
import net.minecraft.world.phys.AxisAlignedBB;
|
import net.minecraft.world.phys.AxisAlignedBB;
|
||||||
import net.minecraft.world.phys.Vec3D;
|
import net.minecraft.world.phys.Vec3D;
|
||||||
|
|
||||||
@ -9,7 +9,7 @@
|
|||||||
public abstract class EntityHorseAbstract extends EntityAnimal implements IInventoryListener, IJumpable, ISaddleable {
|
public abstract class EntityHorseAbstract extends EntityAnimal implements IInventoryListener, IJumpable, ISaddleable {
|
||||||
|
|
||||||
public static final int EQUIPMENT_SLOT_OFFSET = 400;
|
public static final int EQUIPMENT_SLOT_OFFSET = 400;
|
||||||
@@ -109,6 +111,7 @@
|
@@ -108,6 +110,7 @@
|
||||||
private float mouthAnimO;
|
private float mouthAnimO;
|
||||||
protected boolean canGallop = true;
|
protected boolean canGallop = true;
|
||||||
protected int gallopSoundCounter;
|
protected int gallopSoundCounter;
|
||||||
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
protected EntityHorseAbstract(EntityTypes<? extends EntityHorseAbstract> entitytypes, World world) {
|
protected EntityHorseAbstract(EntityTypes<? extends EntityHorseAbstract> entitytypes, World world) {
|
||||||
super(entitytypes, world);
|
super(entitytypes, world);
|
||||||
@@ -293,7 +296,7 @@
|
@@ -292,7 +295,7 @@
|
||||||
public void loadChest() {
|
public void loadChest() {
|
||||||
InventorySubcontainer inventorysubcontainer = this.inventory;
|
InventorySubcontainer inventorysubcontainer = this.inventory;
|
||||||
|
|
||||||
@ -26,7 +26,7 @@
|
|||||||
if (inventorysubcontainer != null) {
|
if (inventorysubcontainer != null) {
|
||||||
inventorysubcontainer.b((IInventoryListener) this);
|
inventorysubcontainer.b((IInventoryListener) this);
|
||||||
int i = Math.min(inventorysubcontainer.getSize(), this.inventory.getSize());
|
int i = Math.min(inventorysubcontainer.getSize(), this.inventory.getSize());
|
||||||
@@ -409,7 +412,7 @@
|
@@ -408,7 +411,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxDomestication() {
|
public int getMaxDomestication() {
|
||||||
@ -35,7 +35,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -479,7 +482,7 @@
|
@@ -478,7 +481,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.getHealth() < this.getMaxHealth() && f > 0.0F) {
|
if (this.getHealth() < this.getMaxHealth() && f > 0.0F) {
|
||||||
@ -44,7 +44,7 @@
|
|||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -556,7 +559,7 @@
|
@@ -555,7 +558,7 @@
|
||||||
super.movementTick();
|
super.movementTick();
|
||||||
if (!this.level.isClientSide && this.isAlive()) {
|
if (!this.level.isClientSide && this.isAlive()) {
|
||||||
if (this.random.nextInt(900) == 0 && this.deathTime == 0) {
|
if (this.random.nextInt(900) == 0 && this.deathTime == 0) {
|
||||||
@ -52,8 +52,8 @@
|
|||||||
+ this.heal(1.0F, RegainReason.REGEN); // CraftBukkit
|
+ this.heal(1.0F, RegainReason.REGEN); // CraftBukkit
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.fU()) {
|
if (this.fV()) {
|
||||||
@@ -794,6 +797,7 @@
|
@@ -786,6 +789,7 @@
|
||||||
if (this.getOwnerUUID() != null) {
|
if (this.getOwnerUUID() != null) {
|
||||||
nbttagcompound.a("Owner", this.getOwnerUUID());
|
nbttagcompound.a("Owner", this.getOwnerUUID());
|
||||||
}
|
}
|
||||||
@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
if (!this.inventory.getItem(0).isEmpty()) {
|
if (!this.inventory.getItem(0).isEmpty()) {
|
||||||
nbttagcompound.set("SaddleItem", this.inventory.getItem(0).save(new NBTTagCompound()));
|
nbttagcompound.set("SaddleItem", this.inventory.getItem(0).save(new NBTTagCompound()));
|
||||||
@@ -821,6 +825,11 @@
|
@@ -813,6 +817,11 @@
|
||||||
if (uuid != null) {
|
if (uuid != null) {
|
||||||
this.setOwnerUUID(uuid);
|
this.setOwnerUUID(uuid);
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@
|
|||||||
|
|
||||||
if (nbttagcompound.hasKeyOfType("SaddleItem", 10)) {
|
if (nbttagcompound.hasKeyOfType("SaddleItem", 10)) {
|
||||||
ItemStack itemstack = ItemStack.a(nbttagcompound.getCompound("SaddleItem"));
|
ItemStack itemstack = ItemStack.a(nbttagcompound.getCompound("SaddleItem"));
|
||||||
@@ -903,6 +912,18 @@
|
@@ -895,6 +904,18 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void b(int i) {
|
public void b(int i) {
|
||||||
@ -90,5 +90,5 @@
|
|||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
this.allowStandSliding = true;
|
this.allowStandSliding = true;
|
||||||
this.fD();
|
this.fE();
|
||||||
this.fW();
|
this.fX();
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
--- a/net/minecraft/world/entity/monster/EntitySkeleton.java
|
|
||||||
+++ b/net/minecraft/world/entity/monster/EntitySkeleton.java
|
|
||||||
@@ -16,10 +16,10 @@
|
|
||||||
|
|
||||||
public class EntitySkeleton extends EntitySkeletonAbstract {
|
|
||||||
|
|
||||||
- private static final DataWatcherObject<Boolean> DATA_STRAY_CONVERSION_ID = DataWatcher.a(EntitySkeleton.class, DataWatcherRegistry.BOOLEAN);
|
|
||||||
+ public static final DataWatcherObject<Boolean> DATA_STRAY_CONVERSION_ID = DataWatcher.a(EntitySkeleton.class, DataWatcherRegistry.BOOLEAN); // PAIL private -> public
|
|
||||||
public static final String CONVERSION_TAG = "StrayConversionTime";
|
|
||||||
private int inPowderSnowTime;
|
|
||||||
- private int conversionTime;
|
|
||||||
+ public int conversionTime; // PAIL private -> public
|
|
||||||
|
|
||||||
public EntitySkeleton(EntityTypes<? extends EntitySkeleton> entitytypes, World world) {
|
|
||||||
super(entitytypes, world);
|
|
||||||
@@ -80,7 +80,7 @@
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
- private void a(int i) {
|
|
||||||
+ public void a(int i) { // PAIL private -> public // PAIL rename startStrayConversion
|
|
||||||
this.conversionTime = i;
|
|
||||||
this.entityData.set(EntitySkeleton.DATA_STRAY_CONVERSION_ID, true);
|
|
||||||
}
|
|
@ -13,5 +13,5 @@
|
|||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
super.tick();
|
super.tick();
|
||||||
this.fD();
|
this.fE();
|
||||||
this.checkBlockCollisions();
|
this.checkBlockCollisions();
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
+ this.conversionTime -= elapsedTicks;
|
+ this.conversionTime -= elapsedTicks;
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
if (this.conversionTime < 0) {
|
if (this.conversionTime < 0) {
|
||||||
this.fy();
|
this.fz();
|
||||||
}
|
}
|
||||||
@@ -222,6 +235,7 @@
|
@@ -222,6 +235,7 @@
|
||||||
}
|
}
|
||||||
@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
if (entityzombie != null) {
|
if (entityzombie != null) {
|
||||||
entityzombie.z(entityzombie.level.getDamageScaler(entityzombie.getChunkCoordinates()).d());
|
entityzombie.z(entityzombie.level.getDamageScaler(entityzombie.getChunkCoordinates()).d());
|
||||||
entityzombie.w(entityzombie.p() && this.fD());
|
entityzombie.w(entityzombie.p() && this.fE());
|
||||||
+ // CraftBukkit start - SPIGOT-5208: End conversion to stop event spam
|
+ // CraftBukkit start - SPIGOT-5208: End conversion to stop event spam
|
||||||
+ } else {
|
+ } else {
|
||||||
+ ((Zombie) getBukkitEntity()).setConversionTime(-1);
|
+ ((Zombie) getBukkitEntity()).setConversionTime(-1);
|
||||||
@ -111,7 +111,7 @@
|
|||||||
|
|
||||||
entityzombievillager.prepare(worldserver, worldserver.getDamageScaler(entityzombievillager.getChunkCoordinates()), EnumMobSpawn.CONVERSION, new EntityZombie.GroupDataZombie(false, true), (NBTTagCompound) null);
|
entityzombievillager.prepare(worldserver, worldserver.getDamageScaler(entityzombievillager.getChunkCoordinates()), EnumMobSpawn.CONVERSION, new EntityZombie.GroupDataZombie(false, true), (NBTTagCompound) null);
|
||||||
entityzombievillager.setVillagerData(entityvillager.getVillagerData());
|
entityzombievillager.setVillagerData(entityvillager.getVillagerData());
|
||||||
@@ -472,7 +503,7 @@
|
@@ -477,7 +508,7 @@
|
||||||
entitychicken1.prepare(worldaccess, difficultydamagescaler, EnumMobSpawn.JOCKEY, (GroupDataEntity) null, (NBTTagCompound) null);
|
entitychicken1.prepare(worldaccess, difficultydamagescaler, EnumMobSpawn.JOCKEY, (GroupDataEntity) null, (NBTTagCompound) null);
|
||||||
entitychicken1.setChickenJockey(true);
|
entitychicken1.setChickenJockey(true);
|
||||||
this.startRiding(entitychicken1);
|
this.startRiding(entitychicken1);
|
||||||
|
@ -92,7 +92,7 @@
|
|||||||
+ boolean flag = PiglinAI.isLovedByPiglin(itemstack, this) || itemstack.a(Items.CROSSBOW); // CraftBukkit
|
+ boolean flag = PiglinAI.isLovedByPiglin(itemstack, this) || itemstack.a(Items.CROSSBOW); // CraftBukkit
|
||||||
+ boolean flag1 = PiglinAI.isLovedByPiglin(itemstack1, this) || itemstack1.a(Items.CROSSBOW); // CraftBukkit
|
+ boolean flag1 = PiglinAI.isLovedByPiglin(itemstack1, this) || itemstack1.a(Items.CROSSBOW); // CraftBukkit
|
||||||
|
|
||||||
return flag && !flag1 ? true : (!flag && flag1 ? false : (this.fv() && !itemstack.a(Items.CROSSBOW) && itemstack1.a(Items.CROSSBOW) ? false : super.a(itemstack, itemstack1)));
|
return flag && !flag1 ? true : (!flag && flag1 ? false : (this.fw() && !itemstack.a(Items.CROSSBOW) && itemstack1.a(Items.CROSSBOW) ? false : super.a(itemstack, itemstack1)));
|
||||||
}
|
}
|
||||||
@@ -405,7 +433,7 @@
|
@@ -405,7 +433,7 @@
|
||||||
|
|
||||||
|
@ -17,4 +17,4 @@
|
|||||||
+ return (EntityLiving) this.brain.getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); // CraftBukkit - decompile error
|
+ return (EntityLiving) this.brain.getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); // CraftBukkit - decompile error
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean fx() {
|
protected boolean fy() {
|
||||||
|
@ -96,7 +96,7 @@
|
|||||||
@@ -278,9 +292,14 @@
|
@@ -278,9 +292,14 @@
|
||||||
boolean flag1;
|
boolean flag1;
|
||||||
|
|
||||||
if (entitypiglin.fv()) {
|
if (entitypiglin.fw()) {
|
||||||
- flag1 = b(itemstack);
|
- flag1 = b(itemstack);
|
||||||
+ flag1 = isBarterItem(itemstack, entitypiglin); // CraftBukkit - Changes to allow custom payment for bartering
|
+ flag1 = isBarterItem(itemstack, entitypiglin); // CraftBukkit - Changes to allow custom payment for bartering
|
||||||
if (flag && flag1) {
|
if (flag && flag1) {
|
||||||
@ -154,8 +154,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected static boolean b(EntityPiglin entitypiglin, ItemStack itemstack) {
|
protected static boolean b(EntityPiglin entitypiglin, ItemStack itemstack) {
|
||||||
- return !x(entitypiglin) && !v(entitypiglin) && entitypiglin.fv() && b(itemstack);
|
- return !x(entitypiglin) && !v(entitypiglin) && entitypiglin.fw() && b(itemstack);
|
||||||
+ return !x(entitypiglin) && !v(entitypiglin) && entitypiglin.fv() && isBarterItem(itemstack, entitypiglin); // CraftBukkit
|
+ return !x(entitypiglin) && !v(entitypiglin) && entitypiglin.fw() && isBarterItem(itemstack, entitypiglin); // CraftBukkit
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static void a(EntityPiglin entitypiglin, EntityLiving entityliving) {
|
protected static void a(EntityPiglin entitypiglin, EntityLiving entityliving) {
|
||||||
|
@ -51,15 +51,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -302,7 +310,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- private void fT() {
|
|
||||||
+ public void fT() {
|
|
||||||
this.t(40);
|
|
||||||
if (!this.level.isClientSide()) {
|
|
||||||
this.playSound(SoundEffects.VILLAGER_NO, this.getSoundVolume(), this.ep());
|
|
||||||
@@ -444,7 +452,14 @@
|
@@ -444,7 +452,14 @@
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next();
|
MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next();
|
||||||
@ -96,7 +87,7 @@
|
|||||||
+ }
|
+ }
|
||||||
+ worldserver.addAllEntities(entitywitch, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING);
|
+ worldserver.addAllEntities(entitywitch, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING);
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
this.fZ();
|
this.ga();
|
||||||
this.die();
|
this.die();
|
||||||
} else {
|
} else {
|
||||||
@@ -834,6 +854,13 @@
|
@@ -834,6 +854,13 @@
|
||||||
|
@ -88,7 +88,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -688,6 +713,30 @@
|
@@ -684,6 +709,30 @@
|
||||||
entityitem.setMot((double) (-f3 * f2 * 0.3F) + Math.cos((double) f5) * (double) f6, (double) (-f1 * 0.3F + 0.1F + (this.random.nextFloat() - this.random.nextFloat()) * 0.1F), (double) (f4 * f2 * 0.3F) + Math.sin((double) f5) * (double) f6);
|
entityitem.setMot((double) (-f3 * f2 * 0.3F) + Math.cos((double) f5) * (double) f6, (double) (-f1 * 0.3F + 0.1F + (this.random.nextFloat() - this.random.nextFloat()) * 0.1F), (double) (f4 * f2 * 0.3F) + Math.sin((double) f5) * (double) f6);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,7 +119,7 @@
|
|||||||
return entityitem;
|
return entityitem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -814,16 +863,17 @@
|
@@ -810,16 +859,17 @@
|
||||||
if (this.isInvulnerable(damagesource)) {
|
if (this.isInvulnerable(damagesource)) {
|
||||||
return false;
|
return false;
|
||||||
} else if (this.abilities.invulnerable && !damagesource.ignoresInvulnerability()) {
|
} else if (this.abilities.invulnerable && !damagesource.ignoresInvulnerability()) {
|
||||||
@ -139,7 +139,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.level.getDifficulty() == EnumDifficulty.EASY) {
|
if (this.level.getDifficulty() == EnumDifficulty.EASY) {
|
||||||
@@ -835,7 +885,13 @@
|
@@ -831,7 +881,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,7 +154,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -855,10 +911,29 @@
|
@@ -851,10 +907,29 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean a(EntityHuman entityhuman) {
|
public boolean a(EntityHuman entityhuman) {
|
||||||
@ -187,7 +187,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -900,8 +975,13 @@
|
@@ -896,8 +971,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,7 +202,7 @@
|
|||||||
if (!this.isInvulnerable(damagesource)) {
|
if (!this.isInvulnerable(damagesource)) {
|
||||||
f = this.applyArmorModifier(damagesource, f);
|
f = this.applyArmorModifier(damagesource, f);
|
||||||
f = this.applyMagicModifier(damagesource, f);
|
f = this.applyMagicModifier(damagesource, f);
|
||||||
@@ -916,7 +996,7 @@
|
@@ -912,7 +992,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (f != 0.0F) {
|
if (f != 0.0F) {
|
||||||
@ -211,7 +211,7 @@
|
|||||||
float f3 = this.getHealth();
|
float f3 = this.getHealth();
|
||||||
|
|
||||||
this.setHealth(this.getHealth() - f);
|
this.setHealth(this.getHealth() - f);
|
||||||
@@ -927,6 +1007,7 @@
|
@@ -923,6 +1003,7 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -219,7 +219,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1086,7 +1167,7 @@
|
@@ -1082,7 +1163,7 @@
|
||||||
|
|
||||||
f *= 0.2F + f2 * f2 * 0.8F;
|
f *= 0.2F + f2 * f2 * 0.8F;
|
||||||
f1 *= f2;
|
f1 *= f2;
|
||||||
@ -228,7 +228,7 @@
|
|||||||
if (f > 0.0F || f1 > 0.0F) {
|
if (f > 0.0F || f1 > 0.0F) {
|
||||||
boolean flag = f2 > 0.9F;
|
boolean flag = f2 > 0.9F;
|
||||||
boolean flag1 = false;
|
boolean flag1 = false;
|
||||||
@@ -1125,8 +1206,15 @@
|
@@ -1121,8 +1202,15 @@
|
||||||
if (entity instanceof EntityLiving) {
|
if (entity instanceof EntityLiving) {
|
||||||
f3 = ((EntityLiving) entity).getHealth();
|
f3 = ((EntityLiving) entity).getHealth();
|
||||||
if (j > 0 && !entity.isBurning()) {
|
if (j > 0 && !entity.isBurning()) {
|
||||||
@ -246,7 +246,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1154,8 +1242,11 @@
|
@@ -1150,8 +1238,11 @@
|
||||||
EntityLiving entityliving = (EntityLiving) iterator.next();
|
EntityLiving entityliving = (EntityLiving) iterator.next();
|
||||||
|
|
||||||
if (entityliving != this && entityliving != entity && !this.p(entityliving) && (!(entityliving instanceof EntityArmorStand) || !((EntityArmorStand) entityliving).isMarker()) && this.f((Entity) entityliving) < 9.0D) {
|
if (entityliving != this && entityliving != entity && !this.p(entityliving) && (!(entityliving instanceof EntityArmorStand) || !((EntityArmorStand) entityliving).isMarker()) && this.f((Entity) entityliving) < 9.0D) {
|
||||||
@ -259,7 +259,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1164,9 +1255,26 @@
|
@@ -1160,9 +1251,26 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entity instanceof EntityPlayer && entity.hurtMarked) {
|
if (entity instanceof EntityPlayer && entity.hurtMarked) {
|
||||||
@ -286,7 +286,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flag2) {
|
if (flag2) {
|
||||||
@@ -1211,7 +1319,14 @@
|
@@ -1207,7 +1315,14 @@
|
||||||
|
|
||||||
this.a(StatisticList.DAMAGE_DEALT, Math.round(f5 * 10.0F));
|
this.a(StatisticList.DAMAGE_DEALT, Math.round(f5 * 10.0F));
|
||||||
if (j > 0) {
|
if (j > 0) {
|
||||||
@ -302,7 +302,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.level instanceof WorldServer && f5 > 2.0F) {
|
if (this.level instanceof WorldServer && f5 > 2.0F) {
|
||||||
@@ -1221,12 +1336,17 @@
|
@@ -1217,12 +1332,17 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -321,7 +321,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1299,6 +1419,12 @@
|
@@ -1295,6 +1415,12 @@
|
||||||
public void a(ItemStack itemstack, ItemStack itemstack1, ClickAction clickaction) {}
|
public void a(ItemStack itemstack, ItemStack itemstack1, ClickAction clickaction) {}
|
||||||
|
|
||||||
public Either<EntityHuman.EnumBedResult, Unit> sleep(BlockPosition blockposition) {
|
public Either<EntityHuman.EnumBedResult, Unit> sleep(BlockPosition blockposition) {
|
||||||
@ -334,7 +334,7 @@
|
|||||||
this.entitySleep(blockposition);
|
this.entitySleep(blockposition);
|
||||||
this.sleepCounter = 0;
|
this.sleepCounter = 0;
|
||||||
return Either.right(Unit.INSTANCE);
|
return Either.right(Unit.INSTANCE);
|
||||||
@@ -1383,9 +1509,9 @@
|
@@ -1379,9 +1505,9 @@
|
||||||
super.jump();
|
super.jump();
|
||||||
this.a(StatisticList.JUMP);
|
this.a(StatisticList.JUMP);
|
||||||
if (this.isSprinting()) {
|
if (this.isSprinting()) {
|
||||||
@ -346,7 +346,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1419,7 +1545,11 @@
|
@@ -1415,7 +1541,11 @@
|
||||||
this.setMot(vec3d2.x, d3 * 0.6D, vec3d2.z);
|
this.setMot(vec3d2.x, d3 * 0.6D, vec3d2.z);
|
||||||
this.flyingSpeed = f;
|
this.flyingSpeed = f;
|
||||||
this.fallDistance = 0.0F;
|
this.fallDistance = 0.0F;
|
||||||
@ -359,7 +359,7 @@
|
|||||||
} else {
|
} else {
|
||||||
super.g(vec3d);
|
super.g(vec3d);
|
||||||
}
|
}
|
||||||
@@ -1454,19 +1584,19 @@
|
@@ -1450,19 +1580,19 @@
|
||||||
i = Math.round((float) Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2) * 100.0F);
|
i = Math.round((float) Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2) * 100.0F);
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
this.a(StatisticList.SWIM_ONE_CM, i);
|
this.a(StatisticList.SWIM_ONE_CM, i);
|
||||||
@ -382,7 +382,7 @@
|
|||||||
}
|
}
|
||||||
} else if (this.isClimbing()) {
|
} else if (this.isClimbing()) {
|
||||||
if (d1 > 0.0D) {
|
if (d1 > 0.0D) {
|
||||||
@@ -1477,13 +1607,13 @@
|
@@ -1473,13 +1603,13 @@
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
if (this.isSprinting()) {
|
if (this.isSprinting()) {
|
||||||
this.a(StatisticList.SPRINT_ONE_CM, i);
|
this.a(StatisticList.SPRINT_ONE_CM, i);
|
||||||
@ -399,7 +399,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (this.isGliding()) {
|
} else if (this.isGliding()) {
|
||||||
@@ -1549,12 +1679,24 @@
|
@@ -1545,12 +1675,24 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startGliding() {
|
public void startGliding() {
|
||||||
@ -425,7 +425,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1644,10 +1786,21 @@
|
@@ -1640,10 +1782,21 @@
|
||||||
return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2);
|
return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -448,7 +448,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1724,15 +1877,22 @@
|
@@ -1720,15 +1873,22 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
|
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
|
||||||
@ -474,7 +474,7 @@
|
|||||||
this.inventory.armor.set(enumitemslot.b(), itemstack);
|
this.inventory.armor.set(enumitemslot.b(), itemstack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1773,26 +1933,31 @@
|
@@ -1769,26 +1929,31 @@
|
||||||
|
|
||||||
protected void releaseShoulderEntities() {
|
protected void releaseShoulderEntities() {
|
||||||
if (this.timeEntitySatOnShoulder + 20L < this.level.getTime()) {
|
if (this.timeEntitySatOnShoulder + 20L < this.level.getTime()) {
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
|
|
||||||
@@ -49,23 +84,25 @@
|
@@ -49,23 +84,25 @@
|
||||||
|
|
||||||
if (flag && this.saturationLevel > 0.0F && entityhuman.ft() && this.foodLevel >= 20) {
|
if (flag && this.saturationLevel > 0.0F && entityhuman.fu() && this.foodLevel >= 20) {
|
||||||
++this.tickTimer;
|
++this.tickTimer;
|
||||||
- if (this.tickTimer >= 10) {
|
- if (this.tickTimer >= 10) {
|
||||||
+ if (this.tickTimer >= this.saturatedRegenRate) { // CraftBukkit
|
+ if (this.tickTimer >= this.saturatedRegenRate) { // CraftBukkit
|
||||||
@ -86,7 +86,7 @@
|
|||||||
+ entityhuman.applyExhaustion(f, org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.REGEN); // CraftBukkit - EntityExhaustionEvent
|
+ entityhuman.applyExhaustion(f, org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.REGEN); // CraftBukkit - EntityExhaustionEvent
|
||||||
this.tickTimer = 0;
|
this.tickTimer = 0;
|
||||||
}
|
}
|
||||||
} else if (flag && this.foodLevel >= 18 && entityhuman.ft()) {
|
} else if (flag && this.foodLevel >= 18 && entityhuman.fu()) {
|
||||||
++this.tickTimer;
|
++this.tickTimer;
|
||||||
- if (this.tickTimer >= 80) {
|
- if (this.tickTimer >= 80) {
|
||||||
- entityhuman.heal(1.0F);
|
- entityhuman.heal(1.0F);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/inventory/Container.java
|
--- a/net/minecraft/world/inventory/Container.java
|
||||||
+++ b/net/minecraft/world/inventory/Container.java
|
+++ b/net/minecraft/world/inventory/Container.java
|
||||||
@@ -29,6 +29,20 @@
|
@@ -30,6 +30,20 @@
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.entity.TileEntity;
|
import net.minecraft.world.level.block.entity.TileEntity;
|
||||||
|
|
||||||
@ -21,16 +21,7 @@
|
|||||||
public abstract class Container {
|
public abstract class Container {
|
||||||
|
|
||||||
public static final int SLOT_CLICKED_OUTSIDE = -999;
|
public static final int SLOT_CLICKED_OUTSIDE = -999;
|
||||||
@@ -43,7 +57,7 @@
|
@@ -59,6 +73,27 @@
|
||||||
public NonNullList<Slot> slots = NonNullList.a();
|
|
||||||
private final List<ContainerProperty> dataSlots = Lists.newArrayList();
|
|
||||||
private ItemStack carried;
|
|
||||||
- private final NonNullList<ItemStack> remoteSlots;
|
|
||||||
+ public NonNullList<ItemStack> remoteSlots;
|
|
||||||
private final IntList remoteDataSlots;
|
|
||||||
private ItemStack remoteCarried;
|
|
||||||
@Nullable
|
|
||||||
@@ -57,6 +71,27 @@
|
|
||||||
private ContainerSynchronizer synchronizer;
|
private ContainerSynchronizer synchronizer;
|
||||||
private boolean suppressRemoteUpdates;
|
private boolean suppressRemoteUpdates;
|
||||||
|
|
||||||
@ -58,7 +49,7 @@
|
|||||||
protected Container(@Nullable Containers<?> containers, int i) {
|
protected Container(@Nullable Containers<?> containers, int i) {
|
||||||
this.carried = ItemStack.EMPTY;
|
this.carried = ItemStack.EMPTY;
|
||||||
this.remoteSlots = NonNullList.a();
|
this.remoteSlots = NonNullList.a();
|
||||||
@@ -154,6 +189,15 @@
|
@@ -156,6 +191,15 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,16 +65,16 @@
|
|||||||
public void b(ICrafting icrafting) {
|
public void b(ICrafting icrafting) {
|
||||||
this.containerListeners.remove(icrafting);
|
this.containerListeners.remove(icrafting);
|
||||||
}
|
}
|
||||||
@@ -338,7 +382,7 @@
|
@@ -370,7 +414,7 @@
|
||||||
}
|
}
|
||||||
} else if (this.quickcraftStatus == 2) {
|
} else if (this.quickcraftStatus == 2) {
|
||||||
if (!this.quickcraftSlots.isEmpty()) {
|
if (!this.quickcraftSlots.isEmpty()) {
|
||||||
- if (this.quickcraftSlots.size() == 1) {
|
- if (this.quickcraftSlots.size() == 1) {
|
||||||
+ if (false && this.quickcraftSlots.size() == 1) { // CraftBukkit - treat everything as a drag since we are unable to easily call InventoryClickEvent instead
|
+ if (false && this.quickcraftSlots.size() == 1) { // CraftBukkit - treat everything as a drag since we are unable to easily call InventoryClickEvent instead
|
||||||
k = ((Slot) this.quickcraftSlots.iterator().next()).index;
|
k = ((Slot) this.quickcraftSlots.iterator().next()).index;
|
||||||
this.e();
|
this.f();
|
||||||
this.b(k, this.quickcraftType, InventoryClickType.PICKUP, entityhuman);
|
this.b(k, this.quickcraftType, InventoryClickType.PICKUP, entityhuman);
|
||||||
@@ -349,6 +393,7 @@
|
@@ -381,6 +425,7 @@
|
||||||
l = this.getCarried().getCount();
|
l = this.getCarried().getCount();
|
||||||
Iterator iterator = this.quickcraftSlots.iterator();
|
Iterator iterator = this.quickcraftSlots.iterator();
|
||||||
|
|
||||||
@ -91,16 +82,18 @@
|
|||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
Slot slot1 = (Slot) iterator.next();
|
Slot slot1 = (Slot) iterator.next();
|
||||||
ItemStack itemstack2 = this.getCarried();
|
ItemStack itemstack2 = this.getCarried();
|
||||||
@@ -365,12 +410,48 @@
|
@@ -397,12 +442,48 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
l -= itemstack3.getCount() - j1;
|
l -= itemstack3.getCount() - j1;
|
||||||
- slot1.set(itemstack3);
|
- slot1.set(itemstack3);
|
||||||
+ // slot1.set(itemstack3);
|
+ // slot1.set(itemstack3);
|
||||||
+ draggedSlots.put(slot1.index, itemstack3); // CraftBukkit - Put in map instead of setting
|
+ draggedSlots.put(slot1.index, itemstack3); // CraftBukkit - Put in map instead of setting
|
||||||
+ }
|
}
|
||||||
+ }
|
}
|
||||||
+
|
|
||||||
|
- itemstack1.setCount(l);
|
||||||
|
- this.setCarried(itemstack1);
|
||||||
+ // CraftBukkit start - InventoryDragEvent
|
+ // CraftBukkit start - InventoryDragEvent
|
||||||
+ InventoryView view = getBukkitView();
|
+ InventoryView view = getBukkitView();
|
||||||
+ org.bukkit.inventory.ItemStack newcursor = CraftItemStack.asCraftMirror(itemstack1);
|
+ org.bukkit.inventory.ItemStack newcursor = CraftItemStack.asCraftMirror(itemstack1);
|
||||||
@ -129,21 +122,19 @@
|
|||||||
+ if (this.getCarried() != null) {
|
+ if (this.getCarried() != null) {
|
||||||
+ this.setCarried(CraftItemStack.asNMSCopy(event.getCursor()));
|
+ this.setCarried(CraftItemStack.asNMSCopy(event.getCursor()));
|
||||||
+ needsUpdate = true;
|
+ needsUpdate = true;
|
||||||
}
|
+ }
|
||||||
+ } else {
|
+ } else {
|
||||||
+ this.setCarried(oldCursor);
|
+ this.setCarried(oldCursor);
|
||||||
}
|
+ }
|
||||||
|
+
|
||||||
- itemstack1.setCount(l);
|
|
||||||
- this.setCarried(itemstack1);
|
|
||||||
+ if (needsUpdate && entityhuman instanceof EntityPlayer) {
|
+ if (needsUpdate && entityhuman instanceof EntityPlayer) {
|
||||||
+ this.updateInventory();
|
+ this.updateInventory();
|
||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
this.e();
|
this.f();
|
||||||
@@ -388,8 +469,11 @@
|
@@ -420,8 +501,11 @@
|
||||||
if (i == -999) {
|
if (i == -999) {
|
||||||
if (!this.getCarried().isEmpty()) {
|
if (!this.getCarried().isEmpty()) {
|
||||||
if (clickaction == ClickAction.PRIMARY) {
|
if (clickaction == ClickAction.PRIMARY) {
|
||||||
@ -156,36 +147,39 @@
|
|||||||
} else {
|
} else {
|
||||||
entityhuman.drop(this.getCarried().cloneAndSubtract(1), true);
|
entityhuman.drop(this.getCarried().cloneAndSubtract(1), true);
|
||||||
}
|
}
|
||||||
@@ -452,6 +536,15 @@
|
@@ -484,6 +568,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
slot.d();
|
slot.d();
|
||||||
+ // CraftBukkit start - Make sure the client has the right slot contents
|
+ // CraftBukkit start - Make sure the client has the right slot contents
|
||||||
+ if (entityhuman instanceof EntityPlayer && slot.getMaxStackSize() != 64) {
|
+ if (entityhuman instanceof EntityPlayer && slot.getMaxStackSize() != 64) {
|
||||||
+ ((EntityPlayer) entityhuman).connection.sendPacket(new PacketPlayOutSetSlot(this.containerId, slot.index, slot.getItem()));
|
+ ((EntityPlayer) entityhuman).connection.sendPacket(new PacketPlayOutSetSlot(this.containerId, this.incrementStateId(), slot.index, slot.getItem()));
|
||||||
+ // Updating a crafting inventory makes the client reset the result slot, have to send it again
|
+ // Updating a crafting inventory makes the client reset the result slot, have to send it again
|
||||||
+ if (this.getBukkitView().getType() == InventoryType.WORKBENCH || this.getBukkitView().getType() == InventoryType.CRAFTING) {
|
+ if (this.getBukkitView().getType() == InventoryType.WORKBENCH || this.getBukkitView().getType() == InventoryType.CRAFTING) {
|
||||||
+ ((EntityPlayer) entityhuman).connection.sendPacket(new PacketPlayOutSetSlot(this.containerId, 0, this.getSlot(0).getItem()));
|
+ ((EntityPlayer) entityhuman).connection.sendPacket(new PacketPlayOutSetSlot(this.containerId, this.incrementStateId(), 0, this.getSlot(0).getItem()));
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Slot slot2;
|
Slot slot2;
|
||||||
@@ -556,8 +649,11 @@
|
@@ -591,13 +684,14 @@
|
||||||
|
ItemStack itemstack = this.getCarried();
|
||||||
|
|
||||||
public void b(EntityHuman entityhuman) {
|
if (!itemstack.isEmpty()) {
|
||||||
if (!this.getCarried().isEmpty()) {
|
+ this.setCarried(ItemStack.EMPTY); // CraftBukkit - SPIGOT-4556 - from below
|
||||||
- entityhuman.drop(this.getCarried(), false);
|
if (entityhuman.isAlive() && !((EntityPlayer) entityhuman).q()) {
|
||||||
+ // CraftBukkit start - SPIGOT-4556
|
entityhuman.getInventory().f(itemstack);
|
||||||
+ ItemStack carried = this.getCarried();
|
} else {
|
||||||
this.setCarried(ItemStack.EMPTY);
|
entityhuman.drop(itemstack, false);
|
||||||
+ entityhuman.drop(carried, false);
|
|
||||||
+ // CraftBukkit end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- this.setCarried(ItemStack.EMPTY);
|
||||||
|
+ // this.setCarried(ItemStack.EMPTY); // CraftBukkit - moved up
|
||||||
}
|
}
|
||||||
@@ -767,6 +863,11 @@
|
}
|
||||||
|
|
||||||
|
@@ -811,6 +905,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getCarried() {
|
public ItemStack getCarried() {
|
||||||
|
@ -22,15 +22,7 @@
|
|||||||
|
|
||||||
public ContainerAnvil(int i, PlayerInventory playerinventory) {
|
public ContainerAnvil(int i, PlayerInventory playerinventory) {
|
||||||
this(i, playerinventory, ContainerAccess.NULL);
|
this(i, playerinventory, ContainerAccess.NULL);
|
||||||
@@ -85,7 +93,6 @@
|
@@ -106,7 +114,7 @@
|
||||||
if (iblockdata1 == null) {
|
|
||||||
world.a(blockposition, false);
|
|
||||||
world.triggerEffect(1029, blockposition, 0);
|
|
||||||
- entityhuman.getInventory().f(itemstack);
|
|
||||||
} else {
|
|
||||||
world.setTypeAndData(blockposition, iblockdata1, 2);
|
|
||||||
world.triggerEffect(1030, blockposition, 0);
|
|
||||||
@@ -107,7 +114,7 @@
|
|
||||||
byte b1 = 0;
|
byte b1 = 0;
|
||||||
|
|
||||||
if (itemstack.isEmpty()) {
|
if (itemstack.isEmpty()) {
|
||||||
@ -39,7 +31,7 @@
|
|||||||
this.cost.set(0);
|
this.cost.set(0);
|
||||||
} else {
|
} else {
|
||||||
ItemStack itemstack1 = itemstack.cloneItemStack();
|
ItemStack itemstack1 = itemstack.cloneItemStack();
|
||||||
@@ -125,7 +132,7 @@
|
@@ -124,7 +132,7 @@
|
||||||
if (itemstack1.f() && itemstack1.getItem().a(itemstack, itemstack2)) {
|
if (itemstack1.f() && itemstack1.getItem().a(itemstack, itemstack2)) {
|
||||||
k = Math.min(itemstack1.getDamage(), itemstack1.i() / 4);
|
k = Math.min(itemstack1.getDamage(), itemstack1.i() / 4);
|
||||||
if (k <= 0) {
|
if (k <= 0) {
|
||||||
@ -48,7 +40,7 @@
|
|||||||
this.cost.set(0);
|
this.cost.set(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -140,7 +147,7 @@
|
@@ -139,7 +147,7 @@
|
||||||
this.repairItemCountCost = i1;
|
this.repairItemCountCost = i1;
|
||||||
} else {
|
} else {
|
||||||
if (!flag && (!itemstack1.a(itemstack2.getItem()) || !itemstack1.f())) {
|
if (!flag && (!itemstack1.a(itemstack2.getItem()) || !itemstack1.f())) {
|
||||||
@ -57,7 +49,7 @@
|
|||||||
this.cost.set(0);
|
this.cost.set(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -230,7 +237,7 @@
|
@@ -229,7 +237,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag2 && !flag1) {
|
if (flag2 && !flag1) {
|
||||||
@ -66,7 +58,7 @@
|
|||||||
this.cost.set(0);
|
this.cost.set(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -254,11 +261,11 @@
|
@@ -253,11 +261,11 @@
|
||||||
itemstack1 = ItemStack.EMPTY;
|
itemstack1 = ItemStack.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +73,7 @@
|
|||||||
itemstack1 = ItemStack.EMPTY;
|
itemstack1 = ItemStack.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -277,7 +284,7 @@
|
@@ -276,7 +284,7 @@
|
||||||
EnchantmentManager.a(map, itemstack1);
|
EnchantmentManager.a(map, itemstack1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +82,8 @@
|
|||||||
this.d();
|
this.d();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -304,4 +311,18 @@
|
@@ -303,4 +311,18 @@
|
||||||
public int j() {
|
public int m() {
|
||||||
return this.cost.get();
|
return this.cost.get();
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
|
@ -66,7 +66,7 @@
|
|||||||
+ player = (Player) playerinventory.player.getBukkitEntity(); // CraftBukkit
|
+ player = (Player) playerinventory.player.getBukkitEntity(); // CraftBukkit
|
||||||
}
|
}
|
||||||
|
|
||||||
public int i() {
|
public int l() {
|
||||||
@@ -124,6 +161,7 @@
|
@@ -124,6 +161,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
@@ -154,7 +170,7 @@
|
@@ -154,7 +170,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
private void o() {
|
private void r() {
|
||||||
- if (!this.trader.getWorld().isClientSide) {
|
- if (!this.trader.getWorld().isClientSide) {
|
||||||
+ if (!this.trader.getWorld().isClientSide && this.trader instanceof Entity) { // CraftBukkit - SPIGOT-5035
|
+ if (!this.trader.getWorld().isClientSide && this.trader instanceof Entity) { // CraftBukkit - SPIGOT-5035
|
||||||
Entity entity = (Entity) this.trader;
|
Entity entity = (Entity) this.trader;
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
int i;
|
int i;
|
||||||
@@ -242,4 +261,17 @@
|
@@ -242,4 +261,17 @@
|
||||||
public boolean d(int i) {
|
public boolean d(int i) {
|
||||||
return i != this.j();
|
return i != this.m();
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
+ player = (Player) playerinventory.player.getBukkitEntity(); // CraftBukkit
|
+ player = (Player) playerinventory.player.getBukkitEntity(); // CraftBukkit
|
||||||
}
|
}
|
||||||
|
|
||||||
public int i() {
|
public int l() {
|
||||||
@@ -120,6 +150,7 @@
|
@@ -120,6 +150,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
@@ -202,4 +216,17 @@
|
@@ -202,4 +216,17 @@
|
||||||
public boolean d(int i) {
|
public boolean d(int i) {
|
||||||
return i != this.j();
|
return i != this.m();
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
decimalformat.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ROOT));
|
decimalformat.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ROOT));
|
||||||
});
|
});
|
||||||
public static final String TAG_ENCH = "Enchantments";
|
public static final String TAG_ENCH = "Enchantments";
|
||||||
@@ -142,16 +175,30 @@
|
@@ -140,16 +173,30 @@
|
||||||
this.checkEmpty();
|
this.checkEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,7 +82,7 @@
|
|||||||
this.getItem().b(this.tag);
|
this.getItem().b(this.tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,6 +206,11 @@
|
@@ -157,6 +204,11 @@
|
||||||
this.setDamage(this.getDamage());
|
this.setDamage(this.getDamage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,7 +94,7 @@
|
|||||||
this.checkEmpty();
|
this.checkEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,7 +248,7 @@
|
@@ -194,7 +246,7 @@
|
||||||
return this.getItem() == item;
|
return this.getItem() == item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +103,7 @@
|
|||||||
EntityHuman entityhuman = itemactioncontext.getEntity();
|
EntityHuman entityhuman = itemactioncontext.getEntity();
|
||||||
BlockPosition blockposition = itemactioncontext.getClickPosition();
|
BlockPosition blockposition = itemactioncontext.getClickPosition();
|
||||||
ShapeDetectorBlock shapedetectorblock = new ShapeDetectorBlock(itemactioncontext.getWorld(), blockposition, false);
|
ShapeDetectorBlock shapedetectorblock = new ShapeDetectorBlock(itemactioncontext.getWorld(), blockposition, false);
|
||||||
@@ -204,12 +256,155 @@
|
@@ -202,12 +254,155 @@
|
||||||
if (entityhuman != null && !entityhuman.getAbilities().mayBuild && !this.b(itemactioncontext.getWorld().r(), shapedetectorblock)) {
|
if (entityhuman != null && !entityhuman.getAbilities().mayBuild && !this.b(itemactioncontext.getWorld().r(), shapedetectorblock)) {
|
||||||
return EnumInteractionResult.PASS;
|
return EnumInteractionResult.PASS;
|
||||||
} else {
|
} else {
|
||||||
@ -260,7 +260,7 @@
|
|||||||
|
|
||||||
return enuminteractionresult;
|
return enuminteractionresult;
|
||||||
}
|
}
|
||||||
@@ -290,6 +485,21 @@
|
@@ -288,6 +483,21 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
i -= k;
|
i -= k;
|
||||||
@ -282,7 +282,7 @@
|
|||||||
if (i <= 0) {
|
if (i <= 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -311,6 +521,11 @@
|
@@ -309,6 +519,11 @@
|
||||||
if (this.isDamaged(i, t0.getRandom(), t0 instanceof EntityPlayer ? (EntityPlayer) t0 : null)) {
|
if (this.isDamaged(i, t0.getRandom(), t0 instanceof EntityPlayer ? (EntityPlayer) t0 : null)) {
|
||||||
consumer.accept(t0);
|
consumer.accept(t0);
|
||||||
Item item = this.getItem();
|
Item item = this.getItem();
|
||||||
@ -294,7 +294,7 @@
|
|||||||
|
|
||||||
this.subtract(1);
|
this.subtract(1);
|
||||||
if (t0 instanceof EntityHuman) {
|
if (t0 instanceof EntityHuman) {
|
||||||
@@ -466,6 +681,17 @@
|
@@ -464,6 +679,17 @@
|
||||||
return this.tag;
|
return this.tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,7 +312,7 @@
|
|||||||
public NBTTagCompound getOrCreateTag() {
|
public NBTTagCompound getOrCreateTag() {
|
||||||
if (this.tag == null) {
|
if (this.tag == null) {
|
||||||
this.setTag(new NBTTagCompound());
|
this.setTag(new NBTTagCompound());
|
||||||
@@ -849,6 +1075,12 @@
|
@@ -844,6 +1070,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRepairCost(int i) {
|
public void setRepairCost(int i) {
|
||||||
@ -325,7 +325,7 @@
|
|||||||
this.getOrCreateTag().setInt("RepairCost", i);
|
this.getOrCreateTag().setInt("RepairCost", i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -898,6 +1130,13 @@
|
@@ -893,6 +1125,13 @@
|
||||||
nbttaglist.add(nbttagcompound);
|
nbttaglist.add(nbttagcompound);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
public class ItemWorldMap extends ItemWorldMapBase {
|
public class ItemWorldMap extends ItemWorldMapBase {
|
||||||
|
|
||||||
public static final int IMAGE_WIDTH = 128;
|
public static final int IMAGE_WIDTH = 128;
|
||||||
@@ -68,14 +73,18 @@
|
@@ -68,7 +73,7 @@
|
||||||
public static Integer d(ItemStack itemstack) {
|
public static Integer d(ItemStack itemstack) {
|
||||||
NBTTagCompound nbttagcompound = itemstack.getTag();
|
NBTTagCompound nbttagcompound = itemstack.getTag();
|
||||||
|
|
||||||
@ -20,9 +20,8 @@
|
|||||||
+ return nbttagcompound != null && nbttagcompound.hasKeyOfType("map", 99) ? nbttagcompound.getInt("map") : -1; // CraftBukkit - make new maps for no tag
|
+ return nbttagcompound != null && nbttagcompound.hasKeyOfType("map", 99) ? nbttagcompound.getInt("map") : -1; // CraftBukkit - make new maps for no tag
|
||||||
}
|
}
|
||||||
|
|
||||||
- private static int a(World world, int i, int j, int k, boolean flag, boolean flag1, ResourceKey<World> resourcekey) {
|
public static int createNewSavedData(World world, int i, int j, int k, boolean flag, boolean flag1, ResourceKey<World> resourcekey) {
|
||||||
+ public static int a(World world, int i, int j, int k, boolean flag, boolean flag1, ResourceKey<World> resourcekey) { // PAIL private -> public
|
@@ -76,6 +81,10 @@
|
||||||
WorldMap worldmap = WorldMap.a((double) i, (double) j, (byte) k, flag, flag1, resourcekey);
|
|
||||||
int l = world.getWorldMapCount();
|
int l = world.getWorldMapCount();
|
||||||
|
|
||||||
world.a(a(l), worldmap);
|
world.a(a(l), worldmap);
|
||||||
|
@ -86,7 +86,7 @@
|
|||||||
return iblockdata;
|
return iblockdata;
|
||||||
} else {
|
} else {
|
||||||
int j = i + 1;
|
int j = i + 1;
|
||||||
@@ -322,10 +349,11 @@
|
@@ -322,7 +349,8 @@
|
||||||
public IWorldInventory a(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
|
public IWorldInventory a(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
|
||||||
int i = (Integer) iblockdata.get(BlockComposter.LEVEL);
|
int i = (Integer) iblockdata.get(BlockComposter.LEVEL);
|
||||||
|
|
||||||
@ -95,11 +95,7 @@
|
|||||||
+ return (IWorldInventory) (i == 8 ? new BlockComposter.ContainerOutput(iblockdata, generatoraccess, blockposition, new ItemStack(Items.BONE_MEAL)) : (i < 7 ? new BlockComposter.ContainerInput(iblockdata, generatoraccess, blockposition) : new BlockComposter.ContainerEmpty(generatoraccess, blockposition)));
|
+ return (IWorldInventory) (i == 8 ? new BlockComposter.ContainerOutput(iblockdata, generatoraccess, blockposition, new ItemStack(Items.BONE_MEAL)) : (i < 7 ? new BlockComposter.ContainerInput(iblockdata, generatoraccess, blockposition) : new BlockComposter.ContainerEmpty(generatoraccess, blockposition)));
|
||||||
}
|
}
|
||||||
|
|
||||||
- private static class ContainerOutput extends InventorySubcontainer implements IWorldInventory {
|
public static class ContainerOutput extends InventorySubcontainer implements IWorldInventory {
|
||||||
+ public static class ContainerOutput extends InventorySubcontainer implements IWorldInventory {
|
|
||||||
|
|
||||||
private final IBlockData state;
|
|
||||||
private final GeneratorAccess level;
|
|
||||||
@@ -337,6 +365,7 @@
|
@@ -337,6 +365,7 @@
|
||||||
this.state = iblockdata;
|
this.state = iblockdata;
|
||||||
this.level = generatoraccess;
|
this.level = generatoraccess;
|
||||||
@ -108,7 +104,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -361,12 +390,19 @@
|
@@ -361,8 +390,15 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
@ -126,11 +122,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- private static class ContainerInput extends InventorySubcontainer implements IWorldInventory {
|
|
||||||
+ public static class ContainerInput extends InventorySubcontainer implements IWorldInventory {
|
|
||||||
|
|
||||||
private final IBlockData state;
|
|
||||||
private final GeneratorAccess level;
|
|
||||||
@@ -375,6 +411,7 @@
|
@@ -375,6 +411,7 @@
|
||||||
|
|
||||||
public ContainerInput(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
|
public ContainerInput(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
|
||||||
@ -139,12 +130,9 @@
|
|||||||
this.state = iblockdata;
|
this.state = iblockdata;
|
||||||
this.level = generatoraccess;
|
this.level = generatoraccess;
|
||||||
this.pos = blockposition;
|
this.pos = blockposition;
|
||||||
@@ -415,10 +452,11 @@
|
@@ -417,8 +454,9 @@
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- private static class ContainerEmpty extends InventorySubcontainer implements IWorldInventory {
|
public static class ContainerEmpty extends InventorySubcontainer implements IWorldInventory {
|
||||||
+ public static class ContainerEmpty extends InventorySubcontainer implements IWorldInventory {
|
|
||||||
|
|
||||||
- public ContainerEmpty() {
|
- public ContainerEmpty() {
|
||||||
+ public ContainerEmpty(GeneratorAccess generatoraccess, BlockPosition blockposition) { // CraftBukkit
|
+ public ContainerEmpty(GeneratorAccess generatoraccess, BlockPosition blockposition) { // CraftBukkit
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/level/block/BlockTallPlant.java
|
--- a/net/minecraft/world/level/block/BlockTallPlant.java
|
||||||
+++ b/net/minecraft/world/level/block/BlockTallPlant.java
|
+++ b/net/minecraft/world/level/block/BlockTallPlant.java
|
||||||
@@ -84,6 +84,11 @@
|
@@ -92,6 +92,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static void b(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) {
|
protected static void b(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) {
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
+
|
+
|
||||||
@Override
|
@Override
|
||||||
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, BiomeBase.Precipitation biomebase_precipitation) {
|
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, BiomeBase.Precipitation biomebase_precipitation) {
|
||||||
if (BlockCauldron.a(world) && (Integer) iblockdata.get(LayeredCauldronBlock.LEVEL) != 3 && this.fillPredicate.test(biomebase_precipitation)) {
|
if (BlockCauldron.a(world, biomebase_precipitation) && (Integer) iblockdata.get(LayeredCauldronBlock.LEVEL) != 3 && this.fillPredicate.test(biomebase_precipitation)) {
|
||||||
- world.setTypeUpdate(blockposition, (IBlockData) iblockdata.a((IBlockState) LayeredCauldronBlock.LEVEL));
|
- world.setTypeUpdate(blockposition, (IBlockData) iblockdata.a((IBlockState) LayeredCauldronBlock.LEVEL));
|
||||||
+ changeLevel(iblockdata, world, blockposition, (IBlockData) iblockdata.a((IBlockState) LayeredCauldronBlock.LEVEL), null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit
|
+ changeLevel(iblockdata, world, blockposition, (IBlockData) iblockdata.a((IBlockState) LayeredCauldronBlock.LEVEL), null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit
|
||||||
}
|
}
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
--- a/net/minecraft/world/level/block/entity/TileEntitySkull.java
|
|
||||||
+++ b/net/minecraft/world/level/block/entity/TileEntitySkull.java
|
|
||||||
@@ -1,3 +1,4 @@
|
|
||||||
+// mc-dev import
|
|
||||||
package net.minecraft.world.level.block.entity;
|
|
||||||
|
|
||||||
import com.google.common.collect.Iterables;
|
|
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/world/level/storage/Convertable.java
|
--- a/net/minecraft/world/level/storage/Convertable.java
|
||||||
+++ b/net/minecraft/world/level/storage/Convertable.java
|
+++ b/net/minecraft/world/level/storage/Convertable.java
|
||||||
@@ -60,6 +60,10 @@
|
@@ -61,6 +61,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;
|
||||||
|
|
||||||
@ -11,7 +11,7 @@
|
|||||||
public class Convertable {
|
public class Convertable {
|
||||||
|
|
||||||
static final Logger LOGGER = LogManager.getLogger();
|
static final Logger LOGGER = LogManager.getLogger();
|
||||||
@@ -105,26 +109,26 @@
|
@@ -106,26 +110,26 @@
|
||||||
Logger logger = Convertable.LOGGER;
|
Logger logger = Convertable.LOGGER;
|
||||||
|
|
||||||
Objects.requireNonNull(logger);
|
Objects.requireNonNull(logger);
|
||||||
@ -42,7 +42,7 @@
|
|||||||
return new IllegalStateException("Failed to get noise settings registry");
|
return new IllegalStateException("Failed to get noise settings registry");
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -294,9 +298,23 @@
|
@@ -302,9 +306,23 @@
|
||||||
return this.backupDir;
|
return this.backupDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,7 +68,7 @@
|
|||||||
|
|
||||||
public class ConversionSession implements AutoCloseable {
|
public class ConversionSession implements AutoCloseable {
|
||||||
|
|
||||||
@@ -304,8 +322,12 @@
|
@@ -312,8 +330,12 @@
|
||||||
public final Path levelPath;
|
public final Path levelPath;
|
||||||
private final String levelId;
|
private final String levelId;
|
||||||
private final Map<SavedFile, Path> resources = Maps.newHashMap();
|
private final Map<SavedFile, Path> resources = Maps.newHashMap();
|
||||||
@ -82,7 +82,7 @@
|
|||||||
this.levelId = s;
|
this.levelId = s;
|
||||||
this.levelPath = Convertable.this.baseDir.resolve(s);
|
this.levelPath = Convertable.this.baseDir.resolve(s);
|
||||||
this.lock = SessionLock.a(this.levelPath);
|
this.lock = SessionLock.a(this.levelPath);
|
||||||
@@ -322,7 +344,7 @@
|
@@ -330,7 +352,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public File a(ResourceKey<World> resourcekey) {
|
public File a(ResourceKey<World> resourcekey) {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>craftbukkit</artifactId>
|
<artifactId>craftbukkit</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>1.17-R0.1-SNAPSHOT</version>
|
<version>1.17.1-R0.1-SNAPSHOT</version>
|
||||||
<name>CraftBukkit</name>
|
<name>CraftBukkit</name>
|
||||||
<url>https://www.spigotmc.org/</url>
|
<url>https://www.spigotmc.org/</url>
|
||||||
|
|
||||||
|
@ -104,6 +104,6 @@ public class CraftProfileBanList implements org.bukkit.BanList {
|
|||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
return (uuid != null) ? MinecraftServer.getServer().getUserCache().getProfile(uuid) : MinecraftServer.getServer().getUserCache().getProfile(target);
|
return ((uuid != null) ? MinecraftServer.getServer().getUserCache().getProfile(uuid) : MinecraftServer.getServer().getUserCache().getProfile(target)).orElse(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1051,7 +1051,7 @@ public final class CraftServer implements Server {
|
|||||||
console.levels.put(internal.getDimensionKey(), internal);
|
console.levels.put(internal.getDimensionKey(), internal);
|
||||||
|
|
||||||
getServer().loadSpawn(internal.getChunkProvider().chunkMap.progressListener, internal);
|
getServer().loadSpawn(internal.getChunkProvider().chunkMap.progressListener, internal);
|
||||||
internal.entityManager.a(); // SPIGOT-6526: Load pending entities so they are available to the API
|
internal.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API
|
||||||
|
|
||||||
pluginManager.callEvent(new WorldLoadEvent(internal.getWorld()));
|
pluginManager.callEvent(new WorldLoadEvent(internal.getWorld()));
|
||||||
return internal.getWorld();
|
return internal.getWorld();
|
||||||
@ -1362,7 +1362,7 @@ public final class CraftServer implements Server {
|
|||||||
|
|
||||||
net.minecraft.world.level.World minecraftWorld = ((CraftWorld) world).getHandle();
|
net.minecraft.world.level.World minecraftWorld = ((CraftWorld) world).getHandle();
|
||||||
// creates a new map at world spawn with the scale of 3, with out tracking position and unlimited tracking
|
// creates a new map at world spawn with the scale of 3, with out tracking position and unlimited tracking
|
||||||
int newId = ItemWorldMap.a(minecraftWorld, minecraftWorld.getWorldData().a(), minecraftWorld.getWorldData().c(), 3, false, false, minecraftWorld.getDimensionKey());
|
int newId = ItemWorldMap.createNewSavedData(minecraftWorld, minecraftWorld.getWorldData().a(), minecraftWorld.getWorldData().c(), 3, false, false, minecraftWorld.getDimensionKey());
|
||||||
return minecraftWorld.a(ItemWorldMap.a(newId)).mapView;
|
return minecraftWorld.a(ItemWorldMap.a(newId)).mapView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1429,7 +1429,7 @@ public final class CraftServer implements Server {
|
|||||||
OfflinePlayer result = getPlayerExact(name);
|
OfflinePlayer result = getPlayerExact(name);
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
// This is potentially blocking :(
|
// This is potentially blocking :(
|
||||||
GameProfile profile = console.getUserCache().getProfile(name);
|
GameProfile profile = console.getUserCache().getProfile(name).orElse(null);
|
||||||
if (profile == null) {
|
if (profile == null) {
|
||||||
// Make an OfflinePlayer using an offline mode UUID since the name has no profile
|
// Make an OfflinePlayer using an offline mode UUID since the name has no profile
|
||||||
result = getOfflinePlayer(new GameProfile(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)), name));
|
result = getOfflinePlayer(new GameProfile(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)), name));
|
||||||
@ -1520,12 +1520,12 @@ public final class CraftServer implements Server {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isWhitelistEnforced() {
|
public boolean isWhitelistEnforced() {
|
||||||
return console.aN();
|
return console.isEnforceWhitelist();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setWhitelistEnforced(boolean value) {
|
public void setWhitelistEnforced(boolean value) {
|
||||||
console.h(value);
|
console.setEnforceWhitelist(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -181,7 +181,7 @@ public class Main {
|
|||||||
useConsole = false;
|
useConsole = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
|
if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
|
||||||
Date buildDate = new Date(Integer.parseInt(Main.class.getPackage().getImplementationVendor()) * 1000L);
|
Date buildDate = new Date(Integer.parseInt(Main.class.getPackage().getImplementationVendor()) * 1000L);
|
||||||
|
|
||||||
Calendar deadline = Calendar.getInstance();
|
Calendar deadline = Calendar.getInstance();
|
||||||
|
@ -70,7 +70,7 @@ public class CraftSkull extends CraftBlockEntityState<TileEntitySkull> implement
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
GameProfile profile = MinecraftServer.getServer().getUserCache().getProfile(name);
|
GameProfile profile = MinecraftServer.getServer().getUserCache().getProfile(name).orElse(null);
|
||||||
if (profile == null) {
|
if (profile == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ public class CraftAnimals extends CraftAgeable implements Animals {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBreedItem(ItemStack itemStack) {
|
public boolean isBreedItem(ItemStack itemStack) {
|
||||||
return getHandle().n(CraftItemStack.asNMSCopy(itemStack));
|
return getHandle().isBreedItem(CraftItemStack.asNMSCopy(itemStack));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -580,7 +580,8 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean dropItem(boolean dropAll) {
|
public boolean dropItem(boolean dropAll) {
|
||||||
return getHandle().dropItem(dropAll);
|
if (!(getHandle() instanceof EntityPlayer)) return false;
|
||||||
|
return ((EntityPlayer) getHandle()).dropItem(dropAll);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -110,7 +110,7 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i
|
|||||||
} else if (index > 35) {
|
} else if (index > 35) {
|
||||||
index = 8 - (index - 36);
|
index = 8 - (index - 36);
|
||||||
}
|
}
|
||||||
player.connection.sendPacket(new PacketPlayOutSetSlot(player.inventoryMenu.containerId, index, CraftItemStack.asNMSCopy(item)));
|
player.connection.sendPacket(new PacketPlayOutSetSlot(player.inventoryMenu.containerId, player.inventoryMenu.incrementStateId(), index, CraftItemStack.asNMSCopy(item)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -224,7 +224,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
|||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public String getMappingsVersion() {
|
public String getMappingsVersion() {
|
||||||
return "acd6e6c27e5a0a9440afba70a96c27c9";
|
return "f0e3dfc7390de285a4693518dd5bd126";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -18,7 +18,7 @@ public final class CraftVoxelShape implements org.bukkit.util.VoxelShape {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<BoundingBox> getBoundingBoxes() {
|
public Collection<BoundingBox> getBoundingBoxes() {
|
||||||
List<AxisAlignedBB> boxes = shape.d(); // PAIL rename toList
|
List<AxisAlignedBB> boxes = shape.toList();
|
||||||
List<BoundingBox> craftBoxes = new ArrayList<>(boxes.size());
|
List<BoundingBox> craftBoxes = new ArrayList<>(boxes.size());
|
||||||
for (AxisAlignedBB aabb : boxes) {
|
for (AxisAlignedBB aabb : boxes) {
|
||||||
craftBoxes.add(new BoundingBox(aabb.minX, aabb.minY, aabb.minZ, aabb.maxX, aabb.maxY, aabb.maxZ));
|
craftBoxes.add(new BoundingBox(aabb.minX, aabb.minY, aabb.minZ, aabb.maxX, aabb.maxY, aabb.maxZ));
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren