-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
662 additions
and
1,232 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
14 changes: 7 additions & 7 deletions
14
...llvdois/daynightpvp/events/JoinEvent.java → ...s/daynightpvp/Listeners/JoinListener.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
45 changes: 45 additions & 0 deletions
45
src/main/java/org/callvdois/daynightpvp/Listeners/ListenersHandler.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,45 @@ | ||
package org.callvdois.daynightpvp.Listeners; | ||
|
||
import org.bukkit.Bukkit; | ||
import org.bukkit.event.HandlerList; | ||
import org.callvdois.daynightpvp.DayNightPvP; | ||
import org.callvdois.daynightpvp.files.ConfigFile; | ||
|
||
public class ListenersHandler { | ||
|
||
private final ConfigFile configFile; | ||
|
||
public ListenersHandler() { | ||
configFile = new ConfigFile(); | ||
} | ||
|
||
public void register() { | ||
registerJoinListener(); | ||
registerEntityListener(); | ||
registerDeathListener(); | ||
} | ||
|
||
public void unregisterAll() { | ||
HandlerList.unregisterAll(DayNightPvP.getInstance()); | ||
} | ||
|
||
private void registerJoinListener() { | ||
if (configFile.getUpdateChecker()) { | ||
Bukkit.getPluginManager().registerEvents(new JoinListener(), DayNightPvP.getInstance()); | ||
} | ||
} | ||
|
||
private void registerEntityListener() { | ||
Bukkit.getPluginManager().registerEvents(new DamageListener(), DayNightPvP.getInstance()); | ||
} | ||
|
||
private void registerDeathListener() { | ||
boolean vaultLoseMoneyOnDeath = configFile.getVaultLoseMoneyOnDeathEnabled(); | ||
boolean keepInventoryWhenKilledByPlayer = configFile.getPvpKeepInventoryWhenKilledByPlayer(); | ||
|
||
if (vaultLoseMoneyOnDeath || keepInventoryWhenKilledByPlayer) { | ||
Bukkit.getPluginManager().registerEvents(new DeathListener(), DayNightPvP.getInstance()); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.