Update CraftBukkit to Minecraft 1.7.10

By: Travis Watkins <amaranth@ubuntu.com>
This commit is contained in:
CraftBukkit/Spigot 2014-06-26 13:05:08 -05:00
parent 645fe18f1f
commit 79e5718f39
35 changed files with 112 additions and 113 deletions

View File

@ -4,7 +4,7 @@
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<packaging>jar</packaging>
<version>1.7.9-R0.3-SNAPSHOT</version>
<version>1.7.10-R0.1-SNAPSHOT</version>
<name>CraftBukkit</name>
<url>http://www.bukkit.org</url>
@ -12,8 +12,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<api.version>unknown</api.version>
<junit.version>4.11</junit.version>
<minecraft.version>1.7.9</minecraft.version>
<minecraft_version>1_7_R3</minecraft_version>
<minecraft.version>1.7.10</minecraft.version>
<minecraft_version>1_7_R4</minecraft_version>
<buildtag.prefix>git-Bukkit-</buildtag.prefix>
<buildtag.suffix></buildtag.suffix>
</properties>

View File

@ -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);
}
}

View File

@ -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<org.bukkit.BanEntry> getBanEntries() {
ImmutableSet.Builder<org.bukkit.BanEntry> 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);
}
}

View File

@ -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<OfflinePlayer> result = new HashSet<OfflinePlayer>();
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<OfflinePlayer> result = new LinkedHashSet<OfflinePlayer>();
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<OfflinePlayer> result = new HashSet<OfflinePlayer>();
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()));
}
}

View File

@ -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() {

View File

@ -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;

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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;
}

View File

