Skip to content

Commit

Permalink
Drain Tricorder energy only when in survival (#2402)
Browse files Browse the repository at this point in the history
(cherry picked from commit 74272b2)
  • Loading branch information
YoungOnionMC authored and ALongStringOfNumbers committed Apr 24, 2024
1 parent d90e8c1 commit 10b6d30
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ public EnumActionResult onItemUseFirst(EntityPlayer player, World world, BlockPo

List<ITextComponent> info = getScannerInfo(player, world, pos);
if (player.isCreative() || drainEnergy(player.getHeldItem(hand), energyCost, true)) {
drainEnergy(player.getHeldItem(hand), energyCost, false);
if (!player.isCreative()) {
drainEnergy(player.getHeldItem(hand), energyCost, false);
}
for (ITextComponent line : info) {
player.sendMessage(line);
}
Expand Down

0 comments on commit 10b6d30

Please sign in to comment.