connection-lost / LockettePro

LockettePro - A much better Lockette plugin for Bukkit [1.8 - 1.12]
42 stars 59 forks source link

Disable in specific worlds #49

Open stan60250 opened 7 years ago

stan60250 commented 7 years ago

Added language Chinese(traditional) and disable in specific worlds feature.

ljacqu commented 7 years ago

-1

This repeats the same line of code over and over -> should be its own method

connection-lost commented 7 years ago

Its own method

The isLockable(Block block) and isLocked(Block block) method in LocketteProAPI.java to the rescue. We only need to add the world check code twice.

connection-lost commented 7 years ago

One more thing: What's with those "ignoreCancelled" you just added? Was that intentional?

stan60250 commented 7 years ago

Yes. I replaced if (event.isCancelled()) return; with @EventHandler(ignoreCancelled = true) It's same but is it much more easier? https://bukkit.org/threads/ignore-cancelled-events.61155/ https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/EventHandler.html

connection-lost commented 7 years ago

Ah I see.