mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-03 14:38:53 +00:00
feat: add support for Minecraft 1.21.6
This commit is contained in:
13 files changed
+96
-11
No files matched your search
@@ -65,7 +65,8 @@ public class FabricCommand {
|
||||
final Map<String, Boolean> permissions = command.getAdditionalPermissions();
|
||||
permissions.forEach((permission, isOp) -> plugin.getPermissions().put(permission, isOp));
|
||||
PermissionCheckEvent.EVENT.register((player, node) -> {
|
||||
if (permissions.containsKey(node) && permissions.get(node) && player.hasPermissionLevel(3)) {
|
||||
if (permissions.containsKey(node) && permissions.get(node) &&
|
||||
(!(player instanceof ServerCommandSource source) || source.hasPermissionLevel(3))) {
|
||||
return TriState.TRUE;
|
||||
}
|
||||
return TriState.DEFAULT;
|
||||
|
||||
@@ -61,12 +61,21 @@ public class FabricUser extends OnlineUser {
|
||||
public Position getPosition() {
|
||||
return FabricHuskHomes.Adapter.adapt(
|
||||
player.getPos(),
|
||||
player.getServerWorld(),
|
||||
getServerWorld(player),
|
||||
player.getYaw(), player.getPitch(),
|
||||
plugin.getServerName()
|
||||
);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private ServerWorld getServerWorld(ServerPlayerEntity player) {
|
||||
//#if MC <=12104
|
||||
//$$ return player.getServerWorld();
|
||||
//#else
|
||||
return player.getWorld();
|
||||
//#endif
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Position> getBedSpawnPosition() {
|
||||
//#if MC<=12104
|
||||
|
||||
Reference in new issue
Block a user