diff options
Diffstat (limited to 'src/main/java/org')
16 files changed, 176 insertions, 53 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index c86225c4..c5e1c037 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -882,25 +882,7 @@ public final class CraftServer implements Server { generator = getGenerator(name); } - Convertable converter = new WorldLoaderServer(getWorldContainer().toPath(), getWorldContainer().toPath().resolveSibling("../backups"), getHandle().getServer().dataConverterManager); - if (converter.isConvertable(name)) { - getLogger().info("Converting world '" + name + "'"); - converter.convert(name, new IProgressUpdate() { - private long b = System.currentTimeMillis(); - - public void a(IChatBaseComponent ichatbasecomponent) {} - - public void a(int i) { - if (System.currentTimeMillis() - this.b >= 1000L) { - this.b = System.currentTimeMillis(); - MinecraftServer.LOGGER.info("Converting... {}%", Integer.valueOf(i)); - } - - } - - public void c(IChatBaseComponent ichatbasecomponent) {} - }); - } + console.convertWorld(name); int dimension = CraftWorld.CUSTOM_DIMENSION_OFFSET + console.worlds.size(); boolean used = false; diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java index e8bf55e8..3fecc796 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -111,6 +111,8 @@ public class Main { .defaultsTo(new File("commands.yml")) .describedAs("Yml file"); + acceptsAll(asList("forceUpgrade"), "Whether to force a world upgrade"); + acceptsAll(asList("nojline"), "Disables jline and emulates the vanilla console"); acceptsAll(asList("noconsole"), "Disables the console"); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBed.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBed.java index e91497d8..c71892a4 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBed.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBed.java @@ -36,7 +36,7 @@ public class CraftBed extends CraftBlockEntityState<TileEntityBed> implements Be case LIGHT_BLUE_BED: return DyeColor.LIGHT_BLUE; case LIGHT_GRAY_BED: - return DyeColor.SILVER; + return DyeColor.LIGHT_GRAY; case LIME_BED: return DyeColor.LIME; case MAGENTA_BED: diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java index 4b2f7a05..94549cee 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java @@ -303,6 +303,9 @@ public class CraftBlockData implements BlockData { register(net.minecraft.server.BlockCocoa.class, org.bukkit.craftbukkit.block.impl.CraftCocoa.class); register(net.minecraft.server.BlockCommand.class, org.bukkit.craftbukkit.block.impl.CraftCommand.class); register(net.minecraft.server.BlockCoralFan.class, org.bukkit.craftbukkit.block.impl.CraftCoralFan.class); + register(net.minecraft.server.BlockCoralFanAbstract.class, org.bukkit.craftbukkit.block.impl.CraftCoralFanAbstract.class); + register(net.minecraft.server.BlockCoralFanWall.class, org.bukkit.craftbukkit.block.impl.CraftCoralFanWall.class); + register(net.minecraft.server.BlockCoralFanWallAbstract.class, org.bukkit.craftbukkit.block.impl.CraftCoralFanWallAbstract.class); register(net.minecraft.server.BlockCrops.class, org.bukkit.craftbukkit.block.impl.CraftCrops.class); register(net.minecraft.server.BlockDaylightDetector.class, org.bukkit.craftbukkit.block.impl.CraftDaylightDetector.class); register(net.minecraft.server.BlockDirtSnow.class, org.bukkit.craftbukkit.block.impl.CraftDirtSnow.class); diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFan.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFan.java index 3385af14..dde1a04b 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFan.java +++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFan.java @@ -3,7 +3,7 @@ */ package org.bukkit.craftbukkit.block.impl; -public final class CraftCoralFan extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Directional { +public final class CraftCoralFan extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Waterlogged { public CraftCoralFan() { super(); @@ -13,22 +13,17 @@ public final class CraftCoralFan extends org.bukkit.craftbukkit.block.data.Craft super(state); } - // org.bukkit.craftbukkit.block.data.CraftDirectional + // org.bukkit.craftbukkit.block.data.CraftWaterlogged - private static final net.minecraft.server.BlockStateEnum<?> FACING = getEnum(net.minecraft.server.BlockCoralFan.class, "facing"); + private static final net.minecraft.server.BlockStateBoolean WATERLOGGED = getBoolean(net.minecraft.server.BlockCoralFan.class, "waterlogged"); @Override - public org.bukkit.block.BlockFace getFacing() { - return get(FACING, org.bukkit.block.BlockFace.class); + public boolean isWaterlogged() { + return get(WATERLOGGED); } @Override - public void setFacing(org.bukkit.block.BlockFace facing) { - set(FACING, facing); - } - - @Override - public java.util.Set<org.bukkit.block.BlockFace> getFaces() { - return getValues(FACING, org.bukkit.block.BlockFace.class); + public void setWaterlogged(boolean waterlogged) { + set(WATERLOGGED, waterlogged); } } diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFanAbstract.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFanAbstract.java new file mode 100644 index 00000000..f1eddf70 --- /dev/null +++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFanAbstract.java @@ -0,0 +1,29 @@ +/** + * Automatically generated file, changes will be lost. + */ +package org.bukkit.craftbukkit.block.impl; + +public final class CraftCoralFanAbstract extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Waterlogged { + + public CraftCoralFanAbstract() { + super(); + } + + public CraftCoralFanAbstract(net.minecraft.server.IBlockData state) { + super(state); + } + + // org.bukkit.craftbukkit.block.data.CraftWaterlogged + + private static final net.minecraft.server.BlockStateBoolean WATERLOGGED = getBoolean(net.minecraft.server.BlockCoralFanAbstract.class, "waterlogged"); + + @Override + public boolean isWaterlogged() { + return get(WATERLOGGED); + } + + @Override + public void setWaterlogged(boolean waterlogged) { + set(WATERLOGGED, waterlogged); + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFanWall.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFanWall.java new file mode 100644 index 00000000..8b89b6b4 --- /dev/null +++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFanWall.java @@ -0,0 +1,48 @@ +/** + * Automatically generated file, changes will be lost. + */ +package org.bukkit.craftbukkit.block.impl; + +public final class CraftCoralFanWall extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.CoralWallFan, org.bukkit.block.data.Directional, org.bukkit.block.data.Waterlogged { + + public CraftCoralFanWall() { + super(); + } + + public CraftCoralFanWall(net.minecraft.server.IBlockData state) { + super(state); + } + + // org.bukkit.craftbukkit.block.data.CraftDirectional + + private static final net.minecraft.server.BlockStateEnum<?> FACING = getEnum(net.minecraft.server.BlockCoralFanWall.class, "facing"); + + @Override + public org.bukkit.block.BlockFace getFacing() { + return get(FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { + set(FACING, facing); + } + + @Override + public java.util.Set<org.bukkit.block.BlockFace> getFaces() { + return getValues(FACING, org.bukkit.block.BlockFace.class); + } + + // org.bukkit.craftbukkit.block.data.CraftWaterlogged + + private static final net.minecraft.server.BlockStateBoolean WATERLOGGED = getBoolean(net.minecraft.server.BlockCoralFanWall.class, "waterlogged"); + + @Override + public boolean isWaterlogged() { + return get(WATERLOGGED); + } + + @Override + public void setWaterlogged(boolean waterlogged) { + set(WATERLOGGED, waterlogged); + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFanWallAbstract.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFanWallAbstract.java new file mode 100644 index 00000000..320f2f21 --- /dev/null +++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCoralFanWallAbstract.java @@ -0,0 +1,48 @@ +/** + * Automatically generated file, changes will be lost. + */ +package org.bukkit.craftbukkit.block.impl; + +public final class CraftCoralFanWallAbstract extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.CoralWallFan, org.bukkit.block.data.Directional, org.bukkit.block.data.Waterlogged { + + public CraftCoralFanWallAbstract() { + super(); + } + + public CraftCoralFanWallAbstract(net.minecraft.server.IBlockData state) { + super(state); + } + + // org.bukkit.craftbukkit.block.data.CraftDirectional + + private static final net.minecraft.server.BlockStateEnum<?> FACING = getEnum(net.minecraft.server.BlockCoralFanWallAbstract.class, "facing"); + + @Override + public org.bukkit.block.BlockFace getFacing() { + return get(FACING, org.bukkit.block.BlockFace.class); + } + + @Override + public void setFacing(org.bukkit.block.BlockFace facing) { + set(FACING, facing); + } + + @Override + public java.util.Set<org.bukkit.block.BlockFace> getFaces() { + return getValues(FACING, org.bukkit.block.BlockFace.class); + } + + // org.bukkit.craftbukkit.block.data.CraftWaterlogged + + private static final net.minecraft.server.BlockStateBoolean WATERLOGGED = getBoolean(net.minecraft.server.BlockCoralFanWallAbstract.class, "waterlogged"); + + @Override + public boolean isWaterlogged() { + return get(WATERLOGGED); + } + + @Override + public void setWaterlogged(boolean waterlogged) { + set(WATERLOGGED, waterlogged); + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 13100e5d..6f23a968 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -472,12 +472,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @Override public boolean isSwimming() { - return getHandle().bb(); + return getHandle().isSwimming(); } @Override public void setSwimming(boolean swimming) { - getHandle().g(swimming); + getHandle().setSwimming(swimming); } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java index 62c923e4..2f72f0ce 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java @@ -63,7 +63,7 @@ public class CraftMetaBanner extends CraftMetaItem implements BannerMeta { String baseStr = SerializableMeta.getString(map, BASE.BUKKIT, true); if (baseStr != null) { - base = DyeColor.valueOf(baseStr); + base = DyeColor.legacyValueOf(baseStr); } Iterable<?> rawPatternList = SerializableMeta.getObject(Iterable.class, map, PATTERNS.BUKKIT, true); diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java index 822600fe..3f8f1754 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java @@ -6,6 +6,7 @@ import net.minecraft.server.ScoreboardServer; import org.apache.commons.lang.Validate; import org.bukkit.OfflinePlayer; +import org.bukkit.craftbukkit.util.CraftChatMessage; import org.bukkit.scoreboard.DisplaySlot; import org.bukkit.scoreboard.Objective; import org.bukkit.scoreboard.Score; @@ -33,16 +34,15 @@ final class CraftObjective extends CraftScoreboardComponent implements Objective public String getDisplayName() throws IllegalStateException { CraftScoreboard scoreboard = checkState(); - return objective.getDisplayName(); + return CraftChatMessage.fromComponent(objective.getDisplayName()); } public void setDisplayName(String displayName) throws IllegalStateException, IllegalArgumentException { Validate.notNull(displayName, "Display name cannot be null"); - Validate.isTrue(displayName.length() <= 32, "Display name '" + displayName + "' is longer than the limit of 32 characters"); + Validate.isTrue(displayName.length() <= 128, "Display name '" + displayName + "' is longer than the limit of 128 characters"); CraftScoreboard scoreboard = checkState(); - objective.displayName = displayName; - ((ScoreboardServer) scoreboard.board).handleObjectiveChanged(objective); + objective.setDisplayName(CraftChatMessage.fromStringOrNull(displayName)); } public String getCriteria() throws IllegalStateException { diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java index 573b9cd1..61c0a55c 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java @@ -16,6 +16,8 @@ import org.bukkit.scoreboard.Team; import com.google.common.base.Function; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; +import net.minecraft.server.IScoreboardCriteria; +import org.bukkit.craftbukkit.util.CraftChatMessage; public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard { final Scoreboard board; @@ -35,11 +37,11 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard { Validate.notNull(criteria, "Criteria cannot be null"); Validate.notNull(displayName, "Display name cannot be null"); Validate.isTrue(name.length() <= 16, "The name '" + name + "' is longer than the limit of 16 characters"); - Validate.isTrue(displayName.length() <= 32, "The display name '" + displayName + "' is longer than the limit of 32 characters"); + Validate.isTrue(displayName.length() <= 128, "The display name '" + displayName + "' is longer than the limit of 128 characters"); Validate.isTrue(board.getObjective(name) == null, "An objective of name '" + name + "' already exists"); CraftCriteria craftCriteria = CraftCriteria.getFromBukkit(criteria); - ScoreboardObjective objective = board.registerObjective(name, craftCriteria.criteria, displayName); + ScoreboardObjective objective = board.registerObjective(name, craftCriteria.criteria, CraftChatMessage.fromStringOrNull(displayName), IScoreboardCriteria.EnumScoreboardHealthDisplay.INTEGER); return new CraftObjective(this, objective); } diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java index cb9ac0f7..c511fa88 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java @@ -33,7 +33,7 @@ final class CraftTeam extends CraftScoreboardComponent implements Team { public String getDisplayName() throws IllegalStateException { CraftScoreboard scoreboard = checkState(); - return team.getDisplayName(); + return CraftChatMessage.fromComponent(team.getDisplayName()); } public void setDisplayName(String displayName) throws IllegalStateException { @@ -41,13 +41,13 @@ final class CraftTeam extends CraftScoreboardComponent implements Team { Validate.isTrue(displayName.length() <= 128, "Display name '" + displayName + "' is longer than the limit of 128 characters"); CraftScoreboard scoreboard = checkState(); - team.setDisplayName(displayName); + team.setDisplayName(CraftChatMessage.fromStringOrNull(displayName)); } public String getPrefix() throws IllegalStateException { CraftScoreboard scoreboard = checkState(); - return CraftChatMessage.fromComponent(team.e()); + return CraftChatMessage.fromComponent(team.getPrefix()); } public void setPrefix(String prefix) throws IllegalStateException, IllegalArgumentException { @@ -55,13 +55,13 @@ final class CraftTeam extends CraftScoreboardComponent implements Team { Validate.isTrue(prefix.length() <= 64, "Prefix '" + prefix + "' is longer than the limit of 64 characters"); CraftScoreboard scoreboard = checkState(); - team.a(CraftChatMessage.fromStringOrNull(prefix)); + team.setPrefix(CraftChatMessage.fromStringOrNull(prefix)); } public String getSuffix() throws IllegalStateException { CraftScoreboard scoreboard = checkState(); - return CraftChatMessage.fromComponent(team.f()); + return CraftChatMessage.fromComponent(team.getPrefix()); } public void setSuffix(String suffix) throws IllegalStateException, IllegalArgumentException { @@ -69,7 +69,7 @@ final class CraftTeam extends CraftScoreboardComponent implements Team { Validate.isTrue(suffix.length() <= 64, "Suffix '" + suffix + "' is longer than the limit of 64 characters"); CraftScoreboard scoreboard = checkState(); - team.b(CraftChatMessage.fromStringOrNull(suffix)); + team.setSuffix(CraftChatMessage.fromStringOrNull(suffix)); } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java index b4c1c68c..c31bb74d 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java @@ -171,6 +171,16 @@ public class Commodore } } + if ( owner.equals( "org/bukkit/DyeColor" ) ) + { + switch ( name ) + { + case "SILVER": + super.visitFieldInsn( opcode, owner, "LIGHT_GRAY", desc ); + return; + } + } + if ( owner.equals( "org/bukkit/Particle" ) ) { switch ( name ) @@ -229,6 +239,15 @@ public class Commodore return; } + if ( owner.equals( "org/bukkit/DyeColor" ) ) + { + if ( name.equals( "valueOf" ) && desc.equals( "(Ljava/lang/String;)Lorg/bukkit/DyeColor;" ) ) + { + super.visitMethodInsn( opcode, owner, "legacyValueOf", desc, itf ); + return; + } + } + if ( owner.equals( "org/bukkit/Material" ) ) { if ( name.equals( "getMaterial" ) && desc.equals( "(I)Lorg/bukkit/Material;" ) ) diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java index fbdfdc47..d7abc0f5 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -138,7 +138,7 @@ public final class CraftMagicNumbers implements UnsafeValues { return CraftBlockData.fromData(getBlock(material, data)); } - public static final int DATA_VERSION = 1513; + public static final int DATA_VERSION = 1519; @Override public int getDataVersion() { diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java index 1833ee72..2d6e7089 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java +++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java @@ -88,11 +88,6 @@ public class DummyGeneratorAccess implements GeneratorAccess { } @Override - public void a(String string, PersistentBase pb) { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override public IChunkProvider getChunkProvider() { throw new UnsupportedOperationException("Not supported yet."); } |