mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-12 20:23:51 +00:00
Sword blocking mechanics and interactoin locks (#1532)
- Fixed #1532 by makingthe blocking correctly reduces damage; per Java 1.8 mechs. - Fixed an attack going through while blocking. - Fixed a bug where you could mine while blocking. - Swing animation while blocking was overrided; per Java 1.8 mechs.
This commit is contained in:
parent
0fc2b5aa5b
commit
4b911b09b7
3 changed files with 31 additions and 5 deletions
|
|
@ -116,6 +116,8 @@ void MultiPlayerGameMode::startDestroyBlock(int x, int y, int z, int face)
|
|||
{
|
||||
if(!minecraft->player->isAllowedToMine()) return;
|
||||
|
||||
if(minecraft->player->isBlocking()) return;
|
||||
|
||||
if (localPlayerMode->isAdventureRestricted())
|
||||
{
|
||||
if (!minecraft->player->mayDestroyBlockAt(x, y, z))
|
||||
|
|
@ -181,6 +183,13 @@ void MultiPlayerGameMode::stopDestroyBlock()
|
|||
void MultiPlayerGameMode::continueDestroyBlock(int x, int y, int z, int face)
|
||||
{
|
||||
if(!minecraft->player->isAllowedToMine()) return;
|
||||
if(minecraft->player->isBlocking())
|
||||
{
|
||||
isDestroying = false;
|
||||
destroyProgress = 0;
|
||||
minecraft->level->destroyTileProgress(minecraft->player->entityId, xDestroyBlock, yDestroyBlock, zDestroyBlock, -1);
|
||||
return;
|
||||
}
|
||||
ensureHasSentCarriedItem();
|
||||
// connection.send(new PlayerActionPacket(PlayerActionPacket.CONTINUE_DESTROY_BLOCK, x, y, z, face));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue