private void onMouseClick(int var1) {
		if(var1 != 0 || this.blockHitTime <= 0) {
			HeldBlock var2;
			if(var1 == 0) {
				var2 = this.renderer.heldBlock;
				this.renderer.heldBlock.offset = -1;
				var2.moving = true;
			}

			int var3;
			if(var1 == 1 && (var3 = this.player.inventory.getSelected()) > 0 && this.gamemode.useItem(this.player, var3)) {
				var2 = this.renderer.heldBlock;
				this.renderer.heldBlock.pos = 0.0F;
			} else if(this.selected == null) {
				if(var1 == 0 && !(this.gamemode instanceof CreativeGameMode)) {
					this.blockHitTime = 10;
				}

			} else {
				if(this.selected.entityPos == 1) {
					if(var1 == 0) {
						this.selected.entity.hurt(this.player, 4);
						return;
					}
				} else if(this.selected.entityPos == 0) {
					var3 = this.selected.x;
					int var4 = this.selected.y;
					int var5 = this.selected.z;
					if(var1 != 0) {
						if(this.selected.face == 0) {
							--var4;
						}

						if(this.selected.face == 1) {
							++var4;
						}

						if(this.selected.face == 2) {
							--var5;
						}

						if(this.selected.face == 3) {
							++var5;
						}

						if(this.selected.face == 4) {
							--var3;
						}

						if(this.selected.face == 5) {
							++var3;
						}
					}

					Block var6 = Block.blocks[this.level.getTile(var3, var4, var5)];
					if(var1 == 0) {
						if(var6 != Block.BEDROCK || this.player.userType >= 100) {
							this.gamemode.hitBlock(var3, var4, var5);
							return;
						}
					} else {
						int var10;
						if((var10 = this.player.inventory.getSelected()) <= 0) {
							return;
						}

						Block var8;
						AABB var9;
						if(((var8 = Block.blocks[this.level.getTile(var3, var4, var5)]) == null || var8 == Block.WATER || var8 == Block.STATIONARY_WATER || var8 == Block.LAVA || var8 == Block.STATIONARY_LAVA) && ((var9 = Block.blocks[var10].getCollisionBox(var3, var4, var5)) == null || (this.player.bb.intersects(var9)?false:this.level.isFree(var9)))) {
							if(!this.gamemode.canPlace(var10)) {
								return;
							}

							if(this.isOnline()) {
								this.networkManager.sendBlockChange(var3, var4, var5, var1, var10);
							}

							this.level.netSetTile(var3, var4, var5, var10);
							var2 = this.renderer.heldBlock;
							this.renderer.heldBlock.pos = 0.0F;
							Block.blocks[var10].onPlace(this.level, var3, var4, var5);
						}
					}
				}

			}
		}
	}