Updated to use mc-dev rename revision 1

By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
CraftBukkit/Spigot 2011-11-29 23:17:43 +00:00
parent 540f893f86
commit 0939b7a7f9
17 changed files with 69 additions and 70 deletions

View File

@ -51,7 +51,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>minecraft-server</artifactId>
<version>1.9.RC1</version>
<version>1.0.0_01</version>
<type>jar</type>
<scope>compile</scope>
</dependency>

View File

@ -568,7 +568,7 @@ public final class CraftServer implements Server {
ChunkCoordinates chunkcoordinates = internal.getSpawn();
internal.chunkProviderServer.getChunkAt(chunkcoordinates.x + j >> 4, chunkcoordinates.z + k >> 4);
while (internal.x()) {
while (internal.updateLights()) {
;
}
}

View File

@ -334,13 +334,13 @@ public class CraftWorld implements World {
}
public LightningStrike strikeLightning(Location loc) {
EntityWeatherStorm lightning = new EntityWeatherStorm(world, loc.getX(), loc.getY(), loc.getZ());
EntityWeatherLighting lightning = new EntityWeatherLighting(world, loc.getX(), loc.getY(), loc.getZ());
world.strikeLightning(lightning);
return new CraftLightningStrike(server, lightning);
}
public LightningStrike strikeLightningEffect(Location loc) {
EntityWeatherStorm lightning = new EntityWeatherStorm(world, loc.getX(), loc.getY(), loc.getZ(), true);
EntityWeatherLighting lightning = new EntityWeatherLighting(world, loc.getX(), loc.getY(), loc.getZ(), true);
world.strikeLightning(lightning);
return new CraftLightningStrike(server, lightning);
}
@ -644,7 +644,7 @@ public class CraftWorld implements World {
public void playEffect(Location location, Effect effect, int data, int radius) {
int packetData = effect.getId();
Packet61 packet = new Packet61(packetData, location.getBlockX(), location.getBlockY(), location.getBlockZ(), data);
Packet61WorldEvent packet = new Packet61WorldEvent(packetData, location.getBlockX(), location.getBlockY(), location.getBlockZ(), data);
int distance;
for (Player player : getPlayers()) {
distance = (int) player.getLocation().distance(location);
@ -676,7 +676,7 @@ public class CraftWorld implements World {
if (Boat.class.isAssignableFrom(clazz)) {
entity = new EntityBoat(world, x, y, z);
} else if (FallingSand.class.isAssignableFrom(clazz)) {
entity = new EntityFallingSand(world, x, y, z, 0, 0);
entity = new EntityFallingBlock(world, x, y, z, 0, 0);
} else if (Projectile.class.isAssignableFrom(clazz)) {
if (Snowball.class.isAssignableFrom(clazz)) {
entity = new EntitySnowball(world, x, y, z);
@ -735,7 +735,7 @@ public class CraftWorld implements World {
entity = new EntitySkeleton(world);
} else if (Slime.class.isAssignableFrom(clazz)) {
if (MagmaCube.class.isAssignableFrom(clazz)) {
entity = new EntityLavaSlime(world);
entity = new EntityMagmaCube(world);
} else {
entity = new EntitySlime(world);
}
@ -808,7 +808,7 @@ public class CraftWorld implements World {
entity = new EntityExperienceOrb(world, x, y, z, 0);
} else if (Weather.class.isAssignableFrom(clazz)) {
// not sure what this can do
entity = new EntityWeatherStorm(world, x, y, z);
entity = new EntityWeatherLighting(world, x, y, z);
} else if (LightningStrike.class.isAssignableFrom(clazz)) {
// what is this, I don't even
} else if (Fish.class.isAssignableFrom(clazz)) {
@ -897,6 +897,6 @@ public class CraftWorld implements World {
}
public File getWorldFolder() {
return ((PlayerNBTManager)world.q()).a();
return ((WorldNBTStorage)world.getDataManager()).getDirectory();
}
}

View File

@ -22,7 +22,7 @@ public class TextWrapper {
private static final char COLOR_CHAR = '\u00A7';
private static final int CHAT_WINDOW_WIDTH = 320;
private static final int CHAT_STRING_LENGTH = 119;
private static final String allowedChars = net.minecraft.server.FontAllowedCharacters.allowedCharacters;
private static final String allowedChars = net.minecraft.server.SharedConstants.allowedCharacters;
public static String[] wrapText(final String text) {
final StringBuilder out = new StringBuilder();

View File

@ -50,7 +50,7 @@ public class CraftEnchantment extends Enchantment {
@Override
public boolean canEnchantItem(ItemStack item) {
return target.slot.a(Item.byId[item.getTypeId()]);
return target.slot.canEnchant(Item.byId[item.getTypeId()]);
}
@Override

View File

@ -81,7 +81,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
}
// Slimes are a special (and broken) case
else if (entity instanceof EntitySlime) {
if (entity instanceof EntityLavaSlime) { return new CraftMagmaCube(server, (EntityLavaSlime) entity); }
if (entity instanceof EntityMagmaCube) { return new CraftMagmaCube(server, (EntityMagmaCube) entity); }
else { return new CraftSlime(server, (EntitySlime) entity); }
}
// Flying
@ -108,7 +108,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
else if (entity instanceof EntityPotion) { return new CraftThrownPotion(server, (EntityPotion) entity); }
else if (entity instanceof EntityEnderPearl) { return new CraftEnderPearl(server, (EntityEnderPearl) entity); }
}
else if (entity instanceof EntityFallingSand) { return new CraftFallingSand(server, (EntityFallingSand) entity); }
else if (entity instanceof EntityFallingBlock) { return new CraftFallingSand(server, (EntityFallingBlock) entity); }
else if (entity instanceof EntityFireball) {
if (entity instanceof EntitySmallFireball) { return new CraftSmallFireball(server, (EntitySmallFireball) entity); }
else { return new CraftFireball(server, (EntityFireball) entity); }
@ -118,7 +118,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
else if (entity instanceof EntityFishingHook) { return new CraftFish(server, (EntityFishingHook) entity); }
else if (entity instanceof EntityItem) { return new CraftItem(server, (EntityItem) entity); }
else if (entity instanceof EntityWeather) {
if (entity instanceof EntityWeatherStorm) { return new CraftLightningStrike(server, (EntityWeatherStorm) entity); }
if (entity instanceof EntityWeatherLighting) { return new CraftLightningStrike(server, (EntityWeatherLighting) entity); }
else { return new CraftWeather(server, (EntityWeather) entity); }
}
else if (entity instanceof EntityMinecart) {
@ -195,7 +195,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
}
public boolean isDead() {
return !entity.aj();
return !entity.isAlive();
}
@Override

View File

@ -1,6 +1,6 @@
package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityFallingSand;
import net.minecraft.server.EntityFallingBlock;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.entity.CraftEntity;
@ -8,13 +8,13 @@ import org.bukkit.entity.FallingSand;
public class CraftFallingSand extends CraftEntity implements FallingSand {
public CraftFallingSand(CraftServer server, EntityFallingSand entity) {
public CraftFallingSand(CraftServer server, EntityFallingBlock entity) {
super(server, entity);
}
@Override
public EntityFallingSand getHandle() {
return (EntityFallingSand) entity;
public EntityFallingBlock getHandle() {
return (EntityFallingBlock) entity;
}
@Override

View File

@ -1,21 +1,21 @@
package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityWeatherStorm;
import net.minecraft.server.EntityWeatherLighting;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.LightningStrike;
public class CraftLightningStrike extends CraftEntity implements LightningStrike {
public CraftLightningStrike(final CraftServer server, final EntityWeatherStorm entity) {
public CraftLightningStrike(final CraftServer server, final EntityWeatherLighting entity) {
super(server, entity);
}
public boolean isEffect() {
return ((EntityWeatherStorm) super.getHandle()).isEffect;
return ((EntityWeatherLighting) super.getHandle()).isEffect;
}
@Override
public EntityWeatherStorm getHandle() {
return (EntityWeatherStorm) entity;
public EntityWeatherLighting getHandle() {
return (EntityWeatherLighting) entity;
}
@Override

View File

@ -149,11 +149,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
}
public int getRemainingAir() {
return getHandle().airTicks;
return getHandle().getAirTicks();
}
public void setRemainingAir(int ticks) {
getHandle().airTicks = ticks;
getHandle().setAirTicks(ticks);
}
public int getMaximumAir() {

View File

@ -1,18 +1,18 @@
package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityLavaSlime;
import net.minecraft.server.EntityMagmaCube;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.MagmaCube;
public class CraftMagmaCube extends CraftSlime implements MagmaCube {
public CraftMagmaCube(CraftServer server, EntityLavaSlime entity) {
public CraftMagmaCube(CraftServer server, EntityMagmaCube entity) {
super(server, entity);
}
public EntityLavaSlime getHandle() {
return (EntityLavaSlime) entity;
public EntityMagmaCube getHandle() {
return (EntityMagmaCube) entity;
}
@Override

View File

@ -6,14 +6,14 @@ import java.util.LinkedHashMap;
import java.util.Map;
import net.minecraft.server.EntityHuman;
import net.minecraft.server.EntityPlayer;
import net.minecraft.server.Packet131;
import net.minecraft.server.Packet131ItemData;
import net.minecraft.server.Packet200Statistic;
import net.minecraft.server.Packet201PlayerInfo;
import net.minecraft.server.Packet3Chat;
import net.minecraft.server.Packet51MapChunk;
import net.minecraft.server.Packet53BlockChange;
import net.minecraft.server.Packet54PlayNoteBlock;
import net.minecraft.server.Packet61;
import net.minecraft.server.Packet61WorldEvent;
import net.minecraft.server.Packet6SpawnPosition;
import net.minecraft.server.Packet70Bed;
import net.minecraft.server.WorldServer;
@ -211,7 +211,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (getHandle().netServerHandler == null) return;
int packetData = effect.getId();
Packet61 packet = new Packet61(packetData, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), data);
Packet61WorldEvent packet = new Packet61WorldEvent(packetData, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), data);
getHandle().netServerHandler.sendPacket(packet);
}
@ -268,7 +268,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
for (int y = 0; y < 128; ++y) {
bytes[y + 3] = data.buffer[y * 128 + x];
}
Packet131 packet = new Packet131((short) Material.MAP.getId(), map.getId(), bytes);
Packet131ItemData packet = new Packet131ItemData((short) Material.MAP.getId(), map.getId(), bytes);
getHandle().netServerHandler.sendPacket(packet);
}
}
@ -459,7 +459,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public int getExperience() {
return getHandle().exp;
return getHandle().expTotal;
}
public void setExperience(int exp) {
@ -467,22 +467,22 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public int getLevel() {
return (int)getHandle().expLevel;
return (int)getHandle().exp;
}
public void setLevel(int level) {
getHandle().expLevel = level;
getHandle().exp = level;
}
public int getTotalExperience() {
return getHandle().expTotal;
return getHandle().expLevel;
}
public void setTotalExperience(int exp) {
getHandle().expTotal = exp;
getHandle().expLevel = exp;
if (getTotalExperience() > getExperience()) {
getHandle().exp = getTotalExperience();
getHandle().expTotal = getTotalExperience();
}
}

View File

@ -15,7 +15,7 @@ import net.minecraft.server.EntityGhast;
import net.minecraft.server.EntityGiantZombie;
import net.minecraft.server.EntityHuman;
import net.minecraft.server.EntityItem;
import net.minecraft.server.EntityLavaSlime;
import net.minecraft.server.EntityMagmaCube;
import net.minecraft.server.EntityLiving;
import net.minecraft.server.EntityMonster;
import net.minecraft.server.EntityMushroomCow;
@ -229,7 +229,7 @@ public class CraftEventFactory {
} else if (entityliving instanceof EntitySkeleton) {
type = CreatureType.SKELETON;
} else if (entityliving instanceof EntitySlime) {
if (entityliving instanceof EntityLavaSlime) type = CreatureType.MAGMA_CUBE;
if (entityliving instanceof EntityMagmaCube) type = CreatureType.MAGMA_CUBE;
else type = CreatureType.SLIME;
} else if (entityliving instanceof EntitySpider) {
if (entityliving instanceof EntityCaveSpider) type = CreatureType.CAVE_SPIDER;

View File

@ -1,17 +1,16 @@
package org.bukkit.craftbukkit.inventory;
import net.minecraft.server.InventoryPlayer;
import net.minecraft.server.PlayerInventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
public class CraftInventoryPlayer extends CraftInventory implements PlayerInventory {
public CraftInventoryPlayer(net.minecraft.server.InventoryPlayer inventory) {
public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.inventory.PlayerInventory {
public CraftInventoryPlayer(net.minecraft.server.PlayerInventory inventory) {
super(inventory);
}
public InventoryPlayer getInventory() {
return (InventoryPlayer) inventory;
public PlayerInventory getInventory() {
return (PlayerInventory) inventory;
}
public int getSize() {

View File

@ -119,7 +119,7 @@ public class CraftItemStack extends ItemStack {
// Ignore damage if item is null
if (item != null) {
super.setDurability(durability);
item.b(durability);
item.setData(durability);
}
}
@ -152,7 +152,7 @@ public class CraftItemStack extends ItemStack {
@Override
public int getEnchantmentLevel(Enchantment ench) {
return EnchantmentManager.b(ench.getId(), item);
return EnchantmentManager.getEnchantmentLevel(ench.getId(), item);
}
@Override
@ -168,15 +168,15 @@ public class CraftItemStack extends ItemStack {
@Override
public Map<Enchantment, Integer> getEnchantments() {
Map<Enchantment, Integer> result = new HashMap<Enchantment, Integer>();
NBTTagList list = item.p();
NBTTagList list = item.getEnchantments();
if (list == null) {
return result;
}
for (int i = 0; i < list.d(); i++) {
short id = ((NBTTagCompound)list.a(i)).e("id");
short level = ((NBTTagCompound)list.a(i)).e("lvl");
for (int i = 0; i < list.size(); i++) {
short id = ((NBTTagCompound)list.get(i)).getShort("id");
short level = ((NBTTagCompound)list.get(i)).getShort("lvl");
result.put(Enchantment.getById(id), (int)level);
}
@ -195,13 +195,13 @@ public class CraftItemStack extends ItemStack {
for (Map.Entry<Enchantment, Integer> entry : enchantments.entrySet()) {
NBTTagCompound subtag = new NBTTagCompound();
subtag.a("id", (short)entry.getKey().getId());
subtag.a("lvl", (short)(int)entry.getValue());
subtag.setShort("id", (short)entry.getKey().getId());
subtag.setShort("lvl", (short)(int)entry.getValue());
list.a(subtag);
list.add(subtag);
}
tag.a("ench", (NBTBase)list);
tag.set("ench", list);
}
public net.minecraft.server.ItemStack getHandle() {

View File

@ -36,7 +36,7 @@ public class CraftMapCanvas implements MapCanvas {
if (x < 0 || y < 0 || x >= 128 || y >= 128) return;
if (buffer[y * 128 + x] != color) {
buffer[y * 128 + x] = color;
mapView.worldMap.a(x, y, y);
mapView.worldMap.flagDirty(x, y, y);
}
}

View File

@ -1,7 +1,7 @@
package org.bukkit.craftbukkit.map;
import net.minecraft.server.WorldMap;
import net.minecraft.server.WorldMapOrienter;
import net.minecraft.server.WorldMapDecoration;
import org.bukkit.entity.Player;
import org.bukkit.map.MapCanvas;
@ -25,7 +25,7 @@ public class CraftMapRenderer extends MapRenderer {
// Map
for (int x = 0; x < 128; ++x) {
for (int y = 0; y < 128; ++y) {
canvas.setPixel(x, y, worldMap.f[y * 128 + x]);
canvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
}
}
@ -34,9 +34,9 @@ public class CraftMapRenderer extends MapRenderer {
while (cursors.size() > 0) {
cursors.removeCursor(cursors.getCursor(0));
}
for (int i = 0; i < worldMap.i.size(); ++i) {
WorldMapOrienter orienter = (WorldMapOrienter) worldMap.i.get(i);
cursors.addCursor(orienter.b, orienter.c, (byte)(orienter.d & 15), (byte)(orienter.a));
for (int i = 0; i < worldMap.decorations.size(); ++i) {
WorldMapDecoration decoration = (WorldMapDecoration) worldMap.decorations.get(i);
cursors.addCursor(decoration.locX, decoration.locY, (byte)(decoration.rotation & 15), (byte)(decoration.type));
}
}

View File

@ -46,11 +46,11 @@ public final class CraftMapView implements MapView {
}
public Scale getScale() {
return Scale.valueOf(worldMap.e);
return Scale.valueOf(worldMap.scale);
}
public void setScale(Scale scale) {
worldMap.e = scale.getValue();
worldMap.scale = scale.getValue();
}
public World getWorld() {
@ -68,19 +68,19 @@ public final class CraftMapView implements MapView {
}
public int getCenterX() {
return worldMap.b;
return worldMap.centerX;
}
public int getCenterZ() {
return worldMap.c;
return worldMap.centerZ;
}
public void setCenterX(int x) {
worldMap.b = x;
worldMap.centerX = x;
}
public void setCenterZ(int z) {
worldMap.c = z;
worldMap.centerZ = z;
}
public List<MapRenderer> getRenderers() {