Skip to content

Commit

Permalink
fix the wrench can break ME network using shift + right click.
Browse files Browse the repository at this point in the history
  • Loading branch information
xsun2001 committed Dec 31, 2017
1 parent 7788984 commit 4f7a9f5
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/main/java/appeng/parts/PartPlacement.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
import net.minecraftforge.event.world.BlockEvent;

import java.util.LinkedList;
import java.util.List;
Expand Down Expand Up @@ -102,6 +103,10 @@ public static boolean place( final ItemStack held, final int x, final int y, fin
final List<ItemStack> is = new LinkedList<ItemStack>();
final SelectedPart sp = selectPart( player, host, mop.hitVec.addVector( -mop.blockX, -mop.blockY, -mop.blockZ ) );

BlockEvent.BreakEvent event = new BlockEvent.BreakEvent( x, y, z, world, block, world.getBlockMetadata( x, y, z ), player );
MinecraftForge.EVENT_BUS.post(event);
if(event.isCanceled()) return true;

if( sp.part != null )
{
is.add( sp.part.getItemStack( PartItemStack.Wrench ) );
Expand Down Expand Up @@ -423,6 +428,16 @@ public static IFacadePart isFacade( final ItemStack held, final ForgeDirection s
return null;
}

private static float getEyeHeight()
{
return eyeHeight;
}

public static void setEyeHeight( final float eyeHeight )
{
PartPlacement.eyeHeight = eyeHeight;
}

@SubscribeEvent
public void playerInteract( final TickEvent.ClientTickEvent event )
{
Expand Down Expand Up @@ -485,16 +500,6 @@ else if( event.action == Action.RIGHT_CLICK_BLOCK && event.entityPlayer.worldObj
}
}

private static float getEyeHeight()
{
return eyeHeight;
}

public static void setEyeHeight( final float eyeHeight )
{
PartPlacement.eyeHeight = eyeHeight;
}

public enum PlaceType
{
PLACE_ITEM, INTERACT_FIRST_PASS, INTERACT_SECOND_PASS
Expand Down

0 comments on commit 4f7a9f5

Please sign in to comment.