diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/blockentity/FluidTankRenderer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/blockentity/FluidTankRenderer.kt index 4d9fd6fc4..3159ae3ca 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/blockentity/FluidTankRenderer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/blockentity/FluidTankRenderer.kt @@ -3,12 +3,12 @@ package ru.dbotthepony.mc.otm.client.render.blockentity import com.mojang.blaze3d.vertex.* import com.mojang.math.Axis import net.minecraft.client.renderer.* +import net.minecraft.client.renderer.block.model.ItemTransforms import net.minecraft.client.renderer.blockentity.BlockEntityRenderer import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider import net.minecraft.client.renderer.entity.ItemRenderer import net.minecraft.world.inventory.InventoryMenu import net.minecraft.world.item.BlockItem -import net.minecraft.world.item.ItemDisplayContext import net.minecraft.world.item.ItemStack import net.minecraft.world.level.block.HalfTransparentBlock import net.minecraft.world.level.block.StainedGlassPaneBlock @@ -38,7 +38,7 @@ class FluidTankRenderer(private val context: BlockEntityRendererProvider.Context object FluidTankItemRenderer : BlockEntityWithoutLevelRenderer(minecraft.blockEntityRenderDispatcher, minecraft.entityModels) { override fun renderByItem( stack: ItemStack, - displayContext: ItemDisplayContext, + displayContext: ItemTransforms.TransformType, poseStack: PoseStack, bufferSource: MultiBufferSource, packedLight: Int, @@ -51,7 +51,7 @@ class FluidTankRenderer(private val context: BlockEntityRendererProvider.Context } val hasFoil = stack.hasFoil() - val fabulous = displayContext == ItemDisplayContext.GUI + val fabulous = displayContext == ItemTransforms.TransformType.GUI || displayContext.firstPerson() || (stack.item is BlockItem && ((stack.item as BlockItem).block is HalfTransparentBlock || (stack.item as BlockItem).block is StainedGlassPaneBlock)) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/container/DynamicallyProxiedContainer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/container/DynamicallyProxiedContainer.kt index b2e400392..26b258970 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/container/DynamicallyProxiedContainer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/container/DynamicallyProxiedContainer.kt @@ -63,10 +63,6 @@ class DynamicallyProxiedContainer(private val toProxy: Supplier) : IC return toProxy.get().canPlaceItem(slot, itemStack) } - override fun canTakeItem(container: Container, slot: Int, itemStack: ItemStack): Boolean { - return toProxy.get().canTakeItem(container, slot, itemStack) - } - override fun countItem(item: Item): Int { return toProxy.get().countItem(item) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/container/IContainer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/container/IContainer.kt index 3afa4ab72..152b969e5 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/container/IContainer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/container/IContainer.kt @@ -26,10 +26,6 @@ interface IContainer : Container { return super.canPlaceItem(slot, itemStack) } - override fun canTakeItem(container: Container, slot: Int, itemStack: ItemStack): Boolean { - return super.canTakeItem(container, slot, itemStack) - } - override fun countItem(item: Item): Int { return super.countItem(item) } @@ -74,10 +70,6 @@ interface IContainer : Container { return container.canPlaceItem(slot, itemStack) } - override fun canTakeItem(container: Container, slot: Int, itemStack: ItemStack): Boolean { - return container.canTakeItem(container, slot, itemStack) - } - override fun countItem(item: Item): Int { return container.countItem(item) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/core/Ext.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/core/Ext.kt index 173689550..1a3e5ce02 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/core/Ext.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/core/Ext.kt @@ -10,6 +10,7 @@ import com.google.common.collect.ImmutableSet import com.google.gson.JsonElement import com.google.gson.JsonObject import com.google.gson.JsonPrimitive +import com.mojang.serialization.DataResult import it.unimi.dsi.fastutil.objects.ObjectComparators import net.minecraft.core.BlockPos import net.minecraft.nbt.CompoundTag diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/EnergyContainerRecipe.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/EnergyContainerRecipe.kt index 6541d8ab9..8990a7ca2 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/EnergyContainerRecipe.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/EnergyContainerRecipe.kt @@ -26,8 +26,8 @@ class EnergyContainerRecipe(val parent: ShapedRecipe) : CraftingRecipe, IShapedR return parent.canCraftInDimensions(p_43999_, p_44000_) } - override fun getResultItem(p_267052_: RegistryAccess): ItemStack { - return parent.getResultItem(p_267052_) + override fun getResultItem(): ItemStack { + return parent.getResultItem() } override fun category(): CraftingBookCategory { @@ -46,10 +46,6 @@ class EnergyContainerRecipe(val parent: ShapedRecipe) : CraftingRecipe, IShapedR return parent.isSpecial } - override fun showNotification(): Boolean { - return parent.showNotification() - } - override fun getGroup(): String { return parent.group } @@ -66,8 +62,8 @@ class EnergyContainerRecipe(val parent: ShapedRecipe) : CraftingRecipe, IShapedR return parent.type } - override fun assemble(container: CraftingContainer, registryAccess: RegistryAccess): ItemStack { - val itemStack = parent.assemble(container, registryAccess) + override fun assemble(container: CraftingContainer): ItemStack { + val itemStack = parent.assemble(container) val battery = container.stream() .filter { !it.isEmpty } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/IMatteryRecipe.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/IMatteryRecipe.kt index 3e5ac763e..a8045539c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/IMatteryRecipe.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/IMatteryRecipe.kt @@ -23,10 +23,6 @@ interface IMatteryRecipe : Recipe { return super.isSpecial() } - override fun showNotification(): Boolean { - return super.showNotification() - } - override fun getGroup(): String { return super.getGroup() } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/PainterRecipe.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/PainterRecipe.kt index 8fff7cc78..b726497b5 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/PainterRecipe.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/PainterRecipe.kt @@ -135,7 +135,7 @@ class PainterRecipe( return NonNullList.of(Ingredient.EMPTY, input) } - override fun assemble(p_44001_: Container, p_267165_: RegistryAccess): ItemStack { + override fun assemble(p_44001_: Container): ItemStack { return output.copy().also { o -> p_44001_[0].tag?.let { if (o.tag == null) { @@ -149,7 +149,7 @@ class PainterRecipe( } } - override fun getResultItem(p_267052_: RegistryAccess): ItemStack { + override fun getResultItem(): ItemStack { return output } @@ -194,7 +194,7 @@ class PainterArmorDyeRecipe( return !isIncomplete && value.item is DyeableArmorItem } - override fun assemble(container: Container, registry: RegistryAccess): ItemStack { + override fun assemble(container: Container): ItemStack { var output = container[0].copy() dyes.forEach { entry -> @@ -208,7 +208,7 @@ class PainterArmorDyeRecipe( return output } - override fun getResultItem(registry: RegistryAccess): ItemStack = ItemStack.EMPTY + override fun getResultItem(): ItemStack = ItemStack.EMPTY override fun getSerializer(): RecipeSerializer<*> = SERIALIZER diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/PlatePressRecipe.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/PlatePressRecipe.kt index 143d7cd1d..a55184efd 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/PlatePressRecipe.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/PlatePressRecipe.kt @@ -70,9 +70,9 @@ class PlatePressRecipe( return input.isActuallyEmpty || output.isActuallyEmpty } - override fun assemble(p_44001_: Container, registry: RegistryAccess): ItemStack = outputStack.copy() + override fun assemble(p_44001_: Container): ItemStack = outputStack.copy() override fun canCraftInDimensions(p_43999_: Int, p_44000_: Int) = true - override fun getResultItem(registry: RegistryAccess): ItemStack = outputStack + override fun getResultItem(): ItemStack = outputStack override fun getSerializer(): RecipeSerializer<*> { return SERIALIZER