@@ -1,6 +1,6 @@
|
||||
package org.bukkit.craftbukkit;
|
||||
|
||||
import net.minecraft.server.EnumArt;
|
||||
import net.minecraft.server.EntityPainting.EnumArt;
|
||||
import org.bukkit.Art;
|
||||
|
||||
// Safety class, will break if either side changes
|
||||
|
||||
@@ -113,6 +113,7 @@ public class CraftChunk implements Chunk {
|
||||
BlockPosition position = (BlockPosition) obj;
|
||||
entities[index++] = worldServer.getWorld().getBlockAt(position.getX(), position.getY(), position.getZ()).getState();
|
||||
}
|
||||
|
||||
return entities;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ import net.minecraft.server.MinecraftServer;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
public final class CraftIpBanEntry implements org.bukkit.BanEntry {
|
||||
private final IpBanList list;
|
||||
@@ -80,7 +82,7 @@ public final class CraftIpBanEntry implements org.bukkit.BanEntry {
|
||||
try {
|
||||
this.list.save();
|
||||
} catch (IOException ex) {
|
||||
MinecraftServer.getLogger().error("Failed to save banned-ips.json, " + ex.getMessage());
|
||||
Bukkit.getLogger().log(Level.SEVERE, "Failed to save banned-ips.json, {0}", ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.Validate;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
public class CraftIpBanList implements org.bukkit.BanList {
|
||||
private final IpBanList list;
|
||||
@@ -45,7 +47,7 @@ public class CraftIpBanList implements org.bukkit.BanList {
|
||||
try {
|
||||
list.save();
|
||||
} catch (IOException ex) {
|
||||
MinecraftServer.getLogger().error("Failed to save banned-ips.json, " + ex.getMessage());
|
||||
Bukkit.getLogger().log(Level.SEVERE, "Failed to save banned-ips.json, {0}", ex.getMessage());
|
||||
}
|
||||
|
||||
return new CraftIpBanEntry(target, entry, list);
|
||||
|
||||
@@ -7,6 +7,8 @@ import net.minecraft.server.MinecraftServer;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
public final class CraftProfileBanEntry implements org.bukkit.BanEntry {
|
||||
private final GameProfileBanList list;
|
||||
@@ -81,7 +83,7 @@ public final class CraftProfileBanEntry implements org.bukkit.BanEntry {
|
||||
try {
|
||||
this.list.save();
|
||||
} catch (IOException ex) {
|
||||
MinecraftServer.getLogger().error("Failed to save banned-players.json, " + ex.getMessage());
|
||||
Bukkit.getLogger().log(Level.SEVERE, "Failed to save banned-players.json, {0}", ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ import org.apache.commons.lang.Validate;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
public class CraftProfileBanList implements org.bukkit.BanList {
|
||||
private final GameProfileBanList list;
|
||||
@@ -57,7 +59,7 @@ public class CraftProfileBanList implements org.bukkit.BanList {
|
||||
try {
|
||||
list.save();
|
||||
} catch (IOException ex) {
|
||||
MinecraftServer.getLogger().error("Failed to save banned-players.json, " + ex.getMessage());
|
||||
Bukkit.getLogger().log(Level.SEVERE, "Failed to save banned-players.json, {0}", ex.getMessage());
|
||||
}
|
||||
|
||||
return new CraftProfileBanEntry(profile, entry, list);
|
||||
@@ -66,6 +68,7 @@ public class CraftProfileBanList implements org.bukkit.BanList {
|
||||
@Override
|
||||
public Set<org.bukkit.BanEntry> getBanEntries() {
|
||||
ImmutableSet.Builder<org.bukkit.BanEntry> builder = ImmutableSet.builder();
|
||||
|
||||
for (JsonListEntry entry : list.getValues()) {
|
||||
GameProfile profile = (GameProfile) entry.getKey();
|
||||
builder.add(new CraftProfileBanEntry(profile, (GameProfileBanEntry) entry, list));
|
||||
|
||||
@@ -831,7 +831,21 @@ public final class CraftServer implements Server {
|
||||
Convertable converter = new WorldLoaderServer(getWorldContainer());
|
||||
if (converter.isConvertable(name)) {
|
||||
getLogger().info("Converting world '" + name + "'");
|
||||
converter.convert(name, new ConvertProgressUpdater(console));
|
||||
converter.convert(name, new IProgressUpdate() {
|
||||
private long b = System.currentTimeMillis();
|
||||
|
||||
public void a(String s) {}
|
||||
|
||||
public void a(int i) {
|
||||
if (System.currentTimeMillis() - this.b >= 1000L) {
|
||||
this.b = System.currentTimeMillis();
|
||||
MinecraftServer.LOGGER.info("Converting... " + i + "%");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void c(String s) {}
|
||||
});
|
||||
}
|
||||
|
||||
int dimension = CraftWorld.CUSTOM_DIMENSION_OFFSET + console.worlds.size();
|
||||
@@ -850,7 +864,7 @@ public final class CraftServer implements Server {
|
||||
IDataManager sdm = new ServerNBTManager(getWorldContainer(), name, true);
|
||||
WorldData worlddata = sdm.getWorldData();
|
||||
if (worlddata == null) {
|
||||
WorldSettings worldSettings = new WorldSettings(creator.seed(), EnumGamemode.getById(getDefaultGameMode().getValue()), generateStructures, hardcore, type);
|
||||
WorldSettings worldSettings = new WorldSettings(creator.seed(), WorldSettings.EnumGamemode.getById(getDefaultGameMode().getValue()), generateStructures, hardcore, type);
|
||||
worldSettings.setGeneratorSettings(creator.generatorSettings());
|
||||
worlddata = new WorldData(worldSettings, name);
|
||||
}
|
||||
@@ -1367,7 +1381,7 @@ public final class CraftServer implements Server {
|
||||
Validate.notNull(mode, "Mode cannot be null");
|
||||
|
||||
for (World world : getWorlds()) {
|
||||
((CraftWorld) world).getHandle().worldData.setGameType(EnumGamemode.getById(mode.getValue()));
|
||||
((CraftWorld) world).getHandle().worldData.setGameType(WorldSettings.EnumGamemode.getById(mode.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.bukkit.craftbukkit;
|
||||
|
||||
import net.minecraft.server.EntityTypes;
|
||||
import net.minecraft.server.MonsterEggInfo;
|
||||
import net.minecraft.server.EntityTypes.MonsterEggInfo;
|
||||
import net.minecraft.server.StatisticList;
|
||||
|
||||
import org.bukkit.Achievement;
|
||||
|
||||
@@ -399,22 +399,30 @@ public class CraftWorld implements World {
|
||||
gen = new WorldGenTaiga1();
|
||||
break;
|
||||
case JUNGLE:
|
||||
gen = new WorldGenJungleTree(true, 10, 20, 3, 3); // Magic values as in BlockSapling
|
||||
IBlockData iblockdata1 = Blocks.LOG.getBlockData().set(BlockLog1.VARIANT, BlockWood.EnumLogVariant.JUNGLE);
|
||||
IBlockData iblockdata2 = Blocks.LEAVES.getBlockData().set(BlockLeaves1.VARIANT, BlockWood.EnumLogVariant.JUNGLE).set(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false));
|
||||
gen = new WorldGenJungleTree(true, 10, 20, iblockdata1, iblockdata2); // Magic values as in BlockSapling
|
||||
break;
|
||||
case SMALL_JUNGLE:
|
||||
gen = new WorldGenTrees(true, 4 + rand.nextInt(7), 3, 3, false);
|
||||
iblockdata1 = Blocks.LOG.getBlockData().set(BlockLog1.VARIANT, BlockWood.EnumLogVariant.JUNGLE);
|
||||
iblockdata2 = Blocks.LEAVES.getBlockData().set(BlockLeaves1.VARIANT, BlockWood.EnumLogVariant.JUNGLE).set(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false));
|
||||
gen = new WorldGenTrees(true, 4 + rand.nextInt(7), iblockdata1, iblockdata2, false);
|
||||
break;
|
||||
case COCOA_TREE:
|
||||
gen = new WorldGenTrees(true, 4 + rand.nextInt(7), 3, 3, true);
|
||||
iblockdata1 = Blocks.LOG.getBlockData().set(BlockLog1.VARIANT, BlockWood.EnumLogVariant.JUNGLE);
|
||||
iblockdata2 = Blocks.LEAVES.getBlockData().set(BlockLeaves1.VARIANT, BlockWood.EnumLogVariant.JUNGLE).set(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false));
|
||||
gen = new WorldGenTrees(true, 4 + rand.nextInt(7), iblockdata1, iblockdata2, true);
|
||||
break;
|
||||
case JUNGLE_BUSH:
|
||||
gen = new WorldGenGroundBush(3, 0);
|
||||
iblockdata1 = Blocks.LOG.getBlockData().set(BlockLog1.VARIANT, BlockWood.EnumLogVariant.JUNGLE);
|
||||
iblockdata2 = Blocks.LEAVES.getBlockData().set(BlockLeaves1.VARIANT, BlockWood.EnumLogVariant.OAK).set(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false));
|
||||
gen = new WorldGenGroundBush(iblockdata1, iblockdata2);
|
||||
break;
|
||||
case RED_MUSHROOM:
|
||||
gen = new WorldGenHugeMushroom(1);
|
||||
gen = new WorldGenHugeMushroom(Blocks.RED_MUSHROOM_BLOCK);
|
||||
break;
|
||||
case BROWN_MUSHROOM:
|
||||
gen = new WorldGenHugeMushroom(0);
|
||||
gen = new WorldGenHugeMushroom(Blocks.BROWN_MUSHROOM_BLOCK);
|
||||
break;
|
||||
case SWAMP:
|
||||
gen = new WorldGenSwampTree();
|
||||
|
||||
@@ -11,7 +11,7 @@ public class CraftWorldBorder implements WorldBorder {
|
||||
|
||||
public CraftWorldBorder(CraftWorld world) {
|
||||
this.world = world;
|
||||
this.handle = world.getHandle().af(); // PAIL: Rename
|
||||
this.handle = world.getHandle().getWorldBorder();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -26,7 +26,7 @@ public class CraftWorldBorder implements WorldBorder {
|
||||
|
||||
@Override
|
||||
public double getSize() {
|
||||
return this.handle.h(); // PAIL: Rename
|
||||
return this.handle.getSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -41,16 +41,16 @@ public class CraftWorldBorder implements WorldBorder {
|
||||
time = Math.min(9223372036854775L, Math.max(0L, time));
|
||||
|
||||
if (time > 0L) {
|
||||
this.handle.a(this.handle.h(), newSize, time * 1000L); // PAIL: Rename
|
||||
this.handle.transitionSizeBetween(this.handle.getSize(), newSize, time * 1000L);
|
||||
} else {
|
||||
this.handle.a(newSize); // PAIL: Rename
|
||||
this.handle.setSize(newSize);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getCenter() {
|
||||
double x = this.handle.f(); // PAIL: Rename
|
||||
double z = this.handle.g(); // PAIL: Rename
|
||||
double x = this.handle.getCenterX();
|
||||
double z = this.handle.getCenterZ();
|
||||
|
||||
return new Location(this.world, x, 0, z);
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public class CraftWorldBorder implements WorldBorder {
|
||||
x = Math.min(3.0E7D, Math.max(-3.0E7D, x));
|
||||
z = Math.min(3.0E7D, Math.max(-3.0E7D, z));
|
||||
|
||||
this.handle.c(x, z); // PAIL: Rename
|
||||
this.handle.setCenter(x, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -71,41 +71,41 @@ public class CraftWorldBorder implements WorldBorder {
|
||||
|
||||
@Override
|
||||
public double getDamageBuffer() {
|
||||
return this.handle.m(); // PAIL: Rename
|
||||
return this.handle.getDamageBuffer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDamageBuffer(double blocks) {
|
||||
this.handle.b(blocks); // PAIL: Rename
|
||||
this.handle.setDamageBuffer(blocks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDamageAmount() {
|
||||
return this.handle.n(); // PAIL: Rename
|
||||
return this.handle.getDamageAmount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDamageAmount(double damage) {
|
||||
this.handle.c(damage); // PAIL: Rename
|
||||
this.handle.setDamageAmount(damage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarningTime() {
|
||||
return this.handle.p(); // PAIL: Rename
|
||||
return this.handle.getWarningTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWarningTime(int time) {
|
||||
this.handle.b(time); // PAIL: Rename
|
||||
this.handle.setWarningTime(time);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarningDistance() {
|
||||
return this.handle.q(); // PAIL: Rename
|
||||
return this.handle.getWarningDistance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWarningDistance(int distance) {
|
||||
this.handle.c(distance); // PAIL: Rename
|
||||
this.handle.setWarningDistance(distance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.bukkit.craftbukkit.block;
|
||||
|
||||
import net.minecraft.server.*;
|
||||
import net.minecraft.server.BlockJukeBox.TileEntityRecordPlayer;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
@@ -24,7 +24,7 @@ public class CraftSkull extends CraftBlockState implements Skull {
|
||||
skull = (TileEntitySkull) world.getTileEntityAt(getX(), getY(), getZ());
|
||||
profile = skull.getGameProfile();
|
||||
skullType = getSkullType(skull.getSkullType());
|
||||
rotation = (byte) skull.rotation;
|
||||
rotation = (byte) skull.getRotation();
|
||||
}
|
||||
|
||||
static SkullType getSkullType(int id) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.bukkit.craftbukkit.chunkio;
|
||||
|
||||
import java.io.IOException;
|
||||
import net.minecraft.server.Chunk;
|
||||
import net.minecraft.server.ChunkRegionLoader;
|
||||
import net.minecraft.server.NBTTagCompound;
|
||||
@@ -9,21 +10,27 @@ import org.bukkit.craftbukkit.util.AsynchronousExecutor;
|
||||
import org.bukkit.craftbukkit.util.LongHash;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChunk, Chunk, Runnable, RuntimeException> {
|
||||
private final AtomicInteger threadNumber = new AtomicInteger(1);
|
||||
|
||||
// async stuff
|
||||
public Chunk callStage1(QueuedChunk queuedChunk) throws RuntimeException {
|
||||
ChunkRegionLoader loader = queuedChunk.loader;
|
||||
Object[] data = loader.loadChunk(queuedChunk.world, queuedChunk.x, queuedChunk.z);
|
||||
try {
|
||||
ChunkRegionLoader loader = queuedChunk.loader;
|
||||
Object[] data = loader.loadChunk(queuedChunk.world, queuedChunk.x, queuedChunk.z);
|
||||
|
||||
if (data != null) {
|
||||
queuedChunk.compound = (NBTTagCompound) data[1];
|
||||
return (Chunk) data[0];
|
||||
}
|
||||
|
||||
if (data != null) {
|
||||
queuedChunk.compound = (NBTTagCompound) data[1];
|
||||
return (Chunk) data[0];
|
||||
return null;
|
||||
} catch (IOException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// sync stuff
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.bukkit.craftbukkit.command;
|
||||
|
||||
import net.minecraft.server.ICommandListener;
|
||||
import net.minecraft.server.TileEntityCommandListener;
|
||||
import net.minecraft.server.CommandBlockListenerAbstract;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.command.BlockCommandSender;
|
||||
@@ -10,9 +10,9 @@ import org.bukkit.command.BlockCommandSender;
|
||||
* Represents input from a command block
|
||||
*/
|
||||
public class CraftBlockCommandSender extends ServerCommandSender implements BlockCommandSender {
|
||||
private final TileEntityCommandListener commandBlock;
|
||||
private final CommandBlockListenerAbstract commandBlock;
|
||||
|
||||
public CraftBlockCommandSender(TileEntityCommandListener commandBlockListenerAbstract) {
|
||||
public CraftBlockCommandSender(CommandBlockListenerAbstract commandBlockListenerAbstract) {
|
||||
super();
|
||||
this.commandBlock = commandBlockListenerAbstract;
|
||||
}
|
||||
|
||||
@@ -61,14 +61,26 @@ public final class VanillaCommandWrapper extends VanillaCommand {
|
||||
// Some commands use the worldserver variable but we leave it full of null values,
|
||||
// so we must temporarily populate it with the world of the commandsender
|
||||
WorldServer[] prev = MinecraftServer.getServer().worldServer;
|
||||
MinecraftServer.getServer().worldServer = new WorldServer[]{(WorldServer) icommandlistener.getWorld()};
|
||||
MinecraftServer server = MinecraftServer.getServer();
|
||||
server.worldServer = new WorldServer[server.worlds.size()];
|
||||
server.worldServer[0] = (WorldServer) icommandlistener.getWorld();
|
||||
int bpos = 0;
|
||||
for (int pos = 1; pos < server.worldServer.length; pos++) {
|
||||
WorldServer world = server.worlds.get(bpos++);
|
||||
if (server.worldServer[0] == world) {
|
||||
pos--;
|
||||
continue;
|
||||
}
|
||||
server.worldServer[pos] = world;
|
||||
}
|
||||
|
||||
try {
|
||||
if (vanillaCommand.canUse(icommandlistener)) {
|
||||
if (i > -1) {
|
||||
List<Entity> list = ((List<Entity>)PlayerSelector.getPlayers(icommandlistener, as[i], Entity.class));
|
||||
String s2 = as[i];
|
||||
|
||||
icommandlistener.a(EnumCommandResult.AFFECTED_ENTITIES, list.size());
|
||||
icommandlistener.a(CommandObjectiveExecutor.EnumCommandResult.AFFECTED_ENTITIES, list.size());
|
||||
Iterator<Entity> iterator = list.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -94,7 +106,7 @@ public final class VanillaCommandWrapper extends VanillaCommand {
|
||||
}
|
||||
as[i] = s2;
|
||||
} else {
|
||||
icommandlistener.a(EnumCommandResult.AFFECTED_ENTITIES, 1);
|
||||
icommandlistener.a(CommandObjectiveExecutor.EnumCommandResult.AFFECTED_ENTITIES, 1);
|
||||
vanillaCommand.execute(icommandlistener, as);
|
||||
j++;
|
||||
}
|
||||
@@ -115,19 +127,18 @@ public final class VanillaCommandWrapper extends VanillaCommand {
|
||||
ChatMessage chatmessage3 = new ChatMessage("commands.generic.exception", new Object[0]);
|
||||
chatmessage3.getChatModifier().setColor(EnumChatFormat.RED);
|
||||
icommandlistener.sendMessage(chatmessage3);
|
||||
if(icommandlistener instanceof TileEntityCommandListener) {
|
||||
TileEntityCommandListener listener = (TileEntityCommandListener) icommandlistener;
|
||||
MinecraftServer.getLogger().log(Level.WARN, String.format("CommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().getX(), listener.getChunkCoordinates().getY(), listener.getChunkCoordinates().getZ()), throwable);
|
||||
} else if (icommandlistener instanceof EntityMinecartCommandBlockListener) {
|
||||
EntityMinecartCommandBlockListener listener = (EntityMinecartCommandBlockListener) icommandlistener;
|
||||
MinecraftServer.getLogger().log(Level.WARN, String.format("MinecartCommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().getX(), listener.getChunkCoordinates().getY(), listener.getChunkCoordinates().getZ()), throwable);
|
||||
if (icommandlistener.f() instanceof EntityMinecartCommandBlock) {
|
||||
MinecraftServer.LOGGER.log(Level.WARN, String.format("MinecartCommandBlock at (%d,%d,%d) failed to handle command", icommandlistener.getChunkCoordinates().getX(), icommandlistener.getChunkCoordinates().getY(), icommandlistener.getChunkCoordinates().getZ()), throwable);
|
||||
} else if(icommandlistener instanceof CommandBlockListenerAbstract) {
|
||||
CommandBlockListenerAbstract listener = (CommandBlockListenerAbstract) icommandlistener;
|
||||
MinecraftServer.LOGGER.log(Level.WARN, String.format("CommandBlock at (%d,%d,%d) failed to handle command", listener.getChunkCoordinates().getX(), listener.getChunkCoordinates().getY(), listener.getChunkCoordinates().getZ()), throwable);
|
||||
} else {
|
||||
MinecraftServer.getLogger().log(Level.WARN, String.format("Unknown CommandBlock failed to handle command"), throwable);
|
||||
MinecraftServer.LOGGER.log(Level.WARN, String.format("Unknown CommandBlock failed to handle command"), throwable);
|
||||
}
|
||||
} finally {
|
||||
MinecraftServer.getServer().worldServer = prev;
|
||||
}
|
||||
icommandlistener.a(EnumCommandResult.SUCCESS_COUNT, j);
|
||||
icommandlistener.a(CommandObjectiveExecutor.EnumCommandResult.SUCCESS_COUNT, j);
|
||||
return j;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public class CraftGuardian extends CraftMonster implements Guardian {
|
||||
|
||||
@Override
|
||||
public boolean isElder() {
|
||||
return ((EntityGuardian)entity).cl();
|
||||
return ((EntityGuardian)entity).cn();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -37,7 +37,7 @@ public class CraftGuardian extends CraftMonster implements Guardian {
|
||||
entityGuardian.a( false );
|
||||
|
||||
// Since minecraft does not reset the elder Guardian to a guardian we have to do that
|
||||
entity.a(0.85F, 0.85F);
|
||||
entity.setSize(0.85F, 0.85F);
|
||||
|
||||
// Since aW() calls its supers it will try to re register attributes which is invalid
|
||||
// PAIL: rename and check these on update
|
||||
@@ -47,10 +47,10 @@ public class CraftGuardian extends CraftMonster implements Guardian {
|
||||
entityGuardian.getAttributeInstance(GenericAttributes.maxHealth).setValue(30.0D);
|
||||
|
||||
// Update pathfinding (random stroll back to 80)
|
||||
entityGuardian.bq.b(80);
|
||||
entityGuardian.br.b(80);
|
||||
|
||||
// Tell minecraft that we need persistence since the guardian changed
|
||||
entityGuardian.bW();
|
||||
entityGuardian.initAttributes();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,8 +227,8 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
}
|
||||
break;
|
||||
case ANVIL:
|
||||
if (craftinv.getInventory() instanceof TileEntityContainerAnvil) {
|
||||
getHandle().openTileEntity((TileEntityContainerAnvil) craftinv.getInventory());
|
||||
if (craftinv.getInventory() instanceof BlockAnvil.TileEntityContainerAnvil) {
|
||||
getHandle().openTileEntity((BlockAnvil.TileEntityContainerAnvil) craftinv.getInventory());
|
||||
} else {
|
||||
openCustomInventory(inventory, player, "minecraft:anvil");
|
||||
}
|
||||
@@ -277,7 +277,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
if (location == null) {
|
||||
location = getLocation();
|
||||
}
|
||||
getHandle().openTileEntity(new TileEntityContainerWorkbench(getHandle().world, new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ())));
|
||||
getHandle().openTileEntity(new BlockWorkbench.TileEntityContainerWorkbench(getHandle().world, new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ())));
|
||||
if (force) {
|
||||
getHandle().activeContainer.checkReachable = false;
|
||||
}
|
||||
|
||||
@@ -77,24 +77,24 @@ public abstract class CraftMinecart extends CraftVehicle implements Minecart {
|
||||
public void setDisplayBlock(MaterialData material) {
|
||||
if(material != null) {
|
||||
IBlockData block = CraftMagicNumbers.getBlock(material.getItemTypeId()).fromLegacyData(material.getData());
|
||||
this.getHandle().a(block);
|
||||
this.getHandle().setDisplayBlock(block);
|
||||
} else {
|
||||
// Set block to air (default) and set the flag to not have a display block.
|
||||
this.getHandle().a(Blocks.AIR.getBlockData());
|
||||
this.getHandle().setDisplayBlock(Blocks.AIR.getBlockData());
|
||||
this.getHandle().a(false);
|
||||
}
|
||||
}
|
||||
|
||||
public MaterialData getDisplayBlock() {
|
||||
IBlockData blockData = getHandle().t(); // PAIL: Rename
|
||||
IBlockData blockData = getHandle().getDisplayBlock();
|
||||
return CraftMagicNumbers.getMaterial(blockData.getBlock()).getNewData((byte) blockData.getBlock().toLegacyData(blockData));
|
||||
}
|
||||
|
||||
public void setDisplayBlockOffset(int offset) {
|
||||
getHandle().l(offset); // PAIL: Rename
|
||||
getHandle().SetDisplayBlockOffset(offset);
|
||||
}
|
||||
|
||||
public int getDisplayBlockOffset() {
|
||||
return getHandle().v(); // PAIL: Rename
|
||||
return getHandle().getDisplayBlockOffset();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
import net.minecraft.server.EntityPainting;
|
||||
import net.minecraft.server.EnumArt;
|
||||
import net.minecraft.server.EntityPainting.EnumArt;
|
||||
import net.minecraft.server.WorldServer;
|
||||
|
||||
import org.bukkit.Art;
|
||||
|
||||
@@ -187,7 +187,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
getHandle().listName = name.equals(getName()) ? null : CraftChatMessage.fromString(name)[0];
|
||||
for (EntityPlayer player : (List<EntityPlayer>)server.getHandle().players) {
|
||||
if (player.getBukkitEntity().canSee(this)) {
|
||||
player.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.UPDATE_DISPLAY_NAME, getHandle()));
|
||||
player.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.UPDATE_DISPLAY_NAME, getHandle()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -760,7 +760,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
|
||||
getHandle().e((Entity) getHandle()); // RENAME
|
||||
getHandle().playerInteractManager.setGameMode(EnumGamemode.getById(mode.getValue()));
|
||||
getHandle().playerInteractManager.setGameMode(WorldSettings.EnumGamemode.getById(mode.getValue()));
|
||||
getHandle().fallDistance = 0;
|
||||
getHandle().playerConnection.sendPacket(new PacketPlayOutGameStateChange(3, mode.getValue()));
|
||||
}
|
||||
@@ -889,7 +889,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
|
||||
//remove the hidden player from this player user list
|
||||
getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.REMOVE_PLAYER, other));
|
||||
getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, other));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -903,7 +903,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
EntityTracker tracker = ((WorldServer) entity.world).tracker;
|
||||
EntityPlayer other = ((CraftPlayer) player).getHandle();
|
||||
|
||||
getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.ADD_PLAYER, other));
|
||||
getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, other));
|
||||
|
||||
EntityTrackerEntry entry = (EntityTrackerEntry) tracker.trackedEntities.get(other.getId());
|
||||
if (entry != null && !entry.trackedPlayers.contains(getHandle())) {
|
||||
|
||||
@@ -31,7 +31,7 @@ public class CraftRabbit extends CraftAnimals implements Rabbit {
|
||||
|
||||
@Override
|
||||
public Type getRabbitType() {
|
||||
int type = getHandle().cl(); // PAIL: Rename
|
||||
int type = getHandle().getRabbitType();
|
||||
return CraftMagicMapping.fromMagic(type);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class CraftRabbit extends CraftAnimals implements Rabbit {
|
||||
entity.initializePathFinderGoals();
|
||||
}
|
||||
|
||||
entity.r(CraftMagicMapping.toMagic(type)); // PAIL: Rename
|
||||
entity.setRabbitType(CraftMagicMapping.toMagic(type));
|
||||
}
|
||||
|
||||
private static class CraftMagicMapping {
|
||||
|
||||
@@ -399,7 +399,7 @@ public class CraftEventFactory {
|
||||
EntityDamageEvent event;
|
||||
if (damager == null) {
|
||||
event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.BLOCK_EXPLOSION, modifiers, modifierFunctions);
|
||||
} else if (entity instanceof EntityEnderDragon && ((EntityEnderDragon) entity).bx == damager) {
|
||||
} else if (entity instanceof EntityEnderDragon && ((EntityEnderDragon) entity).bA == damager) {
|
||||
event = new EntityDamageEvent(entity.getBukkitEntity(), DamageCause.ENTITY_EXPLOSION, modifiers, modifierFunctions);
|
||||
} else {
|
||||
if (damager instanceof org.bukkit.entity.TNTPrimed) {
|
||||
|
||||
@@ -203,7 +203,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<?> getMobsFor(EnumCreatureType type, BlockPosition position) {
|
||||
public List<BiomeBase.BiomeMeta> getMobsFor(EnumCreatureType type, BlockPosition position) {
|
||||
BiomeBase biomebase = world.getBiome(position);
|
||||
|
||||
return biomebase == null ? null : biomebase.getMobs(type);
|
||||
|
||||
@@ -72,7 +72,7 @@ public class NormalChunkGenerator extends InternalChunkGenerator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<?> getMobsFor(EnumCreatureType ect, BlockPosition position) {
|
||||
public List<BiomeBase.BiomeMeta> getMobsFor(EnumCreatureType ect, BlockPosition position) {
|
||||
return provider.getMobsFor(ect, position);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import net.minecraft.server.ContainerAnvilInventory;
|
||||
import net.minecraft.server.ContainerEnchantTableInventory;
|
||||
import net.minecraft.server.IHopper;
|
||||
import net.minecraft.server.IInventory;
|
||||
import net.minecraft.server.InventoryCrafting;
|
||||
@@ -435,7 +433,7 @@ public class CraftInventory implements Inventory {
|
||||
return InventoryType.DISPENSER;
|
||||
} else if (inventory instanceof TileEntityFurnace) {
|
||||
return InventoryType.FURNACE;
|
||||
} else if (inventory instanceof ContainerEnchantTableInventory) {
|
||||
} else if (this instanceof CraftInventoryEnchanting) {
|
||||
return InventoryType.ENCHANTING;
|
||||
} else if (inventory instanceof TileEntityBrewingStand) {
|
||||
return InventoryType.BREWING;
|
||||
@@ -447,7 +445,7 @@ public class CraftInventory implements Inventory {
|
||||
return InventoryType.MERCHANT;
|
||||
} else if (inventory instanceof TileEntityBeacon) {
|
||||
return InventoryType.BEACON;
|
||||
} else if (inventory instanceof ContainerAnvilInventory) {
|
||||
} else if (this instanceof CraftInventoryAnvil) {
|
||||
return InventoryType.ANVIL;
|
||||
} else if (inventory instanceof IHopper) {
|
||||
return InventoryType.HOPPER;
|
||||
|
||||
@@ -3,10 +3,10 @@ package org.bukkit.craftbukkit.inventory;
|
||||
import org.bukkit.inventory.EnchantingInventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import net.minecraft.server.ContainerEnchantTableInventory;
|
||||
import net.minecraft.server.InventorySubcontainer;
|
||||
|
||||
public class CraftInventoryEnchanting extends CraftInventory implements EnchantingInventory {
|
||||
public CraftInventoryEnchanting(ContainerEnchantTableInventory inventory) {
|
||||
public CraftInventoryEnchanting(InventorySubcontainer inventory) {
|
||||
super(inventory);
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@ public class CraftInventoryEnchanting extends CraftInventory implements Enchanti
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContainerEnchantTableInventory getInventory() {
|
||||
return (ContainerEnchantTableInventory)inventory;
|
||||
public InventorySubcontainer getInventory() {
|
||||
return (InventorySubcontainer)inventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,7 +20,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import net.minecraft.server.ChatSerializer;
|
||||
import net.minecraft.server.IChatBaseComponent.ChatSerializer;
|
||||
import net.minecraft.server.Items;
|
||||
import net.minecraft.server.NBTTagString;
|
||||
import org.bukkit.craftbukkit.util.CraftChatMessage;
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.google.common.base.Strings;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap.Builder;
|
||||
import java.util.AbstractList;
|
||||
import net.minecraft.server.ChatSerializer;
|
||||
import net.minecraft.server.IChatBaseComponent.ChatSerializer;
|
||||
import net.minecraft.server.IChatBaseComponent;
|
||||
import net.minecraft.server.NBTTagString;
|
||||
import org.bukkit.craftbukkit.util.CraftChatMessage;
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.bukkit.craftbukkit.inventory.CraftMetaItem.SerializableMeta;
|
||||
import org.bukkit.inventory.meta.BookMeta;
|
||||
|
||||
import com.google.common.collect.ImmutableMap.Builder;
|
||||
import net.minecraft.server.ChatSerializer;
|
||||
import net.minecraft.server.IChatBaseComponent.ChatSerializer;
|
||||
import net.minecraft.server.IChatBaseComponent;
|
||||
import net.minecraft.server.NBTTagString;
|
||||
import org.bukkit.craftbukkit.util.CraftChatMessage;
|
||||
|
||||
@@ -112,7 +112,7 @@ public final class CraftScoreboardManager implements ScoreboardManager {
|
||||
// CraftBukkit method
|
||||
public void updateAllScoresForList(IScoreboardCriteria criteria, String name, List<EntityPlayer> of) {
|
||||
for (ScoreboardScore score : getScoreboardScores(criteria, name, new ArrayList<ScoreboardScore>())) {
|
||||
score.updateForList(of);
|
||||
score.updateForList((List) of);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.bukkit.craftbukkit.scoreboard;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.server.EnumNameTagVisibility;
|
||||
import net.minecraft.server.ScoreboardTeamBase.EnumNameTagVisibility;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
@@ -96,15 +96,13 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
|
||||
public NameTagVisibility getNameTagVisibility() throws IllegalArgumentException {
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
// PAIL: Rename
|
||||
return notchToBukkit(team.i()); // i is sent in PacketPlayOutScoreboardTeam, cannot see a use of j
|
||||
return notchToBukkit(team.getNameTagVisibility());
|
||||
}
|
||||
|
||||
public void setNameTagVisibility(NameTagVisibility visibility) throws IllegalArgumentException {
|
||||
CraftScoreboard scoreboard = checkState();
|
||||
|
||||
// PAIL: Rename
|
||||
team.a(bukkitToNotch(visibility)); // i is sent in PacketPlayOutScoreboardTeam, cannot see a use of j
|
||||
team.setNameTagVisibility(bukkitToNotch(visibility));
|
||||
}
|
||||
|
||||
public Set<OfflinePlayer> getPlayers() throws IllegalStateException {
|
||||
|
||||
@@ -10,7 +10,7 @@ import net.minecraft.server.ChatClickable;
|
||||
import net.minecraft.server.ChatComponentText;
|
||||
import net.minecraft.server.ChatModifier;
|
||||
import net.minecraft.server.EnumChatFormat;
|
||||
import net.minecraft.server.EnumClickAction;
|
||||
import net.minecraft.server.ChatClickable.EnumClickAction;
|
||||
import net.minecraft.server.IChatBaseComponent;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
@@ -5,11 +5,14 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import net.minecraft.server.Block;
|
||||
import net.minecraft.server.Blocks;
|
||||
import net.minecraft.server.Item;
|
||||
import net.minecraft.server.MinecraftKey;
|
||||
import net.minecraft.server.MojangsonParseException;
|
||||
import net.minecraft.server.MojangsonParser;
|
||||
import net.minecraft.server.NBTTagCompound;
|
||||
import net.minecraft.server.StatisticList;
|
||||
@@ -107,7 +110,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
public ItemStack modifyItemStack(ItemStack stack, String arguments) {
|
||||
net.minecraft.server.ItemStack nmsStack = CraftItemStack.asNMSCopy(stack);
|
||||
|
||||
nmsStack.setTag((NBTTagCompound) MojangsonParser.parse(arguments));
|
||||
try {
|
||||
nmsStack.setTag((NBTTagCompound) MojangsonParser.parse(arguments));
|
||||
} catch (MojangsonParseException ex) {
|
||||
Logger.getLogger(CraftMagicNumbers.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
stack.setItemMeta(CraftItemStack.getItemMeta(nmsStack));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user