mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-20 12:20:11 +00:00
Forge 1.19
* Bump pack.mcmeta formats * 1.19 biome modifiers * Mark ClientPlayerNetworkEvent.LoggedOutEvent's getters as nullable * Add docs and package-info to client extension interfaces package * Move RenderBlockOverlayEvent hooks to ForgeHooksClient * Add package-infos to client events package * Rename SoundLoadEvent to SoundEngineLoadEvent This reduces confusion from consumers which may think the name SoundLoadEvent refers to an individual sound being loaded rather than the sound engine. * Document and change SoundLoadEvent to fire on mod bus Previously, it fired on both the mod bus and the Forge bus, which is confusing for consumers. * Delete SoundSetupEvent Looking at its original implementation shows that there isn't an appropriate place in the new sound code to reinsert the event, and the place of 'sound engine/manager initialization event' is taken already by SoundLoadEvent. * Perform some cleanup on client events - Removed nullable annotations from ClientPlayerNetworkEvent - Renamed #getPartialTicks methods to #getPartialTick, to be consistent with vanilla's naming of the partial tick - Cleanup documentation to remove line breaks, use the spelling 'cancelled' over 'canceled', and improve docs on existing and new methods. * Remove EntityEvent.CanUpdate Closes MinecraftForge/MinecraftForge#6394 * Switch to Jetbrains nullability annotations * New PlayLevelSoundEvent; replaces old PlaySoundAtEntityEvent * Remove ForgeWorldPresetScreens * Remove IForgeRegistryEntry * Remove use of List<Throwable> in FML's CompletableFutures * Add docs to mod loading stages, stages, and phases * Gradle 7.4.2 * Use SLF4J in FMLLoader and other subprojects * Switch dynamic versions in subprojects to pinned ones * Switch ForgeRoot and MDK to FG plugin markers * Configure Forge javadoc task The task now uses a custom stylesheet with MCForge elements, and configured to combine the generation from the four FML subprojects (fmlloader, fmlcore, javafmllanguage, mclanguage) and the Forge project into the javadoc output. * Update docs/md files, for 1.19 update and the move away from IRC to Discord. * Make "Potentially dangerous alternative prefix" a debug warning, not info. Co-authored-by: Curle <[email protected]> Co-authored-by: sciwhiz12 <[email protected]> Signed-off-by: SizableShrimp <[email protected]>
This commit is contained in:
1 parent
270e778ac5
commit
4ed9117799
1485 files changed
+14960
-15446
No files matched your search
@@ -15,7 +15,7 @@ import net.minecraft.commands.arguments.ResourceLocationArgument;
|
||||
import net.minecraft.commands.arguments.TeamArgument;
|
||||
import net.minecraft.commands.arguments.coordinates.BlockPosArgument;
|
||||
import net.minecraft.commands.synchronization.SuggestionProviders;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraftforge.client.event.RegisterClientCommandsEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
@@ -49,21 +49,21 @@ public class ClientCommandTest
|
||||
.then(Commands.literal("server")
|
||||
.executes((context) -> {
|
||||
context.getSource().getServer();
|
||||
context.getSource().sendSuccess(new TextComponent("Successfully called getServer should have errored"), false);
|
||||
context.getSource().sendSuccess(Component.literal("Successfully called getServer should have errored"), false);
|
||||
return 1;
|
||||
}))
|
||||
// Used for checking if attempting to get the server level on the client side errors
|
||||
.then(Commands.literal("level")
|
||||
.executes((context) -> {
|
||||
context.getSource().getLevel();
|
||||
context.getSource().sendSuccess(new TextComponent("Successfully called getLevel should have errored"), false);
|
||||
context.getSource().sendSuccess(Component.literal("Successfully called getLevel should have errored"), false);
|
||||
return 1;
|
||||
}))
|
||||
// Used for checking if getting a known objective argument works on the client side
|
||||
.then(Commands.literal("get_objective")
|
||||
.then(Commands.argument("objective", ObjectiveArgument.objective())
|
||||
.executes((context) -> {
|
||||
context.getSource().sendSuccess(new TextComponent("Regular: ")
|
||||
context.getSource().sendSuccess(Component.literal("Regular: ")
|
||||
.append(ObjectiveArgument.getObjective(context, "objective").getFormattedDisplayName()), false);
|
||||
return 1;
|
||||
})))
|
||||
@@ -95,14 +95,14 @@ public class ClientCommandTest
|
||||
.then(Commands.argument("blockpos", BlockPosArgument.blockPos())
|
||||
.executes((context) -> {
|
||||
context.getSource()
|
||||
.sendSuccess(new TextComponent(BlockPosArgument.getLoadedBlockPos(context, "blockpos").toString()), false);
|
||||
.sendSuccess(Component.literal(BlockPosArgument.getLoadedBlockPos(context, "blockpos").toString()), false);
|
||||
return 1;
|
||||
})))
|
||||
// Used for checking if a command can have a requirement
|
||||
.then(Commands.literal("requires")
|
||||
.requires((source) -> false)
|
||||
.executes((context) -> {
|
||||
context.getSource().sendSuccess(new TextComponent("Executed command"), false);
|
||||
context.getSource().sendSuccess(Component.literal("Executed command"), false);
|
||||
return 1;
|
||||
})));
|
||||
|
||||
@@ -110,7 +110,7 @@ public class ClientCommandTest
|
||||
LiteralArgumentBuilder<CommandSourceStack> fork = Commands.literal("clientcommandfork");
|
||||
fork.fork(event.getDispatcher().getRoot(), (context) -> List.of(context.getSource(), context.getSource()))
|
||||
.executes((context) -> {
|
||||
context.getSource().sendSuccess(new TextComponent("Executing forked command"), false);
|
||||
context.getSource().sendSuccess(Component.literal("Executing forked command"), false);
|
||||
return 1;
|
||||
});
|
||||
event.getDispatcher().register(fork);
|
||||
@@ -118,12 +118,12 @@ public class ClientCommandTest
|
||||
|
||||
private int testCommand(CommandContext<CommandSourceStack> context)
|
||||
{
|
||||
context.getSource().sendSuccess(new TextComponent("Input: " + ResourceLocationArgument.getId(context, "block")), false);
|
||||
context.getSource().sendSuccess(new TextComponent("Teams: " + context.getSource().getAllTeams()), false);
|
||||
context.getSource().sendSuccess(new TextComponent("Players: " + context.getSource().getOnlinePlayerNames()), false);
|
||||
context.getSource().sendSuccess(new TextComponent("First recipe: " + context.getSource().getRecipeNames().findFirst().get()), false);
|
||||
context.getSource().sendSuccess(new TextComponent("Levels: " + context.getSource().levels()), false);
|
||||
context.getSource().sendSuccess(new TextComponent("Registry Access: " + context.getSource().registryAccess()), false);
|
||||
context.getSource().sendSuccess(Component.literal("Input: " + ResourceLocationArgument.getId(context, "block")), false);
|
||||
context.getSource().sendSuccess(Component.literal("Teams: " + context.getSource().getAllTeams()), false);
|
||||
context.getSource().sendSuccess(Component.literal("Players: " + context.getSource().getOnlinePlayerNames()), false);
|
||||
context.getSource().sendSuccess(Component.literal("First recipe: " + context.getSource().getRecipeNames().findFirst().get()), false);
|
||||
context.getSource().sendSuccess(Component.literal("Levels: " + context.getSource().levels()), false);
|
||||
context.getSource().sendSuccess(Component.literal("Registry Access: " + context.getSource().registryAccess()), false);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.context.ParsedCommandNode;
|
||||
import net.minecraft.commands.CommandRuntimeException;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraftforge.event.CommandEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
@@ -42,7 +42,7 @@ public class CommandEventTest
|
||||
if (nodes.size() > 0 && nodes.get(0).getNode() == dispatcher.getRoot().getChild("give"))
|
||||
{
|
||||
String msg = source.getTextName() + " used the give command: " + event.getParseResults().getReader().getString();
|
||||
source.getServer().getPlayerList().getPlayers().forEach(player -> player.sendMessage(new TextComponent(msg), player.getUUID()));
|
||||
source.getServer().getPlayerList().getPlayers().forEach(player -> player.sendSystemMessage(Component.literal(msg)));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ import net.minecraft.commands.arguments.selector.EntitySelectorParser;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraftforge.common.command.EntitySelectorManager;
|
||||
import net.minecraftforge.common.command.IEntitySelectorType;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
@@ -30,7 +29,7 @@ public class EntitySelectorTest
|
||||
|
||||
public void setup(FMLCommonSetupEvent event)
|
||||
{
|
||||
EntitySelectorOptions.register("health", this::healthArgument, parser -> true, new TextComponent("Selects entities based on their current health."));
|
||||
EntitySelectorOptions.register("health", this::healthArgument, parser -> true, Component.literal("Selects entities based on their current health."));
|
||||
EntitySelectorManager.register("er", new ExampleCustomSelector());
|
||||
}
|
||||
|
||||
@@ -76,7 +75,7 @@ public class EntitySelectorTest
|
||||
@Override
|
||||
public Component getSuggestionTooltip()
|
||||
{
|
||||
return new TextComponent("Example: Selects a random entity");
|
||||
return Component.literal("Example: Selects a random entity");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user