Skip to content

Commit

Permalink
Update to forge 40.1.59
Browse files Browse the repository at this point in the history
  • Loading branch information
IzzelAliz committed Jul 9, 2022
1 parent f980461 commit 7128c9d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A Bukkit server implementation utilizing Mixin.

| Minecraft | Forge | Status | Build |
| :----: |:-------:| :---: | :---: |
| 1.18.x | 40.1.31 | ACTIVE | [![1.18 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-18?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-18) |
| 1.18.x | 40.1.59 | ACTIVE | [![1.18 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-18?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-18) |
| 1.17.x | 37.1.0 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.17/1.0.2) | [![1.17 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-17?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-17) |
| 1.16.x | 36.2.26 | ACTIVE | [![1.16 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-16?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-16) |
| 1.15.x | 31.2.48 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.15/1.0.19) | [![1.15 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-15?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-15) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraft.commands.SharedSuggestionProvider;
import net.minecraft.commands.synchronization.SuggestionProviders;
import net.minecraft.network.protocol.game.ClientboundCommandsPacket;
import net.minecraft.server.level.ServerPlayer;
import net.minecraftforge.server.command.CommandHelper;
import org.bukkit.Bukkit;
import org.bukkit.event.player.PlayerCommandSendEvent;
import org.spigotmc.SpigotConfig;
Expand Down Expand Up @@ -57,11 +59,12 @@ public void sendCommands(ServerPlayer player) {
RootCommandNode<SharedSuggestionProvider> vanillaRoot = new RootCommandNode<>();
Commands vanillaCommands = ((MinecraftServerBridge) player.server).bridge$getVanillaCommands();
map.put(vanillaCommands.getDispatcher().getRoot(), vanillaRoot);
this.fillUsableCommands(vanillaCommands.getDispatcher().getRoot(), vanillaRoot, player.createCommandSourceStack(), map);
// FORGE: Use our own command node merging method to handle redirect nodes properly, see issue #7551
CommandHelper.mergeCommandNode(vanillaCommands.getDispatcher().getRoot(), vanillaRoot, map, player.createCommandSourceStack(), ctx -> 0, suggest -> SuggestionProviders.safelySwap((com.mojang.brigadier.suggestion.SuggestionProvider<SharedSuggestionProvider>) (com.mojang.brigadier.suggestion.SuggestionProvider<?>) suggest));

RootCommandNode<SharedSuggestionProvider> node = new RootCommandNode<>();
map.put(this.dispatcher.getRoot(), node);
this.fillUsableCommands(this.dispatcher.getRoot(), node, player.createCommandSourceStack(), map);
CommandHelper.mergeCommandNode(this.dispatcher.getRoot(), node, map, player.createCommandSourceStack(), ctx -> 0, suggest -> SuggestionProviders.safelySwap((com.mojang.brigadier.suggestion.SuggestionProvider<SharedSuggestionProvider>) (com.mojang.brigadier.suggestion.SuggestionProvider<?>) suggest));

LinkedHashSet<String> set = new LinkedHashSet<>();
for (CommandNode<SharedSuggestionProvider> child : node.getChildren()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,8 @@ protected Object evaluate() {
return null;
}
String message = String.format(queueEvent.getFormat(), queueEvent.getPlayer().getDisplayName(), queueEvent.getMessage());
Component component = ForgeHooks.onServerChatEvent(handler, queueEvent.getMessage(), ForgeHooks.newChatWithLinks(message));
var event = ForgeHooks.onServerChatEvent(handler, queueEvent.getMessage(), ForgeHooks.newChatWithLinks(message), queueEvent.getMessage(), ForgeHooks.newChatWithLinks(message));
var component = event == null ? null : event.getComponent();
if (component == null) return null;
Bukkit.getConsoleSender().sendMessage(CraftChatMessage.fromComponent(component));
if (((LazyPlayerSet) queueEvent.getRecipients()).isLazy()) {
Expand Down Expand Up @@ -1040,7 +1041,8 @@ class ForgeChat extends Waitable<Void> {
@Override
protected Void evaluate() {
// this is called on main thread
Component component = ForgeHooks.onServerChatEvent(handler, event.getMessage(), chatWithLinks);
var chatEvent = ForgeHooks.onServerChatEvent(handler, event.getMessage(), chatWithLinks, event.getMessage(), chatWithLinks);
var component = chatEvent != null ? chatEvent.getComponent() : null;
if (component == null) return null;
Bukkit.getConsoleSender().sendMessage(CraftChatMessage.fromComponent(component));
if (((LazyPlayerSet) event.getRecipients()).isLazy()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public String runCommand(String command) {
}
if (!threads.isEmpty()) {
ArclightMod.LOGGER.debug("Threads {} not shutting down", String.join(", ", threads));
ArclightMod.LOGGER.warn("{} threads not shutting down correctly, force exiting", threads.size());
ArclightMod.LOGGER.info("{} threads not shutting down correctly, force exiting", threads.size());
}
System.exit(0);
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ allprojects {
ext {
agpVersion = '1.23'
minecraftVersion = '1.18.2'
forgeVersion = '40.1.31'
forgeVersion = '40.1.59'
apiVersion = '1.2.6'
toolsVersion = '1.3.+'
mixinVersion = '0.8.5'
Expand Down

0 comments on commit 7128c9d

Please sign in to comment.