Rollback to the state of .152 build with some critical fixes and updates
This commit is contained in:
@@ -263,7 +263,6 @@ public final class CraftServer implements Server {
|
||||
waterAnimalSpawn = configuration.getInt("spawn-limits.water-animals");
|
||||
ambientSpawn = configuration.getInt("spawn-limits.ambient");
|
||||
console.autosavePeriod = configuration.getInt("ticks-per.autosave");
|
||||
console.invalidateWorldSaver();
|
||||
warningState = WarningState.value(configuration.getString("settings.deprecated-verbose"));
|
||||
loadIcon();
|
||||
chunkGCEnabled = configuration.getBoolean("chunk-gc.enabled"); // Cauldron
|
||||
@@ -671,7 +670,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
@Override
|
||||
public List<World> getWorlds() {
|
||||
return ImmutableList.copyOf(worlds.values());
|
||||
return new ArrayList<World>(worlds.values());
|
||||
}
|
||||
|
||||
public DedicatedPlayerList getHandle() {
|
||||
@@ -765,7 +764,6 @@ public final class CraftServer implements Server {
|
||||
warningState = WarningState.value(configuration.getString("settings.deprecated-verbose"));
|
||||
printSaveWarning = false;
|
||||
console.autosavePeriod = configuration.getInt("ticks-per.autosave");
|
||||
console.invalidateWorldSaver();
|
||||
chunkGCPeriod = configuration.getInt("chunk-gc.period-in-ticks");
|
||||
chunkGCLoadThresh = configuration.getInt("chunk-gc.load-threshold");
|
||||
loadIcon();
|
||||
@@ -1152,7 +1150,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
@Override
|
||||
public Map<String, String[]> getCommandAliases() {
|
||||
ConfigurationSection section = commandsConfiguration.getConfigurationSection("aliases");
|
||||
ConfigurationSection section = configuration.getConfigurationSection("aliases");
|
||||
Map<String, String[]> result = new LinkedHashMap<String, String[]>();
|
||||
|
||||
if (section != null) {
|
||||
|
||||
@@ -683,16 +683,16 @@ public class CraftWorld implements World {
|
||||
public List<Entity> getEntities() {
|
||||
List<Entity> list = new ArrayList<Entity>();
|
||||
|
||||
for (net.minecraft.entity.Entity mcEnt : world.loadedEntityList_KC) {
|
||||
//if (o instanceof net.minecraft.entity.Entity) {
|
||||
//net.minecraft.entity.Entity mcEnt = (net.minecraft.entity.Entity) o;
|
||||
for (Object o : world.loadedEntityList) {
|
||||
if (o instanceof net.minecraft.entity.Entity) {
|
||||
net.minecraft.entity.Entity mcEnt = (net.minecraft.entity.Entity) o;
|
||||
Entity bukkitEntity = mcEnt.getBukkitEntity();
|
||||
|
||||
// Assuming that bukkitEntity isn't null
|
||||
if (bukkitEntity != null) {
|
||||
list.add(bukkitEntity);
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
@@ -701,16 +701,16 @@ public class CraftWorld implements World {
|
||||
public List<LivingEntity> getLivingEntities() {
|
||||
List<LivingEntity> list = new ArrayList<LivingEntity>();
|
||||
|
||||
for (net.minecraft.entity.Entity mcEnt : world.loadedEntityList_KC) {
|
||||
//if (o instanceof net.minecraft.entity.Entity) {
|
||||
//net.minecraft.entity.Entity mcEnt = (net.minecraft.entity.Entity) o;
|
||||
for (Object o : world.loadedEntityList) {
|
||||
if (o instanceof net.minecraft.entity.Entity) {
|
||||
net.minecraft.entity.Entity mcEnt = (net.minecraft.entity.Entity) o;
|
||||
Entity bukkitEntity = mcEnt.getBukkitEntity();
|
||||
|
||||
// Assuming that bukkitEntity isn't null
|
||||
if (bukkitEntity != null && bukkitEntity instanceof LivingEntity) {
|
||||
list.add((LivingEntity) bukkitEntity);
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
@@ -726,9 +726,9 @@ public class CraftWorld implements World {
|
||||
public <T extends Entity> Collection<T> getEntitiesByClass(Class<T> clazz) {
|
||||
Collection<T> list = new ArrayList<T>();
|
||||
|
||||
for (net.minecraft.entity.Entity entity : world.loadedEntityList_KC) {
|
||||
//if (entity instanceof net.minecraft.entity.Entity) {
|
||||
Entity bukkitEntity = entity.getBukkitEntity();
|
||||
for (Object entity: world.loadedEntityList) {
|
||||
if (entity instanceof net.minecraft.entity.Entity) {
|
||||
Entity bukkitEntity = ((net.minecraft.entity.Entity) entity).getBukkitEntity();
|
||||
|
||||
if (bukkitEntity == null) {
|
||||
continue;
|
||||
@@ -739,7 +739,7 @@ public class CraftWorld implements World {
|
||||
if (clazz.isAssignableFrom(bukkitClass)) {
|
||||
list.add((T) bukkitEntity);
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
@@ -748,9 +748,9 @@ public class CraftWorld implements World {
|
||||
public Collection<Entity> getEntitiesByClasses(Class<?>... classes) {
|
||||
Collection<Entity> list = new ArrayList<Entity>();
|
||||
|
||||
for (net.minecraft.entity.Entity entity: world.loadedEntityList_KC) {
|
||||
//if (entity instanceof net.minecraft.entity.Entity) {
|
||||
Entity bukkitEntity = entity.getBukkitEntity();
|
||||
for (Object entity: world.loadedEntityList) {
|
||||
if (entity instanceof net.minecraft.entity.Entity) {
|
||||
Entity bukkitEntity = ((net.minecraft.entity.Entity) entity).getBukkitEntity();
|
||||
|
||||
if (bukkitEntity == null) {
|
||||
continue;
|
||||
@@ -764,7 +764,7 @@ public class CraftWorld implements World {
|
||||
break;
|
||||
}
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
@@ -773,15 +773,15 @@ public class CraftWorld implements World {
|
||||
public List<Player> getPlayers() {
|
||||
List<Player> list = new ArrayList<Player>();
|
||||
|
||||
for (net.minecraft.entity.Entity mcEnt : world.loadedEntityList_KC) {
|
||||
//if (o instanceof net.minecraft.entity.Entity) {
|
||||
//net.minecraft.entity.Entity mcEnt = (net.minecraft.entity.Entity) o;
|
||||
for (Object o : world.loadedEntityList) {
|
||||
if (o instanceof net.minecraft.entity.Entity) {
|
||||
net.minecraft.entity.Entity mcEnt = (net.minecraft.entity.Entity) o;
|
||||
Entity bukkitEntity = mcEnt.getBukkitEntity();
|
||||
|
||||
if ((bukkitEntity != null) && (bukkitEntity instanceof Player)) {
|
||||
list.add((Player) bukkitEntity);
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
|
||||
@@ -136,8 +136,6 @@ public class SpigotTimings {
|
||||
public final CustomTimingsHandler tracker;
|
||||
public final CustomTimingsHandler doTick;
|
||||
public final CustomTimingsHandler tickEntities;
|
||||
public final CustomTimingsHandler weatherUpdate;
|
||||
public final CustomTimingsHandler cleanupCache;
|
||||
|
||||
public final CustomTimingsHandler syncChunkLoadTimer;
|
||||
public final CustomTimingsHandler syncChunkLoadDataTimer;
|
||||
@@ -175,8 +173,6 @@ public class SpigotTimings {
|
||||
tracker = new CustomTimingsHandler(name + "tracker");
|
||||
doTick = new CustomTimingsHandler(name + "doTick");
|
||||
tickEntities = new CustomTimingsHandler(name + "tickEntities");
|
||||
weatherUpdate = new CustomTimingsHandler(name + "weatherUpdate");
|
||||
cleanupCache = new CustomTimingsHandler(name + "cleanupCache");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.MapMaker;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package org.bukkit.craftbukkit.map;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.map.MapCanvas;
|
||||
@@ -11,8 +8,6 @@ import org.bukkit.map.MapCursorCollection;
|
||||
import org.bukkit.map.MapRenderer;
|
||||
import org.bukkit.map.MapView;
|
||||
|
||||
import net.minecraft.world.storage.MapData;
|
||||
|
||||
public class CraftMapRenderer extends MapRenderer {
|
||||
|
||||
private final net.minecraft.world.storage.MapData worldMap;
|
||||
@@ -37,14 +32,14 @@ public class CraftMapRenderer extends MapRenderer {
|
||||
cursors.removeCursor(cursors.getCursor(0));
|
||||
}
|
||||
|
||||
for (Map.Entry<UUID, MapData.MapCoord> key : worldMap.playersVisibleOnMap.entrySet()) {
|
||||
for (Object key : worldMap.playersVisibleOnMap.keySet()) {
|
||||
// If this cursor is for a player check visibility with vanish system
|
||||
Player other = Bukkit.getPlayer(key.getKey());
|
||||
Player other = Bukkit.getPlayerExact((String) key);
|
||||
if (other != null && !player.canSee(other)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
MapData.MapCoord decoration = key.getValue();
|
||||
net.minecraft.world.storage.MapData.MapCoord decoration = (net.minecraft.world.storage.MapData.MapCoord) worldMap.playersVisibleOnMap.get(key);
|
||||
cursors.addCursor(decoration.centerX, decoration.centerZ, (byte) (decoration.iconRotation & 15), decoration.iconSize);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
package org.spigotmc;
|
||||
|
||||
import gnu.trove.strategy.HashingStrategy;
|
||||
|
||||
class CaseInsensitiveHashingStrategy implements HashingStrategy<String> {
|
||||
private static final long serialVersionUID = -9212222772914758878L;
|
||||
static final CaseInsensitiveHashingStrategy INSTANCE = new CaseInsensitiveHashingStrategy();
|
||||
|
||||
@Override
|
||||
public int computeHashCode(String object) {
|
||||
return object.toLowerCase().hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(String o1, String o2) {
|
||||
return o1.equalsIgnoreCase(o2);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package org.spigotmc;
|
||||
|
||||
import gnu.trove.map.hash.TCustomHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class CaseInsensitiveMap<V> extends TCustomHashMap<String, V> {
|
||||
|
||||
public CaseInsensitiveMap() {
|
||||
super(CaseInsensitiveHashingStrategy.INSTANCE);
|
||||
}
|
||||
|
||||
public CaseInsensitiveMap(Map<? extends String, ? extends V> map) {
|
||||
super(CaseInsensitiveHashingStrategy.INSTANCE, map);
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,7 @@ public class WatchdogThread extends Thread
|
||||
log.log(Level.SEVERE, " Dimension:" + world.provider.dimensionId);
|
||||
log.log(Level.SEVERE,
|
||||
" Loaded Chunks: " + world.theChunkProviderServer.loadedChunkHashMap_KC.size() + " Active Chunks: " + world.activeChunkSet.size()
|
||||
+ " Entities: " + world.loadedEntityList_KC.size() + " Tile Entities: " + world.loadedTileEntityList_KC.size());
|
||||
+ " Entities: " + world.loadedEntityList.size() + " Tile Entities: " + world.loadedTileEntityList.size());
|
||||
log.log(Level.SEVERE, " Entities Last Tick: " + world.entitiesTicked);
|
||||
log.log(Level.SEVERE, " Tiles Last Tick: " + world.tilesTicked);
|
||||
}
|
||||
@@ -155,8 +155,8 @@ public class WatchdogThread extends Thread
|
||||
log.log(Level.WARNING, " Dimension:" + world.provider.dimensionId);
|
||||
log.log(Level.WARNING, " Loaded Chunks: " + world.theChunkProviderServer.loadedChunkHashMap_KC.size() +
|
||||
" Active Chunks: " + world.activeChunkSet.size() +
|
||||
" Entities: " + world.loadedEntityList_KC.size() +
|
||||
" Tile Entities: " + world.loadedTileEntityList_KC.size());
|
||||
" Entities: " + world.loadedEntityList.size() +
|
||||
" Tile Entities: " + world.loadedTileEntityList.size());
|
||||
log.log(Level.WARNING, " Entities Last Tick: " + world.entitiesTicked);
|
||||
log.log(Level.WARNING, " Tiles Last Tick: " + world.tilesTicked);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user