[PORT] 25w31a
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
def projectName = "CraterLib";
|
def projectName = "CraterLib";
|
||||||
def projectIcon = "https://cdn.modrinth.com/data/Nn8Wasaq/a172c634683a11a2e9ae593e56eba7885743bb44.png";
|
def projectIcon = "https://cdn.modrinth.com/data/Nn8Wasaq/a172c634683a11a2e9ae593e56eba7885743bb44.png";
|
||||||
def JDK = "21";
|
def JDK = "21";
|
||||||
def majorMc = "1.21.6";
|
def majorMc = "25w31a";
|
||||||
def modLoaders = "neoforge|fabric|quilt|paper";
|
def modLoaders = "fabric|quilt";
|
||||||
def supportedMc = "25w19a";
|
def supportedMc = "25w31a";
|
||||||
def reltype = "experimental";
|
def reltype = "experimental";
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
|
@@ -4,8 +4,7 @@ import com.hypherionmc.craterlib.core.networking.data.PacketHolder;
|
|||||||
import com.hypherionmc.craterlib.nojang.network.BridgedFriendlyByteBuf;
|
import com.hypherionmc.craterlib.nojang.network.BridgedFriendlyByteBuf;
|
||||||
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
|
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
|
||||||
|
|
||||||
public record CommonPacketWrapper<T>(PacketHolder<T> container, T packet) implements CustomPacketPayload
|
public record CommonPacketWrapper<T>(PacketHolder<T> container, T packet) implements CustomPacketPayload {
|
||||||
{
|
|
||||||
public void encode(BridgedFriendlyByteBuf buf)
|
public void encode(BridgedFriendlyByteBuf buf)
|
||||||
{
|
{
|
||||||
container().encoder().accept(packet(), buf);
|
container().encoder().accept(packet(), buf);
|
||||||
|
@@ -342,9 +342,9 @@ public class CraterConfigScreen extends Screen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean mouseClicked(double d, double e, int i) {
|
public boolean mouseClicked(double d, double e, int i, boolean bl) {
|
||||||
this.dragging = i == 0 && d >= width - 6 && d < width;
|
this.dragging = i == 0 && d >= width - 6 && d < width;
|
||||||
return super.mouseClicked(d, e, i) || dragging;
|
return super.mouseClicked(d, e, i, bl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -12,6 +12,7 @@ import net.minecraft.network.Connection;
|
|||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.server.network.CommonListenerCookie;
|
import net.minecraft.server.network.CommonListenerCookie;
|
||||||
|
import net.minecraft.server.players.NameAndId;
|
||||||
import net.minecraft.server.players.PlayerList;
|
import net.minecraft.server.players.PlayerList;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
@@ -43,8 +44,8 @@ public class PlayerListMixin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "canPlayerLogin", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "canPlayerLogin", at = @At("HEAD"), cancellable = true)
|
||||||
private void injectPreLoginEvent(SocketAddress address, GameProfile gameProfile, CallbackInfoReturnable<Component> cir) {
|
private void injectPreLoginEvent(SocketAddress socketAddress, NameAndId arg, CallbackInfoReturnable<Component> cir) {
|
||||||
PlayerPreLoginEvent event = new PlayerPreLoginEvent(address, BridgedGameProfile.of(gameProfile));
|
PlayerPreLoginEvent event = new PlayerPreLoginEvent(socketAddress, BridgedGameProfile.of(arg));
|
||||||
CraterEventBus.INSTANCE.postEvent(event);
|
CraterEventBus.INSTANCE.postEvent(event);
|
||||||
if (event.getMessage() != null) {
|
if (event.getMessage() != null) {
|
||||||
cir.setReturnValue(ChatUtils.adventureToMojang(event.getMessage()));
|
cir.setReturnValue(ChatUtils.adventureToMojang(event.getMessage()));
|
||||||
|
@@ -2,6 +2,7 @@ package com.hypherionmc.craterlib.nojang.authlib;
|
|||||||
|
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import net.minecraft.server.players.NameAndId;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@@ -14,6 +15,10 @@ public class BridgedGameProfile {
|
|||||||
return new BridgedGameProfile(new GameProfile(id, name));
|
return new BridgedGameProfile(new GameProfile(id, name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static BridgedGameProfile of(NameAndId nameAndId) {
|
||||||
|
return BridgedGameProfile.of(new GameProfile(nameAndId.id(), nameAndId.name()));
|
||||||
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return internal.getName();
|
return internal.getName();
|
||||||
}
|
}
|
||||||
@@ -26,4 +31,8 @@ public class BridgedGameProfile {
|
|||||||
return internal;
|
return internal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NameAndId toNameAndId() {
|
||||||
|
return new NameAndId(internal);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -23,7 +23,7 @@ public class BridgedScreen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isLoadingScreen() {
|
public boolean isLoadingScreen() {
|
||||||
return internal instanceof LevelLoadingScreen || internal instanceof ReceivingLevelScreen;
|
return internal instanceof LevelLoadingScreen || internal instanceof ConnectScreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPauseScreen() {
|
public boolean isPauseScreen() {
|
||||||
|
@@ -50,21 +50,21 @@ public class BridgedMinecraftServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPlayerBanned(BridgedGameProfile profile) {
|
public boolean isPlayerBanned(BridgedGameProfile profile) {
|
||||||
return internal.getPlayerList().getBans().isBanned(profile.toMojang());
|
return internal.getPlayerList().getBans().isBanned(profile.toNameAndId());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void whitelistPlayer(BridgedGameProfile gameProfile) {
|
public void whitelistPlayer(BridgedGameProfile gameProfile) {
|
||||||
if (!internal.getPlayerList().isUsingWhitelist())
|
if (!internal.getPlayerList().isUsingWhitelist())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
internal.getPlayerList().getWhiteList().add(new UserWhiteListEntry(gameProfile.toMojang()));
|
internal.getPlayerList().getWhiteList().add(new UserWhiteListEntry(gameProfile.toNameAndId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unWhitelistPlayer(BridgedGameProfile gameProfile) {
|
public void unWhitelistPlayer(BridgedGameProfile gameProfile) {
|
||||||
if (!internal.getPlayerList().isUsingWhitelist())
|
if (!internal.getPlayerList().isUsingWhitelist())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
internal.getPlayerList().getWhiteList().remove(new UserWhiteListEntry(gameProfile.toMojang()));
|
internal.getPlayerList().getWhiteList().remove(new UserWhiteListEntry(gameProfile.toNameAndId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<BridgedPlayer> getPlayers() {
|
public List<BridgedPlayer> getPlayers() {
|
||||||
@@ -83,7 +83,7 @@ public class BridgedMinecraftServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void banPlayer(BridgedGameProfile profile) {
|
public void banPlayer(BridgedGameProfile profile) {
|
||||||
internal.getPlayerList().getBans().add(new UserBanListEntry(profile.toMojang()));
|
internal.getPlayerList().getBans().add(new UserBanListEntry(profile.toNameAndId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void executeCommand(BridgedMinecraftServer server, BridgedFakePlayer player, String command) {
|
public void executeCommand(BridgedMinecraftServer server, BridgedFakePlayer player, String command) {
|
||||||
|
@@ -62,7 +62,7 @@ public class BridgedGameRules {
|
|||||||
public static final WrappedBooleanKey RULE_DO_VINES_SPREAD = WrappedBooleanKey.wrap(GameRules.RULE_DO_VINES_SPREAD);
|
public static final WrappedBooleanKey RULE_DO_VINES_SPREAD = WrappedBooleanKey.wrap(GameRules.RULE_DO_VINES_SPREAD);
|
||||||
public static final WrappedBooleanKey RULE_ENDER_PEARLS_VANISH_ON_DEATH = WrappedBooleanKey.wrap(GameRules.RULE_ENDER_PEARLS_VANISH_ON_DEATH);
|
public static final WrappedBooleanKey RULE_ENDER_PEARLS_VANISH_ON_DEATH = WrappedBooleanKey.wrap(GameRules.RULE_ENDER_PEARLS_VANISH_ON_DEATH);
|
||||||
public static final WrappedIntegerKey RULE_MINECART_MAX_SPEED = WrappedIntegerKey.wrap(GameRules.RULE_MINECART_MAX_SPEED);
|
public static final WrappedIntegerKey RULE_MINECART_MAX_SPEED = WrappedIntegerKey.wrap(GameRules.RULE_MINECART_MAX_SPEED);
|
||||||
public static final WrappedIntegerKey RULE_SPAWN_CHUNK_RADIUS = WrappedIntegerKey.wrap(GameRules.RULE_SPAWN_CHUNK_RADIUS);
|
public static final WrappedIntegerKey RULE_SPAWN_CHUNK_RADIUS = WrappedIntegerKey.wrap(null);
|
||||||
public static final WrappedBooleanKey RULE_TNT_EXPLODES = WrappedBooleanKey.wrap(GameRules.RULE_TNT_EXPLODES);
|
public static final WrappedBooleanKey RULE_TNT_EXPLODES = WrappedBooleanKey.wrap(GameRules.RULE_TNT_EXPLODES);
|
||||||
|
|
||||||
public boolean getBoolean(WrappedBooleanKey key) {
|
public boolean getBoolean(WrappedBooleanKey key) {
|
||||||
|
@@ -118,8 +118,8 @@ publisher {
|
|||||||
setVersionType("release")
|
setVersionType("release")
|
||||||
setChangelog(rootProject.file("changelog.md"))
|
setChangelog(rootProject.file("changelog.md"))
|
||||||
setProjectVersion("${minecraft_version}-${project.version}")
|
setProjectVersion("${minecraft_version}-${project.version}")
|
||||||
setDisplayName("[FABRIC/QUILT 1.21.6] CraterLib - ${project.version}")
|
setDisplayName("[FABRIC/QUILT 1.21.9] CraterLib - ${project.version}")
|
||||||
setGameVersions("1.21.6")
|
setGameVersions("1.21.9")
|
||||||
setLoaders("fabric", "quilt")
|
setLoaders("fabric", "quilt")
|
||||||
setArtifact(remapJar)
|
setArtifact(remapJar)
|
||||||
setCurseEnvironment("both")
|
setCurseEnvironment("both")
|
||||||
|
@@ -27,7 +27,7 @@ public class FabricLoaderHelper implements ModloaderEnvironment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGameVersion() {
|
public String getGameVersion() {
|
||||||
return SharedConstants.VERSION_STRING;
|
return SharedConstants.getCurrentVersion().name();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -118,8 +118,8 @@ publisher {
|
|||||||
setVersionType("release")
|
setVersionType("release")
|
||||||
setChangelog(rootProject.file("changelog.md"))
|
setChangelog(rootProject.file("changelog.md"))
|
||||||
setProjectVersion("${minecraft_version}-${project.version}")
|
setProjectVersion("${minecraft_version}-${project.version}")
|
||||||
setDisplayName("[NeoForge 1.21.6] CraterLib - ${project.version}")
|
setDisplayName("[NeoForge 1.21.9] CraterLib - ${project.version}")
|
||||||
setGameVersions("1.21.6")
|
setGameVersions("1.21.9")
|
||||||
setLoaders("neoforge")
|
setLoaders("neoforge")
|
||||||
setArtifact(remapJar)
|
setArtifact(remapJar)
|
||||||
setCurseEnvironment("both")
|
setCurseEnvironment("both")
|
||||||
|
@@ -68,8 +68,8 @@ publisher {
|
|||||||
setVersionType("alpha")
|
setVersionType("alpha")
|
||||||
setChangelog(rootProject.file("changelog.md"))
|
setChangelog(rootProject.file("changelog.md"))
|
||||||
setProjectVersion("${minecraft_version}-${project.version}")
|
setProjectVersion("${minecraft_version}-${project.version}")
|
||||||
setDisplayName("[Paper 1.21.6] CraterLib - ${project.version}")
|
setDisplayName("[Paper 1.21.9] CraterLib - ${project.version}")
|
||||||
setGameVersions("1.21.6")
|
setGameVersions("1.21.9")
|
||||||
setLoaders("paper")
|
setLoaders("paper")
|
||||||
setArtifact(reobfJar.outputJar)
|
setArtifact(reobfJar.outputJar)
|
||||||
}
|
}
|
||||||
|
@@ -10,12 +10,12 @@ mod_id=craterlib
|
|||||||
mod_name=CraterLib
|
mod_name=CraterLib
|
||||||
|
|
||||||
# Shared
|
# Shared
|
||||||
minecraft_version=1.21.6
|
minecraft_version=25w31a
|
||||||
project_group=com.hypherionmc.craterlib
|
project_group=com.hypherionmc.craterlib
|
||||||
|
|
||||||
# Fabric
|
# Fabric
|
||||||
fabric_loader=0.16.13
|
fabric_loader=0.16.13
|
||||||
fabric_api=0.126.0+1.21.6
|
fabric_api=0.128.2+1.21.6
|
||||||
|
|
||||||
# Forge
|
# Forge
|
||||||
forge_version=50.0.6
|
forge_version=50.0.6
|
||||||
|
@@ -14,6 +14,6 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rootProject.name = 'CraterLib'
|
rootProject.name = 'CraterLib'
|
||||||
include("Common", "Fabric", "NeoForge")
|
include("Common", "Fabric"/*, "NeoForge"*/)
|
||||||
include 'Paper'
|
//include 'Paper'
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user