Fix usage of deprecated api #322
@ -19,10 +19,8 @@
|
||||
|
||||
package de.steamwar.fightsystem.utils;
|
||||
|
||||
import de.steamwar.core.events.ChunkListener;
|
||||
import de.steamwar.fightsystem.fight.FightWorld;
|
||||
import net.minecraft.server.v1_10_R1.Chunk;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_10_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_10_R1.entity.CraftEntity;
|
||||
@ -50,9 +48,6 @@ public class CraftbukkitWrapper10 implements CraftbukkitWrapper.ICraftbukkitWrap
|
||||
}
|
||||
chunk.tileEntities.clear();
|
||||
chunk.tileEntities.putAll(backupChunk.tileEntities);
|
||||
for(Player p : Bukkit.getOnlinePlayers()){
|
||||
ChunkListener.sendChunk(p, x, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,10 +19,8 @@
|
||||
|
||||
package de.steamwar.fightsystem.utils;
|
||||
|
||||
import de.steamwar.core.events.ChunkListener;
|
||||
import de.steamwar.fightsystem.fight.FightWorld;
|
||||
import net.minecraft.server.v1_12_R1.Chunk;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_12_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftEntity;
|
||||
@ -50,9 +48,6 @@ public class CraftbukkitWrapper12 implements CraftbukkitWrapper.ICraftbukkitWrap
|
||||
}
|
||||
chunk.tileEntities.clear();
|
||||
chunk.tileEntities.putAll(backupChunk.tileEntities);
|
||||
for(Player p : Bukkit.getOnlinePlayers()){
|
||||
ChunkListener.sendChunk(p, x, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,10 +19,8 @@
|
||||
|
||||
package de.steamwar.fightsystem.utils;
|
||||
|
||||
import de.steamwar.core.events.ChunkListener;
|
||||
import de.steamwar.fightsystem.fight.FightWorld;
|
||||
import net.minecraft.server.v1_14_R1.Chunk;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_14_R1.CraftWorld;
|
||||
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.heightMap.clear();
|
||||
chunk.heightMap.putAll(backupChunk.heightMap);
|
||||
for(Player p : Bukkit.getOnlinePlayers()){
|
||||
ChunkListener.sendChunk(p, x, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,10 +19,8 @@
|
||||
|
||||
package de.steamwar.fightsystem.utils;
|
||||
|
||||
import de.steamwar.core.events.ChunkListener;
|
||||
import de.steamwar.fightsystem.fight.FightWorld;
|
||||
import net.minecraft.server.v1_15_R1.Chunk;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_15_R1.CraftWorld;
|
||||
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.heightMap.clear();
|
||||
chunk.heightMap.putAll(backupChunk.heightMap);
|
||||
for(Player p : Bukkit.getOnlinePlayers()){
|
||||
ChunkListener.sendChunk(p, x, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,9 +19,7 @@
|
||||
|
||||
package de.steamwar.fightsystem.utils;
|
||||
|
||||
import de.steamwar.core.events.ChunkListener;
|
||||
import net.minecraft.server.v1_8_R3.Chunk;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
|
||||
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());
|
||||
chunk.tileEntities.clear();
|
||||
chunk.tileEntities.putAll(backupChunk.tileEntities);
|
||||
for(Player p : Bukkit.getOnlinePlayers()){
|
||||
ChunkListener.sendChunk(p, x, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,10 +19,8 @@
|
||||
|
||||
package de.steamwar.fightsystem.utils;
|
||||
|
||||
import de.steamwar.core.events.ChunkListener;
|
||||
import de.steamwar.fightsystem.fight.FightWorld;
|
||||
import net.minecraft.server.v1_9_R2.Chunk;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_9_R2.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_9_R2.entity.CraftEntity;
|
||||
@ -50,9 +48,6 @@ public class CraftbukkitWrapper9 implements CraftbukkitWrapper.ICraftbukkitWrapp
|
||||
}
|
||||
chunk.tileEntities.clear();
|
||||
chunk.tileEntities.putAll(backupChunk.tileEntities);
|
||||
for(Player p : Bukkit.getOnlinePlayers()){
|
||||
ChunkListener.sendChunk(p, x, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,6 +30,7 @@ import org.bukkit.World;
|
||||
import org.bukkit.WorldCreator;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class FightWorld extends StateDependent {
|
||||
|
||||
@ -72,7 +73,12 @@ public class FightWorld extends StateDependent {
|
||||
|
||||
World backup = new WorldCreator(world.getName() + "/backup").createWorld();
|
||||
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);
|
||||
}
|
||||
}
|
@ -22,8 +22,8 @@ package de.steamwar.fightsystem.utils;
|
||||
import com.comphenix.tinyprotocol.Reflection;
|
||||
import com.google.common.primitives.Bytes;
|
||||
import de.steamwar.core.Core;
|
||||
import de.steamwar.core.CraftbukkitWrapper;
|
||||
import de.steamwar.core.VersionDependent;
|
||||
import de.steamwar.core.events.ChunkListener;
|
||||
import de.steamwar.fightsystem.Config;
|
||||
import de.steamwar.fightsystem.FightSystem;
|
||||
import de.steamwar.fightsystem.fight.Fight;
|
||||
@ -234,7 +234,7 @@ public class TechHider extends StateDependent {
|
||||
Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), () -> {
|
||||
for(ChunkPos chunk : chunksToReload){
|
||||
if(bypass(p, chunk.x(), chunk.z()) != hide)
|
||||
ChunkListener.sendChunk(p, chunk.x(), chunk.z());
|
||||
CraftbukkitWrapper.impl.sendChunk(p, chunk.x(), chunk.z());
|
||||
}
|
||||
}, 40);
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren