Skip to content

Commit

Permalink
Remove unused state
Browse files Browse the repository at this point in the history
  • Loading branch information
Gegy committed Nov 4, 2023
1 parent 6d3485d commit 72d6ce5
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import it.unimi.dsi.fastutil.objects.ReferenceArraySet;
import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet;
import net.minecraft.server.level.ServerPlayer;
import net.minecraftforge.event.TickEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.eventbus.api.EventPriority;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

import java.util.*;
import java.util.Set;
import java.util.UUID;

@Mod.EventBusSubscriber(modid = LTPermissions.ID)
public final class ProtectionPlayerTracker {
Expand Down Expand Up @@ -97,15 +97,13 @@ private void updateTracker(final ServerPlayer player, final Tracker tracker) {
try {
lastBehaviors.addAll(tracker.behaviors);
tracker.behaviors.clear();
tracker.inside.clear();

final AuthorityMap<Authority> authorities = protection.selectWithBehavior(player.level().dimension());
if (authorities != null) {
final EventSource source = EventSource.forEntity(player);
for (final Authority authority : authorities) {
if (authority.eventFilter().accepts(source)) {
tracker.behaviors.add(authority.behavior().getBehavior());
tracker.inside.add(authority);
}
}
}
Expand Down Expand Up @@ -136,7 +134,6 @@ private void clearTracker(ServerPlayer player, UUID uuid) {
}

private static final class Tracker {
private final Set<Authority> inside = new ReferenceOpenHashSet<>();
private final Set<AuthorityBehavior> behaviors = new ReferenceArraySet<>();
private long lastBlockPos = -1;
}
Expand Down

0 comments on commit 72d6ce5

Please sign in to comment.