Update to Minecraft 1.13

This commit is contained in:
md_5 2018-07-22 12:00:00 +10:00
parent 961295e432
commit 1a6b4f5392
73 changed files with 469 additions and 418 deletions

View file

@ -29,7 +29,7 @@
dynamic = dynamic.set("DataVersion", dynamic.createInt(1343)); dynamic = dynamic.set("DataVersion", dynamic.createInt(1343));
@@ -148,7 +148,7 @@ @@ -148,7 +148,7 @@
dynamic = this.d.aB().update(DataFixTypes.ADVANCEMENTS, dynamic, dynamic.getInt("DataVersion"), 1513); dynamic = this.d.aB().update(DataFixTypes.ADVANCEMENTS, dynamic, dynamic.getInt("DataVersion"), 1519);
dynamic = dynamic.remove("DataVersion"); dynamic = dynamic.remove("DataVersion");
- Map map = (Map) AdvancementDataPlayer.b.getAdapter(AdvancementDataPlayer.c).fromJsonTree((JsonElement) dynamic.getValue()); - Map map = (Map) AdvancementDataPlayer.b.getAdapter(AdvancementDataPlayer.c).fromJsonTree((JsonElement) dynamic.getValue());
+ Map<MinecraftKey, AdvancementProgress> map = (Map) AdvancementDataPlayer.b.getAdapter(AdvancementDataPlayer.c).fromJsonTree((JsonElement) dynamic.getValue()); // CraftBukkit - decompile error + Map<MinecraftKey, AdvancementProgress> map = (Map) AdvancementDataPlayer.b.getAdapter(AdvancementDataPlayer.c).fromJsonTree((JsonElement) dynamic.getValue()); // CraftBukkit - decompile error

View file

@ -6,6 +6,6 @@
public double a(double d0) { public double a(double d0) {
+ if (d0 != d0) return getDefault(); // CraftBukkit + if (d0 != d0) return getDefault(); // CraftBukkit
+ +
d0 = MathHelper.a(d0, this.a, this.b); d0 = MathHelper.a(d0, this.a, this.maximum);
return d0; return d0;
} }

View file

@ -1,6 +1,6 @@
--- a/net/minecraft/server/Block.java --- a/net/minecraft/server/Block.java
+++ b/net/minecraft/server/Block.java +++ b/net/minecraft/server/Block.java
@@ -213,7 +213,7 @@ @@ -212,7 +212,7 @@
} }
public Block(Block.Info block_info) { public Block(Block.Info block_info) {
@ -9,7 +9,7 @@
this.a(blockstatelist_a); this.a(blockstatelist_a);
this.blockStateList = blockstatelist_a.a(BlockData::new); this.blockStateList = blockstatelist_a.a(BlockData::new);
@@ -428,7 +428,8 @@ @@ -427,7 +427,8 @@
int j = this.getDropCount(iblockdata, i, world, blockposition, world.random); int j = this.getDropCount(iblockdata, i, world, blockposition, world.random);
for (int k = 0; k < j; ++k) { for (int k = 0; k < j; ++k) {
@ -19,7 +19,7 @@
Item item = this.getDropType(iblockdata, world, blockposition, i).getItem(); Item item = this.getDropType(iblockdata, world, blockposition, i).getItem();
if (item != Items.AIR) { if (item != Items.AIR) {
@@ -449,7 +450,13 @@ @@ -448,7 +449,13 @@
EntityItem entityitem = new EntityItem(world, (double) blockposition.getX() + d0, (double) blockposition.getY() + d1, (double) blockposition.getZ() + d2, itemstack); EntityItem entityitem = new EntityItem(world, (double) blockposition.getX() + d0, (double) blockposition.getY() + d1, (double) blockposition.getZ() + d2, itemstack);
entityitem.n(); entityitem.n();
@ -34,7 +34,7 @@
} }
} }
@@ -668,7 +675,7 @@ @@ -667,7 +674,7 @@
} }
public String toString() { public String toString() {
@ -43,7 +43,7 @@
} }
public static boolean c(Block block) { public static boolean c(Block block) {
@@ -1380,6 +1387,12 @@ @@ -1406,6 +1413,12 @@
} }

View file

@ -27,4 +27,4 @@
+ // CraftBukkit end + // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockDiodeAbstract.c, Boolean.valueOf(true)), 2); world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockDiodeAbstract.c, Boolean.valueOf(true)), 2);
if (!flag1) { if (!flag1) {
world.I().a(blockposition, this, this.j(iblockdata), TickListPriority.HIGH); world.I().a(blockposition, this, this.k(iblockdata), TickListPriority.HIGH);

View file

@ -68,7 +68,7 @@
return; return;
} }
if (i == 15 && random.nextInt(4) == 0 && !this.j(world.getType(blockposition.down()))) { if (i == 15 && random.nextInt(4) == 0 && !this.k(world.getType(blockposition.down()))) {
- world.setAir(blockposition); - world.setAir(blockposition);
+ fireExtinguished(world, blockposition); // CraftBukkit + fireExtinguished(world, blockposition); // CraftBukkit
return; return;

View file

@ -19,7 +19,7 @@
+ BlockStateListPopulator blockList = new BlockStateListPopulator(world); // CraftBukkit - Use BlockStateListPopulator + BlockStateListPopulator blockList = new BlockStateListPopulator(world); // CraftBukkit - Use BlockStateListPopulator
if (shapedetector_shapedetectorcollection != null) { if (shapedetector_shapedetectorcollection != null) {
for (i = 0; i < this.d().b(); ++i) { for (i = 0; i < this.e().b(); ++i) {
ShapeDetectorBlock shapedetectorblock1 = shapedetector_shapedetectorcollection.a(0, i, 0); ShapeDetectorBlock shapedetectorblock1 = shapedetector_shapedetectorcollection.a(0, i, 0);
- world.setTypeAndData(shapedetectorblock1.getPosition(), Blocks.AIR.getBlockData(), 2); - world.setTypeAndData(shapedetectorblock1.getPosition(), Blocks.AIR.getBlockData(), 2);
@ -42,8 +42,8 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
@@ -70,7 +82,7 @@ @@ -70,7 +82,7 @@
if (shapedetector_shapedetectorcollection != null) { if (shapedetector_shapedetectorcollection != null) {
for (i = 0; i < this.f().c(); ++i) { for (i = 0; i < this.g().c(); ++i) {
for (int l = 0; l < this.f().b(); ++l) { for (int l = 0; l < this.g().b(); ++l) {
- world.setTypeAndData(shapedetector_shapedetectorcollection.a(i, l, 0).getPosition(), Blocks.AIR.getBlockData(), 2); - world.setTypeAndData(shapedetector_shapedetectorcollection.a(i, l, 0).getPosition(), Blocks.AIR.getBlockData(), 2);
+ blockList.setTypeAndData(shapedetector_shapedetectorcollection.a(i, l, 0).getPosition(), Blocks.AIR.getBlockData(), 2); // CraftBukkit + blockList.setTypeAndData(shapedetector_shapedetectorcollection.a(i, l, 0).getPosition(), Blocks.AIR.getBlockData(), 2); // CraftBukkit
} }

View file

@ -9,7 +9,7 @@
public class BlockRedstoneWire extends Block { public class BlockRedstoneWire extends Block {
public static final BlockStateEnum<BlockPropertyRedstoneSide> NORTH = BlockProperties.L; public static final BlockStateEnum<BlockPropertyRedstoneSide> NORTH = BlockProperties.L;
@@ -216,6 +218,15 @@ @@ -215,6 +217,15 @@
j = k; j = k;
} }

View file

@ -23,7 +23,7 @@
if (world.getType(blockposition1).isAir() && (block == Blocks.FARMLAND || block == Blocks.DIRT || block == Blocks.COARSE_DIRT || block == Blocks.PODZOL || block == Blocks.GRASS_BLOCK)) { if (world.getType(blockposition1).isAir() && (block == Blocks.FARMLAND || block == Blocks.DIRT || block == Blocks.COARSE_DIRT || block == Blocks.PODZOL || block == Blocks.GRASS_BLOCK)) {
- world.setTypeUpdate(blockposition1, this.blockFruit.getBlockData()); - world.setTypeUpdate(blockposition1, this.blockFruit.getBlockData());
+ CraftEventFactory.handleBlockGrowEvent(world, blockposition1, this.blockFruit.getBlockData()); // CraftBukkit + CraftEventFactory.handleBlockGrowEvent(world, blockposition1, this.blockFruit.getBlockData()); // CraftBukkit
world.setTypeUpdate(blockposition, (IBlockData) this.blockFruit.d().getBlockData().set(BlockFacingHorizontal.FACING, enumdirection)); world.setTypeUpdate(blockposition, (IBlockData) this.blockFruit.e().getBlockData().set(BlockFacingHorizontal.FACING, enumdirection));
} }
} }
@@ -94,7 +96,7 @@ @@ -94,7 +96,7 @@

View file

@ -16,28 +16,28 @@
+ // CraftBukkit start - Call BlockSpreadEvent + // CraftBukkit start - Call BlockSpreadEvent
+ BlockPosition source = blockposition; + BlockPosition source = blockposition;
+ +
if (flag && this.b(world, blockposition3, enumdirection1)) { if (flag && this.b((IBlockAccess) world, blockposition3, enumdirection1)) {
- world.setTypeAndData(blockposition2, (IBlockData) this.getBlockData().set(getDirection(enumdirection1), Boolean.valueOf(true)), 2); - world.setTypeAndData(blockposition2, (IBlockData) this.getBlockData().set(getDirection(enumdirection1), Boolean.valueOf(true)), 2);
+ CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition2, (IBlockData) this.getBlockData().set(getDirection(enumdirection1), Boolean.valueOf(true)), 2); + CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition2, (IBlockData) this.getBlockData().set(getDirection(enumdirection1), Boolean.valueOf(true)), 2);
} else if (flag1 && this.b(world, blockposition4, enumdirection2)) { } else if (flag1 && this.b((IBlockAccess) world, blockposition4, enumdirection2)) {
- world.setTypeAndData(blockposition2, (IBlockData) this.getBlockData().set(getDirection(enumdirection2), Boolean.valueOf(true)), 2); - world.setTypeAndData(blockposition2, (IBlockData) this.getBlockData().set(getDirection(enumdirection2), Boolean.valueOf(true)), 2);
+ CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition2, (IBlockData) this.getBlockData().set(getDirection(enumdirection2), Boolean.valueOf(true)), 2); + CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition2, (IBlockData) this.getBlockData().set(getDirection(enumdirection2), Boolean.valueOf(true)), 2);
} else { } else {
EnumDirection enumdirection3 = enumdirection.opposite(); EnumDirection enumdirection3 = enumdirection.opposite();
if (flag && world.isEmpty(blockposition3) && this.b(world, blockposition.shift(enumdirection1), enumdirection3)) { if (flag && world.isEmpty(blockposition3) && this.b((IBlockAccess) world, blockposition.shift(enumdirection1), enumdirection3)) {
- world.setTypeAndData(blockposition3, (IBlockData) this.getBlockData().set(getDirection(enumdirection3), Boolean.valueOf(true)), 2); - world.setTypeAndData(blockposition3, (IBlockData) this.getBlockData().set(getDirection(enumdirection3), Boolean.valueOf(true)), 2);
+ CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition3, (IBlockData) this.getBlockData().set(getDirection(enumdirection3), Boolean.valueOf(true)), 2); + CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition3, (IBlockData) this.getBlockData().set(getDirection(enumdirection3), Boolean.valueOf(true)), 2);
} else if (flag1 && world.isEmpty(blockposition4) && this.b(world, blockposition.shift(enumdirection2), enumdirection3)) { } else if (flag1 && world.isEmpty(blockposition4) && this.b((IBlockAccess) world, blockposition.shift(enumdirection2), enumdirection3)) {
- world.setTypeAndData(blockposition4, (IBlockData) this.getBlockData().set(getDirection(enumdirection3), Boolean.valueOf(true)), 2); - world.setTypeAndData(blockposition4, (IBlockData) this.getBlockData().set(getDirection(enumdirection3), Boolean.valueOf(true)), 2);
+ CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition4, (IBlockData) this.getBlockData().set(getDirection(enumdirection3), Boolean.valueOf(true)), 2); + CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition4, (IBlockData) this.getBlockData().set(getDirection(enumdirection3), Boolean.valueOf(true)), 2);
} else if ((double) world.random.nextFloat() < 0.05D && this.b(world, blockposition2.up(), EnumDirection.UP)) { } else if ((double) world.random.nextFloat() < 0.05D && this.b((IBlockAccess) world, blockposition2.up(), EnumDirection.UP)) {
- world.setTypeAndData(blockposition2, (IBlockData) this.getBlockData().set(BlockVine.UP, Boolean.valueOf(true)), 2); - world.setTypeAndData(blockposition2, (IBlockData) this.getBlockData().set(BlockVine.UP, Boolean.valueOf(true)), 2);
+ CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition2, (IBlockData) this.getBlockData().set(BlockVine.UP, Boolean.valueOf(true)), 2); + CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition2, (IBlockData) this.getBlockData().set(BlockVine.UP, Boolean.valueOf(true)), 2);
} }
+ // CraftBukkit end + // CraftBukkit end
} }
} else if (this.b(world, blockposition2, enumdirection)) { } else if (this.b((IBlockAccess) world, blockposition2, enumdirection)) {
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(getDirection(enumdirection), Boolean.valueOf(true)), 2); world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(getDirection(enumdirection), Boolean.valueOf(true)), 2);
@@ -226,7 +232,7 @@ @@ -226,7 +232,7 @@
} }

View file

