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>
<groupId>org.bukkit</groupId>
<artifactId>minecraft-server</artifactId>
<version>1.0.1</version>
<version>1.0.1_01</version>
<type>jar</type>
<scope>compile</scope>
</dependency>

View file

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

View file

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

View file

@ -783,7 +783,7 @@ public final class CraftServer implements Server {
public CraftMapView getMap(short id) {
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) {
return null;
}
@ -792,7 +792,7 @@ public final class CraftServer implements Server {
public CraftMapView createMap(World world) {
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;
}

View file

@ -319,7 +319,7 @@ public class CraftWorld implements World {
EntityArrow arrow = new EntityArrow(world);
arrow.setPositionRotation(loc.getX(), loc.getY(), loc.getZ(), 0, 0);
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();
}
@ -802,7 +802,7 @@ public class CraftWorld implements World {
break;
}
entity = new EntityPainting(world, (int) x, (int) y, (int) z, dir);
if (!((EntityPainting) entity).j()) {
if (!((EntityPainting) entity).survives()) {
entity = null;
}
} else if (TNTPrimed.class.isAssignableFrom(clazz)) {
@ -917,6 +917,6 @@ public class CraftWorld implements World {
block.setType(org.bukkit.Material.AIR);
// 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
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() {
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() {
return Material.getMaterial(jukebox.a);
return Material.getMaterial(jukebox.record);
}
public void setPlaying(Material record) {
if (record == null) {
record = Material.AIR;
}
jukebox.a = record.getId();
jukebox.record = record.getId();
jukebox.update();
if (record == Material.AIR) {
world.getHandle().setData(getX(), getY(), getZ(), 0);
@ -44,7 +44,7 @@ public class CraftJukebox extends CraftBlockState implements Jukebox {
public boolean eject() {
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;
}
}

View file

@ -9,7 +9,7 @@ public class CraftRemoteConsoleCommandSender extends ServerCommandSender impleme
}
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() {

View file

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

View file

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

View file

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

View file

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

View file

@ -78,19 +78,19 @@ public class CustomChunkGenerator extends InternalChunkGenerator {
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();
if (worldchunkmanager == null) {
return null;
} 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) {
return "Stronghold".equals(type) && this.strongholdGen != null ? this.strongholdGen.a(world, x, y, z) : null;
public ChunkPosition findNearestMapFeature(World world, String type, int x, int y, int z) {
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();
}
public List a(EnumCreatureType ect, int i, int i1, int i2) {
return provider.a(ect, i, i1, i2);
public List getMobsFor(EnumCreatureType ect, int i, int i1, int i2) {
return provider.getMobsFor(ect, i, i1, i2);
}
public ChunkPosition a(World world, String string, int i, int i1, int i2) {
return provider.a(world, string, i, i1, i2);
public ChunkPosition findNearestMapFeature(World world, String string, int i, int i1, int i2) {
return provider.findNearestMapFeature(world, string, i, i1, i2);
}
}

View file

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