new settings moved

This commit is contained in:
gnembon committed 2019-06-11 20:24:22 -03:00
1 parent 8ddef0ce6a
commit 79495eccd0
2 files changed
+199 -135

No files matched your search

+192 -135
View File
@@ -1,6 +1,11 @@
package carpet.settings; package carpet.settings;
import carpet.CarpetServer;
import carpet.fakes.MinecraftServer_motdInterface;
import carpet.utils.Messenger;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.dedicated.DedicatedServer;
import static carpet.settings.RuleCategory.BUGFIX; import static carpet.settings.RuleCategory.BUGFIX;
import static carpet.settings.RuleCategory.COMMANDS; import static carpet.settings.RuleCategory.COMMANDS;
@@ -28,10 +33,7 @@ public class Settings
) )
public static boolean portalSuffocationFix = false; public static boolean portalSuffocationFix = false;
@Rule( @Rule(desc = "Gbhs sgnf sadsgras fhskdpri!", category = EXPERIMENTAL)
desc = "Gbhs sgnf sadsgras fhskdpri!",
category = EXPERIMENTAL,
)
public static boolean superSecretSetting = false; public static boolean superSecretSetting = false;
@Rule( @Rule(
@@ -41,23 +43,16 @@ public class Settings
) )
public static boolean portalCreativeDelay = false; public static boolean portalCreativeDelay = false;
@Rule(desc = "Dropping entire stacks works also from on the crafting UI result slot", category = {BUGFIX, SURVIVAL})
@Rule(
desc = "Dropping entire stacks works also from on the crafting UI result slot",
category = {BUGFIX, SURVIVAL}
)
public static boolean ctrlQCraftingFix = false; public static boolean ctrlQCraftingFix = false;
@Rule( @Rule(
desc = "Parrots don't get of your shoulders until you receive damage", desc = "Parrots don't get of your shoulders until you receive damage",
extra = "",
category = {SURVIVAL, FEATURE}, category = {SURVIVAL, FEATURE},
validate = Validator.WIP.class validate = Validator.WIP.class
) )
public static boolean persistentParrots = false; public static boolean persistentParrots = false;
/*@Rule( /*@Rule(
desc = "Mobs growing up won't glitch into walls or go through fences", desc = "Mobs growing up won't glitch into walls or go through fences",
category = BUGFIX, category = BUGFIX,
@@ -65,7 +60,6 @@ public class Settings
) )
public static boolean growingUpWallJump = false; public static boolean growingUpWallJump = false;
@Rule( @Rule(
desc = "Won't let mobs glitch into blocks when reloaded.", desc = "Won't let mobs glitch into blocks when reloaded.",
extra = "Can cause slight differences in mobs behaviour", extra = "Can cause slight differences in mobs behaviour",
@@ -75,16 +69,12 @@ public class Settings
public static boolean reloadSuffocationFix = false; public static boolean reloadSuffocationFix = false;
*/ */
@Rule( desc = "Players absorb XP instantly, without delay", category = CREATIVE ) @Rule( desc = "Players absorb XP instantly, without delay", category = CREATIVE )
public static boolean xpNoCooldown = false; public static boolean xpNoCooldown = false;
@Rule( desc = "XP orbs combine with other into bigger orbs", category = FEATURE ) @Rule( desc = "XP orbs combine with other into bigger orbs", category = FEATURE )
public static boolean combineXPOrbs = false; public static boolean combineXPOrbs = false;
@Rule( @Rule(
desc = "Empty shulker boxes can stack to 64 when dropped on the ground", desc = "Empty shulker boxes can stack to 64 when dropped on the ground",
extra = "To move them around between inventories, use shift click to move entire stacks", extra = "To move them around between inventories, use shift click to move entire stacks",
@@ -92,7 +82,6 @@ public class Settings
) )
public static boolean stackableShulkerBoxes = false; public static boolean stackableShulkerBoxes = false;
@Rule( desc = "Explosions won't destroy blocks", category = CREATIVE ) @Rule( desc = "Explosions won't destroy blocks", category = CREATIVE )
public static boolean explosionNoBlockDamage = false; public static boolean explosionNoBlockDamage = false;
@@ -107,21 +96,13 @@ public class Settings
) )
public static boolean fastRedstoneDust = false; public static boolean fastRedstoneDust = false;
@Rule( @Rule(desc = "Only husks spawn in desert temples", category = FEATURE, validate = Validator.WIP.class)
desc = "Only husks spawn in desert temples",
category = FEATURE,
validate = Validator.WIP.class
)
public static boolean huskSpawningInTemples = false; public static boolean huskSpawningInTemples = false;
@Rule( desc = "Shulkers will respawn in end cities", category = FEATURE ) @Rule( desc = "Shulkers will respawn in end cities", category = FEATURE )
public static boolean shulkerSpawningInEndCities = false; public static boolean shulkerSpawningInEndCities = false;
@Rule( @Rule(desc = "Entities pushed or moved into unloaded chunks no longer disappear", category = {EXPERIMENTAL, BUGFIX}, validate = Validator.WIP.class)
desc = "Entities pushed or moved into unloaded chunks no longer disappear",
category = {EXPERIMENTAL, BUGFIX},
validate = Validator.WIP.class
)
public static boolean unloadedEntityFix = false; public static boolean unloadedEntityFix = false;
@Rule( desc = "TNT doesn't update when placed against a power source", category = CREATIVE ) @Rule( desc = "TNT doesn't update when placed against a power source", category = CREATIVE )
@@ -135,11 +116,7 @@ public class Settings
) )
public static boolean antiCheatSpeed = false; public static boolean antiCheatSpeed = false;
@Rule( @Rule(desc = "Pistons, droppers and dispensers react if block above them is powered", category = CREATIVE, validate = Validator.WIP.class)
desc = "Pistons, droppers and dispensers react if block above them is powered",
category = CREATIVE,
validate = Validator.WIP.class
)
public static boolean quasiConnectivity = true; public static boolean quasiConnectivity = true;
@Rule( @Rule(
@@ -180,134 +157,214 @@ public class Settings
@Rule( desc = "summoning a lightning bolt has all the side effects of natural lightning", category = CREATIVE ) @Rule( desc = "summoning a lightning bolt has all the side effects of natural lightning", category = CREATIVE )
public static boolean summonNaturalLightning = false; public static boolean summonNaturalLightning = false;
@Rule(desc = "Enables /spawn command for spawn tracking", category = COMMANDS)
public static boolean commandSpawn = true;
@Rule(desc = "Enables /tick command to control game clocks", category = COMMANDS)
public static boolean commandTick = true;
@Rule(desc = "Enables /log command to monitor events in the game via chat and overlays", category = COMMANDS)
public static boolean commandLog = true;
@Rule( @Rule(
desc = "", desc = "Enables /distance command to measure in game distance between points",
category = CREATIVE, extra = "Also enables brown carpet placement action if 'carpets' rule is turned on as well",
validate = Validator.WIP.class category = COMMANDS
) )
public static boolean aaa = false; public static boolean commandDistance = true;
@Rule( @Rule(
desc = "", desc = "Enables /info command for blocks",
category = CREATIVE, extra = {
validate = Validator.WIP.class "Also enables gray carpet placement action",
"if 'carpets' rule is turned on as well"
},
category = COMMANDS
) )
public static boolean aaa = false; public static boolean commandInfo = true;
@Rule( @Rule(
desc = "", desc = "Enables /c and /s commands to quickly switch between camera and survival modes",
category = CREATIVE, extra = "/c and /s commands are available to all players regardless of their permission levels",
validate = Validator.WIP.class category = COMMANDS
)
public static boolean aaa = false;
@Rule(
desc = "",
category = CREATIVE,
validate = Validator.WIP.class
)
public static boolean aaa = false;
@Rule(
desc = "",
category = CREATIVE,
validate = Validator.WIP.class
)
public static boolean aaa = false;
@Rule(
desc = "",
category = CREATIVE,
validate = Validator.WIP.class
)
public static boolean aaa = false;
@Rule(
desc = "Enables /c and /s commands to quickly switch between camera and survival modes",
extra = "/c and /s commands are available to all players regardless of their permission levels",
category = COMMANDS
) )
public static boolean commandCameramode = true; public static boolean commandCameramode = true;
@Rule(
desc = "Enables /perimeterinfo command",
extra = "... that scans the area around the block for potential spawnable spots",
category = COMMANDS
)
public static boolean commandPerimeterInfo = true;
@Rule(desc = "Enables /draw commands", extra = "... allows for drawing simple shapes", category = COMMANDS)
public static boolean commandDraw = true;
@Rule(desc = "Enables /script command", extra = "an in-game scripting API", category = COMMANDS)
public static boolean commandScript = true;
@Rule(desc = "Enables /player command to control/spawn players", category = COMMANDS, validate = Validator.WIP.class)
public static boolean commandPlayer = true;
@Rule(desc = "Placing carpets may issue carpet commands for non-op players", category = SURVIVAL)
public static boolean carpets = false;
@Rule(
desc = "Pistons, Glass and Sponge can be broken faster with their appropriate tools",
category = SURVIVAL,
validate = Validator.WIP.class
)
public static boolean missingTools = false;
@Rule(desc = "Alternative, persistent caching strategy for nether portals", category = {SURVIVAL, CREATIVE})
public static boolean portalCaching = false;
@Rule(desc = "Permanent fires don't schedule random updates", category = OPTIMIZATIONS, validate = Validator.WIP.class)
public static boolean calmNetherFires = false;
@Rule(desc = "fill/clone/setblock and structure blocks cause block updates", category = CREATIVE) @Rule(desc = "fill/clone/setblock and structure blocks cause block updates", category = CREATIVE)
public static boolean fillUpdates = true; public static boolean fillUpdates = true;
private class PushLimitLimits extends Validator<Integer> {
private static class CheckFillLimitLimits extends Validator<Integer> @Override Integer validate(ServerCommandSource source, ParsedRule<Integer> currentRule, Integer newValue, String string) {
{ return (newValue>0 && newValue < 1024) ? newValue : null;
@Override
Integer validate(ServerCommandSource source, ParsedRule<Integer> currentRule, Integer newValue, String typedString)
{
return newValue < 20000000 ? newValue : null;
} }
} }
@Rule( @Rule(
desc = "Customizable fill/clone volume limit", desc = "Customizable piston push limit",
options = {"32768", "250000", "1000000"}, options = {"10", "12", "14", "100"},
validate = {Validator.POSITIVE_NUMBER.class, CheckFillLimitLimits.class}, category = CREATIVE,
category = {CREATIVE, "skyblock"} validate = PushLimitLimits.class
)
public static int pushLimit = 12;
@Rule(
desc = "Customizable powered rail power range",
options = {"9", "15", "30"},
category = CREATIVE,
validate = PushLimitLimits.class
)
public static int railPowerLimit = 9;
private class FillLimitLimits extends Validator<Integer> {
@Override Integer validate(ServerCommandSource source, ParsedRule<Integer> currentRule, Integer newValue, String string) {
return (newValue>0 && newValue < 20000000) ? newValue : null;
}
}
@Rule(
desc = "Customizable fill/clone volume limit",
options = {"32768", "250000", "1000000"},
category = CREATIVE,
validate = FillLimitLimits.class
) )
public static int fillLimit = 32768; public static int fillLimit = 32768;
@Rule( @Rule(
desc = "Hoppers pointing to wool will count items passing through them", desc = "Customizable maximal entity collision limits, 0 for no limits",
extra = { options = {"0", "1", "20"},
"Enables /counter command, and actions while placing red and green carpets on wool blocks", category = OPTIMIZATIONS,
"Use /counter <color?> reset to reset the counter, and /counter <color?> to query", validate = Validator.NONNEGATIVE_NUMBER.class
"In survival, place green carpet on same color wool to query, red to reset the counters",
"Counters are global and shared between players, 16 channels available",
"Items counted are destroyed, count up to one stack per tick per hopper"
},
category = COMMANDS
) )
public static boolean hopperCounters = false; public static int maxEntityCollisions = 0;
@Rule(desc = "Explosions won't destroy blocks", category = CREATIVE) @Rule(desc = "One player is required on the server to cause night to pass", category = SURVIVAL)
public static boolean explosionNoBlockDamage = false; public static boolean onePlayerSleeping = false;
private class SetMotd extends Validator<String> {
@Override String validate(ServerCommandSource source, ParsedRule<String> currentRule, String newValue, String string) {
customMOTD = newValue; // accelerate a smidge
((MinecraftServer_motdInterface) CarpetServer.minecraft_server).checkMOTD();
return newValue;
}
}
@Rule(
desc = "Sets a different motd message on client trying to connect to the server",
extra = "use '_' to use the startup setting from server.properties",
options = "_",
category = CREATIVE,
validate = {SetMotd.class, Validator.WIP.class} // for some reason doesn't yet work
)
public static String customMOTD = "_";
@Rule(desc = "Cactus in dispensers rotates blocks.", extra = "Rotates block anti-clockwise if possible", category = FEATURE)
public static boolean rotatorBlock = false;
private class ViewDistanceValidator extends Validator<Integer>
{
@Override Integer validate(ServerCommandSource source, ParsedRule<Integer> currentRule, Integer newValue, String string)
{
if (newValue < 0 || newValue > 32)
{
Messenger.m(source, "r view distance has to be between 0 and 32");
return null;
}
MinecraftServer server = source.getMinecraftServer();
if (server.isDedicated())
{
int vd = (newValue >= 2)?newValue:((DedicatedServer) server).getProperties().viewDistance;
if (vd != CarpetServer.minecraft_server.getPlayerManager().getViewDistance())
CarpetServer.minecraft_server.getPlayerManager().setViewDistance(vd);
return newValue;
}
else
{
Messenger.m(source, "r view distance can only be changed on a server");
return 0;
}
}
}
@Rule(
desc = "Changes the view distance of the server.",
extra = "Set to 0 to not override the value in server settings.",
options = {"0", "12", "16", "32"},
category = CREATIVE,
validate = ViewDistanceValidator.class
)
public static int viewDistance = 0;
private class DisableSpawnChunksValidator extends Validator<Boolean> {
@Override Boolean validate(ServerCommandSource source, ParsedRule<Boolean> currentRule, Boolean newValue, String string) {
if (!newValue)
Messenger.m(source, "w Spawn chunks re-enabled. Visit spawn to load them?");
return newValue;
}
}
@Rule(
desc = "Allows spawn chunks to unload",
category = CREATIVE,
validate = {Validator.WIP.class, DisableSpawnChunksValidator.class}
)
public static boolean disableSpawnChunks = false;
private class KelpLimit extends Validator<Integer> {
@Override Integer validate(ServerCommandSource source, ParsedRule<Integer> currentRule, Integer newValue, String string) {
return (newValue>=0 && newValue <=25)?newValue:null;
}
}
@Rule(
desc = "limits growth limit of newly naturally generated kelp to this amount of blocks",
options = {"0", "2", "25"},
category = FEATURE,
validate = KelpLimit.class
)
public static int kelpGenerationGrowthLimit = 25;
@Rule(desc = "Coral structures will grow with bonemeal from coral plants", category = FEATURE)
public static boolean renewableCoral = false;
@Rule(desc = "fixes block placement rotation issue when player rotates quickly while placing blocks", category = BUGFIX)
public static boolean placementRotationFix = false;
@Rule( @Rule(
desc = "Silverfish drop a gravel item when breaking out of a block", desc = "Fixes leads breaking/becoming invisible in unloaded chunks",
category = {FEATURE, EXPERIMENTAL} extra = "You may still get visibly broken leash links on the client side, but server side the link is still there.",
category = BUGFIX,
validate = Validator.WIP.class
) )
public static boolean silverFishDropGravel = false; public static boolean leadFix = false;
@Rule(desc = "Shulkers will respawn in end cities", category = {FEATURE, EXPERIMENTAL}) @Rule(desc = "Spawning requires much less CPU and Memory", category = OPTIMIZATIONS)
public static boolean shulkerSpawningInEndCities = false;
@Rule(
desc = "Portals won't let a creative player go through instantly",
extra = "Holding obsidian in either hand won't let you through at all",
category = CREATIVE
)
public static boolean portalCreativeDelay = false;
@Rule(desc = "Pistons can push block entities, like hoppers, chests etc.", category = {FEATURE, EXPERIMENTAL})
public static boolean movableTileEntities = false;
@Rule(
desc = "Empty shulker boxes can stack to 64 when dropped on the ground",
extra = "To move them around between inventories, use shift click to move entire stacks",
category = SURVIVAL
)
public static boolean stackableShulkerBoxes = false;
@Rule(desc = "Optimizes spawning", category = {OPTIMIZATIONS, EXPERIMENTAL})
public static boolean lagFreeSpawning = false; public static boolean lagFreeSpawning = false;
} }
@@ -62,4 +62,11 @@ public abstract class Validator<T> {
return newValue; return newValue;
} }
} }
public static class NONNEGATIVE_NUMBER <T extends Number> extends Validator<T> {
@Override
public T validate(ServerCommandSource source, ParsedRule<T> currentRule, T newValue, String string) {
return newValue.doubleValue() >= 0 ? newValue : null;
}
}
} }