-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes and improvements to the tag blocking process
This should fix the memory leak I suspect.
- Loading branch information
Showing
4 changed files
with
52 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/main/java/me/totalfreedom/totalfreedommod/blocking/PlayerBlocker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package me.totalfreedom.totalfreedommod.blocking; | ||
|
||
import com.google.common.collect.Lists; | ||
import me.totalfreedom.totalfreedommod.FreedomService; | ||
import me.totalfreedom.totalfreedommod.TotalFreedomMod; | ||
import me.totalfreedom.totalfreedommod.config.ConfigEntry; | ||
import me.totalfreedom.totalfreedommod.util.FLog; | ||
import me.totalfreedom.totalfreedommod.util.FUtil; | ||
import org.bukkit.ChatColor; | ||
import org.bukkit.Material; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.EventPriority; | ||
import org.bukkit.event.block.BlockPlaceEvent; | ||
import org.bukkit.inventory.ItemStack; | ||
|
||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
public class PlayerBlocker extends FreedomService | ||
{ | ||
|
||
public static final List<String> blockedTags = Lists.newArrayList(); | ||
|
||
public PlayerBlocker(TotalFreedomMod plugin) | ||
{ | ||
super(plugin); | ||
} | ||
|
||
@Override | ||
protected void onStart() | ||
{ | ||
// Load banned tags | ||
blockedTags.clear(); | ||
blockedTags.addAll((Collection<? extends String>) ConfigEntry.BLOCKED_TAGS.getList()); | ||
FLog.info("Loaded " + blockedTags.size() + " banned tags."); | ||
} | ||
|
||
@Override | ||
protected void onStop() | ||
{ | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters