-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add hacky mixin into ModInjector to ensure floodgate-fabric works wit…
…h direct connections (#122)
- Loading branch information
1 parent
3d35cdb
commit bf91d26
Showing
5 changed files
with
46 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/org/geysermc/floodgate/mixin/GeyserModInjectorMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.geysermc.floodgate.mixin; | ||
|
||
import io.netty.channel.ChannelFuture; | ||
import org.geysermc.floodgate.inject.fabric.FabricInjector; | ||
import org.geysermc.geyser.GeyserBootstrap; | ||
import org.geysermc.geyser.platform.mod.GeyserModInjector; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import java.util.List; | ||
|
||
@Mixin(value = GeyserModInjector.class, remap = false) | ||
public class GeyserModInjectorMixin { | ||
|
||
@Shadow | ||
private List<ChannelFuture> allServerChannels; | ||
|
||
@Inject(method = "initializeLocalChannel0", at = @At(value = "INVOKE_ASSIGN", target = "Ljava/util/List;add(Ljava/lang/Object;)Z")) | ||
public void onChannelAdd(GeyserBootstrap bootstrap, CallbackInfo ci) { | ||
FabricInjector.getInstance().injectClient(this.allServerChannels.get(this.allServerChannels.size() - 1)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters