Skip to content

Commit

Permalink
Merge branch 'main' into add-remaining-time
Browse files Browse the repository at this point in the history
  • Loading branch information
needkg committed Aug 28, 2024
2 parents df27fd3 + d9c38f5 commit 88c3fa3
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
</dependency>

<dependency>
<groupId>com.github.TechFortress</groupId>
<groupId>com.github.GriefPrevention</groupId>
<artifactId>GriefPrevention</artifactId>
<version>16.18.2</version>
<scope>provided</scope>
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/callv2/daynightpvp/DayNightPvP.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ public DayNightPvP() {

}

public static DayNightPvP getInstance() {
return instance;
}

@Override
public void onLoad() {
verifyCompatibilityPlugins();
Expand Down Expand Up @@ -79,10 +83,6 @@ public void onDisable() {
runnableHandler.stopAllRunnables();
}

public static DayNightPvP getInstance() {
return instance;
}

private void verifyCompatibilityPlugins() {
vaultIsPresent = PluginUtils.isPluginInstalled("Vault");
worldGuardIsPresent = PluginUtils.isPluginInstalled("WorldGuard");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/callv2/daynightpvp/files/ConfigFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -343,4 +343,4 @@ public boolean getGriefPreventionPvpInLand(String worldName) {
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class GriefPreventionHandler {

public boolean verify(Player damagedPlayer, Player damager) {
DataStore griefPrevention = GriefPrevention.instance.dataStore;
return griefPrevention.getClaimAt(damagedPlayer.getLocation(), true, null) != null || griefPrevention.getClaimAt(damager.getLocation(), true, null) != null;
return griefPrevention.getClaimAt(damagedPlayer.getLocation(), true, null) != null || griefPrevention.getClaimAt(damager.getLocation(), true, null) != null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ private boolean checkHooks(Player damagedPlayer, Player damager, String worldNam
if (DayNightPvP.worldGuardIsPresent && AllowDaytimePvpFlag.checkStateOnPosition(damagedPlayer) && AllowDaytimePvpFlag.checkStateOnPosition(damager)) {
return false;
}
if (WorldUtils.checkPlayerIsInWorld(damagedPlayer))
{
if (WorldUtils.checkPlayerIsInWorld(damagedPlayer)) {
if (configFile.getNotifyPlayersChatHitAnotherPlayerDuringDay(worldName)) {
damager.sendMessage(notifyPvpDisabled);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.callv2.daynightpvp.files.ConfigFile;
import org.callv2.daynightpvp.vault.LoseMoneyOnDeath;

public class DeathListener implements Listener {
public class DeathListener implements Listener {

private final ConfigFile configFile;
private final LoseMoneyOnDeath loseMoneyOnDeath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public RunnableHandler(ConfigFile configFile, LangFile langFile) {

public void startAllRunnables() {

for(String worldName : configFile.getWorlds()) {
for (String worldName : configFile.getWorlds()) {
if (WorldUtils.checkWorldIsValid(worldName)) {

if (configFile.getDayNightDurationEnabled(worldName)) {
Expand Down Expand Up @@ -138,7 +138,7 @@ public void stopAllRunnables() {
bossBar.removeAll();
}

for(String worldName : configFile.getWorlds()) {
for (String worldName : configFile.getWorlds()) {
if (WorldUtils.checkWorldIsValid(worldName)) {
Bukkit.getWorld(worldName).setGameRule(GameRule.DO_DAYLIGHT_CYCLE, true);
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ version: '${project.version}'
author: needkg
main: org.callv2.daynightpvp.DayNightPvP
api-version: '1.16'
softdepend: [PlaceholderAPI, GriefPrevention, Vault, WorldGuard]
softdepend: [ PlaceholderAPI, GriefPrevention, Vault, WorldGuard ]
load: POSTWORLD

commands:
daynightpvp:
description: "Show all available commands"
usage: "/dnp"
aliases: [dnp]
aliases: [ dnp ]
permission: dnp.admin
daynightpvp reload:
description: "Reload the plugin"
usage: "/dnp reload"
aliases: [dnp reload]
aliases: [ dnp reload ]
permission: dnp.admin
daynightpvp addworld:
description: "Adds a world to the configuration file"
usage: "/dnp addworld"
aliases: [dnp addworld]
aliases: [ dnp addworld ]
permission: dnp.admin
daynightpvp delworld:
description: "Deletes a world from the configuration file"
usage: "/dnp delworld"
aliases: [dnp delworld]
aliases: [ dnp delworld ]
permission: dnp.admin

permissions:
Expand Down

0 comments on commit 88c3fa3

Please sign in to comment.