mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 14:38:53 +00:00
feat: add support for Minecraft 1.21.5 on Fabric (#809)
* feat: support Fabric 1.21.5 (working, awaiting adventure) * fix: add world, server & dimension contexts during numerical perm calc, close #808 Not perfect but close-enough * feat: more 1.21.5 work & fixes * ci: update CI for 1.21.5 * build: update dependencies for 1.21.5
This commit is contained in:
1 parent
bab7ac5d40
commit
e02dd9f8ef
17 files changed
+125
-26
No files matched your search
@@ -55,18 +55,22 @@ jobs:
|
||||
paper
|
||||
fabric-1.21.1
|
||||
fabric-1.21.4
|
||||
fabric-1.21.5
|
||||
distro-groups: |
|
||||
paper
|
||||
fabric
|
||||
fabric
|
||||
fabric
|
||||
distro-descriptions: |
|
||||
Paper
|
||||
Fabric 1.21.1
|
||||
Fabric 1.21.4
|
||||
Fabric 1.21.5
|
||||
files: |
|
||||
target/HuskHomes-Paper-${{ env.version_name }}.jar
|
||||
target/HuskHomes-Fabric-${{ env.version_name }}+mc.1.21.1.jar
|
||||
target/HuskHomes-Fabric-${{ env.version_name }}+mc.1.21.4.jar
|
||||
target/HuskHomes-Fabric-${{ env.version_name }}+mc.1.21.5.jar
|
||||
- name: 'Spigot: Publish to Modrinth & Hangar 🚰'
|
||||
uses: WiIIiam278/mc-publish@hangar
|
||||
with:
|
||||
@@ -111,6 +115,7 @@ jobs:
|
||||
1.21.1
|
||||
1.21.2
|
||||
1.21.4
|
||||
1.21.5
|
||||
java: 17
|
||||
- name: 'Fabric 1.21.1: Publish to Modrinth & CurseForge 🧵'
|
||||
uses: WiIIiam278/mc-publish@hangar
|
||||
@@ -167,4 +172,32 @@ jobs:
|
||||
fabric
|
||||
game-versions: |
|
||||
1.21.4
|
||||
java: 21
|
||||
- name: 'Fabric 1.21.5: Publish to Modrinth & CurseForge 🧵'
|
||||
uses: WiIIiam278/mc-publish@hangar
|
||||
if: success() || failure()
|
||||
with:
|
||||
modrinth-id: J6U9o3JG
|
||||
modrinth-featured: false
|
||||
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
|
||||
curseforge-id: 849217
|
||||
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
|
||||
dependencies: |
|
||||
fabric-api | requires | *
|
||||
dynmap | suggests | *
|
||||
bluemap | suggests | *
|
||||
pl3xmap | suggests | *
|
||||
luckperms | suggests | *
|
||||
plan | suggests | *
|
||||
impactor | suggests | *
|
||||
placeholder-api | suggests | *
|
||||
files-primary: target/HuskHomes-Fabric-${{ env.version_name }}+mc.1.21.5.jar
|
||||
name: HuskHomes (Fabric) v${{ env.version_name }}
|
||||
version: ${{ env.version_name }}
|
||||
version-type: alpha
|
||||
changelog: ${{ github.event.head_commit.message }}
|
||||
loaders: |
|
||||
fabric
|
||||
game-versions: |
|
||||
1.21.5
|
||||
java: 21
|
||||
@@ -44,18 +44,22 @@ jobs:
|
||||
paper
|
||||
fabric-1.21.1
|
||||
fabric-1.21.4
|
||||
fabric-1.21.5
|
||||
distro-groups: |
|
||||
paper
|
||||
fabric
|
||||
fabric
|
||||
fabric
|
||||
distro-descriptions: |
|
||||
Paper
|
||||
Fabric 1.21.1
|
||||
Fabric 1.21.4
|
||||
Fabric 1.21.5
|
||||
files: |
|
||||
target/HuskHomes-Paper-${{ github.event.release.tag_name }}.jar
|
||||
target/HuskHomes-Fabric-${{ github.event.release.tag_name }}+mc.1.21.1.jar
|
||||
target/HuskHomes-Fabric-${{ github.event.release.tag_name }}+mc.1.21.4.jar
|
||||
target/HuskHomes-Fabric-${{ github.event.release.tag_name }}+mc.1.21.5.jar
|
||||
- name: 'Spigot: Publish to Modrinth & Hangar 🚰'
|
||||
uses: WiIIiam278/mc-publish@hangar
|
||||
with:
|
||||
@@ -99,6 +103,7 @@ jobs:
|
||||
1.21.1
|
||||
1.21.2
|
||||
1.21.4
|
||||
1.21.5
|
||||
java: 17
|
||||
- name: 'Fabric 1.21.1: Publish to Modrinth & CurseForge 🧵'
|
||||
uses: WiIIiam278/mc-publish@hangar
|
||||
@@ -153,4 +158,31 @@ jobs:
|
||||
fabric
|
||||
game-versions: |
|
||||
1.21.4
|
||||
java: 21
|
||||
- name: 'Fabric 1.21.5: Publish to Modrinth & CurseForge 🧵'
|
||||
uses: WiIIiam278/mc-publish@hangar
|
||||
with:
|
||||
modrinth-id: J6U9o3JG
|
||||
modrinth-featured: false
|
||||
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
|
||||
curseforge-id: 849217
|
||||
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
|
||||
dependencies: |
|
||||
fabric-api | requires | *
|
||||
dynmap | suggests | *
|
||||
bluemap | suggests | *
|
||||
pl3xmap | suggests | *
|
||||
luckperms | suggests | *
|
||||
plan | suggests | *
|
||||
impactor | suggests | *
|
||||
placeholder-api | suggests | *
|
||||
files-primary: target/HuskHomes-Fabric-${{ github.event.release.tag_name }}+mc.1.21.5.jar
|
||||
name: HuskHomes (Fabric) v${{ github.event.release.tag_name }}
|
||||
version: ${{ github.event.release.tag_name }}
|
||||
version-type: release
|
||||
changelog: ${{ github.event.release.body }}
|
||||
loaders: |
|
||||
fabric
|
||||
game-versions: |
|
||||
1.21.5
|
||||
java: 21
|
||||
+2
-2
@@ -3,7 +3,7 @@ import org.apache.tools.ant.filters.ReplaceTokens
|
||||
plugins {
|
||||
id 'io.github.goooler.shadow' version '8.1.8'
|
||||
id 'org.cadixdev.licenser' version '0.6.1' apply false
|
||||
id 'fabric-loom' version "$fabric_loom_version" apply false
|
||||
id 'dev.architectury.loom' version '1.9-SNAPSHOT' apply false
|
||||
id 'gg.essential.multi-version.root' apply false
|
||||
id 'org.ajoberstar.grgit' version '5.3.0'
|
||||
id 'maven-publish'
|
||||
@@ -134,7 +134,7 @@ subprojects {
|
||||
|
||||
// Fabric-specific configuration
|
||||
if (project.parent?.name?.equals('fabric')) {
|
||||
apply plugin: 'fabric-loom'
|
||||
apply plugin: 'dev.architectury.loom'
|
||||
compileJava.options.release.set 21
|
||||
version += "+mc.${project.name}"
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ dependencies {
|
||||
implementation 'io.papermc:paperlib:1.0.8'
|
||||
implementation 'space.arim.morepaperlib:morepaperlib:0.4.4'
|
||||
implementation 'net.kyori:adventure-platform-bukkit:4.3.4'
|
||||
implementation 'net.william278.toilet:toilet-bukkit:1.0.12'
|
||||
implementation 'net.william278.toilet:toilet-bukkit:1.0.13'
|
||||
|
||||
compileOnly 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT'
|
||||
compileOnly 'org.jetbrains:annotations:26.0.2'
|
||||
|
||||
+2
-2
@@ -15,11 +15,11 @@ dependencies {
|
||||
exclude module: 'slf4j-api'
|
||||
}
|
||||
|
||||
compileOnlyApi 'net.william278.toilet:toilet-common:1.0.12'
|
||||
compileOnlyApi 'net.william278.toilet:toilet-common:1.0.13'
|
||||
|
||||
compileOnly 'org.jetbrains:annotations:26.0.2'
|
||||
compileOnly 'com.google.guava:guava:33.4.8-jre'
|
||||
compileOnly 'net.kyori:adventure-api:4.20.0'
|
||||
compileOnly 'net.kyori:adventure-api:4.21.0'
|
||||
compileOnly 'net.kyori:adventure-platform-api:4.3.4'
|
||||
compileOnly 'com.github.plan-player-analytics:Plan:5.6.2883'
|
||||
compileOnly 'com.github.BlueMap-Minecraft:BlueMapAPI:2.6.0'
|
||||
|
||||
@@ -21,15 +21,19 @@ package net.william278.huskhomes.hook;
|
||||
|
||||
import net.luckperms.api.LuckPerms;
|
||||
import net.luckperms.api.LuckPermsProvider;
|
||||
import net.luckperms.api.context.DefaultContextKeys;
|
||||
import net.luckperms.api.context.ImmutableContextSet;
|
||||
import net.luckperms.api.model.user.User;
|
||||
import net.luckperms.api.node.Node;
|
||||
import net.luckperms.api.query.QueryOptions;
|
||||
import net.william278.huskhomes.HuskHomes;
|
||||
import net.william278.huskhomes.position.World;
|
||||
import net.william278.huskhomes.user.OnlineUser;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
@PluginHook(
|
||||
name = "LuckPerms",
|
||||
@@ -59,7 +63,7 @@ public class LuckPermsHook extends Hook {
|
||||
if (user == null) {
|
||||
return List.of();
|
||||
}
|
||||
return user.resolveInheritedNodes(QueryOptions.defaultContextualOptions()).stream().filter(Node::getValue)
|
||||
return user.resolveInheritedNodes(QueryOptions.contextual(getContexts(online))).stream().filter(Node::getValue)
|
||||
.filter(n -> n.getKey().startsWith(nodePrefix))
|
||||
.filter(perm -> canParse(perm, nodePrefix))
|
||||
.map(perm -> Integer.parseInt(perm.getKey().substring(nodePrefix.length())))
|
||||
@@ -67,6 +71,17 @@ public class LuckPermsHook extends Hook {
|
||||
|
||||
}
|
||||
|
||||
// Get basic contexts for a user
|
||||
@NotNull
|
||||
private static ImmutableContextSet getContexts(@NotNull OnlineUser user) {
|
||||
final World world = user.getPosition().getWorld();
|
||||
return ImmutableContextSet.builder()
|
||||
.add(DefaultContextKeys.WORLD_KEY, world.getName())
|
||||
.add(DefaultContextKeys.SERVER_KEY, user.getPosition().getServer())
|
||||
.add(DefaultContextKeys.DIMENSION_TYPE_KEY, world.getEnvironment().name().toLowerCase(Locale.ENGLISH))
|
||||
.build();
|
||||
}
|
||||
|
||||
// Remove node prefix from the permission and parse as an integer
|
||||
private static boolean canParse(@NotNull Node permission, @NotNull String nodePrefix) {
|
||||
try {
|
||||
|
||||
Whitespace-only changes.
@@ -1,7 +1,7 @@
|
||||
essential.defaults.loom.mappings=net.fabricmc:yarn:1.21.1+build.3:v2
|
||||
|
||||
fabric_loader_version=0.16.9
|
||||
fabric_api_version=0.114.0+1.21.1
|
||||
fabric_loader_version=0.16.10
|
||||
fabric_api_version=0.115.4+1.21.1
|
||||
fabric_permissions_api_version=0.3.1
|
||||
fabric_adventure_platform_version=5.14.1
|
||||
fabric_impactor_api_version=5.3.0
|
||||
|
||||
Whitespace-only changes.
@@ -3,6 +3,6 @@ essential.defaults.loom.mappings=net.fabricmc:yarn:1.21.4+build.8:v2
|
||||
fabric_loader_version=0.16.10
|
||||
fabric_api_version=0.116.1+1.21.4
|
||||
fabric_permissions_api_version=0.3.3
|
||||
fabric_adventure_platform_version=6.2.0
|
||||
fabric_adventure_platform_version=6.3.0
|
||||
fabric_impactor_api_version=5.3.0
|
||||
fabric_placeholder_api_version=2.5.2+1.21.3
|
||||
@@ -0,0 +1,8 @@
|
||||
essential.defaults.loom.mappings=net.fabricmc:yarn:1.21.5+build.1:v2
|
||||
|
||||
fabric_loader_version=0.16.14
|
||||
fabric_api_version=0.122.0+1.21.5
|
||||
fabric_permissions_api_version=0.3.3
|
||||
fabric_adventure_platform_version=6.4.0-SNAPSHOT
|
||||
fabric_impactor_api_version=5.3.0
|
||||
fabric_placeholder_api_version=2.6.3+1.21.5
|
||||
+1
-1
@@ -16,7 +16,7 @@ dependencies {
|
||||
modImplementation include("me.lucko:fabric-permissions-api:${fabric_permissions_api_version}")
|
||||
modImplementation include("eu.pb4:placeholder-api:${fabric_placeholder_api_version}")
|
||||
modImplementation include("net.impactdev.impactor.api:economy:${fabric_impactor_api_version}")
|
||||
modImplementation include("net.william278.toilet:toilet-fabric:1.0.12+$project.name")
|
||||
modImplementation include("net.william278.toilet:toilet-fabric:1.0.13+$project.name")
|
||||
modImplementation include("com.github.PokeSkies:FabricPluginMessaging:f621c4fcf6")
|
||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_api_version}"
|
||||
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
1.21.4
|
||||
1.21.5
|
||||
+3
-1
@@ -3,9 +3,11 @@ plugins {
|
||||
}
|
||||
|
||||
preprocess {
|
||||
def fabric12105 = createNode("1.21.5", 12105, "yarn")
|
||||
def fabric12104 = createNode("1.21.4", 12104, "yarn")
|
||||
def fabric12101 = createNode("1.21.1", 12101, "yarn")
|
||||
|
||||
strictExtraMappings.set(true)
|
||||
fabric12101.link(fabric12104, null)
|
||||
fabric12104.link(fabric12105, null)
|
||||
fabric12101.link(fabric12105, null)
|
||||
}
|
||||
@@ -32,7 +32,7 @@ import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.fabricmc.loader.api.ModContainer;
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
//#if MC==12104
|
||||
//#if MC>=12104
|
||||
import net.kyori.adventure.platform.modcommon.MinecraftServerAudiences;
|
||||
//#else
|
||||
//$$ import net.kyori.adventure.platform.fabric.FabricServerAudiences;
|
||||
@@ -98,7 +98,7 @@ public class FabricHuskHomes implements DedicatedServerModInitializer, HuskHomes
|
||||
.orElseThrow(() -> new RuntimeException("Failed to get Mod Container"));
|
||||
private final Map<String, Boolean> permissions = Maps.newHashMap();
|
||||
|
||||
//#if MC==12104
|
||||
//#if MC>=12104
|
||||
private MinecraftServerAudiences audiences;
|
||||
//#else
|
||||
//$$ private FabricServerAudiences audiences;
|
||||
@@ -149,7 +149,7 @@ public class FabricHuskHomes implements DedicatedServerModInitializer, HuskHomes
|
||||
private void onEnable(@NotNull MinecraftServer server) {
|
||||
this.minecraftServer = server;
|
||||
this.toilet = FabricToilet.create(getDumpOptions(), server);
|
||||
//#if MC==12104
|
||||
//#if MC>=12104
|
||||
this.audiences = MinecraftServerAudiences.of(minecraftServer);
|
||||
//#else
|
||||
//$$ this.audiences = FabricServerAudiences.of(minecraftServer);
|
||||
|
||||
@@ -25,6 +25,7 @@ import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
|
||||
import net.fabricmc.fabric.api.util.TriState;
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
@@ -68,17 +69,25 @@ public class FabricUser extends OnlineUser {
|
||||
|
||||
@Override
|
||||
public Optional<Position> getBedSpawnPosition() {
|
||||
final BlockPos spawn = player.getSpawnPointPosition();
|
||||
if (spawn == null) {
|
||||
//#if MC<=12104
|
||||
//$$ final BlockPos spawn = player.getSpawnPointPosition();
|
||||
//$$ final float angle = player.getSpawnAngle();
|
||||
//$$ final RegistryKey<net.minecraft.world.World> world = player.getSpawnPointDimension();
|
||||
//#else
|
||||
final BlockPos spawn = player.getRespawn() == null ? null : player.getRespawn().pos();
|
||||
final float angle = player.getRespawn() == null ? 0 : player.getRespawn().angle();
|
||||
final RegistryKey<net.minecraft.world.World> world = player.getRespawn() == null ? null : player.getRespawn().dimension();
|
||||
//#endif
|
||||
if (spawn == null || world == null) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
return Optional.of(Position.at(
|
||||
spawn.getX(), spawn.getY(), spawn.getZ(),
|
||||
player.getSpawnAngle(), 0,
|
||||
angle, 0,
|
||||
World.from(
|
||||
player.getSpawnPointDimension().getValue().asString(),
|
||||
UUID.nameUUIDFromBytes(player.getSpawnPointDimension().getValue().asString().getBytes())
|
||||
world.getValue().asString(),
|
||||
UUID.nameUUIDFromBytes(world.getValue().asString().getBytes())
|
||||
),
|
||||
plugin.getServerName()
|
||||
));
|
||||
@@ -152,7 +161,7 @@ public class FabricUser extends OnlineUser {
|
||||
plugin.runSync(() -> {
|
||||
player.stopRiding();
|
||||
player.getPassengerList().forEach(Entity::stopRiding);
|
||||
//#if MC==12104
|
||||
//#if MC>=12104
|
||||
player.teleport(
|
||||
world, location.getX(), location.getY(), location.getZ(),
|
||||
Set.of(),
|
||||
|
||||
+5
-5
@@ -4,17 +4,17 @@ org.gradle.daemon=true
|
||||
javaVersion=21
|
||||
|
||||
# Plugin metadata
|
||||
plugin_version=4.9.5
|
||||
plugin_version=4.9.6
|
||||
plugin_archive=huskhomes
|
||||
plugin_description=The powerful & intuitive homes, warps, and teleportation suite
|
||||
|
||||
# General settings
|
||||
jedis_version=5.2.0
|
||||
mysql_driver_version=9.2.0
|
||||
mariadb_driver_version=3.5.2
|
||||
jedis_version=6.0.0
|
||||
mysql_driver_version=9.3.0
|
||||
mariadb_driver_version=3.5.3
|
||||
sqlite_driver_version=3.49.1.0
|
||||
h2_driver_version=2.3.232
|
||||
postgresql_driver_version=42.7.5
|
||||
|
||||
# Fabric settings
|
||||
fabric_loom_version=1.9-SNAPSHOT
|
||||
loom.ignoreDependencyLoomVersionValidation=true
|
||||
Reference in new issue
Block a user