mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 20:23:53 -07:00
Update CraftBukkit to Minecraft 1.4.6
By: feildmaster <admin@feildmaster.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>craftbukkit</artifactId>
|
<artifactId>craftbukkit</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>1.4.5-R1.1-SNAPSHOT</version>
|
<version>1.4.6-R0.1-SNAPSHOT</version>
|
||||||
<name>CraftBukkit</name>
|
<name>CraftBukkit</name>
|
||||||
<url>http://www.bukkit.org</url>
|
<url>http://www.bukkit.org</url>
|
||||||
|
|
||||||
@@ -12,8 +12,8 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<api.version>unknown</api.version>
|
<api.version>unknown</api.version>
|
||||||
<junit.version>4.11</junit.version>
|
<junit.version>4.11</junit.version>
|
||||||
<minecraft.version>1.4.5</minecraft.version>
|
<minecraft.version>1.4.6</minecraft.version>
|
||||||
<minecraft_version>1_4_5</minecraft_version>
|
<minecraft_version>1_4_6</minecraft_version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
|
@@ -106,7 +106,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
|
|||||||
for (Object obj : server.getHandle().players) {
|
for (Object obj : server.getHandle().players) {
|
||||||
EntityPlayer player = (EntityPlayer) obj;
|
EntityPlayer player = (EntityPlayer) obj;
|
||||||
if (player.name.equalsIgnoreCase(getName())) {
|
if (player.name.equalsIgnoreCase(getName())) {
|
||||||
return (player.netServerHandler != null) ? player.netServerHandler.getPlayer() : null;
|
return (player.playerConnection != null) ? player.playerConnection.getPlayer() : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,12 +23,14 @@ import net.minecraft.server.ChunkCoordinates;
|
|||||||
import net.minecraft.server.Convertable;
|
import net.minecraft.server.Convertable;
|
||||||
import net.minecraft.server.ConvertProgressUpdater;
|
import net.minecraft.server.ConvertProgressUpdater;
|
||||||
import net.minecraft.server.CraftingManager;
|
import net.minecraft.server.CraftingManager;
|
||||||
|
import net.minecraft.server.DedicatedPlayerList;
|
||||||
import net.minecraft.server.DedicatedServer;
|
import net.minecraft.server.DedicatedServer;
|
||||||
import net.minecraft.server.Enchantment;
|
import net.minecraft.server.Enchantment;
|
||||||
import net.minecraft.server.EntityPlayer;
|
import net.minecraft.server.EntityPlayer;
|
||||||
import net.minecraft.server.EntityTracker;
|
import net.minecraft.server.EntityTracker;
|
||||||
import net.minecraft.server.EnumGamemode;
|
import net.minecraft.server.EnumGamemode;
|
||||||
import net.minecraft.server.ExceptionWorldConflict;
|
import net.minecraft.server.ExceptionWorldConflict;
|
||||||
|
import net.minecraft.server.PlayerList;
|
||||||
import net.minecraft.server.RecipesFurnace;
|
import net.minecraft.server.RecipesFurnace;
|
||||||
import net.minecraft.server.IProgressUpdate;
|
import net.minecraft.server.IProgressUpdate;
|
||||||
import net.minecraft.server.IWorldAccess;
|
import net.minecraft.server.IWorldAccess;
|
||||||
@@ -37,8 +39,6 @@ import net.minecraft.server.MinecraftServer;
|
|||||||
import net.minecraft.server.MobEffectList;
|
import net.minecraft.server.MobEffectList;
|
||||||
import net.minecraft.server.PropertyManager;
|
import net.minecraft.server.PropertyManager;
|
||||||
import net.minecraft.server.ServerCommand;
|
import net.minecraft.server.ServerCommand;
|
||||||
import net.minecraft.server.ServerConfigurationManager;
|
|
||||||
import net.minecraft.server.ServerConfigurationManagerAbstract;
|
|
||||||
import net.minecraft.server.ServerNBTManager;
|
import net.minecraft.server.ServerNBTManager;
|
||||||
import net.minecraft.server.WorldLoaderServer;
|
import net.minecraft.server.WorldLoaderServer;
|
||||||
import net.minecraft.server.WorldManager;
|
import net.minecraft.server.WorldManager;
|
||||||
@@ -144,7 +144,7 @@ public final class CraftServer implements Server {
|
|||||||
private final StandardMessenger messenger = new StandardMessenger();
|
private final StandardMessenger messenger = new StandardMessenger();
|
||||||
private final PluginManager pluginManager = new SimplePluginManager(this, commandMap);
|
private final PluginManager pluginManager = new SimplePluginManager(this, commandMap);
|
||||||
protected final MinecraftServer console;
|
protected final MinecraftServer console;
|
||||||
protected final ServerConfigurationManager server;
|
protected final DedicatedPlayerList playerList;
|
||||||
private final Map<String, World> worlds = new LinkedHashMap<String, World>();
|
private final Map<String, World> worlds = new LinkedHashMap<String, World>();
|
||||||
private YamlConfiguration configuration;
|
private YamlConfiguration configuration;
|
||||||
private final Yaml yaml = new Yaml(new SafeConstructor());
|
private final Yaml yaml = new Yaml(new SafeConstructor());
|
||||||
@@ -159,16 +159,22 @@ public final class CraftServer implements Server {
|
|||||||
private int ambientSpawn = -1;
|
private int ambientSpawn = -1;
|
||||||
private File container;
|
private File container;
|
||||||
private WarningState warningState = WarningState.DEFAULT;
|
private WarningState warningState = WarningState.DEFAULT;
|
||||||
|
private final BooleanWrapper online = new BooleanWrapper();
|
||||||
|
|
||||||
|
private final class BooleanWrapper {
|
||||||
|
private boolean value = true;
|
||||||
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
|
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
|
||||||
CraftItemFactory.instance();
|
CraftItemFactory.instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
public CraftServer(MinecraftServer console, ServerConfigurationManagerAbstract server) {
|
public CraftServer(MinecraftServer console, PlayerList playerList) {
|
||||||
this.console = console;
|
this.console = console;
|
||||||
this.server = (ServerConfigurationManager) server;
|
this.playerList = (DedicatedPlayerList) playerList;
|
||||||
this.serverVersion = CraftServer.class.getPackage().getImplementationVersion();
|
this.serverVersion = CraftServer.class.getPackage().getImplementationVersion();
|
||||||
|
online.value = console.getPropertyManager().getBoolean("online-mode", true);
|
||||||
|
|
||||||
Bukkit.setServer(this);
|
Bukkit.setServer(this);
|
||||||
|
|
||||||
@@ -299,11 +305,11 @@ public final class CraftServer implements Server {
|
|||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public Player[] getOnlinePlayers() {
|
public Player[] getOnlinePlayers() {
|
||||||
List<EntityPlayer> online = server.players;
|
List<EntityPlayer> online = playerList.players;
|
||||||
Player[] players = new Player[online.size()];
|
Player[] players = new Player[online.size()];
|
||||||
|
|
||||||
for (int i = 0; i < players.length; i++) {
|
for (int i = 0; i < players.length; i++) {
|
||||||
players[i] = online.get(i).netServerHandler.getPlayer();
|
players[i] = online.get(i).playerConnection.getPlayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
return players;
|
return players;
|
||||||
@@ -345,7 +351,7 @@ public final class CraftServer implements Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Player getPlayer(final EntityPlayer entity) {
|
public Player getPlayer(final EntityPlayer entity) {
|
||||||
return entity.netServerHandler.getPlayer();
|
return entity.playerConnection.getPlayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Player> matchPlayer(String partialName) {
|
public List<Player> matchPlayer(String partialName) {
|
||||||
@@ -370,7 +376,7 @@ public final class CraftServer implements Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxPlayers() {
|
public int getMaxPlayers() {
|
||||||
return server.getMaxPlayers();
|
return playerList.getMaxPlayers();
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: These are dependent on the corrisponding call in MinecraftServer
|
// NOTE: These are dependent on the corrisponding call in MinecraftServer
|
||||||
@@ -478,8 +484,8 @@ public final class CraftServer implements Server {
|
|||||||
return new ArrayList<World>(worlds.values());
|
return new ArrayList<World>(worlds.values());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerConfigurationManager getHandle() {
|
public DedicatedPlayerList getHandle() {
|
||||||
return server;
|
return playerList;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: Should only be called from DedicatedServer.ah()
|
// NOTE: Should only be called from DedicatedServer.ah()
|
||||||
@@ -520,7 +526,7 @@ public final class CraftServer implements Server {
|
|||||||
boolean monsters = config.getBoolean("spawn-monsters", console.worlds.get(0).difficulty > 0);
|
boolean monsters = config.getBoolean("spawn-monsters", console.worlds.get(0).difficulty > 0);
|
||||||
int difficulty = config.getInt("difficulty", console.worlds.get(0).difficulty);
|
int difficulty = config.getInt("difficulty", console.worlds.get(0).difficulty);
|
||||||
|
|
||||||
console.setOnlineMode(config.getBoolean("online-mode", console.getOnlineMode()));
|
online.value = config.getBoolean("online-mode", console.getOnlineMode());
|
||||||
console.setSpawnAnimals(config.getBoolean("spawn-animals", console.getSpawnAnimals()));
|
console.setSpawnAnimals(config.getBoolean("spawn-animals", console.getSpawnAnimals()));
|
||||||
console.setPvP(config.getBoolean("pvp", console.getPvP()));
|
console.setPvP(config.getBoolean("pvp", console.getPvP()));
|
||||||
console.setAllowFlight(config.getBoolean("allow-flight", console.getAllowFlight()));
|
console.setAllowFlight(config.getBoolean("allow-flight", console.getAllowFlight()));
|
||||||
@@ -833,7 +839,7 @@ public final class CraftServer implements Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void savePlayers() {
|
public void savePlayers() {
|
||||||
server.savePlayers();
|
playerList.savePlayers();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void configureDbConfig(ServerConfig config) {
|
public void configureDbConfig(ServerConfig config) {
|
||||||
@@ -946,7 +952,7 @@ public final class CraftServer implements Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean getOnlineMode() {
|
public boolean getOnlineMode() {
|
||||||
return console.getOnlineMode();
|
return online.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getAllowFlight() {
|
public boolean getAllowFlight() {
|
||||||
@@ -1059,24 +1065,24 @@ public final class CraftServer implements Server {
|
|||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public Set<String> getIPBans() {
|
public Set<String> getIPBans() {
|
||||||
return server.getIPBans().getEntries().keySet();
|
return playerList.getIPBans().getEntries().keySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void banIP(String address) {
|
public void banIP(String address) {
|
||||||
BanEntry entry = new BanEntry(address);
|
BanEntry entry = new BanEntry(address);
|
||||||
server.getIPBans().add(entry);
|
playerList.getIPBans().add(entry);
|
||||||
server.getIPBans().save();
|
playerList.getIPBans().save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unbanIP(String address) {
|
public void unbanIP(String address) {
|
||||||
server.getIPBans().remove(address);
|
playerList.getIPBans().remove(address);
|
||||||
server.getIPBans().save();
|
playerList.getIPBans().save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<OfflinePlayer> getBannedPlayers() {
|
public Set<OfflinePlayer> getBannedPlayers() {
|
||||||
Set<OfflinePlayer> result = new HashSet<OfflinePlayer>();
|
Set<OfflinePlayer> result = new HashSet<OfflinePlayer>();
|
||||||
|
|
||||||
for (Object name : server.getNameBans().getEntries().keySet()) {
|
for (Object name : playerList.getNameBans().getEntries().keySet()) {
|
||||||
result.add(getOfflinePlayer((String) name));
|
result.add(getOfflinePlayer((String) name));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1084,14 +1090,14 @@ public final class CraftServer implements Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setWhitelist(boolean value) {
|
public void setWhitelist(boolean value) {
|
||||||
server.hasWhitelist = value;
|
playerList.hasWhitelist = value;
|
||||||
console.getPropertyManager().a("white-list", value);
|
console.getPropertyManager().a("white-list", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<OfflinePlayer> getWhitelistedPlayers() {
|
public Set<OfflinePlayer> getWhitelistedPlayers() {
|
||||||
Set<OfflinePlayer> result = new LinkedHashSet<OfflinePlayer>();
|
Set<OfflinePlayer> result = new LinkedHashSet<OfflinePlayer>();
|
||||||
|
|
||||||
for (Object name : server.getWhitelisted()) {
|
for (Object name : playerList.getWhitelisted()) {
|
||||||
if (((String)name).length() == 0 || ((String)name).startsWith("#")) {
|
if (((String)name).length() == 0 || ((String)name).startsWith("#")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1104,7 +1110,7 @@ public final class CraftServer implements Server {
|
|||||||
public Set<OfflinePlayer> getOperators() {
|
public Set<OfflinePlayer> getOperators() {
|
||||||
Set<OfflinePlayer> result = new HashSet<OfflinePlayer>();
|
Set<OfflinePlayer> result = new HashSet<OfflinePlayer>();
|
||||||
|
|
||||||
for (Object name : server.getOPs()) {
|
for (Object name : playerList.getOPs()) {
|
||||||
result.add(getOfflinePlayer((String) name));
|
result.add(getOfflinePlayer((String) name));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1112,7 +1118,7 @@ public final class CraftServer implements Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void reloadWhitelist() {
|
public void reloadWhitelist() {
|
||||||
server.reloadWhitelist();
|
playerList.reloadWhitelist();
|
||||||
}
|
}
|
||||||
|
|
||||||
public GameMode getDefaultGameMode() {
|
public GameMode getDefaultGameMode() {
|
||||||
|
@@ -222,7 +222,7 @@ public class CraftWorld implements World {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isChunkInUse(int x, int z) {
|
public boolean isChunkInUse(int x, int z) {
|
||||||
return world.getPlayerManager().isChunkInUse(x, z);
|
return world.getPlayerChunkMap().isChunkInUse(x, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean loadChunk(int x, int z, boolean generate) {
|
public boolean loadChunk(int x, int z, boolean generate) {
|
||||||
@@ -430,9 +430,9 @@ public class CraftWorld implements World {
|
|||||||
// Forces the client to update to the new time immediately
|
// Forces the client to update to the new time immediately
|
||||||
for (Player p : getPlayers()) {
|
for (Player p : getPlayers()) {
|
||||||
CraftPlayer cp = (CraftPlayer) p;
|
CraftPlayer cp = (CraftPlayer) p;
|
||||||
if (cp.getHandle().netServerHandler == null) continue;
|
if (cp.getHandle().playerConnection == null) continue;
|
||||||
|
|
||||||
cp.getHandle().netServerHandler.sendPacket(new Packet4UpdateTime(cp.getHandle().world.getTime(), cp.getHandle().getPlayerTime()));
|
cp.getHandle().playerConnection.sendPacket(new Packet4UpdateTime(cp.getHandle().world.getTime(), cp.getHandle().getPlayerTime()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -767,12 +767,12 @@ public class CraftWorld implements World {
|
|||||||
radius *= radius;
|
radius *= radius;
|
||||||
|
|
||||||
for (Player player : getPlayers()) {
|
for (Player player : getPlayers()) {
|
||||||
if (((CraftPlayer) player).getHandle().netServerHandler == null) continue;
|
if (((CraftPlayer) player).getHandle().playerConnection == null) continue;
|
||||||
if (!location.getWorld().equals(player.getWorld())) continue;
|
if (!location.getWorld().equals(player.getWorld())) continue;
|
||||||
|
|
||||||
distance = (int) player.getLocation().distanceSquared(location);
|
distance = (int) player.getLocation().distanceSquared(location);
|
||||||
if (distance <= radius) {
|
if (distance <= radius) {
|
||||||
((CraftPlayer) player).getHandle().netServerHandler.sendPacket(packet);
|
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -72,6 +72,8 @@ public class CraftEnchantment extends Enchantment {
|
|||||||
return "OXYGEN";
|
return "OXYGEN";
|
||||||
case 6:
|
case 6:
|
||||||
return "WATER_WORKER";
|
return "WATER_WORKER";
|
||||||
|
case 7:
|
||||||
|
return "THORNS";
|
||||||
case 16:
|
case 16:
|
||||||
return "DAMAGE_ALL";
|
return "DAMAGE_ALL";
|
||||||
case 17:
|
case 17:
|
||||||
|
@@ -148,6 +148,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
|||||||
else { return new CraftHanging(server, (EntityHanging) entity); }
|
else { return new CraftHanging(server, (EntityHanging) entity); }
|
||||||
}
|
}
|
||||||
else if (entity instanceof EntityTNTPrimed) { return new CraftTNTPrimed(server, (EntityTNTPrimed) entity); }
|
else if (entity instanceof EntityTNTPrimed) { return new CraftTNTPrimed(server, (EntityTNTPrimed) entity); }
|
||||||
|
else if (entity instanceof EntityFireworks) { return new CraftFirework(server, (EntityFireworks) entity); }
|
||||||
|
|
||||||
throw new IllegalArgumentException("Unknown entity");
|
throw new IllegalArgumentException("Unknown entity");
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,28 @@
|
|||||||
|
package org.bukkit.craftbukkit.entity;
|
||||||
|
|
||||||
|
import net.minecraft.server.EntityFireworks;
|
||||||
|
|
||||||
|
import org.bukkit.craftbukkit.CraftServer;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.Firework;
|
||||||
|
|
||||||
|
public class CraftFirework extends CraftEntity implements Firework {
|
||||||
|
|
||||||
|
public CraftFirework(CraftServer server, EntityFireworks entity) {
|
||||||
|
super(server, entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EntityFireworks getHandle() {
|
||||||
|
return (EntityFireworks) entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "CraftFirework";
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityType getType() {
|
||||||
|
return EntityType.FIREWORK;
|
||||||
|
}
|
||||||
|
}
|
@@ -229,7 +229,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void openCustomInventory(Inventory inventory, EntityPlayer player, int windowType) {
|
private void openCustomInventory(Inventory inventory, EntityPlayer player, int windowType) {
|
||||||
if (player.netServerHandler == null) return;
|
if (player.playerConnection == null) return;
|
||||||
Container container = new CraftContainer(inventory, this, player.nextContainerCounter());
|
Container container = new CraftContainer(inventory, this, player.nextContainerCounter());
|
||||||
|
|
||||||
container = CraftEventFactory.callInventoryOpenEvent(player, container);
|
container = CraftEventFactory.callInventoryOpenEvent(player, container);
|
||||||
@@ -238,7 +238,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
|||||||
String title = container.getBukkitView().getTitle();
|
String title = container.getBukkitView().getTitle();
|
||||||
int size = container.getBukkitView().getTopInventory().getSize();
|
int size = container.getBukkitView().getTopInventory().getSize();
|
||||||
|
|
||||||
player.netServerHandler.sendPacket(new Packet100OpenWindow(container.windowId, windowType, title, size));
|
player.playerConnection.sendPacket(new Packet100OpenWindow(container.windowId, windowType, title, size));
|
||||||
getHandle().activeContainer = container;
|
getHandle().activeContainer = container;
|
||||||
getHandle().activeContainer.addSlotListener(player);
|
getHandle().activeContainer.addSlotListener(player);
|
||||||
}
|
}
|
||||||
@@ -279,10 +279,10 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
|||||||
|
|
||||||
public void openInventory(InventoryView inventory) {
|
public void openInventory(InventoryView inventory) {
|
||||||
if (!(getHandle() instanceof EntityPlayer)) return; // TODO: NPC support?
|
if (!(getHandle() instanceof EntityPlayer)) return; // TODO: NPC support?
|
||||||
if (((EntityPlayer) getHandle()).netServerHandler == null) return;
|
if (((EntityPlayer) getHandle()).playerConnection == null) return;
|
||||||
if (getHandle().activeContainer != getHandle().defaultContainer) {
|
if (getHandle().activeContainer != getHandle().defaultContainer) {
|
||||||
// fire INVENTORY_CLOSE if one already open
|
// fire INVENTORY_CLOSE if one already open
|
||||||
((EntityPlayer)getHandle()).netServerHandler.handleContainerClose(new Packet101CloseWindow(getHandle().activeContainer.windowId));
|
((EntityPlayer)getHandle()).playerConnection.handleContainerClose(new Packet101CloseWindow(getHandle().activeContainer.windowId));
|
||||||
}
|
}
|
||||||
EntityPlayer player = (EntityPlayer) getHandle();
|
EntityPlayer player = (EntityPlayer) getHandle();
|
||||||
Container container;
|
Container container;
|
||||||
@@ -303,7 +303,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
|||||||
int windowType = CraftContainer.getNotchInventoryType(type);
|
int windowType = CraftContainer.getNotchInventoryType(type);
|
||||||
String title = inventory.getTitle();
|
String title = inventory.getTitle();
|
||||||
int size = inventory.getTopInventory().getSize();
|
int size = inventory.getTopInventory().getSize();
|
||||||
player.netServerHandler.sendPacket(new Packet100OpenWindow(container.windowId, windowType, title, size));
|
player.playerConnection.sendPacket(new Packet100OpenWindow(container.windowId, windowType, title, size));
|
||||||
player.activeContainer = container;
|
player.activeContainer = container;
|
||||||
player.activeContainer.addSlotListener(player);
|
player.activeContainer.addSlotListener(player);
|
||||||
}
|
}
|
||||||
|
@@ -22,11 +22,11 @@ public class CraftItem extends CraftEntity implements Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getItemStack() {
|
public ItemStack getItemStack() {
|
||||||
return CraftItemStack.asCraftMirror(item.itemStack);
|
return CraftItemStack.asCraftMirror(item.getItemStack());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setItemStack(ItemStack stack) {
|
public void setItemStack(ItemStack stack) {
|
||||||
item.itemStack = CraftItemStack.asNMSCopy(stack);
|
item.setItemStack(CraftItemStack.asNMSCopy(stack));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getPickupDelay() {
|
public int getPickupDelay() {
|
||||||
|
@@ -255,8 +255,8 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
|||||||
getHandle().effects.remove(type.getId());
|
getHandle().effects.remove(type.getId());
|
||||||
getHandle().updateEffects = true;
|
getHandle().updateEffects = true;
|
||||||
if (getHandle() instanceof EntityPlayer) {
|
if (getHandle() instanceof EntityPlayer) {
|
||||||
if (((EntityPlayer) getHandle()).netServerHandler == null) return;
|
if (((EntityPlayer) getHandle()).playerConnection == null) return;
|
||||||
((EntityPlayer) getHandle()).netServerHandler.sendPacket(new Packet42RemoveMobEffect(getHandle().id, new MobEffect(type.getId(), 0, 0)));
|
((EntityPlayer) getHandle()).playerConnection.sendPacket(new Packet42RemoveMobEffect(getHandle().id, new MobEffect(type.getId(), 0, 0)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -94,9 +94,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public InetSocketAddress getAddress() {
|
public InetSocketAddress getAddress() {
|
||||||
if (getHandle().netServerHandler == null) return null;
|
if (getHandle().playerConnection == null) return null;
|
||||||
|
|
||||||
SocketAddress addr = getHandle().netServerHandler.networkManager.getSocketAddress();
|
SocketAddress addr = getHandle().playerConnection.networkManager.getSocketAddress();
|
||||||
if (addr instanceof InetSocketAddress) {
|
if (addr instanceof InetSocketAddress) {
|
||||||
return (InetSocketAddress) addr;
|
return (InetSocketAddress) addr;
|
||||||
} else {
|
} else {
|
||||||
@@ -123,9 +123,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void sendRawMessage(String message) {
|
public void sendRawMessage(String message) {
|
||||||
if (getHandle().netServerHandler == null) return;
|
if (getHandle().playerConnection == null) return;
|
||||||
|
|
||||||
getHandle().netServerHandler.sendPacket(new Packet3Chat(message));
|
getHandle().playerConnection.sendPacket(new Packet3Chat(message));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendMessage(String message) {
|
public void sendMessage(String message) {
|
||||||
@@ -181,11 +181,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
Packet201PlayerInfo packet = new Packet201PlayerInfo(name, true, getHandle().ping);
|
Packet201PlayerInfo packet = new Packet201PlayerInfo(name, true, getHandle().ping);
|
||||||
for (int i = 0; i < server.getHandle().players.size(); ++i) {
|
for (int i = 0; i < server.getHandle().players.size(); ++i) {
|
||||||
EntityPlayer entityplayer = (EntityPlayer) server.getHandle().players.get(i);
|
EntityPlayer entityplayer = (EntityPlayer) server.getHandle().players.get(i);
|
||||||
if (entityplayer.netServerHandler == null) continue;
|
if (entityplayer.playerConnection == null) continue;
|
||||||
|
|
||||||
if (entityplayer.getBukkitEntity().canSee(this)) {
|
if (entityplayer.getBukkitEntity().canSee(this)) {
|
||||||
entityplayer.netServerHandler.sendPacket(oldpacket);
|
entityplayer.playerConnection.sendPacket(oldpacket);
|
||||||
entityplayer.netServerHandler.sendPacket(packet);
|
entityplayer.playerConnection.sendPacket(packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -211,16 +211,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void kickPlayer(String message) {
|
public void kickPlayer(String message) {
|
||||||
if (getHandle().netServerHandler == null) return;
|
if (getHandle().playerConnection == null) return;
|
||||||
|
|
||||||
getHandle().netServerHandler.disconnect(message == null ? "" : message);
|
getHandle().playerConnection.disconnect(message == null ? "" : message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCompassTarget(Location loc) {
|
public void setCompassTarget(Location loc) {
|
||||||
if (getHandle().netServerHandler == null) return;
|
if (getHandle().playerConnection == null) return;
|
||||||
|
|
||||||
// Do not directly assign here, from the packethandler we'll assign it.
|
// Do not directly assign here, from the packethandler we'll assign it.
|
||||||
getHandle().netServerHandler.sendPacket(new Packet6SpawnPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
|
getHandle().playerConnection.sendPacket(new Packet6SpawnPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Location getCompassTarget() {
|
public Location getCompassTarget() {
|
||||||
@@ -228,9 +228,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void chat(String msg) {
|
public void chat(String msg) {
|
||||||
if (getHandle().netServerHandler == null) return;
|
if (getHandle().playerConnection == null) return;
|
||||||
|
|
||||||
getHandle().netServerHandler.chat(msg, false);
|
getHandle().playerConnection.chat(msg, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean performCommand(String command) {
|
public boolean performCommand(String command) {
|
||||||
@@ -238,36 +238,36 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void playNote(Location loc, byte instrument, byte note) {
|
public void playNote(Location loc, byte instrument, byte note) {
|
||||||
if (getHandle().netServerHandler == null) return;
|
if (getHandle().playerConnection == null) return;
|
||||||
|
|
||||||
int id = getHandle().world.getTypeId(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
int id = getHandle().world.getTypeId(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
||||||
getHandle().netServerHandler.sendPacket(new Packet54PlayNoteBlock(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), id, instrument, note));
|
getHandle().playerConnection.sendPacket(new Packet54PlayNoteBlock(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), id, instrument, note));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void playNote(Location loc, Instrument instrument, Note note) {
|
public void playNote(Location loc, Instrument instrument, Note note) {
|
||||||
if (getHandle().netServerHandler == null) return;
|
if (getHandle().playerConnection == null) return;
|
||||||
|
|
||||||
int id = getHandle().world.getTypeId(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
int id = getHandle().world.getTypeId(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
||||||
getHandle().netServerHandler.sendPacket(new Packet54PlayNoteBlock(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), id, instrument.getType(), note.getId()));
|
getHandle().playerConnection.sendPacket(new Packet54PlayNoteBlock(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), id, instrument.getType(), note.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void playSound(Location loc, Sound sound, float volume, float pitch) {
|
public void playSound(Location loc, Sound sound, float volume, float pitch) {
|
||||||
if (loc == null || sound == null || getHandle().netServerHandler == null) return;
|
if (loc == null || sound == null || getHandle().playerConnection == null) return;
|
||||||
|
|
||||||
double x = loc.getBlockX() + 0.5;
|
double x = loc.getBlockX() + 0.5;
|
||||||
double y = loc.getBlockY() + 0.5;
|
double y = loc.getBlockY() + 0.5;
|
||||||
double z = loc.getBlockZ() + 0.5;
|
double z = loc.getBlockZ() + 0.5;
|
||||||
|
|
||||||
Packet62NamedSoundEffect packet = new Packet62NamedSoundEffect(CraftSound.getSound(sound), x, y, z, volume, pitch);
|
Packet62NamedSoundEffect packet = new Packet62NamedSoundEffect(CraftSound.getSound(sound), x, y, z, volume, pitch);
|
||||||
getHandle().netServerHandler.sendPacket(packet);
|
getHandle().playerConnection.sendPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void playEffect(Location loc, Effect effect, int data) {
|
public void playEffect(Location loc, Effect effect, int data) {
|
||||||
if (getHandle().netServerHandler == null) return;
|
if (getHandle().playerConnection == null) return;
|
||||||
|
|
||||||
int packetData = effect.getId();
|
int packetData = effect.getId();
|
||||||
Packet61WorldEvent packet = new Packet61WorldEvent(packetData, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), data, false);
|
Packet61WorldEvent packet = new Packet61WorldEvent(packetData, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), data, false);
|
||||||
getHandle().netServerHandler.sendPacket(packet);
|
getHandle().playerConnection.sendPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> void playEffect(Location loc, Effect effect, T data) {
|
public <T> void playEffect(Location loc, Effect effect, T data) {
|
||||||
@@ -286,17 +286,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void sendBlockChange(Location loc, int material, byte data) {
|
public void sendBlockChange(Location loc, int material, byte data) {
|
||||||
if (getHandle().netServerHandler == null) return;
|
if (getHandle().playerConnection == null) return;
|
||||||
|
|
||||||
Packet53BlockChange packet = new Packet53BlockChange(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), ((CraftWorld) loc.getWorld()).getHandle());
|
Packet53BlockChange packet = new Packet53BlockChange(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), ((CraftWorld) loc.getWorld()).getHandle());
|
||||||
|
|
||||||
packet.material = material;
|
packet.material = material;
|
||||||
packet.data = data;
|
packet.data = data;
|
||||||
getHandle().netServerHandler.sendPacket(packet);
|
getHandle().playerConnection.sendPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean sendChunkChange(Location loc, int sx, int sy, int sz, byte[] data) {
|
public boolean sendChunkChange(Location loc, int sx, int sy, int sz, byte[] data) {
|
||||||
if (getHandle().netServerHandler == null) return false;
|
if (getHandle().playerConnection == null) return false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
int x = loc.getBlockX();
|
int x = loc.getBlockX();
|
||||||
@@ -320,7 +320,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
|
|
||||||
Packet51MapChunk packet = new Packet51MapChunk(x, y, z, sx, sy, sz, data);
|
Packet51MapChunk packet = new Packet51MapChunk(x, y, z, sx, sy, sz, data);
|
||||||
|
|
||||||
getHandle().netServerHandler.sendPacket(packet);
|
getHandle().playerConnection.sendPacket(packet);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
*/
|
*/
|
||||||
@@ -329,7 +329,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void sendMap(MapView map) {
|
public void sendMap(MapView map) {
|
||||||
if (getHandle().netServerHandler == null) return;
|
if (getHandle().playerConnection == null) return;
|
||||||
|
|
||||||
RenderData data = ((CraftMapView) map).render(this);
|
RenderData data = ((CraftMapView) map).render(this);
|
||||||
for (int x = 0; x < 128; ++x) {
|
for (int x = 0; x < 128; ++x) {
|
||||||
@@ -339,7 +339,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
bytes[y + 3] = data.buffer[y * 128 + x];
|
bytes[y + 3] = data.buffer[y * 128 + x];
|
||||||
}
|
}
|
||||||
Packet131ItemData packet = new Packet131ItemData((short) Material.MAP.getId(), map.getId(), bytes);
|
Packet131ItemData packet = new Packet131ItemData((short) Material.MAP.getId(), map.getId(), bytes);
|
||||||
getHandle().netServerHandler.sendPacket(packet);
|
getHandle().playerConnection.sendPacket(packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,7 +347,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
public boolean teleport(Location location, PlayerTeleportEvent.TeleportCause cause) {
|
public boolean teleport(Location location, PlayerTeleportEvent.TeleportCause cause) {
|
||||||
EntityPlayer entity = getHandle();
|
EntityPlayer entity = getHandle();
|
||||||
|
|
||||||
if (entity.netServerHandler == null || entity.netServerHandler.disconnected) {
|
if (entity.playerConnection == null || entity.playerConnection.disconnected) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -378,7 +378,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
|
|
||||||
// Check if the fromWorld and toWorld are the same.
|
// Check if the fromWorld and toWorld are the same.
|
||||||
if (fromWorld == toWorld) {
|
if (fromWorld == toWorld) {
|
||||||
entity.netServerHandler.teleport(to);
|
entity.playerConnection.teleport(to);
|
||||||
} else {
|
} else {
|
||||||
// Close any foreign inventory
|
// Close any foreign inventory
|
||||||
if (getHandle().activeContainer != getHandle().defaultContainer){
|
if (getHandle().activeContainer != getHandle().defaultContainer){
|
||||||
@@ -460,14 +460,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void sendStatistic(int id, int amount) {
|
private void sendStatistic(int id, int amount) {
|
||||||
if (getHandle().netServerHandler == null) return;
|
if (getHandle().playerConnection == null) return;
|
||||||
|
|
||||||
while (amount > Byte.MAX_VALUE) {
|
while (amount > Byte.MAX_VALUE) {
|
||||||
sendStatistic(id, Byte.MAX_VALUE);
|
sendStatistic(id, Byte.MAX_VALUE);
|
||||||
amount -= Byte.MAX_VALUE;
|
amount -= Byte.MAX_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
getHandle().netServerHandler.sendPacket(new Packet200Statistic(id, amount));
|
getHandle().playerConnection.sendPacket(new Packet200Statistic(id, amount));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPlayerTime(long time, boolean relative) {
|
public void setPlayerTime(long time, boolean relative) {
|
||||||
@@ -520,7 +520,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setGameMode(GameMode mode) {
|
public void setGameMode(GameMode mode) {
|
||||||
if (getHandle().netServerHandler == null) return;
|
if (getHandle().playerConnection == null) return;
|
||||||
|
|
||||||
if (mode == null) {
|
if (mode == null) {
|
||||||
throw new IllegalArgumentException("Mode cannot be null");
|
throw new IllegalArgumentException("Mode cannot be null");
|
||||||
@@ -533,14 +533,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
getHandle().itemInWorldManager.setGameMode(EnumGamemode.a(mode.getValue()));
|
getHandle().playerInteractManager.setGameMode(EnumGamemode.a(mode.getValue()));
|
||||||
getHandle().netServerHandler.sendPacket(new Packet70Bed(3, mode.getValue()));
|
getHandle().playerConnection.sendPacket(new Packet70Bed(3, mode.getValue()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GameMode getGameMode() {
|
public GameMode getGameMode() {
|
||||||
return GameMode.getByValue(getHandle().itemInWorldManager.getGameMode().a());
|
return GameMode.getByValue(getHandle().playerInteractManager.getGameMode().a());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void giveExp(int exp) {
|
public void giveExp(int exp) {
|
||||||
@@ -624,7 +624,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
|
|
||||||
public void hidePlayer(Player player) {
|
public void hidePlayer(Player player) {
|
||||||
Validate.notNull(player, "hidden player cannot be null");
|
Validate.notNull(player, "hidden player cannot be null");
|
||||||
if (getHandle().netServerHandler == null) return;
|
if (getHandle().playerConnection == null) return;
|
||||||
if (equals(player)) return;
|
if (equals(player)) return;
|
||||||
if (hiddenPlayers.containsKey(player.getName())) return;
|
if (hiddenPlayers.containsKey(player.getName())) return;
|
||||||
hiddenPlayers.put(player.getName(), player);
|
hiddenPlayers.put(player.getName(), player);
|
||||||
@@ -638,12 +638,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//remove the hidden player from this player user list
|
//remove the hidden player from this player user list
|
||||||
getHandle().netServerHandler.sendPacket(new Packet201PlayerInfo(player.getPlayerListName(), false, 9999));
|
getHandle().playerConnection.sendPacket(new Packet201PlayerInfo(player.getPlayerListName(), false, 9999));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showPlayer(Player player) {
|
public void showPlayer(Player player) {
|
||||||
Validate.notNull(player, "shown player cannot be null");
|
Validate.notNull(player, "shown player cannot be null");
|
||||||
if (getHandle().netServerHandler == null) return;
|
if (getHandle().playerConnection == null) return;
|
||||||
if (equals(player)) return;
|
if (equals(player)) return;
|
||||||
if (!hiddenPlayers.containsKey(player.getName())) return;
|
if (!hiddenPlayers.containsKey(player.getName())) return;
|
||||||
hiddenPlayers.remove(player.getName());
|
hiddenPlayers.remove(player.getName());
|
||||||
@@ -655,7 +655,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
entry.updatePlayer(getHandle());
|
entry.updatePlayer(getHandle());
|
||||||
}
|
}
|
||||||
|
|
||||||
getHandle().netServerHandler.sendPacket(new Packet201PlayerInfo(player.getPlayerListName(), true, getHandle().ping));
|
getHandle().playerConnection.sendPacket(new Packet201PlayerInfo(player.getPlayerListName(), true, getHandle().ping));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canSee(Player player) {
|
public boolean canSee(Player player) {
|
||||||
@@ -771,14 +771,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
|
|
||||||
public void sendPluginMessage(Plugin source, String channel, byte[] message) {
|
public void sendPluginMessage(Plugin source, String channel, byte[] message) {
|
||||||
StandardMessenger.validatePluginMessage(server.getMessenger(), source, channel, message);
|
StandardMessenger.validatePluginMessage(server.getMessenger(), source, channel, message);
|
||||||
if (getHandle().netServerHandler == null) return;
|
if (getHandle().playerConnection == null) return;
|
||||||
|
|
||||||
if (channels.contains(channel)) {
|
if (channels.contains(channel)) {
|
||||||
Packet250CustomPayload packet = new Packet250CustomPayload();
|
Packet250CustomPayload packet = new Packet250CustomPayload();
|
||||||
packet.tag = channel;
|
packet.tag = channel;
|
||||||
packet.length = message.length;
|
packet.length = message.length;
|
||||||
packet.data = message;
|
packet.data = message;
|
||||||
getHandle().netServerHandler.sendPacket(packet);
|
getHandle().playerConnection.sendPacket(packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -799,7 +799,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void sendSupportedChannels() {
|
public void sendSupportedChannels() {
|
||||||
if (getHandle().netServerHandler == null) return;
|
if (getHandle().playerConnection == null) return;
|
||||||
Set<String> listening = server.getMessenger().getIncomingChannels();
|
Set<String> listening = server.getMessenger().getIncomingChannels();
|
||||||
|
|
||||||
if (!listening.isEmpty()) {
|
if (!listening.isEmpty()) {
|
||||||
@@ -820,7 +820,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
packet.data = stream.toByteArray();
|
packet.data = stream.toByteArray();
|
||||||
packet.length = packet.data.length;
|
packet.length = packet.data.length;
|
||||||
|
|
||||||
getHandle().netServerHandler.sendPacket(packet);
|
getHandle().playerConnection.sendPacket(packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -488,7 +488,7 @@ public class CraftEventFactory {
|
|||||||
|
|
||||||
public static Container callInventoryOpenEvent(EntityPlayer player, Container container) {
|
public static Container callInventoryOpenEvent(EntityPlayer player, Container container) {
|
||||||
if (player.activeContainer != player.defaultContainer) { // fire INVENTORY_CLOSE if one already open
|
if (player.activeContainer != player.defaultContainer) { // fire INVENTORY_CLOSE if one already open
|
||||||
player.netServerHandler.handleContainerClose(new Packet101CloseWindow(player.activeContainer.windowId));
|
player.playerConnection.handleContainerClose(new Packet101CloseWindow(player.activeContainer.windowId));
|
||||||
}
|
}
|
||||||
|
|
||||||
CraftServer server = ((WorldServer) player.world).getServer();
|
CraftServer server = ((WorldServer) player.world).getServer();
|
||||||
|
@@ -91,7 +91,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Build chunk section
|
// Build chunk section
|
||||||
csect[sec] = new ChunkSection(sec << 4, secBlkID, secExtBlkID);
|
csect[sec] = new ChunkSection(sec << 4, true, secBlkID, secExtBlkID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { // Else check for byte-per-block section data
|
else { // Else check for byte-per-block section data
|
||||||
@@ -107,7 +107,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator {
|
|||||||
if (btypes[sec] == null) {
|
if (btypes[sec] == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
csect[sec] = new ChunkSection(sec << 4, btypes[sec], null);
|
csect[sec] = new ChunkSection(sec << 4, true, btypes[sec], null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { // Else, fall back to pre 1.2 method
|
else { // Else, fall back to pre 1.2 method
|
||||||
@@ -137,7 +137,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator {
|
|||||||
|
|
||||||
if (blk != 0) { // If non-empty
|
if (blk != 0) { // If non-empty
|
||||||
if (cs == null) { // If no section yet, get one
|
if (cs == null) { // If no section yet, get one
|
||||||
cs = csect[sec] = new ChunkSection(sec << 4);
|
cs = csect[sec] = new ChunkSection(sec << 4, true);
|
||||||
csbytes = cs.g();
|
csbytes = cs.g();
|
||||||
}
|
}
|
||||||
csbytes[(cy << 8) | (cz << 4) | cx] = blk;
|
csbytes[(cy << 8) | (cz << 4) | cx] = blk;
|
||||||
|
@@ -85,7 +85,7 @@ public class CraftContainer extends Container {
|
|||||||
setupSlots(top, bottom);
|
setupSlots(top, bottom);
|
||||||
}
|
}
|
||||||
int size = getSize();
|
int size = getSize();
|
||||||
player.getHandle().netServerHandler.sendPacket(new Packet100OpenWindow(this.windowId, type, cachedTitle, size));
|
player.getHandle().playerConnection.sendPacket(new Packet100OpenWindow(this.windowId, type, cachedTitle, size));
|
||||||
player.updateInventory();
|
player.updateInventory();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@@ -36,8 +36,8 @@ import com.google.common.collect.ImmutableMap;
|
|||||||
* <li> void applyToItem(NBTTagCompound tag)
|
* <li> void applyToItem(NBTTagCompound tag)
|
||||||
* <li> boolean applicableTo(Material type)
|
* <li> boolean applicableTo(Material type)
|
||||||
* <br><br>
|
* <br><br>
|
||||||
* <li> boolean notUncommon(CraftMetaItem meta)
|
|
||||||
* <li> boolean equalsCommon(CraftMetaItem meta)
|
* <li> boolean equalsCommon(CraftMetaItem meta)
|
||||||
|
* <li> boolean notUncommon(CraftMetaItem meta)
|
||||||
* <br><br>
|
* <br><br>
|
||||||
* <li> boolean isEmpty()
|
* <li> boolean isEmpty()
|
||||||
* <li> boolean is{Type}Empty()
|
* <li> boolean is{Type}Empty()
|
||||||
|
@@ -14,7 +14,7 @@ public class LazyPlayerSet extends LazyHashSet<Player> {
|
|||||||
if (reference != null) {
|
if (reference != null) {
|
||||||
throw new IllegalStateException("Reference already created!");
|
throw new IllegalStateException("Reference already created!");
|
||||||
}
|
}
|
||||||
List<EntityPlayer> players = MinecraftServer.getServer().getServerConfigurationManager().players;
|
List<EntityPlayer> players = MinecraftServer.getServer().getPlayerList().players;
|
||||||
HashSet<Player> reference = new HashSet<Player>(players.size());
|
HashSet<Player> reference = new HashSet<Player>(players.size());
|
||||||
for (EntityPlayer player : players) {
|
for (EntityPlayer player : players) {
|
||||||
reference.add(player.getBukkitEntity());
|
reference.add(player.getBukkitEntity());
|
||||||
|
Reference in New Issue
Block a user