mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-19 11:53: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
|
|
@ -1279,6 +1279,12 @@ void LocalPlayer::handleMouseDown(int button, bool down)
|
|||
if (!down) missTime = 0;
|
||||
if (button == 0 && missTime > 0) return;
|
||||
|
||||
if (isBlocking())
|
||||
{
|
||||
minecraft->gameMode->stopDestroyBlock();
|
||||
return;
|
||||
}
|
||||
|
||||
if (down && minecraft->hitResult != nullptr && minecraft->hitResult->type == HitResult::TILE && button == 0)
|
||||
{
|
||||
int x = minecraft->hitResult->x;
|
||||
|
|
@ -1476,7 +1482,7 @@ bool LocalPlayer::handleMouseClick(int button)
|
|||
bool returnItemPlaced = false;
|
||||
|
||||
if (button == 0 && missTime > 0) return false;
|
||||
if (button == 0)
|
||||
if (button == 0 && !isBlocking())
|
||||
{
|
||||
//app.DebugPrintf("handleMouseClick - Player %d is swinging\n",GetXboxPad());
|
||||
swing();
|
||||
|
|
@ -1510,7 +1516,7 @@ bool LocalPlayer::handleMouseClick(int button)
|
|||
}
|
||||
else if (minecraft->hitResult->type == HitResult::ENTITY)
|
||||
{
|
||||
if (button == 0)
|
||||
if (button == 0 && !isBlocking())
|
||||
{
|
||||
minecraft->gameMode->attack(minecraft->localplayers[GetXboxPad()], minecraft->hitResult->entity);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue