Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
// "maven-publish"
kotlin("jvm") version "2.2.20"
id("fabric-loom") version "1.13-SNAPSHOT"
kotlin("jvm") version "2.3.0"
id("net.fabricmc.fabric-loom-remap") version "1.14-SNAPSHOT"
Comment on lines +7 to +8
Copy link

@coderabbitai coderabbitai bot Dec 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify Kotlin 2.3.0 release status
echo "=== Checking Kotlin 2.3.0 ==="
curl -s "https://api.github.com/repos/JetBrains/kotlin/releases" | jq -r '.[] | select(.tag_name | test("v?2\\.3\\.0")) | {tag: .tag_name, prerelease: .prerelease, draft: .draft}'

echo ""
echo "=== Checking fabric-loom-remap versions ==="
curl -s "https://search.maven.org/solrsearch/select?q=g:net.fabricmc+AND+a:fabric-loom-remap&rows=10&wt=json" | jq -r '.response.docs[] | "\(.v)"'

echo ""
echo "=== Checking fabric-loom versions (original plugin) ==="
curl -s "https://search.maven.org/solrsearch/select?q=g:net.fabricmc+AND+a:fabric-loom&rows=10&wt=json" | jq -r '.response.docs[] | "\(.v)"'

Repository: OKTW-Network/Galaxy

Length of output: 590


🏁 Script executed:

#!/bin/bash
# Search for fabric-loom more broadly
echo "=== Searching Maven Central for fabric-loom (all versions) ==="
curl -s "https://search.maven.org/solrsearch/select?q=g:net.fabricmc+AND+a:fabric-loom&rows=50&wt=json" | jq -r '.response.docs[] | "\(.v)"' | head -20

echo ""
echo "=== Searching for any fabric-loom related artifacts ==="
curl -s "https://search.maven.org/solrsearch/select?q=g:net.fabricmc+AND+a:*loom*&rows=20&wt=json" | jq -r '.response.docs[] | "\(.a) - \(.v)"' | sort | uniq

echo ""
echo "=== Checking Gradle Plugin Portal for fabric-loom ==="
curl -s "https://plugins.gradle.org/api/plugins?query=fabric-loom" | jq -r '.plugins[].id' | head -10

Repository: OKTW-Network/Galaxy

Length of output: 369


🏁 Script executed:

#!/bin/bash
# Read the build.gradle.kts file
echo "=== Full build.gradle.kts content ==="
cat build.gradle.kts

echo ""
echo "=== Checking Fabric GitHub for loom plugin ==="
curl -s "https://api.github.com/repos/FabricMC/fabric-loom/releases" | jq -r '.[0:5] | .[] | {tag: .tag_name, prerelease: .prerelease}' 2>/dev/null || echo "Could not fetch Fabric Loom releases"

echo ""
echo "=== Checking for fabric-loom-remap in Fabric org ==="
curl -s "https://api.github.com/orgs/FabricMC/repos?type=all" | jq -r '.[] | .name' | grep -i loom

Repository: OKTW-Network/Galaxy

Length of output: 2439


Correct the plugin ID and use the stable Fabric Loom version.

The plugin ID net.fabricmc.fabric-loom-remap does not exist; it should be net.fabricmc.fabric-loom. Additionally, use the stable version 1.14 instead of the snapshot 1.14-SNAPSHOT.

    kotlin("jvm") version "2.3.0"
    id("net.fabricmc.fabric-loom") version "1.14"
🤖 Prompt for AI Agents
In build.gradle.kts around lines 7 to 8, the plugin declaration uses the wrong
ID and a snapshot version; replace id("net.fabricmc.fabric-loom-remap") with
id("net.fabricmc.fabric-loom") and change the version from "1.14-SNAPSHOT" to
the stable "1.14" so the correct Fabric Loom plugin and stable release are
applied.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai 1.14-SNAPSHOT is recommended by fabric document, and name is changing based on changelog, net.fabricmc.fabric-loom is for non-obfuscated versions.

New plugin IDs:

  • net.fabricmc.fabric-loom to be used for non-obfuscated versions
  • net.fabricmc.fabric-loom-remap to be used for obfuscated versions of Minecraft
  • fabric-loom remains to preserve backwards compatibility with existing projects

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jimchen5209, thank you for the correction! You're absolutely right. Minecraft 1.21.11 is still obfuscated and will be the last obfuscated version, and developers should use Loom 1.14. Since you're working with an obfuscated version, using net.fabricmc.fabric-loom-remap is the correct choice, and the 1.14-SNAPSHOT version is actively maintained.

I apologize for the confusion in my initial review. Your configuration is correct for Minecraft 1.21.11.


✏️ Learnings added
Learnt from: jimchen5209
Repo: OKTW-Network/Galaxy PR: 475
File: build.gradle.kts:7-8
Timestamp: 2025-12-26T14:03:59.485Z
Learning: Fabric Loom 1.14 introduced new plugin IDs: `net.fabricmc.fabric-loom` for non-obfuscated Minecraft versions, `net.fabricmc.fabric-loom-remap` for obfuscated versions, and `fabric-loom` for backwards compatibility. Minecraft 1.21.11 is the last obfuscated version, so projects targeting it should use `net.fabricmc.fabric-loom-remap`.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

}

val version = "0.0.1"
val group = "one.oktw"

val minecraftVersion = "1.21.10"
val fabricLoaderVersion = "0.17.3"
val fabricAPIVersion = "0.138.3+1.21.10"
val galaxyLibVersion = "f4e1b25"
val minecraftVersion = "1.21.11"
val fabricLoaderVersion = "0.18.3"
val fabricAPIVersion = "0.140.0+1.21.11"
val galaxyLibVersion = "2235da5"

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion docker
Submodule docker updated 1 files
+6 −6 Dockerfile
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

package one.oktw.galaxy.mixin.tweak;

import net.minecraft.Util;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.IntTag;
import net.minecraft.nbt.StreamTagVisitor;
import net.minecraft.nbt.visitors.CollectFields;
import net.minecraft.nbt.visitors.FieldSelector;
import net.minecraft.util.Tuple;
import net.minecraft.util.Util;
import net.minecraft.util.thread.PriorityConsecutiveExecutor;
import net.minecraft.util.thread.StrictQueue;
import net.minecraft.world.level.ChunkPos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import net.fabricmc.fabric.api.event.registry.RegistryAttributeHolder;
import net.fabricmc.fabric.impl.registry.sync.RegistrySyncManager;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.Identifier;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

Expand All @@ -43,9 +43,9 @@ private static boolean skipRegistryWithoutModded(RegistryAttributeHolder instanc
}

