Skip to content

Commit 15b1d6e

Browse files
Ant95thraaawn
authored andcommitted
Fix off-hand item used when right-clicking walls with PSD
1 parent 4c34e2d commit 15b1d6e

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/main/java/org/dave/compactmachines3/item/ItemPersonalShrinkingDevice.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player
6464
return new ActionResult(EnumActionResult.SUCCESS, stack);
6565
}
6666

67-
if(!world.isRemote && world.provider.getDimension() == ConfigurationHandler.Settings.dimensionId && player instanceof EntityPlayerMP) {
67+
if(!world.isRemote && player instanceof EntityPlayerMP) {
6868
EntityPlayerMP serverPlayer = (EntityPlayerMP)player;
6969

7070
if(player.isSneaking()) {
@@ -75,15 +75,12 @@ public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player
7575
TextComponentTranslation tc = new TextComponentTranslation("item.compactmachines3.psd.spawnpoint_set");
7676
tc.getStyle().setColor(TextFormatting.GREEN);
7777
player.sendStatusMessage(tc, false);
78-
79-
return new ActionResult(EnumActionResult.SUCCESS, stack);
78+
} else {
79+
TeleportationTools.teleportPlayerOutOfMachine(serverPlayer);
8080
}
81-
82-
TeleportationTools.teleportPlayerOutOfMachine(serverPlayer);
83-
return new ActionResult(EnumActionResult.SUCCESS, stack);
8481
}
8582

86-
return new ActionResult(EnumActionResult.FAIL, stack);
83+
return new ActionResult(EnumActionResult.SUCCESS, stack);
8784
}
8885

8986

0 commit comments

Comments
 (0)