From dbb5e6e3cd35ca82efb39a44fcf6542733d2bc00 Mon Sep 17 00:00:00 2001 From: Travis Watkins Date: Thu, 26 Jun 2014 13:05:08 -0500 Subject: Update CraftBukkit to Minecraft 1.7.10 --- src/main/java/org/bukkit/craftbukkit/CraftChunk.java | 4 ++-- .../org/bukkit/craftbukkit/CraftProfileBanList.java | 10 +++++----- src/main/java/org/bukkit/craftbukkit/CraftServer.java | 18 +++++++++--------- src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 18 +++++++++--------- .../java/org/bukkit/craftbukkit/block/CraftBlock.java | 6 +++--- .../bukkit/craftbukkit/block/CraftCommandBlock.java | 8 ++++---- .../craftbukkit/block/CraftCreatureSpawner.java | 16 ++++++++-------- .../org/bukkit/craftbukkit/block/CraftNoteBlock.java | 4 ++-- .../java/org/bukkit/craftbukkit/block/CraftSkull.java | 2 +- .../bukkit/craftbukkit/chunkio/ChunkIOProvider.java | 4 ++-- .../craftbukkit/command/VanillaCommandWrapper.java | 12 ++++++------ .../java/org/bukkit/craftbukkit/entity/CraftBat.java | 4 ++-- .../org/bukkit/craftbukkit/entity/CraftFirework.java | 2 +- .../org/bukkit/craftbukkit/entity/CraftItemFrame.java | 4 ++-- .../bukkit/craftbukkit/entity/CraftLivingEntity.java | 4 ++-- .../craftbukkit/entity/CraftMinecartCommand.java | 8 ++++---- .../org/bukkit/craftbukkit/entity/CraftPlayer.java | 19 +++++++++---------- .../bukkit/craftbukkit/entity/CraftWitherSkull.java | 4 ++-- .../bukkit/craftbukkit/event/CraftEventFactory.java | 10 +++++----- .../craftbukkit/generator/CustomChunkGenerator.java | 6 +++--- .../craftbukkit/inventory/CraftInventoryCustom.java | 2 +- .../bukkit/craftbukkit/inventory/CraftMetaBook.java | 2 +- .../bukkit/craftbukkit/inventory/CraftMetaItem.java | 2 +- .../bukkit/craftbukkit/inventory/CraftMetaSkull.java | 4 ++-- .../org/bukkit/craftbukkit/map/CraftMapRenderer.java | 4 ++-- .../bukkit/craftbukkit/scoreboard/CraftCriteria.java | 2 +- .../scoreboard/CraftScoreboardManager.java | 2 +- .../craftbukkit/util/BlockStateListPopulator.java | 4 ++-- .../org/bukkit/craftbukkit/util/CraftChatMessage.java | 2 +- .../bukkit/craftbukkit/util/CraftDamageSource.java | 8 ++++---- .../bukkit/craftbukkit/util/CraftMagicNumbers.java | 18 +++++++++--------- .../craftbukkit/util/StructureGrowDelegate.java | 2 +- 32 files changed, 107 insertions(+), 108 deletions(-) (limited to 'src/main/java/org') diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java index b2c6ef45..99d3d40f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java @@ -150,7 +150,7 @@ public class CraftChunk implements Chunk { public ChunkSnapshot getChunkSnapshot(boolean includeMaxBlockY, boolean includeBiome, boolean includeBiomeTempRain) { net.minecraft.server.Chunk chunk = getHandle(); - ChunkSection[] cs = chunk.i(); /* Get sections */ + ChunkSection[] cs = chunk.getSections(); short[][] sectionBlockIDs = new short[cs.length][]; byte[][] sectionBlockData = new byte[cs.length][]; byte[][] sectionSkyLights = new byte[cs.length][]; @@ -221,7 +221,7 @@ public class CraftChunk implements Chunk { if (includeBiome) { biome = new BiomeBase[256]; for (int i = 0; i < 256; i++) { - biome[i] = chunk.a(i & 0xF, i >> 4, wcm); + biome[i] = chunk.getBiome(i & 0xF, i >> 4, wcm); } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java b/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java index 20433590..fad6a965 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftProfileBanList.java @@ -26,7 +26,7 @@ public class CraftProfileBanList implements org.bukkit.BanList { public org.bukkit.BanEntry getBanEntry(String target) { Validate.notNull(target, "Target cannot be null"); - GameProfile profile = MinecraftServer.getServer().getUserCache().a(target); + GameProfile profile = MinecraftServer.getServer().getUserCache().getProfile(target); if (profile == null) { return null; } @@ -43,7 +43,7 @@ public class CraftProfileBanList implements org.bukkit.BanList { public org.bukkit.BanEntry addBan(String target, String reason, Date expires, String source) { Validate.notNull(target, "Ban target cannot be null"); - GameProfile profile = MinecraftServer.getServer().getUserCache().a(target); + GameProfile profile = MinecraftServer.getServer().getUserCache().getProfile(target); if (profile == null) { return null; } @@ -67,7 +67,7 @@ public class CraftProfileBanList implements org.bukkit.BanList { public Set getBanEntries() { ImmutableSet.Builder builder = ImmutableSet.builder(); for (JsonListEntry entry : list.getValues()) { - GameProfile profile = (GameProfile) entry.f(); // Should be getKey + GameProfile profile = (GameProfile) entry.getKey(); builder.add(new CraftProfileBanEntry(profile, (GameProfileBanEntry) entry, list)); } @@ -78,7 +78,7 @@ public class CraftProfileBanList implements org.bukkit.BanList { public boolean isBanned(String target) { Validate.notNull(target, "Target cannot be null"); - GameProfile profile = MinecraftServer.getServer().getUserCache().a(target); + GameProfile profile = MinecraftServer.getServer().getUserCache().getProfile(target); if (profile == null) { return false; } @@ -90,7 +90,7 @@ public class CraftProfileBanList implements org.bukkit.BanList { public void pardon(String target) { Validate.notNull(target, "Target cannot be null"); - GameProfile profile = MinecraftServer.getServer().getUserCache().a(target); + GameProfile profile = MinecraftServer.getServer().getUserCache().getProfile(target); list.remove(profile); } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 883f8099..a666131f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -760,7 +760,7 @@ public final class CraftServer implements Server { boolean animals = config.getBoolean("spawn-animals", console.getSpawnAnimals()); boolean monsters = config.getBoolean("spawn-monsters", console.worlds.get(0).difficulty != EnumDifficulty.PEACEFUL); - EnumDifficulty difficulty = EnumDifficulty.a(config.getInt("difficulty", console.worlds.get(0).difficulty.ordinal())); + EnumDifficulty difficulty = EnumDifficulty.getById(config.getInt("difficulty", console.worlds.get(0).difficulty.ordinal())); online.value = config.getBoolean("online-mode", console.getOnlineMode()); console.setSpawnAnimals(config.getBoolean("spawn-animals", console.getSpawnAnimals())); @@ -961,7 +961,7 @@ public final class CraftServer implements Server { } while(used); boolean hardcore = false; - WorldServer internal = new WorldServer(console, new ServerNBTManager(getWorldContainer(), name, true), name, dimension, new WorldSettings(creator.seed(), EnumGamemode.a(getDefaultGameMode().getValue()), generateStructures, hardcore, type), console.methodProfiler, creator.environment(), generator); + WorldServer internal = new WorldServer(console, new ServerNBTManager(getWorldContainer(), name, true), name, dimension, new WorldSettings(creator.seed(), EnumGamemode.getById(getDefaultGameMode().getValue()), generateStructures, hardcore, type), console.methodProfiler, creator.environment(), generator); if (!(worlds.containsKey(name.toLowerCase()))) { return null; @@ -1350,7 +1350,7 @@ public final class CraftServer implements Server { OfflinePlayer result = getPlayerExact(name); if (result == null) { // This is potentially blocking :( - GameProfile profile = MinecraftServer.getServer().getUserCache().a(name); + GameProfile profile = MinecraftServer.getServer().getUserCache().getProfile(name); if (profile == null) { // Make an OfflinePlayer using an offline mode UUID since the name has no profile result = getOfflinePlayer(new GameProfile(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)), name)); @@ -1414,7 +1414,7 @@ public final class CraftServer implements Server { Set result = new HashSet(); for (JsonListEntry entry : playerList.getProfileBans().getValues()) { - result.add(getOfflinePlayer((GameProfile) entry.f())); // Should be getKey + result.add(getOfflinePlayer((GameProfile) entry.getKey())); } return result; @@ -1436,7 +1436,7 @@ public final class CraftServer implements Server { @Override public void setWhitelist(boolean value) { playerList.setHasWhitelist(value); - console.getPropertyManager().a("white-list", value); + console.getPropertyManager().setProperty("white-list", value); } @Override @@ -1444,7 +1444,7 @@ public final class CraftServer implements Server { Set result = new LinkedHashSet(); for (JsonListEntry entry : playerList.getWhitelist().getValues()) { - result.add(getOfflinePlayer((GameProfile) entry.f())); // Should be getKey + result.add(getOfflinePlayer((GameProfile) entry.getKey())); } return result; @@ -1455,7 +1455,7 @@ public final class CraftServer implements Server { Set result = new HashSet(); for (JsonListEntry entry : playerList.getOPs().getValues()) { - result.add(getOfflinePlayer((GameProfile) entry.f())); // Should be getKey + result.add(getOfflinePlayer((GameProfile) entry.getKey())); } return result; @@ -1468,7 +1468,7 @@ public final class CraftServer implements Server { @Override public GameMode getDefaultGameMode() { - return GameMode.getByValue(console.worlds.get(0).getWorldData().getGameType().a()); + return GameMode.getByValue(console.worlds.get(0).getWorldData().getGameType().getId()); } @Override @@ -1476,7 +1476,7 @@ public final class CraftServer implements Server { Validate.notNull(mode, "Mode cannot be null"); for (World world : getWorlds()) { - ((CraftWorld) world).getHandle().worldData.setGameType(EnumGamemode.a(mode.getValue())); + ((CraftWorld) world).getHandle().worldData.setGameType(EnumGamemode.getById(mode.getValue())); } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 9bc72aa8..f4dec5bf 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -407,7 +407,7 @@ public class CraftWorld implements World { break; } - return gen.a(world, rand, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); + return gen.generate(world, rand, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); } public boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate) { @@ -704,7 +704,7 @@ public class CraftWorld implements World { } public void setDifficulty(Difficulty difficulty) { - this.getHandle().difficulty = EnumDifficulty.a(difficulty.getValue()); + this.getHandle().difficulty = EnumDifficulty.getById(difficulty.getValue()); } public Difficulty getDifficulty() { @@ -842,8 +842,8 @@ public class CraftWorld implements World { double y = location.getBlockY() + 0.5; double z = location.getBlockZ() + 0.5; - EntityFallingBlock entity = new EntityFallingBlock(world, x, y, z, net.minecraft.server.Block.e(material.getId()), data); - entity.b = 1; // ticksLived + EntityFallingBlock entity = new EntityFallingBlock(world, x, y, z, net.minecraft.server.Block.getById(material.getId()), data); + entity.ticksLived = 1; world.addEntity(entity, SpawnReason.CUSTOM); return (FallingBlock) entity.getBukkitEntity(); @@ -877,7 +877,7 @@ public class CraftWorld implements World { int type = world.getTypeId((int) x, (int) y, (int) z); int data = world.getData((int) x, (int) y, (int) z); - entity = new EntityFallingBlock(world, x + 0.5, y + 0.5, z + 0.5, net.minecraft.server.Block.e(type), data); + entity = new EntityFallingBlock(world, x + 0.5, y + 0.5, z + 0.5, net.minecraft.server.Block.getById(type), data); } else if (Projectile.class.isAssignableFrom(clazz)) { if (Snowball.class.isAssignableFrom(clazz)) { entity = new EntitySnowball(world, x, y, z); @@ -1040,7 +1040,7 @@ public class CraftWorld implements World { entity = new EntityItemFrame(world, (int) x, (int) y, (int) z, dir); } else if (LeashHitch.class.isAssignableFrom(clazz)) { entity = new EntityLeash(world, (int) x, (int) y, (int) z); - entity.n = true; + entity.attachedToPlayer = true; } if (entity != null && !((EntityHanging) entity).survives()) { @@ -1062,7 +1062,7 @@ public class CraftWorld implements World { if (entity != null) { if (entity instanceof EntityInsentient) { - ((EntityInsentient) entity).a((GroupDataEntity) null); // Should be prepare? + ((EntityInsentient) entity).prepare((GroupDataEntity) null); } world.addEntity(entity, reason); @@ -1279,11 +1279,11 @@ public class CraftWorld implements World { } public String[] getGameRules() { - return getHandle().getGameRules().b(); + return getHandle().getGameRules().getGameRules(); } public boolean isGameRule(String rule) { - return getHandle().getGameRules().e(rule); + return getHandle().getGameRules().contains(rule); } public void processChunkGC() { diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java index 7dded2b4..87d79aec 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -381,7 +381,7 @@ public class CraftBlock implements Block { private boolean itemCausesDrops(ItemStack item) { net.minecraft.server.Block block = this.getNMSBlock(); - net.minecraft.server.Item itemType = item != null ? net.minecraft.server.Item.d(item.getTypeId()) : null; + net.minecraft.server.Item itemType = item != null ? net.minecraft.server.Item.getById(item.getTypeId()) : null; return block != null && (block.getMaterial().isAlwaysDestroyable() || (itemType != null && itemType.canDestroySpecialBlock(block))); } @@ -428,7 +428,7 @@ public class CraftBlock implements Block { nmsStack.setTag(new NBTTagCompound()); NBTTagCompound nbttagcompound = new NBTTagCompound(); - GameProfileSerializer.a(nbttagcompound, tileentityskull.getGameProfile()); + GameProfileSerializer.serialize(nbttagcompound, tileentityskull.getGameProfile()); nmsStack.getTag().set("SkullOwner", nbttagcompound); } @@ -458,7 +458,7 @@ public class CraftBlock implements Block { /* Build biome index based lookup table for BiomeBase to Biome mapping */ static { - BIOME_MAPPING = new Biome[BiomeBase.n().length]; + BIOME_MAPPING = new Biome[BiomeBase.getBiomes().length]; BIOMEBASE_MAPPING = new BiomeBase[Biome.values().length]; BIOME_MAPPING[BiomeBase.OCEAN.id] = Biome.OCEAN; BIOME_MAPPING[BiomeBase.PLAINS.id] = Biome.PLAINS; diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java index e23c1cec..57af2bc5 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java @@ -15,8 +15,8 @@ public class CraftCommandBlock extends CraftBlockState implements CommandBlock { CraftWorld world = (CraftWorld) block.getWorld(); commandBlock = (TileEntityCommand) world.getTileEntityAt(getX(), getY(), getZ()); - command = commandBlock.a().e; - name = commandBlock.a().getName(); + command = commandBlock.getCommandBlock().getCommand(); + name = commandBlock.getCommandBlock().getName(); } public String getCommand() { @@ -39,8 +39,8 @@ public class CraftCommandBlock extends CraftBlockState implements CommandBlock { boolean result = super.update(force, applyPhysics); if (result) { - commandBlock.a().a(command); - commandBlock.a().b(name); + commandBlock.getCommandBlock().setCommand(command); + commandBlock.getCommandBlock().setName(name); } return result; diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java index 86839ad9..fa4c0a96 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java @@ -19,16 +19,16 @@ public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpa @Deprecated public CreatureType getCreatureType() { - return CreatureType.fromName(spawner.a().getMobName()); + return CreatureType.fromName(spawner.getSpawner().getMobName()); } public EntityType getSpawnedType() { - return EntityType.fromName(spawner.a().getMobName()); + return EntityType.fromName(spawner.getSpawner().getMobName()); } @Deprecated public void setCreatureType(CreatureType creatureType) { - spawner.a().a(creatureType.getName()); + spawner.getSpawner().setMobName(creatureType.getName()); } public void setSpawnedType(EntityType entityType) { @@ -36,12 +36,12 @@ public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpa throw new IllegalArgumentException("Can't spawn EntityType " + entityType + " from mobspawners!"); } - spawner.a().a(entityType.getName()); + spawner.getSpawner().setMobName(entityType.getName()); } @Deprecated public String getCreatureTypeId() { - return spawner.a().getMobName(); + return spawner.getSpawner().getMobName(); } @Deprecated @@ -50,7 +50,7 @@ public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpa } public String getCreatureTypeName() { - return spawner.a().getMobName(); + return spawner.getSpawner().getMobName(); } public void setCreatureTypeByName(String creatureType) { @@ -63,11 +63,11 @@ public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpa } public int getDelay() { - return spawner.a().spawnDelay; + return spawner.getSpawner().spawnDelay; } public void setDelay(int delay) { - spawner.a().spawnDelay = delay; + spawner.getSpawner().spawnDelay = delay; } } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftNoteBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftNoteBlock.java index 53173a17..b83e3351 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftNoteBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftNoteBlock.java @@ -53,7 +53,7 @@ public class CraftNoteBlock extends CraftBlockState implements NoteBlock { Block block = getBlock(); if (block.getType() == Material.NOTE_BLOCK) { - world.getHandle().playNote(getX(), getY(), getZ(), CraftMagicNumbers.getBlock(block), instrument, note); + world.getHandle().playBlockAction(getX(), getY(), getZ(), CraftMagicNumbers.getBlock(block), instrument, note); return true; } else { return false; @@ -65,7 +65,7 @@ public class CraftNoteBlock extends CraftBlockState implements NoteBlock { Block block = getBlock(); if (block.getType() == Material.NOTE_BLOCK) { - world.getHandle().playNote(getX(), getY(), getZ(), CraftMagicNumbers.getBlock(block), instrument.getType(), note.getId()); + world.getHandle().playBlockAction(getX(), getY(), getZ(), CraftMagicNumbers.getBlock(block), instrument.getType(), note.getId()); return true; } else { return false; diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java index 8ebb22cf..dc9a587e 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java @@ -152,7 +152,7 @@ public class CraftSkull extends CraftBlockState implements Skull { return false; } - GameProfile profile = MinecraftServer.getServer().getUserCache().a(name); + GameProfile profile = MinecraftServer.getServer().getUserCache().getProfile(name); if (profile == null) { return false; } diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java index 1440349b..9cf1b493 100644 --- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java +++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java @@ -35,7 +35,7 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider 0, "Max health must be greater than 0"); - getHandle().getAttributeInstance(GenericAttributes.a).setValue(amount); + getHandle().getAttributeInstance(GenericAttributes.maxHealth).setValue(amount); if (getHealth() > amount) { setHealth(amount); @@ -348,7 +348,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { } public boolean hasLineOfSight(Entity other) { - return getHandle().p(((CraftEntity) other).getHandle()); + return getHandle().hasLineOfSight(((CraftEntity) other).getHandle()); } public boolean getRemoveWhenFarAway() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java index 4c237270..813b080a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java @@ -24,17 +24,17 @@ public class CraftMinecartCommand extends CraftMinecart implements CommandMineca @Override public String getCommand() { - return ((EntityMinecartCommandBlock) getHandle()).e().e; + return ((EntityMinecartCommandBlock) getHandle()).getCommandBlock().getCommand(); } @Override public void setCommand(String command) { - ((EntityMinecartCommandBlock) getHandle()).e().a(command != null ? command : ""); + ((EntityMinecartCommandBlock) getHandle()).getCommandBlock().setCommand(command != null ? command : ""); } @Override public void setName(String name) { - ((EntityMinecartCommandBlock) getHandle()).e().b(name != null ? name : "@"); + ((EntityMinecartCommandBlock) getHandle()).getCommandBlock().setName(name != null ? name : "@"); } @Override @@ -52,7 +52,7 @@ public class CraftMinecartCommand extends CraftMinecart implements CommandMineca @Override public String getName() { - return ((EntityMinecartCommandBlock) getHandle()).e().getName(); + return ((EntityMinecartCommandBlock) getHandle()).getCommandBlock().getName(); } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index a0e27bc3..9760f8f9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -568,7 +568,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public boolean hasAchievement(Achievement achievement) { Validate.notNull(achievement, "Achievement cannot be null"); - return getHandle().getStatisticManager().a(CraftStatistic.getNMSAchievement(achievement)); + return getHandle().getStatisticManager().hasAchievement(CraftStatistic.getNMSAchievement(achievement)); } @Override @@ -779,7 +779,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return; } - getHandle().playerInteractManager.setGameMode(EnumGamemode.a(mode.getValue())); + getHandle().playerInteractManager.setGameMode(EnumGamemode.getById(mode.getValue())); getHandle().fallDistance = 0; getHandle().playerConnection.sendPacket(new PacketPlayOutGameStateChange(3, mode.getValue())); } @@ -787,7 +787,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public GameMode getGameMode() { - return GameMode.getByValue(getHandle().playerInteractManager.getGameMode().a()); + return GameMode.getByValue(getHandle().playerInteractManager.getGameMode().getId()); } public void giveExp(int exp) { @@ -1258,13 +1258,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void updateScaledHealth() { - AttributeMapServer attributemapserver = (AttributeMapServer) getHandle().bb(); - Set set = attributemapserver.b(); + AttributeMapServer attributemapserver = (AttributeMapServer) getHandle().getAttributeMap(); + Set set = attributemapserver.getAttributes(); injectScaledMaxHealth(set, true); getHandle().getDataWatcher().watch(6, (float) getScaledHealth()); - getHandle().playerConnection.sendPacket(new PacketPlayOutUpdateHealth(getScaledHealth(), getHandle().getFoodData().a(), getHandle().getFoodData().e())); + getHandle().playerConnection.sendPacket(new PacketPlayOutUpdateHealth(getScaledHealth(), getHandle().getFoodData().getFoodLevel(), getHandle().getFoodData().getSaturationLevel())); getHandle().playerConnection.sendPacket(new PacketPlayOutUpdateAttributes(getHandle().getId(), set)); set.clear(); @@ -1276,13 +1276,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return; } for (Object genericInstance : collection) { - IAttribute attribute = ((AttributeInstance) genericInstance).a(); - if (attribute.a().equals("generic.maxHealth")) { + IAttribute attribute = ((AttributeInstance) genericInstance).getAttribute(); + if (attribute.getName().equals("generic.maxHealth")) { collection.remove(genericInstance); break; } - continue; } - collection.add(new AttributeModifiable(getHandle().bb(), (new AttributeRanged("generic.maxHealth", scaledHealth ? healthScale : getMaxHealth(), 0.0D, Float.MAX_VALUE)).a("Max Health").a(true))); + collection.add(new AttributeModifiable(getHandle().getAttributeMap(), (new AttributeRanged("generic.maxHealth", scaledHealth ? healthScale : getMaxHealth(), 0.0D, Float.MAX_VALUE)).a("Max Health").a(true))); } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitherSkull.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitherSkull.java index 2e276166..563177e9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitherSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitherSkull.java @@ -12,12 +12,12 @@ public class CraftWitherSkull extends CraftFireball implements WitherSkull { @Override public void setCharged(boolean charged) { - getHandle().a(charged); + getHandle().setCharged(charged); } @Override public boolean isCharged() { - return getHandle().f(); + return getHandle().isCharged(); } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 8d2c80fb..2d5182a6 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -95,7 +95,7 @@ public class CraftEventFactory { if (world.getHandle().dimension != 0) return true; if (spawnSize <= 0) return true; - if (((CraftServer) Bukkit.getServer()).getHandle().getOPs().d()) return true; // Should be isEmpty + if (((CraftServer) Bukkit.getServer()).getHandle().getOPs().isEmpty()) return true; if (player.isOp()) return true; ChunkCoordinates chunkcoordinates = worldServer.getSpawn(); @@ -332,7 +332,7 @@ public class CraftEventFactory { */ public static BlockFadeEvent callBlockFadeEvent(Block block, net.minecraft.server.Block type) { BlockState state = block.getState(); - state.setTypeId(net.minecraft.server.Block.b(type)); + state.setTypeId(net.minecraft.server.Block.getId(type)); BlockFadeEvent event = new BlockFadeEvent(block, state); Bukkit.getPluginManager().callEvent(event); @@ -341,7 +341,7 @@ public class CraftEventFactory { public static void handleBlockSpreadEvent(Block block, Block source, net.minecraft.server.Block type, int data) { BlockState state = block.getState(); - state.setTypeId(net.minecraft.server.Block.b(type)); + state.setTypeId(net.minecraft.server.Block.getId(type)); state.setRawData((byte) data); BlockSpreadEvent event = new BlockSpreadEvent(block, source, state); @@ -583,7 +583,7 @@ public class CraftEventFactory { public static void handleBlockGrowEvent(World world, int x, int y, int z, net.minecraft.server.Block type, int data) { Block block = world.getWorld().getBlockAt(x, y, z); CraftBlockState state = (CraftBlockState) block.getState(); - state.setTypeId(net.minecraft.server.Block.b(type)); + state.setTypeId(net.minecraft.server.Block.getId(type)); state.setRawData((byte) data); BlockGrowEvent event = new BlockGrowEvent(block, state); @@ -824,7 +824,7 @@ public class CraftEventFactory { } // Client will have updated its idea of the book item; we need to overwrite that - Slot slot = player.activeContainer.a((IInventory) player.inventory, itemInHandIndex); + Slot slot = player.activeContainer.getSlot(player.inventory, itemInHandIndex); player.playerConnection.sendPacket(new PacketPlayOutSetSlot(player.activeContainer.windowId, slot.rawSlotIndex, itemInHand)); } } diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java index dc509dfa..9a46d0c7 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java @@ -63,7 +63,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator { if (xbtypes != null) { chunk = new Chunk(this.world, x, z); - ChunkSection[] csect = chunk.i(); + ChunkSection[] csect = chunk.getSections(); int scnt = Math.min(csect.length, xbtypes.length); // Loop through returned sections @@ -100,7 +100,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator { if (btypes != null) { chunk = new Chunk(this.world, x, z); - ChunkSection[] csect = chunk.i(); + ChunkSection[] csect = chunk.getSections(); int scnt = Math.min(csect.length, btypes.length); for (int sec = 0; sec < scnt; sec++) { @@ -118,7 +118,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator { chunk = new Chunk(this.world, x, z); // Create empty chunk - ChunkSection[] csect = chunk.i(); + ChunkSection[] csect = chunk.getSections(); scnt = Math.min(scnt, csect.length); // Loop through sections diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCustom.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCustom.java index 533d62ad..8b8a317c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCustom.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCustom.java @@ -144,7 +144,7 @@ public class CraftInventoryCustom extends CraftInventory { return type; } - public void l_() {} + public void closeContainer() {} public InventoryHolder getOwner() { return owner; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java index 67935f3a..1cf8fce4 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java @@ -57,7 +57,7 @@ class CraftMetaBook extends CraftMetaItem implements BookMeta { String[] pageArray = new String[pages.size()]; for (int i = 0; i < pages.size(); i++) { - String page = pages.f(i); + String page = pages.getString(i); pageArray[i] = page; } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java index 7d4114c2..c9738c4f 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -235,7 +235,7 @@ class CraftMetaItem implements ItemMeta, Repairable { lore = new ArrayList(list.size()); for (int index = 0; index < list.size(); index++) { - String line = list.f(index); + String line = list.getString(index); lore.add(line); } } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java index 2fe10005..d648d052 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java @@ -34,7 +34,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { super(tag); if (tag.hasKeyOfType(SKULL_OWNER.NBT, 10)) { - profile = GameProfileSerializer.a(tag.getCompound(SKULL_OWNER.NBT)); + profile = GameProfileSerializer.deserialize(tag.getCompound(SKULL_OWNER.NBT)); } else if (tag.hasKeyOfType(SKULL_OWNER.NBT, 8)) { profile = new GameProfile(null, tag.getString(SKULL_OWNER.NBT)); } @@ -51,7 +51,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { if (hasOwner()) { NBTTagCompound owner = new NBTTagCompound(); - GameProfileSerializer.a(owner, profile); + GameProfileSerializer.serialize(owner, profile); tag.set(SKULL_OWNER.NBT, owner); } } diff --git a/src/main/java/org/bukkit/craftbukkit/map/CraftMapRenderer.java b/src/main/java/org/bukkit/craftbukkit/map/CraftMapRenderer.java index 22e00535..392dba4a 100644 --- a/src/main/java/org/bukkit/craftbukkit/map/CraftMapRenderer.java +++ b/src/main/java/org/bukkit/craftbukkit/map/CraftMapRenderer.java @@ -34,14 +34,14 @@ public class CraftMapRenderer extends MapRenderer { cursors.removeCursor(cursors.getCursor(0)); } - for (Object key : worldMap.g.keySet()) { + for (Object key : worldMap.decorations.keySet()) { // If this cursor is for a player check visibility with vanish system Player other = Bukkit.getPlayerExact((String) key); if (other != null && !player.canSee(other)) { continue; } - WorldMapDecoration decoration = (WorldMapDecoration) worldMap.g.get(key); + WorldMapDecoration decoration = (WorldMapDecoration) worldMap.decorations.get(key); cursors.addCursor(decoration.locX, decoration.locY, (byte) (decoration.rotation & 15), decoration.type); } } diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftCriteria.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftCriteria.java index d2e30967..612a5243 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftCriteria.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftCriteria.java @@ -14,7 +14,7 @@ final class CraftCriteria { static { ImmutableMap.Builder defaults = ImmutableMap.builder(); - for (Map.Entry entry : ((Map ) IScoreboardCriteria.a).entrySet()) { + for (Map.Entry entry : ((Map ) IScoreboardCriteria.criteria).entrySet()) { String name = entry.getKey().toString(); IScoreboardCriteria criteria = (IScoreboardCriteria) entry.getValue(); if (!criteria.getName().equals(name)) { diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java index 84091a4f..87259f12 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java @@ -90,7 +90,7 @@ public final class CraftScoreboardManager implements ScoreboardManager { } // The above is the reverse of the below method. - server.getPlayerList().a((ScoreboardServer) newboard, player.getHandle()); + server.getPlayerList().sendScoreboard((ScoreboardServer) newboard, player.getHandle()); } // CraftBukkit method diff --git a/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java b/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java index 124aa6e4..30f2622d 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java +++ b/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java @@ -23,7 +23,7 @@ public class BlockStateListPopulator { public void setTypeAndData(int x, int y, int z, Block block, int data, int light) { BlockState state = world.getBlockAt(x, y, z).getState(); - state.setTypeId(Block.b(block)); + state.setTypeId(Block.getId(block)); state.setRawData((byte) data); list.add(state); } @@ -39,7 +39,7 @@ public class BlockStateListPopulator { public void setType(int x, int y, int z, Block block) { BlockState state = world.getBlockAt(x, y, z).getState(); - state.setTypeId(Block.b(block)); + state.setTypeId(Block.getId(block)); list.add(state); } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java index 2b57bf88..256f0531 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java @@ -110,7 +110,7 @@ public final class CraftChatMessage { currentChatComponent = new ChatComponentText(""); list.add(currentChatComponent); } - currentChatComponent.a(addition); + currentChatComponent.addSibling(addition); } private IChatBaseComponent[] getOutput() { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftDamageSource.java b/src/main/java/org/bukkit/craftbukkit/util/CraftDamageSource.java index 0a72a953..a8e2b5e2 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftDamageSource.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftDamageSource.java @@ -9,17 +9,17 @@ public final class CraftDamageSource extends DamageSource { // Check ignoresArmor if (original.ignoresArmor()) { - newSource.k(); + newSource.setIgnoreArmor(); } // Check magic - if (original.s()) { - newSource.t(); + if (original.isMagic()) { + newSource.setMagic(); } // Check fire if (original.isExplosion()) { - newSource.n(); + newSource.setExplosion(); } return newSource; diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java index 54e2f5d6..52aa5d18 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -39,34 +39,34 @@ public final class CraftMagicNumbers implements UnsafeValues { @Deprecated // A bad method for bad magic. public static int getId(Block block) { - return Block.b(block); + return Block.getId(block); } public static Material getMaterial(Block block) { - return Material.getMaterial(Block.b(block)); + return Material.getMaterial(Block.getId(block)); } public static Item getItem(Material material) { // TODO: Don't use ID - Item item = Item.d(material.getId()); + Item item = Item.getById(material.getId()); return item; } @Deprecated // A bad method for bad magic. public static Item getItem(int id) { - return Item.d(id); + return Item.getById(id); } @Deprecated // A bad method for bad magic. public static int getId(Item item) { - return Item.b(item); + return Item.getId(item); } public static Material getMaterial(Item item) { // TODO: Don't use ID - Material material = Material.getMaterial(Item.b(item)); + Material material = Material.getMaterial(Item.getId(item)); if (material == null) { return Material.AIR; @@ -77,7 +77,7 @@ public final class CraftMagicNumbers implements UnsafeValues { public static Block getBlock(Material material) { // TODO: Don't use ID - Block block = Block.e(material.getId()); + Block block = Block.getById(material.getId()); if (block == null) { return Blocks.AIR; @@ -88,7 +88,7 @@ public final class CraftMagicNumbers implements UnsafeValues { @Override public Material getMaterialFromInternalName(String name) { - return getMaterial((Item) Item.REGISTRY.a(name)); + return getMaterial((Item) Item.REGISTRY.get(name)); } @Override @@ -120,7 +120,7 @@ public final class CraftMagicNumbers implements UnsafeValues { @Override public List tabCompleteInternalStatisticOrAchievementName(String token, List completions) { List matches = new ArrayList(); - Iterator iterator = StatisticList.b.iterator(); + Iterator iterator = StatisticList.stats.iterator(); while (iterator.hasNext()) { String statistic = ((net.minecraft.server.Statistic) iterator.next()).name; if (statistic.startsWith(token)) { diff --git a/src/main/java/org/bukkit/craftbukkit/util/StructureGrowDelegate.java b/src/main/java/org/bukkit/craftbukkit/util/StructureGrowDelegate.java index bb6a5796..f9cc7d6f 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/StructureGrowDelegate.java +++ b/src/main/java/org/bukkit/craftbukkit/util/StructureGrowDelegate.java @@ -61,7 +61,7 @@ public class StructureGrowDelegate implements BlockChangeDelegate { public boolean isEmpty(int x, int y, int z) { for (BlockState state : blocks) { if (state.getX() == x && state.getY() == y && state.getZ() == z) { - return Block.e(state.getTypeId()) == Blocks.AIR; + return Block.getById(state.getTypeId()) == Blocks.AIR; } } -- cgit v1.2.3