-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
130 changed files
with
2,588 additions
and
1,739 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
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
99 changes: 0 additions & 99 deletions
99
polymer-autohost/src/main/java/eu/pb4/polymer/autohost/impl/ResourcePackNetworkHandler.java
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
...t/src/main/java/eu/pb4/polymer/autohost/mixin/ServerConfigurationNetworkHandlerMixin.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,35 @@ | ||
package eu.pb4.polymer.autohost.mixin; | ||
|
||
import eu.pb4.polymer.autohost.impl.AutoHost; | ||
import eu.pb4.polymer.common.api.PolymerCommonUtils; | ||
import eu.pb4.polymer.resourcepack.api.PolymerResourcePackUtils; | ||
import net.minecraft.network.ClientConnection; | ||
import net.minecraft.server.MinecraftServer; | ||
import net.minecraft.server.network.*; | ||
import org.spongepowered.asm.mixin.Final; | ||
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.Queue; | ||
|
||
@Mixin(ServerConfigurationNetworkHandler.class) | ||
public abstract class ServerConfigurationNetworkHandlerMixin extends ServerCommonNetworkHandler { | ||
public ServerConfigurationNetworkHandlerMixin(MinecraftServer server, ClientConnection connection, ConnectedClientData clientData) { | ||
super(server, connection, clientData); | ||
} | ||
|
||
@Shadow protected abstract void queueSendResourcePackTask(); | ||
|
||
@Shadow @Final private Queue<ServerPlayerConfigurationTask> tasks; | ||
|
||
@Inject(method = "queueSendResourcePackTask", at = @At("HEAD"), cancellable = true) | ||
private void polymerAutoHost$addTask(CallbackInfo ci) { | ||
if (AutoHost.config.enabled && !PolymerCommonUtils.hasResourcePack(this.connection)) { | ||
this.tasks.add(new SendResourcePackTask(AutoHost.provider.getProperties())); | ||
ci.cancel(); | ||
} | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
polymer-common/src/main/java/eu/pb4/polymer/common/impl/CommonNetworkHandlerExt.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,11 @@ | ||
package eu.pb4.polymer.common.impl; | ||
|
||
import net.minecraft.network.ClientConnection; | ||
import org.jetbrains.annotations.ApiStatus; | ||
|
||
@ApiStatus.Internal | ||
@SuppressWarnings({"unused"}) | ||
public interface CommonNetworkHandlerExt { | ||
void polymerCommon$setIgnoreNextResourcePack(); | ||
ClientConnection polymerCommon$getConnection(); | ||
} |
7 changes: 7 additions & 0 deletions
7
polymer-common/src/main/java/eu/pb4/polymer/common/impl/compat/FloodGateUtils.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 |
---|---|---|
@@ -1,10 +1,17 @@ | ||
package eu.pb4.polymer.common.impl.compat; | ||
|
||
import com.mojang.authlib.GameProfile; | ||
import net.minecraft.server.network.ServerPlayerEntity; | ||
import org.geysermc.floodgate.api.FloodgateApi; | ||
|
||
import java.util.UUID; | ||
|
||
public class FloodGateUtils { | ||
public static boolean isPlayerBroken(ServerPlayerEntity player) { | ||
return FloodgateApi.getInstance().isFloodgatePlayer(player.getUuid()); | ||
} | ||
|
||
public static boolean isPlayerBroken(GameProfile profile) { | ||
return FloodgateApi.getInstance().isFloodgatePlayer(profile.getId()); | ||
} | ||
} |
Oops, something went wrong.