Skip to content

Commit

Permalink
Portable Tester doesn't have infinite uses anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
ellieisjelly committed Feb 12, 2024
1 parent 41b5748 commit 7332b7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class SabotageItems {
public static final Item SABOTAGE_CHEST = new PolymerBlockItem(SabotageBlocks.SABOTAGE_CHEST, new Item.Settings(), Items.CHEST);
public static final Item TESTER_WOOL = new PolymerBlockItem(SabotageBlocks.TESTER_WOOL, new Item.Settings(), Items.WHITE_WOOL);
public static final Item TESTER_SIGN = new TesterSign(new Item.Settings(), SabotageBlocks.TESTER_SIGN, SabotageBlocks.WALL_TESTER_SIGN);
public static final Item DETECTIVE_SHEARS = new DetectiveShears(new Item.Settings());
public static final Item DETECTIVE_SHEARS = new DetectiveShears(new Item.Settings().maxDamage(101));
public static final ItemGroup ITEM_GROUP = FabricItemGroup.builder()
.displayName(Text.translatable("gameType.sabotage.sabotage"))
.icon(SABOTAGE_CHEST::getDefaultStack)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public ActionResult useOnEntity(ItemStack item, PlayerEntity plr, LivingEntity e
World world = plr.getEntityWorld();
if (!world.isClient()) {
for (SabotageActive game : Sabotage.activeGames) {
if (game.getWorld().equals(world)) {
if (game.getWorld().equals(world) && (item.getMaxDamage() - item.getDamage()) > 1) {
item.setDamage(item.getDamage() + 50);
game.testEntity((ServerPlayerEntity) plr, entity);
break;
}
Expand Down

0 comments on commit 7332b7f

Please sign in to comment.