diff options
author | Thinkofdeath <thinkofdeath@spigotmc.org> | 2015-02-26 22:41:06 +0000 |
---|---|---|
committer | Thinkofdeath <thinkofdeath@spigotmc.org> | 2015-03-04 09:48:58 +0000 |
commit | d8a9c7be4227b2243968b63ab7cc7a00098c93ad (patch) | |
tree | 554a08a5f23ffa5dd66a28247d6358515b1ffb7a /src | |
parent | 33d5de312e9fcc8aec3fc53136658cb6920562aa (diff) | |
download | craftbukkit-d8a9c7be4227b2243968b63ab7cc7a00098c93ad.tar craftbukkit-d8a9c7be4227b2243968b63ab7cc7a00098c93ad.tar.gz craftbukkit-d8a9c7be4227b2243968b63ab7cc7a00098c93ad.tar.lz craftbukkit-d8a9c7be4227b2243968b63ab7cc7a00098c93ad.tar.xz craftbukkit-d8a9c7be4227b2243968b63ab7cc7a00098c93ad.zip |
Update to Minecraft 1.8.3
Diffstat (limited to 'src')
36 files changed, 150 insertions, 96 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftArt.java b/src/main/java/org/bukkit/craftbukkit/CraftArt.java index dd4dc541..6f94348d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftArt.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftArt.java @@ -1,6 +1,6 @@ package org.bukkit.craftbukkit; -import net.minecraft.server.EnumArt; +import net.minecraft.server.EntityPainting.EnumArt; import org.bukkit.Art; // Safety class, will break if either side changes diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java index b1f6a207..8a33e282 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java @@ -113,6 +113,7 @@ public class CraftChunk implements Chunk { BlockPosition position = (BlockPosition) obj; entities[index++] = worldServer.getWorld().getBlockAt(position.getX(), position.getY(), position.getZ()).getState(); } + return entities; } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftIpBanEntry.java b/src/main/java/org/bukkit/craftbukkit/CraftIpBanEntry.java index 42085f8d..7a8ea3bd 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftIpBanEntry.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftIpBanEntry.java @@ -6,6 +6,8 @@ import net.minecraft.server.MinecraftServer; import java.io.IOException; import java.util.Date; +import java.util.logging.Level; +import org.bukkit.Bukkit; public final class CraftIpBanEntry implements org.bukkit.BanEntry { private final IpBanList list; @@ -80,7 +82,7 @@ public final class CraftIpBanEntry implements org.bukkit.BanEntry { try { this.list.save(); } catch (IOException ex) { - MinecraftServer.getLogger().error("Failed to save banned-ips.json, " + ex.getMessage()); + Bukkit.getLogger().log(Level.SEVERE, "Failed to save banned-ips.json, {0}", ex.getMessage()); } } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftIpBanList.java b/src/main/java/org/bukkit/craftbukkit/CraftIpBanList.java index feb679c1..80832f78 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftIpBanList.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftIpBanList.java @@ -12,6 +12,8 @@ import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.Validate; import com.google.common.collect.ImmutableSet; +import java.util.logging.Level; +import org.bukkit.Bukkit; public class CraftIpBanList implements org.bukkit.BanList { private final IpBanList list; @@ -45,7 +47,7 @@ public class CraftIpBanList implements org.bukkit.BanList { try { list.save(); } catch (IOException ex) { - MinecraftServer.getLogger().error("Failed to save banned-ips.json, " + ex.getMessage()); + Bukkit.getLogger().log(Level.SEVERE, "Failed to save banned-ips.json, {0}", ex.getMessage()); } return new CraftIpBanEntry(target, entry, list); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftProfileBanEntry.java b/src/main/java/org/bukkit/craftbukkit/CraftProfileBanEntry.java index 9540bf4f..3c6f9229 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftProfileBanEntry.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftProfileBanEntry.java @@ -7,6 +7,8 @@ import net.minecraft.server.MinecraftServer; import java.io.IOException; import java.util.Date; +import java.util.logging.Level; +import org.bukkit.Bukkit; public final class CraftProfileBanEntry implements org.bukkit.BanEntry { private final GameProfileBanList list; @@ -81,7 +83,7 @@ public final class CraftProfileBanEntry implements org.bukkit.BanEntry { try { this.list.save(); } catch (IOException ex) { - MinecraftServer.getLogger().error("Failed to save banned-players.json, " + ex.getMessage()); + Bukkit.getLogger().log(Level.SEVERE, "Failed to save banned-players.json, {0}", ex.getMessage()); } } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java b/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java index 700c9f7c..84a1f9c8 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java @@ -14,6 +14,8 @@ import org.apache.commons.lang.Validate; import com.google.common.collect.ImmutableSet; import com.mojang.authlib.GameProfile; +import java.util.logging.Level; +import org.bukkit.Bukkit; public class CraftProfileBanList implements org.bukkit.BanList { private final GameProfileBanList list; @@ -57,7 +59,7 @@ public class CraftProfileBanList implements org.bukkit.BanList { try { list.save(); } catch (IOException ex) { - MinecraftServer.getLogger().error("Failed to save banned-players.json, " + ex.getMessage()); + Bukkit.getLogger().log(Level.SEVERE, "Failed to save banned-players.json, {0}", ex.getMessage()); } return new CraftProfileBanEntry(profile, entry, list); @@ -66,6 +68,7 @@ public class CraftProfileBanList implements org.bukkit.BanList { @Override public Set<org.bukkit.BanEntry> getBanEntries() { ImmutableSet.Builder<org.bukkit.BanEntry> builder = ImmutableSet.builder(); + for (JsonListEntry entry : list.getValues()) { GameProfile profile = (GameProfile) entry.getKey(); builder.add(new CraftProfileBanEntry(profile, (GameProfileBanEntry) entry, list)); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 1f936b04..629e6b8b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -831,7 +831,21 @@ public final class CraftServer implements Server { Convertable converter = new WorldLoaderServer(getWorldContainer()); if (converter.isConvertable(name)) { getLogger().info("Converting world '" + name + "'"); - converter.convert(name, new ConvertProgressUpdater(console)); + converter.convert(name, new IProgressUpdate() { + private long b = System.currentTimeMillis(); + + public void a(String s) {} + + public void a(int i) { + if (System.currentTimeMillis() - this.b >= 1000L) { + this.b = System.currentTimeMillis(); + MinecraftServer.LOGGER.info("Converting... " + i + "%"); + } + + } + + public void c(String s) {} + }); } int dimension = CraftWorld.CUSTOM_DIMENSION_OFFSET + console.worlds.size(); @@ -850,7 +864,7 @@ public final class CraftServer implements Server { IDataManager sdm = new ServerNBTManager(getWorldContainer(), name, true); WorldData worlddata = sdm.getWorldData(); if (worlddata == null) { - WorldSettings worldSettings = new WorldSettings(creator.seed(), EnumGamemode.getById(getDefaultGameMode().getValue()), generateStructures, hardcore, type); + WorldSettings worldSettings = new WorldSettings(creator.seed(), WorldSettings.EnumGamemode.getById(getDefaultGameMode().getValue()), generateStructures, hardcore, type); worldSettings.setGeneratorSettings(creator.generatorSettings()); worlddata = new WorldData(worldSettings, name); } @@ -1367,7 +1381,7 @@ public final class CraftServer implements Server { Validate.notNull(mode, "Mode cannot be null"); for (World world : getWorlds()) { - ((CraftWorld) world).getHandle().worldData.setGameType(EnumGamemode.getById(mode.getValue())); + ((CraftWorld) world).getHandle().worldData.setGameType(WorldSettings.EnumGamemode.getById(mode.getValue())); } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftStatistic.java b/src/main/java/org/bukkit/craftbukkit/CraftStatistic.java index a261c77d..3341c994 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftStatistic.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftStatistic.java @@ -1,7 +1,7 @@ package org.bukkit.craftbukkit; import net.minecraft.server.EntityTypes; -import net.minecraft.server.MonsterEggInfo; +import net.minecraft.server.EntityTypes.MonsterEggInfo; import net.minecraft.server.StatisticList; import org.bukkit.Achievement; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index dac2ad06..621c89f6 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -399,22 +399,30 @@ public class CraftWorld implements World { gen = new WorldGenTaiga1(); break; case JUNGLE: - gen = new WorldGenJungleTree(true, 10, 20, 3, 3); // Magic values as in BlockSapling + IBlockData iblockdata1 = Blocks.LOG.getBlockData().set(BlockLog1.VARIANT, BlockWood.EnumLogVariant.JUNGLE); + IBlockData iblockdata2 = Blocks.LEAVES.getBlockData().set(BlockLeaves1.VARIANT, BlockWood.EnumLogVariant.JUNGLE).set(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + gen = new WorldGenJungleTree(true, 10, 20, iblockdata1, iblockdata2); // Magic values as in BlockSapling break; case SMALL_JUNGLE: - gen = new WorldGenTrees(true, 4 + rand.nextInt(7), 3, 3, false); + iblockdata1 = Blocks.LOG.getBlockData().set(BlockLog1.VARIANT, BlockWood.EnumLogVariant.JUNGLE); + iblockdata2 = Blocks.LEAVES.getBlockData().set(BlockLeaves1.VARIANT, BlockWood.EnumLogVariant.JUNGLE).set(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + gen = new WorldGenTrees(true, 4 + rand.nextInt(7), iblockdata1, iblockdata2, false); break; case COCOA_TREE: - gen = new WorldGenTrees(true, 4 + rand.nextInt(7), 3, 3, true); + iblockdata1 = Blocks.LOG.getBlockData().set(BlockLog1.VARIANT, BlockWood.EnumLogVariant.JUNGLE); + iblockdata2 = Blocks.LEAVES.getBlockData().set(BlockLeaves1.VARIANT, BlockWood.EnumLogVariant.JUNGLE).set(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + gen = new WorldGenTrees(true, 4 + rand.nextInt(7), iblockdata1, iblockdata2, true); break; case JUNGLE_BUSH: - gen = new WorldGenGroundBush(3, 0); + iblockdata1 = Blocks.LOG.getBlockData().set(BlockLog1.VARIANT, BlockWood.EnumLogVariant.JUNGLE); + iblockdata2 = Blocks.LEAVES.getBlockData().set(BlockLeaves1.VARIANT, BlockWood.EnumLogVariant.OAK).set(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + gen = new WorldGenGroundBush(iblockdata1, iblockdata2); break; case RED_MUSHROOM: - gen = new WorldGenHugeMushroom(1); + gen = new WorldGenHugeMushroom(Blocks.RED_MUSHROOM_BLOCK); break; case BROWN_MUSHROOM: - gen = new WorldGenHugeMushroom(0); + gen = new WorldGenHugeMushroom(Blocks.BROWN_MUSHROOM_BLOCK); break; case SWAMP: gen = new WorldGenSwampTree(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorldBorder.java b/src/main/java/org/bukkit/craftbukkit/CraftWorldBorder.java index f44e2348..e5395a1c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorldBorder.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorldBorder.java @@ -11,7 +11,7 @@ public class CraftWorldBorder implements WorldBorder { public CraftWorldBorder(CraftWorld world) { this.world = world; - this.handle = world.getHandle().af(); // PAIL: Rename + this.handle = world.getHandle().getWorldBorder(); } @Override @@ -26,7 +26,7 @@ public class CraftWorldBorder implements WorldBorder { @Override public double getSize() { - return this.handle.h(); // PAIL: Rename + return this.handle.getSize(); } @Override @@ -41,16 +41,16 @@ public class CraftWorldBorder implements WorldBorder { time = Math.min(9223372036854775L, Math.max(0L, time)); if (time > 0L) { - this.handle.a(this.handle.h(), newSize, time * 1000L); // PAIL: Rename + this.handle.transitionSizeBetween(this.handle.getSize(), newSize, time * 1000L); } else { - this.handle.a(newSize); // PAIL: Rename + this.handle.setSize(newSize); } } @Override public Location getCenter() { - double x = this.handle.f(); // PAIL: Rename - double z = this.handle.g(); // PAIL: Rename + double x = this.handle.getCenterX(); + double z = this.handle.getCenterZ(); return new Location(this.world, x, 0, z); } @@ -61,7 +61,7 @@ public class CraftWorldBorder implements WorldBorder { x = Math.min(3.0E7D, Math.max(-3.0E7D, x)); z = Math.min(3.0E7D, Math.max(-3.0E7D, z)); - this.handle.c(x, z); // PAIL: Rename + this.handle.setCenter(x, z); } @Override @@ -71,41 +71,41 @@ public class CraftWorldBorder implements WorldBorder { @Override public double getDamageBuffer() { - return this.handle.m(); // PAIL: Rename + return this.handle.getDamageBuffer(); } @Override public void setDamageBuffer(double blocks) { - this.handle.b(blocks); // PAIL: Rename + this.handle.setDamageBuffer(blocks); } @Override public double getDamageAmount() { - return this.handle.n(); // PAIL: Rename + return this.handle.getDamageAmount(); } @Override public void setDamageAmount(double damage) { - this.handle.c(damage); // PAIL: Rename + this.handle.setDamageAmount(damage); } @Override public int getWarningTime() { - return this.handle.p(); // PAIL: Rename + return this.handle.getWarningTime(); } @Override public void setWarningTime(int time) { - this.handle.b(time); // PAIL: Rename + this.handle.setWarningTime(time); } @Override public int getWarningDistance() { - return this.handle.q(); // PAIL: Rename + return this.handle.getWarningDistance(); } @Override public void setWarningDistance(int distance) { - this.handle.c(distance); // PAIL: Rename + this.handle.setWarningDistance(distance); } } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java b/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java index ce744c97..37238c47 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java @@ -1,6 +1,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.server.*; +import net.minecraft.server.BlockJukeBox.TileEntityRecordPlayer; import org.bukkit.Effect; import org.bukkit.Material; import org.bukkit.block.Block; diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java index 8d751c11..b3f57098 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java @@ -24,7 +24,7 @@ public class CraftSkull extends CraftBlockState implements Skull { skull = (TileEntitySkull) world.getTileEntityAt(getX(), getY(), getZ()); profile = skull.getGameProfile(); skullType = getSkullType(skull.getSkullType()); - rotation = (byte) skull.rotation; + rotation = (byte) skull.getRotation(); } static SkullType getSkullType(int id) { diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java index 26ea0d3a..5b568989 100644 --- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java +++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java @@ -1,5 +1,6 @@ package org.bukkit.craftbukkit.chunkio; +import java.io.IOException; import net.minecraft.server.Chunk; import net.minecraft.server.ChunkRegionLoader; import net.minecraft.server.NBTTagCompound; @@ -9,21 +10,27 @@ import org.bukkit.craftbukkit.util.AsynchronousExecutor; import org.bukkit.craftbukkit.util.LongHash; import java.util.concurrent.atomic.AtomicInteger; +import java.util.logging.Level; +import java.util.logging.Logger; class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChunk, Chunk, Runnable, RuntimeException> { private final AtomicInteger threadNumber = new AtomicInteger(1); // async stuff public Chunk callStage1(QueuedChunk queuedChunk) throws RuntimeException { - ChunkRegionLoader loader = queuedChunk.loader; - Object[] data = loader.loadChunk(queuedChunk.world, queuedChunk.x, queuedChunk.z); + try { + ChunkRegionLoader loader = queuedChunk.loader; + Object[] data = loader.loadChunk(queuedChunk.world, queuedChunk.x, queuedChunk.z); + + if (data != null) { + queuedChunk.compound = (NBTTagCompound) data[1]; + return (Chunk) data[0]; + } - if (data != null) { - queuedChunk.compound = (NBTTagCompound) data[1]; - return (Chunk) data[0]; + return null; + } catch (IOException ex) { + throw new RuntimeException(ex); } - - return null; } // sync stuff diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java index a5174166..96e9a710 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java +++ b/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java @@ -1,7 +1,7 @@ package org.bukkit.craftbukkit.command; import net.minecraft.server.ICommandListener; -import net.minecraft.server.TileEntityCommandListener; +import net.minecraft.server.CommandBlockListenerAbstract; import org.bukkit.block.Block; import org.bukkit.command.BlockCommandSender; @@ -10,9 +10,9 @@ import org.bukkit.command.BlockCommandSender; * Represents input from a command block */ public class CraftBlockCommandSender extends ServerCommandSender implements BlockCommandSender { - private final TileEntityCommandListener commandBlock; + private final CommandBlockListenerAbstract commandBlock; - public CraftBlockCommandSender(TileEntityCommandListener commandBlockListenerAbstract) { + public CraftBlockCommandSender(CommandBlockListenerAbstract commandBlockListenerAbstract) { super(); this.commandBlock = commandBlockListenerAbstract; } diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java index 5be09a34..e7098255 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java +++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java @@ -61,14 +61,26 @@ public final class VanillaCommandWrapper extends VanillaCommand { // Some commands use the worldserver variable but we leave it full of null values, // so we must temporarily populate it with the world of the commandsender WorldServer[] prev = MinecraftServer.getServer().worldServer; - MinecraftServer.getServer().worldServer = new WorldServer[]{(WorldServer) icommandlistener.getWorld()}; + MinecraftServer server = MinecraftServer.getServer(); + server.worldServer = new WorldServer[server.worlds.size()]; + server.worldServer[0] = (WorldServer) icommandlistener.getWorld(); + int bpos = 0; + for (int pos = 1; pos < server.worldServer.length; pos++) { + WorldServer world = server.worlds.get(bpos++); + if (server.worldServer[0] == world) { + pos--; + continue; + } + server.worldServer[pos] = world; + } + try { if (vanillaCommand.canUse(icommandlistener)) { if (i > -1) { List<Entity> list = ((List<Entity>)PlayerSelector.getPlayers(icommandlistener, as[i], Entity.class)); String s2 = as[i]; - icommandlistener.a(EnumCommandResult.AFFECTED_ENTITIES, list.size()); + icommandlistener.a(CommandObjectiveExecutor.EnumCommandResult.AFFECTED_ENTITIES, list.size()); Iterator<Entity> iterator = list.iterator(); while (iterator.hasNext()) { @@ -94,7 +106,7 @@ public final class VanillaCommandWrapper extends VanillaCommand { } as[i] = s2; } else { - icommandlistener.a(EnumCommandResult.AFFECTED_ENTITIES, 1); + icommandlistener.a(CommandObjectiveExecutor.EnumCommandResult.AFFECTED_ENTITIES, 1); vanillaCommand.execute(icommandlistener, as); j++; } @@ -115,19 +127,18 @@ public final class VanillaCommandWrapper extends VanillaCommand { ChatMessage chatmessage3 = new ChatMessage("commands.generic.exception", new Object[0]); chatmessage3.getChatModifier().setColor(EnumChatFormat.RED); icommandlistener.sendMessage(chatmessage3); - if(icommandlistener instanceof TileEntityCommandListener) { - TileEntityCommandListener listener = (TileEntityCommandListener) icommandlistener; - MinecraftServer.getLogger().log(Level.WARN, String.format("CommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().getX(), listener.getChunkCoordinates().getY(), listener.getChunkCoordinates().getZ()), throwable); - } else if (icommandlistener instanceof EntityMinecartCommandBlockListener) { - EntityMinecartCommandBlockListener listener = (EntityMinecartCommandBlockListener) icommandlistener; - MinecraftServer.getLogger().log(Level.WARN, String.format("MinecartCommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().getX(), listener.getChunkCoordinates().getY(), listener.getChunkCoordinates().getZ()), throwable); + if (icommandlistener.f() instanceof EntityMinecartCommandBlock) { + MinecraftServer.LOGGER.log(Level.WARN, String.format("MinecartCommandBlock at (%d,%d,%d) failed to handle command", icommandlistener.getChunkCoordinates().getX(), icommandlistener.getChunkCoordinates().getY(), icommandlistener.getChunkCoordinates().getZ()), throwable); + } else if(icommandlistener instanceof CommandBlockListenerAbstract) { + CommandBlockListenerAbstract listener = (CommandBlockListenerAbstract) icommandlistener; + MinecraftServer.LOGGER.log(Level.WARN, String.format("CommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().getX(), listener.getChunkCoordinates().getY(), listener.getChunkCoordinates().getZ()), throwable); } else { - MinecraftServer.getLogger().log(Level.WARN, String.format("Unknown CommandBlock failed to handle command"), throwable); + MinecraftServer.LOGGER.log(Level.WARN, String.format("Unknown CommandBlock failed to handle command"), throwable); } } finally { MinecraftServer.getServer().worldServer = prev; } - icommandlistener.a(EnumCommandResult.SUCCESS_COUNT, j); + icommandlistener.a(CommandObjectiveExecutor.EnumCommandResult.SUCCESS_COUNT, j); return j; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftGuardian.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftGuardian.java index 073d5e19..e015a39e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftGuardian.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftGuardian.java @@ -24,7 +24,7 @@ public class CraftGuardian extends CraftMonster implements Guardian { @Override public boolean isElder() { - return ((EntityGuardian)entity).cl(); + return ((EntityGuardian)entity).cn(); } @Override @@ -37,7 +37,7 @@ public class CraftGuardian extends CraftMonster implements Guardian { entityGuardian.a( false ); // Since minecraft does not reset the elder Guardian to a guardian we have to do that - entity.a(0.85F, 0.85F); + entity.setSize(0.85F, 0.85F); // Since aW() calls its supers it will try to re register attributes which is invalid // PAIL: rename and check these on update @@ -47,10 +47,10 @@ public class CraftGuardian extends CraftMonster implements Guardian { entityGuardian.getAttributeInstance(GenericAttributes.maxHealth).setValue(30.0D); // Update pathfinding (random stroll back to 80) - entityGuardian.bq.b(80); + entityGuardian.br.b(80); // Tell minecraft that we need persistence since the guardian changed - entityGuardian.bW(); + entityGuardian.initAttributes(); } } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index 0e841856..84999fd4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -227,8 +227,8 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { } break; case ANVIL: - if (craftinv.getInventory() instanceof TileEntityContainerAnvil) { - getHandle().openTileEntity((TileEntityContainerAnvil) craftinv.getInventory()); + if (craftinv.getInventory() instanceof BlockAnvil.TileEntityContainerAnvil) { + getHandle().openTileEntity((BlockAnvil.TileEntityContainerAnvil) craftinv.getInventory()); } else { openCustomInventory(inventory, player, "minecraft:anvil"); } @@ -277,7 +277,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { if (location == null) { location = getLocation(); } - getHandle().openTileEntity(new TileEntityContainerWorkbench(getHandle().world, new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ()))); + getHandle().openTileEntity(new BlockWorkbench.TileEntityContainerWorkbench(getHandle().world, new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ()))); if (force) { getHandle().activeContainer.checkReachable = false; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java index 958ec2fe..03e0730b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java @@ -77,24 +77,24 @@ public abstract class CraftMinecart extends CraftVehicle implements Minecart { public void setDisplayBlock(MaterialData material) { if(material != null) { IBlockData block = CraftMagicNumbers.getBlock(material.getItemTypeId()).fromLegacyData(material.getData()); - this.getHandle().a(block); + this.getHandle().setDisplayBlock(block); } else { // Set block to air (default) and set the flag to not have a display block. - this.getHandle().a(Blocks.AIR.getBlockData()); + this.getHandle().setDisplayBlock(Blocks.AIR.getBlockData()); this.getHandle().a(false); } } public MaterialData getDisplayBlock() { - IBlockData blockData = getHandle().t(); // PAIL: Rename + IBlockData blockData = getHandle().getDisplayBlock(); return CraftMagicNumbers.getMaterial(blockData.getBlock()).getNewData((byte) blockData.getBlock().toLegacyData(blockData)); } public void setDisplayBlockOffset(int offset) { - getHandle().l(offset); // PAIL: Rename + getHandle().SetDisplayBlockOffset(offset); } public int getDisplayBlockOffset() { - return getHandle().v(); // PAIL: Rename + return getHandle().getDisplayBlockOffset(); } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPainting.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPainting.java index efad618f..3e9448a9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPainting.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPainting.java @@ -1,7 +1,7 @@ package org.bukkit.craftbukkit.entity; import net.minecraft.server.EntityPainting; -import net.minecraft.server.EnumArt; +import net.minecraft.server.EntityPainting.EnumArt; import net.minecraft.server.WorldServer; import org.bukkit.Art; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 6361b44c..05923b44 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -187,7 +187,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { getHandle().listName = name.equals(getName()) ? null : CraftChatMessage.fromString(name)[0]; for (EntityPlayer player : (List<EntityPlayer>)server.getHandle().players) { if (player.getBukkitEntity().canSee(this)) { - player.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.UPDATE_DISPLAY_NAME, getHandle())); + player.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.UPDATE_DISPLAY_NAME, getHandle())); } } } @@ -760,7 +760,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } getHandle().e((Entity) getHandle()); // RENAME - getHandle().playerInteractManager.setGameMode(EnumGamemode.getById(mode.getValue())); + getHandle().playerInteractManager.setGameMode(WorldSettings.EnumGamemode.getById(mode.getValue())); getHandle().fallDistance = 0; getHandle().playerConnection.sendPacket(new PacketPlayOutGameStateChange(3, mode.getValue())); } @@ -889,7 +889,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } //remove the hidden player from this player user list - getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.REMOVE_PLAYER, other)); + getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, other)); } @Override @@ -903,7 +903,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { EntityTracker tracker = ((WorldServer) entity.world).tracker; EntityPlayer other = ((CraftPlayer) player).getHandle(); - getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.ADD_PLAYER, other)); + getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, other)); EntityTrackerEntry entry = (EntityTrackerEntry) tracker.trackedEntities.get(other.getId()); if (entry != null && !entry.trackedPlayers.contains(getHandle())) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java index 0805dfe0..61330d24 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java @@ -31,7 +31,7 @@ public class CraftRabbit extends CraftAnimals implements Rabbit { @Override public Type getRabbitType() { - int type = getHandle().cl(); // PAIL: Rename + int type = getHandle().getRabbitType(); return CraftMagicMapping.fromMagic(type); } @@ -46,7 +46,7 @@ public class CraftRabbit extends CraftAnimals implements Rabbit { entity.initializePathFinderGoals(); } - entity.r(CraftMagicMapping.toMagic(type)); // PAIL: Rename + entity.setRabbitType(CraftMagicMapping.toMagic(type)); } private static class CraftMagicMapping { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 60e2a4f5..7da317c8 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -399,7 +399,7 @@ public class CraftEventFactory { EntityDamageEvent event; if (damager == null) { event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.BLOCK_EXPLOSION, modifiers, modifierFunctions); - } else if (entity instanceof EntityEnderDragon && ((EntityEnderDragon) entity).bx == damager) { + } else if (entity instanceof EntityEnderDragon && ((EntityEnderDragon) entity).bA == damager) { event = new EntityDamageEvent(entity.getBukkitEntity(), DamageCause.ENTITY_EXPLOSION, modifiers, modifierFunctions); } else { if (damager instanceof org.bukkit.entity.TNTPrimed) { diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java index 33af06d4..4e925824 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java @@ -203,7 +203,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator { } @Override - public List<?> getMobsFor(EnumCreatureType type, BlockPosition position) { + public List<BiomeBase.BiomeMeta> getMobsFor(EnumCreatureType type, BlockPosition position) { BiomeBase biomebase = world.getBiome(position); return biomebase == null ? null : biomebase.getMobs(type); diff --git a/src/main/java/org/bukkit/craftbukkit/generator/NormalChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/NormalChunkGenerator.java index 4230bdb2..fc4bc81f 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/NormalChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/NormalChunkGenerator.java @@ -72,7 +72,7 @@ public class NormalChunkGenerator extends InternalChunkGenerator { } @Override - public List<?> getMobsFor(EnumCreatureType ect, BlockPosition position) { + public List<BiomeBase.BiomeMeta> getMobsFor(EnumCreatureType ect, BlockPosition position) { return provider.getMobsFor(ect, position); } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java index 7ae6f12c..a8028e3f 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java @@ -4,8 +4,6 @@ import java.util.HashMap; import java.util.List; import java.util.ListIterator; -import net.minecraft.server.ContainerAnvilInventory; -import net.minecraft.server.ContainerEnchantTableInventory; import net.minecraft.server.IHopper; import net.minecraft.server.IInventory; import net.minecraft.server.InventoryCrafting; @@ -435,7 +433,7 @@ public class CraftInventory implements Inventory { return InventoryType.DISPENSER; } else if (inventory instanceof TileEntityFurnace) { return InventoryType.FURNACE; - } else if (inventory instanceof ContainerEnchantTableInventory) { + } else if (this instanceof CraftInventoryEnchanting) { return InventoryType.ENCHANTING; } else if (inventory instanceof TileEntityBrewingStand) { return InventoryType.BREWING; @@ -447,7 +445,7 @@ public class CraftInventory implements Inventory { return InventoryType.MERCHANT; } else if (inventory instanceof TileEntityBeacon) { return InventoryType.BEACON; - } else if (inventory instanceof ContainerAnvilInventory) { + } else if (this instanceof CraftInventoryAnvil) { return InventoryType.ANVIL; } else if (inventory instanceof IHopper) { return InventoryType.HOPPER; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryEnchanting.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryEnchanting.java index 068881d2..ec28e2e8 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryEnchanting.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryEnchanting.java @@ -3,10 +3,10 @@ package org.bukkit.craftbukkit.inventory; import org.bukkit.inventory.EnchantingInventory; import org.bukkit.inventory.ItemStack; -import net.minecraft.server.ContainerEnchantTableInventory; +import net.minecraft.server.InventorySubcontainer; public class CraftInventoryEnchanting extends CraftInventory implements EnchantingInventory { - public CraftInventoryEnchanting(ContainerEnchantTableInventory inventory) { + public CraftInventoryEnchanting(InventorySubcontainer inventory) { super(inventory); } @@ -21,8 +21,8 @@ public class CraftInventoryEnchanting extends CraftInventory implements Enchanti } @Override - public ContainerEnchantTableInventory getInventory() { - return (ContainerEnchantTableInventory)inventory; + public InventorySubcontainer getInventory() { + return (InventorySubcontainer)inventory; } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java index 53682097..3d6017ca 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -20,7 +20,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import com.google.common.collect.ImmutableMap; -import net.minecraft.server.ChatSerializer; +import net.minecraft.server.IChatBaseComponent.ChatSerializer; import net.minecraft.server.Items; import net.minecraft.server.NBTTagString; import org.bukkit.craftbukkit.util.CraftChatMessage; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java index 42ecde7e..f23decd3 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java @@ -17,7 +17,7 @@ import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap.Builder; import java.util.AbstractList; -import net.minecraft.server.ChatSerializer; +import net.minecraft.server.IChatBaseComponent.ChatSerializer; import net.minecraft.server.IChatBaseComponent; import net.minecraft.server.NBTTagString; import org.bukkit.craftbukkit.util.CraftChatMessage; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java index 06d484c2..ae3341c4 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java @@ -13,7 +13,7 @@ import org.bukkit.craftbukkit.inventory.CraftMetaItem.SerializableMeta; import org.bukkit.inventory.meta.BookMeta; import com.google.common.collect.ImmutableMap.Builder; -import net.minecraft.server.ChatSerializer; +import net.minecraft.server.IChatBaseComponent.ChatSerializer; import net.minecraft.server.IChatBaseComponent; import net.minecraft.server.NBTTagString; import org.bukkit.craftbukkit.util.CraftChatMessage; diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java index 87259f12..197086e3 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java @@ -112,7 +112,7 @@ public final class CraftScoreboardManager implements ScoreboardManager { // CraftBukkit method public void updateAllScoresForList(IScoreboardCriteria criteria, String name, List<EntityPlayer> of) { for (ScoreboardScore score : getScoreboardScores(criteria, name, new ArrayList<ScoreboardScore>())) { - score.updateForList(of); + score.updateForList((List) of); } } } diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java index c4db4621..ce42b307 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java @@ -2,7 +2,7 @@ package org.bukkit.craftbukkit.scoreboard; import java.util.Set; -import net.minecraft.server.EnumNameTagVisibility; +import net.minecraft.server.ScoreboardTeamBase.EnumNameTagVisibility; import org.apache.commons.lang.Validate; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; @@ -96,15 +96,13 @@ final class CraftTeam extends CraftScoreboardComponent implements Team { public NameTagVisibility getNameTagVisibility() throws IllegalArgumentException { CraftScoreboard scoreboard = checkState(); - // PAIL: Rename - return notchToBukkit(team.i()); // i is sent in PacketPlayOutScoreboardTeam, cannot see a use of j + return notchToBukkit(team.getNameTagVisibility()); } public void setNameTagVisibility(NameTagVisibility visibility) throws IllegalArgumentException { CraftScoreboard scoreboard = checkState(); - // PAIL: Rename - team.a(bukkitToNotch(visibility)); // i is sent in PacketPlayOutScoreboardTeam, cannot see a use of j + team.setNameTagVisibility(bukkitToNotch(visibility)); } public Set<OfflinePlayer> getPlayers() throws IllegalStateException { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java index d2b41c30..38ef8216 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java @@ -10,7 +10,7 @@ import net.minecraft.server.ChatClickable; import net.minecraft.server.ChatComponentText; import net.minecraft.server.ChatModifier; import net.minecraft.server.EnumChatFormat; -import net.minecraft.server.EnumClickAction; +import net.minecraft.server.ChatClickable.EnumClickAction; import net.minecraft.server.IChatBaseComponent; import com.google.common.collect.ImmutableMap; diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java index b84ed46d..589dba72 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -5,11 +5,14 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import net.minecraft.server.Block; import net.minecraft.server.Blocks; import net.minecraft.server.Item; import net.minecraft.server.MinecraftKey; +import net.minecraft.server.MojangsonParseException; import net.minecraft.server.MojangsonParser; import net.minecraft.server.NBTTagCompound; import net.minecraft.server.StatisticList; @@ -107,7 +110,11 @@ public final class CraftMagicNumbers implements UnsafeValues { public ItemStack modifyItemStack(ItemStack stack, String arguments) { net.minecraft.server.ItemStack nmsStack = CraftItemStack.asNMSCopy(stack); - nmsStack.setTag((NBTTagCompound) MojangsonParser.parse(arguments)); + try { + nmsStack.setTag((NBTTagCompound) MojangsonParser.parse(arguments)); + } catch (MojangsonParseException ex) { + Logger.getLogger(CraftMagicNumbers.class.getName()).log(Level.SEVERE, null, ex); + } stack.setItemMeta(CraftItemStack.getItemMeta(nmsStack)); diff --git a/src/test/java/org/bukkit/ArtTest.java b/src/test/java/org/bukkit/ArtTest.java index c8e11d86..7f402889 100644 --- a/src/test/java/org/bukkit/ArtTest.java +++ b/src/test/java/org/bukkit/ArtTest.java @@ -8,7 +8,7 @@ import java.util.EnumMap; import java.util.List; import java.util.Map; -import net.minecraft.server.EnumArt; +import net.minecraft.server.EntityPainting.EnumArt; import org.bukkit.craftbukkit.CraftArt; import org.junit.Test; diff --git a/src/test/java/org/bukkit/PerMaterialTest.java b/src/test/java/org/bukkit/PerMaterialTest.java index 1b532e14..2e212ef7 100644 --- a/src/test/java/org/bukkit/PerMaterialTest.java +++ b/src/test/java/org/bukkit/PerMaterialTest.java @@ -34,7 +34,7 @@ public class PerMaterialTest extends AbstractTestingBase { @BeforeClass public static void getFireValues() { - fireValues = Util.getInternalState(BlockFire.class, Blocks.FIRE, "S"); + fireValues = Util.getInternalState(BlockFire.class, Blocks.FIRE, "T"); } @Parameters(name= "{index}: {0}") diff --git a/src/test/java/org/bukkit/support/DummyEnchantments.java b/src/test/java/org/bukkit/support/DummyEnchantments.java index a0e0396b..ac34a438 100644 --- a/src/test/java/org/bukkit/support/DummyEnchantments.java +++ b/src/test/java/org/bukkit/support/DummyEnchantments.java @@ -4,7 +4,7 @@ import net.minecraft.server.Enchantment; public class DummyEnchantments { static { - Enchantment.getNames(); + Enchantment.getEffects(); org.bukkit.enchantments.Enchantment.stopAcceptingRegistrations(); } |