Merge branch 'master' into 1.16
This commit is contained in:
commit
a019d3f970
5 files changed
+46
-16
No files matched your search
+1
-1
@@ -9,7 +9,7 @@ org.gradle.jvmargs=-Xmx1G
|
||||
loader_version=0.7.8+build.184
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.3.9+v200206
|
||||
mod_version = 1.3.9+v200206b
|
||||
maven_group = carpet
|
||||
archives_base_name = fabric-carpet
|
||||
|
||||
|
||||
@@ -5,18 +5,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import carpet.commands.CameraModeCommand;
|
||||
import carpet.commands.CounterCommand;
|
||||
import carpet.commands.DistanceCommand;
|
||||
import carpet.commands.DrawCommand;
|
||||
import carpet.commands.InfoCommand;
|
||||
import carpet.commands.LogCommand;
|
||||
import carpet.commands.MobAICommand;
|
||||
import carpet.commands.PerimeterInfoCommand;
|
||||
import carpet.commands.PlayerCommand;
|
||||
import carpet.commands.ScriptCommand;
|
||||
import carpet.commands.SpawnCommand;
|
||||
import carpet.commands.TickCommand;
|
||||
import carpet.commands.*;
|
||||
import carpet.helpers.TickSpeed;
|
||||
import carpet.logging.LoggerRegistry;
|
||||
import carpet.script.CarpetScriptServer;
|
||||
@@ -89,6 +78,7 @@ public class CarpetServer // static for now - easier to handle all around the co
|
||||
public static void registerCarpetCommands(CommandDispatcher<ServerCommandSource> dispatcher)
|
||||
{
|
||||
TickCommand.register(dispatcher);
|
||||
ProfileCommand.register(dispatcher);
|
||||
CounterCommand.register(dispatcher);
|
||||
LogCommand.register(dispatcher);
|
||||
SpawnCommand.register(dispatcher);
|
||||
|
||||
@@ -32,7 +32,7 @@ import static carpet.settings.RuleCategory.DISPENSER;
|
||||
@SuppressWarnings("CanBeFinal")
|
||||
public class CarpetSettings
|
||||
{
|
||||
public static final String carpetVersion = "1.3.9+v200206";
|
||||
public static final String carpetVersion = "1.3.9+v200206b";
|
||||
public static final Logger LOG = LogManager.getLogger();
|
||||
public static boolean skipGenerationChecks = false;
|
||||
public static boolean impendingFillSkipUpdates = false;
|
||||
@@ -231,6 +231,13 @@ public class CarpetSettings
|
||||
@Rule(desc = "Enables /tick command to control game clocks", category = COMMAND)
|
||||
public static String commandTick = "true";
|
||||
|
||||
@Rule(
|
||||
desc = "Enables /profile command to monitor game performance",
|
||||
extra = "subset of /tick command capabilities",
|
||||
category = COMMAND
|
||||
)
|
||||
public static String commandProfile = "true";
|
||||
|
||||
@Rule(desc = "Enables /log command to monitor events via chat and overlays", category = COMMAND)
|
||||
public static String commandLog = "true";
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package carpet.commands;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import carpet.settings.SettingsManager;
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
|
||||
import static carpet.commands.TickCommand.healthEntities;
|
||||
import static carpet.commands.TickCommand.healthReport;
|
||||
import static com.mojang.brigadier.arguments.IntegerArgumentType.getInteger;
|
||||
import static com.mojang.brigadier.arguments.IntegerArgumentType.integer;
|
||||
import static net.minecraft.server.command.CommandManager.argument;
|
||||
import static net.minecraft.server.command.CommandManager.literal;
|
||||
|
||||
public class ProfileCommand
|
||||
{
|
||||
public static void register(CommandDispatcher<ServerCommandSource> dispatcher)
|
||||
{
|
||||
LiteralArgumentBuilder<ServerCommandSource> literalargumentbuilder = literal("profile").
|
||||
requires((player) -> SettingsManager.canUseCommand(player, CarpetSettings.commandProfile)).
|
||||
executes( (c) -> healthReport(c.getSource(), 100)).
|
||||
then(literal("health").
|
||||
executes( (c) -> healthReport(c.getSource(), 100)).
|
||||
then(argument("ticks", integer(20,24000)).
|
||||
executes( (c) -> healthReport(c.getSource(), getInteger(c, "ticks"))))).
|
||||
then(literal("entities").
|
||||
executes((c) -> healthEntities(c.getSource(), 100)).
|
||||
then(argument("ticks", integer(20,24000)).
|
||||
executes((c) -> healthEntities(c.getSource(), getInteger(c, "ticks")))));
|
||||
dispatcher.register(literalargumentbuilder);
|
||||
}
|
||||
}
|
||||
@@ -129,13 +129,13 @@ public class TickCommand
|
||||
return 1;
|
||||
}
|
||||
|
||||
private static int healthReport(ServerCommandSource source, int ticks)
|
||||
public static int healthReport(ServerCommandSource source, int ticks)
|
||||
{
|
||||
CarpetProfiler.prepare_tick_report(source, ticks);
|
||||
return 1;
|
||||
}
|
||||
|
||||
private static int healthEntities(ServerCommandSource source, int ticks)
|
||||
public static int healthEntities(ServerCommandSource source, int ticks)
|
||||
{
|
||||
CarpetProfiler.prepare_entity_report(source, ticks);
|
||||
return 1;
|
||||
|
||||
Reference in new issue
Block a user