mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-21 12:42:26 +00:00
All the patches done? Some code fixups.. It begins.
This commit is contained in:
1 parent
a26c4017b1
commit
da03639bd7
20 files changed
+1081
-17
No files matched your search
@@ -0,0 +1,121 @@
|
||||
--- ../src-base/minecraft/net/minecraft/network/NetHandlerPlayServer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/network/NetHandlerPlayServer.java
|
||||
@@ -254,6 +254,8 @@
|
||||
this.playerEntity.ridingEntity.updateRiderPosition();
|
||||
}
|
||||
|
||||
+ if (!this.hasMoved) return; //Fixes teleportation kick while riding entities
|
||||
+
|
||||
this.serverController.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity);
|
||||
|
||||
if (this.playerEntity.ridingEntity != null)
|
||||
@@ -350,6 +352,8 @@
|
||||
this.playerEntity.jump();
|
||||
}
|
||||
|
||||
+ if (!this.hasMoved) return; //Fixes "Moved Too Fast" kick when being teleported while moving
|
||||
+
|
||||
this.playerEntity.moveEntity(d11, d12, d13);
|
||||
this.playerEntity.onGround = packetIn.isOnGround();
|
||||
d11 = d8 - this.playerEntity.posX;
|
||||
@@ -370,6 +374,8 @@
|
||||
logger.warn(this.playerEntity.getName() + " moved wrongly!");
|
||||
}
|
||||
|
||||
+ if (!this.hasMoved) return; //Fixes "Moved Too Fast" kick when being teleported while moving
|
||||
+
|
||||
this.playerEntity.setPositionAndRotation(d8, d9, d10, f1, f2);
|
||||
this.playerEntity.addMovementStat(this.playerEntity.posX - d0, this.playerEntity.posY - d1, this.playerEntity.posZ - d2);
|
||||
|
||||
@@ -377,7 +383,7 @@
|
||||
{
|
||||
boolean flag2 = worldserver.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.getEntityBoundingBox().contract((double)f3, (double)f3, (double)f3)).isEmpty();
|
||||
|
||||
- if (flag && (flag1 || !flag2) && !this.playerEntity.isPlayerSleeping())
|
||||
+ if (flag && (flag1 || !flag2) && !this.playerEntity.isPlayerSleeping() && !this.playerEntity.noClip)
|
||||
{
|
||||
this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, f1, f2);
|
||||
return;
|
||||
@@ -405,6 +411,8 @@
|
||||
this.floatingTickCount = 0;
|
||||
}
|
||||
|
||||
+ if (!this.hasMoved) return; //Fixes "Moved Too Fast" kick when being teleported while moving
|
||||
+
|
||||
this.playerEntity.onGround = packetIn.isOnGround();
|
||||
this.serverController.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity);
|
||||
this.playerEntity.handleFalling(this.playerEntity.posY - d7, packetIn.isOnGround());
|
||||
@@ -497,7 +505,10 @@
|
||||
double d2 = this.playerEntity.posZ - ((double)blockpos.getZ() + 0.5D);
|
||||
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
|
||||
|
||||
- if (d3 > 36.0D)
|
||||
+ double dist = playerEntity.theItemInWorldManager.getBlockReachDistance() + 1;
|
||||
+ dist *= dist;
|
||||
+
|
||||
+ if (d3 > dist)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -549,6 +560,7 @@
|
||||
WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);
|
||||
ItemStack itemstack = this.playerEntity.inventory.getCurrentItem();
|
||||
boolean flag = false;
|
||||
+ boolean placeResult = true;
|
||||
BlockPos blockpos = packetIn.getPosition();
|
||||
EnumFacing enumfacing = EnumFacing.getFront(packetIn.getPlacedBlockDirection());
|
||||
this.playerEntity.markPlayerActive();
|
||||
@@ -560,13 +572,20 @@
|
||||
return;
|
||||
}
|
||||
|
||||
+ net.minecraftforge.event.entity.player.PlayerInteractEvent event = net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(playerEntity, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_AIR, worldserver, new BlockPos(0, 0, 0), null);
|
||||
+ if (event.useItem != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY)
|
||||
+ {
|
||||
this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, worldserver, itemstack);
|
||||
+ }
|
||||
}
|
||||
else if (blockpos.getY() < this.serverController.getBuildLimit() - 1 || enumfacing != EnumFacing.UP && blockpos.getY() < this.serverController.getBuildLimit())
|
||||
{
|
||||
- if (this.hasMoved && this.playerEntity.getDistanceSq((double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D) < 64.0D && !this.serverController.isBlockProtected(worldserver, blockpos, this.playerEntity) && worldserver.getWorldBorder().contains(blockpos))
|
||||
+ double dist = playerEntity.theItemInWorldManager.getBlockReachDistance() + 3;
|
||||
+ dist *= dist;
|
||||
+ if (this.hasMoved && this.playerEntity.getDistanceSq((double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D) < dist && !this.serverController.isBlockProtected(worldserver, blockpos, this.playerEntity) && worldserver.getWorldBorder().contains(blockpos))
|
||||
{
|
||||
- this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, itemstack, blockpos, enumfacing, packetIn.getPlacedBlockOffsetX(), packetIn.getPlacedBlockOffsetY(), packetIn.getPlacedBlockOffsetZ());
|
||||
+ // record block place result so we can update client itemstack size if place event was cancelled.
|
||||
+ placeResult = this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, itemstack, blockpos, enumfacing, packetIn.getPlacedBlockOffsetX(), packetIn.getPlacedBlockOffsetY(), packetIn.getPlacedBlockOffsetZ());
|
||||
}
|
||||
|
||||
flag = true;
|
||||
@@ -601,7 +620,7 @@
|
||||
this.playerEntity.openContainer.detectAndSendChanges();
|
||||
this.playerEntity.isChangingQuantityOnly = false;
|
||||
|
||||
- if (!ItemStack.areItemStacksEqual(this.playerEntity.inventory.getCurrentItem(), packetIn.getStack()))
|
||||
+ if (!ItemStack.areItemStacksEqual(this.playerEntity.inventory.getCurrentItem(), packetIn.getStack()) || !placeResult) // force client itemstack update if place event was cancelled
|
||||
{
|
||||
this.sendPacket(new S2FPacketSetSlot(this.playerEntity.openContainer.windowId, slot.slotNumber, this.playerEntity.inventory.getCurrentItem()));
|
||||
}
|
||||
@@ -770,8 +789,10 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- IChatComponent ichatcomponent = new ChatComponentTranslation("chat.type.text", new Object[] {this.playerEntity.getDisplayName(), s});
|
||||
- this.serverController.getConfigurationManager().sendChatMsgImpl(ichatcomponent, false);
|
||||
+ ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("chat.type.text", this.playerEntity.getDisplayName(), net.minecraftforge.common.ForgeHooks.newChatWithLinks(s));
|
||||
+ IChatComponent chat = net.minecraftforge.common.ForgeHooks.onServerChatEvent(this, s, chatcomponenttranslation1);
|
||||
+ if (chat == null) return;
|
||||
+ this.serverController.getConfigurationManager().sendChatMsgImpl(chat, false);
|
||||
}
|
||||
|
||||
this.chatSpamThresholdCount += 20;
|
||||
@@ -916,7 +937,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
- this.playerEntity = this.serverController.getConfigurationManager().recreatePlayerEntity(this.playerEntity, 0, false);
|
||||
+ this.playerEntity = this.serverController.getConfigurationManager().recreatePlayerEntity(this.playerEntity, playerEntity.dimension, false);
|
||||
}
|
||||
|
||||
break;
|
||||
Reference in new issue
Block a user