Update to mc-dev rename revision 01

By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
CraftBukkit/Spigot 2012-01-12 15:27:39 +00:00
parent 11d06bdb64
commit 1e0e49a804
17 changed files with 65 additions and 68 deletions

View File

@ -52,7 +52,7 @@
<dependency> <dependency>
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>minecraft-server</artifactId> <artifactId>minecraft-server</artifactId>
<version>1.0.1</version> <version>1.0.1_01</version>
<type>jar</type> <type>jar</type>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>

View File

@ -57,7 +57,7 @@ public final class ChunkCompressionThread implements Runnable {
Packet51MapChunk packet = (Packet51MapChunk) queuedPacket.packet; Packet51MapChunk packet = (Packet51MapChunk) queuedPacket.packet;
// If 'packet.g' is set then this packet has already been compressed. // If 'packet.g' is set then this packet has already been compressed.
if (packet.g != null) { if (packet.buffer != null) {
return; return;
} }
@ -76,9 +76,9 @@ public final class ChunkCompressionThread implements Runnable {
} }
// copy compressed data to packet // copy compressed data to packet
packet.g = new byte[size]; packet.buffer = new byte[size];
packet.h = size; packet.size = size;
System.arraycopy(deflateBuffer, 0, packet.g, 0, size); System.arraycopy(deflateBuffer, 0, packet.buffer, 0, size);
} }
private void sendToNetworkQueue(QueuedPacket queuedPacket) { private void sendToNetworkQueue(QueuedPacket queuedPacket) {

View File

@ -148,7 +148,7 @@ public class CraftChunk implements Chunk {
if (includeBiome) { if (includeBiome) {
biome = new BiomeBase[256]; biome = new BiomeBase[256];
wcm.a(biome, x << 4, z << 4, 16, 16); wcm.getBiomeBlock(biome, x << 4, z << 4, 16, 16);
} }
if (includeBiomeTempRain) { if (includeBiomeTempRain) {
@ -205,7 +205,7 @@ public class CraftChunk implements Chunk {
if (includeBiome) { if (includeBiome) {
biome = new BiomeBase[256]; biome = new BiomeBase[256];
wcm.a(biome, x << 4, z << 4, 16, 16); wcm.getBiomeBlock(biome, x << 4, z << 4, 16, 16);
} }
if (includeBiomeTempRain) { if (includeBiomeTempRain) {

View File

@ -783,7 +783,7 @@ public final class CraftServer implements Server {
public CraftMapView getMap(short id) { public CraftMapView getMap(short id) {
WorldMapCollection collection = console.worlds.get(0).worldMaps; WorldMapCollection collection = console.worlds.get(0).worldMaps;
WorldMap worldmap = (WorldMap) collection.a(WorldMap.class, "map_" + id); WorldMap worldmap = (WorldMap) collection.get(WorldMap.class, "map_" + id);
if (worldmap == null) { if (worldmap == null) {
return null; return null;
} }
@ -792,7 +792,7 @@ public final class CraftServer implements Server {
public CraftMapView createMap(World world) { public CraftMapView createMap(World world) {
ItemStack stack = new ItemStack(Item.MAP, 1, -1); ItemStack stack = new ItemStack(Item.MAP, 1, -1);
WorldMap worldmap = Item.MAP.a(stack, ((CraftWorld) world).getHandle()); WorldMap worldmap = Item.MAP.getSavedMap(stack, ((CraftWorld) world).getHandle());
return worldmap.mapView; return worldmap.mapView;
} }

View File

@ -319,7 +319,7 @@ public class CraftWorld implements World {
EntityArrow arrow = new EntityArrow(world); EntityArrow arrow = new EntityArrow(world);
arrow.setPositionRotation(loc.getX(), loc.getY(), loc.getZ(), 0, 0); arrow.setPositionRotation(loc.getX(), loc.getY(), loc.getZ(), 0, 0);
world.addEntity(arrow); world.addEntity(arrow);
arrow.a(velocity.getX(), velocity.getY(), velocity.getZ(), speed, spread); arrow.shoot(velocity.getX(), velocity.getY(), velocity.getZ(), speed, spread);
return (Arrow) arrow.getBukkitEntity(); return (Arrow) arrow.getBukkitEntity();
} }
@ -802,7 +802,7 @@ public class CraftWorld implements World {
break; break;
} }
entity = new EntityPainting(world, (int) x, (int) y, (int) z, dir); entity = new EntityPainting(world, (int) x, (int) y, (int) z, dir);
if (!((EntityPainting) entity).j()) { if (!((EntityPainting) entity).survives()) {
entity = null; entity = null;
} }
} else if (TNTPrimed.class.isAssignableFrom(clazz)) { } else if (TNTPrimed.class.isAssignableFrom(clazz)) {
@ -917,6 +917,6 @@ public class CraftWorld implements World {
block.setType(org.bukkit.Material.AIR); block.setType(org.bukkit.Material.AIR);
// not sure what this does, seems to have something to do with the 'base' material of a block. // not sure what this does, seems to have something to do with the 'base' material of a block.
// For example, WOODEN_STAIRS does something with WOOD in this method // For example, WOODEN_STAIRS does something with WOOD in this method
net.minecraft.server.Block.byId[blockId].a_(this.world, blockX, blockY, blockZ); net.minecraft.server.Block.byId[blockId].wasExploded(this.world, blockX, blockY, blockZ);
} }
} }

View File

@ -325,7 +325,7 @@ public class CraftBlock implements Block {
} }
public PistonMoveReaction getPistonMoveReaction() { public PistonMoveReaction getPistonMoveReaction() {
return PistonMoveReaction.getById(net.minecraft.server.Block.byId[this.getTypeId()].material.l()); return PistonMoveReaction.getById(net.minecraft.server.Block.byId[this.getTypeId()].material.getPushReaction());
} }
} }

View File

@ -21,14 +21,14 @@ public class CraftJukebox extends CraftBlockState implements Jukebox {
} }
public Material getPlaying() { public Material getPlaying() {
return Material.getMaterial(jukebox.a); return Material.getMaterial(jukebox.record);
} }
public void setPlaying(Material record) { public void setPlaying(Material record) {
if (record == null) { if (record == null) {
record = Material.AIR; record = Material.AIR;
} }
jukebox.a = record.getId(); jukebox.record = record.getId();
jukebox.update(); jukebox.update();
if (record == Material.AIR) { if (record == Material.AIR) {
world.getHandle().setData(getX(), getY(), getZ(), 0); world.getHandle().setData(getX(), getY(), getZ(), 0);
@ -44,7 +44,7 @@ public class CraftJukebox extends CraftBlockState implements Jukebox {
public boolean eject() { public boolean eject() {
boolean result = isPlaying(); boolean result = isPlaying();
((BlockJukeBox)net.minecraft.server.Block.JUKEBOX).c_(world.getHandle(), getX(), getY(), getZ()); ((BlockJukeBox)net.minecraft.server.Block.JUKEBOX).dropRecord(world.getHandle(), getX(), getY(), getZ());
return result; return result;
} }
} }

View File

@ -9,7 +9,7 @@ public class CraftRemoteConsoleCommandSender extends ServerCommandSender impleme
} }
public void sendMessage(String message) { public void sendMessage(String message) {
RemoteControlCommandListener.a.sendMessage(message + "\n"); // Send a newline after each message, to preserve formatting. RemoteControlCommandListener.instance.sendMessage(message + "\n"); // Send a newline after each message, to preserve formatting.
} }
public String getName() { public String getName() {

View File

@ -1,6 +1,5 @@
package org.bukkit.craftbukkit.entity; package org.bukkit.craftbukkit.entity;
import net.minecraft.server.Entity;
import net.minecraft.server.EntityComplexPart; import net.minecraft.server.EntityComplexPart;
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.ComplexEntityPart; import org.bukkit.entity.ComplexEntityPart;
@ -12,7 +11,7 @@ public class CraftComplexPart extends CraftEntity implements ComplexEntityPart {
} }
public ComplexLivingEntity getParent() { public ComplexLivingEntity getParent() {
return (ComplexLivingEntity) getHandle().a.getBukkitEntity(); return (ComplexLivingEntity) getHandle().owner.getBukkitEntity();
} }
@Override @Override

View File

@ -5,7 +5,6 @@ import com.google.common.collect.ImmutableSet.Builder;
import java.util.Set; import java.util.Set;
import net.minecraft.server.EntityComplexPart; import net.minecraft.server.EntityComplexPart;
import net.minecraft.server.EntityEnderDragon; import net.minecraft.server.EntityEnderDragon;
import net.minecraft.server.EntityLiving;
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.ComplexEntityPart; import org.bukkit.entity.ComplexEntityPart;
import org.bukkit.entity.EnderDragon; import org.bukkit.entity.EnderDragon;
@ -18,7 +17,7 @@ public class CraftEnderDragon extends CraftComplexLivingEntity implements EnderD
public Set<ComplexEntityPart> getParts() { public Set<ComplexEntityPart> getParts() {
Builder<ComplexEntityPart> builder = ImmutableSet.builder(); Builder<ComplexEntityPart> builder = ImmutableSet.builder();
for (EntityComplexPart part : getHandle().f) { for (EntityComplexPart part : getHandle().children) {
builder.add((ComplexEntityPart) part.getBukkitEntity()); builder.add((ComplexEntityPart) part.getBukkitEntity());
} }

View File

@ -96,7 +96,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
} }
else if (entity instanceof EntityComplexPart) { else if (entity instanceof EntityComplexPart) {
EntityComplexPart part = (EntityComplexPart) entity; EntityComplexPart part = (EntityComplexPart) entity;
if (part.a instanceof EntityEnderDragon) { return new CraftEnderDragonPart(server, (EntityComplexPart) entity); } if (part.owner instanceof EntityEnderDragon) { return new CraftEnderDragonPart(server, (EntityComplexPart) entity); }
else { return new CraftComplexPart(server, (EntityComplexPart) entity); } else { return new CraftComplexPart(server, (EntityComplexPart) entity); }
} }
else if (entity instanceof EntityExperienceOrb) { return new CraftExperienceOrb(server, (EntityExperienceOrb) entity); } else if (entity instanceof EntityExperienceOrb) { return new CraftExperienceOrb(server, (EntityExperienceOrb) entity); }
@ -173,7 +173,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
public List<org.bukkit.entity.Entity> getNearbyEntities(double x, double y, double z) { public List<org.bukkit.entity.Entity> getNearbyEntities(double x, double y, double z) {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
List<Entity> notchEntityList = entity.world.b(entity, entity.boundingBox.b(x, y, z)); List<Entity> notchEntityList = entity.world.getEntities(entity, entity.boundingBox.grow(x, y, z));
List<org.bukkit.entity.Entity> bukkitEntityList = new java.util.ArrayList<org.bukkit.entity.Entity>(notchEntityList.size()); List<org.bukkit.entity.Entity> bukkitEntityList = new java.util.ArrayList<org.bukkit.entity.Entity>(notchEntityList.size());
for (Entity e: notchEntityList) { for (Entity e: notchEntityList) {

View File

@ -25,7 +25,6 @@ import java.util.HashSet;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import net.minecraft.server.DamageSource; import net.minecraft.server.DamageSource;
import net.minecraft.server.EntityHuman;
import org.bukkit.entity.HumanEntity; import org.bukkit.entity.HumanEntity;
public class CraftLivingEntity extends CraftEntity implements LivingEntity { public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@ -227,6 +226,6 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
} }
public Player getKiller() { public Player getKiller() {
return getHandle().aF == null ? null : (Player)getHandle().aF.getBukkitEntity(); return getHandle().killer == null ? null : (Player)getHandle().killer.getBukkitEntity();
} }
} }

View File

@ -21,7 +21,7 @@ public class CraftPainting extends CraftEntity implements Painting {
} }
public Art getArt() { public Art getArt() {
EnumArt art = getHandle().e; EnumArt art = getHandle().art;
return CraftArt.NotchToBukkit(art); return CraftArt.NotchToBukkit(art);
} }
@ -31,14 +31,14 @@ public class CraftPainting extends CraftEntity implements Painting {
public boolean setArt(Art art, boolean force) { public boolean setArt(Art art, boolean force) {
EntityPainting painting = this.getHandle(); EntityPainting painting = this.getHandle();
EnumArt oldArt = painting.e; EnumArt oldArt = painting.art;
EnumArt newArt = CraftArt.BukkitToNotch(art); EnumArt newArt = CraftArt.BukkitToNotch(art);
painting.e = newArt; painting.art = newArt;
painting.b(painting.a); painting.setDirection(painting.direction);
if (!force && !painting.j()) { if (!force && !painting.survives()) {
// Revert painting since it doesn't fit // Revert painting since it doesn't fit
painting.e = oldArt; painting.art = oldArt;
painting.b(painting.a); painting.setDirection(painting.direction);
return false; return false;
} }
this.update(); this.update();
@ -56,31 +56,31 @@ public class CraftPainting extends CraftEntity implements Painting {
public boolean setFacingDirection(BlockFace face, boolean force) { public boolean setFacingDirection(BlockFace face, boolean force) {
Block block = getLocation().getBlock().getRelative(getAttachedFace()).getRelative(face.getOppositeFace()).getRelative(getFacing()); Block block = getLocation().getBlock().getRelative(getAttachedFace()).getRelative(face.getOppositeFace()).getRelative(getFacing());
EntityPainting painting = getHandle(); EntityPainting painting = getHandle();
int x = painting.b, y = painting.c, z = painting.d, dir = painting.a; int x = painting.x, y = painting.y, z = painting.z, dir = painting.direction;
painting.b = block.getX(); painting.x = block.getX();
painting.c = block.getY(); painting.y = block.getY();
painting.d = block.getZ(); painting.z = block.getZ();
switch (face) { switch (face) {
case EAST: case EAST:
default: default:
getHandle().b(0); getHandle().setDirection(0);
break; break;
case NORTH: case NORTH:
getHandle().b(1); getHandle().setDirection(1);
break; break;
case WEST: case WEST:
getHandle().b(2); getHandle().setDirection(2);
break; break;
case SOUTH: case SOUTH:
getHandle().b(3); getHandle().setDirection(3);
break; break;
} }
if (!force && !painting.j()) { if (!force && !painting.survives()) {
// Revert painting since it doesn't fit // Revert painting since it doesn't fit
painting.b = x; painting.x = x;
painting.c = y; painting.y = y;
painting.d = z; painting.z = z;
painting.b(dir); painting.setDirection(dir);
return false; return false;
} }
this.update(); this.update();
@ -88,7 +88,7 @@ public class CraftPainting extends CraftEntity implements Painting {
} }
public BlockFace getFacing() { public BlockFace getFacing() {
switch (this.getHandle().a) { switch (this.getHandle().direction) {
case 0: case 0:
default: default:
return BlockFace.EAST; return BlockFace.EAST;
@ -104,11 +104,11 @@ public class CraftPainting extends CraftEntity implements Painting {
private void update() { private void update() {
WorldServer world = ((CraftWorld)getWorld()).getHandle(); WorldServer world = ((CraftWorld)getWorld()).getHandle();
EntityPainting painting = new EntityPainting(world); EntityPainting painting = new EntityPainting(world);
painting.b = getHandle().b; painting.x = getHandle().x;
painting.c = getHandle().c; painting.y = getHandle().y;
painting.d = getHandle().d; painting.z = getHandle().z;
painting.e = getHandle().e; painting.art = getHandle().art;
painting.b(getHandle().a); painting.setDirection(getHandle().direction);
getHandle().die(); getHandle().die();
getHandle().velocityChanged = true; // because this occurs when the painting is broken, so it might be important getHandle().velocityChanged = true; // because this occurs when the painting is broken, so it might be important
world.addEntity(painting); world.addEntity(painting);

View File

@ -161,7 +161,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Change the name on the client side // Change the name on the client side
server.getHandle().sendAll(new Packet201PlayerInfo(oldName, false, 9999)); server.getHandle().sendAll(new Packet201PlayerInfo(oldName, false, 9999));
server.getHandle().sendAll(new Packet201PlayerInfo(name, true, getHandle().i)); server.getHandle().sendAll(new Packet201PlayerInfo(name, true, getHandle().ping));
} }
@Override @Override
@ -335,11 +335,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
public void loadData() { public void loadData() {
server.getHandle().playerFileData.b(getHandle()); server.getHandle().playerFileData.load(getHandle());
} }
public void saveData() { public void saveData() {
server.getHandle().playerFileData.a(getHandle()); server.getHandle().playerFileData.save(getHandle());
} }
public void updateInventory() { public void updateInventory() {
@ -459,14 +459,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return; return;
} }
getHandle().itemInWorldManager.a(mode.getValue()); getHandle().itemInWorldManager.setGameMode(mode.getValue());
getHandle().netServerHandler.sendPacket(new Packet70Bed(3, mode.getValue())); getHandle().netServerHandler.sendPacket(new Packet70Bed(3, mode.getValue()));
} }
} }
@Override @Override
public GameMode getGameMode() { public GameMode getGameMode() {
return GameMode.getByValue(getHandle().itemInWorldManager.a()); return GameMode.getByValue(getHandle().itemInWorldManager.getGameMode());
} }
public void giveExp(int exp) { public void giveExp(int exp) {
@ -497,7 +497,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void setLevel(int level) { public void setLevel(int level) {
getHandle().expLevel = level; getHandle().expLevel = level;
getHandle().cf = -1; getHandle().lastSentExp = -1;
} }
public int getTotalExperience() { public int getTotalExperience() {
@ -506,7 +506,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void setTotalExperience(int exp) { public void setTotalExperience(int exp) {
getHandle().expTotal = exp; getHandle().expTotal = exp;
getHandle().cf = -1; getHandle().lastSentExp = -1;
if (getTotalExperience() > getExperience()) { if (getTotalExperience() > getExperience()) {
getHandle().expTotal = getTotalExperience(); getHandle().expTotal = getTotalExperience();

View File

@ -78,19 +78,19 @@ public class CustomChunkGenerator extends InternalChunkGenerator {
return generator.getDefaultPopulators(world); return generator.getDefaultPopulators(world);
} }
public List a(EnumCreatureType type, int x, int y, int z) { public List getMobsFor(EnumCreatureType type, int x, int y, int z) {
WorldChunkManager worldchunkmanager = world.getWorldChunkManager(); WorldChunkManager worldchunkmanager = world.getWorldChunkManager();
if (worldchunkmanager == null) { if (worldchunkmanager == null) {
return null; return null;
} else { } else {
BiomeBase biomebase = worldchunkmanager.a(new ChunkCoordIntPair(x >> 4, z >> 4)); BiomeBase biomebase = worldchunkmanager.getBiome(new ChunkCoordIntPair(x >> 4, z >> 4));
return biomebase == null ? null : biomebase.a(type); return biomebase == null ? null : biomebase.getMobs(type);
} }
} }
public ChunkPosition a(World world, String type, int x, int y, int z) { public ChunkPosition findNearestMapFeature(World world, String type, int x, int y, int z) {
return "Stronghold".equals(type) && this.strongholdGen != null ? this.strongholdGen.a(world, x, y, z) : null; return "Stronghold".equals(type) && this.strongholdGen != null ? this.strongholdGen.getNearestGeneratedFeature(world, x, y, z) : null;
} }
} }

View File

@ -59,11 +59,11 @@ public class NormalChunkGenerator extends InternalChunkGenerator {
return provider.canSave(); return provider.canSave();
} }
public List a(EnumCreatureType ect, int i, int i1, int i2) { public List getMobsFor(EnumCreatureType ect, int i, int i1, int i2) {
return provider.a(ect, i, i1, i2); return provider.getMobsFor(ect, i, i1, i2);
} }
public ChunkPosition a(World world, String string, int i, int i1, int i2) { public ChunkPosition findNearestMapFeature(World world, String string, int i, int i1, int i2) {
return provider.a(world, string, i, i1, i2); return provider.findNearestMapFeature(world, string, i, i1, i2);
} }
} }

View File

@ -28,7 +28,7 @@ public final class CraftMapView implements MapView {
} }
public short getId() { public short getId() {
String text = worldMap.a; String text = worldMap.id;
if (text.startsWith("map_")) { if (text.startsWith("map_")) {
try { try {
return Short.parseShort(text.substring("map_".length())); return Short.parseShort(text.substring("map_".length()));