-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Released version 1.2 (Added config and command)
- Loading branch information
Showing
6 changed files
with
155 additions
and
26 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
24 changes: 24 additions & 0 deletions
24
src/main/java/xyz/alicedtrh/safetyblanket/EarlyExpireSafetyBlanketTask.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,24 @@ | ||
package xyz.alicedtrh.safetyblanket; | ||
|
||
import org.bukkit.entity.Player; | ||
import org.bukkit.scheduler.BukkitRunnable; | ||
|
||
public class EarlyExpireSafetyBlanketTask extends BukkitRunnable { | ||
|
||
private final Player player; | ||
|
||
public EarlyExpireSafetyBlanketTask(Player player) { | ||
this.player = player; | ||
} | ||
|
||
/** | ||
* Re-enable enemy spawns. | ||
*/ | ||
@Override | ||
public void run() { | ||
if (player.isValid() && player.isOnline() && player.getAffectsSpawning()) { | ||
player.sendMessage("Enemy spawns now occur like normal."); | ||
player.setAffectsSpawning(false); | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
src/main/java/xyz/alicedtrh/safetyblanket/SafetyBlanketConfig.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,43 @@ | ||
package xyz.alicedtrh.safetyblanket; | ||
|
||
import redempt.redlib.config.annotations.Comment; | ||
|
||
public class SafetyBlanketConfig { | ||
@Comment("(c) AliceDTRH 2022") | ||
|
||
@Comment("This is used to keep track of the configuration file version, please don't touch it.") | ||
public static String config_version = "1.2.0"; | ||
|
||
@Comment("This is used to debug the plugin, I suggest you don't touch this unless I specifically ask you to.") | ||
public static boolean DEBUG = false; | ||
@Comment("You can touch things below: ") | ||
@Comment("The amount of time in milliseconds that a user will be considered new to the server. (Default: 900000 - Which means 15 minutes)") | ||
public static int NEW_PLAYER_DURATION = 900000; | ||
|
||
@Comment("Should mobs target new users? Enemies will still target new users when attacked in most cases. (Default: true)") | ||
public static boolean PREVENT_TARGETING = true; | ||
|
||
@Comment("Should mobs spawns be prevented near new users? (Default: true)") | ||
public static boolean PREVENT_MOB_SPAWNS = true; | ||
|
||
@Comment("Should we decrease fall damage for new users? (Default: true)") | ||
public static boolean DECREASE_FALL_DAMAGE = true; | ||
|
||
@Comment("How much should we decrease fall damage by? (Default: 0.65 - which means 65%)") | ||
@Comment("Example: 10 half hearts of damage * 0.65 = 6.5 half hearts of damage") | ||
public static double FALL_DAMAGE_REDUCTION_PERCENT = 0.65; | ||
|
||
@Comment("Should we give new users an ambient regeneration effect? (Default: true)") | ||
public static boolean REGEN_BOOST = true; | ||
|
||
@Comment("Should we re-enable mob spawns early? (Default: true)") | ||
public static boolean EARLY_MOB_SPAWN_DISABLE = true; | ||
|
||
@Comment("How far along the new user path should we re-enable mob spawns? (Default: 0.5 - which means 50%)") | ||
public static double EARLY_MOB_SPAWN_DISABLE_PERCENT = 0.5; | ||
|
||
@Comment("Disable the nag about using /reload (Default: false)") | ||
public static boolean I_WONT_COMPLAIN_WHEN_EVERYTHING_BREAKS = false; | ||
|
||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
disableuserblanket player:arg { | ||
permission safetyblanket.admin | ||
help This lets you forcefully disable the blanket for a user. | ||
hook disableuserblanket | ||
} |