MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / clickMouse

Method clickMouse

src/main/java/net/minecraft/client/Minecraft.java:1532–1573  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

runTickMethod · 0.95

Calls 9

sendConditionalSwingMethod · 0.95
sendFixedAttackMethod · 0.95
isNotCreativeMethod · 0.80
getBlockPosMethod · 0.65
getBlockMethod · 0.65
getBlockStateMethod · 0.65
errorMethod · 0.45
getMaterialMethod · 0.45
clickBlockMethod · 0.45

Tested by

no test coverage detected