mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-22 05:02:18 +00:00
33 lines
2.0 KiB
Plaintext
33 lines
2.0 KiB
Plaintext
++++ REJECTED PATCH 11
|
|
case BLOCK:
|
|
BlockPos blockpos = this.objectMouseOver.getBlockPos();
|
|
|
|
- if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air)
|
|
+ if (!this.theWorld.isAirBlock(blockpos))
|
|
{
|
|
int i = itemstack != null ? itemstack.stackSize : 0;
|
|
|
|
+
|
|
+ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(thePlayer, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, this.theWorld, blockpos, this.objectMouseOver.sideHit, this.objectMouseOver.hitVec).isCanceled();
|
|
+ if (result) { //Forge: Kept separate to simplify patch
|
|
if (this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, itemstack, blockpos, this.objectMouseOver.sideHit, this.objectMouseOver.hitVec))
|
|
{
|
|
flag = false;
|
|
this.thePlayer.swingItem();
|
|
}
|
|
+ }
|
|
|
|
if (itemstack == null)
|
|
{
|
|
++++ END PATCH
|
|
++++ REJECTED PATCH 12
|
|
{
|
|
ItemStack itemstack1 = this.thePlayer.inventory.getCurrentItem();
|
|
|
|
- if (itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1))
|
|
+ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(thePlayer, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_AIR, theWorld, null, null, null).isCanceled();
|
|
+ if (result && itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1))
|
|
{
|
|
this.entityRenderer.itemRenderer.resetEquippedProgress2();
|
|
}
|
|
++++ END PATCH |