Mappings Update

This commit is contained in:
md_5 2018-12-26 08:00:00 +11:00
parent bd36e200da
commit d05c8b1481
120 changed files with 878 additions and 1619 deletions

View File

@ -8,29 +8,11 @@
public Advancement(MinecraftKey minecraftkey, @Nullable Advancement advancement, @Nullable AdvancementDisplay advancementdisplay, AdvancementRewards advancementrewards, Map<String, Criterion> map, String[][] astring) { public Advancement(MinecraftKey minecraftkey, @Nullable Advancement advancement, @Nullable AdvancementDisplay advancementdisplay, AdvancementRewards advancementrewards, Map<String, Criterion> map, String[][] astring) {
this.d = minecraftkey; this.d = minecraftkey;
@@ -46,7 +47,7 @@
EnumChatFormat enumchatformat = advancementdisplay.e().c();
IChatBaseComponent ichatbasecomponent1 = ichatbasecomponent.h().a(enumchatformat).a("\n").addSibling(advancementdisplay.b());
IChatBaseComponent ichatbasecomponent2 = ichatbasecomponent.h().a((chatmodifier) -> {
- chatmodifier.setChatHoverable(new ChatHoverable(ChatHoverable.EnumHoverAction.SHOW_TEXT, ichatbasecomponent));
+ chatmodifier.setChatHoverable(new ChatHoverable(ChatHoverable.EnumHoverAction.SHOW_TEXT, ichatbasecomponent1)); // CraftBukkit - decompile error
});
this.h = (new ChatComponentText("[")).addSibling(ichatbasecomponent2).a("]").a(enumchatformat);
@@ -55,7 +56,7 @@
}
public Advancement.SerializedAdvancement a() {
- return new Advancement.SerializedAdvancement(this.a == null ? null : this.a.getName(), this.b, this.c, this.e, this.f, null);
+ return new Advancement.SerializedAdvancement(this.a == null ? null : this.a.getName(), this.b, this.c, this.e, this.f); // CraftBukkit - decompile error
}
@Nullable
@@ -206,7 +207,7 @@ @@ -206,7 +207,7 @@
} }
public Advancement b(MinecraftKey minecraftkey) { public Advancement b(MinecraftKey minecraftkey) {
- if (!this.a((minecraftkey) -> { - if (!this.a((minecraftkey1) -> {
+ if (!this.a((Function<MinecraftKey, Advancement>) (minecraftkey1) -> { // CraftBukkit - decompile error + if (!this.a((Function<MinecraftKey, Advancement>) (minecraftkey1) -> { // CraftBukkit - decompile error
return null; return null;
})) { })) {

View File

@ -1,42 +1,6 @@
--- a/net/minecraft/server/AdvancementDataPlayer.java --- a/net/minecraft/server/AdvancementDataPlayer.java
+++ b/net/minecraft/server/AdvancementDataPlayer.java +++ b/net/minecraft/server/AdvancementDataPlayer.java
@@ -38,7 +38,7 @@ @@ -158,7 +158,11 @@
private static final Logger a = LogManager.getLogger();
private static final Gson b = (new GsonBuilder()).registerTypeAdapter(AdvancementProgress.class, new AdvancementProgress.a()).registerTypeAdapter(MinecraftKey.class, new MinecraftKey.a()).setPrettyPrinting().create();
- private static final TypeToken<Map<MinecraftKey, AdvancementProgress>> c = new TypeToken() {
+ private static final TypeToken<Map<MinecraftKey, AdvancementProgress>> c = new TypeToken<Map<MinecraftKey, AdvancementProgress>>() { // CraftBukkit - decompile error
};
private final MinecraftServer d;
private final File e;
@@ -100,7 +100,7 @@
Iterator iterator = this.data.entrySet().iterator();
while (iterator.hasNext()) {
- Entry entry = (Entry) iterator.next();
+ Entry<Advancement, AdvancementProgress> entry = (Entry) iterator.next(); // CraftBukkit - decompile error
if (((AdvancementProgress) entry.getValue()).isDone()) {
arraylist.add(entry.getKey());
@@ -140,7 +140,7 @@
try {
jsonreader.setLenient(false);
- Dynamic dynamic = new Dynamic(JsonOps.INSTANCE, Streams.parse(jsonreader));
+ Dynamic<?> dynamic = new Dynamic(JsonOps.INSTANCE, Streams.parse(jsonreader)); // CraftBukkit - decompile error
if (!dynamic.get("DataVersion").flatMap(Dynamic::getNumberValue).isPresent()) {
dynamic = dynamic.set("DataVersion", dynamic.createInt(1343));
@@ -148,7 +148,7 @@
dynamic = this.d.az().update(DataFixTypes.ADVANCEMENTS, dynamic, dynamic.getInt("DataVersion"), 1631);
dynamic = dynamic.remove("DataVersion");
- 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
if (map == null) {
throw new JsonParseException("Found null for advancements");
@@ -162,7 +162,11 @@
Advancement advancement = this.d.getAdvancementData().a((MinecraftKey) entry.getKey()); Advancement advancement = this.d.getAdvancementData().a((MinecraftKey) entry.getKey());
if (advancement == null) { if (advancement == null) {
@ -49,7 +13,7 @@
} else { } else {
this.a(advancement, (AdvancementProgress) entry.getValue()); this.a(advancement, (AdvancementProgress) entry.getValue());
} }
@@ -231,6 +235,7 @@ @@ -227,6 +231,7 @@
this.i.add(advancement); this.i.add(advancement);
flag = true; flag = true;
if (!flag1 && advancementprogress.isDone()) { if (!flag1 && advancementprogress.isDone()) {

View File

@ -9,26 +9,24 @@
private final Map<String, String> l = Maps.newHashMap(); private final Map<String, String> l = Maps.newHashMap();
private MinecraftKey m = new MinecraftKey(""); private MinecraftKey m = new MinecraftKey("");
private BlockStateList<Block, IBlockData> n; private BlockStateList<Block, IBlockData> n;
@@ -222,7 +222,7 @@ @@ -217,7 +217,7 @@
if (comparable instanceof Integer) { Iterator iterator = iblockstate.d().iterator();
suggestionsbuilder.suggest((Integer) comparable);
} else {
- suggestionsbuilder.suggest(iblockstate.a(comparable));
+ suggestionsbuilder.suggest(iblockstate.a((T) comparable)); // CraftBukkit - decompile error
}
}
@@ -488,8 +488,8 @@ while (iterator.hasNext()) {
Optional optional = iblockstate.b(s); - T t0 = (Comparable) iterator.next();
+ T t0 = (T) iterator.next(); // CraftBukkit - decompile error
if (t0 instanceof Integer) {
suggestionsbuilder.suggest((Integer) t0);
@@ -488,7 +488,7 @@
Optional<T> optional = iblockstate.b(s);
if (optional.isPresent()) { if (optional.isPresent()) {
- this.o = (IBlockData) this.o.set(iblockstate, (Comparable) optional.get()); - this.o = (IBlockData) this.o.set(iblockstate, (Comparable) optional.get());
- this.k.put(iblockstate, optional.get());
+ this.o = (IBlockData) this.o.set(iblockstate, (T) optional.get()); // CraftBukkit - decompile error + this.o = (IBlockData) this.o.set(iblockstate, (T) optional.get()); // CraftBukkit - decompile error
+ this.k.put(iblockstate, (Comparable) optional.get()); // CraftBukkit - decompile error this.k.put(iblockstate, optional.get());
} else { } else {
this.i.setCursor(i); this.i.setCursor(i);
throw ArgumentBlock.e.createWithContext(this.i, this.m.toString(), iblockstate.a(), s);
@@ -526,7 +526,7 @@ @@ -526,7 +526,7 @@
private static <T extends Comparable<T>> void a(StringBuilder stringbuilder, IBlockState<T> iblockstate, Comparable<?> comparable) { private static <T extends Comparable<T>> void a(StringBuilder stringbuilder, IBlockState<T> iblockstate, Comparable<?> comparable) {
stringbuilder.append(iblockstate.a()); stringbuilder.append(iblockstate.a());

View File

@ -1,24 +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
@@ -32,7 +32,7 @@ @@ -405,7 +405,8 @@
@Nullable
private String name;
private static final ThreadLocal<Object2ByteLinkedOpenHashMap<Block.a>> q = ThreadLocal.withInitial(() -> {
- Object2ByteLinkedOpenHashMap object2bytelinkedopenhashmap = new Object2ByteLinkedOpenHashMap(200) {
+ Object2ByteLinkedOpenHashMap object2bytelinkedopenhashmap = new Object2ByteLinkedOpenHashMap<Block.a>(200) { // CraftBukkit - decompile error
protected void rehash(int i) {}
};
@@ -194,7 +194,7 @@
}
public Block(Block.Info block_info) {
- BlockStateList.a blockstatelist_a = new BlockStateList.a(this);
+ BlockStateList.a<Block, IBlockData> blockstatelist_a = new BlockStateList.a(this); // CraftBukkit - decompile error
this.a(blockstatelist_a);
this.blockStateList = blockstatelist_a.a(BlockData::new);
@@ -406,7 +406,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) {
@ -28,7 +10,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) {
@@ -427,7 +428,13 @@ @@ -426,7 +427,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();
@ -43,7 +25,7 @@
} }
} }
@@ -1395,8 +1402,14 @@ @@ -1394,8 +1401,14 @@
} }

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/BlockDispenser.java --- a/net/minecraft/server/BlockDispenser.java
+++ b/net/minecraft/server/BlockDispenser.java +++ b/net/minecraft/server/BlockDispenser.java
@@ -9,9 +9,10 @@ @@ -8,9 +8,10 @@
public static final BlockStateDirection FACING = BlockDirectional.FACING; public static final BlockStateDirection FACING = BlockDirectional.FACING;
public static final BlockStateBoolean TRIGGERED = BlockProperties.w; public static final BlockStateBoolean TRIGGERED = BlockProperties.w;
@ -12,7 +12,7 @@
public static void a(IMaterial imaterial, IDispenseBehavior idispensebehavior) { public static void a(IMaterial imaterial, IDispenseBehavior idispensebehavior) {
BlockDispenser.REGISTRY.put(imaterial.getItem(), idispensebehavior); BlockDispenser.REGISTRY.put(imaterial.getItem(), idispensebehavior);
@@ -57,6 +58,7 @@ @@ -56,6 +57,7 @@
IDispenseBehavior idispensebehavior = this.a(itemstack); IDispenseBehavior idispensebehavior = this.a(itemstack);
if (idispensebehavior != IDispenseBehavior.NONE) { if (idispensebehavior != IDispenseBehavior.NONE) {

View File

@ -12,7 +12,7 @@
@@ -28,6 +30,10 @@ @@ -28,6 +30,10 @@
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) { public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
if (!world.isClientSide && !entity.isPassenger() && !entity.isVehicle() && entity.bm() && VoxelShapes.c(VoxelShapes.a(entity.getBoundingBox().d((double) (-blockposition.getX()), (double) (-blockposition.getY()), (double) (-blockposition.getZ()))), iblockdata.g(world, blockposition), OperatorBoolean.AND)) { if (!world.isClientSide && !entity.isPassenger() && !entity.isVehicle() && entity.bm() && VoxelShapes.c(VoxelShapes.a(entity.getBoundingBox().d((double) (-blockposition.getX()), (double) (-blockposition.getY()), (double) (-blockposition.getZ()))), iblockdata.getShape(world, blockposition), OperatorBoolean.AND)) {
+ // CraftBukkit start - Entity in portal + // CraftBukkit start - Entity in portal
+ EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ())); + EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()));
+ world.getServer().getPluginManager().callEvent(event); + world.getServer().getPluginManager().callEvent(event);

View File

@ -1,7 +1,7 @@
--- a/net/minecraft/server/BlockFire.java --- a/net/minecraft/server/BlockFire.java
+++ b/net/minecraft/server/BlockFire.java +++ b/net/minecraft/server/BlockFire.java
@@ -8,6 +8,16 @@ @@ -7,6 +7,16 @@
import java.util.function.Predicate; import java.util.Map.Entry;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
@ -17,7 +17,7 @@
public class BlockFire extends Block { public class BlockFire extends Block {
public static final BlockStateInteger AGE = BlockProperties.X; public static final BlockStateInteger AGE = BlockProperties.X;
@@ -32,7 +42,20 @@ @@ -31,7 +41,20 @@
} }
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
@ -39,7 +39,7 @@
} }
@Nullable @Nullable
@@ -82,7 +105,7 @@ @@ -81,7 +104,7 @@
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) { public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
if (world.getGameRules().getBoolean("doFireTick")) { if (world.getGameRules().getBoolean("doFireTick")) {
if (!iblockdata.canPlace(world, blockposition)) { if (!iblockdata.canPlace(world, blockposition)) {
@ -48,7 +48,7 @@
} }
Block block = world.getType(blockposition.down()).getBlock(); Block block = world.getType(blockposition.down()).getBlock();
@@ -90,7 +113,7 @@ @@ -89,7 +112,7 @@
int i = (Integer) iblockdata.get(BlockFire.AGE); int i = (Integer) iblockdata.get(BlockFire.AGE);
if (!flag && world.isRaining() && this.a(world, blockposition) && random.nextFloat() < 0.2F + (float) i * 0.03F) { if (!flag && world.isRaining() && this.a(world, blockposition) && random.nextFloat() < 0.2F + (float) i * 0.03F) {
@ -57,7 +57,7 @@
} else { } else {
int j = Math.min(15, i + random.nextInt(3) / 2); int j = Math.min(15, i + random.nextInt(3) / 2);
@@ -103,14 +126,14 @@ @@ -102,14 +125,14 @@
world.getBlockTickList().a(blockposition, this, this.a((IWorldReader) world) + random.nextInt(10)); world.getBlockTickList().a(blockposition, this, this.a((IWorldReader) world) + random.nextInt(10));
if (!this.d(world, blockposition)) { if (!this.d(world, blockposition)) {
if (!world.getType(blockposition.down()).q() || i > 3) { if (!world.getType(blockposition.down()).q() || i > 3) {
@ -74,7 +74,7 @@
return; return;
} }
} }
@@ -118,12 +141,14 @@ @@ -117,12 +140,14 @@
boolean flag1 = world.x(blockposition); boolean flag1 = world.x(blockposition);
int k = flag1 ? -50 : 0; int k = flag1 ? -50 : 0;
@ -95,7 +95,7 @@
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
for (int l = -1; l <= 1; ++l) { for (int l = -1; l <= 1; ++l) {
@@ -149,7 +174,15 @@ @@ -148,7 +173,15 @@
if (i2 > 0 && random.nextInt(k1) <= i2 && (!world.isRaining() || !this.a(world, (BlockPosition) blockposition_mutableblockposition))) { if (i2 > 0 && random.nextInt(k1) <= i2 && (!world.isRaining() || !this.a(world, (BlockPosition) blockposition_mutableblockposition))) {
int j2 = Math.min(15, i + random.nextInt(5) / 4); int j2 = Math.min(15, i + random.nextInt(5) / 4);
@ -112,7 +112,7 @@
} }
} }
} }
@@ -173,12 +206,24 @@ @@ -172,12 +205,24 @@
return this.flameChances.getInt(block); return this.flameChances.getInt(block);
} }
@ -138,7 +138,7 @@
if (random.nextInt(j + 10) < 5 && !world.isRainingAt(blockposition)) { if (random.nextInt(j + 10) < 5 && !world.isRainingAt(blockposition)) {
int l = Math.min(j + random.nextInt(5) / 4, 15); int l = Math.min(j + random.nextInt(5) / 4, 15);
@@ -241,7 +286,7 @@ @@ -240,7 +285,7 @@
if (iblockdata1.getBlock() != iblockdata.getBlock()) { if (iblockdata1.getBlock() != iblockdata.getBlock()) {
if (world.worldProvider.getDimensionManager() != DimensionManager.OVERWORLD && world.worldProvider.getDimensionManager() != DimensionManager.NETHER || !((BlockPortal) Blocks.NETHER_PORTAL).a((GeneratorAccess) world, blockposition)) { if (world.worldProvider.getDimensionManager() != DimensionManager.OVERWORLD && world.worldProvider.getDimensionManager() != DimensionManager.NETHER || !((BlockPortal) Blocks.NETHER_PORTAL).a((GeneratorAccess) world, blockposition)) {
if (!iblockdata.canPlace(world, blockposition)) { if (!iblockdata.canPlace(world, blockposition)) {
@ -147,7 +147,7 @@
} else { } else {
world.getBlockTickList().a(blockposition, this, this.a((IWorldReader) world) + world.random.nextInt(10)); world.getBlockTickList().a(blockposition, this, this.a((IWorldReader) world) + world.random.nextInt(10));
} }
@@ -387,4 +432,12 @@ @@ -386,4 +431,12 @@
blockfire.a(Blocks.BLACK_CARPET, 60, 20); blockfire.a(Blocks.BLACK_CARPET, 60, 20);
blockfire.a(Blocks.DRIED_KELP_BLOCK, 30, 60); blockfire.a(Blocks.DRIED_KELP_BLOCK, 30, 60);
} }

View File

@ -1,20 +1,6 @@
--- a/net/minecraft/server/BlockFluids.java --- a/net/minecraft/server/BlockFluids.java
+++ b/net/minecraft/server/BlockFluids.java +++ b/net/minecraft/server/BlockFluids.java
@@ -57,10 +57,10 @@ @@ -116,14 +116,20 @@
public VoxelShape a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition) {
Fluid fluid = iblockaccess.getFluid(blockposition.up());
- return fluid.c().a((FluidType) this.b) ? VoxelShapes.b() : (VoxelShape) this.o.computeIfAbsent(iblockdata, (iblockdata) -> {
- Fluid fluid = iblockdata.s();
+ return fluid.c().a((FluidType) this.b) ? VoxelShapes.b() : (VoxelShape) this.o.computeIfAbsent(iblockdata, (iblockdata1) -> { // CraftBukkit - decompile errors
+ Fluid fluid1 = iblockdata1.s();
- return VoxelShapes.create(0.0D, 0.0D, 0.0D, 1.0D, (double) fluid.getHeight(), 1.0D);
+ return VoxelShapes.create(0.0D, 0.0D, 0.0D, 1.0D, (double) fluid1.getHeight(), 1.0D);
});
}
@@ -117,14 +117,20 @@
Fluid fluid = world.getFluid(blockposition); Fluid fluid = world.getFluid(blockposition);
if (fluid.d()) { if (fluid.d()) {

View File

@ -21,7 +21,7 @@
} }
@@ -66,8 +70,10 @@ @@ -66,8 +70,10 @@
WorldGenerator worldgenerator = null; WorldGenerator<WorldGenFeatureEmptyConfiguration> worldgenerator = null;
if (this == Blocks.BROWN_MUSHROOM) { if (this == Blocks.BROWN_MUSHROOM) {
+ BlockSapling.treeType = TreeType.BROWN_MUSHROOM; // CraftBukkit + BlockSapling.treeType = TreeType.BROWN_MUSHROOM; // CraftBukkit

View File

@ -1,8 +1,8 @@
--- a/net/minecraft/server/BlockPiston.java --- a/net/minecraft/server/BlockPiston.java
+++ b/net/minecraft/server/BlockPiston.java +++ b/net/minecraft/server/BlockPiston.java
@@ -7,6 +7,18 @@ @@ -6,6 +6,18 @@
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Set;
+// CraftBukkit start +// CraftBukkit start
+import java.util.AbstractList; +import java.util.AbstractList;
@ -19,7 +19,7 @@
public class BlockPiston extends BlockDirectional { public class BlockPiston extends BlockDirectional {
public static final BlockStateBoolean EXTENDED = BlockProperties.f; public static final BlockStateBoolean EXTENDED = BlockProperties.f;
@@ -106,6 +118,18 @@ @@ -105,6 +117,18 @@
} }
} }
@ -38,10 +38,10 @@
world.playBlockAction(blockposition, this, b0, enumdirection.a()); world.playBlockAction(blockposition, this, b0, enumdirection.a());
} }
@@ -278,6 +302,48 @@ @@ -277,6 +301,48 @@
IBlockData[] aiblockdata = new IBlockData[j]; IBlockData[] aiblockdata = new IBlockData[j];
EnumDirection enumdirection1 = flag ? enumdirection : enumdirection.opposite(); EnumDirection enumdirection1 = flag ? enumdirection : enumdirection.opposite();
HashSet hashset = Sets.newHashSet(list); Set<BlockPosition> set = Sets.newHashSet(list);
+ // CraftBukkit start + // CraftBukkit start
+ final org.bukkit.block.Block bblock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + final org.bukkit.block.Block bblock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
+ +

View File

@ -1,7 +1,7 @@
--- a/net/minecraft/server/BlockRedstoneComparator.java --- a/net/minecraft/server/BlockRedstoneComparator.java
+++ b/net/minecraft/server/BlockRedstoneComparator.java +++ b/net/minecraft/server/BlockRedstoneComparator.java
@@ -5,6 +5,8 @@ @@ -4,6 +4,8 @@
import java.util.function.Predicate; import java.util.Random;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit +import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
@ -9,17 +9,17 @@
public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITileEntity { public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITileEntity {
public static final BlockStateEnum<BlockPropertyComparatorMode> MODE = BlockProperties.aq; public static final BlockStateEnum<BlockPropertyComparatorMode> MODE = BlockProperties.aq;
@@ -65,7 +67,8 @@ @@ -64,7 +66,8 @@
@Nullable @Nullable
private EntityItemFrame a(World world, EnumDirection enumdirection, BlockPosition blockposition) { private EntityItemFrame a(World world, EnumDirection enumdirection, BlockPosition blockposition) {
- List list = world.a(EntityItemFrame.class, new AxisAlignedBB((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), (double) (blockposition.getX() + 1), (double) (blockposition.getY() + 1), (double) (blockposition.getZ() + 1)), (entityitemframe) -> { - List<EntityItemFrame> list = world.a(EntityItemFrame.class, new AxisAlignedBB((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), (double) (blockposition.getX() + 1), (double) (blockposition.getY() + 1), (double) (blockposition.getZ() + 1)), (entityitemframe) -> {
+ // CraftBukkit - decompile error + // CraftBukkit - decompile error
+ List list = world.a(EntityItemFrame.class, new AxisAlignedBB((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), (double) (blockposition.getX() + 1), (double) (blockposition.getY() + 1), (double) (blockposition.getZ() + 1)), (Predicate<EntityItemFrame>) (entityitemframe) -> { + List<EntityItemFrame> list = world.a(EntityItemFrame.class, new AxisAlignedBB((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), (double) (blockposition.getX() + 1), (double) (blockposition.getY() + 1), (double) (blockposition.getZ() + 1)), (java.util.function.Predicate<EntityItemFrame>) (entityitemframe) -> {
return entityitemframe != null && entityitemframe.getDirection() == enumdirection; return entityitemframe != null && entityitemframe.getDirection() == enumdirection;
}); });
@@ -118,8 +121,18 @@ @@ -117,8 +120,18 @@
boolean flag1 = (Boolean) iblockdata.get(BlockRedstoneComparator.c); boolean flag1 = (Boolean) iblockdata.get(BlockRedstoneComparator.c);
if (flag1 && !flag) { if (flag1 && !flag) {

View File

@ -50,12 +50,3 @@
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneTorch.LIT, true), 3); world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneTorch.LIT, true), 3);
} }
@@ -112,7 +139,7 @@
}
private static boolean a(World world, BlockPosition blockposition, boolean flag) {
- Object object = (List) BlockRedstoneTorch.b.get(world);
+ List<RedstoneUpdateInfo> object = (List) BlockRedstoneTorch.b.get(world); // CraftBukkit - decompile error
if (object == null) {
object = Lists.newArrayList();

View File

@ -3,7 +3,7 @@
@@ -2,6 +2,12 @@ @@ -2,6 +2,12 @@
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import java.util.LinkedList; import java.util.Queue;
+// CraftBukkit start +// CraftBukkit start
+import java.util.List; +import java.util.List;
+import org.bukkit.craftbukkit.block.CraftBlockState; +import org.bukkit.craftbukkit.block.CraftBlockState;
@ -15,28 +15,28 @@
@@ -33,6 +39,7 @@ @@ -33,6 +39,7 @@
linkedlist.add(new Tuple(blockposition, 0)); queue.add(new Tuple<>(blockposition, 0));
int i = 0; int i = 0;
+ BlockStateListPopulator blockList = new BlockStateListPopulator(world); // CraftBukkit - Use BlockStateListPopulator + BlockStateListPopulator blockList = new BlockStateListPopulator(world); // CraftBukkit - Use BlockStateListPopulator
while (!linkedlist.isEmpty()) { while (!queue.isEmpty()) {
Tuple tuple = (Tuple) linkedlist.poll(); Tuple<BlockPosition, Integer> tuple = (Tuple) queue.poll();
@@ -49,20 +56,20 @@ @@ -49,20 +56,20 @@
Material material = iblockdata.getMaterial(); Material material = iblockdata.getMaterial();
if (fluid.a(TagsFluid.WATER)) { if (fluid.a(TagsFluid.WATER)) {
- if (iblockdata.getBlock() instanceof IFluidSource && ((IFluidSource) iblockdata.getBlock()).a(world, blockposition2, iblockdata) != FluidTypes.a) { - if (iblockdata.getBlock() instanceof IFluidSource && ((IFluidSource) iblockdata.getBlock()).removeFluid(world, blockposition2, iblockdata) != FluidTypes.EMPTY) {
+ if (iblockdata.getBlock() instanceof IFluidSource && ((IFluidSource) iblockdata.getBlock()).a(blockList, blockposition2, iblockdata) != FluidTypes.a) { // CraftBukkit + if (iblockdata.getBlock() instanceof IFluidSource && ((IFluidSource) iblockdata.getBlock()).removeFluid(blockList, blockposition2, iblockdata) != FluidTypes.EMPTY) { // CraftBukkit
++i; ++i;
if (j < 6) { if (j < 6) {
linkedlist.add(new Tuple(blockposition2, j + 1)); queue.add(new Tuple<>(blockposition2, j + 1));
} }
} else if (iblockdata.getBlock() instanceof BlockFluids) { } else if (iblockdata.getBlock() instanceof BlockFluids) {
- world.setTypeAndData(blockposition2, Blocks.AIR.getBlockData(), 3); - world.setTypeAndData(blockposition2, Blocks.AIR.getBlockData(), 3);
+ blockList.setTypeAndData(blockposition2, Blocks.AIR.getBlockData(), 3); // CraftBukkit + blockList.setTypeAndData(blockposition2, Blocks.AIR.getBlockData(), 3); // CraftBukkit
++i; ++i;
if (j < 6) { if (j < 6) {
linkedlist.add(new Tuple(blockposition2, j + 1)); queue.add(new Tuple<>(blockposition2, j + 1));
} }
} else if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) { } else if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) {
- iblockdata.a(world, blockposition2, 0); - iblockdata.a(world, blockposition2, 0);
@ -45,7 +45,7 @@
+ blockList.setTypeAndData(blockposition2, Blocks.AIR.getBlockData(), 3); // CraftBukkit + blockList.setTypeAndData(blockposition2, Blocks.AIR.getBlockData(), 3); // CraftBukkit
++i; ++i;
if (j < 6) { if (j < 6) {
linkedlist.add(new Tuple(blockposition2, j + 1)); queue.add(new Tuple<>(blockposition2, j + 1));
@@ -75,6 +82,37 @@ @@ -75,6 +82,37 @@
break; break;
} }
@ -69,7 +69,7 @@
+ Material material = iblockdata.getMaterial(); + Material material = iblockdata.getMaterial();
+ +
+ if (fluid.a(TagsFluid.WATER)) { + if (fluid.a(TagsFluid.WATER)) {
+ if (iblockdata.getBlock() instanceof IFluidSource && ((IFluidSource) iblockdata.getBlock()).a(blockList, blockposition2, iblockdata) != FluidTypes.a) { + if (iblockdata.getBlock() instanceof IFluidSource && ((IFluidSource) iblockdata.getBlock()).removeFluid(blockList, blockposition2, iblockdata) != FluidTypes.EMPTY) {
+ // NOP + // NOP
+ } else if (iblockdata.getBlock() instanceof BlockFluids) { + } else if (iblockdata.getBlock() instanceof BlockFluids) {
+ // NOP + // NOP

View File

@ -1,7 +1,7 @@
--- a/net/minecraft/server/BlockVine.java --- a/net/minecraft/server/BlockVine.java
+++ b/net/minecraft/server/BlockVine.java +++ b/net/minecraft/server/BlockVine.java
@@ -7,6 +7,8 @@ @@ -6,6 +6,8 @@
import java.util.function.Predicate; import java.util.Map.Entry;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit +import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
@ -9,7 +9,7 @@
public class BlockVine extends Block { public class BlockVine extends Block {
public static final BlockStateBoolean UP = BlockSprawling.p; public static final BlockStateBoolean UP = BlockSprawling.p;
@@ -183,20 +185,24 @@ @@ -182,20 +184,24 @@
BlockPosition blockposition3 = blockposition2.shift(enumdirection1); BlockPosition blockposition3 = blockposition2.shift(enumdirection1);
BlockPosition blockposition4 = blockposition2.shift(enumdirection2); BlockPosition blockposition4 = blockposition2.shift(enumdirection2);
@ -39,7 +39,7 @@
} }
} else if (this.b((IBlockAccess) world, blockposition2, enumdirection)) { } else if (this.b((IBlockAccess) world, blockposition2, enumdirection)) {
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(getDirection(enumdirection), true), 2); world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(getDirection(enumdirection), true), 2);
@@ -226,7 +232,7 @@ @@ -225,7 +231,7 @@
} }
if (this.x(iblockdata3)) { if (this.x(iblockdata3)) {
@ -48,7 +48,7 @@
} }
return; return;
@@ -241,7 +247,7 @@ @@ -240,7 +246,7 @@
IBlockData iblockdata5 = this.a(iblockdata, iblockdata4, random); IBlockData iblockdata5 = this.a(iblockdata, iblockdata4, random);
if (iblockdata4 != iblockdata5 && this.x(iblockdata5)) { if (iblockdata4 != iblockdata5 && this.x(iblockdata5)) {

View File

@ -1,8 +1,8 @@
--- a/net/minecraft/server/BossBattleCustom.java --- a/net/minecraft/server/BossBattleCustom.java
+++ b/net/minecraft/server/BossBattleCustom.java +++ b/net/minecraft/server/BossBattleCustom.java
@@ -8,12 +8,27 @@ @@ -6,12 +6,27 @@
import java.util.Set;
import java.util.UUID; import java.util.UUID;
import java.util.function.Consumer;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.boss.KeyedBossBar; +import org.bukkit.boss.KeyedBossBar;

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/Chunk.java --- a/net/minecraft/server/Chunk.java
+++ b/net/minecraft/server/Chunk.java +++ b/net/minecraft/server/Chunk.java
@@ -22,6 +22,13 @@ @@ -21,6 +21,13 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -14,7 +14,7 @@
public class Chunk implements IChunkAccess { public class Chunk implements IChunkAccess {
private static final Logger d = LogManager.getLogger(); private static final Logger d = LogManager.getLogger();
@@ -57,6 +64,35 @@ @@ -56,6 +63,35 @@
private final AtomicInteger E; private final AtomicInteger E;
private final ChunkCoordIntPair F; private final ChunkCoordIntPair F;
@ -50,7 +50,7 @@
public Chunk(World world, int i, int j, BiomeBase[] abiomebase, ChunkConverter chunkconverter, TickList<Block> ticklist, TickList<FluidType> ticklist1, long k) { public Chunk(World world, int i, int j, BiomeBase[] abiomebase, ChunkConverter chunkconverter, TickList<Block> ticklist, TickList<FluidType> ticklist1, long k) {
this.sections = new ChunkSection[16]; this.sections = new ChunkSection[16];
this.g = new boolean[256]; this.g = new boolean[256];
@@ -95,8 +131,16 @@ @@ -94,8 +130,16 @@
this.s = ticklist; this.s = ticklist;
this.t = ticklist1; this.t = ticklist1;
this.z = k; this.z = k;
@ -67,17 +67,7 @@
public Chunk(World world, ProtoChunk protochunk, int i, int j) { public Chunk(World world, ProtoChunk protochunk, int i, int j) {
this(world, i, j, protochunk.getBiomeIndex(), protochunk.v(), protochunk.k(), protochunk.l(), protochunk.m()); this(world, i, j, protochunk.getBiomeIndex(), protochunk.v(), protochunk.k(), protochunk.l(), protochunk.m());
@@ -136,14 +180,15 @@ @@ -143,6 +187,7 @@
HeightMap.Type heightmap_type = (HeightMap.Type) iterator.next();
if (heightmap_type.c() == HeightMap.Use.LIVE_WORLD) {
- ((HeightMap) this.heightMap.computeIfAbsent(heightmap_type, (heightmap_type) -> {
- return new HeightMap(this, heightmap_type);
+ ((HeightMap) this.heightMap.computeIfAbsent(heightmap_type, (heightmap_type1) -> { // CraftBukkit - decompile error
+ return new HeightMap(this, heightmap_type1); // CraftBukkit - decompile error
})).a(protochunk.b(heightmap_type).b());
}
}
this.x = true; this.x = true;
this.a(ChunkStatus.FULLCHUNK); this.a(ChunkStatus.FULLCHUNK);
@ -85,7 +75,7 @@
} }
public Set<BlockPosition> t() { public Set<BlockPosition> t() {
@@ -413,8 +458,15 @@ @@ -412,8 +457,15 @@
} }
} }
@ -101,7 +91,7 @@
int i = blockposition.getX() & 15; int i = blockposition.getX() & 15;
int j = blockposition.getY(); int j = blockposition.getY();
int k = blockposition.getZ() & 15; int k = blockposition.getZ() & 15;
@@ -474,7 +526,8 @@ @@ -473,7 +525,8 @@
} }
} }
@ -111,7 +101,7 @@
iblockdata.onPlace(this.world, blockposition, iblockdata1); iblockdata.onPlace(this.world, blockposition, iblockdata1);
} }
@@ -654,7 +707,12 @@ @@ -653,7 +706,12 @@
@Nullable @Nullable
public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) { public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) {
@ -125,7 +115,7 @@
if (tileentity == null) { if (tileentity == null) {
NBTTagCompound nbttagcompound = (NBTTagCompound) this.h.remove(blockposition); NBTTagCompound nbttagcompound = (NBTTagCompound) this.h.remove(blockposition);
@@ -701,6 +759,13 @@ @@ -700,6 +758,13 @@
tileentity.z(); tileentity.z();
this.tileEntities.put(blockposition.h(), tileentity); this.tileEntities.put(blockposition.h(), tileentity);
@ -139,14 +129,11 @@
} }
} }
@@ -726,13 +791,55 @@ @@ -727,11 +792,53 @@
int i = aentityslice.length;
for (int j = 0; j < i; ++j) { for (int j = 0; j < i; ++j) {
- EntitySlice entityslice = aentityslice[j]; EntitySlice<Entity> entityslice = aentityslice[j];
+ // CraftBukkit start
+ EntitySlice<Entity> entityslice = aentityslice[j];
+ // CraftBukkit start
+ List<Entity> toRemove = new LinkedList<>(); + List<Entity> toRemove = new LinkedList<>();
this.world.a(entityslice.stream().filter((entity) -> { this.world.a(entityslice.stream().filter((entity) -> {
+ if (this.needsDecoration && !CraftEventFactory.doEntityAddEventCalling(this.world, entity, CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) { // Only call for new chunks + if (this.needsDecoration && !CraftEventFactory.doEntityAddEventCalling(this.world, entity, CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) { // Only call for new chunks
@ -196,11 +183,11 @@
} }
public void removeEntities() { public void removeEntities() {
@@ -749,9 +856,21 @@ @@ -748,9 +855,21 @@
int i = aentityslice.length; int i = aentityslice.length;
for (int j = 0; j < i; ++j) { for (int j = 0; j < i; ++j) {
- EntitySlice entityslice = aentityslice[j]; - EntitySlice<Entity> entityslice = aentityslice[j];
+ // CraftBukkit start + // CraftBukkit start
+ List<Entity> newList = Lists.newArrayList(aentityslice[j]); + List<Entity> newList = Lists.newArrayList(aentityslice[j]);
+ java.util.Iterator<Entity> iter = newList.iterator(); + java.util.Iterator<Entity> iter = newList.iterator();
@ -220,49 +207,28 @@
} }
} }
@@ -813,8 +932,8 @@ @@ -810,7 +929,7 @@
Iterator iterator = this.entitySlices[k].c(oclass).iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); - T t0 = (Entity) iterator.next();
+ T t0 = (T) iterator.next(); // CraftBukkit - decompile error
- if (entity.getBoundingBox().c(axisalignedbb) && (predicate == null || predicate.test(entity))) { if (t0.getBoundingBox().c(axisalignedbb) && (predicate == null || predicate.test(t0))) {
- list.add(entity); list.add(t0);
+ if (entity.getBoundingBox().c(axisalignedbb) && (predicate == null || predicate.test((T) entity))) { // CraftBukkit - fix decompile error @@ -1073,13 +1192,13 @@
+ list.add((T) entity); // Fix decompile error
}
}
}
@@ -1020,13 +1139,13 @@
@Nullable
public LongSet b(String s) {
- return (LongSet) this.q.computeIfAbsent(s, (s) -> {
+ return (LongSet) this.q.computeIfAbsent(s, (s1) -> { // CraftBukkit - decompile error
return new LongOpenHashSet();
});
}
public void a(String s, long i) {
- ((LongSet) this.q.computeIfAbsent(s, (s) -> {
+ ((LongSet) this.q.computeIfAbsent(s, (s1) -> { // CraftBukkit - decompile error
return new LongOpenHashSet();
})).add(i);
}
@@ -1074,14 +1193,14 @@
} }
if (this.s instanceof ProtoChunkTickList) { if (this.s instanceof ProtoChunkTickList) {
- ((ProtoChunkTickList) this.s).a(this.world.getBlockTickList(), (blockposition) -> { - ((ProtoChunkTickList) this.s).a(this.world.getBlockTickList(), (blockposition1) -> {
- return this.world.getType(blockposition).getBlock();
+ ((ProtoChunkTickList<Block>) this.s).a(this.world.getBlockTickList(), (blockposition1) -> { // CraftBukkit - decompile error + ((ProtoChunkTickList<Block>) this.s).a(this.world.getBlockTickList(), (blockposition1) -> { // CraftBukkit - decompile error
+ return this.world.getType(blockposition1).getBlock(); return this.world.getType(blockposition1).getBlock();
}); });
} }
if (this.t instanceof ProtoChunkTickList) { if (this.t instanceof ProtoChunkTickList) {
- ((ProtoChunkTickList) this.t).a(this.world.getFluidTickList(), (blockposition) -> { - ((ProtoChunkTickList) this.t).a(this.world.getFluidTickList(), (blockposition1) -> {
- return this.world.getFluid(blockposition).c();
+ ((ProtoChunkTickList<FluidType>) this.t).a(this.world.getFluidTickList(), (blockposition1) -> { // CraftBukkit - decompile error + ((ProtoChunkTickList<FluidType>) this.t).a(this.world.getFluidTickList(), (blockposition1) -> { // CraftBukkit - decompile error
+ return this.world.getFluid(blockposition1).c(); return this.world.getFluid(blockposition1).c();
}); });
} }

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/ChunkProviderServer.java --- a/net/minecraft/server/ChunkProviderServer.java
+++ b/net/minecraft/server/ChunkProviderServer.java +++ b/net/minecraft/server/ChunkProviderServer.java
@@ -18,6 +18,11 @@ @@ -16,6 +16,11 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -12,39 +12,16 @@
public class ChunkProviderServer implements IChunkProvider { public class ChunkProviderServer implements IChunkProvider {
private static final Logger a = LogManager.getLogger(); private static final Logger a = LogManager.getLogger();
@@ -36,7 +41,7 @@ @@ -34,7 +39,7 @@
this.chunkLoader = ichunkloader; this.chunkLoader = ichunkloader;
this.chunkGenerator = chunkgenerator; this.chunkGenerator = chunkgenerator;
this.asyncTaskHandler = iasynctaskhandler; this.asyncTaskHandler = iasynctaskhandler;
- this.chunkScheduler = new ChunkTaskScheduler(2, worldserver, chunkgenerator, ichunkloader, iasynctaskhandler); - this.chunkScheduler = new ChunkTaskScheduler(2, worldserver, chunkgenerator, ichunkloader, iasynctaskhandler);
+ this.chunkScheduler = new ChunkTaskScheduler(0, worldserver, chunkgenerator, ichunkloader, iasynctaskhandler); // CraftBukkit - very buggy, broken in lots of __subtle__ ways. Same goes for async chunk loading. Also Bukkit API / plugins can't handle async events at all anyway. + this.chunkScheduler = new ChunkTaskScheduler(0, worldserver, chunkgenerator, ichunkloader, iasynctaskhandler); // CraftBukkit - very buggy, broken in lots of __subtle__ ways. Same goes for async chunk loading. Also Bukkit API / plugins can't handle async events at all anyway.
this.batchScheduler = new SchedulerBatch(this.chunkScheduler); this.batchScheduler = new SchedulerBatch<>(this.chunkScheduler);
} }
@@ -86,9 +91,10 @@ @@ -112,6 +117,22 @@
if (flag) {
try {
- chunk = this.chunkLoader.a(this.world, i, j, (chunk) -> {
- chunk.setLastSaved(this.world.getTime());
- this.chunks.put(ChunkCoordIntPair.a(i, j), chunk);
+ // CraftBukkit - decompile error
+ chunk = this.chunkLoader.a(this.world, i, j, (chunk1) -> {
+ chunk1.setLastSaved(this.world.getTime());
+ this.chunks.put(ChunkCoordIntPair.a(i, j), chunk1);
});
} catch (Exception exception) {
ChunkProviderServer.a.error("Couldn't load chunk", exception);
@@ -103,7 +109,7 @@
try {
this.batchScheduler.b();
this.batchScheduler.a(new ChunkCoordIntPair(i, j));
- CompletableFuture completablefuture = this.batchScheduler.c();
+ CompletableFuture<ProtoChunk> completablefuture = this.batchScheduler.c(); // CraftBukkit - decompile error
return (Chunk) completablefuture.thenApply(this::a).join();
} catch (RuntimeException runtimeexception) {
@@ -114,6 +120,22 @@
} }
} }
@ -67,7 +44,7 @@
public IChunkAccess a(int i, int j, boolean flag) { public IChunkAccess a(int i, int j, boolean flag) {
Chunk chunk = this.getChunkAt(i, j, true, false); Chunk chunk = this.getChunkAt(i, j, true, false);
@@ -251,10 +273,12 @@ @@ -249,10 +270,12 @@
Chunk chunk = (Chunk) this.chunks.get(olong); Chunk chunk = (Chunk) this.chunks.get(olong);
if (chunk != null) { if (chunk != null) {
@ -84,7 +61,7 @@
++i; ++i;
} }
} }
@@ -267,6 +291,42 @@ @@ -265,6 +288,42 @@
return false; return false;
} }

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/ChunkRegionLoader.java --- a/net/minecraft/server/ChunkRegionLoader.java
+++ b/net/minecraft/server/ChunkRegionLoader.java +++ b/net/minecraft/server/ChunkRegionLoader.java
@@ -31,7 +31,7 @@ @@ -29,7 +29,7 @@
private final File c; private final File c;
private final DataFixer d; private final DataFixer d;
private PersistentStructureLegacy e; private PersistentStructureLegacy e;
@ -9,7 +9,7 @@
public ChunkRegionLoader(File file, DataFixer datafixer) { public ChunkRegionLoader(File file, DataFixer datafixer) {
this.c = file; this.c = file;
@@ -40,25 +40,64 @@ @@ -38,25 +38,64 @@
@Nullable @Nullable
private NBTTagCompound a(GeneratorAccess generatoraccess, int i, int j) throws IOException { private NBTTagCompound a(GeneratorAccess generatoraccess, int i, int j) throws IOException {
@ -81,7 +81,7 @@
if (k < 1493) { if (k < 1493) {
nbttagcompound1 = GameProfileSerializer.a(this.d, DataFixTypes.CHUNK, nbttagcompound1, k, 1493); nbttagcompound1 = GameProfileSerializer.a(this.d, DataFixTypes.CHUNK, nbttagcompound1, k, 1493);
@@ -86,13 +125,29 @@ @@ -84,13 +123,29 @@
} }
@ -111,7 +111,7 @@
Chunk chunk = this.a(generatoraccess, i, j, nbttagcompound); Chunk chunk = this.a(generatoraccess, i, j, nbttagcompound);
if (chunk != null) { if (chunk != null) {
@@ -101,6 +156,9 @@ @@ -99,6 +154,9 @@
} }
return chunk; return chunk;
@ -121,7 +121,7 @@
} }
} }
@@ -132,7 +190,7 @@ @@ -130,7 +188,7 @@
} }
@Nullable @Nullable
@ -130,7 +130,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);
@@ -151,10 +209,28 @@ @@ -149,10 +207,28 @@
ChunkRegionLoader.a.error("Chunk file at {},{} is in the wrong location; relocating. (Expected {}, {}, got {}, {})", i, j, i, j, chunk.locX, chunk.locZ); ChunkRegionLoader.a.error("Chunk file at {},{} is in the wrong location; relocating. (Expected {}, {}, got {}, {})", i, j, i, j, chunk.locX, chunk.locZ);
nbttagcompound1.setInt("xPos", i); nbttagcompound1.setInt("xPos", i);
nbttagcompound1.setInt("zPos", j); nbttagcompound1.setInt("zPos", j);
@ -160,7 +160,7 @@
} }
} }
} else { } else {
@@ -169,7 +245,7 @@ @@ -167,7 +243,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) {
@ -169,24 +169,24 @@
} else { } else {
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Level"); NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Level");
@@ -217,10 +293,14 @@ @@ -215,10 +291,15 @@
} }
public boolean a() { public boolean a() {
- Iterator iterator = this.b.entrySet().iterator();
+ // CraftBukkit start + // CraftBukkit start
+ return this.processSaveQueueEntry(false); + return this.processSaveQueueEntry(false);
+ } + }
+
+ private boolean processSaveQueueEntry(boolean logCompletion) { + private boolean processSaveQueueEntry(boolean logCompletion) {
+ Iterator iterator = this.b.entrySet().iterator(); Iterator<Entry<ChunkCoordIntPair, NBTTagCompound>> iterator = this.b.entrySet().iterator();
if (!iterator.hasNext()) { if (!iterator.hasNext()) {
- if (this.f) { - if (this.f) {
+ if (logCompletion) { // CraftBukkit + if (logCompletion) { // CraftBukkit
ChunkRegionLoader.a.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.c.getName()); ChunkRegionLoader.a.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.c.getName());
} }
@@ -236,10 +316,14 @@ @@ -234,10 +315,14 @@
return true; return true;
} else { } else {
try { try {
@ -202,7 +202,7 @@
if (this.e != null) { if (this.e != null) {
this.e.a(chunkcoordintpair.a()); this.e.a(chunkcoordintpair.a());
} }
@@ -266,15 +350,16 @@ @@ -264,15 +349,16 @@
public void b() { public void b() {
try { try {
@ -222,7 +222,7 @@
} }
} }
@@ -303,7 +388,7 @@ @@ -301,7 +387,7 @@
if (abiomebase != null) { if (abiomebase != null) {
for (int k = 0; k < abiomebase.length; ++k) { for (int k = 0; k < abiomebase.length; ++k) {
@ -231,7 +231,7 @@
} }
} }
@@ -385,7 +470,7 @@ @@ -383,7 +469,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) {
@ -240,41 +240,7 @@
} }
nbttagcompound.setIntArray("Biomes", aint); nbttagcompound.setIntArray("Biomes", aint);
@@ -487,27 +572,27 @@ @@ -833,17 +919,29 @@
}
ChunkConverter chunkconverter = nbttagcompound.hasKeyOfType("UpgradeData", 10) ? new ChunkConverter(nbttagcompound.getCompound("UpgradeData")) : ChunkConverter.a;
- Predicate predicate = (block) -> {
+ Predicate<Block> predicate = (block) -> { // CraftBukkit - decompile error
return block.getBlockData().isAir();
};
IRegistry iregistry = IRegistry.BLOCK;
IRegistry.BLOCK.getClass();
Function function = iregistry::getKey;
- IRegistry iregistry1 = IRegistry.BLOCK;
+ IRegistry<Block> iregistry1 = IRegistry.BLOCK; // CraftBukkit - decompile error
IRegistry.BLOCK.getClass();
- ProtoChunkTickList protochunkticklist = new ProtoChunkTickList(predicate, function, iregistry1::getOrDefault, new ChunkCoordIntPair(i, j));
+ ProtoChunkTickList protochunkticklist = new ProtoChunkTickList<>(predicate, function, iregistry1::getOrDefault, new ChunkCoordIntPair(i, j)); // CraftBukkit - decompile error
- predicate = (fluidtype) -> {
+ Predicate<FluidType> predicate1 = (fluidtype) -> { // CraftBukkit - decompile error
return fluidtype == FluidTypes.a;
};
iregistry = IRegistry.FLUID;
IRegistry.FLUID.getClass();
function = iregistry::getKey;
- iregistry1 = IRegistry.FLUID;
+ IRegistry<FluidType> iregistry2 = IRegistry.FLUID; // CraftBukkit - decompile error
IRegistry.FLUID.getClass();
- ProtoChunkTickList protochunkticklist1 = new ProtoChunkTickList(predicate, function, iregistry1::getOrDefault, new ChunkCoordIntPair(i, j));
+ ProtoChunkTickList protochunkticklist1 = new ProtoChunkTickList<>(predicate1, function, iregistry2::getOrDefault, new ChunkCoordIntPair(i, j)); // CraftBukkit - decompile error
long i1 = nbttagcompound.getLong("InhabitedTime");
Chunk chunk = new Chunk(generatoraccess.getMinecraftWorld(), i, j, abiomebase, chunkconverter, protochunkticklist, protochunkticklist1, i1);
@@ -850,17 +935,29 @@
} }
@Nullable @Nullable
@ -306,7 +272,7 @@
}); });
} }
@@ -874,8 +971,14 @@ @@ -857,8 +955,14 @@
} }
} }
@ -322,7 +288,7 @@
Iterator iterator = entity.bP().iterator(); Iterator iterator = entity.bP().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@@ -891,7 +994,7 @@ @@ -874,7 +978,7 @@
boolean flag = false; boolean flag = false;
try { try {

View File

@ -1,15 +1,6 @@
--- a/net/minecraft/server/ChunkTaskScheduler.java --- a/net/minecraft/server/ChunkTaskScheduler.java
+++ b/net/minecraft/server/ChunkTaskScheduler.java +++ b/net/minecraft/server/ChunkTaskScheduler.java
@@ -20,7 +20,7 @@ @@ -37,6 +37,12 @@
private final ChunkGenerator<?> d;
private final IChunkLoader e;
private final IAsyncTaskHandler f;
- private final Long2ObjectMap<Scheduler.a> progressCache = new ExpiringMap(8192, 5000) {
+ private final Long2ObjectMap<Scheduler.a> progressCache = new ExpiringMap<Scheduler.a>(8192, 5000) { // CraftBukkit - decompile error
protected boolean a(Scheduler.a scheduler_a) {
ProtoChunk protochunk = (ProtoChunk) scheduler_a.a();
@@ -40,6 +40,12 @@
this.f = iasynctaskhandler; this.f = iasynctaskhandler;
} }
@ -20,5 +11,5 @@
+ // CraftBukkit end + // CraftBukkit end
+ +
@Nullable @Nullable
protected Scheduler.a a(ChunkCoordIntPair chunkcoordintpair, boolean flag) { protected Scheduler<ChunkCoordIntPair, ChunkStatus, ProtoChunk>.a a(ChunkCoordIntPair chunkcoordintpair, boolean flag) {
IChunkLoader ichunkloader = this.e; IChunkLoader ichunkloader = this.e;

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/CommandBlockListenerAbstract.java --- a/net/minecraft/server/CommandBlockListenerAbstract.java
+++ b/net/minecraft/server/CommandBlockListenerAbstract.java +++ b/net/minecraft/server/CommandBlockListenerAbstract.java
@@ -5,6 +5,7 @@ @@ -4,6 +4,7 @@
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -8,7 +8,7 @@
public abstract class CommandBlockListenerAbstract implements ICommandListener { public abstract class CommandBlockListenerAbstract implements ICommandListener {
@@ -16,6 +17,10 @@ @@ -15,6 +16,10 @@
private IChatBaseComponent f; private IChatBaseComponent f;
private String g = ""; private String g = "";
private IChatBaseComponent h = new ChatComponentText("@"); private IChatBaseComponent h = new ChatComponentText("@");
@ -19,7 +19,7 @@
public CommandBlockListenerAbstract() {} public CommandBlockListenerAbstract() {}
@@ -103,14 +108,7 @@ @@ -102,14 +107,7 @@
if (minecraftserver != null && minecraftserver.D() && minecraftserver.getEnableCommandBlock() && !UtilColor.b(this.g)) { if (minecraftserver != null && minecraftserver.D() && minecraftserver.getEnableCommandBlock() && !UtilColor.b(this.g)) {
try { try {
this.f = null; this.f = null;
@ -35,7 +35,7 @@
} catch (Throwable throwable) { } catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Executing command block"); CrashReport crashreport = CrashReport.a(throwable, "Executing command block");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Command to be executed"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Command to be executed");
@@ -141,6 +139,11 @@ @@ -140,6 +138,11 @@
} }
public void setName(IChatBaseComponent ichatbasecomponent) { public void setName(IChatBaseComponent ichatbasecomponent) {

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/CommandDebug.java --- a/net/minecraft/server/CommandDebug.java
+++ b/net/minecraft/server/CommandDebug.java +++ b/net/minecraft/server/CommandDebug.java
@@ -35,6 +35,14 @@ @@ -33,6 +33,14 @@
} }
private static int a(CommandListenerWrapper commandlistenerwrapper) throws CommandSyntaxException { private static int a(CommandListenerWrapper commandlistenerwrapper) throws CommandSyntaxException {
@ -15,7 +15,7 @@
MinecraftServer minecraftserver = commandlistenerwrapper.getServer(); MinecraftServer minecraftserver = commandlistenerwrapper.getServer();
MethodProfiler methodprofiler = minecraftserver.methodProfiler; MethodProfiler methodprofiler = minecraftserver.methodProfiler;
@@ -48,6 +56,14 @@ @@ -46,6 +54,14 @@
} }
private static int b(CommandListenerWrapper commandlistenerwrapper) throws CommandSyntaxException { private static int b(CommandListenerWrapper commandlistenerwrapper) throws CommandSyntaxException {

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/CommandDispatcher.java --- a/net/minecraft/server/CommandDispatcher.java
+++ b/net/minecraft/server/CommandDispatcher.java +++ b/net/minecraft/server/CommandDispatcher.java
@@ -27,12 +27,21 @@ @@ -22,12 +22,21 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -23,7 +23,7 @@
CommandAdvancement.a(this.b); CommandAdvancement.a(this.b);
CommandExecute.a(this.b); CommandExecute.a(this.b);
CommandBossBar.a(this.b); CommandBossBar.a(this.b);
@@ -100,8 +109,13 @@ @@ -95,8 +104,13 @@
} }
this.b.findAmbiguities((commandnode, commandnode1, commandnode2, collection) -> { this.b.findAmbiguities((commandnode, commandnode1, commandnode2, collection) -> {
@ -35,10 +35,10 @@
+ +
+ public CommandDispatcher() { + public CommandDispatcher() {
+ // CraftBukkit end + // CraftBukkit end
this.b.setConsumer((commandcontext, flag, i) -> { this.b.setConsumer((commandcontext, flag1, i) -> {
((CommandListenerWrapper) commandcontext.getSource()).a(commandcontext, flag, i); ((CommandListenerWrapper) commandcontext.getSource()).a(commandcontext, flag1, i);
}); });
@@ -116,7 +130,47 @@ @@ -111,7 +125,47 @@
} }
@ -85,8 +85,8 @@
+ // CraftBukkit end + // CraftBukkit end
StringReader stringreader = new StringReader(s); StringReader stringreader = new StringReader(s);
if(stringreader.canRead() && stringreader.peek() == 47) { if (stringreader.canRead() && stringreader.peek() == '/') {
@@ -128,7 +182,6 @@ @@ -123,7 +177,6 @@
byte b0; byte b0;
try { try {
@ -94,7 +94,7 @@
ChatComponentText chatcomponenttext; ChatComponentText chatcomponenttext;
try { try {
@@ -137,52 +190,56 @@ @@ -132,52 +185,56 @@
return i; return i;
} catch (CommandException commandexception) { } catch (CommandException commandexception) {
commandlistenerwrapper.sendFailureMessage(commandexception.a()); commandlistenerwrapper.sendFailureMessage(commandexception.a());
@ -104,21 +104,21 @@
+ return b0; + return b0;
} catch (CommandSyntaxException commandsyntaxexception) { } catch (CommandSyntaxException commandsyntaxexception) {
commandlistenerwrapper.sendFailureMessage(ChatComponentUtils.a(commandsyntaxexception.getRawMessage())); commandlistenerwrapper.sendFailureMessage(ChatComponentUtils.a(commandsyntaxexception.getRawMessage()));
if(commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) { if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) {
int j = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor()); int j = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor());
- IChatBaseComponent ichatbasecomponent = (new ChatComponentText("")).a(EnumChatFormat.GRAY).a((chatmodifier) -> { - IChatBaseComponent ichatbasecomponent = (new ChatComponentText("")).a(EnumChatFormat.GRAY).a((chatmodifier) -> {
- chatmodifier.setChatClickable(new ChatClickable(ChatClickable.EnumClickAction.SUGGEST_COMMAND, s)); - chatmodifier.setChatClickable(new ChatClickable(ChatClickable.EnumClickAction.SUGGEST_COMMAND, s));
- }); - });
+ chatcomponenttext = new ChatComponentText(""); + chatcomponenttext = new ChatComponentText("");
if(j > 10) { if (j > 10) {
- ichatbasecomponent.a("..."); - ichatbasecomponent.a("...");
+ chatcomponenttext.a("..."); + chatcomponenttext.a("...");
} }
- ichatbasecomponent.a(commandsyntaxexception.getInput().substring(Math.max(0, j - 10), j)); - ichatbasecomponent.a(commandsyntaxexception.getInput().substring(Math.max(0, j - 10), j));
+ chatcomponenttext.a(commandsyntaxexception.getInput().substring(Math.max(0, j - 10), j)); + chatcomponenttext.a(commandsyntaxexception.getInput().substring(Math.max(0, j - 10), j));
if(j < commandsyntaxexception.getInput().length()) { if (j < commandsyntaxexception.getInput().length()) {
- IChatBaseComponent ichatbasecomponent1 = (new ChatComponentText(commandsyntaxexception.getInput().substring(j))).a(new EnumChatFormat[]{EnumChatFormat.RED, EnumChatFormat.UNDERLINE}); - IChatBaseComponent ichatbasecomponent1 = (new ChatComponentText(commandsyntaxexception.getInput().substring(j))).a(new EnumChatFormat[]{EnumChatFormat.RED, EnumChatFormat.UNDERLINE});
+ ChatComponentText chatcomponenttext1 = new ChatComponentText(commandsyntaxexception.getInput().substring(j)); + ChatComponentText chatcomponenttext1 = new ChatComponentText(commandsyntaxexception.getInput().substring(j));
@ -147,11 +147,11 @@
- chatcomponenttext = new ChatComponentText; - chatcomponenttext = new ChatComponentText;
- } - }
- -
- chatcomponenttext.<init>(exception.getMessage() == null?exception.getClass().getName():exception.getMessage()); - chatcomponenttext.<init>(exception.getMessage() == null ? exception.getClass().getName() : exception.getMessage());
- ChatComponentText chatcomponenttext1 = chatcomponenttext; - ChatComponentText chatcomponenttext1 = chatcomponenttext;
+ ChatMessage chatmessage1 = new ChatMessage("command.failed", new Object[0]); + ChatMessage chatmessage1 = new ChatMessage("command.failed", new Object[0]);
- if(CommandDispatcher.a.isDebugEnabled()) { - if (CommandDispatcher.a.isDebugEnabled()) {
- StackTraceElement[] astacktraceelement = exception.getStackTrace(); - StackTraceElement[] astacktraceelement = exception.getStackTrace();
+ chatcomponenttext = new ChatComponentText(exception.getMessage() == null ? exception.getClass().getName() : exception.getMessage()); + chatcomponenttext = new ChatComponentText(exception.getMessage() == null ? exception.getClass().getName() : exception.getMessage());
+ if (CommandDispatcher.a.isDebugEnabled()) { + if (CommandDispatcher.a.isDebugEnabled()) {
@ -166,7 +166,7 @@
- } - }
- commandlistenerwrapper.sendFailureMessage((new ChatMessage("command.failed", new Object[0])).a((chatmodifier) -> { - commandlistenerwrapper.sendFailureMessage((new ChatMessage("command.failed", new Object[0])).a((chatmodifier) -> {
- chatmodifier.setChatHoverable(new ChatHoverable(ChatHoverable.EnumHoverAction.SHOW_TEXT, ichatbasecomponent)); - chatmodifier.setChatHoverable(new ChatHoverable(ChatHoverable.EnumHoverAction.SHOW_TEXT, chatcomponenttext1));
- })); - }));
- b0 = 0; - b0 = 0;
+ chatmessage1.getChatModifier().setChatHoverable(new ChatHoverable(ChatHoverable.EnumHoverAction.SHOW_TEXT, chatcomponenttext)); + chatmessage1.getChatModifier().setChatHoverable(new ChatHoverable(ChatHoverable.EnumHoverAction.SHOW_TEXT, chatcomponenttext));
@ -178,26 +178,25 @@
} finally { } finally {
commandlistenerwrapper.getServer().methodProfiler.exit(); commandlistenerwrapper.getServer().methodProfiler.exit();
} }
@@ -191,11 +248,36 @@ @@ -186,11 +243,36 @@
} }
public void a(EntityPlayer entityplayer) { public void a(EntityPlayer entityplayer) {
- HashMap hashmap = Maps.newHashMap(); - Map<CommandNode<CommandListenerWrapper>, CommandNode<ICompletionProvider>> map = Maps.newHashMap();
- RootCommandNode rootcommandnode = new RootCommandNode();
+ // CraftBukkit start + // CraftBukkit start
+ // Register Vanilla commands into builtRoot as before + // Register Vanilla commands into builtRoot as before
+ Map hashmap = Maps.newIdentityHashMap(); // Use identity to prevent aliasing issues + Map<CommandNode<CommandListenerWrapper>, CommandNode<ICompletionProvider>> map = Maps.newIdentityHashMap(); // Use identity to prevent aliasing issues
+ RootCommandNode vanillaRoot = new RootCommandNode(); + RootCommandNode vanillaRoot = new RootCommandNode();
+ +
+ RootCommandNode<CommandListenerWrapper> vanilla = entityplayer.server.vanillaCommandDispatcher.a().getRoot(); + RootCommandNode<CommandListenerWrapper> vanilla = entityplayer.server.vanillaCommandDispatcher.a().getRoot();
+ hashmap.put(vanilla, vanillaRoot); + map.put(vanilla, vanillaRoot);
+ this.a(vanilla, vanillaRoot, entityplayer.getCommandListener(), (Map) hashmap); + this.a(vanilla, vanillaRoot, entityplayer.getCommandListener(), (Map) map);
+ +
+ // Now build the global commands in a second pass + // Now build the global commands in a second pass
+ RootCommandNode<ICompletionProvider> rootcommandnode = new RootCommandNode(); RootCommandNode<ICompletionProvider> rootcommandnode = new RootCommandNode();
hashmap.put(this.b.getRoot(), rootcommandnode); map.put(this.b.getRoot(), rootcommandnode);
this.a(this.b.getRoot(), rootcommandnode, entityplayer.getCommandListener(), (Map) hashmap); this.a(this.b.getRoot(), rootcommandnode, entityplayer.getCommandListener(), (Map) map);
+ +
+ Collection<String> bukkit = new LinkedHashSet<>(); + Collection<String> bukkit = new LinkedHashSet<>();
+ for (CommandNode node : rootcommandnode.getChildren()) { + for (CommandNode node : rootcommandnode.getChildren()) {
@ -217,3 +216,21 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutCommands(rootcommandnode)); entityplayer.playerConnection.sendPacket(new PacketPlayOutCommands(rootcommandnode));
} }
@@ -201,7 +283,7 @@
CommandNode<CommandListenerWrapper> commandnode2 = (CommandNode) iterator.next();
if (commandnode2.canUse(commandlistenerwrapper)) {
- ArgumentBuilder<ICompletionProvider, ?> argumentbuilder = commandnode2.createBuilder();
+ ArgumentBuilder argumentbuilder = commandnode2.createBuilder(); // CraftBukkit - decompile error
argumentbuilder.requires((icompletionprovider) -> {
return true;
@@ -224,7 +306,7 @@
argumentbuilder.redirect((CommandNode) map.get(argumentbuilder.getRedirect()));
}
- CommandNode<ICompletionProvider> commandnode3 = argumentbuilder.build();
+ CommandNode commandnode3 = argumentbuilder.build(); // CraftBukkit - decompile error
map.put(commandnode2, commandnode3);
commandnode1.addChild(commandnode3);

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/CommandEffect.java --- a/net/minecraft/server/CommandEffect.java
+++ b/net/minecraft/server/CommandEffect.java +++ b/net/minecraft/server/CommandEffect.java
@@ -62,7 +62,7 @@ @@ -60,7 +60,7 @@
if (entity instanceof EntityLiving) { if (entity instanceof EntityLiving) {
MobEffect mobeffect = new MobEffect(mobeffectlist, k, i, false, flag); MobEffect mobeffect = new MobEffect(mobeffectlist, k, i, false, flag);
@ -9,7 +9,7 @@
++j; ++j;
} }
} }
@@ -88,7 +88,7 @@ @@ -86,7 +86,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
@ -18,7 +18,7 @@
++i; ++i;
} }
} }
@@ -113,7 +113,7 @@ @@ -111,7 +111,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/CommandForceload.java --- a/net/minecraft/server/CommandForceload.java
+++ b/net/minecraft/server/CommandForceload.java +++ b/net/minecraft/server/CommandForceload.java
@@ -47,7 +47,7 @@ @@ -43,7 +43,7 @@
private static int a(CommandListenerWrapper commandlistenerwrapper, ArgumentVec2I.a argumentvec2i_a) throws CommandSyntaxException { private static int a(CommandListenerWrapper commandlistenerwrapper, ArgumentVec2I.a argumentvec2i_a) throws CommandSyntaxException {
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(argumentvec2i_a.a >> 4, argumentvec2i_a.b >> 4); ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(argumentvec2i_a.a >> 4, argumentvec2i_a.b >> 4);
@ -9,7 +9,7 @@
boolean flag = commandlistenerwrapper.getServer().getWorldServer(dimensionmanager).isForceLoaded(chunkcoordintpair.x, chunkcoordintpair.z); boolean flag = commandlistenerwrapper.getServer().getWorldServer(dimensionmanager).isForceLoaded(chunkcoordintpair.x, chunkcoordintpair.z);
if (flag) { if (flag) {
@@ -59,7 +59,7 @@ @@ -55,7 +55,7 @@
} }
private static int a(CommandListenerWrapper commandlistenerwrapper) { private static int a(CommandListenerWrapper commandlistenerwrapper) {
@ -18,7 +18,7 @@
LongSet longset = commandlistenerwrapper.getServer().getWorldServer(dimensionmanager).ag(); LongSet longset = commandlistenerwrapper.getServer().getWorldServer(dimensionmanager).ag();
int i = longset.size(); int i = longset.size();
@@ -79,12 +79,12 @@ @@ -75,11 +75,11 @@
} }
private static int b(CommandListenerWrapper commandlistenerwrapper) { private static int b(CommandListenerWrapper commandlistenerwrapper) {
@ -28,13 +28,11 @@
LongSet longset = worldserver.ag(); LongSet longset = worldserver.ag();
- longset.forEach((i) -> { - longset.forEach((i) -> {
- worldserver.setForceLoaded(ChunkCoordIntPair.a(i), ChunkCoordIntPair.b(i), false); + longset.forEach((java.util.function.LongConsumer) (i) -> { // CraftBukkit - decompile error
+ longset.forEach((LongConsumer) (ix) -> { // CraftBukkit - decompile error worldserver.setForceLoaded(ChunkCoordIntPair.a(i), ChunkCoordIntPair.b(i), false);
+ worldserver.setForceLoaded(ChunkCoordIntPair.a(ix), ChunkCoordIntPair.b(ix), false); // CraftBukkit - decompile error
}); });
commandlistenerwrapper.sendMessage(new ChatMessage("commands.forceload.removed.all", new Object[] { dimensionmanager}), true); commandlistenerwrapper.sendMessage(new ChatMessage("commands.forceload.removed.all", new Object[] { dimensionmanager}), true);
return 0; @@ -102,7 +102,7 @@
@@ -106,7 +106,7 @@
if (i2 > 256L) { if (i2 > 256L) {
throw CommandForceload.a.create(256, i2); throw CommandForceload.a.create(256, i2);
} else { } else {

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/CommandGamemode.java --- a/net/minecraft/server/CommandGamemode.java
+++ b/net/minecraft/server/CommandGamemode.java +++ b/net/minecraft/server/CommandGamemode.java
@@ -57,6 +57,12 @@ @@ -55,6 +55,12 @@
if (entityplayer.playerInteractManager.getGameMode() != enumgamemode) { if (entityplayer.playerInteractManager.getGameMode() != enumgamemode) {
entityplayer.a(enumgamemode); entityplayer.a(enumgamemode);

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/CommandGamerule.java --- a/net/minecraft/server/CommandGamerule.java
+++ b/net/minecraft/server/CommandGamerule.java +++ b/net/minecraft/server/CommandGamerule.java
@@ -29,7 +29,7 @@ @@ -27,7 +27,7 @@
} }
private static int a(CommandListenerWrapper commandlistenerwrapper, String s, CommandContext<CommandListenerWrapper> commandcontext) { private static int a(CommandListenerWrapper commandlistenerwrapper, String s, CommandContext<CommandListenerWrapper> commandcontext) {
@ -9,7 +9,7 @@
gamerules_gamerulevalue.getType().a(commandcontext, "value", gamerules_gamerulevalue); gamerules_gamerulevalue.getType().a(commandcontext, "value", gamerules_gamerulevalue);
commandlistenerwrapper.sendMessage(new ChatMessage("commands.gamerule.set", new Object[] { s, gamerules_gamerulevalue.a()}), true); commandlistenerwrapper.sendMessage(new ChatMessage("commands.gamerule.set", new Object[] { s, gamerules_gamerulevalue.a()}), true);
@@ -37,7 +37,7 @@ @@ -35,7 +35,7 @@
} }
private static int a(CommandListenerWrapper commandlistenerwrapper, String s) { private static int a(CommandListenerWrapper commandlistenerwrapper, String s) {

View File

@ -8,18 +8,14 @@
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Iterator; import java.util.Iterator;
@@ -31,9 +32,10 @@ @@ -31,6 +32,7 @@
private final ResultConsumer<CommandListenerWrapper> l; private final ResultConsumer<CommandListenerWrapper> l;
private final ArgumentAnchor.Anchor m; private final ArgumentAnchor.Anchor m;
private final Vec2F n; private final Vec2F n;
+ public CommandNode currentCommand; // CraftBukkit + public CommandNode currentCommand; // CraftBukkit
public CommandListenerWrapper(ICommandListener icommandlistener, Vec3D vec3d, Vec2F vec2f, WorldServer worldserver, int i, String s, IChatBaseComponent ichatbasecomponent, MinecraftServer minecraftserver, @Nullable Entity entity) { public CommandListenerWrapper(ICommandListener icommandlistener, Vec3D vec3d, Vec2F vec2f, WorldServer worldserver, int i, String s, IChatBaseComponent ichatbasecomponent, MinecraftServer minecraftserver, @Nullable Entity entity) {
- this(icommandlistener, vec3d, vec2f, worldserver, i, s, ichatbasecomponent, minecraftserver, entity, false, (commandcontext, flag, i) -> { this(icommandlistener, vec3d, vec2f, worldserver, i, s, ichatbasecomponent, minecraftserver, entity, false, (commandcontext, flag, j) -> {
+ this(icommandlistener, vec3d, vec2f, worldserver, i, s, ichatbasecomponent, minecraftserver, entity, false, (commandcontext, flag, ix) -> { // CraftBukkit - decompile error
}, ArgumentAnchor.Anchor.FEET);
}
@@ -119,6 +121,13 @@ @@ -119,6 +121,13 @@
} }

View File

@ -1,6 +1,15 @@
--- a/net/minecraft/server/CommandSpreadPlayers.java --- a/net/minecraft/server/CommandSpreadPlayers.java
+++ b/net/minecraft/server/CommandSpreadPlayers.java +++ b/net/minecraft/server/CommandSpreadPlayers.java
@@ -269,7 +269,7 @@ @@ -58,7 +58,7 @@
if (entity instanceof EntityHuman) {
set.add(entity.getScoreboardTeam());
} else {
- set.add((Object) null);
+ set.add((ScoreboardTeamBase) null); // CraftBukkit - decompile error
}
}
@@ -266,7 +266,7 @@
} }
blockposition = blockposition.down(); blockposition = blockposition.down();
@ -9,7 +18,7 @@
return blockposition.getY() + 1; return blockposition.getY() + 1;
} }
@@ -285,7 +285,7 @@ @@ -282,7 +282,7 @@
} }
blockposition = blockposition.down(); blockposition = blockposition.down();
@ -18,7 +27,7 @@
} while (iblockdata.isAir()); } while (iblockdata.isAir());
Material material = iblockdata.getMaterial(); Material material = iblockdata.getMaterial();
@@ -297,5 +297,12 @@ @@ -294,5 +294,12 @@
this.a = MathHelper.a(random, d0, d2); this.a = MathHelper.a(random, d0, d2);
this.b = MathHelper.a(random, d1, d3); this.b = MathHelper.a(random, d1, d3);
} }

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/CommandSummon.java --- a/net/minecraft/server/CommandSummon.java
+++ b/net/minecraft/server/CommandSummon.java +++ b/net/minecraft/server/CommandSummon.java
@@ -32,7 +32,7 @@ @@ -30,7 +30,7 @@
if (EntityTypes.getName(EntityTypes.LIGHTNING_BOLT).equals(minecraftkey)) { if (EntityTypes.getName(EntityTypes.LIGHTNING_BOLT).equals(minecraftkey)) {
EntityLightning entitylightning = new EntityLightning(commandlistenerwrapper.getWorld(), vec3d.x, vec3d.y, vec3d.z, false); EntityLightning entitylightning = new EntityLightning(commandlistenerwrapper.getWorld(), vec3d.x, vec3d.y, vec3d.z, false);

View File

@ -1,8 +1,8 @@
--- a/net/minecraft/server/CommandTeleport.java --- a/net/minecraft/server/CommandTeleport.java
+++ b/net/minecraft/server/CommandTeleport.java +++ b/net/minecraft/server/CommandTeleport.java
@@ -14,6 +14,11 @@ @@ -12,6 +12,11 @@
import java.util.Iterator;
import java.util.Set; import java.util.Set;
import java.util.function.Predicate;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.Location; +import org.bukkit.Location;
@ -12,7 +12,7 @@
public class CommandTeleport { public class CommandTeleport {
@@ -49,7 +54,7 @@ @@ -47,7 +52,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity1 = (Entity) iterator.next(); Entity entity1 = (Entity) iterator.next();
@ -21,7 +21,7 @@
} }
if (collection.size() == 1) { if (collection.size() == 1) {
@@ -120,9 +125,9 @@ @@ -118,9 +123,9 @@
} }
if (worldserver == entity.world) { if (worldserver == entity.world) {
@ -33,7 +33,7 @@
} }
entity.setHeadRotation(f); entity.setHeadRotation(f);
@@ -131,6 +136,21 @@ @@ -129,6 +134,21 @@
float f3 = MathHelper.g(f1); float f3 = MathHelper.g(f1);
f3 = MathHelper.a(f3, -90.0F, 90.0F); f3 = MathHelper.a(f3, -90.0F, 90.0F);

View File

@ -117,7 +117,7 @@
} else { } else {
@@ -176,25 +240,53 @@ @@ -176,25 +240,53 @@
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
List list = this.a(itemstack, i, this.costs[i]); List<WeightedRandomEnchant> list = this.a(itemstack, i, this.costs[i]);
- if (!list.isEmpty()) { - if (!list.isEmpty()) {
- entityhuman.enchantDone(itemstack, j); - entityhuman.enchantDone(itemstack, j);

View File

@ -26,7 +26,7 @@
+ return bukkitEntity = new CraftInventoryView(player.player.getBukkitEntity(), a.getOwner().getInventory(), this); + return bukkitEntity = new CraftInventoryView(player.player.getBukkitEntity(), a.getOwner().getInventory(), this);
+ } + }
+ +
public ContainerHorse(IInventory iinventory, final IInventory iinventory1, final EntityHorseAbstract entityhorseabstract, EntityHuman entityhuman) { public ContainerHorse(IInventory iinventory, IInventory iinventory1, final EntityHorseAbstract entityhorseabstract, EntityHuman entityhuman) {
+ player = (PlayerInventory) iinventory; + player = (PlayerInventory) iinventory;
+ // CraftBukkit end + // CraftBukkit end
this.a = iinventory1; this.a = iinventory1;

View File

@ -20,7 +20,7 @@
+ private PlayerInventory player; + private PlayerInventory player;
+ // CraftBukkit end + // CraftBukkit end
public ContainerPlayer(final PlayerInventory playerinventory, boolean flag, EntityHuman entityhuman) { public ContainerPlayer(PlayerInventory playerinventory, boolean flag, EntityHuman entityhuman) {
this.g = flag; this.g = flag;
this.owner = entityhuman; this.owner = entityhuman;
+ // CraftBukkit start + // CraftBukkit start

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/CraftingManager.java --- a/net/minecraft/server/CraftingManager.java
+++ b/net/minecraft/server/CraftingManager.java +++ b/net/minecraft/server/CraftingManager.java
@@ -96,12 +96,14 @@ @@ -95,12 +95,14 @@
do { do {
if (!iterator.hasNext()) { if (!iterator.hasNext()) {
@ -15,7 +15,7 @@
return irecipe.craftItem(iinventory); return irecipe.craftItem(iinventory);
} }
@@ -113,12 +115,14 @@ @@ -112,12 +114,14 @@
do { do {
if (!iterator.hasNext()) { if (!iterator.hasNext()) {

View File

@ -2,7 +2,7 @@
+++ b/net/minecraft/server/CrashReport.java +++ b/net/minecraft/server/CrashReport.java
@@ -63,6 +63,7 @@ @@ -63,6 +63,7 @@
return String.format("%d total; %s", new Object[] { list.size(), list.stream().collect(Collectors.joining(" "))}); return String.format("%d total; %s", list.size(), list.stream().collect(Collectors.joining(" ")));
}); });
+ this.d.a("CraftBukkit Information", (CrashReportCallable) new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit + this.d.a("CraftBukkit Information", (CrashReportCallable) new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit
} }

View File

@ -1,11 +1,11 @@
--- a/net/minecraft/server/CustomFunction.java --- a/net/minecraft/server/CustomFunction.java
+++ b/net/minecraft/server/CustomFunction.java +++ b/net/minecraft/server/CustomFunction.java
@@ -48,7 +48,7 @@ @@ -47,7 +47,7 @@
} }
try { try {
- ParseResults parseresults = customfunctiondata.a().getCommandDispatcher().a().parse(stringreader, customfunctiondata.f()); - ParseResults<CommandListenerWrapper> parseresults = customfunctiondata.a().getCommandDispatcher().a().parse(stringreader, customfunctiondata.f());
+ ParseResults parseresults = customfunctiondata.d().parse(stringreader, customfunctiondata.f()); // CraftBukkit + ParseResults<CommandListenerWrapper> parseresults = customfunctiondata.d().parse(stringreader, customfunctiondata.f()); // CraftBukkit
if (parseresults.getReader().canRead()) { if (parseresults.getReader().canRead()) {
if (parseresults.getExceptions().size() == 1) { if (parseresults.getExceptions().size() == 1) {

View File

@ -1,15 +1,6 @@
--- a/net/minecraft/server/CustomFunctionData.java --- a/net/minecraft/server/CustomFunctionData.java
+++ b/net/minecraft/server/CustomFunctionData.java +++ b/net/minecraft/server/CustomFunctionData.java
@@ -32,7 +32,7 @@ @@ -55,7 +55,7 @@
private final Map<MinecraftKey, CustomFunction> g = Maps.newHashMap();
private final ArrayDeque<CustomFunctionData.a> h = new ArrayDeque();
private boolean i;
- private final Tags<CustomFunction> j = new Tags((minecraftkey) -> {
+ private final Tags<CustomFunction> j = new Tags<>((minecraftkey) -> { // CraftBukkit - decompile error
return this.a(minecraftkey) != null;
}, this::a, "tags/functions", true, "function");
private final List<CustomFunction> k = Lists.newArrayList();
@@ -60,7 +60,7 @@
} }
public com.mojang.brigadier.CommandDispatcher<CommandListenerWrapper> d() { public com.mojang.brigadier.CommandDispatcher<CommandListenerWrapper> d() {
@ -18,12 +9,3 @@
} }
public void tick() { public void tick() {
@@ -164,7 +164,7 @@
arraylist.add(CompletableFuture.supplyAsync(() -> {
return a(iresourcemanager, minecraftkey);
}, Resource.a).thenApplyAsync((list) -> {
- return CustomFunction.a(minecraftkey, this, list);
+ return CustomFunction.a(minecraftkey1, this, list); // CraftBukkit - decompile error
}).handle((customfunction, throwable) -> {
return this.a(customfunction, throwable, minecraftkey);
}));

View File

@ -1,8 +1,8 @@
--- a/net/minecraft/server/DataConverterFlatten.java --- a/net/minecraft/server/DataConverterFlatten.java
+++ b/net/minecraft/server/DataConverterFlatten.java +++ b/net/minecraft/server/DataConverterFlatten.java
@@ -378,7 +378,7 @@ @@ -376,7 +376,7 @@
Typed typed2 = typed.getOrCreateTyped(opticfinder1); Typed<?> typed2 = typed.getOrCreateTyped(opticfinder1);
Dynamic dynamic1 = (Dynamic) typed2.get(DSL.remainderFinder()); Dynamic<?> dynamic1 = (Dynamic) typed2.get(DSL.remainderFinder());
- dynamic1 = dynamic1.set("Damage", dynamic1.createInt(i)); - dynamic1 = dynamic1.set("Damage", dynamic1.createInt(i));
+ if (i != 0) dynamic1 = dynamic1.set("Damage", dynamic1.createInt(i)); // CraftBukkit + if (i != 0) dynamic1 = dynamic1.set("Damage", dynamic1.createInt(i)); // CraftBukkit

View File

@ -1,17 +1,8 @@
--- a/net/minecraft/server/DataConverterMap.java --- a/net/minecraft/server/DataConverterMap.java
+++ b/net/minecraft/server/DataConverterMap.java +++ b/net/minecraft/server/DataConverterMap.java
@@ -22,7 +22,7 @@ @@ -31,7 +31,7 @@
public TypeRewriteRule makeRule() { Typed<?> typed1 = typed.getOrCreateTyped(opticfinder1);
Type type = this.getInputSchema().getType(DataConverterTypes.ITEM_STACK); Dynamic<?> dynamic1 = (Dynamic) typed1.get(DSL.remainderFinder());
OpticFinder opticfinder = DSL.fieldFinder("id", DSL.named(DataConverterTypes.q.typeName(), DSL.namespacedString()));
- OpticFinder opticfinder1 = type.findField("tag");
+ OpticFinder<?> opticfinder1 = type.findField("tag"); // CraftBukkit - decompile error
return this.fixTypeEverywhereTyped("ItemInstanceMapIdFix", type, (typed) -> {
Optional optional = typed.getOptional(opticfinder);
@@ -32,7 +32,7 @@
Typed typed1 = typed.getOrCreateTyped(opticfinder1);
Dynamic dynamic1 = (Dynamic) typed1.get(DSL.remainderFinder());
- dynamic1 = dynamic1.set("map", dynamic1.createInt(dynamic.getInt("Damage"))); - dynamic1 = dynamic1.set("map", dynamic1.createInt(dynamic.getInt("Damage")));
+ if (!dynamic1.get("map").isPresent()) dynamic1 = dynamic1.set("map", dynamic1.createInt(dynamic.getInt("Damage"))); // CraftBukkit + if (!dynamic1.get("map").isPresent()) dynamic1 = dynamic1.set("map", dynamic1.createInt(dynamic.getInt("Damage"))); // CraftBukkit

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/DataConverterRegistry.java --- a/net/minecraft/server/DataConverterRegistry.java
+++ b/net/minecraft/server/DataConverterRegistry.java +++ b/net/minecraft/server/DataConverterRegistry.java
@@ -21,7 +21,12 @@ @@ -20,7 +20,12 @@
DataFixerBuilder datafixerbuilder = new DataFixerBuilder(1631); DataFixerBuilder datafixerbuilder = new DataFixerBuilder(1631);
a(datafixerbuilder); a(datafixerbuilder);
@ -14,7 +14,7 @@
} }
public static DataFixer a() { public static DataFixer a() {
@@ -185,6 +190,18 @@ @@ -184,6 +189,18 @@
datafixerbuilder.addFixer(new DataConverterItemFrame(schema46, false)); datafixerbuilder.addFixer(new DataConverterItemFrame(schema46, false));
Schema schema47 = datafixerbuilder.addSchema(1458, DataConverterRegistry.b); Schema schema47 = datafixerbuilder.addSchema(1458, DataConverterRegistry.b);

View File

@ -1,23 +1,5 @@
--- a/net/minecraft/server/DataWatcher.java --- a/net/minecraft/server/DataWatcher.java
+++ b/net/minecraft/server/DataWatcher.java +++ b/net/minecraft/server/DataWatcher.java
@@ -70,7 +70,7 @@
}
}
- public <T> void register(DataWatcherObject<T> datawatcherobject, T t0) {
+ public <T> void register(DataWatcherObject<T> datawatcherobject, Object t0) { // CraftBukkit T -> Object
int i = datawatcherobject.a();
if (i > 254) {
@@ -84,7 +84,7 @@
}
}
- private <T> void registerObject(DataWatcherObject<T> datawatcherobject, T t0) {
+ private <T> void registerObject(DataWatcherObject<T> datawatcherobject, Object t0) { // CraftBukkit Object
DataWatcher.Item datawatcher_item = new DataWatcher.Item(datawatcherobject, t0);
this.e.writeLock().lock();
@@ -128,6 +128,13 @@ @@ -128,6 +128,13 @@
} }

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/DispenserRegistry.java --- a/net/minecraft/server/DispenserRegistry.java
+++ b/net/minecraft/server/DispenserRegistry.java +++ b/net/minecraft/server/DispenserRegistry.java
@@ -8,6 +8,16 @@ @@ -7,6 +7,16 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -17,27 +17,9 @@
public class DispenserRegistry { public class DispenserRegistry {
public static final PrintStream a = System.out; public static final PrintStream a = System.out;
@@ -70,7 +80,7 @@ @@ -105,11 +115,39 @@
BlockDispenser.a((IMaterial) Items.SPLASH_POTION, new IDispenseBehavior() {
public ItemStack dispense(ISourceBlock isourceblock, final ItemStack itemstack) {
return (new DispenseBehaviorProjectile() {
- protected IProjectile a(World world, IPosition iposition, ItemStack itemstack) {
+ protected IProjectile a(World world, IPosition iposition, ItemStack itemstack1) { // CraftBukkit - decompile issue
return new EntityPotion(world, iposition.getX(), iposition.getY(), iposition.getZ(), itemstack1.cloneItemStack());
}
@@ -87,7 +97,7 @@
BlockDispenser.a((IMaterial) Items.LINGERING_POTION, new IDispenseBehavior() {
public ItemStack dispense(ISourceBlock isourceblock, final ItemStack itemstack) {
return (new DispenseBehaviorProjectile() {
- protected IProjectile a(World world, IPosition iposition, ItemStack itemstack) {
+ protected IProjectile a(World world, IPosition iposition, ItemStack itemstack1) { // CraftBukkit - decompile issue
return new EntityPotion(world, iposition.getX(), iposition.getY(), iposition.getZ(), itemstack1.cloneItemStack());
}
@@ -106,11 +116,39 @@
EnumDirection enumdirection = (EnumDirection) isourceblock.e().get(BlockDispenser.FACING); EnumDirection enumdirection = (EnumDirection) isourceblock.e().get(BlockDispenser.FACING);
EntityTypes entitytypes = ((ItemMonsterEgg) itemstack.getItem()).b(itemstack.getTag()); EntityTypes<?> entitytypes = ((ItemMonsterEgg) itemstack.getItem()).b(itemstack.getTag());
+ // CraftBukkit start + // CraftBukkit start
+ World world = isourceblock.getWorld(); + World world = isourceblock.getWorld();
@ -76,7 +58,7 @@
return itemstack; return itemstack;
} }
}; };
@@ -128,10 +166,39 @@ @@ -127,10 +165,39 @@
double d0 = isourceblock.getX() + (double) enumdirection.getAdjacentX(); double d0 = isourceblock.getX() + (double) enumdirection.getAdjacentX();
double d1 = (double) ((float) isourceblock.getBlockPosition().getY() + 0.2F); double d1 = (double) ((float) isourceblock.getBlockPosition().getY() + 0.2F);
double d2 = isourceblock.getZ() + (double) enumdirection.getAdjacentZ(); double d2 = isourceblock.getZ() + (double) enumdirection.getAdjacentZ();
@ -118,7 +100,7 @@
return itemstack; return itemstack;
} }
@@ -152,8 +219,38 @@ @@ -151,8 +218,38 @@
double d4 = random.nextGaussian() * 0.05D + (double) enumdirection.getAdjacentY(); double d4 = random.nextGaussian() * 0.05D + (double) enumdirection.getAdjacentY();
double d5 = random.nextGaussian() * 0.05D + (double) enumdirection.getAdjacentZ(); double d5 = random.nextGaussian() * 0.05D + (double) enumdirection.getAdjacentZ();
@ -159,7 +141,7 @@
return itemstack; return itemstack;
} }
@@ -175,9 +272,52 @@ @@ -174,9 +271,52 @@
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING)); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
World world = isourceblock.getWorld(); World world = isourceblock.getWorld();
@ -213,12 +195,12 @@
} else { } else {
return this.a.dispense(isourceblock, itemstack); return this.a.dispense(isourceblock, itemstack);
} }
@@ -200,13 +340,39 @@ @@ -199,13 +339,39 @@
Block block = iblockdata.getBlock(); Block block = iblockdata.getBlock();
if (block instanceof IFluidSource) { if (block instanceof IFluidSource) {
- FluidType fluidtype = ((IFluidSource) block).a(world, blockposition, iblockdata); - FluidType fluidtype = ((IFluidSource) block).removeFluid(world, blockposition, iblockdata);
+ FluidType fluidtype = ((IFluidSource) block).a(DummyGeneratorAccess.INSTANCE, blockposition, iblockdata); // CraftBukkit + FluidType fluidtype = ((IFluidSource) block).removeFluid(DummyGeneratorAccess.INSTANCE, blockposition, iblockdata); // CraftBukkit
if (!(fluidtype instanceof FluidTypeFlowing)) { if (!(fluidtype instanceof FluidTypeFlowing)) {
return super.a(isourceblock, itemstack); return super.a(isourceblock, itemstack);
@ -248,13 +230,13 @@
+ } + }
+ } + }
+ +
+ fluidtype = ((IFluidSource) block).a(world, blockposition, iblockdata); // From above + fluidtype = ((IFluidSource) block).removeFluid(world, blockposition, iblockdata); // From above
+ // CraftBukkit end + // CraftBukkit end
+ +
itemstack.subtract(1); itemstack.subtract(1);
if (itemstack.isEmpty()) { if (itemstack.isEmpty()) {
return new ItemStack(item); return new ItemStack(item);
@@ -227,11 +393,39 @@ @@ -226,11 +392,39 @@
protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
World world = isourceblock.getWorld(); World world = isourceblock.getWorld();
@ -295,7 +277,7 @@
} else { } else {
Block block = world.getType(blockposition).getBlock(); Block block = world.getType(blockposition).getBlock();
@@ -255,12 +449,57 @@ @@ -254,12 +448,57 @@
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));
@ -353,7 +335,7 @@
return itemstack; return itemstack;
} }
@@ -269,11 +508,40 @@ @@ -268,11 +507,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));
@ -396,7 +378,7 @@
return itemstack; return itemstack;
} }
})); }));
@@ -295,6 +563,30 @@ @@ -294,6 +562,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);
@ -427,7 +409,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, enumdirection.k() == EnumDirection.EnumAxis.Y ? 0 : enumdirection.opposite().get2DRotationValue() * 4), 3); world.setTypeAndData(blockposition, (IBlockData) Blocks.WITHER_SKELETON_SKULL.getBlockData().set(BlockSkull.a, enumdirection.k() == EnumDirection.EnumAxis.Y ? 0 : enumdirection.opposite().get2DRotationValue() * 4), 3);
@@ -318,6 +610,30 @@ @@ -317,6 +609,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;
@ -458,24 +440,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) {
@@ -336,14 +652,14 @@ @@ -384,6 +700,51 @@
return itemstack;
}
}));
- BlockDispenser.a((IMaterial) Blocks.SHULKER_BOX.getItem(), (IDispenseBehavior) (new DispenserRegistry.d(null)));
+ BlockDispenser.a((IMaterial) Blocks.SHULKER_BOX.getItem(), (IDispenseBehavior) (new DispenserRegistry.d())); // CraftBukkit - decompile error
EnumColor[] aenumcolor = EnumColor.values();
int i = aenumcolor.length;
for (int j = 0; j < i; ++j) {
EnumColor enumcolor = aenumcolor[j];
- BlockDispenser.a((IMaterial) BlockShulkerBox.a(enumcolor).getItem(), (IDispenseBehavior) (new DispenserRegistry.d(null)));
+ BlockDispenser.a((IMaterial) BlockShulkerBox.a(enumcolor).getItem(), (IDispenseBehavior) (new DispenserRegistry.d())); // CraftBukkit - decompile error
}
}
@@ -385,6 +701,51 @@
} }
d(); d();
@ -527,16 +492,7 @@
} }
} }
} }
@@ -393,7 +754,7 @@ @@ -481,6 +842,30 @@
LocaleLanguage localelanguage = LocaleLanguage.a();
iregistry.iterator().forEachRemaining((object) -> {
- String s = (String) function.apply(object);
+ String s1 = (String) function.apply(object); // CraftBukkit - decompile error
if (!localelanguage.b(s)) {
DispenserRegistry.c.warn("Missing translation for {}: {} (key: '{}')", s1, iregistry.getKey(object), s);
@@ -482,6 +843,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;
@ -567,7 +523,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);
@@ -531,12 +916,40 @@ @@ -530,12 +915,40 @@
d3 = 0.0D; d3 = 0.0D;
} }

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/Enchantment.java --- a/net/minecraft/server/Enchantment.java
+++ b/net/minecraft/server/Enchantment.java +++ b/net/minecraft/server/Enchantment.java
@@ -154,10 +154,15 @@ @@ -153,10 +153,15 @@
a("channeling", new EnchantmentTridentChanneling(Enchantment.Rarity.VERY_RARE, new EnumItemSlot[] { EnumItemSlot.MAINHAND})); a("channeling", new EnchantmentTridentChanneling(Enchantment.Rarity.VERY_RARE, new EnumItemSlot[] { EnumItemSlot.MAINHAND}));
a("mending", new EnchantmentMending(Enchantment.Rarity.RARE, EnumItemSlot.values())); a("mending", new EnchantmentMending(Enchantment.Rarity.RARE, EnumItemSlot.values()));
a("vanishing_curse", new EnchantmentVanishing(Enchantment.Rarity.VERY_RARE, EnumItemSlot.values())); a("vanishing_curse", new EnchantmentVanishing(Enchantment.Rarity.VERY_RARE, EnumItemSlot.values()));

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/Entity.java --- a/net/minecraft/server/Entity.java
+++ b/net/minecraft/server/Entity.java +++ b/net/minecraft/server/Entity.java
@@ -19,8 +19,55 @@ @@ -17,8 +17,55 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -56,7 +56,7 @@
protected static final Logger i = LogManager.getLogger(); protected static final Logger i = LogManager.getLogger();
private static final List<ItemStack> a = Collections.emptyList(); private static final List<ItemStack> a = Collections.emptyList();
private static final AxisAlignedBB b = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D); private static final AxisAlignedBB b = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
@@ -107,6 +154,16 @@ @@ -105,6 +152,16 @@
private boolean aK; private boolean aK;
private final double[] aL; private final double[] aL;
private long aM; private long aM;
@ -73,7 +73,7 @@
public Entity(EntityTypes<?> entitytypes, World world) { public Entity(EntityTypes<?> entitytypes, World world) {
this.id = Entity.entityCount++; this.id = Entity.entityCount++;
@@ -212,6 +269,33 @@ @@ -210,6 +267,33 @@
} }
protected void setYawPitch(float f, float f1) { protected void setYawPitch(float f, float f1) {
@ -107,7 +107,7 @@
this.yaw = f % 360.0F; this.yaw = f % 360.0F;
this.pitch = f1 % 360.0F; this.pitch = f1 % 360.0F;
} }
@@ -224,6 +308,7 @@ @@ -222,6 +306,7 @@
float f1 = this.length; float f1 = this.length;
this.a(new AxisAlignedBB(d0 - (double) f, d1, d2 - (double) f, d0 + (double) f, d1 + (double) f1, d2 + (double) f)); this.a(new AxisAlignedBB(d0 - (double) f, d1, d2 - (double) f, d0 + (double) f, d1 + (double) f1, d2 + (double) f));
@ -115,7 +115,7 @@
} }
public void tick() { public void tick() {
@@ -234,6 +319,51 @@ @@ -232,6 +317,51 @@
this.W(); this.W();
} }
@ -167,7 +167,7 @@
public void W() { public void W() {
this.world.methodProfiler.enter("entityBaseTick"); this.world.methodProfiler.enter("entityBaseTick");
if (this.isPassenger() && this.getVehicle().dead) { if (this.isPassenger() && this.getVehicle().dead) {
@@ -250,6 +380,8 @@ @@ -248,6 +378,8 @@
this.lastZ = this.locZ; this.lastZ = this.locZ;
this.lastPitch = this.pitch; this.lastPitch = this.pitch;
this.lastYaw = this.yaw; this.lastYaw = this.yaw;
@ -176,7 +176,7 @@
if (!this.world.isClientSide && this.world instanceof WorldServer) { if (!this.world.isClientSide && this.world instanceof WorldServer) {
this.world.methodProfiler.enter("portal"); this.world.methodProfiler.enter("portal");
if (this.an) { if (this.an) {
@@ -289,6 +421,7 @@ @@ -287,6 +419,7 @@
this.E(); this.E();
this.world.methodProfiler.exit(); this.world.methodProfiler.exit();
} }
@ -184,7 +184,7 @@
this.av(); this.av();
this.r(); this.r();
@@ -339,7 +472,23 @@ @@ -337,7 +470,23 @@
protected void burnFromLava() { protected void burnFromLava() {
if (!this.fireProof) { if (!this.fireProof) {
@ -209,7 +209,7 @@
this.damageEntity(DamageSource.LAVA, 4.0F); this.damageEntity(DamageSource.LAVA, 4.0F);
} }
} }
@@ -505,7 +654,7 @@ @@ -503,7 +652,7 @@
} }
} }
@ -218,7 +218,7 @@
double d11; double d11;
if (this.Q > 0.0F && flag && (d7 != d0 || d9 != d2)) { if (this.Q > 0.0F && flag && (d7 != d0 || d9 != d2)) {
@@ -592,7 +741,7 @@ @@ -590,7 +739,7 @@
this.world.methodProfiler.enter("rest"); this.world.methodProfiler.enter("rest");
this.recalcPosition(); this.recalcPosition();
this.positionChanged = d7 != d0 || d9 != d2; this.positionChanged = d7 != d0 || d9 != d2;
@ -227,7 +227,7 @@
this.onGround = this.C && d8 < 0.0D; this.onGround = this.C && d8 < 0.0D;
this.D = this.positionChanged || this.C; this.D = this.positionChanged || this.C;
int k = MathHelper.floor(this.locX); int k = MathHelper.floor(this.locX);
@@ -627,6 +776,28 @@ @@ -625,6 +774,28 @@
block1.a((IBlockAccess) this.world, this); block1.a((IBlockAccess) this.world, this);
} }
@ -256,7 +256,7 @@
if (this.playStepSound() && (!this.onGround || !this.isSneaking() || !(this instanceof EntityHuman)) && !this.isPassenger()) { if (this.playStepSound() && (!this.onGround || !this.isSneaking() || !(this instanceof EntityHuman)) && !this.isPassenger()) {
double d22 = this.locX - d4; double d22 = this.locX - d4;
double d23 = this.locY - d5; double d23 = this.locY - d5;
@@ -678,7 +849,14 @@ @@ -676,7 +847,14 @@
if (!flag1) { if (!flag1) {
++this.fireTicks; ++this.fireTicks;
if (this.fireTicks == 0) { if (this.fireTicks == 0) {
@ -272,7 +272,7 @@
} }
} }
@@ -706,6 +884,7 @@ @@ -704,6 +882,7 @@
this.locX = (axisalignedbb.minX + axisalignedbb.maxX) / 2.0D; this.locX = (axisalignedbb.minX + axisalignedbb.maxX) / 2.0D;
this.locY = axisalignedbb.minY; this.locY = axisalignedbb.minY;
this.locZ = (axisalignedbb.minZ + axisalignedbb.maxZ) / 2.0D; this.locZ = (axisalignedbb.minZ + axisalignedbb.maxZ) / 2.0D;
@ -280,7 +280,7 @@
} }
protected SoundEffect ad() { protected SoundEffect ad() {
@@ -876,7 +1055,7 @@ @@ -874,7 +1053,7 @@
return null; return null;
} }
@ -289,7 +289,7 @@
if (!this.fireProof) { if (!this.fireProof) {
this.damageEntity(DamageSource.FIRE, (float) i); this.damageEntity(DamageSource.FIRE, (float) i);
} }
@@ -1095,6 +1274,13 @@ @@ -1093,6 +1272,13 @@
} }
public void spawnIn(World world) { public void spawnIn(World world) {
@ -303,7 +303,7 @@
this.world = world; this.world = world;
} }
@@ -1120,6 +1306,7 @@ @@ -1118,6 +1304,7 @@
this.lastYaw -= 360.0F; this.lastYaw -= 360.0F;
} }
@ -311,7 +311,7 @@
this.setPosition(this.locX, this.locY, this.locZ); this.setPosition(this.locX, this.locY, this.locZ);
this.setYawPitch(f, f1); this.setYawPitch(f, f1);
} }
@@ -1302,7 +1489,7 @@ @@ -1300,7 +1487,7 @@
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
String s = this.getSaveID(); String s = this.getSaveID();
@ -320,7 +320,7 @@
nbttagcompound.setString("id", s); nbttagcompound.setString("id", s);
this.save(nbttagcompound); this.save(nbttagcompound);
return true; return true;
@@ -1319,6 +1506,18 @@ @@ -1317,6 +1504,18 @@
try { try {
nbttagcompound.set("Pos", this.a(this.locX, this.locY, this.locZ)); nbttagcompound.set("Pos", this.a(this.locX, this.locY, this.locZ));
nbttagcompound.set("Motion", this.a(this.motX, this.motY, this.motZ)); nbttagcompound.set("Motion", this.a(this.motX, this.motY, this.motZ));
@ -339,7 +339,7 @@
nbttagcompound.set("Rotation", this.a(this.yaw, this.pitch)); nbttagcompound.set("Rotation", this.a(this.yaw, this.pitch));
nbttagcompound.setFloat("FallDistance", this.fallDistance); nbttagcompound.setFloat("FallDistance", this.fallDistance);
nbttagcompound.setShort("Fire", (short) this.fireTicks); nbttagcompound.setShort("Fire", (short) this.fireTicks);
@@ -1328,6 +1527,12 @@ @@ -1326,6 +1525,12 @@
nbttagcompound.setBoolean("Invulnerable", this.invulnerable); nbttagcompound.setBoolean("Invulnerable", this.invulnerable);
nbttagcompound.setInt("PortalCooldown", this.portalCooldown); nbttagcompound.setInt("PortalCooldown", this.portalCooldown);
nbttagcompound.a("UUID", this.getUniqueID()); nbttagcompound.a("UUID", this.getUniqueID());
@ -352,7 +352,7 @@
IChatBaseComponent ichatbasecomponent = this.getCustomName(); IChatBaseComponent ichatbasecomponent = this.getCustomName();
if (ichatbasecomponent != null) { if (ichatbasecomponent != null) {
@@ -1404,6 +1609,8 @@ @@ -1402,6 +1607,8 @@
this.motX = nbttaglist1.k(0); this.motX = nbttaglist1.k(0);
this.motY = nbttaglist1.k(1); this.motY = nbttaglist1.k(1);
this.motZ = nbttaglist1.k(2); this.motZ = nbttaglist1.k(2);
@ -361,7 +361,7 @@
if (Math.abs(this.motX) > 10.0D) { if (Math.abs(this.motX) > 10.0D) {
this.motX = 0.0D; this.motX = 0.0D;
} }
@@ -1415,6 +1622,7 @@ @@ -1413,6 +1620,7 @@
if (Math.abs(this.motZ) > 10.0D) { if (Math.abs(this.motZ) > 10.0D) {
this.motZ = 0.0D; this.motZ = 0.0D;
} }
@ -369,7 +369,7 @@
this.locX = nbttaglist.k(0); this.locX = nbttaglist.k(0);
this.locY = nbttaglist.k(1); this.locY = nbttaglist.k(1);
@@ -1471,6 +1679,56 @@ @@ -1469,6 +1677,56 @@
this.setPosition(this.locX, this.locY, this.locZ); this.setPosition(this.locX, this.locY, this.locZ);
} }
@ -426,7 +426,7 @@
} catch (Throwable throwable) { } catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT"); CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded");
@@ -1544,9 +1802,22 @@ @@ -1542,9 +1800,22 @@
if (itemstack.isEmpty()) { if (itemstack.isEmpty()) {
return null; return null;
} else { } else {
@ -449,7 +449,7 @@
this.world.addEntity(entityitem); this.world.addEntity(entityitem);
return entityitem; return entityitem;
} }
@@ -1658,7 +1929,7 @@ @@ -1656,7 +1927,7 @@
} }
this.vehicle = entity; this.vehicle = entity;
@ -458,7 +458,7 @@
return true; return true;
} }
} }
@@ -1679,15 +1950,33 @@ @@ -1677,15 +1948,33 @@
Entity entity = this.vehicle; Entity entity = this.vehicle;
this.vehicle = null; this.vehicle = null;
@ -494,7 +494,7 @@
if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bO() instanceof EntityHuman)) { if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bO() instanceof EntityHuman)) {
this.passengers.add(0, entity); this.passengers.add(0, entity);
} else { } else {
@@ -1695,15 +1984,33 @@ @@ -1693,15 +1982,33 @@
} }
} }
@ -529,7 +529,7 @@
} }
protected boolean q(Entity entity) { protected boolean q(Entity entity) {
@@ -1800,6 +2107,13 @@ @@ -1798,6 +2105,13 @@
} }
public void setSwimming(boolean flag) { public void setSwimming(boolean flag) {
@ -543,7 +543,7 @@
this.setFlag(4, flag); this.setFlag(4, flag);
} }
@@ -1860,16 +2174,53 @@ @@ -1858,16 +2172,53 @@
} }
public void setAirTicks(int i) { public void setAirTicks(int i) {
@ -600,7 +600,7 @@
} }
public void j(boolean flag) { public void j(boolean flag) {
@@ -2036,19 +2387,72 @@ @@ -2034,19 +2385,72 @@
if (!this.world.isClientSide && !this.dead) { if (!this.world.isClientSide && !this.dead) {
this.world.methodProfiler.enter("changeDimension"); this.world.methodProfiler.enter("changeDimension");
MinecraftServer minecraftserver = this.bK(); MinecraftServer minecraftserver = this.bK();
@ -676,7 +676,7 @@
BlockPosition blockposition; BlockPosition blockposition;
if (dimensionmanager == DimensionManager.THE_END) { if (dimensionmanager == DimensionManager.THE_END) {
@@ -2077,12 +2481,18 @@ @@ -2075,12 +2479,18 @@
blockposition = new BlockPosition(this); blockposition = new BlockPosition(this);
} }
@ -696,7 +696,7 @@
if (dimensionmanager1 == DimensionManager.THE_END && dimensionmanager == DimensionManager.THE_END) { if (dimensionmanager1 == DimensionManager.THE_END && dimensionmanager == DimensionManager.THE_END) {
BlockPosition blockposition1 = worldserver1.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, worldserver1.getSpawn()); BlockPosition blockposition1 = worldserver1.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, worldserver1.getSpawn());
@@ -2090,6 +2500,7 @@ @@ -2088,6 +2498,7 @@
} else { } else {
entity.setPositionRotation(blockposition, entity.yaw, entity.pitch); entity.setPositionRotation(blockposition, entity.yaw, entity.pitch);
} }
@ -704,7 +704,7 @@
boolean flag = entity.attachedToPlayer; boolean flag = entity.attachedToPlayer;
@@ -2097,13 +2508,21 @@ @@ -2095,13 +2506,21 @@
worldserver1.addEntity(entity); worldserver1.addEntity(entity);
entity.attachedToPlayer = flag; entity.attachedToPlayer = flag;
worldserver1.entityJoinedWorld(entity, false); worldserver1.entityJoinedWorld(entity, false);
@ -727,7 +727,7 @@
return entity; return entity;
} else { } else {
return null; return null;
@@ -2243,7 +2662,26 @@ @@ -2241,7 +2660,26 @@
} }
public void a(AxisAlignedBB axisalignedbb) { public void a(AxisAlignedBB axisalignedbb) {

View File

@ -1,17 +1,17 @@
--- a/net/minecraft/server/EntityAreaEffectCloud.java --- a/net/minecraft/server/EntityAreaEffectCloud.java
+++ b/net/minecraft/server/EntityAreaEffectCloud.java +++ b/net/minecraft/server/EntityAreaEffectCloud.java
@@ -10,6 +10,10 @@ @@ -13,6 +13,10 @@
import java.util.List;
import java.util.Map;
import java.util.UUID;
+
+import org.bukkit.craftbukkit.entity.CraftLivingEntity; // CraftBukkit
+import org.bukkit.entity.LivingEntity; // CraftBukkit
+
import java.util.Map.Entry;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
@@ -102,6 +106,22 @@ import org.apache.logging.log4j.Logger;
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftLivingEntity;
+import org.bukkit.entity.LivingEntity;
+// CraftBukkit end
public class EntityAreaEffectCloud extends Entity {
@@ -101,6 +105,22 @@
} }
@ -34,15 +34,15 @@
public int getColor() { public int getColor() {
return (Integer) this.getDataWatcher().get(EntityAreaEffectCloud.c); return (Integer) this.getDataWatcher().get(EntityAreaEffectCloud.c);
} }
@@ -245,6 +265,7 @@ @@ -244,6 +264,7 @@
if (!list.isEmpty()) { if (!list1.isEmpty()) {
Iterator iterator2 = list.iterator(); Iterator iterator2 = list1.iterator();
+ List<LivingEntity> entities = new ArrayList<LivingEntity>(); // CraftBukkit + List<LivingEntity> entities = new java.util.ArrayList<LivingEntity>(); // CraftBukkit
while (iterator2.hasNext()) { while (iterator2.hasNext()) {
EntityLiving entityliving = (EntityLiving) iterator2.next(); EntityLiving entityliving = (EntityLiving) iterator2.next();
@@ -254,6 +275,17 @@ @@ -253,6 +274,17 @@
double d2 = d0 * d0 + d1 * d1; double d2 = d0 * d0 + d1 * d1;
if (d2 <= (double) (f * f)) { if (d2 <= (double) (f * f)) {
@ -58,9 +58,9 @@
+ EntityLiving entityliving = ((CraftLivingEntity) entity).getHandle(); + EntityLiving entityliving = ((CraftLivingEntity) entity).getHandle();
+ // CraftBukkit end + // CraftBukkit end
this.h.put(entityliving, this.ticksLived + this.reapplicationDelay); this.h.put(entityliving, this.ticksLived + this.reapplicationDelay);
Iterator iterator3 = arraylist.iterator(); Iterator iterator3 = list.iterator();
@@ -263,7 +295,7 @@ @@ -262,7 +294,7 @@
if (mobeffect1.getMobEffect().isInstant()) { if (mobeffect1.getMobEffect().isInstant()) {
mobeffect1.getMobEffect().applyInstantEffect(this, this.getSource(), entityliving, mobeffect1.getAmplifier(), 0.5D); mobeffect1.getMobEffect().applyInstantEffect(this, this.getSource(), entityliving, mobeffect1.getAmplifier(), 0.5D);
} else { } else {

View File

@ -1,14 +1,5 @@
--- a/net/minecraft/server/EntityDolphin.java --- a/net/minecraft/server/EntityDolphin.java
+++ b/net/minecraft/server/EntityDolphin.java +++ b/net/minecraft/server/EntityDolphin.java
@@ -95,7 +95,7 @@
this.goalSelector.a(5, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
this.goalSelector.a(5, new PathfinderGoalWaterJump(this, 10));
this.goalSelector.a(6, new PathfinderGoalMeleeAttack(this, 1.2000000476837158D, true));
- this.goalSelector.a(8, new EntityDolphin.d(null));
+ this.goalSelector.a(8, new EntityDolphin.d()); // CraftBukkit - decompile error
this.goalSelector.a(8, new PathfinderGoalFollowBoat(this));
this.goalSelector.a(9, new PathfinderGoalAvoidTarget(this, EntityGuardian.class, 8.0F, 1.0D, 1.0D));
this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, true, new Class[] { EntityGuardian.class}));
@@ -412,7 +412,7 @@ @@ -412,7 +412,7 @@
} }

View File

@ -1,22 +1,6 @@
--- a/net/minecraft/server/EntityEnderman.java --- a/net/minecraft/server/EntityEnderman.java
+++ b/net/minecraft/server/EntityEnderman.java +++ b/net/minecraft/server/EntityEnderman.java
@@ -33,7 +33,14 @@ @@ -44,7 +44,17 @@
this.goalSelector.a(11, new EntityEnderman.PathfinderGoalEndermanPickupBlock(this));
this.targetSelector.a(1, new EntityEnderman.PathfinderGoalPlayerWhoLookedAtTarget(this));
this.targetSelector.a(2, new PathfinderGoalHurtByTarget(this, false, new Class[0]));
- this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityEndermite.class, 10, true, false, EntityEndermite::isPlayerSpawned));
+ // CraftBukkit - decompile error
+ this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityEndermite.class, 10, true, false, new Predicate<EntityEndermite>() {
+ @Override
+ public boolean test(EntityEndermite entityendermite) {
+ return entityendermite.isPlayerSpawned();
+ }
+ }));
+ // CraftBukkit end
}
protected void initAttributes() {
@@ -45,7 +52,17 @@
} }
public void setGoalTarget(@Nullable EntityLiving entityliving) { public void setGoalTarget(@Nullable EntityLiving entityliving) {
@ -35,7 +19,7 @@
AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
if (entityliving == null) { if (entityliving == null) {
@@ -59,6 +76,7 @@ @@ -58,6 +68,7 @@
attributeinstance.b(EntityEnderman.b); attributeinstance.b(EntityEnderman.b);
} }
} }
@ -43,7 +27,7 @@
} }
@@ -277,8 +295,12 @@ @@ -276,8 +287,12 @@
boolean flag = movingobjectposition != null && movingobjectposition.getBlockPosition().equals(blockposition); boolean flag = movingobjectposition != null && movingobjectposition.getBlockPosition().equals(blockposition);
if (block.a(TagsBlock.ENDERMAN_HOLDABLE) && flag) { if (block.a(TagsBlock.ENDERMAN_HOLDABLE) && flag) {
@ -58,7 +42,7 @@
} }
} }
@@ -308,8 +330,12 @@ @@ -307,8 +322,12 @@
IBlockData iblockdata2 = this.a.getCarried(); IBlockData iblockdata2 = this.a.getCarried();
if (iblockdata2 != null && this.a(world, blockposition, iblockdata2, iblockdata, iblockdata1)) { if (iblockdata2 != null && this.a(world, blockposition, iblockdata2, iblockdata, iblockdata1)) {

View File

@ -1,8 +1,8 @@
--- a/net/minecraft/server/EntityFallingBlock.java --- a/net/minecraft/server/EntityFallingBlock.java
+++ b/net/minecraft/server/EntityFallingBlock.java +++ b/net/minecraft/server/EntityFallingBlock.java
@@ -4,6 +4,8 @@ @@ -4,6 +4,8 @@
import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit +import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+ +

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntityGuardianElder.java --- a/net/minecraft/server/EntityGuardianElder.java
+++ b/net/minecraft/server/EntityGuardianElder.java +++ b/net/minecraft/server/EntityGuardianElder.java
@@ -68,7 +68,7 @@ @@ -67,7 +67,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) {
entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(10, 0.0F)); entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(10, 0.0F));

View File

@ -1,7 +1,7 @@
--- a/net/minecraft/server/EntityHuman.java --- a/net/minecraft/server/EntityHuman.java
+++ b/net/minecraft/server/EntityHuman.java +++ b/net/minecraft/server/EntityHuman.java
@@ -15,6 +15,18 @@ @@ -12,6 +12,18 @@
import java.util.function.ToIntFunction; import java.util.function.Predicate;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
@ -19,7 +19,7 @@
public abstract class EntityHuman extends EntityLiving { public abstract class EntityHuman extends EntityLiving {
private static final DataWatcherObject<Float> a = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.c); private static final DataWatcherObject<Float> a = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.c);
@@ -24,10 +36,10 @@ @@ -21,10 +33,10 @@
protected static final DataWatcherObject<NBTTagCompound> bz = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p); protected static final DataWatcherObject<NBTTagCompound> bz = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p);
protected static final DataWatcherObject<NBTTagCompound> bA = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p); protected static final DataWatcherObject<NBTTagCompound> bA = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p);
public PlayerInventory inventory = new PlayerInventory(this); public PlayerInventory inventory = new PlayerInventory(this);
@ -32,7 +32,7 @@
protected int bG; protected int bG;
public float bH; public float bH;
public float bI; public float bI;
@@ -60,6 +72,17 @@ @@ -57,6 +69,17 @@
@Nullable @Nullable
public EntityFishingHook hookedFish; public EntityFishingHook hookedFish;
@ -50,7 +50,7 @@
public EntityHuman(World world, GameProfile gameprofile) { public EntityHuman(World world, GameProfile gameprofile) {
super(EntityTypes.PLAYER, world); super(EntityTypes.PLAYER, world);
this.cd = ItemStack.a; this.cd = ItemStack.a;
@@ -184,7 +207,7 @@ @@ -181,7 +204,7 @@
ItemStack itemstack = this.getEquipment(EnumItemSlot.HEAD); ItemStack itemstack = this.getEquipment(EnumItemSlot.HEAD);
if (itemstack.getItem() == Items.TURTLE_HELMET && !this.a(TagsFluid.WATER)) { if (itemstack.getItem() == Items.TURTLE_HELMET && !this.a(TagsFluid.WATER)) {
@ -59,7 +59,7 @@
} }
} }
@@ -369,7 +392,8 @@ @@ -366,7 +389,8 @@
if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL && this.world.getGameRules().getBoolean("naturalRegeneration")) { if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL && this.world.getGameRules().getBoolean("naturalRegeneration")) {
if (this.getHealth() < this.getMaxHealth() && this.ticksLived % 20 == 0) { if (this.getHealth() < this.getMaxHealth() && this.ticksLived % 20 == 0) {
@ -69,7 +69,7 @@
} }
if (this.foodData.c() && this.ticksLived % 10 == 0) { if (this.foodData.c() && this.ticksLived % 10 == 0) {
@@ -393,7 +417,7 @@ @@ -390,7 +414,7 @@
this.o((float) attributeinstance.getValue()); this.o((float) attributeinstance.getValue());
float f = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ); float f = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ);
@ -78,7 +78,7 @@
if (f > 0.1F) { if (f > 0.1F) {
f = 0.1F; f = 0.1F;
@@ -516,6 +540,7 @@ @@ -513,6 +537,7 @@
@Nullable @Nullable
public EntityItem a(boolean flag) { public EntityItem a(boolean flag) {
@ -86,7 +86,7 @@
return this.a(this.inventory.splitStack(this.inventory.itemInHandIndex, flag && !this.inventory.getItemInHand().isEmpty() ? this.inventory.getItemInHand().getCount() : 1), false, true); return this.a(this.inventory.splitStack(this.inventory.itemInHandIndex, flag && !this.inventory.getItemInHand().isEmpty() ? this.inventory.getItemInHand().getCount() : 1), false, true);
} }
@@ -558,6 +583,30 @@ @@ -555,6 +580,30 @@
entityitem.motZ += Math.sin((double) f1) * (double) f; entityitem.motZ += Math.sin((double) f1) * (double) f;
} }
@ -117,7 +117,7 @@
ItemStack itemstack1 = this.a(entityitem); ItemStack itemstack1 = this.a(entityitem);
if (flag1) { if (flag1) {
@@ -652,6 +701,13 @@ @@ -649,6 +698,13 @@
this.a(true, true, false); this.a(true, true, false);
} }
@ -131,7 +131,7 @@
if (nbttagcompound.hasKeyOfType("SpawnX", 99) && nbttagcompound.hasKeyOfType("SpawnY", 99) && nbttagcompound.hasKeyOfType("SpawnZ", 99)) { if (nbttagcompound.hasKeyOfType("SpawnX", 99) && nbttagcompound.hasKeyOfType("SpawnY", 99) && nbttagcompound.hasKeyOfType("SpawnZ", 99)) {
this.e = new BlockPosition(nbttagcompound.getInt("SpawnX"), nbttagcompound.getInt("SpawnY"), nbttagcompound.getInt("SpawnZ")); this.e = new BlockPosition(nbttagcompound.getInt("SpawnX"), nbttagcompound.getInt("SpawnY"), nbttagcompound.getInt("SpawnZ"));
this.f = nbttagcompound.getBoolean("SpawnForced"); this.f = nbttagcompound.getBoolean("SpawnForced");
@@ -702,6 +758,7 @@ @@ -699,6 +755,7 @@
if (!this.getShoulderEntityRight().isEmpty()) { if (!this.getShoulderEntityRight().isEmpty()) {
nbttagcompound.set("ShoulderEntityRight", this.getShoulderEntityRight()); nbttagcompound.set("ShoulderEntityRight", this.getShoulderEntityRight());
} }
@ -139,7 +139,7 @@
} }
@@ -719,10 +776,10 @@ @@ -716,10 +773,10 @@
this.a(true, true, false); this.a(true, true, false);
} }
@ -152,7 +152,7 @@
} }
if (this.world.getDifficulty() == EnumDifficulty.EASY) { if (this.world.getDifficulty() == EnumDifficulty.EASY) {
@@ -734,7 +791,13 @@ @@ -731,7 +788,13 @@
} }
} }
@ -167,7 +167,7 @@
} }
} }
} }
@@ -748,10 +811,29 @@ @@ -745,10 +808,29 @@
} }
public boolean a(EntityHuman entityhuman) { public boolean a(EntityHuman entityhuman) {
@ -200,7 +200,7 @@
} }
protected void damageArmor(float f) { protected void damageArmor(float f) {
@@ -794,7 +876,12 @@ @@ -791,7 +873,12 @@
return (float) i / (float) this.inventory.armor.size(); return (float) i / (float) this.inventory.armor.size();
} }
@ -214,7 +214,7 @@
if (!this.isInvulnerable(damagesource)) { if (!this.isInvulnerable(damagesource)) {
f = this.applyArmorModifier(damagesource, f); f = this.applyArmorModifier(damagesource, f);
f = this.applyMagicModifier(damagesource, f); f = this.applyMagicModifier(damagesource, f);
@@ -820,6 +907,7 @@ @@ -817,6 +904,7 @@
} }
} }
@ -222,7 +222,7 @@
} }
public void openSign(TileEntitySign tileentitysign) {} public void openSign(TileEntitySign tileentitysign) {}
@@ -941,8 +1029,15 @@ @@ -938,8 +1026,15 @@
if (entity instanceof EntityLiving) { if (entity instanceof EntityLiving) {
f3 = ((EntityLiving) entity).getHealth(); f3 = ((EntityLiving) entity).getHealth();
if (j > 0 && !entity.isBurning()) { if (j > 0 && !entity.isBurning()) {
@ -240,7 +240,7 @@
} }
} }
@@ -973,8 +1068,11 @@ @@ -970,8 +1065,11 @@
EntityLiving entityliving = (EntityLiving) iterator.next(); EntityLiving entityliving = (EntityLiving) iterator.next();
if (entityliving != this && entityliving != entity && !this.r(entityliving) && (!(entityliving instanceof EntityArmorStand) || !((EntityArmorStand) entityliving).isMarker()) && this.h(entityliving) < 9.0D) { if (entityliving != this && entityliving != entity && !this.r(entityliving) && (!(entityliving instanceof EntityArmorStand) || !((EntityArmorStand) entityliving).isMarker()) && this.h(entityliving) < 9.0D) {
@ -253,7 +253,7 @@
} }
} }
@@ -983,11 +1081,28 @@ @@ -980,11 +1078,28 @@
} }
if (entity instanceof EntityPlayer && entity.velocityChanged) { if (entity instanceof EntityPlayer && entity.velocityChanged) {
@ -282,7 +282,7 @@
} }
if (flag2) { if (flag2) {
@@ -1036,7 +1151,14 @@ @@ -1033,7 +1148,14 @@
this.a(StatisticList.DAMAGE_DEALT, Math.round(f5 * 10.0F)); this.a(StatisticList.DAMAGE_DEALT, Math.round(f5 * 10.0F));
if (j > 0) { if (j > 0) {
@ -298,7 +298,7 @@
} }
if (this.world instanceof WorldServer && f5 > 2.0F) { if (this.world instanceof WorldServer && f5 > 2.0F) {
@@ -1052,6 +1174,11 @@ @@ -1049,6 +1171,11 @@
if (flag4) { if (flag4) {
entity.extinguish(); entity.extinguish();
} }
@ -310,7 +310,7 @@
} }
} }
@@ -1113,15 +1240,15 @@ @@ -1110,15 +1237,15 @@
return this.h; return this.h;
} }
@ -330,15 +330,7 @@
return EntityHuman.EnumBedResult.NOT_POSSIBLE_HERE; return EntityHuman.EnumBedResult.NOT_POSSIBLE_HERE;
} }
@@ -1136,13 +1263,33 @@ @@ -1140,6 +1267,26 @@
if (!this.u()) {
double d0 = 8.0D;
double d1 = 5.0D;
- List list = this.world.a(EntityMonster.class, new AxisAlignedBB((double) blockposition.getX() - 8.0D, (double) blockposition.getY() - 5.0D, (double) blockposition.getZ() - 8.0D, (double) blockposition.getX() + 8.0D, (double) blockposition.getY() + 5.0D, (double) blockposition.getZ() + 8.0D), (Predicate) (new EntityHuman.c(this, null)));
+ List list = this.world.a(EntityMonster.class, new AxisAlignedBB((double) blockposition.getX() - 8.0D, (double) blockposition.getY() - 5.0D, (double) blockposition.getZ() - 8.0D, (double) blockposition.getX() + 8.0D, (double) blockposition.getY() + 5.0D, (double) blockposition.getZ() + 8.0D), (Predicate) (new EntityHuman.c(this))); // CraftBukkit - decompile error
if (!list.isEmpty()) {
return EntityHuman.EnumBedResult.NOT_SAFE;
} }
} }
} }
@ -365,7 +357,7 @@
if (this.isPassenger()) { if (this.isPassenger()) {
this.stopRiding(); this.stopRiding();
@@ -1209,6 +1356,24 @@ @@ -1206,6 +1353,24 @@
this.world.everyoneSleeping(); this.world.everyoneSleeping();
} }
@ -390,7 +382,7 @@
this.sleepTicks = flag ? 0 : 100; this.sleepTicks = flag ? 0 : 100;
if (flag2) { if (flag2) {
this.setRespawnPosition(this.bedPosition, false); this.setRespawnPosition(this.bedPosition, false);
@@ -1260,9 +1425,11 @@ @@ -1257,9 +1422,11 @@
if (blockposition != null) { if (blockposition != null) {
this.e = blockposition; this.e = blockposition;
this.f = flag; this.f = flag;
@ -402,7 +394,7 @@
} }
} }
@@ -1328,7 +1495,11 @@ @@ -1325,7 +1492,11 @@
this.motY = d3 * 0.6D; this.motY = d3 * 0.6D;
this.aU = f3; this.aU = f3;
this.fallDistance = 0.0F; this.fallDistance = 0.0F;
@ -415,7 +407,7 @@
} else { } else {
super.a(f, f1, f2); super.a(f, f1, f2);
} }
@@ -1628,13 +1799,17 @@ @@ -1625,13 +1796,17 @@
} }
protected void releaseShoulderEntities() { protected void releaseShoulderEntities() {
@ -438,7 +430,7 @@
if (!this.world.isClientSide && !nbttagcompound.isEmpty()) { if (!this.world.isClientSide && !nbttagcompound.isEmpty()) {
Entity entity = EntityTypes.a(nbttagcompound, this.world); Entity entity = EntityTypes.a(nbttagcompound, this.world);
@@ -1643,9 +1818,10 @@ @@ -1640,9 +1815,10 @@
} }
entity.setPosition(this.locX, this.locY + 0.699999988079071D, this.locZ); entity.setPosition(this.locX, this.locY + 0.699999988079071D, this.locZ);

View File

@ -1,16 +1,5 @@
--- a/net/minecraft/server/EntityIllagerIllusioner.java --- a/net/minecraft/server/EntityIllagerIllusioner.java
+++ b/net/minecraft/server/EntityIllagerIllusioner.java +++ b/net/minecraft/server/EntityIllagerIllusioner.java
@@ -24,8 +24,8 @@
super.n();
this.goalSelector.a(0, new PathfinderGoalFloat(this));
this.goalSelector.a(1, new EntityIllagerWizard.b());
- this.goalSelector.a(4, new EntityIllagerIllusioner.b(null));
- this.goalSelector.a(5, new EntityIllagerIllusioner.a(null));
+ this.goalSelector.a(4, new EntityIllagerIllusioner.b()); // CraftBukkit - decompile error
+ this.goalSelector.a(5, new EntityIllagerIllusioner.a()); // CraftBukkit - decompile error
this.goalSelector.a(6, new PathfinderGoalBowShoot(this, 0.5D, 20, 15.0F));
this.goalSelector.a(8, new PathfinderGoalRandomStroll(this, 0.6D));
this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.0F));
@@ -164,7 +164,7 @@ @@ -164,7 +164,7 @@
} }

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntityInsentient.java --- a/net/minecraft/server/EntityInsentient.java
+++ b/net/minecraft/server/EntityInsentient.java +++ b/net/minecraft/server/EntityInsentient.java
@@ -9,6 +9,18 @@ @@ -10,6 +10,18 @@
import java.util.UUID; import java.util.UUID;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -19,7 +19,7 @@
public abstract class EntityInsentient extends EntityLiving { public abstract class EntityInsentient extends EntityLiving {
private static final DataWatcherObject<Byte> a = DataWatcher.a(EntityInsentient.class, DataWatcherRegistry.a); private static final DataWatcherObject<Byte> a = DataWatcher.a(EntityInsentient.class, DataWatcherRegistry.a);
@@ -27,7 +39,7 @@ @@ -28,7 +40,7 @@
public float[] dropChanceHand; public float[] dropChanceHand;
private final NonNullList<ItemStack> bE; private final NonNullList<ItemStack> bE;
public float[] dropChanceArmor; public float[] dropChanceArmor;
@ -28,7 +28,7 @@
public boolean persistent; public boolean persistent;
private final Map<PathType, Float> bH; private final Map<PathType, Float> bH;
public MinecraftKey lootTableKey; public MinecraftKey lootTableKey;
@@ -57,6 +69,9 @@ @@ -58,6 +70,9 @@
this.n(); this.n();
} }
@ -38,7 +38,7 @@
} }
protected void n() {} protected void n() {}
@@ -110,7 +125,38 @@ @@ -111,7 +126,38 @@
} }
public void setGoalTarget(@Nullable EntityLiving entityliving) { public void setGoalTarget(@Nullable EntityLiving entityliving) {
@ -77,7 +77,7 @@
} }
public boolean b(Class<? extends EntityLiving> oclass) { public boolean b(Class<? extends EntityLiving> oclass) {
@@ -336,11 +382,20 @@ @@ -337,11 +383,20 @@
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
super.a(nbttagcompound); super.a(nbttagcompound);
@ -100,7 +100,7 @@
NBTTagList nbttaglist; NBTTagList nbttaglist;
int i; int i;
@@ -394,6 +449,11 @@ @@ -395,6 +450,11 @@
protected MinecraftKey getDefaultLootTable() { protected MinecraftKey getDefaultLootTable() {
return null; return null;
} }
@ -112,7 +112,7 @@
protected void a(boolean flag, int i, DamageSource damagesource) { protected void a(boolean flag, int i, DamageSource damagesource) {
MinecraftKey minecraftkey = this.lootTableKey; MinecraftKey minecraftkey = this.lootTableKey;
@@ -470,11 +530,21 @@ @@ -471,11 +531,21 @@
ItemStack itemstack1 = this.getEquipment(enumitemslot); ItemStack itemstack1 = this.getEquipment(enumitemslot);
boolean flag = this.a(itemstack, itemstack1, enumitemslot); boolean flag = this.a(itemstack, itemstack1, enumitemslot);
@ -135,7 +135,7 @@
} }
this.setSlot(enumitemslot, itemstack); this.setSlot(enumitemslot, itemstack);
@@ -553,11 +623,11 @@ @@ -554,11 +624,11 @@
double d2 = entityhuman.locZ - this.locZ; double d2 = entityhuman.locZ - this.locZ;
double d3 = d0 * d0 + d1 * d1 + d2 * d2; double d3 = d0 * d0 + d1 * d1 + d2 * d2;
@ -149,7 +149,7 @@
this.die(); this.die();
} else if (d3 < 1024.0D) { } else if (d3 < 1024.0D) {
this.ticksFarFromPlayer = 0; this.ticksFarFromPlayer = 0;
@@ -931,12 +1001,24 @@ @@ -932,12 +1002,24 @@
public final boolean b(EntityHuman entityhuman, EnumHand enumhand) { public final boolean b(EntityHuman entityhuman, EnumHand enumhand) {
if (this.isLeashed() && this.getLeashHolder() == entityhuman) { if (this.isLeashed() && this.getLeashHolder() == entityhuman) {
@ -174,7 +174,7 @@
this.setLeashHolder(entityhuman, true); this.setLeashHolder(entityhuman, true);
itemstack.subtract(1); itemstack.subtract(1);
return true; return true;
@@ -957,10 +1039,12 @@ @@ -958,10 +1040,12 @@
if (this.bK) { if (this.bK) {
if (!this.isAlive()) { if (!this.isAlive()) {
@ -187,7 +187,7 @@
this.unleash(true, true); this.unleash(true, true);
} }
} }
@@ -971,7 +1055,9 @@ @@ -972,7 +1056,9 @@
this.bK = false; this.bK = false;
this.leashHolder = null; this.leashHolder = null;
if (!this.world.isClientSide && flag1) { if (!this.world.isClientSide && flag1) {
@ -197,7 +197,7 @@
} }
if (!this.world.isClientSide && flag && this.world instanceof WorldServer) { if (!this.world.isClientSide && flag && this.world instanceof WorldServer) {
@@ -1041,6 +1127,7 @@ @@ -1042,6 +1128,7 @@
this.setLeashHolder(entityleash, true); this.setLeashHolder(entityleash, true);
} else { } else {
@ -205,7 +205,7 @@
this.unleash(false, true); this.unleash(false, true);
} }
} }
@@ -1136,7 +1223,14 @@ @@ -1137,7 +1224,14 @@
int j = EnchantmentManager.getFireAspectEnchantmentLevel(this); int j = EnchantmentManager.getFireAspectEnchantmentLevel(this);
if (j > 0) { if (j > 0) {

View File

@ -1,21 +1,6 @@
--- a/net/minecraft/server/EntityIronGolem.java --- a/net/minecraft/server/EntityIronGolem.java
+++ b/net/minecraft/server/EntityIronGolem.java +++ b/net/minecraft/server/EntityIronGolem.java
@@ -28,8 +28,12 @@ @@ -66,7 +66,7 @@
this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
this.targetSelector.a(1, new PathfinderGoalDefendVillage(this));
this.targetSelector.a(2, new PathfinderGoalHurtByTarget(this, false, new Class[0]));
- this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityInsentient.class, 10, false, true, (entityinsentient) -> {
- return entityinsentient != null && IMonster.e.test(entityinsentient) && !(entityinsentient instanceof EntityCreeper);
+ // CraftBukkit start - decompile error
+ this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityInsentient.class, 10, false, true, new Predicate<EntityInsentient>() {
+ public boolean test(@Nullable EntityInsentient entityinsentient) {
+ return entityinsentient != null && IMonster.e.test(entityinsentient) && !(entityinsentient instanceof EntityCreeper);
+ }
+ // CraftBukkit end
}));
}
@@ -67,7 +71,7 @@
protected void C(Entity entity) { protected void C(Entity entity) {
if (entity instanceof IMonster && !(entity instanceof EntityCreeper) && this.getRandom().nextInt(20) == 0) { if (entity instanceof IMonster && !(entity instanceof EntityCreeper) && this.getRandom().nextInt(20) == 0) {

View File

@ -1,7 +1,7 @@
--- a/net/minecraft/server/EntityMinecartAbstract.java --- a/net/minecraft/server/EntityMinecartAbstract.java
+++ b/net/minecraft/server/EntityMinecartAbstract.java +++ b/net/minecraft/server/EntityMinecartAbstract.java
@@ -8,6 +8,15 @@ @@ -6,6 +6,15 @@
import java.util.function.ToIntFunction; import java.util.List;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
@ -16,7 +16,7 @@
public abstract class EntityMinecartAbstract extends Entity implements INamableTileEntity { public abstract class EntityMinecartAbstract extends Entity implements INamableTileEntity {
private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityMinecartAbstract.class, DataWatcherRegistry.b); private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityMinecartAbstract.class, DataWatcherRegistry.b);
@@ -25,6 +34,17 @@ @@ -23,6 +32,17 @@
private double aA; private double aA;
private double aB; private double aB;
@ -34,7 +34,7 @@
protected EntityMinecartAbstract(EntityTypes<?> entitytypes, World world) { protected EntityMinecartAbstract(EntityTypes<?> entitytypes, World world) {
super(entitytypes, world); super(entitytypes, world);
this.j = true; this.j = true;
@@ -92,6 +112,19 @@ @@ -90,6 +110,19 @@
if (this.isInvulnerable(damagesource)) { if (this.isInvulnerable(damagesource)) {
return false; return false;
} else { } else {
@ -54,7 +54,7 @@
this.k(-this.u()); this.k(-this.u());
this.d(10); this.d(10);
this.aA(); this.aA();
@@ -99,6 +132,15 @@ @@ -97,6 +130,15 @@
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild; boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild;
if (flag || this.getDamage() > 40.0F) { if (flag || this.getDamage() > 40.0F) {
@ -70,7 +70,7 @@
this.ejectPassengers(); this.ejectPassengers();
if (flag && !this.hasCustomName()) { if (flag && !this.hasCustomName()) {
this.die(); this.die();
@@ -137,6 +179,14 @@ @@ -135,6 +177,14 @@
} }
public void tick() { public void tick() {
@ -85,7 +85,7 @@
if (this.getType() > 0) { if (this.getType() > 0) {
this.d(this.getType() - 1); this.d(this.getType() - 1);
} }
@@ -151,6 +201,8 @@ @@ -149,6 +199,8 @@
int i; int i;
@ -94,7 +94,7 @@
if (!this.world.isClientSide && this.world instanceof WorldServer) { if (!this.world.isClientSide && this.world instanceof WorldServer) {
this.world.methodProfiler.enter("portal"); this.world.methodProfiler.enter("portal");
MinecraftServer minecraftserver = this.world.getMinecraftServer(); MinecraftServer minecraftserver = this.world.getMinecraftServer();
@@ -190,6 +242,7 @@ @@ -188,6 +240,7 @@
this.world.methodProfiler.exit(); this.world.methodProfiler.exit();
} }
@ -102,7 +102,7 @@
if (this.world.isClientSide) { if (this.world.isClientSide) {
if (this.aw > 0) { if (this.aw > 0) {
@@ -257,6 +310,18 @@ @@ -255,6 +308,18 @@
} }
this.setYawPitch(this.yaw, this.pitch); this.setYawPitch(this.yaw, this.pitch);
@ -119,9 +119,9 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
if (this.v() == EntityMinecartAbstract.EnumMinecartType.RIDEABLE && this.motX * this.motX + this.motZ * this.motZ > 0.01D) { if (this.v() == EntityMinecartAbstract.EnumMinecartType.RIDEABLE && this.motX * this.motX + this.motZ * this.motZ > 0.01D) {
List list = this.world.getEntities(this, this.getBoundingBox().grow(0.20000000298023224D, 0.0D, 0.20000000298023224D), IEntitySelector.a(this)); List<Entity> list = this.world.getEntities(this, this.getBoundingBox().grow(0.20000000298023224D, 0.0D, 0.20000000298023224D), IEntitySelector.a(this));
@@ -265,8 +330,24 @@ @@ -263,8 +328,24 @@
Entity entity = (Entity) list.get(l); Entity entity = (Entity) list.get(l);
if (!(entity instanceof EntityHuman) && !(entity instanceof EntityIronGolem) && !(entity instanceof EntityMinecartAbstract) && !this.isVehicle() && !entity.isPassenger()) { if (!(entity instanceof EntityHuman) && !(entity instanceof EntityIronGolem) && !(entity instanceof EntityMinecartAbstract) && !this.isVehicle() && !entity.isPassenger()) {
@ -146,7 +146,7 @@
entity.collide(this); entity.collide(this);
} }
} }
@@ -278,6 +359,14 @@ @@ -276,6 +357,14 @@
Entity entity1 = (Entity) iterator.next(); Entity entity1 = (Entity) iterator.next();
if (!this.w(entity1) && entity1.isCollidable() && entity1 instanceof EntityMinecartAbstract) { if (!this.w(entity1) && entity1.isCollidable() && entity1 instanceof EntityMinecartAbstract) {
@ -161,7 +161,7 @@
entity1.collide(this); entity1.collide(this);
} }
} }
@@ -288,7 +377,7 @@ @@ -286,7 +375,7 @@
} }
protected double p() { protected double p() {
@ -170,7 +170,7 @@
} }
public void a(int i, int j, int k, boolean flag) {} public void a(int i, int j, int k, boolean flag) {}
@@ -299,16 +388,20 @@ @@ -297,16 +386,20 @@
this.motX = MathHelper.a(this.motX, -d0, d0); this.motX = MathHelper.a(this.motX, -d0, d0);
this.motZ = MathHelper.a(this.motZ, -d0, d0); this.motZ = MathHelper.a(this.motZ, -d0, d0);
if (this.onGround) { if (this.onGround) {
@ -197,7 +197,7 @@
} }
} }
@@ -493,7 +586,7 @@ @@ -491,7 +584,7 @@
} }
protected void r() { protected void r() {
@ -206,7 +206,7 @@
this.motX *= 0.996999979019165D; this.motX *= 0.996999979019165D;
this.motY *= 0.0D; this.motY *= 0.0D;
this.motZ *= 0.996999979019165D; this.motZ *= 0.996999979019165D;
@@ -590,6 +683,14 @@ @@ -588,6 +681,14 @@
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
if (!entity.noclip && !this.noclip) { if (!entity.noclip && !this.noclip) {
if (!this.w(entity)) { if (!this.w(entity)) {
@ -221,7 +221,7 @@
double d0 = entity.locX - this.locX; double d0 = entity.locX - this.locX;
double d1 = entity.locZ - this.locZ; double d1 = entity.locZ - this.locZ;
double d2 = d0 * d0 + d1 * d1; double d2 = d0 * d0 + d1 * d1;
@@ -736,4 +837,26 @@ @@ -734,4 +835,26 @@
return this.i; return this.i;
} }
} }

View File

@ -5,8 +5,8 @@
public EntityPainting(World world) { public EntityPainting(World world) {
super(EntityTypes.PAINTING, world); super(EntityTypes.PAINTING, world);
+ // CraftBukkit start - generate a non-null painting + // CraftBukkit start - generate a non-null painting
+ ArrayList arraylist = Lists.newArrayList(Paintings.a); + List<Paintings> list = Lists.newArrayList(Paintings.a);
+ this.art = (Paintings) arraylist.get(this.random.nextInt(arraylist.size())); + this.art = (Paintings) list.get(this.random.nextInt(list.size()));
+ // CraftBukkit end + // CraftBukkit end
} }

View File

@ -1,14 +1,6 @@
--- a/net/minecraft/server/EntityParrot.java --- a/net/minecraft/server/EntityParrot.java
+++ b/net/minecraft/server/EntityParrot.java +++ b/net/minecraft/server/EntityParrot.java
@@ -16,14 +16,14 @@ @@ -21,7 +21,7 @@
public class EntityParrot extends EntityPerchable implements EntityBird {
private static final DataWatcherObject<Integer> bL = DataWatcher.a(EntityParrot.class, DataWatcherRegistry.b);
- private static final Predicate<EntityInsentient> bM = new Predicate() {
+ private static final Predicate<EntityInsentient> bM = new Predicate<EntityInsentient>() { // CraftBukkit - decompile error
public boolean test(@Nullable EntityInsentient entityinsentient) {
return entityinsentient != null && EntityParrot.bP.containsKey(entityinsentient.P());
}
}; };
private static final Item bN = Items.COOKIE; private static final Item bN = Items.COOKIE;
private static final Set<Item> bO = Sets.newHashSet(new Item[] { Items.WHEAT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.BEETROOT_SEEDS}); private static final Set<Item> bO = Sets.newHashSet(new Item[] { Items.WHEAT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.BEETROOT_SEEDS});
@ -17,7 +9,7 @@
hashmap.put(EntityTypes.BLAZE, SoundEffects.ENTITY_PARROT_IMITATE_BLAZE); hashmap.put(EntityTypes.BLAZE, SoundEffects.ENTITY_PARROT_IMITATE_BLAZE);
hashmap.put(EntityTypes.CAVE_SPIDER, SoundEffects.ENTITY_PARROT_IMITATE_SPIDER); hashmap.put(EntityTypes.CAVE_SPIDER, SoundEffects.ENTITY_PARROT_IMITATE_SPIDER);
hashmap.put(EntityTypes.CREEPER, SoundEffects.ENTITY_PARROT_IMITATE_CREEPER); hashmap.put(EntityTypes.CREEPER, SoundEffects.ENTITY_PARROT_IMITATE_CREEPER);
@@ -170,7 +170,7 @@ @@ -168,7 +168,7 @@
} }
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
@ -26,7 +18,7 @@
this.c(entityhuman); this.c(entityhuman);
this.s(true); this.s(true);
this.world.broadcastEntityEffect(this, (byte) 7); this.world.broadcastEntityEffect(this, (byte) 7);
@@ -186,7 +186,7 @@ @@ -184,7 +184,7 @@
itemstack.subtract(1); itemstack.subtract(1);
} }
@ -35,7 +27,7 @@
if (entityhuman.u() || !this.bl()) { if (entityhuman.u() || !this.bl()) {
this.damageEntity(DamageSource.playerAttack(entityhuman), Float.MAX_VALUE); this.damageEntity(DamageSource.playerAttack(entityhuman), Float.MAX_VALUE);
} }
@@ -306,7 +306,8 @@ @@ -304,7 +304,8 @@
return false; return false;
} else { } else {
if (this.goalSit != null) { if (this.goalSit != null) {

View File

@ -1,31 +1,6 @@
--- a/net/minecraft/server/EntityPhantom.java --- a/net/minecraft/server/EntityPhantom.java
+++ b/net/minecraft/server/EntityPhantom.java +++ b/net/minecraft/server/EntityPhantom.java
@@ -28,10 +28,11 @@ @@ -197,7 +197,7 @@
}
protected void n() {
- this.goalSelector.a(1, new EntityPhantom.c(null));
- this.goalSelector.a(2, new EntityPhantom.i(null));
- this.goalSelector.a(3, new EntityPhantom.e(null));
- this.targetSelector.a(1, new EntityPhantom.b(null));
+ // CraftBukkit - decompile errors
+ this.goalSelector.a(1, new EntityPhantom.c());
+ this.goalSelector.a(2, new EntityPhantom.i());
+ this.goalSelector.a(3, new EntityPhantom.e());
+ this.targetSelector.a(1, new EntityPhantom.b());
}
protected void initAttributes() {
@@ -186,7 +187,7 @@
} else {
this.b = 60;
AxisAlignedBB axisalignedbb = EntityPhantom.this.getBoundingBox().grow(16.0D, 64.0D, 16.0D);
- List list = EntityPhantom.this.world.a(EntityHuman.class, axisalignedbb);
+ List<EntityHuman> list = EntityPhantom.this.world.a(EntityHuman.class, axisalignedbb); // CraftBukkit - decompile error
if (!list.isEmpty()) {
list.sort((entityhuman, entityhuman1) -> {
@@ -198,7 +199,7 @@
EntityHuman entityhuman = (EntityHuman) iterator.next(); EntityHuman entityhuman = (EntityHuman) iterator.next();
if (PathfinderGoalTarget.a(EntityPhantom.this, entityhuman, false, false)) { if (PathfinderGoalTarget.a(EntityPhantom.this, entityhuman, false, false)) {

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntityPlayer.java --- a/net/minecraft/server/EntityPlayer.java
+++ b/net/minecraft/server/EntityPlayer.java +++ b/net/minecraft/server/EntityPlayer.java
@@ -15,10 +15,28 @@ @@ -12,10 +12,28 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -30,7 +30,7 @@
public PlayerConnection playerConnection; public PlayerConnection playerConnection;
public final MinecraftServer server; public final MinecraftServer server;
public final PlayerInteractManager playerInteractManager; public final PlayerInteractManager playerInteractManager;
@@ -54,6 +72,20 @@ @@ -51,6 +69,20 @@
public int ping; public int ping;
public boolean viewingCredits; public boolean viewingCredits;
@ -51,7 +51,7 @@
public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) { public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) {
super((World) worldserver, gameprofile); super((World) worldserver, gameprofile);
playerinteractmanager.player = this; playerinteractmanager.player = this;
@@ -64,8 +96,50 @@ @@ -61,8 +93,50 @@
this.cf = minecraftserver.getPlayerList().h(this); this.cf = minecraftserver.getPlayerList().h(this);
this.Q = 1.0F; this.Q = 1.0F;
this.a(worldserver); this.a(worldserver);
@ -102,7 +102,7 @@
private void a(WorldServer worldserver) { private void a(WorldServer worldserver) {
BlockPosition blockposition = worldserver.getSpawn(); BlockPosition blockposition = worldserver.getSpawn();
@@ -132,6 +206,7 @@ @@ -129,6 +203,7 @@
if (nbttagcompound.hasKeyOfType("recipeBook", 10)) { if (nbttagcompound.hasKeyOfType("recipeBook", 10)) {
this.recipeBook.a(nbttagcompound.getCompound("recipeBook")); this.recipeBook.a(nbttagcompound.getCompound("recipeBook"));
} }
@ -110,7 +110,7 @@
} }
@@ -151,7 +226,20 @@ @@ -148,7 +223,20 @@
Entity entity = this.getRootVehicle(); Entity entity = this.getRootVehicle();
Entity entity1 = this.getVehicle(); Entity entity1 = this.getVehicle();
@ -132,7 +132,7 @@
NBTTagCompound nbttagcompound2 = new NBTTagCompound(); NBTTagCompound nbttagcompound2 = new NBTTagCompound();
NBTTagCompound nbttagcompound3 = new NBTTagCompound(); NBTTagCompound nbttagcompound3 = new NBTTagCompound();
@@ -162,8 +250,34 @@ @@ -159,8 +247,34 @@
} }
nbttagcompound.set("recipeBook", this.recipeBook.e()); nbttagcompound.set("recipeBook", this.recipeBook.e());
@ -167,7 +167,7 @@
public void a(int i) { public void a(int i) {
float f = (float) this.getExpToLevel(); float f = (float) this.getExpToLevel();
float f1 = (f - 1.0F) / f; float f1 = (f - 1.0F) / f;
@@ -210,6 +324,11 @@ @@ -207,6 +321,11 @@
} }
public void tick() { public void tick() {
@ -179,7 +179,7 @@
this.playerInteractManager.a(); this.playerInteractManager.a();
--this.invulnerableTicks; --this.invulnerableTicks;
if (this.noDamageTicks > 0) { if (this.noDamageTicks > 0) {
@@ -275,7 +394,7 @@ @@ -272,7 +391,7 @@
} }
if (this.getHealth() != this.lastHealthSent || this.lastFoodSent != this.foodData.getFoodLevel() || this.foodData.getSaturationLevel() == 0.0F != this.cp) { if (this.getHealth() != this.lastHealthSent || this.lastFoodSent != this.foodData.getFoodLevel() || this.foodData.getSaturationLevel() == 0.0F != this.cp) {
@ -188,7 +188,7 @@
this.lastHealthSent = this.getHealth(); this.lastHealthSent = this.getHealth();
this.lastFoodSent = this.foodData.getFoodLevel(); this.lastFoodSent = this.foodData.getFoodLevel();
this.cp = this.foodData.getSaturationLevel() == 0.0F; this.cp = this.foodData.getSaturationLevel() == 0.0F;
@@ -306,6 +425,12 @@ @@ -303,6 +422,12 @@
this.a(IScoreboardCriteria.XP, MathHelper.f((float) this.cm)); this.a(IScoreboardCriteria.XP, MathHelper.f((float) this.cm));
} }
@ -201,7 +201,7 @@
if (this.expLevel != this.cl) { if (this.expLevel != this.cl) {
this.cl = this.expLevel; this.cl = this.expLevel;
this.a(IScoreboardCriteria.LEVEL, MathHelper.f((float) this.cl)); this.a(IScoreboardCriteria.LEVEL, MathHelper.f((float) this.cl));
@@ -320,6 +445,16 @@ @@ -317,6 +442,16 @@
CriterionTriggers.p.a(this); CriterionTriggers.p.a(this);
} }
@ -218,7 +218,7 @@
} catch (Throwable throwable) { } catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Ticking player"); CrashReport crashreport = CrashReport.a(throwable, "Ticking player");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Player being ticked"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Player being ticked");
@@ -330,24 +465,50 @@ @@ -327,16 +462,43 @@
} }
private void a(IScoreboardCriteria iscoreboardcriteria, int i) { private void a(IScoreboardCriteria iscoreboardcriteria, int i) {
@ -265,16 +265,7 @@
this.playerConnection.a((Packet) (new PacketPlayOutCombatEvent(this.getCombatTracker(), PacketPlayOutCombatEvent.EnumCombatEventType.ENTITY_DIED, ichatbasecomponent)), (future) -> { this.playerConnection.a((Packet) (new PacketPlayOutCombatEvent(this.getCombatTracker(), PacketPlayOutCombatEvent.EnumCombatEventType.ENTITY_DIED, ichatbasecomponent)), (future) -> {
if (!future.isSuccess()) { if (!future.isSuccess()) {
- boolean flag = true; @@ -367,12 +529,17 @@
String s = ichatbasecomponent.a(256);
ChatMessage chatmessage = new ChatMessage("death.attack.message_too_long", new Object[] { (new ChatComponentText(s)).a(EnumChatFormat.YELLOW)});
IChatBaseComponent ichatbasecomponent1 = (new ChatMessage("death.attack.even_more_magic", new Object[] { this.getScoreboardDisplayName()})).a((chatmodifier) -> {
- chatmodifier.setChatHoverable(new ChatHoverable(ChatHoverable.EnumHoverAction.SHOW_TEXT, ichatbasecomponent));
+ chatmodifier.setChatHoverable(new ChatHoverable(ChatHoverable.EnumHoverAction.SHOW_TEXT, chatmessage));
});
this.playerConnection.sendPacket(new PacketPlayOutCombatEvent(this.getCombatTracker(), PacketPlayOutCombatEvent.EnumCombatEventType.ENTITY_DIED, ichatbasecomponent1));
@@ -370,12 +531,17 @@
} }
this.releaseShoulderEntities(); this.releaseShoulderEntities();
@ -296,7 +287,7 @@
EntityLiving entityliving = this.cv(); EntityLiving entityliving = this.cv();
if (entityliving != null) { if (entityliving != null) {
@@ -398,10 +564,12 @@ @@ -395,10 +562,12 @@
String s = this.getName(); String s = this.getName();
String s1 = entity.getName(); String s1 = entity.getName();
@ -311,7 +302,7 @@
} else { } else {
this.a(StatisticList.MOB_KILLS); this.a(StatisticList.MOB_KILLS);
} }
@@ -419,7 +587,8 @@ @@ -416,7 +585,8 @@
int i = scoreboardteam.getColor().b(); int i = scoreboardteam.getColor().b();
if (i >= 0 && i < aiscoreboardcriteria.length) { if (i >= 0 && i < aiscoreboardcriteria.length) {
@ -321,7 +312,7 @@
} }
} }
@@ -461,12 +630,14 @@ @@ -458,12 +628,14 @@
} }
private boolean canPvP() { private boolean canPvP() {
@ -338,7 +329,7 @@
if (this.dimension == DimensionManager.OVERWORLD && dimensionmanager == DimensionManager.NETHER) { if (this.dimension == DimensionManager.OVERWORLD && dimensionmanager == DimensionManager.NETHER) {
this.cC = new Vec3D(this.locX, this.locY, this.locZ); this.cC = new Vec3D(this.locX, this.locY, this.locZ);
} else if (this.dimension != DimensionManager.NETHER && dimensionmanager != DimensionManager.OVERWORLD) { } else if (this.dimension != DimensionManager.NETHER && dimensionmanager != DimensionManager.OVERWORLD) {
@@ -474,6 +645,7 @@ @@ -471,6 +643,7 @@
} }
if (this.dimension == DimensionManager.THE_END && dimensionmanager == DimensionManager.THE_END) { if (this.dimension == DimensionManager.THE_END && dimensionmanager == DimensionManager.THE_END) {
@ -346,7 +337,7 @@
this.world.kill(this); this.world.kill(this);
if (!this.viewingCredits) { if (!this.viewingCredits) {
this.viewingCredits = true; this.viewingCredits = true;
@@ -487,7 +659,10 @@ @@ -484,7 +657,10 @@
dimensionmanager = DimensionManager.THE_END; dimensionmanager = DimensionManager.THE_END;
} }
@ -358,7 +349,7 @@
this.playerConnection.sendPacket(new PacketPlayOutWorldEvent(1032, BlockPosition.ZERO, 0, false)); this.playerConnection.sendPacket(new PacketPlayOutWorldEvent(1032, BlockPosition.ZERO, 0, false));
this.lastSentExp = -1; this.lastSentExp = -1;
this.lastHealthSent = -1.0F; this.lastHealthSent = -1.0F;
@@ -533,6 +708,7 @@ @@ -530,6 +706,7 @@
} }
public void a(boolean flag, boolean flag1, boolean flag2) { public void a(boolean flag, boolean flag1, boolean flag2) {
@ -366,7 +357,7 @@
if (this.isSleeping()) { if (this.isSleeping()) {
this.getWorldServer().getTracker().sendPacketToEntity(this, new PacketPlayOutAnimation(this, 2)); this.getWorldServer().getTracker().sendPacketToEntity(this, new PacketPlayOutAnimation(this, 2));
} }
@@ -611,23 +787,55 @@ @@ -608,23 +785,55 @@
this.playerConnection.sendPacket(new PacketPlayOutOpenSignEditor(tileentitysign.getPosition())); this.playerConnection.sendPacket(new PacketPlayOutOpenSignEditor(tileentitysign.getPosition()));
} }
@ -425,7 +416,7 @@
if (iinventory instanceof ILootable && ((ILootable) iinventory).getLootTable() != null && this.isSpectator()) { if (iinventory instanceof ILootable && ((ILootable) iinventory).getLootTable() != null && this.isSpectator()) {
this.a((new ChatMessage("container.spectatorCantOpen", new Object[0])).a(EnumChatFormat.RED), true); this.a((new ChatMessage("container.spectatorCantOpen", new Object[0])).a(EnumChatFormat.RED), true);
} else { } else {
@@ -641,18 +849,21 @@ @@ -638,18 +847,21 @@
if (itileinventory.isLocked() && !this.a(itileinventory.getLock()) && !this.isSpectator()) { if (itileinventory.isLocked() && !this.a(itileinventory.getLock()) && !this.isSpectator()) {
this.playerConnection.sendPacket(new PacketPlayOutChat(new ChatMessage("container.isLocked", new Object[] { iinventory.getScoreboardDisplayName()}), ChatMessageType.GAME_INFO)); this.playerConnection.sendPacket(new PacketPlayOutChat(new ChatMessage("container.isLocked", new Object[] { iinventory.getScoreboardDisplayName()}), ChatMessageType.GAME_INFO));
this.playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(SoundEffects.BLOCK_CHEST_LOCKED, SoundCategory.BLOCKS, this.locX, this.locY, this.locZ, 1.0F, 1.0F)); this.playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(SoundEffects.BLOCK_CHEST_LOCKED, SoundCategory.BLOCKS, this.locX, this.locY, this.locZ, 1.0F, 1.0F));
@ -449,7 +440,7 @@
this.activeContainer.windowId = this.containerCounter; this.activeContainer.windowId = this.containerCounter;
this.activeContainer.addSlotListener(this); this.activeContainer.addSlotListener(this);
@@ -660,8 +871,14 @@ @@ -657,8 +869,14 @@
} }
public void openTrade(IMerchant imerchant) { public void openTrade(IMerchant imerchant) {
@ -465,7 +456,7 @@
this.activeContainer.windowId = this.containerCounter; this.activeContainer.windowId = this.containerCounter;
this.activeContainer.addSlotListener(this); this.activeContainer.addSlotListener(this);
InventoryMerchant inventorymerchant = ((ContainerMerchant) this.activeContainer).d(); InventoryMerchant inventorymerchant = ((ContainerMerchant) this.activeContainer).d();
@@ -681,13 +898,20 @@ @@ -678,13 +896,20 @@
} }
public void openHorseInventory(EntityHorseAbstract entityhorseabstract, IInventory iinventory) { public void openHorseInventory(EntityHorseAbstract entityhorseabstract, IInventory iinventory) {
@ -487,7 +478,7 @@
this.activeContainer.windowId = this.containerCounter; this.activeContainer.windowId = this.containerCounter;
this.activeContainer.addSlotListener(this); this.activeContainer.addSlotListener(this);
} }
@@ -728,6 +952,11 @@ @@ -725,6 +950,11 @@
public void a(Container container, NonNullList<ItemStack> nonnulllist) { public void a(Container container, NonNullList<ItemStack> nonnulllist) {
this.playerConnection.sendPacket(new PacketPlayOutWindowItems(container.windowId, nonnulllist)); this.playerConnection.sendPacket(new PacketPlayOutWindowItems(container.windowId, nonnulllist));
this.playerConnection.sendPacket(new PacketPlayOutSetSlot(-1, -1, this.inventory.getCarried())); this.playerConnection.sendPacket(new PacketPlayOutSetSlot(-1, -1, this.inventory.getCarried()));
@ -499,7 +490,7 @@
} }
public void setContainerData(Container container, int i, int j) { public void setContainerData(Container container, int i, int j) {
@@ -742,6 +971,7 @@ @@ -739,6 +969,7 @@
} }
public void closeInventory() { public void closeInventory() {
@ -507,7 +498,7 @@
this.playerConnection.sendPacket(new PacketPlayOutCloseWindow(this.activeContainer.windowId)); this.playerConnection.sendPacket(new PacketPlayOutCloseWindow(this.activeContainer.windowId));
this.m(); this.m();
} }
@@ -775,14 +1005,14 @@ @@ -772,14 +1003,14 @@
public void a(Statistic<?> statistic, int i) { public void a(Statistic<?> statistic, int i) {
this.cg.b(this, statistic, i); this.cg.b(this, statistic, i);
@ -524,7 +515,7 @@
} }
public int discoverRecipes(Collection<IRecipe> collection) { public int discoverRecipes(Collection<IRecipe> collection) {
@@ -830,8 +1060,17 @@ @@ -827,8 +1058,17 @@
public void triggerHealthUpdate() { public void triggerHealthUpdate() {
this.lastHealthSent = -1.0E8F; this.lastHealthSent = -1.0E8F;
@ -542,7 +533,7 @@
public void a(IChatBaseComponent ichatbasecomponent, boolean flag) { public void a(IChatBaseComponent ichatbasecomponent, boolean flag) {
this.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent, flag ? ChatMessageType.GAME_INFO : ChatMessageType.CHAT)); this.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent, flag ? ChatMessageType.GAME_INFO : ChatMessageType.CHAT));
} }
@@ -882,7 +1121,7 @@ @@ -879,7 +1119,7 @@
this.lastSentExp = -1; this.lastSentExp = -1;
this.lastHealthSent = -1.0F; this.lastHealthSent = -1.0F;
this.lastFoodSent = -1; this.lastFoodSent = -1;
@ -551,7 +542,7 @@
this.removeQueue.addAll(entityplayer.removeQueue); this.removeQueue.addAll(entityplayer.removeQueue);
this.cx = entityplayer.cx; this.cx = entityplayer.cx;
this.cC = entityplayer.cC; this.cC = entityplayer.cC;
@@ -941,6 +1180,18 @@ @@ -938,6 +1178,18 @@
} }
public void a(EnumGamemode enumgamemode) { public void a(EnumGamemode enumgamemode) {
@ -570,7 +561,7 @@
this.playerInteractManager.setGameMode(enumgamemode); this.playerInteractManager.setGameMode(enumgamemode);
this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(3, (float) enumgamemode.getId())); this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(3, (float) enumgamemode.getId()));
if (enumgamemode == EnumGamemode.SPECTATOR) { if (enumgamemode == EnumGamemode.SPECTATOR) {
@@ -988,6 +1239,17 @@ @@ -985,6 +1237,17 @@
} }
public void a(PacketPlayInSettings packetplayinsettings) { public void a(PacketPlayInSettings packetplayinsettings) {
@ -588,7 +579,7 @@
this.locale = packetplayinsettings.b(); this.locale = packetplayinsettings.b();
this.cs = packetplayinsettings.d(); this.cs = packetplayinsettings.d();
this.ct = packetplayinsettings.e(); this.ct = packetplayinsettings.e();
@@ -1023,13 +1285,13 @@ @@ -1020,13 +1283,13 @@
if (entity instanceof EntityHuman) { if (entity instanceof EntityHuman) {
this.playerConnection.sendPacket(new PacketPlayOutEntityDestroy(new int[] { entity.getId()})); this.playerConnection.sendPacket(new PacketPlayOutEntityDestroy(new int[] { entity.getId()}));
} else { } else {
@ -604,7 +595,7 @@
} }
protected void C() { protected void C() {
@@ -1053,7 +1315,7 @@ @@ -1050,7 +1313,7 @@
this.spectatedEntity = (Entity) (entity == null ? this : entity); this.spectatedEntity = (Entity) (entity == null ? this : entity);
if (entity1 != this.spectatedEntity) { if (entity1 != this.spectatedEntity) {
this.playerConnection.sendPacket(new PacketPlayOutCamera(this.spectatedEntity)); this.playerConnection.sendPacket(new PacketPlayOutCamera(this.spectatedEntity));
@ -613,7 +604,7 @@
} }
} }
@@ -1080,7 +1342,7 @@ @@ -1077,7 +1340,7 @@
@Nullable @Nullable
public IChatBaseComponent getPlayerListName() { public IChatBaseComponent getPlayerListName() {
@ -622,7 +613,7 @@
} }
public void a(EnumHand enumhand) { public void a(EnumHand enumhand) {
@@ -1097,12 +1359,17 @@ @@ -1094,12 +1357,17 @@
} }
public void J() { public void J() {
@ -640,7 +631,7 @@
} }
public AdvancementDataPlayer getAdvancementData() { public AdvancementDataPlayer getAdvancementData() {
@@ -1114,9 +1381,16 @@ @@ -1111,9 +1379,16 @@
return this.cC; return this.cC;
} }
@ -657,7 +648,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 {
@@ -1141,6 +1415,149 @@ @@ -1138,6 +1413,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

@ -25,7 +25,7 @@
@@ -114,6 +120,7 @@ @@ -114,6 +120,7 @@
private void a(MovingObjectPosition movingobjectposition, List<MobEffect> list) { private void a(MovingObjectPosition movingobjectposition, List<MobEffect> list) {
AxisAlignedBB axisalignedbb = this.getBoundingBox().grow(4.0D, 2.0D, 4.0D); AxisAlignedBB axisalignedbb = this.getBoundingBox().grow(4.0D, 2.0D, 4.0D);
List list1 = this.world.a(EntityLiving.class, axisalignedbb); List<EntityLiving> list1 = this.world.a(EntityLiving.class, axisalignedbb);
+ Map<LivingEntity, Double> affected = new HashMap<LivingEntity, Double>(); // CraftBukkit + Map<LivingEntity, Double> affected = new HashMap<LivingEntity, Double>(); // CraftBukkit
if (!list1.isEmpty()) { if (!list1.isEmpty()) {

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntitySheep.java --- a/net/minecraft/server/EntitySheep.java
+++ b/net/minecraft/server/EntitySheep.java +++ b/net/minecraft/server/EntitySheep.java
@@ -10,6 +10,12 @@ @@ -8,6 +8,12 @@
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -13,7 +13,7 @@
public class EntitySheep extends EntityAnimal { public class EntitySheep extends EntityAnimal {
private static final DataWatcherObject<Byte> bC = DataWatcher.a(EntitySheep.class, DataWatcherRegistry.a); private static final DataWatcherObject<Byte> bC = DataWatcher.a(EntitySheep.class, DataWatcherRegistry.a);
@@ -17,8 +23,15 @@ @@ -15,8 +21,15 @@
public boolean canUse(EntityHuman entityhuman) { public boolean canUse(EntityHuman entityhuman) {
return false; return false;
} }
@ -30,7 +30,7 @@
enummap.put(EnumColor.WHITE, Blocks.WHITE_WOOL); enummap.put(EnumColor.WHITE, Blocks.WHITE_WOOL);
enummap.put(EnumColor.ORANGE, Blocks.ORANGE_WOOL); enummap.put(EnumColor.ORANGE, Blocks.ORANGE_WOOL);
enummap.put(EnumColor.MAGENTA, Blocks.MAGENTA_WOOL); enummap.put(EnumColor.MAGENTA, Blocks.MAGENTA_WOOL);
@@ -143,11 +156,22 @@ @@ -141,11 +154,22 @@
if (itemstack.getItem() == Items.SHEARS && !this.isSheared() && !this.isBaby()) { if (itemstack.getItem() == Items.SHEARS && !this.isSheared() && !this.isBaby()) {
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
@ -53,7 +53,7 @@
if (entityitem != null) { if (entityitem != null) {
entityitem.motY += (double) (this.random.nextFloat() * 0.05F); entityitem.motY += (double) (this.random.nextFloat() * 0.05F);
@@ -232,6 +256,12 @@ @@ -230,6 +254,12 @@
} }
public void x() { public void x() {
@ -66,7 +66,7 @@
this.setSheared(false); this.setSheared(false);
if (this.isBaby()) { if (this.isBaby()) {
this.setAge(60); this.setAge(60);
@@ -252,6 +282,7 @@ @@ -250,6 +280,7 @@
this.container.setItem(0, new ItemStack(ItemDye.a(enumcolor))); this.container.setItem(0, new ItemStack(ItemDye.a(enumcolor)));
this.container.setItem(1, new ItemStack(ItemDye.a(enumcolor1))); this.container.setItem(1, new ItemStack(ItemDye.a(enumcolor1)));

View File

@ -1,8 +1,8 @@
--- a/net/minecraft/server/EntityShulker.java --- a/net/minecraft/server/EntityShulker.java
+++ b/net/minecraft/server/EntityShulker.java +++ b/net/minecraft/server/EntityShulker.java
@@ -6,6 +6,10 @@ @@ -5,6 +5,10 @@
import java.util.Optional;
import java.util.UUID; import java.util.UUID;
import java.util.function.Predicate;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.Location; +import org.bukkit.Location;
@ -11,16 +11,7 @@
public class EntityShulker extends EntityGolem implements IMonster { public class EntityShulker extends EntityGolem implements IMonster {
@@ -44,7 +48,7 @@ @@ -320,8 +324,17 @@
protected void n() {
this.goalSelector.a(1, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
this.goalSelector.a(4, new EntityShulker.a());
- this.goalSelector.a(7, new EntityShulker.e(null));
+ this.goalSelector.a(7, new EntityShulker.e()); // CraftBukkit - decompile error
this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, true, new Class[0]));
this.targetSelector.a(2, new EntityShulker.d(this));
@@ -321,8 +325,17 @@
EnumDirection enumdirection = aenumdirection[k]; EnumDirection enumdirection = aenumdirection[k];
if (this.world.q(blockposition1.shift(enumdirection))) { if (this.world.q(blockposition1.shift(enumdirection))) {
@ -40,7 +31,7 @@
break; break;
} }
} }
@@ -367,6 +380,7 @@ @@ -366,6 +379,7 @@
this.locX = (double) blockposition.getX() + 0.5D; this.locX = (double) blockposition.getX() + 0.5D;
this.locY = (double) blockposition.getY(); this.locY = (double) blockposition.getY();
this.locZ = (double) blockposition.getZ() + 0.5D; this.locZ = (double) blockposition.getZ() + 0.5D;

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntityShulkerBullet.java --- a/net/minecraft/server/EntityShulkerBullet.java
+++ b/net/minecraft/server/EntityShulkerBullet.java +++ b/net/minecraft/server/EntityShulkerBullet.java
@@ -42,8 +42,29 @@ @@ -41,8 +41,29 @@
this.target = entity; this.target = entity;
this.c = EnumDirection.UP; this.c = EnumDirection.UP;
this.a(enumdirection_enumaxis); this.a(enumdirection_enumaxis);
@ -30,7 +30,7 @@
public SoundCategory bV() { public SoundCategory bV() {
return SoundCategory.HOSTILE; return SoundCategory.HOSTILE;
} }
@@ -287,6 +308,7 @@ @@ -286,6 +307,7 @@
} }
protected void a(MovingObjectPosition movingobjectposition) { protected void a(MovingObjectPosition movingobjectposition) {
@ -38,7 +38,7 @@
if (movingobjectposition.entity == null) { if (movingobjectposition.entity == null) {
((WorldServer) this.world).a(Particles.u, this.locX, this.locY, this.locZ, 2, 0.2D, 0.2D, 0.2D, 0.0D); ((WorldServer) this.world).a(Particles.u, this.locX, this.locY, this.locZ, 2, 0.2D, 0.2D, 0.2D, 0.0D);
this.a(SoundEffects.ENTITY_SHULKER_BULLET_HIT, 1.0F, 1.0F); this.a(SoundEffects.ENTITY_SHULKER_BULLET_HIT, 1.0F, 1.0F);
@@ -296,7 +318,7 @@ @@ -295,7 +317,7 @@
if (flag) { if (flag) {
this.a(this.shooter, movingobjectposition.entity); this.a(this.shooter, movingobjectposition.entity);
if (movingobjectposition.entity instanceof EntityLiving) { if (movingobjectposition.entity instanceof EntityLiving) {

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntitySkeletonAbstract.java --- a/net/minecraft/server/EntitySkeletonAbstract.java
+++ b/net/minecraft/server/EntitySkeletonAbstract.java +++ b/net/minecraft/server/EntitySkeletonAbstract.java
@@ -3,12 +3,13 @@ @@ -3,6 +3,7 @@
import java.time.LocalDate; import java.time.LocalDate;
import java.time.temporal.ChronoField; import java.time.temporal.ChronoField;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -8,13 +8,6 @@
public abstract class EntitySkeletonAbstract extends EntityMonster implements IRangedEntity { public abstract class EntitySkeletonAbstract extends EntityMonster implements IRangedEntity {
private static final DataWatcherObject<Boolean> a = DataWatcher.a(EntitySkeletonAbstract.class, DataWatcherRegistry.i);
private final PathfinderGoalBowShoot<EntitySkeletonAbstract> b = new PathfinderGoalBowShoot(this, 1.0D, 20, 15.0F);
- private final PathfinderGoalMeleeAttack c = new PathfinderGoalMeleeAttack(this, 1.2D, flag) {
+ private final PathfinderGoalMeleeAttack c = new PathfinderGoalMeleeAttack(this, 1.2D, false) { // CraftBukkit - decompile error
public void d() {
super.d();
EntitySkeletonAbstract.this.s(false);
@@ -78,7 +79,14 @@ @@ -78,7 +79,14 @@
} }

View File

@ -9,17 +9,17 @@
private final Map<Class<?>, List<T>> b = Maps.newHashMap(); private final Map<Class<?>, List<T>> b = Maps.newHashMap();
private final Set<Class<?>> c = Sets.newIdentityHashSet(); private final Set<Class<?>> c = Sets.newIdentityHashSet();
private final Class<T> d; private final Class<T> d;
@@ -41,7 +41,7 @@ @@ -35,7 +35,7 @@
Object object = iterator.next();
if (oclass.isAssignableFrom(object.getClass())) { protected void a(Class<?> oclass) {
- this.a(object, oclass); EntitySlice.a.add(oclass);
+ this.a((T) object, oclass); - Iterator iterator = this.e.iterator();
} + Iterator<T> iterator = this.e.iterator(); // CraftBukkit - decompile error
}
while (iterator.hasNext()) {
T t0 = iterator.next();
@@ -78,7 +78,7 @@ @@ -78,7 +78,7 @@
List list = (List) this.b.get(oclass); List<T> list = (List) this.b.get(oclass);
if (list == null) { if (list == null) {
- this.b.put(oclass, Lists.newArrayList(new Object[] { t0})); - this.b.put(oclass, Lists.newArrayList(new Object[] { t0}));
@ -27,3 +27,12 @@
} else { } else {
list.add(t0); list.add(t0);
} }
@@ -86,7 +86,7 @@
}
public boolean remove(Object object) {
- T t0 = object;
+ T t0 = (T) object; // CraftBukkit - decompile error
boolean flag = false;
Iterator iterator = this.c.iterator();

View File

@ -14,7 +14,7 @@
@@ -55,7 +59,7 @@ @@ -55,7 +59,7 @@
} }
if (this.world.getBiome(new BlockPosition(i, 0, k)).c(new BlockPosition(i, j, k)) > 1.0F) { if (this.world.getBiome(new BlockPosition(i, 0, k)).getAdjustedTemperature(new BlockPosition(i, j, k)) > 1.0F) {
- this.damageEntity(DamageSource.BURN, 1.0F); - this.damageEntity(DamageSource.BURN, 1.0F);
+ this.damageEntity(CraftEventFactory.MELTING, 1.0F); // CraftBukkit - DamageSource.BURN -> CraftEventFactory.MELTING + this.damageEntity(CraftEventFactory.MELTING, 1.0F); // CraftBukkit - DamageSource.BURN -> CraftEventFactory.MELTING
} }
@ -23,7 +23,7 @@
@@ -71,7 +75,7 @@ @@ -71,7 +75,7 @@
BlockPosition blockposition = new BlockPosition(i, j, k); BlockPosition blockposition = new BlockPosition(i, j, k);
if (this.world.getType(blockposition).isAir() && this.world.getBiome(blockposition).c(blockposition) < 0.8F && iblockdata.canPlace(this.world, blockposition)) { if (this.world.getType(blockposition).isAir() && this.world.getBiome(blockposition).getAdjustedTemperature(blockposition) < 0.8F && iblockdata.canPlace(this.world, blockposition)) {
- this.world.setTypeUpdate(blockposition, iblockdata); - this.world.setTypeUpdate(blockposition, iblockdata);
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this.world, blockposition, iblockdata, this); // CraftBukkit + org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this.world, blockposition, iblockdata, this); // CraftBukkit
} }

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntityTippedArrow.java --- a/net/minecraft/server/EntityTippedArrow.java
+++ b/net/minecraft/server/EntityTippedArrow.java +++ b/net/minecraft/server/EntityTippedArrow.java
@@ -116,6 +116,25 @@ @@ -115,6 +115,25 @@
} }
} }
@ -26,7 +26,7 @@
public int getColor() { public int getColor() {
return (Integer) this.datawatcher.get(EntityTippedArrow.g); return (Integer) this.datawatcher.get(EntityTippedArrow.g);
} }
@@ -180,7 +199,7 @@ @@ -179,7 +198,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
mobeffect = (MobEffect) iterator.next(); mobeffect = (MobEffect) iterator.next();
@ -35,7 +35,7 @@
} }
if (!this.effects.isEmpty()) { if (!this.effects.isEmpty()) {
@@ -188,7 +207,7 @@ @@ -187,7 +206,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
mobeffect = (MobEffect) iterator.next(); mobeffect = (MobEffect) iterator.next();

View File

@ -64,7 +64,7 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
this.c(); this.c();
object = new PacketPlayOutEntityTeleport(this.tracker); packet1 = new PacketPlayOutEntityTeleport(this.tracker);
} }
@@ -181,6 +205,7 @@ @@ -181,6 +205,7 @@
} }
@ -112,7 +112,7 @@
} }
@@ -224,6 +270,11 @@ @@ -224,6 +270,11 @@
Set set = attributemapserver.getAttributes(); Set<AttributeInstance> set = attributemapserver.getAttributes();
if (!set.isEmpty()) { if (!set.isEmpty()) {
+ // CraftBukkit start - Send scaled max health + // CraftBukkit start - Send scaled max health
@ -138,11 +138,11 @@
+ entityplayer.removeQueue.remove(Integer.valueOf(this.tracker.getId())); + entityplayer.removeQueue.remove(Integer.valueOf(this.tracker.getId()));
+ // CraftBukkit end + // CraftBukkit end
this.trackedPlayers.add(entityplayer); this.trackedPlayers.add(entityplayer);
Packet packet = this.e(); Packet<?> packet = this.e();
@@ -290,6 +351,12 @@ @@ -290,6 +351,12 @@
AttributeMapServer attributemapserver = (AttributeMapServer) ((EntityLiving) this.tracker).getAttributeMap(); AttributeMapServer attributemapserver = (AttributeMapServer) ((EntityLiving) this.tracker).getAttributeMap();
Collection collection = attributemapserver.c(); Collection<AttributeInstance> collection = attributemapserver.c();
+ // CraftBukkit start - If sending own attributes send scaled health instead of current maximum health + // CraftBukkit start - If sending own attributes send scaled health instead of current maximum health
+ if (this.tracker.getId() == entityplayer.getId()) { + if (this.tracker.getId() == entityplayer.getId()) {

View File

@ -1,19 +1,5 @@
--- a/net/minecraft/server/EntityTurtle.java --- a/net/minecraft/server/EntityTurtle.java
+++ b/net/minecraft/server/EntityTurtle.java +++ b/net/minecraft/server/EntityTurtle.java
@@ -130,11 +130,11 @@
this.goalSelector.a(1, new EntityTurtle.a(this, 1.0D));
this.goalSelector.a(1, new EntityTurtle.d(this, 1.0D));
this.goalSelector.a(2, new EntityTurtle.i(this, 1.1D, Blocks.SEAGRASS.getItem()));
- this.goalSelector.a(3, new EntityTurtle.c(this, 1.0D, null));
+ this.goalSelector.a(3, new EntityTurtle.c(this, 1.0D)); // CraftBukkit - decompile error
this.goalSelector.a(4, new EntityTurtle.b(this, 1.0D));
this.goalSelector.a(7, new EntityTurtle.j(this, 1.0D));
this.goalSelector.a(8, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
- this.goalSelector.a(9, new EntityTurtle.h(this, 1.0D, 100, null));
+ this.goalSelector.a(9, new EntityTurtle.h(this, 1.0D, 100)); // CraftBukkit - decompile error
}
protected void initAttributes() {
@@ -232,7 +232,9 @@ @@ -232,7 +232,9 @@
protected void l() { protected void l() {
super.l(); super.l();
@ -34,7 +20,7 @@
} }
public void die(DamageSource damagesource) { public void die(DamageSource damagesource) {
@@ -423,15 +427,19 @@ @@ -423,8 +427,12 @@
} else if (this.f.bK > 200) { } else if (this.f.bK > 200) {
World world = this.f.world; World world = this.f.world;
@ -47,11 +33,3 @@
this.f.s(false); this.f.s(false);
this.f.t(false); this.f.t(false);
this.f.d(600); this.f.d(600);
}
if (this.f.dz()) {
- EntityTurtle.g(this.f);
+ this.f.bK++; // CraftBukkit - decompile error
}
}

View File

@ -2,7 +2,7 @@
+++ b/net/minecraft/server/EntityTypes.java +++ b/net/minecraft/server/EntityTypes.java
@@ -121,7 +121,7 @@ @@ -121,7 +121,7 @@
public static <T extends Entity> EntityTypes<T> a(String s, EntityTypes.a<T> entitytypes_a) { public static <T extends Entity> EntityTypes<T> a(String s, EntityTypes.a<T> entitytypes_a) {
EntityTypes entitytypes = entitytypes_a.a(s); EntityTypes<T> entitytypes = entitytypes_a.a(s);
- IRegistry.ENTITY_TYPE.a(new MinecraftKey(s), (Object) entitytypes); - IRegistry.ENTITY_TYPE.a(new MinecraftKey(s), (Object) entitytypes);
+ IRegistry.ENTITY_TYPE.a(new MinecraftKey(s), entitytypes); // CraftBukkit - decompile error + IRegistry.ENTITY_TYPE.a(new MinecraftKey(s), entitytypes); // CraftBukkit - decompile error
@ -19,24 +19,15 @@
+ +
+ @Nullable + @Nullable
+ public T spawnCreature(World world, @Nullable NBTTagCompound nbttagcompound, @Nullable IChatBaseComponent ichatbasecomponent, @Nullable EntityHuman entityhuman, BlockPosition blockposition, boolean flag, boolean flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) { + public T spawnCreature(World world, @Nullable NBTTagCompound nbttagcompound, @Nullable IChatBaseComponent ichatbasecomponent, @Nullable EntityHuman entityhuman, BlockPosition blockposition, boolean flag, boolean flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) {
Entity entity = this.b(world, nbttagcompound, ichatbasecomponent, entityhuman, blockposition, flag, flag1); T t0 = this.b(world, nbttagcompound, ichatbasecomponent, entityhuman, blockposition, flag, flag1);
- world.addEntity(entity); - world.addEntity(t0);
- return entity; - return t0;
+ return world.addEntity(entity, spawnReason) ? (T) entity : null; // Don't return an entity when CreatureSpawnEvent is canceled + return world.addEntity(t0, spawnReason) ? t0 : null; // Don't return an entity when CreatureSpawnEvent is canceled
+ // CraftBukkit end + // CraftBukkit end
} }
@Nullable @Nullable
@@ -187,7 +193,7 @@
}
a(world, entityhuman, entity, nbttagcompound);
- return entity;
+ return (T) entity; // CraftBukkit - decompile error
}
}
@@ -250,7 +256,7 @@ @@ -250,7 +256,7 @@
@Nullable @Nullable

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntityVillager.java --- a/net/minecraft/server/EntityVillager.java
+++ b/net/minecraft/server/EntityVillager.java +++ b/net/minecraft/server/EntityVillager.java
@@ -7,6 +7,16 @@ @@ -6,6 +6,16 @@
import javax.annotation.Nullable; import javax.annotation.Nullable;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -17,7 +17,7 @@
public class EntityVillager extends EntityAgeable implements NPC, IMerchant { public class EntityVillager extends EntityAgeable implements NPC, IMerchant {
@@ -38,7 +48,7 @@ @@ -37,7 +47,7 @@
public EntityVillager(World world, int i) { public EntityVillager(World world, int i) {
super(EntityTypes.VILLAGER, world); super(EntityTypes.VILLAGER, world);
@ -26,7 +26,7 @@
this.setProfession(i); this.setProfession(i);
this.setSize(0.6F, 1.95F); this.setSize(0.6F, 1.95F);
((Navigation) this.getNavigation()).a(true); ((Navigation) this.getNavigation()).a(true);
@@ -120,7 +130,14 @@ @@ -119,7 +129,14 @@
MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next(); MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next();
if (merchantrecipe.h()) { if (merchantrecipe.h()) {
@ -42,7 +42,7 @@
} }
} }
@@ -132,7 +149,7 @@ @@ -131,7 +148,7 @@
} }
} }
@ -51,7 +51,7 @@
} }
} }
@@ -434,7 +451,20 @@ @@ -433,7 +450,20 @@
for (int l = 0; l < k; ++l) { for (int l = 0; l < k; ++l) {
EntityVillager.IMerchantRecipeOption entityvillager_imerchantrecipeoption = aentityvillager_imerchantrecipeoption3[l]; EntityVillager.IMerchantRecipeOption entityvillager_imerchantrecipeoption = aentityvillager_imerchantrecipeoption3[l];
@ -73,7 +73,7 @@
} }
} }
@@ -569,7 +599,12 @@ @@ -568,7 +598,12 @@
entitywitch.setCustomNameVisible(this.getCustomNameVisible()); entitywitch.setCustomNameVisible(this.getCustomNameVisible());
} }

View File

@ -1,7 +1,7 @@
--- a/net/minecraft/server/EntityWolf.java --- a/net/minecraft/server/EntityWolf.java
+++ b/net/minecraft/server/EntityWolf.java +++ b/net/minecraft/server/EntityWolf.java
@@ -4,6 +4,11 @@ @@ -3,6 +3,11 @@
import java.util.function.Predicate; import java.util.UUID;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
@ -12,7 +12,7 @@
public class EntityWolf extends EntityTameableAnimal { public class EntityWolf extends EntityTameableAnimal {
private static final DataWatcherObject<Float> DATA_HEALTH = DataWatcher.a(EntityWolf.class, DataWatcherRegistry.c); private static final DataWatcherObject<Float> DATA_HEALTH = DataWatcher.a(EntityWolf.class, DataWatcherRegistry.c);
@@ -57,6 +62,22 @@ @@ -56,6 +61,22 @@
this.getAttributeMap().b(GenericAttributes.ATTACK_DAMAGE).setValue(2.0D); this.getAttributeMap().b(GenericAttributes.ATTACK_DAMAGE).setValue(2.0D);
} }
@ -35,7 +35,7 @@
public void setGoalTarget(@Nullable EntityLiving entityliving) { public void setGoalTarget(@Nullable EntityLiving entityliving) {
super.setGoalTarget(entityliving); super.setGoalTarget(entityliving);
if (entityliving == null) { if (entityliving == null) {
@@ -191,7 +212,8 @@ @@ -190,7 +211,8 @@
Entity entity = damagesource.getEntity(); Entity entity = damagesource.getEntity();
if (this.goalSit != null) { if (this.goalSit != null) {
@ -45,7 +45,7 @@
} }
if (entity != null && !(entity instanceof EntityHuman) && !(entity instanceof EntityArrow)) { if (entity != null && !(entity instanceof EntityHuman) && !(entity instanceof EntityArrow)) {
@@ -237,7 +259,7 @@ @@ -236,7 +258,7 @@
itemstack.subtract(1); itemstack.subtract(1);
} }
@ -54,7 +54,7 @@
return true; return true;
} }
} else if (item instanceof ItemDye) { } else if (item instanceof ItemDye) {
@@ -258,7 +280,7 @@ @@ -257,7 +279,7 @@
this.goalSit.setSitting(!this.isSitting()); this.goalSit.setSitting(!this.isSitting());
this.bg = false; this.bg = false;
this.navigation.q(); this.navigation.q();
@ -63,7 +63,7 @@
} }
} else if (item == Items.BONE && !this.isAngry()) { } else if (item == Items.BONE && !this.isAngry()) {
if (!entityhuman.abilities.canInstantlyBuild) { if (!entityhuman.abilities.canInstantlyBuild) {
@@ -266,12 +288,13 @@ @@ -265,12 +287,13 @@
} }
if (!this.world.isClientSide) { if (!this.world.isClientSide) {

View File

@ -16,17 +16,8 @@
public class EntityZombie extends EntityMonster { public class EntityZombie extends EntityMonster {
protected static final IAttribute c = (new AttributeRanged((IAttribute) null, "zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).a("Spawn Reinforcements Chance"); protected static final IAttribute c = (new AttributeRanged((IAttribute) null, "zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).a("Spawn Reinforcements Chance");
@@ -14,13 +23,14 @@ @@ -21,6 +30,7 @@
private static final DataWatcherObject<Boolean> bC = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); public int drownedConversionTime;
private static final DataWatcherObject<Integer> bD = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
private static final DataWatcherObject<Boolean> bE = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
- private static final DataWatcherObject<Boolean> bF = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
+ public static final DataWatcherObject<Boolean> bF = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); // PAIL
private final PathfinderGoalBreakDoor bG;
private boolean bH;
private int bI;
- private int drownedConversionTime;
+ public int drownedConversionTime; // PAIL
private float bK; private float bK;
private float bL; private float bL;
+ private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field + private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field
@ -48,7 +39,7 @@
if (this.drownedConversionTime < 0) { if (this.drownedConversionTime < 0) {
this.dE(); this.dE();
} }
@@ -182,14 +196,21 @@ @@ -182,7 +196,14 @@
} }
if (flag) { if (flag) {
@ -64,14 +55,6 @@
} }
} }
super.movementTick();
}
- private void a(int i) {
+ public void a(int i) { // PAIL
this.drownedConversionTime = i;
this.getDataWatcher().set(EntityZombie.bF, true);
}
@@ -221,7 +242,12 @@ @@ -221,7 +242,12 @@
entityzombie.setCustomNameVisible(this.getCustomNameVisible()); entityzombie.setCustomNameVisible(this.getCustomNameVisible());
} }
@ -113,17 +96,15 @@
} }
} }
@@ -362,8 +395,8 @@ @@ -362,7 +395,7 @@
EntityZombieVillager entityzombievillager = new EntityZombieVillager(this.world); EntityZombieVillager entityzombievillager = new EntityZombieVillager(this.world);
entityzombievillager.u(entityvillager); entityzombievillager.u(entityvillager);
- this.world.kill(entityvillager); - this.world.kill(entityvillager);
- entityzombievillager.prepare(this.world.getDamageScaler(new BlockPosition(entityzombievillager)), new EntityZombie.GroupDataZombie(false, null), (NBTTagCompound) null);
+ // this.world.kill(entityvillager); // CraftBukkit - moved down + // this.world.kill(entityvillager); // CraftBukkit - moved down
+ entityzombievillager.prepare(this.world.getDamageScaler(new BlockPosition(entityzombievillager)), new EntityZombie.GroupDataZombie(false), (NBTTagCompound) null); // CraftBukkit - decompile error entityzombievillager.prepare(this.world.getDamageScaler(new BlockPosition(entityzombievillager)), new EntityZombie.GroupDataZombie(false), (NBTTagCompound) null);
entityzombievillager.setProfession(entityvillager.getProfession()); entityzombievillager.setProfession(entityvillager.getProfession());
entityzombievillager.setBaby(entityvillager.isBaby()); entityzombievillager.setBaby(entityvillager.isBaby());
entityzombievillager.setNoAI(entityvillager.isNoAI());
@@ -372,7 +405,13 @@ @@ -372,7 +405,13 @@
entityzombievillager.setCustomNameVisible(entityvillager.getCustomNameVisible()); entityzombievillager.setCustomNameVisible(entityvillager.getCustomNameVisible());
} }
@ -139,15 +120,6 @@
this.world.a((EntityHuman) null, 1026, new BlockPosition(this), 0); this.world.a((EntityHuman) null, 1026, new BlockPosition(this), 0);
} }
@@ -399,7 +438,7 @@
this.p(this.random.nextFloat() < 0.55F * f);
if (object == null) {
- object = new EntityZombie.GroupDataZombie(this.world.random.nextFloat() < 0.05F, null);
+ object = new EntityZombie.GroupDataZombie(this.world.random.nextFloat() < 0.05F); // CraftBukkit - decompile error
}
if (object instanceof EntityZombie.GroupDataZombie) {
@@ -422,7 +461,7 @@ @@ -422,7 +461,7 @@
entitychicken1.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F); entitychicken1.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F);
entitychicken1.prepare(difficultydamagescaler, (GroupDataEntity) null, (NBTTagCompound) null); entitychicken1.prepare(difficultydamagescaler, (GroupDataEntity) null, (NBTTagCompound) null);

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/EntityZombieVillager.java --- a/net/minecraft/server/EntityZombieVillager.java
+++ b/net/minecraft/server/EntityZombieVillager.java +++ b/net/minecraft/server/EntityZombieVillager.java
@@ -2,13 +2,18 @@ @@ -2,6 +2,10 @@
import java.util.UUID; import java.util.UUID;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -11,11 +11,9 @@
public class EntityZombieVillager extends EntityZombie { public class EntityZombieVillager extends EntityZombie {
- private static final DataWatcherObject<Boolean> a = DataWatcher.a(EntityZombieVillager.class, DataWatcherRegistry.i); @@ -9,6 +13,7 @@
+ public static final DataWatcherObject<Boolean> a = DataWatcher.a(EntityZombieVillager.class, DataWatcherRegistry.i); // PAIL
private static final DataWatcherObject<Integer> b = DataWatcher.a(EntityZombieVillager.class, DataWatcherRegistry.b); private static final DataWatcherObject<Integer> b = DataWatcher.a(EntityZombieVillager.class, DataWatcherRegistry.b);
- private int conversionTime; public int conversionTime;
+ public int conversionTime; // PAIL
private UUID bD; private UUID bD;
+ private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field + private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field
@ -36,15 +34,10 @@
this.conversionTime -= i; this.conversionTime -= i;
if (this.conversionTime <= 0) { if (this.conversionTime <= 0) {
@@ -96,12 +106,14 @@ @@ -100,8 +110,10 @@
return (Boolean) this.getDataWatcher().get(EntityZombieVillager.a);
}
- protected void a(@Nullable UUID uuid, int i) {
+ public void a(@Nullable UUID uuid, int i) { // PAIL
this.bD = uuid; this.bD = uuid;
this.conversionTime = i; this.conversionTime = i;
this.getDataWatcher().set(EntityZombieVillager.a, true); this.getDataWatcher().set(EntityZombieVillager.CONVERTING, true);
- this.removeEffect(MobEffects.WEAKNESS); - this.removeEffect(MobEffects.WEAKNESS);
- this.addEffect(new MobEffect(MobEffects.INCREASE_DAMAGE, i, Math.min(this.world.getDifficulty().a() - 1, 0))); - this.addEffect(new MobEffect(MobEffects.INCREASE_DAMAGE, i, Math.min(this.world.getDifficulty().a() - 1, 0)));
+ // CraftBukkit start + // CraftBukkit start

View File

@ -11,35 +11,25 @@
public class ExpiringMap<T> extends Long2ObjectOpenHashMap<T> { public class ExpiringMap<T> extends Long2ObjectOpenHashMap<T> {
@@ -21,11 +23,17 @@ @@ -21,10 +23,17 @@
long j = SystemUtils.getMonotonicMillis(); long j = SystemUtils.getMonotonicMillis();
this.b.put(i, j); this.b.put(i, j);
- ObjectIterator objectiterator = this.b.long2LongEntrySet().iterator();
+ cleanup();
+ // CraftBukkit start + // CraftBukkit start
+ cleanup();
+ } + }
+ +
+ public void cleanup() { + public void cleanup() {
+ long j = SystemUtils.getMonotonicMillis(); + long j = SystemUtils.getMonotonicMillis();
+ ObjectIterator<Long2LongMap.Entry> objectiterator = this.b.long2LongEntrySet().iterator(); // CraftBukkit - decompile error + // CraftBukkit end
ObjectIterator objectiterator = this.b.long2LongEntrySet().iterator();
while (objectiterator.hasNext()) { while (objectiterator.hasNext()) {
- Entry entry = (Entry) objectiterator.next(); - Entry entry = (Entry) objectiterator.next();
- Object object = super.get(entry.getLongKey());
+ Long2LongMap.Entry entry = (Long2LongMap.Entry) objectiterator.next(); // CraftBukkit - decompile error + Long2LongMap.Entry entry = (Long2LongMap.Entry) objectiterator.next(); // CraftBukkit - decompile error
+ T object = super.get(entry.getLongKey()); // CraftBukkit - decompile error T t0 = super.get(entry.getLongKey());
if (j - entry.getLongValue() <= (long) this.a) { if (j - entry.getLongValue() <= (long) this.a) {
break;
@@ -36,6 +44,7 @@
objectiterator.remove();
}
}
+ // CraftBukkit end
}
@@ -69,4 +78,18 @@ @@ -69,4 +78,18 @@
public T remove(Object object) { public T remove(Object object) {
throw new RuntimeException("Not implemented"); throw new RuntimeException("Not implemented");

View File

@ -1,7 +1,7 @@
--- a/net/minecraft/server/Explosion.java --- a/net/minecraft/server/Explosion.java
+++ b/net/minecraft/server/Explosion.java +++ b/net/minecraft/server/Explosion.java
@@ -10,6 +10,13 @@ @@ -10,6 +10,13 @@
import java.util.Random; import java.util.Set;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
@ -37,7 +37,7 @@
+ return; + return;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
HashSet hashset = Sets.newHashSet(); Set<BlockPosition> set = Sets.newHashSet();
boolean flag = true; boolean flag = true;
@@ -76,7 +89,7 @@ @@ -76,7 +89,7 @@
@ -46,7 +46,7 @@
- if (f > 0.0F && (this.source == null || this.source.a(this, this.world, blockposition, iblockdata, f))) { - if (f > 0.0F && (this.source == null || this.source.a(this, this.world, blockposition, iblockdata, f))) {
+ if (f > 0.0F && (this.source == null || this.source.a(this, this.world, blockposition, iblockdata, f)) && blockposition.getY() < 256 && blockposition.getY() >= 0) { // CraftBukkit - don't wrap explosions + if (f > 0.0F && (this.source == null || this.source.a(this, this.world, blockposition, iblockdata, f)) && blockposition.getY() < 256 && blockposition.getY() >= 0) { // CraftBukkit - don't wrap explosions
hashset.add(blockposition); set.add(blockposition);
} }
@@ -120,7 +133,16 @@ @@ -120,7 +133,16 @@

View File

@ -1,9 +1,9 @@
--- a/net/minecraft/server/FluidTypeFlowing.java --- a/net/minecraft/server/FluidTypeFlowing.java
+++ b/net/minecraft/server/FluidTypeFlowing.java +++ b/net/minecraft/server/FluidTypeFlowing.java
@@ -14,13 +14,18 @@ @@ -10,6 +10,11 @@
import java.util.function.IntFunction; import java.util.Iterator;
import java.util.function.IntPredicate; import java.util.Map;
import java.util.function.Supplier; import java.util.Map.Entry;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.block.BlockFace; +import org.bukkit.block.BlockFace;
+import org.bukkit.craftbukkit.block.CraftBlock; +import org.bukkit.craftbukkit.block.CraftBlock;
@ -12,15 +12,7 @@
public abstract class FluidTypeFlowing extends FluidType { public abstract class FluidTypeFlowing extends FluidType {
public static final BlockStateBoolean FALLING = BlockProperties.h; @@ -141,6 +146,15 @@
public static final BlockStateInteger LEVEL = BlockProperties.ag;
private static final ThreadLocal<Object2ByteLinkedOpenHashMap<Block.a>> e = ThreadLocal.withInitial(() -> {
- Object2ByteLinkedOpenHashMap object2bytelinkedopenhashmap = new Object2ByteLinkedOpenHashMap(200) {
+ Object2ByteLinkedOpenHashMap object2bytelinkedopenhashmap = new Object2ByteLinkedOpenHashMap<Block.a>(200) { // CraftBukkit - decompile error
protected void rehash(int i) {}
};
@@ -145,6 +150,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.getFluid(blockposition1), fluid1.c())) { if (this.a(generatoraccess, blockposition, iblockdata, EnumDirection.DOWN, blockposition1, iblockdata1, generatoraccess.getFluid(blockposition1), fluid1.c())) {
@ -36,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);
@@ -175,6 +189,15 @@ @@ -171,6 +185,15 @@
IBlockData iblockdata1 = generatoraccess.getType(blockposition1); IBlockData iblockdata1 = generatoraccess.getType(blockposition1);
if (this.a(generatoraccess, blockposition, iblockdata, enumdirection, blockposition1, iblockdata1, generatoraccess.getFluid(blockposition1), fluid1.c())) { if (this.a(generatoraccess, blockposition, iblockdata, enumdirection, blockposition1, iblockdata1, generatoraccess.getFluid(blockposition1), fluid1.c())) {
@ -52,69 +44,3 @@
this.a(generatoraccess, blockposition1, iblockdata1, enumdirection, fluid1); this.a(generatoraccess, blockposition1, iblockdata1, enumdirection, fluid1);
} }
} }
@@ -307,21 +330,25 @@
if (enumdirection1 != enumdirection) {
BlockPosition blockposition2 = blockposition.shift(enumdirection1);
short short0 = a(blockposition1, blockposition2);
- Pair pair = (Pair) short2objectmap.computeIfAbsent(short0, (i) -> {
- IBlockData iblockdata = iworldreader.getType(blockposition);
+ // CraftBukkit start - decompile errors
+ Pair pair = (Pair) short2objectmap.computeIfAbsent(short0, (ix) -> {
+ IBlockData iblockdatax = iworldreader.getType(blockposition2);
- return Pair.of(iblockdata, iblockdata.s());
+ return Pair.of(iblockdatax, iblockdatax.s());
});
+ // CraftBukkit end
IBlockData iblockdata1 = (IBlockData) pair.getFirst();
Fluid fluid = (Fluid) pair.getSecond();
if (this.a(iworldreader, this.e(), blockposition, iblockdata, enumdirection1, blockposition2, iblockdata1, fluid)) {
- boolean flag = short2booleanmap.computeIfAbsent(short0, (i) -> {
- BlockPosition blockposition = blockposition1.down();
- IBlockData iblockdata = iworldreader.getType(blockposition);
+ // CraftBukkit start - decompile errors
+ boolean flag = short2booleanmap.computeIfAbsent(short0, (ix) -> {
+ BlockPosition blockpositionx = blockposition2.down();
+ IBlockData iblockdatax = iworldreader.getType(blockpositionx);
- return this.a((IBlockAccess) iworldreader, this.e(), blockposition1, iblockdata1, blockposition, iblockdata);
+ return this.a((IBlockAccess) iworldreader, this.e(), blockposition2, iblockdata1, blockpositionx, iblockdatax);
});
+ // CraftBukkit end
if (flag) {
return i;
@@ -383,22 +410,26 @@
EnumDirection enumdirection = (EnumDirection) iterator.next();
BlockPosition blockposition1 = blockposition.shift(enumdirection);
short short0 = a(blockposition, blockposition1);
- Pair pair = (Pair) short2objectopenhashmap.computeIfAbsent(short0, (i) -> {
- IBlockData iblockdata = iworldreader.getType(blockposition);
+ // CraftBukkit start - decompile errors
+ Pair pair = (Pair) short2objectopenhashmap.computeIfAbsent(short0, (ix) -> {
+ IBlockData iblockdatax = iworldreader.getType(blockposition1);
- return Pair.of(iblockdata, iblockdata.s());
+ return Pair.of(iblockdatax, iblockdatax.s());
});
+ // CraftBukkit end
IBlockData iblockdata1 = (IBlockData) pair.getFirst();
Fluid fluid = (Fluid) pair.getSecond();
Fluid fluid1 = this.a(iworldreader, blockposition1, iblockdata1);
if (this.a(iworldreader, fluid1.c(), blockposition, iblockdata, enumdirection, blockposition1, iblockdata1, fluid)) {
BlockPosition blockposition2 = blockposition1.down();
- boolean flag = short2booleanopenhashmap.computeIfAbsent(short0, (i) -> {
- IBlockData iblockdata = iworldreader.getType(blockposition);
+ // CraftBukkit start - decompile errors
+ boolean flag = short2booleanopenhashmap.computeIfAbsent(short0, (ix) -> {
+ IBlockData iblockdatax = iworldreader.getType(blockposition2);
- return this.a((IBlockAccess) iworldreader, this.e(), blockposition1, iblockdata1, blockposition, iblockdata);
+ return this.a((IBlockAccess) iworldreader, this.e(), blockposition1, iblockdata1, blockposition2, iblockdatax);
});
+ // CraftBukkit end
int j;
if (flag) {

View File

@ -2,7 +2,7 @@
+++ b/net/minecraft/server/ItemBoat.java +++ b/net/minecraft/server/ItemBoat.java
@@ -52,6 +52,13 @@ @@ -52,6 +52,13 @@
if (flag) { if (flag) {
return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack); return new InteractionResultWrapper<>(EnumInteractionResult.PASS, itemstack);
} else if (movingobjectposition.type == MovingObjectPosition.EnumMovingObjectType.BLOCK) { } else if (movingobjectposition.type == MovingObjectPosition.EnumMovingObjectType.BLOCK) {
+ // CraftBukkit start - Boat placement + // CraftBukkit start - Boat placement
+ org.bukkit.event.player.PlayerInteractEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(entityhuman, org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK, movingobjectposition.getBlockPosition(), movingobjectposition.direction, itemstack, enumhand); + org.bukkit.event.player.PlayerInteractEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(entityhuman, org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK, movingobjectposition.getBlockPosition(), movingobjectposition.direction, itemstack, enumhand);
@ -15,7 +15,7 @@
Block block = world.getType(blockposition).getBlock(); Block block = world.getType(blockposition).getBlock();
EntityBoat entityboat = new EntityBoat(world, movingobjectposition.pos.x, movingobjectposition.pos.y, movingobjectposition.pos.z); EntityBoat entityboat = new EntityBoat(world, movingobjectposition.pos.x, movingobjectposition.pos.y, movingobjectposition.pos.z);
@@ -62,7 +69,7 @@ @@ -62,7 +69,7 @@
return new InteractionResultWrapper(EnumInteractionResult.FAIL, itemstack); return new InteractionResultWrapper<>(EnumInteractionResult.FAIL, itemstack);
} else { } else {
if (!world.isClientSide) { if (!world.isClientSide) {
- world.addEntity(entityboat); - world.addEntity(entityboat);

View File

@ -15,11 +15,11 @@
public class ItemBucket extends Item { public class ItemBucket extends Item {
@@ -26,12 +33,21 @@ @@ -26,12 +33,21 @@
if (this.fluidType == FluidTypes.a) { if (this.fluidType == FluidTypes.EMPTY) {
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()).a(DummyGeneratorAccess.INSTANCE, blockposition, iblockdata); + FluidType dummyFluid = ((IFluidSource) iblockdata.getBlock()).removeFluid(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()) {
@ -27,9 +27,9 @@
+ return new InteractionResultWrapper(EnumInteractionResult.FAIL, itemstack); + return new InteractionResultWrapper(EnumInteractionResult.FAIL, itemstack);
+ } + }
+ // CraftBukkit end + // CraftBukkit end
FluidType fluidtype = ((IFluidSource) iblockdata.getBlock()).a(world, blockposition, iblockdata); FluidType fluidtype = ((IFluidSource) iblockdata.getBlock()).removeFluid(world, blockposition, iblockdata);
if (fluidtype != FluidTypes.a) { if (fluidtype != FluidTypes.EMPTY) {
entityhuman.b(StatisticList.ITEM_USED.b(this)); entityhuman.b(StatisticList.ITEM_USED.b(this));
entityhuman.a(fluidtype.a(TagsFluid.LAVA) ? SoundEffects.ITEM_BUCKET_FILL_LAVA : SoundEffects.ITEM_BUCKET_FILL, 1.0F, 1.0F); entityhuman.a(fluidtype.a(TagsFluid.LAVA) ? SoundEffects.ITEM_BUCKET_FILL_LAVA : SoundEffects.ITEM_BUCKET_FILL, 1.0F, 1.0F);
- ItemStack itemstack1 = this.a(itemstack, entityhuman, fluidtype.b()); - ItemStack itemstack1 = this.a(itemstack, entityhuman, fluidtype.b());

View File

@ -32,4 +32,4 @@
+ // CraftBukkit end + // CraftBukkit end
entityhuman.b(StatisticList.ITEM_USED.b(this)); entityhuman.b(StatisticList.ITEM_USED.b(this));
return new InteractionResultWrapper(EnumInteractionResult.SUCCESS, itemstack); return new InteractionResultWrapper<>(EnumInteractionResult.SUCCESS, itemstack);

View File

@ -30,4 +30,4 @@
+ // CraftBukkit end + // CraftBukkit end
entityhuman.b(StatisticList.ITEM_USED.b(this)); entityhuman.b(StatisticList.ITEM_USED.b(this));
return new InteractionResultWrapper(EnumInteractionResult.SUCCESS, itemstack); return new InteractionResultWrapper<>(EnumInteractionResult.SUCCESS, itemstack);

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/ItemStack.java --- a/net/minecraft/server/ItemStack.java
+++ b/net/minecraft/server/ItemStack.java +++ b/net/minecraft/server/ItemStack.java
@@ -16,6 +16,22 @@ @@ -15,6 +15,22 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -23,7 +23,7 @@
public final class ItemStack { public final class ItemStack {
private static final Logger c = LogManager.getLogger(); private static final Logger c = LogManager.getLogger();
@@ -50,25 +66,49 @@ @@ -49,25 +65,49 @@
this.E(); this.E();
} }
@ -76,7 +76,7 @@
this.E(); this.E();
} }
@@ -98,7 +138,7 @@ @@ -97,7 +137,7 @@
return this.h ? Items.AIR : this.item; return this.h ? Items.AIR : this.item;
} }
@ -85,7 +85,7 @@
EntityHuman entityhuman = itemactioncontext.getEntity(); EntityHuman entityhuman = itemactioncontext.getEntity();
BlockPosition blockposition = itemactioncontext.getClickPosition(); BlockPosition blockposition = itemactioncontext.getClickPosition();
ShapeDetectorBlock shapedetectorblock = new ShapeDetectorBlock(itemactioncontext.getWorld(), blockposition, false); ShapeDetectorBlock shapedetectorblock = new ShapeDetectorBlock(itemactioncontext.getWorld(), blockposition, false);
@@ -106,12 +146,144 @@ @@ -105,12 +145,144 @@
if (entityhuman != null && !entityhuman.abilities.mayBuild && !this.b(itemactioncontext.getWorld().F(), shapedetectorblock)) { if (entityhuman != null && !entityhuman.abilities.mayBuild && !this.b(itemactioncontext.getWorld().F(), shapedetectorblock)) {
return EnumInteractionResult.PASS; return EnumInteractionResult.PASS;
} else { } else {
@ -231,7 +231,7 @@
return enuminteractionresult; return enuminteractionresult;
} }
@@ -135,7 +307,7 @@ @@ -134,7 +306,7 @@
nbttagcompound.setString("id", minecraftkey == null ? "minecraft:air" : minecraftkey.toString()); nbttagcompound.setString("id", minecraftkey == null ? "minecraft:air" : minecraftkey.toString());
nbttagcompound.setByte("Count", (byte) this.count); nbttagcompound.setByte("Count", (byte) this.count);
if (this.tag != null) { if (this.tag != null) {
@ -240,7 +240,7 @@
} }
return nbttagcompound; return nbttagcompound;
@@ -213,6 +385,11 @@ @@ -212,6 +384,11 @@
if (this.isDamaged(i, entityliving.getRandom(), entityliving instanceof EntityPlayer ? (EntityPlayer) entityliving : null)) { if (this.isDamaged(i, entityliving.getRandom(), entityliving instanceof EntityPlayer ? (EntityPlayer) entityliving : null)) {
entityliving.c(this); entityliving.c(this);
Item item = this.getItem(); Item item = this.getItem();
@ -252,7 +252,7 @@
this.subtract(1); this.subtract(1);
if (entityliving instanceof EntityHuman) { if (entityliving instanceof EntityHuman) {
@@ -336,6 +513,17 @@ @@ -335,6 +512,17 @@
return this.tag; return this.tag;
} }
@ -270,7 +270,7 @@
public NBTTagCompound getOrCreateTag() { public NBTTagCompound getOrCreateTag() {
if (this.tag == null) { if (this.tag == null) {
this.setTag(new NBTTagCompound()); this.setTag(new NBTTagCompound());
@@ -480,6 +668,14 @@ @@ -479,6 +667,14 @@
} }
public void setRepairCost(int i) { public void setRepairCost(int i) {
@ -285,7 +285,7 @@
this.getOrCreateTag().setInt("RepairCost", i); this.getOrCreateTag().setInt("RepairCost", i);
} }
@@ -522,6 +718,13 @@ @@ -521,6 +717,13 @@
nbttaglist.add((NBTBase) nbttagcompound); nbttaglist.add((NBTBase) nbttagcompound);
} }

View File

@ -3,7 +3,7 @@
@@ -30,7 +30,15 @@ @@ -30,7 +30,15 @@
Fluid fluid = world.getFluid(blockposition); Fluid fluid = world.getFluid(blockposition);
if ((fluid.c() == FluidTypes.c || material == Material.ICE) && world.isEmpty(blockposition1)) { if ((fluid.c() == FluidTypes.WATER || material == Material.ICE) && world.isEmpty(blockposition1)) {
+ // CraftBukkit start - special case for handling block placement with water lilies + // CraftBukkit start - special case for handling block placement with water lilies
+ org.bukkit.block.BlockState blockstate = org.bukkit.craftbukkit.block.CraftBlockState.getBlockState(world, blockposition1); + org.bukkit.block.BlockState blockstate = org.bukkit.craftbukkit.block.CraftBlockState.getBlockState(world, blockposition1);
world.setTypeAndData(blockposition1, Blocks.LILY_PAD.getBlockData(), 11); world.setTypeAndData(blockposition1, Blocks.LILY_PAD.getBlockData(), 11);

View File

@ -1,7 +1,7 @@
--- a/net/minecraft/server/ItemWorldMap.java --- a/net/minecraft/server/ItemWorldMap.java
+++ b/net/minecraft/server/ItemWorldMap.java +++ b/net/minecraft/server/ItemWorldMap.java
@@ -6,6 +6,11 @@ @@ -6,6 +6,11 @@
import java.util.function.Function; import com.google.common.collect.Multisets;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start

View File

@ -1,15 +1,6 @@
--- a/net/minecraft/server/JsonList.java --- a/net/minecraft/server/JsonList.java
+++ b/net/minecraft/server/JsonList.java +++ b/net/minecraft/server/JsonList.java
@@ -56,7 +56,7 @@ @@ -85,7 +85,7 @@
this.c = file;
GsonBuilder gsonbuilder = (new GsonBuilder()).setPrettyPrinting();
- gsonbuilder.registerTypeHierarchyAdapter(JsonListEntry.class, new JsonList.JsonListEntrySerializer(null));
+ gsonbuilder.registerTypeHierarchyAdapter(JsonListEntry.class, new JsonList.JsonListEntrySerializer()); // CraftBukkit - decompile error
this.b = gsonbuilder.create();
}
@@ -86,7 +86,7 @@
@Nullable @Nullable
public V get(K k0) { public V get(K k0) {
this.h(); this.h();
@ -18,7 +9,7 @@
} }
public void remove(K k0) { public void remove(K k0) {
@@ -108,6 +108,12 @@ @@ -107,6 +107,12 @@
return (String[]) this.d.keySet().toArray(new String[this.d.size()]); return (String[]) this.d.keySet().toArray(new String[this.d.size()]);
} }
@ -31,17 +22,35 @@
public boolean isEmpty() { public boolean isEmpty() {
return this.d.size() < 1; return this.d.size() < 1;
} }
@@ -137,7 +143,7 @@ @@ -124,7 +130,7 @@
Iterator iterator = this.d.values().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
Object object = iterator.next(); - V v0 = (JsonListEntry) iterator.next();
+ V v0 = (V) iterator.next(); // CraftBukkit - decompile error
- this.d.remove(this.a(object)); if (v0.hasExpired()) {
+ this.d.remove(this.a((K) object)); // CraftBukkit - decompile error list.add(v0.getKey());
@@ -134,7 +140,7 @@
iterator = list.iterator();
while (iterator.hasNext()) {
- K k0 = iterator.next();
+ K k0 = (K) iterator.next(); // CraftBukkit - decompile error
this.d.remove(this.a(k0));
}
@@ -142,7 +148,7 @@
} }
protected JsonListEntry<K> a(JsonObject jsonobject) {
- return new JsonListEntry<>((Object) null, jsonobject);
+ return new JsonListEntry<>((K) null, jsonobject); // CraftBukkit - decompile error
} }
@@ -180,7 +186,7 @@
JsonListEntry jsonlistentry = (JsonListEntry) iterator.next(); public Collection<V> e() {
@@ -179,7 +185,7 @@
JsonListEntry<K> jsonlistentry = (JsonListEntry) iterator.next();
if (jsonlistentry.getKey() != null) { if (jsonlistentry.getKey() != null) {
- this.d.put(this.a(jsonlistentry.getKey()), jsonlistentry); - this.d.put(this.a(jsonlistentry.getKey()), jsonlistentry);

View File

@ -9,8 +9,8 @@
switch (i) { switch (i) {
case 0: case 0:
LegacyPingHandler.a.debug("Ping: (<1.3.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort()); LegacyPingHandler.a.debug("Ping: (<1.3.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort());
- s = String.format("%s\u00a7%d\u00a7%d", new Object[] { minecraftserver.getMotd(), minecraftserver.getPlayerCount(), minecraftserver.getMaxPlayers()}); - s = String.format("%s\u00a7%d\u00a7%d", minecraftserver.getMotd(), minecraftserver.getPlayerCount(), minecraftserver.getMaxPlayers());
+ s = String.format("%s\u00a7%d\u00a7%d", new Object[] { event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()}); // CraftBukkit + s = String.format("%s\u00a7%d\u00a7%d", event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()); // CraftBukkit
this.a(channelhandlercontext, this.a(s)); this.a(channelhandlercontext, this.a(s));
break; break;
case 1: case 1:
@ -18,8 +18,8 @@
} }
LegacyPingHandler.a.debug("Ping: (1.4-1.5.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort()); LegacyPingHandler.a.debug("Ping: (1.4-1.5.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort());
- s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { 127, minecraftserver.getVersion(), minecraftserver.getMotd(), minecraftserver.getPlayerCount(), minecraftserver.getMaxPlayers()}); - s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", 127, minecraftserver.getVersion(), minecraftserver.getMotd(), minecraftserver.getPlayerCount(), minecraftserver.getMaxPlayers());
+ s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { 127, minecraftserver.getVersion(), event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()}); // CraftBukkit + s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", 127, minecraftserver.getVersion(), event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()); // CraftBukkit
this.a(channelhandlercontext, this.a(s)); this.a(channelhandlercontext, this.a(s));
break; break;
default: default:
@ -27,8 +27,8 @@
} }
LegacyPingHandler.a.debug("Ping: (1.6) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort()); LegacyPingHandler.a.debug("Ping: (1.6) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort());
- String s1 = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { 127, minecraftserver.getVersion(), minecraftserver.getMotd(), minecraftserver.getPlayerCount(), minecraftserver.getMaxPlayers()}); - String s1 = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", 127, minecraftserver.getVersion(), minecraftserver.getMotd(), minecraftserver.getPlayerCount(), minecraftserver.getMaxPlayers());
+ String s1 = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { 127, minecraftserver.getVersion(), event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()}); // CraftBukkit + String s1 = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", 127, minecraftserver.getVersion(), event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()); // CraftBukkit
ByteBuf bytebuf1 = this.a(s1); ByteBuf bytebuf1 = this.a(s1);
try { try {

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/LoginListener.java --- a/net/minecraft/server/LoginListener.java
+++ b/net/minecraft/server/LoginListener.java +++ b/net/minecraft/server/LoginListener.java
@@ -19,6 +19,12 @@ @@ -18,6 +18,12 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -13,7 +13,7 @@
public class LoginListener implements PacketLoginInListener, ITickable { public class LoginListener implements PacketLoginInListener, ITickable {
private static final AtomicInteger b = new AtomicInteger(0); private static final AtomicInteger b = new AtomicInteger(0);
@@ -33,6 +39,7 @@ @@ -32,6 +38,7 @@
private final String j; private final String j;
private SecretKey loginKey; private SecretKey loginKey;
private EntityPlayer l; private EntityPlayer l;
@ -21,7 +21,7 @@
public LoginListener(MinecraftServer minecraftserver, NetworkManager networkmanager) { public LoginListener(MinecraftServer minecraftserver, NetworkManager networkmanager) {
this.g = LoginListener.EnumProtocolState.HELLO; this.g = LoginListener.EnumProtocolState.HELLO;
@@ -61,6 +68,20 @@ @@ -60,6 +67,20 @@
} }
@ -42,7 +42,7 @@
public void disconnect(IChatBaseComponent ichatbasecomponent) { public void disconnect(IChatBaseComponent ichatbasecomponent) {
try { try {
LoginListener.c.info("Disconnecting {}: {}", this.c(), ichatbasecomponent.getString()); LoginListener.c.info("Disconnecting {}: {}", this.c(), ichatbasecomponent.getString());
@@ -77,10 +98,12 @@ @@ -76,10 +97,12 @@
this.i = this.a(this.i); this.i = this.a(this.i);
} }
@ -58,7 +58,7 @@
} else { } else {
this.g = LoginListener.EnumProtocolState.ACCEPTED; this.g = LoginListener.EnumProtocolState.ACCEPTED;
if (this.server.aw() >= 0 && !this.networkManager.isLocal()) { if (this.server.aw() >= 0 && !this.networkManager.isLocal()) {
@@ -94,9 +117,9 @@ @@ -93,9 +116,9 @@
if (entityplayer != null) { if (entityplayer != null) {
this.g = LoginListener.EnumProtocolState.DELAY_ACCEPT; this.g = LoginListener.EnumProtocolState.DELAY_ACCEPT;
@ -70,7 +70,7 @@
} }
} }
@@ -141,6 +164,43 @@ @@ -140,6 +163,43 @@
LoginListener.this.i = LoginListener.this.server.ap().hasJoinedServer(new GameProfile((UUID) null, gameprofile.getName()), s, this.a()); LoginListener.this.i = LoginListener.this.server.ap().hasJoinedServer(new GameProfile((UUID) null, gameprofile.getName()), s, this.a());
if (LoginListener.this.i != null) { if (LoginListener.this.i != null) {
@ -114,7 +114,7 @@
LoginListener.c.info("UUID of player {} is {}", LoginListener.this.i.getName(), LoginListener.this.i.getId()); LoginListener.c.info("UUID of player {} is {}", LoginListener.this.i.getName(), LoginListener.this.i.getId());
LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT; LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
} else if (LoginListener.this.server.H()) { } else if (LoginListener.this.server.H()) {
@@ -160,6 +220,11 @@ @@ -159,6 +219,11 @@
LoginListener.this.disconnect(new ChatMessage("multiplayer.disconnect.authservers_down", new Object[0])); LoginListener.this.disconnect(new ChatMessage("multiplayer.disconnect.authservers_down", new Object[0]));
LoginListener.c.error("Couldn't verify username because servers are unavailable"); LoginListener.c.error("Couldn't verify username because servers are unavailable");
} }

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/MethodProfiler.java --- a/net/minecraft/server/MethodProfiler.java
+++ b/net/minecraft/server/MethodProfiler.java +++ b/net/minecraft/server/MethodProfiler.java
@@ -13,6 +13,7 @@ @@ -12,6 +12,7 @@
public class MethodProfiler { public class MethodProfiler {
@ -8,7 +8,7 @@
private static final Logger a = LogManager.getLogger(); private static final Logger a = LogManager.getLogger();
private final List<String> b = Lists.newArrayList(); private final List<String> b = Lists.newArrayList();
private final List<Long> c = Lists.newArrayList(); private final List<Long> c = Lists.newArrayList();
@@ -41,6 +42,7 @@ @@ -40,6 +41,7 @@
} }
public void a(int i) { public void a(int i) {
@ -16,7 +16,7 @@
if (!this.d) { if (!this.d) {
this.d = true; this.d = true;
this.f.clear(); this.f.clear();
@@ -52,6 +54,7 @@ @@ -51,6 +53,7 @@
} }
public void enter(String s) { public void enter(String s) {
@ -24,7 +24,7 @@
if (this.d) { if (this.d) {
if (!this.e.isEmpty()) { if (!this.e.isEmpty()) {
this.e = this.e + "."; this.e = this.e + ".";
@@ -64,12 +67,14 @@ @@ -63,12 +66,14 @@
} }
public void a(Supplier<String> supplier) { public void a(Supplier<String> supplier) {
@ -39,15 +39,15 @@
if (this.d && !this.c.isEmpty()) { if (this.d && !this.c.isEmpty()) {
long i = SystemUtils.getMonotonicNanos(); long i = SystemUtils.getMonotonicNanos();
long j = (Long) this.c.remove(this.c.size() - 1); long j = (Long) this.c.remove(this.c.size() - 1);
@@ -92,6 +97,7 @@ @@ -91,6 +96,7 @@
} }
public List<MethodProfiler.ProfilerInfo> b(String s) { public List<MethodProfiler.ProfilerInfo> b(String s) {
+ if (!ENABLED) return Collections.emptyList(); // CraftBukkit + if (!ENABLED) return Collections.emptyList(); // CraftBukkit
long i = this.f.containsKey("root") ? (Long) this.f.get("root") : 0L; long i = this.f.containsKey("root") ? (Long) this.f.get("root") : 0L;
long j = this.f.containsKey(s) ? (Long) this.f.get(s) : -1L; long j = this.f.containsKey(s) ? (Long) this.f.get(s) : -1L;
ArrayList arraylist = Lists.newArrayList(); List<MethodProfiler.ProfilerInfo> list = Lists.newArrayList();
@@ -154,11 +160,13 @@ @@ -153,11 +159,13 @@
} }
public void exitEnter(String s) { public void exitEnter(String s) {

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/MinecraftServer.java --- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java
@@ -59,6 +59,14 @@ @@ -54,6 +54,14 @@
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -15,7 +15,7 @@
public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStatistics, ICommandListener, Runnable { public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStatistics, ICommandListener, Runnable {
@@ -129,7 +137,21 @@ @@ -124,7 +132,21 @@
private boolean forceUpgrade; private boolean forceUpgrade;
private float ap; private float ap;
@ -36,9 +36,9 @@
+ +
+ public MinecraftServer(OptionSet options, Proxy proxy, DataFixer datafixer, CommandDispatcher commanddispatcher, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache) { + public MinecraftServer(OptionSet options, Proxy proxy, DataFixer datafixer, CommandDispatcher commanddispatcher, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache) {
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();
@@ -140,22 +162,51 @@ @@ -135,22 +157,51 @@
this.al = new AdvancementDataWorld(); this.al = new AdvancementDataWorld();
this.am = new CustomFunctionData(this); this.am = new CustomFunctionData(this);
this.c = proxy; this.c = proxy;
@ -94,7 +94,7 @@
public abstract boolean init() throws IOException; public abstract boolean init() throws IOException;
public void convertWorld(String s) { public void convertWorld(String s) {
@@ -180,11 +231,11 @@ @@ -175,11 +226,11 @@
} }
if (this.forceUpgrade) { if (this.forceUpgrade) {
@ -109,7 +109,7 @@
IChatBaseComponent ichatbasecomponent = null; IChatBaseComponent ichatbasecomponent = null;
while (!worldupgrader.b()) { while (!worldupgrader.b()) {
@@ -223,8 +274,9 @@ @@ -218,8 +269,9 @@
} }
public void a(String s, String s1, long i, WorldType worldtype, JsonElement jsonelement) { public void a(String s, String s1, long i, WorldType worldtype, JsonElement jsonelement) {
@ -120,7 +120,7 @@
IDataManager idatamanager = this.getConvertable().a(s, this); IDataManager idatamanager = this.getConvertable().a(s, this);
this.a(this.getWorld(), idatamanager); this.a(this.getWorld(), idatamanager);
@@ -249,54 +301,144 @@ @@ -244,54 +296,144 @@
} }
this.a(idatamanager.getDirectory(), worlddata); this.a(idatamanager.getDirectory(), worlddata);
@ -158,8 +158,7 @@
+ continue; + continue;
+ } + }
+ } + }
+
- WorldServer worldserver = this.getWorldServer(DimensionManager.OVERWORLD);
+ 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 + this.convertWorld(name); // Run conversion now
@ -178,32 +177,32 @@
+ this.a(idatamanager.getDirectory(), worlddata); + this.a(idatamanager.getDirectory(), worlddata);
+ PersistentCollection persistentcollection = new PersistentCollection(idatamanager); + PersistentCollection persistentcollection = new PersistentCollection(idatamanager);
- worldserver.a(worldsettings); - WorldServer worldserver = this.getWorldServer(DimensionManager.OVERWORLD);
- worldserver.addIWorldAccess(new WorldManager(this, worldserver));
- if (!this.H()) {
- worldserver.getWorldData().setGameType(this.getGamemode());
- }
+ if (this.L()) { + if (this.L()) {
+ world = (WorldServer) (new DemoWorldServer(this, idatamanager, persistentcollection, worlddata, DimensionManager.OVERWORLD, this.methodProfiler)).i_(); + world = (WorldServer) (new DemoWorldServer(this, idatamanager, persistentcollection, worlddata, DimensionManager.OVERWORLD, this.methodProfiler)).i_();
+ } else { + } else {
+ world = (WorldServer) (new WorldServer(this, idatamanager, persistentcollection, worlddata, DimensionManager.OVERWORLD, this.methodProfiler, org.bukkit.World.Environment.getEnvironment(dimension), gen)).i_(); + world = (WorldServer) (new WorldServer(this, idatamanager, persistentcollection, worlddata, DimensionManager.OVERWORLD, this.methodProfiler, org.bukkit.World.Environment.getEnvironment(dimension), gen)).i_();
+ } + }
- SecondaryWorldServer secondaryworldserver = (new SecondaryWorldServer(this, idatamanager, DimensionManager.NETHER, worldserver, this.methodProfiler)).i_(); - worldserver.a(worldsettings);
- worldserver.addIWorldAccess(new WorldManager(this, worldserver));
- if (!this.H()) {
- worldserver.getWorldData().setGameType(this.getGamemode());
- }
+ world.a(worldsettings); + world.a(worldsettings);
+ this.server.scoreboardManager = new org.bukkit.craftbukkit.scoreboard.CraftScoreboardManager(this, world.getScoreboard()); + this.server.scoreboardManager = new org.bukkit.craftbukkit.scoreboard.CraftScoreboardManager(this, world.getScoreboard());
+ } else { + } else {
+ String dim = "DIM" + dimension; + String dim = "DIM" + dimension;
- SecondaryWorldServer secondaryworldserver = (new SecondaryWorldServer(this, idatamanager, DimensionManager.NETHER, worldserver, this.methodProfiler)).i_();
+ File newWorld = new File(new File(name), dim);
+ File oldWorld = new File(new File(s), dim);
- this.worldServer.put(DimensionManager.NETHER, secondaryworldserver); - this.worldServer.put(DimensionManager.NETHER, secondaryworldserver);
- secondaryworldserver.addIWorldAccess(new WorldManager(this, secondaryworldserver)); - secondaryworldserver.addIWorldAccess(new WorldManager(this, secondaryworldserver));
- if (!this.H()) { - if (!this.H()) {
- secondaryworldserver.getWorldData().setGameType(this.getGamemode()); - secondaryworldserver.getWorldData().setGameType(this.getGamemode());
- } - }
+ File newWorld = new File(new File(name), dim);
+ File oldWorld = new File(new File(s), dim);
- SecondaryWorldServer secondaryworldserver1 = (new SecondaryWorldServer(this, idatamanager, DimensionManager.THE_END, worldserver, this.methodProfiler)).i_();
+ if ((!newWorld.isDirectory()) && (oldWorld.isDirectory())) { + if ((!newWorld.isDirectory()) && (oldWorld.isDirectory())) {
+ MinecraftServer.LOGGER.info("---- Migration of old " + worldType + " folder required ----"); + MinecraftServer.LOGGER.info("---- Migration of old " + worldType + " folder required ----");
+ MinecraftServer.LOGGER.info("Unfortunately due to the way that Minecraft implemented multiworld support in 1.6, Bukkit requires that you move your " + worldType + " folder to a new location in order to operate correctly."); + MinecraftServer.LOGGER.info("Unfortunately due to the way that Minecraft implemented multiworld support in 1.6, Bukkit requires that you move your " + worldType + " folder to a new location in order to operate correctly.");
@ -234,11 +233,7 @@
+ } + }
+ } + }
- this.worldServer.put(DimensionManager.THE_END, secondaryworldserver1); - SecondaryWorldServer secondaryworldserver1 = (new SecondaryWorldServer(this, idatamanager, DimensionManager.THE_END, worldserver, this.methodProfiler)).i_();
- secondaryworldserver1.addIWorldAccess(new WorldManager(this, secondaryworldserver1));
- if (!this.H()) {
- secondaryworldserver1.getWorldData().setGameType(this.getGamemode());
- }
+ IDataManager idatamanager = new ServerNBTManager(server.getWorldContainer(), name, this, this.dataConverterManager); + IDataManager idatamanager = new ServerNBTManager(server.getWorldContainer(), name, this, this.dataConverterManager);
+ // world =, b0 to dimension, s1 to name, added Environment and gen + // world =, b0 to dimension, s1 to name, added Environment and gen
+ worlddata = idatamanager.getWorldData(); + worlddata = idatamanager.getWorldData();
@ -248,20 +243,25 @@
+ worlddata.checkName(name); // CraftBukkit - Migration did not rewrite the level.dat; This forces 1.8 to take the last loaded world as respawn (in this case the end) + worlddata.checkName(name); // CraftBukkit - Migration did not rewrite the level.dat; This forces 1.8 to take the last loaded world as respawn (in this case the end)
+ world = (WorldServer) new SecondaryWorldServer(this, idatamanager, DimensionManager.a(dimension), this.getWorldServer(DimensionManager.OVERWORLD), this.methodProfiler, worlddata, org.bukkit.World.Environment.getEnvironment(dimension), gen).i_(); + world = (WorldServer) new SecondaryWorldServer(this, idatamanager, DimensionManager.a(dimension), this.getWorldServer(DimensionManager.OVERWORLD), this.methodProfiler, worlddata, org.bukkit.World.Environment.getEnvironment(dimension), gen).i_();
+ } + }
+
- this.worldServer.put(DimensionManager.THE_END, secondaryworldserver1);
- secondaryworldserver1.addIWorldAccess(new WorldManager(this, secondaryworldserver1));
- if (!this.H()) {
- secondaryworldserver1.getWorldData().setGameType(this.getGamemode());
- }
+ this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldInitEvent(world.getWorld())); + this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldInitEvent(world.getWorld()));
+ +
+ world.addIWorldAccess(new WorldManager(this, world)); + world.addIWorldAccess(new WorldManager(this, world));
+ if (!this.H()) { + if (!this.H()) {
+ world.getWorldData().setGameType(this.getGamemode()); + world.getWorldData().setGameType(this.getGamemode());
+ } + }
+
+ this.worldServer.put(world.dimension, world);
+ this.getPlayerList().setPlayerFileData(world);
- this.getPlayerList().setPlayerFileData(worldserver); - this.getPlayerList().setPlayerFileData(worldserver);
- if (worlddata.P() != null) { - if (worlddata.P() != null) {
- this.getBossBattleCustomData().a(worlddata.P()); - this.getBossBattleCustomData().a(worlddata.P());
+ this.worldServer.put(world.dimension, world);
+ this.getPlayerList().setPlayerFileData(world);
+
+ if (worlddata.P() != null) { + if (worlddata.P() != null) {
+ this.getBossBattleCustomData().a(worlddata.P()); + this.getBossBattleCustomData().a(worlddata.P());
+ } + }
@ -296,8 +296,8 @@
+ // CraftBukkit end + // CraftBukkit end
this.resourcePackRepository.a((ResourcePackSource) this.resourcePackFolder); this.resourcePackRepository.a((ResourcePackSource) this.resourcePackFolder);
this.resourcePackRepository.a(); this.resourcePackRepository.a();
ArrayList arraylist = Lists.newArrayList(); List<ResourcePackLoader> list = Lists.newArrayList();
@@ -325,42 +467,52 @@ @@ -320,42 +462,52 @@
boolean flag4 = true; boolean flag4 = true;
this.b((IChatBaseComponent) (new ChatMessage("menu.generatingTerrain", new Object[0]))); this.b((IChatBaseComponent) (new ChatMessage("menu.generatingTerrain", new Object[0])));
@ -305,30 +305,30 @@
- MinecraftServer.LOGGER.info("Preparing start region for dimension " + DimensionManager.a(worldserver.worldProvider.getDimensionManager())); - MinecraftServer.LOGGER.info("Preparing start region for dimension " + DimensionManager.a(worldserver.worldProvider.getDimensionManager()));
- BlockPosition blockposition = worldserver.getSpawn(); - BlockPosition blockposition = worldserver.getSpawn();
- ArrayList arraylist = Lists.newArrayList(); - List<ChunkCoordIntPair> list = Lists.newArrayList();
- Set set = Sets.newConcurrentHashSet(); - Set<ChunkCoordIntPair> set = Sets.newConcurrentHashSet();
+ // CraftBukkit start - fire WorldLoadEvent and handle whether or not to keep the spawn in memory + // CraftBukkit start - fire WorldLoadEvent and handle whether or not to keep the spawn in memory
Stopwatch stopwatch = Stopwatch.createStarted(); Stopwatch stopwatch = Stopwatch.createStarted();
- -
- for (int i = -192; i <= 192 && this.isRunning(); i += 16) { - for (int i = -192; i <= 192 && this.isRunning(); i += 16) {
- for (int j = -192; j <= 192 && this.isRunning(); j += 16) { - for (int j = -192; j <= 192 && this.isRunning(); j += 16) {
- arraylist.add(new ChunkCoordIntPair(blockposition.getX() + i >> 4, blockposition.getZ() + j >> 4)); - list.add(new ChunkCoordIntPair(blockposition.getX() + i >> 4, blockposition.getZ() + j >> 4));
+ for (WorldServer worldserver : this.getWorlds()) { + for (WorldServer worldserver : this.getWorlds()) {
+ MinecraftServer.LOGGER.info("Preparing start region for level " + worldserver.dimension + " (Seed: " + worldserver.getSeed() + ")"); + MinecraftServer.LOGGER.info("Preparing start region for level " + worldserver.dimension + " (Seed: " + worldserver.getSeed() + ")");
+ if (!worldserver.getWorld().getKeepSpawnInMemory()) { + if (!worldserver.getWorld().getKeepSpawnInMemory()) {
+ continue; + continue;
} }
- CompletableFuture completablefuture = worldserver.getChunkProvider().a((Iterable) arraylist, (chunk) -> { - CompletableFuture completablefuture = worldserver.getChunkProvider().a((Iterable) list, (chunk) -> {
- set.add(chunk.getPos()); - set.add(chunk.getPos());
- }); - });
+ BlockPosition blockposition = worldserver.getSpawn(); + BlockPosition blockposition = worldserver.getSpawn();
+ ArrayList arraylist = Lists.newArrayList(); + List<ChunkCoordIntPair> list = Lists.newArrayList();
+ Set set = Sets.newConcurrentHashSet(); + Set<ChunkCoordIntPair> set = Sets.newConcurrentHashSet();
+ +
+ for (int i = -192; i <= 192 && this.isRunning(); i += 16) { + for (int i = -192; i <= 192 && this.isRunning(); i += 16) {
+ for (int j = -192; j <= 192 && this.isRunning(); j += 16) { + for (int j = -192; j <= 192 && this.isRunning(); j += 16) {
+ arraylist.add(new ChunkCoordIntPair(blockposition.getX() + i >> 4, blockposition.getZ() + j >> 4)); + list.add(new ChunkCoordIntPair(blockposition.getX() + i >> 4, blockposition.getZ() + j >> 4));
+ } + }
- while (!completablefuture.isDone()) { - while (!completablefuture.isDone()) {
@ -340,7 +340,7 @@
- if (executionexception.getCause() instanceof RuntimeException) { - if (executionexception.getCause() instanceof RuntimeException) {
- throw (RuntimeException) executionexception.getCause(); - throw (RuntimeException) executionexception.getCause();
- } - }
+ CompletableFuture completablefuture = worldserver.getChunkProvider().a((Iterable) arraylist, (chunk) -> { + CompletableFuture completablefuture = worldserver.getChunkProvider().a((Iterable) list, (chunk) -> {
+ set.add(chunk.getPos()); + set.add(chunk.getPos());
+ }); + });
+ +
@ -376,7 +376,7 @@
MinecraftServer.LOGGER.info("Time elapsed: {} ms", stopwatch.elapsed(TimeUnit.MILLISECONDS)); MinecraftServer.LOGGER.info("Time elapsed: {} ms", stopwatch.elapsed(TimeUnit.MILLISECONDS));
Iterator iterator = DimensionManager.b().iterator(); Iterator iterator = DimensionManager.b().iterator();
@@ -419,6 +571,10 @@ @@ -414,6 +566,10 @@
protected void l() { protected void l() {
this.w = null; this.w = null;
this.x = 0; this.x = 0;
@ -387,7 +387,7 @@
} }
protected void saveChunks(boolean flag) { protected void saveChunks(boolean flag) {
@@ -442,8 +598,24 @@ @@ -437,8 +593,24 @@
} }
@ -413,7 +413,7 @@
if (this.getServerConnection() != null) { if (this.getServerConnection() != null) {
this.getServerConnection().b(); this.getServerConnection().b();
} }
@@ -452,6 +624,7 @@ @@ -447,6 +619,7 @@
MinecraftServer.LOGGER.info("Saving players"); MinecraftServer.LOGGER.info("Saving players");
this.playerList.savePlayers(); this.playerList.savePlayers();
this.playerList.u(); this.playerList.u();
@ -421,7 +421,7 @@
} }
MinecraftServer.LOGGER.info("Saving worlds"); MinecraftServer.LOGGER.info("Saving worlds");
@@ -516,11 +689,13 @@ @@ -511,11 +684,13 @@
if (i > 2000L && this.nextTick - this.lastOverloadTime >= 15000L) { if (i > 2000L && this.nextTick - this.lastOverloadTime >= 15000L) {
long j = i / 50L; long j = i / 50L;
@ -435,7 +435,7 @@
this.a(this::canSleepForTick); this.a(this::canSleepForTick);
this.nextTick += 50L; this.nextTick += 50L;
@@ -559,6 +734,12 @@ @@ -554,6 +729,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 {
@ -448,7 +448,7 @@
this.t(); this.t();
} }
@@ -627,7 +808,7 @@ @@ -622,7 +803,7 @@
this.m.b().a(agameprofile); this.m.b().a(agameprofile);
} }
@ -457,7 +457,7 @@
this.methodProfiler.enter("save"); this.methodProfiler.enter("save");
this.playerList.savePlayers(); this.playerList.savePlayers();
this.saveChunks(true); this.saveChunks(true);
@@ -653,6 +834,7 @@ @@ -648,6 +829,7 @@
} }
public void b(BooleanSupplier booleansupplier) { public void b(BooleanSupplier booleansupplier) {
@ -465,7 +465,7 @@
this.methodProfiler.enter("jobs"); this.methodProfiler.enter("jobs");
FutureTask futuretask; FutureTask futuretask;
@@ -665,23 +847,40 @@ @@ -660,23 +842,40 @@
this.getFunctionData().tick(); this.getFunctionData().tick();
this.methodProfiler.exitEnter("levels"); this.methodProfiler.exitEnter("levels");
@ -512,7 +512,7 @@
this.methodProfiler.enter("tick"); this.methodProfiler.enter("tick");
@@ -732,10 +931,11 @@ @@ -727,10 +926,11 @@
this.k.add(itickable); this.k.add(itickable);
} }
@ -525,7 +525,7 @@
boolean flag = true; boolean flag = true;
String s = null; String s = null;
String s1 = "."; String s1 = ".";
@@ -783,13 +983,16 @@ @@ -778,13 +978,16 @@
++j; ++j;
} }
} }
@ -543,7 +543,7 @@
if (s != null) { if (s != null) {
dedicatedserver.h(s); dedicatedserver.h(s);
} }
@@ -827,6 +1030,29 @@ @@ -822,6 +1025,29 @@
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(MinecraftServer.LOGGER)); thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(MinecraftServer.LOGGER));
Runtime.getRuntime().addShutdownHook(thread); Runtime.getRuntime().addShutdownHook(thread);
@ -573,7 +573,7 @@
} 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);
} }
@@ -838,11 +1064,13 @@ @@ -833,11 +1059,13 @@
} }
public void v() { public void v() {
@ -587,7 +587,7 @@
} }
public File c(String s) { public File c(String s) {
@@ -882,7 +1110,7 @@ @@ -877,7 +1105,7 @@
} }
public boolean isDebugging() { public boolean isDebugging() {
@ -596,7 +596,7 @@
} }
public void f(String s) { public void f(String s) {
@@ -897,7 +1125,7 @@ @@ -892,7 +1120,7 @@
} }
public String getServerModName() { public String getServerModName() {
@ -605,7 +605,7 @@
} }
public CrashReport b(CrashReport crashreport) { public CrashReport b(CrashReport crashreport) {
@@ -933,7 +1161,7 @@ @@ -928,7 +1156,7 @@
} }
public boolean D() { public boolean D() {
@ -614,7 +614,7 @@
} }
public void sendMessage(IChatBaseComponent ichatbasecomponent) { public void sendMessage(IChatBaseComponent ichatbasecomponent) {
@@ -1073,7 +1301,7 @@ @@ -1068,7 +1296,7 @@
public abstract boolean Q(); public abstract boolean Q();
public boolean getOnlineMode() { public boolean getOnlineMode() {
@ -623,36 +623,16 @@
} }
public void setOnlineMode(boolean flag) { public void setOnlineMode(boolean flag) {
@@ -1233,7 +1461,7 @@ @@ -1228,7 +1456,7 @@
public <V> ListenableFuture<V> a(Callable<V> callable) { public <V> ListenableFuture<V> a(Callable<V> callable) {
Validate.notNull(callable); Validate.notNull(callable);
- if (!this.isMainThread() && !this.isStopped()) { - if (!this.isMainThread() && !this.isStopped()) {
+ if (!this.isMainThread()) { // CraftBukkit && !this.isStopped()) { + if (!this.isMainThread()) { // CraftBukkit && !this.isStopped()) {
ListenableFutureTask listenablefuturetask = ListenableFutureTask.create(callable); ListenableFutureTask<V> listenablefuturetask = ListenableFutureTask.create(callable);
this.f.add(listenablefuturetask); this.f.add(listenablefuturetask);
@@ -1304,8 +1532,8 @@ @@ -1411,4 +1639,11 @@
if (!worlddata.N().contains(resourcepackloader.e()) && !arraylist.contains(resourcepackloader)) {
MinecraftServer.LOGGER.info("Found new data pack {}, loading it automatically", resourcepackloader.e());
- resourcepackloader.h().a(arraylist, resourcepackloader, (resourcepackloader) -> {
- return resourcepackloader;
+ resourcepackloader.h().a(arraylist, resourcepackloader, (resourcepackloader1) -> { // CraftBukkit - decompile error
+ return resourcepackloader1; // CraftBukkit - decompile error
}, false);
}
}
@@ -1314,7 +1542,7 @@
ArrayList arraylist1 = Lists.newArrayList();
this.resourcePackRepository.d().forEach((resourcepackloader) -> {
- list.add(resourcepackloader.d());
+ arraylist1.add(resourcepackloader.d()); // CraftBukkit - decompile error
});
this.ac.a((List) arraylist1);
worlddata.O().clear();
@@ -1416,4 +1644,11 @@
return 0; return 0;
} }
} }

View File

@ -1,7 +1,7 @@
--- a/net/minecraft/server/MobEffectList.java --- a/net/minecraft/server/MobEffectList.java
+++ b/net/minecraft/server/MobEffectList.java +++ b/net/minecraft/server/MobEffectList.java
@@ -8,6 +8,11 @@ @@ -7,6 +7,11 @@
import java.util.function.Supplier; import java.util.Map.Entry;
import javax.annotation.Nullable; import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
@ -12,7 +12,7 @@
public class MobEffectList { public class MobEffectList {
private final Map<IAttribute, AttributeModifier> a = Maps.newHashMap(); private final Map<IAttribute, AttributeModifier> a = Maps.newHashMap();
@@ -25,7 +30,7 @@ @@ -24,7 +29,7 @@
} }
public static int getId(MobEffectList mobeffectlist) { public static int getId(MobEffectList mobeffectlist) {
@ -21,7 +21,7 @@
} }
protected MobEffectList(boolean flag, int i) { protected MobEffectList(boolean flag, int i) {
@@ -47,11 +52,11 @@ @@ -46,11 +51,11 @@
public void tick(EntityLiving entityliving, int i) { public void tick(EntityLiving entityliving, int i) {
if (this == MobEffects.REGENERATION) { if (this == MobEffects.REGENERATION) {
if (entityliving.getHealth() < entityliving.getMaxHealth()) { if (entityliving.getHealth() < entityliving.getMaxHealth()) {
@ -35,7 +35,7 @@
} }
} else if (this == MobEffects.WITHER) { } else if (this == MobEffects.WITHER) {
entityliving.damageEntity(DamageSource.WITHER, 1.0F); entityliving.damageEntity(DamageSource.WITHER, 1.0F);
@@ -59,14 +64,25 @@ @@ -58,14 +63,25 @@
((EntityHuman) entityliving).applyExhaustion(0.005F * (float) (i + 1)); ((EntityHuman) entityliving).applyExhaustion(0.005F * (float) (i + 1));
} else if (this == MobEffects.SATURATION && entityliving instanceof EntityHuman) { } else if (this == MobEffects.SATURATION && entityliving instanceof EntityHuman) {
if (!entityliving.world.isClientSide) { if (!entityliving.world.isClientSide) {
@ -63,7 +63,7 @@
} }
} }
@@ -87,7 +103,7 @@ @@ -86,7 +102,7 @@
} }
} else { } else {
j = (int) (d0 * (double) (4 << i) + 0.5D); j = (int) (d0 * (double) (4 << i) + 0.5D);
@ -72,7 +72,7 @@
} }
} }
@@ -216,6 +232,11 @@ @@ -215,6 +231,11 @@
a(28, "slow_falling", (new MobEffectList(false, 16773073)).b(8, 0).l()); a(28, "slow_falling", (new MobEffectList(false, 16773073)).b(8, 0).l());
a(29, "conduit_power", (new MobEffectList(false, 1950417)).b(9, 0).l()); a(29, "conduit_power", (new MobEffectList(false, 1950417)).b(9, 0).l());
a(30, "dolphins_grace", (new MobEffectList(false, 8954814)).b(10, 0).l()); a(30, "dolphins_grace", (new MobEffectList(false, 8954814)).b(10, 0).l());

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/NameReferencingFileConverter.java --- a/net/minecraft/server/NameReferencingFileConverter.java
+++ b/net/minecraft/server/NameReferencingFileConverter.java +++ b/net/minecraft/server/NameReferencingFileConverter.java
@@ -83,8 +83,9 @@ @@ -81,8 +81,9 @@
if (gameprofilebanlist.c().exists()) { if (gameprofilebanlist.c().exists()) {
try { try {
gameprofilebanlist.load(); gameprofilebanlist.load();
@ -12,16 +12,7 @@
} }
} }
@@ -113,7 +114,7 @@ @@ -139,8 +140,9 @@
public void onProfileLookupFailed(GameProfile gameprofile, Exception exception) {
NameReferencingFileConverter.e.warn("Could not lookup user banlist entry for {}", gameprofile.getName(), exception);
if (!(exception instanceof ProfileNotFoundException)) {
- throw new NameReferencingFileConverter.FileConversionException("Could not request user " + gameprofile.getName() + " from backend systems", exception, null);
+ throw new NameReferencingFileConverter.FileConversionException("Could not request user " + gameprofile.getName() + " from backend systems", exception); // CraftBukkit - decompile error
}
}
};
@@ -141,8 +142,9 @@
if (ipbanlist.c().exists()) { if (ipbanlist.c().exists()) {
try { try {
ipbanlist.load(); ipbanlist.load();
@ -33,7 +24,7 @@
} }
} }
@@ -182,8 +184,9 @@ @@ -180,8 +182,9 @@
if (oplist.c().exists()) { if (oplist.c().exists()) {
try { try {
oplist.load(); oplist.load();
@ -45,16 +36,7 @@
} }
} }
@@ -198,7 +201,7 @@ @@ -224,8 +227,9 @@
public void onProfileLookupFailed(GameProfile gameprofile, Exception exception) {
NameReferencingFileConverter.e.warn("Could not lookup oplist entry for {}", gameprofile.getName(), exception);
if (!(exception instanceof ProfileNotFoundException)) {
- throw new NameReferencingFileConverter.FileConversionException("Could not request user " + gameprofile.getName() + " from backend systems", exception, null);
+ throw new NameReferencingFileConverter.FileConversionException("Could not request user " + gameprofile.getName() + " from backend systems", exception); // CraftBukkit - decompile error
}
}
};
@@ -226,8 +229,9 @@
if (whitelist.c().exists()) { if (whitelist.c().exists()) {
try { try {
whitelist.load(); whitelist.load();
@ -66,33 +48,15 @@
} }
} }
@@ -242,7 +246,7 @@ @@ -343,6 +347,30 @@
public void onProfileLookupFailed(GameProfile gameprofile, Exception exception) { File file5 = new File(file, s2 + ".dat");
NameReferencingFileConverter.e.warn("Could not lookup user whitelist entry for {}", gameprofile.getName(), exception); File file6 = new File(file4, s3 + ".dat");
if (!(exception instanceof ProfileNotFoundException)) {
- throw new NameReferencingFileConverter.FileConversionException("Could not request user " + gameprofile.getName() + " from backend systems", exception, null);
+ throw new NameReferencingFileConverter.FileConversionException("Could not request user " + gameprofile.getName() + " from backend systems", exception); // CraftBukkit - decompile error
}
}
};
@@ -337,7 +341,7 @@
this.a(file, s, s);
} else {
- throw new NameReferencingFileConverter.FileConversionException("Could not request user " + gameprofile.getName() + " from backend systems", exception, null);
+ throw new NameReferencingFileConverter.FileConversionException("Could not request user " + gameprofile.getName() + " from backend systems", exception); // CraftBukkit - decompile error
}
}
@@ -345,6 +349,30 @@
File file1 = new File(file2, s + ".dat");
File file3 = new File(file, s1 + ".dat");
+ // CraftBukkit start - Use old file name to seed lastKnownName + // CraftBukkit start - Use old file name to seed lastKnownName
+ NBTTagCompound root = null; + NBTTagCompound root = null;
+ +
+ try { + try {
+ root = NBTCompressedStreamTools.a(new java.io.FileInputStream(file1)); + root = NBTCompressedStreamTools.a(new java.io.FileInputStream(file5));
+ } catch (Exception exception) { + } catch (Exception exception) {
+ exception.printStackTrace(); + exception.printStackTrace();
+ } + }
@ -102,7 +66,7 @@
+ root.set("bukkit", new NBTTagCompound()); + root.set("bukkit", new NBTTagCompound());
+ } + }
+ NBTTagCompound data = root.getCompound("bukkit"); + NBTTagCompound data = root.getCompound("bukkit");
+ data.setString("lastKnownName", s); + data.setString("lastKnownName", s2);
+ +
+ try { + try {
+ NBTCompressedStreamTools.a(root, new java.io.FileOutputStream(file2)); + NBTCompressedStreamTools.a(root, new java.io.FileOutputStream(file2));
@ -112,19 +76,10 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+ +
NameReferencingFileConverter.b(file); NameReferencingFileConverter.b(file4);
if (!file1.renameTo(file3)) { if (!file5.renameTo(file6)) {
throw new NameReferencingFileConverter.FileConversionException("Could not convert file for " + s, null); throw new NameReferencingFileConverter.FileConversionException("Could not convert file for " + s2);
@@ -353,7 +381,7 @@ @@ -464,7 +492,7 @@
private String a(GameProfile gameprofile) {
String s = null;
- String[] astring = astring1;
+ // String[] astring = astring1; // CraftBukkit - decompile error
int i = astring.length;
for (int j = 0; j < i; ++j) {
@@ -466,7 +494,7 @@
private static File d(PropertyManager propertymanager) { private static File d(PropertyManager propertymanager) {
String s = propertymanager.getString("level-name", "world"); String s = propertymanager.getString("level-name", "world");

View File

@ -1,15 +1,6 @@
--- a/net/minecraft/server/NetworkManager.java --- a/net/minecraft/server/NetworkManager.java
+++ b/net/minecraft/server/NetworkManager.java +++ b/net/minecraft/server/NetworkManager.java
@@ -103,7 +103,7 @@ @@ -129,7 +129,7 @@
if (flag) {
NetworkManager.g.debug("Failed to sent packet", throwable);
this.sendPacket(new PacketPlayOutKickDisconnect(chatmessage), (future) -> {
- this.close(ichatbasecomponent);
+ this.close(chatmessage); // CraftBukkit - decompile error
});
this.stopReading();
} else {
@@ -130,7 +130,7 @@
} }
private static <T extends PacketListener> void a(Packet<T> packet, PacketListener packetlistener) { private static <T extends PacketListener> void a(Packet<T> packet, PacketListener packetlistener) {
@ -18,7 +9,7 @@
} }
public void setPacketListener(PacketListener packetlistener) { public void setPacketListener(PacketListener packetlistener) {
@@ -241,7 +241,7 @@ @@ -240,7 +240,7 @@
public void close(IChatBaseComponent ichatbasecomponent) { public void close(IChatBaseComponent ichatbasecomponent) {
if (this.channel.isOpen()) { if (this.channel.isOpen()) {

View File

@ -9,7 +9,7 @@
return true; return true;
} }
} else { } else {
- this.d = this.e.world.a(this.e.locX, this.e.locY + (double) this.e.getHeadHeight(), this.e.locZ, this.i(), this.i(), new Function() { - this.d = this.e.world.a(this.e.locX, this.e.locY + (double) this.e.getHeadHeight(), this.e.locZ, this.i(), this.i(), new Function<EntityHuman, Double>() {
+ this.d = (T) this.e.world.a(this.e.locX, this.e.locY + (double) this.e.getHeadHeight(), this.e.locZ, this.i(), this.i(), new Function<EntityHuman, Double>() { // CraftBukkit - fix decompile error + this.d = (T) this.e.world.a(this.e.locX, this.e.locY + (double) this.e.getHeadHeight(), this.e.locZ, this.i(), this.i(), new Function<EntityHuman, Double>() { // CraftBukkit - fix decompile error
@Nullable @Nullable
public Double apply(@Nullable EntityHuman entityhuman) { public Double apply(@Nullable EntityHuman entityhuman) {

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/PlayerChunkMap.java --- a/net/minecraft/server/PlayerChunkMap.java
+++ b/net/minecraft/server/PlayerChunkMap.java +++ b/net/minecraft/server/PlayerChunkMap.java
@@ -15,6 +15,10 @@ @@ -13,6 +13,10 @@
import java.util.function.Predicate; import java.util.function.Predicate;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -11,7 +11,7 @@
public class PlayerChunkMap { public class PlayerChunkMap {
private static final Predicate<EntityPlayer> a = (entityplayer) -> { private static final Predicate<EntityPlayer> a = (entityplayer) -> {
@@ -34,6 +38,7 @@ @@ -32,6 +36,7 @@
private long k; private long k;
private boolean l = true; private boolean l = true;
private boolean m = true; private boolean m = true;
@ -19,30 +19,7 @@
public PlayerChunkMap(WorldServer worldserver) { public PlayerChunkMap(WorldServer worldserver) {
this.world = worldserver; this.world = worldserver;
@@ -103,16 +108,18 @@ @@ -135,7 +140,11 @@
if (this.l && i % 4L == 0L) {
this.l = false;
- Collections.sort(this.h, (playerchunk, playerchunk1) -> {
- return ComparisonChain.start().compare(playerchunk.g(), playerchunk1.g()).result();
+ // CraftBukkit start
+ Collections.sort(this.h, (playerchunkx, playerchunk1x) -> {
+ return ComparisonChain.start().compare(playerchunkx.g(), playerchunk1x.g()).result();
});
}
if (this.m && i % 4L == 2L) {
this.m = false;
- Collections.sort(this.g, (playerchunk, playerchunk1) -> {
- return ComparisonChain.start().compare(playerchunk.g(), playerchunk1.g()).result();
+ Collections.sort(this.g, (playerchunkx, playerchunk1x) -> {
+ return ComparisonChain.start().compare(playerchunkx.g(), playerchunk1x.g()).result();
});
+ // CraftBukkit end
}
if (!this.h.isEmpty()) {
@@ -137,7 +144,11 @@
break; break;
} }
} }
@ -54,7 +31,7 @@
} }
} }
@@ -199,6 +210,16 @@ @@ -197,6 +206,16 @@
return playerchunk; return playerchunk;
} }
@ -71,7 +48,7 @@
public void flagDirty(BlockPosition blockposition) { public void flagDirty(BlockPosition blockposition) {
int i = blockposition.getX() >> 4; int i = blockposition.getX() >> 4;
int j = blockposition.getZ() >> 4; int j = blockposition.getZ() >> 4;
@@ -217,12 +238,22 @@ @@ -215,12 +234,22 @@
entityplayer.d = entityplayer.locX; entityplayer.d = entityplayer.locX;
entityplayer.e = entityplayer.locZ; entityplayer.e = entityplayer.locZ;
@ -95,7 +72,7 @@
this.managedPlayers.add(entityplayer); this.managedPlayers.add(entityplayer);
this.e(); this.e();
} }
@@ -266,11 +297,14 @@ @@ -264,11 +293,14 @@
int j1 = i - k; int j1 = i - k;
int k1 = j - l; int k1 = j - l;
@ -111,7 +88,7 @@
} }
if (!this.a(l1 - j1, i2 - k1, i, j, i1)) { if (!this.a(l1 - j1, i2 - k1, i, j, i1)) {
@@ -286,6 +320,13 @@ @@ -284,6 +316,13 @@
entityplayer.d = entityplayer.locX; entityplayer.d = entityplayer.locX;
entityplayer.e = entityplayer.locZ; entityplayer.e = entityplayer.locZ;
this.e(); this.e();
@ -125,7 +102,7 @@
} }
} }
} }
@@ -370,4 +411,47 @@ @@ -368,4 +407,47 @@
} }
} }

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/PlayerConnection.java --- a/net/minecraft/server/PlayerConnection.java
+++ b/net/minecraft/server/PlayerConnection.java +++ b/net/minecraft/server/PlayerConnection.java
@@ -17,6 +17,50 @@ @@ -16,6 +16,50 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -51,7 +51,7 @@
public class PlayerConnection implements PacketListenerPlayIn, ITickable { public class PlayerConnection implements PacketListenerPlayIn, ITickable {
private static final Logger LOGGER = LogManager.getLogger(); private static final Logger LOGGER = LogManager.getLogger();
@@ -27,7 +71,10 @@ @@ -26,7 +70,10 @@
private long lastKeepAlive; private long lastKeepAlive;
private boolean awaitingKeepAlive; private boolean awaitingKeepAlive;
private long h; private long h;
@ -61,9 +61,9 @@
+ private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle"); + private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle");
+ // CraftBukkit end + // CraftBukkit end
private int j; private int j;
private final IntHashMap<Short> k = new IntHashMap(); private final IntHashMap<Short> k = new IntHashMap<>();
private double l; private double l;
@@ -59,7 +106,33 @@ @@ -58,7 +105,33 @@
networkmanager.setPacketListener(this); networkmanager.setPacketListener(this);
this.player = entityplayer; this.player = entityplayer;
entityplayer.playerConnection = this; entityplayer.playerConnection = this;
@ -97,7 +97,7 @@
public void tick() { public void tick() {
this.syncPosition(); this.syncPosition();
@@ -105,7 +178,7 @@ @@ -104,7 +177,7 @@
this.minecraftServer.methodProfiler.enter("keepAlive"); this.minecraftServer.methodProfiler.enter("keepAlive");
long i = SystemUtils.getMonotonicMillis(); long i = SystemUtils.getMonotonicMillis();
@ -106,7 +106,7 @@
if (this.awaitingKeepAlive) { if (this.awaitingKeepAlive) {
this.disconnect(new ChatMessage("disconnect.timeout", new Object[0])); this.disconnect(new ChatMessage("disconnect.timeout", new Object[0]));
} else { } else {
@@ -117,15 +190,21 @@ @@ -116,15 +189,21 @@
} }
this.minecraftServer.methodProfiler.exit(); this.minecraftServer.methodProfiler.exit();
@ -128,7 +128,7 @@
this.disconnect(new ChatMessage("multiplayer.disconnect.idling", new Object[0])); this.disconnect(new ChatMessage("multiplayer.disconnect.idling", new Object[0]));
} }
@@ -144,16 +223,46 @@ @@ -143,16 +222,46 @@
return this.networkManager; return this.networkManager;
} }
@ -176,7 +176,7 @@
} }
public void a(PacketPlayInSteerVehicle packetplayinsteervehicle) { public void a(PacketPlayInSteerVehicle packetplayinsteervehicle) {
@@ -192,7 +301,34 @@ @@ -191,7 +300,34 @@
double d9 = entity.motX * entity.motX + entity.motY * entity.motY + entity.motZ * entity.motZ; double d9 = entity.motX * entity.motX + entity.motY * entity.motY + entity.motZ * entity.motZ;
double d10 = d6 * d6 + d7 * d7 + d8 * d8; double d10 = d6 * d6 + d7 * d7 + d8 * d8;
@ -212,7 +212,7 @@
PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getDisplayName().getString(), this.player.getDisplayName().getString(), d6, d7, d8); PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getDisplayName().getString(), this.player.getDisplayName().getString(), d6, d7, d8);
this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity)); this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity));
return; return;
@@ -222,14 +358,72 @@ @@ -221,14 +357,72 @@
} }
entity.setLocation(d3, d4, d5, f, f1); entity.setLocation(d3, d4, d5, f, f1);
@ -285,7 +285,7 @@
this.minecraftServer.getPlayerList().updateChunks(this.player); this.minecraftServer.getPlayerList().updateChunks(this.player);
this.player.checkMovement(this.player.locX - d0, this.player.locY - d1, this.player.locZ - d2); this.player.checkMovement(this.player.locX - d0, this.player.locY - d1, this.player.locZ - d2);
this.D = d11 >= -0.03125D && !this.minecraftServer.getAllowFlight() && !worldserver.a(entity.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D)); this.D = d11 >= -0.03125D && !this.minecraftServer.getAllowFlight() && !worldserver.a(entity.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
@@ -243,7 +437,7 @@ @@ -242,7 +436,7 @@
public void a(PacketPlayInTeleportAccept packetplayinteleportaccept) { public void a(PacketPlayInTeleportAccept packetplayinteleportaccept) {
PlayerConnectionUtils.ensureMainThread(packetplayinteleportaccept, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinteleportaccept, this, this.player.getWorldServer());
@ -294,7 +294,7 @@
this.player.setLocation(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch); this.player.setLocation(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch);
this.o = this.teleportPos.x; this.o = this.teleportPos.x;
this.p = this.teleportPos.y; this.p = this.teleportPos.y;
@@ -253,6 +447,7 @@ @@ -252,6 +446,7 @@
} }
this.teleportPos = null; this.teleportPos = null;
@ -302,7 +302,7 @@
} }
} }
@@ -289,6 +484,12 @@ @@ -288,6 +483,12 @@
public void a(PacketPlayInTabComplete packetplayintabcomplete) { public void a(PacketPlayInTabComplete packetplayintabcomplete) {
PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer());
@ -314,9 +314,9 @@
+ // CraftBukkit end + // CraftBukkit end
StringReader stringreader = new StringReader(packetplayintabcomplete.c()); StringReader stringreader = new StringReader(packetplayintabcomplete.c());
if (stringreader.canRead() && stringreader.peek() == 47) { if (stringreader.canRead() && stringreader.peek() == '/') {
@@ -298,7 +499,8 @@ @@ -297,7 +498,8 @@
ParseResults parseresults = this.minecraftServer.getCommandDispatcher().a().parse(stringreader, this.player.getCommandListener()); ParseResults<CommandListenerWrapper> parseresults = this.minecraftServer.getCommandDispatcher().a().parse(stringreader, this.player.getCommandListener());
this.minecraftServer.getCommandDispatcher().a().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { this.minecraftServer.getCommandDispatcher().a().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
- this.networkManager.sendPacket(new PacketPlayOutTabComplete(packetplayintabcomplete.b(), suggestions)); - this.networkManager.sendPacket(new PacketPlayOutTabComplete(packetplayintabcomplete.b(), suggestions));
@ -325,7 +325,7 @@
}); });
} }
@@ -490,6 +692,15 @@ @@ -489,6 +691,15 @@
} }
public void a(PacketPlayInBEdit packetplayinbedit) { public void a(PacketPlayInBEdit packetplayinbedit) {
@ -341,7 +341,7 @@
ItemStack itemstack = packetplayinbedit.b(); ItemStack itemstack = packetplayinbedit.b();
if (!itemstack.isEmpty()) { if (!itemstack.isEmpty()) {
@@ -514,11 +725,13 @@ @@ -513,11 +724,13 @@
} }
itemstack2.a("pages", (NBTBase) nbttaglist); itemstack2.a("pages", (NBTBase) nbttaglist);
@ -357,7 +357,7 @@
} }
} }
@@ -558,7 +771,7 @@ @@ -557,7 +770,7 @@
} else { } else {
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
@ -366,7 +366,7 @@
if (this.e == 0) { if (this.e == 0) {
this.syncPosition(); this.syncPosition();
} }
@@ -568,13 +781,21 @@ @@ -567,13 +780,21 @@
this.A = this.e; this.A = this.e;
this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch); this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch);
} }
@ -389,7 +389,7 @@
double d0 = this.player.locX; double d0 = this.player.locX;
double d1 = this.player.locY; double d1 = this.player.locY;
double d2 = this.player.locZ; double d2 = this.player.locZ;
@@ -599,15 +820,33 @@ @@ -598,15 +819,33 @@
++this.receivedMovePackets; ++this.receivedMovePackets;
int i = this.receivedMovePackets - this.processedMovePackets; int i = this.receivedMovePackets - this.processedMovePackets;
@ -425,7 +425,7 @@
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getDisplayName().getString(), d7, d8, d9); PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getDisplayName().getString(), d7, d8, d9);
this.a(this.player.locX, this.player.locY, this.player.locZ, this.player.yaw, this.player.pitch); this.a(this.player.locX, this.player.locY, this.player.locZ, this.player.yaw, this.player.pitch);
return; return;
@@ -653,6 +892,69 @@ @@ -652,6 +891,69 @@
} }
} }
@ -495,7 +495,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.dc() && !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));
@@ -670,10 +972,76 @@ @@ -669,10 +971,76 @@
} }
public void a(double d0, double d1, double d2, float f, float f1) { public void a(double d0, double d1, double d2, float f, float f1) {
@ -573,7 +573,7 @@
double d3 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.X) ? this.player.locX : 0.0D; double d3 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.X) ? this.player.locX : 0.0D;
double d4 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Y) ? this.player.locY : 0.0D; double d4 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Y) ? this.player.locY : 0.0D;
double d5 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Z) ? this.player.locZ : 0.0D; double d5 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Z) ? this.player.locZ : 0.0D;
@@ -685,6 +1053,14 @@ @@ -684,6 +1052,14 @@
this.teleportAwait = 0; this.teleportAwait = 0;
} }
@ -588,7 +588,7 @@
this.A = this.e; this.A = this.e;
this.player.setLocation(d0, d1, d2, f, f1); this.player.setLocation(d0, d1, d2, f, f1);
this.player.playerConnection.sendPacket(new PacketPlayOutPosition(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.teleportAwait)); this.player.playerConnection.sendPacket(new PacketPlayOutPosition(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.teleportAwait));
@@ -692,6 +1068,7 @@ @@ -691,6 +1067,7 @@
public void a(PacketPlayInBlockDig packetplayinblockdig) { public void a(PacketPlayInBlockDig packetplayinblockdig) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.getWorldServer());
@ -596,7 +596,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
BlockPosition blockposition = packetplayinblockdig.b(); BlockPosition blockposition = packetplayinblockdig.b();
@@ -701,13 +1078,45 @@ @@ -700,13 +1077,45 @@
if (!this.player.isSpectator()) { if (!this.player.isSpectator()) {
ItemStack itemstack = this.player.b(EnumHand.OFF_HAND); ItemStack itemstack = this.player.b(EnumHand.OFF_HAND);
@ -644,7 +644,7 @@
this.player.a(false); this.player.a(false);
} }
@@ -738,7 +1147,15 @@ @@ -737,7 +1146,15 @@
if (!this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) { if (!this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) {
this.player.playerInteractManager.a(blockposition, packetplayinblockdig.c()); this.player.playerInteractManager.a(blockposition, packetplayinblockdig.c());
} else { } else {
@ -660,7 +660,7 @@
} }
} else { } else {
if (packetplayinblockdig.d() == PacketPlayInBlockDig.EnumPlayerDigType.STOP_DESTROY_BLOCK) { if (packetplayinblockdig.d() == PacketPlayInBlockDig.EnumPlayerDigType.STOP_DESTROY_BLOCK) {
@@ -757,10 +1174,12 @@ @@ -756,10 +1173,12 @@
default: default:
throw new IllegalArgumentException("Invalid player action"); throw new IllegalArgumentException("Invalid player action");
} }
@ -673,7 +673,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
EnumHand enumhand = packetplayinuseitem.d(); EnumHand enumhand = packetplayinuseitem.d();
ItemStack itemstack = this.player.b(enumhand); ItemStack itemstack = this.player.b(enumhand);
@@ -773,6 +1192,13 @@ @@ -772,6 +1191,13 @@
this.player.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent, ChatMessageType.GAME_INFO)); this.player.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent, ChatMessageType.GAME_INFO));
} else if (this.teleportPos == null && this.player.d((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && !this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) { } else if (this.teleportPos == null && this.player.d((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && !this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) {
@ -687,7 +687,7 @@
this.player.playerInteractManager.a(this.player, worldserver, itemstack, enumhand, blockposition, enumdirection, packetplayinuseitem.e(), packetplayinuseitem.f(), packetplayinuseitem.g()); this.player.playerInteractManager.a(this.player, worldserver, itemstack, enumhand, blockposition, enumdirection, packetplayinuseitem.e(), packetplayinuseitem.f(), packetplayinuseitem.g());
} }
@@ -782,13 +1208,52 @@ @@ -781,13 +1207,52 @@
public void a(PacketPlayInBlockPlace packetplayinblockplace) { public void a(PacketPlayInBlockPlace packetplayinblockplace) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.getWorldServer());
@ -741,7 +741,7 @@
} }
} }
@@ -808,13 +1273,18 @@ @@ -807,13 +1272,18 @@
} }
if (entity != null) { if (entity != null) {
@ -762,7 +762,7 @@
public void a(PacketPlayInBoatMove packetplayinboatmove) { public void a(PacketPlayInBoatMove packetplayinboatmove) {
PlayerConnectionUtils.ensureMainThread(packetplayinboatmove, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinboatmove, this, this.player.getWorldServer());
@@ -827,11 +1297,26 @@ @@ -826,11 +1296,26 @@
} }
public void a(IChatBaseComponent ichatbasecomponent) { public void a(IChatBaseComponent ichatbasecomponent) {
@ -790,7 +790,7 @@
if (this.minecraftServer.H() && this.player.getDisplayName().getString().equals(this.minecraftServer.G())) { if (this.minecraftServer.H() && this.player.getDisplayName().getString().equals(this.minecraftServer.G())) {
PlayerConnection.LOGGER.info("Stopping singleplayer server as player logged out"); PlayerConnection.LOGGER.info("Stopping singleplayer server as player logged out");
this.minecraftServer.safeShutdown(); this.minecraftServer.safeShutdown();
@@ -857,6 +1342,15 @@ @@ -856,6 +1341,15 @@
} }
} }
@ -806,7 +806,7 @@
try { try {
this.networkManager.sendPacket(packet, genericfuturelistener); this.networkManager.sendPacket(packet, genericfuturelistener);
} catch (Throwable throwable) { } catch (Throwable throwable) {
@@ -872,17 +1366,37 @@ @@ -871,17 +1365,37 @@
public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) { public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
PlayerConnectionUtils.ensureMainThread(packetplayinhelditemslot, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinhelditemslot, this, this.player.getWorldServer());
@ -846,7 +846,7 @@
this.sendPacket(new PacketPlayOutChat((new ChatMessage("chat.cannotSend", new Object[0])).a(EnumChatFormat.RED))); this.sendPacket(new PacketPlayOutChat((new ChatMessage("chat.cannotSend", new Object[0])).a(EnumChatFormat.RED)));
} else { } else {
this.player.resetIdleTimer(); this.player.resetIdleTimer();
@@ -892,39 +1406,249 @@ @@ -891,39 +1405,249 @@
for (int i = 0; i < s.length(); ++i) { for (int i = 0; i < s.length(); ++i) {
if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) { if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) {
@ -1103,7 +1103,7 @@
this.player.resetIdleTimer(); this.player.resetIdleTimer();
IJumpable ijumpable; IJumpable ijumpable;
@@ -987,6 +1711,7 @@ @@ -986,6 +1710,7 @@
public void a(PacketPlayInUseEntity packetplayinuseentity) { public void a(PacketPlayInUseEntity packetplayinuseentity) {
PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.getWorldServer());
@ -1111,7 +1111,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
Entity entity = packetplayinuseentity.a((World) worldserver); Entity entity = packetplayinuseentity.a((World) worldserver);
@@ -1002,20 +1727,73 @@ @@ -1001,20 +1726,73 @@
if (this.player.h(entity) < d0) { if (this.player.h(entity) < d0) {
EnumHand enumhand; EnumHand enumhand;
@ -1186,7 +1186,7 @@
} }
} }
} }
@@ -1031,7 +1809,8 @@ @@ -1030,7 +1808,8 @@
case PERFORM_RESPAWN: case PERFORM_RESPAWN:
if (this.player.viewingCredits) { if (this.player.viewingCredits) {
this.player.viewingCredits = false; this.player.viewingCredits = false;
@ -1196,7 +1196,7 @@
CriterionTriggers.v.a(this.player, DimensionManager.THE_END, DimensionManager.OVERWORLD); CriterionTriggers.v.a(this.player, DimensionManager.THE_END, DimensionManager.OVERWORLD);
} else { } else {
if (this.player.getHealth() > 0.0F) { if (this.player.getHealth() > 0.0F) {
@@ -1053,14 +1832,20 @@ @@ -1052,14 +1831,20 @@
public void a(PacketPlayInCloseWindow packetplayinclosewindow) { public void a(PacketPlayInCloseWindow packetplayinclosewindow) {
PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.getWorldServer());
@ -1216,10 +1216,10 @@
+ if (this.player.activeContainer.windowId == packetplayinwindowclick.b() && this.player.activeContainer.c(this.player) && this.player.activeContainer.canUse(this.player)) { // CraftBukkit + if (this.player.activeContainer.windowId == packetplayinwindowclick.b() && this.player.activeContainer.c(this.player) && this.player.activeContainer.canUse(this.player)) { // CraftBukkit
+ boolean cancelled = this.player.isSpectator(); // CraftBukkit - see below if + boolean cancelled = this.player.isSpectator(); // CraftBukkit - see below if
+ if (false/*this.player.isSpectator()*/) { // CraftBukkit + if (false/*this.player.isSpectator()*/) { // CraftBukkit
NonNullList nonnulllist = NonNullList.a(); NonNullList<ItemStack> nonnulllist = NonNullList.a();
for (int i = 0; i < this.player.activeContainer.slots.size(); ++i) { for (int i = 0; i < this.player.activeContainer.slots.size(); ++i) {
@@ -1069,8 +1854,274 @@ @@ -1068,8 +1853,274 @@
this.player.a(this.player.activeContainer, nonnulllist); this.player.a(this.player.activeContainer, nonnulllist);
} else { } else {
@ -1495,7 +1495,7 @@
if (ItemStack.matches(packetplayinwindowclick.f(), itemstack)) { if (ItemStack.matches(packetplayinwindowclick.f(), itemstack)) {
this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.b(), packetplayinwindowclick.e(), true)); this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.b(), packetplayinwindowclick.e(), true));
this.player.f = true; this.player.f = true;
@@ -1113,6 +2164,7 @@ @@ -1112,6 +2163,7 @@
public void a(PacketPlayInEnchantItem packetplayinenchantitem) { public void a(PacketPlayInEnchantItem packetplayinenchantitem) {
PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.getWorldServer());
@ -1503,7 +1503,7 @@
this.player.resetIdleTimer(); this.player.resetIdleTimer();
if (this.player.activeContainer.windowId == packetplayinenchantitem.b() && this.player.activeContainer.c(this.player) && !this.player.isSpectator()) { if (this.player.activeContainer.windowId == packetplayinenchantitem.b() && this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
this.player.activeContainer.a(this.player, packetplayinenchantitem.c()); this.player.activeContainer.a(this.player, packetplayinenchantitem.c());
@@ -1144,6 +2196,43 @@ @@ -1143,6 +2195,43 @@
boolean flag1 = packetplayinsetcreativeslot.b() >= 1 && packetplayinsetcreativeslot.b() <= 45; boolean flag1 = packetplayinsetcreativeslot.b() >= 1 && packetplayinsetcreativeslot.b() <= 45;
boolean flag2 = itemstack.isEmpty() || itemstack.getDamage() >= 0 && itemstack.getCount() <= 64 && !itemstack.isEmpty(); boolean flag2 = itemstack.isEmpty() || itemstack.getDamage() >= 0 && itemstack.getCount() <= 64 && !itemstack.isEmpty();
@ -1547,7 +1547,7 @@
if (flag1 && flag2) { if (flag1 && flag2) {
if (itemstack.isEmpty()) { if (itemstack.isEmpty()) {
@@ -1167,6 +2256,7 @@ @@ -1166,6 +2255,7 @@
public void a(PacketPlayInTransaction packetplayintransaction) { public void a(PacketPlayInTransaction packetplayintransaction) {
PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.getWorldServer());
@ -1555,7 +1555,7 @@
Short oshort = (Short) this.k.get(this.player.activeContainer.windowId); Short oshort = (Short) this.k.get(this.player.activeContainer.windowId);
if (oshort != null && packetplayintransaction.c() == oshort && this.player.activeContainer.windowId == packetplayintransaction.b() && !this.player.activeContainer.c(this.player) && !this.player.isSpectator()) { if (oshort != null && packetplayintransaction.c() == oshort && this.player.activeContainer.windowId == packetplayintransaction.b() && !this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
@@ -1177,6 +2267,7 @@ @@ -1176,6 +2266,7 @@
public void a(PacketPlayInUpdateSign packetplayinupdatesign) { public void a(PacketPlayInUpdateSign packetplayinupdatesign) {
PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.getWorldServer());
@ -1563,7 +1563,7 @@
this.player.resetIdleTimer(); this.player.resetIdleTimer();
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
BlockPosition blockposition = packetplayinupdatesign.b(); BlockPosition blockposition = packetplayinupdatesign.b();
@@ -1193,14 +2284,30 @@ @@ -1192,14 +2283,30 @@
if (!tileentitysign.d() || tileentitysign.e() != this.player) { if (!tileentitysign.d() || tileentitysign.e() != this.player) {
this.minecraftServer.warning("Player " + this.player.getDisplayName().getString() + " just tried to change non-editable sign"); this.minecraftServer.warning("Player " + this.player.getDisplayName().getString() + " just tried to change non-editable sign");
@ -1595,7 +1595,7 @@
tileentitysign.update(); tileentitysign.update();
worldserver.notify(blockposition, iblockdata, iblockdata, 3); worldserver.notify(blockposition, iblockdata, iblockdata, 3);
@@ -1209,6 +2316,7 @@ @@ -1208,6 +2315,7 @@
} }
public void a(PacketPlayInKeepAlive packetplayinkeepalive) { public void a(PacketPlayInKeepAlive packetplayinkeepalive) {
@ -1603,7 +1603,7 @@
if (this.awaitingKeepAlive && packetplayinkeepalive.b() == this.h) { if (this.awaitingKeepAlive && packetplayinkeepalive.b() == this.h) {
int i = (int) (SystemUtils.getMonotonicMillis() - this.lastKeepAlive); int i = (int) (SystemUtils.getMonotonicMillis() - this.lastKeepAlive);
@@ -1222,7 +2330,17 @@ @@ -1221,7 +2329,17 @@
public void a(PacketPlayInAbilities packetplayinabilities) { public void a(PacketPlayInAbilities packetplayinabilities) {
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.getWorldServer()); PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.getWorldServer());
@ -1622,7 +1622,7 @@
} }
public void a(PacketPlayInSettings packetplayinsettings) { public void a(PacketPlayInSettings packetplayinsettings) {
@@ -1230,5 +2348,47 @@ @@ -1229,5 +2347,47 @@
this.player.a(packetplayinsettings); this.player.a(packetplayinsettings);
} }

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/PlayerList.java --- a/net/minecraft/server/PlayerList.java
+++ b/net/minecraft/server/PlayerList.java +++ b/net/minecraft/server/PlayerList.java
@@ -19,6 +19,29 @@ @@ -18,6 +18,29 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -30,7 +30,7 @@
public abstract class PlayerList { public abstract class PlayerList {
public static final File a = new File("banned-players.json"); public static final File a = new File("banned-players.json");
@@ -28,14 +51,16 @@ @@ -27,14 +50,16 @@
private static final Logger f = LogManager.getLogger(); private static final Logger f = LogManager.getLogger();
private static final SimpleDateFormat g = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z"); private static final SimpleDateFormat g = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
private final MinecraftServer server; private final MinecraftServer server;
@ -50,7 +50,7 @@
public IPlayerFileData playerFileData; public IPlayerFileData playerFileData;
private boolean hasWhitelist; private boolean hasWhitelist;
protected int maxPlayers; protected int maxPlayers;
@@ -44,13 +69,23 @@ @@ -43,13 +68,23 @@
private boolean u; private boolean u;
private int v; private int v;
@ -76,7 +76,7 @@
this.server = minecraftserver; this.server = minecraftserver;
this.getProfileBans().a(true); this.getProfileBans().a(true);
this.getIPBans().a(true); this.getIPBans().a(true);
@@ -65,6 +100,12 @@ @@ -64,6 +99,12 @@
usercache.a(gameprofile); usercache.a(gameprofile);
NBTTagCompound nbttagcompound = this.a(entityplayer); NBTTagCompound nbttagcompound = this.a(entityplayer);
@ -89,7 +89,7 @@
entityplayer.spawnIn(this.server.getWorldServer(entityplayer.dimension)); entityplayer.spawnIn(this.server.getWorldServer(entityplayer.dimension));
entityplayer.playerInteractManager.a((WorldServer) entityplayer.world); entityplayer.playerInteractManager.a((WorldServer) entityplayer.world);
@@ -74,7 +115,8 @@ @@ -73,7 +114,8 @@
s1 = networkmanager.getSocketAddress().toString(); s1 = networkmanager.getSocketAddress().toString();
} }
@ -99,7 +99,7 @@
WorldServer worldserver = this.server.getWorldServer(entityplayer.dimension); WorldServer worldserver = this.server.getWorldServer(entityplayer.dimension);
WorldData worlddata = worldserver.getWorldData(); WorldData worlddata = worldserver.getWorldData();
@@ -82,6 +124,7 @@ @@ -81,6 +123,7 @@
PlayerConnection playerconnection = new PlayerConnection(this.server, networkmanager, entityplayer); PlayerConnection playerconnection = new PlayerConnection(this.server, networkmanager, entityplayer);
playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), worlddata.isHardcore(), worldserver.worldProvider.getDimensionManager(), worldserver.getDifficulty(), this.getMaxPlayers(), worlddata.getType(), worldserver.getGameRules().getBoolean("reducedDebugInfo"))); playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), worlddata.isHardcore(), worldserver.worldProvider.getDimensionManager(), worldserver.getDifficulty(), this.getMaxPlayers(), worlddata.getType(), worldserver.getGameRules().getBoolean("reducedDebugInfo")));
@ -107,7 +107,7 @@
playerconnection.sendPacket(new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.b, (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName()))); playerconnection.sendPacket(new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.b, (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName())));
playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked())); playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
playerconnection.sendPacket(new PacketPlayOutAbilities(entityplayer.abilities)); playerconnection.sendPacket(new PacketPlayOutAbilities(entityplayer.abilities));
@@ -101,8 +144,10 @@ @@ -100,8 +143,10 @@
chatmessage = new ChatMessage("multiplayer.player.joined.renamed", new Object[] { entityplayer.getScoreboardDisplayName(), s}); chatmessage = new ChatMessage("multiplayer.player.joined.renamed", new Object[] { entityplayer.getScoreboardDisplayName(), s});
} }
@ -120,7 +120,7 @@
playerconnection.a(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch); playerconnection.a(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch);
this.b(entityplayer, worldserver); this.b(entityplayer, worldserver);
if (!this.server.getResourcePack().isEmpty()) { if (!this.server.getResourcePack().isEmpty()) {
@@ -154,6 +199,8 @@ @@ -153,6 +198,8 @@
} }
entityplayer.syncInventory(); entityplayer.syncInventory();
@ -129,7 +129,7 @@
} }
public void sendScoreboard(ScoreboardServer scoreboardserver, EntityPlayer entityplayer) { public void sendScoreboard(ScoreboardServer scoreboardserver, EntityPlayer entityplayer) {
@@ -186,26 +233,27 @@ @@ -185,26 +232,27 @@
} }
public void setPlayerFileData(WorldServer worldserver) { public void setPlayerFileData(WorldServer worldserver) {
@ -162,7 +162,7 @@
} }
public void b(WorldBorder worldborder, double d0) {} public void b(WorldBorder worldborder, double d0) {}
@@ -253,14 +301,15 @@ @@ -252,14 +300,15 @@
} }
protected void savePlayerFile(EntityPlayer entityplayer) { protected void savePlayerFile(EntityPlayer entityplayer) {
@ -180,7 +180,7 @@
if (advancementdataplayer != null) { if (advancementdataplayer != null) {
advancementdataplayer.c(); advancementdataplayer.c();
@@ -268,29 +317,80 @@ @@ -267,29 +316,80 @@
} }
@ -268,7 +268,7 @@
this.savePlayerFile(entityplayer); this.savePlayerFile(entityplayer);
if (entityplayer.isPassenger()) { if (entityplayer.isPassenger()) {
Entity entity = entityplayer.getRootVehicle(); Entity entity = entityplayer.getRootVehicle();
@@ -321,18 +421,68 @@ @@ -320,18 +420,68 @@
if (entityplayer1 == entityplayer) { if (entityplayer1 == entityplayer) {
this.j.remove(uuid); this.j.remove(uuid);
@ -311,18 +311,18 @@
- if (this.k.isBanned(gameprofile)) { - if (this.k.isBanned(gameprofile)) {
+ // Moved from processLogin + // Moved from processLogin
+ UUID uuid = EntityHuman.a(gameprofile); + UUID uuid = EntityHuman.a(gameprofile);
+ ArrayList arraylist = Lists.newArrayList(); + List<EntityPlayer> list = Lists.newArrayList();
+ +
+ EntityPlayer entityplayer; + EntityPlayer entityplayer;
+ +
+ for (int i = 0; i < this.players.size(); ++i) { + for (int i = 0; i < this.players.size(); ++i) {
+ entityplayer = (EntityPlayer) this.players.get(i); + entityplayer = (EntityPlayer) this.players.get(i);
+ if (entityplayer.getUniqueID().equals(uuid)) { + if (entityplayer.getUniqueID().equals(uuid)) {
+ arraylist.add(entityplayer); + list.add(entityplayer);
+ } + }
+ } + }
+ +
+ Iterator iterator = arraylist.iterator(); + Iterator iterator = list.iterator();
+ +
+ while (iterator.hasNext()) { + while (iterator.hasNext()) {
+ entityplayer = (EntityPlayer) iterator.next(); + entityplayer = (EntityPlayer) iterator.next();
@ -343,7 +343,7 @@
GameProfileBanEntry gameprofilebanentry = (GameProfileBanEntry) this.k.get(gameprofile); GameProfileBanEntry gameprofilebanentry = (GameProfileBanEntry) this.k.get(gameprofile);
chatmessage = new ChatMessage("multiplayer.disconnect.banned.reason", new Object[] { gameprofilebanentry.getReason()}); chatmessage = new ChatMessage("multiplayer.disconnect.banned.reason", new Object[] { gameprofilebanentry.getReason()});
@@ -340,10 +490,12 @@ @@ -339,10 +489,12 @@
chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned.expiration", new Object[] { PlayerList.g.format(gameprofilebanentry.getExpires())})); chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned.expiration", new Object[] { PlayerList.g.format(gameprofilebanentry.getExpires())}));
} }
@ -359,7 +359,7 @@
IpBanEntry ipbanentry = this.l.get(socketaddress); IpBanEntry ipbanentry = this.l.get(socketaddress);
chatmessage = new ChatMessage("multiplayer.disconnect.banned_ip.reason", new Object[] { ipbanentry.getReason()}); chatmessage = new ChatMessage("multiplayer.disconnect.banned_ip.reason", new Object[] { ipbanentry.getReason()});
@@ -351,13 +503,25 @@ @@ -350,13 +502,25 @@
chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned_ip.expiration", new Object[] { PlayerList.g.format(ipbanentry.getExpires())})); chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned_ip.expiration", new Object[] { PlayerList.g.format(ipbanentry.getExpires())}));
} }
@ -386,9 +386,9 @@
+ public EntityPlayer processLogin(GameProfile gameprofile, EntityPlayer player) { // CraftBukkit - added EntityPlayer + public EntityPlayer processLogin(GameProfile gameprofile, EntityPlayer player) { // CraftBukkit - added EntityPlayer
+ /* CraftBukkit startMoved up + /* CraftBukkit startMoved up
UUID uuid = EntityHuman.a(gameprofile); UUID uuid = EntityHuman.a(gameprofile);
ArrayList arraylist = Lists.newArrayList(); List<EntityPlayer> list = Lists.newArrayList();
@@ -392,17 +556,27 @@ @@ -391,17 +555,27 @@
} }
return new EntityPlayer(this.server, this.server.getWorldServer(DimensionManager.OVERWORLD), gameprofile, (PlayerInteractManager) object); return new EntityPlayer(this.server, this.server.getWorldServer(DimensionManager.OVERWORLD), gameprofile, (PlayerInteractManager) object);
@ -417,7 +417,7 @@
entityplayer.dimension = dimensionmanager; entityplayer.dimension = dimensionmanager;
Object object; Object object;
@@ -413,6 +587,11 @@ @@ -412,6 +586,11 @@
} }
EntityPlayer entityplayer1 = new EntityPlayer(this.server, this.server.getWorldServer(entityplayer.dimension), entityplayer.getProfile(), (PlayerInteractManager) object); EntityPlayer entityplayer1 = new EntityPlayer(this.server, this.server.getWorldServer(entityplayer.dimension), entityplayer.getProfile(), (PlayerInteractManager) object);
@ -429,7 +429,7 @@
entityplayer1.playerConnection = entityplayer.playerConnection; entityplayer1.playerConnection = entityplayer.playerConnection;
entityplayer1.copyFrom(entityplayer, flag); entityplayer1.copyFrom(entityplayer, flag);
@@ -426,43 +605,160 @@ @@ -425,43 +604,160 @@
entityplayer1.addScoreboardTag(s); entityplayer1.addScoreboardTag(s);
} }
@ -607,7 +607,7 @@
public void f(EntityPlayer entityplayer) { public void f(EntityPlayer entityplayer) {
GameProfile gameprofile = entityplayer.getProfile(); GameProfile gameprofile = entityplayer.getProfile();
int i = this.server.a(gameprofile); int i = this.server.a(gameprofile);
@@ -499,42 +795,69 @@ @@ -498,42 +794,69 @@
} }
public void changeWorld(Entity entity, DimensionManager dimensionmanager, WorldServer worldserver, WorldServer worldserver1) { public void changeWorld(Entity entity, DimensionManager dimensionmanager, WorldServer worldserver, WorldServer worldserver1) {
@ -680,7 +680,7 @@
} }
worldserver.methodProfiler.exit(); worldserver.methodProfiler.exit();
@@ -542,22 +865,119 @@ @@ -541,22 +864,119 @@
worldserver.methodProfiler.enter("placing"); worldserver.methodProfiler.enter("placing");
d0 = (double) MathHelper.clamp((int) d0, -29999872, 29999872); d0 = (double) MathHelper.clamp((int) d0, -29999872, 29999872);
d1 = (double) MathHelper.clamp((int) d1, -29999872, 29999872); d1 = (double) MathHelper.clamp((int) d1, -29999872, 29999872);
@ -801,7 +801,7 @@
this.v = 0; this.v = 0;
} }
@@ -570,6 +990,25 @@ @@ -569,6 +989,25 @@
} }
@ -827,7 +827,7 @@
public void a(Packet<?> packet, DimensionManager dimensionmanager) { public void a(Packet<?> packet, DimensionManager dimensionmanager) {
for (int i = 0; i < this.players.size(); ++i) { for (int i = 0; i < this.players.size(); ++i) {
EntityPlayer entityplayer = (EntityPlayer) this.players.get(i); EntityPlayer entityplayer = (EntityPlayer) this.players.get(i);
@@ -670,6 +1109,7 @@ @@ -669,6 +1108,7 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, b0)); entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, b0));
} }
@ -835,7 +835,7 @@
this.server.getCommandDispatcher().a(entityplayer); this.server.getCommandDispatcher().a(entityplayer);
} }
@@ -702,6 +1142,12 @@ @@ -701,6 +1141,12 @@
for (int i = 0; i < this.players.size(); ++i) { for (int i = 0; i < this.players.size(); ++i) {
EntityPlayer entityplayer = (EntityPlayer) this.players.get(i); EntityPlayer entityplayer = (EntityPlayer) this.players.get(i);
@ -848,7 +848,7 @@
if (entityplayer != entityhuman && entityplayer.dimension == dimensionmanager) { if (entityplayer != entityhuman && entityplayer.dimension == dimensionmanager) {
double d4 = d0 - entityplayer.locX; double d4 = d0 - entityplayer.locX;
double d5 = d1 - entityplayer.locY; double d5 = d1 - entityplayer.locY;
@@ -741,7 +1187,7 @@ @@ -740,7 +1186,7 @@
public void reloadWhitelist() {} public void reloadWhitelist() {}
public void b(EntityPlayer entityplayer, WorldServer worldserver) { public void b(EntityPlayer entityplayer, WorldServer worldserver) {
@ -857,7 +857,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")));
@@ -749,16 +1195,21 @@ @@ -748,16 +1194,21 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutSpawnPosition(blockposition)); entityplayer.playerConnection.sendPacket(new PacketPlayOutSpawnPosition(blockposition));
if (worldserver.isRaining()) { if (worldserver.isRaining()) {
@ -883,7 +883,7 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex)); entityplayer.playerConnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex));
} }
@@ -820,26 +1271,39 @@ @@ -819,26 +1270,39 @@
} }
public void u() { public void u() {
@ -928,7 +928,7 @@
if (serverstatisticmanager == null) { if (serverstatisticmanager == null) {
File file = new File(this.server.getWorldServer(DimensionManager.OVERWORLD).getDataManager().getDirectory(), "stats"); File file = new File(this.server.getWorldServer(DimensionManager.OVERWORLD).getDataManager().getDirectory(), "stats");
@@ -854,7 +1318,7 @@ @@ -853,7 +1317,7 @@
} }
serverstatisticmanager = new ServerStatisticManager(this.server, file1); serverstatisticmanager = new ServerStatisticManager(this.server, file1);
@ -937,7 +937,7 @@
} }
return serverstatisticmanager; return serverstatisticmanager;
@@ -862,14 +1326,14 @@ @@ -861,14 +1325,14 @@
public AdvancementDataPlayer h(EntityPlayer entityplayer) { public AdvancementDataPlayer h(EntityPlayer entityplayer) {
UUID uuid = entityplayer.getUniqueID(); UUID uuid = entityplayer.getUniqueID();
@ -954,7 +954,7 @@
} }
advancementdataplayer.a(entityplayer); advancementdataplayer.a(entityplayer);
@@ -905,13 +1369,20 @@ @@ -904,13 +1368,20 @@
} }
public void reload() { public void reload() {

View File

@ -2,7 +2,7 @@
+++ b/net/minecraft/server/RecipeArmorDye.java +++ b/net/minecraft/server/RecipeArmorDye.java
@@ -3,11 +3,13 @@ @@ -3,11 +3,13 @@
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import java.util.ArrayList; import java.util.List;
-public class RecipeArmorDye extends IRecipeComplex { -public class RecipeArmorDye extends IRecipeComplex {
+public class RecipeArmorDye extends ShapelessRecipes implements IRecipe { // CraftBukkit - added extends +public class RecipeArmorDye extends ShapelessRecipes implements IRecipe { // CraftBukkit - added extends

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/RecipeBookServer.java --- a/net/minecraft/server/RecipeBookServer.java
+++ b/net/minecraft/server/RecipeBookServer.java +++ b/net/minecraft/server/RecipeBookServer.java
@@ -8,6 +8,7 @@ @@ -7,6 +7,7 @@
import java.util.List; import java.util.List;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -8,7 +8,7 @@
public class RecipeBookServer extends RecipeBook { public class RecipeBookServer extends RecipeBook {
@@ -27,7 +28,7 @@ @@ -26,7 +27,7 @@
IRecipe irecipe = (IRecipe) iterator.next(); IRecipe irecipe = (IRecipe) iterator.next();
MinecraftKey minecraftkey = irecipe.getKey(); MinecraftKey minecraftkey = irecipe.getKey();
@ -16,8 +16,8 @@
+ if (!this.a.contains(minecraftkey) && !irecipe.c() && CraftEventFactory.handlePlayerRecipeListUpdateEvent(entityplayer, minecraftkey)) { // CraftBukkit + if (!this.a.contains(minecraftkey) && !irecipe.c() && CraftEventFactory.handlePlayerRecipeListUpdateEvent(entityplayer, minecraftkey)) { // CraftBukkit
this.a(minecraftkey); this.a(minecraftkey);
this.c(minecraftkey); this.c(minecraftkey);
arraylist.add(minecraftkey); list.add(minecraftkey);
@@ -61,6 +62,7 @@ @@ -60,6 +61,7 @@
} }
private void a(PacketPlayOutRecipes.Action packetplayoutrecipes_action, EntityPlayer entityplayer, List<MinecraftKey> list) { private void a(PacketPlayOutRecipes.Action packetplayoutrecipes_action, EntityPlayer entityplayer, List<MinecraftKey> list) {

View File

@ -1,7 +1,7 @@
--- a/net/minecraft/server/RecipeFireworksFade.java --- a/net/minecraft/server/RecipeFireworksFade.java
+++ b/net/minecraft/server/RecipeFireworksFade.java +++ b/net/minecraft/server/RecipeFireworksFade.java
@@ -4,13 +4,15 @@ @@ -3,13 +3,15 @@
import java.util.ArrayList; import com.google.common.collect.Lists;
import java.util.List; import java.util.List;
-public class RecipeFireworksFade extends IRecipeComplex { -public class RecipeFireworksFade extends IRecipeComplex {

View File

@ -1,8 +1,8 @@
--- a/net/minecraft/server/RecipeFireworksStar.java --- a/net/minecraft/server/RecipeFireworksStar.java
+++ b/net/minecraft/server/RecipeFireworksStar.java +++ b/net/minecraft/server/RecipeFireworksStar.java
@@ -8,12 +8,12 @@ @@ -6,12 +6,12 @@
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.function.Consumer;
-public class RecipeFireworksStar extends IRecipeComplex { -public class RecipeFireworksStar extends IRecipeComplex {
+public class RecipeFireworksStar extends ShapelessRecipes implements IRecipe { // CraftBukkit - added extends +public class RecipeFireworksStar extends ShapelessRecipes implements IRecipe { // CraftBukkit - added extends
@ -15,7 +15,7 @@
hashmap.put(Items.FIRE_CHARGE, ItemFireworks.EffectType.LARGE_BALL); hashmap.put(Items.FIRE_CHARGE, ItemFireworks.EffectType.LARGE_BALL);
hashmap.put(Items.FEATHER, ItemFireworks.EffectType.BURST); hashmap.put(Items.FEATHER, ItemFireworks.EffectType.BURST);
hashmap.put(Items.GOLD_NUGGET, ItemFireworks.EffectType.STAR); hashmap.put(Items.GOLD_NUGGET, ItemFireworks.EffectType.STAR);
@@ -26,9 +26,11 @@ @@ -24,9 +24,11 @@
}); });
private static final RecipeItemStack e = RecipeItemStack.a(Items.GUNPOWDER); private static final RecipeItemStack e = RecipeItemStack.a(Items.GUNPOWDER);

View File

@ -3,7 +3,7 @@
@@ -2,12 +2,15 @@ @@ -2,12 +2,15 @@
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import java.util.ArrayList; import java.util.List;
+import java.util.stream.Stream; +import java.util.stream.Stream;
-public class RecipeRepair extends IRecipeComplex { -public class RecipeRepair extends IRecipeComplex {

Some files were not shown because too many files have changed in this diff Show More