COnverted patches to SRG names

This commit is contained in:
AbrarSyed committed 2014-03-25 10:13:57 -05:00
1 parent 0620a64813
commit 2a2e201f4a
211 files changed
+5540 -5065

No files matched your search

@@ -14,134 +14,134 @@
+
public class NetHandlerPlayServer implements INetHandlerPlayServer
{
private static final Logger logger = LogManager.getLogger();
@@ -229,6 +237,11 @@
this.playerEntity.ridingEntity.updateRiderPosition();
private static final Logger field_147370_c = LogManager.getLogger();
@@ -219,6 +227,11 @@
this.field_147369_b.field_70154_o.func_70043_V();
}
+ if (!this.hasMoved) //Fixes teleportation kick while riding entities
+ if (!this.field_147380_r) //Fixes teleportation kick while riding entities
+ {
+ return;
+ }
+
this.serverController.getConfigurationManager().updatePlayerPertinentChunks(this.playerEntity);
this.field_147367_d.func_71203_ab().func_72358_d(this.field_147369_b);
if (this.hasMoved)
@@ -306,9 +319,10 @@
d4 = d1 - this.playerEntity.posX;
double d5 = d2 - this.playerEntity.posY;
double d6 = d3 - this.playerEntity.posZ;
- double d7 = Math.min(Math.abs(d4), Math.abs(this.playerEntity.motionX));
- double d8 = Math.min(Math.abs(d5), Math.abs(this.playerEntity.motionY));
- double d9 = Math.min(Math.abs(d6), Math.abs(this.playerEntity.motionZ));
if (this.field_147380_r)
@@ -296,9 +309,10 @@
d4 = d1 - this.field_147369_b.field_70165_t;
double d5 = d2 - this.field_147369_b.field_70163_u;
double d6 = d3 - this.field_147369_b.field_70161_v;
- double d7 = Math.min(Math.abs(d4), Math.abs(this.field_147369_b.field_70159_w));
- double d8 = Math.min(Math.abs(d5), Math.abs(this.field_147369_b.field_70181_x));
- double d9 = Math.min(Math.abs(d6), Math.abs(this.field_147369_b.field_70179_y));
+ //BUGFIX: min -> max, grabs the highest distance
+ double d7 = Math.max(Math.abs(d4), Math.abs(this.playerEntity.motionX));
+ double d8 = Math.max(Math.abs(d5), Math.abs(this.playerEntity.motionY));
+ double d9 = Math.max(Math.abs(d6), Math.abs(this.playerEntity.motionZ));
+ double d7 = Math.max(Math.abs(d4), Math.abs(this.field_147369_b.field_70159_w));
+ double d8 = Math.max(Math.abs(d5), Math.abs(this.field_147369_b.field_70181_x));
+ double d9 = Math.max(Math.abs(d6), Math.abs(this.field_147369_b.field_70179_y));
double d10 = d7 * d7 + d8 * d8 + d9 * d9;
if (d10 > 100.0D && (!this.serverController.isSinglePlayer() || !this.serverController.getServerOwner().equals(this.playerEntity.getCommandSenderName())))
@@ -326,6 +340,11 @@
this.playerEntity.jump();
if (d10 > 100.0D && (!this.field_147367_d.func_71264_H() || !this.field_147367_d.func_71214_G().equals(this.field_147369_b.func_70005_c_())))
@@ -316,6 +330,11 @@
this.field_147369_b.func_70664_aZ();
}
+ if (!this.hasMoved) //Fixes "Moved Too Fast" kick when being teleported while moving
+ if (!this.field_147380_r) //Fixes "Moved Too Fast" kick when being teleported while moving
+ {
+ return;
+ }
+
this.playerEntity.moveEntity(d4, d5, d6);
this.playerEntity.onGround = p_147347_1_.func_149465_i();
this.playerEntity.addMovementStat(d4, d5, d6);
@@ -348,10 +367,15 @@
logger.warn(this.playerEntity.getCommandSenderName() + " moved wrongly!");
this.field_147369_b.func_70091_d(d4, d5, d6);
this.field_147369_b.field_70122_E = p_147347_1_.func_149465_i();
this.field_147369_b.func_71000_j(d4, d5, d6);
@@ -338,10 +357,15 @@
field_147370_c.warn(this.field_147369_b.func_70005_c_() + " moved wrongly!");
}
+ if (!this.hasMoved) //Fixes "Moved Too Fast" kick when being teleported while moving
+ if (!this.field_147380_r) //Fixes "Moved Too Fast" kick when being teleported while moving
+ {
+ return;
+ }
+
this.playerEntity.setPositionAndRotation(d1, d2, d3, f1, f2);
boolean flag2 = worldserver.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.boundingBox.copy().contract((double)f3, (double)f3, (double)f3)).isEmpty();
this.field_147369_b.func_70080_a(d1, d2, d3, f1, f2);
boolean flag2 = worldserver.func_72945_a(this.field_147369_b, this.field_147369_b.field_70121_D.func_72329_c().func_72331_e((double)f3, (double)f3, (double)f3)).isEmpty();
- if (flag && (flag1 || !flag2) && !this.playerEntity.isPlayerSleeping())
+ if (flag && (flag1 || !flag2) && !this.playerEntity.isPlayerSleeping() && !this.playerEntity.noClip)
- if (flag && (flag1 || !flag2) && !this.field_147369_b.func_70608_bn())
+ if (flag && (flag1 || !flag2) && !this.field_147369_b.func_70608_bn() && !this.field_147369_b.field_70145_X)
{
this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, f1, f2);
this.func_147364_a(this.field_147373_o, this.field_147382_p, this.field_147381_q, f1, f2);
return;
@@ -359,7 +383,7 @@
@@ -349,7 +373,7 @@
AxisAlignedBB axisalignedbb = this.playerEntity.boundingBox.copy().expand((double)f3, (double)f3, (double)f3).addCoord(0.0D, -0.55D, 0.0D);
AxisAlignedBB axisalignedbb = this.field_147369_b.field_70121_D.func_72329_c().func_72314_b((double)f3, (double)f3, (double)f3).func_72321_a(0.0D, -0.55D, 0.0D);
- if (!this.serverController.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !worldserver.checkBlockCollision(axisalignedbb))
+ if (!this.serverController.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !worldserver.checkBlockCollision(axisalignedbb) && !this.playerEntity.capabilities.allowFlying)
- if (!this.field_147367_d.func_71231_X() && !this.field_147369_b.field_71134_c.func_73083_d() && !worldserver.func_72829_c(axisalignedbb))
+ if (!this.field_147367_d.func_71231_X() && !this.field_147369_b.field_71134_c.func_73083_d() && !worldserver.func_72829_c(axisalignedbb) && !this.field_147369_b.field_71075_bZ.field_75101_c)
{
if (d11 >= -0.03125D)
{
@@ -378,6 +402,11 @@
this.floatingTickCount = 0;
@@ -368,6 +392,11 @@
this.field_147365_f = 0;
}
+ if (!this.hasMoved) //Fixes "Moved Too Fast" kick when being teleported while moving
+ if (!this.field_147380_r) //Fixes "Moved Too Fast" kick when being teleported while moving
+ {
+ return;
+ }
+
this.playerEntity.onGround = p_147347_1_.func_149465_i();
this.serverController.getConfigurationManager().updatePlayerPertinentChunks(this.playerEntity);
this.playerEntity.handleFalling(this.playerEntity.posY - d0, p_147347_1_.func_149465_i());
@@ -448,7 +477,10 @@
double d2 = this.playerEntity.posZ - ((double)k + 0.5D);
this.field_147369_b.field_70122_E = p_147347_1_.func_149465_i();
this.field_147367_d.func_71203_ab().func_72358_d(this.field_147369_b);
this.field_147369_b.func_71122_b(this.field_147369_b.field_70163_u - d0, p_147347_1_.func_149465_i());
@@ -436,7 +465,10 @@
double d2 = this.field_147369_b.field_70161_v - ((double)k + 0.5D);
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
- if (d3 > 36.0D)
+ double dist = playerEntity.theItemInWorldManager.getBlockReachDistance() + 1;
+ double dist = field_147369_b.field_71134_c.getBlockReachDistance() + 1;
+ dist *= dist;
+
+ if (d3 > dist)
{
return;
}
@@ -510,7 +542,11 @@
@@ -497,7 +529,11 @@
return;
}
- this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, worldserver, itemstack);
+ PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(playerEntity, PlayerInteractEvent.Action.RIGHT_CLICK_AIR, 0, 0, 0, -1);
- this.field_147369_b.field_71134_c.func_73085_a(this.field_147369_b, worldserver, itemstack);
+ PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(field_147369_b, PlayerInteractEvent.Action.RIGHT_CLICK_AIR, 0, 0, 0, -1);
+ if (event.useItem != Event.Result.DENY)
+ {
+ this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, worldserver, itemstack);
+ this.field_147369_b.field_71134_c.func_73085_a(this.field_147369_b, worldserver, itemstack);
+ }
}
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()))
else if (p_147346_1_.func_149571_d() >= this.field_147367_d.func_71207_Z() - 1 && (p_147346_1_.func_149568_f() == 1 || p_147346_1_.func_149571_d() >= this.field_147367_d.func_71207_Z()))
{
@@ -521,7 +557,9 @@
@@ -508,7 +544,9 @@
}
else
{
- if (this.hasMoved && this.playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < 64.0D && !this.serverController.isBlockProtected(worldserver, i, j, k, this.playerEntity))
+ double dist = playerEntity.theItemInWorldManager.getBlockReachDistance() + 1;
- if (this.field_147380_r && this.field_147369_b.func_70092_e((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < 64.0D && !this.field_147367_d.func_96290_a(worldserver, i, j, k, this.field_147369_b))
+ double dist = field_147369_b.field_71134_c.getBlockReachDistance() + 1;
+ dist *= dist;
+ if (this.hasMoved && this.playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < dist && !this.serverController.isBlockProtected(worldserver, i, j, k, this.playerEntity))
+ if (this.field_147380_r && this.field_147369_b.func_70092_e((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < dist && !this.field_147367_d.func_96290_a(worldserver, i, j, k, this.field_147369_b))
{
this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, itemstack, i, j, k, l, p_147346_1_.func_149573_h(), p_147346_1_.func_149569_i(), p_147346_1_.func_149575_j());
this.field_147369_b.field_71134_c.func_73078_a(this.field_147369_b, worldserver, itemstack, i, j, k, l, p_147346_1_.func_149573_h(), p_147346_1_.func_149569_i(), p_147346_1_.func_149575_j());
}
@@ -690,6 +728,8 @@
@@ -674,6 +712,8 @@
else
{
ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("chat.type.text", new Object[] {this.playerEntity.func_145748_c_(), s});
ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("chat.type.text", new Object[] {this.field_147369_b.func_145748_c_(), s});
+ chatcomponenttranslation1 = ForgeHooks.onServerChatEvent(this, s, chatcomponenttranslation1);
+ if (chatcomponenttranslation1 == null) return;
this.serverController.getConfigurationManager().sendChatMsgImpl(chatcomponenttranslation1, false);
this.field_147367_d.func_71203_ab().func_148544_a(chatcomponenttranslation1, false);
}
@@ -831,7 +871,7 @@
@@ -810,7 +850,7 @@
return;
}
- this.playerEntity = this.serverController.getConfigurationManager().respawnPlayer(this.playerEntity, 0, false);
+ this.playerEntity = this.serverController.getConfigurationManager().respawnPlayer(this.playerEntity, playerEntity.dimension, false);
- this.field_147369_b = this.field_147367_d.func_71203_ab().func_72368_a(this.field_147369_b, 0, false);
+ this.field_147369_b = this.field_147367_d.func_71203_ab().func_72368_a(this.field_147369_b, field_147369_b.field_71093_bK, false);
}
break;