SteamWar/FightSystem
Archiviert
13
1

Fix usage of deprecated api #322

Zusammengeführt
Lixfel hat 1 Commits von deprecation nach master 2022-01-13 16:40:39 +01:00 zusammengeführt
8 geänderte Dateien mit 9 neuen und 33 gelöschten Zeilen
Nur Änderungen aus Commit 4635772b23 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -19,10 +19,8 @@
package de.steamwar.fightsystem.utils; package de.steamwar.fightsystem.utils;
import de.steamwar.core.events.ChunkListener;
import de.steamwar.fightsystem.fight.FightWorld; import de.steamwar.fightsystem.fight.FightWorld;
import net.minecraft.server.v1_10_R1.Chunk; import net.minecraft.server.v1_10_R1.Chunk;
import org.bukkit.Bukkit;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.craftbukkit.v1_10_R1.CraftWorld; import org.bukkit.craftbukkit.v1_10_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_10_R1.entity.CraftEntity; import org.bukkit.craftbukkit.v1_10_R1.entity.CraftEntity;
@ -50,9 +48,6 @@ public class CraftbukkitWrapper10 implements CraftbukkitWrapper.ICraftbukkitWrap
} }
chunk.tileEntities.clear(); chunk.tileEntities.clear();
chunk.tileEntities.putAll(backupChunk.tileEntities); chunk.tileEntities.putAll(backupChunk.tileEntities);
for(Player p : Bukkit.getOnlinePlayers()){
ChunkListener.sendChunk(p, x, z);
}
} }
@Override @Override

Datei anzeigen

@ -19,10 +19,8 @@
package de.steamwar.fightsystem.utils; package de.steamwar.fightsystem.utils;
import de.steamwar.core.events.ChunkListener;
import de.steamwar.fightsystem.fight.FightWorld; import de.steamwar.fightsystem.fight.FightWorld;
import net.minecraft.server.v1_12_R1.Chunk; import net.minecraft.server.v1_12_R1.Chunk;
import org.bukkit.Bukkit;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.craftbukkit.v1_12_R1.CraftWorld; import org.bukkit.craftbukkit.v1_12_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftEntity; import org.bukkit.craftbukkit.v1_12_R1.entity.CraftEntity;
@ -50,9 +48,6 @@ public class CraftbukkitWrapper12 implements CraftbukkitWrapper.ICraftbukkitWrap
} }
chunk.tileEntities.clear(); chunk.tileEntities.clear();
chunk.tileEntities.putAll(backupChunk.tileEntities); chunk.tileEntities.putAll(backupChunk.tileEntities);
for(Player p : Bukkit.getOnlinePlayers()){
ChunkListener.sendChunk(p, x, z);
}
} }
@Override @Override

Datei anzeigen

@ -19,10 +19,8 @@
package de.steamwar.fightsystem.utils; package de.steamwar.fightsystem.utils;
import de.steamwar.core.events.ChunkListener;
import de.steamwar.fightsystem.fight.FightWorld; import de.steamwar.fightsystem.fight.FightWorld;
import net.minecraft.server.v1_14_R1.Chunk; import net.minecraft.server.v1_14_R1.Chunk;
import org.bukkit.Bukkit;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.craftbukkit.v1_14_R1.CraftWorld; import org.bukkit.craftbukkit.v1_14_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity;
@ -51,9 +49,6 @@ public class CraftbukkitWrapper14 implements CraftbukkitWrapper.ICraftbukkitWrap
chunk.tileEntities.putAll(backupChunk.tileEntities); chunk.tileEntities.putAll(backupChunk.tileEntities);
chunk.heightMap.clear(); chunk.heightMap.clear();
chunk.heightMap.putAll(backupChunk.heightMap); chunk.heightMap.putAll(backupChunk.heightMap);
for(Player p : Bukkit.getOnlinePlayers()){
ChunkListener.sendChunk(p, x, z);
}
} }
@Override @Override

Datei anzeigen

@ -19,10 +19,8 @@
package de.steamwar.fightsystem.utils; package de.steamwar.fightsystem.utils;
import de.steamwar.core.events.ChunkListener;
import de.steamwar.fightsystem.fight.FightWorld; import de.steamwar.fightsystem.fight.FightWorld;
import net.minecraft.server.v1_15_R1.Chunk; import net.minecraft.server.v1_15_R1.Chunk;
import org.bukkit.Bukkit;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.craftbukkit.v1_15_R1.CraftWorld; import org.bukkit.craftbukkit.v1_15_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity; import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity;
@ -51,9 +49,6 @@ public class CraftbukkitWrapper15 implements CraftbukkitWrapper.ICraftbukkitWrap
chunk.tileEntities.putAll(backupChunk.tileEntities); chunk.tileEntities.putAll(backupChunk.tileEntities);
chunk.heightMap.clear(); chunk.heightMap.clear();
chunk.heightMap.putAll(backupChunk.heightMap); chunk.heightMap.putAll(backupChunk.heightMap);
for(Player p : Bukkit.getOnlinePlayers()){
ChunkListener.sendChunk(p, x, z);
}
} }
@Override @Override

Datei anzeigen

@ -19,9 +19,7 @@
package de.steamwar.fightsystem.utils; package de.steamwar.fightsystem.utils;
import de.steamwar.core.events.ChunkListener;
import net.minecraft.server.v1_8_R3.Chunk; import net.minecraft.server.v1_8_R3.Chunk;
import org.bukkit.Bukkit;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld; import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
@ -47,9 +45,6 @@ public class CraftbukkitWrapper8 implements CraftbukkitWrapper.ICraftbukkitWrapp
w.tileEntityList.removeAll(chunk.tileEntities.values()); w.tileEntityList.removeAll(chunk.tileEntities.values());
chunk.tileEntities.clear(); chunk.tileEntities.clear();
chunk.tileEntities.putAll(backupChunk.tileEntities); chunk.tileEntities.putAll(backupChunk.tileEntities);
for(Player p : Bukkit.getOnlinePlayers()){
ChunkListener.sendChunk(p, x, z);
}
} }
@Override @Override

Datei anzeigen

@ -19,10 +19,8 @@
package de.steamwar.fightsystem.utils; package de.steamwar.fightsystem.utils;
import de.steamwar.core.events.ChunkListener;
import de.steamwar.fightsystem.fight.FightWorld; import de.steamwar.fightsystem.fight.FightWorld;
import net.minecraft.server.v1_9_R2.Chunk; import net.minecraft.server.v1_9_R2.Chunk;
import org.bukkit.Bukkit;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.craftbukkit.v1_9_R2.CraftWorld; import org.bukkit.craftbukkit.v1_9_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_9_R2.entity.CraftEntity; import org.bukkit.craftbukkit.v1_9_R2.entity.CraftEntity;
@ -50,9 +48,6 @@ public class CraftbukkitWrapper9 implements CraftbukkitWrapper.ICraftbukkitWrapp
} }
chunk.tileEntities.clear(); chunk.tileEntities.clear();
chunk.tileEntities.putAll(backupChunk.tileEntities); chunk.tileEntities.putAll(backupChunk.tileEntities);
for(Player p : Bukkit.getOnlinePlayers()){
ChunkListener.sendChunk(p, x, z);
}
} }
@Override @Override

Datei anzeigen

@ -30,6 +30,7 @@ import org.bukkit.World;
import org.bukkit.WorldCreator; import org.bukkit.WorldCreator;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
public class FightWorld extends StateDependent { public class FightWorld extends StateDependent {
@ -72,7 +73,12 @@ public class FightWorld extends StateDependent {
World backup = new WorldCreator(world.getName() + "/backup").createWorld(); World backup = new WorldCreator(world.getName() + "/backup").createWorld();
assert backup != null; assert backup != null;
Config.ArenaRegion.forEachChunk((x, z) -> CraftbukkitWrapper.impl.resetChunk(world, backup, x, z)); Config.ArenaRegion.forEachChunk((x, z) -> {
CraftbukkitWrapper.impl.resetChunk(world, backup, x, z);
for(Player p : Bukkit.getOnlinePlayers()) {
de.steamwar.core.CraftbukkitWrapper.impl.sendChunk(p, x, z);
}
});
Bukkit.unloadWorld(backup, false); Bukkit.unloadWorld(backup, false);
} }
} }

Datei anzeigen

@ -22,8 +22,8 @@ package de.steamwar.fightsystem.utils;
import com.comphenix.tinyprotocol.Reflection; import com.comphenix.tinyprotocol.Reflection;
import com.google.common.primitives.Bytes; import com.google.common.primitives.Bytes;
import de.steamwar.core.Core; import de.steamwar.core.Core;
import de.steamwar.core.CraftbukkitWrapper;
import de.steamwar.core.VersionDependent; import de.steamwar.core.VersionDependent;
import de.steamwar.core.events.ChunkListener;
import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.Config;
import de.steamwar.fightsystem.FightSystem; import de.steamwar.fightsystem.FightSystem;
import de.steamwar.fightsystem.fight.Fight; import de.steamwar.fightsystem.fight.Fight;
@ -234,7 +234,7 @@ public class TechHider extends StateDependent {
Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), () -> { Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), () -> {
for(ChunkPos chunk : chunksToReload){ for(ChunkPos chunk : chunksToReload){
if(bypass(p, chunk.x(), chunk.z()) != hide) if(bypass(p, chunk.x(), chunk.z()) != hide)
ChunkListener.sendChunk(p, chunk.x(), chunk.z()); CraftbukkitWrapper.impl.sendChunk(p, chunk.x(), chunk.z());
} }
}, 40); }, 40);
} }