Archiviert
13
0

Update to Minecraft 1.12.2

Dieser Commit ist enthalten in:
md_5 2017-09-18 20:00:00 +10:00
Ursprung 8f472147b7
Commit 9a1f5ee80a
23 geänderte Dateien mit 120 neuen und 148 gelöschten Zeilen

Datei anzeigen

@ -12,7 +12,7 @@
@@ -37,6 +39,10 @@ @@ -37,6 +39,10 @@
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) { public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) {
if (!entity.isPassenger() && !entity.isVehicle() && entity.bf() && !world.isClientSide && entity.getBoundingBox().c(iblockdata.e(world, blockposition).a(blockposition))) { if (!world.isClientSide && !entity.isPassenger() && !entity.isVehicle() && entity.bf() && entity.getBoundingBox().c(iblockdata.e(world, blockposition).a(blockposition))) {
+ // 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);

Datei anzeigen

@ -12,7 +12,7 @@
public class BlockSoil extends Block { public class BlockSoil extends Block {
public static final BlockStateInteger MOISTURE = BlockStateInteger.of("moisture", 0, 7); public static final BlockStateInteger MOISTURE = BlockStateInteger.of("moisture", 0, 7);
@@ -35,6 +40,12 @@ @@ -36,6 +41,12 @@
if (i > 0) { if (i > 0) {
world.setTypeAndData(blockposition, iblockdata.set(BlockSoil.MOISTURE, Integer.valueOf(i - 1)), 2); world.setTypeAndData(blockposition, iblockdata.set(BlockSoil.MOISTURE, Integer.valueOf(i - 1)), 2);
} else if (!this.c(world, blockposition)) { } else if (!this.c(world, blockposition)) {
@ -22,10 +22,10 @@
+ return; + return;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
this.b(world, blockposition); b(world, blockposition);
} }
} else if (i < 7) { } else if (i < 7) {
@@ -44,11 +55,29 @@ @@ -45,11 +56,29 @@
} }
public void fallOn(World world, BlockPosition blockposition, Entity entity, float f) { public void fallOn(World world, BlockPosition blockposition, Entity entity, float f) {
@ -48,11 +48,11 @@
+ return; + return;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
this.b(world, blockposition); b(world, blockposition);
} }
- super.fallOn(world, blockposition, entity, f); - super.fallOn(world, blockposition, entity, f);
+ // super.fallOn(world, blockposition, entity, f); // CraftBukkit - moved up + // super.fallOn(world, blockposition, entity, f); // CraftBukkit - moved up
} }
private void b(World world, BlockPosition blockposition) { protected static void b(World world, BlockPosition blockposition) {

Datei anzeigen

@ -17,7 +17,7 @@
+ +
public abstract class Container { public abstract class Container {
public NonNullList<ItemStack> b = NonNullList.a(); public NonNullList<ItemStack> items = NonNullList.a();
@@ -18,6 +29,18 @@ @@ -18,6 +29,18 @@
protected List<ICrafting> listeners = Lists.newArrayList(); protected List<ICrafting> listeners = Lists.newArrayList();
private final Set<EntityHuman> i = Sets.newHashSet(); private final Set<EntityHuman> i = Sets.newHashSet();

Datei anzeigen

@ -74,7 +74,7 @@
@@ -301,6 +311,7 @@ @@ -301,6 +311,7 @@
} }
public boolean a(EntityHuman entityhuman) { public boolean canUse(EntityHuman entityhuman) {
+ if (!this.checkReachable) return true; // CraftBukkit + if (!this.checkReachable) return true; // CraftBukkit
return this.i.getType(this.j).getBlock() != Blocks.ANVIL ? false : entityhuman.d((double) this.j.getX() + 0.5D, (double) this.j.getY() + 0.5D, (double) this.j.getZ() + 0.5D) <= 64.0D; return this.i.getType(this.j).getBlock() != Blocks.ANVIL ? false : entityhuman.d((double) this.j.getX() + 0.5D, (double) this.j.getY() + 0.5D, (double) this.j.getZ() + 0.5D) <= 64.0D;
} }

Datei anzeigen

@ -22,7 +22,7 @@
@@ -48,6 +55,7 @@ @@ -48,6 +55,7 @@
} }
public boolean a(EntityHuman entityhuman) { public boolean canUse(EntityHuman entityhuman) {
+ if (!this.checkReachable) return true; // CraftBukkit + if (!this.checkReachable) return true; // CraftBukkit
return this.beacon.a(entityhuman); return this.beacon.a(entityhuman);
} }

Datei anzeigen

@ -28,7 +28,7 @@
@@ -54,6 +65,7 @@ @@ -54,6 +65,7 @@
} }
public boolean a(EntityHuman entityhuman) { public boolean canUse(EntityHuman entityhuman) {
+ if (!this.checkReachable) return true; // CraftBukkit + if (!this.checkReachable) return true; // CraftBukkit
return this.brewingStand.a(entityhuman); return this.brewingStand.a(entityhuman);
} }

Datei anzeigen

@ -53,7 +53,7 @@
@@ -33,6 +66,7 @@ @@ -33,6 +66,7 @@
} }
public boolean a(EntityHuman entityhuman) { public boolean canUse(EntityHuman entityhuman) {
+ if (!this.checkReachable) return true; // CraftBukkit + if (!this.checkReachable) return true; // CraftBukkit
return this.container.a(entityhuman); return this.container.a(entityhuman);
} }

Datei anzeigen

@ -28,7 +28,7 @@
@@ -29,6 +42,7 @@ @@ -29,6 +42,7 @@
} }
public boolean a(EntityHuman entityhuman) { public boolean canUse(EntityHuman entityhuman) {
+ if (!this.checkReachable) return true; // CraftBukkit + if (!this.checkReachable) return true; // CraftBukkit
return this.items.a(entityhuman); return this.items.a(entityhuman);
} }

Datei anzeigen

