Forge 1.19.3

Created a CreativeModeTabEvent to register creative mode tabs and populate entries per tab
Moved datapack registries to DataPackRegistryEvent.NewRegistry event instead of tying them to ForgeRegistry
Made it easier for mods to datagen datapack builtin entries with DatapackBuiltinEntriesProvider
Provided access to lookupProvider for datagen
Updated dependencies to match versions used by vanilla and update JarJar to 0.3.18
Added a test mod for the new CreativeModeTabEvent
Throws better error message for Forge registries in tag datagen
Deleted ForgeRegistryTagsProvider
Updated ClientChatReceivedEvent and ServerChatEvent for Mojang changes
Added patches for both sign related methods in ModelLayers
Changed RegisterShadersEvent to use ResourceProvider
Migrated old Mojang math types to JOML

Co-authored-by: Marc Hermans <[email protected]>
Co-authored-by: LexManos <[email protected]>
Co-authored-by: sciwhiz12 <[email protected]>
Co-authored-by: coehlrich <[email protected]>
This commit is contained in:
committed 2022-12-08 01:45:22 -06:00
1 parent 617ecb7ad3
commit 8255d7aed3
726 files changed
+7615 -6653

No files matched your search

@@ -29,6 +29,7 @@ import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.server.command.CommandHelper;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.ApiStatus;
import java.util.IdentityHashMap;
import java.util.Map;
@@ -45,13 +46,10 @@ public class ClientCommandHandler
private static void handleClientPlayerLogin(ClientPlayerNetworkEvent.LoggingIn event)
{
// some custom server implementations do not send ClientboundCommandsPacket, provide a fallback
var suggestionDispatcher = mergeServerCommands(new CommandDispatcher<>(), new CommandBuildContext(event.getPlayer().connection.registryAccess()));
if (event.getConnection().getPacketListener() instanceof ClientPacketListener listener)
{
// Must set this, so that suggestions for client-only commands work, if server never sends commands packet
listener.commands = suggestionDispatcher;
}
final ClientPacketListener connection = event.getPlayer().connection;
// Some custom server implementations do not send ClientboundCommandsPacket, so we provide a fallback:
// Must set this, so that suggestions for client-only commands work, if server never sends commands packet
connection.commands = mergeServerCommands(new CommandDispatcher<>(), CommandBuildContext.simple(connection.registryAccess(), connection.enabledFeatures()));
}
/*
@@ -60,6 +58,7 @@ public class ClientCommandHandler
* Merges command dispatcher use for suggestions to the command dispatcher used for client commands so they can be sent to the server, and vice versa so client commands appear
* with server commands in suggestions
*/
@ApiStatus.Internal
public static CommandDispatcher<SharedSuggestionProvider> mergeServerCommands(CommandDispatcher<SharedSuggestionProvider> serverCommands, CommandBuildContext buildContext)
{
CommandDispatcher<CommandSourceStack> commandsTemp = new CommandDispatcher<>();
@@ -143,10 +142,10 @@ public class ClientCommandHandler
}
/**
* Always try to execute the cached parsing of a typed command as a clientside command. Requires that the execute field of the commands to be set to send to server so that they aren't\
* Always try to execute the cached parsing of a typed command as a clientside command. Requires that the execute field of the commands to be set to send to server so that they aren't
* treated as client command's that do nothing.
*
* {@link net.minecraft.commands.Commands#performCommand(CommandSourceStack, String)} for reference
* {@link net.minecraft.commands.Commands#performCommand(ParseResults, String)} for reference
*
* @param command the full command to execute, no preceding slash
* @return {@code false} leaves the message to be sent to the server, while {@code true} means it should be caught before LocalPlayer#sendCommand