ActionResultType in onActivated

This commit is contained in:
Sebastian Hartte
2020-06-02 19:15:23 +02:00
parent 3e78c713d1
commit cf9ab8a13b
42 changed files with 135 additions and 181 deletions
@@ -79,7 +79,7 @@ public class PartPlacement
return ActionResultType.FAIL;
}
if( !held.isEmpty() && Platform.isWrench( player, held, pos ) && player.isShiftKeyDown() )
if( !held.isEmpty() && Platform.isWrench( player, held, pos ) && player.isCrouching() )
{
if( !Platform.hasPermissions( new DimensionalCoord( world, pos ), player ) )
{
@@ -200,7 +200,7 @@ public class PartPlacement
if( held.isEmpty() )
{
final Block block = world.getBlockState( pos ).getBlock();
if( host != null && player.isShiftKeyDown() && block != null )
if( host != null && player.isCrouching() && block != null )
{
final LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) );
final RayTraceResult mop = block.getRayTraceResult( world.getBlockState( pos ), world, pos, dir.getA(), dir.getB(), mop );
@@ -325,7 +325,7 @@ public class PartPlacement
if( sp.part != null )
{
if( !player.isShiftKeyDown() && sp.part.onActivate( player, hand, mop.hitVec ) )
if( !player.isCrouching() && sp.part.onActivate( player, hand, mop.hitVec ) )
{
return ActionResult.resultFail( null );
}
@@ -437,7 +437,7 @@ public class PartPlacement
boolean supportedItem = items.memoryCard().isSameAs( held );
supportedItem |= items.colorApplicator().isSameAs( held );
if( event.getPlayer().isShiftKeyDown() && !held.isEmpty() && supportedItem )
if( event.getPlayer().isCrouching() && !held.isEmpty() && supportedItem )
{
NetworkHandler.instance().sendToServer( new PacketClick( event.getPos(), event.getFace(), 0, 0, 0, event.getHand() ) );
}