Migrate the Carpet codebase to Mojang Mappings

This commit is contained in:
altrisi committed 2022-01-24 20:33:16 +01:00
1 parent a1a2488bc3
commit 06af9ce8b1
346 files changed
+8353 -8492

No files matched your search

+14 -10
View File
@@ -1,5 +1,6 @@
package carpet;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
@@ -27,16 +28,19 @@ import carpet.logging.HUDController;
import carpet.utils.FabricAPIHooks;
import carpet.utils.MobAI;
import carpet.utils.SpawnReporter;
import com.google.common.reflect.ClassPath;
import com.google.common.reflect.ClassPath.ClassInfo;
import com.mojang.brigadier.CommandDispatcher;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.DedicatedServerModInitializer;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.dedicated.command.PerfCommand;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.commands.PerfCommand;
import net.minecraft.server.level.ServerPlayer;
public class CarpetServer // static for now - easier to handle all around the code, its one anyways
{
@@ -45,7 +49,7 @@ public class CarpetServer // static for now - easier to handle all around the co
public static final Random rand = new Random();
public static MinecraftServer minecraft_server;
private static CommandDispatcher<ServerCommandSource> currentCommandDispatcher;
private static CommandDispatcher<CommandSourceStack> currentCommandDispatcher;
public static CarpetScriptServer scriptServer;
public static SettingsManager settingsManager;
public static final List<CarpetExtension> extensions = new ArrayList<>();
@@ -116,10 +120,10 @@ public class CarpetServer // static for now - easier to handle all around the co
}
@Deprecated
public static void registerCarpetCommands(CommandDispatcher<ServerCommandSource> dispatcher) {
public static void registerCarpetCommands(CommandDispatcher<CommandSourceStack> dispatcher) {
}
public static void registerCarpetCommands(CommandDispatcher<ServerCommandSource> dispatcher, CommandManager.RegistrationEnvironment environment)
public static void registerCarpetCommands(CommandDispatcher<CommandSourceStack> dispatcher, Commands.CommandSelection environment)
{
settingsManager.registerCommand(dispatcher);
extensions.forEach(e -> {
@@ -144,7 +148,7 @@ public class CarpetServer // static for now - easier to handle all around the co
extensions.forEach(e -> e.registerCommands(dispatcher));
currentCommandDispatcher = dispatcher;
if (environment != CommandManager.RegistrationEnvironment.DEDICATED)
if (environment != Commands.CommandSelection.DEDICATED)
PerfCommand.register(dispatcher);
if (FabricLoader.getInstance().isDevelopmentEnvironment())
@@ -152,7 +156,7 @@ public class CarpetServer // static for now - easier to handle all around the co
// todo 1.16 - re-registerer apps if that's a reload operation.
}
public static void onPlayerLoggedIn(ServerPlayerEntity player)
public static void onPlayerLoggedIn(ServerPlayer player)
{
ServerNetworkHandler.onPlayerJoin(player);
LoggerRegistry.playerConnected(player);
@@ -161,7 +165,7 @@ public class CarpetServer // static for now - easier to handle all around the co
}
public static void onPlayerLoggedOut(ServerPlayerEntity player)
public static void onPlayerLoggedOut(ServerPlayer player)
{
ServerNetworkHandler.onPlayerLoggedOut(player);
LoggerRegistry.playerDisconnected(player);