@ -231,7 +231,7 @@
WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);
this.field_147366_g = true;
@@ -199,8 +323,78 @@
@@ -199,8 +323,70 @@
}
}
@ -268,9 +268,6 @@
+ this.lastYaw = to.getYaw();
+ this.lastPitch = to.getPitch();
+
+ // Skip the first time we do this
+ if (hasMoved) // Spigot - Better Check!
+ {
+ PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
+ this.server.getPluginManager().callEvent(event);
+
@ -299,11 +296,6 @@
+ return;
+ }
+ }
+ else
+ {
+ hasMoved = true; // Spigot - Better Check!
+ }
+ }
+
+ if (this.hasMoved && !this.playerEntity.isDead)
+ {
@ -311,7 +303,7 @@
double d1;
double d2;
double d3;
@@ -280,13 +474 ,6 @@
@@ -280,13 +466 ,6 @@
d3 = p_147347_1_.func_149472_e();
d4 = p_147347_1_.func_149471_f() - p_147347_1_.func_149467_d();
@ -325,7 +317,7 @@
if (Math.abs(p_147347_1_.func_149464_c()) > 3.2E7D || Math.abs(p_147347_1_.func_149472_e()) > 3.2E7D)
{
this.kickPlayerFromServer("Illegal position");
@@ -318,7 +505 ,7 @@
@@ -318,7 +497 ,7 @@
double d9 = Math.max(Math.abs(d6), Math.abs(this.playerEntity.motionZ));
double d10 = d7 * d7 + d8 * d8 + d9 * d9;
@ -334,7 +326,7 @@
{
logger.warn(this.playerEntity.getCommandSenderName() + " moved too quickly! " + d4 + "," + d5 + "," + d6 + " (" + d7 + ", " + d8 + ", " + d9 + ")");
this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch);
@@ -413,21 +600 ,85 @@
@@ -413,21 +592 ,85 @@
public void setPlayerLocation(double p_147364_1_, double p_147364_3_, double p_147364_5_, float p_147364_7_, float p_147364_8_)
{
@ -425,7 +417,7 @@
this.playerEntity.dropOneItem(false);
}
else if (p_147345_1_.func_149506_g() == 3)
@@ -490,7 +741 ,17 @@
@@ -490,7 +733 ,17 @@
}
else
{
@ -443,7 +435,7 @@
}
}
else if (p_147345_1_.func_149506_g() == 2)
@@ -517,6 +778 ,34 @@
@@ -517,6 +770 ,34 @@
public void processPlayerBlockPlacement(C08PacketPlayerBlockPlacement p_147346_1_)
{
WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);
@ -478,7 +470,7 @@
ItemStack itemstack = this.playerEntity.inventory.getCurrentItem();
boolean flag = false;
boolean placeResult = true;
@@ -533,11 +822 ,21 @@
@@ -533,11 +814 ,21 @@
return;
}
@ -502,7 +494,7 @@
}
else if (p_147346_1_.func_149571_d() >= this.serverController.getBuildLimit() - 1 && (p_147346_1_.func_149568_f() == 1 || p_147346_1_.func_149571_d() >= this.serverController.getBuildLimit()))
{
@@ -548,17 +847 ,24 @@
@@ -548,17 +839 ,24 @@
}
else
{
@ -535,7 +527,7 @@
flag = true;
}
@@ -615,7 +92 1,7 @@
@@ -615,7 +913 ,7 @@
this.playerEntity.openContainer.detectAndSendChanges();
this.playerEntity.isChangingQuantityOnly = false;
@ -544,7 +536,7 @@
{
this.sendPacket(new S2FPacketSetSlot(this.playerEntity.openContainer.windowId, slot.slotNumber, this.playerEntity.inventory.getCurrentItem()));
}
@@ -624,14 +930 ,34 @@
@@ -624,14 +922 ,34 @@
public void onDisconnect(IChatComponent p_147231_1_)
{
@ -584,7 +576,7 @@
if (this.serverController.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.serverController.getServerOwner()))
{
logger.info("Stopping singleplayer server as player logged out");
@@ -657,6 +983 ,18 @@
@@ -657,6 +975 ,18 @@
}
}
@ -603,7 +595,7 @@
try
{
this.netManager.scheduleOutboundPacket(p_147359_1_, new GenericFutureListener[0]);
@@ -679,20 +1017 ,37 @@
@@ -679,20 +1009 ,37 @@
public void processHeldItemChange(C09PacketHeldItemChange p_147355_1_)
{
@ -642,7 +634,7 @@
{
ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("chat.cannotSend", new Object[0]);
chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED);
@@ -708,51 +1063 ,385 @@
@@ -708,51 +1055 ,385 @@
{
if (!ChatAllowedCharacters.isAllowedCharacter(s.charAt(i)))
{
@ -1040,7 +1032,7 @@
if (p_147357_1_.func_149513_d() == 1)
{
this.playerEntity.setSneaking(true);
@@ -772,7 +1461 ,7 @@
@@ -772,7 +1453 ,7 @@
else if (p_147357_1_.func_149513_d() == 3)
{
this.playerEntity.wakeUpPlayer(false, true, true);
@ -1049,7 +1041,7 @@
}
else if (p_147357_1_.func_149513_d() == 6)
{
@@ -789,8 +1478 ,20 @@
@@ -789,8 +1470 ,20 @@
public void processUseEntity(C02PacketUseEntity p_147340_1_)
{
@ -1071,7 +1063,7 @@
this.playerEntity.func_143004_u();
if (entity != null)
@@ -805,9 +1506 ,53 @@
@@ -805,9 +1498 ,53 @@
if (this.playerEntity.getDistanceSqToEntity(entity) < d0)
{
@ -1125,7 +1117,7 @@
}
else if (p_147340_1_.func_149565_c() == C02PacketUseEntity.Action.ATTACK)
{
@@ -819,6 +1564 ,13 @@
@@ -819,6 +155 6,13 @@
}
this.playerEntity.attackTargetEntityWithCurrentItem(entity);
@ -1139,7 +1131,7 @@
}
}
}
@@ -834,8 +1586 ,19 @@
@@ -834,8 +157 8,19 @@
case 1:
if (this.playerEntity.playerConqueredTheEnd)
{
@ -1160,7 +1152,7 @@
else if (this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled())
{
if (this.serverController.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.serverController.getServerOwner()))
@@ -871,17 +1634 ,461 @@
@@ -871,17 +1626 ,461 @@
public void processCloseWindow(C0DPacketCloseWindow p_147356_1_)
{
@ -1623,7 +1615,7 @@
if (ItemStack.areItemStacksEqual(p_147351_1_.func_149546_g(), itemstack))
{
this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(p_147351_1_.func_149548_c(), p_147351_1_.func_149547_f(), true));
@@ -903,6 +211 0,12 @@
@@ -903,6 +2102 ,12 @@
}
this.playerEntity.sendContainerAndContentsToPlayer(this.playerEntity.openContainer, arraylist);
@ -1636,7 +1628,7 @@
}
}
}
@@ -925,9 +2138 ,61 @@
@@ -925,9 +2130 ,61 @@
boolean flag = p_147344_1_.func_149627_c() < 0;
ItemStack itemstack = p_147344_1_.func_149625_d();
boolean flag1 = p_147344_1_.func_149627_c() >= 1 && p_147344_1_.func_149627_c() < 36 + InventoryPlayer.getHotbarSize();
@ -1699,7 +1691,7 @@
if (flag1 && flag2 && flag3)
{
if (itemstack == null)
@@ -956,6 +222 1,11 @@
@@ -956,6 +2213 ,11 @@
public void processConfirmTransaction(C0FPacketConfirmTransaction p_147339_1_)
{
@ -1711,7 +1703,7 @@
Short oshort = (Short)this.field_147372_n.lookup(this.playerEntity.openContainer.windowId);
if (oshort != null && p_147339_1_.func_149533_d() == oshort.shortValue() && this.playerEntity.openContainer.windowId == p_147339_1_.func_149532_c() && !this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity))
@@ -966,6 +2236 ,11 @@
@@ -966,6 +2228 ,11 @@
public void processUpdateSign(C12PacketUpdateSign p_147343_1_)
{
@ -1723,7 +1715,7 @@
this.playerEntity.func_143004_u();
WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);
@@ -980,6 +2255 ,7 @@
@@ -980,6 +2247 ,7 @@
if (!tileentitysign.func_145914_a() || tileentitysign.func_145911_b() != this.playerEntity)
{
this.serverController.logWarning("Player " + this.playerEntity.getCommandSenderName() + " just tried to change non-editable sign");
@ -1731,7 +1723,7 @@
return;
}
}
@@ -990,6 +2266 ,7 @@
@@ -990,6 +2258 ,7 @@
for (j = 0; j < 4; ++j)
{
boolean flag = true;
@ -1739,7 +1731,7 @@
if (p_147343_1_.func_149589_f()[j].length() > 15)
{
@@ -1018,7 +2295 ,29 @@
@@ -1018,7 +2287 ,29 @@
int k = p_147343_1_.func_149586_d();
i = p_147343_1_.func_149585_e();
TileEntitySign tileentitysign1 = (TileEntitySign)tileentity;
@ -1770,7 +1762,7 @@
tileentitysign1.markDirty();
worldserver.markBlockForUpdate(j, k, i);
}
@@ -1041,7 +2340 ,22 @@
@@ -1041,7 +2332 ,22 @@
public void processPlayerAbilities(C13PacketPlayerAbilities p_147348_1_)
{
@ -1794,7 +1786,7 @@
}
public void processTabComplete(C14PacketTabComplete p_147341_1_)
@@ -1068,7 +2382 ,6 @@
@@ -1068,7 +2374 ,6 @@
PacketBuffer packetbuffer;
ItemStack itemstack;
ItemStack itemstack1;
@ -1802,7 +1794,7 @@
if ("MC|BEdit".equals(p_147349_1_.func_149559_c()))
{
packetbuffer = new PacketBuffer(Unpooled.wrappedBuffer(p_147349_1_.func_149558_e()));
@@ -1093,16 +2406 ,18 @@
@@ -1093,16 +2398 ,18 @@
if (itemstack.getItem() == Items.writable_book && itemstack.getItem() == itemstack1.getItem())
{
@ -1825,7 +1817,7 @@
}
finally
{
@@ -1135,19 +2450 ,18 @@
@@ -1135,19 +2442 ,18 @@
{
if (itemstack.getItem() == Items.written_book && itemstack1.getItem() == Items.writable_book)
{
@ -1851,7 +1843,7 @@
}
finally
{
@@ -1174,9 +2488 ,12 @@
@@ -1174,9 +2480 ,12 @@
((ContainerMerchant)container).setCurrentRecipeIndex(i);
}
}
@ -1865,7 +1857,7 @@
}
}
else if ("MC|AdvCdm".equals(p_147349_1_.func_149559_c()))
@@ -1222,9 +2539 ,12 @@
@@ -1222,9 +2531 ,12 @@
this.playerEntity.addChatMessage(new ChatComponentTranslation("advMode.setCommand.success", new Object[] {s1}));
}
}
@ -1880,7 +1872,7 @@
}
finally
{
@@ -1257,9 +2577 ,12 @@
@@ -1257,9 +2569 ,12 @@
tileentitybeacon.markDirty();
}
}
@ -1895,7 +1887,7 @@
}
}
}
@@ -1281,6 +2604 ,13 @@
@@ -1281,6 +259 6,13 @@
containerrepair.updateItemName("");
}
}
@ -1909,7 +1901,7 @@
}
}
@@ -1292,6 +2622 ,21 @@
@@ -1292,6 +2614 ,21 @@
}
}