feat: add all gamerules

This commit is contained in:
Simon Giesel 2020-05-07 17:11:13 +02:00
parent ef953d8c8f
commit 5ab70b7cb9
3 changed files with 71 additions and 36 deletions

View file

@ -4,6 +4,7 @@
"java.jdt.ls.vmargs": "-Dfile.encoding=UTF-8", "java.jdt.ls.vmargs": "-Dfile.encoding=UTF-8",
"java.configuration.updateBuildConfiguration": "automatic", "java.configuration.updateBuildConfiguration": "automatic",
"cSpell.words": [ "cSpell.words": [
"Aragur",
"Gamemode", "Gamemode",
"Gamerules", "Gamerules",
"Minecraft", "Minecraft",

View file

@ -66,10 +66,41 @@ public class Varo extends JavaPlugin {
getCommand("varo").setExecutor(new VaroCommand(this)); getCommand("varo").setExecutor(new VaroCommand(this));
for (World world : getServer().getWorlds()) { for (World world : getServer().getWorlds()) {
// world.setDifficulty(Difficulty.HARD); world.setDifficulty(Difficulty.HARD);
world.setDifficulty(Difficulty.PEACEFUL); // TODO: REMOVE AFTER DEBUG!!
world.setGameRule(GameRule.ANNOUNCE_ADVANCEMENTS, false); world.setGameRule(GameRule.ANNOUNCE_ADVANCEMENTS, false);
world.setGameRule(GameRule.COMMAND_BLOCK_OUTPUT, true);
world.setGameRule(GameRule.DISABLE_ELYTRA_MOVEMENT_CHECK, false);
world.setGameRule(GameRule.DISABLE_RAIDS, false);
world.setGameRule(GameRule.DO_DAYLIGHT_CYCLE, true);
world.setGameRule(GameRule.DO_ENTITY_DROPS, true);
world.setGameRule(GameRule.DO_FIRE_TICK, true);
world.setGameRule(GameRule.DO_INSOMNIA, false);
world.setGameRule(GameRule.DO_IMMEDIATE_RESPAWN, false);
world.setGameRule(GameRule.DO_LIMITED_CRAFTING, false);
world.setGameRule(GameRule.DO_MOB_LOOT, true);
world.setGameRule(GameRule.DO_MOB_SPAWNING, true);
world.setGameRule(GameRule.DO_PATROL_SPAWNING, true);
world.setGameRule(GameRule.DO_TILE_DROPS, true);
world.setGameRule(GameRule.DO_TRADER_SPAWNING, false);
world.setGameRule(GameRule.DO_WEATHER_CYCLE, true);
world.setGameRule(GameRule.DROWNING_DAMAGE, true);
world.setGameRule(GameRule.FALL_DAMAGE, true);
world.setGameRule(GameRule.FIRE_DAMAGE, true);
world.setGameRule(GameRule.KEEP_INVENTORY, false);
world.setGameRule(GameRule.LOG_ADMIN_COMMANDS, true);
world.setGameRule(GameRule.MOB_GRIEFING, true);
world.setGameRule(GameRule.NATURAL_REGENERATION, true);
world.setGameRule(GameRule.REDUCED_DEBUG_INFO, true); world.setGameRule(GameRule.REDUCED_DEBUG_INFO, true);
world.setGameRule(GameRule.SEND_COMMAND_FEEDBACK, true);
world.setGameRule(GameRule.SHOW_DEATH_MESSAGES, true);
world.setGameRule(GameRule.SPECTATORS_GENERATE_CHUNKS, false);
// DEBUG specific Settings
if (this.config.getBoolean("Varo.Debug")) {
world.setDifficulty(Difficulty.PEACEFUL);
world.setGameRule(GameRule.DO_DAYLIGHT_CYCLE, false);
world.setGameRule(GameRule.DO_WEATHER_CYCLE, false);
}
} }
getServer().removeRecipe(NamespacedKey.minecraft("fishing_rod")); getServer().removeRecipe(NamespacedKey.minecraft("fishing_rod"));
} }

View file

@ -50,43 +50,46 @@ public class PlayerJoinQuitListener implements Listener {
e.getPlayer().sendMessage("\n§7§l#### §9Cliffbreak.de - §lVaro §r§9Changelog §7§l####\n \n" e.getPlayer().sendMessage("\n§7§l#### §9Cliffbreak.de - §lVaro §r§9Changelog §7§l####\n \n"
+ " §cWarning: §r§c Plugin is running in DEBUG mode!\n "); + " §cWarning: §r§c Plugin is running in DEBUG mode!\n ");
final Stack<String> changes = new Stack<String>(); if (!(e.getPlayer().getName().equals("AragurLP") || e.getPlayer().getName().equals("AragurTV"))) {
changes.push(" §7• §r§lADD: §rAdd /varo portal to allow Operators to create a Portal"); final Stack<String> changes = new Stack<String>();
changes.push(" §7• §r§lADD: §rPlayers can't create Portals");
changes.push(" §7• §r§lADD: §rFakePlayer now drops his items and gets real player banned on death");
changes.push(" §7• §r§lADD: §rFakePlayer is no attackable (can also be killed)");
changes.push(" §7• §r§lADD: §rAdd a FakePlayer if Player is logged out");
changes.push(" §7• §r§lADD: §rAdd /varo test && /varo testremove");
changes.push(" §7• §r§lFIX: §r/varo Command is only usable by Server Operators now");
changes.push(
" §7• §r§lADD: §rDisallow special Items (Enchanted Golden Apple, Fishing Rod, Totem of Undying)");
changes.push(" §7• §r§lADD: §rUse Vanilla Hearts");
changes.push(" §7• §r§lADD: §rDisable Fishing Rod Crafting Recipe");
changes.push(" §7• §r§lFIX: §rCheck for Ban in AsyncPreLoginEvent");
changes.push(" §7• §r§lFIX: §rOnly kick player after Entity isn't ticking anymore");
changes.push(" §7• §r§lADD: §r/varo Command for Admins");
changes.push(" §7• §r§lADD: §rBan Player on Death");
changes.push(" §7• §r§lADD: §r1.8 Health Regeneration");
changes.push(" §7• §r§lADD: §rCustom Dynamic ServerListEntry");
changes.push(" §7• §r§lADD: §rControl Difficulty and Gamerules by the Plugin");
changes.push(" §7• §r§lADD: §rHover over Playername for Details (Team)");
changes.push(" §7• §r§lADD: §rRedesigned Chat with Timestamp");
new BukkitRunnable() { changes.push(" §7• §r§lADD: §rAdd /varo portal to allow Operators to create a Portal");
@Override changes.push(" §7• §r§lADD: §rPlayers can't create Portals");
public void run() { changes.push(" §7• §r§lADD: §rFakePlayer now drops his items and gets real player banned on death");
if (!e.getPlayer().isOnline()) { changes.push(" §7• §r§lADD: §rFakePlayer is no attackable (can also be killed)");
this.cancel(); changes.push(" §7• §r§lADD: §rAdd a FakePlayer if Player is logged out");
return; changes.push(" §7• §r§lADD: §rAdd /varo test && /varo testremove");
changes.push(" §7• §r§lFIX: §r/varo Command is only usable by Server Operators now");
changes.push(
" §7• §r§lADD: §rDisallow special Items (Enchanted Golden Apple, Fishing Rod, Totem of Undying)");
changes.push(" §7• §r§lADD: §rUse Vanilla Hearts");
changes.push(" §7• §r§lADD: §rDisable Fishing Rod Crafting Recipe");
changes.push(" §7• §r§lFIX: §rCheck for Ban in AsyncPreLoginEvent");
changes.push(" §7• §r§lFIX: §rOnly kick player after Entity isn't ticking anymore");
changes.push(" §7• §r§lADD: §r/varo Command for Admins");
changes.push(" §7• §r§lADD: §rBan Player on Death");
changes.push(" §7• §r§lADD: §r1.8 Health Regeneration");
changes.push(" §7• §r§lADD: §rCustom Dynamic ServerListEntry");
changes.push(" §7• §r§lADD: §rControl Difficulty and Gamerules by the Plugin");
changes.push(" §7• §r§lADD: §rHover over Playername for Details (Team)");
changes.push(" §7• §r§lADD: §rRedesigned Chat with Timestamp");
new BukkitRunnable() {
@Override
public void run() {
if (!e.getPlayer().isOnline()) {
this.cancel();
return;
}
if (changes.empty()) {
this.cancel();
return;
}
e.getPlayer().sendMessage(changes.pop());
} }
if (changes.empty()) { }.runTaskTimer(plugin, 20, 20);
this.cancel(); }
return;
}
e.getPlayer().sendMessage(changes.pop());
}
}.runTaskTimer(plugin, 20, 20);
} }
} }