Skip to content

Commit

Permalink
Minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
ALongStringOfNumbers committed Dec 20, 2022
1 parent 1de4842 commit 8d659a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/gregtech/api/items/toolitem/ToolHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public static void damageItem(ItemStack stack, EntityLivingBase entity, int dama
if (!(stack.getItem() instanceof IGTTool)) {
stack.damageItem(damage, entity);
} else {
if (stack.getTagCompound() != null && stack.getTagCompound().getBoolean("Unbreakable")) {
if (stack.getTagCompound() != null && stack.getTagCompound().getBoolean(UNBREAKABLE_KEY)) {
return;
}
IGTTool tool = (IGTTool) stack.getItem();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

public final class TreeFellingListener {

private static final int MAX_SCANS = 10;

private final EntityPlayerMP player;
private final ItemStack tool;
private final Deque<BlockPos> orderedBlocks;
Expand All @@ -48,13 +46,11 @@ public static void start(@Nonnull IBlockState state, ItemStack tool, BlockPos st
Block block = state.getBlock();
BlockPos.MutableBlockPos mutablePos = new BlockPos.MutableBlockPos();

int operations = 0;

Queue<BlockPos> checking = new ArrayDeque<>();
Set<BlockPos> visited = new ObjectOpenHashSet<>();
checking.add(start);

while (/*operations++ < MAX_SCANS &&*/ !checking.isEmpty()) {
while (!checking.isEmpty()) {
BlockPos check = checking.remove();
if (check != start) {
visited.add(check);
Expand Down

0 comments on commit 8d659a3

Please sign in to comment.