@ -181,7 +181,7 @@
} }
} }
public boolean a(EntityHuman entityhuman) { public boolean canUse(EntityHuman entityhuman) {
+ if (!this.checkReachable) return true; // CraftBukkit + if (!this.checkReachable) return true; // CraftBukkit
return this.world.getType(this.position).getBlock() != Blocks.ENCHANTING_TABLE ? false : entityhuman.d((double) this.position.getX() + 0.5D, (double) this.position.getY() + 0.5D, (double) this.position.getZ() + 0.5D) <= 64.0D; return this.world.getType(this.position).getBlock() != Blocks.ENCHANTING_TABLE ? false : entityhuman.d((double) this.position.getX() + 0.5D, (double) this.position.getY() + 0.5D, (double) this.position.getZ() + 0.5D) <= 64.0D;
} }

Datei anzeigen

@ -43,7 +43,7 @@
@@ -63,6 +85,7 @@ @@ -63,6 +85,7 @@
} }
public boolean a(EntityHuman entityhuman) { public boolean canUse(EntityHuman entityhuman) {
+ if (!this.checkReachable) return true; // CraftBukkit + if (!this.checkReachable) return true; // CraftBukkit
return this.furnace.a(entityhuman); return this.furnace.a(entityhuman);
} }

Datei anzeigen

@ -37,7 +37,7 @@
@@ -28,6 +50,7 @@ @@ -28,6 +50,7 @@
} }
public boolean a(EntityHuman entityhuman) { public boolean canUse(EntityHuman entityhuman) {
+ if (!this.checkReachable) return true; // CraftBukkit + if (!this.checkReachable) return true; // CraftBukkit
return this.hopper.a(entityhuman); return this.hopper.a(entityhuman);
} }

Datei anzeigen

@ -35,7 +35,7 @@
@@ -47,6 +62,7 @@ @@ -47,6 +62,7 @@
} }
public boolean a(EntityHuman entityhuman) { public boolean canUse(EntityHuman entityhuman) {
+ if (!this.checkReachable) return true; // CraftBukkit + if (!this.checkReachable) return true; // CraftBukkit
return this.g.getType(this.h).getBlock() != Blocks.CRAFTING_TABLE ? false : entityhuman.d((double) this.h.getX() + 0.5D, (double) this.h.getY() + 0.5D, (double) this.h.getZ() + 0.5D) <= 64.0D; return this.g.getType(this.h).getBlock() != Blocks.CRAFTING_TABLE ? false : entityhuman.d((double) this.h.getX() + 0.5D, (double) this.h.getY() + 0.5D, (double) this.h.getZ() + 0.5D) <= 64.0D;
} }

Datei anzeigen

@ -98,7 +98,7 @@
+ +
thread.setDaemon(true); thread.setDaemon(true);
thread.start(); thread.start();
DedicatedServer.LOGGER.info("Starting minecraft server version 1.12.1"); DedicatedServer.LOGGER.info("Starting minecraft server version 1.12.2");
@@ -79,7 +126,7 @@ @@ -79,7 +126,7 @@
} }

Datei anzeigen