// TODO(Ravel): no target class
@WrapOperation(method = "createAndPopulateRegistryMap", at = @At(value = "INVOKE", target = "Lnet/minecraft/core/Registry;getKey(Ljava/lang/Object;)Lnet/minecraft/resources/ResourceLocation;"), require = 0)
private static ResourceLocation skipGalaxyEntries(Registry<?> instance, Object t, Operation<ResourceLocation> original) {
ResourceLocation id = original.call(instance, t);
@WrapOperation(method = "createAndPopulateRegistryMap", at = @At(value = "INVOKE", target = "Lnet/minecraft/core/Registry;getKey(Ljava/lang/Object;)Lnet/minecraft/resources/Identifier;"), require = 0)
Comment on lines 45 to 46

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The TODO comment and require = 0 suggest that this WrapOperation might not be applying correctly. The target string seems to use Yarn names (net.minecraft.resources.Identifier), but if the project is configured to use official Mojang mappings, this could cause issues during the build process if the names aren't resolved correctly.

To ensure this mixin applies correctly, you should verify the target method signature. With official mappings, it should be Lnet/minecraft/core/Registry;getKey(Ljava/lang/Object;)Lnet/minecraft/resources/ResourceLocation;. If you are indeed using Yarn names, the current target might be correct, but the TODO indicates a potential problem worth investigating. If this mixin is intended to be optional, it's fine, but if its logic is important, this could lead to unexpected behavior.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gemini-code-assist ResourceLocation is renamed back to Identifier in 1.21.11

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the clarification! You are correct; ResourceLocation was indeed renamed back to Identifier in Minecraft 1.21.11. My apologies for the oversight. The current target Lnet/minecraft/core/Registry;getKey(Ljava/lang/Object;)Lnet/minecraft/resources/Identifier; is correct for this version.

The TODO(Ravel): no target class comment still suggests there might be an underlying reason for require = 0 or a potential issue with the mixin's application, but the specific naming concern I raised is resolved.

private static Identifier skipGalaxyEntries(Registry<?> instance, Object t, Operation<Identifier> original) {
Identifier id = original.call(instance, t);
if (id.getNamespace().equals("galaxy")) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
package one.oktw.galaxy.mixin.tweak;

import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.projectile.Arrow;
import net.minecraft.world.entity.projectile.SpectralArrow;
import net.minecraft.world.entity.projectile.arrow.Arrow;
import net.minecraft.world.entity.projectile.arrow.SpectralArrow;
import one.oktw.galaxy.mixin.interfaces.IThrownCountdown_Entity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
*/
package org.spongepowered.common.mixin.realtime.entity.mob;

import net.minecraft.world.entity.monster.ZombieVillager;
import net.minecraft.world.entity.monster.zombie.ZombieVillager;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -59,7 +59,7 @@ public abstract class ZombieVillagerMixin_RealTime extends LivingEntityMixin_Rea
method = "tick",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/entity/monster/ZombieVillager;getConversionProgress()I",
target = "Lnet/minecraft/world/entity/monster/zombie/ZombieVillager;getConversionProgress()I",
ordinal = 0
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
import net.minecraft.resources.ResourceKey;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.GameRules;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.dimension.DimensionType;
import net.minecraft.world.level.gamerules.GameRules;
import net.minecraft.world.level.storage.ServerLevelData;
import net.minecraft.world.level.storage.WritableLevelData;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -80,7 +80,7 @@ protected ServerLevelMixin_RealTime(WritableLevelData properties, ResourceKey<Le

@Inject(method = "tickTime", at = @At("HEAD"))
private void realTimeImpl$fixTimeOfDayForRealTime(CallbackInfo ci) {
if (this.serverLevelData.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) {
if (this.serverLevelData.getGameRules().get(GameRules.ADVANCE_TIME)) {
// Subtract the one the original tick method is going to add
long diff = this.realTimeBridge$getRealTimeTicks() - 1;
// Don't set if we're not changing it as other mods might be listening for changes
Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/one/oktw/galaxy/block/CustomBlock.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import net.fabricmc.fabric.api.`object`.builder.v1.block.entity.FabricBlockEntit
import net.minecraft.core.BlockPos
import net.minecraft.core.Registry
import net.minecraft.core.registries.BuiltInRegistries
import net.minecraft.resources.ResourceLocation
import net.minecraft.resources.Identifier
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.Blocks.*
import net.minecraft.world.level.block.entity.BlockEntityType
Expand All @@ -31,8 +31,8 @@ import one.oktw.galaxy.item.CustomBlockItem
import one.oktw.galaxy.util.CustomRegistry
import one.oktw.galaxy.util.Registrable

open class CustomBlock(final override val identifier: ResourceLocation, val baseBlock: Block = BARRIER) : Registrable {
constructor(id: String, baseBlock: Block = BARRIER) : this(ResourceLocation.fromNamespaceAndPath("galaxy", "block/$id"), baseBlock)
open class CustomBlock(final override val identifier: Identifier, val baseBlock: Block = BARRIER) : Registrable {
constructor(id: String, baseBlock: Block = BARRIER) : this(Identifier.fromNamespaceAndPath("galaxy", "block/$id"), baseBlock)

protected val blockEntityType: BlockEntityType<CustomBlockEntity> = Registry.register(
BuiltInRegistries.BLOCK_ENTITY_TYPE,
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/one/oktw/galaxy/block/DummyBlock.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
package one.oktw.galaxy.block

import net.minecraft.core.BlockPos
import net.minecraft.resources.ResourceLocation
import net.minecraft.resources.Identifier
import one.oktw.galaxy.block.entity.DummyBlockEntity

class DummyBlock : CustomBlock(ResourceLocation.fromNamespaceAndPath("galaxy", "block/dummy")) {
class DummyBlock : CustomBlock(Identifier.fromNamespaceAndPath("galaxy", "block/dummy")) {
override fun createBlockEntity(pos: BlockPos) = DummyBlockEntity(blockEntityType, pos)
}
6 changes: 3 additions & 3 deletions src/main/kotlin/one/oktw/galaxy/block/ModelCustomBlock.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
package one.oktw.galaxy.block

import net.minecraft.core.BlockPos
import net.minecraft.resources.ResourceLocation
import net.minecraft.resources.Identifier
import net.minecraft.world.item.ItemStack
import net.minecraft.world.level.block.Blocks.BARRIER
import one.oktw.galaxy.block.entity.CustomBlockEntity
import one.oktw.galaxy.block.entity.ModelCustomBlockEntity
import one.oktw.galaxy.item.CustomBlockItem
import one.oktw.galaxy.item.CustomItemHelper

open class ModelCustomBlock(identifier: ResourceLocation, protected open val modelItem: ItemStack) : CustomBlock(identifier, BARRIER) {
constructor(id: String, modelItem: ItemStack) : this(ResourceLocation.fromNamespaceAndPath("galaxy", "block/$id"), modelItem)
open class ModelCustomBlock(identifier: Identifier, protected open val modelItem: ItemStack) : CustomBlock(identifier, BARRIER) {
constructor(id: String, modelItem: ItemStack) : this(Identifier.fromNamespaceAndPath("galaxy", "block/$id"), modelItem)

override fun toItem() = modelItem.let { CustomItemHelper.getItem(it) as? CustomBlockItem }

Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/one/oktw/galaxy/block/TrashcanBlock.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
package one.oktw.galaxy.block

import net.minecraft.core.BlockPos
import net.minecraft.resources.ResourceLocation
import net.minecraft.resources.Identifier
import net.minecraft.world.item.ItemStack
import one.oktw.galaxy.block.entity.CustomBlockEntity
import one.oktw.galaxy.block.entity.TrashcanBlockEntity

class TrashcanBlock(id: String, modelItem: ItemStack) : ModelCustomBlock(ResourceLocation.fromNamespaceAndPath("galaxy", "block/$id"), modelItem) {
class TrashcanBlock(id: String, modelItem: ItemStack) : ModelCustomBlock(Identifier.fromNamespaceAndPath("galaxy", "block/$id"), modelItem) {
override fun createBlockEntity(pos: BlockPos): CustomBlockEntity {
return TrashcanBlockEntity(blockEntityType, pos, modelItem)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package one.oktw.galaxy.block.entity

import net.minecraft.core.BlockPos
import net.minecraft.resources.ResourceLocation
import net.minecraft.resources.Identifier
import net.minecraft.world.level.block.entity.BlockEntityType
import net.minecraft.world.level.storage.ValueInput
import net.minecraft.world.level.storage.ValueOutput
Expand All @@ -28,7 +28,7 @@ import one.oktw.galaxy.block.CustomBlock
class DummyBlockEntity(type: BlockEntityType<*>, pos: BlockPos) : CustomBlockEntity(type, pos) {
override fun loadAdditional(view: ValueInput) {
super.loadAdditional(view)
view.getStringOr("id", "")?.let(ResourceLocation::tryParse)?.let(CustomBlock.registry::get)?.let {
view.getStringOr("id", "").let(Identifier::tryParse)?.let(CustomBlock.registry::get)?.let {
if (it != CustomBlock.DUMMY) {
level?.removeBlockEntity(worldPosition)
level?.setBlockEntity(it.createBlockEntity(worldPosition).apply { readCopyableData(view) })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import kotlinx.coroutines.*
import net.minecraft.core.BlockPos
import net.minecraft.core.component.DataComponents.ITEM_NAME
import net.minecraft.network.chat.Component
import net.minecraft.resources.ResourceLocation
import net.minecraft.resources.Identifier
import net.minecraft.server.level.ServerPlayer
import net.minecraft.world.InteractionHand
import net.minecraft.world.InteractionResult
Expand Down Expand Up @@ -60,7 +60,7 @@ class HTCraftingTableBlockEntity(type: BlockEntityType<*>, pos: BlockPos, modelI
val itemBrowser = CustomItemBrowser(filterRecipe = true)
return GUI.Builder(MenuType.GENERIC_9x3)
.setTitle(Component.translatable("UI.Title.HiTechCraftingTableList"))
.setBackground("A", ResourceLocation.fromNamespaceAndPath("galaxy", "gui_font/container_layout/ht_crafting_table"))
.setBackground("A", Identifier.fromNamespaceAndPath("galaxy", "gui_font/container_layout/ht_crafting_table"))
.blockEntity(this)
.build()
.apply {
Expand Down Expand Up @@ -135,7 +135,7 @@ class HTCraftingTableBlockEntity(type: BlockEntityType<*>, pos: BlockPos, modelI
val gui =
GUI.Builder(MenuType.GENERIC_9x3)
.setTitle(Component.translatable("UI.Title.HiTechCraftingTableRecipe", recipe.outputItem.getName()))
.setBackground("B", ResourceLocation.fromNamespaceAndPath("galaxy", "gui_font/container_layout/ht_crafting_table"))
.setBackground("B", Identifier.fromNamespaceAndPath("galaxy", "gui_font/container_layout/ht_crafting_table"))
.blockEntity(this)
.addSlot(7, 1, object : Slot(output, 0, 0, 0) {
override fun mayPlace(stack: ItemStack) = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import net.minecraft.core.component.DataComponentGetter
import net.minecraft.core.component.DataComponentMap
import net.minecraft.core.component.DataComponents
import net.minecraft.network.chat.Component
import net.minecraft.resources.ResourceLocation
import net.minecraft.resources.Identifier
import net.minecraft.server.level.ServerLevel
import net.minecraft.server.level.ServerPlayer
import net.minecraft.world.*
Expand Down Expand Up @@ -62,7 +62,7 @@ class HarvestBlockEntity(type: BlockEntityType<*>, pos: BlockPos, modelItem: Ite
private var rangeCache = 0

private val gui = GUI.Builder(MenuType.GENERIC_9x3).setTitle(Component.translatable("block.HARVEST"))
.setBackground("A", ResourceLocation.fromNamespaceAndPath("galaxy", "gui_font/container_layout/harvest")).blockEntity(this).apply {
.setBackground("A", Identifier.fromNamespaceAndPath("galaxy", "gui_font/container_layout/harvest")).blockEntity(this).apply {
addSlot(4, 0, object : Slot(this@HarvestBlockEntity, TOOL_SLOT.first, 0, 0) { // Tool
override fun mayPlace(item: ItemStack) = isHoe(item)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import net.minecraft.core.component.DataComponentGetter
import net.minecraft.core.component.DataComponentMap
import net.minecraft.core.component.DataComponents
import net.minecraft.network.chat.Component
import net.minecraft.resources.ResourceLocation
import net.minecraft.resources.Identifier
import net.minecraft.server.level.ServerPlayer
import net.minecraft.world.Container
import net.minecraft.world.ContainerHelper
Expand Down Expand Up @@ -70,7 +70,7 @@ class TestGuiBlockEntity(type: BlockEntityType<*>, pos: BlockPos, modelItem: Ite

private val gui = GUI.Builder(MenuType.GENERIC_9x6)
.setTitle(Component.literal("Test GUI"))
.setBackground("A", ResourceLocation.fromNamespaceAndPath("galaxy", "gui_font/container_layout/test_gui"))
.setBackground("A", Identifier.fromNamespaceAndPath("galaxy", "gui_font/container_layout/test_gui"))
.blockEntity(this)
.apply {
var i = 0
Expand All @@ -94,7 +94,7 @@ class TestGuiBlockEntity(type: BlockEntityType<*>, pos: BlockPos, modelItem: Ite

private val gui2 = GUI.Builder(MenuType.GENERIC_9x4)
.setTitle(Component.literal("Test GUI2"))
.setBackground("B", ResourceLocation.fromNamespaceAndPath("galaxy", "gui_font/container_layout/test_gui"))
.setBackground("B", Identifier.fromNamespaceAndPath("galaxy", "gui_font/container_layout/test_gui"))
.blockEntity(this)
.apply {
var i = 0
Expand All @@ -111,7 +111,7 @@ class TestGuiBlockEntity(type: BlockEntityType<*>, pos: BlockPos, modelItem: Ite
}
private val gui3 = GUI.Builder(MenuType.ANVIL)
.setTitle(Component.literal("Test GUI3"))
.setBackground("C", ResourceLocation.fromNamespaceAndPath("galaxy", "gui_font/container_layout/test_gui"))
.setBackground("C", Identifier.fromNamespaceAndPath("galaxy", "gui_font/container_layout/test_gui"))
.blockEntity(this).build()
.apply {
editInventory {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package one.oktw.galaxy.block.entity

import net.minecraft.core.BlockPos
import net.minecraft.network.chat.Component
import net.minecraft.resources.ResourceLocation
import net.minecraft.resources.Identifier
import net.minecraft.server.level.ServerPlayer
import net.minecraft.world.Container
import net.minecraft.world.InteractionHand
Expand Down Expand Up @@ -65,7 +65,7 @@ class TrashcanBlockEntity(type: BlockEntityType<*>, pos: BlockPos, modelItem: It
val gui = GUI
.Builder(MenuType.GENERIC_9x6)
.setTitle(Component.translatable("block.TRASHCAN"))
.setBackground("A", ResourceLocation.fromNamespaceAndPath("galaxy", "gui_font/container_layout/trashcan"))
.setBackground("A", Identifier.fromNamespaceAndPath("galaxy", "gui_font/container_layout/trashcan"))
.blockEntity(this)
.apply {
var i = 0
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/one/oktw/galaxy/command/commands/Admin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Admin : Command {
override fun register(dispatcher: CommandDispatcher<CommandSourceStack>) {
dispatcher.register(
Commands.literal("admin")
.requires { source -> source.hasPermission(2) }
.requires(Commands.hasPermission(Commands.LEVEL_GAMEMASTERS))
.then(Creative().command)
.then(GetItem().command)
.then(RegisterBlock.command)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import net.minecraft.commands.CommandSourceStack
import net.minecraft.commands.Commands
import net.minecraft.core.component.DataComponents.ITEM_NAME
import net.minecraft.network.chat.Component
import net.minecraft.resources.ResourceLocation
import net.minecraft.resources.Identifier
import net.minecraft.world.SimpleContainer
import net.minecraft.world.entity.player.Player
import net.minecraft.world.inventory.ClickType
Expand Down Expand Up @@ -55,7 +55,7 @@ class Creative {
val inventory = SimpleContainer(6 * 3)
return GUI.Builder(MenuType.GENERIC_9x3)
.setTitle(Component.literal("Galaxy"))
.setBackground("A", ResourceLocation.fromNamespaceAndPath("galaxy", "gui_font/container_layout/ht_crafting_table"))
.setBackground("A", Identifier.fromNamespaceAndPath("galaxy", "gui_font/container_layout/ht_crafting_table"))
.apply {
var i = 0
for (y in 0..2) for (x in 2..7) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import com.mojang.brigadier.Command
import com.mojang.brigadier.builder.LiteralArgumentBuilder
import net.minecraft.commands.CommandSourceStack
import net.minecraft.commands.Commands
import net.minecraft.commands.arguments.ResourceLocationArgument
import net.minecraft.commands.arguments.IdentifierArgument
import net.minecraft.network.chat.Component
import net.minecraft.sounds.SoundEvents
import net.minecraft.sounds.SoundSource
Expand All @@ -31,7 +31,7 @@ import one.oktw.galaxy.item.CustomItem
class GetItem {
val command: LiteralArgumentBuilder<CommandSourceStack> = Commands.literal("getItem")
.then(
Commands.argument("item", ResourceLocationArgument.id())
Commands.argument("item", IdentifierArgument.id())
.suggests { _, builder ->
CustomItem.registry.getAll().keys.forEach { identifier ->
if (identifier.toString().contains(builder.remaining, ignoreCase = true)) {
Expand All @@ -41,7 +41,7 @@ class GetItem {
return@suggests builder.buildFuture()
}
.executes {
val identifier = ResourceLocationArgument.getId(it, "item")
val identifier = IdentifierArgument.getId(it, "item")
val item = CustomItem.registry.get(identifier)

if (item == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import com.mojang.brigadier.Command
import com.mojang.brigadier.builder.LiteralArgumentBuilder
import net.minecraft.commands.CommandSourceStack
import net.minecraft.commands.Commands
import net.minecraft.commands.arguments.ResourceLocationArgument
import net.minecraft.commands.arguments.IdentifierArgument
import net.minecraft.commands.arguments.coordinates.BlockPosArgument
import net.minecraft.network.chat.Component
import one.oktw.galaxy.block.CustomBlock
Expand All @@ -37,7 +37,7 @@ class RegisterBlock {
}

private val block =
Commands.argument("block", ResourceLocationArgument.id())
Commands.argument("block", IdentifierArgument.id())
.suggests { _, builder ->
CustomBlock.registry.getAll().keys.forEach { identifier ->
if (identifier.toString().contains(builder.remaining, ignoreCase = true)) {
Expand All @@ -47,7 +47,7 @@ class RegisterBlock {
return@suggests builder.buildFuture()
}
.executes {
val identifier = ResourceLocationArgument.getId(it, "block")
val identifier = IdentifierArgument.getId(it, "block")
val block = CustomBlock.registry.get(identifier)

if (block == null) {
Expand Down
Loading