@ -9,20 +9,25 @@
public ChunkRegionLoader(File file, DataFixer datafixer) { public ChunkRegionLoader(File file, DataFixer datafixer) {
this.c = file; this.c = file;
@@ -48,15 +48,54 @@ @@ -45,20 +45,56 @@
return nbttagcompound != null ? nbttagcompound : this.b(generatoraccess, i, j); private synchronized NBTTagCompound a(GeneratorAccess generatoraccess, int i, int j) throws IOException {
} NBTTagCompound nbttagcompound = (NBTTagCompound) this.b.get(new ChunkCoordIntPair(i, j));
- return nbttagcompound != null ? nbttagcompound : this.a(generatoraccess.o().getDimensionManager(), generatoraccess.s_(), i, j);
+ return nbttagcompound != null ? nbttagcompound : this.a(generatoraccess.o().getDimensionManager(), generatoraccess.s_(), i, j, generatoraccess); // CraftBukkit
+ }
+
+ // CraftBukkit start + // CraftBukkit start
+ private boolean check(ChunkProviderServer cps, int x, int z) throws IOException { + private boolean check(ChunkProviderServer cps, int x, int z) throws IOException {
+ com.google.common.base.Preconditions.checkState(org.bukkit.Bukkit.isPrimaryThread(), "primary thread"); + if (cps != null) {
+ + com.google.common.base.Preconditions.checkState(org.bukkit.Bukkit.isPrimaryThread(), "primary thread");
+ if (cps.isLoaded(x, z)) { + if (cps.isLoaded(x, z)) {
+ return true; + return true;
+ }
+ } + }
+ +
+ if (RegionFileCache.chunkExists(this.c, x, z)) { + if (RegionFileCache.chunkExists(this.c, x, z)) {
+ NBTTagCompound nbt = RegionFileCache.d(this.c, x, z); + NBTTagCompound nbt = RegionFileCache.read(this.c, x, z);
+ if (nbt != null) { + if (nbt != null) {
+ NBTTagCompound level = nbt.getCompound("Level"); + NBTTagCompound level = nbt.getCompound("Level");
+ if (level.getBoolean("TerrainPopulated")) { + if (level.getBoolean("TerrainPopulated")) {
@ -37,27 +42,28 @@
+ } + }
+ +
+ return false; + return false;
+ } }
+ // CraftBukkit end
+
@Nullable @Nullable
private NBTTagCompound b(GeneratorAccess generatoraccess, int i, int j) throws IOException { - private NBTTagCompound a(DimensionManager dimensionmanager, @Nullable PersistentCollection persistentcollection, int i, int j) throws IOException {
- DataInputStream datainputstream = RegionFileCache.d(this.c, i, j); - DataInputStream datainputstream = RegionFileCache.read(this.c, i, j);
+ // CraftBukkit start + private NBTTagCompound a(DimensionManager dimensionmanager, @Nullable PersistentCollection persistentcollection, int i, int j, @Nullable GeneratorAccess generatoraccess) throws IOException {
+ NBTTagCompound nbttagcompound = RegionFileCache.d(this.c, i, j); + NBTTagCompound nbttagcompound = RegionFileCache.read(this.c, i, j);
- if (datainputstream == null) { - if (datainputstream == null) {
+ if (nbttagcompound == null) { + if (nbttagcompound == null) {
return null; return null;
} else { } else {
- NBTTagCompound nbttagcompound = NBTCompressedStreamTools.a(datainputstream); - NBTTagCompound nbttagcompound = NBTCompressedStreamTools.a(datainputstream);
-
- datainputstream.close();
+ // CraftBukkit end + // CraftBukkit end
int k = nbttagcompound.hasKeyOfType("DataVersion", 99) ? nbttagcompound.getInt("DataVersion") : -1; int k = nbttagcompound.hasKeyOfType("DataVersion", 99) ? nbttagcompound.getInt("DataVersion") : -1;
+ // CraftBukkit start + // CraftBukkit start
+ if (k < 1466) { + if (k < 1466) {
+ NBTTagCompound level = nbttagcompound.getCompound("Level"); + NBTTagCompound level = nbttagcompound.getCompound("Level");
+ if (level.getBoolean("TerrainPopulated") && !level.getBoolean("LightPopulated")) { + if (level.getBoolean("TerrainPopulated") && !level.getBoolean("LightPopulated")) {
+ ChunkProviderServer cps = ((WorldServer) generatoraccess).getChunkProviderServer(); + ChunkProviderServer cps = (generatoraccess == null) ? null : ((WorldServer) generatoraccess).getChunkProviderServer();
+ if (check(cps, i - 1, j) && check(cps, i - 1, j - 1) && check(cps, i, j - 1)) { + if (check(cps, i - 1, j) && check(cps, i - 1, j - 1) && check(cps, i, j - 1)) {
+ level.setBoolean("LightPopulated", true); + level.setBoolean("LightPopulated", true);
+ } + }
@ -67,7 +73,7 @@
if (k < 1493) { if (k < 1493) {
nbttagcompound = GameProfileSerializer.a(this.d, DataFixTypes.CHUNK, nbttagcompound, k, 1493); nbttagcompound = GameProfileSerializer.a(this.d, DataFixTypes.CHUNK, nbttagcompound, k, 1493);
@@ -78,13 +117,29 @@ @@ -81,13 +117,29 @@
} }
} }
@ -97,7 +103,7 @@
Chunk chunk = this.a(generatoraccess, i, j, nbttagcompound); Chunk chunk = this.a(generatoraccess, i, j, nbttagcompound);
if (chunk != null) { if (chunk != null) {
@@ -93,6 +148,9 @@ @@ -96,6 +148,9 @@
} }
return chunk; return chunk;
@ -107,7 +113,7 @@
} }
} }
@@ -121,7 +179,7 @@ @@ -124,7 +179,7 @@
} }
@Nullable @Nullable
@ -116,7 +122,7 @@
if (nbttagcompound.hasKeyOfType("Level", 10) && nbttagcompound.getCompound("Level").hasKeyOfType("Status", 8)) { if (nbttagcompound.hasKeyOfType("Level", 10) && nbttagcompound.getCompound("Level").hasKeyOfType("Status", 8)) {
ChunkStatus.Type chunkstatus_type = this.a(nbttagcompound); ChunkStatus.Type chunkstatus_type = this.a(nbttagcompound);
@@ -140,10 +198,28 @@ @@ -143,10 +198,28 @@
ChunkRegionLoader.a.error("Chunk file at {},{} is in the wrong location; relocating. (Expected {}, {}, got {}, {})", Integer.valueOf(i), Integer.valueOf(j), Integer.valueOf(i), Integer.valueOf(j), Integer.valueOf(chunk.locX), Integer.valueOf(chunk.locZ)); ChunkRegionLoader.a.error("Chunk file at {},{} is in the wrong location; relocating. (Expected {}, {}, got {}, {})", Integer.valueOf(i), Integer.valueOf(j), Integer.valueOf(i), Integer.valueOf(j), Integer.valueOf(chunk.locX), Integer.valueOf(chunk.locZ));
nbttagcompound1.setInt("xPos", i); nbttagcompound1.setInt("xPos", i);
nbttagcompound1.setInt("zPos", j); nbttagcompound1.setInt("zPos", j);
@ -146,7 +152,7 @@
} }
} }
} else { } else {
@@ -158,7 +234,7 @@ @@ -161,7 +234,7 @@
ChunkStatus.Type chunkstatus_type = this.a(nbttagcompound); ChunkStatus.Type chunkstatus_type = this.a(nbttagcompound);
if (chunkstatus_type == ChunkStatus.Type.LEVELCHUNK) { if (chunkstatus_type == ChunkStatus.Type.LEVELCHUNK) {
@ -155,7 +161,7 @@
} else { } else {
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Level"); NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Level");
@@ -204,19 +280,30 @@ @@ -209,19 +282,30 @@
} }
public synchronized boolean a() { public synchronized boolean a() {
@ -190,7 +196,7 @@
if (nbttagcompound != null) { if (nbttagcompound != null) {
try { try {
@@ -228,7 +315,7 @@ @@ -233,7 +317,7 @@
flag = true; flag = true;
} finally { } finally {
@ -199,13 +205,13 @@
} }
return flag; return flag;
@@ -248,10 +335,14 @@ @@ -253,10 +337,14 @@
} }
private void b(ChunkCoordIntPair chunkcoordintpair, NBTTagCompound nbttagcompound) throws IOException { private void b(ChunkCoordIntPair chunkcoordintpair, NBTTagCompound nbttagcompound) throws IOException {
- DataOutputStream dataoutputstream = RegionFileCache.e(this.c, chunkcoordintpair.x, chunkcoordintpair.z); - DataOutputStream dataoutputstream = RegionFileCache.write(this.c, chunkcoordintpair.x, chunkcoordintpair.z);
+ // CraftBukkit start + // CraftBukkit start
+ RegionFileCache.e(this.c, chunkcoordintpair.x, chunkcoordintpair.z, nbttagcompound); + RegionFileCache.write(this.c, chunkcoordintpair.x, chunkcoordintpair.z, nbttagcompound);
+ /* + /*
NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) dataoutputstream); NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) dataoutputstream);
@ -215,7 +221,7 @@
if (this.e != null) { if (this.e != null) {
this.e.a(chunkcoordintpair.a()); this.e.a(chunkcoordintpair.a());
} }
@@ -264,15 +355,16 @@ @@ -269,15 +357,16 @@
public void c() { public void c() {
try { try {
@ -235,7 +241,7 @@
} }
} }
@@ -301,7 +393,7 @@ @@ -306,7 +395,7 @@
if (abiomebase != null) { if (abiomebase != null) {
for (int k = 0; k < abiomebase.length; ++k) { for (int k = 0; k < abiomebase.length; ++k) {
@ -244,7 +250,7 @@
} }
} }
@@ -383,7 +475,7 @@ @@ -388,7 +477,7 @@
int[] aint = new int[abiomebase.length]; int[] aint = new int[abiomebase.length];
for (int i = 0; i < abiomebase.length; ++i) { for (int i = 0; i < abiomebase.length; ++i) {
@ -253,7 +259,7 @@
} }
nbttagcompound.setIntArray("Biomes", aint); nbttagcompound.setIntArray("Biomes", aint);
@@ -485,7 +577,7 @@ @@ -490,7 +579,7 @@
} }
ChunkConverter chunkconverter = nbttagcompound.hasKeyOfType("UpgradeData", 10) ? new ChunkConverter(nbttagcompound.getCompound("UpgradeData")) : ChunkConverter.a; ChunkConverter chunkconverter = nbttagcompound.hasKeyOfType("UpgradeData", 10) ? new ChunkConverter(nbttagcompound.getCompound("UpgradeData")) : ChunkConverter.a;
@ -262,7 +268,7 @@
return block.getBlockData().isAir(); return block.getBlockData().isAir();
}; };
RegistryBlocks registryblocks = Block.REGISTRY; RegistryBlocks registryblocks = Block.REGISTRY;
@@ -497,7 +589,7 @@ @@ -502,7 +591,7 @@
Block.REGISTRY.getClass(); Block.REGISTRY.getClass();
ProtoChunkTickList protochunkticklist = new ProtoChunkTickList(predicate, function, registryblocks1::get, new ChunkCoordIntPair(i, j)); ProtoChunkTickList protochunkticklist = new ProtoChunkTickList(predicate, function, registryblocks1::get, new ChunkCoordIntPair(i, j));
@ -271,7 +277,7 @@
return fluidtype == FluidTypes.a; return fluidtype == FluidTypes.a;
}; };
registryblocks = FluidType.c; registryblocks = FluidType.c;
@@ -505,7 +597,7 @@ @@ -510,7 +599,7 @@
function = registryblocks::b; function = registryblocks::b;
registryblocks1 = FluidType.c; registryblocks1 = FluidType.c;
FluidType.c.getClass(); FluidType.c.getClass();
@ -280,7 +286,7 @@
long i1 = nbttagcompound.getLong("InhabitedTime"); long i1 = nbttagcompound.getLong("InhabitedTime");
Chunk chunk = new Chunk(generatoraccess.getMinecraftWorld(), i, j, abiomebase, chunkconverter, protochunkticklist, protochunkticklist1, i1); Chunk chunk = new Chunk(generatoraccess.getMinecraftWorld(), i, j, abiomebase, chunkconverter, protochunkticklist, protochunkticklist1, i1);
@@ -852,17 +944,29 @@ @@ -853,17 +942,29 @@
} }
@Nullable @Nullable
@ -312,7 +318,7 @@
}); });
} }
@@ -876,8 +980,14 @@ @@ -877,8 +978,14 @@
} }
} }
@ -328,3 +334,12 @@
Iterator iterator = entity.bP().iterator(); Iterator iterator = entity.bP().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@@ -894,7 +1001,7 @@
boolean flag = false;
try {
- this.a(dimensionmanager, persistentcollection, chunkcoordintpair.x, chunkcoordintpair.z);
+ this.a(dimensionmanager, persistentcollection, chunkcoordintpair.x, chunkcoordintpair.z, null); // CraftBukkit
while (!this.b.isEmpty()) {
this.a();

View file

@ -76,7 +76,7 @@
public boolean canUse(EntityHuman entityhuman) { public boolean canUse(EntityHuman entityhuman) {
+ if (!this.checkReachable) return true; // CraftBukkit + if (!this.checkReachable) return true; // CraftBukkit
return !this.i.getType(this.j).a(TagsBlock.x) ? false : entityhuman.d((double) this.j.getX() + 0.5D, (double) this.j.getY() + 0.5D, (double) this.j.getZ() + 0.5D) <= 64.0D; return !this.i.getType(this.j).a(TagsBlock.y) ? false : entityhuman.d((double) this.j.getX() + 0.5D, (double) this.j.getY() + 0.5D, (double) this.j.getZ() + 0.5D) <= 64.0D;
} }
@@ -357,4 +368,33 @@ @@ -357,4 +368,33 @@

View file

@ -17,7 +17,7 @@
+ return this.f.vanillaCommandDispatcher.a(); // CraftBukkit + return this.f.vanillaCommandDispatcher.a(); // CraftBukkit
} }
public void X_() { public void Y_() {
@@ -164,7 +164,7 @@ @@ -164,7 +164,7 @@
arraylist.add(CompletableFuture.supplyAsync(() -> { arraylist.add(CompletableFuture.supplyAsync(() -> {
return a(iresourcemanager, minecraftkey); return a(iresourcemanager, minecraftkey);

View file

@ -130,7 +130,7 @@
+ this.convertable = new WorldLoaderServer(server.getWorldContainer().toPath(), server.getWorldContainer().toPath().resolve("../backups"), this.dataConverterManager); // CraftBukkit - moved from MinecraftServer constructor + this.convertable = new WorldLoaderServer(server.getWorldContainer().toPath(), server.getWorldContainer().toPath().resolve("../backups"), this.dataConverterManager); // CraftBukkit - moved from MinecraftServer constructor
long j = SystemUtils.c(); long j = SystemUtils.c();
if (this.K() == null) { if (this.getWorld() == null) {
@@ -228,7 +282,18 @@ @@ -228,7 +282,18 @@
DedicatedServer.LOGGER.info("Starting remote control listener"); DedicatedServer.LOGGER.info("Starting remote control listener");
this.m = new RemoteControlListener(this); this.m = new RemoteControlListener(this);

View file

@ -241,7 +241,7 @@
itemstack.subtract(1); itemstack.subtract(1);
if (itemstack.isEmpty()) { if (itemstack.isEmpty()) {
return new ItemStack(item); return new ItemStack(item);
@@ -227,14 +387,42 @@ @@ -227,11 +387,39 @@
protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
World world = isourceblock.getWorld(); World world = isourceblock.getWorld();
@ -274,20 +274,15 @@
if (ItemFlintAndSteel.a((GeneratorAccess) world, blockposition)) { if (ItemFlintAndSteel.a((GeneratorAccess) world, blockposition)) {
- world.setTypeUpdate(blockposition, Blocks.FIRE.getBlockData()); - world.setTypeUpdate(blockposition, Blocks.FIRE.getBlockData());
- if (itemstack.isDamaged(1, world.random, (EntityPlayer) null)) {
- itemstack.setCount(0);
+ // CraftBukkit start - Ignition by dispensing flint and steel + // CraftBukkit start - Ignition by dispensing flint and steel
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, isourceblock.getBlockPosition()).isCancelled()) { + if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, isourceblock.getBlockPosition()).isCancelled()) {
+ world.setTypeUpdate(blockposition, Blocks.FIRE.getBlockData()); + world.setTypeUpdate(blockposition, Blocks.FIRE.getBlockData());
+ if (itemstack.isDamaged(1, world.random, (EntityPlayer) null)) { + }
+ itemstack.setCount(0);
+ }
}
+ // CraftBukkit end + // CraftBukkit end
} else { } else {
Block block = world.getType(blockposition).getBlock(); Block block = world.getType(blockposition).getBlock();
@@ -254,12 +442,55 @@ @@ -255,12 +443,55 @@
this.a = true; this.a = true;
World world = isourceblock.getWorld(); World world = isourceblock.getWorld();
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING)); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
@ -343,7 +338,7 @@
return itemstack; return itemstack;
} }
@@ -268,11 +499,40 @@ @@ -269,11 +500,40 @@
protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
World world = isourceblock.getWorld(); World world = isourceblock.getWorld();
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING)); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
@ -386,7 +381,7 @@
return itemstack; return itemstack;
} }
})); }));
@@ -294,6 +554,30 @@ @@ -295,6 +555,30 @@
EnumDirection enumdirection = (EnumDirection) isourceblock.e().get(BlockDispenser.FACING); EnumDirection enumdirection = (EnumDirection) isourceblock.e().get(BlockDispenser.FACING);
BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection); BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection);
@ -417,7 +412,7 @@
this.a = true; this.a = true;
if (world.isEmpty(blockposition) && BlockWitherSkull.b(world, blockposition, itemstack)) { if (world.isEmpty(blockposition) && BlockWitherSkull.b(world, blockposition, itemstack)) {
world.setTypeAndData(blockposition, (IBlockData) Blocks.WITHER_SKELETON_SKULL.getBlockData().set(BlockSkull.a, Integer.valueOf(enumdirection.opposite().get2DRotationValue() * 4)), 3); world.setTypeAndData(blockposition, (IBlockData) Blocks.WITHER_SKELETON_SKULL.getBlockData().set(BlockSkull.a, Integer.valueOf(enumdirection.opposite().get2DRotationValue() * 4)), 3);
@@ -317,6 +601,30 @@ @@ -318,6 +602,30 @@
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING)); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
BlockPumpkinCarved blockpumpkincarved = (BlockPumpkinCarved) Blocks.CARVED_PUMPKIN; BlockPumpkinCarved blockpumpkincarved = (BlockPumpkinCarved) Blocks.CARVED_PUMPKIN;
@ -448,7 +443,7 @@
this.a = true; this.a = true;
if (world.isEmpty(blockposition) && blockpumpkincarved.a((IWorldReader) world, blockposition)) { if (world.isEmpty(blockposition) && blockpumpkincarved.a((IWorldReader) world, blockposition)) {
if (!world.isClientSide) { if (!world.isClientSide) {
@@ -378,6 +686,51 @@ @@ -379,6 +687,51 @@
} }
d(); d();
@ -500,7 +495,7 @@
} }
} }
} }
@@ -386,7 +739,7 @@ @@ -387,7 +740,7 @@
LocaleLanguage localelanguage = LocaleLanguage.a(); LocaleLanguage localelanguage = LocaleLanguage.a();
registrymaterials.iterator().forEachRemaining((object) -> { registrymaterials.iterator().forEachRemaining((object) -> {
@ -509,7 +504,7 @@
if (!localelanguage.b(s)) { if (!localelanguage.b(s)) {
DispenserRegistry.c.warn("Missing translation for {}: {} (key: \'{}\')", s1, registrymaterials.b(object), s); DispenserRegistry.c.warn("Missing translation for {}: {} (key: \'{}\')", s1, registrymaterials.b(object), s);
@@ -480,6 +833,30 @@ @@ -481,6 +834,30 @@
BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection); BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection);
EnumDirection enumdirection1 = isourceblock.getWorld().isEmpty(blockposition.down()) ? enumdirection : EnumDirection.UP; EnumDirection enumdirection1 = isourceblock.getWorld().isEmpty(blockposition.down()) ? enumdirection : EnumDirection.UP;
@ -540,7 +535,7 @@
this.a = ((ItemBlock) item).a((BlockActionContext) (new DispenserRegistry.b(isourceblock.getWorld(), blockposition, enumdirection, itemstack, enumdirection1))) == EnumInteractionResult.SUCCESS; this.a = ((ItemBlock) item).a((BlockActionContext) (new DispenserRegistry.b(isourceblock.getWorld(), blockposition, enumdirection, itemstack, enumdirection1))) == EnumInteractionResult.SUCCESS;
if (this.a) { if (this.a) {
itemstack.subtract(1); itemstack.subtract(1);
@@ -533,12 +910,40 @@ @@ -534,12 +911,40 @@
d3 = 0.0D; d3 = 0.0D;
} }

View file

@ -500,9 +500,9 @@
@@ -1799,6 +2118,13 @@ @@ -1799,6 +2118,13 @@
} }
public void g(boolean flag) { public void setSwimming(boolean flag) {
+ // CraftBukkit start + // CraftBukkit start
+ if (this.bb() != flag && this instanceof EntityLiving) { + if (this.isSwimming() != flag && this instanceof EntityLiving) {
+ if (CraftEventFactory.callToggleSwimEvent((EntityLiving) this, flag).isCancelled()) { + if (CraftEventFactory.callToggleSwimEvent((EntityLiving) this, flag).isCancelled()) {
+ return; + return;
+ } + }

View file

@ -56,7 +56,7 @@
- this.aX = true; - this.aX = true;
- this.world.explode(this, this.locX, this.locY, this.locZ, (float) this.explosionRadius * f, flag); - this.world.explode(this, this.locX, this.locY, this.locZ, (float) this.explosionRadius * f, flag);
- this.die(); - this.die();
- this.dF(); - this.dG();
+ // CraftBukkit start + // CraftBukkit start
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), this.explosionRadius * f, false); + ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), this.explosionRadius * f, false);
+ this.world.getServer().getPluginManager().callEvent(event); + this.world.getServer().getPluginManager().callEvent(event);
@ -64,7 +64,7 @@
+ this.aX = true; + this.aX = true;
+ this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire(), flag); + this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire(), flag);
+ this.die(); + this.die();
+ this.dF(); + this.dG();
+ } else { + } else {
+ fuseTicks = 0; + fuseTicks = 0;
+ } + }

View file

@ -12,7 +12,7 @@
@@ -429,7 +429,7 @@ @@ -429,7 +429,7 @@
} }
if (this.c.bb() && this.c.world.random.nextInt(6) == 0) { if (this.c.isSwimming() && this.c.world.random.nextInt(6) == 0) {
- this.c.addEffect(new MobEffect(MobEffects.DOLPHINS_GRACE, 100)); - this.c.addEffect(new MobEffect(MobEffects.DOLPHINS_GRACE, 100));
+ this.c.addEffect(new MobEffect(MobEffects.DOLPHINS_GRACE, 100), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.DOLPHIN); // CraftBukkit + this.c.addEffect(new MobEffect(MobEffects.DOLPHINS_GRACE, 100), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.DOLPHIN); // CraftBukkit
} }

View file

@ -20,7 +20,7 @@
this.die(); this.die();
@@ -112,7 +114,7 @@ @@ -112,7 +114,7 @@
if (!flag1 && BlockFalling.j(this.world.getType(new BlockPosition(this.locX, this.locY - 0.009999999776482582D, this.locZ)))) { if (!flag1 && BlockFalling.k(this.world.getType(new BlockPosition(this.locX, this.locY - 0.009999999776482582D, this.locZ)))) {
this.onGround = false; this.onGround = false;
- return; - return;
+ // return; // CraftBukkit + // return; // CraftBukkit
@ -31,9 +31,9 @@
if (iblockdata.getBlock() != Blocks.MOVING_PISTON) { if (iblockdata.getBlock() != Blocks.MOVING_PISTON) {
this.die(); this.die();
if (!this.f) { if (!this.f) {
- if (iblockdata.getMaterial().isReplaceable() && (flag1 || !BlockFalling.j(this.world.getType(blockposition.down()))) && this.world.setTypeAndData(blockposition, this.block, 3)) { - if (iblockdata.getMaterial().isReplaceable() && (flag1 || !BlockFalling.k(this.world.getType(blockposition.down()))) && this.world.setTypeAndData(blockposition, this.block, 3)) {
+ // CraftBukkit start + // CraftBukkit start
+ if (iblockdata.getMaterial().isReplaceable() && (flag1 || !BlockFalling.j(this.world.getType(blockposition.down())))) { + if (iblockdata.getMaterial().isReplaceable() && (flag1 || !BlockFalling.k(this.world.getType(blockposition.down())))) {
+ if (CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, this.block).isCancelled()) { + if (CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, this.block).isCancelled()) {
+ return; + return;
+ } + }

View file

@ -86,7 +86,7 @@
+ this.owner.world.addEntity(new EntityExperienceOrb(this.owner.world, this.owner.locX, this.owner.locY + 0.5D, this.owner.locZ + 0.5D, playerFishEvent.getExpToDrop())); + this.owner.world.addEntity(new EntityExperienceOrb(this.owner.world, this.owner.locX, this.owner.locY + 0.5D, this.owner.locZ + 0.5D, playerFishEvent.getExpToDrop()));
+ } + }
+ // CraftBukkit end + // CraftBukkit end
if (itemstack1.getItem().a(TagsItem.G)) { if (itemstack1.getItem().a(TagsItem.D)) {
this.owner.a(StatisticList.FISH_CAUGHT, 1); this.owner.a(StatisticList.FISH_CAUGHT, 1);
} }
@@ -425,8 +463,25 @@ @@ -425,8 +463,25 @@

View file

@ -1,14 +1,5 @@
--- a/net/minecraft/server/EntityGuardianElder.java --- a/net/minecraft/server/EntityGuardianElder.java
+++ b/net/minecraft/server/EntityGuardianElder.java +++ b/net/minecraft/server/EntityGuardianElder.java
@@ -17,7 +17,7 @@
}
- protected void initAttributes() {
+ public void initAttributes() { // CraftBukkit - decompile error
super.initAttributes();
this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.30000001192092896D);
this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(8.0D);
@@ -68,7 +68,7 @@ @@ -68,7 +68,7 @@
if (!entityplayer.hasEffect(mobeffectlist) || entityplayer.getEffect(mobeffectlist).getAmplifier() < 2 || entityplayer.getEffect(mobeffectlist).getDuration() < 1200) { if (!entityplayer.hasEffect(mobeffectlist) || entityplayer.getEffect(mobeffectlist).getAmplifier() < 2 || entityplayer.getEffect(mobeffectlist).getDuration() < 1200) {

View file

@ -20,8 +20,8 @@
public void loadChest() { public void loadChest() {
InventoryHorseChest inventoryhorsechest = this.inventoryChest; InventoryHorseChest inventoryhorsechest = this.inventoryChest;
- this.inventoryChest = new InventoryHorseChest(this.getDisplayName(), this.dA()); - this.inventoryChest = new InventoryHorseChest(this.getDisplayName(), this.dB());
+ this.inventoryChest = new InventoryHorseChest(this.getDisplayName(), this.dA(), this); // CraftBukkit + this.inventoryChest = new InventoryHorseChest(this.getDisplayName(), this.dB(), this); // CraftBukkit
this.inventoryChest.a(this.getCustomName()); this.inventoryChest.a(this.getCustomName());
if (inventoryhorsechest != null) { if (inventoryhorsechest != null) {
inventoryhorsechest.b(this); inventoryhorsechest.b(this);
@ -33,7 +33,7 @@
+ return this.maxDomestication; // CraftBukkit - return stored max domestication instead of 100 + return this.maxDomestication; // CraftBukkit - return stored max domestication instead of 100
} }
protected float cC() { protected float cD() {
@@ -408,7 +410,7 @@ @@ -408,7 +410,7 @@
} }
@ -68,7 +68,7 @@
+ this.heal(1.0F, RegainReason.REGEN); // CraftBukkit + this.heal(1.0F, RegainReason.REGEN); // CraftBukkit
} }
if (this.dY()) { if (this.dZ()) {
@@ -716,6 +719,7 @@ @@ -716,6 +719,7 @@
if (this.getOwnerUUID() != null) { if (this.getOwnerUUID() != null) {
nbttagcompound.setString("OwnerUUID", this.getOwnerUUID().toString()); nbttagcompound.setString("OwnerUUID", this.getOwnerUUID().toString());
@ -106,5 +106,5 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
this.canSlide = true; this.canSlide = true;
this.dH(); this.dI();
} }

View file

@ -93,7 +93,7 @@
@@ -283,19 +335,19 @@ @@ -283,19 +335,19 @@
protected void ca() { protected void cb() {
++this.deathTicks; ++this.deathTicks;
- if (this.deathTicks == 20) { - if (this.deathTicks == 20) {
+ if (this.deathTicks >= 20 && !this.dead) { // CraftBukkit - (this.deathTicks == 20) -> (this.deathTicks >= 20 && !this.dead) + if (this.deathTicks >= 20 && !this.dead) { // CraftBukkit - (this.deathTicks == 20) -> (this.deathTicks >= 20 && !this.dead)
@ -280,7 +280,7 @@
} else { } else {
return false; return false;
@@ -637,14 +779,40 @@ @@ -637,14 +779,40 @@
public boolean co() { public boolean cp() {
return this.getMonsterType() == EnumMonsterType.UNDEAD; return this.getMonsterType() == EnumMonsterType.UNDEAD;
} }
- -
@ -734,7 +734,7 @@
protected void q() { protected void q() {
if (!this.activeItem.isEmpty() && this.isHandRaised()) { if (!this.activeItem.isEmpty() && this.isHandRaised()) {
this.b(this.activeItem, 16); this.b(this.activeItem, 16);
- this.a(this.cT(), this.activeItem.a(this.world, this)); - this.a(this.cU(), this.activeItem.a(this.world, this));
+ // CraftBukkit start - fire PlayerItemConsumeEvent + // CraftBukkit start - fire PlayerItemConsumeEvent
+ ItemStack itemstack; + ItemStack itemstack;
+ if (this instanceof EntityPlayer) { + if (this instanceof EntityPlayer) {
@ -754,9 +754,9 @@
+ itemstack = this.activeItem.a(this.world, this); + itemstack = this.activeItem.a(this.world, this);
+ } + }
+ +
+ this.a(this.cT(), itemstack); + this.a(this.cU(), itemstack);
+ // CraftBukkit end + // CraftBukkit end
this.cZ(); this.da();
} }
@@ -2261,10 +2649,18 @@ @@ -2261,10 +2649,18 @@

View file

@ -68,7 +68,7 @@
this.b = true; this.b = true;
} }
@@ -93,7 +136,7 @@ @@ -102,7 +145,7 @@
} }
public int getMaxStackSize() { public int getMaxStackSize() {

View file

@ -259,7 +259,7 @@
this.releaseShoulderEntities(); this.releaseShoulderEntities();
- if (!this.world.getGameRules().getBoolean("keepInventory") && !this.isSpectator()) { - if (!this.world.getGameRules().getBoolean("keepInventory") && !this.isSpectator()) {
- this.di(); - this.dj();
- this.inventory.q(); - this.inventory.q();
+ // we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory. + // we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory.
+ if (!event.getKeepInventory()) { + if (!event.getKeepInventory()) {
@ -274,7 +274,7 @@
+ // CraftBukkit - Get our scores instead + // CraftBukkit - Get our scores instead
+ this.world.getServer().getScoreboardManager().getScoreboardScores(IScoreboardCriteria.d, this.getName(), ScoreboardScore::incrementScore); + this.world.getServer().getScoreboardManager().getScoreboardScores(IScoreboardCriteria.d, this.getName(), ScoreboardScore::incrementScore);
+ +
EntityLiving entityliving = this.cu(); EntityLiving entityliving = this.cv();
if (entityliving != null) { if (entityliving != null) {
@@ -383,10 +537,12 @@ @@ -383,10 +537,12 @@
@ -568,7 +568,7 @@
this.locale = packetplayinsettings.b(); this.locale = packetplayinsettings.b();
this.ct = packetplayinsettings.d(); this.ct = packetplayinsettings.d();
this.cu = packetplayinsettings.e(); this.cu = packetplayinsettings.e();
@@ -1039,7 +1288,7 @@ @@ -1033,7 +1282,7 @@
this.cw = (Entity) (entity == null ? this : entity); this.cw = (Entity) (entity == null ? this : entity);
if (entity1 != this.cw) { if (entity1 != this.cw) {
this.playerConnection.sendPacket(new PacketPlayOutCamera(this.cw)); this.playerConnection.sendPacket(new PacketPlayOutCamera(this.cw));
@ -577,7 +577,7 @@
} }
} }
@@ -1066,7 +1315,7 @@ @@ -1060,7 +1309,7 @@
@Nullable @Nullable
public IChatBaseComponent getPlayerListName() { public IChatBaseComponent getPlayerListName() {
@ -586,7 +586,7 @@
} }
public void a(EnumHand enumhand) { public void a(EnumHand enumhand) {
@@ -1083,12 +1332,17 @@ @@ -1077,12 +1326,17 @@
} }
public void J() { public void J() {
@ -604,7 +604,7 @@
} }
public AdvancementDataPlayer getAdvancementData() { public AdvancementDataPlayer getAdvancementData() {
@@ -1100,9 +1354,16 @@ @@ -1094,9 +1348,16 @@
return this.cD; return this.cD;
} }
@ -621,7 +621,7 @@
if (worldserver == this.world) { if (worldserver == this.world) {
this.playerConnection.a(d0, d1, d2, f, f1); this.playerConnection.a(d0, d1, d2, f, f1);
} else { } else {
@@ -1127,6 +1388,149 @@ @@ -1121,6 +1382,149 @@
this.server.getPlayerList().b(this, worldserver); this.server.getPlayerList().b(this, worldserver);
this.server.getPlayerList().updateClient(this); this.server.getPlayerList().updateClient(this);
} }

View file

@ -1,14 +1,5 @@
--- a/net/minecraft/server/EntityPufferFish.java --- a/net/minecraft/server/EntityPufferFish.java
+++ b/net/minecraft/server/EntityPufferFish.java +++ b/net/minecraft/server/EntityPufferFish.java
@@ -47,7 +47,7 @@
this.a(f);
}
- protected final void setSize(float f, float f1) {
+ public final void setSize(float f, float f1) { // CraftBukkit - decompile error
boolean flag = this.bE > 0.0F;
this.bE = f;
@@ -140,7 +140,7 @@ @@ -140,7 +140,7 @@
int i = this.getPuffState(); int i = this.getPuffState();

View file

@ -3,7 +3,7 @@
@@ -153,6 +153,11 @@ @@ -153,6 +153,11 @@
IBlockData iblockdata = world.getType(blockposition); IBlockData iblockdata = world.getType(blockposition);
if (BlockMonsterEggs.j(iblockdata)) { if (BlockMonsterEggs.k(iblockdata)) {
+ // CraftBukkit start + // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.a, blockposition, BlockMonsterEggs.f(iblockdata.getBlock())).isCancelled()) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.a, blockposition, BlockMonsterEggs.f(iblockdata.getBlock())).isCancelled()) {
+ return; + return;

View file

@ -14,8 +14,8 @@
private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityWither.class, DataWatcherRegistry.b); private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityWither.class, DataWatcherRegistry.b);
@@ -181,13 +187,38 @@ @@ -181,13 +187,38 @@
if (this.dz() > 0) { if (this.dA() > 0) {
i = this.dz() - 1; i = this.dA() - 1;
if (i <= 0) { if (i <= 0) {
- this.world.createExplosion(this, this.locX, this.locY + (double) this.getHeadHeight(), this.locZ, 7.0F, false, this.world.getGameRules().getBoolean("mobGriefing")); - this.world.createExplosion(this, this.locX, this.locY + (double) this.getHeadHeight(), this.locZ, 7.0F, false, this.world.getGameRules().getBoolean("mobGriefing"));
- this.world.a(1023, new BlockPosition(this), 0); - this.world.a(1023, new BlockPosition(this), 0);

View file

@ -57,7 +57,7 @@
@@ -258,7 +280,7 @@ @@ -258,7 +280,7 @@
this.goalSit.setSitting(!this.isSitting()); this.goalSit.setSitting(!this.isSitting());
this.bg = false; this.bg = false;
this.navigation.r(); this.navigation.q();
- this.setGoalTarget((EntityLiving) null); - this.setGoalTarget((EntityLiving) null);
+ this.setGoalTarget((EntityLiving) null, TargetReason.FORGOT_TARGET, true); // CraftBukkit - reason + this.setGoalTarget((EntityLiving) null, TargetReason.FORGOT_TARGET, true); // CraftBukkit - reason
} }
@ -71,7 +71,7 @@
+ // CraftBukkit - added event call and isCancelled check. + // CraftBukkit - added event call and isCancelled check.
+ if (this.random.nextInt(3) == 0 && !CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) { + if (this.random.nextInt(3) == 0 && !CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) {
this.c(entityhuman); this.c(entityhuman);
this.navigation.r(); this.navigation.q();
this.setGoalTarget((EntityLiving) null); this.setGoalTarget((EntityLiving) null);
this.goalSit.setSitting(true); this.goalSit.setSitting(true);
- this.setHealth(20.0F); - this.setHealth(20.0F);

View file

@ -11,7 +11,7 @@
@@ -56,6 +57,11 @@ @@ -56,6 +57,11 @@
public void tick() { public void tick() {
if (!this.world.isClientSide && this.isConverting()) { if (!this.world.isClientSide && this.isConverting()) {
int i = this.dK(); int i = this.dL();
+ // CraftBukkit start - Use wall time instead of ticks for villager conversion + // CraftBukkit start - Use wall time instead of ticks for villager conversion
+ int elapsedTicks = MinecraftServer.currentTick - this.lastTick; + int elapsedTicks = MinecraftServer.currentTick - this.lastTick;
+ this.lastTick = MinecraftServer.currentTick; + this.lastTick = MinecraftServer.currentTick;

View file

@ -12,7 +12,7 @@
public abstract class FluidTypeFlowing extends FluidType { public abstract class FluidTypeFlowing extends FluidType {
@@ -116,6 +121,15 @@ @@ -128,6 +133,15 @@
Fluid fluid1 = this.a((IWorldReader) generatoraccess, blockposition1, iblockdata1); Fluid fluid1 = this.a((IWorldReader) generatoraccess, blockposition1, iblockdata1);
if (this.a(generatoraccess, blockposition, iblockdata, EnumDirection.DOWN, blockposition1, iblockdata1, generatoraccess.b(blockposition1), fluid1.c())) { if (this.a(generatoraccess, blockposition, iblockdata, EnumDirection.DOWN, blockposition1, iblockdata1, generatoraccess.b(blockposition1), fluid1.c())) {
@ -28,7 +28,7 @@
this.a(generatoraccess, blockposition1, iblockdata1, EnumDirection.DOWN, fluid1); this.a(generatoraccess, blockposition1, iblockdata1, EnumDirection.DOWN, fluid1);
if (this.a((IWorldReader) generatoraccess, blockposition) >= 3) { if (this.a((IWorldReader) generatoraccess, blockposition) >= 3) {
this.a(generatoraccess, blockposition, fluid, iblockdata); this.a(generatoraccess, blockposition, fluid, iblockdata);
@@ -146,6 +160,15 @@ @@ -158,6 +172,15 @@
IBlockData iblockdata1 = generatoraccess.getType(blockposition1); IBlockData iblockdata1 = generatoraccess.getType(blockposition1);
if (this.a(generatoraccess, blockposition, iblockdata, enumdirection, blockposition1, iblockdata1, generatoraccess.b(blockposition1), fluid1.c())) { if (this.a(generatoraccess, blockposition, iblockdata, enumdirection, blockposition1, iblockdata1, generatoraccess.b(blockposition1), fluid1.c())) {

View file

@ -64,7 +64,7 @@
this.a(f); this.a(f);
this.foodTickTimer = 0; this.foodTickTimer = 0;
} }
} else if (flag && this.foodLevel >= 18 && entityhuman.dw()) { } else if (flag && this.foodLevel >= 18 && entityhuman.dx()) {
++this.foodTickTimer; ++this.foodTickTimer;
if (this.foodTickTimer >= 80) { if (this.foodTickTimer >= 80) {
- entityhuman.heal(1.0F); - entityhuman.heal(1.0F);

View file

@ -57,8 +57,8 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+ +
if (packethandshakinginsetprotocol.c() > 389) { if (packethandshakinginsetprotocol.c() > 393) {
chatmessage = new ChatMessage("multiplayer.disconnect.outdated_server", new Object[] { "1.13-pre7"}); chatmessage = new ChatMessage("multiplayer.disconnect.outdated_server", new Object[] { "1.13"});
this.b.sendPacket(new PacketLoginOutDisconnect(chatmessage)); this.b.sendPacket(new PacketLoginOutDisconnect(chatmessage));
@@ -26,6 +71,7 @@ @@ -26,6 +71,7 @@
this.b.close(chatmessage); this.b.close(chatmessage);

View file

@ -12,10 +12,10 @@
+ // CraftBukkit start - obfuscator went a little crazy + // CraftBukkit start - obfuscator went a little crazy
+ /* + /*
this.a(new MinecraftKey("pull"), (itemstack, world, entityliving) -> { this.a(new MinecraftKey("pull"), (itemstack, world, entityliving) -> {
return entityliving == null ? 0.0F : (entityliving.cV().getItem() != Items.BOW ? 0.0F : (float) (itemstack.k() - entityliving.cW()) / 20.0F); return entityliving == null ? 0.0F : (entityliving.cW().getItem() != Items.BOW ? 0.0F : (float) (itemstack.k() - entityliving.cX()) / 20.0F);
}); });
this.a(new MinecraftKey("pulling"), (itemstack, world, entityliving) -> { this.a(new MinecraftKey("pulling"), (itemstack, world, entityliving) -> {
return entityliving != null && entityliving.isHandRaised() && entityliving.cV() == itemstack ? 1.0F : 0.0F; return entityliving != null && entityliving.isHandRaised() && entityliving.cW() == itemstack ? 1.0F : 0.0F;
}); });
+ */ + */
+ // CraftBukkit end + // CraftBukkit end

View file

@ -19,14 +19,14 @@
iblockdata = world.getType(blockposition); iblockdata = world.getType(blockposition);
if (iblockdata.getBlock() instanceof IFluidSource) { if (iblockdata.getBlock() instanceof IFluidSource) {
+ // CraftBukkit start + // CraftBukkit start
+ FluidType dummyFluid = ((IFluidSource) iblockdata.getBlock()).b(DummyGeneratorAccess.INSTANCE, blockposition, iblockdata); + FluidType dummyFluid = ((IFluidSource) iblockdata.getBlock()).a(DummyGeneratorAccess.INSTANCE, blockposition, iblockdata);
+ PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent(entityhuman, blockposition.getX(), blockposition.getY(), blockposition.getZ(), null, itemstack, dummyFluid.b()); + PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent(entityhuman, blockposition.getX(), blockposition.getY(), blockposition.getZ(), null, itemstack, dummyFluid.b());
+ +
+ if (event.isCancelled()) { + if (event.isCancelled()) {
+ return new InteractionResultWrapper(EnumInteractionResult.FAIL, itemstack); + return new InteractionResultWrapper(EnumInteractionResult.FAIL, itemstack);
+ } + }
+ // CraftBukkit end + // CraftBukkit end
FluidType fluidtype = ((IFluidSource) iblockdata.getBlock()).b(world, blockposition, iblockdata); FluidType fluidtype = ((IFluidSource) iblockdata.getBlock()).a(world, blockposition, iblockdata);
if (fluidtype != FluidTypes.a) { if (fluidtype != FluidTypes.a) {
entityhuman.b(StatisticList.ITEM_USED.b(this)); entityhuman.b(StatisticList.ITEM_USED.b(this));

View file

@ -14,9 +14,9 @@
public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStatistics, ICommandListener, Runnable { public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStatistics, ICommandListener, Runnable {
@@ -124,7 +131,22 @@ @@ -125,7 +132,22 @@
private boolean an; private boolean forceUpgrade;
private float ao; private float ap;
- public MinecraftServer(@Nullable File file, Proxy proxy, DataFixer datafixer, CommandDispatcher commanddispatcher, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache) { - public MinecraftServer(@Nullable File file, Proxy proxy, DataFixer datafixer, CommandDispatcher commanddispatcher, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache) {
+ // CraftBukkit start + // CraftBukkit start
@ -38,7 +38,7 @@
this.ac = new ResourceManager(EnumResourcePackType.SERVER_DATA); this.ac = new ResourceManager(EnumResourcePackType.SERVER_DATA);
this.resourcePackRepository = new ResourcePackRepository(ResourcePackLoader::new); this.resourcePackRepository = new ResourcePackRepository(ResourcePackLoader::new);
this.ag = new CraftingManager(); this.ag = new CraftingManager();
@@ -135,22 +157,51 @@ @@ -136,22 +158,51 @@
this.al = new AdvancementDataWorld(); this.al = new AdvancementDataWorld();
this.am = new CustomFunctionData(this); this.am = new CustomFunctionData(this);
this.d = proxy; this.d = proxy;
@ -93,16 +93,35 @@
+ +
public abstract boolean init() throws IOException; public abstract boolean init() throws IOException;
protected void a(String s) { public void convertWorld(String s) {
@@ -184,6 +235,7 @@ @@ -176,11 +227,11 @@
this.a(s); }
if (this.forceUpgrade) {
- MinecraftServer.LOGGER.info("Forcing world upgrade!");
- WorldData worlddata = this.getConvertable().c(this.getWorld());
+ MinecraftServer.LOGGER.info("Forcing world upgrade! {}", s); // CraftBukkit
+ WorldData worlddata = this.getConvertable().c(s); // CraftBukkit
if (worlddata != null) {
- WorldUpgrader worldupgrader = new WorldUpgrader(this.getWorld(), this.getConvertable(), worlddata);
+ WorldUpgrader worldupgrader = new WorldUpgrader(s, this.getConvertable(), worlddata); // CraftBukkit
IChatBaseComponent ichatbasecomponent = null;
while (!worldupgrader.b()) {
@@ -219,9 +270,10 @@
}
public void a(String s, String s1, long i, WorldType worldtype, JsonElement jsonelement) {
- this.convertWorld(s);
+ // this.convertWorld(s); // CraftBukkit - moved down
this.b((IChatBaseComponent) (new ChatMessage("menu.loadingLevel", new Object[0]))); this.b((IChatBaseComponent) (new ChatMessage("menu.loadingLevel", new Object[0])));
this.worldServer = new WorldServer[3]; this.worldServer = new WorldServer[3];
+ /* CraftBukkit start - Remove ticktime arrays and worldsettings + /* CraftBukkit start - Remove ticktime arrays and worldsettings
this.f = new long[this.worldServer.length][100]; this.f = new long[this.worldServer.length][100];
IDataManager idatamanager = this.convertable.a(s, this); IDataManager idatamanager = this.convertable.a(s, this);
@@ -209,40 +261,115 @@ @@ -247,40 +299,116 @@
} }
this.a(idatamanager.getDirectory(), worlddata); this.a(idatamanager.getDirectory(), worlddata);
@ -136,6 +155,7 @@
+ String worldType = org.bukkit.World.Environment.getEnvironment(dimension).toString().toLowerCase(); + String worldType = org.bukkit.World.Environment.getEnvironment(dimension).toString().toLowerCase();
+ String name = (dimension == 0) ? s : s + "_" + worldType; + String name = (dimension == 0) ? s : s + "_" + worldType;
+ this.convertWorld(name); // Run conversion now
+ +
+ org.bukkit.generator.ChunkGenerator gen = this.server.getGenerator(name); + org.bukkit.generator.ChunkGenerator gen = this.server.getGenerator(name);
+ WorldSettings worldsettings = new WorldSettings(i, this.getGamemode(), this.getGenerateStructures(), this.isHardcore(), worldtype); + WorldSettings worldsettings = new WorldSettings(i, this.getGamemode(), this.getGenerateStructures(), this.isHardcore(), worldtype);
@ -232,7 +252,7 @@
this.a(this.getDifficulty()); this.a(this.getDifficulty());
this.g_(); this.g_();
@@ -251,6 +378,25 @@ @@ -289,6 +417,25 @@
protected void a(File file, WorldData worlddata) { protected void a(File file, WorldData worlddata) {
this.resourcePackRepository.a((ResourcePackSource) (new ResourcePackSourceVanilla())); this.resourcePackRepository.a((ResourcePackSource) (new ResourcePackSourceVanilla()));
this.resourcePackFolder = new ResourcePackSourceFolder(new File(file, "datapacks")); this.resourcePackFolder = new ResourcePackSourceFolder(new File(file, "datapacks"));
@ -258,7 +278,7 @@
this.resourcePackRepository.a((ResourcePackSource) this.resourcePackFolder); this.resourcePackRepository.a((ResourcePackSource) this.resourcePackFolder);
this.resourcePackRepository.a(); this.resourcePackRepository.a();
ArrayList arraylist = Lists.newArrayList(); ArrayList arraylist = Lists.newArrayList();
@@ -281,41 +427,52 @@ @@ -319,41 +466,52 @@
this.b((IChatBaseComponent) (new ChatMessage("menu.generatingTerrain", new Object[0]))); this.b((IChatBaseComponent) (new ChatMessage("menu.generatingTerrain", new Object[0])));
boolean flag5 = false; boolean flag5 = false;
@ -286,11 +306,6 @@
+ BlockPosition blockposition = worldserver.getSpawn(); + BlockPosition blockposition = worldserver.getSpawn();
+ ArrayList arraylist = Lists.newArrayList(); + ArrayList arraylist = Lists.newArrayList();
+ Set set = Sets.newConcurrentHashSet(); + Set set = Sets.newConcurrentHashSet();
+
+ for (int i = -192; i <= 192 && this.isRunning(); i += 16) {
+ for (int j = -192; j <= 192 && this.isRunning(); j += 16) {
+ arraylist.add(new ChunkCoordIntPair(blockposition.getX() + i >> 4, blockposition.getZ() + j >> 4));
+ }
- while (!completablefuture.isDone()) { - while (!completablefuture.isDone()) {
- try { - try {
@ -301,6 +316,11 @@
- if (executionexception.getCause() instanceof RuntimeException) { - if (executionexception.getCause() instanceof RuntimeException) {
- throw (RuntimeException) executionexception.getCause(); - throw (RuntimeException) executionexception.getCause();
- } - }
+ for (int i = -192; i <= 192 && this.isRunning(); i += 16) {
+ for (int j = -192; j <= 192 && this.isRunning(); j += 16) {
+ arraylist.add(new ChunkCoordIntPair(blockposition.getX() + i >> 4, blockposition.getZ() + j >> 4));
+ }
+
+ CompletableFuture completablefuture = worldserver.getChunkProviderServer().a((Iterable) arraylist, (chunk) -> { + CompletableFuture completablefuture = worldserver.getChunkProviderServer().a((Iterable) arraylist, (chunk) -> {
+ set.add(chunk.getPos()); + set.add(chunk.getPos());
+ }); + });
@ -337,7 +357,7 @@
this.m(); this.m();
MinecraftServer.LOGGER.info("Time elapsed: {} ms", Long.valueOf(stopwatch.elapsed(TimeUnit.MILLISECONDS))); MinecraftServer.LOGGER.info("Time elapsed: {} ms", Long.valueOf(stopwatch.elapsed(TimeUnit.MILLISECONDS)));
} }
@@ -354,14 +511,17 @@ @@ -392,14 +550,17 @@
protected void m() { protected void m() {
this.w = null; this.w = null;
this.x = 0; this.x = 0;
@ -357,7 +377,7 @@
if (worldserver != null) { if (worldserver != null) {
if (!flag) { if (!flag) {
@@ -378,8 +538,24 @@ @@ -416,8 +577,24 @@
} }
@ -383,7 +403,7 @@
if (this.getServerConnection() != null) { if (this.getServerConnection() != null) {
this.getServerConnection().b(); this.getServerConnection().b();
} }
@@ -388,6 +564,7 @@ @@ -426,6 +603,7 @@
MinecraftServer.LOGGER.info("Saving players"); MinecraftServer.LOGGER.info("Saving players");
this.s.savePlayers(); this.s.savePlayers();
this.s.u(); this.s.u();
@ -391,7 +411,7 @@
} }
if (this.worldServer != null) { if (this.worldServer != null) {
@@ -398,8 +575,10 @@ @@ -436,8 +614,10 @@
int j; int j;
WorldServer worldserver; WorldServer worldserver;
@ -404,7 +424,7 @@
if (worldserver != null) { if (worldserver != null) {
worldserver.savingDisabled = false; worldserver.savingDisabled = false;
} }
@@ -409,8 +588,10 @@ @@ -447,8 +627,10 @@
aworldserver = this.worldServer; aworldserver = this.worldServer;
i = aworldserver.length; i = aworldserver.length;
@ -417,7 +437,7 @@
if (worldserver != null) { if (worldserver != null) {
worldserver.close(); worldserver.close();
} }
@@ -453,11 +634,13 @@ @@ -491,11 +673,13 @@
if (i > 2000L && this.aa - this.Q >= 15000L) { if (i > 2000L && this.aa - this.Q >= 15000L) {
long j = i / 50L; long j = i / 50L;
@ -431,7 +451,7 @@
this.v(); this.v();
this.aa += 50L; this.aa += 50L;
@@ -496,6 +679,12 @@ @@ -534,6 +718,12 @@
} catch (Throwable throwable1) { } catch (Throwable throwable1) {
MinecraftServer.LOGGER.error("Exception stopping the server", throwable1); MinecraftServer.LOGGER.error("Exception stopping the server", throwable1);
} finally { } finally {
@ -444,7 +464,7 @@
this.u(); this.u();
} }
@@ -564,7 +753,7 @@ @@ -602,7 +792,7 @@
this.n.b().a(agameprofile); this.n.b().a(agameprofile);
} }
@ -453,7 +473,7 @@
this.methodProfiler.a("save"); this.methodProfiler.a("save");
this.s.savePlayers(); this.s.savePlayers();
this.saveChunks(true); this.saveChunks(true);
@@ -590,6 +779,7 @@ @@ -628,6 +818,7 @@
} }
public void w() { public void w() {
@ -461,8 +481,8 @@
this.methodProfiler.a("jobs"); this.methodProfiler.a("jobs");
FutureTask futuretask; FutureTask futuretask;
@@ -602,22 +792,40 @@ @@ -640,22 +831,40 @@
this.aD().X_(); this.getFunctionData().Y_();
this.methodProfiler.c("levels"); this.methodProfiler.c("levels");
+ // CraftBukkit start + // CraftBukkit start
@ -505,7 +525,7 @@
this.methodProfiler.a("tick"); this.methodProfiler.a("tick");
@@ -646,7 +854,7 @@ @@ -684,7 +893,7 @@
this.methodProfiler.e(); this.methodProfiler.e();
} }
@ -514,7 +534,7 @@
} }
this.methodProfiler.c("connection"); this.methodProfiler.c("connection");
@@ -670,10 +878,11 @@ @@ -708,10 +917,11 @@
this.l.add(itickable); this.l.add(itickable);
} }
@ -527,7 +547,7 @@
boolean flag = true; boolean flag = true;
String s = null; String s = null;
String s1 = "."; String s1 = ".";
@@ -718,13 +927,16 @@ @@ -759,13 +969,16 @@
++j; ++j;
} }
} }
@ -545,7 +565,7 @@
if (s != null) { if (s != null) {
dedicatedserver.h(s); dedicatedserver.h(s);
} }
@@ -758,6 +970,25 @@ @@ -803,6 +1016,29 @@
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(MinecraftServer.LOGGER)); thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(MinecraftServer.LOGGER));
Runtime.getRuntime().addShutdownHook(thread); Runtime.getRuntime().addShutdownHook(thread);
@ -566,12 +586,16 @@
+ dedicatedserver.setWorld((String) options.valueOf("world")); + dedicatedserver.setWorld((String) options.valueOf("world"));
+ } + }
+ +
+ if (options.has("forceUpgrade")) {
+ dedicatedserver.setForceUpgrade(true);
+ }
+
+ dedicatedserver.primaryThread.start(); + dedicatedserver.primaryThread.start();
+ // CraftBukkit end + // CraftBukkit end
} catch (Exception exception) { } catch (Exception exception) {
MinecraftServer.LOGGER.fatal("Failed to start the minecraft server", exception); MinecraftServer.LOGGER.fatal("Failed to start the minecraft server", exception);
} }
@@ -765,11 +996,13 @@ @@ -814,11 +1050,13 @@
} }
public void y() { public void y() {
@ -585,7 +609,7 @@
} }
public File c(String s) { public File c(String s) {
@@ -785,11 +1018,18 @@ @@ -834,11 +1072,18 @@
} }
public WorldServer getWorldServer(int i) { public WorldServer getWorldServer(int i) {
@ -606,7 +630,7 @@
} }
public String getVersion() { public String getVersion() {
@@ -809,7 +1049,7 @@ @@ -858,7 +1103,7 @@
} }
public boolean isDebugging() { public boolean isDebugging() {
@ -615,7 +639,7 @@
} }
public void f(String s) { public void f(String s) {
@@ -824,7 +1064,7 @@ @@ -873,7 +1118,7 @@
} }
public String getServerModName() { public String getServerModName() {
@ -624,7 +648,7 @@
} }
public CrashReport b(CrashReport crashreport) { public CrashReport b(CrashReport crashreport) {
@@ -860,7 +1100,7 @@ @@ -909,7 +1154,7 @@
} }
public boolean F() { public boolean F() {
@ -633,7 +657,7 @@
} }
public void sendMessage(IChatBaseComponent ichatbasecomponent) { public void sendMessage(IChatBaseComponent ichatbasecomponent) {
@@ -904,11 +1144,13 @@ @@ -953,11 +1198,13 @@
} }
public void a(EnumDifficulty enumdifficulty) { public void a(EnumDifficulty enumdifficulty) {
@ -650,7 +674,7 @@
if (worldserver != null) { if (worldserver != null) {
if (worldserver.getWorldData().isHardcore()) { if (worldserver.getWorldData().isHardcore()) {
@@ -975,13 +1217,11 @@ @@ -1024,13 +1271,11 @@
int i = 0; int i = 0;
if (this.worldServer != null) { if (this.worldServer != null) {
@ -668,7 +692,7 @@
WorldData worlddata = worldserver.getWorldData(); WorldData worlddata = worldserver.getWorldData();
mojangstatisticsgenerator.a("world[" + i + "][dimension]", Integer.valueOf(worldserver.worldProvider.getDimensionManager().getDimensionID())); mojangstatisticsgenerator.a("world[" + i + "][dimension]", Integer.valueOf(worldserver.worldProvider.getDimensionManager().getDimensionID()));
@@ -1007,7 +1247,7 @@ @@ -1056,7 +1301,7 @@
public abstract boolean S(); public abstract boolean S();
public boolean getOnlineMode() { public boolean getOnlineMode() {
@ -677,7 +701,7 @@
} }
public void setOnlineMode(boolean flag) { public void setOnlineMode(boolean flag) {
@@ -1089,13 +1329,9 @@ @@ -1138,13 +1383,9 @@
public abstract boolean af(); public abstract boolean af();
public void setGamemode(EnumGamemode enumgamemode) { public void setGamemode(EnumGamemode enumgamemode) {
@ -694,7 +718,7 @@
} }
} }
@@ -1168,7 +1404,7 @@ @@ -1217,7 +1458,7 @@
public <V> ListenableFuture<V> a(Callable<V> callable) { public <V> ListenableFuture<V> a(Callable<V> callable) {
Validate.notNull(callable); Validate.notNull(callable);
@ -703,7 +727,7 @@
ListenableFutureTask listenablefuturetask = ListenableFutureTask.create(callable); ListenableFutureTask listenablefuturetask = ListenableFutureTask.create(callable);
this.g.add(listenablefuturetask); this.g.add(listenablefuturetask);
@@ -1225,7 +1461,7 @@ @@ -1274,7 +1515,7 @@
} else { } else {
this.getPlayerList().savePlayers(); this.getPlayerList().savePlayers();
this.resourcePackRepository.a(); this.resourcePackRepository.a();
@ -712,7 +736,7 @@
this.getPlayerList().reload(); this.getPlayerList().reload();
} }
} }
@@ -1239,8 +1475,8 @@ @@ -1288,8 +1529,8 @@
if (!worlddata.N().contains(resourcepackloader.e()) && !arraylist.contains(resourcepackloader)) { if (!worlddata.N().contains(resourcepackloader.e()) && !arraylist.contains(resourcepackloader)) {
MinecraftServer.LOGGER.info("Found new data pack {}, loading it automatically", resourcepackloader.e()); MinecraftServer.LOGGER.info("Found new data pack {}, loading it automatically", resourcepackloader.e());
@ -723,7 +747,7 @@
}, false); }, false);
} }
} }
@@ -1249,7 +1485,7 @@ @@ -1298,7 +1539,7 @@
ArrayList arraylist1 = Lists.newArrayList(); ArrayList arraylist1 = Lists.newArrayList();
this.resourcePackRepository.d().forEach((resourcepackloader) -> { this.resourcePackRepository.d().forEach((resourcepackloader) -> {
@ -732,7 +756,7 @@
}); });
this.ac.a((List) arraylist1); this.ac.a((List) arraylist1);
worlddata.O().clear(); worlddata.O().clear();
@@ -1299,7 +1535,7 @@ @@ -1348,7 +1589,7 @@
} }
public CommandListenerWrapper getServerCommandListener() { public CommandListenerWrapper getServerCommandListener() {
@ -741,7 +765,7 @@
} }
public boolean a() { public boolean a() {
@@ -1327,7 +1563,7 @@ @@ -1376,7 +1617,7 @@
} }
public GameRules aQ() { public GameRules aQ() {
@ -750,9 +774,9 @@
} }
public BossBattleCustomData aR() { public BossBattleCustomData aR() {
@@ -1341,4 +1577,11 @@ @@ -1400,4 +1641,11 @@
public void k(boolean flag) { return 0;
this.an = flag; }
} }
+ +
+ // CraftBukkit start + // CraftBukkit start

View file

@ -53,8 +53,8 @@
+ ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutUpdateHealth(((EntityPlayer) entityhuman).getBukkitEntity().getScaledHealth(), entityhuman.getFoodData().foodLevel, entityhuman.getFoodData().saturationLevel)); + ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutUpdateHealth(((EntityPlayer) entityhuman).getBukkitEntity().getScaledHealth(), entityhuman.getFoodData().foodLevel, entityhuman.getFoodData().saturationLevel));
+ // CraftBukkit end + // CraftBukkit end
} }
} else if ((this != MobEffects.HEAL || entityliving.co()) && (this != MobEffects.HARM || !entityliving.co())) { } else if ((this != MobEffects.HEAL || entityliving.cp()) && (this != MobEffects.HARM || !entityliving.cp())) {
if (this == MobEffects.HARM && !entityliving.co() || this == MobEffects.HEAL && entityliving.co()) { if (this == MobEffects.HARM && !entityliving.cp() || this == MobEffects.HEAL && entityliving.cp()) {
entityliving.damageEntity(DamageSource.MAGIC, (float) (6 << i)); entityliving.damageEntity(DamageSource.MAGIC, (float) (6 << i));
} }
} else { } else {

View file

@ -29,6 +29,6 @@
+ +
+ this.b.setPositionRotation(to.getX(), to.getY(), to.getZ(), to.getYaw(), to.getPitch()); + this.b.setPositionRotation(to.getX(), to.getY(), to.getZ(), to.getYaw(), to.getPitch());
+ // CraftBukkit end + // CraftBukkit end
this.e.r(); this.e.q();
return; return;
} }

View file

@ -18,7 +18,7 @@
} }
@@ -42,7 +43,7 @@ @@ -42,7 +43,7 @@
entityhorseskeleton.di(); entityhorseskeleton.dj();
entityhorseskeleton.setTamed(true); entityhorseskeleton.setTamed(true);
entityhorseskeleton.setAgeRaw(0); entityhorseskeleton.setAgeRaw(0);
- entityhorseskeleton.world.addEntity(entityhorseskeleton); - entityhorseskeleton.world.addEntity(entityhorseskeleton);

View file

@ -7,7 +7,7 @@
- this.e.setGoalTarget(this.e.getLastDamager()); - this.e.setGoalTarget(this.e.getLastDamager());
+ this.e.setGoalTarget(this.e.getLastDamager(), org.bukkit.event.entity.EntityTargetEvent.TargetReason.TARGET_ATTACKED_ENTITY, true); // CraftBukkit - reason + this.e.setGoalTarget(this.e.getLastDamager(), org.bukkit.event.entity.EntityTargetEvent.TargetReason.TARGET_ATTACKED_ENTITY, true); // CraftBukkit - reason
this.g = this.e.getGoalTarget(); this.g = this.e.getGoalTarget();
this.b = this.e.cf(); this.b = this.e.cg();
this.h = 300; this.h = 300;
@@ -66,6 +66,6 @@ @@ -66,6 +66,6 @@
} }

View file

@ -10,6 +10,6 @@
+ return false; + return false;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
return !this.a.getNavigation().q(); return !this.a.getNavigation().p();
} }

View file

@ -11,7 +11,7 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
} else if (this.i == 1 && iblockdata.isAir()) { } else if (this.i == 1 && iblockdata.isAir()) {
InventorySubcontainer inventorysubcontainer = this.f.dD(); InventorySubcontainer inventorysubcontainer = this.f.dE();
@@ -49,19 +53,28 @@ @@ -49,19 +53,28 @@
boolean flag = false; boolean flag = false;

View file

@ -95,7 +95,7 @@
} }
+ // CraftBukkit end + // CraftBukkit end
public void X_() { public void Y_() {
this.syncPosition(); this.syncPosition();
@@ -103,7 +176,7 @@ @@ -103,7 +176,7 @@
this.minecraftServer.methodProfiler.a("keepAlive"); this.minecraftServer.methodProfiler.a("keepAlive");
@ -389,8 +389,8 @@
+ speed = player.abilities.walkSpeed * 10f; + speed = player.abilities.walkSpeed * 10f;
+ } + }
+ +
if (!this.player.H() && (!this.player.getWorldServer().getGameRules().getBoolean("disableElytraMovementCheck") || !this.player.db())) { if (!this.player.H() && (!this.player.getWorldServer().getGameRules().getBoolean("disableElytraMovementCheck") || !this.player.dc())) {
float f2 = this.player.db() ? 300.0F : 100.0F; float f2 = this.player.dc() ? 300.0F : 100.0F;
- if (d11 - d10 > (double) (f2 * (float) i) && (!this.minecraftServer.J() || !this.minecraftServer.I().equals(this.player.getProfile().getName()))) { - if (d11 - d10 > (double) (f2 * (float) i) && (!this.minecraftServer.J() || !this.minecraftServer.I().equals(this.player.getProfile().getName()))) {
+ if (d11 - d10 > Math.max(f2, Math.pow((double) (10.0F * (float) i * speed), 2)) && (!this.minecraftServer.J() || !this.minecraftServer.I().equals(this.player.getProfile().getName()))) { + if (d11 - d10 > Math.max(f2, Math.pow((double) (10.0F * (float) i * speed), 2)) && (!this.minecraftServer.J() || !this.minecraftServer.I().equals(this.player.getProfile().getName()))) {
@ -467,7 +467,7 @@
+ +
this.B = d12 >= -0.03125D; this.B = d12 >= -0.03125D;
this.B &= !this.minecraftServer.getAllowFlight() && !this.player.abilities.canFly; this.B &= !this.minecraftServer.getAllowFlight() && !this.player.abilities.canFly;
this.B &= !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.db() && !worldserver.a(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D)); this.B &= !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.dc() && !worldserver.a(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
@@ -662,10 +959,76 @@ @@ -662,10 +959,76 @@
} }

View file

@ -159,7 +159,7 @@
+ if (nmsBlock != null && !event.isCancelled() && !this.isCreative() && this.player.hasBlock(nmsBlock.getBlockData())) { + if (nmsBlock != null && !event.isCancelled() && !this.isCreative() && this.player.hasBlock(nmsBlock.getBlockData())) {
+ // Copied from block.a(World world, EntityHuman entityhuman, BlockPosition blockposition, IBlockData iblockdata, @Nullable TileEntity tileentity, ItemStack itemstack) + // Copied from block.a(World world, EntityHuman entityhuman, BlockPosition blockposition, IBlockData iblockdata, @Nullable TileEntity tileentity, ItemStack itemstack)
+ // PAIL: checkme each update + // PAIL: checkme each update
+ if (!(nmsBlock.k() && EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) > 0)) { + if (!(nmsBlock.X_() && EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) > 0)) {
+ int bonusLevel = EnchantmentManager.getEnchantmentLevel(Enchantments.LOOT_BONUS_BLOCKS, itemstack); + int bonusLevel = EnchantmentManager.getEnchantmentLevel(Enchantments.LOOT_BONUS_BLOCKS, itemstack);
+ +
+ event.setExpToDrop(nmsBlock.getExpDrop(nmsData, this.world, blockposition, bonusLevel)); + event.setExpToDrop(nmsBlock.getExpDrop(nmsData, this.world, blockposition, bonusLevel));
@ -261,7 +261,7 @@
+ public boolean firedInteract = false; + public boolean firedInteract = false;
public EnumInteractionResult a(EntityHuman entityhuman, World world, ItemStack itemstack, EnumHand enumhand, BlockPosition blockposition, EnumDirection enumdirection, float f, float f1, float f2) { public EnumInteractionResult a(EntityHuman entityhuman, World world, ItemStack itemstack, EnumHand enumhand, BlockPosition blockposition, EnumDirection enumdirection, float f, float f1, float f2) {
IBlockData iblockdata = world.getType(blockposition); IBlockData iblockdata = world.getType(blockposition);
+ EnumInteractionResult enuminteractionresult = EnumInteractionResult.FAIL; + EnumInteractionResult enuminteractionresult = EnumInteractionResult.PASS;
+ if (iblockdata.isAir()) return enuminteractionresult; + if (iblockdata.isAir()) return enuminteractionresult;
+ boolean cancelledBlock = false; + boolean cancelledBlock = false;
@ -293,22 +293,18 @@
if (tileentity instanceof ITileInventory) { if (tileentity instanceof ITileInventory) {
Block block = iblockdata.getBlock(); Block block = iblockdata.getBlock();
@@ -304,26 +486,26 @@ @@ -305,24 +487,26 @@
} else { boolean flag = !entityhuman.getItemInMainHand().isEmpty() || !entityhuman.getItemInOffHand().isEmpty();
boolean flag = entityhuman.getItemInMainHand().isEmpty(); boolean flag1 = entityhuman.isSneaking() && flag;
- if ((!entityhuman.isSneaking() || flag && entityhuman.getItemInOffHand().isEmpty()) && iblockdata.interact(world, blockposition, entityhuman, enumhand, enumdirection, f, f1, f2)) { - if (!flag1 && iblockdata.interact(world, blockposition, entityhuman, enumhand, enumdirection, f, f1, f2)) {
- return EnumInteractionResult.SUCCESS; - return EnumInteractionResult.SUCCESS;
- } else if (flag) { - } else if (!itemstack.isEmpty() && !entityhuman.getCooldownTracker().a(itemstack.getItem())) {
- return EnumInteractionResult.PASS; + if (!flag1) {
- } else if (entityhuman.getCooldownTracker().a(itemstack.getItem())) {
- return EnumInteractionResult.PASS;
- } else {
+ if ((!entityhuman.isSneaking() || flag && entityhuman.getItemInOffHand().isEmpty())) {
+ enuminteractionresult = iblockdata.interact(world, blockposition, entityhuman, enumhand, enumdirection, f, f1, f2) ? EnumInteractionResult.SUCCESS : EnumInteractionResult.FAIL; + enuminteractionresult = iblockdata.interact(world, blockposition, entityhuman, enumhand, enumdirection, f, f1, f2) ? EnumInteractionResult.SUCCESS : EnumInteractionResult.FAIL;
+ } + }
+ +
+ if (!itemstack.isEmpty() && !flag && enuminteractionresult != EnumInteractionResult.SUCCESS && !interactResult) { // add !interactResult SPIGOT-764 // MC-133478 - add isEmpty + if (!itemstack.isEmpty() && enuminteractionresult != EnumInteractionResult.SUCCESS && !interactResult) { // add !interactResult SPIGOT-764
ItemActionContext itemactioncontext = new ItemActionContext(entityhuman, entityhuman.b(enumhand), blockposition, enumdirection, f, f1, f2); ItemActionContext itemactioncontext = new ItemActionContext(entityhuman, entityhuman.b(enumhand), blockposition, enumdirection, f, f1, f2);
if (this.isCreative()) { if (this.isCreative()) {
@ -322,6 +318,8 @@
- return itemstack.placeItem(itemactioncontext); - return itemstack.placeItem(itemactioncontext);
+ return itemstack.placeItem(itemactioncontext, enumhand); + return itemstack.placeItem(itemactioncontext, enumhand);
} }
- } else {
- return EnumInteractionResult.PASS;
} }
} }
+ return enuminteractionresult; + return enuminteractionresult;

View file

@ -619,17 +619,8 @@
+ +
public void f(EntityPlayer entityplayer) { public void f(EntityPlayer entityplayer) {
GameProfile gameprofile = entityplayer.getProfile(); GameProfile gameprofile = entityplayer.getProfile();
int i = this.isOp(gameprofile) ? this.operators.a(gameprofile) : 0; int i = this.server.a(gameprofile);
@@ -470,7 +771,7 @@ @@ -499,12 +800,111 @@
boolean flag1 = flag && this.server.I().equalsIgnoreCase(entityplayer.getProfile().getName());
int j = flag1 ? 4 : 2;
- i = flag && this.server.worldServer[0].getWorldData().u() ? j : i;
+ i = flag && this.server.worlds.get(0).getWorldData().u() ? j : i; // CraftBukkit
i = this.u ? j : i;
this.b(entityplayer, i);
}
@@ -504,12 +805,111 @@
} }
public void changeWorld(Entity entity, int i, WorldServer worldserver, WorldServer worldserver1) { public void changeWorld(Entity entity, int i, WorldServer worldserver, WorldServer worldserver1) {
@ -741,7 +732,7 @@
if (entity.dimension == -1) { if (entity.dimension == -1) {
d0 = MathHelper.a(d0 / 8.0D, worldserver1.getWorldBorder().b() + 16.0D, worldserver1.getWorldBorder().d() - 16.0D); d0 = MathHelper.a(d0 / 8.0D, worldserver1.getWorldBorder().b() + 16.0D, worldserver1.getWorldBorder().d() - 16.0D);
d1 = MathHelper.a(d1 / 8.0D, worldserver1.getWorldBorder().c() + 16.0D, worldserver1.getWorldBorder().e() - 16.0D); d1 = MathHelper.a(d1 / 8.0D, worldserver1.getWorldBorder().c() + 16.0D, worldserver1.getWorldBorder().e() - 16.0D);
@@ -528,6 +928,8 @@ @@ -523,6 +923,8 @@
BlockPosition blockposition; BlockPosition blockposition;
if (i == 1) { if (i == 1) {
@ -750,7 +741,7 @@
blockposition = worldserver1.getSpawn(); blockposition = worldserver1.getSpawn();
} else { } else {
blockposition = worldserver1.getDimensionSpawn(); blockposition = worldserver1.getDimensionSpawn();
@@ -541,16 +943,27 @@ @@ -536,16 +938,27 @@
worldserver.entityJoinedWorld(entity, false); worldserver.entityJoinedWorld(entity, false);
} }
} }
@ -781,7 +772,7 @@
worldserver1.entityJoinedWorld(entity, false); worldserver1.entityJoinedWorld(entity, false);
} }
@@ -558,11 +971,23 @@ @@ -553,11 +966,23 @@
} }
entity.spawnIn(worldserver1); entity.spawnIn(worldserver1);
@ -806,7 +797,7 @@
this.v = 0; this.v = 0;
} }
@@ -575,6 +1000,25 @@ @@ -570,6 +995,25 @@
} }
@ -832,7 +823,7 @@
public void a(Packet<?> packet, int i) { public void a(Packet<?> packet, int i) {
for (int j = 0; j < this.players.size(); ++j) { for (int j = 0; j < this.players.size(); ++j) {
EntityPlayer entityplayer = (EntityPlayer) this.players.get(j); EntityPlayer entityplayer = (EntityPlayer) this.players.get(j);
@@ -677,6 +1121,7 @@ @@ -670,6 +1114,7 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, b0)); entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, b0));
} }
@ -840,7 +831,7 @@
this.server.getCommandDispatcher().a(entityplayer); this.server.getCommandDispatcher().a(entityplayer);
} }
@@ -685,7 +1130,7 @@ @@ -678,7 +1123,7 @@
} }
public boolean isOp(GameProfile gameprofile) { public boolean isOp(GameProfile gameprofile) {
@ -849,7 +840,7 @@
} }
@Nullable @Nullable
@@ -709,6 +1154,12 @@ @@ -702,6 +1147,12 @@
for (int j = 0; j < this.players.size(); ++j) { for (int j = 0; j < this.players.size(); ++j) {
EntityPlayer entityplayer = (EntityPlayer) this.players.get(j); EntityPlayer entityplayer = (EntityPlayer) this.players.get(j);
@ -862,7 +853,7 @@
if (entityplayer != entityhuman && entityplayer.dimension == i) { if (entityplayer != entityhuman && entityplayer.dimension == i) {
double d4 = d0 - entityplayer.locX; double d4 = d0 - entityplayer.locX;
double d5 = d1 - entityplayer.locY; double d5 = d1 - entityplayer.locY;
@@ -748,7 +1199,7 @@ @@ -741,7 +1192,7 @@
public void reloadWhitelist() {} public void reloadWhitelist() {}
public void b(EntityPlayer entityplayer, WorldServer worldserver) { public void b(EntityPlayer entityplayer, WorldServer worldserver) {
@ -871,7 +862,7 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutWorldBorder(worldborder, PacketPlayOutWorldBorder.EnumWorldBorderAction.INITIALIZE)); entityplayer.playerConnection.sendPacket(new PacketPlayOutWorldBorder(worldborder, PacketPlayOutWorldBorder.EnumWorldBorderAction.INITIALIZE));
entityplayer.playerConnection.sendPacket(new PacketPlayOutUpdateTime(worldserver.getTime(), worldserver.getDayTime(), worldserver.getGameRules().getBoolean("doDaylightCycle"))); entityplayer.playerConnection.sendPacket(new PacketPlayOutUpdateTime(worldserver.getTime(), worldserver.getDayTime(), worldserver.getGameRules().getBoolean("doDaylightCycle")));
@@ -756,16 +1207,21 @@ @@ -749,16 +1200,21 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutSpawnPosition(blockposition)); entityplayer.playerConnection.sendPacket(new PacketPlayOutSpawnPosition(blockposition));
if (worldserver.isRaining()) { if (worldserver.isRaining()) {
@ -897,7 +888,7 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex)); entityplayer.playerConnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex));
} }
@@ -778,7 +1234,7 @@ @@ -771,7 +1227,7 @@
} }
public String[] getSeenPlayers() { public String[] getSeenPlayers() {
@ -906,7 +897,7 @@
} }
public boolean getHasWhitelist() { public boolean getHasWhitelist() {
@@ -827,26 +1283,39 @@ @@ -820,26 +1276,39 @@
} }
public void u() { public void u() {
@ -951,7 +942,7 @@
if (serverstatisticmanager == null) { if (serverstatisticmanager == null) {
File file = new File(this.server.a(DimensionManager.OVERWORLD).getDataManager().getDirectory(), "stats"); File file = new File(this.server.a(DimensionManager.OVERWORLD).getDataManager().getDirectory(), "stats");
@@ -861,7 +1330,7 @@ @@ -854,7 +1323,7 @@
} }
serverstatisticmanager = new ServerStatisticManager(this.server, file1); serverstatisticmanager = new ServerStatisticManager(this.server, file1);
@ -960,7 +951,7 @@
} }
return serverstatisticmanager; return serverstatisticmanager;
@@ -869,14 +1338,14 @@ @@ -862,14 +1331,14 @@
public AdvancementDataPlayer h(EntityPlayer entityplayer) { public AdvancementDataPlayer h(EntityPlayer entityplayer) {
UUID uuid = entityplayer.getUniqueID(); UUID uuid = entityplayer.getUniqueID();
@ -977,7 +968,7 @@
} }
advancementdataplayer.a(entityplayer); advancementdataplayer.a(entityplayer);
@@ -889,8 +1358,10 @@ @@ -882,8 +1351,10 @@
WorldServer[] aworldserver = this.server.worldServer; WorldServer[] aworldserver = this.server.worldServer;
int j = aworldserver.length; int j = aworldserver.length;
@ -990,7 +981,7 @@
if (worldserver != null) { if (worldserver != null) {
worldserver.getPlayerChunkMap().a(i); worldserver.getPlayerChunkMap().a(i);
@@ -915,13 +1386,20 @@ @@ -908,13 +1379,20 @@
} }
public void reload() { public void reload() {

View file

@ -4,9 +4,9 @@
} }
@Nullable @Nullable
- public static DataInputStream d(File file, int i, int j) { - public static DataInputStream read(File file, int i, int j) {
+ // CraftBukkit start - call sites hoisted for synchronization + // CraftBukkit start - call sites hoisted for synchronization
+ public static synchronized NBTTagCompound d(File file, int i, int j) throws IOException { + public static synchronized NBTTagCompound read(File file, int i, int j) throws IOException {
RegionFile regionfile = a(file, i, j); RegionFile regionfile = a(file, i, j);
- return regionfile.a(i & 31, j & 31); - return regionfile.a(i & 31, j & 31);
@ -20,12 +20,12 @@
} }
@Nullable @Nullable
- public static DataOutputStream e(File file, int i, int j) { - public static DataOutputStream write(File file, int i, int j) {
+ public static synchronized void e(File file, int i, int j, NBTTagCompound nbttagcompound) throws IOException { + public static synchronized void write(File file, int i, int j, NBTTagCompound nbttagcompound) throws IOException {
RegionFile regionfile = a(file, i, j); RegionFile regionfile = a(file, i, j);
- return regionfile.b(i & 31, j & 31); - return regionfile.c(i & 31, j & 31);
+ DataOutputStream dataoutputstream = regionfile.b(i & 31, j & 31); + DataOutputStream dataoutputstream = regionfile.c(i & 31, j & 31);
+ NBTCompressedStreamTools.a(nbttagcompound, (java.io.DataOutput) dataoutputstream); + NBTCompressedStreamTools.a(nbttagcompound, (java.io.DataOutput) dataoutputstream);
+ dataoutputstream.close(); + dataoutputstream.close();
} }

View file

@ -51,7 +51,7 @@
+ return maxStack; // CraftBukkit + return maxStack; // CraftBukkit
} }
public void X_() { public void Y_() {
@@ -170,8 +199,20 @@ @@ -170,8 +199,20 @@
if (this.f < 0) { if (this.f < 0) {
this.f = 0; this.f = 0;

View file

@ -16,7 +16,7 @@
public class TileEntityFurnace extends TileEntityContainer implements IWorldInventory, RecipeHolder, AutoRecipeOutput, ITickable { public class TileEntityFurnace extends TileEntityContainer implements IWorldInventory, RecipeHolder, AutoRecipeOutput, ITickable {
@@ -98,6 +107,32 @@ @@ -93,6 +102,32 @@
return linkedhashmap; return linkedhashmap;
} }
@ -49,10 +49,10 @@
public TileEntityFurnace() { public TileEntityFurnace() {
super(TileEntityTypes.b); super(TileEntityTypes.b);
this.items = NonNullList.a(3, ItemStack.a); this.items = NonNullList.a(3, ItemStack.a);
@@ -225,11 +260,30 @@ @@ -220,11 +255,30 @@
} }
public void X_() { public void Y_() {
- boolean flag = this.isBurning(); - boolean flag = this.isBurning();
+ boolean flag = this.getBlock().get(BlockFurnace.LIT); // CraftBukkit - SPIGOT-844 - Check if furnace block is lit using the block instead of burn time + boolean flag = this.getBlock().get(BlockFurnace.LIT); // CraftBukkit - SPIGOT-844 - Check if furnace block is lit using the block instead of burn time
boolean flag1 = false; boolean flag1 = false;
@ -82,7 +82,7 @@
} }
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
@@ -240,12 +294,21 @@ @@ -235,12 +289,21 @@
this.cookTime = MathHelper.clamp(this.cookTime - 2, 0, this.cookTimeTotal); this.cookTime = MathHelper.clamp(this.cookTime - 2, 0, this.cookTimeTotal);
} }
} else { } else {
@ -109,7 +109,7 @@
flag1 = true; flag1 = true;
if (!itemstack.isEmpty()) { if (!itemstack.isEmpty()) {
Item item = itemstack.getItem(); Item item = itemstack.getItem();
@@ -260,6 +323,7 @@ @@ -255,6 +318,7 @@
} }
} }
@ -117,7 +117,7 @@
if (this.isBurning() && this.canBurn(irecipe)) { if (this.isBurning() && this.canBurn(irecipe)) {
++this.cookTime; ++this.cookTime;
if (this.cookTime == this.cookTimeTotal) { if (this.cookTime == this.cookTimeTotal) {
@@ -271,11 +335,13 @@ @@ -266,11 +330,13 @@
} else { } else {
this.cookTime = 0; this.cookTime = 0;
} }
@ -131,7 +131,7 @@
} }
} }
@@ -300,7 +366,8 @@ @@ -295,7 +361,8 @@
} else { } else {
ItemStack itemstack1 = (ItemStack) this.items.get(2); ItemStack itemstack1 = (ItemStack) this.items.get(2);
@ -141,7 +141,7 @@
} }
} else { } else {
return false; return false;
@@ -313,11 +380,38 @@ @@ -308,11 +375,38 @@
ItemStack itemstack1 = irecipe.d(); ItemStack itemstack1 = irecipe.d();
ItemStack itemstack2 = (ItemStack) this.items.get(2); ItemStack itemstack2 = (ItemStack) this.items.get(2);

View file

@ -55,7 +55,7 @@
+ return maxStack; // CraftBukkit + return maxStack; // CraftBukkit
} }
public void X_() { public void Y_() {
@@ -165,10 +199,35 @@ @@ -165,10 +199,35 @@
for (int i = 0; i < this.getSize(); ++i) { for (int i = 0; i < this.getSize(); ++i) {
if (!this.getItem(i).isEmpty()) { if (!this.getItem(i).isEmpty()) {

View file

@ -441,15 +441,15 @@
entity.N = entity.locX; entity.N = entity.locX;
entity.O = entity.locY; entity.O = entity.locY;
@@ -967,6 +1220,7 @@ @@ -970,6 +1223,7 @@
entity.aH(); return ((MinecraftKey) EntityTypes.REGISTRY.b(entity.P())).toString();
} else { });
entity.tick(); entity.tick();
+ entity.postTick(); // CraftBukkit + entity.postTick(); // CraftBukkit
this.methodProfiler.e();
} }
} }
@@ -1300,11 +1554,18 @@
@@ -1296,11 +1550,18 @@
} }
} }
@ -468,7 +468,7 @@
TileEntity tileentity = null; TileEntity tileentity = null;
if (this.J) { if (this.J) {
@@ -1335,6 +1596,14 @@ @@ -1339,6 +1600,14 @@
public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) { public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) {
if (!k(blockposition)) { if (!k(blockposition)) {
if (tileentity != null && !tileentity.x()) { if (tileentity != null && !tileentity.x()) {
@ -483,7 +483,7 @@
if (this.J) { if (this.J) {
tileentity.setPosition(blockposition); tileentity.setPosition(blockposition);
Iterator iterator = this.c.iterator(); Iterator iterator = this.c.iterator();
@@ -1494,6 +1763,14 @@ @@ -1498,6 +1767,14 @@
} }
this.p = MathHelper.a(this.p, 0.0F, 1.0F); this.p = MathHelper.a(this.p, 0.0F, 1.0F);
@ -498,7 +498,7 @@
} }
} }
} }
@@ -1579,7 +1856,10 @@ @@ -1583,7 +1860,10 @@
} }
public boolean c(EnumSkyBlock enumskyblock, BlockPosition blockposition) { public boolean c(EnumSkyBlock enumskyblock, BlockPosition blockposition) {
@ -510,7 +510,7 @@
return false; return false;
} else { } else {
int i = 0; int i = 0;
@@ -1750,7 +2030,7 @@ @@ -1754,7 +2034,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
@ -519,7 +519,7 @@
arraylist.add(entity); arraylist.add(entity);
} }
} }
@@ -1765,7 +2045,7 @@ @@ -1769,7 +2049,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
@ -528,7 +528,7 @@
arraylist.add(entity); arraylist.add(entity);
} }
} }
@@ -1814,7 +2094,7 @@ @@ -1818,7 +2098,7 @@
} }
} }
@ -537,7 +537,7 @@
} }
@Nullable @Nullable
@@ -1835,8 +2115,17 @@ @@ -1839,8 +2119,17 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
@ -556,7 +556,7 @@
++i; ++i;
} }
} }
@@ -1845,12 +2134,18 @@ @@ -1849,12 +2138,18 @@
} }
public void a(Collection<Entity> collection) { public void a(Collection<Entity> collection) {
@ -576,7 +576,7 @@
this.b(entity); this.b(entity);
} }
@@ -1954,6 +2249,11 @@ @@ -1958,6 +2253,11 @@
for (int i = 0; i < this.players.size(); ++i) { for (int i = 0; i < this.players.size(); ++i) {
EntityHuman entityhuman1 = (EntityHuman) this.players.get(i); EntityHuman entityhuman1 = (EntityHuman) this.players.get(i);
@ -588,7 +588,7 @@
if (predicate.test(entityhuman1)) { if (predicate.test(entityhuman1)) {
double d5 = entityhuman1.d(d0, d1, d2); double d5 = entityhuman1.d(d0, d1, d2);
@@ -2122,6 +2422,16 @@ @@ -2126,6 +2426,16 @@
public void everyoneSleeping() {} public void everyoneSleeping() {}
@ -605,7 +605,7 @@
public float g(float f) { public float g(float f) {
return (this.q + (this.r - this.q) * f) * this.i(f); return (this.q + (this.r - this.q) * f) * this.i(f);
} }
@@ -2296,7 +2606,7 @@ @@ -2300,7 +2610,7 @@
int l = j * 16 + 8 - blockposition.getZ(); int l = j * 16 + 8 - blockposition.getZ();
boolean flag = true; boolean flag = true;

View file

@ -12,23 +12,23 @@
public class WorldData { public class WorldData {
@@ -62,6 +67,7 @@ @@ -64,6 +69,7 @@
private final Map<DimensionManager, NBTTagCompound> S; private final Map<DimensionManager, NBTTagCompound> T;
private NBTTagCompound T; private NBTTagCompound U;
private final GameRules U; private final GameRules V;
+ public WorldServer world; // CraftBukkit + public WorldServer world; // CraftBukkit
protected WorldData() { protected WorldData() {
this.f = WorldType.NORMAL; this.f = WorldType.NORMAL;
@@ -296,6 +302,7 @@ @@ -304,6 +310,7 @@
nbttagcompound2.setBoolean("Snapshot", true); nbttagcompound2.setBoolean("Snapshot", false);
nbttagcompound.set("Version", nbttagcompound2); nbttagcompound.set("Version", nbttagcompound2);
nbttagcompound.setInt("DataVersion", 1513); nbttagcompound.setInt("DataVersion", 1519);
+ if (org.bukkit.craftbukkit.util.CraftMagicNumbers.DATA_VERSION != 1513) throw new AssertionError(); // CraftBukkit - sentinel + if (org.bukkit.craftbukkit.util.CraftMagicNumbers.DATA_VERSION != 1519) throw new AssertionError(); // CraftBukkit - sentinel
nbttagcompound.setLong("RandomSeed", this.e); nbttagcompound.setLong("RandomSeed", this.e);
nbttagcompound.setString("generatorName", this.f.name()); nbttagcompound.setString("generatorName", this.f.b());
nbttagcompound.setInt("generatorVersion", this.f.getVersion()); nbttagcompound.setInt("generatorVersion", this.f.getVersion());
@@ -466,6 +473,16 @@ @@ -478,6 +485,16 @@
} }
public void setThundering(boolean flag) { public void setThundering(boolean flag) {
@ -42,10 +42,10 @@
+ } + }
+ } + }
+ // CraftBukkit end + // CraftBukkit end
this.y = flag; this.z = flag;
} }
@@ -482,6 +499,16 @@ @@ -494,6 +511,16 @@
} }
public void setStorm(boolean flag) { public void setStorm(boolean flag) {
@ -59,13 +59,13 @@
+ } + }
+ } + }
+ // CraftBukkit end + // CraftBukkit end
this.w = flag; this.x = flag;
} }
@@ -631,6 +658,12 @@ @@ -643,6 +670,12 @@
public void setDifficulty(EnumDifficulty enumdifficulty) { public void setDifficulty(EnumDifficulty enumdifficulty) {
this.F = enumdifficulty; this.G = enumdifficulty;
+ // CraftBukkit start + // CraftBukkit start
+ PacketPlayOutServerDifficulty packet = new PacketPlayOutServerDifficulty(this.getDifficulty(), this.isDifficultyLocked()); + PacketPlayOutServerDifficulty packet = new PacketPlayOutServerDifficulty(this.getDifficulty(), this.isDifficultyLocked());
+ for (EntityPlayer player : (java.util.List<EntityPlayer>) (java.util.List) world.players) { + for (EntityPlayer player : (java.util.List<EntityPlayer>) (java.util.List) world.players) {
@ -75,9 +75,9 @@
} }
public boolean isDifficultyLocked() { public boolean isDifficultyLocked() {
@@ -712,4 +745,12 @@ @@ -724,4 +757,12 @@
public void c(@Nullable NBTTagCompound nbttagcompound) { public void c(@Nullable NBTTagCompound nbttagcompound) {
this.T = nbttagcompound; this.U = nbttagcompound;
} }
+ +
+ // CraftBukkit start - Check if the name stored in NBT is the correct one + // CraftBukkit start - Check if the name stored in NBT is the correct one

View file

@ -3,7 +3,7 @@
@@ -1662,14 +1662,14 @@ @@ -1662,14 +1662,14 @@
entityzombievillager.prepare(generatoraccess.getDamageScaler(new BlockPosition(entityzombievillager)), (GroupDataEntity) null, (NBTTagCompound) null); entityzombievillager.prepare(generatoraccess.getDamageScaler(new BlockPosition(entityzombievillager)), (GroupDataEntity) null, (NBTTagCompound) null);
entityzombievillager.setProfession(this.c(i1, 0)); entityzombievillager.setProfession(this.c(i1, 0));
entityzombievillager.di(); entityzombievillager.dj();
- generatoraccess.addEntity(entityzombievillager); - generatoraccess.addEntity(entityzombievillager);
+ generatoraccess.addEntity(entityzombievillager, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN); // CraftBukkit - add SpawnReason + generatoraccess.addEntity(entityzombievillager, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN); // CraftBukkit - add SpawnReason
} else { } else {

View file

@ -1,7 +1,7 @@
--- a/net/minecraft/server/WorldGenWitchHut.java --- a/net/minecraft/server/WorldGenWitchHut.java
+++ b/net/minecraft/server/WorldGenWitchHut.java +++ b/net/minecraft/server/WorldGenWitchHut.java
@@ -86,7 +86,7 @@ @@ -86,7 +86,7 @@
entitywitch.di(); entitywitch.dj();
entitywitch.setPositionRotation((double) i + 0.5D, (double) j, (double) k + 0.5D, 0.0F, 0.0F); entitywitch.setPositionRotation((double) i + 0.5D, (double) j, (double) k + 0.5D, 0.0F, 0.0F);
entitywitch.prepare(generatoraccess.getDamageScaler(new BlockPosition(i, j, k)), (GroupDataEntity) null, (NBTTagCompound) null); entitywitch.prepare(generatoraccess.getDamageScaler(new BlockPosition(i, j, k)), (GroupDataEntity) null, (NBTTagCompound) null);
- generatoraccess.addEntity(entitywitch); - generatoraccess.addEntity(entitywitch);

View file

@ -4,14 +4,14 @@
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId> <artifactId>craftbukkit</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.13-pre7-R0.1-SNAPSHOT</version> <version>1.13-R0.1-SNAPSHOT</version>
<name>CraftBukkit</name> <name>CraftBukkit</name>
<url>http://www.bukkit.org</url> <url>http://www.bukkit.org</url>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<api.version>unknown</api.version> <api.version>unknown</api.version>
<minecraft.version>1.13-pre7</minecraft.version> <minecraft.version>1.13</minecraft.version>
<minecraft_version>1_13_R1</minecraft_version> <minecraft_version>1_13_R1</minecraft_version>
<buildtag.prefix>git-Bukkit-</buildtag.prefix> <buildtag.prefix>git-Bukkit-</buildtag.prefix>
<buildtag.suffix></buildtag.suffix> <buildtag.suffix></buildtag.suffix>

View file

@ -1,80 +0,0 @@
package com.mojang.brigadier.suggestion;
import com.mojang.brigadier.Message;
import com.mojang.brigadier.context.StringRange;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;
public class SuggestionsBuilder {
private final String input;
public int start;
public String remaining;
private final List<Suggestion> result = new ArrayList<>();
public SuggestionsBuilder(final String input, final int start) {
this.input = input;
this.start = start;
this.remaining = input.substring(start);
}
public String getInput() {
return input;
}
public int getStart() {
return start;
}
public String getRemaining() {
return remaining;
}
public Suggestions build() {
return Suggestions.create(input, result);
}
public CompletableFuture<Suggestions> buildFuture() {
return CompletableFuture.completedFuture(build());
}
public SuggestionsBuilder suggest(final String text) {
if (text.equals(remaining)) {
return this;
}
result.add(new Suggestion(StringRange.between(start, input.length()), text));
return this;
}
public SuggestionsBuilder suggest(final String text, final Message tooltip) {
if (text.equals(remaining)) {
return this;
}
result.add(new Suggestion(StringRange.between(start, input.length()), text, tooltip));
return this;
}
public SuggestionsBuilder suggest(final int value) {
result.add(new IntegerSuggestion(StringRange.between(start, input.length()), value));
return this;
}
public SuggestionsBuilder suggest(final int value, final Message tooltip) {
result.add(new IntegerSuggestion(StringRange.between(start, input.length()), value, tooltip));
return this;
}
public SuggestionsBuilder add(final SuggestionsBuilder other) {
result.addAll(other.result);
return this;
}
public SuggestionsBuilder createOffset(final int start) {
return new SuggestionsBuilder(input, start);
}
public SuggestionsBuilder restart() {
return new SuggestionsBuilder(input, start);
}
}

View file

@ -882,25 +882,7 @@ public final class CraftServer implements Server {
generator = getGenerator(name); generator = getGenerator(name);
} }
Convertable converter = new WorldLoaderServer(getWorldContainer().toPath(), getWorldContainer().toPath().resolveSibling("../backups"), getHandle().getServer().dataConverterManager); console.convertWorld(name);
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) {}
});
}
int dimension = CraftWorld.CUSTOM_DIMENSION_OFFSET + console.worlds.size(); int dimension = CraftWorld.CUSTOM_DIMENSION_OFFSET + console.worlds.size();
boolean used = false; boolean used = false;

View file

@ -111,6 +111,8 @@ public class Main {
.defaultsTo(new File("commands.yml")) .defaultsTo(new File("commands.yml"))
.describedAs("Yml file"); .describedAs("Yml file");
acceptsAll(asList("forceUpgrade"), "Whether to force a world upgrade");
acceptsAll(asList("nojline"), "Disables jline and emulates the vanilla console"); acceptsAll(asList("nojline"), "Disables jline and emulates the vanilla console");
acceptsAll(asList("noconsole"), "Disables the console"); acceptsAll(asList("noconsole"), "Disables the console");

View file

@ -36,7 +36,7 @@ public class CraftBed extends CraftBlockEntityState<TileEntityBed> implements Be
case LIGHT_BLUE_BED: case LIGHT_BLUE_BED:
return DyeColor.LIGHT_BLUE; return DyeColor.LIGHT_BLUE;
case LIGHT_GRAY_BED: case LIGHT_GRAY_BED:
return DyeColor.SILVER; return DyeColor.LIGHT_GRAY;
case LIME_BED: case LIME_BED:
return DyeColor.LIME; return DyeColor.LIME;
case MAGENTA_BED: case MAGENTA_BED:

View file

@ -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.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.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.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.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.BlockDaylightDetector.class, org.bukkit.craftbukkit.block.impl.CraftDaylightDetector.class);
register(net.minecraft.server.BlockDirtSnow.class, org.bukkit.craftbukkit.block.impl.CraftDirtSnow.class); register(net.minecraft.server.BlockDirtSnow.class, org.bukkit.craftbukkit.block.impl.CraftDirtSnow.class);

View file

@ -3,7 +3,7 @@
*/ */
package org.bukkit.craftbukkit.block.impl; 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() { public CraftCoralFan() {
super(); super();
@ -13,22 +13,17 @@ public final class CraftCoralFan extends org.bukkit.craftbukkit.block.data.Craft
super(state); 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 @Override
public org.bukkit.block.BlockFace getFacing() { public boolean isWaterlogged() {
return get(FACING, org.bukkit.block.BlockFace.class); return get(WATERLOGGED);
} }
@Override @Override
public void setFacing(org.bukkit.block.BlockFace facing) { public void setWaterlogged(boolean waterlogged) {
set(FACING, facing); set(WATERLOGGED, waterlogged);
}
@Override
public java.util.Set<org.bukkit.block.BlockFace> getFaces() {
return getValues(FACING, org.bukkit.block.BlockFace.class);
} }
} }

View file

@ -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);
}
}

View file

@ -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);
}
}

View file

@ -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);
}
}

View file

@ -472,12 +472,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@Override @Override
public boolean isSwimming() { public boolean isSwimming() {
return getHandle().bb(); return getHandle().isSwimming();
} }
@Override @Override
public void setSwimming(boolean swimming) { public void setSwimming(boolean swimming) {
getHandle().g(swimming); getHandle().setSwimming(swimming);
} }
@Override @Override

View file

@ -63,7 +63,7 @@ public class CraftMetaBanner extends CraftMetaItem implements BannerMeta {
String baseStr = SerializableMeta.getString(map, BASE.BUKKIT, true); String baseStr = SerializableMeta.getString(map, BASE.BUKKIT, true);
if (baseStr != null) { if (baseStr != null) {
base = DyeColor.valueOf(baseStr); base = DyeColor.legacyValueOf(baseStr);
} }
Iterable<?> rawPatternList = SerializableMeta.getObject(Iterable.class, map, PATTERNS.BUKKIT, true); Iterable<?> rawPatternList = SerializableMeta.getObject(Iterable.class, map, PATTERNS.BUKKIT, true);

View file

@ -6,6 +6,7 @@ import net.minecraft.server.ScoreboardServer;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.craftbukkit.util.CraftChatMessage;
import org.bukkit.scoreboard.DisplaySlot; import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective; import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Score; import org.bukkit.scoreboard.Score;
@ -33,16 +34,15 @@ final class CraftObjective extends CraftScoreboardComponent implements Objective
public String getDisplayName() throws IllegalStateException { public String getDisplayName() throws IllegalStateException {
CraftScoreboard scoreboard = checkState(); CraftScoreboard scoreboard = checkState();
return objective.getDisplayName(); return CraftChatMessage.fromComponent(objective.getDisplayName());
} }
public void setDisplayName(String displayName) throws IllegalStateException, IllegalArgumentException { public void setDisplayName(String displayName) throws IllegalStateException, IllegalArgumentException {
Validate.notNull(displayName, "Display name cannot be null"); 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(); CraftScoreboard scoreboard = checkState();
objective.displayName = displayName; objective.setDisplayName(CraftChatMessage.fromStringOrNull(displayName));
((ScoreboardServer) scoreboard.board).handleObjectiveChanged(objective);
} }
public String getCriteria() throws IllegalStateException { public String getCriteria() throws IllegalStateException {

View file

@ -16,6 +16,8 @@ import org.bukkit.scoreboard.Team;
import com.google.common.base.Function; import com.google.common.base.Function;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables; 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 { public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
final Scoreboard board; 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(criteria, "Criteria cannot be null");
Validate.notNull(displayName, "Display name 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(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"); Validate.isTrue(board.getObjective(name) == null, "An objective of name '" + name + "' already exists");
CraftCriteria craftCriteria = CraftCriteria.getFromBukkit(criteria); 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); return new CraftObjective(this, objective);
} }

View file

@ -33,7 +33,7 @@ final class CraftTeam extends CraftScoreboardComponent implements Team {
public String getDisplayName() throws IllegalStateException { public String getDisplayName() throws IllegalStateException {
CraftScoreboard scoreboard = checkState(); CraftScoreboard scoreboard = checkState();
return team.getDisplayName(); return CraftChatMessage.fromComponent(team.getDisplayName());
} }
public void setDisplayName(String displayName) throws IllegalStateException { 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"); Validate.isTrue(displayName.length() <= 128, "Display name '" + displayName + "' is longer than the limit of 128 characters");
CraftScoreboard scoreboard = checkState(); CraftScoreboard scoreboard = checkState();
team.setDisplayName(displayName); team.setDisplayName(CraftChatMessage.fromStringOrNull(displayName));
} }
public String getPrefix() throws IllegalStateException { public String getPrefix() throws IllegalStateException {
CraftScoreboard scoreboard = checkState(); CraftScoreboard scoreboard = checkState();
return CraftChatMessage.fromComponent(team.e()); return CraftChatMessage.fromComponent(team.getPrefix());
} }
public void setPrefix(String prefix) throws IllegalStateException, IllegalArgumentException { 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"); Validate.isTrue(prefix.length() <= 64, "Prefix '" + prefix + "' is longer than the limit of 64 characters");
CraftScoreboard scoreboard = checkState(); CraftScoreboard scoreboard = checkState();
team.a(CraftChatMessage.fromStringOrNull(prefix)); team.setPrefix(CraftChatMessage.fromStringOrNull(prefix));
} }
public String getSuffix() throws IllegalStateException { public String getSuffix() throws IllegalStateException {
CraftScoreboard scoreboard = checkState(); CraftScoreboard scoreboard = checkState();
return CraftChatMessage.fromComponent(team.f()); return CraftChatMessage.fromComponent(team.getPrefix());
} }
public void setSuffix(String suffix) throws IllegalStateException, IllegalArgumentException { 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"); Validate.isTrue(suffix.length() <= 64, "Suffix '" + suffix + "' is longer than the limit of 64 characters");
CraftScoreboard scoreboard = checkState(); CraftScoreboard scoreboard = checkState();
team.b(CraftChatMessage.fromStringOrNull(suffix)); team.setSuffix(CraftChatMessage.fromStringOrNull(suffix));
} }
@Override @Override

View file

@ -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" ) ) if ( owner.equals( "org/bukkit/Particle" ) )
{ {
switch ( name ) switch ( name )
@ -229,6 +239,15 @@ public class Commodore
return; 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 ( owner.equals( "org/bukkit/Material" ) )
{ {
if ( name.equals( "getMaterial" ) && desc.equals( "(I)Lorg/bukkit/Material;" ) ) if ( name.equals( "getMaterial" ) && desc.equals( "(I)Lorg/bukkit/Material;" ) )

View file

@ -138,7 +138,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
return CraftBlockData.fromData(getBlock(material, data)); return CraftBlockData.fromData(getBlock(material, data));
} }
public static final int DATA_VERSION = 1513; public static final int DATA_VERSION = 1519;
@Override @Override
public int getDataVersion() { public int getDataVersion() {

View file

@ -87,11 +87,6 @@ public class DummyGeneratorAccess implements GeneratorAccess {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
@Override
public void a(String string, PersistentBase pb) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override @Override
public IChunkProvider getChunkProvider() { public IChunkProvider getChunkProvider() {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");

View file

@ -31,6 +31,9 @@ public class LegacyTest extends AbstractTestingBase {
Material.HEART_OF_THE_SEA, Material.HORN_CORAL, Material.HORN_CORAL_BLOCK, Material.HORN_CORAL_FAN, Material.NAUTILUS_SHELL, Material.PHANTOM_MEMBRANE, Material.SEA_PICKLE, Material.TUBE_CORAL, Material.TUBE_CORAL_BLOCK, Material.HEART_OF_THE_SEA, Material.HORN_CORAL, Material.HORN_CORAL_BLOCK, Material.HORN_CORAL_FAN, Material.NAUTILUS_SHELL, Material.PHANTOM_MEMBRANE, Material.SEA_PICKLE, Material.TUBE_CORAL, Material.TUBE_CORAL_BLOCK,
Material.TUBE_CORAL_FAN, Material.STRIPPED_ACACIA_WOOD, Material.STRIPPED_BIRCH_WOOD, Material.STRIPPED_DARK_OAK_WOOD, Material.STRIPPED_JUNGLE_WOOD, Material.STRIPPED_OAK_WOOD, Material.STRIPPED_SPRUCE_WOOD, Material.TUBE_CORAL_FAN, Material.STRIPPED_ACACIA_WOOD, Material.STRIPPED_BIRCH_WOOD, Material.STRIPPED_DARK_OAK_WOOD, Material.STRIPPED_JUNGLE_WOOD, Material.STRIPPED_OAK_WOOD, Material.STRIPPED_SPRUCE_WOOD,
Material.ACACIA_WOOD, Material.BIRCH_WOOD, Material.DARK_OAK_WOOD, Material.JUNGLE_WOOD, Material.OAK_WOOD, Material.SPRUCE_WOOD, Material.ACACIA_WOOD, Material.BIRCH_WOOD, Material.DARK_OAK_WOOD, Material.JUNGLE_WOOD, Material.OAK_WOOD, Material.SPRUCE_WOOD,
Material.TUBE_CORAL_WALL_FAN, Material.BRAIN_CORAL_WALL_FAN, Material.BUBBLE_CORAL_WALL_FAN, Material.FIRE_CORAL_WALL_FAN, Material.HORN_CORAL_WALL_FAN, Material.DEAD_TUBE_CORAL_WALL_FAN, Material.DEAD_BRAIN_CORAL_WALL_FAN,
Material.DEAD_BUBBLE_CORAL_WALL_FAN, Material.DEAD_FIRE_CORAL_WALL_FAN, Material.DEAD_HORN_CORAL_WALL_FAN, Material.DEAD_TUBE_CORAL_FAN, Material.DEAD_BRAIN_CORAL_FAN, Material.DEAD_BUBBLE_CORAL_FAN, Material.DEAD_FIRE_CORAL_FAN,
Material.DEAD_HORN_CORAL_FAN,
// //
Material.LEGACY_AIR, Material.LEGACY_DEAD_BUSH, Material.LEGACY_BURNING_FURNACE, Material.LEGACY_WALL_SIGN, Material.LEGACY_REDSTONE_TORCH_OFF, Material.LEGACY_SKULL, Material.LEGACY_REDSTONE_COMPARATOR_ON, Material.LEGACY_WALL_BANNER, Material.LEGACY_MONSTER_EGG)); Material.LEGACY_AIR, Material.LEGACY_DEAD_BUSH, Material.LEGACY_BURNING_FURNACE, Material.LEGACY_WALL_SIGN, Material.LEGACY_REDSTONE_TORCH_OFF, Material.LEGACY_SKULL, Material.LEGACY_REDSTONE_COMPARATOR_ON, Material.LEGACY_WALL_BANNER, Material.LEGACY_MONSTER_EGG));

View file

@ -31,7 +31,7 @@ public class TropicalFishTest {
testVariant(117506305, DyeColor.ORANGE, DyeColor.GRAY, Pattern.STRIPEY); testVariant(117506305, DyeColor.ORANGE, DyeColor.GRAY, Pattern.STRIPEY);
testVariant(117899265, DyeColor.GRAY, DyeColor.GRAY, Pattern.FLOPPER); testVariant(117899265, DyeColor.GRAY, DyeColor.GRAY, Pattern.FLOPPER);
testVariant(118161664, DyeColor.BLUE, DyeColor.GRAY, Pattern.SUNSTREAK); testVariant(118161664, DyeColor.BLUE, DyeColor.GRAY, Pattern.SUNSTREAK);
testVariant(134217984, DyeColor.WHITE, DyeColor.SILVER, Pattern.SUNSTREAK); testVariant(134217984, DyeColor.WHITE, DyeColor.LIGHT_GRAY, Pattern.SUNSTREAK);
testVariant(234882305, DyeColor.WHITE, DyeColor.RED, Pattern.CLAYFISH); testVariant(234882305, DyeColor.WHITE, DyeColor.RED, Pattern.CLAYFISH);
testVariant(235340288, DyeColor.GRAY, DyeColor.RED, Pattern.SNOOPER); testVariant(235340288, DyeColor.GRAY, DyeColor.RED, Pattern.SNOOPER);
} }

View file

@ -43,6 +43,6 @@ public abstract class AbstractTestingBase {
} }
} }
INVALIDATED_MATERIALS = builder.build(); INVALIDATED_MATERIALS = builder.build();
Assert.assertTrue("Expected 533 invalidated materials (got " + INVALIDATED_MATERIALS.size() + ")", INVALIDATED_MATERIALS.size() == 533); Assert.assertTrue("Expected 543 invalidated materials (got " + INVALIDATED_MATERIALS.size() + ")", INVALIDATED_MATERIALS.size() == 543);
} }
} }