Update CraftBukkit to Minecraft 1.7.5

By: Nate Mortensen <nate.richard.mortensen@gmail.com>
This commit is contained in:
CraftBukkit/Spigot 2014-03-20 22:26:30 -06:00
parent d6c0b864b8
commit e6de9aaa17
17 changed files with 78 additions and 76 deletions

View file

@ -4,7 +4,7 @@
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<packaging>jar</packaging>
<version>1.7.2-R0.4-SNAPSHOT</version>
<version>1.7.5-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.2</minecraft.version>
<minecraft_version>1_7_R1</minecraft_version>
<minecraft.version>1.7.5</minecraft.version>
<minecraft_version>1_7_R2</minecraft_version>
<buildtag.prefix>git-Bukkit-</buildtag.prefix>
<buildtag.suffix></buildtag.suffix>
</properties>

View file

@ -43,6 +43,7 @@ import net.minecraft.server.CommandKick;
import net.minecraft.server.CommandKill;
import net.minecraft.server.CommandList;
import net.minecraft.server.CommandMe;
import net.minecraft.server.CommandNetstat;
import net.minecraft.server.CommandOp;
import net.minecraft.server.CommandPardon;
import net.minecraft.server.CommandPardonIP;
@ -432,6 +433,8 @@ public final class CraftServer implements Server {
commandMap.register("minecraft", new VanillaCommandWrapper(new CommandWeather(), "/weather <clear/rain/thunder> [duration in seconds]"));
commandMap.register("minecraft", new VanillaCommandWrapper(new CommandWhitelist(), "/whitelist (add|remove) <player>\n/whitelist (on|off|list|reload)"));
commandMap.register("minecraft", new VanillaCommandWrapper(new CommandXp(), "/xp <amount> [player]\n/xp <amount>L [player]"));
// This is what is in the lang file, I swear.
commandMap.register("minecraft", new VanillaCommandWrapper(new CommandNetstat(), "/list"));
}
private void loadPlugin(Plugin plugin) {
@ -1609,11 +1612,11 @@ public final class CraftServer implements Server {
}
public void setIdleTimeout(int threshold) {
console.d(threshold); // Should be setIdleTimeout
console.setIdleTimeout(threshold);
}
public int getIdleTimeout() {
return console.aq(); // Should be getIdleTimeout
return console.getIdleTimeout();
}
@Deprecated

View file

@ -54,7 +54,7 @@ public class CraftStatistic {
private CraftStatistic() {}
public static org.bukkit.Achievement getBukkitAchievement(net.minecraft.server.Achievement achievement) {
return getBukkitAchievementByName(achievement.e);
return getBukkitAchievementByName(achievement.name);
}
public static org.bukkit.Achievement getBukkitAchievementByName(String name) {
@ -62,7 +62,7 @@ public class CraftStatistic {
}
public static org.bukkit.Statistic getBukkitStatistic(net.minecraft.server.Statistic statistic) {
return getBukkitStatisticByName(statistic.e);
return getBukkitStatisticByName(statistic.name);
}
public static org.bukkit.Statistic getBukkitStatisticByName(String name) {
@ -88,26 +88,26 @@ public class CraftStatistic {
}
public static net.minecraft.server.Statistic getNMSStatistic(org.bukkit.Statistic statistic) {
return StatisticList.a(statistics.inverse().get(statistic));
return StatisticList.getStatistic(statistics.inverse().get(statistic));
}
public static net.minecraft.server.Achievement getNMSAchievement(org.bukkit.Achievement achievement) {
return (net.minecraft.server.Achievement) StatisticList.a(achievements.inverse().get(achievement));
return (net.minecraft.server.Achievement) StatisticList.getStatistic(achievements.inverse().get(achievement));
}
public static net.minecraft.server.Statistic getMaterialStatistic(org.bukkit.Statistic stat, Material material) {
try {
if (stat == Statistic.MINE_BLOCK) {
return StatisticList.C[material.getId()];
return StatisticList.MINE_BLOCK_COUNT[material.getId()];
}
if (stat == Statistic.CRAFT_ITEM) {
return StatisticList.D[material.getId()];
return StatisticList.CRAFT_BLOCK_COUNT[material.getId()];
}
if (stat == Statistic.USE_ITEM) {
return StatisticList.E[material.getId()];
return StatisticList.USE_ITEM_COUNT[material.getId()];
}
if (stat == Statistic.BREAK_ITEM) {
return StatisticList.F[material.getId()];
return StatisticList.BREAK_ITEM_COUNT[material.getId()];
}
} catch (ArrayIndexOutOfBoundsException e) {
return null;
@ -116,21 +116,21 @@ public class CraftStatistic {
}
public static net.minecraft.server.Statistic getEntityStatistic(org.bukkit.Statistic stat, EntityType entity) {
MonsterEggInfo monsteregginfo = (MonsterEggInfo) EntityTypes.a.get(Integer.valueOf(entity.getTypeId()));
MonsterEggInfo monsteregginfo = (MonsterEggInfo) EntityTypes.eggInfo.get(Integer.valueOf(entity.getTypeId()));
if (monsteregginfo != null) {
return monsteregginfo.d;
return monsteregginfo.killEntityStatistic;
}
return null;
}
public static EntityType getEntityTypeFromStatistic(net.minecraft.server.Statistic statistic) {
String statisticString = statistic.e;
String statisticString = statistic.name;
return EntityType.fromName(statisticString.substring(statisticString.lastIndexOf(".") + 1));
}
public static Material getMaterialFromStatistic(net.minecraft.server.Statistic statistic) {
String statisticString = statistic.e;
String statisticString = statistic.name;
int id;
try {
id = Integer.valueOf(statisticString.substring(statisticString.lastIndexOf(".") + 1));

View file

@ -41,13 +41,13 @@ public class CraftTravelAgent extends PortalTravelAgent implements TravelAgent {
}
public Location findPortal(Location location) {
PortalTravelAgent pta = ((CraftWorld) location.getWorld()).getHandle().t(); // Should be getTravelAgent
PortalTravelAgent pta = ((CraftWorld) location.getWorld()).getHandle().getTravelAgent();
ChunkCoordinates found = pta.findPortal(location.getX(), location.getY(), location.getZ(), this.getSearchRadius());
return found != null ? new Location(location.getWorld(), found.x, found.y, found.z, location.getYaw(), location.getPitch()) : null;
}
public boolean createPortal(Location location) {
PortalTravelAgent pta = ((CraftWorld) location.getWorld()).getHandle().t();
PortalTravelAgent pta = ((CraftWorld) location.getWorld()).getHandle().getTravelAgent();
return pta.createPortal(location.getX(), location.getY(), location.getZ(), this.getCreationRadius());
}

View file

@ -1011,7 +1011,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.o = true;
entity.n = true;
}
if (entity != null && !((EntityHanging) entity).survives()) {

View file

@ -35,16 +35,16 @@ public final class VanillaCommandWrapper extends VanillaCommand {
protected final CommandAbstract vanillaCommand;
public VanillaCommandWrapper(CommandAbstract vanillaCommand) {
super(vanillaCommand.c());
super(vanillaCommand.getCommand());
this.vanillaCommand = vanillaCommand;
}
public VanillaCommandWrapper(CommandAbstract vanillaCommand, String usage) {
super(vanillaCommand.c());
super(vanillaCommand.getCommand());
this.vanillaCommand = vanillaCommand;
this.description = "A Mojang provided command.";
this.usageMessage = usage;
this.setPermission("minecraft.command." + vanillaCommand.c());
this.setPermission("minecraft.command." + vanillaCommand.getCommand());
}
@Override
@ -57,14 +57,14 @@ public final class VanillaCommandWrapper extends VanillaCommand {
WorldServer[] prev = MinecraftServer.getServer().worldServer;
MinecraftServer.getServer().worldServer = new WorldServer[]{(WorldServer) icommandlistener.getWorld()};
try {
vanillaCommand.b(icommandlistener, args);
vanillaCommand.execute(icommandlistener, args);
} catch (ExceptionUsage exceptionusage) {
ChatMessage chatmessage = new ChatMessage("commands.generic.usage", new Object[] {new ChatMessage(exceptionusage.getMessage(), exceptionusage.a())});
chatmessage.b().setColor(EnumChatFormat.RED);
chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
icommandlistener.sendMessage(chatmessage);
} catch (CommandException commandexception) {
ChatMessage chatmessage = new ChatMessage(commandexception.getMessage(), commandexception.a());
chatmessage.b().setColor(EnumChatFormat.RED);
chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
icommandlistener.sendMessage(chatmessage);
} finally {
MinecraftServer.getServer().worldServer = prev;
@ -77,7 +77,7 @@ public final class VanillaCommandWrapper extends VanillaCommand {
Validate.notNull(sender, "Sender cannot be null");
Validate.notNull(args, "Arguments cannot be null");
Validate.notNull(alias, "Alias cannot be null");
return (List<String>) vanillaCommand.a(getListener(sender), args);
return (List<String>) vanillaCommand.tabComplete(getListener(sender), args);
}
public final int dispatchVanillaCommandBlock(CommandBlockListenerAbstract icommandlistener, String s) {
@ -95,7 +95,7 @@ public final class VanillaCommandWrapper extends VanillaCommand {
WorldServer[] prev = MinecraftServer.getServer().worldServer;
MinecraftServer.getServer().worldServer = new WorldServer[]{(WorldServer) icommandlistener.getWorld()};
try {
if (vanillaCommand.a(icommandlistener)) {
if (vanillaCommand.canUse(icommandlistener)) {
if (i > -1) {
EntityPlayer aentityplayer[] = PlayerSelector.getPlayers(icommandlistener, as[i]);
String s2 = as[i];
@ -105,12 +105,12 @@ public final class VanillaCommandWrapper extends VanillaCommand {
EntityPlayer entityplayer = aentityplayer1[l];
as[i] = entityplayer.getName();
try {
vanillaCommand.b(icommandlistener, as);
vanillaCommand.execute(icommandlistener, as);
j++;
continue;
} catch (CommandException commandexception1) {
ChatMessage chatmessage4 = new ChatMessage(commandexception1.getMessage(), commandexception1.a());
chatmessage4.b().setColor(EnumChatFormat.RED);
chatmessage4.getChatModifier().setColor(EnumChatFormat.RED);
icommandlistener.sendMessage(chatmessage4);
l++;
}
@ -118,34 +118,34 @@ public final class VanillaCommandWrapper extends VanillaCommand {
as[i] = s2;
} else {
vanillaCommand.b(icommandlistener, as);
vanillaCommand.execute(icommandlistener, as);
j++;
}
} else {
ChatMessage chatmessage = new ChatMessage("commands.generic.permission", new Object[0]);
chatmessage.b().setColor(EnumChatFormat.RED);
chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
icommandlistener.sendMessage(chatmessage);
}
} catch (ExceptionUsage exceptionusage) {
ChatMessage chatmessage1 = new ChatMessage("commands.generic.usage", new Object[] { new ChatMessage(exceptionusage.getMessage(), exceptionusage.a()) });
chatmessage1.b().setColor(EnumChatFormat.RED);
chatmessage1.getChatModifier().setColor(EnumChatFormat.RED);
icommandlistener.sendMessage(chatmessage1);
} catch (CommandException commandexception) {
ChatMessage chatmessage2 = new ChatMessage(commandexception.getMessage(), commandexception.a());
chatmessage2.b().setColor(EnumChatFormat.RED);
chatmessage2.getChatModifier().setColor(EnumChatFormat.RED);
icommandlistener.sendMessage(chatmessage2);
} catch (Throwable throwable) {
ChatMessage chatmessage3 = new ChatMessage("commands.generic.exception", new Object[0]);
chatmessage3.b().setColor(EnumChatFormat.RED);
chatmessage3.getChatModifier().setColor(EnumChatFormat.RED);
icommandlistener.sendMessage(chatmessage3);
if(icommandlistener instanceof TileEntityCommandListener) {
TileEntityCommandListener listener = (TileEntityCommandListener) icommandlistener;
MinecraftServer.av().log(Level.WARN, String.format("CommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().x, listener.getChunkCoordinates().y, listener.getChunkCoordinates().z), throwable);
MinecraftServer.getLogger().log(Level.WARN, String.format("CommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().x, listener.getChunkCoordinates().y, listener.getChunkCoordinates().z), throwable);
} else if (icommandlistener instanceof EntityMinecartCommandBlockListener) {
EntityMinecartCommandBlockListener listener = (EntityMinecartCommandBlockListener) icommandlistener;
MinecraftServer.av().log(Level.WARN, String.format("MinecartCommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().x, listener.getChunkCoordinates().y, listener.getChunkCoordinates().z), throwable);
MinecraftServer.getLogger().log(Level.WARN, String.format("MinecartCommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().x, listener.getChunkCoordinates().y, listener.getChunkCoordinates().z), throwable);
} else {
MinecraftServer.av().log(Level.WARN, String.format("Unknown CommandBlock failed to handle command"), throwable);
MinecraftServer.getLogger().log(Level.WARN, String.format("Unknown CommandBlock failed to handle command"), throwable);
}
} finally {
MinecraftServer.getServer().worldServer = prev;
@ -174,7 +174,7 @@ public final class VanillaCommandWrapper extends VanillaCommand {
private int getPlayerListSize(String as[]) {
for (int i = 0; i < as.length; i++) {
if (vanillaCommand.a(as, i) && PlayerSelector.isList(as[i])) {
if (vanillaCommand.isListStart(as, i) && PlayerSelector.isList(as[i])) {
return i;
}
}

View file

@ -17,19 +17,19 @@ public class CraftArrow extends AbstractProjectile implements Arrow {
public void setKnockbackStrength(int knockbackStrength) {
Validate.isTrue(knockbackStrength >= 0, "Knockback cannot be negative");
getHandle().a(knockbackStrength);
getHandle().setKnockbackStrength(knockbackStrength);
}
public int getKnockbackStrength() {
return getHandle().aw;
return getHandle().knockbackStrength;
}
public boolean isCritical() {
return getHandle().f();
return getHandle().isCritical();
}
public void setCritical(boolean critical) {
getHandle().a(critical);
getHandle().setCritical(critical);
}
public ProjectileSource getShooter() {

View file

@ -348,7 +348,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
}
public boolean hasLineOfSight(Entity other) {
return getHandle().o(((CraftEntity) other).getHandle());
return getHandle().p(((CraftEntity) other).getHandle());
}
public boolean getRemoveWhenFarAway() {

View file

@ -522,8 +522,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (achievement.hasParent() && !hasAchievement(achievement.getParent())) {
awardAchievement(achievement.getParent());
}
getHandle().x().a(getHandle(), CraftStatistic.getNMSAchievement(achievement), 1);
getHandle().x().b(getHandle());
getHandle().getStatisticManager().setStatistic(getHandle(), CraftStatistic.getNMSAchievement(achievement), 1);
getHandle().getStatisticManager().updateStatistics(getHandle());
}
@Override
@ -534,13 +534,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
removeAchievement(achieve);
}
}
getHandle().x().a(getHandle(), CraftStatistic.getNMSAchievement(achievement), 0);
getHandle().getStatisticManager().setStatistic(getHandle(), CraftStatistic.getNMSAchievement(achievement), 0);
}
@Override
public boolean hasAchievement(Achievement achievement) {
Validate.notNull(achievement, "Achievement cannot be null");
return getHandle().x().a(CraftStatistic.getNMSAchievement(achievement));
return getHandle().getStatisticManager().a(CraftStatistic.getNMSAchievement(achievement));
}
@Override
@ -557,7 +557,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public int getStatistic(Statistic statistic) {
Validate.notNull(statistic, "Statistic cannot be null");
Validate.isTrue(statistic.getType() == Type.UNTYPED, "Must supply additional paramater for this statistic");
return getHandle().x().a(CraftStatistic.getNMSStatistic(statistic));
return getHandle().getStatisticManager().getStatisticValue(CraftStatistic.getNMSStatistic(statistic));
}
@Override
@ -578,7 +578,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Validate.isTrue(statistic.getType() == Type.UNTYPED, "Must supply additional paramater for this statistic");
Validate.isTrue(newValue >= 0, "Value must be greater than or equal to 0");
net.minecraft.server.Statistic nmsStatistic = CraftStatistic.getNMSStatistic(statistic);
getHandle().x().a(getHandle(), nmsStatistic, newValue);
getHandle().getStatisticManager().setStatistic(getHandle(), nmsStatistic, newValue);
}
@Override
@ -598,7 +598,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Validate.isTrue(statistic.getType() == Type.BLOCK || statistic.getType() == Type.ITEM, "This statistic does not take a Material parameter");
net.minecraft.server.Statistic nmsStatistic = CraftStatistic.getMaterialStatistic(statistic, material);
Validate.notNull(nmsStatistic, "The supplied Material does not have a corresponding statistic");
return getHandle().x().a(nmsStatistic);
return getHandle().getStatisticManager().getStatisticValue(nmsStatistic);
}
@Override
@ -621,7 +621,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Validate.isTrue(statistic.getType() == Type.BLOCK || statistic.getType() == Type.ITEM, "This statistic does not take a Material parameter");
net.minecraft.server.Statistic nmsStatistic = CraftStatistic.getMaterialStatistic(statistic, material);
Validate.notNull(nmsStatistic, "The supplied Material does not have a corresponding statistic");
getHandle().x().a(getHandle(), nmsStatistic, newValue);
getHandle().getStatisticManager().setStatistic(getHandle(), nmsStatistic, newValue);
}
@Override
@ -641,7 +641,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Validate.isTrue(statistic.getType() == Type.ENTITY, "This statistic does not take an EntityType parameter");
net.minecraft.server.Statistic nmsStatistic = CraftStatistic.getEntityStatistic(statistic, entityType);
Validate.notNull(nmsStatistic, "The supplied EntityType does not have a corresponding statistic");
return getHandle().x().a(nmsStatistic);
return getHandle().getStatisticManager().getStatisticValue(nmsStatistic);
}
@Override
@ -664,7 +664,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Validate.isTrue(statistic.getType() == Type.ENTITY, "This statistic does not take an EntityType parameter");
net.minecraft.server.Statistic nmsStatistic = CraftStatistic.getEntityStatistic(statistic, entityType);
Validate.notNull(nmsStatistic, "The supplied EntityType does not have a corresponding statistic");
getHandle().x().a(getHandle(), nmsStatistic, newValue);
getHandle().getStatisticManager().setStatistic(getHandle(), nmsStatistic, newValue);
}
@Override
@ -1011,7 +1011,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void setResourcePack(String url) {
Validate.notNull(url, "Resource pack URL cannot be null");
getHandle().a(url); // should be setResourcePack
getHandle().setResourcePack(url);
}
public void addChannel(String channel) {
@ -1225,7 +1225,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void updateScaledHealth() {
AttributeMapServer attributemapserver = (AttributeMapServer) getHandle().bc();
AttributeMapServer attributemapserver = (AttributeMapServer) getHandle().bb();
Set set = attributemapserver.b();
injectScaledMaxHealth(set, true);
@ -1250,6 +1250,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
continue;
}
collection.add(new AttributeModifiable(getHandle().bc(), (new AttributeRanged("generic.maxHealth", scaledHealth ? healthScale : getMaxHealth(), 0.0D, Float.MAX_VALUE)).a("Max Health").a(true)));
collection.add(new AttributeModifiable(getHandle().bb(), (new AttributeRanged("generic.maxHealth", scaledHealth ? healthScale : getMaxHealth(), 0.0D, Float.MAX_VALUE)).a("Max Health").a(true)));
}
}

View file

@ -393,8 +393,7 @@ public class CraftEventFactory {
}
public static EntityDamageEvent handleEntityDamageEvent(Entity entity, DamageSource source, float damage) {
// Should be isExplosion
if (source.c()) {
if (source.isExplosion()) {
return null;
} else if (source instanceof EntityDamageSource) {
Entity damager = source.getEntity();

View file

@ -226,5 +226,5 @@ public class CustomChunkGenerator extends InternalChunkGenerator {
return "CustomChunkGenerator";
}
public void b() {}
public void c() {}
}

View file

@ -82,5 +82,5 @@ public class NormalChunkGenerator extends InternalChunkGenerator {
return "NormalWorldGenerator";
}
public void b() {}
public void c() {}
}

View file

@ -83,13 +83,13 @@ public class CraftBlockProjectileSource implements BlockProjectileSource {
((EntityArrow) launch).fromPlayer = 1;
((EntityArrow) launch).projectileSource = this;
} else if (Fireball.class.isAssignableFrom(projectile)) {
double d0 = iposition.getX() + (double) ((float) enumfacing.c() * 0.3F);
double d1 = iposition.getY() + (double) ((float) enumfacing.c() * 0.3F);
double d2 = iposition.getZ() + (double) ((float) enumfacing.e() * 0.3F);
double d0 = iposition.getX() + (double) ((float) enumfacing.getAdjacentX() * 0.3F);
double d1 = iposition.getY() + (double) ((float) enumfacing.getAdjacentY() * 0.3F);
double d2 = iposition.getZ() + (double) ((float) enumfacing.getAdjacentZ() * 0.3F);
Random random = world.random;
double d3 = random.nextGaussian() * 0.05D + (double) enumfacing.c();
double d4 = random.nextGaussian() * 0.05D + (double) enumfacing.d();
double d5 = random.nextGaussian() * 0.05D + (double) enumfacing.e();
double d3 = random.nextGaussian() * 0.05D + (double) enumfacing.getAdjacentX();
double d4 = random.nextGaussian() * 0.05D + (double) enumfacing.getAdjacentY();
double d5 = random.nextGaussian() * 0.05D + (double) enumfacing.getAdjacentZ();
if (SmallFireball.class.isAssignableFrom(projectile)) {
launch = new EntitySmallFireball(world, d0, d1, d2, d3, d4, d5);
@ -129,7 +129,7 @@ public class CraftBlockProjectileSource implements BlockProjectileSource {
b *= 1.25F;
}
// Copied from DispenseBehaviorProjectile
((IProjectile) launch).shoot((double) enumfacing.c(), (double) ((float) enumfacing.d() + 0.1F), (double) enumfacing.e(), b, a);
((IProjectile) launch).shoot((double) enumfacing.getAdjacentX(), (double) ((float) enumfacing.getAdjacentY() + 0.1F), (double) enumfacing.getAdjacentZ(), b, a);
}
if (velocity != null) {

View file

@ -85,9 +85,9 @@ public final class CraftChatMessage {
currentChatComponent = null;
break;
case 3:
modifier.a(new ChatClickable(EnumClickAction.OPEN_URL, match)); // Should be setChatClickable
modifier.setChatClickable(new ChatClickable(EnumClickAction.OPEN_URL, match));
appendNewComponent(matcher.end(groupId));
modifier.a((ChatClickable) null);
modifier.setChatClickable((ChatClickable) null);
}
currentIndex = matcher.end(groupId);
}

View file

@ -18,7 +18,7 @@ public final class CraftDamageSource extends DamageSource {
}
// Check fire
if (original.c()) {
if (original.isExplosion()) {
newSource.n();
}

View file

@ -93,14 +93,14 @@ public final class CraftMagicNumbers implements UnsafeValues {
@Override
public List<String> tabCompleteInternalMaterialName(String token, List<String> completions) {
return StringUtil.copyPartialMatches(token, Item.REGISTRY.b(), completions);
return StringUtil.copyPartialMatches(token, Item.REGISTRY.keySet(), completions);
}
@Override
public ItemStack modifyItemStack(ItemStack stack, String arguments) {
net.minecraft.server.ItemStack nmsStack = CraftItemStack.asNMSCopy(stack);
nmsStack.setTag((NBTTagCompound) MojangsonParser.a(arguments));
nmsStack.setTag((NBTTagCompound) MojangsonParser.parse(arguments));
stack.setItemMeta(CraftItemStack.getItemMeta(nmsStack));
@ -122,7 +122,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
List<String> matches = new ArrayList<String>();
Iterator iterator = StatisticList.b.iterator();
while (iterator.hasNext()) {
String statistic = ((net.minecraft.server.Statistic) iterator.next()).e;
String statistic = ((net.minecraft.server.Statistic) iterator.next()).name;
if (statistic.startsWith(token)) {
matches.add(statistic);
}

View file

@ -22,7 +22,7 @@ public class StatisticsAndAchievementsTest extends AbstractTestingBase {
public void verifyAchievementMapping() throws Throwable {
List<Achievement> achievements = Lists.newArrayList(Achievement.values());
for (net.minecraft.server.Achievement achievement : (List<net.minecraft.server.Achievement>) AchievementList.e) {
String name = achievement.e;
String name = achievement.name;
String message = String.format("org.bukkit.Achievement is missing: '%s'", name);
@ -43,7 +43,7 @@ public class StatisticsAndAchievementsTest extends AbstractTestingBase {
if (statistic instanceof net.minecraft.server.Achievement) {
continue;
}
String name = statistic.e;
String name = statistic.name;
String message = String.format("org.bukkit.Statistic is missing: '%s'", name);