@ -1,19 +1,19 @@
--- a/net/minecraft/server/EntityEnderPearl.java --- a/net/minecraft/server/EntityEnderPearl.java
+++ b/net/minecraft/server/EntityEnderPearl.java +++ b/net/minecraft/server/EntityEnderPearl.java
@@ -1,5 +1,12 @@ @@ -1,6 +1,12 @@
package net.minecraft.server; package net.minecraft.server;
import javax.annotation.Nullable;
+// CraftBukkit start +// CraftBukkit start
+import org.bukkit.Bukkit; +import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.CreatureSpawnEvent; +import org.bukkit.event.entity.CreatureSpawnEvent;
+import org.bukkit.event.player.PlayerTeleportEvent; +import org.bukkit.event.player.PlayerTeleportEvent;
+// CraftBukkit end +// CraftBukkit end
+
public class EntityEnderPearl extends EntityProjectile { public class EntityEnderPearl extends EntityProjectile {
private EntityLiving d; @@ -61,21 +67,35 @@
@@ -59,21 +66,35 @@
EntityPlayer entityplayer = (EntityPlayer) entityliving; EntityPlayer entityplayer = (EntityPlayer) entityliving;
if (entityplayer.playerConnection.a().isConnected() && entityplayer.world == this.world && !entityplayer.isSleeping()) { if (entityplayer.playerConnection.a().isConnected() && entityplayer.world == this.world && !entityplayer.isSleeping()) {
@ -23,6 +23,10 @@
- entityendermite.a(true); - entityendermite.a(true);
- entityendermite.setPositionRotation(entityliving.locX, entityliving.locY, entityliving.locZ, entityliving.yaw, entityliving.pitch); - entityendermite.setPositionRotation(entityliving.locX, entityliving.locY, entityliving.locZ, entityliving.yaw, entityliving.pitch);
- this.world.addEntity(entityendermite); - this.world.addEntity(entityendermite);
- }
-
- if (entityliving.isPassenger()) {
- entityliving.stopRiding();
+ // CraftBukkit start - Fire PlayerTeleportEvent + // CraftBukkit start - Fire PlayerTeleportEvent
+ org.bukkit.craftbukkit.entity.CraftPlayer player = entityplayer.getBukkitEntity(); + org.bukkit.craftbukkit.entity.CraftPlayer player = entityplayer.getBukkitEntity();
+ org.bukkit.Location location = getBukkitEntity().getLocation(); + org.bukkit.Location location = getBukkitEntity().getLocation();
@ -52,10 +56,6 @@
+ CraftEventFactory.entityDamage = null; + CraftEventFactory.entityDamage = null;
} }
- -
- if (entityliving.isPassenger()) {
- entityliving.stopRiding();
- }
-
- entityliving.enderTeleportTo(this.locX, this.locY, this.locZ); - entityliving.enderTeleportTo(this.locX, this.locY, this.locZ);
- entityliving.fallDistance = 0.0F; - entityliving.fallDistance = 0.0F;
- entityliving.damageEntity(DamageSource.FALL, 5.0F); - entityliving.damageEntity(DamageSource.FALL, 5.0F);

Datei anzeigen

@ -10,11 +10,11 @@
protected void i() {} protected void i() {}
@@ -127,7 +128,7 @@ @@ -127,7 +128,7 @@
if (entity1.isInteractable()) { if (entity1.isInteractable()) {
if (entity1 == this.c) { if (entity1 == this.d) {
flag = true; flag = true;
- } else if (this.shooter != null && this.ticksLived < 2 && this.c == null) { - } else if (this.shooter != null && this.ticksLived < 2 && this.d == null) {
+ } else if (this.shooter != null && this.ticksLived < 2 && this.c == null && this.shooter == entity1) { // CraftBukkit - MC-88491 + } else if (this.shooter != null && this.ticksLived < 2 && this.d == null && this.shooter == entity1) { // CraftBukkit - MC-88491
this.c = entity1; this.d = entity1;
flag = true; flag = true;
} else { } else {
@@ -164,6 +165,11 @@ @@ -164,6 +165,11 @@

Datei anzeigen

@ -14,7 +14,7 @@
private static final DataWatcherObject<Byte> bx = DataWatcher.a(EntitySheep.class, DataWatcherRegistry.a); private static final DataWatcherObject<Byte> bx = DataWatcher.a(EntitySheep.class, DataWatcherRegistry.a);
@@ -12,6 +18,13 @@ @@ -12,6 +18,13 @@
public boolean a(EntityHuman entityhuman) { public boolean canUse(EntityHuman entityhuman) {
return false; return false;
} }
+ +

Datei anzeigen

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

Datei anzeigen

@ -51,8 +51,8 @@
private static final Logger LOGGER = LogManager.getLogger(); private static final Logger LOGGER = LogManager.getLogger();
@@ -25,7 +68,10 @@ @@ -25,7 +68,10 @@
private int f; private long f;
private long g; private boolean g;
private long h; private long h;
- private int chatThrottle; - private int chatThrottle;
+ // CraftBukkit start - multithreaded fields + // CraftBukkit start - multithreaded fields
@ -97,7 +97,7 @@
public void e() { public void e() {
this.syncPosition(); this.syncPosition();
@@ -110,15 +183,21 @@ @@ -116,15 +189,21 @@
} }
this.minecraftServer.methodProfiler.b(); this.minecraftServer.methodProfiler.b();
@ -119,7 +119,7 @@
this.disconnect(new ChatMessage("multiplayer.disconnect.idling", new Object[0])); this.disconnect(new ChatMessage("multiplayer.disconnect.idling", new Object[0]));
} }
@@ -137,18 +216,48 @@ @@ -143,18 +222,48 @@
return this.networkManager; return this.networkManager;
} }
@ -174,7 +174,7 @@
} }
public void a(PacketPlayInSteerVehicle packetplayinsteervehicle) { public void a(PacketPlayInSteerVehicle packetplayinsteervehicle) {
@@ -187,7 +296,34 @@ @@ -193,7 +302,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;
@ -210,7 +210,7 @@
PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getName(), this.player.getName(), Double.valueOf(d6), Double.valueOf(d7), Double.valueOf(d8)); PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getName(), this.player.getName(), Double.valueOf(d6), Double.valueOf(d7), Double.valueOf(d8));
this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity)); this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity));
return; return;
@@ -225,6 +361,62 @@ @@ -231,6 +367,62 @@
return; return;
} }
@ -273,7 +273,7 @@
this.minecraftServer.getPlayerList().d(this.player); this.minecraftServer.getPlayerList().d(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.c(entity.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D)); this.D = d11 >= -0.03125D && !this.minecraftServer.getAllowFlight() && !worldserver.c(entity.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
@@ -283,7 +475,7 @@ @@ -289,7 +481,7 @@
} else { } else {
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
@ -282,7 +282,7 @@
if (this.e == 0) { if (this.e == 0) {
this.syncPosition(); this.syncPosition();
} }
@@ -293,13 +485,21 @@ @@ -299,13 +491,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);
} }
@ -305,7 +305,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;
@@ -324,15 +524,33 @@ @@ -330,15 +530,33 @@
++this.receivedMovePackets; ++this.receivedMovePackets;
int i = this.receivedMovePackets - this.processedMovePackets; int i = this.receivedMovePackets - this.processedMovePackets;
@ -341,7 +341,7 @@
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getName(), Double.valueOf(d7), Double.valueOf(d8), Double.valueOf(d9)); PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getName(), Double.valueOf(d7), Double.valueOf(d8), Double.valueOf(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;
@@ -378,6 +596,69 @@ @@ -384,6 +602,69 @@
} }
} }
@ -411,7 +411,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.cP() && !worldserver.c(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D)); this.B &= !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.cP() && !worldserver.c(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D));
@@ -395,10 +676,76 @@ @@ -401,10 +682,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) {
@ -489,7 +489,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;
@@ -415,6 +762,14 @@ @@ -421,6 +768,14 @@
f3 = f1 + this.player.pitch; f3 = f1 + this.player.pitch;
} }
@ -504,7 +504,7 @@
if (++this.teleportAwait == Integer.MAX_VALUE) { if (++this.teleportAwait == Integer.MAX_VALUE) {
this.teleportAwait = 0; this.teleportAwait = 0;
} }
@@ -426,6 +781,7 @@ @@ -432,6 +787,7 @@
public void a(PacketPlayInBlockDig packetplayinblockdig) { public void a(PacketPlayInBlockDig packetplayinblockdig) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.x());
@ -512,7 +512,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
BlockPosition blockposition = packetplayinblockdig.a(); BlockPosition blockposition = packetplayinblockdig.a();
@@ -435,7 +791,15 @@ @@ -441,7 +797,15 @@
if (!this.player.isSpectator()) { if (!this.player.isSpectator()) {
ItemStack itemstack = this.player.b(EnumHand.OFF_HAND); ItemStack itemstack = this.player.b(EnumHand.OFF_HAND);
@ -529,7 +529,7 @@
this.player.a(EnumHand.MAIN_HAND, itemstack); this.player.a(EnumHand.MAIN_HAND, itemstack);
} }
@@ -443,6 +807,21 @@ @@ -449,6 +813,21 @@
case DROP_ITEM: case DROP_ITEM:
if (!this.player.isSpectator()) { if (!this.player.isSpectator()) {
@ -551,7 +551,7 @@
this.player.a(false); this.player.a(false);
} }
@@ -476,7 +855,15 @@ @@ -482,7 +861,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.b()); this.player.playerInteractManager.a(blockposition, packetplayinblockdig.b());
} else { } else {
@ -567,7 +567,7 @@
} }
} else { } else {
if (packetplayinblockdig.c() == PacketPlayInBlockDig.EnumPlayerDigType.STOP_DESTROY_BLOCK) { if (packetplayinblockdig.c() == PacketPlayInBlockDig.EnumPlayerDigType.STOP_DESTROY_BLOCK) {
@@ -496,10 +883,12 @@ @@ -502,10 +889,12 @@
default: default:
throw new IllegalArgumentException("Invalid player action"); throw new IllegalArgumentException("Invalid player action");
} }
@ -580,7 +580,7 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
EnumHand enumhand = packetplayinuseitem.c(); EnumHand enumhand = packetplayinuseitem.c();
ItemStack itemstack = this.player.b(enumhand); ItemStack itemstack = this.player.b(enumhand);
@@ -513,6 +902,13 @@ @@ -519,6 +908,13 @@
chatmessage.getChatModifier().setColor(EnumChatFormat.RED); chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
this.player.playerConnection.sendPacket(new PacketPlayOutChat(chatmessage, ChatMessageType.GAME_INFO)); this.player.playerConnection.sendPacket(new PacketPlayOutChat(chatmessage, 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)) {
@ -594,7 +594,7 @@
this.player.playerInteractManager.a(this.player, worldserver, itemstack, enumhand, blockposition, enumdirection, packetplayinuseitem.d(), packetplayinuseitem.e(), packetplayinuseitem.f()); this.player.playerInteractManager.a(this.player, worldserver, itemstack, enumhand, blockposition, enumdirection, packetplayinuseitem.d(), packetplayinuseitem.e(), packetplayinuseitem.f());
} }
@@ -522,13 +918,52 @@ @@ -528,13 +924,52 @@
public void a(PacketPlayInBlockPlace packetplayinblockplace) { public void a(PacketPlayInBlockPlace packetplayinblockplace) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.x());
@ -648,7 +648,7 @@
} }
} }
@@ -539,8 +974,8 @@ @@ -545,8 +980,8 @@
WorldServer[] aworldserver = this.minecraftServer.worldServer; WorldServer[] aworldserver = this.minecraftServer.worldServer;
int i = aworldserver.length; int i = aworldserver.length;
@ -659,7 +659,7 @@
if (worldserver != null) { if (worldserver != null) {
entity = packetplayinspectate.a(worldserver); entity = packetplayinspectate.a(worldserver);
@@ -553,6 +988,8 @@ @@ -559,6 +994,8 @@
if (entity != null) { if (entity != null) {
this.player.setSpectatorTarget(this.player); this.player.setSpectatorTarget(this.player);
this.player.stopRiding(); this.player.stopRiding();
@ -668,7 +668,7 @@
if (entity.world == this.player.world) { if (entity.world == this.player.world) {
this.player.enderTeleportTo(entity.locX, entity.locY, entity.locZ); this.player.enderTeleportTo(entity.locX, entity.locY, entity.locZ);
} else { } else {
@@ -578,12 +1015,20 @@ @@ -584,12 +1021,20 @@
this.minecraftServer.getPlayerList().b(this.player, worldserver2); this.minecraftServer.getPlayerList().b(this.player, worldserver2);
this.minecraftServer.getPlayerList().updateClient(this.player); this.minecraftServer.getPlayerList().updateClient(this.player);
} }
@ -690,7 +690,7 @@
public void a(PacketPlayInBoatMove packetplayinboatmove) { public void a(PacketPlayInBoatMove packetplayinboatmove) {
PlayerConnectionUtils.ensureMainThread(packetplayinboatmove, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayinboatmove, this, this.player.x());
@@ -596,14 +1041,29 @@ @@ -602,14 +1047,29 @@
} }
public void a(IChatBaseComponent ichatbasecomponent) { public void a(IChatBaseComponent ichatbasecomponent) {
@ -721,7 +721,7 @@
if (this.minecraftServer.R() && this.player.getName().equals(this.minecraftServer.Q())) { if (this.minecraftServer.R() && this.player.getName().equals(this.minecraftServer.Q())) {
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();
@@ -625,6 +1085,15 @@ @@ -631,6 +1091,15 @@
} }
} }
@ -737,7 +737,7 @@
try { try {
this.networkManager.sendPacket(packet); this.networkManager.sendPacket(packet);
} catch (Throwable throwable) { } catch (Throwable throwable) {
@@ -646,17 +1115,32 @@ @@ -652,17 +1121,32 @@
public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) { public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
PlayerConnectionUtils.ensureMainThread(packetplayinhelditemslot, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayinhelditemslot, this, this.player.x());
@ -772,7 +772,7 @@
ChatMessage chatmessage = new ChatMessage("chat.cannotSend", new Object[0]); ChatMessage chatmessage = new ChatMessage("chat.cannotSend", new Object[0]);
chatmessage.getChatModifier().setColor(EnumChatFormat.RED); chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
@@ -669,39 +1153,249 @@ @@ -675,39 +1159,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))) {
@ -1029,7 +1029,7 @@
this.player.resetIdleTimer(); this.player.resetIdleTimer();
IJumpable ijumpable; IJumpable ijumpable;
@@ -773,6 +1467,7 @@ @@ -779,6 +1473,7 @@
public void a(PacketPlayInUseEntity packetplayinuseentity) { public void a(PacketPlayInUseEntity packetplayinuseentity) {
PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.x());
@ -1037,7 +1037,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);
@@ -788,20 +1483,68 @@ @@ -794,20 +1489,68 @@
if (this.player.h(entity) < d0) { if (this.player.h(entity) < d0) {
EnumHand enumhand; EnumHand enumhand;
@ -1107,7 +1107,7 @@
} }
} }
} }
@@ -817,7 +1560,8 @@ @@ -823,7 +1566,8 @@
case PERFORM_RESPAWN: case PERFORM_RESPAWN:
if (this.player.viewingCredits) { if (this.player.viewingCredits) {
this.player.viewingCredits = false; this.player.viewingCredits = false;
@ -1117,7 +1117,7 @@
CriterionTriggers.u.a(this.player, DimensionManager.THE_END, DimensionManager.OVERWORLD); CriterionTriggers.u.a(this.player, DimensionManager.THE_END, DimensionManager.OVERWORLD);
} else { } else {
if (this.player.getHealth() > 0.0F) { if (this.player.getHealth() > 0.0F) {
@@ -840,14 +1584,20 @@ @@ -846,14 +1590,20 @@
public void a(PacketPlayInCloseWindow packetplayinclosewindow) { public void a(PacketPlayInCloseWindow packetplayinclosewindow) {
PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.x());
@ -1134,13 +1134,13 @@
this.player.resetIdleTimer(); this.player.resetIdleTimer();
- if (this.player.activeContainer.windowId == packetplayinwindowclick.a() && this.player.activeContainer.c(this.player)) { - if (this.player.activeContainer.windowId == packetplayinwindowclick.a() && this.player.activeContainer.c(this.player)) {
- if (this.player.isSpectator()) { - if (this.player.isSpectator()) {
+ if (this.player.activeContainer.windowId == packetplayinwindowclick.a() && this.player.activeContainer.c(this.player) && this.player.activeContainer.a(this.player)) { // CraftBukkit + if (this.player.activeContainer.windowId == packetplayinwindowclick.a() && 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 nonnulllist = NonNullList.a();
for (int i = 0; i < this.player.activeContainer.c.size(); ++i) { for (int i = 0; i < this.player.activeContainer.slots.size(); ++i) {
@@ -856,8 +1606,274 @@ @@ -862,8 +1612,274 @@
this.player.a(this.player.activeContainer, nonnulllist); this.player.a(this.player.activeContainer, nonnulllist);
} else { } else {
@ -1416,7 +1416,7 @@
if (ItemStack.matches(packetplayinwindowclick.e(), itemstack)) { if (ItemStack.matches(packetplayinwindowclick.e(), itemstack)) {
this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.a(), packetplayinwindowclick.d(), true)); this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.a(), packetplayinwindowclick.d(), true));
this.player.f = true; this.player.f = true;
@@ -894,6 +1910,7 @@ @@ -900,6 +1916,7 @@
public void a(PacketPlayInEnchantItem packetplayinenchantitem) { public void a(PacketPlayInEnchantItem packetplayinenchantitem) {
PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.x());
@ -1424,7 +1424,7 @@
this.player.resetIdleTimer(); this.player.resetIdleTimer();
if (this.player.activeContainer.windowId == packetplayinenchantitem.a() && this.player.activeContainer.c(this.player) && !this.player.isSpectator()) { if (this.player.activeContainer.windowId == packetplayinenchantitem.a() && this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
this.player.activeContainer.a(this.player, packetplayinenchantitem.b()); this.player.activeContainer.a(this.player, packetplayinenchantitem.b());
@@ -927,7 +1944,45 @@ @@ -933,7 +1950,45 @@
} }
boolean flag1 = packetplayinsetcreativeslot.a() >= 1 && packetplayinsetcreativeslot.a() <= 45; boolean flag1 = packetplayinsetcreativeslot.a() >= 1 && packetplayinsetcreativeslot.a() <= 45;
@ -1471,7 +1471,7 @@
if (flag1 && flag2) { if (flag1 && flag2) {
if (itemstack.isEmpty()) { if (itemstack.isEmpty()) {
@@ -951,6 +2006,7 @@ @@ -957,6 +2012,7 @@
public void a(PacketPlayInTransaction packetplayintransaction) { public void a(PacketPlayInTransaction packetplayintransaction) {
PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.x());
@ -1479,7 +1479,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.b() == oshort.shortValue() && this.player.activeContainer.windowId == packetplayintransaction.a() && !this.player.activeContainer.c(this.player) && !this.player.isSpectator()) { if (oshort != null && packetplayintransaction.b() == oshort.shortValue() && this.player.activeContainer.windowId == packetplayintransaction.a() && !this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
@@ -961,6 +2017,7 @@ @@ -967,6 +2023,7 @@
public void a(PacketPlayInUpdateSign packetplayinupdatesign) { public void a(PacketPlayInUpdateSign packetplayinupdatesign) {
PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.x());
@ -1487,7 +1487,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.a(); BlockPosition blockposition = packetplayinupdatesign.a();
@@ -977,14 +2034,30 @@ @@ -983,14 +2040,30 @@
if (!tileentitysign.a() || tileentitysign.e() != this.player) { if (!tileentitysign.a() || tileentitysign.e() != this.player) {
this.minecraftServer.warning("Player " + this.player.getName() + " just tried to change non-editable sign"); this.minecraftServer.warning("Player " + this.player.getName() + " just tried to change non-editable sign");
@ -1519,7 +1519,7 @@
tileentitysign.update(); tileentitysign.update();
worldserver.notify(blockposition, iblockdata, iblockdata, 3); worldserver.notify(blockposition, iblockdata, iblockdata, 3);
@@ -1007,11 +2080,27 @@ @@ -1016,11 +2089,27 @@
public void a(PacketPlayInAbilities packetplayinabilities) { public void a(PacketPlayInAbilities packetplayinabilities) {
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.x());
@ -1548,7 +1548,7 @@
ArrayList arraylist = Lists.newArrayList(); ArrayList arraylist = Lists.newArrayList();
Iterator iterator = this.minecraftServer.tabCompleteCommand(this.player, packetplayintabcomplete.a(), packetplayintabcomplete.b(), packetplayintabcomplete.c()).iterator(); Iterator iterator = this.minecraftServer.tabCompleteCommand(this.player, packetplayintabcomplete.a(), packetplayintabcomplete.b(), packetplayintabcomplete.c()).iterator();
@@ -1037,6 +2126,13 @@ @@ -1046,6 +2135,13 @@
ItemStack itemstack1; ItemStack itemstack1;
if ("MC|BEdit".equals(s)) { if ("MC|BEdit".equals(s)) {
@ -1562,7 +1562,7 @@
packetdataserializer = packetplayincustompayload.b(); packetdataserializer = packetplayincustompayload.b();
try { try {
@@ -1055,15 +2151,25 @@ @@ -1064,15 +2160,25 @@
} }
if (itemstack.getItem() == Items.WRITABLE_BOOK && itemstack.getItem() == itemstack1.getItem()) { if (itemstack.getItem() == Items.WRITABLE_BOOK && itemstack.getItem() == itemstack1.getItem()) {
@ -1588,7 +1588,7 @@
packetdataserializer = packetplayincustompayload.b(); packetdataserializer = packetplayincustompayload.b();
try { try {
@@ -1097,10 +2203,11 @@ @@ -1106,10 +2212,11 @@
} }
itemstack2.a("pages", (NBTBase) nbttaglist); itemstack2.a("pages", (NBTBase) nbttaglist);
@ -1601,7 +1601,7 @@
} }
} else if ("MC|TrSel".equals(s)) { } else if ("MC|TrSel".equals(s)) {
try { try {
@@ -1112,6 +2219,7 @@ @@ -1121,6 +2228,7 @@
} }
} catch (Exception exception2) { } catch (Exception exception2) {
PlayerConnection.LOGGER.error("Couldn\'t select trade", exception2); PlayerConnection.LOGGER.error("Couldn\'t select trade", exception2);
@ -1609,7 +1609,7 @@
} }
} else { } else {
TileEntity tileentity; TileEntity tileentity;
@@ -1161,6 +2269,7 @@ @@ -1170,6 +2278,7 @@
} }
} catch (Exception exception3) { } catch (Exception exception3) {
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception3); PlayerConnection.LOGGER.error("Couldn\'t set command block", exception3);
@ -1617,7 +1617,7 @@
} }
} else if ("MC|AutoCmd".equals(s)) { } else if ("MC|AutoCmd".equals(s)) {
if (!this.minecraftServer.getEnableCommandBlock()) { if (!this.minecraftServer.getEnableCommandBlock()) {
@@ -1228,6 +2337,7 @@ @@ -1237,6 +2346,7 @@
} }
} catch (Exception exception4) { } catch (Exception exception4) {
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception4); PlayerConnection.LOGGER.error("Couldn\'t set command block", exception4);
@ -1625,7 +1625,7 @@
} }
} else { } else {
int k; int k;
@@ -1251,6 +2361,7 @@ @@ -1260,6 +2370,7 @@
} }
} catch (Exception exception5) { } catch (Exception exception5) {
PlayerConnection.LOGGER.error("Couldn\'t set beacon", exception5); PlayerConnection.LOGGER.error("Couldn\'t set beacon", exception5);
@ -1633,7 +1633,7 @@
} }
} }
} else if ("MC|ItemName".equals(s)) { } else if ("MC|ItemName".equals(s)) {
@@ -1337,6 +2448,7 @@ @@ -1346,6 +2457,7 @@
} }
} catch (Exception exception6) { } catch (Exception exception6) {
PlayerConnection.LOGGER.error("Couldn\'t set structure block", exception6); PlayerConnection.LOGGER.error("Couldn\'t set structure block", exception6);
@ -1641,7 +1641,7 @@
} }
} else if ("MC|PickItem".equals(s)) { } else if ("MC|PickItem".equals(s)) {
packetdataserializer = packetplayincustompayload.b(); packetdataserializer = packetplayincustompayload.b();
@@ -1349,11 +2461,49 @@ @@ -1358,11 +2470,49 @@
this.player.playerConnection.sendPacket(new PacketPlayOutHeldItemSlot(this.player.inventory.itemInHandIndex)); this.player.playerConnection.sendPacket(new PacketPlayOutHeldItemSlot(this.player.inventory.itemInHandIndex));
} catch (Exception exception7) { } catch (Exception exception7) {
PlayerConnection.LOGGER.error("Couldn\'t pick item", exception7); PlayerConnection.LOGGER.error("Couldn\'t pick item", exception7);

Datei anzeigen

@ -387,35 +387,7 @@
this.c(entity); this.c(entity);
} }
@@ -1138,6 +1371,13 @@ @@ -1184,9 +1417,11 @@
this.methodProfiler.c("blockEntities");
this.O = true;
+ // CraftBukkit start - From below, clean up tile entities before ticking them
+ if (!this.tileEntityListUnload.isEmpty()) {
+ this.tileEntityListTick.removeAll(this.tileEntityListUnload);
+ this.tileEntityList.removeAll(this.tileEntityListUnload);
+ this.tileEntityListUnload.clear();
+ }
+ // CraftBukkit end
Iterator iterator = this.tileEntityListTick.iterator();
while (iterator.hasNext()) {
@@ -1172,11 +1412,13 @@
}
this.O = false;
+ /* CraftBukkit start - Moved up
if (!this.tileEntityListUnload.isEmpty()) {
this.tileEntityListTick.removeAll(this.tileEntityListUnload);
this.tileEntityList.removeAll(this.tileEntityListUnload);
this.tileEntityListUnload.clear();
}
+ // CraftBukkit end */
this.methodProfiler.c("pendingBlockEntities");
if (!this.b.isEmpty()) {
@@ -1184,9 +1426,11 @@
TileEntity tileentity1 = (TileEntity) this.b.get(i1); TileEntity tileentity1 = (TileEntity) this.b.get(i1);
if (!tileentity1.y()) { if (!tileentity1.y()) {
@ -427,7 +399,7 @@
if (this.isLoaded(tileentity1.getPosition())) { if (this.isLoaded(tileentity1.getPosition())) {
Chunk chunk = this.getChunkAtWorldCoords(tileentity1.getPosition()); Chunk chunk = this.getChunkAtWorldCoords(tileentity1.getPosition());
@@ -1194,6 +1438,12 @@ @@ -1194,6 +1429,12 @@
chunk.a(tileentity1.getPosition(), tileentity1); chunk.a(tileentity1.getPosition(), tileentity1);
this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3); this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3);
@ -440,7 +412,7 @@
} }
} }
} }
@@ -1247,15 +1497,13 @@ @@ -1247,15 +1488,13 @@
int i; int i;
int j; int j;
@ -462,7 +434,7 @@
entity.M = entity.locX; entity.M = entity.locX;
entity.N = entity.locY; entity.N = entity.locY;
@@ -1268,6 +1516,7 @@ @@ -1268,6 +1507,7 @@
entity.aE(); entity.aE();
} else { } else {
entity.B_(); entity.B_();
@ -470,7 +442,7 @@
} }
} }
@@ -1559,11 +1808,18 @@ @@ -1559,11 +1799,18 @@
} }
} }
@ -489,7 +461,7 @@
TileEntity tileentity = null; TileEntity tileentity = null;
if (this.O) { if (this.O) {
@@ -1598,6 +1854,14 @@ @@ -1598,6 +1845,14 @@
public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) { public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) {
if (!this.E(blockposition)) { if (!this.E(blockposition)) {
if (tileentity != null && !tileentity.y()) { if (tileentity != null && !tileentity.y()) {
@ -504,7 +476,7 @@
if (this.O) { if (this.O) {
tileentity.setPosition(blockposition); tileentity.setPosition(blockposition);
Iterator iterator = this.b.iterator(); Iterator iterator = this.b.iterator();
@@ -1757,6 +2021,14 @@ @@ -1757,6 +2012,14 @@
} }
this.o = MathHelper.a(this.o, 0.0F, 1.0F); this.o = MathHelper.a(this.o, 0.0F, 1.0F);
@ -519,7 +491,7 @@
} }
} }
} }
@@ -1894,7 +2166,10 @@ @@ -1894,7 +2157,10 @@
} }
public boolean c(EnumSkyBlock enumskyblock, BlockPosition blockposition) { public boolean c(EnumSkyBlock enumskyblock, BlockPosition blockposition) {
@ -531,7 +503,7 @@
return false; return false;
} else { } else {
int i = 0; int i = 0;
@@ -2061,7 +2336,7 @@ @@ -2061,7 +2327,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
@ -540,7 +512,7 @@
arraylist.add(entity); arraylist.add(entity);
} }
} }
@@ -2076,7 +2351,7 @@ @@ -2076,7 +2342,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
@ -549,7 +521,7 @@
arraylist.add(entity); arraylist.add(entity);
} }
} }
@@ -2125,7 +2400,7 @@ @@ -2125,7 +2391,7 @@
} }
} }
@ -558,7 +530,7 @@
} }
@Nullable @Nullable
@@ -2146,8 +2421,17 @@ @@ -2146,8 +2412,17 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
@ -577,7 +549,7 @@
++i; ++i;
} }
} }
@@ -2156,12 +2440,18 @@ @@ -2156,12 +2431,18 @@
} }
public void a(Collection<Entity> collection) { public void a(Collection<Entity> collection) {
@ -597,7 +569,7 @@
this.b(entity); this.b(entity);
} }
@@ -2175,7 +2465,13 @@ @@ -2175,7 +2456,13 @@
IBlockData iblockdata = this.getType(blockposition); IBlockData iblockdata = this.getType(blockposition);
AxisAlignedBB axisalignedbb = flag ? null : block.getBlockData().d(this, blockposition); AxisAlignedBB axisalignedbb = flag ? null : block.getBlockData().d(this, blockposition);
@ -612,7 +584,7 @@
} }
public int getSeaLevel() { public int getSeaLevel() {
@@ -2285,6 +2581,11 @@ @@ -2285,6 +2572,11 @@
for (int i = 0; i < this.players.size(); ++i) { for (int i = 0; i < this.players.size(); ++i) {
EntityHuman entityhuman1 = (EntityHuman) this.players.get(i); EntityHuman entityhuman1 = (EntityHuman) this.players.get(i);
@ -624,7 +596,7 @@
if (predicate.apply(entityhuman1)) { if (predicate.apply(entityhuman1)) {
double d5 = entityhuman1.d(d0, d1, d2); double d5 = entityhuman1.d(d0, d1, d2);
@@ -2453,6 +2754,16 @@ @@ -2453,6 +2745,16 @@
public void everyoneSleeping() {} public void everyoneSleeping() {}
@ -641,7 +613,7 @@
public float h(float f) { public float h(float f) {
return (this.p + (this.q - this.p) * f) * this.j(f); return (this.p + (this.q - this.p) * f) * this.j(f);
} }
@@ -2670,7 +2981,7 @@ @@ -2670,7 +2972,7 @@
int l = j * 16 + 8 - blockposition.getZ(); int l = j * 16 + 8 - blockposition.getZ();
boolean flag = true; boolean flag = true;

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/server/WorldServer.java --- a/net/minecraft/server/WorldServer.java
+++ b/net/minecraft/server/WorldServer.java +++ b/net/minecraft/server/WorldServer.java
@@ -19,14 +19,26 @@ @@ -20,14 +20,26 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -29,7 +29,7 @@
private final Map<UUID, Entity> entitiesByUUID = Maps.newHashMap(); private final Map<UUID, Entity> entitiesByUUID = Maps.newHashMap();
public boolean savingDisabled; public boolean savingDisabled;
private boolean Q; private boolean Q;
@@ -38,14 +50,22 @@ @@ -39,14 +51,22 @@
private int V; private int V;
private final List<NextTickListEntry> W = Lists.newArrayList(); private final List<NextTickListEntry> W = Lists.newArrayList();
@ -55,7 +55,7 @@
this.J(); this.J();
this.K(); this.K();
this.getWorldBorder().a(minecraftserver.aE()); this.getWorldBorder().a(minecraftserver.aE());
@@ -64,6 +84,7 @@ @@ -65,6 +85,7 @@
this.villages.a((World) this); this.villages.a((World) this);
} }
@ -63,7 +63,7 @@
this.scoreboard = new ScoreboardServer(this.server); this.scoreboard = new ScoreboardServer(this.server);
PersistentScoreboard persistentscoreboard = (PersistentScoreboard) this.worldMaps.get(PersistentScoreboard.class, "scoreboard"); PersistentScoreboard persistentscoreboard = (PersistentScoreboard) this.worldMaps.get(PersistentScoreboard.class, "scoreboard");
@@ -74,9 +95,21 @@ @@ -75,9 +96,21 @@
persistentscoreboard.a(this.scoreboard); persistentscoreboard.a(this.scoreboard);
((ScoreboardServer) this.scoreboard).a((Runnable) (new RunnableSaveScoreboard(persistentscoreboard))); ((ScoreboardServer) this.scoreboard).a((Runnable) (new RunnableSaveScoreboard(persistentscoreboard)));
@ -87,7 +87,7 @@
this.getWorldBorder().setCenter(this.worldData.B(), this.worldData.C()); this.getWorldBorder().setCenter(this.worldData.B(), this.worldData.C());
this.getWorldBorder().setDamageAmount(this.worldData.H()); this.getWorldBorder().setDamageAmount(this.worldData.H());
this.getWorldBorder().setDamageBuffer(this.worldData.G()); this.getWorldBorder().setDamageBuffer(this.worldData.G());
@@ -88,9 +121,146 @@ @@ -89,9 +122,146 @@
this.getWorldBorder().setSize(this.worldData.D()); this.getWorldBorder().setSize(this.worldData.D());
} }
@ -234,7 +234,7 @@
public void doTick() { public void doTick() {
super.doTick(); super.doTick();
if (this.getWorldData().isHardcore() && this.getDifficulty() != EnumDifficulty.HARD) { if (this.getWorldData().isHardcore() && this.getDifficulty() != EnumDifficulty.HARD) {
@@ -109,8 +279,11 @@ @@ -110,8 +280,11 @@
} }
this.methodProfiler.a("mobSpawner"); this.methodProfiler.a("mobSpawner");
@ -248,7 +248,7 @@
} }
this.methodProfiler.c("chunkSource"); this.methodProfiler.c("chunkSource");
@@ -139,6 +312,8 @@ @@ -140,6 +313,8 @@
this.portalTravelAgent.a(this.getTime()); this.portalTravelAgent.a(this.getTime());
this.methodProfiler.b(); this.methodProfiler.b();
this.aq(); this.aq();
@ -257,7 +257,7 @@
} }
@Nullable @Nullable
@@ -166,7 +341,7 @@ @@ -167,7 +342,7 @@
if (entityhuman.isSpectator()) { if (entityhuman.isSpectator()) {
++i; ++i;

14
pom.xml
Datei anzeigen

@ -4,14 +4,14 @@
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId> <artifactId>craftbukkit</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.12.1-R0.1-SNAPSHOT</version> <version>1.12.2-R0.1-SNAPSHOT</version>
<name>CraftBukkit</name> <name>CraftBukkit</name>
<url>http://www.bukkit.org</url> <url>http://www.bukkit.org</url>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<api.version>unknown</api.version> <api.version>unknown</api.version>
<minecraft.version>1.12.1</minecraft.version> <minecraft.version>1.12.2</minecraft.version>
<minecraft_version>1_12_R1</minecraft_version> <minecraft_version>1_12_R1</minecraft_version>
<buildtag.prefix>git-Bukkit-</buildtag.prefix> <buildtag.prefix>git-Bukkit-</buildtag.prefix>
<buildtag.suffix></buildtag.suffix> <buildtag.suffix></buildtag.suffix>
@ -55,13 +55,13 @@
<dependency> <dependency>
<groupId>org.xerial</groupId> <groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId> <artifactId>sqlite-jdbc</artifactId>
<version>3.19.3</version> <version>3.20.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
<version>5.1.43</version> <version>5.1.44</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<!-- testing --> <!-- testing -->
@ -153,7 +153,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId> <artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.15</version> <version>1.16</version>
<executions> <executions>
<execution> <execution>
<phase>process-classes</phase> <phase>process-classes</phase>
@ -173,7 +173,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version> <version>3.1.0</version>
<executions> <executions>
<execution> <execution>
<phase>package</phase> <phase>package</phase>
@ -218,7 +218,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.6.2</version> <version>3.7.0</version>
<configuration> <configuration>
<!-- we use the Eclipse compiler as it doesn't need a JDK --> <!-- we use the Eclipse compiler as it doesn't need a JDK -->
<compilerId>eclipse</compilerId> <compilerId>eclipse</compilerId>

Datei anzeigen

@ -169,7 +169,7 @@ public class Main {
useConsole = false; useConsole = false;
} }
if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
Date buildDate = new SimpleDateFormat("yyyyMMdd-HHmm").parse(Main.class.getPackage().getImplementationVendor()); Date buildDate = new SimpleDateFormat("yyyyMMdd-HHmm").parse(Main.class.getPackage().getImplementationVendor());
Calendar deadline = Calendar.getInstance(); Calendar deadline = Calendar.getInstance();

Datei anzeigen

@ -93,8 +93,8 @@ public class CraftContainer extends Container {
String type = getNotchInventoryType(cachedType); String type = getNotchInventoryType(cachedType);
IInventory top = ((CraftInventory) view.getTopInventory()).getInventory(); IInventory top = ((CraftInventory) view.getTopInventory()).getInventory();
PlayerInventory bottom = (PlayerInventory) ((CraftInventory) view.getBottomInventory()).getInventory(); PlayerInventory bottom = (PlayerInventory) ((CraftInventory) view.getBottomInventory()).getInventory();
this.b.clear(); this.items.clear();
this.c.clear(); this.slots.clear();
if (typeChanged) { if (typeChanged) {
setupSlots(top, bottom, player.getHandle()); setupSlots(top, bottom, player.getHandle());
} }
@ -172,18 +172,18 @@ public class CraftContainer extends Container {
} }
if (delegate != null) { if (delegate != null) {
this.b = delegate.b; // PAIL: items this.items = delegate.items;
this.c = delegate.c; // PAIL: slots this.slots = delegate.slots;
} }
} }
@Override @Override
public ItemStack b(EntityHuman entityhuman, int i) { // PAIL: shiftClick public ItemStack shiftClick(EntityHuman entityhuman, int i) {
return (delegate != null) ? delegate.b(entityhuman, i) : super.b(entityhuman, i); return (delegate != null) ? delegate.shiftClick(entityhuman, i) : super.shiftClick(entityhuman, i);
} }
@Override @Override
public boolean a(EntityHuman entity) { // PAIL: canUse public boolean canUse(EntityHuman entity) {
return true; return true;
} }
} }