-
Notifications
You must be signed in to change notification settings - Fork 219
TFM 5.0.2 Release #2176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devel
Are you sure you want to change the base?
TFM 5.0.2 Release #2176
Changes from all commits
0797702
239b637
a19f554
13ca59c
28e4cf9
4ce62c3
af1c820
8fdd377
3452c1e
af850e6
c1c333e
bc722b3
0c5cafb
264f862
5700d25
ab0a38c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| language: java | ||
| dist: trusty | ||
| jdk: | ||
| - oraclejdk8 | ||
| notifications: | ||
|
|
||
| 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() | ||
| { | ||
| } | ||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need a separate service for loading this list. Especially since we're never adding to it. You can simply use
ConfigEntry.BLOCKED_TAGS.getList()anywhere you need it. Lookup should be pretty fast and without I/O.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just going to go and facepalm. Apparently I decided over-engineering it was the best way. Thanks for the heads up, I'll make appropriate changes.