-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send players into config phase during addon reload
- Loading branch information
1 parent
0a6199a
commit 823542f
Showing
11 changed files
with
109 additions
and
33 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
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
9 changes: 9 additions & 0 deletions
9
src/main/java/net/kyrptonaught/serverutils/customMapLoader/CustomMapLoaderConfig.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,9 @@ | ||
package net.kyrptonaught.serverutils.customMapLoader; | ||
|
||
import net.kyrptonaught.serverutils.AbstractConfigFile; | ||
|
||
public class CustomMapLoaderConfig extends AbstractConfigFile { | ||
|
||
public String reconfigFunction; | ||
|
||
} |
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
28 changes: 28 additions & 0 deletions
28
...ava/net/kyrptonaught/serverutils/mixin/customMapLoader/ServerPlayNetworkHandlerMixin.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,28 @@ | ||
package net.kyrptonaught.serverutils.mixin.customMapLoader; | ||
|
||
import net.kyrptonaught.serverutils.customMapLoader.CustomMapLoaderMod; | ||
import net.minecraft.network.ClientConnection; | ||
import net.minecraft.network.packet.c2s.play.AcknowledgeReconfigurationC2SPacket; | ||
import net.minecraft.server.MinecraftServer; | ||
import net.minecraft.server.network.*; | ||
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; | ||
|
||
@Mixin(ServerPlayNetworkHandler.class) | ||
public abstract class ServerPlayNetworkHandlerMixin extends ServerCommonNetworkHandler { | ||
|
||
@Shadow | ||
public ServerPlayerEntity player; | ||
|
||
public ServerPlayNetworkHandlerMixin(MinecraftServer server, ClientConnection connection, ConnectedClientData clientData) { | ||
super(server, connection, clientData); | ||
} | ||
|
||
@Inject(method = "onAcknowledgeReconfiguration", at = @At("TAIL")) | ||
public void grabReconfig(AcknowledgeReconfigurationC2SPacket packet, CallbackInfo ci) { | ||
CustomMapLoaderMod.onEnterReconfig((ServerConfigurationNetworkHandler) this.connection.getPacketListener(), this.player); | ||
} | ||
} |
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
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