Fixed errors on Spigot servers due to missing methods

This commit is contained in:
OmerBenGera 2023-11-24 20:58:52 +02:00
parent 9f65c62a0c
commit b5f80816c3

View File

@ -64,9 +64,13 @@ public final class ChunkLoaderNPCImpl extends ServerPlayer implements ChunkLoade
this.advancements = new DummyPlayerAdvancements(minecraftServer, this); this.advancements = new DummyPlayerAdvancements(minecraftServer, this);
SET_GAMEMODE.invoke(this.gameMode, GameType.CREATIVE, null); SET_GAMEMODE.invoke(this.gameMode, GameType.CREATIVE, null);
try {
setLoadViewDistance(2); setLoadViewDistance(2);
setTickViewDistance(2); setTickViewDistance(2);
setSendViewDistance(2); setSendViewDistance(2);
} catch (Throwable ignored) {
// Doesn't exist on Spigot
}
fauxSleeping = true; fauxSleeping = true;
@ -136,7 +140,7 @@ public final class ChunkLoaderNPCImpl extends ServerPlayer implements ChunkLoade
public class DummyServerGamePacketListenerImpl extends ServerGamePacketListenerImpl { public class DummyServerGamePacketListenerImpl extends ServerGamePacketListenerImpl {
DummyServerGamePacketListenerImpl(MinecraftServer minecraftServer, ServerPlayer serverPlayer) { DummyServerGamePacketListenerImpl(MinecraftServer minecraftServer, ServerPlayer serverPlayer) {
super(minecraftServer, new DummyConnection(), serverPlayer, CommonListenerCookie.createInitial(ChunkLoaderNPCImpl.this.gameProfile)); super(minecraftServer, new DummyConnection(), serverPlayer, CommonListenerCookie.createInitial(ChunkLoaderNPCImpl.this.getGameProfile()));
} }
@Override @Override