ST25P4BNKEUOEE7LZDQIYZYJ5YDLZH7W7MXNFTOV5UXPO6TY6WAQC
4XF57XP4D3A3PB3P33FTM2PSTUVN5S6PZAFYQW3ZB4NBUJ7FGMYAC
E47ITWNH66F6LUYLYDYXWAIDCWRBKSEOYZVIEBPNWTPDLITB2WMAC
C7DCAFONCSK5UGE6DJGOEGZORIUSHGBOVLCOYI223IHDHNCXV34AC
TYAKLNHVG66RHRVN53OOF4FVPAY2P3D4GSMMUSWLY2XA6A5I6PQAC
56BXTCJXCGNVEF6FYB4JB3QY4IM5O4BPG3ZOYEGX4RH3CGQ52PBAC
TIIF4XCJZOH2HTF2BUCEPKY5VPL4BHESCVLQQGGX3L4V4YIO5U4QC
KEYYAOAFLRUJZZEVL5WGPUZEIT7W67P3RWKX6LM5ZLWHMCEPWH4QC
SWJCNHIWVYQ53PSMSLVQJXRAEJB6B4JQGSJ4PX3VCWHYQV4JX2UQC
WZDPQH7HT32TS2SANLKAHMDWAD7TJRODADM5IL3UENMQPFTLBCZAC
Y6ZVQ4IMQMZZL6PFUPIVKRDT66JY2YMZ2IBOVDDBHUKLCYD2E7SQC
ULITSNHA2I27MUVBHJ7T7Y6JMZNF7XGJV6OSY5YHWUH7DF3BUI6AC
package ua.com.minersstudios.whomine.util;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.logging.Level;
public final class Plugin extends JavaPlugin
{
/**
* Ensure that required plugins are installed on a server, if not - disable itself.
*/
@Override
public void onEnable()
{
ArrayList<String> expected_plugins_names = new ArrayList<>(Arrays.asList(
"AuthMe", "ProtocolLib", "DiscordSRV"
));
for (String p : expected_plugins_names)
{
if (getServer().getPluginManager().getPlugin(p) == null)
{
getLogger().log(Level.SEVERE, "Required dependencies unsatisfied.");
getServer().getPluginManager().disablePlugin(this);
getLogger().log(Level.WARNING, "Am I still running?"); // Debug
break;
}
}
}
}
import org.bukkit.World;
import org.bukkit.WorldCreator;
import org.bukkit.WorldType;
import net.kyori.adventure.util.TriState;
import org.bukkit.generator.BiomeProvider;
import org.bukkit.block.Biome;
import org.bukkit.generator.WorldInfo;
import org.bukkit.generator.ChunkGenerator;
import org.bukkit.Difficulty;
import java.util.List;
import java.util.ArrayList;
import static org.bukkit.GameRule.*;
public static World initialiseWorldDark()
{
String name = "world_dark";
World world = new WorldCreator(name)
.type(WorldType.FLAT)
.environment(World.Environment.NORMAL)
.biomeProvider(new BiomeProvider()
{
@Override
public @NonNull Biome getBiome(
@NonNull WorldInfo worldInfo,
int x, int y, int z)
{ return Biome.FOREST; }
@Override
public @NonNull List<Biome> getBiomes(@NonNull WorldInfo worldInfo)
{ return new ArrayList<>(); }
})
.generator(new ChunkGenerator() {})
.generateStructures(false)
.hardcore(false)
.keepSpawnLoaded(TriState.TRUE)
.createWorld();
assert world != null;
// Set the enviornment.
world.setTime(18000L);
world.setDifficulty(Difficulty.PEACEFUL);
world.setGameRule(FALL_DAMAGE, false);
world.setGameRule(FIRE_DAMAGE, false);
world.setGameRule(FREEZE_DAMAGE, false);
world.setGameRule(DROWNING_DAMAGE, false);
world.setGameRule(DO_DAYLIGHT_CYCLE, false);
world.setGameRule(DO_WEATHER_CYCLE, false);
world.setGameRule(SHOW_DEATH_MESSAGES, false);
world.setGameRule(KEEP_INVENTORY, true);
return world;
}
public static WorldDark world_dark = new WorldDark();
/**
* @return a single instance of the class
*/
@Getter
private static MSUtil instance = new MSUtil();
/**
* Ensure that required plugins are installed on a server, if not - disable itself.
*/
@Override
public void onEnable()
{
ArrayList<String> expected_plugins_names = new ArrayList<>(Arrays.asList(
"AuthMe", "ProtocolLib", "DiscordSRV"
));
for (String p : expected_plugins_names)
{
if (getServer().getPluginManager().getPlugin(p) == null)
{
getLogger().log(Level.SEVERE, "Required dependencies unsatisfied.");
getServer().getPluginManager().disablePlugin(instance);
getLogger().log(Level.WARNING, "Am I still running?"); // Debug
break;
}
}
}
/**
* @return a reference to an object representing World Dark
*/
@Getter
private static World world_dark = WorldDark.initialiseWorldDark();