From 51624c4dd157a89e494b6028a1ac8cad676b4006 Mon Sep 17 00:00:00 2001 From: jimchen5209 Date: Wed, 4 Dec 2024 21:22:30 +0800 Subject: [PATCH 01/11] feat(docker): bump minecraft to 1.21.4 --- docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker b/docker index f92d0ae1b..a02175fab 160000 --- a/docker +++ b/docker @@ -1 +1 @@ -Subproject commit f92d0ae1b774fb8b9445f018ca6ea8b4e65beb3a +Subproject commit a02175fab49256a3ddfba5fbc226460299b19a70 From 052a62d708eaa855f568611217cf67c6c930a8bb Mon Sep 17 00:00:00 2001 From: jimchen5209 Date: Wed, 4 Dec 2024 21:33:08 +0800 Subject: [PATCH 02/11] build: bump galaxy lib to bcf8f61 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 09ebb2f63..f4960e2d4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,7 +12,7 @@ val version = "0.0.1" val group = "one.oktw" val fabricVersion = "0.108.0+1.21.3" -val galaxyLibVersion = "c328418" +val galaxyLibVersion = "bcf8f61" repositories { mavenCentral() From ab30fcf6eb6effa9f74384c1e5dc81e3368f76d3 Mon Sep 17 00:00:00 2001 From: jimchen5209 Date: Wed, 4 Dec 2024 21:53:41 +0800 Subject: [PATCH 03/11] build: bump jvm to 2.1.0 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index f4960e2d4..e4a4df7d9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { // "maven-publish" - kotlin("jvm") version "2.0.21" + kotlin("jvm") version "2.1.0" id("fabric-loom") version "1.8-SNAPSHOT" } From 9b31ced1220a2f1a22235221954484d86c4c9a22 Mon Sep 17 00:00:00 2001 From: jimchen5209 Date: Wed, 4 Dec 2024 21:54:01 +0800 Subject: [PATCH 04/11] build: bump gradle to 8.11.1 --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index df97d72b8..e2847c820 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From 7ba103eb41465a813632a278ed8e3202a66c70a8 Mon Sep 17 00:00:00 2001 From: jimchen5209 Date: Wed, 4 Dec 2024 22:16:31 +0800 Subject: [PATCH 05/11] feat: bump minecraft to 1.21.4 --- build.gradle.kts | 8 ++++---- .../AbstractFurnaceBlockEntityAccessor.java | 12 ++++++------ ...stractFurnaceBlockEntityMixin_RealTime.java | 18 +++++++++--------- .../block/entity/ModelCustomBlockEntity.kt | 4 ++-- .../kotlin/one/oktw/galaxy/item/CustomItem.kt | 4 ++-- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index e4a4df7d9..d27152b4a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,13 +5,13 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { // "maven-publish" kotlin("jvm") version "2.1.0" - id("fabric-loom") version "1.8-SNAPSHOT" + id("fabric-loom") version "1.9-SNAPSHOT" } val version = "0.0.1" val group = "one.oktw" -val fabricVersion = "0.108.0+1.21.3" +val fabricVersion = "0.110.5+1.21.4" val galaxyLibVersion = "bcf8f61" repositories { @@ -42,8 +42,8 @@ loom { dependencies { // Core - minecraft(group = "com.mojang", name = "minecraft", version = "1.21.3") - mappings(group = "net.fabricmc", name = "yarn", version = "1.21.3+build.2", classifier = "v2") + minecraft(group = "com.mojang", name = "minecraft", version = "1.21.4") + mappings(group = "net.fabricmc", name = "yarn", version = "1.21.4+build.1", classifier = "v2") modImplementation(group = "net.fabricmc", name = "fabric-loader", version = "0.16.9") // fabric api diff --git a/src/main/java/org/spongepowered/common/mixin/realtime/accessor/AbstractFurnaceBlockEntityAccessor.java b/src/main/java/org/spongepowered/common/mixin/realtime/accessor/AbstractFurnaceBlockEntityAccessor.java index 84d9953fa..ca17299e8 100644 --- a/src/main/java/org/spongepowered/common/mixin/realtime/accessor/AbstractFurnaceBlockEntityAccessor.java +++ b/src/main/java/org/spongepowered/common/mixin/realtime/accessor/AbstractFurnaceBlockEntityAccessor.java @@ -1,6 +1,6 @@ /* * OKTW Galaxy Project - * Copyright (C) 2018-2020 + * Copyright (C) 2018-2024 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published @@ -25,17 +25,17 @@ @Mixin(AbstractFurnaceBlockEntity.class) public interface AbstractFurnaceBlockEntityAccessor { @Accessor - int getBurnTime(); + int getLitTimeRemaining(); @Accessor - void setBurnTime(int i); + void setLitTimeRemaining(int i); @Accessor - int getCookTime(); + int getCookingTimeSpent(); @Accessor - void setCookTime(int i); + void setCookingTimeSpent(int i); @Accessor - int getCookTimeTotal(); + int getCookingTotalTime(); } diff --git a/src/main/java/org/spongepowered/common/mixin/realtime/blockentity/AbstractFurnaceBlockEntityMixin_RealTime.java b/src/main/java/org/spongepowered/common/mixin/realtime/blockentity/AbstractFurnaceBlockEntityMixin_RealTime.java index 51465c5bb..fd6ab3366 100644 --- a/src/main/java/org/spongepowered/common/mixin/realtime/blockentity/AbstractFurnaceBlockEntityMixin_RealTime.java +++ b/src/main/java/org/spongepowered/common/mixin/realtime/blockentity/AbstractFurnaceBlockEntityMixin_RealTime.java @@ -1,6 +1,6 @@ /* * OKTW Galaxy Project - * Copyright (C) 2018-2021 + * Copyright (C) 2018-2024 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published @@ -57,7 +57,7 @@ public abstract class AbstractFurnaceBlockEntityMixin_RealTime { @Redirect(method = "tick", at = @At( value = "FIELD", - target = "Lnet/minecraft/block/entity/AbstractFurnaceBlockEntity;burnTime:I", + target = "Lnet/minecraft/block/entity/AbstractFurnaceBlockEntity;litTimeRemaining:I", opcode = Opcodes.PUTFIELD, ordinal = 0 ) @@ -66,29 +66,29 @@ public abstract class AbstractFurnaceBlockEntityMixin_RealTime { final int ticks = (int) ((RealTimeTrackingBridge) self.getWorld()).realTimeBridge$getRealTimeTicks(); AbstractFurnaceBlockEntityAccessor accessor = (AbstractFurnaceBlockEntityAccessor) self; - final int burnTime = accessor.getBurnTime(); + final int burnTime = accessor.getLitTimeRemaining(); if (burnTime != 1 && burnTime < ticks) { - accessor.setBurnTime(1); // last cook tick + accessor.setLitTimeRemaining(1); // last cook tick } else { - accessor.setBurnTime(Math.max(0, burnTime - ticks)); + accessor.setLitTimeRemaining(Math.max(0, burnTime - ticks)); } } @Redirect( method = "tick", - at = @At(value = "FIELD", target = "Lnet/minecraft/block/entity/AbstractFurnaceBlockEntity;cookTime:I", opcode = Opcodes.PUTFIELD, ordinal = 0)) + at = @At(value = "FIELD", target = "Lnet/minecraft/block/entity/AbstractFurnaceBlockEntity;cookingTimeSpent:I", opcode = Opcodes.PUTFIELD, ordinal = 0)) private static void realTimeImpl$adjustForRealTimeCookTime(final AbstractFurnaceBlockEntity self, final int modifier) { final int ticks = (int) ((RealTimeTrackingBridge) self.getWorld()).realTimeBridge$getRealTimeTicks(); AbstractFurnaceBlockEntityAccessor accessor = (AbstractFurnaceBlockEntityAccessor) self; - accessor.setCookTime(Math.min(accessor.getCookTimeTotal(), accessor.getCookTime() + ticks)); + accessor.setCookingTimeSpent(Math.min(accessor.getCookingTotalTime(), accessor.getCookingTimeSpent() + ticks)); } @Redirect( method = "tick", at = @At( value = "FIELD", - target = "Lnet/minecraft/block/entity/AbstractFurnaceBlockEntity;cookTime:I", + target = "Lnet/minecraft/block/entity/AbstractFurnaceBlockEntity;cookingTimeSpent:I", opcode = Opcodes.PUTFIELD ), slice = @Slice( @@ -106,6 +106,6 @@ public abstract class AbstractFurnaceBlockEntityMixin_RealTime { final int ticks = (int) ((RealTimeTrackingBridge) self.getWorld()).realTimeBridge$getRealTimeTicks(); AbstractFurnaceBlockEntityAccessor accessor = (AbstractFurnaceBlockEntityAccessor) self; - accessor.setCookTime(MathHelper.clamp(accessor.getCookTime() - (2 * ticks), 0, accessor.getCookTimeTotal())); + accessor.setCookingTimeSpent(MathHelper.clamp(accessor.getCookingTimeSpent() - (2 * ticks), 0, accessor.getCookingTotalTime())); } } diff --git a/src/main/kotlin/one/oktw/galaxy/block/entity/ModelCustomBlockEntity.kt b/src/main/kotlin/one/oktw/galaxy/block/entity/ModelCustomBlockEntity.kt index af88ae46a..1b6610b03 100644 --- a/src/main/kotlin/one/oktw/galaxy/block/entity/ModelCustomBlockEntity.kt +++ b/src/main/kotlin/one/oktw/galaxy/block/entity/ModelCustomBlockEntity.kt @@ -53,7 +53,7 @@ open class ModelCustomBlockEntity(type: BlockEntityType<*>, pos: BlockPos, priva set(direction) { if (facing != null && direction != null && direction in allowedFacing) { field = direction - (world as? ServerWorld)?.getEntity(entityUUID)?.yaw = direction.asRotation() + (world as? ServerWorld)?.getEntity(entityUUID)?.yaw = direction.positiveHorizontalDegrees } } open val allowedFacing: List = emptyList() @@ -93,7 +93,7 @@ open class ModelCustomBlockEntity(type: BlockEntityType<*>, pos: BlockPos, priva private fun spawnEntity() { val entity: ArmorStandEntity = EntityType.getEntityFromNbt(armorStandNbt, world, SpawnReason.COMMAND).get() as ArmorStandEntity - entity.refreshPositionAndAngles(pos.x + 0.5, pos.y + 0.5, pos.z + 0.5, facing?.asRotation() ?: 0.0F, 0.0F) + entity.refreshPositionAndAngles(pos.x + 0.5, pos.y + 0.5, pos.z + 0.5, facing?.positiveHorizontalDegrees ?: 0.0F, 0.0F) entity.equipStack(EquipmentSlot.HEAD, modelItem) entity.addCommandTag("BLOCK") entity.addCommandTag(getId().toString()) diff --git a/src/main/kotlin/one/oktw/galaxy/item/CustomItem.kt b/src/main/kotlin/one/oktw/galaxy/item/CustomItem.kt index ff29d558e..63c38cfa0 100644 --- a/src/main/kotlin/one/oktw/galaxy/item/CustomItem.kt +++ b/src/main/kotlin/one/oktw/galaxy/item/CustomItem.kt @@ -20,7 +20,6 @@ package one.oktw.galaxy.item import net.minecraft.component.DataComponentTypes import net.minecraft.component.type.AttributeModifiersComponent -import net.minecraft.component.type.CustomModelDataComponent import net.minecraft.component.type.NbtComponent import net.minecraft.component.type.UnbreakableComponent import net.minecraft.item.Item @@ -70,7 +69,8 @@ abstract class CustomItem( if (cacheable && this::cacheItemStack.isInitialized) return cacheItemStack.copy() return ItemStack(baseItem).apply { - set(DataComponentTypes.CUSTOM_MODEL_DATA, CustomModelDataComponent(modelData)) + // FIXME: Change to new item model + // set(DataComponentTypes.CUSTOM_MODEL_DATA, CustomModelDataComponent(modelData)) set(DataComponentTypes.UNBREAKABLE, UnbreakableComponent(false)) set(DataComponentTypes.ATTRIBUTE_MODIFIERS, AttributeModifiersComponent(emptyList(), false)) set(DataComponentTypes.ITEM_NAME, this@CustomItem.getName()) From 4babee822e7da404306781dd0441eb9ed8231ddf Mon Sep 17 00:00:00 2001 From: jimchen5209 Date: Fri, 6 Dec 2024 20:29:25 +0800 Subject: [PATCH 06/11] build: bump fabric api to 0.111.0 --- build.gradle.kts | 2 +- docker | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index d27152b4a..38f3fca6d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,7 +11,7 @@ plugins { val version = "0.0.1" val group = "one.oktw" -val fabricVersion = "0.110.5+1.21.4" +val fabricVersion = "0.111.0+1.21.4" val galaxyLibVersion = "bcf8f61" repositories { diff --git a/docker b/docker index a02175fab..e1a7dcfc3 160000 --- a/docker +++ b/docker @@ -1 +1 @@ -Subproject commit a02175fab49256a3ddfba5fbc226460299b19a70 +Subproject commit e1a7dcfc38480c663df1e8ced5c8848df3779b0a From 2fa75701ae55bf26215a34910343ddbe9072a477 Mon Sep 17 00:00:00 2001 From: jimchen5209 Date: Fri, 6 Dec 2024 21:06:45 +0800 Subject: [PATCH 07/11] build: migrate custom model data to item model --- .../kotlin/one/oktw/galaxy/item/Button.kt | 154 ++++++------- .../one/oktw/galaxy/item/CustomBlockItem.kt | 22 +- .../kotlin/one/oktw/galaxy/item/CustomItem.kt | 10 +- src/main/kotlin/one/oktw/galaxy/item/Gui.kt | 204 +++++++++--------- .../kotlin/one/oktw/galaxy/item/Material.kt | 26 +-- src/main/kotlin/one/oktw/galaxy/item/Tool.kt | 8 +- .../kotlin/one/oktw/galaxy/item/Upgrade.kt | 76 +++---- .../kotlin/one/oktw/galaxy/item/Weapon.kt | 52 ++--- .../data/galaxy/recipe/blocks/elevator.json | 2 +- .../data/galaxy/recipe/blocks/harvest.json | 2 +- .../recipe/blocks/ht_crafting_table.json | 2 +- .../data/galaxy/recipe/blocks/trashcan.json | 2 +- .../data/galaxy/recipe/tools/crowbar.json | 2 +- .../data/galaxy/recipe/tools/wrench.json | 2 +- 14 files changed, 284 insertions(+), 280 deletions(-) diff --git a/src/main/kotlin/one/oktw/galaxy/item/Button.kt b/src/main/kotlin/one/oktw/galaxy/item/Button.kt index 6e3edcba7..a39416017 100644 --- a/src/main/kotlin/one/oktw/galaxy/item/Button.kt +++ b/src/main/kotlin/one/oktw/galaxy/item/Button.kt @@ -22,84 +22,84 @@ import net.minecraft.item.Items.DIAMOND_HOE import net.minecraft.text.Text import net.minecraft.util.Identifier -class Button private constructor(id: String, modelData: Int) : CustomItem(Identifier.of("galaxy", "item/gui/button/$id"), DIAMOND_HOE, modelData) { +class Button private constructor(id: String) : CustomItem(Identifier.of("galaxy", "item/gui/button/$id"), DIAMOND_HOE) { companion object { - val BLANK = registry.register(Button("blank", 1300000)) - val ARROWHEAD_UP = registry.register(Button("arrowhead_up", 1300001)) - val ARROWHEAD_DOWN = registry.register(Button("arrowhead_down", 1300002)) - val ARROWHEAD_LEFT = registry.register(Button("arrowhead_left", 1300003)) - val ARROWHEAD_RIGHT = registry.register(Button("arrowhead_right", 1300004)) - val ARROW_UP = registry.register(Button("arrow_up", 1300005)) - val ARROW_DOWN = registry.register(Button("arrow_down", 1300006)) - val ARROW_LEFT = registry.register(Button("arrow_left", 1300007)) - val ARROW_RIGHT = registry.register(Button("arrow_right", 1300008)) - val CROSS_MARK = registry.register(Button("cross_mark", 1300009)) - val CHECK_MARK = registry.register(Button("check_mark", 1300010)) - val MINUS = registry.register(Button("minus", 1300011)) - val PLUS = registry.register(Button("plus", 1300012)) - val ZERO_TO_NINE = registry.register(Button("zero_to_nine", 1300013)) - val A_TO_Z = registry.register(Button("a_to_z", 1300014)) - val POWER_OFF = registry.register(Button("power_off", 1300015)) - val POWER_ON = registry.register(Button("power_on", 1300016)) - val STARS = registry.register(Button("stars", 1300017)) - val UPGRADE = registry.register(Button("upgrade", 1300018)) - val EXCLAMATION_MARK = registry.register(Button("exclamation_mark", 1300019)) - val QUESTION_MARK = registry.register(Button("question_mark", 1300020)) - val COG = registry.register(Button("cog", 1300021)) - val LIST = registry.register(Button("list", 1300022)) - val LEAVE = registry.register(Button("leave", 1300023)) - val ENTER = registry.register(Button("enter", 1300024)) - val SUQARES = registry.register(Button("suqares", 1300025)) - val WRITE = registry.register(Button("write", 1300026)) - val MESSAGE = registry.register(Button("message", 1300027)) - val ANONYMOUS = registry.register(Button("anonymous", 1300028)) - val PERSON = registry.register(Button("person", 1300029)) - val MEMBER = registry.register(Button("member", 1300030)) - val ADMINISTRATOR = registry.register(Button("administrator", 1300031)) - val PEOPLE = registry.register(Button("people", 1300032)) - val GALAXY = registry.register(Button("galaxy", 1300033)) - val GALAXY_WITH_MINUS_SIGN = registry.register(Button("galaxy_with_minus_sign", 1300034)) - val GALAXY_WITH_PLUS_SIGN = registry.register(Button("galaxy_with_plus_sign", 1300035)) - val GALAXY_WITH_EXCLAMATION_MARK = registry.register(Button("galaxy_with_exclamation_mark", 1300036)) - val GALAXY_WITH_QUESTION_MARK = registry.register(Button("galaxy_with_question_mark", 1300037)) - val GALAXY_WITH_COG = registry.register(Button("galaxy_with_cog", 1300038)) - val GALAXY_WITH_CHECK_MARK = registry.register(Button("galaxy_with_check_mark", 1300039)) - val PLANET_NEUTRAL = registry.register(Button("planet_neutral", 1300040)) - val PLANET_HOT = registry.register(Button("planet_hot", 1300041)) - val PLANET_DARK = registry.register(Button("planet_dark", 1300042)) - val PLANET_WITH_LIST = registry.register(Button("planet_with_list", 1300043)) - val UNKNOWN_PLANET = registry.register(Button("unknown_planet", 1300044)) - val UNKNOWN_PLANET_WITH_PLUS_SIGN = registry.register(Button("unknown_planet_with_plus_sign", 1300045)) - val PERSON_WITH_MINUS_SIGN = registry.register(Button("person_with_minus_sign", 1300046)) - val PERSON_WITH_PLUS_SIGN = registry.register(Button("person_with_plus_sign", 1300047)) - val PERSON_WITH_EXCLAMATION_MARK = registry.register(Button("person_with_exclamation_mark", 1300048)) - val PERSON_WITH_QUESTION_MARK = registry.register(Button("person_with_question_mark", 1300049)) - val PERSON_WITH_COG = registry.register(Button("person_with_cog", 1300050)) - val NUMBER_0 = registry.register(Button("number_0", 1300051)) - val NUMBER_1 = registry.register(Button("number_1", 1300052)) - val NUMBER_2 = registry.register(Button("number_2", 1300053)) - val NUMBER_3 = registry.register(Button("number_3", 1300054)) - val NUMBER_4 = registry.register(Button("number_4", 1300055)) - val NUMBER_5 = registry.register(Button("number_5", 1300056)) - val NUMBER_6 = registry.register(Button("number_6", 1300057)) - val NUMBER_7 = registry.register(Button("number_7", 1300058)) - val NUMBER_8 = registry.register(Button("number_8", 1300059)) - val NUMBER_9 = registry.register(Button("number_9", 1300060)) - val UNDERSCORE = registry.register(Button("underscore", 1300061)) - val INFO = registry.register(Button("info", 1300062)) - val MAGNIFIER = registry.register(Button("magnifier", 1300063)) - val STARDUST_JAR = registry.register(Button("stardust_jar", 1300064)) - val DISABLED_BLANK = registry.register(Button("disabled_blank", 1310000)) - val DISABLED_ARROWHEAD_UP = registry.register(Button("disabled_arrowhead_up", 1310001)) - val DISABLED_ARROWHEAD_DOWN = registry.register(Button("disabled_arrowhead_down", 1310002)) - val DISABLED_ARROWHEAD_LEFT = registry.register(Button("disabled_arrowhead_left", 1310003)) - val DISABLED_ARROWHEAD_RIGHT = registry.register(Button("disabled_arrowhead_right", 1310004)) - val DISABLED_ARROW_UP = registry.register(Button("disabled_arrow_up", 1310005)) - val DISABLED_ARROW_DOWN = registry.register(Button("disabled_arrow_down", 1310006)) - val DISABLED_ARROW_LEFT = registry.register(Button("disabled_arrow_left", 1310007)) - val DISABLED_ARROW_RIGHT = registry.register(Button("disabled_arrow_right", 1310008)) - val DISABLED_CROSS_MARK = registry.register(Button("disabled_cross_mark", 1310009)) - val DISABLED_CHECK_MARK = registry.register(Button("disabled_check_mark", 1310010)) + val BLANK = registry.register(Button("blank")) + val ARROWHEAD_UP = registry.register(Button("arrowhead_up")) + val ARROWHEAD_DOWN = registry.register(Button("arrowhead_down")) + val ARROWHEAD_LEFT = registry.register(Button("arrowhead_left")) + val ARROWHEAD_RIGHT = registry.register(Button("arrowhead_right")) + val ARROW_UP = registry.register(Button("arrow_up")) + val ARROW_DOWN = registry.register(Button("arrow_down")) + val ARROW_LEFT = registry.register(Button("arrow_left")) + val ARROW_RIGHT = registry.register(Button("arrow_right")) + val CROSS_MARK = registry.register(Button("cross_mark")) + val CHECK_MARK = registry.register(Button("check_mark")) + val MINUS = registry.register(Button("minus")) + val PLUS = registry.register(Button("plus")) + val ZERO_TO_NINE = registry.register(Button("zero_to_nine")) + val A_TO_Z = registry.register(Button("a_to_z")) + val POWER_OFF = registry.register(Button("power_off")) + val POWER_ON = registry.register(Button("power_on")) + val STARS = registry.register(Button("stars")) + val UPGRADE = registry.register(Button("upgrade")) + val EXCLAMATION_MARK = registry.register(Button("exclamation_mark")) + val QUESTION_MARK = registry.register(Button("question_mark")) + val COG = registry.register(Button("cog")) + val LIST = registry.register(Button("list")) + val LEAVE = registry.register(Button("leave")) + val ENTER = registry.register(Button("enter")) + val SUQARES = registry.register(Button("suqares")) + val WRITE = registry.register(Button("write")) + val MESSAGE = registry.register(Button("message")) + val ANONYMOUS = registry.register(Button("anonymous")) + val PERSON = registry.register(Button("person")) + val MEMBER = registry.register(Button("member")) + val ADMINISTRATOR = registry.register(Button("administrator")) + val PEOPLE = registry.register(Button("people")) + val GALAXY = registry.register(Button("galaxy")) + val GALAXY_WITH_MINUS_SIGN = registry.register(Button("galaxy_with_minus_sign")) + val GALAXY_WITH_PLUS_SIGN = registry.register(Button("galaxy_with_plus_sign")) + val GALAXY_WITH_EXCLAMATION_MARK = registry.register(Button("galaxy_with_exclamation_mark")) + val GALAXY_WITH_QUESTION_MARK = registry.register(Button("galaxy_with_question_mark")) + val GALAXY_WITH_COG = registry.register(Button("galaxy_with_cog")) + val GALAXY_WITH_CHECK_MARK = registry.register(Button("galaxy_with_check_mark")) + val PLANET_NEUTRAL = registry.register(Button("planet_neutral")) + val PLANET_HOT = registry.register(Button("planet_hot")) + val PLANET_DARK = registry.register(Button("planet_dark")) + val PLANET_WITH_LIST = registry.register(Button("planet_with_list")) + val UNKNOWN_PLANET = registry.register(Button("unknown_planet")) + val UNKNOWN_PLANET_WITH_PLUS_SIGN = registry.register(Button("unknown_planet_with_plus_sign")) + val PERSON_WITH_MINUS_SIGN = registry.register(Button("person_with_minus_sign")) + val PERSON_WITH_PLUS_SIGN = registry.register(Button("person_with_plus_sign")) + val PERSON_WITH_EXCLAMATION_MARK = registry.register(Button("person_with_exclamation_mark")) + val PERSON_WITH_QUESTION_MARK = registry.register(Button("person_with_question_mark")) + val PERSON_WITH_COG = registry.register(Button("person_with_cog")) + val NUMBER_0 = registry.register(Button("number_0")) + val NUMBER_1 = registry.register(Button("number_1")) + val NUMBER_2 = registry.register(Button("number_2")) + val NUMBER_3 = registry.register(Button("number_3")) + val NUMBER_4 = registry.register(Button("number_4")) + val NUMBER_5 = registry.register(Button("number_5")) + val NUMBER_6 = registry.register(Button("number_6")) + val NUMBER_7 = registry.register(Button("number_7")) + val NUMBER_8 = registry.register(Button("number_8")) + val NUMBER_9 = registry.register(Button("number_9")) + val UNDERSCORE = registry.register(Button("underscore")) + val INFO = registry.register(Button("info")) + val MAGNIFIER = registry.register(Button("magnifier")) + val STARDUST_JAR = registry.register(Button("stardust_jar")) + val DISABLED_BLANK = registry.register(Button("disabled_blank")) + val DISABLED_ARROWHEAD_UP = registry.register(Button("disabled_arrowhead_up")) + val DISABLED_ARROWHEAD_DOWN = registry.register(Button("disabled_arrowhead_down")) + val DISABLED_ARROWHEAD_LEFT = registry.register(Button("disabled_arrowhead_left")) + val DISABLED_ARROWHEAD_RIGHT = registry.register(Button("disabled_arrowhead_right")) + val DISABLED_ARROW_UP = registry.register(Button("disabled_arrow_up")) + val DISABLED_ARROW_DOWN = registry.register(Button("disabled_arrow_down")) + val DISABLED_ARROW_LEFT = registry.register(Button("disabled_arrow_left")) + val DISABLED_ARROW_RIGHT = registry.register(Button("disabled_arrow_right")) + val DISABLED_CROSS_MARK = registry.register(Button("disabled_cross_mark")) + val DISABLED_CHECK_MARK = registry.register(Button("disabled_check_mark")) } override fun getName(): Text = Text.literal("").styled { it.withItalic(false) } diff --git a/src/main/kotlin/one/oktw/galaxy/item/CustomBlockItem.kt b/src/main/kotlin/one/oktw/galaxy/item/CustomBlockItem.kt index 524f2bcfc..f4174480b 100644 --- a/src/main/kotlin/one/oktw/galaxy/item/CustomBlockItem.kt +++ b/src/main/kotlin/one/oktw/galaxy/item/CustomBlockItem.kt @@ -24,18 +24,18 @@ import net.minecraft.util.Formatting import net.minecraft.util.Identifier import one.oktw.galaxy.block.CustomBlock -class CustomBlockItem private constructor(private val id: String, modelData: Int, private val name: String?) : - CustomItem(Identifier.of("galaxy", "item/block/$id"), COMMAND_BLOCK, modelData) { +class CustomBlockItem private constructor(private val id: String, private val name: String?) : + CustomItem(Identifier.of("galaxy", "item/block/$id"), COMMAND_BLOCK) { companion object { - val HT_CRAFTING_TABLE = registry.register(CustomBlockItem("ht_crafting_table", 1010100, "block.HT_CRAFTING_TABLE")) - val ELEVATOR = registry.register(CustomBlockItem("elevator", 1010200, "block.ELEVATOR")) - val ANGEL_BLOCK = registry.register(CustomBlockItem("angel_block", 1010400, "block.ANGEL_BLOCK")) - val TRASHCAN = registry.register(CustomBlockItem("trashcan", 1010500, "block.TRASHCAN")) - val TELEPORTER_CORE_BASIC = registry.register(CustomBlockItem("teleporter_core_basic", 1010300, "block.TELEPORTER")) - val TELEPORTER_CORE_ADVANCE = registry.register(CustomBlockItem("teleporter_core_advance", 1010301, "block.TELEPORTER_ADVANCED")) - val TELEPORTER_FRAME = registry.register(CustomBlockItem("teleporter_frame", 1010302, "block.TELEPORTER_FRAME")) - val TEST_GUI = registry.register(CustomBlockItem("test_gui", 9999999, "block.TEST_GUI")) - val HARVEST = registry.register(CustomBlockItem("harvest", 1010700, "block.HARVEST")) + val HT_CRAFTING_TABLE = registry.register(CustomBlockItem("ht_crafting_table", "block.HT_CRAFTING_TABLE")) + val ELEVATOR = registry.register(CustomBlockItem("elevator", "block.ELEVATOR")) + val ANGEL_BLOCK = registry.register(CustomBlockItem("angel_block", "block.ANGEL_BLOCK")) + val TRASHCAN = registry.register(CustomBlockItem("trashcan", "block.TRASHCAN")) + val TELEPORTER_CORE_BASIC = registry.register(CustomBlockItem("teleporter_core_basic", "block.TELEPORTER")) + val TELEPORTER_CORE_ADVANCE = registry.register(CustomBlockItem("teleporter_core_advance", "block.TELEPORTER_ADVANCED")) + val TELEPORTER_FRAME = registry.register(CustomBlockItem("teleporter_frame", "block.TELEPORTER_FRAME")) + val TEST_GUI = registry.register(CustomBlockItem("test_gui", "block.TEST_GUI")) + val HARVEST = registry.register(CustomBlockItem("harvest", "block.HARVEST")) } fun getBlock(): CustomBlock { diff --git a/src/main/kotlin/one/oktw/galaxy/item/CustomItem.kt b/src/main/kotlin/one/oktw/galaxy/item/CustomItem.kt index 63c38cfa0..3d96e501f 100644 --- a/src/main/kotlin/one/oktw/galaxy/item/CustomItem.kt +++ b/src/main/kotlin/one/oktw/galaxy/item/CustomItem.kt @@ -20,6 +20,7 @@ package one.oktw.galaxy.item import net.minecraft.component.DataComponentTypes import net.minecraft.component.type.AttributeModifiersComponent +import net.minecraft.component.type.CustomModelDataComponent import net.minecraft.component.type.NbtComponent import net.minecraft.component.type.UnbreakableComponent import net.minecraft.item.Item @@ -33,7 +34,8 @@ import one.oktw.galaxy.util.Registrable abstract class CustomItem( override val identifier: Identifier, private val baseItem: Item, - private val modelData: Int, + private val itemModel: Identifier = identifier, + private val customModelData: CustomModelDataComponent? = null, private val maxStackSize: Int = 64 ) : Registrable { companion object { @@ -69,12 +71,14 @@ abstract class CustomItem( if (cacheable && this::cacheItemStack.isInitialized) return cacheItemStack.copy() return ItemStack(baseItem).apply { - // FIXME: Change to new item model - // set(DataComponentTypes.CUSTOM_MODEL_DATA, CustomModelDataComponent(modelData)) + set(DataComponentTypes.ITEM_MODEL, itemModel) set(DataComponentTypes.UNBREAKABLE, UnbreakableComponent(false)) set(DataComponentTypes.ATTRIBUTE_MODIFIERS, AttributeModifiersComponent(emptyList(), false)) set(DataComponentTypes.ITEM_NAME, this@CustomItem.getName()) set(DataComponentTypes.MAX_STACK_SIZE, maxStackSize) + if (customModelData != null) { + set(DataComponentTypes.CUSTOM_MODEL_DATA, customModelData) + } // Galaxy Data val galaxyNbt = CustomItemHelper.getNbt(this) diff --git a/src/main/kotlin/one/oktw/galaxy/item/Gui.kt b/src/main/kotlin/one/oktw/galaxy/item/Gui.kt index 0e976cdd7..50cb0250d 100644 --- a/src/main/kotlin/one/oktw/galaxy/item/Gui.kt +++ b/src/main/kotlin/one/oktw/galaxy/item/Gui.kt @@ -22,109 +22,109 @@ import net.minecraft.item.Items.DIAMOND_HOE import net.minecraft.text.Text import net.minecraft.util.Identifier -class Gui private constructor(id: String, modelData: Int) : CustomItem(Identifier.of("galaxy", "item/gui/base/$id"), DIAMOND_HOE, modelData) { +class Gui private constructor(id: String) : CustomItem(Identifier.of("galaxy", "item/gui/base/$id"), DIAMOND_HOE) { companion object { - val BLANK = registry.register(Gui("blank", 1000000)) - val MAIN_FIELD = registry.register(Gui("main_field", 1010000)) - val MAIN_FIELD_ENCLOSED = registry.register(Gui("main_field_enclosed", 1010001)) - val MAIN_FIELD_TOP_BOTTOM_LEFT = registry.register(Gui("main_field_top_bottom_left", 1010002)) - val MAIN_FIELD_TOP_BOTTOM_RIGHT = registry.register(Gui("main_field_top_bottom_right", 1010003)) - val MAIN_FIELD_TOP_LEFT_RIGHT = registry.register(Gui("main_field_top_left_right", 1010004)) - val MAIN_FIELD_BOTTOM_LEFT_RIGHT = registry.register(Gui("main_field_bottom_left_right", 1010005)) - val MAIN_FIELD_TOP_BOTTOM = registry.register(Gui("main_field_top_bottom", 1010006)) - val MAIN_FIELD_TOP_LEFT = registry.register(Gui("main_field_top_left", 1010007)) - val MAIN_FIELD_TOP_RIGHT = registry.register(Gui("main_field_top_right", 1010008)) - val MAIN_FIELD_BOTTOM_LEFT = registry.register(Gui("main_field_bottom_left", 1010009)) - val MAIN_FIELD_BOTTOM_RIGHT = registry.register(Gui("main_field_bottom_right", 1010010)) - val MAIN_FIELD_LEFT_RIGHT = registry.register(Gui("main_field_left_right", 1010011)) - val MAIN_FIELD_TOP = registry.register(Gui("main_field_top", 1010012)) - val MAIN_FIELD_BOTTOM = registry.register(Gui("main_field_bottom", 1010013)) - val MAIN_FIELD_LEFT = registry.register(Gui("main_field_left", 1010014)) - val MAIN_FIELD_RIGHT = registry.register(Gui("main_field_right", 1010015)) - val MAIN_FIELD_TOP_LEFT_CORNER_BORDERED = registry.register(Gui("main_field_top_left_corner_bordered", 1010016)) - val MAIN_FIELD_TOP_RIGHT_CORNER_BORDERED = registry.register(Gui("main_field_top_right_corner_bordered", 1010017)) - val MAIN_FIELD_BOTTOM_LEFT_CORNER_BORDERED = registry.register(Gui("main_field_bottom_left_corner_bordered", 1010018)) - val MAIN_FIELD_BOTTOM_RIGHT_CORNER_BORDERED = registry.register(Gui("main_field_bottom_right_corner_bordered", 1010019)) - val MAIN_FIELD_CORNER_BORDERED = registry.register(Gui("main_field_corner_bordered", 1010020)) - val MAIN_FIELD_CORNER_BORDER_TOP_LEFT = registry.register(Gui("main_field_corner_border_top_left", 1010021)) - val MAIN_FIELD_CORNER_BORDER_TOP_RIGHT = registry.register(Gui("main_field_corner_border_top_right", 1010022)) - val MAIN_FIELD_CORNER_BORDER_BOTOOM_LEFT = registry.register(Gui("main_field_corner_border_botoom_left", 1010023)) - val MAIN_FIELD_CORNER_BORDER_BOTTOM_RIGHT = registry.register(Gui("main_field_corner_border_bottom_right", 1010024)) - val SUB_FIELD = registry.register(Gui("sub_field", 1020000)) - val SUB_FIELD_ENCLOSED = registry.register(Gui("sub_field_enclosed", 1020001)) - val SUB_FIELD_TOP_BOTTOM_LEFT = registry.register(Gui("sub_field_top_bottom_left", 1020002)) - val SUB_FIELD_TOP_BOTTOM_RIGHT = registry.register(Gui("sub_field_top_bottom_right", 1020003)) - val SUB_FIELD_TOP_LEFT_RIGHT = registry.register(Gui("sub_field_top_left_right", 1020004)) - val SUB_FIELD_BOTTOM_LEFT_RIGHT = registry.register(Gui("sub_field_bottom_left_right", 1020005)) - val SUB_FIELD_TOP_BOTTOM = registry.register(Gui("sub_field_top_bottom", 1020006)) - val SUB_FIELD_TOP_LEFT = registry.register(Gui("sub_field_top_left", 1020007)) - val SUB_FIELD_TOP_RIGHT = registry.register(Gui("sub_field_top_right", 1020008)) - val SUB_FIELD_BOTTOM_LEFT = registry.register(Gui("sub_field_bottom_left", 1020009)) - val SUB_FIELD_BOTTOM_RIGHT = registry.register(Gui("sub_field_bottom_right", 1020010)) - val SUB_FIELD_LEFT_RIGHT = registry.register(Gui("sub_field_left_right", 1020011)) - val SUB_FIELD_TOP = registry.register(Gui("sub_field_top", 1020012)) - val SUB_FIELD_BOTTOM = registry.register(Gui("sub_field_bottom", 1020013)) - val SUB_FIELD_LEFT = registry.register(Gui("sub_field_left", 1020014)) - val SUB_FIELD_RIGHT = registry.register(Gui("sub_field_right", 1020015)) - val SUB_FIELD_TOP_LEFT_CORNER_BORDERED = registry.register(Gui("sub_field_top_left_corner_bordered", 1020016)) - val SUB_FIELD_TOP_RIGHT_CORNER_BORDERED = registry.register(Gui("sub_field_top_right_corner_bordered", 1020017)) - val SUB_FIELD_BOTTOM_LEFT_CORNER_BORDERED = registry.register(Gui("sub_field_bottom_left_corner_bordered", 1020018)) - val SUB_FIELD_BOTTOM_RIGHT_CORNER_BORDERED = registry.register(Gui("sub_field_bottom_right_corner_bordered", 1020019)) - val SUB_FIELD_CORNER_BORDERED = registry.register(Gui("sub_field_corner_bordered", 1020020)) - val SUB_FIELD_CORNER_BORDER_TOP_LEFT = registry.register(Gui("sub_field_corner_border_top_left", 1020021)) - val SUB_FIELD_CORNER_BORDER_TOP_RIGHT = registry.register(Gui("sub_field_corner_border_top_right", 1020022)) - val SUB_FIELD_CORNER_BORDER_BOTOOM_LEFT = registry.register(Gui("sub_field_corner_border_botoom_left", 1020023)) - val SUB_FIELD_CORNER_BORDER_BOTTOM_RIGHT = registry.register(Gui("sub_field_corner_border_bottom_right", 1020024)) - val INFO = registry.register(Gui("info", 1100000)) - val PROGRESS_RIGHT_0 = registry.register(Gui("progress_right_0", 1110000)) - val PROGRESS_RIGHT_1 = registry.register(Gui("progress_right_1", 1110001)) - val PROGRESS_RIGHT_2 = registry.register(Gui("progress_right_2", 1110002)) - val PROGRESS_RIGHT_3 = registry.register(Gui("progress_right_3", 1110003)) - val PROGRESS_RIGHT_4 = registry.register(Gui("progress_right_4", 1110004)) - val PROGRESS_RIGHT_5 = registry.register(Gui("progress_right_5", 1110005)) - val PROGRESS_RIGHT_6 = registry.register(Gui("progress_right_6", 1110006)) - val PROGRESS_RIGHT_7 = registry.register(Gui("progress_right_7", 1110007)) - val PROGRESS_RIGHT_8 = registry.register(Gui("progress_right_8", 1110008)) - val PROGRESS_RIGHT_9 = registry.register(Gui("progress_right_9", 1110009)) - val PROGRESS_RIGHT_10 = registry.register(Gui("progress_right_10", 1110010)) - val PROGRESS_RIGHT_11 = registry.register(Gui("progress_right_11", 1110011)) - val PROGRESS_RIGHT_12 = registry.register(Gui("progress_right_12", 1110012)) - val PROGRESS_RIGHT_13 = registry.register(Gui("progress_right_13", 1110013)) - val PROGRESS_RIGHT_14 = registry.register(Gui("progress_right_14", 1110014)) - val PROGRESS_RIGHT_15 = registry.register(Gui("progress_right_15", 1110015)) - val PROGRESS_RIGHT_16 = registry.register(Gui("progress_right_16", 1110016)) - val PROGRESS_RIGHT_17 = registry.register(Gui("progress_right_17", 1110017)) - val PROGRESS_RIGHT_18 = registry.register(Gui("progress_right_18", 1110018)) - val PROGRESS_RIGHT_19 = registry.register(Gui("progress_right_19", 1110019)) - val PROGRESS_RIGHT_20 = registry.register(Gui("progress_right_20", 1110020)) - val PROGRESS_RIGHT_21 = registry.register(Gui("progress_right_21", 1110021)) - val PROGRESS_RIGHT_22 = registry.register(Gui("progress_right_22", 1110022)) - val PROGRESS_RIGHT_BLOCKED = registry.register(Gui("progress_right_blocked", 1110023)) - val PROGRESS_DOWN_0 = registry.register(Gui("progress_down_0", 1120000)) - val PROGRESS_DOWN_1 = registry.register(Gui("progress_down_1", 1120001)) - val PROGRESS_DOWN_2 = registry.register(Gui("progress_down_2", 1120002)) - val PROGRESS_DOWN_3 = registry.register(Gui("progress_down_3", 1120003)) - val PROGRESS_DOWN_4 = registry.register(Gui("progress_down_4", 1120004)) - val PROGRESS_DOWN_5 = registry.register(Gui("progress_down_5", 1120005)) - val PROGRESS_DOWN_6 = registry.register(Gui("progress_down_6", 1120006)) - val PROGRESS_DOWN_7 = registry.register(Gui("progress_down_7", 1120007)) - val PROGRESS_DOWN_8 = registry.register(Gui("progress_down_8", 1120008)) - val PROGRESS_DOWN_9 = registry.register(Gui("progress_down_9", 1120009)) - val PROGRESS_DOWN_10 = registry.register(Gui("progress_down_10", 1120010)) - val PROGRESS_DOWN_11 = registry.register(Gui("progress_down_11", 1120011)) - val PROGRESS_DOWN_12 = registry.register(Gui("progress_down_12", 1120012)) - val PROGRESS_DOWN_BLOCKED = registry.register(Gui("progress_down_blocked", 1120013)) - val NUMBER_0 = registry.register(Gui("number_0", 1400050)) - val NUMBER_1 = registry.register(Gui("number_1", 1400051)) - val NUMBER_2 = registry.register(Gui("number_2", 1400052)) - val NUMBER_3 = registry.register(Gui("number_3", 1400053)) - val NUMBER_4 = registry.register(Gui("number_4", 1400054)) - val NUMBER_5 = registry.register(Gui("number_5", 1400055)) - val NUMBER_6 = registry.register(Gui("number_6", 1400056)) - val NUMBER_7 = registry.register(Gui("number_7", 1400057)) - val NUMBER_8 = registry.register(Gui("number_8", 1400058)) - val NUMBER_9 = registry.register(Gui("number_9", 1400059)) - val UNDERSCORE = registry.register(Gui("underscore", 1400060)) + val BLANK = registry.register(Gui("blank")) + val MAIN_FIELD = registry.register(Gui("main_field")) + val MAIN_FIELD_ENCLOSED = registry.register(Gui("main_field_enclosed")) + val MAIN_FIELD_TOP_BOTTOM_LEFT = registry.register(Gui("main_field_top_bottom_left")) + val MAIN_FIELD_TOP_BOTTOM_RIGHT = registry.register(Gui("main_field_top_bottom_right")) + val MAIN_FIELD_TOP_LEFT_RIGHT = registry.register(Gui("main_field_top_left_right")) + val MAIN_FIELD_BOTTOM_LEFT_RIGHT = registry.register(Gui("main_field_bottom_left_right")) + val MAIN_FIELD_TOP_BOTTOM = registry.register(Gui("main_field_top_bottom")) + val MAIN_FIELD_TOP_LEFT = registry.register(Gui("main_field_top_left")) + val MAIN_FIELD_TOP_RIGHT = registry.register(Gui("main_field_top_right")) + val MAIN_FIELD_BOTTOM_LEFT = registry.register(Gui("main_field_bottom_left")) + val MAIN_FIELD_BOTTOM_RIGHT = registry.register(Gui("main_field_bottom_right")) + val MAIN_FIELD_LEFT_RIGHT = registry.register(Gui("main_field_left_right")) + val MAIN_FIELD_TOP = registry.register(Gui("main_field_top")) + val MAIN_FIELD_BOTTOM = registry.register(Gui("main_field_bottom")) + val MAIN_FIELD_LEFT = registry.register(Gui("main_field_left")) + val MAIN_FIELD_RIGHT = registry.register(Gui("main_field_right")) + val MAIN_FIELD_TOP_LEFT_CORNER_BORDERED = registry.register(Gui("main_field_top_left_corner_bordered")) + val MAIN_FIELD_TOP_RIGHT_CORNER_BORDERED = registry.register(Gui("main_field_top_right_corner_bordered")) + val MAIN_FIELD_BOTTOM_LEFT_CORNER_BORDERED = registry.register(Gui("main_field_bottom_left_corner_bordered")) + val MAIN_FIELD_BOTTOM_RIGHT_CORNER_BORDERED = registry.register(Gui("main_field_bottom_right_corner_bordered")) + val MAIN_FIELD_CORNER_BORDERED = registry.register(Gui("main_field_corner_bordered")) + val MAIN_FIELD_CORNER_BORDER_TOP_LEFT = registry.register(Gui("main_field_corner_border_top_left")) + val MAIN_FIELD_CORNER_BORDER_TOP_RIGHT = registry.register(Gui("main_field_corner_border_top_right")) + val MAIN_FIELD_CORNER_BORDER_BOTOOM_LEFT = registry.register(Gui("main_field_corner_border_botoom_left")) + val MAIN_FIELD_CORNER_BORDER_BOTTOM_RIGHT = registry.register(Gui("main_field_corner_border_bottom_right")) + val SUB_FIELD = registry.register(Gui("sub_field")) + val SUB_FIELD_ENCLOSED = registry.register(Gui("sub_field_enclosed")) + val SUB_FIELD_TOP_BOTTOM_LEFT = registry.register(Gui("sub_field_top_bottom_left")) + val SUB_FIELD_TOP_BOTTOM_RIGHT = registry.register(Gui("sub_field_top_bottom_right")) + val SUB_FIELD_TOP_LEFT_RIGHT = registry.register(Gui("sub_field_top_left_right")) + val SUB_FIELD_BOTTOM_LEFT_RIGHT = registry.register(Gui("sub_field_bottom_left_right")) + val SUB_FIELD_TOP_BOTTOM = registry.register(Gui("sub_field_top_bottom")) + val SUB_FIELD_TOP_LEFT = registry.register(Gui("sub_field_top_left")) + val SUB_FIELD_TOP_RIGHT = registry.register(Gui("sub_field_top_right")) + val SUB_FIELD_BOTTOM_LEFT = registry.register(Gui("sub_field_bottom_left")) + val SUB_FIELD_BOTTOM_RIGHT = registry.register(Gui("sub_field_bottom_right")) + val SUB_FIELD_LEFT_RIGHT = registry.register(Gui("sub_field_left_right")) + val SUB_FIELD_TOP = registry.register(Gui("sub_field_top")) + val SUB_FIELD_BOTTOM = registry.register(Gui("sub_field_bottom")) + val SUB_FIELD_LEFT = registry.register(Gui("sub_field_left")) + val SUB_FIELD_RIGHT = registry.register(Gui("sub_field_right")) + val SUB_FIELD_TOP_LEFT_CORNER_BORDERED = registry.register(Gui("sub_field_top_left_corner_bordered")) + val SUB_FIELD_TOP_RIGHT_CORNER_BORDERED = registry.register(Gui("sub_field_top_right_corner_bordered")) + val SUB_FIELD_BOTTOM_LEFT_CORNER_BORDERED = registry.register(Gui("sub_field_bottom_left_corner_bordered")) + val SUB_FIELD_BOTTOM_RIGHT_CORNER_BORDERED = registry.register(Gui("sub_field_bottom_right_corner_bordered")) + val SUB_FIELD_CORNER_BORDERED = registry.register(Gui("sub_field_corner_bordered")) + val SUB_FIELD_CORNER_BORDER_TOP_LEFT = registry.register(Gui("sub_field_corner_border_top_left")) + val SUB_FIELD_CORNER_BORDER_TOP_RIGHT = registry.register(Gui("sub_field_corner_border_top_right")) + val SUB_FIELD_CORNER_BORDER_BOTOOM_LEFT = registry.register(Gui("sub_field_corner_border_botoom_left")) + val SUB_FIELD_CORNER_BORDER_BOTTOM_RIGHT = registry.register(Gui("sub_field_corner_border_bottom_right")) + val INFO = registry.register(Gui("info")) + val PROGRESS_RIGHT_0 = registry.register(Gui("progress_right_0")) + val PROGRESS_RIGHT_1 = registry.register(Gui("progress_right_1")) + val PROGRESS_RIGHT_2 = registry.register(Gui("progress_right_2")) + val PROGRESS_RIGHT_3 = registry.register(Gui("progress_right_3")) + val PROGRESS_RIGHT_4 = registry.register(Gui("progress_right_4")) + val PROGRESS_RIGHT_5 = registry.register(Gui("progress_right_5")) + val PROGRESS_RIGHT_6 = registry.register(Gui("progress_right_6")) + val PROGRESS_RIGHT_7 = registry.register(Gui("progress_right_7")) + val PROGRESS_RIGHT_8 = registry.register(Gui("progress_right_8")) + val PROGRESS_RIGHT_9 = registry.register(Gui("progress_right_9")) + val PROGRESS_RIGHT_10 = registry.register(Gui("progress_right_10")) + val PROGRESS_RIGHT_11 = registry.register(Gui("progress_right_11")) + val PROGRESS_RIGHT_12 = registry.register(Gui("progress_right_12")) + val PROGRESS_RIGHT_13 = registry.register(Gui("progress_right_13")) + val PROGRESS_RIGHT_14 = registry.register(Gui("progress_right_14")) + val PROGRESS_RIGHT_15 = registry.register(Gui("progress_right_15")) + val PROGRESS_RIGHT_16 = registry.register(Gui("progress_right_16")) + val PROGRESS_RIGHT_17 = registry.register(Gui("progress_right_17")) + val PROGRESS_RIGHT_18 = registry.register(Gui("progress_right_18")) + val PROGRESS_RIGHT_19 = registry.register(Gui("progress_right_19")) + val PROGRESS_RIGHT_20 = registry.register(Gui("progress_right_20")) + val PROGRESS_RIGHT_21 = registry.register(Gui("progress_right_21")) + val PROGRESS_RIGHT_22 = registry.register(Gui("progress_right_22")) + val PROGRESS_RIGHT_BLOCKED = registry.register(Gui("progress_right_blocked")) + val PROGRESS_DOWN_0 = registry.register(Gui("progress_down_0")) + val PROGRESS_DOWN_1 = registry.register(Gui("progress_down_1")) + val PROGRESS_DOWN_2 = registry.register(Gui("progress_down_2")) + val PROGRESS_DOWN_3 = registry.register(Gui("progress_down_3")) + val PROGRESS_DOWN_4 = registry.register(Gui("progress_down_4")) + val PROGRESS_DOWN_5 = registry.register(Gui("progress_down_5")) + val PROGRESS_DOWN_6 = registry.register(Gui("progress_down_6")) + val PROGRESS_DOWN_7 = registry.register(Gui("progress_down_7")) + val PROGRESS_DOWN_8 = registry.register(Gui("progress_down_8")) + val PROGRESS_DOWN_9 = registry.register(Gui("progress_down_9")) + val PROGRESS_DOWN_10 = registry.register(Gui("progress_down_10")) + val PROGRESS_DOWN_11 = registry.register(Gui("progress_down_11")) + val PROGRESS_DOWN_12 = registry.register(Gui("progress_down_12")) + val PROGRESS_DOWN_BLOCKED = registry.register(Gui("progress_down_blocked")) + val NUMBER_0 = registry.register(Gui("number_0")) + val NUMBER_1 = registry.register(Gui("number_1")) + val NUMBER_2 = registry.register(Gui("number_2")) + val NUMBER_3 = registry.register(Gui("number_3")) + val NUMBER_4 = registry.register(Gui("number_4")) + val NUMBER_5 = registry.register(Gui("number_5")) + val NUMBER_6 = registry.register(Gui("number_6")) + val NUMBER_7 = registry.register(Gui("number_7")) + val NUMBER_8 = registry.register(Gui("number_8")) + val NUMBER_9 = registry.register(Gui("number_9")) + val UNDERSCORE = registry.register(Gui("underscore")) } override fun getName(): Text = Text.literal("").styled { it.withItalic(false) } diff --git a/src/main/kotlin/one/oktw/galaxy/item/Material.kt b/src/main/kotlin/one/oktw/galaxy/item/Material.kt index c3df52c1d..5926ab97e 100644 --- a/src/main/kotlin/one/oktw/galaxy/item/Material.kt +++ b/src/main/kotlin/one/oktw/galaxy/item/Material.kt @@ -24,20 +24,20 @@ import net.minecraft.text.Text.translatable import net.minecraft.util.Formatting import net.minecraft.util.Identifier -class Material private constructor(id: String, modelData: Int, private val name: String) : - CustomItem(Identifier.of("galaxy", "item/material/$id"), COMMAND_BLOCK, modelData) { +class Material private constructor(id: String, private val name: String) : + CustomItem(Identifier.of("galaxy", "item/material/$id"), COMMAND_BLOCK) { companion object { - val RAW_BASE_PLATE = registry.register(Material("raw_base_plate", 4010100, "item.Material.PART_RAW_BASE")) - val BASE_PLATE = registry.register(Material("base_plate", 4010101, "item.Material.PART_BASE")) - val COOLANT = registry.register(Material("coolant", 4010102, "item.Material.COOLANT")) - val CPU = registry.register(Material("cpu", 4010103, "item.Material.CPU")) - val SCOPE = registry.register(Material("scope", 4010200, "item.Material.SCOPE")) - val BATTERY = registry.register(Material("battery", 4010300, "item.Material.BATTERY")) - val LASER = registry.register(Material("laser", 4010400, "item.Material.LASER")) - val BUTT = registry.register(Material("butt", 4010500, "item.Material.BUTT")) - val TRIGGER = registry.register(Material("trigger", 4010501, "item.Material.TRIGGER")) - val HANDLE = registry.register(Material("handle", 4010502, "item.Material.HANDLE")) - val BARREL = registry.register(Material("barrel", 4010503, "item.Material.BARREL")) + val RAW_BASE_PLATE = registry.register(Material("raw_base_plate", "item.Material.PART_RAW_BASE")) + val BASE_PLATE = registry.register(Material("base_plate", "item.Material.PART_BASE")) + val COOLANT = registry.register(Material("coolant", "item.Material.COOLANT")) + val CPU = registry.register(Material("cpu", "item.Material.CPU")) + val SCOPE = registry.register(Material("scope", "item.Material.SCOPE")) + val BATTERY = registry.register(Material("battery", "item.Material.BATTERY")) + val LASER = registry.register(Material("laser", "item.Material.LASER")) + val BUTT = registry.register(Material("butt", "item.Material.BUTT")) + val TRIGGER = registry.register(Material("trigger", "item.Material.TRIGGER")) + val HANDLE = registry.register(Material("handle", "item.Material.HANDLE")) + val BARREL = registry.register(Material("barrel", "item.Material.BARREL")) } override fun getName(): Text = translatable(name).styled { it.withColor(Formatting.WHITE).withItalic(false) } diff --git a/src/main/kotlin/one/oktw/galaxy/item/Tool.kt b/src/main/kotlin/one/oktw/galaxy/item/Tool.kt index 4d2efee23..dd7dd1fcd 100644 --- a/src/main/kotlin/one/oktw/galaxy/item/Tool.kt +++ b/src/main/kotlin/one/oktw/galaxy/item/Tool.kt @@ -24,13 +24,13 @@ import net.minecraft.text.Text.translatable import net.minecraft.util.Formatting import net.minecraft.util.Identifier -class Tool private constructor(id: String, modelData: Int, private val name: String) : - CustomItem(Identifier.of("galaxy", "item/tool/$id"), COMMAND_BLOCK, modelData, 1) { +class Tool private constructor(id: String, private val name: String) : + CustomItem(Identifier.of("galaxy", "item/tool/$id"), COMMAND_BLOCK, maxStackSize = 1) { override val cacheable = false companion object { - val WRENCH = registry.register(Tool("wrench", 2010100, "item.Tool.WRENCH")) - val CROWBAR = registry.register(Tool("crowbar", 2010200, "item.Tool.CROWBAR")) + val WRENCH = registry.register(Tool("wrench", "item.Tool.WRENCH")) + val CROWBAR = registry.register(Tool("crowbar", "item.Tool.CROWBAR")) } override fun getName(): Text = translatable(name).styled { it.withColor(Formatting.WHITE).withItalic(false) } diff --git a/src/main/kotlin/one/oktw/galaxy/item/Upgrade.kt b/src/main/kotlin/one/oktw/galaxy/item/Upgrade.kt index 99c6bd2a4..0be69ba57 100644 --- a/src/main/kotlin/one/oktw/galaxy/item/Upgrade.kt +++ b/src/main/kotlin/one/oktw/galaxy/item/Upgrade.kt @@ -24,45 +24,45 @@ import net.minecraft.text.Text.translatable import net.minecraft.util.Formatting import net.minecraft.util.Identifier -class Upgrade private constructor(id: String, modelData: Int, private val name: String, private val level: Int) : - CustomItem(Identifier.of("galaxy", "item/upgrade/$id"), COMMAND_BLOCK, modelData) { +class Upgrade private constructor(id: String, private val name: String, private val level: Int) : + CustomItem(Identifier.of("galaxy", "item/upgrade/$id"), COMMAND_BLOCK) { companion object { - val BASE = registry.register(Upgrade("base", 5000100, "item.Upgrade.BASE", 0)) - val COOLING_LV1 = registry.register(Upgrade("cooling_lv1", 5010100, "item.Upgrade.COOLING", 1)) - val COOLING_LV2 = registry.register(Upgrade("cooling_lv2", 5010101, "item.Upgrade.COOLING", 2)) - val COOLING_LV3 = registry.register(Upgrade("cooling_lv3", 5010102, "item.Upgrade.COOLING", 3)) - val COOLING_LV4 = registry.register(Upgrade("cooling_lv4", 5010103, "item.Upgrade.COOLING", 4)) - val COOLING_LV5 = registry.register(Upgrade("cooling_lv5", 5010104, "item.Upgrade.COOLING", 5)) - val RANGE_LV1 = registry.register(Upgrade("range_lv1", 5010200, "item.Upgrade.RANGE", 1)) - val RANGE_LV2 = registry.register(Upgrade("range_lv2", 5010201, "item.Upgrade.RANGE", 2)) - val RANGE_LV3 = registry.register(Upgrade("range_lv3", 5010202, "item.Upgrade.RANGE", 3)) - val RANGE_LV4 = registry.register(Upgrade("range_lv4", 5010203, "item.Upgrade.RANGE", 4)) - val RANGE_LV5 = registry.register(Upgrade("range_lv5", 5010204, "item.Upgrade.RANGE", 5)) - val SPEED_LV1 = registry.register(Upgrade("speed_lv1", 5010300, "item.Upgrade.SPEED", 1)) - val SPEED_LV2 = registry.register(Upgrade("speed_lv2", 5010301, "item.Upgrade.SPEED", 2)) - val SPEED_LV3 = registry.register(Upgrade("speed_lv3", 5010302, "item.Upgrade.SPEED", 3)) - val SPEED_LV4 = registry.register(Upgrade("speed_lv4", 5010303, "item.Upgrade.SPEED", 4)) - val SPEED_LV5 = registry.register(Upgrade("speed_lv5", 5010304, "item.Upgrade.SPEED", 5)) - val THROUGH_LV1 = registry.register(Upgrade("through_lv1", 5010400, "item.Upgrade.THROUGH", 1)) - val THROUGH_LV2 = registry.register(Upgrade("through_lv2", 5010401, "item.Upgrade.THROUGH", 2)) - val THROUGH_LV3 = registry.register(Upgrade("through_lv3", 5010402, "item.Upgrade.THROUGH", 3)) - val THROUGH_LV4 = registry.register(Upgrade("through_lv4", 5010403, "item.Upgrade.THROUGH", 4)) - val THROUGH_LV5 = registry.register(Upgrade("through_lv5", 5010404, "item.Upgrade.THROUGH", 5)) - val DAMAGE_LV1 = registry.register(Upgrade("damage_lv1", 5010500, "item.Upgrade.DAMAGE", 1)) - val DAMAGE_LV2 = registry.register(Upgrade("damage_lv2", 5010501, "item.Upgrade.DAMAGE", 2)) - val DAMAGE_LV3 = registry.register(Upgrade("damage_lv3", 5010502, "item.Upgrade.DAMAGE", 3)) - val DAMAGE_LV4 = registry.register(Upgrade("damage_lv4", 5010503, "item.Upgrade.DAMAGE", 4)) - val DAMAGE_LV5 = registry.register(Upgrade("damage_lv5", 5010504, "item.Upgrade.DAMAGE", 5)) - val DISTANCE_LV1 = registry.register(Upgrade("distance_lv1", 5010600, "item.Upgrade.DISTANCE", 1)) - val DISTANCE_LV2 = registry.register(Upgrade("distance_lv2", 5010601, "item.Upgrade.DISTANCE", 2)) - val DISTANCE_LV3 = registry.register(Upgrade("distance_lv3", 5010602, "item.Upgrade.DISTANCE", 3)) - val DISTANCE_LV4 = registry.register(Upgrade("distance_lv4", 5010603, "item.Upgrade.DISTANCE", 4)) - val DISTANCE_LV5 = registry.register(Upgrade("distance_lv5", 5010604, "item.Upgrade.DISTANCE", 5)) - val FIRE_RESISTANCE_LV1 = registry.register(Upgrade("fire_resistance_lv1", 5010700, "item.Upgrade.HEAT", 1)) - val FIRE_RESISTANCE_LV2 = registry.register(Upgrade("fire_resistance_lv2", 5010701, "item.Upgrade.HEAT", 2)) - val FIRE_RESISTANCE_LV3 = registry.register(Upgrade("fire_resistance_lv3", 5010702, "item.Upgrade.HEAT", 3)) - val FIRE_RESISTANCE_LV4 = registry.register(Upgrade("fire_resistance_lv4", 5010703, "item.Upgrade.HEAT", 4)) - val FIRE_RESISTANCE_LV5 = registry.register(Upgrade("fire_resistance_lv5", 5010704, "item.Upgrade.HEAT", 5)) + val BASE = registry.register(Upgrade("base", "item.Upgrade.BASE", 0)) + val COOLING_LV1 = registry.register(Upgrade("cooling_lv1", "item.Upgrade.COOLING", 1)) + val COOLING_LV2 = registry.register(Upgrade("cooling_lv2", "item.Upgrade.COOLING", 2)) + val COOLING_LV3 = registry.register(Upgrade("cooling_lv3", "item.Upgrade.COOLING", 3)) + val COOLING_LV4 = registry.register(Upgrade("cooling_lv4", "item.Upgrade.COOLING", 4)) + val COOLING_LV5 = registry.register(Upgrade("cooling_lv5", "item.Upgrade.COOLING", 5)) + val RANGE_LV1 = registry.register(Upgrade("range_lv1", "item.Upgrade.RANGE", 1)) + val RANGE_LV2 = registry.register(Upgrade("range_lv2", "item.Upgrade.RANGE", 2)) + val RANGE_LV3 = registry.register(Upgrade("range_lv3", "item.Upgrade.RANGE", 3)) + val RANGE_LV4 = registry.register(Upgrade("range_lv4", "item.Upgrade.RANGE", 4)) + val RANGE_LV5 = registry.register(Upgrade("range_lv5", "item.Upgrade.RANGE", 5)) + val SPEED_LV1 = registry.register(Upgrade("speed_lv1", "item.Upgrade.SPEED", 1)) + val SPEED_LV2 = registry.register(Upgrade("speed_lv2", "item.Upgrade.SPEED", 2)) + val SPEED_LV3 = registry.register(Upgrade("speed_lv3", "item.Upgrade.SPEED", 3)) + val SPEED_LV4 = registry.register(Upgrade("speed_lv4", "item.Upgrade.SPEED", 4)) + val SPEED_LV5 = registry.register(Upgrade("speed_lv5", "item.Upgrade.SPEED", 5)) + val THROUGH_LV1 = registry.register(Upgrade("through_lv1", "item.Upgrade.THROUGH", 1)) + val THROUGH_LV2 = registry.register(Upgrade("through_lv2", "item.Upgrade.THROUGH", 2)) + val THROUGH_LV3 = registry.register(Upgrade("through_lv3", "item.Upgrade.THROUGH", 3)) + val THROUGH_LV4 = registry.register(Upgrade("through_lv4", "item.Upgrade.THROUGH", 4)) + val THROUGH_LV5 = registry.register(Upgrade("through_lv5", "item.Upgrade.THROUGH", 5)) + val DAMAGE_LV1 = registry.register(Upgrade("damage_lv1", "item.Upgrade.DAMAGE", 1)) + val DAMAGE_LV2 = registry.register(Upgrade("damage_lv2", "item.Upgrade.DAMAGE", 2)) + val DAMAGE_LV3 = registry.register(Upgrade("damage_lv3", "item.Upgrade.DAMAGE", 3)) + val DAMAGE_LV4 = registry.register(Upgrade("damage_lv4", "item.Upgrade.DAMAGE", 4)) + val DAMAGE_LV5 = registry.register(Upgrade("damage_lv5", "item.Upgrade.DAMAGE", 5)) + val DISTANCE_LV1 = registry.register(Upgrade("distance_lv1", "item.Upgrade.DISTANCE", 1)) + val DISTANCE_LV2 = registry.register(Upgrade("distance_lv2", "item.Upgrade.DISTANCE", 2)) + val DISTANCE_LV3 = registry.register(Upgrade("distance_lv3", "item.Upgrade.DISTANCE", 3)) + val DISTANCE_LV4 = registry.register(Upgrade("distance_lv4", "item.Upgrade.DISTANCE", 4)) + val DISTANCE_LV5 = registry.register(Upgrade("distance_lv5", "item.Upgrade.DISTANCE", 5)) + val FIRE_RESISTANCE_LV1 = registry.register(Upgrade("fire_resistance_lv1", "item.Upgrade.HEAT", 1)) + val FIRE_RESISTANCE_LV2 = registry.register(Upgrade("fire_resistance_lv2", "item.Upgrade.HEAT", 2)) + val FIRE_RESISTANCE_LV3 = registry.register(Upgrade("fire_resistance_lv3", "item.Upgrade.HEAT", 3)) + val FIRE_RESISTANCE_LV4 = registry.register(Upgrade("fire_resistance_lv4", "item.Upgrade.HEAT", 4)) + val FIRE_RESISTANCE_LV5 = registry.register(Upgrade("fire_resistance_lv5", "item.Upgrade.HEAT", 5)) } override fun getName(): Text = translatable("item.Upgrade.Item", translatable(name)) diff --git a/src/main/kotlin/one/oktw/galaxy/item/Weapon.kt b/src/main/kotlin/one/oktw/galaxy/item/Weapon.kt index 2f7b1ce4d..7ea4cb5c5 100644 --- a/src/main/kotlin/one/oktw/galaxy/item/Weapon.kt +++ b/src/main/kotlin/one/oktw/galaxy/item/Weapon.kt @@ -24,35 +24,35 @@ import net.minecraft.text.Text.translatable import net.minecraft.util.Formatting import net.minecraft.util.Identifier -class Weapon private constructor(id: String, modelData: Int, private val name: String) : - CustomItem(Identifier.of("galaxy", "item/weapon/$id"), COMMAND_BLOCK, modelData, 1) { +class Weapon private constructor(id: String, private val name: String) : + CustomItem(Identifier.of("galaxy", "item/weapon/$id"), COMMAND_BLOCK, maxStackSize = 1) { override val cacheable = false companion object { - val PISTOL = registry.register(Weapon("pistol", 3010100, "item.Gun.PISTOL")) - val PISTOL_LASOR = registry.register(Weapon("pistol_lasor", 3010200, "item.Gun.PISTOL")) - val PISTOL_LASOR_AIMING = registry.register(Weapon("pistol_lasor_aiming", 3010201, "item.Gun.PISTOL")) - val SNIPER = registry.register(Weapon("sniper", 3010300, "item.Gun.SNIPER")) - val SNIPER_AIMING = registry.register(Weapon("sniper_aiming", 3010301, "item.Gun.SNIPER")) - val RAILGUN = registry.register(Weapon("railgun", 3010400, "item.Gun.RAILGUN")) - val RAILGUN_AIMING = registry.register(Weapon("railgun_aiming", 3010401, "item.Gun.RAILGUN")) - val SWORD_KATANA_OFF = registry.register(Weapon("sword_katana_off", 3020100, "item.Weapon.KATANA")) - val SWORD_KATANA_ON = registry.register(Weapon("sword_katana_on", 3020101, "item.Weapon.KATANA")) - val SWORD_KATANA_SCABBARD = registry.register(Weapon("sword_katana_scabbard", 3020102, "item.Weapon.KATANA.SCABARD")) - val SWORD_MAGI_OFF = registry.register(Weapon("sword_magi_off", 3020200, "item.Weapon.MAGI")) - val SWORD_MAGI_ON = registry.register(Weapon("sword_magi_on", 3020201, "item.Weapon.MAGI")) - val SWORD_GHOST_CUTTER_OFF = registry.register(Weapon("sword_ghost_cutter_off", 3020300, "item.event.halloween2018.undeadKiller")) - val SWORD_GHOST_CUTTER_ON = registry.register(Weapon("sword_ghost_cutter_on", 3020301, "item.event.halloween2018.undeadKiller")) - val SWORD_NAZO_OFF = registry.register(Weapon("sword_nazo_off", 3020400, "item.Weapon.NAZO")) - val SWORD_NAZO_ON = registry.register(Weapon("sword_nazo_on", 3020401, "item.Weapon.NAZO")) - val SWORD_NAZO_SCABBARD = registry.register(Weapon("sword_nazo_scabbard", 3020402, "item.Weapon.NAZO.SCABARD")) - val SWORD_RANBO_OFF = registry.register(Weapon("sword_ranbo_off", 3020500, "item.Weapon.RANBO")) - val SWORD_RANBO_ON = registry.register(Weapon("sword_ranbo_on", 3020501, "item.Weapon.RANBO")) - val SWORD_PLASUM_OFF = registry.register(Weapon("sword_plasum_off", 3020600, "item.Weapon.PLASUM")) - val SWORD_PLASUM_ON = registry.register(Weapon("sword_plasum_on", 3020601, "item.Weapon.PLASUM")) - val SWORD_NANOSABER_OFF = registry.register(Weapon("sword_nanosaber_off", 3020700, "item.Weapon.NANOSABER")) - val SWORD_NANOSABER_ON = registry.register(Weapon("sword_nanosaber_on", 3020701, "item.Weapon.NANOSABER")) - val SWORD_NANOSABER_SCABBARD = registry.register(Weapon("sword_nanosaber_scabbard", 3020702, "item.Weapon.NANOSABER.SCABARD")) + val PISTOL = registry.register(Weapon("pistol", "item.Gun.PISTOL")) + val PISTOL_LASOR = registry.register(Weapon("pistol_lasor", "item.Gun.PISTOL")) + val PISTOL_LASOR_AIMING = registry.register(Weapon("pistol_lasor_aiming", "item.Gun.PISTOL")) + val SNIPER = registry.register(Weapon("sniper", "item.Gun.SNIPER")) + val SNIPER_AIMING = registry.register(Weapon("sniper_aiming", "item.Gun.SNIPER")) + val RAILGUN = registry.register(Weapon("railgun", "item.Gun.RAILGUN")) + val RAILGUN_AIMING = registry.register(Weapon("railgun_aiming", "item.Gun.RAILGUN")) + val SWORD_KATANA_OFF = registry.register(Weapon("sword_katana_off", "item.Weapon.KATANA")) + val SWORD_KATANA_ON = registry.register(Weapon("sword_katana_on", "item.Weapon.KATANA")) + val SWORD_KATANA_SCABBARD = registry.register(Weapon("sword_katana_scabbard", "item.Weapon.KATANA.SCABARD")) + val SWORD_MAGI_OFF = registry.register(Weapon("sword_magi_off", "item.Weapon.MAGI")) + val SWORD_MAGI_ON = registry.register(Weapon("sword_magi_on", "item.Weapon.MAGI")) + val SWORD_GHOST_CUTTER_OFF = registry.register(Weapon("sword_ghost_cutter_off", "item.event.halloween2018.undeadKiller")) + val SWORD_GHOST_CUTTER_ON = registry.register(Weapon("sword_ghost_cutter_on", "item.event.halloween2018.undeadKiller")) + val SWORD_NAZO_OFF = registry.register(Weapon("sword_nazo_off", "item.Weapon.NAZO")) + val SWORD_NAZO_ON = registry.register(Weapon("sword_nazo_on", "item.Weapon.NAZO")) + val SWORD_NAZO_SCABBARD = registry.register(Weapon("sword_nazo_scabbard", "item.Weapon.NAZO.SCABARD")) + val SWORD_RANBO_OFF = registry.register(Weapon("sword_ranbo_off", "item.Weapon.RANBO")) + val SWORD_RANBO_ON = registry.register(Weapon("sword_ranbo_on", "item.Weapon.RANBO")) + val SWORD_PLASUM_OFF = registry.register(Weapon("sword_plasum_off", "item.Weapon.PLASUM")) + val SWORD_PLASUM_ON = registry.register(Weapon("sword_plasum_on", "item.Weapon.PLASUM")) + val SWORD_NANOSABER_OFF = registry.register(Weapon("sword_nanosaber_off", "item.Weapon.NANOSABER")) + val SWORD_NANOSABER_ON = registry.register(Weapon("sword_nanosaber_on", "item.Weapon.NANOSABER")) + val SWORD_NANOSABER_SCABBARD = registry.register(Weapon("sword_nanosaber_scabbard", "item.Weapon.NANOSABER.SCABARD")) } override fun getName(): Text = translatable(name).styled { it.withColor(Formatting.WHITE).withItalic(false) } diff --git a/src/main/resources/data/galaxy/recipe/blocks/elevator.json b/src/main/resources/data/galaxy/recipe/blocks/elevator.json index 31dfe3713..98216421e 100644 --- a/src/main/resources/data/galaxy/recipe/blocks/elevator.json +++ b/src/main/resources/data/galaxy/recipe/blocks/elevator.json @@ -17,7 +17,7 @@ "show_in_tooltip": false }, "item_name": "{\"translate\": \"block.ELEVATOR\", \"color\": \"white\", \"italic\": false}", - "custom_model_data": 1010200, + "item_model": "galaxy:item/block/elevator", "custom_data": { "GalaxyData": { "CustomItemIdentifier": "galaxy:item/block/elevator" diff --git a/src/main/resources/data/galaxy/recipe/blocks/harvest.json b/src/main/resources/data/galaxy/recipe/blocks/harvest.json index 870b45510..5ff8094be 100644 --- a/src/main/resources/data/galaxy/recipe/blocks/harvest.json +++ b/src/main/resources/data/galaxy/recipe/blocks/harvest.json @@ -23,7 +23,7 @@ "show_in_tooltip": false }, "item_name": "{\"translate\": \"block.HARVEST\", \"color\": \"white\", \"italic\": false}", - "custom_model_data": 1010700, + "item_model": "galaxy:item/block/harvest", "custom_data": { "GalaxyData": { "CustomItemIdentifier": "galaxy:item/block/harvest" diff --git a/src/main/resources/data/galaxy/recipe/blocks/ht_crafting_table.json b/src/main/resources/data/galaxy/recipe/blocks/ht_crafting_table.json index 3c6a1852c..29b68b417 100644 --- a/src/main/resources/data/galaxy/recipe/blocks/ht_crafting_table.json +++ b/src/main/resources/data/galaxy/recipe/blocks/ht_crafting_table.json @@ -26,7 +26,7 @@ "show_in_tooltip": false }, "item_name": "{\"translate\": \"block.HT_CRAFTING_TABLE\", \"color\": \"white\", \"italic\": false}", - "custom_model_data": 1010100, + "item_model": "galaxy:item/block/ht_crafting_table", "custom_data": { "GalaxyData": { "CustomItemIdentifier": "galaxy:item/block/ht_crafting_table" diff --git a/src/main/resources/data/galaxy/recipe/blocks/trashcan.json b/src/main/resources/data/galaxy/recipe/blocks/trashcan.json index ef831df27..813168019 100644 --- a/src/main/resources/data/galaxy/recipe/blocks/trashcan.json +++ b/src/main/resources/data/galaxy/recipe/blocks/trashcan.json @@ -24,7 +24,7 @@ "show_in_tooltip": false }, "item_name": "{\"translate\": \"block.TRASHCAN\", \"color\": \"white\", \"italic\": false}", - "custom_model_data": 1010700, + "item_model": "galaxy:item/block/trashcan", "custom_data": { "GalaxyData": { "CustomItemIdentifier": "galaxy:item/block/trashcan" diff --git a/src/main/resources/data/galaxy/recipe/tools/crowbar.json b/src/main/resources/data/galaxy/recipe/tools/crowbar.json index 148d94f5b..a25f8ee15 100644 --- a/src/main/resources/data/galaxy/recipe/tools/crowbar.json +++ b/src/main/resources/data/galaxy/recipe/tools/crowbar.json @@ -22,7 +22,7 @@ "show_in_tooltip": false }, "item_name": "{\"translate\": \"item.Tool.CROWBAR\", \"color\": \"white\", \"italic\": false}", - "custom_model_data": 2010200, + "item_model": "galaxy:item/tool/crowbar", "custom_data": { "GalaxyData": { "CustomItemIdentifier": "galaxy:item/tool/crowbar" diff --git a/src/main/resources/data/galaxy/recipe/tools/wrench.json b/src/main/resources/data/galaxy/recipe/tools/wrench.json index f170c1def..1f08df6a8 100644 --- a/src/main/resources/data/galaxy/recipe/tools/wrench.json +++ b/src/main/resources/data/galaxy/recipe/tools/wrench.json @@ -23,7 +23,7 @@ "show_in_tooltip": false }, "item_name": "{\"translate\": \"item.Tool.WRENCH\", \"color\": \"white\", \"italic\": false}", - "custom_model_data": 2010100, + "item_model": "galaxy:item/tool/wrench", "custom_data": { "GalaxyData": { "CustomItemIdentifier": "galaxy:item/tool/wrench" From 5c3d977d9a9038f03b4711199a83ef852ee41f61 Mon Sep 17 00:00:00 2001 From: jimchen5209 Date: Wed, 25 Dec 2024 20:45:37 +0800 Subject: [PATCH 08/11] build: update fabric mapping and fabric api --- build.gradle.kts | 4 ++-- src/main/kotlin/one/oktw/galaxy/block/CustomBlock.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 38f3fca6d..c9cabe933 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,7 +11,7 @@ plugins { val version = "0.0.1" val group = "one.oktw" -val fabricVersion = "0.111.0+1.21.4" +val fabricVersion = "0.113.0+1.21.4" val galaxyLibVersion = "bcf8f61" repositories { @@ -43,7 +43,7 @@ loom { dependencies { // Core minecraft(group = "com.mojang", name = "minecraft", version = "1.21.4") - mappings(group = "net.fabricmc", name = "yarn", version = "1.21.4+build.1", classifier = "v2") + mappings(group = "net.fabricmc", name = "yarn", version = "1.21.4+build.2", classifier = "v2") modImplementation(group = "net.fabricmc", name = "fabric-loader", version = "0.16.9") // fabric api diff --git a/src/main/kotlin/one/oktw/galaxy/block/CustomBlock.kt b/src/main/kotlin/one/oktw/galaxy/block/CustomBlock.kt index 283a53c50..0d92b3e28 100644 --- a/src/main/kotlin/one/oktw/galaxy/block/CustomBlock.kt +++ b/src/main/kotlin/one/oktw/galaxy/block/CustomBlock.kt @@ -37,7 +37,7 @@ open class CustomBlock(final override val identifier: Identifier, val baseBlock: protected val blockEntityType: BlockEntityType = Registry.register( Registries.BLOCK_ENTITY_TYPE, identifier, - FabricBlockEntityTypeBuilder.create({ pos, _ -> createBlockEntity(pos) }, BARRIER).build(null) + FabricBlockEntityTypeBuilder.create({ pos, _ -> createBlockEntity(pos) }, BARRIER).build() ) companion object { From 02a43c2b7521cce2863f23066aff9b4e200ceacd Mon Sep 17 00:00:00 2001 From: jimchen5209 Date: Wed, 25 Dec 2024 20:45:57 +0800 Subject: [PATCH 09/11] build(docker): update mods and easy recipe --- docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker b/docker index e1a7dcfc3..947d045e0 160000 --- a/docker +++ b/docker @@ -1 +1 @@ -Subproject commit e1a7dcfc38480c663df1e8ced5c8848df3779b0a +Subproject commit 947d045e0bf1ee878da7c6e06798fd3f087bc06e From c06779d5f039cc1eb84b58ce144e401044cda1d3 Mon Sep 17 00:00:00 2001 From: jimchen5209 Date: Mon, 20 Jan 2025 22:31:59 +0800 Subject: [PATCH 10/11] build(docker): update mods --- docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker b/docker index 947d045e0..7eb3bae1b 160000 --- a/docker +++ b/docker @@ -1 +1 @@ -Subproject commit 947d045e0bf1ee878da7c6e06798fd3f087bc06e +Subproject commit 7eb3bae1b9aef6ef2abb01dd4ef82578f21fd5ce From 1094655f9ee4e947f6bd8ca31d0b210eca04535f Mon Sep 17 00:00:00 2001 From: jimchen5209 Date: Mon, 20 Jan 2025 22:32:21 +0800 Subject: [PATCH 11/11] build: update fabric mapping and fabric api --- build.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index c9cabe933..f07267770 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,7 +11,7 @@ plugins { val version = "0.0.1" val group = "one.oktw" -val fabricVersion = "0.113.0+1.21.4" +val fabricVersion = "0.114.3+1.21.4" val galaxyLibVersion = "bcf8f61" repositories { @@ -43,8 +43,8 @@ loom { dependencies { // Core minecraft(group = "com.mojang", name = "minecraft", version = "1.21.4") - mappings(group = "net.fabricmc", name = "yarn", version = "1.21.4+build.2", classifier = "v2") - modImplementation(group = "net.fabricmc", name = "fabric-loader", version = "0.16.9") + mappings(group = "net.fabricmc", name = "yarn", version = "1.21.4+build.8", classifier = "v2") + modImplementation(group = "net.fabricmc", name = "fabric-loader", version = "0.16.10") // fabric api modImplementation(group = "net.fabricmc.fabric-api", name = "fabric-api", version = fabricVersion) {