Archiviert
13
0

Purged deprecated MobType and MobSpawner

Dieser Commit ist enthalten in:
Dinnerbone 2011-03-07 16:32:41 +00:00
Ursprung 6a99d8c412
Commit e8e74992cb
3 geänderte Dateien mit 17 neuen und 51 gelöschten Zeilen

Datei anzeigen

@ -3,8 +3,8 @@ package net.minecraft.server;
import java.util.List;
// CraftBukkit start
import org.bukkit.entity.CreatureType;
import org.bukkit.entity.Egg;
import org.bukkit.entity.MobType;
import org.bukkit.entity.Player;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.event.Event.Type;
@ -188,7 +188,8 @@ public class EntityEgg extends Entity {
if (!hatching) {
numHatching = 0;
}
MobType hatchingType = MobType.CHICKEN;
CreatureType hatchingType = CreatureType.CHICKEN;
if (this.g instanceof EntityPlayer) {
CraftServer server = ((WorldServer) this.world).getServer();

Datei anzeigen

@ -12,12 +12,12 @@ import java.util.TreeSet;
import org.bukkit.Location;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.entity.CreatureType;
import org.bukkit.event.Event;
import org.bukkit.event.Event.Type;
import org.bukkit.event.block.BlockCanBuildEvent;
import org.bukkit.event.block.BlockPhysicsEvent;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.entity.MobType;
// CraftBukkit end
public class World implements IBlockAccess {
@ -716,30 +716,30 @@ public class World implements IBlockAccess {
// CraftBukkit start
if (entity instanceof EntityLiving) {
MobType type = null;
CreatureType type = null;
if (entity instanceof EntityChicken) {
type = MobType.CHICKEN;
type = CreatureType.CHICKEN;
} else if (entity instanceof EntityCow) {
type = MobType.COW;
type = CreatureType.COW;
} else if (entity instanceof EntityCreeper) {
type = MobType.CREEPER;
type = CreatureType.CREEPER;
} else if (entity instanceof EntityGhast) {
type = MobType.GHAST;
type = CreatureType.GHAST;
} else if (entity instanceof EntityPig) {
type = MobType.PIG;
type = CreatureType.PIG;
} else if (entity instanceof EntityPigZombie) {
type = MobType.PIG_ZOMBIE;
type = CreatureType.PIG_ZOMBIE;
} else if (entity instanceof EntitySheep) {
type = MobType.SHEEP;
type = CreatureType.SHEEP;
} else if (entity instanceof EntitySkeleton) {
type = MobType.SKELETON;
type = CreatureType.SKELETON;
} else if (entity instanceof EntitySpider) {
type = MobType.SPIDER;
type = CreatureType.SPIDER;
} else if (entity instanceof EntityZombie) {
type = MobType.ZOMBIE;
type = CreatureType.ZOMBIE;
} else if (entity instanceof EntitySlime) {
type = MobType.SLIME;
type = CreatureType.SLIME;
}
if (type != null) {

Datei anzeigen

@ -3,12 +3,10 @@ package org.bukkit.craftbukkit.block;
import net.minecraft.server.TileEntityMobSpawner;
import org.bukkit.block.Block;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.block.MobSpawner;
import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.entity.CreatureType;
import org.bukkit.entity.MobType;
public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpawner, MobSpawner {
public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpawner {
private final CraftWorld world;
private final TileEntityMobSpawner spawner;
@ -48,37 +46,4 @@ public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpa
spawner.a = delay;
}
/**
* @deprecated Use getCreatureType() instead.
*/
public MobType getMobType() {
return MobType.fromName(spawner.h);
}
/**
* @deprecated Use setCreatureType() instead.
*/
public void setMobType(MobType mobType) {
spawner.h = mobType.getName();
}
/**
* @deprecated Use getCreatureTypeId() instead.
*/
public String getMobTypeId() {
return spawner.h;
}
/**
* @deprecated Use setCreatureTypeId() instead.
*/
public void setMobTypeId(String mobType) {
// Verify input
MobType type = MobType.fromName(mobType);
if (type == null) {
return;
}
spawner.h = type.getName();
}
}