Skip to content

Commit

Permalink
Opt to reset time
Browse files Browse the repository at this point in the history
Because if you wait too long then the difficulty will increase based on time, and that isn't good :P
  • Loading branch information
Permanently committed Dec 30, 2020
1 parent b1c5c62 commit 4eab436
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.UUID;
import java.util.stream.Collectors;

import static com.yoonicode.minecraftmanhunt.PluginListener.wb;
import static com.yoonicode.minecraftmanhunt.PluginListener.world;
import static com.yoonicode.minecraftmanhunt.PluginListener.worldBorderModified;
import static org.bukkit.Bukkit.*;

Expand Down Expand Up @@ -274,10 +274,15 @@ public boolean onCommand(CommandSender commandSender, Command command, String la
}

if (worldBorderModified) {
WorldBorder wb = world.getWorldBorder();
wb.setCenter(0.5, 0.5);
wb.setSize(60000000);
}

if (main.getConfig().getBoolean("setTimeToZero", true)) {
world.setTime(0);
}

for (String i : main.spectators) {
Player player = Bukkit.getPlayer(i);
if (player == null) continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class PluginListener implements Listener {

boolean setRunnersToSpecOnDeath;
static boolean worldBorderModified = false;
static WorldBorder wb;
static World world;
PluginMain main;
public PluginListener(PluginMain main) {
this.main = main;
Expand Down Expand Up @@ -109,7 +109,8 @@ public void onPlayerEnterPortal(PlayerPortalEvent event){
public void onPlayerJoin(PlayerJoinEvent event){
if (!worldBorderModified && main.getConfig().getBoolean("preGameWorldBorder", false)) {
Location joinLoc = event.getPlayer().getLocation();
wb = event.getPlayer().getWorld().getWorldBorder();
world = event.getPlayer().getWorld();
WorldBorder wb = world.getWorldBorder();

wb.setDamageAmount(0);
wb.setWarningDistance(0);
Expand Down
2 changes: 2 additions & 0 deletions MinecraftManhunt/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ clearRunnerInvOnStart: false
clearHunterInvOnStart: false
# Set to true to clear all item drops when the game starts.
clearItemDropsOnStart: true
# Set to true to set the world time to 0 when the game starts.
setTimeToZero: true

# Set to true if you want a pre-game world border to be set before the game starts.
# This may be useful if you don't want a player exploring the world, prior ot starting.
Expand Down

0 comments on commit 4eab436

Please sign in to comment.