mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-16 01:23:52 +00:00
Merge b10b897a28 into 09df8928ee
This commit is contained in:
commit
962d91ae6b
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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