13
0

Multiple bugfixes

Dieser Commit ist enthalten in:
Lixfel 2020-11-02 12:32:06 +01:00
Ursprung 18dc4754cf
Commit 7d25736236
2 geänderte Dateien mit 13 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -56,6 +56,14 @@ public class RPlayer extends REntity {
connection.sendPacket(new PacketPlayOutEntityEquipment(entity.getId(), EnumItemSlot.FEET, ((EntityPlayer) entity).inventory.armor.get(3)));
}
@Override
public void remove(){
PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, (EntityPlayer) entity);
for(Player player : Bukkit.getOnlinePlayers())
((CraftPlayer)player).getHandle().playerConnection.sendPacket(packet);
super.remove();
}
private static EntityPlayer createPlayer(UUID uuid, String name){
MinecraftServer nmsServer = ((CraftServer) Bukkit.getServer()).getServer();
GameProfile gameProfile = new GameProfile(uuid, name); // Change "playername" to the name the NPC should have, max 16 characters.

Datei anzeigen

@ -37,9 +37,10 @@ public class WorldLoader {
private static final World world = Bukkit.getWorlds().get(0);
public static void configureForceLoad(){
for(int cX = Config.ArenaMinX / 16; cX <= Config.ArenaMaxX / 16; cX++){
for(int cZ = Config.ArenaMinZ / 16; cZ <= Config.ArenaMaxZ / 16; cZ++){
for(int cX = (int) Math.floor(Config.ArenaMinX / 16.0); cX <= (int) Math.floor(Config.ArenaMaxX / 16.0); cX++){
for(int cZ = (int) Math.floor(Config.ArenaMinZ / 16.0); cZ <= (int) Math.floor(Config.ArenaMaxZ / 16.0); cZ++){
world.setChunkForceLoaded(cX, cZ, true);
world.loadChunk(cX, cZ, false);
}
}
}
@ -50,8 +51,8 @@ public class WorldLoader {
World backupWorld = new WorldCreator(world.getName() + "-backup").createWorld();
int delay = 0;
for(int cX = Config.ArenaMinX / 16; cX <= Config.ArenaMaxX / 16; cX++){
for(int cZ = Config.ArenaMinZ / 16; cZ <= Config.ArenaMaxZ / 16; cZ++){
for(int cX = (int) Math.floor(Config.ArenaMinX / 16.0); cX <= (int) Math.floor(Config.ArenaMaxX / 16.0); cX++){
for(int cZ = (int) Math.floor(Config.ArenaMinZ / 16.0); cZ <= (int) Math.floor(Config.ArenaMaxZ / 16.0); cZ++){
int finalCX = cX;
int finalCZ = cZ;
Bukkit.getScheduler().runTaskLater(SpectateSystem.get(), () -> reloadChunk(backupWorld, finalCX, finalCZ), delay++);