Updated to rename revision 02

By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
CraftBukkit/Spigot 2012-02-29 22:31:04 +01:00
parent ddf9216f11
commit 34d3cf9be4
16 changed files with 75 additions and 75 deletions

View File

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

View File

@ -589,7 +589,7 @@ public final class CraftServer implements Server {
ChunkGenerator generator = creator.generator();
File folder = new File(getWorldContainer(), name);
World world = getWorld(name);
WorldType type = WorldType.a(creator.type().getName());
WorldType type = WorldType.getType(creator.type().getName());
boolean generateStructures = creator.generateStructures();
if (world != null) {
@ -824,13 +824,13 @@ public final class CraftServer implements Server {
}
public void clearRecipes() {
CraftingManager.getInstance().b.clear();
FurnaceRecipes.getInstance().b().clear();
CraftingManager.getInstance().recipies.clear();
FurnaceRecipes.getInstance().recipies.clear();
}
public void resetRecipes() {
CraftingManager.getInstance().b = new CraftingManager().b;
FurnaceRecipes.getInstance().b = new FurnaceRecipes().b;
CraftingManager.getInstance().recipies = new CraftingManager().recipies;
FurnaceRecipes.getInstance().recipies = new FurnaceRecipes().recipies;
}
public Map<String, String[]> getCommandAliases() {

View File

@ -1037,7 +1037,7 @@ public class CraftWorld implements World {
}
public boolean canGenerateStructures() {
return world.getWorldData().o();
return world.getWorldData().shouldGenerateMapFeatures();
}
public long getTicksPerAnimalSpawns() {

View File

@ -124,11 +124,11 @@ public class CraftBlock implements Block {
}
public byte getLightFromSky() {
return (byte) chunk.getHandle().a(EnumSkyBlock.SKY, this.x & 0xF, this.y & 0x7F, this.z & 0xF);
return (byte) chunk.getHandle().getBrightness(EnumSkyBlock.SKY, this.x & 0xF, this.y & 0x7F, this.z & 0xF);
}
public byte getLightFromBlocks() {
return (byte) chunk.getHandle().a(EnumSkyBlock.BLOCK, this.x & 0xF, this.y & 0x7F, this.z & 0xF);
return (byte) chunk.getHandle().getBrightness(EnumSkyBlock.BLOCK, this.x & 0xF, this.y & 0x7F, this.z & 0xF);
}
@ -253,7 +253,7 @@ public class CraftBlock implements Block {
return null;
}
return BIOME_MAPPING[base.K];
return BIOME_MAPPING[base.id];
}
public double getTemperature() {
@ -326,7 +326,7 @@ public class CraftBlock implements Block {
private boolean itemCausesDrops(ItemStack item) {
net.minecraft.server.Block block = net.minecraft.server.Block.byId[this.getTypeId()];
net.minecraft.server.Item itemType = item != null ? net.minecraft.server.Item.byId[item.getTypeId()] : null;
return block != null && (block.material.k() || (itemType != null && itemType.a(block)));
return block != null && (block.material.isAlwaysDestroyable() || (itemType != null && itemType.canDestroySpecialBlock(block)));
}
public boolean breakNaturally() {
@ -377,32 +377,32 @@ public class CraftBlock implements Block {
/* Build biome index based lookup table for BiomeBase to Biome mapping */
static {
BIOME_MAPPING = new Biome[BiomeBase.a.length];
BIOME_MAPPING[BiomeBase.SWAMPLAND.K] = Biome.SWAMPLAND;
BIOME_MAPPING[BiomeBase.FOREST.K] = Biome.FOREST;
BIOME_MAPPING[BiomeBase.TAIGA.K] = Biome.TAIGA;
BIOME_MAPPING[BiomeBase.DESERT.K] = Biome.DESERT;
BIOME_MAPPING[BiomeBase.PLAINS.K] = Biome.PLAINS;
BIOME_MAPPING[BiomeBase.HELL.K] = Biome.HELL;
BIOME_MAPPING[BiomeBase.SKY.K] = Biome.SKY;
BIOME_MAPPING[BiomeBase.RIVER.K] = Biome.RIVER;
BIOME_MAPPING[BiomeBase.EXTREME_HILLS.K] = Biome.EXTREME_HILLS;
BIOME_MAPPING[BiomeBase.OCEAN.K] = Biome.OCEAN;
BIOME_MAPPING[BiomeBase.FROZEN_OCEAN.K] = Biome.FROZEN_OCEAN;
BIOME_MAPPING[BiomeBase.FROZEN_RIVER.K] = Biome.FROZEN_RIVER;
BIOME_MAPPING[BiomeBase.ICE_PLAINS.K] = Biome.ICE_PLAINS;
BIOME_MAPPING[BiomeBase.ICE_MOUNTAINS.K] = Biome.ICE_MOUNTAINS;
BIOME_MAPPING[BiomeBase.MUSHROOM_ISLAND.K] = Biome.MUSHROOM_ISLAND;
BIOME_MAPPING[BiomeBase.MUSHROOM_SHORE.K] = Biome.MUSHROOM_SHORE;
BIOME_MAPPING[BiomeBase.BEACH.K] = Biome.BEACH;
BIOME_MAPPING[BiomeBase.DESERT_HILLS.K] = Biome.DESERT_HILLS;
BIOME_MAPPING[BiomeBase.FOREST_HILLS.K] = Biome.FOREST_HILLS;
BIOME_MAPPING[BiomeBase.TAIGA_HILLS.K] = Biome.TAIGA_HILLS;
BIOME_MAPPING[BiomeBase.SMALL_MOUNTAINS.K] = Biome.SMALL_MOUNTAINS;
BIOME_MAPPING = new Biome[BiomeBase.biomes.length];
BIOME_MAPPING[BiomeBase.SWAMPLAND.id] = Biome.SWAMPLAND;
BIOME_MAPPING[BiomeBase.FOREST.id] = Biome.FOREST;
BIOME_MAPPING[BiomeBase.TAIGA.id] = Biome.TAIGA;
BIOME_MAPPING[BiomeBase.DESERT.id] = Biome.DESERT;
BIOME_MAPPING[BiomeBase.PLAINS.id] = Biome.PLAINS;
BIOME_MAPPING[BiomeBase.HELL.id] = Biome.HELL;
BIOME_MAPPING[BiomeBase.SKY.id] = Biome.SKY;
BIOME_MAPPING[BiomeBase.RIVER.id] = Biome.RIVER;
BIOME_MAPPING[BiomeBase.EXTREME_HILLS.id] = Biome.EXTREME_HILLS;
BIOME_MAPPING[BiomeBase.OCEAN.id] = Biome.OCEAN;
BIOME_MAPPING[BiomeBase.FROZEN_OCEAN.id] = Biome.FROZEN_OCEAN;
BIOME_MAPPING[BiomeBase.FROZEN_RIVER.id] = Biome.FROZEN_RIVER;
BIOME_MAPPING[BiomeBase.ICE_PLAINS.id] = Biome.ICE_PLAINS;
BIOME_MAPPING[BiomeBase.ICE_MOUNTAINS.id] = Biome.ICE_MOUNTAINS;
BIOME_MAPPING[BiomeBase.MUSHROOM_ISLAND.id] = Biome.MUSHROOM_ISLAND;
BIOME_MAPPING[BiomeBase.MUSHROOM_SHORE.id] = Biome.MUSHROOM_SHORE;
BIOME_MAPPING[BiomeBase.BEACH.id] = Biome.BEACH;
BIOME_MAPPING[BiomeBase.DESERT_HILLS.id] = Biome.DESERT_HILLS;
BIOME_MAPPING[BiomeBase.FOREST_HILLS.id] = Biome.FOREST_HILLS;
BIOME_MAPPING[BiomeBase.TAIGA_HILLS.id] = Biome.TAIGA_HILLS;
BIOME_MAPPING[BiomeBase.SMALL_MOUNTAINS.id] = Biome.SMALL_MOUNTAINS;
/* Sanity check - we should have a record for each record in the BiomeBase.a table */
/* Helps avoid missed biomes when we upgrade bukkit to new code with new biomes */
for (int i = 0; i < BIOME_MAPPING.length; i++) {
if ((BiomeBase.a[i] != null) && (BIOME_MAPPING[i] == null)) {
if ((BiomeBase.biomes[i] != null) && (BIOME_MAPPING[i] == null)) {
throw new IllegalArgumentException("Missing Biome mapping for BiomeBase[" + i + "]");
}
}

View File

@ -34,10 +34,10 @@ public class CraftBrewingStand extends CraftBlockState implements BrewingStand {
}
public int getBrewingTime() {
return brewingStand.b;
return brewingStand.brewTime;
}
public void setBrewingTime(int brewTime) {
brewingStand.b = brewTime;
brewingStand.brewTime = brewTime;
}
}

View File

@ -33,7 +33,7 @@ public abstract class CraftComplexLivingEntity extends CraftLivingEntity impleme
}
if (entity instanceof EntityComplex) {
((EntityComplex) entity).e(reason, amount);
((EntityComplex) entity).dealDamage(reason, amount);
} else {
entity.damageEntity(reason, amount);
}

View File

@ -297,7 +297,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
}
public void playEffect(EntityEffect type) {
this.getHandle().world.a(getHandle(), type.getData());
this.getHandle().world.broadcastEntityEffect(getHandle(), type.getData());
}
public void setHandle(final Entity entity) {

View File

@ -64,14 +64,14 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
}
public ItemStack getItemOnCursor() {
return new CraftItemStack(getHandle().inventory.l());
return new CraftItemStack(getHandle().inventory.getCarried());
}
public void setItemOnCursor(ItemStack item) {
CraftItemStack stack = new CraftItemStack(item.getType(), item.getAmount(), item.getDurability());
getHandle().inventory.b(stack.getHandle());
getHandle().inventory.setCarried(stack.getHandle());
if (this instanceof CraftPlayer) {
((EntityPlayer)getHandle()).D(); // Send set slot for cursor
((EntityPlayer) getHandle()).broadcastCarriedItem(); // Send set slot for cursor
}
}
@ -174,22 +174,22 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
switch(type) {
case PLAYER:
case CHEST:
getHandle().a(craftinv.getInventory());
getHandle().openContainer(craftinv.getInventory());
break;
case DISPENSER:
getHandle().a((TileEntityDispenser)craftinv.getInventory());
getHandle().openDispenser((TileEntityDispenser)craftinv.getInventory());
break;
case FURNACE:
getHandle().a((TileEntityFurnace)craftinv.getInventory());
getHandle().openFurnace((TileEntityFurnace)craftinv.getInventory());
break;
case WORKBENCH:
getHandle().b(getLocation().getBlockX(), getLocation().getBlockY(), getLocation().getBlockZ());
getHandle().startCrafting(getLocation().getBlockX(), getLocation().getBlockY(), getLocation().getBlockZ());
break;
case BREWING:
getHandle().a((TileEntityBrewingStand)craftinv.getInventory());
getHandle().openBrewingStand((TileEntityBrewingStand)craftinv.getInventory());
break;
case ENCHANTING:
getHandle().c(getLocation().getBlockX(), getLocation().getBlockY(), getLocation().getBlockZ());
getHandle().startEnchanting(getLocation().getBlockX(), getLocation().getBlockY(), getLocation().getBlockZ());
break;
case CREATIVE:
case CRAFTING:
@ -209,7 +209,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
if (location == null) {
location = getLocation();
}
getHandle().b(location.getBlockX(), location.getBlockY(), location.getBlockZ());
getHandle().startCrafting(location.getBlockX(), location.getBlockY(), location.getBlockZ());
if (force) {
getHandle().activeContainer.checkReachable = false;
}
@ -226,7 +226,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
if (location == null) {
location = getLocation();
}
getHandle().c(location.getBlockX(), location.getBlockY(), location.getBlockZ());
getHandle().startEnchanting(location.getBlockX(), location.getBlockY(), location.getBlockZ());
if (force) {
getHandle().activeContainer.checkReachable = false;
}
@ -237,14 +237,14 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
if (!(getHandle() instanceof EntityPlayer)) return; // TODO: NPC support?
if (getHandle().activeContainer != getHandle().defaultContainer) {
// fire INVENTORY_CLOSE if one already open
((EntityPlayer)getHandle()).netServerHandler.a(new Packet101CloseWindow(getHandle().activeContainer.windowId));
((EntityPlayer)getHandle()).netServerHandler.handleContainerClose(new Packet101CloseWindow(getHandle().activeContainer.windowId));
}
EntityPlayer player = (EntityPlayer) getHandle();
Container container;
if (inventory instanceof CraftInventoryView) {
container = ((CraftInventoryView) inventory).getHandle();
} else {
container = new CraftContainer(inventory, player.aS());
container = new CraftContainer(inventory, player.nextContainerCounter());
}
// Trigger an INVENTORY_OPEN event
@ -259,7 +259,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
// Now open the window
player.netServerHandler.sendPacket(new Packet100OpenWindow(container.windowId, 1, "Crafting", 9));
player.activeContainer = container;
player.activeContainer.a((ICrafting) player);
player.activeContainer.addSlotListener((ICrafting) player);
}
public void closeInventory() {

View File

@ -576,7 +576,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void setBedSpawnLocation(Location location) {
getHandle().a(new ChunkCoordinates(location.getBlockX(), location.getBlockY(), location.getBlockZ()));
getHandle().setRespawnPosition(new ChunkCoordinates(location.getBlockX(), location.getBlockY(), location.getBlockZ()));
getHandle().spawnWorld = location.getWorld().getName();
}
@ -587,9 +587,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
//remove this player from the hidden player's EntityTrackerEntry
EntityTracker tracker = ((WorldServer) entity.world).tracker;
EntityPlayer other = ((CraftPlayer) player).getHandle();
EntityTrackerEntry entry = (EntityTrackerEntry) tracker.trackedEntities.a(other.id);
EntityTrackerEntry entry = (EntityTrackerEntry) tracker.trackedEntities.get(other.id);
if (entry != null) {
entry.c(getHandle());
entry.clear(getHandle());
}
//remove the hidden player from this player user list
@ -602,9 +602,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
EntityTracker tracker = ((WorldServer) entity.world).tracker;
EntityPlayer other = ((CraftPlayer) player).getHandle();
EntityTrackerEntry entry = (EntityTrackerEntry) tracker.trackedEntities.a(other.id);
EntityTrackerEntry entry = (EntityTrackerEntry) tracker.trackedEntities.get(other.id);
if (entry != null && !entry.trackedPlayers.contains(getHandle())) {
entry.b(getHandle());
entry.updatePlayer(getHandle());
}
getHandle().netServerHandler.sendPacket(new Packet201PlayerInfo(player.getPlayerListName(), true, getHandle().ping));
@ -764,7 +764,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (container.getBukkitView().getType() != prop.getType()) {
return false;
}
getHandle().a(container, prop.getId(), value);
getHandle().setContainerData(container, prop.getId(), value);
return true;
}
}

View File

@ -20,7 +20,7 @@ public class CraftThrownPotion extends CraftProjectile implements ThrownPotion {
public Collection<PotionEffect> getEffects() {
if (effects == null) {
effects = Potion.getBrewer().getEffectsFromDamage(getHandle().f());
effects = Potion.getBrewer().getEffectsFromDamage(getHandle().getPotionValue());
}
return effects;

View File

@ -423,7 +423,7 @@ public class CraftEventFactory {
public static Container callInventoryOpenEvent(EntityPlayer player, Container container) {
if (player.activeContainer != player.defaultContainer) { // fire INVENTORY_CLOSE if one already open
player.netServerHandler.a(new Packet101CloseWindow(player.activeContainer.windowId));
player.netServerHandler.handleContainerClose(new Packet101CloseWindow(player.activeContainer.windowId));
}
CraftServer server = ((WorldServer) player.world).getServer();

View File

@ -17,15 +17,15 @@ public class CraftInventoryDoubleChest extends CraftInventory implements DoubleC
public CraftInventoryDoubleChest(InventoryLargeChest largeChest) {
super(largeChest);
if (largeChest.b instanceof InventoryLargeChest) {
left = new CraftInventoryDoubleChest((InventoryLargeChest)largeChest.b);
if (largeChest.left instanceof InventoryLargeChest) {
left = new CraftInventoryDoubleChest((InventoryLargeChest) largeChest.left);
} else {
left = new CraftInventory(largeChest.b);
left = new CraftInventory(largeChest.left);
}
if (largeChest.c instanceof InventoryLargeChest) {
right = new CraftInventoryDoubleChest((InventoryLargeChest)largeChest.c);
if (largeChest.right instanceof InventoryLargeChest) {
right = new CraftInventoryDoubleChest((InventoryLargeChest) largeChest.right);
} else {
right = new CraftInventory(largeChest.c);
right = new CraftInventory(largeChest.right);
}
}

View File

@ -51,7 +51,7 @@ public class CraftInventoryView extends InventoryView {
public void setItem(int slot, ItemStack item) {
if (slot != -999) {
CraftItemStack stack = new CraftItemStack(item);
container.b(slot).c(stack.getHandle());
container.getSlot(slot).set(stack.getHandle());
}
}
@ -60,7 +60,7 @@ public class CraftInventoryView extends InventoryView {
if (slot == -999) {
return null;
}
return new CraftItemStack(container.b(slot).getItem());
return new CraftItemStack(container.getSlot(slot).getItem());
}
public boolean isInTop(int rawSlot) {

View File

@ -13,10 +13,10 @@ public class RecipeIterator implements Iterator<Recipe> {
private Iterator<CraftingRecipe> recipes;
private Iterator<Integer> smelting;
private Iterator<?> removeFrom = null;
public RecipeIterator() {
this.recipes = CraftingManager.getInstance().b().iterator();
this.smelting = FurnaceRecipes.getInstance().b().keySet().iterator();
this.recipes = CraftingManager.getInstance().getRecipies().iterator();
this.smelting = FurnaceRecipes.getInstance().getRecipies().keySet().iterator();
}
public boolean hasNext() {
@ -34,7 +34,7 @@ public class RecipeIterator implements Iterator<Recipe> {
} else {
removeFrom = smelting;
int id = smelting.next();
CraftItemStack stack = new CraftItemStack(FurnaceRecipes.getInstance().a(id));
CraftItemStack stack = new CraftItemStack(FurnaceRecipes.getInstance().getResult(id));
CraftFurnaceRecipe recipe = new CraftFurnaceRecipe(stack, new ItemStack(id, 1, (short) -1));
return recipe;
}

View File

@ -20,7 +20,7 @@ public class CraftPotionBrewer implements PotionBrewer {
if (cache.containsKey(damage))
return cache.get(damage);
List<?> mcEffects = net.minecraft.server.PotionBrewer.a(damage, false);
List<?> mcEffects = net.minecraft.server.PotionBrewer.getEffects(damage, false);
List<PotionEffect> effects = new ArrayList<PotionEffect>();
if (mcEffects == null)
return effects;

View File

@ -14,7 +14,7 @@ public class CraftPotionEffectType extends PotionEffectType {
@Override
public double getDurationModifier() {
return handle.d();
return handle.getDurationModifier();
}
public MobEffectList getHandle() {
@ -69,6 +69,6 @@ public class CraftPotionEffectType extends PotionEffectType {
@Override
public boolean isInstant() {
return handle.b();
return handle.isInstant();
}
}