mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-10 22:05:10 +01:00
Update CraftBukkit to Minecraft 1.5
By: Travis Watkins <amaranth@ubuntu.com>
This commit is contained in:
parent
0d9124396f
commit
18164ee949
@ -4,7 +4,7 @@
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.4.7-R1.1-SNAPSHOT</version>
|
||||
<version>1.5-R0.1-SNAPSHOT</version>
|
||||
<name>CraftBukkit</name>
|
||||
<url>http://www.bukkit.org</url>
|
||||
|
||||
@ -12,8 +12,8 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<api.version>unknown</api.version>
|
||||
<junit.version>4.11</junit.version>
|
||||
<minecraft.version>1.4.7</minecraft.version>
|
||||
<minecraft_version>1_4_R1</minecraft_version>
|
||||
<minecraft.version>1.5</minecraft.version>
|
||||
<minecraft_version>1_5_R1</minecraft_version>
|
||||
</properties>
|
||||
|
||||
<scm>
|
||||
|
@ -522,7 +522,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
public void reload() {
|
||||
configuration = YamlConfiguration.loadConfiguration(getConfigFile());
|
||||
PropertyManager config = new PropertyManager(console.options);
|
||||
PropertyManager config = new PropertyManager(console.options, console.getLogger());
|
||||
|
||||
((DedicatedServer) console).propertyManager = config;
|
||||
|
||||
@ -707,7 +707,7 @@ public final class CraftServer implements Server {
|
||||
} while(used);
|
||||
boolean hardcore = false;
|
||||
|
||||
WorldServer internal = new WorldServer(console, new ServerNBTManager(getWorldContainer(), name, true), name, dimension, new WorldSettings(creator.seed(), EnumGamemode.a(getDefaultGameMode().getValue()), generateStructures, hardcore, type), console.methodProfiler, creator.environment(), generator);
|
||||
WorldServer internal = new WorldServer(console, new ServerNBTManager(getWorldContainer(), name, true), name, dimension, new WorldSettings(creator.seed(), EnumGamemode.a(getDefaultGameMode().getValue()), generateStructures, hardcore, type), console.methodProfiler, console.getLogger(), creator.environment(), generator);
|
||||
|
||||
if (!(worlds.containsKey(name.toLowerCase()))) {
|
||||
return null;
|
||||
@ -830,7 +830,7 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
|
||||
public Logger getLogger() {
|
||||
return MinecraftServer.log;
|
||||
return console.getLogger().getLogger();
|
||||
}
|
||||
|
||||
public ConsoleReader getReader() {
|
||||
|
@ -861,11 +861,17 @@ public class CraftWorld implements World {
|
||||
}
|
||||
} else if (Minecart.class.isAssignableFrom(clazz)) {
|
||||
if (PoweredMinecart.class.isAssignableFrom(clazz)) {
|
||||
entity = new EntityMinecart(world, x, y, z, CraftMinecart.Type.PoweredMinecart.getId());
|
||||
entity = new EntityMinecartFurnace(world, x, y, z);
|
||||
} else if (StorageMinecart.class.isAssignableFrom(clazz)) {
|
||||
entity = new EntityMinecart(world, x, y, z, CraftMinecart.Type.StorageMinecart.getId());
|
||||
entity = new EntityMinecartChest(world, x, y, z);
|
||||
} else if (MinecartTNT.class.isAssignableFrom(clazz)) {
|
||||
entity = new EntityMinecartTNT(world, x, y, z);
|
||||
} else if (MinecartHopper.class.isAssignableFrom(clazz)) {
|
||||
entity = new EntityMinecartHopper(world, x, y, z);
|
||||
} else if (MinecartMobSpawner.class.isAssignableFrom(clazz)) {
|
||||
entity = new EntityMinecartMobSpawner(world, x, y, z);
|
||||
} else {
|
||||
entity = new EntityMinecart(world, x, y, z, CraftMinecart.Type.Minecart.getId());
|
||||
entity = new EntityMinecartRideable(world, x, y, z);
|
||||
}
|
||||
} else if (EnderSignal.class.isAssignableFrom(clazz)) {
|
||||
entity = new EntityEnderSignal(world, x, y, z);
|
||||
@ -989,7 +995,7 @@ public class CraftWorld implements World {
|
||||
entity = null;
|
||||
}
|
||||
} else if (TNTPrimed.class.isAssignableFrom(clazz)) {
|
||||
entity = new EntityTNTPrimed(world, x, y, z);
|
||||
entity = new EntityTNTPrimed(world, x, y, z, null);
|
||||
} else if (ExperienceOrb.class.isAssignableFrom(clazz)) {
|
||||
entity = new EntityExperienceOrb(world, x, y, z, 0);
|
||||
} else if (Weather.class.isAssignableFrom(clazz)) {
|
||||
@ -1102,7 +1108,7 @@ 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].wasExploded(this.world, blockX, blockY, blockZ);
|
||||
net.minecraft.server.Block.byId[blockId].wasExploded(this.world, blockX, blockY, blockZ, null);
|
||||
}
|
||||
|
||||
public void sendPluginMessage(Plugin source, String channel, byte[] message) {
|
||||
|
@ -7,6 +7,7 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.server.BiomeBase;
|
||||
import net.minecraft.server.BlockRedstoneWire;
|
||||
import net.minecraft.server.Direction;
|
||||
import net.minecraft.server.EnumSkyBlock;
|
||||
import net.minecraft.server.NBTTagCompound;
|
||||
import net.minecraft.server.TileEntitySkull;
|
||||
@ -84,14 +85,14 @@ public class CraftBlock implements Block {
|
||||
}
|
||||
|
||||
public void setData(final byte data) {
|
||||
chunk.getHandle().world.setData(x, y, z, data);
|
||||
chunk.getHandle().world.setData(x, y, z, data, 3);
|
||||
}
|
||||
|
||||
public void setData(final byte data, boolean applyPhysics) {
|
||||
if (applyPhysics) {
|
||||
chunk.getHandle().world.setData(x, y, z, data);
|
||||
chunk.getHandle().world.setData(x, y, z, data, 3);
|
||||
} else {
|
||||
chunk.getHandle().world.setRawData(x, y, z, data);
|
||||
chunk.getHandle().world.setData(x, y, z, data, 4);
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,22 +105,22 @@ public class CraftBlock implements Block {
|
||||
}
|
||||
|
||||
public boolean setTypeId(final int type) {
|
||||
return chunk.getHandle().world.setTypeId(x, y, z, type);
|
||||
return chunk.getHandle().world.setTypeIdAndData(x, y, z, type, getData(), 3);
|
||||
}
|
||||
|
||||
public boolean setTypeId(final int type, final boolean applyPhysics) {
|
||||
if (applyPhysics) {
|
||||
return setTypeId(type);
|
||||
} else {
|
||||
return chunk.getHandle().world.setRawTypeId(x, y, z, type);
|
||||
return chunk.getHandle().world.setTypeIdAndData(x, y, z, type, getData(), 4);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean setTypeIdAndData(final int type, final byte data, final boolean applyPhysics) {
|
||||
if (applyPhysics) {
|
||||
return chunk.getHandle().world.setTypeIdAndData(x, y, z, type, data);
|
||||
return chunk.getHandle().world.setTypeIdAndData(x, y, z, type, data, 3);
|
||||
} else {
|
||||
boolean success = chunk.getHandle().world.setRawTypeIdAndData(x, y, z, type, data);
|
||||
boolean success = chunk.getHandle().world.setTypeIdAndData(x, y, z, type, data, 4);
|
||||
if (success) {
|
||||
chunk.getHandle().world.notify(x, y, z);
|
||||
}
|
||||
@ -294,7 +295,7 @@ public class CraftBlock implements Block {
|
||||
}
|
||||
|
||||
public boolean isBlockPowered() {
|
||||
return chunk.getHandle().world.isBlockPowered(x, y, z);
|
||||
return chunk.getHandle().world.getBlockPower(x, y, z) > 0;
|
||||
}
|
||||
|
||||
public boolean isBlockIndirectlyPowered() {
|
||||
@ -320,7 +321,14 @@ public class CraftBlock implements Block {
|
||||
}
|
||||
|
||||
public boolean isBlockFaceIndirectlyPowered(BlockFace face) {
|
||||
return chunk.getHandle().world.isBlockFaceIndirectlyPowered(x, y, z, blockFaceToNotch(face));
|
||||
int power = chunk.getHandle().world.getBlockFacePower(x, y, z, blockFaceToNotch(face));
|
||||
|
||||
Block relative = getRelative(face);
|
||||
if (relative.getType() == Material.REDSTONE_WIRE) {
|
||||
return Math.max(power, relative.getData()) > 0;
|
||||
}
|
||||
|
||||
return power > 0;
|
||||
}
|
||||
|
||||
public int getBlockPower(BlockFace face) {
|
||||
|
@ -21,16 +21,16 @@ public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpa
|
||||
|
||||
@Deprecated
|
||||
public CreatureType getCreatureType() {
|
||||
return CreatureType.fromName(spawner.mobName);
|
||||
return CreatureType.fromName(spawner.a().getMobName());
|
||||
}
|
||||
|
||||
public EntityType getSpawnedType() {
|
||||
return EntityType.fromName(spawner.mobName);
|
||||
return EntityType.fromName(spawner.a().getMobName());
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setCreatureType(CreatureType creatureType) {
|
||||
spawner.mobName = creatureType.getName();
|
||||
spawner.a().a(creatureType.getName());
|
||||
}
|
||||
|
||||
public void setSpawnedType(EntityType entityType) {
|
||||
@ -38,12 +38,12 @@ public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpa
|
||||
throw new IllegalArgumentException("Can't spawn EntityType " + entityType + " from mobspawners!");
|
||||
}
|
||||
|
||||
spawner.mobName = entityType.getName();
|
||||
spawner.a().a(entityType.getName());
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getCreatureTypeId() {
|
||||
return spawner.mobName;
|
||||
return spawner.a().getMobName();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ -52,7 +52,7 @@ public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpa
|
||||
}
|
||||
|
||||
public String getCreatureTypeName() {
|
||||
return spawner.mobName;
|
||||
return spawner.a().getMobName();
|
||||
}
|
||||
|
||||
public void setCreatureTypeByName(String creatureType) {
|
||||
@ -65,11 +65,11 @@ public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpa
|
||||
}
|
||||
|
||||
public int getDelay() {
|
||||
return spawner.spawnDelay;
|
||||
return spawner.a().spawnDelay;
|
||||
}
|
||||
|
||||
public void setDelay(int delay) {
|
||||
spawner.spawnDelay = delay;
|
||||
spawner.a().spawnDelay = delay;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ public class CraftJukebox extends CraftBlockState implements Jukebox {
|
||||
}
|
||||
|
||||
public Material getPlaying() {
|
||||
ItemStack record = jukebox.record;
|
||||
ItemStack record = jukebox.getRecord();
|
||||
if (record == null) {
|
||||
return Material.AIR;
|
||||
}
|
||||
@ -33,15 +33,15 @@ public class CraftJukebox extends CraftBlockState implements Jukebox {
|
||||
public void setPlaying(Material record) {
|
||||
if (record == null || Item.byId[record.getId()] == null) {
|
||||
record = Material.AIR;
|
||||
jukebox.record = null;
|
||||
jukebox.setRecord(null);
|
||||
} else {
|
||||
jukebox.record = new ItemStack(Item.byId[record.getId()], 1);
|
||||
jukebox.setRecord(new ItemStack(Item.byId[record.getId()], 1));
|
||||
}
|
||||
jukebox.update();
|
||||
if (record == Material.AIR) {
|
||||
world.getHandle().setData(getX(), getY(), getZ(), 0);
|
||||
world.getHandle().setData(getX(), getY(), getZ(), 0, 3);
|
||||
} else {
|
||||
world.getHandle().setData(getX(), getY(), getZ(), 1);
|
||||
world.getHandle().setData(getX(), getY(), getZ(), 1, 3);
|
||||
}
|
||||
world.playEffect(getLocation(), Effect.RECORD_PLAY, record.getId());
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ public class CraftBlockCommandSender extends ServerCommandSender implements Bloc
|
||||
}
|
||||
|
||||
public Block getBlock() {
|
||||
return commandBlock.world.getWorld().getBlockAt(commandBlock.x, commandBlock.y, commandBlock.z);
|
||||
return commandBlock.getWorld().getWorld().getBlockAt(commandBlock.x, commandBlock.y, commandBlock.z);
|
||||
}
|
||||
|
||||
public void sendMessage(String message) {
|
||||
|
@ -136,13 +136,14 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
if (entity instanceof EntityLightning) { return new CraftLightningStrike(server, (EntityLightning) entity); }
|
||||
else { return new CraftWeather(server, (EntityWeather) entity); }
|
||||
}
|
||||
else if (entity instanceof EntityMinecart) {
|
||||
EntityMinecart mc = (EntityMinecart) entity;
|
||||
if (mc.type == CraftMinecart.Type.StorageMinecart.getId()) { return new CraftStorageMinecart(server, mc); }
|
||||
else if (mc.type == CraftMinecart.Type.PoweredMinecart.getId()) { return new CraftPoweredMinecart(server, mc); }
|
||||
else { return new CraftMinecart(server, mc); }
|
||||
}
|
||||
else if (entity instanceof EntityHanging) {
|
||||
else if (entity instanceof EntityMinecartAbstract) {
|
||||
if (entity instanceof EntityMinecartFurnace) { return new CraftPoweredMinecart(server, (EntityMinecartFurnace) entity); }
|
||||
else if (entity instanceof EntityMinecartChest) { return new CraftStorageMinecart(server, (EntityMinecartChest) entity); }
|
||||
else if (entity instanceof EntityMinecartTNT) { return new CraftMinecartTNT(server, (EntityMinecartTNT) entity); }
|
||||
else if (entity instanceof EntityMinecartHopper) { return new CraftMinecartHopper(server, (EntityMinecartHopper) entity); }
|
||||
else if (entity instanceof EntityMinecartMobSpawner) { return new CraftMinecartMobSpawner(server, (EntityMinecartMobSpawner) entity); }
|
||||
else { return new CraftMinecart(server, (EntityMinecartRideable) entity); }
|
||||
} else if (entity instanceof EntityHanging) {
|
||||
if (entity instanceof EntityPainting) { return new CraftPainting(server, (EntityPainting) entity); }
|
||||
else if (entity instanceof EntityItemFrame) { return new CraftItemFrame(server, (EntityItemFrame) entity); }
|
||||
else { return new CraftHanging(server, (EntityHanging) entity); }
|
||||
@ -302,7 +303,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
}
|
||||
|
||||
public UUID getUniqueId() {
|
||||
return getHandle().uniqueId;
|
||||
return getHandle().uniqueID;
|
||||
}
|
||||
|
||||
public int getTicksLived() {
|
||||
|
@ -238,7 +238,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
String title = container.getBukkitView().getTitle();
|
||||
int size = container.getBukkitView().getTopInventory().getSize();
|
||||
|
||||
player.playerConnection.sendPacket(new Packet100OpenWindow(container.windowId, windowType, title, size));
|
||||
player.playerConnection.sendPacket(new Packet100OpenWindow(container.windowId, windowType, title, size, true));
|
||||
getHandle().activeContainer = container;
|
||||
getHandle().activeContainer.addSlotListener(player);
|
||||
}
|
||||
@ -270,7 +270,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
if (location == null) {
|
||||
location = getLocation();
|
||||
}
|
||||
getHandle().startEnchanting(location.getBlockX(), location.getBlockY(), location.getBlockZ());
|
||||
getHandle().startEnchanting(location.getBlockX(), location.getBlockY(), location.getBlockZ(), null);
|
||||
if (force) {
|
||||
getHandle().activeContainer.checkReachable = false;
|
||||
}
|
||||
@ -303,7 +303,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
int windowType = CraftContainer.getNotchInventoryType(type);
|
||||
String title = inventory.getTitle();
|
||||
int size = inventory.getTopInventory().getSize();
|
||||
player.playerConnection.sendPacket(new Packet100OpenWindow(container.windowId, windowType, title, size));
|
||||
player.playerConnection.sendPacket(new Packet100OpenWindow(container.windowId, windowType, title, size, false));
|
||||
player.activeContainer = container;
|
||||
player.activeContainer.addSlotListener(player);
|
||||
}
|
||||
@ -313,7 +313,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
}
|
||||
|
||||
public boolean isBlocking() {
|
||||
return getHandle().bh();
|
||||
return getHandle().bk(); // Should be isBlocking
|
||||
}
|
||||
|
||||
public boolean setWindowProperty(InventoryView.Property prop, int value) {
|
||||
|
@ -50,7 +50,7 @@ public class CraftItemFrame extends CraftHanging implements ItemFrame {
|
||||
|
||||
public void setRotation(Rotation rotation) {
|
||||
Validate.notNull(rotation, "Rotation cannot be null");
|
||||
getHandle().g(toInteger(rotation));
|
||||
getHandle().b(toInteger(rotation)); // Should be setRotation
|
||||
}
|
||||
|
||||
static int toInteger(Rotation rotation) {
|
||||
|
@ -325,7 +325,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
}
|
||||
|
||||
public boolean hasLineOfSight(Entity other) {
|
||||
return getHandle().aA().canSee(((CraftEntity) other).getHandle()); // az should be getEntitySenses
|
||||
return getHandle().aD().canSee(((CraftEntity) other).getHandle()); // az should be getEntitySenses
|
||||
}
|
||||
|
||||
public boolean getRemoveWhenFarAway() {
|
||||
@ -356,4 +356,30 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
|
||||
return super.teleport(location, cause);
|
||||
}
|
||||
|
||||
public void setCustomName(String name) {
|
||||
if (name == null) {
|
||||
name = "";
|
||||
}
|
||||
|
||||
getHandle().setCustomName(name);
|
||||
}
|
||||
|
||||
public String getCustomName() {
|
||||
String name = getHandle().getCustomName();
|
||||
|
||||
if (name == null || name.length() == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setCustomNameVisible(boolean flag) {
|
||||
getHandle().setCustomNameVisible(flag);
|
||||
}
|
||||
|
||||
public boolean getCustomNameVisible() {
|
||||
return getHandle().getCustomNameVisible();
|
||||
}
|
||||
}
|
||||
|
@ -1,33 +1,13 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
import net.minecraft.server.EntityMinecart;
|
||||
import net.minecraft.server.EntityMinecartAbstract;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Minecart;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class CraftMinecart extends CraftVehicle implements Minecart {
|
||||
/**
|
||||
* Stores the minecart type id, which is used by Minecraft to differentiate
|
||||
* minecart types. Here we use subclasses.
|
||||
*/
|
||||
public enum Type {
|
||||
Minecart(0),
|
||||
StorageMinecart(1),
|
||||
PoweredMinecart(2);
|
||||
|
||||
private final int id;
|
||||
|
||||
private Type(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
||||
public CraftMinecart(CraftServer server, EntityMinecart entity) {
|
||||
public CraftMinecart(CraftServer server, EntityMinecartAbstract entity) {
|
||||
super(server, entity);
|
||||
}
|
||||
|
||||
@ -74,8 +54,8 @@ public class CraftMinecart extends CraftVehicle implements Minecart {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityMinecart getHandle() {
|
||||
return (EntityMinecart) entity;
|
||||
public EntityMinecartAbstract getHandle() {
|
||||
return (EntityMinecartAbstract) entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -0,0 +1,16 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
import net.minecraft.server.EntityMinecartHopper;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.MinecartHopper;
|
||||
|
||||
final class CraftMinecartHopper extends CraftMinecart implements MinecartHopper {
|
||||
CraftMinecartHopper(CraftServer server, EntityMinecartHopper entity) {
|
||||
super(server, entity);
|
||||
}
|
||||
|
||||
public EntityType getType() {
|
||||
return EntityType.MINECART_HOPPER;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
import net.minecraft.server.EntityMinecartMobSpawner;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.MinecartMobSpawner;
|
||||
|
||||
final class CraftMinecartMobSpawner extends CraftMinecart implements MinecartMobSpawner {
|
||||
CraftMinecartMobSpawner(CraftServer server, EntityMinecartMobSpawner entity) {
|
||||
super(server, entity);
|
||||
}
|
||||
|
||||
public EntityType getType() {
|
||||
return EntityType.MINECART_MOB_SPAWNER;
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
import net.minecraft.server.EntityMinecartTNT;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.entity.MinecartTNT;
|
||||
|
||||
final class CraftMinecartTNT extends CraftMinecart implements MinecartTNT {
|
||||
CraftMinecartTNT(CraftServer server, EntityMinecartTNT entity) {
|
||||
super(server, entity);
|
||||
}
|
||||
}
|
@ -1,12 +1,13 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
import org.bukkit.craftbukkit.entity.CraftMinecart;
|
||||
import net.minecraft.server.EntityMinecart;
|
||||
import net.minecraft.server.EntityMinecartFurnace;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.PoweredMinecart;
|
||||
|
||||
public class CraftPoweredMinecart extends CraftMinecart implements PoweredMinecart {
|
||||
public CraftPoweredMinecart(CraftServer server, EntityMinecart entity) {
|
||||
public CraftPoweredMinecart(CraftServer server, EntityMinecartFurnace entity) {
|
||||
super(server, entity);
|
||||
}
|
||||
|
||||
@ -14,4 +15,8 @@ public class CraftPoweredMinecart extends CraftMinecart implements PoweredMineca
|
||||
public String toString() {
|
||||
return "CraftPoweredMinecart";
|
||||
}
|
||||
|
||||
public EntityType getType() {
|
||||
return EntityType.MINECART_FURNACE;
|
||||
}
|
||||
}
|
||||
|
@ -1,16 +1,17 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
import net.minecraft.server.EntityMinecart;
|
||||
import net.minecraft.server.EntityMinecartChest;
|
||||
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.craftbukkit.inventory.CraftInventory;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.inventory.CraftInventory;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.StorageMinecart;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
|
||||
public class CraftStorageMinecart extends CraftMinecart implements StorageMinecart {
|
||||
private final CraftInventory inventory;
|
||||
|
||||
public CraftStorageMinecart(CraftServer server, EntityMinecart entity) {
|
||||
public CraftStorageMinecart(CraftServer server, EntityMinecartChest entity) {
|
||||
super(server, entity);
|
||||
inventory = new CraftInventory(entity);
|
||||
}
|
||||
@ -23,4 +24,8 @@ public class CraftStorageMinecart extends CraftMinecart implements StorageMineca
|
||||
public String toString() {
|
||||
return "CraftStorageMinecart{" + "inventory=" + inventory + '}';
|
||||
}
|
||||
|
||||
public EntityType getType() {
|
||||
return EntityType.MINECART_CHEST;
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ public class CraftContainer extends Container {
|
||||
setupSlots(top, bottom);
|
||||
}
|
||||
int size = getSize();
|
||||
player.getHandle().playerConnection.sendPacket(new Packet100OpenWindow(this.windowId, type, cachedTitle, size));
|
||||
player.getHandle().playerConnection.sendPacket(new Packet100OpenWindow(this.windowId, type, cachedTitle, size, true));
|
||||
player.updateInventory();
|
||||
}
|
||||
return true;
|
||||
|
@ -108,7 +108,7 @@ public class CraftInventoryCustom extends CraftInventory {
|
||||
|
||||
public void update() {}
|
||||
|
||||
public boolean a_(EntityHuman entityhuman) {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -132,8 +132,6 @@ public class CraftInventoryCustom extends CraftInventory {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void f() {}
|
||||
|
||||
public void g() {}
|
||||
|
||||
public InventoryHolder getOwner() {
|
||||
@ -141,5 +139,13 @@ public class CraftInventoryCustom extends CraftInventory {
|
||||
}
|
||||
|
||||
public void startOpen() {}
|
||||
|
||||
public boolean c() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean b(int i, ItemStack itemstack) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class DyeColorsTest extends AbstractTestingBase {
|
||||
@Test
|
||||
public void checkFireworkColor() {
|
||||
Color color = dye.getFireworkColor();
|
||||
int nmsColor = ItemDye.b[dye.getDyeData()];
|
||||
int nmsColor = ItemDye.c[dye.getDyeData()];
|
||||
assertThat(color, is(Color.fromRGB(nmsColor)));
|
||||
}
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ public class PerMaterialTest extends AbstractTestingBase {
|
||||
@Test
|
||||
public void isOccluding() {
|
||||
if (material.isBlock()) {
|
||||
assertThat(material.isOccluding(), is(Block.i(material.getId())));
|
||||
assertThat(material.isOccluding(), is(Block.l(material.getId())));
|
||||
} else {
|
||||
assertFalse(material.isOccluding());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user