fix the wrench can break ME network using shift + right click.
This commit is contained in:
parent
77889845bf
commit
4f7a9f5237
|
@ -54,6 +54,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||
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;
|
||||
|
@ -102,6 +103,10 @@ public class PartPlacement
|
|||
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 ) );
|
||||
|
@ -423,6 +428,16 @@ public class PartPlacement
|
|||
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 )
|
||||
{
|
||||
|
@ -485,16 +500,6 @@ public class PartPlacement
|
|||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue