mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 14:38:53 +00:00
Add support for Minecraft 1.21.11 (#913)
This commit is contained in:
1 parent
50a32dca7d
commit
305dc35011
13 files changed
+157
-23
No files matched your search
@@ -57,24 +57,28 @@ jobs:
|
||||
fabric-1.21.4
|
||||
fabric-1.21.5
|
||||
fabric-1.21.8
|
||||
fabric-1.21.11
|
||||
distro-groups: |
|
||||
paper
|
||||
fabric
|
||||
fabric
|
||||
fabric
|
||||
fabric
|
||||
fabric
|
||||
distro-descriptions: |
|
||||
Paper
|
||||
Fabric 1.21.1
|
||||
Fabric 1.21.4
|
||||
Fabric 1.21.5
|
||||
Fabric 1.21.8
|
||||
Fabric 1.21.11
|
||||
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
|
||||
target/HuskHomes-Fabric-${{ env.version_name }}+mc.1.21.8.jar
|
||||
target/HuskHomes-Fabric-${{ env.version_name }}+mc.1.21.11.jar
|
||||
- name: 'Spigot: Publish to Modrinth & Hangar 🚰'
|
||||
uses: WiIIiam278/mc-publish@hangar
|
||||
with:
|
||||
@@ -122,6 +126,7 @@ jobs:
|
||||
1.21.5
|
||||
1.21.6
|
||||
1.21.8
|
||||
1.21.11
|
||||
java: 17
|
||||
- name: 'Fabric 1.21.1: Publish to Modrinth & CurseForge 🧵'
|
||||
uses: WiIIiam278/mc-publish@hangar
|
||||
@@ -235,3 +240,31 @@ jobs:
|
||||
game-versions: |
|
||||
1.21.8
|
||||
java: 21
|
||||
- name: 'Fabric 1.21.11: 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.11.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.11
|
||||
java: 21
|
||||
@@ -46,24 +46,28 @@ jobs:
|
||||
fabric-1.21.4
|
||||
fabric-1.21.5
|
||||
fabric-1.21.8
|
||||
fabric-1.21.11
|
||||
distro-groups: |
|
||||
paper
|
||||
fabric
|
||||
fabric
|
||||
fabric
|
||||
fabric
|
||||
fabric
|
||||
distro-descriptions: |
|
||||
Paper
|
||||
Fabric 1.21.1
|
||||
Fabric 1.21.4
|
||||
Fabric 1.21.5
|
||||
Fabric 1.21.8
|
||||
Fabric 1.21.11
|
||||
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
|
||||
target/HuskHomes-Fabric-${{ github.event.release.tag_name }}+mc.1.21.8.jar
|
||||
target/HuskHomes-Fabric-${{ github.event.release.tag_name }}+mc.1.21.11.jar
|
||||
- name: 'Spigot: Publish to Modrinth & Hangar 🚰'
|
||||
uses: WiIIiam278/mc-publish@hangar
|
||||
with:
|
||||
@@ -110,6 +114,7 @@ jobs:
|
||||
1.21.5
|
||||
1.21.6
|
||||
1.21.8
|
||||
1.21.11
|
||||
java: 17
|
||||
- name: 'Fabric 1.21.1: Publish to Modrinth & CurseForge 🧵'
|
||||
uses: WiIIiam278/mc-publish@hangar
|
||||
@@ -219,3 +224,30 @@ jobs:
|
||||
game-versions: |
|
||||
1.21.8
|
||||
java: 21
|
||||
- name: 'Fabric 1.21.11: 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.11.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.11
|
||||
java: 21
|
||||
+1
-1
@@ -3,7 +3,7 @@ import org.apache.tools.ant.filters.ReplaceTokens
|
||||
plugins {
|
||||
id 'com.gradleup.shadow' version '9.0.0-beta17'
|
||||
id 'org.cadixdev.licenser' version '0.6.1' apply false
|
||||
id 'dev.architectury.loom' version '1.9-SNAPSHOT' apply false
|
||||
id 'dev.architectury.loom' version '1.13-SNAPSHOT' apply false
|
||||
id 'gg.essential.multi-version.root' apply false
|
||||
id 'org.ajoberstar.grgit' version '5.3.2'
|
||||
id 'maven-publish'
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
essential.defaults.loom.mappings=net.fabricmc:yarn:1.21.11+build.3:v2
|
||||
|
||||
fabric_loader_version=0.18.2
|
||||
fabric_api_version=0.139.5+1.21.11
|
||||
fabric_permissions_api_version=0.6.1
|
||||
fabric_adventure_platform_version=6.8.0
|
||||
fabric_impactor_api_version=5.3.4
|
||||
fabric_placeholder_api_version=2.8.1+1.21.10
|
||||
+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.16+$project.name")
|
||||
modImplementation include("net.william278.toilet:toilet-fabric:1.0.17+$project.name")
|
||||
modImplementation include("com.github.PokeSkies:FabricPluginMessaging:f621c4fcf6")
|
||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_api_version}"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
loom.platform=fabric
|
||||
|
||||
essential.defaults.loom=1
|
||||
essential.defaults.loom.fabric-loader=net.fabricmc:fabric-loader:0.16.10
|
||||
essential.defaults.loom.fabric-loader=net.fabricmc:fabric-loader:0.18.2
|
||||
|
||||
org.gradle.daemon=false
|
||||
org.gradle.parallel=true
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
1.21.8
|
||||
1.21.11
|
||||
+5
-3
@@ -3,13 +3,15 @@ plugins {
|
||||
}
|
||||
|
||||
preprocess {
|
||||
def fabric12111 = createNode("1.21.11", 12108, "yarn")
|
||||
def fabric12108 = createNode("1.21.8", 12108, "yarn")
|
||||
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)
|
||||
fabric12105.link(fabric12108, null)
|
||||
fabric12104.link(fabric12108, null)
|
||||
fabric12101.link(fabric12108, null)
|
||||
fabric12108.link(fabric12111, null)
|
||||
fabric12105.link(fabric12111, null)
|
||||
fabric12104.link(fabric12111, null)
|
||||
fabric12101.link(fabric12111, null)
|
||||
}
|
||||
@@ -46,6 +46,7 @@ import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.TeleportTarget;
|
||||
import net.minecraft.world.WorldProperties;
|
||||
import net.william278.desertwell.util.Version;
|
||||
import net.william278.huskhomes.api.FabricHuskHomesAPI;
|
||||
import net.william278.huskhomes.command.Command;
|
||||
@@ -196,10 +197,19 @@ public class FabricHuskHomes implements DedicatedServerModInitializer, HuskHomes
|
||||
public void setWorldSpawn(@NotNull Position position) {
|
||||
final ServerWorld world = Adapter.adapt(position, minecraftServer);
|
||||
if (world != null) {
|
||||
world.setSpawnPos(
|
||||
//#if MC>=12111
|
||||
world.setSpawnPoint(WorldProperties.SpawnPoint.create(
|
||||
world.getRegistryKey(),
|
||||
BlockPos.ofFloored(position.getX(), position.getY(), position.getZ()),
|
||||
position.getYaw()
|
||||
);
|
||||
position.getYaw(),
|
||||
0
|
||||
));
|
||||
//#else
|
||||
//$$ world.setSpawnPos(
|
||||
//$$ BlockPos.ofFloored(position.getX(), position.getY(), position.getZ()),
|
||||
//$$ position.getYaw()
|
||||
//$$ );
|
||||
//#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,10 @@ import com.mojang.brigadier.tree.LiteralCommandNode;
|
||||
import me.lucko.fabric.api.permissions.v0.PermissionCheckEvent;
|
||||
import me.lucko.fabric.api.permissions.v0.Permissions;
|
||||
import net.fabricmc.fabric.api.util.TriState;
|
||||
//#if MC>=12111
|
||||
import net.minecraft.command.permission.Permission;
|
||||
import net.minecraft.command.permission.PermissionLevel;
|
||||
//#endif
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.william278.huskhomes.FabricHuskHomes;
|
||||
@@ -50,8 +54,16 @@ public class FabricCommand {
|
||||
|
||||
public void register(@NotNull CommandDispatcher<ServerCommandSource> dispatcher) {
|
||||
// Register brigadier command
|
||||
final int permissionLevel = command.isOperatorCommand() ? 3 : 0;
|
||||
final Predicate<ServerCommandSource> predicate = Permissions
|
||||
.require(command.getPermission(), command.isOperatorCommand() ? 3 : 0);
|
||||
.require(
|
||||
command.getPermission(),
|
||||
//#if MC>=1.21.11
|
||||
PermissionLevel.fromLevel(permissionLevel)
|
||||
//#else
|
||||
//$$ permissionLevel
|
||||
//#endif
|
||||
);
|
||||
final LiteralArgumentBuilder<ServerCommandSource> builder = literal(command.getName())
|
||||
.requires(predicate).executes(getBrigadierExecutor());
|
||||
plugin.getPermissions().put(command.getPermission(), command.isOperatorCommand());
|
||||
@@ -66,7 +78,7 @@ public class FabricCommand {
|
||||
permissions.forEach((permission, isOp) -> plugin.getPermissions().put(permission, isOp));
|
||||
PermissionCheckEvent.EVENT.register((player, node) -> {
|
||||
if (permissions.containsKey(node) && permissions.get(node) &&
|
||||
(!(player instanceof ServerCommandSource source) || source.hasPermissionLevel(3))) {
|
||||
(!(player instanceof ServerCommandSource source) || hasPermissionLevel(source, 3))) {
|
||||
return TriState.TRUE;
|
||||
}
|
||||
return TriState.DEFAULT;
|
||||
@@ -84,6 +96,14 @@ public class FabricCommand {
|
||||
});
|
||||
}
|
||||
|
||||
private boolean hasPermissionLevel(ServerCommandSource source, int level) {
|
||||
//#if MC>=12111
|
||||
return source.getPermissions().hasPermission(new Permission.Level(PermissionLevel.fromLevel(level)));
|
||||
//#else
|
||||
//$$ return source.hasPermissionLevel(level);
|
||||
//#endif
|
||||
}
|
||||
|
||||
private com.mojang.brigadier.Command<ServerCommandSource> getBrigadierExecutor() {
|
||||
return (context) -> {
|
||||
command.onExecuted(
|
||||
|
||||
@@ -24,6 +24,10 @@ import me.lucko.fabric.api.permissions.v0.Permissions;
|
||||
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
|
||||
import net.fabricmc.fabric.api.util.TriState;
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
//#if MC>=12111
|
||||
import net.minecraft.command.permission.Permission;
|
||||
import net.minecraft.command.permission.PermissionLevel;
|
||||
//#endif
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
@@ -47,7 +51,11 @@ public class FabricUser extends OnlineUser {
|
||||
private final ServerPlayerEntity player;
|
||||
|
||||
private FabricUser(@NotNull ServerPlayerEntity player, @NotNull FabricHuskHomes plugin) {
|
||||
super(player.getUuid(), player.getGameProfile().getName(), plugin);
|
||||
//#if MC>=12111
|
||||
super(player.getUuid(), player.getGameProfile().name(), plugin);
|
||||
//#else
|
||||
//$$ super(player.getUuid(), player.getGameProfile().getName(), plugin);
|
||||
//#endif
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
@@ -60,7 +68,11 @@ public class FabricUser extends OnlineUser {
|
||||
@Override
|
||||
public Position getPosition() {
|
||||
return FabricHuskHomes.Adapter.adapt(
|
||||
player.getPos(),
|
||||
//#if MC>=12111
|
||||
player.getEntityPos(),
|
||||
//#else
|
||||
//$$ player.getPos(),
|
||||
//#endif
|
||||
getServerWorld(player),
|
||||
player.getYaw(), player.getPitch(),
|
||||
plugin.getServerName()
|
||||
@@ -69,10 +81,12 @@ public class FabricUser extends OnlineUser {
|
||||
|
||||
@NotNull
|
||||
private ServerWorld getServerWorld(ServerPlayerEntity player) {
|
||||
//#if MC <=12104
|
||||
//#if MC <=12105
|
||||
//$$ return player.getServerWorld();
|
||||
//#elseif MC >=12111
|
||||
return player.getEntityWorld();
|
||||
//#else
|
||||
return player.getWorld();
|
||||
//$$ return player.getWorld();
|
||||
//#endif
|
||||
}
|
||||
|
||||
@@ -82,10 +96,14 @@ public class FabricUser extends OnlineUser {
|
||||
//$$ final BlockPos spawn = player.getSpawnPointPosition();
|
||||
//$$ final float angle = player.getSpawnAngle();
|
||||
//$$ final RegistryKey<net.minecraft.world.World> world = player.getSpawnPointDimension();
|
||||
//#elseif MC>=12111
|
||||
final BlockPos spawn = player.getRespawn() == null ? null : player.getRespawn().respawnData().getPos();
|
||||
final float angle = player.getRespawn() == null ? 0 : player.getRespawn().respawnData().yaw();
|
||||
final RegistryKey<net.minecraft.world.World> world = player.getRespawn() == null ? null : player.getRespawn().respawnData().getDimension();
|
||||
//#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();
|
||||
//$$ 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();
|
||||
@@ -115,7 +133,12 @@ public class FabricUser extends OnlineUser {
|
||||
@Override
|
||||
public boolean hasPermission(@NotNull String node) {
|
||||
boolean op = Boolean.TRUE.equals(((FabricHuskHomes) plugin).getPermissions().getOrDefault(node, true));
|
||||
return Permissions.check(player, node, !op || player.hasPermissionLevel(3));
|
||||
//#if MC>=12111
|
||||
boolean hasPermission = player.getPermissions().hasPermission(new Permission.Level(PermissionLevel.fromLevel(3)));
|
||||
//#else
|
||||
//$$ boolean hasPermission = player.hasPermissionLevel(3);
|
||||
//#endif
|
||||
return Permissions.check(player, node, !op || hasPermission);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -157,7 +180,12 @@ public class FabricUser extends OnlineUser {
|
||||
|
||||
@Override
|
||||
public void teleportLocally(@NotNull Location location, boolean async) throws TeleportationException {
|
||||
final MinecraftServer server = player.getServer();
|
||||
//#if MC>=12111
|
||||
final MinecraftServer server = player.getEntityWorld().getServer();
|
||||
//#else
|
||||
//$$ final MinecraftServer server = player.getServer();
|
||||
//#endif
|
||||
|
||||
if (server == null) {
|
||||
throw new TeleportationException(TeleportationException.Type.ILLEGAL_TARGET_COORDINATES, plugin);
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ org.gradle.daemon=true
|
||||
javaVersion=21
|
||||
|
||||
# Plugin metadata
|
||||
plugin_version=4.9.9
|
||||
plugin_version=4.9.10
|
||||
plugin_archive=huskhomes
|
||||
plugin_description=The powerful & intuitive homes, warps, and teleportation suite
|
||||
|
||||
|
||||
+2
-1
@@ -4,11 +4,12 @@ pluginManagement {
|
||||
maven { url 'https://maven.fabricmc.net/' }
|
||||
maven { url 'https://maven.architectury.dev/' }
|
||||
maven { url 'https://maven.minecraftforge.net' }
|
||||
maven { url 'https://repo.william278.net/releases' }
|
||||
maven { url 'https://repo.essential.gg/repository/maven-public' }
|
||||
}
|
||||
|
||||
plugins {
|
||||
def egtVersion = "0.6.5"
|
||||
def egtVersion = "0.6.10-patch2"
|
||||
id("gg.essential.defaults") version egtVersion
|
||||
id("gg.essential.multi-version.root") version egtVersion
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user