()
| 1530 | } |
| 1531 | |
| 1532 | private void clickMouse() |
| 1533 | { |
| 1534 | if (this.clickMouseEnabled && this.leftClickCounter <= 0) |
| 1535 | { |
| 1536 | AttackOrder.sendConditionalSwing(this.objectMouseOver); |
| 1537 | |
| 1538 | if (this.objectMouseOver == null) |
| 1539 | { |
| 1540 | logger.error("Null returned as \'hitResult\', this shouldn\'t happen!"); |
| 1541 | |
| 1542 | if (this.playerController.isNotCreative()) |
| 1543 | { |
| 1544 | this.leftClickCounter = 10; |
| 1545 | } |
| 1546 | } |
| 1547 | else |
| 1548 | { |
| 1549 | switch (this.objectMouseOver.typeOfHit) |
| 1550 | { |
| 1551 | case ENTITY: |
| 1552 | AttackOrder.sendFixedAttack(this.thePlayer, this.objectMouseOver.entityHit); |
| 1553 | break; |
| 1554 | |
| 1555 | case BLOCK: |
| 1556 | BlockPos blockpos = this.objectMouseOver.getBlockPos(); |
| 1557 | |
| 1558 | if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air) |
| 1559 | { |
| 1560 | this.playerController.clickBlock(blockpos, this.objectMouseOver.sideHit); |
| 1561 | break; |
| 1562 | } |
| 1563 | |
| 1564 | case MISS: |
| 1565 | default: |
| 1566 | if (this.playerController.isNotCreative()) |
| 1567 | { |
| 1568 | this.leftClickCounter = 10; |
| 1569 | } |
| 1570 | } |
| 1571 | } |
| 1572 | } |
| 1573 | } |
| 1574 | |
| 1575 | @SuppressWarnings("incomplete-switch") |
| 1576 |
no test coverage detected