@ -35,7 +35,7 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChu
}
queuedChunk.loader.loadEntities(chunk, queuedChunk.compound.getCompound("Level"), queuedChunk.world);
chunk.p = queuedChunk.provider.world.getTime();
chunk.lastSaved = queuedChunk.provider.world.getTime();
queuedChunk.provider.chunks.put(LongHash.toLong(queuedChunk.x, queuedChunk.z), chunk);
chunk.addEntities();
@ -63,7 +63,7 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChu
}
}
chunk.a(queuedChunk.provider, queuedChunk.provider, queuedChunk.x, queuedChunk.z);
chunk.loadNearby(queuedChunk.provider, queuedChunk.provider, queuedChunk.x, queuedChunk.z);
}
public void callStage3(QueuedChunk queuedChunk, Chunk chunk, Runnable runnable) throws RuntimeException {

View File

@ -59,11 +59,11 @@ public final class VanillaCommandWrapper extends VanillaCommand {
try {
vanillaCommand.execute(icommandlistener, args);
} catch (ExceptionUsage exceptionusage) {
ChatMessage chatmessage = new ChatMessage("commands.generic.usage", new Object[] {new ChatMessage(exceptionusage.getMessage(), exceptionusage.a())});
ChatMessage chatmessage = new ChatMessage("commands.generic.usage", new Object[] {new ChatMessage(exceptionusage.getMessage(), exceptionusage.getArgs())});
chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
icommandlistener.sendMessage(chatmessage);
} catch (CommandException commandexception) {
ChatMessage chatmessage = new ChatMessage(commandexception.getMessage(), commandexception.a());
ChatMessage chatmessage = new ChatMessage(commandexception.getMessage(), commandexception.getArgs());
chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
icommandlistener.sendMessage(chatmessage);
} finally {
@ -109,7 +109,7 @@ public final class VanillaCommandWrapper extends VanillaCommand {
j++;
continue;
} catch (CommandException commandexception1) {
ChatMessage chatmessage4 = new ChatMessage(commandexception1.getMessage(), commandexception1.a());
ChatMessage chatmessage4 = new ChatMessage(commandexception1.getMessage(), commandexception1.getArgs());
chatmessage4.getChatModifier().setColor(EnumChatFormat.RED);
icommandlistener.sendMessage(chatmessage4);
}
@ -126,11 +126,11 @@ public final class VanillaCommandWrapper extends VanillaCommand {
icommandlistener.sendMessage(chatmessage);
}
} catch (ExceptionUsage exceptionusage) {
ChatMessage chatmessage1 = new ChatMessage("commands.generic.usage", new Object[] { new ChatMessage(exceptionusage.getMessage(), exceptionusage.a()) });
ChatMessage chatmessage1 = new ChatMessage("commands.generic.usage", new Object[] { new ChatMessage(exceptionusage.getMessage(), exceptionusage.getArgs()) });
chatmessage1.getChatModifier().setColor(EnumChatFormat.RED);
icommandlistener.sendMessage(chatmessage1);
} catch (CommandException commandexception) {
ChatMessage chatmessage2 = new ChatMessage(commandexception.getMessage(), commandexception.a());
ChatMessage chatmessage2 = new ChatMessage(commandexception.getMessage(), commandexception.getArgs());
chatmessage2.getChatModifier().setColor(EnumChatFormat.RED);
icommandlistener.sendMessage(chatmessage2);
} catch (Throwable throwable) {
@ -160,7 +160,7 @@ public final class VanillaCommandWrapper extends VanillaCommand {
return ((CraftBlockCommandSender) sender).getTileEntity();
}
if (sender instanceof CommandMinecart) {
return ((EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).e();
return ((EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).getCommandBlock();
}
if (sender instanceof RemoteConsoleCommandSender) {
return RemoteControlCommandListener.instance;

View File

@ -26,11 +26,11 @@ public class CraftBat extends CraftAmbient implements Bat {
@Override
public boolean isAwake() {
return !getHandle().isStartled();
return !getHandle().isAsleep();
}
@Override
public void setAwake(boolean state) {
getHandle().setStartled(!state);
getHandle().setAsleep(!state);
}
}

View File

@ -64,7 +64,7 @@ public class CraftFirework extends CraftEntity implements Firework {
// Copied from EntityFireworks constructor, update firework lifetime/power
getHandle().expectedLifespan = 10 * (1 + meta.getPower()) + random.nextInt(6) + random.nextInt(7);
getHandle().getDataWatcher().h(FIREWORK_ITEM_INDEX); // Update
getHandle().getDataWatcher().update(FIREWORK_ITEM_INDEX);
}
@Override

View File

@ -31,8 +31,8 @@ public class CraftItemFrame extends CraftHanging implements ItemFrame {
public void setItem(org.bukkit.inventory.ItemStack item) {
if (item == null || item.getTypeId() == 0) {
getHandle().getDataWatcher().a(2, 5);
getHandle().getDataWatcher().h(2);
getHandle().getDataWatcher().add(2, 5);
getHandle().getDataWatcher().update(2);
} else {
getHandle().setItem(CraftItemStack.asNMSCopy(item));
}

View File

@ -95,7 +95,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
public void setMaxHealth(double amount) {
Validate.isTrue(amount > 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() {

View File

@ -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

View File

@ -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)));
}
}

View File

@ -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

View File

@ -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));
}
}

View File

@ -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

View File

@ -144,7 +144,7 @@ public class CraftInventoryCustom extends CraftInventory {
return type;
}
public void l_() {}
public void closeContainer() {}
public InventoryHolder getOwner() {
return owner;

View File

@ -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;
}

View File

@ -235,7 +235,7 @@ class CraftMetaItem implements ItemMeta, Repairable {
lore = new ArrayList<String>(list.size());
for (int index = 0; index < list.size(); index++) {
String line = list.f(index);
String line = list.getString(index);
lore.add(line);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -14,7 +14,7 @@ final class CraftCriteria {
static {
ImmutableMap.Builder<String, CraftCriteria> 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)) {

View File

@ -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

View File

@ -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);
}

View File

@ -110,7 +110,7 @@ public final class CraftChatMessage {
currentChatComponent = new ChatComponentText("");
list.add(currentChatComponent);
}
currentChatComponent.a(addition);
currentChatComponent.addSibling(addition);
}
private IChatBaseComponent[] getOutput() {

View File

@ -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;

View File

@ -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<String> tabCompleteInternalStatisticOrAchievementName(String token, List<String> completions) {
List<String> matches = new ArrayList<String>();
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)) {

View File

@ -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;
}
}

View File

@ -39,7 +39,7 @@ public class StatisticsAndAchievementsTest extends AbstractTestingBase {
@SuppressWarnings("unchecked")
public void verifyStatisticMapping() throws Throwable {
HashMultiset<Statistic> statistics = HashMultiset.create();
for (net.minecraft.server.Statistic statistic : (List<net.minecraft.server.Statistic>) StatisticList.b) {
for (net.minecraft.server.Statistic statistic : (List<net.minecraft.server.Statistic>) StatisticList.stats) {
if (statistic instanceof net.minecraft.server.Achievement) {
continue;
}

View File

@ -33,7 +33,7 @@ public class ItemFactoryTest extends AbstractTestingBase {
for (final Field field : clazz.getDeclaredFields()) {
if (IAttribute.class.isAssignableFrom(field.getType()) && Modifier.isStatic(field.getModifiers())) {
field.setAccessible(true);
final String attributeName = ((IAttribute) field.get(null)).a();
final String attributeName = ((IAttribute) field.get(null)).getName();
assertThat("Logical error: duplicate name `" + attributeName + "' in " + clazz.getName(), names.add(attributeName), is(true));
assertThat(clazz.getName(), CraftItemFactory.KNOWN_NBT_ATTRIBUTE_NAMES, hasItem(attributeName));
}