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())