From 924766976ea327eeadf09aab730435ba9a9aa9ab Mon Sep 17 00:00:00 2001 From: Matyrobbrt Date: Sat, 6 Apr 2024 21:14:38 +0300 Subject: [PATCH 01/20] Initial port --- build.gradle | 150 +++++++----------- gradle.properties | 15 +- gradle/wrapper/gradle-wrapper.jar | Bin 59536 -> 62076 bytes gradle/wrapper/gradle-wrapper.properties | 3 +- settings.gradle | 12 +- .../functionalstorage/FunctionalStorage.java | 48 +++--- .../block/CompactingDrawerBlock.java | 8 +- .../block/CompactingFramedDrawerBlock.java | 2 +- .../block/ControllerExtensionBlock.java | 2 +- .../functionalstorage/block/DrawerBlock.java | 8 +- .../block/DrawerControllerBlock.java | 2 +- .../block/EnderDrawerBlock.java | 2 +- .../block/FluidDrawerBlock.java | 8 +- .../block/FramedControllerExtensionBlock.java | 2 +- .../block/FramedDrawerBlock.java | 6 +- .../block/FramedDrawerControllerBlock.java | 2 +- .../FramedSimpleCompactingDrawerBlock.java | 2 +- .../block/SimpleCompactingDrawerBlock.java | 4 +- .../block/tile/ArmoryCabinetTile.java | 10 +- .../block/tile/CompactingDrawerTile.java | 14 +- .../tile/CompactingFramedDrawerTile.java | 3 +- .../block/tile/ControllableDrawerTile.java | 10 +- .../block/tile/DrawerTile.java | 14 +- .../block/tile/EnderDrawerTile.java | 14 +- .../block/tile/FluidDrawerTile.java | 34 ++-- .../tile/FramedControllerExtensionTile.java | 2 +- .../tile/FramedDrawerControllerTile.java | 2 +- .../block/tile/FramedDrawerTile.java | 3 +- .../FramedSimpleCompactingDrawerTile.java | 3 +- .../tile/ItemControllableDrawerTile.java | 16 +- .../tile/SimpleCompactingDrawerTile.java | 14 +- .../tile/StorageControllerExtensionTile.java | 7 +- .../block/tile/StorageControllerTile.java | 20 +-- .../client/ControllerRenderer.java | 2 +- .../client/DrawerRenderer.java | 1 + .../client/FluidDrawerRenderer.java | 4 +- .../client/FramedColors.java | 10 +- .../client/gui/DrawerInfoGuiAddon.java | 2 +- .../client/gui/FluidDrawerInfoGuiAddon.java | 6 +- .../client/loader/FramedModel.java | 26 +-- .../client/model/FramedDrawerModelData.java | 7 +- .../functionalstorage/compat/TOPPlugin.java | 4 +- .../compat/top/FunctionalDrawerProvider.java | 2 +- .../FunctionalStorageBlockTagsProvider.java | 6 +- .../FunctionalStorageBlockstateProvider.java | 15 +- .../FunctionalStorageItemTagsProvider.java | 7 +- .../data/FunctionalStorageLangProvider.java | 6 +- .../FunctionalStorageRecipesProvider.java | 7 +- .../fluid/BigFluidHandler.java | 8 +- .../fluid/ControllerFluidHandler.java | 4 +- .../ArmoryCabinetInventoryHandler.java | 8 +- .../inventory/BigInventoryHandler.java | 8 +- .../inventory/CompactingInventoryHandler.java | 7 +- .../inventory/ControllerInventoryHandler.java | 2 +- .../CompactingDrawerCapabilityProvider.java | 14 +- .../item/CompactingStackItemHandler.java | 7 +- .../item/DrawerCapabilityProvider.java | 14 +- .../item/DrawerStackItemHandler.java | 9 +- .../item/LinkingToolItem.java | 4 +- .../item/StorageUpgradeItem.java | 4 +- .../functionalstorage/item/UpgradeItem.java | 2 +- .../network/EnderDrawerSyncMessage.java | 3 +- .../recipe/DrawerlessWoodIngredient.java | 4 +- .../util/CompactingUtil.java | 5 +- .../util/ConnectedDrawers.java | 8 +- .../functionalstorage/util/MathUtils.java | 1 + .../functionalstorage/util/StorageTags.java | 1 - .../functionalstorage/util/TooltipUtil.java | 6 +- 68 files changed, 321 insertions(+), 345 deletions(-) diff --git a/build.gradle b/build.gradle index 174a591c..6a8ccec9 100644 --- a/build.gradle +++ b/build.gradle @@ -1,117 +1,85 @@ -buildscript { - repositories { - // These repositories are only for Gradle plugins, put any other repositories in the repository block further below - maven { url = 'https://maven.minecraftforge.net' } - mavenCentral() - } - dependencies { - classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true - } +plugins { + id 'java-library' + id 'eclipse' + id 'idea' + id 'maven-publish' + id 'net.neoforged.gradle.userdev' version '7.0.97' } -apply plugin: 'net.minecraftforge.gradle' - -group = 'com.buuz135' -version = '1.20.1-1.2.10' - -java { - archivesBaseName = 'functionalstorage' - toolchain.languageVersion = JavaLanguageVersion.of(17) +final mcVersion = project.neo_version.split('\\.', 3).with { + '1.' + it[0] + '.' + it[1] } +version = mcVersion + "-" + mod_version +group = modGroup -minecraft { - - mappings channel: 'official', version: '1.20.1' - accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') - - runs { - client { - workingDirectory project.file('run') - property 'forge.logging.markers', 'REGISTRIES' - property 'forge.logging.console.level', 'debug' - property 'mixin.env.remapRefMap', 'true' - property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" - - mods { - functionalstorage { - source sourceSets.main - } - } +repositories { + maven { + name = "BlameJared maven" + url = "https://maven.blamejared.com/" + } + maven { + url "https://www.cursemaven.com" + content { + includeGroup "curse.maven" } + } +} - server { - property 'forge.logging.markers', 'REGISTRIES' - property 'forge.logging.console.level', 'debug' - property 'mixin.env.remapRefMap', 'true' - property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" +base { + archivesName = modBaseName +} - mods { - functionalstorage { - source sourceSets.main - } - } - } +// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. +java.toolchain.languageVersion = JavaLanguageVersion.of(17) - data { - workingDirectory project.file('run') - property 'forge.logging.markers', 'REGISTRIES' +// Default run configurations. +// These can be tweaked, removed, or duplicated as needed. +runs { + configureEach { + // Recommended logging level for the console + // You can set various levels here. + // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels + systemProperty 'forge.logging.console.level', 'debug' - property 'forge.logging.console.level', 'debug' - property 'mixin.env.remapRefMap', 'true' - property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" + modSource project.sourceSets.main + } - args '--mod', 'functionalstorage', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') + client { + } - mods { - functionalstorage { - source sourceSets.main - } - } - } + server { + programArgument '--nogui' } } +minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/accesstransformer.cfg') + // Include resources generated by data generators. sourceSets.main.resources { srcDir 'src/generated/resources' } -repositories { - maven { - name 'jared maven' - url "https://maven.blamejared.com/" - } - - maven { - url = "https://www.cursemaven.com" - } - //maven { url 'https://modmaven.dev/' } -} - dependencies { - - minecraft 'net.minecraftforge:forge:1.20.1-47.1.1' - implementation fg.deobf(project.dependencies.create('com.hrznstudio:titanium:1.20.1-3.8.1-9')) - compileOnly fg.deobf("mezz.jei:jei-1.20.1-common-api:15.2.0.23") - compileOnly fg.deobf("mezz.jei:jei-1.20.1-forge-api:15.2.0.23") - // at runtime, use the full JEI jar for Forge - runtimeOnly fg.deobf("mezz.jei:jei-1.20.1-forge:15.2.0.23") - implementation fg.deobf("curse.maven:the-one-probe-245211:4613250") - implementation fg.deobf("curse.maven:mekanism-268560:4866575") - annotationProcessor "org.spongepowered:mixin:0.8.5:processor" + implementation "net.neoforged:neoforge:${neo_version}" + + compileOnly "mezz.jei:jei-1.20.4-common-api:$jei_version" + compileOnly "mezz.jei:jei-1.20.4-neoforge-api:$jei_version" + runtimeOnly "mezz.jei:jei-1.20.4-neoforge:$jei_version" + implementation "curse.maven:refined-storage-243076:5165548" } -// Example for how to get properties into the manifest for reading at runtime. jar { manifest { - attributes([ - "Specification-Title" : "functionalstorage", - "Specification-Vendor" : "Buuz135, Rid", - "Specification-Version" : "1", // We are version 1 of ourselves - "Implementation-Title" : project.name, - "Implementation-Version" : project.jar.archiveVersion, - "Implementation-Vendor" : "Buuz135, Rid", - "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") + attributes(["Specification-Title" : project.name, + "Specification-Vendor" : "Buuz135", + "Specification-Version" : "1.0", + "Implementation-Title" : project.name, + "Implementation-Version" : "${project.version}", + "Implementation-Vendor" : "Buuz135", + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), + "ModSide" : "BOTH" ]) } } -jar.finalizedBy('reobfJar') +tasks.withType(JavaCompile).configureEach { + options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 01bb4ddc..f7581260 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,10 @@ -org.gradle.jvmargs=-Xmx3G -org.gradle.daemon=false -mc_version=1.20.1 -jei_version=11.2.0.254 -mekanism_version=10.3.5.474 \ No newline at end of file +org.gradle.jvmargs=-Xmx2048M +modGroup=com.buuz135 +mod_version=2.4.0 +modBaseName=rsrequestify + +neo_version=20.4.200 +jei_version=17.3.0.49 + +neogradle.subsystems.parchment.minecraftVersion=1.20.4 +neogradle.subsystems.parchment.mappingsVersion=2024.02.25 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae8848c63b8b4dea2cb829da983f2fa..c1962a79e29d3e0ab67b14947c167a862655af9b 100644 GIT binary patch delta 40133 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 this::onClient); EventManager.forge(BlockEvent.BreakEvent.class).process(breakEvent -> { if (breakEvent.getPlayer().isCreative()) { @@ -360,7 +362,7 @@ public void onClient() { if (itemTooltipEvent.getItemStack().is(FunctionalStorage.LINKING_TOOL.get()) && itemTooltipEvent.getItemStack().getOrCreateTag().contains(LinkingToolItem.NBT_ENDER)) { TooltipUtil.renderItems(itemTooltipEvent.getGraphics(), EnderDrawerBlock.getFrequencyDisplay(itemTooltipEvent.getItemStack().getOrCreateTag().getString(LinkingToolItem.NBT_ENDER)), itemTooltipEvent.getX() + 14, itemTooltipEvent.getY() + 11); } - itemTooltipEvent.getItemStack().getCapability(ForgeCapabilities.ITEM_HANDLER).ifPresent(iItemHandler -> { + itemTooltipEvent.getItemStack().getCapability(Capabilities.ITEM_HANDLER).ifPresent(iItemHandler -> { if (iItemHandler instanceof DrawerStackItemHandler) { int i = 0; for (BigInventoryHandler.BigStack storedStack : ((DrawerStackItemHandler) iItemHandler).getStoredStacks()) { diff --git a/src/main/java/com/buuz135/functionalstorage/block/CompactingDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/CompactingDrawerBlock.java index 5a9152f4..a311446a 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/CompactingDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/CompactingDrawerBlock.java @@ -50,11 +50,11 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraftforge.common.Tags; -import net.minecraftforge.common.capabilities.ICapabilityProvider; +import net.neoforged.neoforge.common.Tags; +import net.neoforged.neoforge.common.capabilities.ICapabilityProvider; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; - +import var; import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; @@ -295,7 +295,7 @@ public static class CompactingDrawerItem extends BlockItem { private final int slots; private Block drawerBlock; - public CompactingDrawerItem(Block p_40565_, Properties p_40566_, int slots) { + public CompactingDrawerItem(Block p_40565_, net.minecraft.world.item.Item.Properties p_40566_, int slots) { super(p_40565_, p_40566_); this.drawerBlock = p_40565_; this.slots = slots; diff --git a/src/main/java/com/buuz135/functionalstorage/block/CompactingFramedDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/CompactingFramedDrawerBlock.java index 7ada92ef..b820129c 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/CompactingFramedDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/CompactingFramedDrawerBlock.java @@ -27,7 +27,7 @@ import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.common.Tags; +import net.neoforged.neoforge.common.Tags; import org.jetbrains.annotations.Nullable; import java.util.List; diff --git a/src/main/java/com/buuz135/functionalstorage/block/ControllerExtensionBlock.java b/src/main/java/com/buuz135/functionalstorage/block/ControllerExtensionBlock.java index bf83dd53..ec212bde 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/ControllerExtensionBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/ControllerExtensionBlock.java @@ -10,7 +10,7 @@ import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.storage.loot.LootTable; -import net.minecraftforge.common.Tags; +import net.neoforged.neoforge.common.Tags; import org.jetbrains.annotations.NotNull; import java.util.function.Consumer; diff --git a/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java index e8ff2ba5..44e86251 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java @@ -55,12 +55,12 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraftforge.common.Tags; -import net.minecraftforge.common.capabilities.ICapabilityProvider; +import net.neoforged.neoforge.common.Tags; +import net.neoforged.neoforge.common.capabilities.ICapabilityProvider; import org.apache.commons.lang3.tuple.Pair; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; - +import var; import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.HashMap; @@ -384,7 +384,7 @@ public int getSignal(BlockState p_60483_, BlockGetter blockGetter, BlockPos bloc public static class DrawerItem extends BlockItem{ private DrawerBlock drawerBlock; - public DrawerItem(DrawerBlock p_40565_, Properties p_40566_, TitaniumTab tab) { + public DrawerItem(DrawerBlock p_40565_, net.minecraft.world.item.Item.Properties p_40566_, TitaniumTab tab) { super(p_40565_, p_40566_); this.drawerBlock = p_40565_; tab.getTabList().add(this); diff --git a/src/main/java/com/buuz135/functionalstorage/block/DrawerControllerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/DrawerControllerBlock.java index 8e5abfb5..5a7a7c5a 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/DrawerControllerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/DrawerControllerBlock.java @@ -10,7 +10,7 @@ import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.storage.loot.LootTable; -import net.minecraftforge.common.Tags; +import net.neoforged.neoforge.common.Tags; import org.jetbrains.annotations.NotNull; import java.util.function.Consumer; diff --git a/src/main/java/com/buuz135/functionalstorage/block/EnderDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/EnderDrawerBlock.java index 8f0d8fd6..483a4e11 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/EnderDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/EnderDrawerBlock.java @@ -38,7 +38,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.registries.ForgeRegistries; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java index 32cc4df5..170c7e38 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java @@ -47,11 +47,11 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraftforge.common.capabilities.ICapabilityProvider; -import net.minecraftforge.fluids.FluidStack; +import net.neoforged.neoforge.common.capabilities.ICapabilityProvider; +import net.neoforged.neoforge.fluids.FluidStack; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; - +import var; import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; @@ -309,7 +309,7 @@ public static class DrawerItem extends BlockItem { private FluidDrawerBlock drawerBlock; - public DrawerItem(FluidDrawerBlock p_40565_, Properties p_40566_) { + public DrawerItem(FluidDrawerBlock p_40565_, net.minecraft.world.item.Item.Properties p_40566_) { super(p_40565_, p_40566_); this.drawerBlock = p_40565_; } diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java index 8a9ed6d6..d81130d6 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java @@ -23,7 +23,7 @@ import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.common.Tags; +import net.neoforged.neoforge.common.Tags; import org.jetbrains.annotations.Nullable; import java.util.List; diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java index 565e953b..f22f5a20 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java @@ -30,9 +30,9 @@ import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.common.Tags; -import net.minecraftforge.items.ItemHandlerHelper; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.common.Tags; +import net.neoforged.neoforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.registries.ForgeRegistries; import org.apache.commons.lang3.tuple.Pair; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerControllerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerControllerBlock.java index ed975149..04554f05 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerControllerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerControllerBlock.java @@ -22,7 +22,7 @@ import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.common.Tags; +import net.neoforged.neoforge.common.Tags; import org.jetbrains.annotations.Nullable; import java.util.List; diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedSimpleCompactingDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedSimpleCompactingDrawerBlock.java index ec13bb8c..c9a3eb1b 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedSimpleCompactingDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedSimpleCompactingDrawerBlock.java @@ -26,7 +26,7 @@ import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.common.Tags; +import net.neoforged.neoforge.common.Tags; import org.jetbrains.annotations.Nullable; import java.util.List; diff --git a/src/main/java/com/buuz135/functionalstorage/block/SimpleCompactingDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/SimpleCompactingDrawerBlock.java index 75c017f2..7c8dd4e7 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/SimpleCompactingDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/SimpleCompactingDrawerBlock.java @@ -44,10 +44,10 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraftforge.common.Tags; +import net.neoforged.neoforge.common.Tags; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; - +import var; import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/ArmoryCabinetTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/ArmoryCabinetTile.java index 39fed6a8..c22bf303 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/ArmoryCabinetTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/ArmoryCabinetTile.java @@ -11,10 +11,10 @@ import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.IItemHandler; +import net.neoforged.neoforge.common.capabilities.Capabilities; +import net.neoforged.neoforge.common.capabilities.Capability; +import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.items.IItemHandler; import org.jetbrains.annotations.NotNull; import javax.annotation.Nonnull; @@ -40,7 +40,7 @@ public void onChange() { @Nonnull @Override public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == ForgeCapabilities.ITEM_HANDLER) { + if (cap == Capabilities.ITEM_HANDLER) { return lazyStorage.cast(); } return super.getCapability(cap, side); diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingDrawerTile.java index a2c0e344..3dd5fd72 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingDrawerTile.java @@ -16,12 +16,12 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.IItemHandler; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.common.capabilities.Capabilities; +import net.neoforged.neoforge.common.capabilities.Capability; +import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.items.IItemHandler; import org.apache.commons.lang3.tuple.Pair; import org.jetbrains.annotations.NotNull; @@ -146,7 +146,7 @@ public int getBaseSize(int slot) { @Nonnull @Override public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == ForgeCapabilities.ITEM_HANDLER) { + if (cap == Capabilities.ITEM_HANDLER) { return lazyStorage.cast(); } return super.getCapability(cap, side); diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingFramedDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingFramedDrawerTile.java index 0d4b288e..bc0ea7a7 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingFramedDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingFramedDrawerTile.java @@ -6,8 +6,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.client.model.data.ModelData; - +import net.neoforged.neoforge.client.model.data.ModelData; import javax.annotation.Nonnull; import java.util.HashMap; diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/ControllableDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/ControllableDrawerTile.java index acebd406..4952426b 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/ControllableDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/ControllableDrawerTile.java @@ -25,11 +25,11 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.util.INBTSerializable; -import net.minecraftforge.items.ItemHandlerHelper; - +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.common.util.INBTSerializable; +import net.neoforged.neoforge.items.ItemHandlerHelper; +import var; import java.util.HashMap; public abstract class ControllableDrawerTile> extends ActiveTile { diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/DrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/DrawerTile.java index b0b5618d..b226932b 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/DrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/DrawerTile.java @@ -15,12 +15,12 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.IItemHandler; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.common.capabilities.Capabilities; +import net.neoforged.neoforge.common.capabilities.Capability; +import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.items.IItemHandler; import org.jetbrains.annotations.NotNull; import javax.annotation.Nonnull; @@ -90,7 +90,7 @@ public void initClient() { @Nonnull @Override public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == ForgeCapabilities.ITEM_HANDLER) { + if (cap == Capabilities.ITEM_HANDLER) { return lazyStorage.cast(); } return super.getCapability(cap, side); diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/EnderDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/EnderDrawerTile.java index 293aed2c..b0538d97 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/EnderDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/EnderDrawerTile.java @@ -19,12 +19,12 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.IItemHandler; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.common.capabilities.Capabilities; +import net.neoforged.neoforge.common.capabilities.Capability; +import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.items.IItemHandler; import org.jetbrains.annotations.NotNull; import javax.annotation.Nonnull; @@ -66,7 +66,7 @@ public void initClient() { @Nonnull @Override public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == ForgeCapabilities.ITEM_HANDLER) { + if (cap == Capabilities.ITEM_HANDLER) { return lazyStorage.cast(); } return super.getCapability(cap, side); diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java index a0554973..1cbfd741 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java @@ -22,18 +22,18 @@ import net.minecraft.world.level.block.BucketPickup; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.fluids.FluidUtil; -import net.minecraftforge.fluids.IFluidBlock; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.wrappers.BucketPickupHandlerWrapper; -import net.minecraftforge.fluids.capability.wrappers.FluidBlockWrapper; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.common.capabilities.Capabilities; +import net.neoforged.neoforge.common.capabilities.Capability; +import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.fluids.FluidUtil; +import net.neoforged.neoforge.fluids.IFluidBlock; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.fluids.capability.wrappers.BucketPickupHandlerWrapper; +import net.neoforged.neoforge.fluids.capability.wrappers.FluidBlockWrapper; import org.jetbrains.annotations.NotNull; - +import var; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -100,10 +100,10 @@ public void initClient() { @Nonnull @Override public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == ForgeCapabilities.ITEM_HANDLER) { + if (cap == Capabilities.ITEM_HANDLER) { return LazyOptional.empty(); } - if (cap == ForgeCapabilities.FLUID_HANDLER) { + if (cap == Capabilities.FLUID_HANDLER) { return fluidHandlerLazyOptional.cast(); } return super.getCapability(cap, side); @@ -199,8 +199,8 @@ public InteractionResult onSlotActivated(Player playerIn, InteractionHand hand, if (stack.getItem().equals(FunctionalStorage.CONFIGURATION_TOOL.get()) || stack.getItem().equals(FunctionalStorage.LINKING_TOOL.get())) return InteractionResult.PASS; if (slot != -1 && !playerIn.getItemInHand(hand).isEmpty()) { - var interactionResult = stack.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM).map(iFluidHandlerItem -> { - return playerIn.getCapability(ForgeCapabilities.ITEM_HANDLER).map(iItemHandler -> { + var interactionResult = stack.getCapability(Capabilities.FLUID_HANDLER_ITEM).map(iFluidHandlerItem -> { + return playerIn.getCapability(Capabilities.ITEM_HANDLER).map(iItemHandler -> { var result = FluidUtil.tryEmptyContainerAndStow(stack, this.fluidHandler.getTankList()[slot], iItemHandler, Integer.MAX_VALUE, playerIn, true); if (result.isSuccess()) { playerIn.setItemInHand(hand, result.getResult().copy()); @@ -220,8 +220,8 @@ public InteractionResult onSlotActivated(Player playerIn, InteractionHand hand, public void onClicked(Player playerIn, int slot) { ItemStack stack = playerIn.getItemInHand(InteractionHand.MAIN_HAND); if (slot != -1 && !stack.isEmpty()) { - stack.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM).ifPresent(iFluidHandlerItem -> { - playerIn.getCapability(ForgeCapabilities.ITEM_HANDLER).ifPresent(iItemHandler -> { + stack.getCapability(Capabilities.FLUID_HANDLER_ITEM).ifPresent(iFluidHandlerItem -> { + playerIn.getCapability(Capabilities.ITEM_HANDLER).ifPresent(iItemHandler -> { var result = FluidUtil.tryFillContainerAndStow(stack, this.fluidHandler.getTankList()[slot], iItemHandler, Integer.MAX_VALUE, playerIn, true); if (result.isSuccess()) { playerIn.setItemInHand(InteractionHand.MAIN_HAND, result.getResult()); diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/FramedControllerExtensionTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/FramedControllerExtensionTile.java index 21e76e89..abf54433 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/FramedControllerExtensionTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/FramedControllerExtensionTile.java @@ -6,7 +6,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.client.model.data.ModelData; +import net.neoforged.neoforge.client.model.data.ModelData; import org.jetbrains.annotations.NotNull; import java.util.HashMap; diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/FramedDrawerControllerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/FramedDrawerControllerTile.java index 791df26d..611d591b 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/FramedDrawerControllerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/FramedDrawerControllerTile.java @@ -6,7 +6,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.client.model.data.ModelData; +import net.neoforged.neoforge.client.model.data.ModelData; import org.jetbrains.annotations.NotNull; import java.util.HashMap; diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/FramedDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/FramedDrawerTile.java index 59630a89..8afbd20a 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/FramedDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/FramedDrawerTile.java @@ -8,8 +8,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.client.model.data.ModelData; - +import net.neoforged.neoforge.client.model.data.ModelData; import javax.annotation.Nonnull; import java.util.HashMap; diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/FramedSimpleCompactingDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/FramedSimpleCompactingDrawerTile.java index c06df4eb..63ab5557 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/FramedSimpleCompactingDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/FramedSimpleCompactingDrawerTile.java @@ -6,8 +6,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.client.model.data.ModelData; - +import net.neoforged.neoforge.client.model.data.ModelData; import javax.annotation.Nonnull; import java.util.HashMap; diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java index 15ad0717..7708c31d 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java @@ -23,12 +23,12 @@ import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.ItemHandlerHelper; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.common.capabilities.Capabilities; +import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.ItemHandlerHelper; import org.jetbrains.annotations.NotNull; import java.util.HashMap; @@ -62,7 +62,7 @@ public void serverTick(Level level, BlockPos pos, BlockState state, T blockEntit if (item.equals(FunctionalStorage.PULLING_UPGRADE.get())) { Direction direction = UpgradeItem.getDirection(stack); TileUtil.getTileEntity(level, pos.relative(direction)).ifPresent(blockEntity1 -> { - blockEntity1.getCapability(ForgeCapabilities.ITEM_HANDLER, direction.getOpposite()).ifPresent(iItemHandler -> { + blockEntity1.getCapability(Capabilities.ITEM_HANDLER, direction.getOpposite()).ifPresent(iItemHandler -> { for (int otherSlot = 0; otherSlot < iItemHandler.getSlots(); otherSlot++) { ItemStack pulledStack = iItemHandler.extractItem(otherSlot, FunctionalStorageConfig.UPGRADE_PULL_ITEMS, true); if (pulledStack.isEmpty()) continue; @@ -84,7 +84,7 @@ public void serverTick(Level level, BlockPos pos, BlockState state, T blockEntit if (item.equals(FunctionalStorage.PUSHING_UPGRADE.get())) { Direction direction = UpgradeItem.getDirection(stack); TileUtil.getTileEntity(level, pos.relative(direction)).ifPresent(blockEntity1 -> { - blockEntity1.getCapability(ForgeCapabilities.ITEM_HANDLER, direction.getOpposite()).ifPresent(otherHandler -> { + blockEntity1.getCapability(Capabilities.ITEM_HANDLER, direction.getOpposite()).ifPresent(otherHandler -> { for (int drawerSlot = 0; drawerSlot < getStorage().getSlots(); drawerSlot++) { ItemStack pulledStack = getStorage().extractItem(drawerSlot, FunctionalStorageConfig.UPGRADE_PUSH_ITEMS, true); if (pulledStack.isEmpty()) continue; diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/SimpleCompactingDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/SimpleCompactingDrawerTile.java index b35441f3..4be1becd 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/SimpleCompactingDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/SimpleCompactingDrawerTile.java @@ -16,12 +16,12 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.IItemHandler; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.common.capabilities.Capabilities; +import net.neoforged.neoforge.common.capabilities.Capability; +import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.items.IItemHandler; import org.apache.commons.lang3.tuple.Pair; import org.jetbrains.annotations.NotNull; @@ -146,7 +146,7 @@ public int getBaseSize(int slot) { @Nonnull @Override public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == ForgeCapabilities.ITEM_HANDLER) { + if (cap == Capabilities.ITEM_HANDLER) { return lazyStorage.cast(); } return super.getCapability(cap, side); diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/StorageControllerExtensionTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/StorageControllerExtensionTile.java index fb98fed2..38d3e3ef 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/StorageControllerExtensionTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/StorageControllerExtensionTile.java @@ -12,10 +12,9 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.IItemHandler; - +import net.neoforged.neoforge.common.capabilities.Capability; +import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.items.IItemHandler; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.Optional; diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/StorageControllerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/StorageControllerTile.java index 9408da84..56986479 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/StorageControllerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/StorageControllerTile.java @@ -30,15 +30,15 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.items.IItemHandler; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.common.capabilities.Capabilities; +import net.neoforged.neoforge.common.capabilities.Capability; +import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.items.IItemHandler; import org.jetbrains.annotations.NotNull; - +import var; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.ArrayList; @@ -254,10 +254,10 @@ public boolean addConnectedDrawers(LinkingToolItem.ActionMode action, BlockPos.. @Nonnull @Override public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == ForgeCapabilities.ITEM_HANDLER) { + if (cap == Capabilities.ITEM_HANDLER) { return itemHandlerLazyOptional.cast(); } - if (cap == ForgeCapabilities.FLUID_HANDLER) { + if (cap == Capabilities.FLUID_HANDLER) { return fluidHandlerLazyOptional.cast(); } return super.getCapability(cap, side); diff --git a/src/main/java/com/buuz135/functionalstorage/client/ControllerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/ControllerRenderer.java index 7932b4ce..f9fe5996 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/ControllerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/ControllerRenderer.java @@ -28,7 +28,7 @@ import net.minecraft.world.phys.shapes.VoxelShape; import org.joml.Matrix4f; import org.lwjgl.opengl.GL11; - +import var; import java.util.List; import java.util.OptionalDouble; diff --git a/src/main/java/com/buuz135/functionalstorage/client/DrawerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/DrawerRenderer.java index d3ff6dee..a417d169 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/DrawerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/DrawerRenderer.java @@ -27,6 +27,7 @@ import net.minecraft.world.level.Level; import org.joml.Matrix4f; import org.joml.Vector3f; +import var; import static com.buuz135.functionalstorage.util.MathUtils.createTransformMatrix; diff --git a/src/main/java/com/buuz135/functionalstorage/client/FluidDrawerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/FluidDrawerRenderer.java index 3d21bfad..32813a0a 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/FluidDrawerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/FluidDrawerRenderer.java @@ -21,8 +21,8 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.inventory.InventoryMenu; import net.minecraft.world.phys.AABB; -import net.minecraftforge.client.extensions.common.IClientFluidTypeExtensions; -import net.minecraftforge.fluids.FluidStack; +import net.neoforged.neoforge.client.extensions.common.IClientFluidTypeExtensions; +import net.neoforged.neoforge.fluids.FluidStack; import org.joml.Matrix4f; diff --git a/src/main/java/com/buuz135/functionalstorage/client/FramedColors.java b/src/main/java/com/buuz135/functionalstorage/client/FramedColors.java index 30ac551d..13d81409 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/FramedColors.java +++ b/src/main/java/com/buuz135/functionalstorage/client/FramedColors.java @@ -21,11 +21,11 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.client.event.RegisterColorHandlersEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.Mod; +import net.neoforged.neoforge.client.event.RegisterColorHandlersEvent; +import net.neoforged.neoforge.registries.ForgeRegistries; import org.jetbrains.annotations.Nullable; import java.util.Map; diff --git a/src/main/java/com/buuz135/functionalstorage/client/gui/DrawerInfoGuiAddon.java b/src/main/java/com/buuz135/functionalstorage/client/gui/DrawerInfoGuiAddon.java index d6d98658..d3deff8d 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/gui/DrawerInfoGuiAddon.java +++ b/src/main/java/com/buuz135/functionalstorage/client/gui/DrawerInfoGuiAddon.java @@ -11,7 +11,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.apache.commons.lang3.tuple.Pair; - +import var; import java.util.ArrayList; import java.util.Optional; import java.util.function.Function; diff --git a/src/main/java/com/buuz135/functionalstorage/client/gui/FluidDrawerInfoGuiAddon.java b/src/main/java/com/buuz135/functionalstorage/client/gui/FluidDrawerInfoGuiAddon.java index 42b35ee1..db204ccb 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/gui/FluidDrawerInfoGuiAddon.java +++ b/src/main/java/com/buuz135/functionalstorage/client/gui/FluidDrawerInfoGuiAddon.java @@ -15,10 +15,10 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.client.extensions.common.IClientFluidTypeExtensions; -import net.minecraftforge.fluids.FluidStack; +import net.neoforged.neoforge.client.extensions.common.IClientFluidTypeExtensions; +import net.neoforged.neoforge.fluids.FluidStack; import org.apache.commons.lang3.tuple.Pair; - +import var; import java.awt.*; import java.util.ArrayList; import java.util.Optional; diff --git a/src/main/java/com/buuz135/functionalstorage/client/loader/FramedModel.java b/src/main/java/com/buuz135/functionalstorage/client/loader/FramedModel.java index f1e0a5c7..8c0e27f6 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/loader/FramedModel.java +++ b/src/main/java/com/buuz135/functionalstorage/client/loader/FramedModel.java @@ -29,17 +29,17 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.client.ChunkRenderTypeSet; -import net.minecraftforge.client.model.IDynamicBakedModel; -import net.minecraftforge.client.model.IQuadTransformer; -import net.minecraftforge.client.model.SimpleModelState; -import net.minecraftforge.client.model.data.ModelData; -import net.minecraftforge.client.model.data.ModelProperty; -import net.minecraftforge.client.model.geometry.IGeometryBakingContext; -import net.minecraftforge.client.model.geometry.IGeometryLoader; -import net.minecraftforge.client.model.geometry.IUnbakedGeometry; -import net.minecraftforge.common.util.ConcatenatedListView; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.client.ChunkRenderTypeSet; +import net.neoforged.neoforge.client.model.IDynamicBakedModel; +import net.neoforged.neoforge.client.model.IQuadTransformer; +import net.neoforged.neoforge.client.model.SimpleModelState; +import net.neoforged.neoforge.client.model.data.ModelData; +import net.neoforged.neoforge.client.model.data.ModelProperty; +import net.neoforged.neoforge.client.model.geometry.IGeometryBakingContext; +import net.neoforged.neoforge.client.model.geometry.IGeometryLoader; +import net.neoforged.neoforge.client.model.geometry.IUnbakedGeometry; +import net.neoforged.neoforge.common.util.ConcatenatedListView; +import net.neoforged.neoforge.registries.ForgeRegistries; import org.apache.commons.lang3.tuple.ImmutableTriple; import org.apache.commons.lang3.tuple.Triple; import org.apache.logging.log4j.LogManager; @@ -47,7 +47,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.joml.Vector3f; - +import var; import java.util.*; import java.util.function.Function; @@ -55,7 +55,7 @@ /** * A Custom Model for Framed Drawers.
- * Based on {@link net.minecraftforge.client.model.CompositeModel} from Forge.
+ * Based on {@link net.neoforged.neoforge.client.model.CompositeModel} from Forge.
* Using parts of Painted Block Model from Ender IO. */ public class FramedModel implements IUnbakedGeometry { diff --git a/src/main/java/com/buuz135/functionalstorage/client/model/FramedDrawerModelData.java b/src/main/java/com/buuz135/functionalstorage/client/model/FramedDrawerModelData.java index 777d5e8a..5f55d5e1 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/model/FramedDrawerModelData.java +++ b/src/main/java/com/buuz135/functionalstorage/client/model/FramedDrawerModelData.java @@ -26,10 +26,9 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; -import net.minecraftforge.client.model.data.ModelProperty; -import net.minecraftforge.common.util.INBTSerializable; -import net.minecraftforge.registries.ForgeRegistries; - +import net.neoforged.neoforge.client.model.data.ModelProperty; +import net.neoforged.neoforge.common.util.INBTSerializable; +import net.neoforged.neoforge.registries.ForgeRegistries; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/com/buuz135/functionalstorage/compat/TOPPlugin.java b/src/main/java/com/buuz135/functionalstorage/compat/TOPPlugin.java index 529c4d85..bcbe8a26 100644 --- a/src/main/java/com/buuz135/functionalstorage/compat/TOPPlugin.java +++ b/src/main/java/com/buuz135/functionalstorage/compat/TOPPlugin.java @@ -5,8 +5,8 @@ import com.hrznstudio.titanium.event.handler.EventManager; import com.hrznstudio.titanium.plugin.FeaturePluginInstance; import com.hrznstudio.titanium.plugin.PluginPhase; -import net.minecraftforge.fml.InterModComms; -import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent; +import net.neoforged.fml.InterModComms; +import net.neoforged.fml.event.lifecycle.InterModEnqueueEvent; @FeaturePlugin(value = "theoneprobe", type = FeaturePlugin.FeaturePluginType.MOD) public class TOPPlugin implements FeaturePluginInstance { diff --git a/src/main/java/com/buuz135/functionalstorage/compat/top/FunctionalDrawerProvider.java b/src/main/java/com/buuz135/functionalstorage/compat/top/FunctionalDrawerProvider.java index 90e3054f..1f71afa8 100644 --- a/src/main/java/com/buuz135/functionalstorage/compat/top/FunctionalDrawerProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/compat/top/FunctionalDrawerProvider.java @@ -23,7 +23,7 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import org.apache.commons.lang3.text.WordUtils; - +import var; import java.awt.Color; import java.util.Locale; import java.util.function.Function; diff --git a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageBlockTagsProvider.java b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageBlockTagsProvider.java index 02ff862f..c459f107 100644 --- a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageBlockTagsProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageBlockTagsProvider.java @@ -5,9 +5,9 @@ import net.minecraft.data.DataGenerator; import net.minecraft.tags.BlockTags; import net.minecraft.world.level.block.Block; -import net.minecraftforge.common.data.BlockTagsProvider; -import net.minecraftforge.common.data.ExistingFileHelper; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.common.data.BlockTagsProvider; +import net.neoforged.neoforge.common.data.ExistingFileHelper; +import net.neoforged.neoforge.registries.RegistryObject; import org.apache.commons.lang3.tuple.Pair; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageBlockstateProvider.java b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageBlockstateProvider.java index 884c4f84..ed8378c0 100644 --- a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageBlockstateProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageBlockstateProvider.java @@ -8,14 +8,13 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.properties.DirectionProperty; -import net.minecraftforge.client.model.generators.BlockStateProvider; -import net.minecraftforge.client.model.generators.ConfiguredModel; -import net.minecraftforge.client.model.generators.ModelFile; -import net.minecraftforge.client.model.generators.VariantBlockStateBuilder; -import net.minecraftforge.common.data.ExistingFileHelper; -import net.minecraftforge.common.util.NonNullLazy; -import net.minecraftforge.registries.ForgeRegistries; - +import net.neoforged.neoforge.client.model.generators.BlockStateProvider; +import net.neoforged.neoforge.client.model.generators.ConfiguredModel; +import net.neoforged.neoforge.client.model.generators.ModelFile; +import net.neoforged.neoforge.client.model.generators.VariantBlockStateBuilder; +import net.neoforged.neoforge.common.data.ExistingFileHelper; +import net.neoforged.neoforge.common.util.NonNullLazy; +import net.neoforged.neoforge.registries.ForgeRegistries; import java.util.List; public class FunctionalStorageBlockstateProvider extends BlockStateProvider { diff --git a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageItemTagsProvider.java b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageItemTagsProvider.java index 68868c7b..b5d8c39c 100644 --- a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageItemTagsProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageItemTagsProvider.java @@ -10,12 +10,11 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Block; -import net.minecraftforge.common.data.ExistingFileHelper; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.common.data.ExistingFileHelper; +import net.neoforged.neoforge.registries.RegistryObject; import org.apache.commons.lang3.tuple.Pair; import org.jetbrains.annotations.Nullable; - +import var; import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; diff --git a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageLangProvider.java b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageLangProvider.java index 74f54b36..44b63423 100644 --- a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageLangProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageLangProvider.java @@ -5,9 +5,9 @@ import com.buuz135.functionalstorage.item.StorageUpgradeItem; import net.minecraft.data.DataGenerator; import net.minecraft.world.level.block.Block; -import net.minecraftforge.common.data.LanguageProvider; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.common.data.LanguageProvider; +import net.neoforged.neoforge.registries.ForgeRegistries; +import net.neoforged.neoforge.registries.RegistryObject; import org.apache.commons.lang3.text.WordUtils; import org.apache.commons.lang3.tuple.Pair; diff --git a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageRecipesProvider.java b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageRecipesProvider.java index 0a98456a..2c91d278 100644 --- a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageRecipesProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageRecipesProvider.java @@ -13,10 +13,9 @@ import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.block.Block; -import net.minecraftforge.common.Tags; -import net.minecraftforge.common.util.NonNullLazy; -import net.minecraftforge.registries.ForgeRegistries; - +import net.neoforged.neoforge.common.Tags; +import net.neoforged.neoforge.common.util.NonNullLazy; +import net.neoforged.neoforge.registries.ForgeRegistries; import java.util.List; import java.util.function.Consumer; diff --git a/src/main/java/com/buuz135/functionalstorage/fluid/BigFluidHandler.java b/src/main/java/com/buuz135/functionalstorage/fluid/BigFluidHandler.java index e75cea40..a9c9cd87 100644 --- a/src/main/java/com/buuz135/functionalstorage/fluid/BigFluidHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/fluid/BigFluidHandler.java @@ -1,10 +1,10 @@ package com.buuz135.functionalstorage.fluid; import net.minecraft.nbt.CompoundTag; -import net.minecraftforge.common.util.INBTSerializable; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.templates.FluidTank; +import net.neoforged.neoforge.common.util.INBTSerializable; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.fluids.capability.templates.FluidTank; import org.jetbrains.annotations.NotNull; import javax.annotation.Nonnull; diff --git a/src/main/java/com/buuz135/functionalstorage/fluid/ControllerFluidHandler.java b/src/main/java/com/buuz135/functionalstorage/fluid/ControllerFluidHandler.java index 4acb481b..89f16d1f 100644 --- a/src/main/java/com/buuz135/functionalstorage/fluid/ControllerFluidHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/fluid/ControllerFluidHandler.java @@ -3,12 +3,12 @@ import com.buuz135.functionalstorage.block.tile.DrawerControllerTile; import com.buuz135.functionalstorage.inventory.ControllerInventoryHandler; import com.buuz135.functionalstorage.util.ConnectedDrawers; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.IFluidHandler; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.List; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; public abstract class ControllerFluidHandler implements IFluidHandler { diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/ArmoryCabinetInventoryHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/ArmoryCabinetInventoryHandler.java index 5b43235e..862d3e0b 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/ArmoryCabinetInventoryHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/ArmoryCabinetInventoryHandler.java @@ -5,9 +5,9 @@ import net.minecraft.world.item.HorseArmorItem; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.RecordItem; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.INBTSerializable; -import net.minecraftforge.items.IItemHandler; +import net.neoforged.neoforge.common.capabilities.Capabilities; +import net.neoforged.neoforge.common.util.INBTSerializable; +import net.neoforged.neoforge.items.IItemHandler; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; @@ -76,7 +76,7 @@ private boolean isValid(int slot, @NotNull ItemStack stack) { } private boolean isCertifiedStack(ItemStack stack){ - if (stack.getCapability(ForgeCapabilities.ITEM_HANDLER, null).isPresent()) return false; + if (stack.getCapability(Capabilities.ITEM_HANDLER, null).isPresent()) return false; if (stack.getMaxStackSize() > 1) return false; return stack.hasTag() || stack.isDamageableItem() || stack.isEnchantable() || stack.getItem() instanceof RecordItem || stack.getItem() instanceof HorseArmorItem; } diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/BigInventoryHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/BigInventoryHandler.java index cc29ce05..54b2c173 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/BigInventoryHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/BigInventoryHandler.java @@ -3,10 +3,10 @@ import com.buuz135.functionalstorage.FunctionalStorage; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.util.INBTSerializable; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.ItemHandlerHelper; - +import net.neoforged.neoforge.common.util.INBTSerializable; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.ItemHandlerHelper; +import var; import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/CompactingInventoryHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/CompactingInventoryHandler.java index 30617ef6..01fdc8b0 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/CompactingInventoryHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/CompactingInventoryHandler.java @@ -3,10 +3,9 @@ import com.buuz135.functionalstorage.util.CompactingUtil; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.util.INBTSerializable; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.ItemHandlerHelper; - +import net.neoforged.neoforge.common.util.INBTSerializable; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.ItemHandlerHelper; import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/ControllerInventoryHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/ControllerInventoryHandler.java index b67a83bf..b0e0a8ca 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/ControllerInventoryHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/ControllerInventoryHandler.java @@ -3,7 +3,7 @@ import com.buuz135.functionalstorage.block.tile.DrawerControllerTile; import com.buuz135.functionalstorage.util.ConnectedDrawers; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.items.IItemHandler; +import net.neoforged.neoforge.items.IItemHandler; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingDrawerCapabilityProvider.java b/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingDrawerCapabilityProvider.java index ccbd7c13..25a1a219 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingDrawerCapabilityProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingDrawerCapabilityProvider.java @@ -2,11 +2,11 @@ import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.capabilities.ICapabilityProvider; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.IItemHandler; +import net.neoforged.neoforge.common.capabilities.Capabilities; +import net.neoforged.neoforge.common.capabilities.Capability; +import net.neoforged.neoforge.common.capabilities.ICapabilityProvider; +import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.items.IItemHandler; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -25,14 +25,14 @@ public CompactingDrawerCapabilityProvider(ItemStack stack, int slots) { @NotNull @Override public LazyOptional getCapability(@NotNull Capability cap, @Nullable Direction side) { - if (cap.equals(ForgeCapabilities.ITEM_HANDLER)) return this.itemHandler.cast(); + if (cap.equals(Capabilities.ITEM_HANDLER)) return this.itemHandler.cast(); return LazyOptional.empty(); } @NotNull @Override public LazyOptional getCapability(@NotNull Capability cap) { - if (cap.equals(ForgeCapabilities.ITEM_HANDLER)) return this.itemHandler.cast(); + if (cap.equals(Capabilities.ITEM_HANDLER)) return this.itemHandler.cast(); return LazyOptional.empty(); } } diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingStackItemHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingStackItemHandler.java index 43a2b7ae..a702b613 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingStackItemHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingStackItemHandler.java @@ -6,10 +6,9 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.util.INBTSerializable; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.ItemHandlerHelper; - +import net.neoforged.neoforge.common.util.INBTSerializable; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.ItemHandlerHelper; import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerCapabilityProvider.java b/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerCapabilityProvider.java index 43e8a93c..13c4f513 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerCapabilityProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerCapabilityProvider.java @@ -3,11 +3,11 @@ import com.buuz135.functionalstorage.FunctionalStorage; import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.capabilities.ICapabilityProvider; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.IItemHandler; +import net.neoforged.neoforge.common.capabilities.Capabilities; +import net.neoforged.neoforge.common.capabilities.Capability; +import net.neoforged.neoforge.common.capabilities.ICapabilityProvider; +import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.items.IItemHandler; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -26,14 +26,14 @@ public DrawerCapabilityProvider(ItemStack stack, FunctionalStorage.DrawerType ty @NotNull @Override public LazyOptional getCapability(@NotNull Capability cap, @Nullable Direction side) { - if (cap.equals(ForgeCapabilities.ITEM_HANDLER)) return this.itemHandler.cast(); + if (cap.equals(Capabilities.ITEM_HANDLER)) return this.itemHandler.cast(); return LazyOptional.empty(); } @NotNull @Override public LazyOptional getCapability(@NotNull Capability cap) { - if (cap.equals(ForgeCapabilities.ITEM_HANDLER)) return this.itemHandler.cast(); + if (cap.equals(Capabilities.ITEM_HANDLER)) return this.itemHandler.cast(); return LazyOptional.empty(); } } diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerStackItemHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerStackItemHandler.java index d8cc21ad..80ea837b 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerStackItemHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerStackItemHandler.java @@ -2,14 +2,15 @@ import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.inventory.BigInventoryHandler; +import com.buuz135.functionalstorage.inventory.BigInventoryHandler.BigStack; import com.buuz135.functionalstorage.item.StorageUpgradeItem; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.util.INBTSerializable; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.ItemHandlerHelper; - +import net.neoforged.neoforge.common.util.INBTSerializable; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.ItemHandlerHelper; +import var; import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/buuz135/functionalstorage/item/LinkingToolItem.java b/src/main/java/com/buuz135/functionalstorage/item/LinkingToolItem.java index 39fc6fcf..7d568205 100644 --- a/src/main/java/com/buuz135/functionalstorage/item/LinkingToolItem.java +++ b/src/main/java/com/buuz135/functionalstorage/item/LinkingToolItem.java @@ -26,8 +26,8 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.AABB; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.fml.LogicalSide; +import net.neoforged.fml.LogicalSide; +import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent; import org.jetbrains.annotations.Nullable; import java.awt.*; diff --git a/src/main/java/com/buuz135/functionalstorage/item/StorageUpgradeItem.java b/src/main/java/com/buuz135/functionalstorage/item/StorageUpgradeItem.java index 2aec86cf..c2953a3b 100644 --- a/src/main/java/com/buuz135/functionalstorage/item/StorageUpgradeItem.java +++ b/src/main/java/com/buuz135/functionalstorage/item/StorageUpgradeItem.java @@ -8,8 +8,8 @@ import net.minecraft.network.chat.Style; import net.minecraft.util.Mth; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; import org.jetbrains.annotations.Nullable; import java.util.List; diff --git a/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java b/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java index 4f14919d..ad3bb311 100644 --- a/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java +++ b/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java @@ -17,7 +17,7 @@ import net.minecraft.world.level.Level; import org.apache.commons.lang3.text.WordUtils; import org.jetbrains.annotations.Nullable; - +import var; import java.util.Arrays; import java.util.List; import java.util.Locale; diff --git a/src/main/java/com/buuz135/functionalstorage/network/EnderDrawerSyncMessage.java b/src/main/java/com/buuz135/functionalstorage/network/EnderDrawerSyncMessage.java index e57eccca..5beb7764 100644 --- a/src/main/java/com/buuz135/functionalstorage/network/EnderDrawerSyncMessage.java +++ b/src/main/java/com/buuz135/functionalstorage/network/EnderDrawerSyncMessage.java @@ -5,8 +5,7 @@ import com.hrznstudio.titanium.network.CompoundSerializableDataHandler; import com.hrznstudio.titanium.network.Message; import net.minecraft.client.Minecraft; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.network.NetworkEvent; +import net.neoforged.neoforge.network.NetworkEvent; public class EnderDrawerSyncMessage extends Message { diff --git a/src/main/java/com/buuz135/functionalstorage/recipe/DrawerlessWoodIngredient.java b/src/main/java/com/buuz135/functionalstorage/recipe/DrawerlessWoodIngredient.java index 2909cdc6..6bbf63f1 100644 --- a/src/main/java/com/buuz135/functionalstorage/recipe/DrawerlessWoodIngredient.java +++ b/src/main/java/com/buuz135/functionalstorage/recipe/DrawerlessWoodIngredient.java @@ -10,8 +10,8 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; -import net.minecraftforge.common.crafting.IIngredientSerializer; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.common.crafting.IIngredientSerializer; +import net.neoforged.neoforge.registries.ForgeRegistries; import org.jetbrains.annotations.Nullable; import java.util.List; diff --git a/src/main/java/com/buuz135/functionalstorage/util/CompactingUtil.java b/src/main/java/com/buuz135/functionalstorage/util/CompactingUtil.java index c2758f83..cd80e0c6 100644 --- a/src/main/java/com/buuz135/functionalstorage/util/CompactingUtil.java +++ b/src/main/java/com/buuz135/functionalstorage/util/CompactingUtil.java @@ -14,9 +14,8 @@ import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.Level; -import net.minecraftforge.items.ItemHandlerHelper; -import net.minecraftforge.registries.ForgeRegistries; - +import net.neoforged.neoforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.registries.ForgeRegistries; import java.util.*; diff --git a/src/main/java/com/buuz135/functionalstorage/util/ConnectedDrawers.java b/src/main/java/com/buuz135/functionalstorage/util/ConnectedDrawers.java index 21fe9874..a0d31be5 100644 --- a/src/main/java/com/buuz135/functionalstorage/util/ConnectedDrawers.java +++ b/src/main/java/com/buuz135/functionalstorage/util/ConnectedDrawers.java @@ -14,10 +14,10 @@ import net.minecraft.world.phys.shapes.BooleanOp; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraftforge.common.util.INBTSerializable; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.items.IItemHandler; - +import net.neoforged.neoforge.common.util.INBTSerializable; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.items.IItemHandler; +import var; import java.util.ArrayList; import java.util.Comparator; import java.util.List; diff --git a/src/main/java/com/buuz135/functionalstorage/util/MathUtils.java b/src/main/java/com/buuz135/functionalstorage/util/MathUtils.java index b6cf8502..86046473 100644 --- a/src/main/java/com/buuz135/functionalstorage/util/MathUtils.java +++ b/src/main/java/com/buuz135/functionalstorage/util/MathUtils.java @@ -4,6 +4,7 @@ import org.joml.Matrix4f; import org.joml.Quaternionf; import org.joml.Vector3f; +import var; public class MathUtils { diff --git a/src/main/java/com/buuz135/functionalstorage/util/StorageTags.java b/src/main/java/com/buuz135/functionalstorage/util/StorageTags.java index 66ae3fa8..9e974811 100644 --- a/src/main/java/com/buuz135/functionalstorage/util/StorageTags.java +++ b/src/main/java/com/buuz135/functionalstorage/util/StorageTags.java @@ -5,7 +5,6 @@ import net.minecraft.tags.ItemTags; import net.minecraft.tags.TagKey; import net.minecraft.world.item.Item; -import net.minecraftforge.common.Tags; public class StorageTags { diff --git a/src/main/java/com/buuz135/functionalstorage/util/TooltipUtil.java b/src/main/java/com/buuz135/functionalstorage/util/TooltipUtil.java index 221a8794..ecf09162 100644 --- a/src/main/java/com/buuz135/functionalstorage/util/TooltipUtil.java +++ b/src/main/java/com/buuz135/functionalstorage/util/TooltipUtil.java @@ -17,9 +17,9 @@ import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; - +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import var; import javax.annotation.Nullable; import java.util.List; From 5e23671578b348490aa8b1f9aee84ae313ad00d1 Mon Sep 17 00:00:00 2001 From: Matyrobbrt Date: Sun, 7 Apr 2024 00:55:37 +0300 Subject: [PATCH 02/20] 1.20.4 Update --- .gitignore | 1 + build.gradle | 16 +- settings.gradle | 6 + .../15b6275091e1d61ba43a63172e99581ffd5ac41e | 2 +- ... 361def3a0b0e87157892b021be1ddec9d13d5e52} | 2 +- .../424df6c0265e09414e636289f261813cd93f4aa2 | 2 +- .../58b100d11464fc6de03e6a16617c8d741d90a73a | 4 +- .../59eb3dbb5f86130e09b3c62d89b9525ee01cf52d | 2 +- .../7b7965c95f0313555fafc7c653e689cdb94b8fca | 2 +- .../9b4b2fe28e6a198629709c0c8772cb00a8b15d4a | 4 +- .../9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e | 184 ++++++--- .../b3b48c10570c424437115253c982ed89e6bd5ccb | 8 - .../f4bc6a534340ffb17710ab19bf013aa0d2f1f9d9 | 2 +- .../advancements/recipes/misc/acacia_1.json | 40 ++ .../advancements/recipes/misc/acacia_2.json | 40 ++ .../advancements/recipes/misc/acacia_4.json | 40 ++ .../recipes/misc/armory_cabinet.json | 38 ++ .../advancements/recipes/misc/birch_1.json | 40 ++ .../advancements/recipes/misc/birch_2.json | 40 ++ .../advancements/recipes/misc/birch_4.json | 40 ++ .../advancements/recipes/misc/cherry_1.json | 40 ++ .../advancements/recipes/misc/cherry_2.json | 40 ++ .../advancements/recipes/misc/cherry_4.json | 40 ++ .../recipes/misc/collector_upgrade.json | 38 ++ .../recipes/misc/compacting_drawer.json | 40 ++ .../misc/compacting_framed_drawer.json | 40 ++ .../recipes/misc/configuration_tool.json | 40 ++ .../recipes/misc/controller_extension.json | 38 ++ .../recipes/misc/copper_upgrade.json | 40 ++ .../advancements/recipes/misc/crimson_1.json | 40 ++ .../advancements/recipes/misc/crimson_2.json | 40 ++ .../advancements/recipes/misc/crimson_4.json | 40 ++ .../advancements/recipes/misc/dark_oak_1.json | 40 ++ .../advancements/recipes/misc/dark_oak_2.json | 40 ++ .../advancements/recipes/misc/dark_oak_4.json | 40 ++ .../recipes/misc/diamond_upgrade.json | 38 ++ .../recipes/misc/ender_drawer.json | 38 ++ .../advancements/recipes/misc/fluid_1.json | 38 ++ .../advancements/recipes/misc/fluid_2.json | 38 ++ .../advancements/recipes/misc/fluid_4.json | 38 ++ .../advancements/recipes/misc/framed_1.json | 40 ++ .../advancements/recipes/misc/framed_2.json | 40 ++ .../advancements/recipes/misc/framed_4.json | 40 ++ .../misc/framed_controller_extension.json | 40 ++ .../misc/framed_simple_compacting_drawer.json | 40 ++ .../misc/framed_storage_controller.json | 40 ++ .../recipes/misc/gold_upgrade.json | 38 ++ .../recipes/misc/iron_downgrade.json | 38 ++ .../advancements/recipes/misc/jungle_1.json | 40 ++ .../advancements/recipes/misc/jungle_2.json | 40 ++ .../advancements/recipes/misc/jungle_4.json | 40 ++ .../recipes/misc/linking_tool.json | 40 ++ .../advancements/recipes/misc/mangrove_1.json | 40 ++ .../advancements/recipes/misc/mangrove_2.json | 40 ++ .../advancements/recipes/misc/mangrove_4.json | 40 ++ .../recipes/misc/netherite_upgrade.json | 7 +- .../advancements/recipes/misc/oak_1.json | 40 ++ .../advancements/recipes/misc/oak_2.json | 40 ++ .../advancements/recipes/misc/oak_4.json | 40 ++ .../recipes/misc/puller_upgrade.json | 38 ++ .../recipes/misc/pusher_upgrade.json | 38 ++ .../recipes/misc/redstone_upgrade.json | 40 ++ .../misc/simple_compacting_drawer.json | 40 ++ .../advancements/recipes/misc/spruce_1.json | 40 ++ .../advancements/recipes/misc/spruce_2.json | 40 ++ .../advancements/recipes/misc/spruce_4.json | 40 ++ .../recipes/misc/storage_controller.json | 38 ++ .../recipes/misc/void_upgrade.json | 38 ++ .../advancements/recipes/misc/warped_1.json | 40 ++ .../advancements/recipes/misc/warped_2.json | 40 ++ .../advancements/recipes/misc/warped_4.json | 40 ++ .../functionalstorage/recipes/acacia_1.json | 57 ++- .../functionalstorage/recipes/acacia_2.json | 59 ++- .../functionalstorage/recipes/acacia_4.json | 59 ++- .../recipes/armory_cabinet.json | 69 ++-- .../functionalstorage/recipes/birch_1.json | 57 ++- .../functionalstorage/recipes/birch_2.json | 59 ++- .../functionalstorage/recipes/birch_4.json | 59 ++- .../functionalstorage/recipes/cherry_1.json | 57 ++- .../functionalstorage/recipes/cherry_2.json | 59 ++- .../functionalstorage/recipes/cherry_4.json | 59 ++- .../recipes/collector_upgrade.json | 69 ++-- .../recipes/compacting_drawer.json | 69 ++-- .../recipes/compacting_framed_drawer.json | 69 ++-- .../recipes/configuration_tool.json | 69 ++-- .../recipes/controller_extension.json | 69 ++-- .../recipes/copper_upgrade.json | 69 ++-- .../functionalstorage/recipes/crimson_1.json | 57 ++- .../functionalstorage/recipes/crimson_2.json | 59 ++- .../functionalstorage/recipes/crimson_4.json | 59 ++- .../recipes/custom_compacting/clay.json | 11 - .../functionalstorage/recipes/dark_oak_1.json | 57 ++- .../functionalstorage/recipes/dark_oak_2.json | 59 ++- .../functionalstorage/recipes/dark_oak_4.json | 59 ++- .../recipes/diamond_upgrade.json | 69 ++-- .../recipes/ender_drawer.json | 63 ++- .../functionalstorage/recipes/fluid_1.json | 57 ++- .../functionalstorage/recipes/fluid_2.json | 59 ++- .../functionalstorage/recipes/fluid_4.json | 59 ++- .../functionalstorage/recipes/framed_1.json | 57 ++- .../functionalstorage/recipes/framed_2.json | 59 ++- .../functionalstorage/recipes/framed_4.json | 59 ++- .../recipes/framed_controller_extension.json | 69 ++-- .../framed_simple_compacting_drawer.json | 69 ++-- .../recipes/framed_storage_controller.json | 69 ++-- .../recipes/gold_upgrade.json | 69 ++-- .../recipes/iron_downgrade.json | 57 ++- .../functionalstorage/recipes/jungle_1.json | 57 ++- .../functionalstorage/recipes/jungle_2.json | 59 ++- .../functionalstorage/recipes/jungle_4.json | 59 ++- .../recipes/linking_tool.json | 69 ++-- .../functionalstorage/recipes/mangrove_1.json | 57 ++- .../functionalstorage/recipes/mangrove_2.json | 59 ++- .../functionalstorage/recipes/mangrove_4.json | 59 ++- .../data/functionalstorage/recipes/oak_1.json | 57 ++- .../data/functionalstorage/recipes/oak_2.json | 59 ++- .../data/functionalstorage/recipes/oak_4.json | 59 ++- .../recipes/oak_drawer_alternate_x1.json | 39 -- .../recipes/oak_drawer_alternate_x2.json | 40 -- .../recipes/oak_drawer_alternate_x4.json | 40 -- .../recipes/puller_upgrade.json | 69 ++-- .../recipes/pusher_upgrade.json | 69 ++-- .../recipes/redstone_upgrade.json | 69 ++-- .../recipes/simple_compacting_drawer.json | 69 ++-- .../functionalstorage/recipes/spruce_1.json | 57 ++- .../functionalstorage/recipes/spruce_2.json | 59 ++- .../functionalstorage/recipes/spruce_4.json | 59 ++- .../recipes/storage_controller.json | 69 ++-- .../recipes/void_upgrade.json | 57 ++- .../functionalstorage/recipes/warped_1.json | 57 ++- .../functionalstorage/recipes/warped_2.json | 59 ++- .../functionalstorage/recipes/warped_4.json | 59 ++- .../functionalstorage/tags/items/drawer.json | 22 +- .../recipes}/amethyst.json | 1 - .../recipes/blue_ice.json} | 5 +- .../recipes}/glowstone.json | 1 - .../recipes}/melon.json | 1 - .../recipes}/packed_ice.json | 5 +- .../recipes}/quartz.json | 1 - .../minecraft/tags/blocks/mineable/axe.json | 22 +- .../functionalstorage/FunctionalStorage.java | 342 ++++++++++------- .../block/ArmoryCabinetBlock.java | 5 +- .../block/CompactingDrawerBlock.java | 21 +- .../block/CompactingFramedDrawerBlock.java | 13 +- .../block/ControllerExtensionBlock.java | 12 +- .../functionalstorage/block/DrawerBlock.java | 60 ++- .../block/DrawerControllerBlock.java | 12 +- .../block/EnderDrawerBlock.java | 28 +- .../block/FluidDrawerBlock.java | 33 +- .../block/FramedControllerExtensionBlock.java | 17 +- .../block/FramedDrawerBlock.java | 35 +- .../block/FramedDrawerControllerBlock.java | 16 +- .../FramedSimpleCompactingDrawerBlock.java | 13 +- .../block/SimpleCompactingDrawerBlock.java | 10 +- .../block/tile/ArmoryCabinetTile.java | 26 -- .../block/tile/CompactingDrawerTile.java | 22 -- .../block/tile/ControllableDrawerTile.java | 7 +- .../block/tile/DrawerTile.java | 22 -- .../block/tile/EnderDrawerTile.java | 32 +- .../block/tile/FluidDrawerTile.java | 112 +++--- .../tile/ItemControllableDrawerTile.java | 80 ++-- .../tile/SimpleCompactingDrawerTile.java | 21 - .../tile/StorageControllerExtensionTile.java | 21 +- .../block/tile/StorageControllerTile.java | 46 +-- .../client/ControllerRenderer.java | 2 +- .../client/DrawerRenderer.java | 12 +- .../client/FluidDrawerRenderer.java | 12 +- .../client/FramedColors.java | 21 +- .../client/gui/DrawerInfoGuiAddon.java | 2 +- .../client/gui/FluidDrawerInfoGuiAddon.java | 2 +- .../client/loader/FramedModel.java | 6 +- .../client/model/FramedDrawerModelData.java | 9 +- .../functionalstorage/compat/TOPPlugin.java | 44 +-- .../compat/jei/JEIPlugin.java | 10 +- .../compat/top/CustomElementItemStack.java | 190 ++++----- .../compat/top/FunctionalDrawerProvider.java | 360 +++++++++--------- .../FunctionalStorageBlockTagsProvider.java | 31 +- .../FunctionalStorageBlockstateProvider.java | 13 +- .../FunctionalStorageItemTagsProvider.java | 15 +- .../data/FunctionalStorageLangProvider.java | 46 ++- .../FunctionalStorageRecipesProvider.java | 71 ++-- .../ArmoryCabinetInventoryHandler.java | 6 +- .../inventory/BigInventoryHandler.java | 4 +- .../inventory/CompactingInventoryHandler.java | 4 +- .../CompactingDrawerCapabilityProvider.java | 38 -- .../item/CompactingStackItemHandler.java | 4 +- .../item/DrawerCapabilityProvider.java | 39 -- .../item/DrawerStackItemHandler.java | 4 +- .../functionalstorage/item/UpgradeItem.java | 6 +- .../network/EnderDrawerSyncMessage.java | 6 +- .../recipe/CustomCompactingRecipe.java | 35 +- .../recipe/DrawerlessWoodIngredient.java | 56 +-- .../recipe/FramedDrawerRecipe.java | 15 +- .../util/CompactingUtil.java | 34 +- .../util/ConnectedDrawers.java | 1 - .../functionalstorage/util/MathUtils.java | 1 - .../functionalstorage/util/TooltipUtil.java | 4 +- .../world/EnderSavedData.java | 3 +- src/main/resources/META-INF/mods.toml | 18 +- 199 files changed, 4764 insertions(+), 3567 deletions(-) rename src/generated/resources/.cache/{c622617f6fabf890a00b9275cd5f643584a8a2c8 => 361def3a0b0e87157892b021be1ddec9d13d5e52} (50%) delete mode 100644 src/generated/resources/.cache/b3b48c10570c424437115253c982ed89e6bd5ccb create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_1.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_2.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_4.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/armory_cabinet.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_1.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_2.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_4.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_1.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_2.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_4.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/collector_upgrade.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/compacting_drawer.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/compacting_framed_drawer.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/configuration_tool.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/controller_extension.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/copper_upgrade.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_1.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_2.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_4.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_1.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_2.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_4.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/diamond_upgrade.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/ender_drawer.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_1.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_2.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_4.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_1.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_2.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_4.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_controller_extension.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_simple_compacting_drawer.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_storage_controller.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/gold_upgrade.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/iron_downgrade.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_1.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_2.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_4.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/linking_tool.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_1.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_2.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_4.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_1.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_2.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_4.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/puller_upgrade.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/pusher_upgrade.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/redstone_upgrade.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/simple_compacting_drawer.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_1.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_2.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_4.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/storage_controller.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/void_upgrade.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_1.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_2.json create mode 100644 src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_4.json delete mode 100644 src/generated/resources/data/functionalstorage/recipes/custom_compacting/clay.json delete mode 100644 src/generated/resources/data/functionalstorage/recipes/oak_drawer_alternate_x1.json delete mode 100644 src/generated/resources/data/functionalstorage/recipes/oak_drawer_alternate_x2.json delete mode 100644 src/generated/resources/data/functionalstorage/recipes/oak_drawer_alternate_x4.json rename src/generated/resources/data/{functionalstorage/recipes/custom_compacting => minecraft/recipes}/amethyst.json (92%) rename src/generated/resources/data/{functionalstorage/recipes/custom_compacting/ice.json => minecraft/recipes/blue_ice.json} (77%) rename src/generated/resources/data/{functionalstorage/recipes/custom_compacting => minecraft/recipes}/glowstone.json (92%) rename src/generated/resources/data/{functionalstorage/recipes/custom_compacting => minecraft/recipes}/melon.json (91%) rename src/generated/resources/data/{functionalstorage/recipes/custom_compacting => minecraft/recipes}/packed_ice.json (75%) rename src/generated/resources/data/{functionalstorage/recipes/custom_compacting => minecraft/recipes}/quartz.json (92%) delete mode 100644 src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingDrawerCapabilityProvider.java delete mode 100644 src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerCapabilityProvider.java diff --git a/.gitignore b/.gitignore index 97ab8fcc..cab0230c 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ build # other eclipse run +runs classes /includedMods/ diff --git a/build.gradle b/build.gradle index 6a8ccec9..d3d99798 100644 --- a/build.gradle +++ b/build.gradle @@ -23,6 +23,9 @@ repositories { includeGroup "curse.maven" } } + maven { + url(rootProject.file('../Titanium/repo')) + } } base { @@ -50,6 +53,14 @@ runs { server { programArgument '--nogui' } + + data { + // example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it + // workingDirectory project.file('run-data') + + // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. + programArguments.addAll '--mod', 'functionalstorage', '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath() + } } minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/accesstransformer.cfg') @@ -64,6 +75,9 @@ dependencies { compileOnly "mezz.jei:jei-1.20.4-neoforge-api:$jei_version" runtimeOnly "mezz.jei:jei-1.20.4-neoforge:$jei_version" implementation "curse.maven:refined-storage-243076:5165548" + + implementation('com.hrznstudio:titanium') + runtimeOnly('com.hrznstudio:Titanium:1.20.4-2.4.0') } jar { @@ -82,4 +96,4 @@ jar { tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation -} \ No newline at end of file +} diff --git a/settings.gradle b/settings.gradle index ada876e2..6ee4e0c2 100644 --- a/settings.gradle +++ b/settings.gradle @@ -9,3 +9,9 @@ pluginManagement { plugins { id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' } + +includeBuild('../Titanium') { + dependencySubstitution { + substitute module('com.hrznstudio:titanium') using project(':') + } +} diff --git a/src/generated/resources/.cache/15b6275091e1d61ba43a63172e99581ffd5ac41e b/src/generated/resources/.cache/15b6275091e1d61ba43a63172e99581ffd5ac41e index 7a499a0c..7b62f64a 100644 --- a/src/generated/resources/.cache/15b6275091e1d61ba43a63172e99581ffd5ac41e +++ b/src/generated/resources/.cache/15b6275091e1d61ba43a63172e99581ffd5ac41e @@ -1,4 +1,4 @@ -// 1.20.1 2023-09-13T21:39:23.8474114 Item Models: functionalstorage +// 1.20.4 2024-04-07T00:54:11.3462225 Item Models: functionalstorage 05946c7f40bf42b62f86e70d637524afd795cad2 assets/functionalstorage/models/item/acacia_1.json 9e4990cfbaa0ce0612d18b497169377fe24ee704 assets/functionalstorage/models/item/acacia_2.json 648c9170a8c4c6068d0fdcf1ff7f6bf387902f3c assets/functionalstorage/models/item/acacia_4.json diff --git a/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 b/src/generated/resources/.cache/361def3a0b0e87157892b021be1ddec9d13d5e52 similarity index 50% rename from src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 rename to src/generated/resources/.cache/361def3a0b0e87157892b021be1ddec9d13d5e52 index 16073964..e14d3ed7 100644 --- a/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 +++ b/src/generated/resources/.cache/361def3a0b0e87157892b021be1ddec9d13d5e52 @@ -1,2 +1,2 @@ -// 1.20.1 2024-03-09T18:58:14.9644129 Languages: en_us +// 1.20.4 2024-04-07T00:54:11.3182077 Languages: en_us for mod: functionalstorage 112cce2d4db4dc706b7fdd988dd505ea0046bacc assets/functionalstorage/lang/en_us.json diff --git a/src/generated/resources/.cache/424df6c0265e09414e636289f261813cd93f4aa2 b/src/generated/resources/.cache/424df6c0265e09414e636289f261813cd93f4aa2 index eeb5ef85..7b3364a5 100644 --- a/src/generated/resources/.cache/424df6c0265e09414e636289f261813cd93f4aa2 +++ b/src/generated/resources/.cache/424df6c0265e09414e636289f261813cd93f4aa2 @@ -1,4 +1,4 @@ -// 1.20.1 2023-09-13T21:39:23.841862 Block States: functionalstorage +// 1.20.4 2024-04-07T00:54:11.3102053 Block States: functionalstorage b1f76f1b67016350af532beb6de3ffdc4d9a07be assets/functionalstorage/blockstates/acacia_1.json a4e462d9775fd4aefa673952d4d69f9d90b2e823 assets/functionalstorage/blockstates/acacia_2.json ecd77b58fb3d746ab8e2109adf686ea01cf5d96a assets/functionalstorage/blockstates/acacia_4.json diff --git a/src/generated/resources/.cache/58b100d11464fc6de03e6a16617c8d741d90a73a b/src/generated/resources/.cache/58b100d11464fc6de03e6a16617c8d741d90a73a index e79dd020..36048dd4 100644 --- a/src/generated/resources/.cache/58b100d11464fc6de03e6a16617c8d741d90a73a +++ b/src/generated/resources/.cache/58b100d11464fc6de03e6a16617c8d741d90a73a @@ -1,2 +1,2 @@ -// 1.20.1 2024-03-09T18:58:14.9623682 Functional Storage Item Tags -dce1fbc7d93ffd0f6dca91d6e15795d982c6e62e data/functionalstorage/tags/items/drawer.json +// 1.20.4 2024-04-07T00:54:11.3292104 Functional Storage Item Tags +e72c53e88ffb2ff0aed4d46bafae940a49fe9e97 data/functionalstorage/tags/items/drawer.json diff --git a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d index 98b39a35..9403e23e 100644 --- a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d +++ b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d @@ -1,4 +1,4 @@ -// 1.20.1 2023-09-13T21:39:23.8438745 Loot Tables +// 1.20.4 2024-04-07T00:54:11.3242122 Loot Tables d78cf8442a9d36bff4abc1107f1217f4a4418c8e data/functionalstorage/loot_tables/blocks/acacia_1.json 47f3265cef09634f6f2d136757304488a7cf1c75 data/functionalstorage/loot_tables/blocks/acacia_2.json 769595131ba5623e061d1fada4a22af5fd00cb69 data/functionalstorage/loot_tables/blocks/acacia_4.json diff --git a/src/generated/resources/.cache/7b7965c95f0313555fafc7c653e689cdb94b8fca b/src/generated/resources/.cache/7b7965c95f0313555fafc7c653e689cdb94b8fca index a8513a9e..4575dab6 100644 --- a/src/generated/resources/.cache/7b7965c95f0313555fafc7c653e689cdb94b8fca +++ b/src/generated/resources/.cache/7b7965c95f0313555fafc7c653e689cdb94b8fca @@ -1 +1 @@ -// 1.20.1 2023-06-27T22:27:43.4184305 Block Model Item Generator (functionalstorage) +// 1.20.4 2024-04-07T00:54:11.3432297 Block Model Item Generator (functionalstorage) diff --git a/src/generated/resources/.cache/9b4b2fe28e6a198629709c0c8772cb00a8b15d4a b/src/generated/resources/.cache/9b4b2fe28e6a198629709c0c8772cb00a8b15d4a index bfd63d4b..02405431 100644 --- a/src/generated/resources/.cache/9b4b2fe28e6a198629709c0c8772cb00a8b15d4a +++ b/src/generated/resources/.cache/9b4b2fe28e6a198629709c0c8772cb00a8b15d4a @@ -1,3 +1,3 @@ -// 1.20.1 2024-03-09T18:58:14.9634102 Tags for minecraft:block mod id functionalstorage -dce1fbc7d93ffd0f6dca91d6e15795d982c6e62e data/minecraft/tags/blocks/mineable/axe.json +// 1.20.4 2024-04-07T00:54:11.3412364 Tags for minecraft:block mod id functionalstorage +e72c53e88ffb2ff0aed4d46bafae940a49fe9e97 data/minecraft/tags/blocks/mineable/axe.json 4b6fc75faca16170a17220f0e301b16866f4bc5c data/minecraft/tags/blocks/mineable/pickaxe.json diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index f172bcfe..2afda1a8 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,63 +1,123 @@ -// 1.20.1 2023-09-13T21:39:23.8448782 Recipes -c4487c2009b27c499e810f3097d3213212dcacfd data/functionalstorage/advancements/recipes/misc/netherite_upgrade.json -69b434b12c87949feb9ef15335611c6dd83089c6 data/functionalstorage/recipes/acacia_1.json -c3f04e49ddf3b0bb66802b78df289758a6a7e100 data/functionalstorage/recipes/acacia_2.json -8580ace1fc32c8a2e7691f6a65b97626967cf46e data/functionalstorage/recipes/acacia_4.json -770ea21366fa788977c6b1a2d79ed6a7c5b5fdbe data/functionalstorage/recipes/armory_cabinet.json -9155f29c46311e58b9f7748b33c1fee66f155d4d data/functionalstorage/recipes/birch_1.json -65131c2cfbfc26acfd61bb249289aa46e1213fdb data/functionalstorage/recipes/birch_2.json -3479e33fc685a60fc9a90f0dbabd7ba7b1211679 data/functionalstorage/recipes/birch_4.json -259b02fa4a8f385fd32716be96015579f4d4d71c data/functionalstorage/recipes/cherry_1.json -d8a8c500fe125b591bed76930566c0c69086a49d data/functionalstorage/recipes/cherry_2.json -d5a2f61480f951fbc7219f44b47eb48ba3591971 data/functionalstorage/recipes/cherry_4.json -20b07aed4dd4c28904c261384289e58e3bacf02b data/functionalstorage/recipes/collector_upgrade.json -0b75fe99e9fddc155ad8f1074c5997a77472886f data/functionalstorage/recipes/compacting_drawer.json -4681fc7981b54bbdc8b7416b09ce0ab7eb4051cf data/functionalstorage/recipes/compacting_framed_drawer.json -68b9b8763274fbb2e7d014764953e2977e25147e data/functionalstorage/recipes/configuration_tool.json -b61cf03d171bdc0ae7bbb4d8207593ea2d6a7535 data/functionalstorage/recipes/controller_extension.json -638b8b85d6875d0d8062105e4091c9c7aa01fd91 data/functionalstorage/recipes/copper_upgrade.json -29b64fcede6507b1efefc9f0fcdcd66c00fb28e3 data/functionalstorage/recipes/crimson_1.json -a51774abecca696b732db067dc3de24e1c7766e5 data/functionalstorage/recipes/crimson_2.json -544deb7fcc561d6de9cc5c7bf47c46c90007f009 data/functionalstorage/recipes/crimson_4.json -531fc41c9356c0c0331446da71ab4aa2f0022659 data/functionalstorage/recipes/dark_oak_1.json -8b81ae74138455c0726689186d7a057b6203096d data/functionalstorage/recipes/dark_oak_2.json -eed3129867662705e188882566554f627a665183 data/functionalstorage/recipes/dark_oak_4.json -5d104d1ace8d22251e32ed78b15d5d5e9f1e9613 data/functionalstorage/recipes/diamond_upgrade.json -2404e399e052ce6c83c49eaf1c2810ef80243058 data/functionalstorage/recipes/ender_drawer.json -416f5b09ec636dea47705d7c959ac7860155f66c data/functionalstorage/recipes/fluid_1.json -ed08096d238440468414a0f483f55c6b07c141c7 data/functionalstorage/recipes/fluid_2.json -5d21d0a6f30efb5382645279da3de4ead9c38eff data/functionalstorage/recipes/fluid_4.json -daf2bb7d5e86b83a5a659caa134168079abe1e78 data/functionalstorage/recipes/framed_1.json -f4d167cda5372fc89da838a396f0a4ceb080a94e data/functionalstorage/recipes/framed_2.json -29e682a603c598b26487368d22b69e6ca8d8386a data/functionalstorage/recipes/framed_4.json -934f6149f0db5c56c4ed1b82fb4b3e13569ecfa2 data/functionalstorage/recipes/framed_controller_extension.json -876d55518878937f6426fa20c99542516cc98ac1 data/functionalstorage/recipes/framed_simple_compacting_drawer.json -b0527bad8d11a398f273e45abdc681fee588d200 data/functionalstorage/recipes/framed_storage_controller.json -efc3785a4d1ff872f689a5546580177081c3d2a2 data/functionalstorage/recipes/gold_upgrade.json -76a6b5e3e1fbc61f8b737da5648cde72ca5e6691 data/functionalstorage/recipes/iron_downgrade.json -ad874a5d12d64a12e88d57b02193178341de722c data/functionalstorage/recipes/jungle_1.json -337ff512bcdb74bb52f29edcf29a1f44e36ef734 data/functionalstorage/recipes/jungle_2.json -365af235ba1643d867c94c253d7e2612eeb69a7d data/functionalstorage/recipes/jungle_4.json -4599441ae6f74ef6c3457edff933ed5957e08574 data/functionalstorage/recipes/linking_tool.json -de695200bf3892214c18d8c8dcce6b1203837b13 data/functionalstorage/recipes/mangrove_1.json -81ba6073ed47d6659b0d7c6152ca89939119a090 data/functionalstorage/recipes/mangrove_2.json -75c4958854b7b739017a753094e096b733afb6b0 data/functionalstorage/recipes/mangrove_4.json +// 1.20.4 2024-04-07T00:54:11.3332477 Recipes +72528341b7f8317bcd4b46b536d3eea663345706 data/functionalstorage/advancements/recipes/misc/acacia_1.json +b0e04e073c0a2d4f3398b977678a581b581a6e99 data/functionalstorage/advancements/recipes/misc/acacia_2.json +53e29bff9cf54d0d489a66ad711b40f7d6c1d4f5 data/functionalstorage/advancements/recipes/misc/acacia_4.json +2a7334decaf62bff448c6c115330add1976bf2e2 data/functionalstorage/advancements/recipes/misc/armory_cabinet.json +8f67f6e972e051d893c3e37c45a6c306807f0088 data/functionalstorage/advancements/recipes/misc/birch_1.json +da1abea18171c7607f018dfc15571ef1282c029a data/functionalstorage/advancements/recipes/misc/birch_2.json +29212901bf63a0c7fe7ed6f21f4448a56db240aa data/functionalstorage/advancements/recipes/misc/birch_4.json +89beef3273716ec2b728b73ebad81900fb247ced data/functionalstorage/advancements/recipes/misc/cherry_1.json +5f6c76fcd6de4d8e2e5521a1ae918a9ebc1d07cd data/functionalstorage/advancements/recipes/misc/cherry_2.json +45f254412a67c8d66d0744ede97d9620e3245b72 data/functionalstorage/advancements/recipes/misc/cherry_4.json +8d2bb5a10c9611e2bbfb85c8806940669c6e37b1 data/functionalstorage/advancements/recipes/misc/collector_upgrade.json +3e24d840d865c134762187738f62f36e6ece3979 data/functionalstorage/advancements/recipes/misc/compacting_drawer.json +662b5411d4360261bd5e9ecdb95f6bf1f602ff43 data/functionalstorage/advancements/recipes/misc/compacting_framed_drawer.json +01187729211d5160962cfa7d8cb71325f24dd7c4 data/functionalstorage/advancements/recipes/misc/configuration_tool.json +76dc7498bf4a1b3bf773b925797cddc5d9dbac64 data/functionalstorage/advancements/recipes/misc/controller_extension.json +2c11bf8a787b29646e54b7ec9219472aee19a395 data/functionalstorage/advancements/recipes/misc/copper_upgrade.json +a15b34eb48ca5f2352b383f4118636ab7ff5d92b data/functionalstorage/advancements/recipes/misc/crimson_1.json +9119a6d51628db1593965b3c852b4001f1bcae5e data/functionalstorage/advancements/recipes/misc/crimson_2.json +1d7d23180458082a0068aba086bbd11ad8da7da0 data/functionalstorage/advancements/recipes/misc/crimson_4.json +3505933b96df3f9a7c8b66ceba9c06d608a2c3f8 data/functionalstorage/advancements/recipes/misc/dark_oak_1.json +41e2153173dbb1a7bd1f2762aa81d1942f6051de data/functionalstorage/advancements/recipes/misc/dark_oak_2.json +3653d9f71579562eabe086f75fc2d76020661a66 data/functionalstorage/advancements/recipes/misc/dark_oak_4.json +fc20d9f9c332f3b240865b85006676171da8370d data/functionalstorage/advancements/recipes/misc/diamond_upgrade.json +bff17300ad3fe2ab48158a27baa332e0abfbe355 data/functionalstorage/advancements/recipes/misc/ender_drawer.json +ae9c1d5ae29b1ff206162f4f2842ef7838c0ec54 data/functionalstorage/advancements/recipes/misc/fluid_1.json +efacdded2485f2b481af5a086e339132a9c651e0 data/functionalstorage/advancements/recipes/misc/fluid_2.json +737736f0450add8ac042ef629f36816547e8fabf data/functionalstorage/advancements/recipes/misc/fluid_4.json +15f0c9409a5f784ad795f2d279af40cd708d0fd1 data/functionalstorage/advancements/recipes/misc/framed_1.json +f06238ecabe94704bca8ee7f4e2995ac8be6a01b data/functionalstorage/advancements/recipes/misc/framed_2.json +5c7483913a6efc86baafa592ff726c42f0939f9d data/functionalstorage/advancements/recipes/misc/framed_4.json +1cd42abd49da5dd5c9b498c8bbba6a1ee0ecb7c7 data/functionalstorage/advancements/recipes/misc/framed_controller_extension.json +13dc59583bb9f10d6a10dfd39ce3aec6fc1d9f90 data/functionalstorage/advancements/recipes/misc/framed_simple_compacting_drawer.json +09ecfaca636f83f254f1ccb4c56bdbdb1502a7d1 data/functionalstorage/advancements/recipes/misc/framed_storage_controller.json +f73ac90d0c48b6c4babec29b0e0ec3e3fa6dfbe3 data/functionalstorage/advancements/recipes/misc/gold_upgrade.json +3c79a5c491fad66512cd57d219187547c7b15e1f data/functionalstorage/advancements/recipes/misc/iron_downgrade.json +36ec68ac31b4db1b57515ee1648c720eb854abe8 data/functionalstorage/advancements/recipes/misc/jungle_1.json +f8b6f36370e163305531f81b5fcd1d8dea61efdf data/functionalstorage/advancements/recipes/misc/jungle_2.json +80de247b237795914fdd2155a498592612986818 data/functionalstorage/advancements/recipes/misc/jungle_4.json +1e6dd147cbf262e5309e03a8c472cd8d24e683db data/functionalstorage/advancements/recipes/misc/linking_tool.json +8a64fd833efca6509aca8c3fe07b6d063e034f8c data/functionalstorage/advancements/recipes/misc/mangrove_1.json +edaf84d35549e5599c5f06dc5e4df83e89271f15 data/functionalstorage/advancements/recipes/misc/mangrove_2.json +00e08eec2a68f76cb2f2dce583bc42d4126d872c data/functionalstorage/advancements/recipes/misc/mangrove_4.json +d9417abf98d878f51c9d3c6fd11ac9173406204c data/functionalstorage/advancements/recipes/misc/netherite_upgrade.json +a29201b45c7a89c8813d32002df598b5b6de427a data/functionalstorage/advancements/recipes/misc/oak_1.json +5714424f64e49b013e3b62a48acb03e06350d1b3 data/functionalstorage/advancements/recipes/misc/oak_2.json +69a5e037a143f31c15c7d5f7a68f76290d9652eb data/functionalstorage/advancements/recipes/misc/oak_4.json +90c46bfee588b98d53147c2e2052145eac5283fb data/functionalstorage/advancements/recipes/misc/puller_upgrade.json +f244341504e8eacb43f0394c5394cd3936810205 data/functionalstorage/advancements/recipes/misc/pusher_upgrade.json +9b4211a8a66f2ec076cc1f868963a9d275eefc7b data/functionalstorage/advancements/recipes/misc/redstone_upgrade.json +c49563600aafeae88ec9a8c282d295b80f354f44 data/functionalstorage/advancements/recipes/misc/simple_compacting_drawer.json +23b9b83d4b557fa3f14bc670b274f2846c002f9b data/functionalstorage/advancements/recipes/misc/spruce_1.json +1a8feaf3bb60a4a1c9ab727d99e551abbe03ec17 data/functionalstorage/advancements/recipes/misc/spruce_2.json +138f509e6bf2ba1829bd8fd4a2153f10d3d21e25 data/functionalstorage/advancements/recipes/misc/spruce_4.json +1d003afdafcdffad75b7baa603244543875d0f2e data/functionalstorage/advancements/recipes/misc/storage_controller.json +a7a1b82e23a41741322848067aad65b75454ad15 data/functionalstorage/advancements/recipes/misc/void_upgrade.json +ecbc7279e43455b49833bbbc42e5d25dd9bd3543 data/functionalstorage/advancements/recipes/misc/warped_1.json +5307459f80390f94cf2a8eabc24bc32e1e07feb9 data/functionalstorage/advancements/recipes/misc/warped_2.json +e51abea248741e4b5b077a557f263b5a87e2718f data/functionalstorage/advancements/recipes/misc/warped_4.json +22ce4e567c90b52264edfc8b9fda64fa14285845 data/functionalstorage/recipes/acacia_1.json +2a89941c5106fa4fdc38607f74738c3f8a3fc062 data/functionalstorage/recipes/acacia_2.json +64092ca74d93e8866a12d4a45f6b6e55c877f851 data/functionalstorage/recipes/acacia_4.json +ea0953692767a8d1379a3d03bfc821db63ac73ee data/functionalstorage/recipes/armory_cabinet.json +a5f273badce95bc72c6f89c9e3c294628cc853cf data/functionalstorage/recipes/birch_1.json +83c1b6dfaff3611b211b55b1637fd0f9c2e2247c data/functionalstorage/recipes/birch_2.json +f3dd17063422fd6d69d844dffc5e80782ee72787 data/functionalstorage/recipes/birch_4.json +34f066e2c59572edfa88b9ee4ffef83f2c8bf502 data/functionalstorage/recipes/cherry_1.json +6614914bb71f64e5c547533e0211207b7cebf0eb data/functionalstorage/recipes/cherry_2.json +2b33273ed754dd8319d8495e88e2f9c8c260e72c data/functionalstorage/recipes/cherry_4.json +e1942ad5a1a83c8b20c386829216eaa2a6cee19f data/functionalstorage/recipes/collector_upgrade.json +1947695f2c428e8199326909db58b787c65a4a7b data/functionalstorage/recipes/compacting_drawer.json +342862de5e3b39ed26feeb11a18833076ce1be36 data/functionalstorage/recipes/compacting_framed_drawer.json +8773914553d57d91061d489b1c598085d0de483e data/functionalstorage/recipes/configuration_tool.json +7a599b829e8eb8d56601add0cd655073a326cddb data/functionalstorage/recipes/controller_extension.json +c789d6af57dd0ccaf216c49ee391718e29e25379 data/functionalstorage/recipes/copper_upgrade.json +bc5524de6ecbd953b197c414d9b63b096dd7c48e data/functionalstorage/recipes/crimson_1.json +a2a88219643657dfaec7bbaa3f7d9e1847d9ebb7 data/functionalstorage/recipes/crimson_2.json +aa6cc89aea0929522092b6403a5ff8455c0b957c data/functionalstorage/recipes/crimson_4.json +16126610451714756f2854544604684b366d01f9 data/functionalstorage/recipes/dark_oak_1.json +644c43a6427c955e7217e237d0738d1847b2a4ba data/functionalstorage/recipes/dark_oak_2.json +0a12df6c07e9912cdac70380de5f0f1f1b9b5815 data/functionalstorage/recipes/dark_oak_4.json +6c46a4b98a21b662e92e6ff1082acd5ea64d37b4 data/functionalstorage/recipes/diamond_upgrade.json +a1705b747a0834cf91bdb35163d0ea4d50e99839 data/functionalstorage/recipes/ender_drawer.json +1dce91d3b325b06b67ecb9633bd55e30583fc04f data/functionalstorage/recipes/fluid_1.json +4c843ba14f4b041de50249e6f07d4b41f2fccf0f data/functionalstorage/recipes/fluid_2.json +e5c96130c9e6c372d1434768d6967a255085355f data/functionalstorage/recipes/fluid_4.json +12ad9980f708d010aa9325fe06b225da5b46c0cb data/functionalstorage/recipes/framed_1.json +0363e14a8e2a472ef0a90750da4576653ca4cb76 data/functionalstorage/recipes/framed_2.json +e531379d5cd5a1823b896f5278d89f2cd9750222 data/functionalstorage/recipes/framed_4.json +e639ca500bf44e34936cdb10f48878c9e1fd998c data/functionalstorage/recipes/framed_controller_extension.json +d5df59688f8a7df3575ff8481f6b9d2d4d472227 data/functionalstorage/recipes/framed_simple_compacting_drawer.json +c353224254e7923f8e66adaf17f4df874d1dcbdf data/functionalstorage/recipes/framed_storage_controller.json +255c3bdc5015be03d75a1a70e42b50e85c5a1567 data/functionalstorage/recipes/gold_upgrade.json +702769474f6595cebaf3d4517d65a4f69a9dbedc data/functionalstorage/recipes/iron_downgrade.json +88f21b369f13e7551057094c3c27f354ae58fb7c data/functionalstorage/recipes/jungle_1.json +73ef1849777d9676b32459ad848ecb939bbdd1e0 data/functionalstorage/recipes/jungle_2.json +dcad1b94f98a14de7f9248b8a4229429a13862e0 data/functionalstorage/recipes/jungle_4.json +a237a1bd9c909abfd9c6e70e50fc7457b07aca2e data/functionalstorage/recipes/linking_tool.json +86882f70ef2119613d08ec144929a7b2c3decc38 data/functionalstorage/recipes/mangrove_1.json +26712b44b3e320eb615bd1d7ac500420c6b69946 data/functionalstorage/recipes/mangrove_2.json +a24948b011d3c542c159ecf17aeb7effccbc83de data/functionalstorage/recipes/mangrove_4.json 263afed3953c17b4a3940302e788b36b9fbe76eb data/functionalstorage/recipes/netherite_upgrade.json -56a4bb31e934fa7ad3aa60bdded1144743959a02 data/functionalstorage/recipes/oak_1.json -a685ca7980412cefff9e0d6219857b56210bed10 data/functionalstorage/recipes/oak_2.json -67aa8ac1ba957a5f62c70daabaa4bec8f9e6f612 data/functionalstorage/recipes/oak_4.json -f6534beab44ed517cf850785ed9fa858eae7a99d data/functionalstorage/recipes/oak_drawer_alternate_x1.json -9c96371ec87218a24095301e6f9c9f72c056e008 data/functionalstorage/recipes/oak_drawer_alternate_x2.json -3211363e1989533daa944f3100d88614e4d45f71 data/functionalstorage/recipes/oak_drawer_alternate_x4.json -9dc5d4bde3a00f4c8b4ae91872964777e9c376c5 data/functionalstorage/recipes/puller_upgrade.json -b51f0c8e0476412d6ae6e162d041c8dfb8bc2a2b data/functionalstorage/recipes/pusher_upgrade.json -658244426ae95804e2efeee6ad94f90d0aadea4d data/functionalstorage/recipes/redstone_upgrade.json -1e4f2dc5edc5388e3f3527df271c6b5fed41de90 data/functionalstorage/recipes/simple_compacting_drawer.json -c4e539d0a82d1864a28e423c3de10e051a8134db data/functionalstorage/recipes/spruce_1.json -1a444eabc46341d8d7bfb73afddb9e46a3a25e4d data/functionalstorage/recipes/spruce_2.json -73c3c31706b5c19a35d7823dae93eaafac7e3f6d data/functionalstorage/recipes/spruce_4.json -77d9d1293a6243491f0683c46c682246a8d38451 data/functionalstorage/recipes/storage_controller.json -2cc8c0ba9b5e4071f6f7f70516561944f9a796ca data/functionalstorage/recipes/void_upgrade.json -652ed891ef481549320c65bead5d0333d2b22dc2 data/functionalstorage/recipes/warped_1.json -24935bdc28cf8c708e81ab82f04bfb9581d13c83 data/functionalstorage/recipes/warped_2.json -c85f69d876ab9233234c63fd075e89b1b2968b75 data/functionalstorage/recipes/warped_4.json +0daac04d5e593be8afb420d7b068b5d0a0a7e759 data/functionalstorage/recipes/oak_1.json +87727eeccd7271b330812f379e9a5e5bc6cf5de9 data/functionalstorage/recipes/oak_2.json +e729c5d55e191f2d1bd99a7217a3833291483ecb data/functionalstorage/recipes/oak_4.json +9c919a3baeaa9b3deae92ef802ddb6f07b1fa2f8 data/functionalstorage/recipes/puller_upgrade.json +055f291a2c7df167b3417931c3ce324e9a3b4efc data/functionalstorage/recipes/pusher_upgrade.json +25d723eedc951d40516c197b5b85cba0ff2cc64b data/functionalstorage/recipes/redstone_upgrade.json +cf0d2dbd7131c865223a85f7a1c4e314cf6167b6 data/functionalstorage/recipes/simple_compacting_drawer.json +a9e8d25c0ee7f0442675427627072906b34c8b4d data/functionalstorage/recipes/spruce_1.json +9e0b9a5c99d072155f01ccd335acf9c2fca96bc9 data/functionalstorage/recipes/spruce_2.json +6c782d5e81f1a152dbc1849391164b6c533f576b data/functionalstorage/recipes/spruce_4.json +f336fee45abfd07c1f2810275b816b04f606448c data/functionalstorage/recipes/storage_controller.json +1660fde05871583966ad2fc9a7882ac7a5066e20 data/functionalstorage/recipes/void_upgrade.json +f016626b869686a6657b772c100d9e923b58cf39 data/functionalstorage/recipes/warped_1.json +b034bdc06d0734de160f9c857b630e9261d6df01 data/functionalstorage/recipes/warped_2.json +53ba0cbca3c75a9f90ec12d241622d743cfadcc4 data/functionalstorage/recipes/warped_4.json +435084d750577a3e1e31113cb6976f65ce98170b data/minecraft/recipes/amethyst.json +185e1f0c092f5aef2db16ff27daf7796ea578fbf data/minecraft/recipes/blue_ice.json +59f83e20d8a359a63417b2d6dad0ddc0b1657bac data/minecraft/recipes/glowstone.json +286fc95fc2f0fbe0341b751cf5bfdab1007bd6e3 data/minecraft/recipes/melon.json +e9c6ff4fbcb2617dc7fd7f4371db0ead6cea7154 data/minecraft/recipes/packed_ice.json +6fb23d653de5174dc0094f8a81c933162b0ad806 data/minecraft/recipes/quartz.json diff --git a/src/generated/resources/.cache/b3b48c10570c424437115253c982ed89e6bd5ccb b/src/generated/resources/.cache/b3b48c10570c424437115253c982ed89e6bd5ccb deleted file mode 100644 index de2385c2..00000000 --- a/src/generated/resources/.cache/b3b48c10570c424437115253c982ed89e6bd5ccb +++ /dev/null @@ -1,8 +0,0 @@ -// 1.20.1 2023-11-18T18:42:50.7617865 Titanium Serializable (functionalstorage) -35cd7d63477caf5ea93cae6c81984fd4d7992fc3 data/functionalstorage/recipes/custom_compacting/amethyst.json -d24028ec840b0e7b4d100b43144e7a3f5a70283c data/functionalstorage/recipes/custom_compacting/clay.json -b3d11532f966981fbe0349b89e09cc691e8f68e4 data/functionalstorage/recipes/custom_compacting/glowstone.json -6847d92c8055493634aed84c9de6de4835aab167 data/functionalstorage/recipes/custom_compacting/ice.json -266466efff4179eae51a2ce4c4541d65ebd9bb60 data/functionalstorage/recipes/custom_compacting/melon.json -b56c50e4b97f0af81f6019e3d306b24d235945ca data/functionalstorage/recipes/custom_compacting/packed_ice.json -4d0c7b7ed927a92cef2cdb9814ca086287a363ac data/functionalstorage/recipes/custom_compacting/quartz.json diff --git a/src/generated/resources/.cache/f4bc6a534340ffb17710ab19bf013aa0d2f1f9d9 b/src/generated/resources/.cache/f4bc6a534340ffb17710ab19bf013aa0d2f1f9d9 index bad315d8..ca4508a6 100644 --- a/src/generated/resources/.cache/f4bc6a534340ffb17710ab19bf013aa0d2f1f9d9 +++ b/src/generated/resources/.cache/f4bc6a534340ffb17710ab19bf013aa0d2f1f9d9 @@ -1,4 +1,4 @@ -// 1.20.1 2023-06-27T22:41:46.5044951 Block Models: functionalstorage +// 1.20.4 2024-04-07T00:54:11.3202025 Block Models: functionalstorage 9a3565a126dac6771b78fa3f5f3f2b6e3c858dd8 assets/functionalstorage/models/block/acacia_1_locked.json fb054b9a925853b52f05fc4402de2b58b2d3a72f assets/functionalstorage/models/block/acacia_2_locked.json b8c2c3e1a316d39c881a4532b04a18d19d6d9c55 assets/functionalstorage/models/block/acacia_4_locked.json diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_1.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_1.json new file mode 100644 index 00000000..bb56d9c9 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_1.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:acacia_1" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:acacia_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:acacia_1" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:acacia_1" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_2.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_2.json new file mode 100644 index 00000000..e6d8d572 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_2.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:acacia_2" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:acacia_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:acacia_2" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:acacia_2" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_4.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_4.json new file mode 100644 index 00000000..257cc153 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_4.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:acacia_4" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:acacia_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:acacia_4" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:acacia_4" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/armory_cabinet.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/armory_cabinet.json new file mode 100644 index 00000000..2e09f5ca --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/armory_cabinet.json @@ -0,0 +1,38 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:armory_cabinet" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "tag": "forge:stone" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:armory_cabinet" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:armory_cabinet" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_1.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_1.json new file mode 100644 index 00000000..b1a3eaf5 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_1.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:birch_1" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:birch_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:birch_1" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:birch_1" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_2.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_2.json new file mode 100644 index 00000000..7ac03800 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_2.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:birch_2" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:birch_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:birch_2" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:birch_2" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_4.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_4.json new file mode 100644 index 00000000..1a738f3b --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_4.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:birch_4" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:birch_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:birch_4" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:birch_4" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_1.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_1.json new file mode 100644 index 00000000..601ef6e2 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_1.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:cherry_1" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:cherry_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:cherry_1" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:cherry_1" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_2.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_2.json new file mode 100644 index 00000000..502a52a0 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_2.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:cherry_2" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:cherry_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:cherry_2" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:cherry_2" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_4.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_4.json new file mode 100644 index 00000000..9e668a5c --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_4.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:cherry_4" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:cherry_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:cherry_4" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:cherry_4" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/collector_upgrade.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/collector_upgrade.json new file mode 100644 index 00000000..d3608151 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/collector_upgrade.json @@ -0,0 +1,38 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:collector_upgrade" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "tag": "forge:stone" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:collector_upgrade" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:collector_upgrade" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/compacting_drawer.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/compacting_drawer.json new file mode 100644 index 00000000..0c678f69 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/compacting_drawer.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:compacting_drawer" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:stone" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:compacting_drawer" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:compacting_drawer" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/compacting_framed_drawer.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/compacting_framed_drawer.json new file mode 100644 index 00000000..c204022b --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/compacting_framed_drawer.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:compacting_framed_drawer" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:iron_nugget" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:compacting_framed_drawer" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:compacting_framed_drawer" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/configuration_tool.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/configuration_tool.json new file mode 100644 index 00000000..f16f1df9 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/configuration_tool.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:configuration_tool" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:paper" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:configuration_tool" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:configuration_tool" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/controller_extension.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/controller_extension.json new file mode 100644 index 00000000..2cba6fb3 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/controller_extension.json @@ -0,0 +1,38 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:controller_extension" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "tag": "forge:stone" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:controller_extension" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:controller_extension" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/copper_upgrade.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/copper_upgrade.json new file mode 100644 index 00000000..1f727249 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/copper_upgrade.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:copper_upgrade" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:copper_ingot" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:copper_upgrade" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:copper_upgrade" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_1.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_1.json new file mode 100644 index 00000000..a0a67ff6 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_1.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:crimson_1" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:crimson_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:crimson_1" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:crimson_1" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_2.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_2.json new file mode 100644 index 00000000..38b49e92 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_2.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:crimson_2" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:crimson_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:crimson_2" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:crimson_2" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_4.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_4.json new file mode 100644 index 00000000..6ec19ade --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_4.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:crimson_4" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:crimson_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:crimson_4" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:crimson_4" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_1.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_1.json new file mode 100644 index 00000000..f14bc9bc --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_1.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:dark_oak_1" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:dark_oak_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:dark_oak_1" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:dark_oak_1" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_2.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_2.json new file mode 100644 index 00000000..c5acc613 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_2.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:dark_oak_2" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:dark_oak_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:dark_oak_2" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:dark_oak_2" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_4.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_4.json new file mode 100644 index 00000000..db2544b1 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_4.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:dark_oak_4" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:dark_oak_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:dark_oak_4" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:dark_oak_4" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/diamond_upgrade.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/diamond_upgrade.json new file mode 100644 index 00000000..5793bfc5 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/diamond_upgrade.json @@ -0,0 +1,38 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:diamond_upgrade" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "tag": "forge:gems/diamond" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:diamond_upgrade" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:diamond_upgrade" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/ender_drawer.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/ender_drawer.json new file mode 100644 index 00000000..3d4bf5fe --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/ender_drawer.json @@ -0,0 +1,38 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:ender_drawer" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "tag": "minecraft:planks" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:ender_drawer" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:ender_drawer" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_1.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_1.json new file mode 100644 index 00000000..70c33545 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_1.json @@ -0,0 +1,38 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:fluid_1" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "tag": "minecraft:planks" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:fluid_1" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:fluid_1" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_2.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_2.json new file mode 100644 index 00000000..b6064133 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_2.json @@ -0,0 +1,38 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:fluid_2" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "tag": "minecraft:planks" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:fluid_2" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:fluid_2" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_4.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_4.json new file mode 100644 index 00000000..ca7770d1 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_4.json @@ -0,0 +1,38 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:fluid_4" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "tag": "minecraft:planks" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:fluid_4" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:fluid_4" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_1.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_1.json new file mode 100644 index 00000000..f48abfd5 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_1.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:framed_1" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:iron_nugget" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:framed_1" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:framed_1" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_2.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_2.json new file mode 100644 index 00000000..9fb63aaf --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_2.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:framed_2" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:iron_nugget" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:framed_2" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:framed_2" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_4.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_4.json new file mode 100644 index 00000000..f3fbab01 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_4.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:framed_4" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:iron_nugget" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:framed_4" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:framed_4" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_controller_extension.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_controller_extension.json new file mode 100644 index 00000000..fb04e282 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_controller_extension.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:framed_controller_extension" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:iron_nugget" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:framed_controller_extension" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:framed_controller_extension" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_simple_compacting_drawer.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_simple_compacting_drawer.json new file mode 100644 index 00000000..77aa5176 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_simple_compacting_drawer.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:framed_simple_compacting_drawer" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:iron_nugget" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:framed_simple_compacting_drawer" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:framed_simple_compacting_drawer" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_storage_controller.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_storage_controller.json new file mode 100644 index 00000000..a324ec21 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_storage_controller.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:framed_storage_controller" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:iron_nugget" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:framed_storage_controller" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:framed_storage_controller" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/gold_upgrade.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/gold_upgrade.json new file mode 100644 index 00000000..9c4fcf9e --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/gold_upgrade.json @@ -0,0 +1,38 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:gold_upgrade" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "tag": "forge:ingots/gold" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:gold_upgrade" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:gold_upgrade" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/iron_downgrade.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/iron_downgrade.json new file mode 100644 index 00000000..7bedccd6 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/iron_downgrade.json @@ -0,0 +1,38 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:iron_downgrade" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "tag": "forge:ingots/iron" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:iron_downgrade" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:iron_downgrade" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_1.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_1.json new file mode 100644 index 00000000..9d0e54d5 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_1.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:jungle_1" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:jungle_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:jungle_1" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:jungle_1" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_2.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_2.json new file mode 100644 index 00000000..b3f73174 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_2.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:jungle_2" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:jungle_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:jungle_2" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:jungle_2" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_4.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_4.json new file mode 100644 index 00000000..bf5dd7f2 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_4.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:jungle_4" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:jungle_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:jungle_4" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:jungle_4" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/linking_tool.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/linking_tool.json new file mode 100644 index 00000000..3746e671 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/linking_tool.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:linking_tool" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:paper" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:linking_tool" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:linking_tool" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_1.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_1.json new file mode 100644 index 00000000..4f008307 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_1.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:mangrove_1" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:mangrove_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:mangrove_1" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:mangrove_1" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_2.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_2.json new file mode 100644 index 00000000..0174c583 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_2.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:mangrove_2" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:mangrove_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:mangrove_2" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:mangrove_2" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_4.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_4.json new file mode 100644 index 00000000..3b15c817 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_4.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:mangrove_4" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:mangrove_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:mangrove_4" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:mangrove_4" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/netherite_upgrade.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/netherite_upgrade.json index 07a67538..5f66c507 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/netherite_upgrade.json +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/netherite_upgrade.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_netherite_ingot", - "has_the_recipe" + "has_the_recipe", + "has_netherite_ingot" ] ], "rewards": { "recipes": [ "functionalstorage:netherite_upgrade" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_1.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_1.json new file mode 100644 index 00000000..4103d50c --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_1.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:oak_1" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:oak_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:oak_1" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:oak_1" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_2.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_2.json new file mode 100644 index 00000000..100cf4cd --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_2.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:oak_2" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:oak_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:oak_2" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:oak_2" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_4.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_4.json new file mode 100644 index 00000000..5c3c2d20 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_4.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:oak_4" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:oak_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:oak_4" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:oak_4" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/puller_upgrade.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/puller_upgrade.json new file mode 100644 index 00000000..9befe62d --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/puller_upgrade.json @@ -0,0 +1,38 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:puller_upgrade" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "tag": "forge:stone" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:puller_upgrade" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:puller_upgrade" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/pusher_upgrade.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/pusher_upgrade.json new file mode 100644 index 00000000..64c78e37 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/pusher_upgrade.json @@ -0,0 +1,38 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:pusher_upgrade" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "tag": "forge:stone" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:pusher_upgrade" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:pusher_upgrade" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/redstone_upgrade.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/redstone_upgrade.json new file mode 100644 index 00000000..cbc974cd --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/redstone_upgrade.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:redstone_upgrade" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:redstone" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:redstone_upgrade" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:redstone_upgrade" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/simple_compacting_drawer.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/simple_compacting_drawer.json new file mode 100644 index 00000000..b389bc15 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/simple_compacting_drawer.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:simple_compacting_drawer" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:stone" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:simple_compacting_drawer" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:simple_compacting_drawer" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_1.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_1.json new file mode 100644 index 00000000..f617aff6 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_1.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:spruce_1" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:spruce_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:spruce_1" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:spruce_1" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_2.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_2.json new file mode 100644 index 00000000..358ba28a --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_2.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:spruce_2" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:spruce_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:spruce_2" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:spruce_2" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_4.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_4.json new file mode 100644 index 00000000..a1d932fd --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_4.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:spruce_4" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:spruce_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:spruce_4" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:spruce_4" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/storage_controller.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/storage_controller.json new file mode 100644 index 00000000..7bee4dbd --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/storage_controller.json @@ -0,0 +1,38 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:storage_controller" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "tag": "forge:stone" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:storage_controller" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:storage_controller" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/void_upgrade.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/void_upgrade.json new file mode 100644 index 00000000..1cc2c8e3 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/void_upgrade.json @@ -0,0 +1,38 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:void_upgrade" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "tag": "forge:obsidian" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:void_upgrade" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:void_upgrade" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_1.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_1.json new file mode 100644 index 00000000..d4a0f3d4 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_1.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:warped_1" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:warped_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:warped_1" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:warped_1" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_2.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_2.json new file mode 100644 index 00000000..16bc8f50 --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_2.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:warped_2" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:warped_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:warped_2" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:warped_2" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_4.json b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_4.json new file mode 100644 index 00000000..11269b5e --- /dev/null +++ b/src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_4.json @@ -0,0 +1,40 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:item_exists", + "item": "functionalstorage:warped_4" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:warped_planks" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "functionalstorage:warped_4" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "functionalstorage:warped_4" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/acacia_1.json b/src/generated/resources/data/functionalstorage/recipes/acacia_1.json index 20f139fc..befe501e 100644 --- a/src/generated/resources/data/functionalstorage/recipes/acacia_1.json +++ b/src/generated/resources/data/functionalstorage/recipes/acacia_1.json @@ -1,39 +1,26 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:acacia_1" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:acacia_planks" - } - }, - "pattern": [ - "PPP", - "PCP", - "PPP" - ], - "result": { - "item": "functionalstorage:acacia_1" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:acacia_1" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:acacia_planks" + } + }, + "pattern": [ + "PPP", + "PCP", + "PPP" + ], + "result": { + "item": "functionalstorage:acacia_1" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/acacia_2.json b/src/generated/resources/data/functionalstorage/recipes/acacia_2.json index f042130f..8626284c 100644 --- a/src/generated/resources/data/functionalstorage/recipes/acacia_2.json +++ b/src/generated/resources/data/functionalstorage/recipes/acacia_2.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:acacia_2" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:acacia_planks" - } - }, - "pattern": [ - "PCP", - "PPP", - "PCP" - ], - "result": { - "count": 2, - "item": "functionalstorage:acacia_2" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:acacia_2" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:acacia_planks" + } + }, + "pattern": [ + "PCP", + "PPP", + "PCP" + ], + "result": { + "count": 2, + "item": "functionalstorage:acacia_2" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/acacia_4.json b/src/generated/resources/data/functionalstorage/recipes/acacia_4.json index 4f7d5c29..473c712d 100644 --- a/src/generated/resources/data/functionalstorage/recipes/acacia_4.json +++ b/src/generated/resources/data/functionalstorage/recipes/acacia_4.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:acacia_4" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:acacia_planks" - } - }, - "pattern": [ - "CPC", - "PPP", - "CPC" - ], - "result": { - "count": 4, - "item": "functionalstorage:acacia_4" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:acacia_4" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:acacia_planks" + } + }, + "pattern": [ + "CPC", + "PPP", + "CPC" + ], + "result": { + "count": 4, + "item": "functionalstorage:acacia_4" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/armory_cabinet.json b/src/generated/resources/data/functionalstorage/recipes/armory_cabinet.json index 6e0e045c..7d7cd33c 100644 --- a/src/generated/resources/data/functionalstorage/recipes/armory_cabinet.json +++ b/src/generated/resources/data/functionalstorage/recipes/armory_cabinet.json @@ -1,45 +1,32 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:armory_cabinet" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "B": { - "tag": "forge:ingots/netherite" - }, - "C": { - "tag": "functionalstorage:drawer" - }, - "D": { - "item": "minecraft:comparator" - }, - "I": { - "tag": "forge:stone" - } - }, - "pattern": [ - "ICI", - "CDC", - "IBI" - ], - "result": { - "item": "functionalstorage:armory_cabinet" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:armory_cabinet" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "B": { + "tag": "forge:ingots/netherite" + }, + "C": { + "tag": "functionalstorage:drawer" + }, + "D": { + "item": "minecraft:comparator" + }, + "I": { + "tag": "forge:stone" + } + }, + "pattern": [ + "ICI", + "CDC", + "IBI" + ], + "result": { + "item": "functionalstorage:armory_cabinet" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/birch_1.json b/src/generated/resources/data/functionalstorage/recipes/birch_1.json index 3b547bef..21895c89 100644 --- a/src/generated/resources/data/functionalstorage/recipes/birch_1.json +++ b/src/generated/resources/data/functionalstorage/recipes/birch_1.json @@ -1,39 +1,26 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:birch_1" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:birch_planks" - } - }, - "pattern": [ - "PPP", - "PCP", - "PPP" - ], - "result": { - "item": "functionalstorage:birch_1" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:birch_1" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:birch_planks" + } + }, + "pattern": [ + "PPP", + "PCP", + "PPP" + ], + "result": { + "item": "functionalstorage:birch_1" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/birch_2.json b/src/generated/resources/data/functionalstorage/recipes/birch_2.json index 9c0878e9..d7420128 100644 --- a/src/generated/resources/data/functionalstorage/recipes/birch_2.json +++ b/src/generated/resources/data/functionalstorage/recipes/birch_2.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:birch_2" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:birch_planks" - } - }, - "pattern": [ - "PCP", - "PPP", - "PCP" - ], - "result": { - "count": 2, - "item": "functionalstorage:birch_2" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:birch_2" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:birch_planks" + } + }, + "pattern": [ + "PCP", + "PPP", + "PCP" + ], + "result": { + "count": 2, + "item": "functionalstorage:birch_2" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/birch_4.json b/src/generated/resources/data/functionalstorage/recipes/birch_4.json index 373ada50..8a9c74bc 100644 --- a/src/generated/resources/data/functionalstorage/recipes/birch_4.json +++ b/src/generated/resources/data/functionalstorage/recipes/birch_4.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:birch_4" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:birch_planks" - } - }, - "pattern": [ - "CPC", - "PPP", - "CPC" - ], - "result": { - "count": 4, - "item": "functionalstorage:birch_4" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:birch_4" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:birch_planks" + } + }, + "pattern": [ + "CPC", + "PPP", + "CPC" + ], + "result": { + "count": 4, + "item": "functionalstorage:birch_4" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/cherry_1.json b/src/generated/resources/data/functionalstorage/recipes/cherry_1.json index 2a960f5d..53ba92d3 100644 --- a/src/generated/resources/data/functionalstorage/recipes/cherry_1.json +++ b/src/generated/resources/data/functionalstorage/recipes/cherry_1.json @@ -1,39 +1,26 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:cherry_1" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:cherry_planks" - } - }, - "pattern": [ - "PPP", - "PCP", - "PPP" - ], - "result": { - "item": "functionalstorage:cherry_1" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:cherry_1" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:cherry_planks" + } + }, + "pattern": [ + "PPP", + "PCP", + "PPP" + ], + "result": { + "item": "functionalstorage:cherry_1" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/cherry_2.json b/src/generated/resources/data/functionalstorage/recipes/cherry_2.json index 8de7a0c8..7fc18e60 100644 --- a/src/generated/resources/data/functionalstorage/recipes/cherry_2.json +++ b/src/generated/resources/data/functionalstorage/recipes/cherry_2.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:cherry_2" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:cherry_planks" - } - }, - "pattern": [ - "PCP", - "PPP", - "PCP" - ], - "result": { - "count": 2, - "item": "functionalstorage:cherry_2" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:cherry_2" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:cherry_planks" + } + }, + "pattern": [ + "PCP", + "PPP", + "PCP" + ], + "result": { + "count": 2, + "item": "functionalstorage:cherry_2" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/cherry_4.json b/src/generated/resources/data/functionalstorage/recipes/cherry_4.json index e98dba35..b03f43ae 100644 --- a/src/generated/resources/data/functionalstorage/recipes/cherry_4.json +++ b/src/generated/resources/data/functionalstorage/recipes/cherry_4.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:cherry_4" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:cherry_planks" - } - }, - "pattern": [ - "CPC", - "PPP", - "CPC" - ], - "result": { - "count": 4, - "item": "functionalstorage:cherry_4" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:cherry_4" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:cherry_planks" + } + }, + "pattern": [ + "CPC", + "PPP", + "CPC" + ], + "result": { + "count": 4, + "item": "functionalstorage:cherry_4" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/collector_upgrade.json b/src/generated/resources/data/functionalstorage/recipes/collector_upgrade.json index 7be0e591..d9013f5e 100644 --- a/src/generated/resources/data/functionalstorage/recipes/collector_upgrade.json +++ b/src/generated/resources/data/functionalstorage/recipes/collector_upgrade.json @@ -1,45 +1,32 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:collector_upgrade" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "B": { - "item": "minecraft:hopper" - }, - "D": { - "tag": "functionalstorage:drawer" - }, - "I": { - "tag": "forge:stone" - }, - "R": { - "tag": "forge:dusts/redstone" - } - }, - "pattern": [ - "IBI", - "RDR", - "IBI" - ], - "result": { - "item": "functionalstorage:collector_upgrade" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:collector_upgrade" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "B": { + "item": "minecraft:hopper" + }, + "D": { + "tag": "functionalstorage:drawer" + }, + "I": { + "tag": "forge:stone" + }, + "R": { + "tag": "forge:dusts/redstone" + } + }, + "pattern": [ + "IBI", + "RDR", + "IBI" + ], + "result": { + "item": "functionalstorage:collector_upgrade" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/compacting_drawer.json b/src/generated/resources/data/functionalstorage/recipes/compacting_drawer.json index 4f906313..adb81144 100644 --- a/src/generated/resources/data/functionalstorage/recipes/compacting_drawer.json +++ b/src/generated/resources/data/functionalstorage/recipes/compacting_drawer.json @@ -1,45 +1,32 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:compacting_drawer" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "functionalstorage:drawer" - }, - "I": { - "tag": "forge:ingots/iron" - }, - "P": { - "item": "minecraft:piston" - }, - "S": { - "item": "minecraft:stone" - } - }, - "pattern": [ - "SSS", - "PDP", - "SIS" - ], - "result": { - "item": "functionalstorage:compacting_drawer" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:compacting_drawer" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "functionalstorage:drawer" + }, + "I": { + "tag": "forge:ingots/iron" + }, + "P": { + "item": "minecraft:piston" + }, + "S": { + "item": "minecraft:stone" + } + }, + "pattern": [ + "SSS", + "PDP", + "SIS" + ], + "result": { + "item": "functionalstorage:compacting_drawer" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/compacting_framed_drawer.json b/src/generated/resources/data/functionalstorage/recipes/compacting_framed_drawer.json index 5c58e9fb..06ecce57 100644 --- a/src/generated/resources/data/functionalstorage/recipes/compacting_framed_drawer.json +++ b/src/generated/resources/data/functionalstorage/recipes/compacting_framed_drawer.json @@ -1,45 +1,32 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:compacting_framed_drawer" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "functionalstorage:drawer" - }, - "I": { - "tag": "forge:ingots/iron" - }, - "P": { - "item": "minecraft:piston" - }, - "S": { - "item": "minecraft:iron_nugget" - } - }, - "pattern": [ - "SSS", - "PDP", - "SIS" - ], - "result": { - "item": "functionalstorage:compacting_framed_drawer" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:compacting_framed_drawer" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "functionalstorage:drawer" + }, + "I": { + "tag": "forge:ingots/iron" + }, + "P": { + "item": "minecraft:piston" + }, + "S": { + "item": "minecraft:iron_nugget" + } + }, + "pattern": [ + "SSS", + "PDP", + "SIS" + ], + "result": { + "item": "functionalstorage:compacting_framed_drawer" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/configuration_tool.json b/src/generated/resources/data/functionalstorage/recipes/configuration_tool.json index 4405a060..7fad5bad 100644 --- a/src/generated/resources/data/functionalstorage/recipes/configuration_tool.json +++ b/src/generated/resources/data/functionalstorage/recipes/configuration_tool.json @@ -1,45 +1,32 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:configuration_tool" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "functionalstorage:drawer" - }, - "E": { - "item": "minecraft:emerald" - }, - "G": { - "tag": "forge:ingots/gold" - }, - "P": { - "item": "minecraft:paper" - } - }, - "pattern": [ - "PPG", - "PDG", - "PEP" - ], - "result": { - "item": "functionalstorage:configuration_tool" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:configuration_tool" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "functionalstorage:drawer" + }, + "E": { + "item": "minecraft:emerald" + }, + "G": { + "tag": "forge:ingots/gold" + }, + "P": { + "item": "minecraft:paper" + } + }, + "pattern": [ + "PPG", + "PDG", + "PEP" + ], + "result": { + "item": "functionalstorage:configuration_tool" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/controller_extension.json b/src/generated/resources/data/functionalstorage/recipes/controller_extension.json index c33eb9cc..fafc065e 100644 --- a/src/generated/resources/data/functionalstorage/recipes/controller_extension.json +++ b/src/generated/resources/data/functionalstorage/recipes/controller_extension.json @@ -1,45 +1,32 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:controller_extension" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "B": { - "tag": "forge:storage_blocks/quartz" - }, - "C": { - "tag": "functionalstorage:drawer" - }, - "D": { - "item": "minecraft:repeater" - }, - "I": { - "tag": "forge:stone" - } - }, - "pattern": [ - "IBI", - "CDC", - "IBI" - ], - "result": { - "item": "functionalstorage:controller_extension" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:controller_extension" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "B": { + "tag": "forge:storage_blocks/quartz" + }, + "C": { + "tag": "functionalstorage:drawer" + }, + "D": { + "item": "minecraft:repeater" + }, + "I": { + "tag": "forge:stone" + } + }, + "pattern": [ + "IBI", + "CDC", + "IBI" + ], + "result": { + "item": "functionalstorage:controller_extension" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/copper_upgrade.json b/src/generated/resources/data/functionalstorage/recipes/copper_upgrade.json index 0ed9cee6..4ef5b225 100644 --- a/src/generated/resources/data/functionalstorage/recipes/copper_upgrade.json +++ b/src/generated/resources/data/functionalstorage/recipes/copper_upgrade.json @@ -1,45 +1,32 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:copper_upgrade" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "B": { - "item": "minecraft:copper_block" - }, - "C": { - "tag": "forge:chests/wooden" - }, - "D": { - "tag": "functionalstorage:drawer" - }, - "I": { - "item": "minecraft:copper_ingot" - } - }, - "pattern": [ - "IBI", - "CDC", - "IBI" - ], - "result": { - "item": "functionalstorage:copper_upgrade" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:copper_upgrade" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "B": { + "item": "minecraft:copper_block" + }, + "C": { + "tag": "forge:chests/wooden" + }, + "D": { + "tag": "functionalstorage:drawer" + }, + "I": { + "item": "minecraft:copper_ingot" + } + }, + "pattern": [ + "IBI", + "CDC", + "IBI" + ], + "result": { + "item": "functionalstorage:copper_upgrade" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/crimson_1.json b/src/generated/resources/data/functionalstorage/recipes/crimson_1.json index be8f62c2..499eb8a7 100644 --- a/src/generated/resources/data/functionalstorage/recipes/crimson_1.json +++ b/src/generated/resources/data/functionalstorage/recipes/crimson_1.json @@ -1,39 +1,26 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:crimson_1" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:crimson_planks" - } - }, - "pattern": [ - "PPP", - "PCP", - "PPP" - ], - "result": { - "item": "functionalstorage:crimson_1" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:crimson_1" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:crimson_planks" + } + }, + "pattern": [ + "PPP", + "PCP", + "PPP" + ], + "result": { + "item": "functionalstorage:crimson_1" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/crimson_2.json b/src/generated/resources/data/functionalstorage/recipes/crimson_2.json index a56ef6f6..4858f58b 100644 --- a/src/generated/resources/data/functionalstorage/recipes/crimson_2.json +++ b/src/generated/resources/data/functionalstorage/recipes/crimson_2.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:crimson_2" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:crimson_planks" - } - }, - "pattern": [ - "PCP", - "PPP", - "PCP" - ], - "result": { - "count": 2, - "item": "functionalstorage:crimson_2" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:crimson_2" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:crimson_planks" + } + }, + "pattern": [ + "PCP", + "PPP", + "PCP" + ], + "result": { + "count": 2, + "item": "functionalstorage:crimson_2" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/crimson_4.json b/src/generated/resources/data/functionalstorage/recipes/crimson_4.json index 5ddbd705..9ccb20f6 100644 --- a/src/generated/resources/data/functionalstorage/recipes/crimson_4.json +++ b/src/generated/resources/data/functionalstorage/recipes/crimson_4.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:crimson_4" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:crimson_planks" - } - }, - "pattern": [ - "CPC", - "PPP", - "CPC" - ], - "result": { - "count": 4, - "item": "functionalstorage:crimson_4" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:crimson_4" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:crimson_planks" + } + }, + "pattern": [ + "CPC", + "PPP", + "CPC" + ], + "result": { + "count": 4, + "item": "functionalstorage:crimson_4" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/custom_compacting/clay.json b/src/generated/resources/data/functionalstorage/recipes/custom_compacting/clay.json deleted file mode 100644 index 892ee345..00000000 --- a/src/generated/resources/data/functionalstorage/recipes/custom_compacting/clay.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "type": "functionalstorage:custom_compacting", - "higher_input": { - "count": 1, - "item": "minecraft:clay" - }, - "lower_input": { - "count": 4, - "item": "minecraft:clay_ball" - } -} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/dark_oak_1.json b/src/generated/resources/data/functionalstorage/recipes/dark_oak_1.json index 717797a6..372862fb 100644 --- a/src/generated/resources/data/functionalstorage/recipes/dark_oak_1.json +++ b/src/generated/resources/data/functionalstorage/recipes/dark_oak_1.json @@ -1,39 +1,26 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:dark_oak_1" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:dark_oak_planks" - } - }, - "pattern": [ - "PPP", - "PCP", - "PPP" - ], - "result": { - "item": "functionalstorage:dark_oak_1" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:dark_oak_1" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:dark_oak_planks" + } + }, + "pattern": [ + "PPP", + "PCP", + "PPP" + ], + "result": { + "item": "functionalstorage:dark_oak_1" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/dark_oak_2.json b/src/generated/resources/data/functionalstorage/recipes/dark_oak_2.json index e9a7b95b..1b79aedc 100644 --- a/src/generated/resources/data/functionalstorage/recipes/dark_oak_2.json +++ b/src/generated/resources/data/functionalstorage/recipes/dark_oak_2.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:dark_oak_2" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:dark_oak_planks" - } - }, - "pattern": [ - "PCP", - "PPP", - "PCP" - ], - "result": { - "count": 2, - "item": "functionalstorage:dark_oak_2" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:dark_oak_2" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:dark_oak_planks" + } + }, + "pattern": [ + "PCP", + "PPP", + "PCP" + ], + "result": { + "count": 2, + "item": "functionalstorage:dark_oak_2" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/dark_oak_4.json b/src/generated/resources/data/functionalstorage/recipes/dark_oak_4.json index cfa43d4a..ea7d6419 100644 --- a/src/generated/resources/data/functionalstorage/recipes/dark_oak_4.json +++ b/src/generated/resources/data/functionalstorage/recipes/dark_oak_4.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:dark_oak_4" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:dark_oak_planks" - } - }, - "pattern": [ - "CPC", - "PPP", - "CPC" - ], - "result": { - "count": 4, - "item": "functionalstorage:dark_oak_4" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:dark_oak_4" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:dark_oak_planks" + } + }, + "pattern": [ + "CPC", + "PPP", + "CPC" + ], + "result": { + "count": 4, + "item": "functionalstorage:dark_oak_4" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/diamond_upgrade.json b/src/generated/resources/data/functionalstorage/recipes/diamond_upgrade.json index 4980fd3c..bfbd6763 100644 --- a/src/generated/resources/data/functionalstorage/recipes/diamond_upgrade.json +++ b/src/generated/resources/data/functionalstorage/recipes/diamond_upgrade.json @@ -1,45 +1,32 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:diamond_upgrade" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "B": { - "tag": "forge:storage_blocks/diamond" - }, - "C": { - "tag": "forge:chests/wooden" - }, - "D": { - "item": "functionalstorage:gold_upgrade" - }, - "I": { - "tag": "forge:gems/diamond" - } - }, - "pattern": [ - "IBI", - "CDC", - "IBI" - ], - "result": { - "item": "functionalstorage:diamond_upgrade" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:diamond_upgrade" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "B": { + "tag": "forge:storage_blocks/diamond" + }, + "C": { + "tag": "forge:chests/wooden" + }, + "D": { + "item": "functionalstorage:gold_upgrade" + }, + "I": { + "tag": "forge:gems/diamond" + } + }, + "pattern": [ + "IBI", + "CDC", + "IBI" + ], + "result": { + "item": "functionalstorage:diamond_upgrade" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/ender_drawer.json b/src/generated/resources/data/functionalstorage/recipes/ender_drawer.json index 8bcf18de..1941d15a 100644 --- a/src/generated/resources/data/functionalstorage/recipes/ender_drawer.json +++ b/src/generated/resources/data/functionalstorage/recipes/ender_drawer.json @@ -1,42 +1,29 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:ender_drawer" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/ender" - }, - "L": { - "tag": "functionalstorage:drawer" - }, - "P": { - "tag": "minecraft:planks" - } - }, - "pattern": [ - "PPP", - "LCL", - "PPP" - ], - "result": { - "item": "functionalstorage:ender_drawer" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:ender_drawer" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/ender" + }, + "L": { + "tag": "functionalstorage:drawer" + }, + "P": { + "tag": "minecraft:planks" + } + }, + "pattern": [ + "PPP", + "LCL", + "PPP" + ], + "result": { + "item": "functionalstorage:ender_drawer" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/fluid_1.json b/src/generated/resources/data/functionalstorage/recipes/fluid_1.json index 93600515..59b4d50c 100644 --- a/src/generated/resources/data/functionalstorage/recipes/fluid_1.json +++ b/src/generated/resources/data/functionalstorage/recipes/fluid_1.json @@ -1,39 +1,26 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:fluid_1" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "minecraft:bucket" - }, - "P": { - "tag": "minecraft:planks" - } - }, - "pattern": [ - "PPP", - "PCP", - "PPP" - ], - "result": { - "item": "functionalstorage:fluid_1" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:fluid_1" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "minecraft:bucket" + }, + "P": { + "tag": "minecraft:planks" + } + }, + "pattern": [ + "PPP", + "PCP", + "PPP" + ], + "result": { + "item": "functionalstorage:fluid_1" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/fluid_2.json b/src/generated/resources/data/functionalstorage/recipes/fluid_2.json index 820214ed..f7113b2c 100644 --- a/src/generated/resources/data/functionalstorage/recipes/fluid_2.json +++ b/src/generated/resources/data/functionalstorage/recipes/fluid_2.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:fluid_2" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "minecraft:bucket" - }, - "P": { - "tag": "minecraft:planks" - } - }, - "pattern": [ - "PCP", - "PPP", - "PCP" - ], - "result": { - "count": 2, - "item": "functionalstorage:fluid_2" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:fluid_2" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "minecraft:bucket" + }, + "P": { + "tag": "minecraft:planks" + } + }, + "pattern": [ + "PCP", + "PPP", + "PCP" + ], + "result": { + "count": 2, + "item": "functionalstorage:fluid_2" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/fluid_4.json b/src/generated/resources/data/functionalstorage/recipes/fluid_4.json index d464e183..58204ce1 100644 --- a/src/generated/resources/data/functionalstorage/recipes/fluid_4.json +++ b/src/generated/resources/data/functionalstorage/recipes/fluid_4.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:fluid_4" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "minecraft:bucket" - }, - "P": { - "tag": "minecraft:planks" - } - }, - "pattern": [ - "CPC", - "PPP", - "CPC" - ], - "result": { - "count": 4, - "item": "functionalstorage:fluid_4" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:fluid_4" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "minecraft:bucket" + }, + "P": { + "tag": "minecraft:planks" + } + }, + "pattern": [ + "CPC", + "PPP", + "CPC" + ], + "result": { + "count": 4, + "item": "functionalstorage:fluid_4" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/framed_1.json b/src/generated/resources/data/functionalstorage/recipes/framed_1.json index 67c60ead..6bb970d7 100644 --- a/src/generated/resources/data/functionalstorage/recipes/framed_1.json +++ b/src/generated/resources/data/functionalstorage/recipes/framed_1.json @@ -1,39 +1,26 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:framed_1" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:iron_nugget" - } - }, - "pattern": [ - "PPP", - "PCP", - "PPP" - ], - "result": { - "item": "functionalstorage:framed_1" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:framed_1" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:iron_nugget" + } + }, + "pattern": [ + "PPP", + "PCP", + "PPP" + ], + "result": { + "item": "functionalstorage:framed_1" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/framed_2.json b/src/generated/resources/data/functionalstorage/recipes/framed_2.json index 55720fb0..adf56d9c 100644 --- a/src/generated/resources/data/functionalstorage/recipes/framed_2.json +++ b/src/generated/resources/data/functionalstorage/recipes/framed_2.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:framed_2" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:iron_nugget" - } - }, - "pattern": [ - "PCP", - "PPP", - "PCP" - ], - "result": { - "count": 2, - "item": "functionalstorage:framed_2" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:framed_2" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:iron_nugget" + } + }, + "pattern": [ + "PCP", + "PPP", + "PCP" + ], + "result": { + "count": 2, + "item": "functionalstorage:framed_2" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/framed_4.json b/src/generated/resources/data/functionalstorage/recipes/framed_4.json index 578b3e3a..4731de99 100644 --- a/src/generated/resources/data/functionalstorage/recipes/framed_4.json +++ b/src/generated/resources/data/functionalstorage/recipes/framed_4.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:framed_4" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:iron_nugget" - } - }, - "pattern": [ - "CPC", - "PPP", - "CPC" - ], - "result": { - "count": 4, - "item": "functionalstorage:framed_4" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:framed_4" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:iron_nugget" + } + }, + "pattern": [ + "CPC", + "PPP", + "CPC" + ], + "result": { + "count": 4, + "item": "functionalstorage:framed_4" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/framed_controller_extension.json b/src/generated/resources/data/functionalstorage/recipes/framed_controller_extension.json index 25b69069..7efc2472 100644 --- a/src/generated/resources/data/functionalstorage/recipes/framed_controller_extension.json +++ b/src/generated/resources/data/functionalstorage/recipes/framed_controller_extension.json @@ -1,45 +1,32 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:framed_controller_extension" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "B": { - "tag": "forge:storage_blocks/quartz" - }, - "C": { - "tag": "functionalstorage:drawer" - }, - "D": { - "item": "minecraft:repeater" - }, - "I": { - "item": "minecraft:iron_nugget" - } - }, - "pattern": [ - "IBI", - "CDC", - "IBI" - ], - "result": { - "item": "functionalstorage:framed_controller_extension" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:framed_controller_extension" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "B": { + "tag": "forge:storage_blocks/quartz" + }, + "C": { + "tag": "functionalstorage:drawer" + }, + "D": { + "item": "minecraft:repeater" + }, + "I": { + "item": "minecraft:iron_nugget" + } + }, + "pattern": [ + "IBI", + "CDC", + "IBI" + ], + "result": { + "item": "functionalstorage:framed_controller_extension" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/framed_simple_compacting_drawer.json b/src/generated/resources/data/functionalstorage/recipes/framed_simple_compacting_drawer.json index dd960697..ed91529b 100644 --- a/src/generated/resources/data/functionalstorage/recipes/framed_simple_compacting_drawer.json +++ b/src/generated/resources/data/functionalstorage/recipes/framed_simple_compacting_drawer.json @@ -1,45 +1,32 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:framed_simple_compacting_drawer" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "functionalstorage:drawer" - }, - "I": { - "tag": "forge:ingots/iron" - }, - "P": { - "item": "minecraft:piston" - }, - "S": { - "item": "minecraft:iron_nugget" - } - }, - "pattern": [ - "SSS", - "SDP", - "SIS" - ], - "result": { - "item": "functionalstorage:framed_simple_compacting_drawer" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:framed_simple_compacting_drawer" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "functionalstorage:drawer" + }, + "I": { + "tag": "forge:ingots/iron" + }, + "P": { + "item": "minecraft:piston" + }, + "S": { + "item": "minecraft:iron_nugget" + } + }, + "pattern": [ + "SSS", + "SDP", + "SIS" + ], + "result": { + "item": "functionalstorage:framed_simple_compacting_drawer" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/framed_storage_controller.json b/src/generated/resources/data/functionalstorage/recipes/framed_storage_controller.json index 75aeb358..d7f9eaa0 100644 --- a/src/generated/resources/data/functionalstorage/recipes/framed_storage_controller.json +++ b/src/generated/resources/data/functionalstorage/recipes/framed_storage_controller.json @@ -1,45 +1,32 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:framed_storage_controller" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "B": { - "tag": "forge:storage_blocks/quartz" - }, - "C": { - "tag": "functionalstorage:drawer" - }, - "D": { - "item": "minecraft:comparator" - }, - "I": { - "item": "minecraft:iron_nugget" - } - }, - "pattern": [ - "IBI", - "CDC", - "IBI" - ], - "result": { - "item": "functionalstorage:framed_storage_controller" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:framed_storage_controller" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "B": { + "tag": "forge:storage_blocks/quartz" + }, + "C": { + "tag": "functionalstorage:drawer" + }, + "D": { + "item": "minecraft:comparator" + }, + "I": { + "item": "minecraft:iron_nugget" + } + }, + "pattern": [ + "IBI", + "CDC", + "IBI" + ], + "result": { + "item": "functionalstorage:framed_storage_controller" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/gold_upgrade.json b/src/generated/resources/data/functionalstorage/recipes/gold_upgrade.json index 1d289796..103ec755 100644 --- a/src/generated/resources/data/functionalstorage/recipes/gold_upgrade.json +++ b/src/generated/resources/data/functionalstorage/recipes/gold_upgrade.json @@ -1,45 +1,32 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:gold_upgrade" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "B": { - "tag": "forge:storage_blocks/gold" - }, - "C": { - "tag": "forge:chests/wooden" - }, - "D": { - "item": "functionalstorage:copper_upgrade" - }, - "I": { - "tag": "forge:ingots/gold" - } - }, - "pattern": [ - "IBI", - "CDC", - "BIB" - ], - "result": { - "item": "functionalstorage:gold_upgrade" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:gold_upgrade" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "B": { + "tag": "forge:storage_blocks/gold" + }, + "C": { + "tag": "forge:chests/wooden" + }, + "D": { + "item": "functionalstorage:copper_upgrade" + }, + "I": { + "tag": "forge:ingots/gold" + } + }, + "pattern": [ + "IBI", + "CDC", + "BIB" + ], + "result": { + "item": "functionalstorage:gold_upgrade" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/iron_downgrade.json b/src/generated/resources/data/functionalstorage/recipes/iron_downgrade.json index e780272d..be63a129 100644 --- a/src/generated/resources/data/functionalstorage/recipes/iron_downgrade.json +++ b/src/generated/resources/data/functionalstorage/recipes/iron_downgrade.json @@ -1,39 +1,26 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:iron_downgrade" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "functionalstorage:drawer" - }, - "I": { - "tag": "forge:ingots/iron" - } - }, - "pattern": [ - "III", - "IDI", - "III" - ], - "result": { - "item": "functionalstorage:iron_downgrade" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:iron_downgrade" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "functionalstorage:drawer" + }, + "I": { + "tag": "forge:ingots/iron" + } + }, + "pattern": [ + "III", + "IDI", + "III" + ], + "result": { + "item": "functionalstorage:iron_downgrade" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/jungle_1.json b/src/generated/resources/data/functionalstorage/recipes/jungle_1.json index 6b37be4d..707ffbac 100644 --- a/src/generated/resources/data/functionalstorage/recipes/jungle_1.json +++ b/src/generated/resources/data/functionalstorage/recipes/jungle_1.json @@ -1,39 +1,26 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:jungle_1" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:jungle_planks" - } - }, - "pattern": [ - "PPP", - "PCP", - "PPP" - ], - "result": { - "item": "functionalstorage:jungle_1" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:jungle_1" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:jungle_planks" + } + }, + "pattern": [ + "PPP", + "PCP", + "PPP" + ], + "result": { + "item": "functionalstorage:jungle_1" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/jungle_2.json b/src/generated/resources/data/functionalstorage/recipes/jungle_2.json index 4690a3c8..a898f74c 100644 --- a/src/generated/resources/data/functionalstorage/recipes/jungle_2.json +++ b/src/generated/resources/data/functionalstorage/recipes/jungle_2.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:jungle_2" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:jungle_planks" - } - }, - "pattern": [ - "PCP", - "PPP", - "PCP" - ], - "result": { - "count": 2, - "item": "functionalstorage:jungle_2" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:jungle_2" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:jungle_planks" + } + }, + "pattern": [ + "PCP", + "PPP", + "PCP" + ], + "result": { + "count": 2, + "item": "functionalstorage:jungle_2" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/jungle_4.json b/src/generated/resources/data/functionalstorage/recipes/jungle_4.json index c983298f..00734ad3 100644 --- a/src/generated/resources/data/functionalstorage/recipes/jungle_4.json +++ b/src/generated/resources/data/functionalstorage/recipes/jungle_4.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:jungle_4" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:jungle_planks" - } - }, - "pattern": [ - "CPC", - "PPP", - "CPC" - ], - "result": { - "count": 4, - "item": "functionalstorage:jungle_4" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:jungle_4" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:jungle_planks" + } + }, + "pattern": [ + "CPC", + "PPP", + "CPC" + ], + "result": { + "count": 4, + "item": "functionalstorage:jungle_4" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/linking_tool.json b/src/generated/resources/data/functionalstorage/recipes/linking_tool.json index 6d269f9d..aa950547 100644 --- a/src/generated/resources/data/functionalstorage/recipes/linking_tool.json +++ b/src/generated/resources/data/functionalstorage/recipes/linking_tool.json @@ -1,45 +1,32 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:linking_tool" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "functionalstorage:drawer" - }, - "E": { - "item": "minecraft:diamond" - }, - "G": { - "tag": "forge:ingots/gold" - }, - "P": { - "item": "minecraft:paper" - } - }, - "pattern": [ - "PPG", - "PDG", - "PEP" - ], - "result": { - "item": "functionalstorage:linking_tool" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:linking_tool" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "functionalstorage:drawer" + }, + "E": { + "item": "minecraft:diamond" + }, + "G": { + "tag": "forge:ingots/gold" + }, + "P": { + "item": "minecraft:paper" + } + }, + "pattern": [ + "PPG", + "PDG", + "PEP" + ], + "result": { + "item": "functionalstorage:linking_tool" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/mangrove_1.json b/src/generated/resources/data/functionalstorage/recipes/mangrove_1.json index 51beba7d..69f4322d 100644 --- a/src/generated/resources/data/functionalstorage/recipes/mangrove_1.json +++ b/src/generated/resources/data/functionalstorage/recipes/mangrove_1.json @@ -1,39 +1,26 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:mangrove_1" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:mangrove_planks" - } - }, - "pattern": [ - "PPP", - "PCP", - "PPP" - ], - "result": { - "item": "functionalstorage:mangrove_1" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:mangrove_1" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:mangrove_planks" + } + }, + "pattern": [ + "PPP", + "PCP", + "PPP" + ], + "result": { + "item": "functionalstorage:mangrove_1" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/mangrove_2.json b/src/generated/resources/data/functionalstorage/recipes/mangrove_2.json index 7cb544bc..7242f89d 100644 --- a/src/generated/resources/data/functionalstorage/recipes/mangrove_2.json +++ b/src/generated/resources/data/functionalstorage/recipes/mangrove_2.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:mangrove_2" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:mangrove_planks" - } - }, - "pattern": [ - "PCP", - "PPP", - "PCP" - ], - "result": { - "count": 2, - "item": "functionalstorage:mangrove_2" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:mangrove_2" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:mangrove_planks" + } + }, + "pattern": [ + "PCP", + "PPP", + "PCP" + ], + "result": { + "count": 2, + "item": "functionalstorage:mangrove_2" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/mangrove_4.json b/src/generated/resources/data/functionalstorage/recipes/mangrove_4.json index df47a6ca..a5590628 100644 --- a/src/generated/resources/data/functionalstorage/recipes/mangrove_4.json +++ b/src/generated/resources/data/functionalstorage/recipes/mangrove_4.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:mangrove_4" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:mangrove_planks" - } - }, - "pattern": [ - "CPC", - "PPP", - "CPC" - ], - "result": { - "count": 4, - "item": "functionalstorage:mangrove_4" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:mangrove_4" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:mangrove_planks" + } + }, + "pattern": [ + "CPC", + "PPP", + "CPC" + ], + "result": { + "count": 4, + "item": "functionalstorage:mangrove_4" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/oak_1.json b/src/generated/resources/data/functionalstorage/recipes/oak_1.json index 972eeaa6..54cb95b2 100644 --- a/src/generated/resources/data/functionalstorage/recipes/oak_1.json +++ b/src/generated/resources/data/functionalstorage/recipes/oak_1.json @@ -1,39 +1,26 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:oak_1" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:oak_planks" - } - }, - "pattern": [ - "PPP", - "PCP", - "PPP" - ], - "result": { - "item": "functionalstorage:oak_1" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:oak_1" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "type": "functionalstorage:woodless" + } + }, + "pattern": [ + "PPP", + "PCP", + "PPP" + ], + "result": { + "item": "functionalstorage:oak_1" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/oak_2.json b/src/generated/resources/data/functionalstorage/recipes/oak_2.json index cd471f21..3892da10 100644 --- a/src/generated/resources/data/functionalstorage/recipes/oak_2.json +++ b/src/generated/resources/data/functionalstorage/recipes/oak_2.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:oak_2" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:oak_planks" - } - }, - "pattern": [ - "PCP", - "PPP", - "PCP" - ], - "result": { - "count": 2, - "item": "functionalstorage:oak_2" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:oak_2" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "type": "functionalstorage:woodless" + } + }, + "pattern": [ + "PCP", + "PPP", + "PCP" + ], + "result": { + "count": 2, + "item": "functionalstorage:oak_2" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/oak_4.json b/src/generated/resources/data/functionalstorage/recipes/oak_4.json index 9cfd9364..3651b0b7 100644 --- a/src/generated/resources/data/functionalstorage/recipes/oak_4.json +++ b/src/generated/resources/data/functionalstorage/recipes/oak_4.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:oak_4" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:oak_planks" - } - }, - "pattern": [ - "CPC", - "PPP", - "CPC" - ], - "result": { - "count": 4, - "item": "functionalstorage:oak_4" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:oak_4" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "type": "functionalstorage:woodless" + } + }, + "pattern": [ + "CPC", + "PPP", + "CPC" + ], + "result": { + "count": 4, + "item": "functionalstorage:oak_4" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/oak_drawer_alternate_x1.json b/src/generated/resources/data/functionalstorage/recipes/oak_drawer_alternate_x1.json deleted file mode 100644 index d91c8733..00000000 --- a/src/generated/resources/data/functionalstorage/recipes/oak_drawer_alternate_x1.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "type": "forge:conditional", - "recipes": [ - { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:oak_1" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "type": "functionalstorage:woodless" - } - }, - "pattern": [ - "PPP", - "PCP", - "PPP" - ], - "result": { - "item": "functionalstorage:oak_1" - }, - "show_notification": true - } - } - ] -} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/oak_drawer_alternate_x2.json b/src/generated/resources/data/functionalstorage/recipes/oak_drawer_alternate_x2.json deleted file mode 100644 index 46a82bd7..00000000 --- a/src/generated/resources/data/functionalstorage/recipes/oak_drawer_alternate_x2.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "type": "forge:conditional", - "recipes": [ - { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:oak_2" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "type": "functionalstorage:woodless" - } - }, - "pattern": [ - "PCP", - "PPP", - "PCP" - ], - "result": { - "count": 2, - "item": "functionalstorage:oak_2" - }, - "show_notification": true - } - } - ] -} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/oak_drawer_alternate_x4.json b/src/generated/resources/data/functionalstorage/recipes/oak_drawer_alternate_x4.json deleted file mode 100644 index a9629e56..00000000 --- a/src/generated/resources/data/functionalstorage/recipes/oak_drawer_alternate_x4.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "type": "forge:conditional", - "recipes": [ - { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:oak_4" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "type": "functionalstorage:woodless" - } - }, - "pattern": [ - "CPC", - "PPP", - "CPC" - ], - "result": { - "count": 4, - "item": "functionalstorage:oak_4" - }, - "show_notification": true - } - } - ] -} \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/puller_upgrade.json b/src/generated/resources/data/functionalstorage/recipes/puller_upgrade.json index 6eb464bc..7861c62c 100644 --- a/src/generated/resources/data/functionalstorage/recipes/puller_upgrade.json +++ b/src/generated/resources/data/functionalstorage/recipes/puller_upgrade.json @@ -1,45 +1,32 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:puller_upgrade" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "B": { - "tag": "forge:dusts/redstone" - }, - "C": { - "item": "minecraft:hopper" - }, - "D": { - "tag": "functionalstorage:drawer" - }, - "I": { - "tag": "forge:stone" - } - }, - "pattern": [ - "ICI", - "IDI", - "IBI" - ], - "result": { - "item": "functionalstorage:puller_upgrade" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:puller_upgrade" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "B": { + "tag": "forge:dusts/redstone" + }, + "C": { + "item": "minecraft:hopper" + }, + "D": { + "tag": "functionalstorage:drawer" + }, + "I": { + "tag": "forge:stone" + } + }, + "pattern": [ + "ICI", + "IDI", + "IBI" + ], + "result": { + "item": "functionalstorage:puller_upgrade" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/pusher_upgrade.json b/src/generated/resources/data/functionalstorage/recipes/pusher_upgrade.json index 8504461d..bcfd3491 100644 --- a/src/generated/resources/data/functionalstorage/recipes/pusher_upgrade.json +++ b/src/generated/resources/data/functionalstorage/recipes/pusher_upgrade.json @@ -1,45 +1,32 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:pusher_upgrade" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "B": { - "tag": "forge:dusts/redstone" - }, - "D": { - "tag": "functionalstorage:drawer" - }, - "I": { - "tag": "forge:stone" - }, - "R": { - "item": "minecraft:hopper" - } - }, - "pattern": [ - "IBI", - "IDI", - "IRI" - ], - "result": { - "item": "functionalstorage:pusher_upgrade" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:pusher_upgrade" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "B": { + "tag": "forge:dusts/redstone" + }, + "D": { + "tag": "functionalstorage:drawer" + }, + "I": { + "tag": "forge:stone" + }, + "R": { + "item": "minecraft:hopper" + } + }, + "pattern": [ + "IBI", + "IDI", + "IRI" + ], + "result": { + "item": "functionalstorage:pusher_upgrade" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/redstone_upgrade.json b/src/generated/resources/data/functionalstorage/recipes/redstone_upgrade.json index cc739a8c..1fd9c198 100644 --- a/src/generated/resources/data/functionalstorage/recipes/redstone_upgrade.json +++ b/src/generated/resources/data/functionalstorage/recipes/redstone_upgrade.json @@ -1,45 +1,32 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:redstone_upgrade" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "B": { - "item": "minecraft:redstone_block" - }, - "C": { - "item": "minecraft:comparator" - }, - "D": { - "tag": "functionalstorage:drawer" - }, - "I": { - "item": "minecraft:redstone" - } - }, - "pattern": [ - "IBI", - "CDC", - "IBI" - ], - "result": { - "item": "functionalstorage:redstone_upgrade" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:redstone_upgrade" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "B": { + "item": "minecraft:redstone_block" + }, + "C": { + "item": "minecraft:comparator" + }, + "D": { + "tag": "functionalstorage:drawer" + }, + "I": { + "item": "minecraft:redstone" + } + }, + "pattern": [ + "IBI", + "CDC", + "IBI" + ], + "result": { + "item": "functionalstorage:redstone_upgrade" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/simple_compacting_drawer.json b/src/generated/resources/data/functionalstorage/recipes/simple_compacting_drawer.json index 342cc6e2..952bd933 100644 --- a/src/generated/resources/data/functionalstorage/recipes/simple_compacting_drawer.json +++ b/src/generated/resources/data/functionalstorage/recipes/simple_compacting_drawer.json @@ -1,45 +1,32 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:simple_compacting_drawer" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "functionalstorage:drawer" - }, - "I": { - "tag": "forge:ingots/iron" - }, - "P": { - "item": "minecraft:piston" - }, - "S": { - "item": "minecraft:stone" - } - }, - "pattern": [ - "SSS", - "SDP", - "SIS" - ], - "result": { - "item": "functionalstorage:simple_compacting_drawer" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:simple_compacting_drawer" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "functionalstorage:drawer" + }, + "I": { + "tag": "forge:ingots/iron" + }, + "P": { + "item": "minecraft:piston" + }, + "S": { + "item": "minecraft:stone" + } + }, + "pattern": [ + "SSS", + "SDP", + "SIS" + ], + "result": { + "item": "functionalstorage:simple_compacting_drawer" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/spruce_1.json b/src/generated/resources/data/functionalstorage/recipes/spruce_1.json index 2848d38a..4510aee1 100644 --- a/src/generated/resources/data/functionalstorage/recipes/spruce_1.json +++ b/src/generated/resources/data/functionalstorage/recipes/spruce_1.json @@ -1,39 +1,26 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:spruce_1" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:spruce_planks" - } - }, - "pattern": [ - "PPP", - "PCP", - "PPP" - ], - "result": { - "item": "functionalstorage:spruce_1" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:spruce_1" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:spruce_planks" + } + }, + "pattern": [ + "PPP", + "PCP", + "PPP" + ], + "result": { + "item": "functionalstorage:spruce_1" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/spruce_2.json b/src/generated/resources/data/functionalstorage/recipes/spruce_2.json index 4e5cc9d6..c5fad6a1 100644 --- a/src/generated/resources/data/functionalstorage/recipes/spruce_2.json +++ b/src/generated/resources/data/functionalstorage/recipes/spruce_2.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:spruce_2" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:spruce_planks" - } - }, - "pattern": [ - "PCP", - "PPP", - "PCP" - ], - "result": { - "count": 2, - "item": "functionalstorage:spruce_2" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:spruce_2" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:spruce_planks" + } + }, + "pattern": [ + "PCP", + "PPP", + "PCP" + ], + "result": { + "count": 2, + "item": "functionalstorage:spruce_2" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/spruce_4.json b/src/generated/resources/data/functionalstorage/recipes/spruce_4.json index 06839516..58c588b8 100644 --- a/src/generated/resources/data/functionalstorage/recipes/spruce_4.json +++ b/src/generated/resources/data/functionalstorage/recipes/spruce_4.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:spruce_4" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:spruce_planks" - } - }, - "pattern": [ - "CPC", - "PPP", - "CPC" - ], - "result": { - "count": 4, - "item": "functionalstorage:spruce_4" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:spruce_4" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:spruce_planks" + } + }, + "pattern": [ + "CPC", + "PPP", + "CPC" + ], + "result": { + "count": 4, + "item": "functionalstorage:spruce_4" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/storage_controller.json b/src/generated/resources/data/functionalstorage/recipes/storage_controller.json index 390ad4f9..07419ca3 100644 --- a/src/generated/resources/data/functionalstorage/recipes/storage_controller.json +++ b/src/generated/resources/data/functionalstorage/recipes/storage_controller.json @@ -1,45 +1,32 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:storage_controller" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "B": { - "tag": "forge:storage_blocks/quartz" - }, - "C": { - "tag": "functionalstorage:drawer" - }, - "D": { - "item": "minecraft:comparator" - }, - "I": { - "tag": "forge:stone" - } - }, - "pattern": [ - "IBI", - "CDC", - "IBI" - ], - "result": { - "item": "functionalstorage:storage_controller" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:storage_controller" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "B": { + "tag": "forge:storage_blocks/quartz" + }, + "C": { + "tag": "functionalstorage:drawer" + }, + "D": { + "item": "minecraft:comparator" + }, + "I": { + "tag": "forge:stone" + } + }, + "pattern": [ + "IBI", + "CDC", + "IBI" + ], + "result": { + "item": "functionalstorage:storage_controller" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/void_upgrade.json b/src/generated/resources/data/functionalstorage/recipes/void_upgrade.json index 2c03ed46..11c960c4 100644 --- a/src/generated/resources/data/functionalstorage/recipes/void_upgrade.json +++ b/src/generated/resources/data/functionalstorage/recipes/void_upgrade.json @@ -1,39 +1,26 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:void_upgrade" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "functionalstorage:drawer" - }, - "I": { - "tag": "forge:obsidian" - } - }, - "pattern": [ - "III", - "IDI", - "III" - ], - "result": { - "item": "functionalstorage:void_upgrade" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:void_upgrade" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "functionalstorage:drawer" + }, + "I": { + "tag": "forge:obsidian" + } + }, + "pattern": [ + "III", + "IDI", + "III" + ], + "result": { + "item": "functionalstorage:void_upgrade" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/warped_1.json b/src/generated/resources/data/functionalstorage/recipes/warped_1.json index d08394da..1cd750ae 100644 --- a/src/generated/resources/data/functionalstorage/recipes/warped_1.json +++ b/src/generated/resources/data/functionalstorage/recipes/warped_1.json @@ -1,39 +1,26 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:warped_1" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:warped_planks" - } - }, - "pattern": [ - "PPP", - "PCP", - "PPP" - ], - "result": { - "item": "functionalstorage:warped_1" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:warped_1" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:warped_planks" + } + }, + "pattern": [ + "PPP", + "PCP", + "PPP" + ], + "result": { + "item": "functionalstorage:warped_1" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/warped_2.json b/src/generated/resources/data/functionalstorage/recipes/warped_2.json index 0ba3ae18..5ced37c4 100644 --- a/src/generated/resources/data/functionalstorage/recipes/warped_2.json +++ b/src/generated/resources/data/functionalstorage/recipes/warped_2.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:warped_2" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:warped_planks" - } - }, - "pattern": [ - "PCP", - "PPP", - "PCP" - ], - "result": { - "count": 2, - "item": "functionalstorage:warped_2" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:warped_2" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:warped_planks" + } + }, + "pattern": [ + "PCP", + "PPP", + "PCP" + ], + "result": { + "count": 2, + "item": "functionalstorage:warped_2" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/warped_4.json b/src/generated/resources/data/functionalstorage/recipes/warped_4.json index 353cdf26..e420cf3c 100644 --- a/src/generated/resources/data/functionalstorage/recipes/warped_4.json +++ b/src/generated/resources/data/functionalstorage/recipes/warped_4.json @@ -1,40 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "forge:and", - "values": [ - { - "type": "forge:item_exists", - "item": "functionalstorage:warped_4" - } - ] - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "tag": "forge:chests/wooden" - }, - "P": { - "item": "minecraft:warped_planks" - } - }, - "pattern": [ - "CPC", - "PPP", - "CPC" - ], - "result": { - "count": 4, - "item": "functionalstorage:warped_4" - }, - "show_notification": true - } + "type": "neoforge:item_exists", + "item": "functionalstorage:warped_4" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "tag": "forge:chests/wooden" + }, + "P": { + "item": "minecraft:warped_planks" + } + }, + "pattern": [ + "CPC", + "PPP", + "CPC" + ], + "result": { + "count": 4, + "item": "functionalstorage:warped_4" + } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/tags/items/drawer.json b/src/generated/resources/data/functionalstorage/tags/items/drawer.json index e4ff1a1b..bb20db0b 100644 --- a/src/generated/resources/data/functionalstorage/tags/items/drawer.json +++ b/src/generated/resources/data/functionalstorage/tags/items/drawer.json @@ -1,16 +1,5 @@ { "values": [ - "functionalstorage:oak_2", - "functionalstorage:spruce_2", - "functionalstorage:birch_2", - "functionalstorage:jungle_2", - "functionalstorage:acacia_2", - "functionalstorage:dark_oak_2", - "functionalstorage:crimson_2", - "functionalstorage:warped_2", - "functionalstorage:mangrove_2", - "functionalstorage:cherry_2", - "functionalstorage:framed_2", "functionalstorage:oak_4", "functionalstorage:spruce_4", "functionalstorage:birch_4", @@ -22,6 +11,17 @@ "functionalstorage:mangrove_4", "functionalstorage:cherry_4", "functionalstorage:framed_4", + "functionalstorage:oak_2", + "functionalstorage:spruce_2", + "functionalstorage:birch_2", + "functionalstorage:jungle_2", + "functionalstorage:acacia_2", + "functionalstorage:dark_oak_2", + "functionalstorage:crimson_2", + "functionalstorage:warped_2", + "functionalstorage:mangrove_2", + "functionalstorage:cherry_2", + "functionalstorage:framed_2", "functionalstorage:oak_1", "functionalstorage:spruce_1", "functionalstorage:birch_1", diff --git a/src/generated/resources/data/functionalstorage/recipes/custom_compacting/amethyst.json b/src/generated/resources/data/minecraft/recipes/amethyst.json similarity index 92% rename from src/generated/resources/data/functionalstorage/recipes/custom_compacting/amethyst.json rename to src/generated/resources/data/minecraft/recipes/amethyst.json index f7fd2685..7cf19ea0 100644 --- a/src/generated/resources/data/functionalstorage/recipes/custom_compacting/amethyst.json +++ b/src/generated/resources/data/minecraft/recipes/amethyst.json @@ -1,7 +1,6 @@ { "type": "functionalstorage:custom_compacting", "higher_input": { - "count": 1, "item": "minecraft:amethyst_block" }, "lower_input": { diff --git a/src/generated/resources/data/functionalstorage/recipes/custom_compacting/ice.json b/src/generated/resources/data/minecraft/recipes/blue_ice.json similarity index 77% rename from src/generated/resources/data/functionalstorage/recipes/custom_compacting/ice.json rename to src/generated/resources/data/minecraft/recipes/blue_ice.json index 4b13a104..46ba85a2 100644 --- a/src/generated/resources/data/functionalstorage/recipes/custom_compacting/ice.json +++ b/src/generated/resources/data/minecraft/recipes/blue_ice.json @@ -1,11 +1,10 @@ { "type": "functionalstorage:custom_compacting", "higher_input": { - "count": 1, - "item": "minecraft:packed_ice" + "item": "minecraft:blue_ice" }, "lower_input": { "count": 9, - "item": "minecraft:ice" + "item": "minecraft:packed_ice" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/custom_compacting/glowstone.json b/src/generated/resources/data/minecraft/recipes/glowstone.json similarity index 92% rename from src/generated/resources/data/functionalstorage/recipes/custom_compacting/glowstone.json rename to src/generated/resources/data/minecraft/recipes/glowstone.json index ad792d87..37ad6b17 100644 --- a/src/generated/resources/data/functionalstorage/recipes/custom_compacting/glowstone.json +++ b/src/generated/resources/data/minecraft/recipes/glowstone.json @@ -1,7 +1,6 @@ { "type": "functionalstorage:custom_compacting", "higher_input": { - "count": 1, "item": "minecraft:glowstone" }, "lower_input": { diff --git a/src/generated/resources/data/functionalstorage/recipes/custom_compacting/melon.json b/src/generated/resources/data/minecraft/recipes/melon.json similarity index 91% rename from src/generated/resources/data/functionalstorage/recipes/custom_compacting/melon.json rename to src/generated/resources/data/minecraft/recipes/melon.json index 71eb8163..e48931bd 100644 --- a/src/generated/resources/data/functionalstorage/recipes/custom_compacting/melon.json +++ b/src/generated/resources/data/minecraft/recipes/melon.json @@ -1,7 +1,6 @@ { "type": "functionalstorage:custom_compacting", "higher_input": { - "count": 1, "item": "minecraft:melon" }, "lower_input": { diff --git a/src/generated/resources/data/functionalstorage/recipes/custom_compacting/packed_ice.json b/src/generated/resources/data/minecraft/recipes/packed_ice.json similarity index 75% rename from src/generated/resources/data/functionalstorage/recipes/custom_compacting/packed_ice.json rename to src/generated/resources/data/minecraft/recipes/packed_ice.json index 9ff67aad..1425fc4a 100644 --- a/src/generated/resources/data/functionalstorage/recipes/custom_compacting/packed_ice.json +++ b/src/generated/resources/data/minecraft/recipes/packed_ice.json @@ -1,11 +1,10 @@ { "type": "functionalstorage:custom_compacting", "higher_input": { - "count": 1, - "item": "minecraft:blue_ice" + "item": "minecraft:packed_ice" }, "lower_input": { "count": 9, - "item": "minecraft:packed_ice" + "item": "minecraft:ice" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/custom_compacting/quartz.json b/src/generated/resources/data/minecraft/recipes/quartz.json similarity index 92% rename from src/generated/resources/data/functionalstorage/recipes/custom_compacting/quartz.json rename to src/generated/resources/data/minecraft/recipes/quartz.json index a2057b77..ec46807b 100644 --- a/src/generated/resources/data/functionalstorage/recipes/custom_compacting/quartz.json +++ b/src/generated/resources/data/minecraft/recipes/quartz.json @@ -1,7 +1,6 @@ { "type": "functionalstorage:custom_compacting", "higher_input": { - "count": 1, "item": "minecraft:quartz_block" }, "lower_input": { diff --git a/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json b/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json index e4ff1a1b..bb20db0b 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json +++ b/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json @@ -1,16 +1,5 @@ { "values": [ - "functionalstorage:oak_2", - "functionalstorage:spruce_2", - "functionalstorage:birch_2", - "functionalstorage:jungle_2", - "functionalstorage:acacia_2", - "functionalstorage:dark_oak_2", - "functionalstorage:crimson_2", - "functionalstorage:warped_2", - "functionalstorage:mangrove_2", - "functionalstorage:cherry_2", - "functionalstorage:framed_2", "functionalstorage:oak_4", "functionalstorage:spruce_4", "functionalstorage:birch_4", @@ -22,6 +11,17 @@ "functionalstorage:mangrove_4", "functionalstorage:cherry_4", "functionalstorage:framed_4", + "functionalstorage:oak_2", + "functionalstorage:spruce_2", + "functionalstorage:birch_2", + "functionalstorage:jungle_2", + "functionalstorage:acacia_2", + "functionalstorage:dark_oak_2", + "functionalstorage:crimson_2", + "functionalstorage:warped_2", + "functionalstorage:mangrove_2", + "functionalstorage:cherry_2", + "functionalstorage:framed_2", "functionalstorage:oak_1", "functionalstorage:spruce_1", "functionalstorage:birch_1", diff --git a/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java b/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java index 79013ab1..3a74b5bc 100644 --- a/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java +++ b/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java @@ -1,10 +1,43 @@ package com.buuz135.functionalstorage; -import com.buuz135.functionalstorage.block.*; -import com.buuz135.functionalstorage.block.tile.*; -import com.buuz135.functionalstorage.client.*; +import com.buuz135.functionalstorage.block.ArmoryCabinetBlock; +import com.buuz135.functionalstorage.block.CompactingDrawerBlock; +import com.buuz135.functionalstorage.block.CompactingFramedDrawerBlock; +import com.buuz135.functionalstorage.block.ControllerExtensionBlock; +import com.buuz135.functionalstorage.block.DrawerBlock; +import com.buuz135.functionalstorage.block.DrawerControllerBlock; +import com.buuz135.functionalstorage.block.EnderDrawerBlock; +import com.buuz135.functionalstorage.block.FluidDrawerBlock; +import com.buuz135.functionalstorage.block.FramedControllerExtensionBlock; +import com.buuz135.functionalstorage.block.FramedDrawerBlock; +import com.buuz135.functionalstorage.block.FramedDrawerControllerBlock; +import com.buuz135.functionalstorage.block.FramedSimpleCompactingDrawerBlock; +import com.buuz135.functionalstorage.block.SimpleCompactingDrawerBlock; +import com.buuz135.functionalstorage.block.tile.ArmoryCabinetTile; +import com.buuz135.functionalstorage.block.tile.CompactingDrawerTile; +import com.buuz135.functionalstorage.block.tile.CompactingFramedDrawerTile; +import com.buuz135.functionalstorage.block.tile.DrawerControllerTile; +import com.buuz135.functionalstorage.block.tile.DrawerTile; +import com.buuz135.functionalstorage.block.tile.EnderDrawerTile; +import com.buuz135.functionalstorage.block.tile.FluidDrawerTile; +import com.buuz135.functionalstorage.block.tile.FramedDrawerControllerTile; +import com.buuz135.functionalstorage.block.tile.FramedDrawerTile; +import com.buuz135.functionalstorage.block.tile.FramedSimpleCompactingDrawerTile; +import com.buuz135.functionalstorage.block.tile.ItemControllableDrawerTile; +import com.buuz135.functionalstorage.block.tile.SimpleCompactingDrawerTile; +import com.buuz135.functionalstorage.block.tile.StorageControllerTile; +import com.buuz135.functionalstorage.client.CompactingDrawerRenderer; +import com.buuz135.functionalstorage.client.ControllerRenderer; +import com.buuz135.functionalstorage.client.DrawerRenderer; +import com.buuz135.functionalstorage.client.EnderDrawerRenderer; +import com.buuz135.functionalstorage.client.FluidDrawerRenderer; +import com.buuz135.functionalstorage.client.SimpleCompactingDrawerRenderer; import com.buuz135.functionalstorage.client.loader.FramedModel; -import com.buuz135.functionalstorage.data.*; +import com.buuz135.functionalstorage.data.FunctionalStorageBlockTagsProvider; +import com.buuz135.functionalstorage.data.FunctionalStorageBlockstateProvider; +import com.buuz135.functionalstorage.data.FunctionalStorageItemTagsProvider; +import com.buuz135.functionalstorage.data.FunctionalStorageLangProvider; +import com.buuz135.functionalstorage.data.FunctionalStorageRecipesProvider; import com.buuz135.functionalstorage.inventory.BigInventoryHandler; import com.buuz135.functionalstorage.inventory.item.CompactingStackItemHandler; import com.buuz135.functionalstorage.inventory.item.DrawerStackItemHandler; @@ -16,46 +49,40 @@ import com.buuz135.functionalstorage.recipe.CustomCompactingRecipe; import com.buuz135.functionalstorage.recipe.DrawerlessWoodIngredient; import com.buuz135.functionalstorage.recipe.FramedDrawerRecipe; -import com.buuz135.functionalstorage.util.*; -import com.hrznstudio.titanium.block.BasicBlock; +import com.buuz135.functionalstorage.util.DrawerWoodType; +import com.buuz135.functionalstorage.util.IWoodType; +import com.buuz135.functionalstorage.util.NumberUtils; +import com.buuz135.functionalstorage.util.TooltipUtil; import com.hrznstudio.titanium.datagenerator.loot.TitaniumLootTableProvider; import com.hrznstudio.titanium.datagenerator.model.BlockItemModelGeneratorProvider; import com.hrznstudio.titanium.event.handler.EventManager; +import com.hrznstudio.titanium.module.BlockWithTile; import com.hrznstudio.titanium.module.ModuleController; import com.hrznstudio.titanium.nbthandler.NBTManager; import com.hrznstudio.titanium.network.NetworkHandler; -import com.hrznstudio.titanium.recipe.generator.TitaniumRecipeProvider; -import com.hrznstudio.titanium.recipe.generator.TitaniumShapedRecipeBuilder; -import com.hrznstudio.titanium.tab.TitaniumTab; -import com.hrznstudio.titanium.recipe.generator.IJSONGenerator; -import com.hrznstudio.titanium.recipe.generator.IJsonFile; -import com.hrznstudio.titanium.recipe.generator.TitaniumSerializableProvider; import com.hrznstudio.titanium.recipe.serializer.GenericSerializer; +import com.hrznstudio.titanium.tab.TitaniumTab; import net.minecraft.client.renderer.ItemBlockRenderTypes; import net.minecraft.client.renderer.RenderType; -import net.minecraft.data.recipes.FinishedRecipe; -import net.minecraft.data.recipes.RecipeCategory; -import net.minecraft.data.recipes.SmithingTransformRecipeBuilder; +import net.minecraft.core.Holder; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; import net.minecraft.nbt.CompoundTag; import net.minecraft.resources.ResourceLocation; -import net.minecraft.tags.ItemTags; -import net.minecraft.world.inventory.InventoryMenu; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; -import net.minecraftforge.client.event.*; import net.neoforged.api.distmarker.Dist; import net.neoforged.api.distmarker.OnlyIn; -import net.neoforged.fml.DistExecutor; import net.neoforged.fml.common.Mod; import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; -import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent; import net.neoforged.neoforge.client.event.EntityRenderersEvent; import net.neoforged.neoforge.client.event.ModelEvent; import net.neoforged.neoforge.client.event.RegisterColorHandlersEvent; @@ -65,21 +92,25 @@ import net.neoforged.neoforge.client.model.generators.ItemModelProvider; import net.neoforged.neoforge.client.model.generators.ModelFile; import net.neoforged.neoforge.common.NeoForgeMod; -import net.neoforged.neoforge.common.capabilities.Capabilities; -import net.neoforged.neoforge.common.crafting.CraftingHelper; +import net.neoforged.neoforge.common.crafting.IngredientType; import net.neoforged.neoforge.common.util.NonNullLazy; import net.neoforged.neoforge.data.event.GatherDataEvent; import net.neoforged.neoforge.event.level.BlockEvent; -import net.neoforged.neoforge.registries.ForgeRegistries; -import net.neoforged.neoforge.registries.RegistryObject; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.NeoForgeRegistries; import org.apache.commons.lang3.tuple.Pair; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import var; -import java.awt.*; -import java.util.*; + +import java.awt.Color; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Optional; import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.function.Consumer; +import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Collectors; @@ -91,7 +122,7 @@ public class FunctionalStorage extends ModuleController { public static NetworkHandler NETWORK = new NetworkHandler(MOD_ID); static { - NETWORK.registerMessage(EnderDrawerSyncMessage.class); + NETWORK.registerMessage("ender_drawer_sync", EnderDrawerSyncMessage.class); } // Directly reference a log4j logger. @@ -99,40 +130,43 @@ public class FunctionalStorage extends ModuleController { public static ConcurrentLinkedQueue WOOD_TYPES = new ConcurrentLinkedQueue<>(); - public static HashMap, RegistryObject>>>> DRAWER_TYPES = new HashMap<>(); - public static Pair, RegistryObject>> COMPACTING_DRAWER; - public static Pair, RegistryObject>> DRAWER_CONTROLLER; - public static Pair, RegistryObject>> ARMORY_CABINET; - public static Pair, RegistryObject>> ENDER_DRAWER; - public static Pair, RegistryObject>> FRAMED_COMPACTING_DRAWER; - public static Pair, RegistryObject>> FLUID_DRAWER_1; - public static Pair, RegistryObject>> FLUID_DRAWER_2; - public static Pair, RegistryObject>> FLUID_DRAWER_4; - public static Pair, RegistryObject>> CONTROLLER_EXTENSION; - public static Pair, RegistryObject>> SIMPLE_COMPACTING_DRAWER; - public static Pair, RegistryObject>> FRAMED_DRAWER_CONTROLLER; - public static Pair, RegistryObject>> FRAMED_CONTROLLER_EXTENSION; - public static Pair, RegistryObject>> FRAMED_SIMPLE_COMPACTING_DRAWER; - - - public static RegistryObject LINKING_TOOL; - public static HashMap> STORAGE_UPGRADES = new HashMap<>(); - public static RegistryObject COLLECTOR_UPGRADE; - public static RegistryObject PULLING_UPGRADE; - public static RegistryObject PUSHING_UPGRADE; - public static RegistryObject VOID_UPGRADE; - public static RegistryObject CONFIGURATION_TOOL; - public static RegistryObject REDSTONE_UPGRADE; - public static RegistryObject CREATIVE_UPGRADE; + public static HashMap> DRAWER_TYPES = new HashMap<>(); + public static BlockWithTile COMPACTING_DRAWER; + public static BlockWithTile DRAWER_CONTROLLER; + public static BlockWithTile ARMORY_CABINET; + public static BlockWithTile ENDER_DRAWER; + public static BlockWithTile FRAMED_COMPACTING_DRAWER; + public static BlockWithTile FLUID_DRAWER_1; + public static BlockWithTile FLUID_DRAWER_2; + public static BlockWithTile FLUID_DRAWER_4; + public static BlockWithTile CONTROLLER_EXTENSION; + public static BlockWithTile SIMPLE_COMPACTING_DRAWER; + public static BlockWithTile FRAMED_DRAWER_CONTROLLER; + public static BlockWithTile FRAMED_CONTROLLER_EXTENSION; + public static BlockWithTile FRAMED_SIMPLE_COMPACTING_DRAWER; + + + public static DeferredHolder LINKING_TOOL; + public static HashMap> STORAGE_UPGRADES = new HashMap<>(); + public static DeferredHolder COLLECTOR_UPGRADE; + public static DeferredHolder PULLING_UPGRADE; + public static DeferredHolder PUSHING_UPGRADE; + public static DeferredHolder VOID_UPGRADE; + public static DeferredHolder CONFIGURATION_TOOL; + public static DeferredHolder REDSTONE_UPGRADE; + public static DeferredHolder CREATIVE_UPGRADE; public static TitaniumTab TAB = new TitaniumTab(new ResourceLocation(MOD_ID, "main")); - public static RegistryObject> CUSTOM_COMPACTING_RECIPE_SERIALIZER; - public static RegistryObject> CUSTOM_COMPACTING_RECIPE_TYPE; + public static Holder> CUSTOM_COMPACTING_RECIPE_SERIALIZER; + public static Holder> CUSTOM_COMPACTING_RECIPE_TYPE; - public FunctionalStorage() { + public FunctionalStorage(Dist dist) { NeoForgeMod.enableMilkFluid(); - DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> this::onClient); + if (dist.isClient()) { + Runnable runnable = this::onClient; + runnable.run(); + } EventManager.forge(BlockEvent.BreakEvent.class).process(breakEvent -> { if (breakEvent.getPlayer().isCreative()) { if (breakEvent.getState().getBlock() instanceof DrawerBlock) { @@ -172,14 +206,58 @@ public FunctionalStorage() { } } }).subscribe(); - EventManager.mod(FMLCommonSetupEvent.class).process(fmlCommonSetupEvent -> { - CraftingHelper.register(DrawerlessWoodIngredient.NAME, DrawerlessWoodIngredient.SERIALIZER); - }).subscribe(); NBTManager.getInstance().scanTileClassForAnnotations(FramedDrawerTile.class); NBTManager.getInstance().scanTileClassForAnnotations(CompactingFramedDrawerTile.class); NBTManager.getInstance().scanTileClassForAnnotations(FluidDrawerTile.class); NBTManager.getInstance().scanTileClassForAnnotations(SimpleCompactingDrawerTile.class); NBTManager.getInstance().scanTileClassForAnnotations(FramedSimpleCompactingDrawerTile.class); + + EventManager.mod(RegisterCapabilitiesEvent.class).process(event -> { + class Registrar { + void register(Class tp, Function func, BlockWithTile... types) { + for (var type : types) { + event.registerBlockEntity(Capabilities.ItemHandler.BLOCK, type.type().get(), (object, context) -> { + if (tp.isInstance(object)) { + return func.apply(tp.cast(object)); + } + return null; + }); + } + } + } + final var reg = new Registrar(); + reg.register(ArmoryCabinetTile.class, ac -> ac.handler, ARMORY_CABINET); + reg.register(CompactingDrawerTile.class, cd -> cd.handler, COMPACTING_DRAWER, FRAMED_COMPACTING_DRAWER); + + for (var type : List.of(FLUID_DRAWER_1, FLUID_DRAWER_2, FLUID_DRAWER_4)) { + event.registerBlockEntity(Capabilities.FluidHandler.BLOCK, type.type().get(), (object, context) -> { + if (object instanceof FluidDrawerTile fd) { + return fd.fluidHandler; + } + return null; + }); + } + for (var type : List.of(FRAMED_DRAWER_CONTROLLER, DRAWER_CONTROLLER)) { + event.registerBlockEntity(Capabilities.FluidHandler.BLOCK, type.type().get(), (object, context) -> { + if (object instanceof StorageControllerTile sc) { + return sc.fluidHandler; + } + return null; + }); + } + + BuiltInRegistries.BLOCK_ENTITY_TYPE.holders() + .filter(hol -> hol.key().location().getNamespace().equals(MOD_ID)) + .map(Holder::value) + .forEach(betype -> { + event.registerBlockEntity(Capabilities.ItemHandler.BLOCK, betype, (object, context) -> { + if (object instanceof ItemControllableDrawerTile icd) { + return icd.getStorage(); + } + return null; + }); + }); + }); } @@ -194,15 +272,15 @@ protected void initModules() { new DrawerBlock.DrawerItem((DrawerBlock) blockRegistryObject.get(), new Item.Properties(), TAB),TAB); DRAWER_TYPES.computeIfAbsent(value, drawerType -> new ArrayList<>()).add(pair); } else { - DRAWER_TYPES.computeIfAbsent(value, drawerType -> new ArrayList<>()).add(getRegistries().registerBlockWithTileItem(name, () -> new DrawerBlock(woodType, value, BlockBehaviour.Properties.copy(woodType.getPlanks())), blockRegistryObject -> () -> + DRAWER_TYPES.computeIfAbsent(value, drawerType -> new ArrayList<>()).add(getRegistries().registerBlockWithTileItem(name, () -> new DrawerBlock(woodType, value, BlockBehaviour.Properties.ofFullCopy(woodType.getPlanks())), blockRegistryObject -> () -> new DrawerBlock.DrawerItem((DrawerBlock) blockRegistryObject.get(), new Item.Properties(), TAB),TAB)); } } } - FLUID_DRAWER_1 = getRegistries().registerBlockWithTile("fluid_1", () -> new FluidDrawerBlock(DrawerType.X_1, BlockBehaviour.Properties.copy(Blocks.STONE_BRICKS)), TAB); - FLUID_DRAWER_2 = getRegistries().registerBlockWithTile("fluid_2", () -> new FluidDrawerBlock(DrawerType.X_2, BlockBehaviour.Properties.copy(Blocks.STONE_BRICKS)), TAB); - FLUID_DRAWER_4 = getRegistries().registerBlockWithTile("fluid_4", () -> new FluidDrawerBlock(DrawerType.X_4, BlockBehaviour.Properties.copy(Blocks.STONE_BRICKS)), TAB); - COMPACTING_DRAWER = getRegistries().registerBlockWithTileItem("compacting_drawer", () -> new CompactingDrawerBlock("compacting_drawer", BlockBehaviour.Properties.copy(Blocks.STONE_BRICKS)), + FLUID_DRAWER_1 = getRegistries().registerBlockWithTile("fluid_1", () -> new FluidDrawerBlock(DrawerType.X_1, BlockBehaviour.Properties.ofFullCopy(Blocks.STONE_BRICKS)), TAB); + FLUID_DRAWER_2 = getRegistries().registerBlockWithTile("fluid_2", () -> new FluidDrawerBlock(DrawerType.X_2, BlockBehaviour.Properties.ofFullCopy(Blocks.STONE_BRICKS)), TAB); + FLUID_DRAWER_4 = getRegistries().registerBlockWithTile("fluid_4", () -> new FluidDrawerBlock(DrawerType.X_4, BlockBehaviour.Properties.ofFullCopy(Blocks.STONE_BRICKS)), TAB); + COMPACTING_DRAWER = getRegistries().registerBlockWithTileItem("compacting_drawer", () -> new CompactingDrawerBlock("compacting_drawer", BlockBehaviour.Properties.ofFullCopy(Blocks.STONE_BRICKS)), blockRegistryObject -> () -> new CompactingDrawerBlock.CompactingDrawerItem(blockRegistryObject.get(), new Item.Properties(), 3), TAB); FRAMED_COMPACTING_DRAWER = getRegistries().registerBlockWithTileItem("compacting_framed_drawer", () -> new CompactingFramedDrawerBlock("compacting_framed_drawer"), @@ -212,39 +290,41 @@ protected void initModules() { FRAMED_DRAWER_CONTROLLER = getRegistries().registerBlockWithTile("framed_storage_controller", FramedDrawerControllerBlock::new, TAB); CONTROLLER_EXTENSION = getRegistries().registerBlockWithTile("controller_extension", ControllerExtensionBlock::new, TAB); FRAMED_CONTROLLER_EXTENSION = getRegistries().registerBlockWithTile("framed_controller_extension", FramedControllerExtensionBlock::new, TAB); - LINKING_TOOL = getRegistries().registerGeneric(ForgeRegistries.ITEMS.getRegistryKey(), "linking_tool", LinkingToolItem::new); - CONFIGURATION_TOOL = getRegistries().registerGeneric(ForgeRegistries.ITEMS.getRegistryKey(), "configuration_tool", ConfigurationToolItem::new); + LINKING_TOOL = getRegistries().registerGeneric(Registries.ITEM, "linking_tool", LinkingToolItem::new); + CONFIGURATION_TOOL = getRegistries().registerGeneric(Registries.ITEM, "configuration_tool", ConfigurationToolItem::new); for (StorageUpgradeItem.StorageTier value : StorageUpgradeItem.StorageTier.values()) { - STORAGE_UPGRADES.put(value, getRegistries().registerGeneric(ForgeRegistries.ITEMS.getRegistryKey(), value.name().toLowerCase(Locale.ROOT) + (value == StorageUpgradeItem.StorageTier.IRON ? "_downgrade" : "_upgrade"), () -> new StorageUpgradeItem(value))); + STORAGE_UPGRADES.put(value, getRegistries().registerGeneric(Registries.ITEM, value.name().toLowerCase(Locale.ROOT) + (value == StorageUpgradeItem.StorageTier.IRON ? "_downgrade" : "_upgrade"), () -> new StorageUpgradeItem(value))); } - SIMPLE_COMPACTING_DRAWER = getRegistries().registerBlockWithTileItem("simple_compacting_drawer", () -> new SimpleCompactingDrawerBlock("simple_compacting_drawer", BlockBehaviour.Properties.copy(Blocks.STONE_BRICKS)), + SIMPLE_COMPACTING_DRAWER = getRegistries().registerBlockWithTileItem("simple_compacting_drawer", () -> new SimpleCompactingDrawerBlock("simple_compacting_drawer", BlockBehaviour.Properties.ofFullCopy(Blocks.STONE_BRICKS)), blockRegistryObject -> () -> new CompactingDrawerBlock.CompactingDrawerItem(blockRegistryObject.get(), new Item.Properties(), 2), TAB); FRAMED_SIMPLE_COMPACTING_DRAWER = getRegistries().registerBlockWithTileItem("framed_simple_compacting_drawer", () -> new FramedSimpleCompactingDrawerBlock("framed_simple_compacting_drawer"), blockRegistryObject -> () -> new CompactingDrawerBlock.CompactingDrawerItem(blockRegistryObject.get(), new Item.Properties(), 2), TAB); - COLLECTOR_UPGRADE = getRegistries().registerGeneric(ForgeRegistries.ITEMS.getRegistryKey(), "collector_upgrade", () -> new UpgradeItem(new Item.Properties(), UpgradeItem.Type.UTILITY)); - PULLING_UPGRADE = getRegistries().registerGeneric(ForgeRegistries.ITEMS.getRegistryKey(), "puller_upgrade", () -> new UpgradeItem(new Item.Properties(), UpgradeItem.Type.UTILITY)); - PUSHING_UPGRADE = getRegistries().registerGeneric(ForgeRegistries.ITEMS.getRegistryKey(), "pusher_upgrade", () -> new UpgradeItem(new Item.Properties(), UpgradeItem.Type.UTILITY)); - VOID_UPGRADE = getRegistries().registerGeneric(ForgeRegistries.ITEMS.getRegistryKey(), "void_upgrade", () -> new UpgradeItem(new Item.Properties(), UpgradeItem.Type.UTILITY)); + COLLECTOR_UPGRADE = getRegistries().registerGeneric(Registries.ITEM, "collector_upgrade", () -> new UpgradeItem(new Item.Properties(), UpgradeItem.Type.UTILITY)); + PULLING_UPGRADE = getRegistries().registerGeneric(Registries.ITEM, "puller_upgrade", () -> new UpgradeItem(new Item.Properties(), UpgradeItem.Type.UTILITY)); + PUSHING_UPGRADE = getRegistries().registerGeneric(Registries.ITEM, "pusher_upgrade", () -> new UpgradeItem(new Item.Properties(), UpgradeItem.Type.UTILITY)); + VOID_UPGRADE = getRegistries().registerGeneric(Registries.ITEM, "void_upgrade", () -> new UpgradeItem(new Item.Properties(), UpgradeItem.Type.UTILITY)); ARMORY_CABINET = getRegistries().registerBlockWithTile("armory_cabinet", ArmoryCabinetBlock::new, TAB); ENDER_DRAWER = getRegistries().registerBlockWithTile("ender_drawer", EnderDrawerBlock::new, TAB); - REDSTONE_UPGRADE = getRegistries().registerGeneric(ForgeRegistries.ITEMS.getRegistryKey(), "redstone_upgrade", () -> new UpgradeItem(new Item.Properties(), UpgradeItem.Type.UTILITY)); - CREATIVE_UPGRADE = getRegistries().registerGeneric(ForgeRegistries.ITEMS.getRegistryKey(), "creative_vending_upgrade", () -> new UpgradeItem(new Item.Properties(), UpgradeItem.Type.STORAGE) { + REDSTONE_UPGRADE = getRegistries().registerGeneric(Registries.ITEM, "redstone_upgrade", () -> new UpgradeItem(new Item.Properties(), UpgradeItem.Type.UTILITY)); + CREATIVE_UPGRADE = getRegistries().registerGeneric(Registries.ITEM, "creative_vending_upgrade", () -> new UpgradeItem(new Item.Properties(), UpgradeItem.Type.STORAGE) { @Override public boolean isFoil(ItemStack p_41453_) { return true; } }); + DrawerlessWoodIngredient.TYPE = getRegistries().registerGeneric(NeoForgeRegistries.Keys.INGREDIENT_TYPES, DrawerlessWoodIngredient.NAME.getPath(), () -> new IngredientType<>(DrawerlessWoodIngredient.CODEC)); - getRegistries().registerGeneric(ForgeRegistries.RECIPE_SERIALIZERS.getRegistryKey(), "framed_recipe", () -> FramedDrawerRecipe.SERIALIZER); - this.addCreativeTab("main", () -> new ItemStack(DRAWER_CONTROLLER.getLeft().get()), MOD_ID, TAB); + getRegistries().registerGeneric(Registries.RECIPE_SERIALIZER, "framed_recipe", () -> FramedDrawerRecipe.SERIALIZER); - CUSTOM_COMPACTING_RECIPE_TYPE = getRegistries().registerGeneric(ForgeRegistries.RECIPE_TYPES.getRegistryKey(), "custom_compacting", () -> RecipeType.simple(new ResourceLocation(MOD_ID, "custom_compacting"))); + this.addCreativeTab("main", () -> new ItemStack(DRAWER_CONTROLLER), MOD_ID, TAB); - CUSTOM_COMPACTING_RECIPE_SERIALIZER = getRegistries().registerGeneric(ForgeRegistries.RECIPE_SERIALIZERS.getRegistryKey(), "custom_compacting", () -> new GenericSerializer<>(CustomCompactingRecipe.class, CUSTOM_COMPACTING_RECIPE_TYPE)); + CUSTOM_COMPACTING_RECIPE_TYPE = getRegistries().registerGeneric(Registries.RECIPE_TYPE, "custom_compacting", () -> RecipeType.simple(new ResourceLocation(MOD_ID, "custom_compacting"))); + + CUSTOM_COMPACTING_RECIPE_SERIALIZER = getRegistries().registerGeneric(Registries.RECIPE_SERIALIZER, "custom_compacting", () -> new GenericSerializer<>(CustomCompactingRecipe.class, CUSTOM_COMPACTING_RECIPE_TYPE::value, CustomCompactingRecipe.CODEC)); } public enum DrawerType { @@ -294,20 +374,20 @@ public void onClient() { EventManager.mod(EntityRenderersEvent.RegisterRenderers.class).process(registerRenderers -> { for (DrawerType value : DrawerType.values()) { DRAWER_TYPES.get(value).forEach(blockRegistryObject -> { - registerRenderers.registerBlockEntityRenderer((BlockEntityType) blockRegistryObject.getRight().get(), p_173571_ -> new DrawerRenderer()); + registerRenderers.registerBlockEntityRenderer((BlockEntityType) blockRegistryObject.type().get(), p_173571_ -> new DrawerRenderer()); }); } - registerRenderers.registerBlockEntityRenderer((BlockEntityType) COMPACTING_DRAWER.getRight().get(), p_173571_ -> new CompactingDrawerRenderer()); - registerRenderers.registerBlockEntityRenderer((BlockEntityType) FRAMED_COMPACTING_DRAWER.getRight().get(), p_173571_ -> new CompactingDrawerRenderer()); - registerRenderers.registerBlockEntityRenderer((BlockEntityType) DRAWER_CONTROLLER.getRight().get(), p -> new ControllerRenderer()); - registerRenderers.registerBlockEntityRenderer((BlockEntityType) ENDER_DRAWER.getRight().get(), p_173571_ -> new EnderDrawerRenderer()); - registerRenderers.registerBlockEntityRenderer((BlockEntityType) FLUID_DRAWER_1.getRight().get(), p_173571_ -> new FluidDrawerRenderer()); - registerRenderers.registerBlockEntityRenderer((BlockEntityType) FLUID_DRAWER_2.getRight().get(), p_173571_ -> new FluidDrawerRenderer()); - registerRenderers.registerBlockEntityRenderer((BlockEntityType) FLUID_DRAWER_4.getRight().get(), p_173571_ -> new FluidDrawerRenderer()); - registerRenderers.registerBlockEntityRenderer((BlockEntityType) SIMPLE_COMPACTING_DRAWER.getRight().get(), p_173571_ -> new SimpleCompactingDrawerRenderer()); - - registerRenderers.registerBlockEntityRenderer((BlockEntityType) FRAMED_DRAWER_CONTROLLER.getRight().get(), p -> new ControllerRenderer()); - registerRenderers.registerBlockEntityRenderer((BlockEntityType) FRAMED_SIMPLE_COMPACTING_DRAWER.getRight().get(), p_173571_ -> new SimpleCompactingDrawerRenderer()); + registerRenderers.registerBlockEntityRenderer((BlockEntityType) COMPACTING_DRAWER.type().get(), p_173571_ -> new CompactingDrawerRenderer()); + registerRenderers.registerBlockEntityRenderer((BlockEntityType) FRAMED_COMPACTING_DRAWER.type().get(), p_173571_ -> new CompactingDrawerRenderer()); + registerRenderers.registerBlockEntityRenderer((BlockEntityType) DRAWER_CONTROLLER.type().get(), p -> new ControllerRenderer()); + registerRenderers.registerBlockEntityRenderer((BlockEntityType) ENDER_DRAWER.type().get(), p_173571_ -> new EnderDrawerRenderer()); + registerRenderers.registerBlockEntityRenderer((BlockEntityType) FLUID_DRAWER_1.type().get(), p_173571_ -> new FluidDrawerRenderer()); + registerRenderers.registerBlockEntityRenderer((BlockEntityType) FLUID_DRAWER_2.type().get(), p_173571_ -> new FluidDrawerRenderer()); + registerRenderers.registerBlockEntityRenderer((BlockEntityType) FLUID_DRAWER_4.type().get(), p_173571_ -> new FluidDrawerRenderer()); + registerRenderers.registerBlockEntityRenderer((BlockEntityType) SIMPLE_COMPACTING_DRAWER.type().get(), p_173571_ -> new SimpleCompactingDrawerRenderer()); + + registerRenderers.registerBlockEntityRenderer((BlockEntityType) FRAMED_DRAWER_CONTROLLER.type().get(), p -> new ControllerRenderer()); + registerRenderers.registerBlockEntityRenderer((BlockEntityType) FRAMED_SIMPLE_COMPACTING_DRAWER.type().get(), p_173571_ -> new SimpleCompactingDrawerRenderer()); }).subscribe(); EventManager.mod(RegisterColorHandlersEvent.Item.class).process(item -> { @@ -339,30 +419,29 @@ public void onClient() { }).subscribe(); EventManager.mod(FMLClientSetupEvent.class).process(event -> { for (DrawerType value : DrawerType.values()) { - for (RegistryObject blockRegistryObject : DRAWER_TYPES.get(value).stream().map(Pair::getLeft).collect(Collectors.toList())) { - ItemBlockRenderTypes.setRenderLayer(blockRegistryObject.get(), RenderType.cutout()); - } + DRAWER_TYPES.get(value).stream().map(BlockWithTile::getBlock).forEach(bl -> ItemBlockRenderTypes.setRenderLayer(bl, RenderType.cutout())); } - ItemBlockRenderTypes.setRenderLayer(COMPACTING_DRAWER.getLeft().get(), RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer(FRAMED_COMPACTING_DRAWER.getLeft().get(), RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer(ENDER_DRAWER.getLeft().get(), RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer(FLUID_DRAWER_1.getLeft().get(), RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer(FLUID_DRAWER_2.getLeft().get(), RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer(FLUID_DRAWER_4.getLeft().get(), RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer(SIMPLE_COMPACTING_DRAWER.getLeft().get(), RenderType.cutout()); - - ItemBlockRenderTypes.setRenderLayer(FRAMED_DRAWER_CONTROLLER.getLeft().get(), RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer(FRAMED_CONTROLLER_EXTENSION.getLeft().get(), RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer(FRAMED_SIMPLE_COMPACTING_DRAWER.getLeft().get(), RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer(COMPACTING_DRAWER.getBlock(), RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer(FRAMED_COMPACTING_DRAWER.getBlock(), RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer(ENDER_DRAWER.getBlock(), RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer(FLUID_DRAWER_1.getBlock(), RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer(FLUID_DRAWER_2.getBlock(), RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer(FLUID_DRAWER_4.getBlock(), RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer(SIMPLE_COMPACTING_DRAWER.getBlock(), RenderType.cutout()); + + ItemBlockRenderTypes.setRenderLayer(FRAMED_DRAWER_CONTROLLER.getBlock(), RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer(FRAMED_CONTROLLER_EXTENSION.getBlock(), RenderType.cutout()); + ItemBlockRenderTypes.setRenderLayer(FRAMED_SIMPLE_COMPACTING_DRAWER.getBlock(), RenderType.cutout()); }).subscribe(); EventManager.forge(RenderTooltipEvent.Pre.class).process(itemTooltipEvent -> { - if (itemTooltipEvent.getItemStack().getItem().equals(FunctionalStorage.ENDER_DRAWER.getLeft().get().asItem()) && itemTooltipEvent.getItemStack().hasTag()) { + if (itemTooltipEvent.getItemStack().getItem().equals(FunctionalStorage.ENDER_DRAWER.getBlock().asItem()) && itemTooltipEvent.getItemStack().hasTag()) { TooltipUtil.renderItems(itemTooltipEvent.getGraphics(), EnderDrawerBlock.getFrequencyDisplay(itemTooltipEvent.getItemStack().getTag().getCompound("Tile").getString("frequency")), itemTooltipEvent.getX() + 14, itemTooltipEvent.getY() + 11); } if (itemTooltipEvent.getItemStack().is(FunctionalStorage.LINKING_TOOL.get()) && itemTooltipEvent.getItemStack().getOrCreateTag().contains(LinkingToolItem.NBT_ENDER)) { TooltipUtil.renderItems(itemTooltipEvent.getGraphics(), EnderDrawerBlock.getFrequencyDisplay(itemTooltipEvent.getItemStack().getOrCreateTag().getString(LinkingToolItem.NBT_ENDER)), itemTooltipEvent.getX() + 14, itemTooltipEvent.getY() + 11); } - itemTooltipEvent.getItemStack().getCapability(Capabilities.ITEM_HANDLER).ifPresent(iItemHandler -> { + var iItemHandler = itemTooltipEvent.getItemStack().getCapability(Capabilities.ItemHandler.ITEM); + if (iItemHandler != null) { if (iItemHandler instanceof DrawerStackItemHandler) { int i = 0; for (BigInventoryHandler.BigStack storedStack : ((DrawerStackItemHandler) iItemHandler).getStoredStacks()) { @@ -381,19 +460,18 @@ public void onClient() { } } } - }); + } }).subscribe(); EventManager.mod(ModelEvent.RegisterGeometryLoaders.class).process(modelRegistryEvent -> { - modelRegistryEvent.register("framedblock", FramedModel.Loader.INSTANCE); + modelRegistryEvent.register(new ResourceLocation(MOD_ID, "framedblock"), FramedModel.Loader.INSTANCE); }).subscribe(); } @Override public void addDataProvider(GatherDataEvent event) { NonNullLazy> blocksToProcess = NonNullLazy.of(() -> - ForgeRegistries.BLOCKS.getValues() - .stream() - .filter(basicBlock -> Optional.ofNullable(ForgeRegistries.BLOCKS.getKey(basicBlock)) + BuiltInRegistries.BLOCK.stream() + .filter(basicBlock -> Optional.of(BuiltInRegistries.BLOCK.getKey(basicBlock)) .map(ResourceLocation::getNamespace) .filter(MOD_ID::equalsIgnoreCase) .isPresent()) @@ -412,7 +490,7 @@ public void addDataProvider(GatherDataEvent event) { event.getGenerator().addProvider(true, new ItemModelProvider(event.getGenerator().getPackOutput(), MOD_ID, event.getExistingFileHelper()) { @Override protected void registerModels() { - blocksToProcess.get().forEach(block -> withUnchecked(ForgeRegistries.BLOCKS.getKey(block).getPath(), new ResourceLocation(FunctionalStorage.MOD_ID, "block/" + ForgeRegistries.BLOCKS.getKey(block).getPath()))); + blocksToProcess.get().forEach(block -> withUnchecked(BuiltInRegistries.BLOCK.getKey(block).getPath(), new ResourceLocation(FunctionalStorage.MOD_ID, "block/" + BuiltInRegistries.BLOCK.getKey(block).getPath()))); for (StorageUpgradeItem.StorageTier storageTier : STORAGE_UPGRADES.keySet()) { item(STORAGE_UPGRADES.get(storageTier).get()); } @@ -425,7 +503,7 @@ protected void registerModels() { } private void item(Item item) { - withUnchecked(ForgeRegistries.ITEMS.getKey(item).getPath(), new ResourceLocation("minecraft:item/generated")).texture( "layer0", new ResourceLocation(MOD_ID, "item/" + ForgeRegistries.ITEMS.getKey(item).getPath())); + withUnchecked(BuiltInRegistries.ITEM.getKey(item).getPath(), new ResourceLocation("minecraft:item/generated")).texture( "layer0", new ResourceLocation(MOD_ID, "item/" + BuiltInRegistries.ITEM.getKey(item).getPath())); } private ItemModelBuilder withUnchecked(String name, ResourceLocation parent){ @@ -436,45 +514,31 @@ private ItemModelBuilder withUnchecked(String name, ResourceLocation parent){ @Override protected void registerModels() { for (DrawerType value : DrawerType.values()) { - for (RegistryObject blockRegistryObject : DRAWER_TYPES.get(value).stream().map(Pair::getLeft).collect(Collectors.toList())) { + for (var blockRegistryObject : DRAWER_TYPES.get(value).stream().map(BlockWithTile::block).toList()) { if (blockRegistryObject.get() instanceof FramedDrawerBlock) { continue; } - withExistingParent(ForgeRegistries.BLOCKS.getKey(blockRegistryObject.get()).getPath() + "_locked", modLoc(ForgeRegistries.BLOCKS.getKey(blockRegistryObject.get()).getPath())) + withExistingParent(BuiltInRegistries.BLOCK.getKey(blockRegistryObject.get()).getPath() + "_locked", modLoc(BuiltInRegistries.BLOCK.getKey(blockRegistryObject.get()).getPath())) .texture("lock_icon", modLoc("block/lock")); } } - withExistingParent(ForgeRegistries.BLOCKS.getKey(COMPACTING_DRAWER.getLeft().get()).getPath() + "_locked", modLoc(ForgeRegistries.BLOCKS.getKey(COMPACTING_DRAWER.getLeft().get()).getPath())) + withExistingParent(BuiltInRegistries.BLOCK.getKey(COMPACTING_DRAWER.getBlock()).getPath() + "_locked", modLoc(BuiltInRegistries.BLOCK.getKey(COMPACTING_DRAWER.getBlock()).getPath())) .texture("lock_icon", modLoc("block/lock")); - withExistingParent(ForgeRegistries.BLOCKS.getKey(ENDER_DRAWER.getLeft().get()).getPath() + "_locked", modLoc(ForgeRegistries.BLOCKS.getKey(ENDER_DRAWER.getLeft().get()).getPath())) + withExistingParent(BuiltInRegistries.BLOCK.getKey(ENDER_DRAWER.getBlock()).getPath() + "_locked", modLoc(BuiltInRegistries.BLOCK.getKey(ENDER_DRAWER.getBlock()).getPath())) .texture("lock_icon", modLoc("block/lock")); - withExistingParent(ForgeRegistries.BLOCKS.getKey(FLUID_DRAWER_1.getLeft().get()).getPath() + "_locked", modLoc(ForgeRegistries.BLOCKS.getKey(FLUID_DRAWER_1.getLeft().get()).getPath())) + withExistingParent(BuiltInRegistries.BLOCK.getKey(FLUID_DRAWER_1.getBlock()).getPath() + "_locked", modLoc(BuiltInRegistries.BLOCK.getKey(FLUID_DRAWER_1.getBlock()).getPath())) .texture("lock_icon", modLoc("block/lock")); - withExistingParent(ForgeRegistries.BLOCKS.getKey(FLUID_DRAWER_2.getLeft().get()).getPath() + "_locked", modLoc(ForgeRegistries.BLOCKS.getKey(FLUID_DRAWER_2.getLeft().get()).getPath())) + withExistingParent(BuiltInRegistries.BLOCK.getKey(FLUID_DRAWER_2.getBlock()).getPath() + "_locked", modLoc(BuiltInRegistries.BLOCK.getKey(FLUID_DRAWER_2.getBlock()).getPath())) .texture("lock_icon", modLoc("block/lock")); - withExistingParent(ForgeRegistries.BLOCKS.getKey(FLUID_DRAWER_4.getLeft().get()).getPath() + "_locked", modLoc(ForgeRegistries.BLOCKS.getKey(FLUID_DRAWER_4.getLeft().get()).getPath())) + withExistingParent(BuiltInRegistries.BLOCK.getKey(FLUID_DRAWER_4.getBlock()).getPath() + "_locked", modLoc(BuiltInRegistries.BLOCK.getKey(FLUID_DRAWER_4.getBlock()).getPath())) .texture("lock_icon", modLoc("block/lock")); - withExistingParent(ForgeRegistries.BLOCKS.getKey(SIMPLE_COMPACTING_DRAWER.getLeft().get()).getPath() + "_locked", modLoc(ForgeRegistries.BLOCKS.getKey(SIMPLE_COMPACTING_DRAWER.getLeft().get()).getPath())) + withExistingParent(BuiltInRegistries.BLOCK.getKey(SIMPLE_COMPACTING_DRAWER.getBlock()).getPath() + "_locked", modLoc(BuiltInRegistries.BLOCK.getKey(SIMPLE_COMPACTING_DRAWER.getBlock()).getPath())) .texture("lock_icon", modLoc("block/lock")); -// withExistingParent(ForgeRegistries.BLOCKS.getKey(FRAMED_COMPACTING_DRAWER.getLeft().get()).getPath() + "_locked", modLoc(ForgeRegistries.BLOCKS.getKey(FRAMED_COMPACTING_DRAWER.getLeft().get()).getPath())) +// withExistingParent(BuiltInRegistries.BLOCK.getKey(FRAMED_COMPACTING_DRAWER.getBlock()).getPath() + "_locked", modLoc(BuiltInRegistries.BLOCK.getKey(FRAMED_COMPACTING_DRAWER.getBlock()).getPath())) // .texture("lock_icon", modLoc("block/lock")); } }); } event.getGenerator().addProvider(true, new FunctionalStorageRecipesProvider(event.getGenerator(), blocksToProcess)); - event.getGenerator().addProvider(true, new TitaniumSerializableProvider(event.getGenerator(), MOD_ID) { - - public void add(Map serializables) { - new CustomCompactingRecipe(new ResourceLocation("clay"), new ItemStack(Items.CLAY_BALL, 4), new ItemStack(Items.CLAY)); - new CustomCompactingRecipe(new ResourceLocation("glowstone"), new ItemStack(Items.GLOWSTONE_DUST, 4), new ItemStack(Items.GLOWSTONE)); - new CustomCompactingRecipe(new ResourceLocation("melon"), new ItemStack(Items.MELON_SLICE, 9), new ItemStack(Items.MELON)); - new CustomCompactingRecipe(new ResourceLocation("quartz"), new ItemStack(Items.QUARTZ, 4), new ItemStack(Items.QUARTZ_BLOCK)); - new CustomCompactingRecipe(new ResourceLocation("ice"), new ItemStack(Items.ICE, 9), new ItemStack(Items.PACKED_ICE)); - new CustomCompactingRecipe(new ResourceLocation("packed_ice"), new ItemStack(Items.PACKED_ICE, 9), new ItemStack(Items.BLUE_ICE)); - new CustomCompactingRecipe(new ResourceLocation("amethyst"), new ItemStack(Items.AMETHYST_SHARD, 4), new ItemStack(Items.AMETHYST_BLOCK)); - - CustomCompactingRecipe.RECIPES.forEach(customCompactingRecipe -> serializables.put(customCompactingRecipe, customCompactingRecipe)); - } - }); } } diff --git a/src/main/java/com/buuz135/functionalstorage/block/ArmoryCabinetBlock.java b/src/main/java/com/buuz135/functionalstorage/block/ArmoryCabinetBlock.java index d1519701..7cd40a82 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/ArmoryCabinetBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/ArmoryCabinetBlock.java @@ -13,7 +13,6 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.LootTable; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; @@ -26,13 +25,13 @@ public class ArmoryCabinetBlock extends RotatableBlock { public ArmoryCabinetBlock() { - super("armory_cabinet", Properties.copy(Blocks.IRON_BLOCK), ArmoryCabinetTile.class); + super("armory_cabinet", Properties.ofFullCopy(Blocks.IRON_BLOCK), ArmoryCabinetTile.class); //setItemGroup(FunctionalStorage.TAB); } @Override public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { - return (p_155268_, p_155269_) -> new ArmoryCabinetTile(this, FunctionalStorage.ARMORY_CABINET.getRight().get(), p_155268_, p_155269_); + return (p_155268_, p_155269_) -> new ArmoryCabinetTile(this, FunctionalStorage.ARMORY_CABINET.type().get(), p_155268_, p_155269_); } @NotNull diff --git a/src/main/java/com/buuz135/functionalstorage/block/CompactingDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/CompactingDrawerBlock.java index a311446a..8aad62d4 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/CompactingDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/CompactingDrawerBlock.java @@ -5,7 +5,7 @@ import com.buuz135.functionalstorage.block.tile.ControllableDrawerTile; import com.buuz135.functionalstorage.block.tile.ItemControllableDrawerTile; import com.buuz135.functionalstorage.block.tile.StorageControllerTile; -import com.buuz135.functionalstorage.inventory.item.CompactingDrawerCapabilityProvider; +import com.buuz135.functionalstorage.inventory.item.CompactingStackItemHandler; import com.buuz135.functionalstorage.item.ConfigurationToolItem; import com.buuz135.functionalstorage.item.LinkingToolItem; import com.buuz135.functionalstorage.util.StorageTags; @@ -20,8 +20,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.NonNullList; -import net.minecraft.data.recipes.FinishedRecipe; -import net.minecraft.nbt.CompoundTag; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.world.InteractionHand; @@ -40,7 +39,6 @@ import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; -import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.LootTable; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; @@ -51,15 +49,14 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; import net.neoforged.neoforge.common.Tags; -import net.neoforged.neoforge.common.capabilities.ICapabilityProvider; +import net.neoforged.neoforge.items.IItemHandler; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import var; + import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; import java.util.Optional; -import java.util.function.Consumer; public class CompactingDrawerBlock extends RotatableBlock { @@ -95,7 +92,7 @@ public RotationType getRotationType() { @Override public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { - return (blockPos, state) -> new CompactingDrawerTile(this, (BlockEntityType) FunctionalStorage.COMPACTING_DRAWER.getRight().get(), blockPos, state); + return (blockPos, state) -> new CompactingDrawerTile(this, (BlockEntityType) FunctionalStorage.COMPACTING_DRAWER.type().get(), blockPos, state); } @Override @@ -226,7 +223,7 @@ public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @Nullabl } @Override - public void registerRecipe(Consumer consumer) { + public void registerRecipe(RecipeOutput consumer) { TitaniumShapedRecipeBuilder.shapedRecipe(this) .pattern("SSS").pattern("PDP").pattern("SIS") .define('S', Blocks.STONE) @@ -306,10 +303,8 @@ public Optional getTooltipImage(ItemStack stack) { return super.getTooltipImage(stack); } - @Nullable - @Override - public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundTag nbt) { - return new CompactingDrawerCapabilityProvider(stack, slots); + public IItemHandler initCapabilities(ItemStack stack) { + return new CompactingStackItemHandler(stack, slots); } } } diff --git a/src/main/java/com/buuz135/functionalstorage/block/CompactingFramedDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/CompactingFramedDrawerBlock.java index b820129c..a141a999 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/CompactingFramedDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/CompactingFramedDrawerBlock.java @@ -10,7 +10,7 @@ import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; import net.minecraft.core.NonNullList; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; @@ -19,11 +19,11 @@ import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.HitResult; @@ -31,16 +31,15 @@ import org.jetbrains.annotations.Nullable; import java.util.List; -import java.util.function.Consumer; public class CompactingFramedDrawerBlock extends CompactingDrawerBlock{ public CompactingFramedDrawerBlock(String name) { - super(name, Properties.copy(Blocks.STONE).noOcclusion().isViewBlocking((p_61036_, p_61037_, p_61038_) -> false)); + super(name, Properties.ofFullCopy(Blocks.STONE).noOcclusion().isViewBlocking((p_61036_, p_61037_, p_61038_) -> false)); } @Override public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { - return (blockPos, state) -> new CompactingFramedDrawerTile(this, (BlockEntityType) FunctionalStorage.FRAMED_COMPACTING_DRAWER.getValue().get(), blockPos, state); + return (blockPos, state) -> new CompactingFramedDrawerTile(this, (BlockEntityType) FunctionalStorage.FRAMED_COMPACTING_DRAWER.type().get(), blockPos, state); } @Override @@ -73,7 +72,7 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) } @Override - public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter level, BlockPos pos, Player player) { + public ItemStack getCloneItemStack(BlockState state, HitResult target, LevelReader level, BlockPos pos, Player player) { BlockEntity entity = level.getBlockEntity(pos); if (entity instanceof FramedDrawerTile framedDrawerTile && framedDrawerTile.getFramedDrawerModelData() != null && !framedDrawerTile.getFramedDrawerModelData().getDesign().isEmpty()){ ItemStack stack = new ItemStack(this); @@ -84,7 +83,7 @@ public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGett } @Override - public void registerRecipe(Consumer consumer) { + public void registerRecipe(RecipeOutput consumer) { TitaniumShapedRecipeBuilder.shapedRecipe(this) .pattern("SSS").pattern("PDP").pattern("SIS") .define('S', Items.IRON_NUGGET) diff --git a/src/main/java/com/buuz135/functionalstorage/block/ControllerExtensionBlock.java b/src/main/java/com/buuz135/functionalstorage/block/ControllerExtensionBlock.java index ec212bde..517f250d 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/ControllerExtensionBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/ControllerExtensionBlock.java @@ -5,7 +5,7 @@ import com.buuz135.functionalstorage.util.StorageTags; import com.hrznstudio.titanium.datagenerator.loot.block.BasicBlockLootTables; import com.hrznstudio.titanium.recipe.generator.TitaniumShapedRecipeBuilder; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntityType; @@ -13,22 +13,20 @@ import net.neoforged.neoforge.common.Tags; import org.jetbrains.annotations.NotNull; -import java.util.function.Consumer; - public class ControllerExtensionBlock extends StorageControllerExtensionBlock { public ControllerExtensionBlock() { - super("controller_extension", Properties.copy(Blocks.IRON_BLOCK), ControllerExtensionTile.class); + super("controller_extension", Properties.ofFullCopy(Blocks.IRON_BLOCK), ControllerExtensionTile.class); } @Override public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { - return (p_155268_, p_155269_) -> new ControllerExtensionTile(this, (BlockEntityType) FunctionalStorage.CONTROLLER_EXTENSION.getRight().get(), p_155268_, p_155269_); + return (p_155268_, p_155269_) -> new ControllerExtensionTile(this, (BlockEntityType) FunctionalStorage.CONTROLLER_EXTENSION.type().get(), p_155268_, p_155269_); } @Override - public void registerRecipe(Consumer consumer) { - TitaniumShapedRecipeBuilder.shapedRecipe(FunctionalStorage.CONTROLLER_EXTENSION.getLeft().get()) + public void registerRecipe(RecipeOutput consumer) { + TitaniumShapedRecipeBuilder.shapedRecipe(FunctionalStorage.CONTROLLER_EXTENSION.block().get()) .pattern("IBI").pattern("CDC").pattern("IBI") .define('I', Tags.Items.STONE) .define('B', Tags.Items.STORAGE_BLOCKS_QUARTZ) diff --git a/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java index 44e86251..10e4675b 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java @@ -5,7 +5,7 @@ import com.buuz135.functionalstorage.block.tile.DrawerTile; import com.buuz135.functionalstorage.block.tile.ItemControllableDrawerTile; import com.buuz135.functionalstorage.block.tile.StorageControllerTile; -import com.buuz135.functionalstorage.inventory.item.DrawerCapabilityProvider; +import com.buuz135.functionalstorage.inventory.item.DrawerStackItemHandler; import com.buuz135.functionalstorage.item.ConfigurationToolItem; import com.buuz135.functionalstorage.item.LinkingToolItem; import com.buuz135.functionalstorage.recipe.DrawerlessWoodIngredient; @@ -14,6 +14,7 @@ import com.google.common.collect.MultimapBuilder; import com.hrznstudio.titanium.block.RotatableBlock; import com.hrznstudio.titanium.datagenerator.loot.block.BasicBlockLootTables; +import com.hrznstudio.titanium.module.BlockWithTile; import com.hrznstudio.titanium.recipe.generator.TitaniumShapedRecipeBuilder; import com.hrznstudio.titanium.tab.TitaniumTab; import com.hrznstudio.titanium.util.RayTraceUtils; @@ -22,7 +23,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.NonNullList; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; @@ -31,7 +32,6 @@ import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.tooltip.TooltipComponent; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; @@ -44,7 +44,6 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BooleanProperty; -import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.LootTable; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; @@ -56,17 +55,15 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; import net.neoforged.neoforge.common.Tags; -import net.neoforged.neoforge.common.capabilities.ICapabilityProvider; +import net.neoforged.neoforge.items.IItemHandler; import org.apache.commons.lang3.tuple.Pair; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import var; + import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import java.util.Optional; -import java.util.function.Consumer; public class DrawerBlock extends RotatableBlock { @@ -146,7 +143,7 @@ public RotationType getRotationType() { @Override public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { - return (blockPos, state) -> new DrawerTile(this, (BlockEntityType) FunctionalStorage.DRAWER_TYPES.get(type).stream().filter(registryObjectRegistryObjectPair -> registryObjectRegistryObjectPair.getLeft().get().equals(this)).map(Pair::getRight).findFirst().get().get(), blockPos, state, type, woodType); + return (blockPos, state) -> new DrawerTile(this, (BlockEntityType) FunctionalStorage.DRAWER_TYPES.get(type).stream().filter(registryObjectRegistryObjectPair -> registryObjectRegistryObjectPair.getBlock() == this).map(BlockWithTile::type).findFirst().get().get(), blockPos, state, type, woodType); } @Override @@ -272,13 +269,8 @@ public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @Nullabl } @Override - public void registerRecipe(Consumer consumer) { + public void registerRecipe(RecipeOutput consumer) { if (type == FunctionalStorage.DrawerType.X_1) { - TitaniumShapedRecipeBuilder.shapedRecipe(this) - .pattern("PPP").pattern("PCP").pattern("PPP") - .define('P', woodType.getPlanks()) - .define('C', Tags.Items.CHESTS_WOODEN) - .save(consumer); if (woodType.getName().equals("oak")){ TitaniumShapedRecipeBuilder.shapedRecipe(this) .setName(new ResourceLocation(FunctionalStorage.MOD_ID, "oak_drawer_alternate_x1")) @@ -286,14 +278,15 @@ public void registerRecipe(Consumer consumer) { .define('P', new DrawerlessWoodIngredient()) .define('C', Tags.Items.CHESTS_WOODEN) .save(consumer); + } else { + TitaniumShapedRecipeBuilder.shapedRecipe(this) + .pattern("PPP").pattern("PCP").pattern("PPP") + .define('P', woodType.getPlanks()) + .define('C', Tags.Items.CHESTS_WOODEN) + .save(consumer); } } if (type == FunctionalStorage.DrawerType.X_2){ - TitaniumShapedRecipeBuilder.shapedRecipe(this, 2) - .pattern("PCP").pattern("PPP").pattern("PCP") - .define('P', woodType.getPlanks()) - .define('C', Tags.Items.CHESTS_WOODEN) - .save(consumer); if (woodType.getName().equals("oak")){ TitaniumShapedRecipeBuilder.shapedRecipe(this, 2) .setName(new ResourceLocation(FunctionalStorage.MOD_ID, "oak_drawer_alternate_x2")) @@ -301,14 +294,15 @@ public void registerRecipe(Consumer consumer) { .define('P', new DrawerlessWoodIngredient()) .define('C', Tags.Items.CHESTS_WOODEN) .save(consumer); + } else { + TitaniumShapedRecipeBuilder.shapedRecipe(this, 2) + .pattern("PCP").pattern("PPP").pattern("PCP") + .define('P', woodType.getPlanks()) + .define('C', Tags.Items.CHESTS_WOODEN) + .save(consumer); } } if (type == FunctionalStorage.DrawerType.X_4){ - TitaniumShapedRecipeBuilder.shapedRecipe(this, 4) - .pattern("CPC").pattern("PPP").pattern("CPC") - .define('P', woodType.getPlanks()) - .define('C', Tags.Items.CHESTS_WOODEN) - .save(consumer); if (woodType.getName().equals("oak")){ TitaniumShapedRecipeBuilder.shapedRecipe(this, 4) .setName(new ResourceLocation(FunctionalStorage.MOD_ID, "oak_drawer_alternate_x4")) @@ -316,6 +310,12 @@ public void registerRecipe(Consumer consumer) { .define('P', new DrawerlessWoodIngredient()) .define('C', Tags.Items.CHESTS_WOODEN) .save(consumer); + } else { + TitaniumShapedRecipeBuilder.shapedRecipe(this, 4) + .pattern("CPC").pattern("PPP").pattern("CPC") + .define('P', woodType.getPlanks()) + .define('C', Tags.Items.CHESTS_WOODEN) + .save(consumer); } } } @@ -390,15 +390,9 @@ public DrawerItem(DrawerBlock p_40565_, net.minecraft.world.item.Item.Properties tab.getTabList().add(this); } - @Override - public Optional getTooltipImage(ItemStack stack) { - return super.getTooltipImage(stack); - } - @Nullable - @Override - public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundTag nbt) { - return new DrawerCapabilityProvider(stack, this.drawerBlock.getType()); + public IItemHandler initCapabilities(ItemStack stack) { + return new DrawerStackItemHandler(stack, this.drawerBlock.getType()); } } diff --git a/src/main/java/com/buuz135/functionalstorage/block/DrawerControllerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/DrawerControllerBlock.java index 5a7a7c5a..da204ed2 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/DrawerControllerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/DrawerControllerBlock.java @@ -5,7 +5,7 @@ import com.buuz135.functionalstorage.util.StorageTags; import com.hrznstudio.titanium.datagenerator.loot.block.BasicBlockLootTables; import com.hrznstudio.titanium.recipe.generator.TitaniumShapedRecipeBuilder; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntityType; @@ -13,22 +13,20 @@ import net.neoforged.neoforge.common.Tags; import org.jetbrains.annotations.NotNull; -import java.util.function.Consumer; - public class DrawerControllerBlock extends StorageControllerBlock { public DrawerControllerBlock() { - super("storage_controller", Properties.copy(Blocks.IRON_BLOCK), DrawerControllerTile.class); + super("storage_controller", Properties.ofFullCopy(Blocks.IRON_BLOCK), DrawerControllerTile.class); } @Override public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { - return (p_155268_, p_155269_) -> new DrawerControllerTile(this, (BlockEntityType) FunctionalStorage.DRAWER_CONTROLLER.getRight().get(), p_155268_, p_155269_); + return (p_155268_, p_155269_) -> new DrawerControllerTile(this, (BlockEntityType) FunctionalStorage.DRAWER_CONTROLLER.type().get(), p_155268_, p_155269_); } @Override - public void registerRecipe(Consumer consumer) { - TitaniumShapedRecipeBuilder.shapedRecipe(FunctionalStorage.DRAWER_CONTROLLER.getLeft().get()) + public void registerRecipe(RecipeOutput consumer) { + TitaniumShapedRecipeBuilder.shapedRecipe(FunctionalStorage.DRAWER_CONTROLLER.block().get()) .pattern("IBI").pattern("CDC").pattern("IBI") .define('I', Tags.Items.STONE) .define('B', Tags.Items.STORAGE_BLOCKS_QUARTZ) diff --git a/src/main/java/com/buuz135/functionalstorage/block/EnderDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/EnderDrawerBlock.java index 483a4e11..eb9390a8 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/EnderDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/EnderDrawerBlock.java @@ -1,7 +1,10 @@ package com.buuz135.functionalstorage.block; import com.buuz135.functionalstorage.FunctionalStorage; -import com.buuz135.functionalstorage.block.tile.*; +import com.buuz135.functionalstorage.block.tile.ControllableDrawerTile; +import com.buuz135.functionalstorage.block.tile.EnderDrawerTile; +import com.buuz135.functionalstorage.block.tile.ItemControllableDrawerTile; +import com.buuz135.functionalstorage.block.tile.StorageControllerTile; import com.buuz135.functionalstorage.item.LinkingToolItem; import com.hrznstudio.titanium.block.RotatableBlock; import com.hrznstudio.titanium.datagenerator.loot.block.BasicBlockLootTables; @@ -11,15 +14,18 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.NonNullList; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; -import net.minecraft.util.Mth; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.*; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; @@ -28,7 +34,6 @@ import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; -import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.LootTable; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; @@ -38,7 +43,6 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import net.neoforged.neoforge.registries.ForgeRegistries; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -47,7 +51,6 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; -import java.util.function.Consumer; import java.util.stream.Collectors; import static com.buuz135.functionalstorage.block.DrawerBlock.LOCKED; @@ -55,7 +58,7 @@ public class EnderDrawerBlock extends RotatableBlock { public EnderDrawerBlock() { - super("ender_drawer", Properties.copy(Blocks.ENDER_CHEST), EnderDrawerTile.class); + super("ender_drawer", Properties.ofFullCopy(Blocks.ENDER_CHEST), EnderDrawerTile.class); setItemGroup(FunctionalStorage.TAB); registerDefaultState(defaultBlockState().setValue(RotatableBlock.FACING_HORIZONTAL, Direction.NORTH).setValue(LOCKED, false)); } @@ -64,7 +67,7 @@ public EnderDrawerBlock() { public static List getFrequencyDisplay(String string){ return FREQUENCY_LOOK.computeIfAbsent(string, s -> { - List minecraftItems = ForgeRegistries.ITEMS.getValues().stream().filter(item -> item != Items.AIR && ForgeRegistries.ITEMS.getKey(item).getNamespace().equals("minecraft") && !(item instanceof BlockItem)).collect(Collectors.toList()); + List minecraftItems = BuiltInRegistries.ITEM.stream().filter(item -> item != Items.AIR && BuiltInRegistries.ITEM.getKey(item).getNamespace().equals("minecraft") && !(item instanceof BlockItem)).collect(Collectors.toList()); return Arrays.stream(string.split("-")).map(s1 -> new ItemStack(minecraftItems.get(Math.abs(s1.hashCode()) % minecraftItems.size()))).collect(Collectors.toList()); }); } @@ -83,7 +86,7 @@ public RotationType getRotationType() { @Override public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { - return (blockPos, state) -> new EnderDrawerTile(this, (BlockEntityType) FunctionalStorage.ENDER_DRAWER.getRight().get(),blockPos, state); + return (blockPos, state) -> new EnderDrawerTile(this, (BlockEntityType) FunctionalStorage.ENDER_DRAWER.type().get(),blockPos, state); } @Override @@ -182,11 +185,6 @@ public NonNullList getDynamicDrops(BlockState state, Level worldIn, B return NonNullList.create(); } - @Override - public void registerRecipe(Consumer consumer) { - - } - @Override public void onRemove(BlockState state, Level worldIn, BlockPos pos, BlockState newState, boolean isMoving) { if (!state.is(newState.getBlock())){ diff --git a/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java index 170c7e38..a1bf5321 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java @@ -4,7 +4,7 @@ import com.buuz135.functionalstorage.block.tile.ControllableDrawerTile; import com.buuz135.functionalstorage.block.tile.FluidDrawerTile; import com.buuz135.functionalstorage.block.tile.StorageControllerTile; -import com.buuz135.functionalstorage.inventory.item.DrawerCapabilityProvider; +import com.buuz135.functionalstorage.inventory.item.DrawerStackItemHandler; import com.buuz135.functionalstorage.item.ConfigurationToolItem; import com.buuz135.functionalstorage.item.LinkingToolItem; import com.buuz135.functionalstorage.util.NumberUtils; @@ -17,7 +17,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.NonNullList; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.tags.ItemTags; @@ -25,7 +25,6 @@ import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.tooltip.TooltipComponent; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; @@ -37,7 +36,6 @@ import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; -import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.LootTable; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; @@ -47,16 +45,14 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import net.neoforged.neoforge.common.capabilities.ICapabilityProvider; import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.items.IItemHandler; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import var; + import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; -import java.util.Optional; -import java.util.function.Consumer; public class FluidDrawerBlock extends RotatableBlock { @@ -97,12 +93,12 @@ public RotationType getRotationType() { @Override public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { return (blockPos, state) -> { - BlockEntityType entityType = (BlockEntityType) FunctionalStorage.FLUID_DRAWER_1.getRight().get(); + BlockEntityType entityType = (BlockEntityType) FunctionalStorage.FLUID_DRAWER_1.type().get(); if (type == FunctionalStorage.DrawerType.X_2) { - entityType = (BlockEntityType) FunctionalStorage.FLUID_DRAWER_2.getRight().get(); + entityType = (BlockEntityType) FunctionalStorage.FLUID_DRAWER_2.type().get(); } if (type == FunctionalStorage.DrawerType.X_4) { - entityType = (BlockEntityType) FunctionalStorage.FLUID_DRAWER_4.getRight().get(); + entityType = (BlockEntityType) FunctionalStorage.FLUID_DRAWER_4.type().get(); } return new FluidDrawerTile(this, entityType, blockPos, state, type); }; @@ -222,7 +218,7 @@ public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @Nullabl } @Override - public void registerRecipe(Consumer consumer) { + public void registerRecipe(RecipeOutput consumer) { if (type == FunctionalStorage.DrawerType.X_1) { TitaniumShapedRecipeBuilder.shapedRecipe(this) .pattern("PPP").pattern("PCP").pattern("PPP") @@ -314,17 +310,8 @@ public DrawerItem(FluidDrawerBlock p_40565_, net.minecraft.world.item.Item.Prope this.drawerBlock = p_40565_; } - @Override - public Optional getTooltipImage(ItemStack stack) { - return super.getTooltipImage(stack); - } - - @Nullable - @Override - public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundTag nbt) { - return new DrawerCapabilityProvider(stack, this.drawerBlock.getType()); + public IItemHandler initCapabilities(ItemStack stack, @Nullable CompoundTag nbt) { + return new DrawerStackItemHandler(stack, this.drawerBlock.getType()); } } - - } diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java index d81130d6..62230a4e 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java @@ -2,24 +2,22 @@ import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.block.tile.FramedControllerExtensionTile; -import com.buuz135.functionalstorage.block.tile.FramedDrawerControllerTile; import com.buuz135.functionalstorage.util.StorageTags; import com.hrznstudio.titanium.recipe.generator.TitaniumShapedRecipeBuilder; import com.hrznstudio.titanium.util.TileUtil; import net.minecraft.core.BlockPos; import net.minecraft.core.NonNullList; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; -import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.HitResult; @@ -27,17 +25,16 @@ import org.jetbrains.annotations.Nullable; import java.util.List; -import java.util.function.Consumer; public class FramedControllerExtensionBlock extends StorageControllerExtensionBlock{ public FramedControllerExtensionBlock() { - super("framed_controller_extension", Properties.copy(Blocks.IRON_BLOCK).noOcclusion().isViewBlocking(((p_61036_, p_61037_, p_61038_) -> false)), FramedControllerExtensionTile.class); + super("framed_controller_extension", Properties.ofFullCopy(Blocks.IRON_BLOCK).noOcclusion().isViewBlocking(((p_61036_, p_61037_, p_61038_) -> false)), FramedControllerExtensionTile.class); } @Override public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { - return ((p_155268_, p_155269_) -> new FramedControllerExtensionTile(this, (BlockEntityType) FunctionalStorage.FRAMED_CONTROLLER_EXTENSION.getRight().get(), p_155268_, p_155269_)); + return ((p_155268_, p_155269_) -> new FramedControllerExtensionTile(this, (BlockEntityType) FunctionalStorage.FRAMED_CONTROLLER_EXTENSION.type().get(), p_155268_, p_155269_)); } @Override @@ -67,7 +64,7 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) } @Override - public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter level, BlockPos pos, Player player) { + public ItemStack getCloneItemStack(BlockState state, HitResult target, LevelReader level, BlockPos pos, Player player) { BlockEntity blockEntity = level.getBlockEntity(pos); if(blockEntity instanceof FramedControllerExtensionTile framedControllerExtensionTile) { @@ -85,8 +82,8 @@ public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGett } @Override - public void registerRecipe(Consumer consumer) { - TitaniumShapedRecipeBuilder.shapedRecipe(FunctionalStorage.FRAMED_CONTROLLER_EXTENSION.getLeft().get()) + public void registerRecipe(RecipeOutput consumer) { + TitaniumShapedRecipeBuilder.shapedRecipe(FunctionalStorage.FRAMED_CONTROLLER_EXTENSION.block().get()) .pattern("IBI").pattern("CDC").pattern("IBI") .define('I', Items.IRON_NUGGET) .define('B', Tags.Items.STORAGE_BLOCKS_QUARTZ) diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java index f22f5a20..ed8f0323 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java @@ -5,12 +5,14 @@ import com.buuz135.functionalstorage.block.tile.FramedDrawerTile; import com.buuz135.functionalstorage.client.model.FramedDrawerModelData; import com.buuz135.functionalstorage.util.DrawerWoodType; +import com.hrznstudio.titanium.module.BlockWithTile; import com.hrznstudio.titanium.recipe.generator.TitaniumShapedRecipeBuilder; import com.hrznstudio.titanium.util.TileUtil; import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; import net.minecraft.core.NonNullList; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; @@ -22,33 +24,30 @@ import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.HitResult; import net.neoforged.neoforge.common.Tags; import net.neoforged.neoforge.items.ItemHandlerHelper; -import net.neoforged.neoforge.registries.ForgeRegistries; -import org.apache.commons.lang3.tuple.Pair; import org.jetbrains.annotations.Nullable; import java.util.HashMap; import java.util.List; -import java.util.function.Consumer; public class FramedDrawerBlock extends DrawerBlock{ public FramedDrawerBlock(FunctionalStorage.DrawerType type) { - super(DrawerWoodType.FRAMED, type, Properties.copy(Blocks.OAK_PLANKS).noOcclusion().isViewBlocking((p_61036_, p_61037_, p_61038_) -> false)); + super(DrawerWoodType.FRAMED, type, Properties.ofFullCopy(Blocks.OAK_PLANKS).noOcclusion().isViewBlocking((p_61036_, p_61037_, p_61038_) -> false)); } @Override public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { - return (blockPos, state) -> new FramedDrawerTile(this, (BlockEntityType) FunctionalStorage.DRAWER_TYPES.get(this.getType()).stream().filter(registryObjectRegistryObjectPair -> registryObjectRegistryObjectPair.getLeft().get().equals(this)).map(Pair::getRight).findFirst().get().get(), blockPos, state, this.getType()); + return (blockPos, state) -> new FramedDrawerTile(this, (BlockEntityType) FunctionalStorage.DRAWER_TYPES.get(this.getType()).stream().filter(registryObjectRegistryObjectPair -> registryObjectRegistryObjectPair.getBlock() == this).map(BlockWithTile::type).findFirst().get().get(), blockPos, state, this.getType()); } @Override @@ -64,10 +63,10 @@ public static FramedDrawerModelData getDrawerModelData(ItemStack stack){ CompoundTag tag = stack.getTag().getCompound("Style"); if (tag.isEmpty()) return null; HashMap data = new HashMap<>(); - data.put("particle", ForgeRegistries.ITEMS.getValue(new ResourceLocation(tag.getString("particle")))); - data.put("front", ForgeRegistries.ITEMS.getValue(new ResourceLocation(tag.getString("front")))); - data.put("side", ForgeRegistries.ITEMS.getValue(new ResourceLocation(tag.getString("side")))); - data.put("front_divider", ForgeRegistries.ITEMS.getValue(new ResourceLocation(tag.getString("front_divider")))); + data.put("particle", BuiltInRegistries.ITEM.get(new ResourceLocation(tag.getString("particle")))); + data.put("front", BuiltInRegistries.ITEM.get(new ResourceLocation(tag.getString("front")))); + data.put("side", BuiltInRegistries.ITEM.get(new ResourceLocation(tag.getString("side")))); + data.put("front_divider", BuiltInRegistries.ITEM.get(new ResourceLocation(tag.getString("front_divider")))); return new FramedDrawerModelData(data); } return null; @@ -76,13 +75,13 @@ public static FramedDrawerModelData getDrawerModelData(ItemStack stack){ public static ItemStack fill(ItemStack first, ItemStack second, ItemStack drawer, ItemStack divider){ drawer = ItemHandlerHelper.copyStackWithSize(drawer, 1); CompoundTag style = drawer.getOrCreateTagElement("Style"); - style.putString("particle", ForgeRegistries.ITEMS.getKey(first.getItem()).toString()); - style.putString("side", ForgeRegistries.ITEMS.getKey(first.getItem()).toString()); - style.putString("front", ForgeRegistries.ITEMS.getKey(second.getItem()).toString()); + style.putString("particle", BuiltInRegistries.ITEM.getKey(first.getItem()).toString()); + style.putString("side", BuiltInRegistries.ITEM.getKey(first.getItem()).toString()); + style.putString("front", BuiltInRegistries.ITEM.getKey(second.getItem()).toString()); if (divider.isEmpty()){ - style.putString("front_divider", ForgeRegistries.ITEMS.getKey(first.getItem()).toString()); + style.putString("front_divider", BuiltInRegistries.ITEM.getKey(first.getItem()).toString()); } else { - style.putString("front_divider", ForgeRegistries.ITEMS.getKey(divider.getItem()).toString()); + style.putString("front_divider", BuiltInRegistries.ITEM.getKey(divider.getItem()).toString()); } drawer.getOrCreateTag().put("Style", style); return drawer; @@ -109,7 +108,7 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) } @Override - public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter level, BlockPos pos, Player player) { + public ItemStack getCloneItemStack(BlockState state, HitResult target, LevelReader level, BlockPos pos, Player player) { BlockEntity entity = level.getBlockEntity(pos); if (entity instanceof FramedDrawerTile framedDrawerTile && framedDrawerTile.getFramedDrawerModelData() != null && !framedDrawerTile.getFramedDrawerModelData().getDesign().isEmpty()){ ItemStack stack = new ItemStack(this); @@ -120,7 +119,7 @@ public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGett } @Override - public void registerRecipe(Consumer consumer) { + public void registerRecipe(RecipeOutput consumer) { if (this.getType() == FunctionalStorage.DrawerType.X_1) { TitaniumShapedRecipeBuilder.shapedRecipe(this) .pattern("PPP").pattern("PCP").pattern("PPP") diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerControllerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerControllerBlock.java index 04554f05..94291390 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerControllerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerControllerBlock.java @@ -7,18 +7,17 @@ import com.hrznstudio.titanium.util.TileUtil; import net.minecraft.core.BlockPos; import net.minecraft.core.NonNullList; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; -import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.HitResult; @@ -26,17 +25,16 @@ import org.jetbrains.annotations.Nullable; import java.util.List; -import java.util.function.Consumer; public class FramedDrawerControllerBlock extends StorageControllerBlock { public FramedDrawerControllerBlock() { - super("framed_storage_controller", Properties.copy(Blocks.IRON_BLOCK).noOcclusion().isViewBlocking(((p_61036_, p_61037_, p_61038_) -> false)), FramedDrawerControllerTile.class); + super("framed_storage_controller", Properties.ofFullCopy(Blocks.IRON_BLOCK).noOcclusion().isViewBlocking(((p_61036_, p_61037_, p_61038_) -> false)), FramedDrawerControllerTile.class); } @Override public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { - return (p_155268_, p_155269_) -> new FramedDrawerControllerTile(this, (BlockEntityType) FunctionalStorage.FRAMED_DRAWER_CONTROLLER.getRight().get(), p_155268_, p_155269_); + return (p_155268_, p_155269_) -> new FramedDrawerControllerTile(this, (BlockEntityType) FunctionalStorage.FRAMED_DRAWER_CONTROLLER.type().get(), p_155268_, p_155269_); } @Override @@ -66,7 +64,7 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) } @Override - public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter level, BlockPos pos, Player player) { + public ItemStack getCloneItemStack(BlockState state, HitResult target, LevelReader level, BlockPos pos, Player player) { BlockEntity blockEntity = level.getBlockEntity(pos); if(blockEntity instanceof FramedDrawerControllerTile framedDrawerControllerTile) { @@ -84,8 +82,8 @@ public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGett } @Override - public void registerRecipe(Consumer consumer) { - TitaniumShapedRecipeBuilder.shapedRecipe(FunctionalStorage.FRAMED_DRAWER_CONTROLLER.getLeft().get()) + public void registerRecipe(RecipeOutput consumer) { + TitaniumShapedRecipeBuilder.shapedRecipe(FunctionalStorage.FRAMED_DRAWER_CONTROLLER.block().get()) .pattern("IBI").pattern("CDC").pattern("IBI") .define('I', Items.IRON_NUGGET) .define('B', Tags.Items.STORAGE_BLOCKS_QUARTZ) diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedSimpleCompactingDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedSimpleCompactingDrawerBlock.java index c9a3eb1b..150df6f3 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedSimpleCompactingDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedSimpleCompactingDrawerBlock.java @@ -9,7 +9,7 @@ import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; import net.minecraft.core.NonNullList; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; @@ -18,11 +18,11 @@ import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.HitResult; @@ -30,16 +30,15 @@ import org.jetbrains.annotations.Nullable; import java.util.List; -import java.util.function.Consumer; public class FramedSimpleCompactingDrawerBlock extends SimpleCompactingDrawerBlock { public FramedSimpleCompactingDrawerBlock(String name) { - super(name, Properties.copy(Blocks.STONE).noOcclusion().isViewBlocking((p_61036_, p_61037_, p_61038_) -> false)); + super(name, Properties.ofFullCopy(Blocks.STONE).noOcclusion().isViewBlocking((p_61036_, p_61037_, p_61038_) -> false)); } @Override public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { - return (blockPos, state) -> new FramedSimpleCompactingDrawerTile(this, (BlockEntityType) FunctionalStorage.FRAMED_SIMPLE_COMPACTING_DRAWER.getValue().get(), blockPos, state); + return (blockPos, state) -> new FramedSimpleCompactingDrawerTile(this, (BlockEntityType) FunctionalStorage.FRAMED_SIMPLE_COMPACTING_DRAWER.type().get(), blockPos, state); } @Override @@ -72,7 +71,7 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) } @Override - public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter level, BlockPos pos, Player player) { + public ItemStack getCloneItemStack(BlockState state, HitResult target, LevelReader level, BlockPos pos, Player player) { BlockEntity entity = level.getBlockEntity(pos); if (entity instanceof FramedSimpleCompactingDrawerTile framedDrawerTile && framedDrawerTile.getFramedDrawerModelData() != null && !framedDrawerTile.getFramedDrawerModelData().getDesign().isEmpty()) { ItemStack stack = new ItemStack(this); @@ -83,7 +82,7 @@ public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGett } @Override - public void registerRecipe(Consumer consumer) { + public void registerRecipe(RecipeOutput consumer) { TitaniumShapedRecipeBuilder.shapedRecipe(this) .pattern("SSS").pattern("SDP").pattern("SIS") .define('S', Items.IRON_NUGGET) diff --git a/src/main/java/com/buuz135/functionalstorage/block/SimpleCompactingDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/SimpleCompactingDrawerBlock.java index 7c8dd4e7..740d7a48 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/SimpleCompactingDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/SimpleCompactingDrawerBlock.java @@ -17,7 +17,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.NonNullList; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.world.InteractionHand; @@ -34,7 +34,6 @@ import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; -import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.LootTable; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; @@ -47,11 +46,10 @@ import net.neoforged.neoforge.common.Tags; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import var; + import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; -import java.util.function.Consumer; public class SimpleCompactingDrawerBlock extends RotatableBlock { @@ -78,7 +76,7 @@ public RotationType getRotationType() { @Override public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { - return (blockPos, state) -> new SimpleCompactingDrawerTile(this, (BlockEntityType) FunctionalStorage.SIMPLE_COMPACTING_DRAWER.getRight().get(), blockPos, state); + return (blockPos, state) -> new SimpleCompactingDrawerTile(this, (BlockEntityType) FunctionalStorage.SIMPLE_COMPACTING_DRAWER.type().get(), blockPos, state); } @Override @@ -201,7 +199,7 @@ public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @Nullabl } @Override - public void registerRecipe(Consumer consumer) { + public void registerRecipe(RecipeOutput consumer) { TitaniumShapedRecipeBuilder.shapedRecipe(this) .pattern("SSS").pattern("SDP").pattern("SIS") .define('S', Blocks.STONE) diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/ArmoryCabinetTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/ArmoryCabinetTile.java index c22bf303..a943b775 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/ArmoryCabinetTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/ArmoryCabinetTile.java @@ -5,26 +5,20 @@ import com.hrznstudio.titanium.block.BasicTileBlock; import com.hrznstudio.titanium.block.tile.ActiveTile; import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.Connection; import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.neoforged.neoforge.common.capabilities.Capabilities; -import net.neoforged.neoforge.common.capabilities.Capability; -import net.neoforged.neoforge.common.util.LazyOptional; import net.neoforged.neoforge.items.IItemHandler; import org.jetbrains.annotations.NotNull; import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class ArmoryCabinetTile extends ActiveTile { @Save public ArmoryCabinetInventoryHandler handler; - private final LazyOptional lazyStorage; public ArmoryCabinetTile(BasicTileBlock base, BlockEntityType entityType, BlockPos pos, BlockState state) { super(base, entityType, pos, state); @@ -34,26 +28,12 @@ public void onChange() { ArmoryCabinetTile.this.markForUpdate(); } }; - this.lazyStorage = LazyOptional.of(() -> handler); - } - - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == Capabilities.ITEM_HANDLER) { - return lazyStorage.cast(); - } - return super.getCapability(cap, side); } public IItemHandler getStorage() { return handler; } - public LazyOptional getOptional() { - return lazyStorage; - } - @Override public ClientboundBlockEntityDataPacket getUpdatePacket() { return ClientboundBlockEntityDataPacket.create(this, blockEntity -> new CompoundTag()); @@ -85,10 +65,4 @@ public boolean isEverythingEmpty() { public ArmoryCabinetTile getSelf() { return this; } - - @Override - public void invalidateCaps() { - super.invalidateCaps(); - getOptional().invalidate(); - } } diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingDrawerTile.java index 3dd5fd72..2bad0f79 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingDrawerTile.java @@ -18,21 +18,14 @@ import net.minecraft.world.level.block.state.BlockState; import net.neoforged.api.distmarker.Dist; import net.neoforged.api.distmarker.OnlyIn; -import net.neoforged.neoforge.common.capabilities.Capabilities; -import net.neoforged.neoforge.common.capabilities.Capability; -import net.neoforged.neoforge.common.util.LazyOptional; import net.neoforged.neoforge.items.IItemHandler; import org.apache.commons.lang3.tuple.Pair; import org.jetbrains.annotations.NotNull; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - public class CompactingDrawerTile extends ItemControllableDrawerTile { @Save public CompactingInventoryHandler handler; - private final LazyOptional lazyStorage; private boolean hasCheckedRecipes; public CompactingDrawerTile(BasicTileBlock base, BlockEntityType blockEntityType, BlockPos pos, BlockState state) { @@ -69,7 +62,6 @@ public boolean isLocked() { } }; - lazyStorage = LazyOptional.of(() -> this.handler); this.hasCheckedRecipes = false; } @@ -133,25 +125,11 @@ public IItemHandler getStorage() { return handler; } - @Override - public LazyOptional getOptional() { - return lazyStorage; - } - @Override public int getBaseSize(int slot) { return handler.getSlotLimitBase(slot); } - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == Capabilities.ITEM_HANDLER) { - return lazyStorage.cast(); - } - return super.getCapability(cap, side); - } - @NotNull @Override public CompactingDrawerTile getSelf() { diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/ControllableDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/ControllableDrawerTile.java index 4952426b..9141559a 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/ControllableDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/ControllableDrawerTile.java @@ -29,7 +29,7 @@ import net.neoforged.api.distmarker.OnlyIn; import net.neoforged.neoforge.common.util.INBTSerializable; import net.neoforged.neoforge.items.ItemHandlerHelper; -import var; + import java.util.HashMap; public abstract class ControllableDrawerTile> extends ActiveTile { @@ -298,11 +298,6 @@ public InventoryComponent> getStorageUpgrades() { return storageUpgrades; } - @Override - public void invalidateCaps() { - super.invalidateCaps(); - } - public boolean isEverythingEmpty() { for (int i = 0; i < getStorageUpgrades().getSlots(); i++) { if (!getStorageUpgrades().getStackInSlot(i).isEmpty()) { diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/DrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/DrawerTile.java index b226932b..4825b560 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/DrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/DrawerTile.java @@ -17,20 +17,13 @@ import net.minecraft.world.level.block.state.BlockState; import net.neoforged.api.distmarker.Dist; import net.neoforged.api.distmarker.OnlyIn; -import net.neoforged.neoforge.common.capabilities.Capabilities; -import net.neoforged.neoforge.common.capabilities.Capability; -import net.neoforged.neoforge.common.util.LazyOptional; import net.neoforged.neoforge.items.IItemHandler; import org.jetbrains.annotations.NotNull; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - public class DrawerTile extends ItemControllableDrawerTile { @Save public BigInventoryHandler handler; - private final LazyOptional lazyStorage; private FunctionalStorage.DrawerType type; private IWoodType woodType; @@ -71,7 +64,6 @@ public boolean isCreative() { }; - lazyStorage = LazyOptional.of(() -> this.handler); } @OnlyIn(Dist.CLIENT) @@ -87,15 +79,6 @@ public void initClient() { )); } - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == Capabilities.ITEM_HANDLER) { - return lazyStorage.cast(); - } - return super.getCapability(cap, side); - } - public InteractionResult onSlotActivated(Player playerIn, InteractionHand hand, Direction facing, double hitX, double hitY, double hitZ, int slot) { ItemStack stack = playerIn.getItemInHand(hand); if (stack.getItem().equals(FunctionalStorage.CONFIGURATION_TOOL.get()) || stack.getItem().equals(FunctionalStorage.LINKING_TOOL.get())) return InteractionResult.PASS; @@ -128,11 +111,6 @@ public IItemHandler getStorage() { return handler; } - @Override - public LazyOptional getOptional() { - return lazyStorage; - } - @Override public int getBaseSize(int lost) { return type.getSlotAmount(); diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/EnderDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/EnderDrawerTile.java index b0538d97..ee2daa5a 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/EnderDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/EnderDrawerTile.java @@ -21,33 +21,27 @@ import net.minecraft.world.level.block.state.BlockState; import net.neoforged.api.distmarker.Dist; import net.neoforged.api.distmarker.OnlyIn; -import net.neoforged.neoforge.common.capabilities.Capabilities; -import net.neoforged.neoforge.common.capabilities.Capability; -import net.neoforged.neoforge.common.util.LazyOptional; import net.neoforged.neoforge.items.IItemHandler; import org.jetbrains.annotations.NotNull; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import java.util.UUID; public class EnderDrawerTile extends ItemControllableDrawerTile { @Save private String frequency; - private LazyOptional lazyStorage; + private IItemHandler storage; public EnderDrawerTile(BasicTileBlock base, BlockEntityType blockEntityType, BlockPos pos, BlockState state) { super(base, blockEntityType, pos, state); this.frequency = UUID.randomUUID().toString(); - this.lazyStorage = LazyOptional.empty(); } @Override public void setLevel(Level p_155231_) { super.setLevel(p_155231_); - this.lazyStorage.invalidate(); - this.lazyStorage = LazyOptional.of(() -> EnderSavedData.getInstance(this.level).getFrequency(this.frequency)); + this.invalidateCapabilities(); + this.storage = EnderSavedData.getInstance(this.level).getFrequency(this.frequency); } @OnlyIn(Dist.CLIENT) @@ -63,15 +57,6 @@ public void initClient() { )); } - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == Capabilities.ITEM_HANDLER) { - return lazyStorage.cast(); - } - return super.getCapability(cap, side); - } - @Override public void serverTick(Level level, BlockPos pos, BlockState state, EnderDrawerTile blockEntity) { super.serverTick(level, pos, state, blockEntity); @@ -144,12 +129,7 @@ public int getStorageSlotAmount() { @Override public IItemHandler getStorage() { - return this.lazyStorage.resolve().get(); - } - - @Override - public LazyOptional getOptional() { - return this.lazyStorage; + return this.storage; } @Override @@ -181,8 +161,8 @@ public int getBaseSize(int lost) { public void setFrequency(String frequency) { if (frequency == null) return; this.frequency = frequency; - this.lazyStorage.invalidate(); - this.lazyStorage = LazyOptional.of(() -> EnderSavedData.getInstance(this.level).getFrequency(this.frequency)); + this.invalidateCapabilities(); + this.storage = EnderSavedData.getInstance(this.level).getFrequency(this.frequency); this.markForUpdate(); } diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java index 1cbfd741..d747e711 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java @@ -9,10 +9,11 @@ import com.hrznstudio.titanium.annotation.Save; import com.hrznstudio.titanium.block.BasicTileBlock; import com.hrznstudio.titanium.component.inventory.InventoryComponent; -import com.hrznstudio.titanium.util.TileUtil; +import com.mojang.authlib.GameProfile; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.level.ServerLevel; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; @@ -24,24 +25,22 @@ import net.minecraft.world.level.block.state.BlockState; import net.neoforged.api.distmarker.Dist; import net.neoforged.api.distmarker.OnlyIn; -import net.neoforged.neoforge.common.capabilities.Capabilities; -import net.neoforged.neoforge.common.capabilities.Capability; -import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.common.util.FakePlayerFactory; import net.neoforged.neoforge.fluids.FluidUtil; import net.neoforged.neoforge.fluids.IFluidBlock; import net.neoforged.neoforge.fluids.capability.IFluidHandler; import net.neoforged.neoforge.fluids.capability.wrappers.BucketPickupHandlerWrapper; import net.neoforged.neoforge.fluids.capability.wrappers.FluidBlockWrapper; import org.jetbrains.annotations.NotNull; -import var; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -public class FluidDrawerTile extends ControllableDrawerTile { +import java.util.Optional; +import java.util.UUID; - public LazyOptional fluidHandlerLazyOptional; +public class FluidDrawerTile extends ControllableDrawerTile { + public static final GameProfile FP = new GameProfile(UUID.fromString("FunctionalStorage-Pickup"), "FunctionalStorage-Pickp"); @Save - private BigFluidHandler fluidHandler; + public BigFluidHandler fluidHandler; private FunctionalStorage.DrawerType type; public FluidDrawerTile(BasicTileBlock base, BlockEntityType blockEntityType, BlockPos pos, BlockState state, FunctionalStorage.DrawerType type) { @@ -68,7 +67,6 @@ public boolean isDrawerCreative() { return isCreative(); } }; - this.fluidHandlerLazyOptional = LazyOptional.of(() -> fluidHandler); } private int getTankCapacity(int storageMultiplier) { @@ -97,18 +95,6 @@ public void initClient() { )); } - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == Capabilities.ITEM_HANDLER) { - return LazyOptional.empty(); - } - if (cap == Capabilities.FLUID_HANDLER) { - return fluidHandlerLazyOptional.cast(); - } - return super.getCapability(cap, side); - } - @Override public double getStorageDiv() { return 2; @@ -124,40 +110,38 @@ public void serverTick(Level level, BlockPos pos, BlockState stateOwn, FluidDraw var item = stack.getItem(); if (item.equals(FunctionalStorage.PUSHING_UPGRADE.get())) { var direction = UpgradeItem.getDirection(stack); - TileUtil.getTileEntity(level, pos.relative(direction)).ifPresent(blockEntity1 -> { - blockEntity1.getCapability(ForgeCapabilities.FLUID_HANDLER, direction.getOpposite()).ifPresent(otherFluidHandler -> { - for (int tankId = 0; tankId < this.getFluidHandler().getTanks(); tankId++) { - var fluidTank = this.fluidHandler.getTankList()[tankId]; - if (fluidTank.getFluid().isEmpty()) continue; - var extracted = fluidTank.drain(FunctionalStorageConfig.UPGRADE_PUSH_FLUID, IFluidHandler.FluidAction.SIMULATE); - if (extracted.isEmpty()) continue; - var insertedAmount = otherFluidHandler.fill(extracted, IFluidHandler.FluidAction.EXECUTE); - if (insertedAmount > 0) { - fluidTank.drain(insertedAmount, IFluidHandler.FluidAction.EXECUTE); - this.fluidHandler.onChange(); - break; - } + var otherFluidHandler = level.getCapability(Capabilities.FluidHandler.BLOCK, pos.relative(direction), direction.getOpposite()); + if (otherFluidHandler != null) { + for (int tankId = 0; tankId < this.getFluidHandler().getTanks(); tankId++) { + var fluidTank = this.fluidHandler.getTankList()[tankId]; + if (fluidTank.getFluid().isEmpty()) continue; + var extracted = fluidTank.drain(FunctionalStorageConfig.UPGRADE_PUSH_FLUID, IFluidHandler.FluidAction.SIMULATE); + if (extracted.isEmpty()) continue; + var insertedAmount = otherFluidHandler.fill(extracted, IFluidHandler.FluidAction.EXECUTE); + if (insertedAmount > 0) { + fluidTank.drain(insertedAmount, IFluidHandler.FluidAction.EXECUTE); + this.fluidHandler.onChange(); + break; } - }); - }); + } + } } if (item.equals(FunctionalStorage.PULLING_UPGRADE.get())) { var direction = UpgradeItem.getDirection(stack); - TileUtil.getTileEntity(level, pos.relative(direction)).ifPresent(blockEntity1 -> { - blockEntity1.getCapability(ForgeCapabilities.FLUID_HANDLER, direction.getOpposite()).ifPresent(otherFluidHandler -> { - for (int tankId = 0; tankId < this.getFluidHandler().getTanks(); tankId++) { - var fluidTank = this.fluidHandler.getTankList()[tankId]; - var extracted = otherFluidHandler.drain(FunctionalStorageConfig.UPGRADE_PULL_FLUID, IFluidHandler.FluidAction.SIMULATE); - if (extracted.isEmpty()) continue; - var insertedAmount = fluidTank.fill(extracted, IFluidHandler.FluidAction.EXECUTE); - if (insertedAmount > 0) { - otherFluidHandler.drain(insertedAmount, IFluidHandler.FluidAction.EXECUTE); - this.fluidHandler.onChange(); - break; - } + var otherFluidHandler = level.getCapability(Capabilities.FluidHandler.BLOCK, pos.relative(direction), direction.getOpposite()); + if (otherFluidHandler != null) { + for (int tankId = 0; tankId < this.getFluidHandler().getTanks(); tankId++) { + var fluidTank = this.fluidHandler.getTankList()[tankId]; + var extracted = otherFluidHandler.drain(FunctionalStorageConfig.UPGRADE_PULL_FLUID, IFluidHandler.FluidAction.SIMULATE); + if (extracted.isEmpty()) continue; + var insertedAmount = fluidTank.fill(extracted, IFluidHandler.FluidAction.EXECUTE); + if (insertedAmount > 0) { + otherFluidHandler.drain(insertedAmount, IFluidHandler.FluidAction.EXECUTE); + this.fluidHandler.onChange(); + break; } - }); - }); + } + } } if (item.equals(FunctionalStorage.COLLECTOR_UPGRADE.get()) && level.getGameTime() % (FunctionalStorageConfig.UPGRADE_TICK * 3) == 0) { var direction = UpgradeItem.getDirection(stack); @@ -169,7 +153,7 @@ public void serverTick(Level level, BlockPos pos, BlockState stateOwn, FluidDraw if (block instanceof IFluidBlock) { targetFluidHandler = new FluidBlockWrapper((IFluidBlock) block, level, pos.relative(direction)); } else if (block instanceof BucketPickup) { - targetFluidHandler = new BucketPickupHandlerWrapper((BucketPickup) block, level, pos.relative(direction)); + targetFluidHandler = new BucketPickupHandlerWrapper(FakePlayerFactory.get((ServerLevel) level, FP), (BucketPickup) block, level, pos.relative(direction)); } if (targetFluidHandler != null) { var drained = targetFluidHandler.drain(Integer.MAX_VALUE, IFluidHandler.FluidAction.SIMULATE); @@ -199,16 +183,14 @@ public InteractionResult onSlotActivated(Player playerIn, InteractionHand hand, if (stack.getItem().equals(FunctionalStorage.CONFIGURATION_TOOL.get()) || stack.getItem().equals(FunctionalStorage.LINKING_TOOL.get())) return InteractionResult.PASS; if (slot != -1 && !playerIn.getItemInHand(hand).isEmpty()) { - var interactionResult = stack.getCapability(Capabilities.FLUID_HANDLER_ITEM).map(iFluidHandlerItem -> { - return playerIn.getCapability(Capabilities.ITEM_HANDLER).map(iItemHandler -> { - var result = FluidUtil.tryEmptyContainerAndStow(stack, this.fluidHandler.getTankList()[slot], iItemHandler, Integer.MAX_VALUE, playerIn, true); - if (result.isSuccess()) { - playerIn.setItemInHand(hand, result.getResult().copy()); - return InteractionResult.SUCCESS; - } - return InteractionResult.PASS; - }).orElse(InteractionResult.PASS); - }).orElse(InteractionResult.PASS); + var interactionResult = Optional.ofNullable(stack.getCapability(Capabilities.FluidHandler.ITEM)).map(iFluidHandlerItem -> Optional.ofNullable(playerIn.getCapability(Capabilities.ItemHandler.ENTITY)).map(iItemHandler -> { + var result = FluidUtil.tryEmptyContainerAndStow(stack, this.fluidHandler.getTankList()[slot], iItemHandler, Integer.MAX_VALUE, playerIn, true); + if (result.isSuccess()) { + playerIn.setItemInHand(hand, result.getResult().copy()); + return InteractionResult.SUCCESS; + } + return InteractionResult.PASS; + }).orElse(InteractionResult.PASS)).orElse(InteractionResult.PASS); if (interactionResult == InteractionResult.SUCCESS) { return interactionResult; } @@ -220,8 +202,8 @@ public InteractionResult onSlotActivated(Player playerIn, InteractionHand hand, public void onClicked(Player playerIn, int slot) { ItemStack stack = playerIn.getItemInHand(InteractionHand.MAIN_HAND); if (slot != -1 && !stack.isEmpty()) { - stack.getCapability(Capabilities.FLUID_HANDLER_ITEM).ifPresent(iFluidHandlerItem -> { - playerIn.getCapability(Capabilities.ITEM_HANDLER).ifPresent(iItemHandler -> { + Optional.ofNullable(stack.getCapability(Capabilities.FluidHandler.ITEM)).ifPresent(iFluidHandlerItem -> { + Optional.ofNullable(playerIn.getCapability(Capabilities.ItemHandler.ENTITY)).ifPresent(iItemHandler -> { var result = FluidUtil.tryFillContainerAndStow(stack, this.fluidHandler.getTankList()[slot], iItemHandler, Integer.MAX_VALUE, playerIn, true); if (result.isSuccess()) { playerIn.setItemInHand(InteractionHand.MAIN_HAND, result.getResult()); diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java index 7708c31d..c1e0c667 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java @@ -7,7 +7,6 @@ import com.hrznstudio.titanium.block.BasicTileBlock; import com.hrznstudio.titanium.component.inventory.InventoryComponent; import com.hrznstudio.titanium.util.RayTraceUtils; -import com.hrznstudio.titanium.util.TileUtil; import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -25,8 +24,7 @@ import net.minecraft.world.phys.HitResult; import net.neoforged.api.distmarker.Dist; import net.neoforged.api.distmarker.OnlyIn; -import net.neoforged.neoforge.common.capabilities.Capabilities; -import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.capabilities.Capabilities; import net.neoforged.neoforge.items.IItemHandler; import net.neoforged.neoforge.items.ItemHandlerHelper; import org.jetbrains.annotations.NotNull; @@ -61,48 +59,46 @@ public void serverTick(Level level, BlockPos pos, BlockState state, T blockEntit Item item = stack.getItem(); if (item.equals(FunctionalStorage.PULLING_UPGRADE.get())) { Direction direction = UpgradeItem.getDirection(stack); - TileUtil.getTileEntity(level, pos.relative(direction)).ifPresent(blockEntity1 -> { - blockEntity1.getCapability(Capabilities.ITEM_HANDLER, direction.getOpposite()).ifPresent(iItemHandler -> { - for (int otherSlot = 0; otherSlot < iItemHandler.getSlots(); otherSlot++) { - ItemStack pulledStack = iItemHandler.extractItem(otherSlot, FunctionalStorageConfig.UPGRADE_PULL_ITEMS, true); - if (pulledStack.isEmpty()) continue; - boolean hasWorked = false; - for (int ourSlot = 0; ourSlot < this.getStorage().getSlots(); ourSlot++) { - ItemStack simulated = getStorage().insertItem(ourSlot, pulledStack, true); - if (!simulated.equals(pulledStack)) { - ItemStack extracted = iItemHandler.extractItem(otherSlot, pulledStack.getCount() - simulated.getCount(), false); - getStorage().insertItem(ourSlot, extracted, false); - hasWorked = true; - break; - } + var iItemHandler = level.getCapability(Capabilities.ItemHandler.BLOCK, pos.relative(direction), direction.getOpposite()); + if (iItemHandler != null) { + for (int otherSlot = 0; otherSlot < iItemHandler.getSlots(); otherSlot++) { + ItemStack pulledStack = iItemHandler.extractItem(otherSlot, FunctionalStorageConfig.UPGRADE_PULL_ITEMS, true); + if (pulledStack.isEmpty()) continue; + boolean hasWorked = false; + for (int ourSlot = 0; ourSlot < this.getStorage().getSlots(); ourSlot++) { + ItemStack simulated = getStorage().insertItem(ourSlot, pulledStack, true); + if (!simulated.equals(pulledStack)) { + ItemStack extracted = iItemHandler.extractItem(otherSlot, pulledStack.getCount() - simulated.getCount(), false); + getStorage().insertItem(ourSlot, extracted, false); + hasWorked = true; + break; } - if (hasWorked) break; } - }); - }); + if (hasWorked) break; + } + } } if (item.equals(FunctionalStorage.PUSHING_UPGRADE.get())) { Direction direction = UpgradeItem.getDirection(stack); - TileUtil.getTileEntity(level, pos.relative(direction)).ifPresent(blockEntity1 -> { - blockEntity1.getCapability(Capabilities.ITEM_HANDLER, direction.getOpposite()).ifPresent(otherHandler -> { - for (int drawerSlot = 0; drawerSlot < getStorage().getSlots(); drawerSlot++) { - ItemStack pulledStack = getStorage().extractItem(drawerSlot, FunctionalStorageConfig.UPGRADE_PUSH_ITEMS, true); - if (pulledStack.isEmpty()) continue; - boolean hasWorked = false; - for (int destinationSlot = 0; destinationSlot < otherHandler.getSlots(); destinationSlot++) { - if (otherHandler.getStackInSlot(destinationSlot).getCount() >= otherHandler.getSlotLimit(destinationSlot)) - continue; - ItemStack simulated = otherHandler.insertItem(destinationSlot, pulledStack, true); - if (simulated.getCount() <= pulledStack.getCount()) { - otherHandler.insertItem(destinationSlot, getStorage().extractItem(drawerSlot, pulledStack.getCount() - simulated.getCount(), false), false); - hasWorked = true; - break; - } + var otherHandler = level.getCapability(Capabilities.ItemHandler.BLOCK, pos.relative(direction), direction.getOpposite()); + if (otherHandler != null) { + for (int drawerSlot = 0; drawerSlot < getStorage().getSlots(); drawerSlot++) { + ItemStack pulledStack = getStorage().extractItem(drawerSlot, FunctionalStorageConfig.UPGRADE_PUSH_ITEMS, true); + if (pulledStack.isEmpty()) continue; + boolean hasWorked = false; + for (int destinationSlot = 0; destinationSlot < otherHandler.getSlots(); destinationSlot++) { + if (otherHandler.getStackInSlot(destinationSlot).getCount() >= otherHandler.getSlotLimit(destinationSlot)) + continue; + ItemStack simulated = otherHandler.insertItem(destinationSlot, pulledStack, true); + if (simulated.getCount() <= pulledStack.getCount()) { + otherHandler.insertItem(destinationSlot, getStorage().extractItem(drawerSlot, pulledStack.getCount() - simulated.getCount(), false), false); + hasWorked = true; + break; } - if (hasWorked) break; } - }); - }); + if (hasWorked) break; + } + } } if (item.equals(FunctionalStorage.COLLECTOR_UPGRADE.get())) { Direction direction = UpgradeItem.getDirection(stack); @@ -172,16 +168,8 @@ public void onClicked(Player playerIn, int slot) { public abstract IItemHandler getStorage(); - public abstract LazyOptional getOptional(); - public abstract int getBaseSize(int lost); - @Override - public void invalidateCaps() { - super.invalidateCaps(); - getOptional().invalidate(); - } - @Override public InventoryComponent> getStorageUpgradesConstructor() { return new InventoryComponent>("storage_upgrades", 10, 70, getStorageSlotAmount()) { diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/SimpleCompactingDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/SimpleCompactingDrawerTile.java index 4be1becd..ad46df59 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/SimpleCompactingDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/SimpleCompactingDrawerTile.java @@ -18,19 +18,12 @@ import net.minecraft.world.level.block.state.BlockState; import net.neoforged.api.distmarker.Dist; import net.neoforged.api.distmarker.OnlyIn; -import net.neoforged.neoforge.common.capabilities.Capabilities; -import net.neoforged.neoforge.common.capabilities.Capability; -import net.neoforged.neoforge.common.util.LazyOptional; import net.neoforged.neoforge.items.IItemHandler; import org.apache.commons.lang3.tuple.Pair; import org.jetbrains.annotations.NotNull; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - public class SimpleCompactingDrawerTile extends ItemControllableDrawerTile { - private final LazyOptional lazyStorage; @Save public CompactingInventoryHandler handler; private boolean hasCheckedRecipes; @@ -69,7 +62,6 @@ public boolean isLocked() { } }; - lazyStorage = LazyOptional.of(() -> this.handler); this.hasCheckedRecipes = false; } @@ -133,25 +125,12 @@ public IItemHandler getStorage() { return handler; } - @Override - public LazyOptional getOptional() { - return lazyStorage; - } @Override public int getBaseSize(int slot) { return handler.getSlotLimitBase(slot); } - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == Capabilities.ITEM_HANDLER) { - return lazyStorage.cast(); - } - return super.getCapability(cap, side); - } - @NotNull @Override public SimpleCompactingDrawerTile getSelf() { diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/StorageControllerExtensionTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/StorageControllerExtensionTile.java index 38d3e3ef..32156b37 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/StorageControllerExtensionTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/StorageControllerExtensionTile.java @@ -12,11 +12,8 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.neoforged.neoforge.common.capabilities.Capability; -import net.neoforged.neoforge.common.util.LazyOptional; import net.neoforged.neoforge.items.IItemHandler; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; + import java.util.Optional; public abstract class StorageControllerExtensionTile> extends ItemControllableDrawerTile { @@ -45,11 +42,6 @@ public IItemHandler getStorage() { return getControllerInstance().map(StorageControllerTile::getStorage).orElse(null); } - @Override - public LazyOptional getOptional() { - return getControllerInstance().map(StorageControllerTile::getOptional).orElse(null); - } - @Override public int getBaseSize(int lost) { return 1; @@ -71,20 +63,9 @@ public void toggleOption(ConfigurationToolItem.ConfigurationAction action) { } } - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - return getControllerInstance().map(drawerControllerTile -> drawerControllerTile.getCapability(cap, side)).orElse(super.getCapability(cap, side)); - } - private Optional getControllerInstance() { if (getControllerPos() == null) return Optional.empty(); if (level == null || !level.isLoaded(getControllerPos())) return Optional.empty(); return TileUtil.getTileEntity(this.level, getControllerPos(), StorageControllerTile.class); } - - @Override - public void invalidateCaps() { - - } } diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/StorageControllerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/StorageControllerTile.java index 56986479..f1fd4b98 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/StorageControllerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/StorageControllerTile.java @@ -32,15 +32,8 @@ import net.minecraft.world.phys.Vec3; import net.neoforged.api.distmarker.Dist; import net.neoforged.api.distmarker.OnlyIn; -import net.neoforged.neoforge.common.capabilities.Capabilities; -import net.neoforged.neoforge.common.capabilities.Capability; -import net.neoforged.neoforge.common.util.LazyOptional; -import net.neoforged.neoforge.fluids.capability.IFluidHandler; import net.neoforged.neoforge.items.IItemHandler; -import org.jetbrains.annotations.NotNull; -import var; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; + import java.util.ArrayList; import java.util.HashMap; import java.util.UUID; @@ -53,8 +46,6 @@ public abstract class StorageControllerTile> protected ConnectedDrawers connectedDrawers; public ControllerInventoryHandler inventoryHandler; public ControllerFluidHandler fluidHandler; - protected LazyOptional itemHandlerLazyOptional; - protected LazyOptional fluidHandlerLazyOptional; public StorageControllerTile(BasicTileBlock base, BlockEntityType entityType, BlockPos pos, BlockState state) { super(base, entityType, pos, state); @@ -65,14 +56,12 @@ public ConnectedDrawers getDrawers() { return connectedDrawers; } }; - this.itemHandlerLazyOptional = LazyOptional.of(() -> this.inventoryHandler); this.fluidHandler = new ControllerFluidHandler() { @Override public ConnectedDrawers getDrawers() { return connectedDrawers; } }; - this.fluidHandlerLazyOptional = LazyOptional.of(() -> this.fluidHandler); } @Override @@ -169,11 +158,6 @@ public IItemHandler getStorage() { return inventoryHandler; } - @Override - public LazyOptional getOptional() { - return itemHandlerLazyOptional; - } - @Override public int getBaseSize(int lost) { return 1; @@ -251,29 +235,11 @@ public boolean addConnectedDrawers(LinkingToolItem.ActionMode action, BlockPos.. return didWork; } - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == Capabilities.ITEM_HANDLER) { - return itemHandlerLazyOptional.cast(); - } - if (cap == Capabilities.FLUID_HANDLER) { - return fluidHandlerLazyOptional.cast(); - } - return super.getCapability(cap, side); - } - - @Override - public void invalidateCaps() { - super.invalidateCaps(); - this.fluidHandlerLazyOptional.invalidate(); - this.itemHandlerLazyOptional.invalidate(); - } - - @Override - public AABB getRenderBoundingBox() { - return super.getRenderBoundingBox().inflate(1200); - } + // TODO 1.20.4 - fix +// @Override +// public AABB getRenderBoundingBox() { +// return super.getRenderBoundingBox().inflate(1200); +// } @Override public InventoryComponent> getStorageUpgradesConstructor() { diff --git a/src/main/java/com/buuz135/functionalstorage/client/ControllerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/ControllerRenderer.java index f9fe5996..7932b4ce 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/ControllerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/ControllerRenderer.java @@ -28,7 +28,7 @@ import net.minecraft.world.phys.shapes.VoxelShape; import org.joml.Matrix4f; import org.lwjgl.opengl.GL11; -import var; + import java.util.List; import java.util.OptionalDouble; diff --git a/src/main/java/com/buuz135/functionalstorage/client/DrawerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/DrawerRenderer.java index a417d169..64870fd6 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/DrawerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/DrawerRenderer.java @@ -27,7 +27,7 @@ import net.minecraft.world.level.Level; import org.joml.Matrix4f; import org.joml.Vector3f; -import var; + import static com.buuz135.functionalstorage.util.MathUtils.createTransformMatrix; @@ -110,10 +110,10 @@ public static void renderIndicator(PoseStack matrixStack, MultiBufferSource buff float y1 = -6.65F / 16F; float y2 = y1 + 1.25f / 16F; float z2 = 0; - double bx1 = 0; - double bx2 = 8; - double bz1 = 0; - double bz2 = 2; + float bx1 = 0; + float bx2 = 8; + float bz1 = 0; + float bz2 = 2; float u1 = still.getU(bx1); float u2 = still.getU(bx2); float v1 = still.getV(bz1); @@ -125,7 +125,7 @@ public static void renderIndicator(PoseStack matrixStack, MultiBufferSource buff builder.vertex(posMat, x1, y1, z2).color(red, green, blue, alpha).uv(u1, v1).overlayCoords(combinedOverlayIn).uv2(combinedLightIn).normal(0f, 0f, 1f).endVertex(); } - u2 = still.getU(bx2 * progress); + u2 = still.getU((float) (bx2 * progress)); x2 = x1 + 0.5f * progress; z2 = 0.0001f; v1 = still.getV(8); diff --git a/src/main/java/com/buuz135/functionalstorage/client/FluidDrawerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/FluidDrawerRenderer.java index 32813a0a..040a2bb7 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/FluidDrawerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/FluidDrawerRenderer.java @@ -47,12 +47,12 @@ public static void renderFluidStack(PoseStack matrixStack, MultiBufferSource buf float y2 = (float) bounds.maxY; float z1 = (float) bounds.minZ; float z2 = (float) bounds.maxZ; - double bx1 = bounds.minX * 16; - double bx2 = bounds.maxX * 16; - double by1 = bounds.minY * 16; - double by2 = bounds.maxY * 16; - double bz1 = bounds.minZ * 16; - double bz2 = bounds.maxZ * 16; + float bx1 = (float) bounds.minX * 16; + float bx2 = (float) bounds.maxX * 16; + float by1 = (float) bounds.minY * 16; + float by2 = (float) bounds.maxY * 16; + float bz1 = (float) bounds.minZ * 16; + float bz2 = (float) bounds.maxZ * 16; Matrix4f posMat = matrixStack.last().pose(); diff --git a/src/main/java/com/buuz135/functionalstorage/client/FramedColors.java b/src/main/java/com/buuz135/functionalstorage/client/FramedColors.java index 13d81409..fa863fc5 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/FramedColors.java +++ b/src/main/java/com/buuz135/functionalstorage/client/FramedColors.java @@ -12,7 +12,7 @@ import net.minecraft.client.color.block.BlockColor; import net.minecraft.client.color.item.ItemColor; import net.minecraft.core.BlockPos; -import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; @@ -25,7 +25,6 @@ import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.client.event.RegisterColorHandlersEvent; -import net.neoforged.neoforge.registries.ForgeRegistries; import org.jetbrains.annotations.Nullable; import java.util.Map; @@ -42,7 +41,7 @@ public int getColor(BlockState state, @Nullable BlockAndTintGetter level, @Nulla if (framedDrawerModelData != null) { for (Map.Entry entry: framedDrawerModelData.getDesign().entrySet()) { if (entry.getValue() instanceof BlockItem blockItem) { - if (ForgeRegistries.ITEMS.getKey(blockItem).getNamespace().equals(FunctionalStorage.MOD_ID)) + if (BuiltInRegistries.ITEM.getKey(blockItem).getNamespace().equals(FunctionalStorage.MOD_ID)) continue; BlockState state1 = blockItem.getBlock().defaultBlockState(); int color = Minecraft.getInstance().getBlockColors().getColor(state1, level, pos, tintIndex); @@ -57,7 +56,7 @@ public int getColor(BlockState state, @Nullable BlockAndTintGetter level, @Nulla if (framedDrawerModelData != null) { for (Map.Entry entry: framedDrawerModelData.getDesign().entrySet()) { if (entry.getValue() instanceof BlockItem blockItem) { - if (ForgeRegistries.ITEMS.getKey(blockItem).getNamespace().equals(FunctionalStorage.MOD_ID)) + if (BuiltInRegistries.ITEM.getKey(blockItem).getNamespace().equals(FunctionalStorage.MOD_ID)) continue; BlockState state1 = blockItem.getBlock().defaultBlockState(); int color = Minecraft.getInstance().getBlockColors().getColor(state1, level, pos, tintIndex); @@ -72,7 +71,7 @@ public int getColor(BlockState state, @Nullable BlockAndTintGetter level, @Nulla if (framedDrawerModelData != null) { for (Map.Entry entry : framedDrawerModelData.getDesign().entrySet()) { if (entry.getValue() instanceof BlockItem blockItem) { - if (ForgeRegistries.ITEMS.getKey(blockItem).getNamespace().equals(FunctionalStorage.MOD_ID)) + if (BuiltInRegistries.ITEM.getKey(blockItem).getNamespace().equals(FunctionalStorage.MOD_ID)) continue; BlockState state1 = blockItem.getBlock().defaultBlockState(); int color = Minecraft.getInstance().getBlockColors().getColor(state1, level, pos, tintIndex); @@ -107,20 +106,20 @@ public int getColor(ItemStack itemStack, int tintIndex) { @SubscribeEvent public static void blockColors(RegisterColorHandlersEvent.Block event) { - Block block1 = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(FunctionalStorage.MOD_ID, "framed_1")); + Block block1 = BuiltInRegistries.BLOCK.get(new ResourceLocation(FunctionalStorage.MOD_ID, "framed_1")); event.register(new FramedColors(), block1); - Block block2 = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(FunctionalStorage.MOD_ID, "framed_2")); + Block block2 = BuiltInRegistries.BLOCK.get(new ResourceLocation(FunctionalStorage.MOD_ID, "framed_2")); event.register(new FramedColors(), block2); - Block block4 = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(FunctionalStorage.MOD_ID, "framed_4")); + Block block4 = BuiltInRegistries.BLOCK.get(new ResourceLocation(FunctionalStorage.MOD_ID, "framed_4")); event.register(new FramedColors(), block4); - Block block5 = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(FunctionalStorage.MOD_ID, "compacting_framed_drawer")); + Block block5 = BuiltInRegistries.BLOCK.get(new ResourceLocation(FunctionalStorage.MOD_ID, "compacting_framed_drawer")); event.register(new FramedColors(), block5); - Block controller = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(FunctionalStorage.MOD_ID, "framed_storage_controller")); + Block controller = BuiltInRegistries.BLOCK.get(new ResourceLocation(FunctionalStorage.MOD_ID, "framed_storage_controller")); event.register(new FramedColors(), controller); - Block controllerExtension = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(FunctionalStorage.MOD_ID, "framed_controller_extension")); + Block controllerExtension = BuiltInRegistries.BLOCK.get(new ResourceLocation(FunctionalStorage.MOD_ID, "framed_controller_extension")); event.register(new FramedColors(), controllerExtension); } } diff --git a/src/main/java/com/buuz135/functionalstorage/client/gui/DrawerInfoGuiAddon.java b/src/main/java/com/buuz135/functionalstorage/client/gui/DrawerInfoGuiAddon.java index d3deff8d..d6d98658 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/gui/DrawerInfoGuiAddon.java +++ b/src/main/java/com/buuz135/functionalstorage/client/gui/DrawerInfoGuiAddon.java @@ -11,7 +11,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.apache.commons.lang3.tuple.Pair; -import var; + import java.util.ArrayList; import java.util.Optional; import java.util.function.Function; diff --git a/src/main/java/com/buuz135/functionalstorage/client/gui/FluidDrawerInfoGuiAddon.java b/src/main/java/com/buuz135/functionalstorage/client/gui/FluidDrawerInfoGuiAddon.java index db204ccb..fe57d1b4 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/gui/FluidDrawerInfoGuiAddon.java +++ b/src/main/java/com/buuz135/functionalstorage/client/gui/FluidDrawerInfoGuiAddon.java @@ -18,7 +18,7 @@ import net.neoforged.neoforge.client.extensions.common.IClientFluidTypeExtensions; import net.neoforged.neoforge.fluids.FluidStack; import org.apache.commons.lang3.tuple.Pair; -import var; + import java.awt.*; import java.util.ArrayList; import java.util.Optional; diff --git a/src/main/java/com/buuz135/functionalstorage/client/loader/FramedModel.java b/src/main/java/com/buuz135/functionalstorage/client/loader/FramedModel.java index 8c0e27f6..cc2a23c8 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/loader/FramedModel.java +++ b/src/main/java/com/buuz135/functionalstorage/client/loader/FramedModel.java @@ -22,6 +22,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Vec3i; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.RandomSource; import net.minecraft.world.inventory.InventoryMenu; @@ -39,7 +40,6 @@ import net.neoforged.neoforge.client.model.geometry.IGeometryLoader; import net.neoforged.neoforge.client.model.geometry.IUnbakedGeometry; import net.neoforged.neoforge.common.util.ConcatenatedListView; -import net.neoforged.neoforge.registries.ForgeRegistries; import org.apache.commons.lang3.tuple.ImmutableTriple; import org.apache.commons.lang3.tuple.Triple; import org.apache.logging.log4j.LogManager; @@ -47,7 +47,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.joml.Vector3f; -import var; + import java.util.*; import java.util.function.Function; @@ -364,7 +364,7 @@ public TextureAtlasSprite getParticleIcon() public TextureAtlasSprite getParticleIcon(@NotNull ModelData data) { FramedDrawerModelData framedDrawerModelData = data.get(FramedDrawerModelData.FRAMED_PROPERTY); if (framedDrawerModelData != null && framedDrawerModelData.getDesign().containsKey("particle")) { - if (framedDrawerModelData.getDesign().get("particle") instanceof BlockItem blockItem && !ForgeRegistries.ITEMS.getKey(blockItem).getNamespace().equals(FunctionalStorage.MOD_ID)) { + if (framedDrawerModelData.getDesign().get("particle") instanceof BlockItem blockItem && !BuiltInRegistries.ITEM.getKey(blockItem).getNamespace().equals(FunctionalStorage.MOD_ID)) { return Minecraft.getInstance().getBlockRenderer().getBlockModel(blockItem.getBlock().defaultBlockState()).getParticleIcon(data); } } diff --git a/src/main/java/com/buuz135/functionalstorage/client/model/FramedDrawerModelData.java b/src/main/java/com/buuz135/functionalstorage/client/model/FramedDrawerModelData.java index 5f55d5e1..30912368 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/model/FramedDrawerModelData.java +++ b/src/main/java/com/buuz135/functionalstorage/client/model/FramedDrawerModelData.java @@ -23,12 +23,13 @@ package com.buuz135.functionalstorage.client.model; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; import net.neoforged.neoforge.client.model.data.ModelProperty; import net.neoforged.neoforge.common.util.INBTSerializable; -import net.neoforged.neoforge.registries.ForgeRegistries; + import java.util.HashMap; import java.util.Map; @@ -51,7 +52,7 @@ public Map getDesign() { @Override public CompoundTag serializeNBT() { CompoundTag compoundTag = new CompoundTag(); - design.forEach((s, item) -> compoundTag.putString(s, ForgeRegistries.ITEMS.getKey(item).toString())); + design.forEach((s, item) -> compoundTag.putString(s, BuiltInRegistries.ITEM.getKey(item).toString())); return compoundTag; } @@ -59,7 +60,7 @@ public CompoundTag serializeNBT() { public void deserializeNBT(CompoundTag nbt) { design = new HashMap<>(); for (String allKey : nbt.getAllKeys()) { - design.put(allKey, ForgeRegistries.ITEMS.getValue(new ResourceLocation(nbt.getString(allKey)))); + design.put(allKey, BuiltInRegistries.ITEM.get(new ResourceLocation(nbt.getString(allKey)))); } this.generateCode(); } @@ -67,7 +68,7 @@ public void deserializeNBT(CompoundTag nbt) { private void generateCode(){ this.code = ""; this.design.forEach((s, item) -> { - this.code += (s + ForgeRegistries.ITEMS.getKey(item).toString()); + this.code += (s + BuiltInRegistries.ITEM.getKey(item)); }); } diff --git a/src/main/java/com/buuz135/functionalstorage/compat/TOPPlugin.java b/src/main/java/com/buuz135/functionalstorage/compat/TOPPlugin.java index bcbe8a26..a417d247 100644 --- a/src/main/java/com/buuz135/functionalstorage/compat/TOPPlugin.java +++ b/src/main/java/com/buuz135/functionalstorage/compat/TOPPlugin.java @@ -1,22 +1,22 @@ -package com.buuz135.functionalstorage.compat; - -import com.buuz135.functionalstorage.compat.top.FunctionalDrawerProvider; -import com.hrznstudio.titanium.annotation.plugin.FeaturePlugin; -import com.hrznstudio.titanium.event.handler.EventManager; -import com.hrznstudio.titanium.plugin.FeaturePluginInstance; -import com.hrznstudio.titanium.plugin.PluginPhase; -import net.neoforged.fml.InterModComms; -import net.neoforged.fml.event.lifecycle.InterModEnqueueEvent; - -@FeaturePlugin(value = "theoneprobe", type = FeaturePlugin.FeaturePluginType.MOD) -public class TOPPlugin implements FeaturePluginInstance { - @Override - public void execute(PluginPhase phase) { - if (phase == PluginPhase.CONSTRUCTION) { - EventManager.mod(InterModEnqueueEvent.class).process(interModEnqueueEvent -> { - InterModComms.sendTo("theoneprobe", "getTheOneProbe", () -> FunctionalDrawerProvider.REGISTER); - }).subscribe(); - } - } - -} +//package com.buuz135.functionalstorage.compat; +// +//import com.buuz135.functionalstorage.compat.top.FunctionalDrawerProvider; +//import com.hrznstudio.titanium.annotation.plugin.FeaturePlugin; +//import com.hrznstudio.titanium.event.handler.EventManager; +//import com.hrznstudio.titanium.plugin.FeaturePluginInstance; +//import com.hrznstudio.titanium.plugin.PluginPhase; +//import net.neoforged.fml.InterModComms; +//import net.neoforged.fml.event.lifecycle.InterModEnqueueEvent; +// +//@FeaturePlugin(value = "theoneprobe", type = FeaturePlugin.FeaturePluginType.MOD) +//public class TOPPlugin implements FeaturePluginInstance { +// @Override +// public void execute(PluginPhase phase) { +// if (phase == PluginPhase.CONSTRUCTION) { +// EventManager.mod(InterModEnqueueEvent.class).process(interModEnqueueEvent -> { +// InterModComms.sendTo("theoneprobe", "getTheOneProbe", () -> FunctionalDrawerProvider.REGISTER); +// }).subscribe(); +// } +// } +// +//} diff --git a/src/main/java/com/buuz135/functionalstorage/compat/jei/JEIPlugin.java b/src/main/java/com/buuz135/functionalstorage/compat/jei/JEIPlugin.java index e457b7b2..05ee6e76 100644 --- a/src/main/java/com/buuz135/functionalstorage/compat/jei/JEIPlugin.java +++ b/src/main/java/com/buuz135/functionalstorage/compat/jei/JEIPlugin.java @@ -28,16 +28,16 @@ public void registerCategories(IRecipeCategoryRegistration registration) { @Override public void registerRecipes(IRecipeRegistration registration) { - registration.addRecipes(CompactingRecipeCategory.TYPE, RecipeUtil.getRecipes(Minecraft.getInstance().level, (RecipeType) FunctionalStorage.CUSTOM_COMPACTING_RECIPE_TYPE.get())); + registration.addRecipes(CompactingRecipeCategory.TYPE, RecipeUtil.getRecipes(Minecraft.getInstance().level, (RecipeType) FunctionalStorage.CUSTOM_COMPACTING_RECIPE_TYPE.value())); } @Override public void registerRecipeCatalysts(IRecipeCatalystRegistration registration) { IModPlugin.super.registerRecipeCatalysts(registration); - registration.addRecipeCatalyst(new ItemStack(FunctionalStorage.COMPACTING_DRAWER.getKey().get()), CompactingRecipeCategory.TYPE); - registration.addRecipeCatalyst(new ItemStack(FunctionalStorage.FRAMED_COMPACTING_DRAWER.getKey().get()), CompactingRecipeCategory.TYPE); - registration.addRecipeCatalyst(new ItemStack(FunctionalStorage.SIMPLE_COMPACTING_DRAWER.getKey().get()), CompactingRecipeCategory.TYPE); - registration.addRecipeCatalyst(new ItemStack(FunctionalStorage.FRAMED_SIMPLE_COMPACTING_DRAWER.getKey().get()), CompactingRecipeCategory.TYPE); + registration.addRecipeCatalyst(new ItemStack(FunctionalStorage.COMPACTING_DRAWER.getBlock()), CompactingRecipeCategory.TYPE); + registration.addRecipeCatalyst(new ItemStack(FunctionalStorage.FRAMED_COMPACTING_DRAWER.getBlock()), CompactingRecipeCategory.TYPE); + registration.addRecipeCatalyst(new ItemStack(FunctionalStorage.SIMPLE_COMPACTING_DRAWER.getBlock()), CompactingRecipeCategory.TYPE); + registration.addRecipeCatalyst(new ItemStack(FunctionalStorage.FRAMED_SIMPLE_COMPACTING_DRAWER.getBlock()), CompactingRecipeCategory.TYPE); } @Override diff --git a/src/main/java/com/buuz135/functionalstorage/compat/top/CustomElementItemStack.java b/src/main/java/com/buuz135/functionalstorage/compat/top/CustomElementItemStack.java index f271251b..4e94ea39 100644 --- a/src/main/java/com/buuz135/functionalstorage/compat/top/CustomElementItemStack.java +++ b/src/main/java/com/buuz135/functionalstorage/compat/top/CustomElementItemStack.java @@ -1,95 +1,95 @@ -package com.buuz135.functionalstorage.compat.top; - - -import com.buuz135.functionalstorage.FunctionalStorage; -import com.mojang.blaze3d.vertex.PoseStack; -import mcjty.theoneprobe.api.IElement; -import mcjty.theoneprobe.api.IItemStyle; -import mcjty.theoneprobe.apiimpl.styles.ItemStyle; -import mcjty.theoneprobe.network.NetworkTools; -import mcjty.theoneprobe.rendering.RenderHelper; -import net.minecraft.ChatFormatting; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.renderer.entity.ItemRenderer; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.ItemStack; - -public class CustomElementItemStack implements IElement { - - public static ResourceLocation RL = new ResourceLocation(FunctionalStorage.MOD_ID, "drawer_element"); - - private final ItemStack itemStack; - private final IItemStyle style; - private final String display; - private boolean displayName; - - public CustomElementItemStack(ItemStack itemStack, String display, IItemStyle style) { - this.itemStack = itemStack; - this.style = style; - this.display = display; - this.displayName = false; - } - - public CustomElementItemStack(ItemStack itemStack, String display, IItemStyle style, boolean displayName) { - this(itemStack, display, style); - this.displayName = true; - } - - public CustomElementItemStack(FriendlyByteBuf buf) { - if (buf.readBoolean()) { - this.itemStack = NetworkTools.readItemStack(buf); - } else { - this.itemStack = ItemStack.EMPTY; - } - - this.style = (new ItemStyle()).width(buf.readInt()).height(buf.readInt()); - this.display = buf.readUtf(); - this.displayName = buf.readBoolean(); - } - - public void render(GuiGraphics matrixStack, int x, int y) { - ItemRenderer itemRender = Minecraft.getInstance().getItemRenderer(); - if (!itemStack.isEmpty()) { - int size = itemStack.getCount(); - - if (!RenderHelper.renderItemStack(Minecraft.getInstance(), itemRender, itemStack, matrixStack, x + (style.getWidth() - 18) / 2, y + (style.getHeight() - 18) / 2, display)) { - Minecraft var10000 = Minecraft.getInstance(); - ChatFormatting var10004 = ChatFormatting.RED; - RenderHelper.renderText(var10000, matrixStack, x, y, var10004 + "ERROR: " + itemStack.getHoverName()); - } - if (this.displayName){ - RenderHelper.renderText(Minecraft.getInstance(), matrixStack, x + 22, y + 7, itemStack.getHoverName()); - } - - } - - } - - public int getWidth() { - return this.style.getWidth() + (this.displayName ? Minecraft.getInstance().font.width(itemStack.getHoverName().getString()) : 0) ; - } - - public int getHeight() { - return this.style.getHeight(); - } - - public void toBytes(FriendlyByteBuf buf) { - if (!this.itemStack.isEmpty()) { - buf.writeBoolean(true); - NetworkTools.writeItemStack(buf, this.itemStack); - } else { - buf.writeBoolean(false); - } - - buf.writeInt(this.style.getWidth()); - buf.writeInt(this.style.getHeight()); - buf.writeUtf(this.display); - buf.writeBoolean(this.displayName); - } - - public ResourceLocation getID() { - return RL; - } -} +//package com.buuz135.functionalstorage.compat.top; +// +// +//import com.buuz135.functionalstorage.FunctionalStorage; +//import com.mojang.blaze3d.vertex.PoseStack; +//import mcjty.theoneprobe.api.IElement; +//import mcjty.theoneprobe.api.IItemStyle; +//import mcjty.theoneprobe.apiimpl.styles.ItemStyle; +//import mcjty.theoneprobe.network.NetworkTools; +//import mcjty.theoneprobe.rendering.RenderHelper; +//import net.minecraft.ChatFormatting; +//import net.minecraft.client.Minecraft; +//import net.minecraft.client.gui.GuiGraphics; +//import net.minecraft.client.renderer.entity.ItemRenderer; +//import net.minecraft.network.FriendlyByteBuf; +//import net.minecraft.resources.ResourceLocation; +//import net.minecraft.world.item.ItemStack; +// +//public class CustomElementItemStack implements IElement { +// +// public static ResourceLocation RL = new ResourceLocation(FunctionalStorage.MOD_ID, "drawer_element"); +// +// private final ItemStack itemStack; +// private final IItemStyle style; +// private final String display; +// private boolean displayName; +// +// public CustomElementItemStack(ItemStack itemStack, String display, IItemStyle style) { +// this.itemStack = itemStack; +// this.style = style; +// this.display = display; +// this.displayName = false; +// } +// +// public CustomElementItemStack(ItemStack itemStack, String display, IItemStyle style, boolean displayName) { +// this(itemStack, display, style); +// this.displayName = true; +// } +// +// public CustomElementItemStack(FriendlyByteBuf buf) { +// if (buf.readBoolean()) { +// this.itemStack = NetworkTools.readItemStack(buf); +// } else { +// this.itemStack = ItemStack.EMPTY; +// } +// +// this.style = (new ItemStyle()).width(buf.readInt()).height(buf.readInt()); +// this.display = buf.readUtf(); +// this.displayName = buf.readBoolean(); +// } +// +// public void render(GuiGraphics matrixStack, int x, int y) { +// ItemRenderer itemRender = Minecraft.getInstance().getItemRenderer(); +// if (!itemStack.isEmpty()) { +// int size = itemStack.getCount(); +// +// if (!RenderHelper.renderItemStack(Minecraft.getInstance(), itemRender, itemStack, matrixStack, x + (style.getWidth() - 18) / 2, y + (style.getHeight() - 18) / 2, display)) { +// Minecraft var10000 = Minecraft.getInstance(); +// ChatFormatting var10004 = ChatFormatting.RED; +// RenderHelper.renderText(var10000, matrixStack, x, y, var10004 + "ERROR: " + itemStack.getHoverName()); +// } +// if (this.displayName){ +// RenderHelper.renderText(Minecraft.getInstance(), matrixStack, x + 22, y + 7, itemStack.getHoverName()); +// } +// +// } +// +// } +// +// public int getWidth() { +// return this.style.getWidth() + (this.displayName ? Minecraft.getInstance().font.width(itemStack.getHoverName().getString()) : 0) ; +// } +// +// public int getHeight() { +// return this.style.getHeight(); +// } +// +// public void toBytes(FriendlyByteBuf buf) { +// if (!this.itemStack.isEmpty()) { +// buf.writeBoolean(true); +// NetworkTools.writeItemStack(buf, this.itemStack); +// } else { +// buf.writeBoolean(false); +// } +// +// buf.writeInt(this.style.getWidth()); +// buf.writeInt(this.style.getHeight()); +// buf.writeUtf(this.display); +// buf.writeBoolean(this.displayName); +// } +// +// public ResourceLocation getID() { +// return RL; +// } +//} diff --git a/src/main/java/com/buuz135/functionalstorage/compat/top/FunctionalDrawerProvider.java b/src/main/java/com/buuz135/functionalstorage/compat/top/FunctionalDrawerProvider.java index 1f71afa8..39816d7b 100644 --- a/src/main/java/com/buuz135/functionalstorage/compat/top/FunctionalDrawerProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/compat/top/FunctionalDrawerProvider.java @@ -1,180 +1,180 @@ -package com.buuz135.functionalstorage.compat.top; - -import com.buuz135.functionalstorage.FunctionalStorage; -import com.buuz135.functionalstorage.block.EnderDrawerBlock; -import com.buuz135.functionalstorage.block.tile.*; -import com.buuz135.functionalstorage.inventory.BigInventoryHandler; -import com.buuz135.functionalstorage.inventory.CompactingInventoryHandler; -import com.buuz135.functionalstorage.inventory.EnderInventoryHandler; -import com.buuz135.functionalstorage.item.UpgradeItem; -import com.buuz135.functionalstorage.util.NumberUtils; -import com.buuz135.functionalstorage.world.EnderSavedData; -import mcjty.theoneprobe.api.*; -import mcjty.theoneprobe.apiimpl.elements.ElementHorizontal; -import mcjty.theoneprobe.apiimpl.elements.ElementTank; -import mcjty.theoneprobe.apiimpl.elements.ElementVertical; -import mcjty.theoneprobe.apiimpl.styles.ProgressStyle; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.state.BlockState; -import org.apache.commons.lang3.text.WordUtils; -import var; -import java.awt.Color; -import java.util.Locale; -import java.util.function.Function; - -public class FunctionalDrawerProvider implements IProbeInfoProvider { - - public static Function REGISTER = iTheOneProbe -> { - iTheOneProbe.registerProvider(new FunctionalDrawerProvider()); - iTheOneProbe.registerElementFactory(new IElementFactory() { - @Override - public IElement createElement(FriendlyByteBuf friendlyByteBuf) { - return new CustomElementItemStack(friendlyByteBuf); - } - - @Override - public ResourceLocation getId() { - return CustomElementItemStack.RL; - } - }); - return null; - }; - - @Override - public ResourceLocation getID() { - return new ResourceLocation(FunctionalStorage.MOD_ID, "drawer"); - } - - @Override - public void addProbeInfo(ProbeMode probeMode, IProbeInfo iProbeInfo, Player player, Level level, BlockState blockState, IProbeHitData iProbeHitData) { - BlockEntity blockEntity = level.getBlockEntity(iProbeHitData.getPos()); - if (blockEntity instanceof ControllableDrawerTile && !(blockEntity instanceof StorageControllerTile) && !(blockEntity instanceof StorageControllerExtensionTile)) { - iProbeInfo.getElements().removeIf(iElement -> iElement instanceof ElementVertical); - ElementVertical vertical = new ElementVertical(); - if (blockEntity instanceof DrawerTile) { - BigInventoryHandler handler = ((DrawerTile) blockEntity).getHandler(); - if (handler.getSlots() == 1 || player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED) { - ElementVertical elementVertical = new ElementVertical(iProbeInfo.defaultLayoutStyle().spacing(2).leftPadding(7).rightPadding(7)); - elementVertical.getStyle().borderColor(Color.CYAN.darker().getRGB()); - for (int i = 0; i < handler.getStoredStacks().size(); i++) { - BigInventoryHandler.BigStack storedStack = handler.getStoredStacks().get(i); - if (storedStack.getAmount() > 0 || (handler.isLocked() && !storedStack.getStack().isEmpty())) { - elementVertical.element(new CustomElementItemStack(storedStack.getStack(), NumberUtils.getFormatedBigNumber(handler.getStackInSlot(i).getCount()) + "/" + NumberUtils.getFormatedBigNumber(handler.getSlotLimit(i)), iProbeInfo.defaultItemStyle(), true)); - } - } - if (elementVertical.getElements().size() > 0) vertical.element(elementVertical); - vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); - } else { - ElementHorizontal abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().spacing(8).leftPadding(7).rightPadding(7)); - abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); - for (int i = 0; i < handler.getStoredStacks().size(); i++) { - BigInventoryHandler.BigStack storedStack = handler.getStoredStacks().get(i); - if (storedStack.getAmount() > 0 || (handler.isLocked() && !storedStack.getStack().isEmpty())) { - abstractElementPanel.element(new CustomElementItemStack(storedStack.getStack(), NumberUtils.getFormatedBigNumber(handler.getStackInSlot(i).getCount()) + "/" + NumberUtils.getFormatedBigNumber(handler.getSlotLimit(i)), iProbeInfo.defaultItemStyle())); - } - } - if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); - vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); - } - } - if (blockEntity instanceof EnderDrawerTile) { - ElementHorizontal abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().spacing(8).leftPadding(7).rightPadding(7)); - abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); - EnderInventoryHandler savedData = EnderSavedData.getInstance(level).getFrequency(((EnderDrawerTile) blockEntity).getFrequency()); - for (int i = 0; i < savedData.getStoredStacks().size(); i++) { - BigInventoryHandler.BigStack storedStack = savedData.getStoredStacks().get(i); - if (storedStack.getAmount() > 0 || (savedData.isLocked() && !storedStack.getStack().isEmpty())) { - abstractElementPanel.element(new CustomElementItemStack(storedStack.getStack(), NumberUtils.getFormatedBigNumber(storedStack.getAmount()) + "/" + NumberUtils.getFormatedBigNumber(savedData.getSlotLimit(i)), iProbeInfo.defaultItemStyle(), player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED)); - } - } - if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); - ElementVertical elementVertical = new ElementVertical(iProbeInfo.defaultLayoutStyle()); - elementVertical.getStyle().borderColor(Color.CYAN.darker().getRGB()); - elementVertical.text(Component.translatable("linkingtool.ender.frequency")); - vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); - abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().leftPadding(4).topPadding(2).rightPadding(4)); - for (ItemStack stack : EnderDrawerBlock.getFrequencyDisplay(((EnderDrawerTile) blockEntity).getFrequency())) { - abstractElementPanel.element(new CustomElementItemStack(stack, "", iProbeInfo.defaultItemStyle())); - } - elementVertical.element(abstractElementPanel); - vertical.element(elementVertical); - vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); - } - if (blockEntity instanceof CompactingDrawerTile) { - CompactingInventoryHandler inventoryHandler = ((CompactingDrawerTile) blockEntity).getHandler(); - if (player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED || inventoryHandler.isCreative()) { - ElementVertical abstractElementPanel = new ElementVertical(iProbeInfo.defaultLayoutStyle().spacing(2).leftPadding(7).rightPadding(7)); - abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); - abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(2).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(2).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(2)), iProbeInfo.defaultItemStyle(), true)); - abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(1).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(1).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(1)), iProbeInfo.defaultItemStyle(), true)); - abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(0).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(0).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(0)), iProbeInfo.defaultItemStyle(), true)); - if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); - } else { - ElementHorizontal abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().spacing(8).leftPadding(7).rightPadding(7)); - abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); - int amount = inventoryHandler.getAmount(); - abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(2).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(2).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(2)), iProbeInfo.defaultItemStyle())); - amount -= inventoryHandler.getResultList().get(2).getNeeded() * inventoryHandler.getStackInSlot(2).getCount(); - abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(1).getResult(), NumberUtils.getFormatedBigNumber((int) Math.floor(amount / inventoryHandler.getResultList().get(1).getNeeded())), iProbeInfo.defaultItemStyle())); - amount -= inventoryHandler.getResultList().get(1).getNeeded() * Math.floor(amount / inventoryHandler.getResultList().get(1).getNeeded()); - abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(0).getResult(), NumberUtils.getFormatedBigNumber((int) Math.floor(amount / inventoryHandler.getResultList().get(0).getNeeded())), iProbeInfo.defaultItemStyle())); - if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); - } - vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); - } - if (blockEntity instanceof SimpleCompactingDrawerTile) { - CompactingInventoryHandler inventoryHandler = ((SimpleCompactingDrawerTile) blockEntity).getHandler(); - if (player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED || inventoryHandler.isCreative()) { - ElementVertical abstractElementPanel = new ElementVertical(iProbeInfo.defaultLayoutStyle().spacing(2).leftPadding(7).rightPadding(7)); - abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); - abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(1).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(1).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(1)), iProbeInfo.defaultItemStyle(), true)); - abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(0).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(0).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(0)), iProbeInfo.defaultItemStyle(), true)); - if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); - } else { - ElementHorizontal abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().spacing(8).leftPadding(7).rightPadding(7)); - abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); - int amount = inventoryHandler.getAmount(); - abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(1).getResult(), NumberUtils.getFormatedBigNumber((int) Math.floor(amount / inventoryHandler.getResultList().get(1).getNeeded())), iProbeInfo.defaultItemStyle())); - amount -= inventoryHandler.getResultList().get(1).getNeeded() * Math.floor(amount / inventoryHandler.getResultList().get(1).getNeeded()); - abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(0).getResult(), NumberUtils.getFormatedBigNumber((int) Math.floor(amount / inventoryHandler.getResultList().get(0).getNeeded())), iProbeInfo.defaultItemStyle())); - if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); - } - vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); - } - if (blockEntity instanceof FluidDrawerTile fluidDrawerTile && (player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED)) { - ElementVertical tanksVertical = new ElementVertical(iProbeInfo.defaultLayoutStyle().spacing(2)); - for (int i = 0; i < fluidDrawerTile.getFluidHandler().getTanks(); i++) { - var tankReference = TankReference.createTank(fluidDrawerTile.getFluidHandler().getTankList()[i]); - tanksVertical.element(new ElementTank(tankReference, new ProgressStyle().numberFormat(NumberFormat.COMPACT))); - } - iProbeInfo.element(tanksVertical); - } - if (player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED) { - ElementHorizontal abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().topPadding(0).spacing(8).leftPadding(7).rightPadding(7)); - abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); - for (int i = 0; i < ((ControllableDrawerTile) blockEntity).getUtilityUpgrades().getSlots(); i++) { - ItemStack stack = ((ControllableDrawerTile) blockEntity).getUtilityUpgrades().getStackInSlot(i); - if (!stack.isEmpty()) { - String extra = ""; - if (stack.is(FunctionalStorage.PUSHING_UPGRADE.get()) || stack.is(FunctionalStorage.PULLING_UPGRADE.get()) || stack.is(FunctionalStorage.COLLECTOR_UPGRADE.get())) { - extra = WordUtils.capitalize(UpgradeItem.getDirection(stack).name().toLowerCase(Locale.ROOT)); - if (extra.equals("Up")) { - extra = " " + extra; - } - } - abstractElementPanel.element(new CustomElementItemStack(stack, extra, iProbeInfo.defaultItemStyle())); - } - } - if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); - } - iProbeInfo.element(vertical); - } - - } -} \ No newline at end of file +//package com.buuz135.functionalstorage.compat.top; +// +//import com.buuz135.functionalstorage.FunctionalStorage; +//import com.buuz135.functionalstorage.block.EnderDrawerBlock; +//import com.buuz135.functionalstorage.block.tile.*; +//import com.buuz135.functionalstorage.inventory.BigInventoryHandler; +//import com.buuz135.functionalstorage.inventory.CompactingInventoryHandler; +//import com.buuz135.functionalstorage.inventory.EnderInventoryHandler; +//import com.buuz135.functionalstorage.item.UpgradeItem; +//import com.buuz135.functionalstorage.util.NumberUtils; +//import com.buuz135.functionalstorage.world.EnderSavedData; +//import mcjty.theoneprobe.api.*; +//import mcjty.theoneprobe.apiimpl.elements.ElementHorizontal; +//import mcjty.theoneprobe.apiimpl.elements.ElementTank; +//import mcjty.theoneprobe.apiimpl.elements.ElementVertical; +//import mcjty.theoneprobe.apiimpl.styles.ProgressStyle; +//import net.minecraft.network.FriendlyByteBuf; +//import net.minecraft.network.chat.Component; +//import net.minecraft.resources.ResourceLocation; +//import net.minecraft.world.entity.player.Player; +//import net.minecraft.world.item.ItemStack; +//import net.minecraft.world.level.Level; +//import net.minecraft.world.level.block.entity.BlockEntity; +//import net.minecraft.world.level.block.state.BlockState; +//import org.apache.commons.lang3.text.WordUtils; +// +//import java.awt.Color; +//import java.util.Locale; +//import java.util.function.Function; +// +//public class FunctionalDrawerProvider implements IProbeInfoProvider { +// +// public static Function REGISTER = iTheOneProbe -> { +// iTheOneProbe.registerProvider(new FunctionalDrawerProvider()); +// iTheOneProbe.registerElementFactory(new IElementFactory() { +// @Override +// public IElement createElement(FriendlyByteBuf friendlyByteBuf) { +// return new CustomElementItemStack(friendlyByteBuf); +// } +// +// @Override +// public ResourceLocation getId() { +// return CustomElementItemStack.RL; +// } +// }); +// return null; +// }; +// +// @Override +// public ResourceLocation getID() { +// return new ResourceLocation(FunctionalStorage.MOD_ID, "drawer"); +// } +// +// @Override +// public void addProbeInfo(ProbeMode probeMode, IProbeInfo iProbeInfo, Player player, Level level, BlockState blockState, IProbeHitData iProbeHitData) { +// BlockEntity blockEntity = level.getBlockEntity(iProbeHitData.getPos()); +// if (blockEntity instanceof ControllableDrawerTile && !(blockEntity instanceof StorageControllerTile) && !(blockEntity instanceof StorageControllerExtensionTile)) { +// iProbeInfo.getElements().removeIf(iElement -> iElement instanceof ElementVertical); +// ElementVertical vertical = new ElementVertical(); +// if (blockEntity instanceof DrawerTile) { +// BigInventoryHandler handler = ((DrawerTile) blockEntity).getHandler(); +// if (handler.getSlots() == 1 || player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED) { +// ElementVertical elementVertical = new ElementVertical(iProbeInfo.defaultLayoutStyle().spacing(2).leftPadding(7).rightPadding(7)); +// elementVertical.getStyle().borderColor(Color.CYAN.darker().getRGB()); +// for (int i = 0; i < handler.getStoredStacks().size(); i++) { +// BigInventoryHandler.BigStack storedStack = handler.getStoredStacks().get(i); +// if (storedStack.getAmount() > 0 || (handler.isLocked() && !storedStack.getStack().isEmpty())) { +// elementVertical.element(new CustomElementItemStack(storedStack.getStack(), NumberUtils.getFormatedBigNumber(handler.getStackInSlot(i).getCount()) + "/" + NumberUtils.getFormatedBigNumber(handler.getSlotLimit(i)), iProbeInfo.defaultItemStyle(), true)); +// } +// } +// if (elementVertical.getElements().size() > 0) vertical.element(elementVertical); +// vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); +// } else { +// ElementHorizontal abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().spacing(8).leftPadding(7).rightPadding(7)); +// abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); +// for (int i = 0; i < handler.getStoredStacks().size(); i++) { +// BigInventoryHandler.BigStack storedStack = handler.getStoredStacks().get(i); +// if (storedStack.getAmount() > 0 || (handler.isLocked() && !storedStack.getStack().isEmpty())) { +// abstractElementPanel.element(new CustomElementItemStack(storedStack.getStack(), NumberUtils.getFormatedBigNumber(handler.getStackInSlot(i).getCount()) + "/" + NumberUtils.getFormatedBigNumber(handler.getSlotLimit(i)), iProbeInfo.defaultItemStyle())); +// } +// } +// if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); +// vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); +// } +// } +// if (blockEntity instanceof EnderDrawerTile) { +// ElementHorizontal abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().spacing(8).leftPadding(7).rightPadding(7)); +// abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); +// EnderInventoryHandler savedData = EnderSavedData.getInstance(level).getFrequency(((EnderDrawerTile) blockEntity).getFrequency()); +// for (int i = 0; i < savedData.getStoredStacks().size(); i++) { +// BigInventoryHandler.BigStack storedStack = savedData.getStoredStacks().get(i); +// if (storedStack.getAmount() > 0 || (savedData.isLocked() && !storedStack.getStack().isEmpty())) { +// abstractElementPanel.element(new CustomElementItemStack(storedStack.getStack(), NumberUtils.getFormatedBigNumber(storedStack.getAmount()) + "/" + NumberUtils.getFormatedBigNumber(savedData.getSlotLimit(i)), iProbeInfo.defaultItemStyle(), player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED)); +// } +// } +// if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); +// ElementVertical elementVertical = new ElementVertical(iProbeInfo.defaultLayoutStyle()); +// elementVertical.getStyle().borderColor(Color.CYAN.darker().getRGB()); +// elementVertical.text(Component.translatable("linkingtool.ender.frequency")); +// vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); +// abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().leftPadding(4).topPadding(2).rightPadding(4)); +// for (ItemStack stack : EnderDrawerBlock.getFrequencyDisplay(((EnderDrawerTile) blockEntity).getFrequency())) { +// abstractElementPanel.element(new CustomElementItemStack(stack, "", iProbeInfo.defaultItemStyle())); +// } +// elementVertical.element(abstractElementPanel); +// vertical.element(elementVertical); +// vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); +// } +// if (blockEntity instanceof CompactingDrawerTile) { +// CompactingInventoryHandler inventoryHandler = ((CompactingDrawerTile) blockEntity).getHandler(); +// if (player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED || inventoryHandler.isCreative()) { +// ElementVertical abstractElementPanel = new ElementVertical(iProbeInfo.defaultLayoutStyle().spacing(2).leftPadding(7).rightPadding(7)); +// abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); +// abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(2).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(2).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(2)), iProbeInfo.defaultItemStyle(), true)); +// abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(1).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(1).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(1)), iProbeInfo.defaultItemStyle(), true)); +// abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(0).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(0).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(0)), iProbeInfo.defaultItemStyle(), true)); +// if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); +// } else { +// ElementHorizontal abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().spacing(8).leftPadding(7).rightPadding(7)); +// abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); +// int amount = inventoryHandler.getAmount(); +// abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(2).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(2).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(2)), iProbeInfo.defaultItemStyle())); +// amount -= inventoryHandler.getResultList().get(2).getNeeded() * inventoryHandler.getStackInSlot(2).getCount(); +// abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(1).getResult(), NumberUtils.getFormatedBigNumber((int) Math.floor(amount / inventoryHandler.getResultList().get(1).getNeeded())), iProbeInfo.defaultItemStyle())); +// amount -= inventoryHandler.getResultList().get(1).getNeeded() * Math.floor(amount / inventoryHandler.getResultList().get(1).getNeeded()); +// abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(0).getResult(), NumberUtils.getFormatedBigNumber((int) Math.floor(amount / inventoryHandler.getResultList().get(0).getNeeded())), iProbeInfo.defaultItemStyle())); +// if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); +// } +// vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); +// } +// if (blockEntity instanceof SimpleCompactingDrawerTile) { +// CompactingInventoryHandler inventoryHandler = ((SimpleCompactingDrawerTile) blockEntity).getHandler(); +// if (player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED || inventoryHandler.isCreative()) { +// ElementVertical abstractElementPanel = new ElementVertical(iProbeInfo.defaultLayoutStyle().spacing(2).leftPadding(7).rightPadding(7)); +// abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); +// abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(1).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(1).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(1)), iProbeInfo.defaultItemStyle(), true)); +// abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(0).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(0).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(0)), iProbeInfo.defaultItemStyle(), true)); +// if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); +// } else { +// ElementHorizontal abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().spacing(8).leftPadding(7).rightPadding(7)); +// abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); +// int amount = inventoryHandler.getAmount(); +// abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(1).getResult(), NumberUtils.getFormatedBigNumber((int) Math.floor(amount / inventoryHandler.getResultList().get(1).getNeeded())), iProbeInfo.defaultItemStyle())); +// amount -= inventoryHandler.getResultList().get(1).getNeeded() * Math.floor(amount / inventoryHandler.getResultList().get(1).getNeeded()); +// abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(0).getResult(), NumberUtils.getFormatedBigNumber((int) Math.floor(amount / inventoryHandler.getResultList().get(0).getNeeded())), iProbeInfo.defaultItemStyle())); +// if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); +// } +// vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); +// } +// if (blockEntity instanceof FluidDrawerTile fluidDrawerTile && (player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED)) { +// ElementVertical tanksVertical = new ElementVertical(iProbeInfo.defaultLayoutStyle().spacing(2)); +// for (int i = 0; i < fluidDrawerTile.getFluidHandler().getTanks(); i++) { +// var tankReference = TankReference.createTank(fluidDrawerTile.getFluidHandler().getTankList()[i]); +// tanksVertical.element(new ElementTank(tankReference, new ProgressStyle().numberFormat(NumberFormat.COMPACT))); +// } +// iProbeInfo.element(tanksVertical); +// } +// if (player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED) { +// ElementHorizontal abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().topPadding(0).spacing(8).leftPadding(7).rightPadding(7)); +// abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); +// for (int i = 0; i < ((ControllableDrawerTile) blockEntity).getUtilityUpgrades().getSlots(); i++) { +// ItemStack stack = ((ControllableDrawerTile) blockEntity).getUtilityUpgrades().getStackInSlot(i); +// if (!stack.isEmpty()) { +// String extra = ""; +// if (stack.is(FunctionalStorage.PUSHING_UPGRADE.get()) || stack.is(FunctionalStorage.PULLING_UPGRADE.get()) || stack.is(FunctionalStorage.COLLECTOR_UPGRADE.get())) { +// extra = WordUtils.capitalize(UpgradeItem.getDirection(stack).name().toLowerCase(Locale.ROOT)); +// if (extra.equals("Up")) { +// extra = " " + extra; +// } +// } +// abstractElementPanel.element(new CustomElementItemStack(stack, extra, iProbeInfo.defaultItemStyle())); +// } +// } +// if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); +// } +// iProbeInfo.element(vertical); +// } +// +// } +//} diff --git a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageBlockTagsProvider.java b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageBlockTagsProvider.java index c459f107..1e1b5fef 100644 --- a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageBlockTagsProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageBlockTagsProvider.java @@ -1,14 +1,13 @@ package com.buuz135.functionalstorage.data; import com.buuz135.functionalstorage.FunctionalStorage; +import com.hrznstudio.titanium.module.BlockWithTile; import net.minecraft.core.HolderLookup; import net.minecraft.data.DataGenerator; import net.minecraft.tags.BlockTags; import net.minecraft.world.level.block.Block; import net.neoforged.neoforge.common.data.BlockTagsProvider; import net.neoforged.neoforge.common.data.ExistingFileHelper; -import net.neoforged.neoforge.registries.RegistryObject; -import org.apache.commons.lang3.tuple.Pair; import org.jetbrains.annotations.Nullable; import java.util.concurrent.CompletableFuture; @@ -24,24 +23,24 @@ public FunctionalStorageBlockTagsProvider(DataGenerator dataGenerator, Completab protected void addTags(HolderLookup.Provider p_256380_) { TagAppender tTagAppender = this.tag(BlockTags.MINEABLE_WITH_AXE); for (FunctionalStorage.DrawerType drawerType : FunctionalStorage.DRAWER_TYPES.keySet()) { - for (RegistryObject blockRegistryObject : FunctionalStorage.DRAWER_TYPES.get(drawerType).stream().map(Pair::getLeft).collect(Collectors.toList())) { + for (var blockRegistryObject : FunctionalStorage.DRAWER_TYPES.get(drawerType).stream().map(BlockWithTile::block).collect(Collectors.toList())) { tTagAppender.add(blockRegistryObject.getKey()); } } this.tag(BlockTags.MINEABLE_WITH_PICKAXE) - .add(FunctionalStorage.COMPACTING_DRAWER.getLeft().get()) - .add(FunctionalStorage.DRAWER_CONTROLLER.getLeft().get()) - .add(FunctionalStorage.ARMORY_CABINET.getLeft().get()) - .add(FunctionalStorage.ENDER_DRAWER.getLeft().get()) - .add(FunctionalStorage.FRAMED_COMPACTING_DRAWER.getLeft().get()) - .add(FunctionalStorage.FLUID_DRAWER_1.getLeft().get()) - .add(FunctionalStorage.FLUID_DRAWER_2.getLeft().get()) - .add(FunctionalStorage.FLUID_DRAWER_4.getLeft().get()) - .add(FunctionalStorage.CONTROLLER_EXTENSION.getLeft().get()) - .add(FunctionalStorage.SIMPLE_COMPACTING_DRAWER.getLeft().get()) - .add(FunctionalStorage.FRAMED_DRAWER_CONTROLLER.getLeft().get()) - .add(FunctionalStorage.FRAMED_CONTROLLER_EXTENSION.getLeft().get()) - .add(FunctionalStorage.FRAMED_SIMPLE_COMPACTING_DRAWER.getLeft().get()) + .add(FunctionalStorage.COMPACTING_DRAWER.getBlock()) + .add(FunctionalStorage.DRAWER_CONTROLLER.getBlock()) + .add(FunctionalStorage.ARMORY_CABINET.getBlock()) + .add(FunctionalStorage.ENDER_DRAWER.getBlock()) + .add(FunctionalStorage.FRAMED_COMPACTING_DRAWER.getBlock()) + .add(FunctionalStorage.FLUID_DRAWER_1.getBlock()) + .add(FunctionalStorage.FLUID_DRAWER_2.getBlock()) + .add(FunctionalStorage.FLUID_DRAWER_4.getBlock()) + .add(FunctionalStorage.CONTROLLER_EXTENSION.getBlock()) + .add(FunctionalStorage.SIMPLE_COMPACTING_DRAWER.getBlock()) + .add(FunctionalStorage.FRAMED_DRAWER_CONTROLLER.getBlock()) + .add(FunctionalStorage.FRAMED_CONTROLLER_EXTENSION.getBlock()) + .add(FunctionalStorage.FRAMED_SIMPLE_COMPACTING_DRAWER.getBlock()) ; } diff --git a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageBlockstateProvider.java b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageBlockstateProvider.java index ed8378c0..71810df7 100644 --- a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageBlockstateProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageBlockstateProvider.java @@ -1,9 +1,14 @@ package com.buuz135.functionalstorage.data; import com.buuz135.functionalstorage.FunctionalStorage; -import com.buuz135.functionalstorage.block.*; +import com.buuz135.functionalstorage.block.CompactingDrawerBlock; +import com.buuz135.functionalstorage.block.DrawerBlock; +import com.buuz135.functionalstorage.block.EnderDrawerBlock; +import com.buuz135.functionalstorage.block.FluidDrawerBlock; +import com.buuz135.functionalstorage.block.SimpleCompactingDrawerBlock; import com.hrznstudio.titanium.block.RotatableBlock; import net.minecraft.core.Direction; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.data.DataGenerator; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.block.Block; @@ -14,7 +19,7 @@ import net.neoforged.neoforge.client.model.generators.VariantBlockStateBuilder; import net.neoforged.neoforge.common.data.ExistingFileHelper; import net.neoforged.neoforge.common.util.NonNullLazy; -import net.neoforged.neoforge.registries.ForgeRegistries; + import java.util.List; public class FunctionalStorageBlockstateProvider extends BlockStateProvider { @@ -28,11 +33,11 @@ public FunctionalStorageBlockstateProvider(DataGenerator gen, ExistingFileHelper } public static ResourceLocation getModel(Block block) { - return new ResourceLocation(ForgeRegistries.BLOCKS.getKey(block).getNamespace(), "block/" + ForgeRegistries.BLOCKS.getKey(block).getPath()); + return new ResourceLocation(BuiltInRegistries.BLOCK.getKey(block).getNamespace(), "block/" + BuiltInRegistries.BLOCK.getKey(block).getPath()); } public static ResourceLocation getModelLocked(Block block) { - return new ResourceLocation(ForgeRegistries.BLOCKS.getKey(block).getNamespace(), "block/" + ForgeRegistries.BLOCKS.getKey(block).getPath() + "_locked"); + return new ResourceLocation(BuiltInRegistries.BLOCK.getKey(block).getNamespace(), "block/" + BuiltInRegistries.BLOCK.getKey(block).getPath() + "_locked"); } @Override diff --git a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageItemTagsProvider.java b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageItemTagsProvider.java index b5d8c39c..e5962f01 100644 --- a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageItemTagsProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageItemTagsProvider.java @@ -2,21 +2,15 @@ import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.util.StorageTags; +import com.hrznstudio.titanium.module.BlockWithTile; import net.minecraft.core.HolderLookup; -import net.minecraft.data.DataGenerator; import net.minecraft.data.PackOutput; import net.minecraft.data.tags.ItemTagsProvider; -import net.minecraft.data.tags.TagsProvider; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Block; import net.neoforged.neoforge.common.data.ExistingFileHelper; -import net.neoforged.neoforge.registries.RegistryObject; -import org.apache.commons.lang3.tuple.Pair; import org.jetbrains.annotations.Nullable; -import var; + import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; public class FunctionalStorageItemTagsProvider extends ItemTagsProvider { @@ -29,9 +23,8 @@ public FunctionalStorageItemTagsProvider(PackOutput packOutput, CompletableFutur protected void addTags(HolderLookup.Provider p_256380_) { var tTagAppender = this.tag(StorageTags.DRAWER); for (FunctionalStorage.DrawerType drawerType : FunctionalStorage.DRAWER_TYPES.keySet()) { - for (RegistryObject blockRegistryObject : FunctionalStorage.DRAWER_TYPES.get(drawerType).stream().map(Pair::getLeft).collect(Collectors.toList())) { - tTagAppender.add(blockRegistryObject.get().asItem()); - } + FunctionalStorage.DRAWER_TYPES.get(drawerType).stream().map(BlockWithTile::block) + .forEach(ho -> tTagAppender.add(ho.get().asItem())); } } diff --git a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageLangProvider.java b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageLangProvider.java index 44b63423..bb2db5c1 100644 --- a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageLangProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageLangProvider.java @@ -3,13 +3,11 @@ import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.block.DrawerBlock; import com.buuz135.functionalstorage.item.StorageUpgradeItem; +import com.hrznstudio.titanium.module.BlockWithTile; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.data.DataGenerator; -import net.minecraft.world.level.block.Block; import net.neoforged.neoforge.common.data.LanguageProvider; -import net.neoforged.neoforge.registries.ForgeRegistries; -import net.neoforged.neoforge.registries.RegistryObject; import org.apache.commons.lang3.text.WordUtils; -import org.apache.commons.lang3.tuple.Pair; import java.util.stream.Collectors; @@ -23,20 +21,20 @@ public FunctionalStorageLangProvider(DataGenerator gen, String modid, String loc protected void addTranslations() { this.add("itemGroup.functionalstorage", "Functional Storage"); for (FunctionalStorage.DrawerType drawerType : FunctionalStorage.DRAWER_TYPES.keySet()) { - for (RegistryObject blockRegistryObject : FunctionalStorage.DRAWER_TYPES.get(drawerType).stream().map(Pair::getLeft).collect(Collectors.toList())) { + for (var blockRegistryObject : FunctionalStorage.DRAWER_TYPES.get(drawerType).stream().map(BlockWithTile::block).collect(Collectors.toList())) { DrawerBlock drawerBlock = (DrawerBlock) blockRegistryObject.get(); this.add(drawerBlock, WordUtils.capitalize(drawerBlock.getWoodType().getName().replace('_', ' ').toLowerCase()) + " Drawer (" + drawerBlock.getType().getDisplayName() + ")"); } } - this.add(FunctionalStorage.FLUID_DRAWER_1.getLeft().get(), "Fluid Drawer (" + FunctionalStorage.DrawerType.X_1.getDisplayName() + ")"); - this.add(FunctionalStorage.FLUID_DRAWER_2.getLeft().get(), "Fluid Drawer (" + FunctionalStorage.DrawerType.X_2.getDisplayName() + ")"); - this.add(FunctionalStorage.FLUID_DRAWER_4.getLeft().get(), "Fluid Drawer (" + FunctionalStorage.DrawerType.X_4.getDisplayName() + ")"); - this.add(FunctionalStorage.SIMPLE_COMPACTING_DRAWER.getLeft().get(), "Simple Compacting Drawer"); - this.add(FunctionalStorage.FRAMED_SIMPLE_COMPACTING_DRAWER.getLeft().get(), "Framed Simple Compacting Drawer"); - this.add(FunctionalStorage.COMPACTING_DRAWER.getLeft().get(), "Compacting Drawer"); - this.add(FunctionalStorage.FRAMED_COMPACTING_DRAWER.getLeft().get(), "Framed Compacting Drawer"); - this.add(FunctionalStorage.ENDER_DRAWER.getLeft().get(), "Ender Drawer"); - this.add(FunctionalStorage.CONTROLLER_EXTENSION.getLeft().get(), "Controller Access Point"); + this.add(FunctionalStorage.FLUID_DRAWER_1.getBlock(), "Fluid Drawer (" + FunctionalStorage.DrawerType.X_1.getDisplayName() + ")"); + this.add(FunctionalStorage.FLUID_DRAWER_2.getBlock(), "Fluid Drawer (" + FunctionalStorage.DrawerType.X_2.getDisplayName() + ")"); + this.add(FunctionalStorage.FLUID_DRAWER_4.getBlock(), "Fluid Drawer (" + FunctionalStorage.DrawerType.X_4.getDisplayName() + ")"); + this.add(FunctionalStorage.SIMPLE_COMPACTING_DRAWER.getBlock(), "Simple Compacting Drawer"); + this.add(FunctionalStorage.FRAMED_SIMPLE_COMPACTING_DRAWER.getBlock(), "Framed Simple Compacting Drawer"); + this.add(FunctionalStorage.COMPACTING_DRAWER.getBlock(), "Compacting Drawer"); + this.add(FunctionalStorage.FRAMED_COMPACTING_DRAWER.getBlock(), "Framed Compacting Drawer"); + this.add(FunctionalStorage.ENDER_DRAWER.getBlock(), "Ender Drawer"); + this.add(FunctionalStorage.CONTROLLER_EXTENSION.getBlock(), "Controller Access Point"); this.add("linkingtool.linkingmode", "Linking Mode: "); this.add("linkingtool.linkingmode.single", "Single"); this.add("linkingtool.linkingmode.single.desc", "Links a drawer to a controller"); @@ -50,22 +48,22 @@ protected void addTranslations() { this.add("key.categories.utility", "Utility"); this.add("key.categories.storage", "Storage"); this.add(FunctionalStorage.LINKING_TOOL.get(), "Linking Tool"); - this.add(FunctionalStorage.DRAWER_CONTROLLER.getLeft().get(), "Storage Controller"); - this.add(FunctionalStorage.FRAMED_DRAWER_CONTROLLER.getLeft().get(), "Framed Storage Controller"); - this.add(FunctionalStorage.FRAMED_CONTROLLER_EXTENSION.getLeft().get(), "Framed Controller Access Point"); + this.add(FunctionalStorage.DRAWER_CONTROLLER.getBlock(), "Storage Controller"); + this.add(FunctionalStorage.FRAMED_DRAWER_CONTROLLER.getBlock(), "Framed Storage Controller"); + this.add(FunctionalStorage.FRAMED_CONTROLLER_EXTENSION.getBlock(), "Framed Controller Access Point"); this.add("storageupgrade.desc.item", "Multiplies the block item storage by "); this.add("storageupgrade.desc.fluid", "Multiplies the block fluid storage by "); this.add("storageupgrade.desc.range", "Increases controller radius by %s blocks"); for (StorageUpgradeItem.StorageTier storageTier : FunctionalStorage.STORAGE_UPGRADES.keySet()) { this.add(FunctionalStorage.STORAGE_UPGRADES.get(storageTier).get(), WordUtils.capitalize(storageTier.name().toLowerCase()) + (storageTier == StorageUpgradeItem.StorageTier.IRON ? " Downgrade" : " Upgrade")); } - this.add(FunctionalStorage.COLLECTOR_UPGRADE.get(), WordUtils.capitalize(ForgeRegistries.ITEMS.getKey(FunctionalStorage.COLLECTOR_UPGRADE.get()).getPath().replace('_', ' ').toLowerCase())); - this.add(FunctionalStorage.PULLING_UPGRADE.get(), WordUtils.capitalize(ForgeRegistries.ITEMS.getKey(FunctionalStorage.PULLING_UPGRADE.get()).getPath().replace('_', ' ').toLowerCase())); - this.add(FunctionalStorage.PUSHING_UPGRADE.get(), WordUtils.capitalize(ForgeRegistries.ITEMS.getKey(FunctionalStorage.PUSHING_UPGRADE.get()).getPath().replace('_', ' ').toLowerCase())); - this.add(FunctionalStorage.VOID_UPGRADE.get(), WordUtils.capitalize(ForgeRegistries.ITEMS.getKey(FunctionalStorage.VOID_UPGRADE.get()).getPath().replace('_', ' ').toLowerCase())); - this.add(FunctionalStorage.REDSTONE_UPGRADE.get(), WordUtils.capitalize(ForgeRegistries.ITEMS.getKey(FunctionalStorage.REDSTONE_UPGRADE.get()).getPath().replace('_', ' ').toLowerCase())); - this.add(FunctionalStorage.CREATIVE_UPGRADE.get(), WordUtils.capitalize(ForgeRegistries.ITEMS.getKey(FunctionalStorage.CREATIVE_UPGRADE.get()).getPath().replace('_', ' ').toLowerCase())); - this.add(FunctionalStorage.ARMORY_CABINET.getLeft().get(), "Armory Cabinet"); + this.add(FunctionalStorage.COLLECTOR_UPGRADE.get(), WordUtils.capitalize(BuiltInRegistries.ITEM.getKey(FunctionalStorage.COLLECTOR_UPGRADE.get()).getPath().replace('_', ' ').toLowerCase())); + this.add(FunctionalStorage.PULLING_UPGRADE.get(), WordUtils.capitalize(BuiltInRegistries.ITEM.getKey(FunctionalStorage.PULLING_UPGRADE.get()).getPath().replace('_', ' ').toLowerCase())); + this.add(FunctionalStorage.PUSHING_UPGRADE.get(), WordUtils.capitalize(BuiltInRegistries.ITEM.getKey(FunctionalStorage.PUSHING_UPGRADE.get()).getPath().replace('_', ' ').toLowerCase())); + this.add(FunctionalStorage.VOID_UPGRADE.get(), WordUtils.capitalize(BuiltInRegistries.ITEM.getKey(FunctionalStorage.VOID_UPGRADE.get()).getPath().replace('_', ' ').toLowerCase())); + this.add(FunctionalStorage.REDSTONE_UPGRADE.get(), WordUtils.capitalize(BuiltInRegistries.ITEM.getKey(FunctionalStorage.REDSTONE_UPGRADE.get()).getPath().replace('_', ' ').toLowerCase())); + this.add(FunctionalStorage.CREATIVE_UPGRADE.get(), WordUtils.capitalize(BuiltInRegistries.ITEM.getKey(FunctionalStorage.CREATIVE_UPGRADE.get()).getPath().replace('_', ' ').toLowerCase())); + this.add(FunctionalStorage.ARMORY_CABINET.getBlock(), "Armory Cabinet"); this.add(FunctionalStorage.CONFIGURATION_TOOL.get(), "Configuration Tool"); this.add("item.utility.downgrade", "Downgrades the slots to a max of 64 items"); this.add("item.utility.direction", "Direction: "); diff --git a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageRecipesProvider.java b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageRecipesProvider.java index 2c91d278..ed06b643 100644 --- a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageRecipesProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageRecipesProvider.java @@ -1,126 +1,145 @@ package com.buuz135.functionalstorage.data; import com.buuz135.functionalstorage.item.StorageUpgradeItem; +import com.buuz135.functionalstorage.recipe.CustomCompactingRecipe; import com.buuz135.functionalstorage.util.StorageTags; import com.hrznstudio.titanium.block.BasicBlock; -import com.hrznstudio.titanium.recipe.generator.TitaniumRecipeProvider; import com.hrznstudio.titanium.recipe.generator.TitaniumShapedRecipeBuilder; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.data.DataGenerator; -import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.data.recipes.RecipeCategory; +import net.minecraft.data.recipes.RecipeOutput; +import net.minecraft.data.recipes.RecipeProvider; import net.minecraft.data.recipes.SmithingTransformRecipeBuilder; +import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.ItemTags; +import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.block.Block; import net.neoforged.neoforge.common.Tags; import net.neoforged.neoforge.common.util.NonNullLazy; -import net.neoforged.neoforge.registries.ForgeRegistries; + import java.util.List; -import java.util.function.Consumer; -import static com.buuz135.functionalstorage.FunctionalStorage.*; +import static com.buuz135.functionalstorage.FunctionalStorage.ARMORY_CABINET; +import static com.buuz135.functionalstorage.FunctionalStorage.COLLECTOR_UPGRADE; +import static com.buuz135.functionalstorage.FunctionalStorage.CONFIGURATION_TOOL; +import static com.buuz135.functionalstorage.FunctionalStorage.ENDER_DRAWER; +import static com.buuz135.functionalstorage.FunctionalStorage.LINKING_TOOL; +import static com.buuz135.functionalstorage.FunctionalStorage.PULLING_UPGRADE; +import static com.buuz135.functionalstorage.FunctionalStorage.PUSHING_UPGRADE; +import static com.buuz135.functionalstorage.FunctionalStorage.REDSTONE_UPGRADE; +import static com.buuz135.functionalstorage.FunctionalStorage.STORAGE_UPGRADES; +import static com.buuz135.functionalstorage.FunctionalStorage.VOID_UPGRADE; -public class FunctionalStorageRecipesProvider extends TitaniumRecipeProvider { +public class FunctionalStorageRecipesProvider extends RecipeProvider { - private NonNullLazy> blocksToProcess; + private final NonNullLazy> blocksToProcess; public FunctionalStorageRecipesProvider(DataGenerator generator, NonNullLazy> blocksToProcess) { - super(generator); + super(generator.getPackOutput()); this.blocksToProcess = blocksToProcess; } @Override - public void register(Consumer consumer) { - blocksToProcess.get().stream().map(block -> (BasicBlock) block).forEach(basicBlock -> basicBlock.registerRecipe(consumer)); + protected void buildRecipes(RecipeOutput output) { + blocksToProcess.get().stream().map(block -> (BasicBlock) block).forEach(basicBlock -> basicBlock.registerRecipe(output)); TitaniumShapedRecipeBuilder.shapedRecipe(STORAGE_UPGRADES.get(StorageUpgradeItem.StorageTier.IRON).get()) .pattern("III").pattern("IDI").pattern("III") .define('I', Tags.Items.INGOTS_IRON) .define('D', StorageTags.DRAWER) - .save(consumer); + .save(output); TitaniumShapedRecipeBuilder.shapedRecipe(VOID_UPGRADE.get()) .pattern("III").pattern("IDI").pattern("III") .define('I', Tags.Items.OBSIDIAN) .define('D', StorageTags.DRAWER) - .save(consumer); + .save(output); TitaniumShapedRecipeBuilder.shapedRecipe(CONFIGURATION_TOOL.get()) .pattern("PPG").pattern("PDG").pattern("PEP") .define('P', Items.PAPER) .define('G', Tags.Items.INGOTS_GOLD) .define('D', StorageTags.DRAWER) .define('E', Items.EMERALD) - .save(consumer); + .save(output); TitaniumShapedRecipeBuilder.shapedRecipe(LINKING_TOOL.get()) .pattern("PPG").pattern("PDG").pattern("PEP") .define('P', Items.PAPER) .define('G', Tags.Items.INGOTS_GOLD) .define('D', StorageTags.DRAWER) .define('E', Items.DIAMOND) - .save(consumer); + .save(output); TitaniumShapedRecipeBuilder.shapedRecipe(STORAGE_UPGRADES.get(StorageUpgradeItem.StorageTier.COPPER).get()) .pattern("IBI").pattern("CDC").pattern("IBI") .define('I', Items.COPPER_INGOT) .define('B', Items.COPPER_BLOCK) .define('C', Tags.Items.CHESTS_WOODEN) .define('D', StorageTags.DRAWER) - .save(consumer); + .save(output); TitaniumShapedRecipeBuilder.shapedRecipe(STORAGE_UPGRADES.get(StorageUpgradeItem.StorageTier.GOLD).get()) .pattern("IBI").pattern("CDC").pattern("BIB") .define('I', Tags.Items.INGOTS_GOLD) .define('B', Tags.Items.STORAGE_BLOCKS_GOLD) .define('C', Tags.Items.CHESTS_WOODEN) .define('D', STORAGE_UPGRADES.get(StorageUpgradeItem.StorageTier.COPPER).get()) - .save(consumer); + .save(output); TitaniumShapedRecipeBuilder.shapedRecipe(STORAGE_UPGRADES.get(StorageUpgradeItem.StorageTier.DIAMOND).get()) .pattern("IBI").pattern("CDC").pattern("IBI") .define('I', Tags.Items.GEMS_DIAMOND) .define('B', Tags.Items.STORAGE_BLOCKS_DIAMOND) .define('C', Tags.Items.CHESTS_WOODEN) .define('D', STORAGE_UPGRADES.get(StorageUpgradeItem.StorageTier.GOLD).get()) - .save(consumer); + .save(output); TitaniumShapedRecipeBuilder.shapedRecipe(REDSTONE_UPGRADE.get()) .pattern("IBI").pattern("CDC").pattern("IBI") .define('I', Items.REDSTONE) .define('B', Items.REDSTONE_BLOCK) .define('C', Items.COMPARATOR) .define('D', StorageTags.DRAWER) - .save(consumer); + .save(output); SmithingTransformRecipeBuilder.smithing(Ingredient.of(Items.NETHERITE_UPGRADE_SMITHING_TEMPLATE), Ingredient.of(STORAGE_UPGRADES.get(StorageUpgradeItem.StorageTier.DIAMOND).get()), Ingredient.of(Items.NETHERITE_INGOT), RecipeCategory.MISC, STORAGE_UPGRADES.get(StorageUpgradeItem.StorageTier.NETHERITE).get()) .unlocks("has_netherite_ingot", has(Items.NETHERITE_INGOT)) - .save(consumer, ForgeRegistries.ITEMS.getKey(STORAGE_UPGRADES.get(StorageUpgradeItem.StorageTier.NETHERITE).get())); - TitaniumShapedRecipeBuilder.shapedRecipe(ARMORY_CABINET.getLeft().get()) + .save(output, BuiltInRegistries.ITEM.getKey(STORAGE_UPGRADES.get(StorageUpgradeItem.StorageTier.NETHERITE).get())); + TitaniumShapedRecipeBuilder.shapedRecipe(ARMORY_CABINET.getBlock()) .pattern("ICI").pattern("CDC").pattern("IBI") .define('I', Tags.Items.STONE) .define('B', Tags.Items.INGOTS_NETHERITE) .define('C', StorageTags.DRAWER) .define('D', Items.COMPARATOR) - .save(consumer); + .save(output); TitaniumShapedRecipeBuilder.shapedRecipe(PULLING_UPGRADE.get()) .pattern("ICI").pattern("IDI").pattern("IBI") .define('I', Tags.Items.STONE) .define('B', Tags.Items.DUSTS_REDSTONE) .define('C', Items.HOPPER) .define('D', StorageTags.DRAWER) - .save(consumer); + .save(output); TitaniumShapedRecipeBuilder.shapedRecipe(PUSHING_UPGRADE.get()) .pattern("IBI").pattern("IDI").pattern("IRI") .define('I', Tags.Items.STONE) .define('B', Tags.Items.DUSTS_REDSTONE) .define('R', Items.HOPPER) .define('D', StorageTags.DRAWER) - .save(consumer); + .save(output); TitaniumShapedRecipeBuilder.shapedRecipe(COLLECTOR_UPGRADE.get()) .pattern("IBI").pattern("RDR").pattern("IBI") .define('I', Tags.Items.STONE) .define('B', Items.HOPPER) .define('R', Tags.Items.DUSTS_REDSTONE) .define('D', StorageTags.DRAWER) - .save(consumer); - TitaniumShapedRecipeBuilder.shapedRecipe(ENDER_DRAWER.getLeft().get()) + .save(output); + TitaniumShapedRecipeBuilder.shapedRecipe(ENDER_DRAWER.getBlock()) .pattern("PPP").pattern("LCL").pattern("PPP") .define('P', ItemTags.PLANKS) .define('C', Tags.Items.CHESTS_ENDER) .define('L', StorageTags.DRAWER) - .save(consumer); + .save(output); + + new CustomCompactingRecipe(new ItemStack(Items.GLOWSTONE_DUST, 4), new ItemStack(Items.GLOWSTONE)).save(output); + new CustomCompactingRecipe(new ItemStack(Items.MELON_SLICE, 9), new ItemStack(Items.MELON)).save(output); + new CustomCompactingRecipe(new ItemStack(Items.QUARTZ, 4), new ItemStack(Items.QUARTZ_BLOCK)).save(output, new ResourceLocation("quartz")); + new CustomCompactingRecipe(new ItemStack(Items.ICE, 9), new ItemStack(Items.PACKED_ICE)).save(output); + new CustomCompactingRecipe(new ItemStack(Items.PACKED_ICE, 9), new ItemStack(Items.BLUE_ICE)).save(output); + new CustomCompactingRecipe(new ItemStack(Items.AMETHYST_SHARD, 4), new ItemStack(Items.AMETHYST_BLOCK)).save(output, new ResourceLocation("amethyst")); } } diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/ArmoryCabinetInventoryHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/ArmoryCabinetInventoryHandler.java index 862d3e0b..cf54bd5b 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/ArmoryCabinetInventoryHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/ArmoryCabinetInventoryHandler.java @@ -5,7 +5,7 @@ import net.minecraft.world.item.HorseArmorItem; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.RecordItem; -import net.neoforged.neoforge.common.capabilities.Capabilities; +import net.neoforged.neoforge.capabilities.Capabilities; import net.neoforged.neoforge.common.util.INBTSerializable; import net.neoforged.neoforge.items.IItemHandler; import org.jetbrains.annotations.NotNull; @@ -76,7 +76,7 @@ private boolean isValid(int slot, @NotNull ItemStack stack) { } private boolean isCertifiedStack(ItemStack stack){ - if (stack.getCapability(Capabilities.ITEM_HANDLER, null).isPresent()) return false; + if (stack.getCapability(Capabilities.ItemHandler.ITEM) != null) return false; if (stack.getMaxStackSize() > 1) return false; return stack.hasTag() || stack.isDamageableItem() || stack.isEnchantable() || stack.getItem() instanceof RecordItem || stack.getItem() instanceof HorseArmorItem; } @@ -87,7 +87,7 @@ public CompoundTag serializeNBT() { for (int i = 0; i < this.stackList.size(); i++) { ItemStack stack = this.stackList.get(i); if (!stack.isEmpty()){ - compoundTag.put(i + "", stack.serializeNBT()); + compoundTag.put(String.valueOf(i), stack.save(new CompoundTag())); } } return compoundTag; diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/BigInventoryHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/BigInventoryHandler.java index 54b2c173..e6ac9b4c 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/BigInventoryHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/BigInventoryHandler.java @@ -6,7 +6,7 @@ import net.neoforged.neoforge.common.util.INBTSerializable; import net.neoforged.neoforge.items.IItemHandler; import net.neoforged.neoforge.items.ItemHandlerHelper; -import var; + import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; @@ -133,7 +133,7 @@ public CompoundTag serializeNBT() { CompoundTag items = new CompoundTag(); for (int i = 0; i < this.storedStacks.size(); i++) { CompoundTag bigStack = new CompoundTag(); - bigStack.put(STACK, this.storedStacks.get(i).getStack().serializeNBT()); + bigStack.put(STACK, this.storedStacks.get(i).getStack().save(new CompoundTag())); bigStack.putInt(AMOUNT, this.storedStacks.get(i).getAmount()); items.put(i + "", bigStack); } diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/CompactingInventoryHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/CompactingInventoryHandler.java index 01fdc8b0..27dbe5f7 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/CompactingInventoryHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/CompactingInventoryHandler.java @@ -172,12 +172,12 @@ private boolean isValid(int slot, @Nonnull ItemStack stack){ @Override public CompoundTag serializeNBT() { CompoundTag compoundTag = new CompoundTag(); - compoundTag.put(PARENT, this.getParent().serializeNBT()); + compoundTag.put(PARENT, this.getParent().save(new CompoundTag())); compoundTag.putInt(AMOUNT, this.amount); CompoundTag items = new CompoundTag(); for (int i = 0; i < this.resultList.size(); i++) { CompoundTag bigStack = new CompoundTag(); - bigStack.put(STACK, this.resultList.get(i).getResult().serializeNBT()); + bigStack.put(STACK, this.resultList.get(i).getResult().save(new CompoundTag())); bigStack.putInt(AMOUNT, this.resultList.get(i).getNeeded()); items.put(i + "", bigStack); } diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingDrawerCapabilityProvider.java b/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingDrawerCapabilityProvider.java deleted file mode 100644 index 25a1a219..00000000 --- a/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingDrawerCapabilityProvider.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.buuz135.functionalstorage.inventory.item; - -import net.minecraft.core.Direction; -import net.minecraft.world.item.ItemStack; -import net.neoforged.neoforge.common.capabilities.Capabilities; -import net.neoforged.neoforge.common.capabilities.Capability; -import net.neoforged.neoforge.common.capabilities.ICapabilityProvider; -import net.neoforged.neoforge.common.util.LazyOptional; -import net.neoforged.neoforge.items.IItemHandler; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public class CompactingDrawerCapabilityProvider implements ICapabilityProvider { - - private final ItemStack stack; - private final CompactingStackItemHandler drawerStackItemHandler; - private final LazyOptional itemHandler; - - public CompactingDrawerCapabilityProvider(ItemStack stack, int slots) { - this.stack = stack; - this.drawerStackItemHandler = new CompactingStackItemHandler(stack, slots); - this.itemHandler = LazyOptional.of(() -> this.drawerStackItemHandler); - } - - @NotNull - @Override - public LazyOptional getCapability(@NotNull Capability cap, @Nullable Direction side) { - if (cap.equals(Capabilities.ITEM_HANDLER)) return this.itemHandler.cast(); - return LazyOptional.empty(); - } - - @NotNull - @Override - public LazyOptional getCapability(@NotNull Capability cap) { - if (cap.equals(Capabilities.ITEM_HANDLER)) return this.itemHandler.cast(); - return LazyOptional.empty(); - } -} diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingStackItemHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingStackItemHandler.java index a702b613..30e71e38 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingStackItemHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingStackItemHandler.java @@ -202,12 +202,12 @@ private boolean isValid(int slot, @Nonnull ItemStack stack) { @Override public CompoundTag serializeNBT() { CompoundTag compoundTag = new CompoundTag(); - compoundTag.put(PARENT, this.getParent().serializeNBT()); + compoundTag.put(PARENT, this.getParent().save(new CompoundTag())); compoundTag.putInt(AMOUNT, this.amount); CompoundTag items = new CompoundTag(); for (int i = 0; i < this.resultList.size(); i++) { CompoundTag bigStack = new CompoundTag(); - bigStack.put(STACK, this.resultList.get(i).getResult().serializeNBT()); + bigStack.put(STACK, this.resultList.get(i).getResult().save(new CompoundTag())); bigStack.putInt(AMOUNT, this.resultList.get(i).getNeeded()); items.put(i + "", bigStack); } diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerCapabilityProvider.java b/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerCapabilityProvider.java deleted file mode 100644 index 13c4f513..00000000 --- a/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerCapabilityProvider.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.buuz135.functionalstorage.inventory.item; - -import com.buuz135.functionalstorage.FunctionalStorage; -import net.minecraft.core.Direction; -import net.minecraft.world.item.ItemStack; -import net.neoforged.neoforge.common.capabilities.Capabilities; -import net.neoforged.neoforge.common.capabilities.Capability; -import net.neoforged.neoforge.common.capabilities.ICapabilityProvider; -import net.neoforged.neoforge.common.util.LazyOptional; -import net.neoforged.neoforge.items.IItemHandler; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public class DrawerCapabilityProvider implements ICapabilityProvider { - - private final ItemStack stack; - private final DrawerStackItemHandler drawerStackItemHandler; - private final LazyOptional itemHandler; - - public DrawerCapabilityProvider(ItemStack stack, FunctionalStorage.DrawerType type) { - this.stack = stack; - this.drawerStackItemHandler = new DrawerStackItemHandler(stack, type); - this.itemHandler = LazyOptional.of(() -> this.drawerStackItemHandler); - } - - @NotNull - @Override - public LazyOptional getCapability(@NotNull Capability cap, @Nullable Direction side) { - if (cap.equals(Capabilities.ITEM_HANDLER)) return this.itemHandler.cast(); - return LazyOptional.empty(); - } - - @NotNull - @Override - public LazyOptional getCapability(@NotNull Capability cap) { - if (cap.equals(Capabilities.ITEM_HANDLER)) return this.itemHandler.cast(); - return LazyOptional.empty(); - } -} diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerStackItemHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerStackItemHandler.java index 80ea837b..12e7b0e8 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerStackItemHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerStackItemHandler.java @@ -10,7 +10,7 @@ import net.neoforged.neoforge.common.util.INBTSerializable; import net.neoforged.neoforge.items.IItemHandler; import net.neoforged.neoforge.items.ItemHandlerHelper; -import var; + import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; @@ -63,7 +63,7 @@ public CompoundTag serializeNBT() { CompoundTag items = new CompoundTag(); for (int i = 0; i < this.storedStacks.size(); i++) { CompoundTag bigStack = new CompoundTag(); - bigStack.put(STACK, this.storedStacks.get(i).getStack().serializeNBT()); + bigStack.put(STACK, this.storedStacks.get(i).getStack().save(new CompoundTag())); bigStack.putInt(AMOUNT, this.storedStacks.get(i).getAmount()); items.put(i + "", bigStack); } diff --git a/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java b/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java index ad3bb311..45e7fe21 100644 --- a/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java +++ b/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java @@ -17,7 +17,7 @@ import net.minecraft.world.level.Level; import org.apache.commons.lang3.text.WordUtils; import org.jetbrains.annotations.Nullable; -import var; + import java.util.Arrays; import java.util.List; import java.util.Locale; @@ -75,13 +75,13 @@ public boolean overrideOtherStackedOnMe(ItemStack first, ItemStack second, Slot Direction direction = getDirection(first); Direction next = Direction.values()[(Arrays.asList(Direction.values()).indexOf(direction) + 1 ) % Direction.values().length]; first.getOrCreateTag().putString("Direction", next.getName()); - p_150896_.playSound(SoundEvents.UI_BUTTON_CLICK.get(), 0.5f, 1); + p_150896_.playSound(SoundEvents.UI_BUTTON_CLICK.value(), 0.5f, 1); return true; } if (item.equals(FunctionalStorage.REDSTONE_UPGRADE.get())){ int slot = first.getOrCreateTag().getInt("Slot"); first.getOrCreateTag().putInt("Slot", (slot + 1) % MAX_SLOT); - p_150896_.playSound(SoundEvents.UI_BUTTON_CLICK.get(), 0.5f, 1); + p_150896_.playSound(SoundEvents.UI_BUTTON_CLICK.value(), 0.5f, 1); return true; } } diff --git a/src/main/java/com/buuz135/functionalstorage/network/EnderDrawerSyncMessage.java b/src/main/java/com/buuz135/functionalstorage/network/EnderDrawerSyncMessage.java index 5beb7764..ff37bc27 100644 --- a/src/main/java/com/buuz135/functionalstorage/network/EnderDrawerSyncMessage.java +++ b/src/main/java/com/buuz135/functionalstorage/network/EnderDrawerSyncMessage.java @@ -5,7 +5,7 @@ import com.hrznstudio.titanium.network.CompoundSerializableDataHandler; import com.hrznstudio.titanium.network.Message; import net.minecraft.client.Minecraft; -import net.neoforged.neoforge.network.NetworkEvent; +import net.neoforged.neoforge.network.handling.PlayPayloadContext; public class EnderDrawerSyncMessage extends Message { @@ -33,8 +33,8 @@ public EnderDrawerSyncMessage() { } @Override - protected void handleMessage(NetworkEvent.Context context) { - context.enqueueWork(() -> { + protected void handleMessage(PlayPayloadContext context) { + context.workHandler().execute(() -> { EnderSavedData.getInstance(Minecraft.getInstance().level).setFrenquency(frequency, handler); }); } diff --git a/src/main/java/com/buuz135/functionalstorage/recipe/CustomCompactingRecipe.java b/src/main/java/com/buuz135/functionalstorage/recipe/CustomCompactingRecipe.java index 7d0c0d6c..5880f3fb 100644 --- a/src/main/java/com/buuz135/functionalstorage/recipe/CustomCompactingRecipe.java +++ b/src/main/java/com/buuz135/functionalstorage/recipe/CustomCompactingRecipe.java @@ -1,31 +1,37 @@ package com.buuz135.functionalstorage.recipe; import com.buuz135.functionalstorage.FunctionalStorage; -import com.hrznstudio.titanium.recipe.serializer.GenericSerializer; -import com.hrznstudio.titanium.recipe.serializer.SerializableRecipe; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.core.RegistryAccess; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.Container; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.Level; import java.util.ArrayList; import java.util.List; -public class CustomCompactingRecipe extends SerializableRecipe { +public class CustomCompactingRecipe implements Recipe { + public static final Codec CODEC = RecordCodecBuilder.create(in -> in.group( + ItemStack.ITEM_WITH_COUNT_CODEC.fieldOf("lower_input").forGetter(CustomCompactingRecipe::getLower_input), + ItemStack.ITEM_WITH_COUNT_CODEC.fieldOf("higher_input").forGetter(CustomCompactingRecipe::getHigher_input) + ).apply(in, CustomCompactingRecipe::new)); public static List RECIPES = new ArrayList<>(); public ItemStack lower_input = ItemStack.EMPTY; public ItemStack higher_input = ItemStack.EMPTY; - public CustomCompactingRecipe(ResourceLocation resourceLocation) { - super(resourceLocation); + public CustomCompactingRecipe() { } - public CustomCompactingRecipe(ResourceLocation resourceLocation, ItemStack lower_input, ItemStack higher_input) { - super(resourceLocation); + public CustomCompactingRecipe(ItemStack lower_input, ItemStack higher_input) { this.lower_input = lower_input; this.higher_input = higher_input; RECIPES.add(this); @@ -52,15 +58,24 @@ public ItemStack getResultItem(RegistryAccess access) { } @Override - public GenericSerializer getSerializer() { - return (GenericSerializer) FunctionalStorage.CUSTOM_COMPACTING_RECIPE_SERIALIZER.get(); + public RecipeSerializer getSerializer() { + return FunctionalStorage.CUSTOM_COMPACTING_RECIPE_SERIALIZER.value(); } @Override public RecipeType getType() { - return FunctionalStorage.CUSTOM_COMPACTING_RECIPE_TYPE.get(); + return FunctionalStorage.CUSTOM_COMPACTING_RECIPE_TYPE.value(); } + public void save(RecipeOutput output, ResourceLocation id) { + output.accept(id, this, null); + } + + public void save(RecipeOutput output) { + save(output, BuiltInRegistries.ITEM.getKey(higher_input.getItem())); + } + + public ItemStack getLower_input() { return lower_input; } diff --git a/src/main/java/com/buuz135/functionalstorage/recipe/DrawerlessWoodIngredient.java b/src/main/java/com/buuz135/functionalstorage/recipe/DrawerlessWoodIngredient.java index 6bbf63f1..e2231a64 100644 --- a/src/main/java/com/buuz135/functionalstorage/recipe/DrawerlessWoodIngredient.java +++ b/src/main/java/com/buuz135/functionalstorage/recipe/DrawerlessWoodIngredient.java @@ -1,17 +1,16 @@ package com.buuz135.functionalstorage.recipe; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; import com.hrznstudio.titanium.util.TagUtil; -import net.minecraft.network.FriendlyByteBuf; +import com.mojang.serialization.Codec; +import net.minecraft.core.Holder; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.ItemTags; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; -import net.neoforged.neoforge.common.crafting.IIngredientSerializer; -import net.neoforged.neoforge.registries.ForgeRegistries; +import net.neoforged.neoforge.common.crafting.IngredientType; import org.jetbrains.annotations.Nullable; import java.util.List; @@ -21,9 +20,9 @@ import static com.buuz135.functionalstorage.FunctionalStorage.MOD_ID; public class DrawerlessWoodIngredient extends Ingredient { - - public static WoodlessIngredientSerializer SERIALIZER = new WoodlessIngredientSerializer(); - public static ResourceLocation NAME = new ResourceLocation(MOD_ID, "woodless"); + public static final Codec CODEC = Codec.unit(DrawerlessWoodIngredient::new); + public static Holder> TYPE; + public static final ResourceLocation NAME = new ResourceLocation(MOD_ID, "woodless"); private List woodless; @@ -42,13 +41,18 @@ public boolean test(@Nullable ItemStack stack) { } @Override - public IIngredientSerializer getSerializer() { - return SERIALIZER; + public boolean synchronizeWithContents() { + return false; + } + + @Override + public IngredientType getType() { + return TYPE.value(); } private List getWoods(){ if (woodless == null){ - woodless = TagUtil.getAllEntries(ForgeRegistries.ITEMS, ItemTags.PLANKS).stream().filter(item -> !ForgeRegistries.ITEMS.getKey(item).getNamespace().equalsIgnoreCase("minecraft")).collect(Collectors.toList()); + woodless = TagUtil.getAllEntries(BuiltInRegistries.ITEM, ItemTags.PLANKS).stream().filter(item -> !BuiltInRegistries.ITEM.getKey(item).getNamespace().equalsIgnoreCase("minecraft")).collect(Collectors.toList()); if (woodless.isEmpty()){ woodless.add(Items.OAK_PLANKS); } @@ -56,34 +60,4 @@ private List getWoods(){ return woodless; } - @Override - public JsonElement toJson() { - JsonObject element = new JsonObject(); - element.addProperty("type", NAME.toString()); - return element; - } - - @Override - protected void invalidate() { - super.invalidate(); - this.woodless = null; - } - - public static class WoodlessIngredientSerializer implements IIngredientSerializer{ - - @Override - public Ingredient parse(FriendlyByteBuf buffer) { - return new DrawerlessWoodIngredient(); - } - - @Override - public Ingredient parse(JsonObject json) { - return new DrawerlessWoodIngredient(); - } - - @Override - public void write(FriendlyByteBuf buffer, Ingredient ingredient) { - - } - } } diff --git a/src/main/java/com/buuz135/functionalstorage/recipe/FramedDrawerRecipe.java b/src/main/java/com/buuz135/functionalstorage/recipe/FramedDrawerRecipe.java index f19fae40..246b463b 100644 --- a/src/main/java/com/buuz135/functionalstorage/recipe/FramedDrawerRecipe.java +++ b/src/main/java/com/buuz135/functionalstorage/recipe/FramedDrawerRecipe.java @@ -1,9 +1,12 @@ package com.buuz135.functionalstorage.recipe; -import com.buuz135.functionalstorage.block.*; +import com.buuz135.functionalstorage.block.CompactingFramedDrawerBlock; +import com.buuz135.functionalstorage.block.FramedControllerExtensionBlock; +import com.buuz135.functionalstorage.block.FramedDrawerBlock; +import com.buuz135.functionalstorage.block.FramedDrawerControllerBlock; +import com.buuz135.functionalstorage.block.FramedSimpleCompactingDrawerBlock; import net.minecraft.core.RegistryAccess; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.inventory.CraftingContainer; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.ItemStack; @@ -13,14 +16,12 @@ import net.minecraft.world.item.crafting.SimpleCraftingRecipeSerializer; import net.minecraft.world.level.Level; -import java.util.List; - public class FramedDrawerRecipe extends CustomRecipe { - public static RecipeSerializer SERIALIZER = new SimpleCraftingRecipeSerializer<>((p_250892_, p_249920_) -> new FramedDrawerRecipe(p_250892_)); + public static RecipeSerializer SERIALIZER = new SimpleCraftingRecipeSerializer<>((c) -> new FramedDrawerRecipe()); - public FramedDrawerRecipe(ResourceLocation idIn) { - super(idIn, CraftingBookCategory.MISC); + public FramedDrawerRecipe() { + super(CraftingBookCategory.MISC); } diff --git a/src/main/java/com/buuz135/functionalstorage/util/CompactingUtil.java b/src/main/java/com/buuz135/functionalstorage/util/CompactingUtil.java index cd80e0c6..0e29e872 100644 --- a/src/main/java/com/buuz135/functionalstorage/util/CompactingUtil.java +++ b/src/main/java/com/buuz135/functionalstorage/util/CompactingUtil.java @@ -4,19 +4,23 @@ import com.buuz135.functionalstorage.recipe.CustomCompactingRecipe; import com.hrznstudio.titanium.util.RecipeUtil; import net.minecraft.core.NonNullList; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.CraftingContainer; import net.minecraft.world.inventory.TransientCraftingContainer; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.CraftingRecipe; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.Level; import net.neoforged.neoforge.items.ItemHandlerHelper; -import net.neoforged.neoforge.registries.ForgeRegistries; -import java.util.*; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** @@ -37,7 +41,7 @@ public CompactingUtil(Level level, int resultAmount) { this.level = level; this.resultAmount = resultAmount; this.results = new ArrayList<>(); - this.recipes = (List) RecipeUtil.getRecipes(level, FunctionalStorage.CUSTOM_COMPACTING_RECIPE_TYPE.get()); + this.recipes = (List) RecipeUtil.getRecipes(level, FunctionalStorage.CUSTOM_COMPACTING_RECIPE_TYPE.value()); } public void setup(ItemStack stack){ @@ -126,7 +130,8 @@ private Result findLowerTier(ItemStack stack){ } List candidates = new ArrayList<>(); Map candidatesRate = new HashMap<>(); - for (CraftingRecipe craftingRecipe : level.getRecipeManager().getAllRecipesFor(RecipeType.CRAFTING)) { + for (var rcp : level.getRecipeManager().getAllRecipesFor(RecipeType.CRAFTING)) { + var craftingRecipe = rcp.value(); ItemStack output = craftingRecipe.getResultItem(this.level.registryAccess()); if (!ItemStack.isSameItem(stack, output)) continue; ItemStack match = tryMatch(stack, craftingRecipe.getIngredients()); @@ -160,7 +165,8 @@ private Result findLowerTier(ItemStack stack){ private List findAllMatchingRecipes(CraftingContainer crafting) { List candidates = new ArrayList<>(); - for (CraftingRecipe recipe : level.getRecipeManager().getRecipesFor(RecipeType.CRAFTING, crafting, level)) { + for (var rcp : level.getRecipeManager().getRecipesFor(RecipeType.CRAFTING, crafting, level)) { + var recipe = rcp.value(); if (recipe.matches(crafting, level)) { ItemStack result = recipe.assemble(crafting, this.level.registryAccess()); if (!result.isEmpty()) @@ -171,17 +177,13 @@ private List findAllMatchingRecipes(CraftingContainer crafting) { } private ItemStack findSimilar(ItemStack reference, List candidates) { - ResourceLocation referenceName = ForgeRegistries.ITEMS.getKey(reference.getItem()); - if (referenceName != null) { - for (ItemStack candidate : candidates) { - ResourceLocation matchName = ForgeRegistries.ITEMS.getKey(candidate.getItem()); - if (matchName != null) { - if (referenceName.getNamespace().equals(matchName.getNamespace())) - return candidate; - } - } + ResourceLocation referenceName = BuiltInRegistries.ITEM.getKey(reference.getItem()); + for (ItemStack candidate : candidates) { + ResourceLocation matchName = BuiltInRegistries.ITEM.getKey(candidate.getItem()); + if (referenceName.getNamespace().equals(matchName.getNamespace())) + return candidate; } - return candidates.size() > 0 ? candidates.get(0) : ItemStack.EMPTY; + return !candidates.isEmpty() ? candidates.get(0) : ItemStack.EMPTY; } diff --git a/src/main/java/com/buuz135/functionalstorage/util/ConnectedDrawers.java b/src/main/java/com/buuz135/functionalstorage/util/ConnectedDrawers.java index a0d31be5..1468ee08 100644 --- a/src/main/java/com/buuz135/functionalstorage/util/ConnectedDrawers.java +++ b/src/main/java/com/buuz135/functionalstorage/util/ConnectedDrawers.java @@ -17,7 +17,6 @@ import net.neoforged.neoforge.common.util.INBTSerializable; import net.neoforged.neoforge.fluids.capability.IFluidHandler; import net.neoforged.neoforge.items.IItemHandler; -import var; import java.util.ArrayList; import java.util.Comparator; import java.util.List; diff --git a/src/main/java/com/buuz135/functionalstorage/util/MathUtils.java b/src/main/java/com/buuz135/functionalstorage/util/MathUtils.java index 86046473..b6cf8502 100644 --- a/src/main/java/com/buuz135/functionalstorage/util/MathUtils.java +++ b/src/main/java/com/buuz135/functionalstorage/util/MathUtils.java @@ -4,7 +4,6 @@ import org.joml.Matrix4f; import org.joml.Quaternionf; import org.joml.Vector3f; -import var; public class MathUtils { diff --git a/src/main/java/com/buuz135/functionalstorage/util/TooltipUtil.java b/src/main/java/com/buuz135/functionalstorage/util/TooltipUtil.java index ecf09162..8cbadd35 100644 --- a/src/main/java/com/buuz135/functionalstorage/util/TooltipUtil.java +++ b/src/main/java/com/buuz135/functionalstorage/util/TooltipUtil.java @@ -3,13 +3,11 @@ import com.mojang.blaze3d.platform.GlStateManager; import com.mojang.blaze3d.platform.Lighting; import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Font; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.renderer.MultiBufferSource; -import net.minecraft.client.renderer.block.model.ItemTransforms; import net.minecraft.client.renderer.texture.OverlayTexture; import net.minecraft.client.renderer.texture.TextureAtlas; import net.minecraft.client.resources.model.BakedModel; @@ -19,7 +17,7 @@ import net.minecraft.world.level.Level; import net.neoforged.api.distmarker.Dist; import net.neoforged.api.distmarker.OnlyIn; -import var; + import javax.annotation.Nullable; import java.util.List; diff --git a/src/main/java/com/buuz135/functionalstorage/world/EnderSavedData.java b/src/main/java/com/buuz135/functionalstorage/world/EnderSavedData.java index 11e10993..43ac94b6 100644 --- a/src/main/java/com/buuz135/functionalstorage/world/EnderSavedData.java +++ b/src/main/java/com/buuz135/functionalstorage/world/EnderSavedData.java @@ -28,7 +28,8 @@ public EnderSavedData(Level level) { public static EnderSavedData getInstance(LevelAccessor accessor){ if (accessor instanceof ServerLevel){ ServerLevel serverWorld = ((ServerLevel) accessor).getServer().getLevel(Level.OVERWORLD); - EnderSavedData data = serverWorld.getDataStorage().computeIfAbsent(tag -> EnderSavedData.load(tag, (ServerLevel) accessor), () -> new EnderSavedData((ServerLevel)accessor), NAME); + EnderSavedData data = serverWorld.getDataStorage().computeIfAbsent( + new Factory(() -> new EnderSavedData((ServerLevel)accessor), tag -> EnderSavedData.load(tag, (ServerLevel) accessor)), NAME); return data; } else if (accessor instanceof ClientLevel){ return CLIENT; diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index c9b5a0f7..4c94d4d8 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -6,7 +6,7 @@ # The name of the mod loader type to load - for regular FML @Mod mods it should be javafml modLoader = "javafml" #mandatory # A version range to match for said mod loader - for regular FML @Mod it will be the forge version -loaderVersion = "[43,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions. +loaderVersion = "[2,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions. # The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties. # Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here. license = "MIT" @@ -39,11 +39,11 @@ Functional Storage # A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional. [[dependencies.functionalstorage]] #optional # the modid of the dependency -modId = "forge" #mandatory +modId = "neoforge" #mandatory # Does this dependency have to exist - if not, ordering below must be specified -mandatory = true #mandatory +type = "required" # The version range of the dependency -versionRange = "[43.2.3,)" #mandatory +versionRange = "[20.4,)" #mandatory # An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory ordering = "NONE" # Side this dependency is applied on - BOTH, CLIENT or SERVER @@ -51,15 +51,15 @@ side = "BOTH" # Here's another dependency [[dependencies.functionalstorage]] modId = "minecraft" -mandatory = true +type = "required" # This version range declares a minimum of the current minecraft version up to but not including the next major version -versionRange = "[1.19.2,)" +versionRange = "[1.20.4,)" ordering = "NONE" side = "BOTH" [[dependencies.functionalstorage]] modId = "titanium" -mandatory = true -versionRange = "[3.8.0,)" +type = "required" +versionRange = "[1,)" # TODO - fix version # This version range declares a minimum of the current minecraft version up to but not including the next major version ordering = "NONE" -side = "BOTH" \ No newline at end of file +side = "BOTH" From 5515647314ce256360c472d4b9bfd94fa0aa421b Mon Sep 17 00:00:00 2001 From: Matyrobbrt Date: Sun, 7 Apr 2024 15:07:27 +0300 Subject: [PATCH 03/20] Attachments --- build.gradle | 4 + .../functionalstorage/FunctionalStorage.java | 101 +++++++------ .../block/ArmoryCabinetBlock.java | 7 +- .../block/CompactingDrawerBlock.java | 48 ++---- .../block/CompactingFramedDrawerBlock.java | 15 +- .../functionalstorage/block/Drawer.java | 26 ++++ .../functionalstorage/block/DrawerBlock.java | 38 ++--- .../block/EnderDrawerBlock.java | 38 ++--- .../block/FluidDrawerBlock.java | 33 ++--- .../block/FramedControllerExtensionBlock.java | 5 +- .../block/FramedDrawerBlock.java | 23 +-- .../block/FramedDrawerControllerBlock.java | 5 +- .../FramedSimpleCompactingDrawerBlock.java | 13 +- .../block/SimpleCompactingDrawerBlock.java | 47 ++---- .../block/tile/FluidDrawerTile.java | 3 +- .../client/ControllerRenderer.java | 16 +- .../item/CompactingStackItemHandler.java | 14 +- .../item/DrawerStackItemHandler.java | 16 +- .../item/ConfigurationToolItem.java | 34 ++--- .../functionalstorage/item/FSAttachments.java | 45 ++++++ .../item/LinkingToolItem.java | 140 +++++++----------- .../functionalstorage/item/UpgradeItem.java | 39 +++-- 22 files changed, 353 insertions(+), 357 deletions(-) create mode 100644 src/main/java/com/buuz135/functionalstorage/block/Drawer.java create mode 100644 src/main/java/com/buuz135/functionalstorage/item/FSAttachments.java diff --git a/build.gradle b/build.gradle index d3d99798..f00161ab 100644 --- a/build.gradle +++ b/build.gradle @@ -80,6 +80,10 @@ dependencies { runtimeOnly('com.hrznstudio:Titanium:1.20.4-2.4.0') } +tasks.configureEach { + if (it.name.startsWith('neoForm')) it.enabled = false +} + jar { manifest { attributes(["Specification-Title" : project.name, diff --git a/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java b/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java index 3a74b5bc..c1a3e6b9 100644 --- a/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java +++ b/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java @@ -4,6 +4,7 @@ import com.buuz135.functionalstorage.block.CompactingDrawerBlock; import com.buuz135.functionalstorage.block.CompactingFramedDrawerBlock; import com.buuz135.functionalstorage.block.ControllerExtensionBlock; +import com.buuz135.functionalstorage.block.Drawer; import com.buuz135.functionalstorage.block.DrawerBlock; import com.buuz135.functionalstorage.block.DrawerControllerBlock; import com.buuz135.functionalstorage.block.EnderDrawerBlock; @@ -42,6 +43,7 @@ import com.buuz135.functionalstorage.inventory.item.CompactingStackItemHandler; import com.buuz135.functionalstorage.inventory.item.DrawerStackItemHandler; import com.buuz135.functionalstorage.item.ConfigurationToolItem; +import com.buuz135.functionalstorage.item.FSAttachments; import com.buuz135.functionalstorage.item.LinkingToolItem; import com.buuz135.functionalstorage.item.StorageUpgradeItem; import com.buuz135.functionalstorage.item.UpgradeItem; @@ -53,6 +55,7 @@ import com.buuz135.functionalstorage.util.IWoodType; import com.buuz135.functionalstorage.util.NumberUtils; import com.buuz135.functionalstorage.util.TooltipUtil; +import com.hrznstudio.titanium.block.RotatableBlock; import com.hrznstudio.titanium.datagenerator.loot.TitaniumLootTableProvider; import com.hrznstudio.titanium.datagenerator.model.BlockItemModelGeneratorProvider; import com.hrznstudio.titanium.event.handler.EventManager; @@ -62,23 +65,34 @@ import com.hrznstudio.titanium.network.NetworkHandler; import com.hrznstudio.titanium.recipe.serializer.GenericSerializer; import com.hrznstudio.titanium.tab.TitaniumTab; +import com.hrznstudio.titanium.util.RayTraceUtils; import net.minecraft.client.renderer.ItemBlockRenderTypes; import net.minecraft.client.renderer.RenderType; +import net.minecraft.core.BlockPos; import net.minecraft.core.Holder; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; import net.minecraft.nbt.CompoundTag; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; +import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.HitResult; +import net.minecraft.world.phys.shapes.BooleanOp; +import net.minecraft.world.phys.shapes.Shapes; +import net.minecraft.world.phys.shapes.VoxelShape; import net.neoforged.api.distmarker.Dist; import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.bus.api.IEventBus; import net.neoforged.fml.common.Mod; import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; import net.neoforged.neoforge.capabilities.Capabilities; @@ -95,6 +109,7 @@ import net.neoforged.neoforge.common.crafting.IngredientType; import net.neoforged.neoforge.common.util.NonNullLazy; import net.neoforged.neoforge.data.event.GatherDataEvent; +import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent; import net.neoforged.neoforge.event.level.BlockEvent; import net.neoforged.neoforge.items.IItemHandler; import net.neoforged.neoforge.registries.DeferredHolder; @@ -161,51 +176,13 @@ public class FunctionalStorage extends ModuleController { public static Holder> CUSTOM_COMPACTING_RECIPE_TYPE; - public FunctionalStorage(Dist dist) { + public FunctionalStorage(Dist dist, IEventBus modBus) { NeoForgeMod.enableMilkFluid(); + FSAttachments.DR.register(modBus); if (dist.isClient()) { Runnable runnable = this::onClient; runnable.run(); } - EventManager.forge(BlockEvent.BreakEvent.class).process(breakEvent -> { - if (breakEvent.getPlayer().isCreative()) { - if (breakEvent.getState().getBlock() instanceof DrawerBlock) { - int hit = ((DrawerBlock) breakEvent.getState().getBlock()).getHit(breakEvent.getState(), breakEvent.getPlayer().getCommandSenderWorld(), breakEvent.getPos(), breakEvent.getPlayer()); - if (hit != -1) { - breakEvent.setCanceled(true); - ((DrawerBlock) breakEvent.getState().getBlock()).attack(breakEvent.getState(), breakEvent.getPlayer().getCommandSenderWorld(), breakEvent.getPos(), breakEvent.getPlayer()); - } - } - if (breakEvent.getState().getBlock() instanceof CompactingDrawerBlock) { - int hit = ((CompactingDrawerBlock) breakEvent.getState().getBlock()).getHit(breakEvent.getState(), breakEvent.getPlayer().getCommandSenderWorld(), breakEvent.getPos(), breakEvent.getPlayer()); - if (hit != -1) { - breakEvent.setCanceled(true); - ((CompactingDrawerBlock) breakEvent.getState().getBlock()).attack(breakEvent.getState(), breakEvent.getPlayer().getCommandSenderWorld(), breakEvent.getPos(), breakEvent.getPlayer()); - } - } - if (breakEvent.getState().getBlock() instanceof EnderDrawerBlock) { - int hit = ((EnderDrawerBlock) breakEvent.getState().getBlock()).getHit(breakEvent.getState(), breakEvent.getPlayer().getCommandSenderWorld(), breakEvent.getPos(), breakEvent.getPlayer()); - if (hit != -1) { - breakEvent.setCanceled(true); - ((EnderDrawerBlock) breakEvent.getState().getBlock()).attack(breakEvent.getState(), breakEvent.getPlayer().getCommandSenderWorld(), breakEvent.getPos(), breakEvent.getPlayer()); - } - } - if (breakEvent.getState().getBlock() instanceof FluidDrawerBlock) { - int hit = ((FluidDrawerBlock) breakEvent.getState().getBlock()).getHit(breakEvent.getState(), breakEvent.getPlayer().getCommandSenderWorld(), breakEvent.getPos(), breakEvent.getPlayer()); - if (hit != -1) { - breakEvent.setCanceled(true); - ((FluidDrawerBlock) breakEvent.getState().getBlock()).attack(breakEvent.getState(), breakEvent.getPlayer().getCommandSenderWorld(), breakEvent.getPos(), breakEvent.getPlayer()); - } - } - if (breakEvent.getState().getBlock() instanceof SimpleCompactingDrawerBlock) { - int hit = ((SimpleCompactingDrawerBlock) breakEvent.getState().getBlock()).getHit(breakEvent.getState(), breakEvent.getPlayer().level(), breakEvent.getPos(), breakEvent.getPlayer()); - if (hit != -1) { - breakEvent.setCanceled(true); - ((SimpleCompactingDrawerBlock) breakEvent.getState().getBlock()).attack(breakEvent.getState(), breakEvent.getPlayer().level(), breakEvent.getPos(), breakEvent.getPlayer()); - } - } - } - }).subscribe(); NBTManager.getInstance().scanTileClassForAnnotations(FramedDrawerTile.class); NBTManager.getInstance().scanTileClassForAnnotations(CompactingFramedDrawerTile.class); NBTManager.getInstance().scanTileClassForAnnotations(FluidDrawerTile.class); @@ -392,13 +369,12 @@ public void onClient() { }).subscribe(); EventManager.mod(RegisterColorHandlersEvent.Item.class).process(item -> { item.getItemColors().register((stack, tint) -> { - CompoundTag tag = stack.getOrCreateTag(); LinkingToolItem.LinkingMode linkingMode = LinkingToolItem.getLinkingMode(stack); LinkingToolItem.ActionMode linkingAction = LinkingToolItem.getActionMode(stack); - if (tint != 0 && stack.getOrCreateTag().contains(LinkingToolItem.NBT_ENDER)) { + if (tint != 0 && stack.hasData(FSAttachments.ENDER_FREQUENCY)) { return new Color(44, 150, 88).getRGB(); } - if (tint == 3 && tag.contains(LinkingToolItem.NBT_CONTROLLER)) { + if (tint == 3 && stack.hasData(FSAttachments.CONTROLLER)) { return Color.RED.getRGB(); } if (tint == 1) { @@ -435,10 +411,10 @@ public void onClient() { }).subscribe(); EventManager.forge(RenderTooltipEvent.Pre.class).process(itemTooltipEvent -> { if (itemTooltipEvent.getItemStack().getItem().equals(FunctionalStorage.ENDER_DRAWER.getBlock().asItem()) && itemTooltipEvent.getItemStack().hasTag()) { - TooltipUtil.renderItems(itemTooltipEvent.getGraphics(), EnderDrawerBlock.getFrequencyDisplay(itemTooltipEvent.getItemStack().getTag().getCompound("Tile").getString("frequency")), itemTooltipEvent.getX() + 14, itemTooltipEvent.getY() + 11); + TooltipUtil.renderItems(itemTooltipEvent.getGraphics(), EnderDrawerBlock.getFrequencyDisplay(itemTooltipEvent.getItemStack().getData(FSAttachments.TILE).getString("frequency")), itemTooltipEvent.getX() + 14, itemTooltipEvent.getY() + 11); } - if (itemTooltipEvent.getItemStack().is(FunctionalStorage.LINKING_TOOL.get()) && itemTooltipEvent.getItemStack().getOrCreateTag().contains(LinkingToolItem.NBT_ENDER)) { - TooltipUtil.renderItems(itemTooltipEvent.getGraphics(), EnderDrawerBlock.getFrequencyDisplay(itemTooltipEvent.getItemStack().getOrCreateTag().getString(LinkingToolItem.NBT_ENDER)), itemTooltipEvent.getX() + 14, itemTooltipEvent.getY() + 11); + if (itemTooltipEvent.getItemStack().is(FunctionalStorage.LINKING_TOOL.get()) && itemTooltipEvent.getItemStack().hasData(FSAttachments.ENDER_FREQUENCY)) { + TooltipUtil.renderItems(itemTooltipEvent.getGraphics(), EnderDrawerBlock.getFrequencyDisplay(itemTooltipEvent.getItemStack().getData(FSAttachments.ENDER_FREQUENCY)), itemTooltipEvent.getX() + 14, itemTooltipEvent.getY() + 11); } var iItemHandler = itemTooltipEvent.getItemStack().getCapability(Capabilities.ItemHandler.ITEM); if (iItemHandler != null) { @@ -465,6 +441,39 @@ public void onClient() { EventManager.mod(ModelEvent.RegisterGeometryLoaders.class).process(modelRegistryEvent -> { modelRegistryEvent.register(new ResourceLocation(MOD_ID, "framedblock"), FramedModel.Loader.INSTANCE); }).subscribe(); + + EventManager.forge(PlayerInteractEvent.LeftClickBlock.class) + .process(event -> { + var state = event.getLevel().getBlockState(event.getPos()); + if (event.getLevel().getBlockState(event.getPos()).getBlock() instanceof Drawer drawer) { + final int hit = getHit(drawer, state, event.getLevel(), event.getEntity()); + if (hit != -1) { + var be = drawer.getBlockEntityAt(event.getLevel(), event.getPos()); + if (be != null) { + be.onClicked(event.getEntity(), hit); + event.setCanceled(true); + } + } + } + }) + .subscribe(); + } + + private static int getHit(Drawer drawer, BlockState state, Level worldIn, Player player) { + HitResult result = RayTraceUtils.rayTraceSimple(worldIn, player, 32, 0); + if (result instanceof BlockHitResult) { + VoxelShape hit = RayTraceUtils.rayTraceVoxelShape((BlockHitResult) result, worldIn, player, 32, 0); + if (hit != null) { + if (hit.equals(Shapes.block())) return -1; + List shapes = new ArrayList<>(drawer.getHitShapes(state)); + for (int i = 0; i < shapes.size(); i++) { + if (Shapes.joinIsNotEmpty(shapes.get(i), hit, BooleanOp.AND)) { + return i; + } + } + } + } + return -1; } @Override diff --git a/src/main/java/com/buuz135/functionalstorage/block/ArmoryCabinetBlock.java b/src/main/java/com/buuz135/functionalstorage/block/ArmoryCabinetBlock.java index 7cd40a82..9d30bd25 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/ArmoryCabinetBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/ArmoryCabinetBlock.java @@ -2,6 +2,7 @@ import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.block.tile.ArmoryCabinetTile; +import com.buuz135.functionalstorage.item.FSAttachments; import com.hrznstudio.titanium.block.RotatableBlock; import com.hrznstudio.titanium.datagenerator.loot.block.BasicBlockLootTables; import net.minecraft.core.BlockPos; @@ -57,7 +58,7 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) BlockEntity drawerTile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); if (drawerTile instanceof ArmoryCabinetTile) { if (!((ArmoryCabinetTile) drawerTile).isEverythingEmpty()) { - stack.getOrCreateTag().put("Tile", drawerTile.saveWithoutMetadata()); + stack.setData(FSAttachments.TILE, drawerTile.saveWithoutMetadata()); } } stacks.add(stack); @@ -72,10 +73,10 @@ public NonNullList getDynamicDrops(BlockState state, Level worldIn, B @Override public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @Nullable LivingEntity p_49850_, ItemStack stack) { super.setPlacedBy(level, pos, p_49849_, p_49850_, stack); - if (stack.hasTag() && stack.getTag().contains("Tile")) { + if (stack.hasData(FSAttachments.TILE)) { BlockEntity entity = level.getBlockEntity(pos); if (entity instanceof ArmoryCabinetTile) { - entity.load(stack.getTag().getCompound("Tile")); + entity.load(stack.getData(FSAttachments.TILE)); ((ArmoryCabinetTile) entity).markForUpdate(); } } diff --git a/src/main/java/com/buuz135/functionalstorage/block/CompactingDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/CompactingDrawerBlock.java index 8aad62d4..7ada2d2d 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/CompactingDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/CompactingDrawerBlock.java @@ -3,10 +3,10 @@ import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.block.tile.CompactingDrawerTile; import com.buuz135.functionalstorage.block.tile.ControllableDrawerTile; -import com.buuz135.functionalstorage.block.tile.ItemControllableDrawerTile; import com.buuz135.functionalstorage.block.tile.StorageControllerTile; import com.buuz135.functionalstorage.inventory.item.CompactingStackItemHandler; import com.buuz135.functionalstorage.item.ConfigurationToolItem; +import com.buuz135.functionalstorage.item.FSAttachments; import com.buuz135.functionalstorage.item.LinkingToolItem; import com.buuz135.functionalstorage.util.StorageTags; import com.google.common.collect.Multimap; @@ -55,10 +55,11 @@ import javax.annotation.Nonnull; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import java.util.Optional; -public class CompactingDrawerBlock extends RotatableBlock { +public class CompactingDrawerBlock extends Drawer { public static Multimap CACHED_SHAPES = MultimapBuilder.hashKeys().arrayListValues().build(); @@ -136,8 +137,8 @@ public InteractionResult use(BlockState state, Level worldIn, BlockPos pos, Play } @Override - public void attack(BlockState state, Level worldIn, BlockPos pos, Player player) { - TileUtil.getTileEntity(worldIn, pos, CompactingDrawerTile.class).ifPresent(drawerTile -> drawerTile.onClicked(player, getHit(state, worldIn, pos, player))); + public Collection getHitShapes(BlockState state) { + return CACHED_SHAPES.get(state.getValue(RotatableBlock.FACING_HORIZONTAL)); } public int getHit(BlockState state, Level worldIn, BlockPos pos, Player player) { @@ -175,10 +176,10 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) BlockEntity drawerTile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); if (drawerTile instanceof ControllableDrawerTile tile) { if (!tile.isEverythingEmpty()) { - stack.getOrCreateTag().put("Tile", drawerTile.saveWithoutMetadata()); + stack.setData(FSAttachments.TILE, drawerTile.saveWithoutMetadata()); } - if (tile.isLocked()){ - stack.getOrCreateTag().putBoolean("Locked", tile.isLocked()); + if (tile.isLocked()) { + stack.setData(FSAttachments.LOCKED, tile.isLocked()); } } stacks.add(stack); @@ -194,17 +195,11 @@ public NonNullList getDynamicDrops(BlockState state, Level worldIn, B public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @Nullable LivingEntity p_49850_, ItemStack stack) { super.setPlacedBy(level, pos, p_49849_, p_49850_, stack); BlockEntity entity = level.getBlockEntity(pos); - if (stack.hasTag()) { - if (stack.getTag().contains("Tile")){ - if (entity instanceof ControllableDrawerTile tile) { - entity.load(stack.getTag().getCompound("Tile")); - tile.markForUpdate(); - } - } - if (stack.getTag().contains("Locked")){ - if (entity instanceof ControllableDrawerTile tile) { - tile.setLocked(stack.getTag().getBoolean("Locked")); - } + if (entity instanceof ControllableDrawerTile tile) { + tile.setLocked(stack.getData(FSAttachments.LOCKED)); + if (stack.hasData(FSAttachments.TILE)) { + entity.load(stack.getData(FSAttachments.TILE)); + tile.markForUpdate(); } } var offhand = p_49850_.getOffhandItem(); @@ -260,26 +255,13 @@ public boolean isSignalSource(BlockState p_60571_) { @Override public int getSignal(BlockState p_60483_, BlockGetter blockGetter, BlockPos blockPos, Direction p_60486_) { - ItemControllableDrawerTile tile = TileUtil.getTileEntity(blockGetter, blockPos, ItemControllableDrawerTile.class).orElse(null); - if (tile != null){ - for (int i = 0; i < tile.getUtilityUpgrades().getSlots(); i++) { - ItemStack stack = tile.getUtilityUpgrades().getStackInSlot(i); - if (stack.getItem().equals(FunctionalStorage.REDSTONE_UPGRADE.get())) { - int redstoneSlot = stack.getOrCreateTag().getInt("Slot"); - if (redstoneSlot < tile.getStorage().getSlots()) { - int amount = tile.getStorage().getStackInSlot(redstoneSlot).getCount() * 14 / tile.getStorage().getSlotLimit(redstoneSlot); - return amount + (amount > 0 ? 1 : 0); - } - } - } - } - return 0; + return DrawerBlock.getSignal(blockGetter, blockPos); } @Override public void appendHoverText(ItemStack p_49816_, @Nullable BlockGetter p_49817_, List tooltip, TooltipFlag p_49819_) { super.appendHoverText(p_49816_, p_49817_, tooltip, p_49819_); - if (p_49816_.hasTag() && p_49816_.getTag().contains("Tile")) { + if (p_49816_.hasData(FSAttachments.TILE)) { MutableComponent text = Component.translatable("drawer.block.contents"); tooltip.add(text.withStyle(ChatFormatting.GRAY)); tooltip.add(Component.literal("")); diff --git a/src/main/java/com/buuz135/functionalstorage/block/CompactingFramedDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/CompactingFramedDrawerBlock.java index a141a999..f6a713e6 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/CompactingFramedDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/CompactingFramedDrawerBlock.java @@ -4,6 +4,7 @@ import com.buuz135.functionalstorage.block.tile.CompactingDrawerTile; import com.buuz135.functionalstorage.block.tile.CompactingFramedDrawerTile; import com.buuz135.functionalstorage.block.tile.FramedDrawerTile; +import com.buuz135.functionalstorage.item.FSAttachments; import com.buuz135.functionalstorage.util.StorageTags; import com.hrznstudio.titanium.recipe.generator.TitaniumShapedRecipeBuilder; import com.hrznstudio.titanium.util.TileUtil; @@ -57,14 +58,14 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) ItemStack stack = new ItemStack(this); BlockEntity drawerTile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); if (drawerTile instanceof CompactingFramedDrawerTile framedDrawerTile) { - if (!framedDrawerTile.isEverythingEmpty()) { - stack.getOrCreateTag().put("Tile", drawerTile.saveWithoutMetadata()); - } if (framedDrawerTile.getFramedDrawerModelData() != null) { - stack.getOrCreateTag().put("Style", framedDrawerTile.getFramedDrawerModelData().serializeNBT()); + stack.setData(FSAttachments.STYLE, framedDrawerTile.getFramedDrawerModelData().serializeNBT()); + } + if (!framedDrawerTile.isEverythingEmpty()) { + stack.setData(FSAttachments.TILE, framedDrawerTile.saveWithoutMetadata()); } - if (framedDrawerTile.isLocked()){ - stack.getOrCreateTag().putBoolean("Locked", framedDrawerTile.isLocked()); + if (framedDrawerTile.isLocked()) { + stack.setData(FSAttachments.LOCKED, framedDrawerTile.isLocked()); } } stacks.add(stack); @@ -76,7 +77,7 @@ public ItemStack getCloneItemStack(BlockState state, HitResult target, LevelRead BlockEntity entity = level.getBlockEntity(pos); if (entity instanceof FramedDrawerTile framedDrawerTile && framedDrawerTile.getFramedDrawerModelData() != null && !framedDrawerTile.getFramedDrawerModelData().getDesign().isEmpty()){ ItemStack stack = new ItemStack(this); - stack.getOrCreateTag().put("Style", framedDrawerTile.getFramedDrawerModelData().serializeNBT()); + stack.setData(FSAttachments.STYLE, framedDrawerTile.getFramedDrawerModelData().serializeNBT()); return stack; } return super.getCloneItemStack(state, target, level, pos, player); diff --git a/src/main/java/com/buuz135/functionalstorage/block/Drawer.java b/src/main/java/com/buuz135/functionalstorage/block/Drawer.java new file mode 100644 index 00000000..874ef484 --- /dev/null +++ b/src/main/java/com/buuz135/functionalstorage/block/Drawer.java @@ -0,0 +1,26 @@ +package com.buuz135.functionalstorage.block; + +import com.buuz135.functionalstorage.block.tile.ControllableDrawerTile; +import com.hrznstudio.titanium.block.RotatableBlock; +import com.hrznstudio.titanium.block.tile.BasicTile; +import com.hrznstudio.titanium.util.TileUtil; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.shapes.VoxelShape; + +import javax.annotation.Nullable; +import java.util.Collection; + +public abstract class Drawer> extends RotatableBlock { + public Drawer(String name, Properties properties, Class tileClass) { + super(name, properties, tileClass); + } + + @Nullable + public ControllableDrawerTile getBlockEntityAt(BlockGetter level, BlockPos pos) { + return TileUtil.getTileEntity(level, pos, ControllableDrawerTile.class).orElse(null); + } + + public abstract Collection getHitShapes(BlockState state); +} diff --git a/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java index 10e4675b..a246bb3b 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java @@ -7,6 +7,7 @@ import com.buuz135.functionalstorage.block.tile.StorageControllerTile; import com.buuz135.functionalstorage.inventory.item.DrawerStackItemHandler; import com.buuz135.functionalstorage.item.ConfigurationToolItem; +import com.buuz135.functionalstorage.item.FSAttachments; import com.buuz135.functionalstorage.item.LinkingToolItem; import com.buuz135.functionalstorage.recipe.DrawerlessWoodIngredient; import com.buuz135.functionalstorage.util.IWoodType; @@ -62,10 +63,11 @@ import javax.annotation.Nonnull; import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; import java.util.List; -public class DrawerBlock extends RotatableBlock { +public class DrawerBlock extends Drawer { public static HashMap> CACHED_SHAPES = new HashMap<>(); @@ -181,8 +183,8 @@ public InteractionResult use(BlockState state, Level worldIn, BlockPos pos, Play } @Override - public void attack(BlockState state, Level worldIn, BlockPos pos, Player player) { - TileUtil.getTileEntity(worldIn, pos, DrawerTile.class).ifPresent(drawerTile -> drawerTile.onClicked(player, getHit(state, worldIn, pos, player))); + public Collection getHitShapes(BlockState state) { + return DrawerBlock.CACHED_SHAPES.get(type).get(state.getValue(RotatableBlock.FACING_HORIZONTAL)); } public int getHit(BlockState state, Level worldIn, BlockPos pos, Player player) { @@ -221,10 +223,10 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) BlockEntity drawerTile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); if (drawerTile instanceof DrawerTile tile) { if (!tile.isEverythingEmpty()) { - stack.getOrCreateTag().put("Tile", drawerTile.saveWithoutMetadata()); + stack.setData(FSAttachments.TILE, drawerTile.saveWithoutMetadata()); } - if (tile.isLocked()){ - stack.getOrCreateTag().putBoolean("Locked", tile.isLocked()); + if (tile.isLocked()) { + stack.setData(FSAttachments.LOCKED, tile.isLocked()); } } stacks.add(stack); @@ -240,17 +242,11 @@ public NonNullList getDynamicDrops(BlockState state, Level worldIn, B public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @Nullable LivingEntity p_49850_, ItemStack stack) { super.setPlacedBy(level, pos, p_49849_, p_49850_, stack); BlockEntity entity = level.getBlockEntity(pos); - if (stack.hasTag()) { - if (stack.getTag().contains("Tile")){ - if (entity instanceof ControllableDrawerTile tile) { - entity.load(stack.getTag().getCompound("Tile")); - tile.markForUpdate(); - } - } - if (stack.getTag().contains("Locked")){ - if (entity instanceof ControllableDrawerTile tile) { - tile.setLocked(stack.getTag().getBoolean("Locked")); - } + if (entity instanceof ControllableDrawerTile tile) { + tile.setLocked(stack.getData(FSAttachments.LOCKED)); + if (stack.hasData(FSAttachments.TILE)) { + entity.load(stack.getData(FSAttachments.TILE)); + tile.markForUpdate(); } } var offhand = p_49850_.getOffhandItem(); @@ -345,7 +341,7 @@ public void onRemove(BlockState state, Level worldIn, BlockPos pos, BlockState n @Override public void appendHoverText(ItemStack p_49816_, @Nullable BlockGetter p_49817_, List tooltip, TooltipFlag p_49819_) { super.appendHoverText(p_49816_, p_49817_, tooltip, p_49819_); - if (p_49816_.hasTag() && p_49816_.getTag().contains("Tile")) { + if (p_49816_.hasData(FSAttachments.TILE)) { MutableComponent text = Component.translatable("drawer.block.contents"); tooltip.add(text.withStyle(ChatFormatting.GRAY)); tooltip.add(Component.literal("")); @@ -365,12 +361,16 @@ public boolean isSignalSource(BlockState p_60571_) { @Override public int getSignal(BlockState p_60483_, BlockGetter blockGetter, BlockPos blockPos, Direction p_60486_) { + return getSignal(blockGetter, blockPos); + } + + public static int getSignal(BlockGetter blockGetter, BlockPos blockPos) { ItemControllableDrawerTile tile = TileUtil.getTileEntity(blockGetter, blockPos, ItemControllableDrawerTile.class).orElse(null); if (tile != null){ for (int i = 0; i < tile.getUtilityUpgrades().getSlots(); i++) { ItemStack stack = tile.getUtilityUpgrades().getStackInSlot(i); if (stack.getItem().equals(FunctionalStorage.REDSTONE_UPGRADE.get())){ - int redstoneSlot = stack.getOrCreateTag().getInt("Slot"); + int redstoneSlot = stack.getData(FSAttachments.SLOT); if (redstoneSlot < tile.getStorage().getSlots()) { int amount = tile.getStorage().getStackInSlot(redstoneSlot).getCount() * 14 / tile.getStorage().getSlotLimit(redstoneSlot); return amount + (amount > 0 ? 1 : 0); diff --git a/src/main/java/com/buuz135/functionalstorage/block/EnderDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/EnderDrawerBlock.java index eb9390a8..28a39f75 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/EnderDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/EnderDrawerBlock.java @@ -5,6 +5,7 @@ import com.buuz135.functionalstorage.block.tile.EnderDrawerTile; import com.buuz135.functionalstorage.block.tile.ItemControllableDrawerTile; import com.buuz135.functionalstorage.block.tile.StorageControllerTile; +import com.buuz135.functionalstorage.item.FSAttachments; import com.buuz135.functionalstorage.item.LinkingToolItem; import com.hrznstudio.titanium.block.RotatableBlock; import com.hrznstudio.titanium.datagenerator.loot.block.BasicBlockLootTables; @@ -49,13 +50,14 @@ import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; import static com.buuz135.functionalstorage.block.DrawerBlock.LOCKED; -public class EnderDrawerBlock extends RotatableBlock { +public class EnderDrawerBlock extends Drawer { public EnderDrawerBlock() { super("ender_drawer", Properties.ofFullCopy(Blocks.ENDER_CHEST), EnderDrawerTile.class); @@ -124,8 +126,8 @@ public InteractionResult use(BlockState state, Level worldIn, BlockPos pos, Play } @Override - public void attack(BlockState state, Level worldIn, BlockPos pos, Player player) { - TileUtil.getTileEntity(worldIn, pos, EnderDrawerTile.class).ifPresent(drawerTile -> drawerTile.onClicked(player, getHit(state, worldIn, pos, player))); + public Collection getHitShapes(BlockState state) { + return DrawerBlock.CACHED_SHAPES.get(FunctionalStorage.DrawerType.X_1).get(state.getValue(RotatableBlock.FACING_HORIZONTAL)); } public int getHit(BlockState state, Level worldIn, BlockPos pos, Player player) { @@ -159,7 +161,7 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) BlockEntity drawerTile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); if (drawerTile instanceof EnderDrawerTile tile) { if (!tile.isEverythingEmpty()) { - stack.getOrCreateTag().put("Tile", drawerTile.saveWithoutMetadata()); + stack.setData(FSAttachments.TILE, drawerTile.saveWithoutMetadata()); } } stacks.add(stack); @@ -169,13 +171,10 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) @Override public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @Nullable LivingEntity p_49850_, ItemStack stack) { super.setPlacedBy(level, pos, p_49849_, p_49850_, stack); - if (stack.hasTag()) { - if (stack.getTag().contains("Tile")) { - BlockEntity entity = level.getBlockEntity(pos); - if (entity instanceof ControllableDrawerTile tile) { - entity.load(stack.getTag().getCompound("Tile")); - tile.markForUpdate(); - } + if (level.getBlockEntity(pos) instanceof ControllableDrawerTile tile) { + if (stack.hasData(FSAttachments.TILE)) { + tile.load(stack.getData(FSAttachments.TILE)); + tile.markForUpdate(); } } } @@ -203,7 +202,7 @@ public void onRemove(BlockState state, Level worldIn, BlockPos pos, BlockState n @Override public void appendHoverText(ItemStack p_49816_, @Nullable BlockGetter p_49817_, List tooltip, TooltipFlag p_49819_) { super.appendHoverText(p_49816_, p_49817_, tooltip, p_49819_); - if (p_49816_.hasTag()) { + if (p_49816_.hasData(FSAttachments.TILE)) { MutableComponent text = Component.translatable("linkingtool.ender.frequency"); tooltip.add(text.withStyle(ChatFormatting.GRAY)); tooltip.add(Component.literal("")); @@ -224,19 +223,6 @@ public boolean isSignalSource(BlockState p_60571_) { @Override public int getSignal(BlockState p_60483_, BlockGetter blockGetter, BlockPos blockPos, Direction p_60486_) { - ItemControllableDrawerTile tile = TileUtil.getTileEntity(blockGetter, blockPos, ItemControllableDrawerTile.class).orElse(null); - if (tile != null){ - for (int i = 0; i < tile.getUtilityUpgrades().getSlots(); i++) { - ItemStack stack = tile.getUtilityUpgrades().getStackInSlot(i); - if (stack.getItem().equals(FunctionalStorage.REDSTONE_UPGRADE.get())) { - int redstoneSlot = stack.getOrCreateTag().getInt("Slot"); - if (redstoneSlot < tile.getStorage().getSlots()) { - int amount = tile.getStorage().getStackInSlot(redstoneSlot).getCount() * 14 / tile.getStorage().getSlotLimit(redstoneSlot); - return amount + (amount > 0 ? 1 : 0); - } - } - } - } - return 0; + return DrawerBlock.getSignal(blockGetter, blockPos); } } diff --git a/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java index a1bf5321..099b3cc0 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java @@ -6,6 +6,7 @@ import com.buuz135.functionalstorage.block.tile.StorageControllerTile; import com.buuz135.functionalstorage.inventory.item.DrawerStackItemHandler; import com.buuz135.functionalstorage.item.ConfigurationToolItem; +import com.buuz135.functionalstorage.item.FSAttachments; import com.buuz135.functionalstorage.item.LinkingToolItem; import com.buuz135.functionalstorage.util.NumberUtils; import com.hrznstudio.titanium.block.RotatableBlock; @@ -52,9 +53,10 @@ import javax.annotation.Nonnull; import java.util.ArrayList; +import java.util.Collection; import java.util.List; -public class FluidDrawerBlock extends RotatableBlock { +public class FluidDrawerBlock extends Drawer { /** * Framed version @@ -131,8 +133,8 @@ public InteractionResult use(BlockState state, Level worldIn, BlockPos pos, Play } @Override - public void attack(BlockState state, Level worldIn, BlockPos pos, Player player) { - TileUtil.getTileEntity(worldIn, pos, FluidDrawerTile.class).ifPresent(drawerTile -> drawerTile.onClicked(player, getHit(state, worldIn, pos, player))); + public Collection getHitShapes(BlockState state) { + return DrawerBlock.CACHED_SHAPES.get(type).get(state.getValue(RotatableBlock.FACING_HORIZONTAL)); } public int getHit(BlockState state, Level worldIn, BlockPos pos, Player player) { @@ -171,10 +173,10 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) BlockEntity drawerTile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); if (drawerTile instanceof FluidDrawerTile tile) { if (!tile.isEverythingEmpty()) { - stack.getOrCreateTag().put("Tile", drawerTile.saveWithoutMetadata()); + stack.setData(FSAttachments.TILE, drawerTile.saveWithoutMetadata()); } if (tile.isLocked()) { - stack.getOrCreateTag().putBoolean("Locked", tile.isLocked()); + stack.setData(FSAttachments.LOCKED, tile.isLocked()); } } stacks.add(stack); @@ -189,16 +191,11 @@ public NonNullList getDynamicDrops(BlockState state, Level worldIn, B @Override public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @Nullable LivingEntity p_49850_, ItemStack stack) { super.setPlacedBy(level, pos, p_49849_, p_49850_, stack); - if (stack.hasTag()) { - if (stack.getTag().contains("Tile")) { - BlockEntity entity = level.getBlockEntity(pos); - if (entity instanceof ControllableDrawerTile tile) { - entity.load(stack.getTag().getCompound("Tile")); - tile.markForUpdate(); - } - } - if (stack.getTag().contains("Locked")) { - level.setBlock(pos, p_49849_.setValue(DrawerBlock.LOCKED, true), 3); + if (level.getBlockEntity(pos) instanceof ControllableDrawerTile tile) { + tile.setLocked(stack.getData(FSAttachments.LOCKED)); + if (stack.hasData(FSAttachments.TILE)) { + tile.load(stack.getData(FSAttachments.TILE)); + tile.markForUpdate(); } } BlockEntity entity = level.getBlockEntity(pos); @@ -263,8 +260,8 @@ public void onRemove(BlockState state, Level worldIn, BlockPos pos, BlockState n @Override public void appendHoverText(ItemStack itemStack, @Nullable BlockGetter p_49817_, List tooltip, TooltipFlag p_49819_) { super.appendHoverText(itemStack, p_49817_, tooltip, p_49819_); - if (itemStack.hasTag() && itemStack.getTag().contains("Tile")) { - var tileTag = itemStack.getTag().getCompound("Tile").getCompound("fluidHandler"); + if (itemStack.hasData(FSAttachments.TILE)) { + var tileTag = itemStack.getData(FSAttachments.TILE).getCompound("fluidHandler"); tooltip.add(Component.translatable("drawer.block.contents").withStyle(ChatFormatting.GRAY)); for (int i = 0; i < type.getSlots(); i++) { FluidStack stack = FluidStack.loadFluidStackFromNBT(tileTag.getCompound(i + "")); @@ -291,7 +288,7 @@ public int getSignal(BlockState p_60483_, BlockGetter blockGetter, BlockPos bloc for (int i = 0; i < tile.getUtilityUpgrades().getSlots(); i++) { ItemStack stack = tile.getUtilityUpgrades().getStackInSlot(i); if (stack.getItem().equals(FunctionalStorage.REDSTONE_UPGRADE.get())) { - int redstoneSlot = stack.getOrCreateTag().getInt("Slot"); + int redstoneSlot = stack.getData(FSAttachments.SLOT); if (redstoneSlot < tile.getFluidHandler().getTanks()) { return tile.getFluidHandler().getFluidInTank(redstoneSlot).getAmount() * 15 / tile.getFluidHandler().getTankCapacity(redstoneSlot); } diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java index 62230a4e..d4cbe389 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java @@ -2,6 +2,7 @@ import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.block.tile.FramedControllerExtensionTile; +import com.buuz135.functionalstorage.item.FSAttachments; import com.buuz135.functionalstorage.util.StorageTags; import com.hrznstudio.titanium.recipe.generator.TitaniumShapedRecipeBuilder; import com.hrznstudio.titanium.util.TileUtil; @@ -55,7 +56,7 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) { if(framedControllerExtensionTile.getFramedDrawerModelData() != null) { - stack.getOrCreateTag().put("Style", framedControllerExtensionTile.getFramedDrawerModelData().serializeNBT()); + stack.setData(FSAttachments.STYLE, framedControllerExtensionTile.getFramedDrawerModelData().serializeNBT()); } } @@ -73,7 +74,7 @@ public ItemStack getCloneItemStack(BlockState state, HitResult target, LevelRead if(!framedControllerExtensionTile.getFramedDrawerModelData().getDesign().isEmpty()) { ItemStack stack = new ItemStack(this); - stack.getOrCreateTag().put("Style", framedControllerExtensionTile.getFramedDrawerModelData().serializeNBT()); + stack.setData(FSAttachments.STYLE, framedControllerExtensionTile.getFramedDrawerModelData().serializeNBT()); return stack; } } diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java index ed8f0323..626934f4 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java @@ -4,6 +4,7 @@ import com.buuz135.functionalstorage.block.tile.DrawerTile; import com.buuz135.functionalstorage.block.tile.FramedDrawerTile; import com.buuz135.functionalstorage.client.model.FramedDrawerModelData; +import com.buuz135.functionalstorage.item.FSAttachments; import com.buuz135.functionalstorage.util.DrawerWoodType; import com.hrznstudio.titanium.module.BlockWithTile; import com.hrznstudio.titanium.recipe.generator.TitaniumShapedRecipeBuilder; @@ -59,8 +60,8 @@ public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @Nullabl } public static FramedDrawerModelData getDrawerModelData(ItemStack stack){ - if (stack.hasTag() && stack.getTag().contains("Style")){ - CompoundTag tag = stack.getTag().getCompound("Style"); + if (stack.hasData(FSAttachments.STYLE)){ + CompoundTag tag = stack.getData(FSAttachments.STYLE); if (tag.isEmpty()) return null; HashMap data = new HashMap<>(); data.put("particle", BuiltInRegistries.ITEM.get(new ResourceLocation(tag.getString("particle")))); @@ -74,7 +75,7 @@ public static FramedDrawerModelData getDrawerModelData(ItemStack stack){ public static ItemStack fill(ItemStack first, ItemStack second, ItemStack drawer, ItemStack divider){ drawer = ItemHandlerHelper.copyStackWithSize(drawer, 1); - CompoundTag style = drawer.getOrCreateTagElement("Style"); + CompoundTag style = drawer.getData(FSAttachments.STYLE); style.putString("particle", BuiltInRegistries.ITEM.getKey(first.getItem()).toString()); style.putString("side", BuiltInRegistries.ITEM.getKey(first.getItem()).toString()); style.putString("front", BuiltInRegistries.ITEM.getKey(second.getItem()).toString()); @@ -83,7 +84,7 @@ public static ItemStack fill(ItemStack first, ItemStack second, ItemStack drawer } else { style.putString("front_divider", BuiltInRegistries.ITEM.getKey(divider.getItem()).toString()); } - drawer.getOrCreateTag().put("Style", style); + drawer.setData(FSAttachments.STYLE, style); return drawer; } @@ -93,14 +94,14 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) ItemStack stack = new ItemStack(this); BlockEntity drawerTile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); if (drawerTile instanceof FramedDrawerTile framedDrawerTile) { - if (!framedDrawerTile.isEverythingEmpty()) { - stack.getOrCreateTag().put("Tile", drawerTile.saveWithoutMetadata()); - } if (framedDrawerTile.getFramedDrawerModelData() != null) { - stack.getOrCreateTag().put("Style", framedDrawerTile.getFramedDrawerModelData().serializeNBT()); + stack.setData(FSAttachments.STYLE, framedDrawerTile.getFramedDrawerModelData().serializeNBT()); + } + if (!framedDrawerTile.isEverythingEmpty()) { + stack.setData(FSAttachments.TILE, framedDrawerTile.saveWithoutMetadata()); } - if (framedDrawerTile.isLocked()){ - stack.getOrCreateTag().putBoolean("Locked", framedDrawerTile.isLocked()); + if (framedDrawerTile.isLocked()) { + stack.setData(FSAttachments.LOCKED, framedDrawerTile.isLocked()); } } stacks.add(stack); @@ -112,7 +113,7 @@ public ItemStack getCloneItemStack(BlockState state, HitResult target, LevelRead BlockEntity entity = level.getBlockEntity(pos); if (entity instanceof FramedDrawerTile framedDrawerTile && framedDrawerTile.getFramedDrawerModelData() != null && !framedDrawerTile.getFramedDrawerModelData().getDesign().isEmpty()){ ItemStack stack = new ItemStack(this); - stack.getOrCreateTag().put("Style", framedDrawerTile.getFramedDrawerModelData().serializeNBT()); + stack.setData(FSAttachments.STYLE, framedDrawerTile.getFramedDrawerModelData().serializeNBT()); return stack; } return super.getCloneItemStack(state, target, level, pos, player); diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerControllerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerControllerBlock.java index 94291390..ce873028 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerControllerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerControllerBlock.java @@ -2,6 +2,7 @@ import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.block.tile.FramedDrawerControllerTile; +import com.buuz135.functionalstorage.item.FSAttachments; import com.buuz135.functionalstorage.util.StorageTags; import com.hrznstudio.titanium.recipe.generator.TitaniumShapedRecipeBuilder; import com.hrznstudio.titanium.util.TileUtil; @@ -55,7 +56,7 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) { if(framedControllerTile.getFramedDrawerModelData() != null) { - stack.getOrCreateTag().put("Style", framedControllerTile.getFramedDrawerModelData().serializeNBT()); + stack.setData(FSAttachments.STYLE, framedControllerTile.getFramedDrawerModelData().serializeNBT()); } } @@ -73,7 +74,7 @@ public ItemStack getCloneItemStack(BlockState state, HitResult target, LevelRead if(!framedDrawerControllerTile.getFramedDrawerModelData().getDesign().isEmpty()) { ItemStack stack = new ItemStack(this); - stack.getOrCreateTag().put("Style", framedDrawerControllerTile.getFramedDrawerModelData().serializeNBT()); + stack.setData(FSAttachments.STYLE, framedDrawerControllerTile.getFramedDrawerModelData().serializeNBT()); return stack; } } diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedSimpleCompactingDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedSimpleCompactingDrawerBlock.java index 150df6f3..1a2aed45 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedSimpleCompactingDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedSimpleCompactingDrawerBlock.java @@ -3,6 +3,7 @@ import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.block.tile.FramedSimpleCompactingDrawerTile; import com.buuz135.functionalstorage.block.tile.SimpleCompactingDrawerTile; +import com.buuz135.functionalstorage.item.FSAttachments; import com.buuz135.functionalstorage.util.StorageTags; import com.hrznstudio.titanium.recipe.generator.TitaniumShapedRecipeBuilder; import com.hrznstudio.titanium.util.TileUtil; @@ -57,13 +58,13 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) BlockEntity drawerTile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); if (drawerTile instanceof FramedSimpleCompactingDrawerTile framedDrawerTile) { if (!framedDrawerTile.isEverythingEmpty()) { - stack.getOrCreateTag().put("Tile", drawerTile.saveWithoutMetadata()); - } - if (framedDrawerTile.getFramedDrawerModelData() != null) { - stack.getOrCreateTag().put("Style", framedDrawerTile.getFramedDrawerModelData().serializeNBT()); + stack.setData(FSAttachments.TILE, drawerTile.saveWithoutMetadata()); } if (framedDrawerTile.isLocked()) { - stack.getOrCreateTag().putBoolean("Locked", framedDrawerTile.isLocked()); + stack.setData(FSAttachments.LOCKED, framedDrawerTile.isLocked()); + } + if (framedDrawerTile.getFramedDrawerModelData() != null) { + stack.setData(FSAttachments.STYLE, framedDrawerTile.getFramedDrawerModelData().serializeNBT()); } } stacks.add(stack); @@ -75,7 +76,7 @@ public ItemStack getCloneItemStack(BlockState state, HitResult target, LevelRead BlockEntity entity = level.getBlockEntity(pos); if (entity instanceof FramedSimpleCompactingDrawerTile framedDrawerTile && framedDrawerTile.getFramedDrawerModelData() != null && !framedDrawerTile.getFramedDrawerModelData().getDesign().isEmpty()) { ItemStack stack = new ItemStack(this); - stack.getOrCreateTag().put("Style", framedDrawerTile.getFramedDrawerModelData().serializeNBT()); + stack.setData(FSAttachments.STYLE, framedDrawerTile.getFramedDrawerModelData().serializeNBT()); return stack; } return super.getCloneItemStack(state, target, level, pos, player); diff --git a/src/main/java/com/buuz135/functionalstorage/block/SimpleCompactingDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/SimpleCompactingDrawerBlock.java index 740d7a48..dab83425 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/SimpleCompactingDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/SimpleCompactingDrawerBlock.java @@ -2,10 +2,10 @@ import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.block.tile.ControllableDrawerTile; -import com.buuz135.functionalstorage.block.tile.ItemControllableDrawerTile; import com.buuz135.functionalstorage.block.tile.SimpleCompactingDrawerTile; import com.buuz135.functionalstorage.block.tile.StorageControllerTile; import com.buuz135.functionalstorage.item.ConfigurationToolItem; +import com.buuz135.functionalstorage.item.FSAttachments; import com.buuz135.functionalstorage.item.LinkingToolItem; import com.buuz135.functionalstorage.util.StorageTags; import com.hrznstudio.titanium.block.RotatableBlock; @@ -18,6 +18,7 @@ import net.minecraft.core.Direction; import net.minecraft.core.NonNullList; import net.minecraft.data.recipes.RecipeOutput; +import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.world.InteractionHand; @@ -49,9 +50,10 @@ import javax.annotation.Nonnull; import java.util.ArrayList; +import java.util.Collection; import java.util.List; -public class SimpleCompactingDrawerBlock extends RotatableBlock { +public class SimpleCompactingDrawerBlock extends Drawer { public SimpleCompactingDrawerBlock(String name, Properties properties) { @@ -112,8 +114,8 @@ public InteractionResult use(BlockState state, Level worldIn, BlockPos pos, Play } @Override - public void attack(BlockState state, Level worldIn, BlockPos pos, Player player) { - TileUtil.getTileEntity(worldIn, pos, SimpleCompactingDrawerTile.class).ifPresent(drawerTile -> drawerTile.onClicked(player, getHit(state, worldIn, pos, player))); + public Collection getHitShapes(BlockState state) { + return DrawerBlock.CACHED_SHAPES.get(FunctionalStorage.DrawerType.X_2).get(state.getValue(RotatableBlock.FACING_HORIZONTAL)); } public int getHit(BlockState state, Level worldIn, BlockPos pos, Player player) { @@ -151,10 +153,10 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) BlockEntity drawerTile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); if (drawerTile instanceof ControllableDrawerTile tile) { if (!tile.isEverythingEmpty()) { - stack.getOrCreateTag().put("Tile", drawerTile.saveWithoutMetadata()); + stack.setData(FSAttachments.TILE, drawerTile.saveWithoutMetadata()); } if (tile.isLocked()) { - stack.getOrCreateTag().putBoolean("Locked", tile.isLocked()); + stack.setData(FSAttachments.LOCKED, tile.isLocked()); } } stacks.add(stack); @@ -170,17 +172,11 @@ public NonNullList getDynamicDrops(BlockState state, Level worldIn, B public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @Nullable LivingEntity p_49850_, ItemStack stack) { super.setPlacedBy(level, pos, p_49849_, p_49850_, stack); BlockEntity entity = level.getBlockEntity(pos); - if (stack.hasTag()) { - if (stack.getTag().contains("Tile")) { - if (entity instanceof ControllableDrawerTile tile) { - entity.load(stack.getTag().getCompound("Tile")); - tile.markForUpdate(); - } - } - if (stack.getTag().contains("Locked")) { - if (entity instanceof ControllableDrawerTile tile) { - tile.setLocked(stack.getTag().getBoolean("Locked")); - } + if (entity instanceof ControllableDrawerTile tile) { + tile.setLocked(stack.getData(FSAttachments.LOCKED)); + if (stack.hasData(FSAttachments.TILE)) { + entity.load(stack.getData(FSAttachments.TILE)); + tile.markForUpdate(); } } var offhand = p_49850_.getOffhandItem(); @@ -236,26 +232,13 @@ public boolean isSignalSource(BlockState p_60571_) { @Override public int getSignal(BlockState p_60483_, BlockGetter blockGetter, BlockPos blockPos, Direction p_60486_) { - ItemControllableDrawerTile tile = TileUtil.getTileEntity(blockGetter, blockPos, ItemControllableDrawerTile.class).orElse(null); - if (tile != null) { - for (int i = 0; i < tile.getUtilityUpgrades().getSlots(); i++) { - ItemStack stack = tile.getUtilityUpgrades().getStackInSlot(i); - if (stack.getItem().equals(FunctionalStorage.REDSTONE_UPGRADE.get())) { - int redstoneSlot = stack.getOrCreateTag().getInt("Slot"); - if (redstoneSlot < tile.getStorage().getSlots()) { - int amount = tile.getStorage().getStackInSlot(redstoneSlot).getCount() * 14 / tile.getStorage().getSlotLimit(redstoneSlot); - return amount + (amount > 0 ? 1 : 0); - } - } - } - } - return 0; + return DrawerBlock.getSignal(blockGetter, blockPos); } @Override public void appendHoverText(ItemStack p_49816_, @Nullable BlockGetter p_49817_, List tooltip, TooltipFlag p_49819_) { super.appendHoverText(p_49816_, p_49817_, tooltip, p_49819_); - if (p_49816_.hasTag() && p_49816_.getTag().contains("Tile")) { + if (p_49816_.hasData(FSAttachments.TILE)) { MutableComponent text = Component.translatable("drawer.block.contents"); tooltip.add(text.withStyle(ChatFormatting.GRAY)); tooltip.add(Component.literal("")); diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java index d747e711..caf43bf5 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java @@ -34,11 +34,12 @@ import net.neoforged.neoforge.fluids.capability.wrappers.FluidBlockWrapper; import org.jetbrains.annotations.NotNull; +import java.nio.charset.StandardCharsets; import java.util.Optional; import java.util.UUID; public class FluidDrawerTile extends ControllableDrawerTile { - public static final GameProfile FP = new GameProfile(UUID.fromString("FunctionalStorage-Pickup"), "FunctionalStorage-Pickp"); + public static final GameProfile FP = new GameProfile(UUID.nameUUIDFromBytes("FunctionalStorage-Pickup".getBytes(StandardCharsets.UTF_8)), "FunctionalStorage-Pickp"); @Save public BigFluidHandler fluidHandler; private FunctionalStorage.DrawerType type; diff --git a/src/main/java/com/buuz135/functionalstorage/client/ControllerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/ControllerRenderer.java index 7932b4ce..027e8b2f 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/ControllerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/ControllerRenderer.java @@ -2,6 +2,7 @@ import com.buuz135.functionalstorage.block.config.FunctionalStorageConfig; import com.buuz135.functionalstorage.block.tile.StorageControllerTile; +import com.buuz135.functionalstorage.item.FSAttachments; import com.buuz135.functionalstorage.item.LinkingToolItem; import com.hrznstudio.titanium.util.RayTraceUtils; import com.mojang.blaze3d.platform.GlStateManager; @@ -17,7 +18,6 @@ import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; import net.minecraft.core.BlockPos; -import net.minecraft.nbt.CompoundTag; import net.minecraft.util.Mth; import net.minecraft.world.item.ItemStack; import net.minecraft.world.phys.AABB; @@ -27,15 +27,11 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; import org.joml.Matrix4f; -import org.lwjgl.opengl.GL11; import java.util.List; import java.util.OptionalDouble; -import static com.buuz135.functionalstorage.item.LinkingToolItem.NBT_CONTROLLER; -import static com.buuz135.functionalstorage.item.LinkingToolItem.NBT_FIRST; - -public class ControllerRenderer implements BlockEntityRenderer { +public class ControllerRenderer implements BlockEntityRenderer> { public static RenderType TYPE = RenderType.create("custom_lines", DefaultVertexFormat.POSITION_COLOR_NORMAL, VertexFormat.Mode.LINES, 256, false, false,RenderType.CompositeState.builder() .setShaderState(new RenderStateShard.ShaderStateShard(GameRenderer::getRendertypeLinesShader)) @@ -75,12 +71,10 @@ public void render(StorageControllerTile tile, float partialTicks, PoseStack mat ItemStack stack = Minecraft.getInstance().player.getMainHandItem(); if (stack.isEmpty()) return; if (stack.getItem() instanceof LinkingToolItem) { - CompoundTag controllerNBT = stack.getOrCreateTag().getCompound(NBT_CONTROLLER); - BlockPos controller = new BlockPos(controllerNBT.getInt("X"), controllerNBT.getInt("Y"), controllerNBT.getInt("Z")); + BlockPos controller = stack.getData(FSAttachments.CONTROLLER); if (!controller.equals(tile.getBlockPos())) return; - if (stack.getOrCreateTag().contains(NBT_FIRST)) { - CompoundTag firstpos = stack.getOrCreateTag().getCompound(NBT_FIRST); - BlockPos firstPos = new BlockPos(firstpos.getInt("X"), firstpos.getInt("Y"), firstpos.getInt("Z")); + if (stack.hasData(FSAttachments.FIRST_POSITION)) { + BlockPos firstPos = stack.getData(FSAttachments.FIRST_POSITION); HitResult result = RayTraceUtils.rayTraceSimple(Minecraft.getInstance().level, Minecraft.getInstance().player, 8, partialTicks); if (result.getType() == HitResult.Type.BLOCK){ BlockPos hit = ((BlockHitResult)result).getBlockPos(); diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingStackItemHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingStackItemHandler.java index 30e71e38..29eabaaf 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingStackItemHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingStackItemHandler.java @@ -1,6 +1,7 @@ package com.buuz135.functionalstorage.inventory.item; import com.buuz135.functionalstorage.FunctionalStorage; +import com.buuz135.functionalstorage.item.FSAttachments; import com.buuz135.functionalstorage.item.StorageUpgradeItem; import com.buuz135.functionalstorage.util.CompactingUtil; import net.minecraft.nbt.CompoundTag; @@ -49,8 +50,9 @@ public CompactingStackItemHandler(ItemStack stack, int slots) { this.isVoid = false; this.isCreative = false; if (stack.hasTag()) { - deserializeNBT(stack.getTag().getCompound("Tile").getCompound("handler")); - for (Tag tag : stack.getOrCreateTag().getCompound("Tile").getCompound("storageUpgrades").getList("Items", Tag.TAG_COMPOUND)) { + var tile = stack.getData(FSAttachments.TILE); + deserializeNBT(tile.getCompound("handler")); + for (Tag tag : tile.getCompound("storageUpgrades").getList("Items", Tag.TAG_COMPOUND)) { ItemStack itemStack = ItemStack.of((CompoundTag) tag); if (itemStack.getItem() instanceof StorageUpgradeItem) { if (multiplier == 1) multiplier = ((StorageUpgradeItem) itemStack.getItem()).getStorageMultiplier(); @@ -63,7 +65,7 @@ public CompactingStackItemHandler(ItemStack stack, int slots) { this.isCreative = true; } } - for (Tag tag : stack.getOrCreateTag().getCompound("Tile").getCompound("utilityUpgrades").getList("Items", Tag.TAG_COMPOUND)) { + for (Tag tag : tile.getCompound("utilityUpgrades").getList("Items", Tag.TAG_COMPOUND)) { ItemStack itemStack = ItemStack.of((CompoundTag) tag); if (itemStack.getItem().equals(FunctionalStorage.VOID_UPGRADE.get())) { this.isVoid = true; @@ -226,9 +228,9 @@ public void deserializeNBT(CompoundTag nbt) { } public void onChange() { - if (stack.getOrCreateTag().contains("Tile")) - stack.getOrCreateTag().put("Tile", new CompoundTag()); - stack.getOrCreateTag().getCompound("Tile").put("handler", serializeNBT()); + if (stack.hasData(FSAttachments.TILE)) + stack.setData(FSAttachments.TILE, new CompoundTag()); + stack.getData(FSAttachments.TILE).put("handler", serializeNBT()); } public int getMultiplier() { diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerStackItemHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerStackItemHandler.java index 12e7b0e8..5f95ed78 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerStackItemHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerStackItemHandler.java @@ -3,6 +3,7 @@ import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.inventory.BigInventoryHandler; import com.buuz135.functionalstorage.inventory.BigInventoryHandler.BigStack; +import com.buuz135.functionalstorage.item.FSAttachments; import com.buuz135.functionalstorage.item.StorageUpgradeItem; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; @@ -36,9 +37,10 @@ public DrawerStackItemHandler(ItemStack stack, FunctionalStorage.DrawerType draw for (int i = 0; i < drawerType.getSlots(); i++) { this.storedStacks.add(i, new BigInventoryHandler.BigStack(ItemStack.EMPTY, 0)); } - if (stack.hasTag()) { - deserializeNBT(stack.getTag().getCompound("Tile").getCompound("handler")); - for (Tag tag : stack.getOrCreateTag().getCompound("Tile").getCompound("storageUpgrades").getList("Items", Tag.TAG_COMPOUND)) { + if (stack.hasData(FSAttachments.TILE)) { + var tile = stack.getData(FSAttachments.TILE); + deserializeNBT(tile.getCompound("handler")); + for (Tag tag : tile.getCompound("storageUpgrades").getList("Items", Tag.TAG_COMPOUND)) { ItemStack itemStack = ItemStack.of((CompoundTag) tag); if (itemStack.getItem() instanceof StorageUpgradeItem) { if (multiplier == 1) multiplier = ((StorageUpgradeItem) itemStack.getItem()).getStorageMultiplier(); @@ -48,7 +50,7 @@ public DrawerStackItemHandler(ItemStack stack, FunctionalStorage.DrawerType draw this.downgrade = true; } } - for (Tag tag : stack.getOrCreateTag().getCompound("Tile").getCompound("utilityUpgrades").getList("Items", Tag.TAG_COMPOUND)) { + for (Tag tag : tile.getCompound("utilityUpgrades").getList("Items", Tag.TAG_COMPOUND)) { ItemStack itemStack = ItemStack.of((CompoundTag) tag); if (itemStack.getItem().equals(FunctionalStorage.VOID_UPGRADE.get())) { this.isVoid = true; @@ -115,9 +117,9 @@ private boolean isVoid() { } private void onChange() { - if (stack.getOrCreateTag().contains("Tile")) - stack.getOrCreateTag().put("Tile", new CompoundTag()); - stack.getOrCreateTag().getCompound("Tile").put("handler", serializeNBT()); + if (stack.hasData(FSAttachments.TILE)) + stack.setData(FSAttachments.TILE, new CompoundTag()); + stack.getData(FSAttachments.TILE).put("handler", serializeNBT()); } private boolean isValid(int slot, @Nonnull ItemStack stack) { diff --git a/src/main/java/com/buuz135/functionalstorage/item/ConfigurationToolItem.java b/src/main/java/com/buuz135/functionalstorage/item/ConfigurationToolItem.java index 0a011bcd..4b1f5cf1 100644 --- a/src/main/java/com/buuz135/functionalstorage/item/ConfigurationToolItem.java +++ b/src/main/java/com/buuz135/functionalstorage/item/ConfigurationToolItem.java @@ -3,38 +3,33 @@ import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.block.tile.ControllableDrawerTile; import com.hrznstudio.titanium.item.BasicItem; +import com.mojang.serialization.Codec; import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; -import net.minecraft.core.NonNullList; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Style; import net.minecraft.network.chat.TextColor; import net.minecraft.sounds.SoundEvents; +import net.minecraft.util.StringRepresentable; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResultHolder; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import org.jetbrains.annotations.Nullable; -import java.awt.*; +import java.awt.Color; import java.util.Arrays; import java.util.List; import java.util.Locale; public class ConfigurationToolItem extends BasicItem { - public static final String NBT_MODE = "Mode"; - public static ConfigurationAction getAction(ItemStack stack) { - if (stack.hasTag()) { - return ConfigurationAction.valueOf(stack.getOrCreateTag().getString(NBT_MODE)); - } - return ConfigurationAction.LOCKING; + return stack.getData(FSAttachments.CONFIGURATION_ACTION); } public ConfigurationToolItem() { @@ -42,17 +37,6 @@ public ConfigurationToolItem() { setItemGroup(FunctionalStorage.TAB); } - @Override - public void onCraftedBy(ItemStack p_41447_, Level p_41448_, Player p_41449_) { - super.onCraftedBy(p_41447_, p_41448_, p_41449_); - initNbt(p_41447_); - } - - private ItemStack initNbt(ItemStack stack) { - stack.getOrCreateTag().putString(NBT_MODE, ConfigurationAction.LOCKING.name()); - return stack; - } - @Override public InteractionResult useOn(UseOnContext context) { BlockPos pos = context.getClickedPos(); @@ -82,7 +66,7 @@ public InteractionResultHolder use(Level p_41432_, Player player, Int if (player.isShiftKeyDown()) { ConfigurationAction action = getAction(stack); ConfigurationAction newAction = ConfigurationAction.values()[(Arrays.asList(ConfigurationAction.values()).indexOf(action) + 1) % ConfigurationAction.values().length]; - stack.getOrCreateTag().putString(NBT_MODE, newAction.name()); + stack.setData(FSAttachments.CONFIGURATION_ACTION, newAction); player.displayClientMessage(Component.literal("Swapped mode to ").setStyle(Style.EMPTY.withColor(newAction.getColor())) .append(Component.translatable("configurationtool.configmode." + newAction.name().toLowerCase(Locale.ROOT))), true); player.playSound(SoundEvents.ITEM_FRAME_REMOVE_ITEM, 0.5f, 1); @@ -109,7 +93,7 @@ public boolean hasTooltipDetails(@Nullable BasicItem.Key key) { return key == null; } - public enum ConfigurationAction { + public enum ConfigurationAction implements StringRepresentable { LOCKING(TextColor.fromRgb(new Color(40, 131, 250).getRGB()), 1), TOGGLE_NUMBERS(TextColor.fromRgb(new Color(250, 145, 40).getRGB()), 1), TOGGLE_RENDER(TextColor.fromRgb(new Color(100, 250, 40).getRGB()), 1), @@ -117,6 +101,7 @@ public enum ConfigurationAction { INDICATOR(TextColor.fromRgb(new Color(255, 40, 40).getRGB()), 3); //0 NO , 1 - PROGRESS, 2 - ONLY FULL, 3 - ONLY FULL WITHOUT BG + public static final Codec CODEC = StringRepresentable.fromValues(ConfigurationAction::values); private final TextColor color; private final int max; @@ -132,5 +117,10 @@ public TextColor getColor() { public int getMax() { return max; } + + @Override + public String getSerializedName() { + return name().toLowerCase(Locale.ROOT); + } } } diff --git a/src/main/java/com/buuz135/functionalstorage/item/FSAttachments.java b/src/main/java/com/buuz135/functionalstorage/item/FSAttachments.java new file mode 100644 index 00000000..4892a906 --- /dev/null +++ b/src/main/java/com/buuz135/functionalstorage/item/FSAttachments.java @@ -0,0 +1,45 @@ +package com.buuz135.functionalstorage.item; + +import com.buuz135.functionalstorage.FunctionalStorage; +import com.mojang.serialization.Codec; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.util.Unit; +import net.neoforged.neoforge.attachment.AttachmentType; +import net.neoforged.neoforge.registries.DeferredRegister; +import net.neoforged.neoforge.registries.NeoForgeRegistries; + +import java.util.function.Supplier; +import java.util.function.UnaryOperator; + +public class FSAttachments { + public static final DeferredRegister> DR = DeferredRegister.create(NeoForgeRegistries.ATTACHMENT_TYPES, FunctionalStorage.MOD_ID); + + public static final Supplier> CONFIGURATION_ACTION = + register("configuration_action", () -> ConfigurationToolItem.ConfigurationAction.LOCKING, builder -> builder.serialize(ConfigurationToolItem.ConfigurationAction.CODEC)); + + public static final Supplier> ACTION_MODE = + register("action_mode", () -> LinkingToolItem.ActionMode.ADD, builder -> builder.serialize(LinkingToolItem.ActionMode.CODEC)); + + public static final Supplier> LINKING_MODE = + register("linking_mode", () -> LinkingToolItem.LinkingMode.SINGLE, builder -> builder.serialize(LinkingToolItem.LinkingMode.CODEC)); + + public static final Supplier> FIRST_POSITION = + register("first_pos", () -> BlockPos.ZERO, builder -> builder.serialize(BlockPos.CODEC)); + public static final Supplier> CONTROLLER = + register("controller_position", () -> BlockPos.ZERO, builder -> builder.serialize(BlockPos.CODEC)); + + public static final Supplier> ENDER_FREQUENCY = register("ender_frequency", () -> "", op -> op.serialize(Codec.STRING)); + public static final Supplier> ENDER_SAFETY = register("ender_safety", () -> Unit.INSTANCE, op -> op.serialize(Codec.unit(Unit.INSTANCE))); + public static final Supplier> DIRECTION = register("direction", () -> Direction.NORTH, op -> op.serialize(Direction.CODEC)); + public static final Supplier> SLOT = register("slot", () -> 0, op -> op.serialize(Codec.intRange(0, UpgradeItem.MAX_SLOT - 1))); + public static final Supplier> LOCKED = register("locked", () -> false, op -> op.serialize(Codec.BOOL)); + + public static final Supplier> TILE = register("tile", CompoundTag::new, op -> op.serialize(CompoundTag.CODEC)); + public static final Supplier> STYLE = register("style", CompoundTag::new, op -> op.serialize(CompoundTag.CODEC)); + + private static Supplier> register(String name, Supplier defaultVal, UnaryOperator> op) { + return DR.register(name, () -> op.apply(AttachmentType.builder(defaultVal)).build()); + } +} diff --git a/src/main/java/com/buuz135/functionalstorage/item/LinkingToolItem.java b/src/main/java/com/buuz135/functionalstorage/item/LinkingToolItem.java index 7d568205..050466ac 100644 --- a/src/main/java/com/buuz135/functionalstorage/item/LinkingToolItem.java +++ b/src/main/java/com/buuz135/functionalstorage/item/LinkingToolItem.java @@ -1,25 +1,27 @@ package com.buuz135.functionalstorage.item; import com.buuz135.functionalstorage.FunctionalStorage; -import com.buuz135.functionalstorage.block.tile.*; +import com.buuz135.functionalstorage.block.tile.ControllableDrawerTile; +import com.buuz135.functionalstorage.block.tile.EnderDrawerTile; +import com.buuz135.functionalstorage.block.tile.StorageControllerTile; import com.buuz135.functionalstorage.inventory.EnderInventoryHandler; import com.buuz135.functionalstorage.world.EnderSavedData; import com.hrznstudio.titanium.event.handler.EventManager; import com.hrznstudio.titanium.item.BasicItem; +import com.mojang.serialization.Codec; import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; -import net.minecraft.core.NonNullList; -import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.network.chat.Style; import net.minecraft.network.chat.TextColor; import net.minecraft.sounds.SoundEvents; +import net.minecraft.util.StringRepresentable; +import net.minecraft.util.Unit; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResultHolder; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.Level; @@ -30,40 +32,27 @@ import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent; import org.jetbrains.annotations.Nullable; -import java.awt.*; +import java.awt.Color; import java.util.ArrayList; import java.util.List; import java.util.Locale; public class LinkingToolItem extends BasicItem { - public static final String NBT_MODE = "Mode"; - public static final String NBT_CONTROLLER = "Controller"; - public static final String NBT_ACTION = "Action"; - public static final String NBT_FIRST = "First"; - public static final String NBT_ENDER = "Ender"; - public static final String NBT_ENDER_SAFETY = "EnderSafety"; - public static LinkingMode getLinkingMode(ItemStack stack) { - if (stack.hasTag() && stack.getTag().contains(NBT_MODE)) { - return LinkingMode.valueOf(stack.getOrCreateTag().getString(NBT_MODE)); - } - return LinkingMode.SINGLE; + return stack.getData(FSAttachments.LINKING_MODE); } public static ActionMode getActionMode(ItemStack stack) { - if (stack.hasTag() && stack.getTag().contains(NBT_ACTION)) { - return ActionMode.valueOf(stack.getOrCreateTag().getString(NBT_ACTION)); - } - return ActionMode.ADD; + return stack.getData(FSAttachments.ACTION_MODE); } static { EventManager.forge(PlayerInteractEvent.LeftClickBlock.class).filter(leftClickBlock -> leftClickBlock.getSide() == LogicalSide.SERVER && leftClickBlock.getItemStack().is(FunctionalStorage.LINKING_TOOL.get())).process(leftClickBlock -> { ItemStack stack = leftClickBlock.getItemStack(); BlockEntity blockEntity = leftClickBlock.getLevel().getBlockEntity(leftClickBlock.getPos()); - if (blockEntity instanceof EnderDrawerTile){ - stack.getOrCreateTag().putString(NBT_ENDER, ((EnderDrawerTile) blockEntity).getFrequency()); + if (blockEntity instanceof EnderDrawerTile tile) { + stack.setData(FSAttachments.ENDER_FREQUENCY, tile.getFrequency()); leftClickBlock.getEntity().displayClientMessage(Component.literal("Stored frequency in the tool").setStyle(Style.EMPTY.withColor(LinkingMode.SINGLE.color)), true); leftClickBlock.setCanceled(true); } @@ -75,29 +64,17 @@ public LinkingToolItem() { setItemGroup(FunctionalStorage.TAB); } - @Override - public void onCraftedBy(ItemStack p_41447_, Level p_41448_, Player p_41449_) { - super.onCraftedBy(p_41447_, p_41448_, p_41449_); - initNbt(p_41447_); - } - - private ItemStack initNbt(ItemStack stack) { - stack.getOrCreateTag().putString(NBT_MODE, LinkingMode.SINGLE.name()); - stack.getOrCreateTag().putString(NBT_ACTION, ActionMode.ADD.name()); - return stack; - } - @Override public boolean isFoil(ItemStack stack) { - return stack.getOrCreateTag().contains(NBT_ENDER); + return stack.hasData(FSAttachments.ENDER_FREQUENCY); } @Override public boolean canAttackBlock(BlockState state, Level level, BlockPos pos, Player player) { ItemStack stack = player.getItemInHand(InteractionHand.MAIN_HAND); BlockEntity blockEntity = level.getBlockEntity(pos); - if (blockEntity instanceof EnderDrawerTile){ - stack.getOrCreateTag().putString(NBT_ENDER, ((EnderDrawerTile) blockEntity).getFrequency()); + if (blockEntity instanceof EnderDrawerTile tile) { + stack.setData(FSAttachments.ENDER_FREQUENCY, tile.getFrequency()); player.displayClientMessage(Component.literal("Stored frequency in the tool").setStyle(Style.EMPTY.withColor(LinkingMode.SINGLE.color)), true); return false; } @@ -113,33 +90,28 @@ public InteractionResult useOn(UseOnContext context) { LinkingMode linkingMode = getLinkingMode(stack); ActionMode linkingAction = getActionMode(stack); if (blockEntity instanceof EnderDrawerTile){ - if (stack.getOrCreateTag().contains(NBT_ENDER)){ - String frequency = stack.getOrCreateTag().getString(NBT_ENDER); + if (stack.hasData(FSAttachments.ENDER_FREQUENCY)){ + String frequency = stack.getData(FSAttachments.ENDER_FREQUENCY); EnderInventoryHandler inventory = EnderSavedData.getInstance(context.getLevel()).getFrequency(((EnderDrawerTile) blockEntity).getFrequency()); - if (inventory.getStackInSlot(0).isEmpty() || (context.getPlayer().isShiftKeyDown() && stack.getOrCreateTag().contains(NBT_ENDER))){ + if (inventory.getStackInSlot(0).isEmpty() || (context.getPlayer().isShiftKeyDown() && stack.hasData(FSAttachments.ENDER_SAFETY))) { ((EnderDrawerTile) blockEntity).setFrequency(frequency); context.getPlayer().displayClientMessage(Component.literal("Changed drawer frequency").setStyle(Style.EMPTY.withColor(linkingMode.color)), true); - stack.getOrCreateTag().remove(NBT_ENDER_SAFETY); + stack.removeData(FSAttachments.ENDER_SAFETY); } else { context.getPlayer().displayClientMessage(Component.literal("Cannot change frequency, there are items in the drawer. Sneak + Right Click again to ignore this safety").withStyle(ChatFormatting.RED), true); - stack.getOrCreateTag().putBoolean(NBT_ENDER_SAFETY, true); + stack.setData(FSAttachments.ENDER_SAFETY, Unit.INSTANCE); } return InteractionResult.SUCCESS; } } if (blockEntity instanceof StorageControllerTile) { - CompoundTag controller = new CompoundTag(); - controller.putInt("X", pos.getX()); - controller.putInt("Y", pos.getY()); - controller.putInt("Z", pos.getZ()); - stack.getOrCreateTag().put(NBT_CONTROLLER, controller); + stack.setData(FSAttachments.CONTROLLER, pos); context.getPlayer().playSound(SoundEvents.ITEM_FRAME_ADD_ITEM, 0.5f, 1); context.getPlayer().displayClientMessage(Component.literal("Controller configured to the tool").withStyle(ChatFormatting.GREEN), true); - stack.getOrCreateTag().remove(NBT_ENDER); + stack.removeData(FSAttachments.ENDER_FREQUENCY); return InteractionResult.SUCCESS; - } else if (blockEntity instanceof ControllableDrawerTile && stack.getOrCreateTag().contains(NBT_CONTROLLER)) { - CompoundTag controllerNBT = stack.getOrCreateTag().getCompound(NBT_CONTROLLER); - BlockEntity controller = level.getBlockEntity(new BlockPos(controllerNBT.getInt("X"), controllerNBT.getInt("Y"), controllerNBT.getInt("Z"))); + } else if (blockEntity instanceof ControllableDrawerTile && stack.hasData(FSAttachments.CONTROLLER)) { + BlockEntity controller = level.getBlockEntity(stack.getData(FSAttachments.CONTROLLER)); if (controller instanceof StorageControllerTile) { if (linkingMode == LinkingMode.SINGLE) { if (((StorageControllerTile) controller).addConnectedDrawers(linkingAction, pos)){ @@ -150,9 +122,8 @@ public InteractionResult useOn(UseOnContext context) { } } } else { - if (stack.getOrCreateTag().contains(NBT_FIRST)) { - CompoundTag firstpos = stack.getOrCreateTag().getCompound(NBT_FIRST); - BlockPos firstPos = new BlockPos(firstpos.getInt("X"), firstpos.getInt("Y"), firstpos.getInt("Z")); + if (stack.hasData(FSAttachments.FIRST_POSITION)) { + BlockPos firstPos = stack.getData(FSAttachments.FIRST_POSITION); AABB aabb = new AABB(Math.min(firstPos.getX(), pos.getX()), Math.min(firstPos.getY(), pos.getY()), Math.min(firstPos.getZ(), pos.getZ()), Math.max(firstPos.getX(), pos.getX()) + 1, Math.max(firstPos.getY(), pos.getY()) + 1, Math.max(firstPos.getZ(), pos.getZ()) + 1); if (((StorageControllerTile) controller).addConnectedDrawers(linkingAction, getBlockPosInAABB(aabb).toArray(BlockPos[]::new))){ if (linkingAction == ActionMode.ADD){ @@ -161,13 +132,9 @@ public InteractionResult useOn(UseOnContext context) { context.getPlayer().displayClientMessage(Component.literal("Removed drawers from the controller").setStyle(Style.EMPTY.withColor(linkingMode.color)), true); } } - stack.getOrCreateTag().remove(NBT_FIRST); + stack.removeData(FSAttachments.FIRST_POSITION); } else { - CompoundTag firstPos = new CompoundTag(); - firstPos.putInt("X", pos.getX()); - firstPos.putInt("Y", pos.getY()); - firstPos.putInt("Z", pos.getZ()); - stack.getOrCreateTag().put(NBT_FIRST, firstPos); + stack.setData(FSAttachments.FIRST_POSITION, pos); } } context.getPlayer().playSound(SoundEvents.ITEM_FRAME_ROTATE_ITEM, 0.5f, 1); @@ -181,31 +148,23 @@ public InteractionResult useOn(UseOnContext context) { public InteractionResultHolder use(Level p_41432_, Player player, InteractionHand hand) { ItemStack stack = player.getItemInHand(hand); if (!stack.isEmpty()) { - if (stack.getOrCreateTag().contains(NBT_ENDER)){ - if (player.isShiftKeyDown()){ - stack.getOrCreateTag().remove(NBT_ENDER); + if (stack.hasData(FSAttachments.ENDER_FREQUENCY)) { + if (player.isShiftKeyDown()) { + stack.removeData(FSAttachments.ENDER_FREQUENCY); player.displayClientMessage(Component.literal("Cleared drawer frequency").setStyle(Style.EMPTY.withColor(ActionMode.ADD.getColor())), true); } } else { if (player.isShiftKeyDown()) { LinkingMode linkingMode = getLinkingMode(stack); - if (linkingMode == LinkingMode.SINGLE) { - stack.getOrCreateTag().putString(NBT_MODE, LinkingMode.MULTIPLE.name()); - player.displayClientMessage(Component.literal("Swapped mode to " + LinkingMode.MULTIPLE.name().toLowerCase(Locale.ROOT)).setStyle(Style.EMPTY.withColor(LinkingMode.MULTIPLE.getColor())), true); - } else { - stack.getOrCreateTag().putString(NBT_MODE, LinkingMode.SINGLE.name()); - player.displayClientMessage(Component.literal("Swapped mode to " + LinkingMode.SINGLE.name().toLowerCase(Locale.ROOT)).setStyle(Style.EMPTY.withColor(LinkingMode.SINGLE.getColor())), true); - } - stack.getOrCreateTag().remove(NBT_FIRST); + LinkingMode newMode = linkingMode == LinkingMode.SINGLE ? LinkingMode.MULTIPLE : LinkingMode.SINGLE; + stack.setData(FSAttachments.LINKING_MODE, newMode); + player.displayClientMessage(Component.literal("Swapped mode to " + newMode.name().toLowerCase(Locale.ROOT)).setStyle(Style.EMPTY.withColor(LinkingMode.MULTIPLE.getColor())), true); + stack.removeData(FSAttachments.FIRST_POSITION); } else { ActionMode linkingMode = getActionMode(stack); - if (linkingMode == ActionMode.ADD) { - stack.getOrCreateTag().putString(NBT_ACTION, ActionMode.REMOVE.name()); - player.displayClientMessage(Component.literal("Swapped action to " + ActionMode.REMOVE.name().toLowerCase(Locale.ROOT)).setStyle(Style.EMPTY.withColor(ActionMode.REMOVE.getColor())), true); - } else { - stack.getOrCreateTag().putString(NBT_ACTION, ActionMode.ADD.name()); - player.displayClientMessage(Component.literal("Swapped action to " + ActionMode.ADD.name().toLowerCase(Locale.ROOT)).setStyle(Style.EMPTY.withColor(ActionMode.ADD.getColor())), true); - } + ActionMode newMode = linkingMode == ActionMode.ADD ? ActionMode.REMOVE : ActionMode.ADD; + stack.setData(FSAttachments.ACTION_MODE, newMode); + player.displayClientMessage(Component.literal("Swapped action to " + newMode.name().toLowerCase(Locale.ROOT)).setStyle(Style.EMPTY.withColor(ActionMode.REMOVE.getColor())), true); } } player.playSound(SoundEvents.ITEM_FRAME_REMOVE_ITEM, 0.5f, 1); @@ -220,7 +179,7 @@ public void addTooltipDetails(@Nullable BasicItem.Key key, ItemStack stack, List LinkingMode linkingMode = getLinkingMode(stack); ActionMode linkingAction = getActionMode(stack); if (key == null) { - if (stack.getOrCreateTag().contains(NBT_ENDER)) { + if (stack.hasData(FSAttachments.ENDER_FREQUENCY)) { MutableComponent text = Component.translatable("linkingtool.ender.frequency"); //frequencyDisplay.forEach(item -> text.append(item.getName(new ItemStack(item)))); tooltip.add(text.withStyle(ChatFormatting.GRAY)); @@ -232,9 +191,10 @@ public void addTooltipDetails(@Nullable BasicItem.Key key, ItemStack stack, List .append(Component.translatable("linkingtool.linkingmode." + linkingMode.name().toLowerCase(Locale.ROOT)).withStyle(Style.EMPTY.withColor(linkingMode.getColor())))); tooltip.add(Component.translatable("linkingtool.linkingaction").withStyle(ChatFormatting.YELLOW) .append(Component.translatable("linkingtool.linkingaction." + linkingAction.name().toLowerCase(Locale.ROOT)).withStyle(Style.EMPTY.withColor(linkingAction.getColor())))); - if (stack.getOrCreateTag().contains(NBT_CONTROLLER)) { + if (stack.hasData(FSAttachments.CONTROLLER)) { + var pos = stack.getData(FSAttachments.CONTROLLER); tooltip.add(Component.translatable("linkingtool.controller").withStyle(ChatFormatting.YELLOW) - .append(Component.literal(stack.getOrCreateTag().getCompound(NBT_CONTROLLER).getInt("X") + "" + ChatFormatting.WHITE + ", " + ChatFormatting.DARK_AQUA + stack.getOrCreateTag().getCompound(NBT_CONTROLLER).getInt("Y") + ChatFormatting.WHITE + ", " + ChatFormatting.DARK_AQUA + stack.getOrCreateTag().getCompound(NBT_CONTROLLER).getInt("Z")).withStyle(ChatFormatting.DARK_AQUA))); + .append(Component.literal(pos.getX() + "" + ChatFormatting.WHITE + ", " + ChatFormatting.DARK_AQUA + pos.getY() + ChatFormatting.WHITE + ", " + ChatFormatting.DARK_AQUA + pos.getZ()).withStyle(ChatFormatting.DARK_AQUA))); } else { tooltip.add(Component.translatable("linkingtool.controller").withStyle(ChatFormatting.YELLOW).append(Component.literal("???").withStyle(ChatFormatting.DARK_AQUA))); } @@ -262,10 +222,12 @@ public boolean hasTooltipDetails(@Nullable BasicItem.Key key) { return key == null; } - public enum LinkingMode { + public enum LinkingMode implements StringRepresentable { SINGLE(TextColor.fromRgb(Color.cyan.getRGB())), MULTIPLE(TextColor.fromRgb(Color.GREEN.getRGB())); + public static final Codec CODEC = StringRepresentable.fromValues(LinkingMode::values); + private final TextColor color; LinkingMode(TextColor color) { @@ -275,12 +237,19 @@ public enum LinkingMode { public TextColor getColor() { return color; } + + @Override + public String getSerializedName() { + return name().toLowerCase(Locale.ROOT); + } } - public enum ActionMode { + public enum ActionMode implements StringRepresentable { ADD(TextColor.fromRgb(new Color(40, 131, 250).getRGB())), REMOVE(TextColor.fromRgb(new Color(250, 145, 40).getRGB())); + public static final Codec CODEC = StringRepresentable.fromValues(ActionMode::values); + private final TextColor color; ActionMode(TextColor color) { @@ -290,5 +259,10 @@ public enum ActionMode { public TextColor getColor() { return color; } + + @Override + public String getSerializedName() { + return name().toLowerCase(Locale.ROOT); + } } } diff --git a/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java b/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java index 45e7fe21..eb1cf7c6 100644 --- a/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java +++ b/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java @@ -4,14 +4,12 @@ import com.hrznstudio.titanium.item.BasicItem; import net.minecraft.ChatFormatting; import net.minecraft.core.Direction; -import net.minecraft.core.NonNullList; import net.minecraft.network.chat.Component; import net.minecraft.sounds.SoundEvents; import net.minecraft.world.entity.SlotAccess; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.ClickAction; import net.minecraft.world.inventory.Slot; -import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; @@ -24,14 +22,13 @@ public class UpgradeItem extends BasicItem { - public static int MAX_SLOT = 4; + public static final int MAX_SLOT = 4; public static Direction getDirection(ItemStack stack){ - if (stack.hasTag() && stack.getTag().contains("Direction")) { + if (stack.hasData(FSAttachments.DIRECTION)) { Item item = stack.getItem(); if (item.equals(FunctionalStorage.PULLING_UPGRADE.get()) || item.equals(FunctionalStorage.PUSHING_UPGRADE.get()) || item.equals(FunctionalStorage.COLLECTOR_UPGRADE.get())) { - var direction = Direction.byName(stack.getOrCreateTag().getString("Direction")); - return direction == null ? Direction.NORTH : direction; + return stack.getData(FSAttachments.DIRECTION); } } return Direction.NORTH; @@ -54,10 +51,10 @@ public void onCraftedBy(ItemStack p_41447_, Level p_41448_, Player p_41449_) { private ItemStack initNbt(ItemStack stack){ Item item = stack.getItem(); if (item.equals(FunctionalStorage.PULLING_UPGRADE.get()) || item.equals(FunctionalStorage.PUSHING_UPGRADE.get()) || item.equals(FunctionalStorage.COLLECTOR_UPGRADE.get())){ - stack.getOrCreateTag().putString("Direction", Direction.values()[0].getName()); + stack.setData(FSAttachments.DIRECTION, Direction.NORTH); } if (item.equals(FunctionalStorage.REDSTONE_UPGRADE.get())){ - stack.getOrCreateTag().putInt("Slot", 0); + stack.setData(FSAttachments.SLOT, 0); } return stack; } @@ -74,13 +71,13 @@ public boolean overrideOtherStackedOnMe(ItemStack first, ItemStack second, Slot if (item.equals(FunctionalStorage.PULLING_UPGRADE.get()) || item.equals(FunctionalStorage.PUSHING_UPGRADE.get()) || item.equals(FunctionalStorage.COLLECTOR_UPGRADE.get())){ Direction direction = getDirection(first); Direction next = Direction.values()[(Arrays.asList(Direction.values()).indexOf(direction) + 1 ) % Direction.values().length]; - first.getOrCreateTag().putString("Direction", next.getName()); + first.setData(FSAttachments.DIRECTION, next); p_150896_.playSound(SoundEvents.UI_BUTTON_CLICK.value(), 0.5f, 1); return true; } if (item.equals(FunctionalStorage.REDSTONE_UPGRADE.get())){ - int slot = first.getOrCreateTag().getInt("Slot"); - first.getOrCreateTag().putInt("Slot", (slot + 1) % MAX_SLOT); + int slot = first.getData(FSAttachments.SLOT); + first.setData(FSAttachments.SLOT, (slot + 1) % MAX_SLOT); p_150896_.playSound(SoundEvents.UI_BUTTON_CLICK.value(), 0.5f, 1); return true; } @@ -93,17 +90,15 @@ public void addTooltipDetails(@Nullable BasicItem.Key key, ItemStack stack, List super.addTooltipDetails(key, stack, tooltip, advanced); tooltip.add(Component.translatable("upgrade.type").withStyle(ChatFormatting.YELLOW).append(Component.translatable("upgrade.type." + getType().name().toLowerCase(Locale.ROOT)).withStyle(ChatFormatting.WHITE))); Item item = stack.getItem(); - if (stack.hasTag()) { - if (item.equals(FunctionalStorage.PULLING_UPGRADE.get()) || item.equals(FunctionalStorage.PUSHING_UPGRADE.get()) || item.equals(FunctionalStorage.COLLECTOR_UPGRADE.get())) { - tooltip.add(Component.translatable("item.utility.direction").withStyle(ChatFormatting.YELLOW).append(Component.translatable(WordUtils.capitalize(getDirection(stack).getName().toLowerCase(Locale.ROOT))).withStyle(ChatFormatting.WHITE))); - tooltip.add(Component.literal("")); - tooltip.add(Component.translatable("item.utility.direction.desc").withStyle(ChatFormatting.GRAY)); - } - if (item.equals(FunctionalStorage.REDSTONE_UPGRADE.get())) { - tooltip.add(Component.translatable("item.utility.slot").withStyle(ChatFormatting.YELLOW).append(Component.literal(stack.getOrCreateTag().getInt("Slot") + "").withStyle(ChatFormatting.WHITE))); - tooltip.add(Component.literal("")); - tooltip.add(Component.translatable("item.utility.direction.desc").withStyle(ChatFormatting.GRAY)); - } + if (item.equals(FunctionalStorage.PULLING_UPGRADE.get()) || item.equals(FunctionalStorage.PUSHING_UPGRADE.get()) || item.equals(FunctionalStorage.COLLECTOR_UPGRADE.get())) { + tooltip.add(Component.translatable("item.utility.direction").withStyle(ChatFormatting.YELLOW).append(Component.translatable(WordUtils.capitalize(getDirection(stack).getName().toLowerCase(Locale.ROOT))).withStyle(ChatFormatting.WHITE))); + tooltip.add(Component.literal("")); + tooltip.add(Component.translatable("item.utility.direction.desc").withStyle(ChatFormatting.GRAY)); + } + if (item.equals(FunctionalStorage.REDSTONE_UPGRADE.get())) { + tooltip.add(Component.translatable("item.utility.slot").withStyle(ChatFormatting.YELLOW).append(Component.literal(stack.getData(FSAttachments.SLOT).toString()).withStyle(ChatFormatting.WHITE))); + tooltip.add(Component.literal("")); + tooltip.add(Component.translatable("item.utility.direction.desc").withStyle(ChatFormatting.GRAY)); } } From b83d10469c34686a9450639878ab92291c2f4e7d Mon Sep 17 00:00:00 2001 From: Matyrobbrt Date: Sun, 7 Apr 2024 15:57:39 +0300 Subject: [PATCH 04/20] More deduplication --- .../functionalstorage/FunctionalStorage.java | 49 ++-- .../block/CompactingDrawerBlock.java | 152 ----------- .../block/CompactingFramedDrawerBlock.java | 48 +--- .../functionalstorage/block/Drawer.java | 246 +++++++++++++++++- .../functionalstorage/block/DrawerBlock.java | 173 +----------- .../block/EnderDrawerBlock.java | 120 +-------- .../block/FluidDrawerBlock.java | 149 ----------- .../functionalstorage/block/FramedBlock.java | 4 + .../block/FramedControllerExtensionBlock.java | 17 +- .../block/FramedDrawerBlock.java | 48 +--- .../FramedSimpleCompactingDrawerBlock.java | 69 +---- .../block/SimpleCompactingDrawerBlock.java | 182 ------------- .../tile/CompactingFramedDrawerTile.java | 2 +- .../tile/FramedControllerExtensionTile.java | 2 +- .../tile/FramedDrawerControllerTile.java | 2 +- .../block/tile/FramedDrawerTile.java | 2 +- .../FramedSimpleCompactingDrawerTile.java | 2 +- .../block/tile/FramedTile.java | 9 + 18 files changed, 299 insertions(+), 977 deletions(-) create mode 100644 src/main/java/com/buuz135/functionalstorage/block/FramedBlock.java create mode 100644 src/main/java/com/buuz135/functionalstorage/block/tile/FramedTile.java diff --git a/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java b/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java index c1a3e6b9..5e825f9e 100644 --- a/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java +++ b/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java @@ -189,6 +189,22 @@ public FunctionalStorage(Dist dist, IEventBus modBus) { NBTManager.getInstance().scanTileClassForAnnotations(SimpleCompactingDrawerTile.class); NBTManager.getInstance().scanTileClassForAnnotations(FramedSimpleCompactingDrawerTile.class); + EventManager.forge(PlayerInteractEvent.LeftClickBlock.class) + .process(event -> { + var state = event.getLevel().getBlockState(event.getPos()); + if (event.getLevel().getBlockState(event.getPos()).getBlock() instanceof Drawer drawer) { + final int hit = drawer.getHit(state, event.getLevel(), event.getEntity()); + if (hit != -1) { + var be = drawer.getBlockEntityAt(event.getLevel(), event.getPos()); + if (be != null) { + be.onClicked(event.getEntity(), hit); + event.setCanceled(true); + } + } + } + }) + .subscribe(); + EventManager.mod(RegisterCapabilitiesEvent.class).process(event -> { class Registrar { void register(Class tp, Function func, BlockWithTile... types) { @@ -254,6 +270,7 @@ protected void initModules() { } } } + // TODO - items for normal drawers FLUID_DRAWER_1 = getRegistries().registerBlockWithTile("fluid_1", () -> new FluidDrawerBlock(DrawerType.X_1, BlockBehaviour.Properties.ofFullCopy(Blocks.STONE_BRICKS)), TAB); FLUID_DRAWER_2 = getRegistries().registerBlockWithTile("fluid_2", () -> new FluidDrawerBlock(DrawerType.X_2, BlockBehaviour.Properties.ofFullCopy(Blocks.STONE_BRICKS)), TAB); FLUID_DRAWER_4 = getRegistries().registerBlockWithTile("fluid_4", () -> new FluidDrawerBlock(DrawerType.X_4, BlockBehaviour.Properties.ofFullCopy(Blocks.STONE_BRICKS)), TAB); @@ -442,38 +459,6 @@ public void onClient() { modelRegistryEvent.register(new ResourceLocation(MOD_ID, "framedblock"), FramedModel.Loader.INSTANCE); }).subscribe(); - EventManager.forge(PlayerInteractEvent.LeftClickBlock.class) - .process(event -> { - var state = event.getLevel().getBlockState(event.getPos()); - if (event.getLevel().getBlockState(event.getPos()).getBlock() instanceof Drawer drawer) { - final int hit = getHit(drawer, state, event.getLevel(), event.getEntity()); - if (hit != -1) { - var be = drawer.getBlockEntityAt(event.getLevel(), event.getPos()); - if (be != null) { - be.onClicked(event.getEntity(), hit); - event.setCanceled(true); - } - } - } - }) - .subscribe(); - } - - private static int getHit(Drawer drawer, BlockState state, Level worldIn, Player player) { - HitResult result = RayTraceUtils.rayTraceSimple(worldIn, player, 32, 0); - if (result instanceof BlockHitResult) { - VoxelShape hit = RayTraceUtils.rayTraceVoxelShape((BlockHitResult) result, worldIn, player, 32, 0); - if (hit != null) { - if (hit.equals(Shapes.block())) return -1; - List shapes = new ArrayList<>(drawer.getHitShapes(state)); - for (int i = 0; i < shapes.size(); i++) { - if (Shapes.joinIsNotEmpty(shapes.get(i), hit, BooleanOp.AND)) { - return i; - } - } - } - } - return -1; } @Override diff --git a/src/main/java/com/buuz135/functionalstorage/block/CompactingDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/CompactingDrawerBlock.java index 7ada2d2d..1b22eca0 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/CompactingDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/CompactingDrawerBlock.java @@ -85,12 +85,6 @@ public CompactingDrawerBlock(String name, Properties properties) { registerDefaultState(defaultBlockState().setValue(RotatableBlock.FACING_HORIZONTAL, Direction.NORTH).setValue(DrawerBlock.LOCKED, false)); } - @NotNull - @Override - public RotationType getRotationType() { - return RotationType.FOUR_WAY; - } - @Override public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { return (blockPos, state) -> new CompactingDrawerTile(this, (BlockEntityType) FunctionalStorage.COMPACTING_DRAWER.type().get(), blockPos, state); @@ -109,114 +103,11 @@ private static List getShapes(BlockState state, BlockGetter source, return boxes; } - @Override - protected void createBlockStateDefinition(StateDefinition.Builder p_206840_1_) { - super.createBlockStateDefinition(p_206840_1_); - p_206840_1_.add(DrawerBlock.LOCKED); - } - - @Nonnull - @Override - public VoxelShape getCollisionShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext selectionContext) { - return Shapes.box(0, 0, 0, 1,1,1); - } - - @Override - public boolean hasCustomBoxes(BlockState state, BlockGetter source, BlockPos pos) { - return true; - } - - @Override - public boolean hasIndividualRenderVoxelShape() { - return true; - } - - @Override - public InteractionResult use(BlockState state, Level worldIn, BlockPos pos, Player player, InteractionHand hand, BlockHitResult ray) { - return TileUtil.getTileEntity(worldIn, pos, CompactingDrawerTile.class).map(drawerTile -> drawerTile.onSlotActivated(player, hand, ray.getDirection(), ray.getLocation().x, ray.getLocation().y, ray.getLocation().z, getHit(state, worldIn, pos, player))).orElse(InteractionResult.PASS); - } - @Override public Collection getHitShapes(BlockState state) { return CACHED_SHAPES.get(state.getValue(RotatableBlock.FACING_HORIZONTAL)); } - public int getHit(BlockState state, Level worldIn, BlockPos pos, Player player) { - HitResult result = RayTraceUtils.rayTraceSimple(worldIn, player, 32, 0); - if (result instanceof BlockHitResult) { - VoxelShape hit = RayTraceUtils.rayTraceVoxelShape((BlockHitResult) result, worldIn, player, 32, 0); - if (hit != null) { - if (hit.equals(Shapes.block())) return -1; - List shapes = new ArrayList<>(CACHED_SHAPES.get(state.getValue(RotatableBlock.FACING_HORIZONTAL))); - for (int i = 0; i < shapes.size(); i++) { - if (Shapes.joinIsNotEmpty(shapes.get(i), hit, BooleanOp.AND)) { - return i; - } - } - } - } - return -1; - } - - @Override - public LootTable.Builder getLootTable(@Nonnull BasicBlockLootTables blockLootTables) { - //CopyNbtFunction.Builder nbtBuilder = CopyNbtFunction.copyData(ContextNbtProvider.BLOCK_ENTITY); - //nbtBuilder.copy("handler", "BlockEntityTag.handler"); - //nbtBuilder.copy("storageUpgrades", "BlockEntityTag.storageUpgrades"); - //nbtBuilder.copy("utilityUpgrades", "BlockEntityTag.utilityUpgrades"); - //return blockLootTables.droppingSelfWithNbt(this, nbtBuilder); - return blockLootTables.droppingNothing(); - } - - - @Override - public List getDrops(BlockState p_60537_, LootParams.Builder builder) { - NonNullList stacks = NonNullList.create(); - ItemStack stack = new ItemStack(this); - BlockEntity drawerTile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); - if (drawerTile instanceof ControllableDrawerTile tile) { - if (!tile.isEverythingEmpty()) { - stack.setData(FSAttachments.TILE, drawerTile.saveWithoutMetadata()); - } - if (tile.isLocked()) { - stack.setData(FSAttachments.LOCKED, tile.isLocked()); - } - } - stacks.add(stack); - return stacks; - } - - @Override - public NonNullList getDynamicDrops(BlockState state, Level worldIn, BlockPos pos, BlockState newState, boolean isMoving) { - return NonNullList.create(); - } - - @Override - public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @Nullable LivingEntity p_49850_, ItemStack stack) { - super.setPlacedBy(level, pos, p_49849_, p_49850_, stack); - BlockEntity entity = level.getBlockEntity(pos); - if (entity instanceof ControllableDrawerTile tile) { - tile.setLocked(stack.getData(FSAttachments.LOCKED)); - if (stack.hasData(FSAttachments.TILE)) { - entity.load(stack.getData(FSAttachments.TILE)); - tile.markForUpdate(); - } - } - var offhand = p_49850_.getOffhandItem(); - if (offhand.is(FunctionalStorage.CONFIGURATION_TOOL.get())) { - var action = ConfigurationToolItem.getAction(offhand); - if (entity instanceof ControllableDrawerTile tile) { - if (action == ConfigurationToolItem.ConfigurationAction.LOCKING) { - tile.setLocked(true); - } else if (action.getMax() == 1) { - tile.getDrawerOptions().setActive(action, false); - } else { - tile.getDrawerOptions().setAdvancedValue(action, 1); - } - } - } - } - @Override public void registerRecipe(RecipeOutput consumer) { TitaniumShapedRecipeBuilder.shapedRecipe(this) @@ -228,55 +119,12 @@ public void registerRecipe(RecipeOutput consumer) { .save(consumer); } - @Override - public void onRemove(BlockState state, Level worldIn, BlockPos pos, BlockState newState, boolean isMoving) { - if (!state.is(newState.getBlock())){ - TileUtil.getTileEntity(worldIn, pos, CompactingDrawerTile.class).ifPresent(tile -> { - if (tile.getControllerPos() != null){ - TileUtil.getTileEntity(worldIn, tile.getControllerPos(), StorageControllerTile.class).ifPresent(drawerControllerTile -> { - drawerControllerTile.addConnectedDrawers(LinkingToolItem.ActionMode.REMOVE, pos); - }); - } - }); - } - super.onRemove(state, worldIn, pos, newState, isMoving); - } - - - @Override - public boolean canConnectRedstone(BlockState state, BlockGetter level, BlockPos pos, @Nullable Direction direction) { - return true; - } - - @Override - public boolean isSignalSource(BlockState p_60571_) { - return true; - } - - @Override - public int getSignal(BlockState p_60483_, BlockGetter blockGetter, BlockPos blockPos, Direction p_60486_) { - return DrawerBlock.getSignal(blockGetter, blockPos); - } - - @Override - public void appendHoverText(ItemStack p_49816_, @Nullable BlockGetter p_49817_, List tooltip, TooltipFlag p_49819_) { - super.appendHoverText(p_49816_, p_49817_, tooltip, p_49819_); - if (p_49816_.hasData(FSAttachments.TILE)) { - MutableComponent text = Component.translatable("drawer.block.contents"); - tooltip.add(text.withStyle(ChatFormatting.GRAY)); - tooltip.add(Component.literal("")); - tooltip.add(Component.literal("")); - } - } - public static class CompactingDrawerItem extends BlockItem { private final int slots; - private Block drawerBlock; public CompactingDrawerItem(Block p_40565_, net.minecraft.world.item.Item.Properties p_40566_, int slots) { super(p_40565_, p_40566_); - this.drawerBlock = p_40565_; this.slots = slots; } diff --git a/src/main/java/com/buuz135/functionalstorage/block/CompactingFramedDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/CompactingFramedDrawerBlock.java index f6a713e6..44bf5476 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/CompactingFramedDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/CompactingFramedDrawerBlock.java @@ -33,7 +33,7 @@ import java.util.List; -public class CompactingFramedDrawerBlock extends CompactingDrawerBlock{ +public class CompactingFramedDrawerBlock extends CompactingDrawerBlock implements FramedBlock { public CompactingFramedDrawerBlock(String name) { super(name, Properties.ofFullCopy(Blocks.STONE).noOcclusion().isViewBlocking((p_61036_, p_61037_, p_61038_) -> false)); } @@ -43,46 +43,6 @@ public BlockEntityType.BlockEntitySupplier getTileEntityFa return (blockPos, state) -> new CompactingFramedDrawerTile(this, (BlockEntityType) FunctionalStorage.FRAMED_COMPACTING_DRAWER.type().get(), blockPos, state); } - @Override - public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @Nullable LivingEntity p_49850_, ItemStack stack) { - super.setPlacedBy(level, pos, p_49849_, p_49850_, stack); - TileUtil.getTileEntity(level, pos, CompactingFramedDrawerTile.class).ifPresent(framedDrawerTile -> { - framedDrawerTile.setFramedDrawerModelData(FramedDrawerBlock.getDrawerModelData(stack)); - }); - } - - - @Override - public List getDrops(BlockState p_60537_, LootParams.Builder builder) { - NonNullList stacks = NonNullList.create(); - ItemStack stack = new ItemStack(this); - BlockEntity drawerTile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); - if (drawerTile instanceof CompactingFramedDrawerTile framedDrawerTile) { - if (framedDrawerTile.getFramedDrawerModelData() != null) { - stack.setData(FSAttachments.STYLE, framedDrawerTile.getFramedDrawerModelData().serializeNBT()); - } - if (!framedDrawerTile.isEverythingEmpty()) { - stack.setData(FSAttachments.TILE, framedDrawerTile.saveWithoutMetadata()); - } - if (framedDrawerTile.isLocked()) { - stack.setData(FSAttachments.LOCKED, framedDrawerTile.isLocked()); - } - } - stacks.add(stack); - return stacks; - } - - @Override - public ItemStack getCloneItemStack(BlockState state, HitResult target, LevelReader level, BlockPos pos, Player player) { - BlockEntity entity = level.getBlockEntity(pos); - if (entity instanceof FramedDrawerTile framedDrawerTile && framedDrawerTile.getFramedDrawerModelData() != null && !framedDrawerTile.getFramedDrawerModelData().getDesign().isEmpty()){ - ItemStack stack = new ItemStack(this); - stack.setData(FSAttachments.STYLE, framedDrawerTile.getFramedDrawerModelData().serializeNBT()); - return stack; - } - return super.getCloneItemStack(state, target, level, pos, player); - } - @Override public void registerRecipe(RecipeOutput consumer) { TitaniumShapedRecipeBuilder.shapedRecipe(this) @@ -93,9 +53,5 @@ public void registerRecipe(RecipeOutput consumer) { .define('I', Tags.Items.INGOTS_IRON) .save(consumer); } - @Override - public void appendHoverText(ItemStack p_49816_, @Nullable BlockGetter p_49817_, List components, TooltipFlag p_49819_) { - components.add(Component.translatable("frameddrawer.use").withStyle(ChatFormatting.GRAY)); - super.appendHoverText(p_49816_, p_49817_, components, p_49819_); - } + } diff --git a/src/main/java/com/buuz135/functionalstorage/block/Drawer.java b/src/main/java/com/buuz135/functionalstorage/block/Drawer.java index 874ef484..e48357d7 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/Drawer.java +++ b/src/main/java/com/buuz135/functionalstorage/block/Drawer.java @@ -1,18 +1,57 @@ package com.buuz135.functionalstorage.block; +import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.block.tile.ControllableDrawerTile; +import com.buuz135.functionalstorage.block.tile.DrawerTile; +import com.buuz135.functionalstorage.block.tile.FramedDrawerTile; +import com.buuz135.functionalstorage.block.tile.FramedSimpleCompactingDrawerTile; +import com.buuz135.functionalstorage.block.tile.FramedTile; +import com.buuz135.functionalstorage.block.tile.ItemControllableDrawerTile; +import com.buuz135.functionalstorage.block.tile.StorageControllerTile; +import com.buuz135.functionalstorage.item.ConfigurationToolItem; +import com.buuz135.functionalstorage.item.FSAttachments; +import com.buuz135.functionalstorage.item.LinkingToolItem; import com.hrznstudio.titanium.block.RotatableBlock; -import com.hrznstudio.titanium.block.tile.BasicTile; +import com.hrznstudio.titanium.datagenerator.loot.block.BasicBlockLootTables; +import com.hrznstudio.titanium.util.RayTraceUtils; import com.hrznstudio.titanium.util.TileUtil; +import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.core.NonNullList; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.storage.loot.LootParams; +import net.minecraft.world.level.storage.loot.LootTable; +import net.minecraft.world.level.storage.loot.parameters.LootContextParams; +import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.HitResult; +import net.minecraft.world.phys.shapes.BooleanOp; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; +import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import javax.annotation.Nullable; +import java.util.ArrayList; import java.util.Collection; +import java.util.List; -public abstract class Drawer> extends RotatableBlock { +public abstract class Drawer> extends RotatableBlock { public Drawer(String name, Properties properties, Class tileClass) { super(name, properties, tileClass); } @@ -22,5 +61,208 @@ public ControllableDrawerTile getBlockEntityAt(BlockGetter level, BlockPos po return TileUtil.getTileEntity(level, pos, ControllableDrawerTile.class).orElse(null); } + @Override + protected void createBlockStateDefinition(StateDefinition.Builder def) { + super.createBlockStateDefinition(def); + def.add(DrawerBlock.LOCKED); + } + + @NotNull + @Override + public RotationType getRotationType() { + return RotationType.FOUR_WAY; + } + + @Nonnull + @Override + public VoxelShape getCollisionShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext selectionContext) { + return Shapes.box(0, 0, 0, 1, 1, 1); + } + + @Override + public boolean hasCustomBoxes(BlockState state, BlockGetter source, BlockPos pos) { + return true; + } + + @Override + public boolean hasIndividualRenderVoxelShape() { + return true; + } + + @Override + public InteractionResult use(BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult ray) { + var entity = getBlockEntityAt(level, pos); + if (entity != null) { + return entity.onSlotActivated(player, hand, ray.getDirection(), ray.getLocation().x, ray.getLocation().y, ray.getLocation().z, getHit(state, level, player)); + } + return InteractionResult.PASS; + } + + @Override + public List getDrops(BlockState p_60537_, LootParams.Builder builder) { + NonNullList stacks = NonNullList.create(); + ItemStack stack = new ItemStack(this); + BlockEntity drawerTile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); + if (drawerTile instanceof ControllableDrawerTile tile) { + copyTo((T) tile, stack); + } + stacks.add(stack); + return stacks; + } + + @Override + public LootTable.Builder getLootTable(@Nonnull BasicBlockLootTables blockLootTables) { + return blockLootTables.droppingNothing(); + } + + @Override + public NonNullList getDynamicDrops(BlockState state, Level worldIn, BlockPos pos, BlockState newState, boolean isMoving) { + return NonNullList.create(); + } + + protected void copyTo(T tile, ItemStack stack) { + if (!tile.isEverythingEmpty()) { + stack.setData(FSAttachments.TILE, tile.saveWithoutMetadata()); + } + if (tile.isLocked()) { + stack.setData(FSAttachments.LOCKED, tile.isLocked()); + } + if (tile instanceof FramedTile framedDrawerTile && framedDrawerTile.getFramedDrawerModelData() != null) { + stack.setData(FSAttachments.STYLE, framedDrawerTile.getFramedDrawerModelData().serializeNBT()); + } + } + + protected void copyFrom(ItemStack stack, T tile) { + tile.setLocked(stack.getData(FSAttachments.LOCKED)); + if (stack.hasData(FSAttachments.TILE)) { + tile.load(stack.getData(FSAttachments.TILE)); + tile.markForUpdate(); + } + if (stack.hasData(FSAttachments.STYLE) && tile instanceof FramedTile framed) { + framed.setFramedDrawerModelData(FramedDrawerBlock.getDrawerModelData(stack)); + } + } + + protected void configure(LivingEntity player, T tile) { + var offhand = player.getOffhandItem(); + if (offhand.is(FunctionalStorage.CONFIGURATION_TOOL.get())) { + var action = ConfigurationToolItem.getAction(offhand); + if (action == ConfigurationToolItem.ConfigurationAction.LOCKING) { + tile.setLocked(true); + } else if (action.getMax() == 1) { + tile.getDrawerOptions().setActive(action, false); + } else { + tile.getDrawerOptions().setAdvancedValue(action, 1); + } + } + } + + @Override + public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @org.jetbrains.annotations.Nullable LivingEntity player, ItemStack stack) { + super.setPlacedBy(level, pos, p_49849_, player, stack); + BlockEntity entity = level.getBlockEntity(pos); + if (entity instanceof ControllableDrawerTile tile) { + copyFrom(stack, (T) tile); + if (player != null) configure(player, (T) tile); + } + } + + @Override + public boolean isSignalSource(BlockState p_60571_) { + return true; + } + + @Override + public boolean canConnectRedstone(BlockState state, BlockGetter level, BlockPos pos, @org.jetbrains.annotations.Nullable Direction direction) { + ControllableDrawerTile tile = TileUtil.getTileEntity(level, pos, ControllableDrawerTile.class).orElse(null); + if (tile != null) { + for (int i = 0; i < tile.getUtilityUpgrades().getSlots(); i++) { + ItemStack stack = tile.getUtilityUpgrades().getStackInSlot(i); + if (stack.is(FunctionalStorage.REDSTONE_UPGRADE.get())) { + return true; + } + } + } + return false; + } + + @Override + public int getSignal(BlockState p_60483_, BlockGetter blockGetter, BlockPos blockPos, Direction p_60486_) { + ItemControllableDrawerTile tile = TileUtil.getTileEntity(blockGetter, blockPos, ItemControllableDrawerTile.class).orElse(null); + if (tile != null){ + for (int i = 0; i < tile.getUtilityUpgrades().getSlots(); i++) { + ItemStack stack = tile.getUtilityUpgrades().getStackInSlot(i); + if (stack.getItem().equals(FunctionalStorage.REDSTONE_UPGRADE.get())){ + int redstoneSlot = stack.getData(FSAttachments.SLOT); + if (redstoneSlot < tile.getStorage().getSlots()) { + int amount = tile.getStorage().getStackInSlot(redstoneSlot).getCount() * 14 / tile.getStorage().getSlotLimit(redstoneSlot); + return amount + (amount > 0 ? 1 : 0); + } + } + } + } + return 0; + } + + @Override + public void appendHoverText(ItemStack stack, @org.jetbrains.annotations.Nullable BlockGetter p_49817_, List tooltip, TooltipFlag p_49819_) { + super.appendHoverText(stack, p_49817_, tooltip, p_49819_); + if (stack.hasData(FSAttachments.TILE)) { + MutableComponent text = Component.translatable("drawer.block.contents"); + tooltip.add(text.withStyle(ChatFormatting.GRAY)); + tooltip.add(Component.literal("")); + tooltip.add(Component.literal("")); + } + + if (this instanceof FramedBlock) { + tooltip.add(Component.translatable("frameddrawer.use").withStyle(ChatFormatting.GRAY)); + } + } + + @Override + public ItemStack getCloneItemStack(BlockState state, HitResult target, LevelReader level, BlockPos pos, Player player) { + BlockEntity entity = level.getBlockEntity(pos); + ItemStack stack = new ItemStack(this); + if (entity instanceof FramedTile framedDrawerTile && framedDrawerTile.getFramedDrawerModelData() != null && !framedDrawerTile.getFramedDrawerModelData().getDesign().isEmpty()) { + stack.setData(FSAttachments.STYLE, framedDrawerTile.getFramedDrawerModelData().serializeNBT()); + return stack; + } + if (entity instanceof ControllableDrawerTile tile) { + copyTo((T) tile, stack); + } + return stack; + } + + @Override + public void onRemove(BlockState state, Level worldIn, BlockPos pos, BlockState newState, boolean isMoving) { + if (!state.is(newState.getBlock())){ + TileUtil.getTileEntity(worldIn, pos, ControllableDrawerTile.class).ifPresent(tile -> { + if (tile.getControllerPos() != null) { + TileUtil.getTileEntity(worldIn, tile.getControllerPos(), StorageControllerTile.class).ifPresent(drawerControllerTile -> { + drawerControllerTile.addConnectedDrawers(LinkingToolItem.ActionMode.REMOVE, pos); + }); + } + }); + } + super.onRemove(state, worldIn, pos, newState, isMoving); + } + public abstract Collection getHitShapes(BlockState state); + + public int getHit(BlockState state, Level worldIn, Player player) { + HitResult result = RayTraceUtils.rayTraceSimple(worldIn, player, 32, 0); + if (result instanceof BlockHitResult) { + VoxelShape hit = RayTraceUtils.rayTraceVoxelShape((BlockHitResult) result, worldIn, player, 32, 0); + if (hit != null) { + if (hit.equals(Shapes.block())) return -1; + List shapes = new ArrayList<>(getHitShapes(state)); + for (int i = 0; i < shapes.size(); i++) { + if (Shapes.joinIsNotEmpty(shapes.get(i), hit, BooleanOp.AND)) { + return i; + } + } + } + } + return -1; + } } diff --git a/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java index a246bb3b..84328b0c 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java @@ -69,9 +69,9 @@ public class DrawerBlock extends Drawer { - public static HashMap> CACHED_SHAPES = new HashMap<>(); + public static final HashMap> CACHED_SHAPES = new HashMap<>(); - public static BooleanProperty LOCKED = BooleanProperty.create("locked"); + public static final BooleanProperty LOCKED = BooleanProperty.create("locked"); static { CACHED_SHAPES.computeIfAbsent(FunctionalStorage.DrawerType.X_1, type1 -> MultimapBuilder.hashKeys().arrayListValues().build()) @@ -129,20 +129,6 @@ public DrawerBlock(IWoodType woodType, FunctionalStorage.DrawerType type, BlockB setItemGroup(FunctionalStorage.TAB); registerDefaultState(defaultBlockState().setValue(RotatableBlock.FACING_HORIZONTAL, Direction.NORTH).setValue(LOCKED, false)); } - - - @Override - protected void createBlockStateDefinition(StateDefinition.Builder p_206840_1_) { - super.createBlockStateDefinition(p_206840_1_); - p_206840_1_.add(LOCKED); - } - - @NotNull - @Override - public RotationType getRotationType() { - return RotationType.FOUR_WAY; - } - @Override public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { return (blockPos, state) -> new DrawerTile(this, (BlockEntityType) FunctionalStorage.DRAWER_TYPES.get(type).stream().filter(registryObjectRegistryObjectPair -> registryObjectRegistryObjectPair.getBlock() == this).map(BlockWithTile::type).findFirst().get().get(), blockPos, state, type, woodType); @@ -161,109 +147,11 @@ private static List getShapes(BlockState state, BlockGetter source, return boxes; } - @Nonnull - @Override - public VoxelShape getCollisionShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext selectionContext) { - return Shapes.box(0, 0, 0, 1,1,1); - } - - @Override - public boolean hasCustomBoxes(BlockState state, BlockGetter source, BlockPos pos) { - return true; - } - - @Override - public boolean hasIndividualRenderVoxelShape() { - return true; - } - - @Override - public InteractionResult use(BlockState state, Level worldIn, BlockPos pos, Player player, InteractionHand hand, BlockHitResult ray) { - return TileUtil.getTileEntity(worldIn, pos, DrawerTile.class).map(drawerTile -> drawerTile.onSlotActivated(player, hand, ray.getDirection(), ray.getLocation().x, ray.getLocation().y, ray.getLocation().z, getHit(state, worldIn, pos, player))).orElse(InteractionResult.PASS); - } - @Override public Collection getHitShapes(BlockState state) { return DrawerBlock.CACHED_SHAPES.get(type).get(state.getValue(RotatableBlock.FACING_HORIZONTAL)); } - public int getHit(BlockState state, Level worldIn, BlockPos pos, Player player) { - HitResult result = RayTraceUtils.rayTraceSimple(worldIn, player, 32, 0); - if (result instanceof BlockHitResult) { - VoxelShape hit = RayTraceUtils.rayTraceVoxelShape((BlockHitResult) result, worldIn, player, 32, 0); - if (hit != null) { - if (hit.equals(Shapes.block())) return -1; - List shapes = new ArrayList<>(); - shapes.addAll(CACHED_SHAPES.get(type).get(state.getValue(RotatableBlock.FACING_HORIZONTAL))); - for (int i = 0; i < shapes.size(); i++) { - if (Shapes.joinIsNotEmpty(shapes.get(i), hit, BooleanOp.AND)) { - return i; - } - } - } - } - return -1; - } - - @Override - public LootTable.Builder getLootTable(@Nonnull BasicBlockLootTables blockLootTables) { - //CopyNbtFunction.Builder nbtBuilder = CopyNbtFunction.copyData(ContextNbtProvider.BLOCK_ENTITY); - //nbtBuilder.copy("handler", "BlockEntityTag.handler"); - //nbtBuilder.copy("storageUpgrades", "BlockEntityTag.storageUpgrades"); - //nbtBuilder.copy("utilityUpgrades", "BlockEntityTag.utilityUpgrades"); - //return blockLootTables.droppingSelfWithNbt(this, nbtBuilder); - return blockLootTables.droppingNothing(); - } - - - @Override - public List getDrops(BlockState p_60537_, LootParams.Builder builder) { - NonNullList stacks = NonNullList.create(); - ItemStack stack = new ItemStack(this); - BlockEntity drawerTile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); - if (drawerTile instanceof DrawerTile tile) { - if (!tile.isEverythingEmpty()) { - stack.setData(FSAttachments.TILE, drawerTile.saveWithoutMetadata()); - } - if (tile.isLocked()) { - stack.setData(FSAttachments.LOCKED, tile.isLocked()); - } - } - stacks.add(stack); - return stacks; - } - - @Override - public NonNullList getDynamicDrops(BlockState state, Level worldIn, BlockPos pos, BlockState newState, boolean isMoving) { - return NonNullList.create(); - } - - @Override - public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @Nullable LivingEntity p_49850_, ItemStack stack) { - super.setPlacedBy(level, pos, p_49849_, p_49850_, stack); - BlockEntity entity = level.getBlockEntity(pos); - if (entity instanceof ControllableDrawerTile tile) { - tile.setLocked(stack.getData(FSAttachments.LOCKED)); - if (stack.hasData(FSAttachments.TILE)) { - entity.load(stack.getData(FSAttachments.TILE)); - tile.markForUpdate(); - } - } - var offhand = p_49850_.getOffhandItem(); - if (offhand.is(FunctionalStorage.CONFIGURATION_TOOL.get())) { - var action = ConfigurationToolItem.getAction(offhand); - if (entity instanceof ControllableDrawerTile tile) { - if (action == ConfigurationToolItem.ConfigurationAction.LOCKING) { - tile.setLocked(true); - } else if (action.getMax() == 1) { - tile.getDrawerOptions().setActive(action, false); - } else { - tile.getDrawerOptions().setAdvancedValue(action, 1); - } - } - } - } - @Override public void registerRecipe(RecipeOutput consumer) { if (type == FunctionalStorage.DrawerType.X_1) { @@ -324,63 +212,6 @@ public IWoodType getWoodType() { return woodType; } - @Override - public void onRemove(BlockState state, Level worldIn, BlockPos pos, BlockState newState, boolean isMoving) { - if (!state.is(newState.getBlock())){ - TileUtil.getTileEntity(worldIn, pos, DrawerTile.class).ifPresent(tile -> { - if (tile.getControllerPos() != null) { - TileUtil.getTileEntity(worldIn, tile.getControllerPos(), StorageControllerTile.class).ifPresent(drawerControllerTile -> { - drawerControllerTile.addConnectedDrawers(LinkingToolItem.ActionMode.REMOVE, pos); - }); - } - }); - } - super.onRemove(state, worldIn, pos, newState, isMoving); - } - - @Override - public void appendHoverText(ItemStack p_49816_, @Nullable BlockGetter p_49817_, List tooltip, TooltipFlag p_49819_) { - super.appendHoverText(p_49816_, p_49817_, tooltip, p_49819_); - if (p_49816_.hasData(FSAttachments.TILE)) { - MutableComponent text = Component.translatable("drawer.block.contents"); - tooltip.add(text.withStyle(ChatFormatting.GRAY)); - tooltip.add(Component.literal("")); - tooltip.add(Component.literal("")); - } - } - - @Override - public boolean canConnectRedstone(BlockState state, BlockGetter level, BlockPos pos, @Nullable Direction direction) { - return true; - } - - @Override - public boolean isSignalSource(BlockState p_60571_) { - return true; - } - - @Override - public int getSignal(BlockState p_60483_, BlockGetter blockGetter, BlockPos blockPos, Direction p_60486_) { - return getSignal(blockGetter, blockPos); - } - - public static int getSignal(BlockGetter blockGetter, BlockPos blockPos) { - ItemControllableDrawerTile tile = TileUtil.getTileEntity(blockGetter, blockPos, ItemControllableDrawerTile.class).orElse(null); - if (tile != null){ - for (int i = 0; i < tile.getUtilityUpgrades().getSlots(); i++) { - ItemStack stack = tile.getUtilityUpgrades().getStackInSlot(i); - if (stack.getItem().equals(FunctionalStorage.REDSTONE_UPGRADE.get())){ - int redstoneSlot = stack.getData(FSAttachments.SLOT); - if (redstoneSlot < tile.getStorage().getSlots()) { - int amount = tile.getStorage().getStackInSlot(redstoneSlot).getCount() * 14 / tile.getStorage().getSlotLimit(redstoneSlot); - return amount + (amount > 0 ? 1 : 0); - } - } - } - } - return 0; - } - public static class DrawerItem extends BlockItem{ private DrawerBlock drawerBlock; diff --git a/src/main/java/com/buuz135/functionalstorage/block/EnderDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/EnderDrawerBlock.java index 28a39f75..33819b40 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/EnderDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/EnderDrawerBlock.java @@ -1,27 +1,19 @@ package com.buuz135.functionalstorage.block; import com.buuz135.functionalstorage.FunctionalStorage; -import com.buuz135.functionalstorage.block.tile.ControllableDrawerTile; import com.buuz135.functionalstorage.block.tile.EnderDrawerTile; -import com.buuz135.functionalstorage.block.tile.ItemControllableDrawerTile; import com.buuz135.functionalstorage.block.tile.StorageControllerTile; import com.buuz135.functionalstorage.item.FSAttachments; import com.buuz135.functionalstorage.item.LinkingToolItem; import com.hrznstudio.titanium.block.RotatableBlock; -import com.hrznstudio.titanium.datagenerator.loot.block.BasicBlockLootTables; -import com.hrznstudio.titanium.util.RayTraceUtils; import com.hrznstudio.titanium.util.TileUtil; import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; -import net.minecraft.core.NonNullList; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; @@ -29,25 +21,14 @@ import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.block.state.StateDefinition; -import net.minecraft.world.level.storage.loot.LootParams; -import net.minecraft.world.level.storage.loot.LootTable; -import net.minecraft.world.level.storage.loot.parameters.LootContextParams; -import net.minecraft.world.phys.BlockHitResult; -import net.minecraft.world.phys.HitResult; -import net.minecraft.world.phys.shapes.BooleanOp; -import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -65,7 +46,7 @@ public EnderDrawerBlock() { registerDefaultState(defaultBlockState().setValue(RotatableBlock.FACING_HORIZONTAL, Direction.NORTH).setValue(LOCKED, false)); } - public static HashMap> FREQUENCY_LOOK = new HashMap<>(); + public static final HashMap> FREQUENCY_LOOK = new HashMap<>(); public static List getFrequencyDisplay(String string){ return FREQUENCY_LOOK.computeIfAbsent(string, s -> { @@ -74,18 +55,6 @@ public static List getFrequencyDisplay(String string){ }); } - @Override - protected void createBlockStateDefinition(StateDefinition.Builder p_206840_1_) { - super.createBlockStateDefinition(p_206840_1_); - p_206840_1_.add(LOCKED); - } - - @NotNull - @Override - public RotationType getRotationType() { - return RotationType.FOUR_WAY; - } - @Override public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { return (blockPos, state) -> new EnderDrawerTile(this, (BlockEntityType) FunctionalStorage.ENDER_DRAWER.type().get(),blockPos, state); @@ -104,84 +73,20 @@ private static List getShapes(BlockState state, BlockGetter source, return boxes; } - @Nonnull - @Override - public VoxelShape getCollisionShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext selectionContext) { - return Shapes.box(0, 0, 0, 1,1,1); - } - - @Override - public boolean hasCustomBoxes(BlockState state, BlockGetter source, BlockPos pos) { - return true; - } - - @Override - public boolean hasIndividualRenderVoxelShape() { - return true; - } - - @Override - public InteractionResult use(BlockState state, Level worldIn, BlockPos pos, Player player, InteractionHand hand, BlockHitResult ray) { - return TileUtil.getTileEntity(worldIn, pos, EnderDrawerTile.class).map(drawerTile -> drawerTile.onSlotActivated(player, hand, ray.getDirection(), ray.getLocation().x, ray.getLocation().y, ray.getLocation().z, getHit(state, worldIn, pos, player))).orElse(InteractionResult.PASS); - } - @Override public Collection getHitShapes(BlockState state) { return DrawerBlock.CACHED_SHAPES.get(FunctionalStorage.DrawerType.X_1).get(state.getValue(RotatableBlock.FACING_HORIZONTAL)); } - public int getHit(BlockState state, Level worldIn, BlockPos pos, Player player) { - HitResult result = RayTraceUtils.rayTraceSimple(worldIn, player, 32, 0); - if (result instanceof BlockHitResult) { - VoxelShape hit = RayTraceUtils.rayTraceVoxelShape((BlockHitResult) result, worldIn, player, 32, 0); - if (hit != null) { - if (hit.equals(Shapes.block())) return -1; - List shapes = new ArrayList<>(DrawerBlock.CACHED_SHAPES.get(FunctionalStorage.DrawerType.X_1).get(state.getValue(RotatableBlock.FACING_HORIZONTAL))); - for (int i = 0; i < shapes.size(); i++) { - if (Shapes.joinIsNotEmpty(shapes.get(i), hit, BooleanOp.AND)) { - return i; - } - } - } - } - return -1; - } - - @Override - public LootTable.Builder getLootTable(@Nonnull BasicBlockLootTables blockLootTables) { - //CopyNbtFunction.Builder nbtBuilder = CopyNbtFunction.copyData(ContextNbtProvider.BLOCK_ENTITY); - //nbtBuilder.copy("frequency", "BlockEntityTag.frequency"); - return blockLootTables.droppingNothing(); - } - - @Override - public List getDrops(BlockState p_60537_, LootParams.Builder builder) { - NonNullList stacks = NonNullList.create(); - ItemStack stack = new ItemStack(this); - BlockEntity drawerTile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); - if (drawerTile instanceof EnderDrawerTile tile) { - if (!tile.isEverythingEmpty()) { - stack.setData(FSAttachments.TILE, drawerTile.saveWithoutMetadata()); - } - } - stacks.add(stack); - return stacks; - } - @Override - public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @Nullable LivingEntity p_49850_, ItemStack stack) { - super.setPlacedBy(level, pos, p_49849_, p_49850_, stack); - if (level.getBlockEntity(pos) instanceof ControllableDrawerTile tile) { - if (stack.hasData(FSAttachments.TILE)) { - tile.load(stack.getData(FSAttachments.TILE)); - tile.markForUpdate(); - } + protected void copyTo(EnderDrawerTile tile, ItemStack stack) { + if (!tile.isEverythingEmpty()) { + stack.setData(FSAttachments.TILE, tile.saveWithoutMetadata()); } } @Override - public NonNullList getDynamicDrops(BlockState state, Level worldIn, BlockPos pos, BlockState newState, boolean isMoving) { - return NonNullList.create(); + protected void configure(LivingEntity player, EnderDrawerTile tile) { } @Override @@ -201,7 +106,6 @@ public void onRemove(BlockState state, Level worldIn, BlockPos pos, BlockState n @Override public void appendHoverText(ItemStack p_49816_, @Nullable BlockGetter p_49817_, List tooltip, TooltipFlag p_49819_) { - super.appendHoverText(p_49816_, p_49817_, tooltip, p_49819_); if (p_49816_.hasData(FSAttachments.TILE)) { MutableComponent text = Component.translatable("linkingtool.ender.frequency"); tooltip.add(text.withStyle(ChatFormatting.GRAY)); @@ -211,18 +115,4 @@ public void appendHoverText(ItemStack p_49816_, @Nullable BlockGetter p_49817_, } - @Override - public boolean canConnectRedstone(BlockState state, BlockGetter level, BlockPos pos, @Nullable Direction direction) { - return true; - } - - @Override - public boolean isSignalSource(BlockState p_60571_) { - return true; - } - - @Override - public int getSignal(BlockState p_60483_, BlockGetter blockGetter, BlockPos blockPos, Direction p_60486_) { - return DrawerBlock.getSignal(blockGetter, blockPos); - } } diff --git a/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java index 099b3cc0..e2732626 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java @@ -79,19 +79,6 @@ private static List getShapes(BlockState state, BlockGetter source, boxes.add(total); return boxes; } - - @Override - protected void createBlockStateDefinition(StateDefinition.Builder p_206840_1_) { - super.createBlockStateDefinition(p_206840_1_); - p_206840_1_.add(DrawerBlock.LOCKED); - } - - @NotNull - @Override - public RotationType getRotationType() { - return RotationType.FOUR_WAY; - } - @Override public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { return (blockPos, state) -> { @@ -111,109 +98,11 @@ public List getBoundingBoxes(BlockState state, BlockGetter source, B return getShapes(state, source, pos, this.type); } - @Nonnull - @Override - public VoxelShape getCollisionShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext selectionContext) { - return Shapes.box(0, 0, 0, 1, 1, 1); - } - - @Override - public boolean hasCustomBoxes(BlockState state, BlockGetter source, BlockPos pos) { - return true; - } - - @Override - public boolean hasIndividualRenderVoxelShape() { - return true; - } - - @Override - public InteractionResult use(BlockState state, Level worldIn, BlockPos pos, Player player, InteractionHand hand, BlockHitResult ray) { - return TileUtil.getTileEntity(worldIn, pos, FluidDrawerTile.class).map(drawerTile -> drawerTile.onSlotActivated(player, hand, ray.getDirection(), ray.getLocation().x, ray.getLocation().y, ray.getLocation().z, getHit(state, worldIn, pos, player))).orElse(InteractionResult.PASS); - } - @Override public Collection getHitShapes(BlockState state) { return DrawerBlock.CACHED_SHAPES.get(type).get(state.getValue(RotatableBlock.FACING_HORIZONTAL)); } - public int getHit(BlockState state, Level worldIn, BlockPos pos, Player player) { - HitResult result = RayTraceUtils.rayTraceSimple(worldIn, player, 32, 0); - if (result instanceof BlockHitResult) { - VoxelShape hit = RayTraceUtils.rayTraceVoxelShape((BlockHitResult) result, worldIn, player, 32, 0); - if (hit != null) { - if (hit.equals(Shapes.block())) return -1; - List shapes = new ArrayList<>(); - shapes.addAll(DrawerBlock.CACHED_SHAPES.get(type).get(state.getValue(RotatableBlock.FACING_HORIZONTAL))); - for (int i = 0; i < shapes.size(); i++) { - if (Shapes.joinIsNotEmpty(shapes.get(i), hit, BooleanOp.AND)) { - return i; - } - } - } - } - return -1; - } - - @Override - public LootTable.Builder getLootTable(@Nonnull BasicBlockLootTables blockLootTables) { - //CopyNbtFunction.Builder nbtBuilder = CopyNbtFunction.copyData(ContextNbtProvider.BLOCK_ENTITY); - //nbtBuilder.copy("handler", "BlockEntityTag.handler"); - //nbtBuilder.copy("storageUpgrades", "BlockEntityTag.storageUpgrades"); - //nbtBuilder.copy("utilityUpgrades", "BlockEntityTag.utilityUpgrades"); - //return blockLootTables.droppingSelfWithNbt(this, nbtBuilder); - return blockLootTables.droppingNothing(); - } - - - @Override - public List getDrops(BlockState p_60537_, LootParams.Builder builder) { - NonNullList stacks = NonNullList.create(); - ItemStack stack = new ItemStack(this); - BlockEntity drawerTile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); - if (drawerTile instanceof FluidDrawerTile tile) { - if (!tile.isEverythingEmpty()) { - stack.setData(FSAttachments.TILE, drawerTile.saveWithoutMetadata()); - } - if (tile.isLocked()) { - stack.setData(FSAttachments.LOCKED, tile.isLocked()); - } - } - stacks.add(stack); - return stacks; - } - - @Override - public NonNullList getDynamicDrops(BlockState state, Level worldIn, BlockPos pos, BlockState newState, boolean isMoving) { - return NonNullList.create(); - } - - @Override - public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @Nullable LivingEntity p_49850_, ItemStack stack) { - super.setPlacedBy(level, pos, p_49849_, p_49850_, stack); - if (level.getBlockEntity(pos) instanceof ControllableDrawerTile tile) { - tile.setLocked(stack.getData(FSAttachments.LOCKED)); - if (stack.hasData(FSAttachments.TILE)) { - tile.load(stack.getData(FSAttachments.TILE)); - tile.markForUpdate(); - } - } - BlockEntity entity = level.getBlockEntity(pos); - var offhand = p_49850_.getOffhandItem(); - if (offhand.is(FunctionalStorage.CONFIGURATION_TOOL.get())) { - var action = ConfigurationToolItem.getAction(offhand); - if (entity instanceof ControllableDrawerTile tile) { - if (action == ConfigurationToolItem.ConfigurationAction.LOCKING) { - tile.setLocked(true); - } else if (action.getMax() == 1) { - tile.getDrawerOptions().setActive(action, false); - } else { - tile.getDrawerOptions().setAdvancedValue(action, 1); - } - } - } - } - @Override public void registerRecipe(RecipeOutput consumer) { if (type == FunctionalStorage.DrawerType.X_1) { @@ -243,23 +132,8 @@ public FunctionalStorage.DrawerType getType() { return type; } - @Override - public void onRemove(BlockState state, Level worldIn, BlockPos pos, BlockState newState, boolean isMoving) { - if (!state.is(newState.getBlock())) { - TileUtil.getTileEntity(worldIn, pos, FluidDrawerTile.class).ifPresent(tile -> { - if (tile.getControllerPos() != null) { - TileUtil.getTileEntity(worldIn, tile.getControllerPos(), StorageControllerTile.class).ifPresent(drawerControllerTile -> { - drawerControllerTile.addConnectedDrawers(LinkingToolItem.ActionMode.REMOVE, pos); - }); - } - }); - } - super.onRemove(state, worldIn, pos, newState, isMoving); - } - @Override public void appendHoverText(ItemStack itemStack, @Nullable BlockGetter p_49817_, List tooltip, TooltipFlag p_49819_) { - super.appendHoverText(itemStack, p_49817_, tooltip, p_49819_); if (itemStack.hasData(FSAttachments.TILE)) { var tileTag = itemStack.getData(FSAttachments.TILE).getCompound("fluidHandler"); tooltip.add(Component.translatable("drawer.block.contents").withStyle(ChatFormatting.GRAY)); @@ -271,16 +145,6 @@ public void appendHoverText(ItemStack itemStack, @Nullable BlockGetter p_49817_, } } - @Override - public boolean canConnectRedstone(BlockState state, BlockGetter level, BlockPos pos, @Nullable Direction direction) { - return true; - } - - @Override - public boolean isSignalSource(BlockState p_60571_) { - return true; - } - @Override public int getSignal(BlockState p_60483_, BlockGetter blockGetter, BlockPos blockPos, Direction p_60486_) { FluidDrawerTile tile = TileUtil.getTileEntity(blockGetter, blockPos, FluidDrawerTile.class).orElse(null); @@ -298,17 +162,4 @@ public int getSignal(BlockState p_60483_, BlockGetter blockGetter, BlockPos bloc return 0; } - public static class DrawerItem extends BlockItem { - - private FluidDrawerBlock drawerBlock; - - public DrawerItem(FluidDrawerBlock p_40565_, net.minecraft.world.item.Item.Properties p_40566_) { - super(p_40565_, p_40566_); - this.drawerBlock = p_40565_; - } - - public IItemHandler initCapabilities(ItemStack stack, @Nullable CompoundTag nbt) { - return new DrawerStackItemHandler(stack, this.drawerBlock.getType()); - } - } } diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedBlock.java new file mode 100644 index 00000000..b22e5555 --- /dev/null +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedBlock.java @@ -0,0 +1,4 @@ +package com.buuz135.functionalstorage.block; + +public interface FramedBlock { +} diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java index d4cbe389..2c4ad0e0 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java @@ -27,7 +27,7 @@ import java.util.List; -public class FramedControllerExtensionBlock extends StorageControllerExtensionBlock{ +public class FramedControllerExtensionBlock extends StorageControllerExtensionBlock { public FramedControllerExtensionBlock() { super("framed_controller_extension", Properties.ofFullCopy(Blocks.IRON_BLOCK).noOcclusion().isViewBlocking(((p_61036_, p_61037_, p_61038_) -> false)), FramedControllerExtensionTile.class); @@ -52,10 +52,8 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) ItemStack stack = new ItemStack(this); BlockEntity blockEntity = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); - if(blockEntity instanceof FramedControllerExtensionTile framedControllerExtensionTile) - { - if(framedControllerExtensionTile.getFramedDrawerModelData() != null) - { + if (blockEntity instanceof FramedControllerExtensionTile framedControllerExtensionTile) { + if (framedControllerExtensionTile.getFramedDrawerModelData() != null) { stack.setData(FSAttachments.STYLE, framedControllerExtensionTile.getFramedDrawerModelData().serializeNBT()); } } @@ -67,12 +65,9 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) @Override public ItemStack getCloneItemStack(BlockState state, HitResult target, LevelReader level, BlockPos pos, Player player) { BlockEntity blockEntity = level.getBlockEntity(pos); - if(blockEntity instanceof FramedControllerExtensionTile framedControllerExtensionTile) - { - if(framedControllerExtensionTile.getFramedDrawerModelData() != null) - { - if(!framedControllerExtensionTile.getFramedDrawerModelData().getDesign().isEmpty()) - { + if (blockEntity instanceof FramedControllerExtensionTile framedControllerExtensionTile) { + if (framedControllerExtensionTile.getFramedDrawerModelData() != null) { + if (!framedControllerExtensionTile.getFramedDrawerModelData().getDesign().isEmpty()) { ItemStack stack = new ItemStack(this); stack.setData(FSAttachments.STYLE, framedControllerExtensionTile.getFramedDrawerModelData().serializeNBT()); return stack; diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java index 626934f4..a9594fdf 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java @@ -1,6 +1,8 @@ package com.buuz135.functionalstorage.block; import com.buuz135.functionalstorage.FunctionalStorage; +import com.buuz135.functionalstorage.block.tile.CompactingDrawerTile; +import com.buuz135.functionalstorage.block.tile.CompactingFramedDrawerTile; import com.buuz135.functionalstorage.block.tile.DrawerTile; import com.buuz135.functionalstorage.block.tile.FramedDrawerTile; import com.buuz135.functionalstorage.client.model.FramedDrawerModelData; @@ -40,7 +42,7 @@ import java.util.HashMap; import java.util.List; -public class FramedDrawerBlock extends DrawerBlock{ +public class FramedDrawerBlock extends DrawerBlock implements FramedBlock { public FramedDrawerBlock(FunctionalStorage.DrawerType type) { super(DrawerWoodType.FRAMED, type, Properties.ofFullCopy(Blocks.OAK_PLANKS).noOcclusion().isViewBlocking((p_61036_, p_61037_, p_61038_) -> false)); @@ -51,14 +53,6 @@ public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { return (blockPos, state) -> new FramedDrawerTile(this, (BlockEntityType) FunctionalStorage.DRAWER_TYPES.get(this.getType()).stream().filter(registryObjectRegistryObjectPair -> registryObjectRegistryObjectPair.getBlock() == this).map(BlockWithTile::type).findFirst().get().get(), blockPos, state, this.getType()); } - @Override - public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @Nullable LivingEntity p_49850_, ItemStack stack) { - super.setPlacedBy(level, pos, p_49849_, p_49850_, stack); - TileUtil.getTileEntity(level, pos, FramedDrawerTile.class).ifPresent(framedDrawerTile -> { - framedDrawerTile.setFramedDrawerModelData(getDrawerModelData(stack)); - }); - } - public static FramedDrawerModelData getDrawerModelData(ItemStack stack){ if (stack.hasData(FSAttachments.STYLE)){ CompoundTag tag = stack.getData(FSAttachments.STYLE); @@ -88,37 +82,6 @@ public static ItemStack fill(ItemStack first, ItemStack second, ItemStack drawer return drawer; } - @Override - public List getDrops(BlockState p_60537_, LootParams.Builder builder) { - NonNullList stacks = NonNullList.create(); - ItemStack stack = new ItemStack(this); - BlockEntity drawerTile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); - if (drawerTile instanceof FramedDrawerTile framedDrawerTile) { - if (framedDrawerTile.getFramedDrawerModelData() != null) { - stack.setData(FSAttachments.STYLE, framedDrawerTile.getFramedDrawerModelData().serializeNBT()); - } - if (!framedDrawerTile.isEverythingEmpty()) { - stack.setData(FSAttachments.TILE, framedDrawerTile.saveWithoutMetadata()); - } - if (framedDrawerTile.isLocked()) { - stack.setData(FSAttachments.LOCKED, framedDrawerTile.isLocked()); - } - } - stacks.add(stack); - return stacks; - } - - @Override - public ItemStack getCloneItemStack(BlockState state, HitResult target, LevelReader level, BlockPos pos, Player player) { - BlockEntity entity = level.getBlockEntity(pos); - if (entity instanceof FramedDrawerTile framedDrawerTile && framedDrawerTile.getFramedDrawerModelData() != null && !framedDrawerTile.getFramedDrawerModelData().getDesign().isEmpty()){ - ItemStack stack = new ItemStack(this); - stack.setData(FSAttachments.STYLE, framedDrawerTile.getFramedDrawerModelData().serializeNBT()); - return stack; - } - return super.getCloneItemStack(state, target, level, pos, player); - } - @Override public void registerRecipe(RecipeOutput consumer) { if (this.getType() == FunctionalStorage.DrawerType.X_1) { @@ -146,9 +109,4 @@ public void registerRecipe(RecipeOutput consumer) { } } - @Override - public void appendHoverText(ItemStack p_49816_, @Nullable BlockGetter p_49817_, List components, TooltipFlag p_49819_) { - components.add(Component.translatable("frameddrawer.use").withStyle(ChatFormatting.GRAY)); - super.appendHoverText(p_49816_, p_49817_, components, p_49819_); - } } diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedSimpleCompactingDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedSimpleCompactingDrawerBlock.java index 1a2aed45..66a56028 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedSimpleCompactingDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedSimpleCompactingDrawerBlock.java @@ -3,36 +3,15 @@ import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.block.tile.FramedSimpleCompactingDrawerTile; import com.buuz135.functionalstorage.block.tile.SimpleCompactingDrawerTile; -import com.buuz135.functionalstorage.item.FSAttachments; import com.buuz135.functionalstorage.util.StorageTags; import com.hrznstudio.titanium.recipe.generator.TitaniumShapedRecipeBuilder; -import com.hrznstudio.titanium.util.TileUtil; -import net.minecraft.ChatFormatting; -import net.minecraft.core.BlockPos; -import net.minecraft.core.NonNullList; import net.minecraft.data.recipes.RecipeOutput; -import net.minecraft.network.chat.Component; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; -import net.minecraft.world.item.TooltipFlag; -import net.minecraft.world.level.BlockGetter; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.storage.loot.LootParams; -import net.minecraft.world.level.storage.loot.parameters.LootContextParams; -import net.minecraft.world.phys.HitResult; import net.neoforged.neoforge.common.Tags; -import org.jetbrains.annotations.Nullable; -import java.util.List; - -public class FramedSimpleCompactingDrawerBlock extends SimpleCompactingDrawerBlock { +public class FramedSimpleCompactingDrawerBlock extends SimpleCompactingDrawerBlock implements FramedBlock { public FramedSimpleCompactingDrawerBlock(String name) { super(name, Properties.ofFullCopy(Blocks.STONE).noOcclusion().isViewBlocking((p_61036_, p_61037_, p_61038_) -> false)); } @@ -42,46 +21,6 @@ public BlockEntityType.BlockEntitySupplier getTileEn return (blockPos, state) -> new FramedSimpleCompactingDrawerTile(this, (BlockEntityType) FunctionalStorage.FRAMED_SIMPLE_COMPACTING_DRAWER.type().get(), blockPos, state); } - @Override - public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @Nullable LivingEntity p_49850_, ItemStack stack) { - super.setPlacedBy(level, pos, p_49849_, p_49850_, stack); - TileUtil.getTileEntity(level, pos, FramedSimpleCompactingDrawerTile.class).ifPresent(framedDrawerTile -> { - framedDrawerTile.setFramedDrawerModelData(FramedDrawerBlock.getDrawerModelData(stack)); - }); - } - - - @Override - public List getDrops(BlockState p_60537_, LootParams.Builder builder) { - NonNullList stacks = NonNullList.create(); - ItemStack stack = new ItemStack(this); - BlockEntity drawerTile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); - if (drawerTile instanceof FramedSimpleCompactingDrawerTile framedDrawerTile) { - if (!framedDrawerTile.isEverythingEmpty()) { - stack.setData(FSAttachments.TILE, drawerTile.saveWithoutMetadata()); - } - if (framedDrawerTile.isLocked()) { - stack.setData(FSAttachments.LOCKED, framedDrawerTile.isLocked()); - } - if (framedDrawerTile.getFramedDrawerModelData() != null) { - stack.setData(FSAttachments.STYLE, framedDrawerTile.getFramedDrawerModelData().serializeNBT()); - } - } - stacks.add(stack); - return stacks; - } - - @Override - public ItemStack getCloneItemStack(BlockState state, HitResult target, LevelReader level, BlockPos pos, Player player) { - BlockEntity entity = level.getBlockEntity(pos); - if (entity instanceof FramedSimpleCompactingDrawerTile framedDrawerTile && framedDrawerTile.getFramedDrawerModelData() != null && !framedDrawerTile.getFramedDrawerModelData().getDesign().isEmpty()) { - ItemStack stack = new ItemStack(this); - stack.setData(FSAttachments.STYLE, framedDrawerTile.getFramedDrawerModelData().serializeNBT()); - return stack; - } - return super.getCloneItemStack(state, target, level, pos, player); - } - @Override public void registerRecipe(RecipeOutput consumer) { TitaniumShapedRecipeBuilder.shapedRecipe(this) @@ -93,9 +32,5 @@ public void registerRecipe(RecipeOutput consumer) { .save(consumer); } - @Override - public void appendHoverText(ItemStack p_49816_, @Nullable BlockGetter p_49817_, List components, TooltipFlag p_49819_) { - components.add(Component.translatable("frameddrawer.use").withStyle(ChatFormatting.GRAY)); - super.appendHoverText(p_49816_, p_49817_, components, p_49819_); - } + } diff --git a/src/main/java/com/buuz135/functionalstorage/block/SimpleCompactingDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/SimpleCompactingDrawerBlock.java index dab83425..88b243fc 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/SimpleCompactingDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/SimpleCompactingDrawerBlock.java @@ -1,52 +1,21 @@ package com.buuz135.functionalstorage.block; import com.buuz135.functionalstorage.FunctionalStorage; -import com.buuz135.functionalstorage.block.tile.ControllableDrawerTile; import com.buuz135.functionalstorage.block.tile.SimpleCompactingDrawerTile; -import com.buuz135.functionalstorage.block.tile.StorageControllerTile; -import com.buuz135.functionalstorage.item.ConfigurationToolItem; -import com.buuz135.functionalstorage.item.FSAttachments; -import com.buuz135.functionalstorage.item.LinkingToolItem; import com.buuz135.functionalstorage.util.StorageTags; import com.hrznstudio.titanium.block.RotatableBlock; -import com.hrznstudio.titanium.datagenerator.loot.block.BasicBlockLootTables; import com.hrznstudio.titanium.recipe.generator.TitaniumShapedRecipeBuilder; -import com.hrznstudio.titanium.util.RayTraceUtils; -import com.hrznstudio.titanium.util.TileUtil; -import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; -import net.minecraft.core.NonNullList; import net.minecraft.data.recipes.RecipeOutput; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResult; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.BlockGetter; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.block.state.StateDefinition; -import net.minecraft.world.level.storage.loot.LootParams; -import net.minecraft.world.level.storage.loot.LootTable; -import net.minecraft.world.level.storage.loot.parameters.LootContextParams; -import net.minecraft.world.phys.BlockHitResult; -import net.minecraft.world.phys.HitResult; -import net.minecraft.world.phys.shapes.BooleanOp; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; import net.neoforged.neoforge.common.Tags; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import javax.annotation.Nonnull; import java.util.ArrayList; @@ -55,7 +24,6 @@ public class SimpleCompactingDrawerBlock extends Drawer { - public SimpleCompactingDrawerBlock(String name, Properties properties) { super(name, properties, SimpleCompactingDrawerTile.class); setItemGroup(FunctionalStorage.TAB); @@ -70,12 +38,6 @@ private static List getShapes(BlockState state, BlockGetter source, return boxes; } - @NotNull - @Override - public RotationType getRotationType() { - return RotationType.FOUR_WAY; - } - @Override public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { return (blockPos, state) -> new SimpleCompactingDrawerTile(this, (BlockEntityType) FunctionalStorage.SIMPLE_COMPACTING_DRAWER.type().get(), blockPos, state); @@ -86,114 +48,11 @@ public List getBoundingBoxes(BlockState state, BlockGetter source, B return getShapes(state, source, pos); } - @Override - protected void createBlockStateDefinition(StateDefinition.Builder p_206840_1_) { - super.createBlockStateDefinition(p_206840_1_); - p_206840_1_.add(DrawerBlock.LOCKED); - } - - @Nonnull - @Override - public VoxelShape getCollisionShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext selectionContext) { - return Shapes.box(0, 0, 0, 1, 1, 1); - } - - @Override - public boolean hasCustomBoxes(BlockState state, BlockGetter source, BlockPos pos) { - return true; - } - - @Override - public boolean hasIndividualRenderVoxelShape() { - return true; - } - - @Override - public InteractionResult use(BlockState state, Level worldIn, BlockPos pos, Player player, InteractionHand hand, BlockHitResult ray) { - return TileUtil.getTileEntity(worldIn, pos, SimpleCompactingDrawerTile.class).map(drawerTile -> drawerTile.onSlotActivated(player, hand, ray.getDirection(), ray.getLocation().x, ray.getLocation().y, ray.getLocation().z, getHit(state, worldIn, pos, player))).orElse(InteractionResult.PASS); - } - @Override public Collection getHitShapes(BlockState state) { return DrawerBlock.CACHED_SHAPES.get(FunctionalStorage.DrawerType.X_2).get(state.getValue(RotatableBlock.FACING_HORIZONTAL)); } - public int getHit(BlockState state, Level worldIn, BlockPos pos, Player player) { - HitResult result = RayTraceUtils.rayTraceSimple(worldIn, player, 32, 0); - if (result instanceof BlockHitResult) { - VoxelShape hit = RayTraceUtils.rayTraceVoxelShape((BlockHitResult) result, worldIn, player, 32, 0); - if (hit != null) { - if (hit.equals(Shapes.block())) return -1; - List shapes = new ArrayList<>(DrawerBlock.CACHED_SHAPES.get(FunctionalStorage.DrawerType.X_2).get(state.getValue(RotatableBlock.FACING_HORIZONTAL))); - for (int i = 0; i < shapes.size(); i++) { - if (Shapes.joinIsNotEmpty(shapes.get(i), hit, BooleanOp.AND)) { - return i; - } - } - } - } - return -1; - } - - @Override - public LootTable.Builder getLootTable(@Nonnull BasicBlockLootTables blockLootTables) { - //CopyNbtFunction.Builder nbtBuilder = CopyNbtFunction.copyData(ContextNbtProvider.BLOCK_ENTITY); - //nbtBuilder.copy("handler", "BlockEntityTag.handler"); - //nbtBuilder.copy("storageUpgrades", "BlockEntityTag.storageUpgrades"); - //nbtBuilder.copy("utilityUpgrades", "BlockEntityTag.utilityUpgrades"); - //return blockLootTables.droppingSelfWithNbt(this, nbtBuilder); - return blockLootTables.droppingNothing(); - } - - - @Override - public List getDrops(BlockState p_60537_, LootParams.Builder builder) { - NonNullList stacks = NonNullList.create(); - ItemStack stack = new ItemStack(this); - BlockEntity drawerTile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); - if (drawerTile instanceof ControllableDrawerTile tile) { - if (!tile.isEverythingEmpty()) { - stack.setData(FSAttachments.TILE, drawerTile.saveWithoutMetadata()); - } - if (tile.isLocked()) { - stack.setData(FSAttachments.LOCKED, tile.isLocked()); - } - } - stacks.add(stack); - return stacks; - } - - @Override - public NonNullList getDynamicDrops(BlockState state, Level worldIn, BlockPos pos, BlockState newState, boolean isMoving) { - return NonNullList.create(); - } - - @Override - public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @Nullable LivingEntity p_49850_, ItemStack stack) { - super.setPlacedBy(level, pos, p_49849_, p_49850_, stack); - BlockEntity entity = level.getBlockEntity(pos); - if (entity instanceof ControllableDrawerTile tile) { - tile.setLocked(stack.getData(FSAttachments.LOCKED)); - if (stack.hasData(FSAttachments.TILE)) { - entity.load(stack.getData(FSAttachments.TILE)); - tile.markForUpdate(); - } - } - var offhand = p_49850_.getOffhandItem(); - if (offhand.is(FunctionalStorage.CONFIGURATION_TOOL.get())) { - var action = ConfigurationToolItem.getAction(offhand); - if (entity instanceof ControllableDrawerTile tile) { - if (action == ConfigurationToolItem.ConfigurationAction.LOCKING) { - tile.setLocked(true); - } else if (action.getMax() == 1) { - tile.getDrawerOptions().setActive(action, false); - } else { - tile.getDrawerOptions().setAdvancedValue(action, 1); - } - } - } - } - @Override public void registerRecipe(RecipeOutput consumer) { TitaniumShapedRecipeBuilder.shapedRecipe(this) @@ -204,45 +63,4 @@ public void registerRecipe(RecipeOutput consumer) { .define('I', Tags.Items.INGOTS_IRON) .save(consumer); } - - @Override - public void onRemove(BlockState state, Level worldIn, BlockPos pos, BlockState newState, boolean isMoving) { - if (!state.is(newState.getBlock())) { - TileUtil.getTileEntity(worldIn, pos, SimpleCompactingDrawerTile.class).ifPresent(tile -> { - if (tile.getControllerPos() != null) { - TileUtil.getTileEntity(worldIn, tile.getControllerPos(), StorageControllerTile.class).ifPresent(drawerControllerTile -> { - drawerControllerTile.addConnectedDrawers(LinkingToolItem.ActionMode.REMOVE, pos); - }); - } - }); - } - super.onRemove(state, worldIn, pos, newState, isMoving); - } - - - @Override - public boolean canConnectRedstone(BlockState state, BlockGetter level, BlockPos pos, @Nullable Direction direction) { - return true; - } - - @Override - public boolean isSignalSource(BlockState p_60571_) { - return true; - } - - @Override - public int getSignal(BlockState p_60483_, BlockGetter blockGetter, BlockPos blockPos, Direction p_60486_) { - return DrawerBlock.getSignal(blockGetter, blockPos); - } - - @Override - public void appendHoverText(ItemStack p_49816_, @Nullable BlockGetter p_49817_, List tooltip, TooltipFlag p_49819_) { - super.appendHoverText(p_49816_, p_49817_, tooltip, p_49819_); - if (p_49816_.hasData(FSAttachments.TILE)) { - MutableComponent text = Component.translatable("drawer.block.contents"); - tooltip.add(text.withStyle(ChatFormatting.GRAY)); - tooltip.add(Component.literal("")); - tooltip.add(Component.literal("")); - } - } } diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingFramedDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingFramedDrawerTile.java index bc0ea7a7..ca343cfb 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingFramedDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingFramedDrawerTile.java @@ -10,7 +10,7 @@ import javax.annotation.Nonnull; import java.util.HashMap; -public class CompactingFramedDrawerTile extends CompactingDrawerTile{ +public class CompactingFramedDrawerTile extends CompactingDrawerTile implements FramedTile { @Save private FramedDrawerModelData framedDrawerModelData; diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/FramedControllerExtensionTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/FramedControllerExtensionTile.java index abf54433..c48a8795 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/FramedControllerExtensionTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/FramedControllerExtensionTile.java @@ -11,7 +11,7 @@ import java.util.HashMap; -public class FramedControllerExtensionTile extends StorageControllerExtensionTile{ +public class FramedControllerExtensionTile extends StorageControllerExtensionTile implements FramedTile { @Save private FramedDrawerModelData framedDrawerModelData; diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/FramedDrawerControllerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/FramedDrawerControllerTile.java index 611d591b..7d9b448c 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/FramedDrawerControllerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/FramedDrawerControllerTile.java @@ -11,7 +11,7 @@ import java.util.HashMap; -public class FramedDrawerControllerTile extends StorageControllerTile { +public class FramedDrawerControllerTile extends StorageControllerTile implements FramedTile { @Save private FramedDrawerModelData framedDrawerModelData; diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/FramedDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/FramedDrawerTile.java index 8afbd20a..7a0f93c2 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/FramedDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/FramedDrawerTile.java @@ -12,7 +12,7 @@ import javax.annotation.Nonnull; import java.util.HashMap; -public class FramedDrawerTile extends DrawerTile{ +public class FramedDrawerTile extends DrawerTile implements FramedTile { @Save private FramedDrawerModelData framedDrawerModelData; diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/FramedSimpleCompactingDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/FramedSimpleCompactingDrawerTile.java index 63ab5557..e9219829 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/FramedSimpleCompactingDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/FramedSimpleCompactingDrawerTile.java @@ -10,7 +10,7 @@ import javax.annotation.Nonnull; import java.util.HashMap; -public class FramedSimpleCompactingDrawerTile extends SimpleCompactingDrawerTile { +public class FramedSimpleCompactingDrawerTile extends SimpleCompactingDrawerTile implements FramedTile { @Save private FramedDrawerModelData framedDrawerModelData; diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/FramedTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/FramedTile.java new file mode 100644 index 00000000..ccb26dd9 --- /dev/null +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/FramedTile.java @@ -0,0 +1,9 @@ +package com.buuz135.functionalstorage.block.tile; + +import com.buuz135.functionalstorage.client.model.FramedDrawerModelData; + +public interface FramedTile { + FramedDrawerModelData getFramedDrawerModelData(); + + void setFramedDrawerModelData(FramedDrawerModelData framedDrawerModelData); +} From 4e241b934af008b9cad7669acce65f7320f86194 Mon Sep 17 00:00:00 2001 From: Matyrobbrt Date: Sun, 7 Apr 2024 18:09:58 +0300 Subject: [PATCH 05/20] Remove renderer duplication --- .../functionalstorage/FunctionalStorage.java | 8 ++ .../block/FramedControllerExtensionBlock.java | 2 +- .../block/FramedDrawerControllerBlock.java | 18 +-- .../block/tile/FluidDrawerTile.java | 2 +- .../client/BaseDrawerRenderer.java | 52 ++++++++ .../client/CompactingDrawerRenderer.java | 33 +---- .../client/DrawerRenderer.java | 32 +---- .../client/EnderDrawerRenderer.java | 59 +-------- .../client/FramedColors.java | 68 ++-------- .../SimpleCompactingDrawerRenderer.java | 30 +---- .../client/loader/FramedModel.java | 120 +++++++----------- .../client/model/FramedDrawerModelData.java | 2 +- .../item/StorageUpgradeItem.java | 2 +- .../functionalstorage/item/UpgradeItem.java | 4 +- .../util/ConnectedDrawers.java | 4 +- .../functionalstorage/util/NumberUtils.java | 2 +- .../functionalstorage/util/StorageTags.java | 4 +- 17 files changed, 141 insertions(+), 301 deletions(-) create mode 100644 src/main/java/com/buuz135/functionalstorage/client/BaseDrawerRenderer.java diff --git a/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java b/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java index 5e825f9e..d80556ef 100644 --- a/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java +++ b/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java @@ -9,6 +9,7 @@ import com.buuz135.functionalstorage.block.DrawerControllerBlock; import com.buuz135.functionalstorage.block.EnderDrawerBlock; import com.buuz135.functionalstorage.block.FluidDrawerBlock; +import com.buuz135.functionalstorage.block.FramedBlock; import com.buuz135.functionalstorage.block.FramedControllerExtensionBlock; import com.buuz135.functionalstorage.block.FramedDrawerBlock; import com.buuz135.functionalstorage.block.FramedDrawerControllerBlock; @@ -146,6 +147,7 @@ public class FunctionalStorage extends ModuleController { public static ConcurrentLinkedQueue WOOD_TYPES = new ConcurrentLinkedQueue<>(); public static HashMap> DRAWER_TYPES = new HashMap<>(); + public static List FRAMED_BLOCKS; public static BlockWithTile COMPACTING_DRAWER; public static BlockWithTile DRAWER_CONTROLLER; public static BlockWithTile ARMORY_CABINET; @@ -309,6 +311,12 @@ public boolean isFoil(ItemStack p_41453_) { } }); + FRAMED_BLOCKS = getRegistries().getRegistry(Registries.BLOCK) + .getEntries().stream() + .filter(bl -> bl.value() instanceof FramedBlock) + .map(Holder::value) + .toList(); + DrawerlessWoodIngredient.TYPE = getRegistries().registerGeneric(NeoForgeRegistries.Keys.INGREDIENT_TYPES, DrawerlessWoodIngredient.NAME.getPath(), () -> new IngredientType<>(DrawerlessWoodIngredient.CODEC)); diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java index 2c4ad0e0..09dd2620 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java @@ -27,7 +27,7 @@ import java.util.List; -public class FramedControllerExtensionBlock extends StorageControllerExtensionBlock { +public class FramedControllerExtensionBlock extends StorageControllerExtensionBlock implements FramedBlock { public FramedControllerExtensionBlock() { super("framed_controller_extension", Properties.ofFullCopy(Blocks.IRON_BLOCK).noOcclusion().isViewBlocking(((p_61036_, p_61037_, p_61038_) -> false)), FramedControllerExtensionTile.class); diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerControllerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerControllerBlock.java index ce873028..5e6e5296 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerControllerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerControllerBlock.java @@ -27,8 +27,7 @@ import java.util.List; -public class FramedDrawerControllerBlock extends StorageControllerBlock -{ +public class FramedDrawerControllerBlock extends StorageControllerBlock implements FramedBlock { public FramedDrawerControllerBlock() { super("framed_storage_controller", Properties.ofFullCopy(Blocks.IRON_BLOCK).noOcclusion().isViewBlocking(((p_61036_, p_61037_, p_61038_) -> false)), FramedDrawerControllerTile.class); } @@ -52,10 +51,8 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) ItemStack stack = new ItemStack(this); BlockEntity blockEntity = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); - if(blockEntity instanceof FramedDrawerControllerTile framedControllerTile) - { - if(framedControllerTile.getFramedDrawerModelData() != null) - { + if (blockEntity instanceof FramedDrawerControllerTile framedControllerTile) { + if (framedControllerTile.getFramedDrawerModelData() != null) { stack.setData(FSAttachments.STYLE, framedControllerTile.getFramedDrawerModelData().serializeNBT()); } } @@ -67,12 +64,9 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) @Override public ItemStack getCloneItemStack(BlockState state, HitResult target, LevelReader level, BlockPos pos, Player player) { BlockEntity blockEntity = level.getBlockEntity(pos); - if(blockEntity instanceof FramedDrawerControllerTile framedDrawerControllerTile) - { - if(framedDrawerControllerTile.getFramedDrawerModelData() != null) - { - if(!framedDrawerControllerTile.getFramedDrawerModelData().getDesign().isEmpty()) - { + if (blockEntity instanceof FramedDrawerControllerTile framedDrawerControllerTile) { + if (framedDrawerControllerTile.getFramedDrawerModelData() != null) { + if (!framedDrawerControllerTile.getFramedDrawerModelData().getDesign().isEmpty()) { ItemStack stack = new ItemStack(this); stack.setData(FSAttachments.STYLE, framedDrawerControllerTile.getFramedDrawerModelData().serializeNBT()); return stack; diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java index caf43bf5..e0ec8b7c 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java @@ -42,7 +42,7 @@ public class FluidDrawerTile extends ControllableDrawerTile { public static final GameProfile FP = new GameProfile(UUID.nameUUIDFromBytes("FunctionalStorage-Pickup".getBytes(StandardCharsets.UTF_8)), "FunctionalStorage-Pickp"); @Save public BigFluidHandler fluidHandler; - private FunctionalStorage.DrawerType type; + private final FunctionalStorage.DrawerType type; public FluidDrawerTile(BasicTileBlock base, BlockEntityType blockEntityType, BlockPos pos, BlockState state, FunctionalStorage.DrawerType type) { super(base, blockEntityType, pos, state); diff --git a/src/main/java/com/buuz135/functionalstorage/client/BaseDrawerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/BaseDrawerRenderer.java new file mode 100644 index 00000000..29cc1a70 --- /dev/null +++ b/src/main/java/com/buuz135/functionalstorage/client/BaseDrawerRenderer.java @@ -0,0 +1,52 @@ +package com.buuz135.functionalstorage.client; + +import com.buuz135.functionalstorage.block.tile.CompactingDrawerTile; +import com.buuz135.functionalstorage.block.tile.ControllableDrawerTile; +import com.mojang.blaze3d.vertex.PoseStack; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.LevelRenderer; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; +import net.minecraft.core.Direction; +import org.joml.Vector3f; + +import static com.buuz135.functionalstorage.util.MathUtils.createTransformMatrix; + +public abstract class BaseDrawerRenderer> implements BlockEntityRenderer { + @Override + public final void render(T tile, float partialTicks, PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) { + if (Minecraft.getInstance().player != null && !tile.getBlockPos().closerThan(Minecraft.getInstance().player.getOnPos(), FunctionalStorageClientConfig.DRAWER_RENDER_RANGE)){ + return; + } + matrixStack.pushPose(); + + Direction facing = tile.getFacingDirection(); + matrixStack.mulPoseMatrix(createTransformMatrix( + new Vector3f(0), new Vector3f(0, 180, 0), 1)); + + if (facing == Direction.NORTH) { + matrixStack.mulPoseMatrix(createTransformMatrix( + new Vector3f(-1, 0, 0), new Vector3f(0), 1)); + } + else if (facing == Direction.EAST) { + matrixStack.mulPoseMatrix(createTransformMatrix( + new Vector3f(-1, 0, -1), new Vector3f(0, -90, 0), 1)); + } + else if (facing == Direction.SOUTH) { + matrixStack.mulPoseMatrix(createTransformMatrix( + new Vector3f(0, 0, -1), new Vector3f(0, 180, 0), 1)); + } + else if (facing == Direction.WEST) { + matrixStack.mulPoseMatrix(createTransformMatrix( + new Vector3f(0, 0, 0), new Vector3f(0, 90, 0), 1)); + } + + matrixStack.translate(0,0,-0.5/16D); + combinedLightIn = LevelRenderer.getLightColor(tile.getLevel(), tile.getBlockPos().relative(facing)); + DrawerRenderer.renderUpgrades(matrixStack, bufferIn, combinedLightIn, combinedOverlayIn, tile); + + renderItems(tile, partialTicks, matrixStack, bufferIn, combinedLightIn, combinedOverlayIn); + } + + public abstract void renderItems(T tile, float partialTicks, PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn); +} diff --git a/src/main/java/com/buuz135/functionalstorage/client/CompactingDrawerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/CompactingDrawerRenderer.java index 3f572506..3d7969fa 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/CompactingDrawerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/CompactingDrawerRenderer.java @@ -14,39 +14,10 @@ import static com.buuz135.functionalstorage.util.MathUtils.createTransformMatrix; -public class CompactingDrawerRenderer implements BlockEntityRenderer { +public class CompactingDrawerRenderer extends BaseDrawerRenderer { @Override - public void render(CompactingDrawerTile tile, float partialTicks, PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) { - if (Minecraft.getInstance().player != null && !tile.getBlockPos().closerThan(Minecraft.getInstance().player.getOnPos(), FunctionalStorageClientConfig.DRAWER_RENDER_RANGE)){ - return; - } - matrixStack.pushPose(); - - Direction facing = tile.getFacingDirection(); - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(0), new Vector3f(0, 180, 0), 1)); - - if (facing == Direction.NORTH) { - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(-1, 0, 0), new Vector3f(0), 1)); - } - else if (facing == Direction.EAST) { - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(-1, 0, -1), new Vector3f(0, -90, 0), 1)); - } - else if (facing == Direction.SOUTH) { - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(0, 0, -1), new Vector3f(0, 180, 0), 1)); - } - else if (facing == Direction.WEST) { - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(0, 0, 0), new Vector3f(0, 90, 0), 1)); - } - - matrixStack.translate(0,0,-0.5/16D); - combinedLightIn = LevelRenderer.getLightColor(tile.getLevel(), tile.getBlockPos().relative(facing)); - DrawerRenderer.renderUpgrades(matrixStack, bufferIn, combinedLightIn, combinedOverlayIn, tile); + public void renderItems(CompactingDrawerTile tile, float partialTicks, PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) { ItemStack stack = tile.getHandler().getResultList().get(0).getResult(); if (!stack.isEmpty()){ matrixStack.pushPose(); diff --git a/src/main/java/com/buuz135/functionalstorage/client/DrawerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/DrawerRenderer.java index 64870fd6..95b0bf2b 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/DrawerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/DrawerRenderer.java @@ -31,38 +31,10 @@ import static com.buuz135.functionalstorage.util.MathUtils.createTransformMatrix; -public class DrawerRenderer implements BlockEntityRenderer { +public class DrawerRenderer extends BaseDrawerRenderer { @Override - public void render(DrawerTile tile, float partialTicks, PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) { - if (Minecraft.getInstance().player != null && !tile.getBlockPos().closerThan(Minecraft.getInstance().player.getOnPos(), FunctionalStorageClientConfig.DRAWER_RENDER_RANGE)){ - return; - } - matrixStack.pushPose(); - - Direction facing = tile.getFacingDirection(); - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(0), new Vector3f(0, 180, 0), 1)); - - if (facing == Direction.NORTH) { - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(-1, 0, 0), new Vector3f(0), 1)); - } - else if (facing == Direction.EAST) { - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(-1, 0, -1), new Vector3f(0, -90, 0), 1)); - } - else if (facing == Direction.SOUTH) { - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(0, 0, -1), new Vector3f(0, 180, 0), 1)); - } - else if (facing == Direction.WEST) { - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(0, 0, 0), new Vector3f(0, 90, 0), 1)); - } - matrixStack.translate(0,0,-0.5/16D); - combinedLightIn = LevelRenderer.getLightColor(tile.getLevel(), tile.getBlockPos().relative(facing)); - renderUpgrades(matrixStack, bufferIn, combinedLightIn, combinedOverlayIn, tile); + public final void renderItems(DrawerTile tile, float partialTicks, PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) { if (tile.getDrawerType() == FunctionalStorage.DrawerType.X_1) render1Slot(matrixStack, bufferIn, combinedLightIn, combinedOverlayIn, tile); if (tile.getDrawerType() == FunctionalStorage.DrawerType.X_2) render2Slot(matrixStack, bufferIn, combinedLightIn, combinedOverlayIn, tile); if (tile.getDrawerType() == FunctionalStorage.DrawerType.X_4) render4Slot(matrixStack, bufferIn, combinedLightIn, combinedOverlayIn, tile); diff --git a/src/main/java/com/buuz135/functionalstorage/client/EnderDrawerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/EnderDrawerRenderer.java index bbd9680f..358cb32a 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/EnderDrawerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/EnderDrawerRenderer.java @@ -20,69 +20,14 @@ import static com.buuz135.functionalstorage.util.MathUtils.createTransformMatrix; -public class EnderDrawerRenderer implements BlockEntityRenderer { +public class EnderDrawerRenderer extends BaseDrawerRenderer { @Override - public void render(EnderDrawerTile tile, float partialTicks, PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) { - if (Minecraft.getInstance().player != null && !tile.getBlockPos().closerThan(Minecraft.getInstance().player.getOnPos(), FunctionalStorageClientConfig.DRAWER_RENDER_RANGE)){ - return; - } - matrixStack.pushPose(); - - Direction facing = tile.getFacingDirection(); - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(0), new Vector3f(0, 180, 0), 1)); - - if (facing == Direction.NORTH) { - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(-1, 0, 0), new Vector3f(0), 1)); - } - else if (facing == Direction.EAST) { - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(-1, 0, -1), new Vector3f(0, -90, 0), 1)); - } - else if (facing == Direction.SOUTH) { - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(0, 0, -1), new Vector3f(0, 180, 0), 1)); - } - else if (facing == Direction.WEST) { - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(0, 0, 0), new Vector3f(0, 90, 0), 1)); - } - - matrixStack.translate(0,0,-0.5/16D); - combinedLightIn = LevelRenderer.getLightColor(tile.getLevel(), tile.getBlockPos().relative(facing)); - renderUpgrades(matrixStack, bufferIn, combinedLightIn, combinedOverlayIn, tile); + public void renderItems(EnderDrawerTile tile, float partialTicks, PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) { render1Slot(matrixStack, bufferIn, combinedLightIn, combinedOverlayIn, tile); matrixStack.popPose(); } - public static void renderUpgrades(PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn, ControllableDrawerTile tile){ - float scale = 0.0625f; - if (tile.getDrawerOptions().isActive(ConfigurationToolItem.ConfigurationAction.TOGGLE_UPGRADES)){ - matrixStack.pushPose(); - matrixStack.translate(0.031,0.031f,0.472/16D); - for (int i = 0; i < tile.getStorageUpgrades().getSlots(); i++) { - ItemStack stack = tile.getStorageUpgrades().getStackInSlot(i); - if (!stack.isEmpty()){ - matrixStack.pushPose(); - matrixStack.scale(scale, scale, scale); - Minecraft.getInstance().getItemRenderer().renderStatic(stack, ItemDisplayContext.NONE, combinedLightIn, combinedOverlayIn, matrixStack, bufferIn, tile.getLevel(), 0); - matrixStack.popPose(); - matrixStack.translate(scale,0,0); - } - } - matrixStack.popPose(); - } - if (tile.isVoid()){ - matrixStack.pushPose(); - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(.969f, .031f, .469f/16.0f), new Vector3f(0), scale)); - Minecraft.getInstance().getItemRenderer().renderStatic(new ItemStack(FunctionalStorage.VOID_UPGRADE.get()), ItemDisplayContext.NONE, combinedLightIn, combinedOverlayIn, matrixStack, bufferIn, tile.getLevel(), 0); - matrixStack.popPose(); - } - } - private void render1Slot(PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn, EnderDrawerTile tile){ EnderInventoryHandler inventoryHandler = EnderSavedData.getInstance(tile.getLevel()).getFrequency(tile.getFrequency()); if (!inventoryHandler.getStoredStacks().get(0).getStack().isEmpty()){ diff --git a/src/main/java/com/buuz135/functionalstorage/client/FramedColors.java b/src/main/java/com/buuz135/functionalstorage/client/FramedColors.java index fa863fc5..1549e5b6 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/FramedColors.java +++ b/src/main/java/com/buuz135/functionalstorage/client/FramedColors.java @@ -2,24 +2,20 @@ import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.block.CompactingFramedDrawerBlock; +import com.buuz135.functionalstorage.block.FramedBlock; import com.buuz135.functionalstorage.block.FramedDrawerBlock; import com.buuz135.functionalstorage.block.FramedDrawerControllerBlock; -import com.buuz135.functionalstorage.block.tile.FramedControllerExtensionTile; -import com.buuz135.functionalstorage.block.tile.FramedDrawerControllerTile; -import com.buuz135.functionalstorage.block.tile.FramedDrawerTile; +import com.buuz135.functionalstorage.block.tile.FramedTile; import com.buuz135.functionalstorage.client.model.FramedDrawerModelData; import net.minecraft.client.Minecraft; import net.minecraft.client.color.block.BlockColor; import net.minecraft.client.color.item.ItemColor; import net.minecraft.core.BlockPos; import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.BlockAndTintGetter; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.SubscribeEvent; @@ -35,8 +31,7 @@ public class FramedColors implements BlockColor, ItemColor { @Override public int getColor(BlockState state, @Nullable BlockAndTintGetter level, @Nullable BlockPos pos, int tintIndex) { if (level != null && pos != null && tintIndex == 0) { - BlockEntity entity = level.getBlockEntity(pos); - if (entity instanceof FramedDrawerTile tile) { + if (level.getBlockEntity(pos) instanceof FramedTile tile) { FramedDrawerModelData framedDrawerModelData = tile.getFramedDrawerModelData(); if (framedDrawerModelData != null) { for (Map.Entry entry: framedDrawerModelData.getDesign().entrySet()) { @@ -51,36 +46,6 @@ public int getColor(BlockState state, @Nullable BlockAndTintGetter level, @Nulla } } } - if (entity instanceof FramedDrawerControllerTile tile) { - FramedDrawerModelData framedDrawerModelData = tile.getFramedDrawerModelData(); - if (framedDrawerModelData != null) { - for (Map.Entry entry: framedDrawerModelData.getDesign().entrySet()) { - if (entry.getValue() instanceof BlockItem blockItem) { - if (BuiltInRegistries.ITEM.getKey(blockItem).getNamespace().equals(FunctionalStorage.MOD_ID)) - continue; - BlockState state1 = blockItem.getBlock().defaultBlockState(); - int color = Minecraft.getInstance().getBlockColors().getColor(state1, level, pos, tintIndex); - if (color != -1) - return color; - } - } - } - } - if (entity instanceof FramedControllerExtensionTile tile) { - FramedDrawerModelData framedDrawerModelData = tile.getFramedDrawerModelData(); - if (framedDrawerModelData != null) { - for (Map.Entry entry : framedDrawerModelData.getDesign().entrySet()) { - if (entry.getValue() instanceof BlockItem blockItem) { - if (BuiltInRegistries.ITEM.getKey(blockItem).getNamespace().equals(FunctionalStorage.MOD_ID)) - continue; - BlockState state1 = blockItem.getBlock().defaultBlockState(); - int color = Minecraft.getInstance().getBlockColors().getColor(state1, level, pos, tintIndex); - if (color != -1) - return color; - } - } - } - } } return 0xFFFFFF; } @@ -88,11 +53,11 @@ public int getColor(BlockState state, @Nullable BlockAndTintGetter level, @Nulla @Override public int getColor(ItemStack itemStack, int tintIndex) { if (tintIndex == 0) { - if (itemStack.getItem() instanceof BlockItem item && (item.getBlock() instanceof FramedDrawerBlock || item.getBlock() instanceof CompactingFramedDrawerBlock || item.getBlock() instanceof FramedDrawerControllerBlock)) { + if (itemStack.getItem() instanceof BlockItem item && item.getBlock() instanceof FramedBlock) { FramedDrawerModelData framedDrawerModelData = FramedDrawerBlock.getDrawerModelData(itemStack); if (framedDrawerModelData != null) { for (Map.Entry entry: framedDrawerModelData.getDesign().entrySet()) { - if (entry.getValue() instanceof BlockItem blockItem) { + if (entry.getValue() instanceof BlockItem) { int color = Minecraft.getInstance().getItemColors().getColor(itemStack, tintIndex); if (color != -1) return color; @@ -105,21 +70,14 @@ public int getColor(ItemStack itemStack, int tintIndex) { } @SubscribeEvent - public static void blockColors(RegisterColorHandlersEvent.Block event) { - Block block1 = BuiltInRegistries.BLOCK.get(new ResourceLocation(FunctionalStorage.MOD_ID, "framed_1")); - event.register(new FramedColors(), block1); - Block block2 = BuiltInRegistries.BLOCK.get(new ResourceLocation(FunctionalStorage.MOD_ID, "framed_2")); - event.register(new FramedColors(), block2); - Block block4 = BuiltInRegistries.BLOCK.get(new ResourceLocation(FunctionalStorage.MOD_ID, "framed_4")); - event.register(new FramedColors(), block4); - - Block block5 = BuiltInRegistries.BLOCK.get(new ResourceLocation(FunctionalStorage.MOD_ID, "compacting_framed_drawer")); - event.register(new FramedColors(), block5); - - Block controller = BuiltInRegistries.BLOCK.get(new ResourceLocation(FunctionalStorage.MOD_ID, "framed_storage_controller")); - event.register(new FramedColors(), controller); + static void blockColors(RegisterColorHandlersEvent.Block event) { + final var instance = new FramedColors(); + FunctionalStorage.FRAMED_BLOCKS.forEach(bl -> event.register(instance, bl)); + } - Block controllerExtension = BuiltInRegistries.BLOCK.get(new ResourceLocation(FunctionalStorage.MOD_ID, "framed_controller_extension")); - event.register(new FramedColors(), controllerExtension); + @SubscribeEvent + static void itemColors(RegisterColorHandlersEvent.Item event) { + final var instance = new FramedColors(); + FunctionalStorage.FRAMED_BLOCKS.forEach(bl -> event.register(instance, bl)); } } diff --git a/src/main/java/com/buuz135/functionalstorage/client/SimpleCompactingDrawerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/SimpleCompactingDrawerRenderer.java index 2fec5d00..6ad28ba3 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/SimpleCompactingDrawerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/SimpleCompactingDrawerRenderer.java @@ -12,36 +12,10 @@ import static com.buuz135.functionalstorage.util.MathUtils.createTransformMatrix; -public class SimpleCompactingDrawerRenderer implements BlockEntityRenderer { +public class SimpleCompactingDrawerRenderer extends BaseDrawerRenderer { @Override - public void render(SimpleCompactingDrawerTile tile, float partialTicks, PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) { - if (Minecraft.getInstance().player != null && !tile.getBlockPos().closerThan(Minecraft.getInstance().player.getOnPos(), FunctionalStorageClientConfig.DRAWER_RENDER_RANGE)) { - return; - } - matrixStack.pushPose(); - - Direction facing = tile.getFacingDirection(); - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(0), new Vector3f(0, 180, 0), 1)); - - if (facing == Direction.NORTH) { - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(-1, 0, 0), new Vector3f(0), 1)); - } else if (facing == Direction.EAST) { - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(-1, 0, -1), new Vector3f(0, -90, 0), 1)); - } else if (facing == Direction.SOUTH) { - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(0, 0, -1), new Vector3f(0, 180, 0), 1)); - } else if (facing == Direction.WEST) { - matrixStack.mulPoseMatrix(createTransformMatrix( - new Vector3f(0, 0, 0), new Vector3f(0, 90, 0), 1)); - } - - matrixStack.translate(0, 0, -0.5 / 16D); - combinedLightIn = LevelRenderer.getLightColor(tile.getLevel(), tile.getBlockPos().relative(facing)); - DrawerRenderer.renderUpgrades(matrixStack, bufferIn, combinedLightIn, combinedOverlayIn, tile); + public void renderItems(SimpleCompactingDrawerTile tile, float partialTicks, PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) { ItemStack stack = tile.getHandler().getResultList().get(0).getResult(); if (!stack.isEmpty()) { matrixStack.pushPose(); diff --git a/src/main/java/com/buuz135/functionalstorage/client/loader/FramedModel.java b/src/main/java/com/buuz135/functionalstorage/client/loader/FramedModel.java index cc2a23c8..14da172f 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/loader/FramedModel.java +++ b/src/main/java/com/buuz135/functionalstorage/client/loader/FramedModel.java @@ -65,8 +65,7 @@ public class FramedModel implements IUnbakedGeometry { private final ImmutableList itemPasses; private final boolean logWarning; - public FramedModel(ImmutableMap children, ImmutableList itemPasses) - { + public FramedModel(ImmutableMap children, ImmutableList itemPasses) { this(children, itemPasses, false); } @@ -115,13 +114,11 @@ public BakedModel bake(IGeometryBakingContext context, ModelBaker bakery, Functi } @Override - public Set getConfigurableComponentNames() - { + public Set getConfigurableComponentNames() { return children.keySet(); } - public class Baked implements IDynamicBakedModel - { + public class Baked implements IDynamicBakedModel { private final boolean isAmbientOcclusion; private final boolean isGui3d; private final boolean isSideLit; @@ -131,8 +128,7 @@ public class Baked implements IDynamicBakedModel private final ImmutableMap children; private final ImmutableList itemPasses; - public Baked(boolean isGui3d, boolean isSideLit, boolean isAmbientOcclusion, TextureAtlasSprite particle, ItemTransforms transforms, ItemOverrides overrides, ImmutableMap children, ImmutableList itemPasses) - { + public Baked(boolean isGui3d, boolean isSideLit, boolean isAmbientOcclusion, TextureAtlasSprite particle, ItemTransforms transforms, ItemOverrides overrides, ImmutableMap children, ImmutableList itemPasses) { this.children = children; this.isAmbientOcclusion = isAmbientOcclusion; this.isGui3d = isGui3d; @@ -145,13 +141,10 @@ public Baked(boolean isGui3d, boolean isSideLit, boolean isAmbientOcclusion, Tex @NotNull @Override - public List getQuads(@Nullable BlockState state, @Nullable Direction side, @NotNull RandomSource rand, @NotNull ModelData data, @Nullable RenderType renderType) - { + public List getQuads(@Nullable BlockState state, @Nullable Direction side, @NotNull RandomSource rand, @NotNull ModelData data, @Nullable RenderType renderType) { List> quadLists = new ArrayList<>(); - for (Map.Entry entry : children.entrySet()) - { - if (renderType == null || (state != null && entry.getValue().getRenderTypes(state, rand, data).contains(renderType))) - { + for (Map.Entry entry : children.entrySet()) { + if (renderType == null || (state != null && entry.getValue().getRenderTypes(state, rand, data).contains(renderType))) { FramedDrawerModelData framedDrawerModelData = data.get(FramedDrawerModelData.FRAMED_PROPERTY); List quads = entry.getValue().getQuads(state, side, rand, Data.resolve(data, entry.getKey()), renderType); if (framedDrawerModelData != null && framedDrawerModelData.getDesign().containsKey(entry.getKey())) { @@ -172,7 +165,7 @@ protected static List getQuadsUsingShape(@Nullable Item frameItem, Li Optional>> spriteOptional = getSpriteData(model, state1, side, rand, null, renderType); List returnQuads = new ArrayList<>(); for (BakedQuad shapeQuad : shape) { - List> spriteData = spriteOptional.orElse(getSpriteFromModel(shapeQuad, model, state1,null)); + List> spriteData = spriteOptional.orElse(getSpriteFromModel(shapeQuad, model, state1, null)); returnQuads.addAll(framedQuad(shapeQuad, spriteData, state1.getLightEmission(Minecraft.getInstance().level, BlockPos.ZERO))); } return returnQuads; @@ -185,14 +178,14 @@ private static Optional>> getSpr List positions = new ArrayList<>(); List> modelData = new ArrayList<>(); if (!quads.isEmpty()) { - for (BakedQuad bakedQuad: quads) { + for (BakedQuad bakedQuad : quads) { float[] position = unpackVertices(bakedQuad.getVertices(), 0, IQuadTransformer.POSITION, 3); positions.add(getPositionFromDirection(position, side)); } List index = getMinMaxPosition(positions, side); for (int i = 0; i < index.size(); i++) { int[] lights = new int[4]; - for (int j=0; j<4 ; j++) { + for (int j = 0; j < 4; j++) { lights[j] = quads.get(i).getVertices()[IQuadTransformer.UV2 + j * IQuadTransformer.STRIDE]; } int tint = quads.get(i).isTinted() ? Minecraft.getInstance().getBlockColors().getColor(state, Minecraft.getInstance().level, null, quads.get(i).getTintIndex()) : -1; @@ -204,7 +197,7 @@ private static Optional>> getSpr } private static float getPositionFromDirection(float[] position, Direction side) { - Vec3i normal = new Vec3i(0,0,0); + Vec3i normal = new Vec3i(0, 0, 0); if (side != null) { normal = side.getNormal(); } @@ -228,7 +221,7 @@ protected static List> getSpriteFromM List positions = new ArrayList<>(); List> modelData = new ArrayList<>(); if (!quads.isEmpty()) { - for (BakedQuad bakedQuad: quads) { + for (BakedQuad bakedQuad : quads) { float[] position = unpackVertices(bakedQuad.getVertices(), 0, IQuadTransformer.POSITION, 3); positions.add(getPositionFromDirection(position, shape.getDirection())); @@ -236,7 +229,7 @@ protected static List> getSpriteFromM List index = getMinMaxPosition(positions, shape.getDirection()); for (int i = 0; i < index.size(); i++) { int[] lights = new int[4]; - for (int j=0; j<4; j++) { + for (int j = 0; j < 4; j++) { lights[j] = quads.get(i).getVertices()[IQuadTransformer.UV2 + j * IQuadTransformer.STRIDE]; } int tint = quads.get(i).isTinted() ? Minecraft.getInstance().getBlockColors().getColor(state, Minecraft.getInstance().level, null, quads.get(i).getTintIndex()) : -1; @@ -244,7 +237,7 @@ protected static List> getSpriteFromM modelData.add(triple); } } - return quads.isEmpty() ? List.of(Triple.of(Minecraft.getInstance().getTextureAtlas(InventoryMenu.BLOCK_ATLAS).apply(MissingTextureAtlasSprite.getLocation()), -1, new int[] {0,0,0,0})) : modelData; + return quads.isEmpty() ? List.of(Triple.of(Minecraft.getInstance().getTextureAtlas(InventoryMenu.BLOCK_ATLAS).apply(MissingTextureAtlasSprite.getLocation()), -1, new int[] {0, 0, 0, 0})) : modelData; } protected static List framedQuad(BakedQuad toCopy, List> modelData, int lightEmission) { @@ -268,7 +261,7 @@ protected static List framedQuad(BakedQuad toCopy, List(); for (Map.Entry entry : children.entrySet()) sets.add(entry.getValue().getRenderTypes(state, rand, FramedModel.Data.resolve(data, entry.getKey()))); @@ -393,14 +378,12 @@ public ChunkRenderTypeSet getRenderTypes(@NotNull BlockState state, @NotNull Ran } @Override - public List getRenderPasses(ItemStack itemStack, boolean fabulous) - { + public List getRenderPasses(ItemStack itemStack, boolean fabulous) { return List.of(new ItemModel(this, itemStack)); } @Nullable - public BakedModel getPart(String name) - { + public BakedModel getPart(String name) { return children.get(name); } } @@ -408,20 +391,17 @@ public BakedModel getPart(String name) /** * A model data container which stores data for child components. */ - public static class Data - { + public static class Data { public static final ModelProperty PROPERTY = new ModelProperty<>(); private final Map partData; - private Data(Map partData) - { + private Data(Map partData) { this.partData = partData; } @Nullable - public ModelData get(String name) - { + public ModelData get(String name) { return partData.get(name); } @@ -432,8 +412,7 @@ public ModelData get(String name) * @param name The name of the part to get data for * @return The data for the part, or the one passed in if not found */ - public static ModelData resolve(ModelData modelData, String name) - { + public static ModelData resolve(ModelData modelData, String name) { var compositeData = modelData.get(PROPERTY); if (compositeData == null) return modelData; @@ -441,39 +420,32 @@ public static ModelData resolve(ModelData modelData, String name) return partData != null ? partData : modelData; } - public static FramedModel.Data.Builder builder() - { + public static FramedModel.Data.Builder builder() { return new FramedModel.Data.Builder(); } - public static final class Builder - { + public static final class Builder { private final Map partData = new IdentityHashMap<>(); - public FramedModel.Data.Builder with(String name, ModelData data) - { + public FramedModel.Data.Builder with(String name, ModelData data) { partData.put(name, data); return this; } - public FramedModel.Data build() - { + public FramedModel.Data build() { return new FramedModel.Data(partData); } } } - public static final class Loader implements IGeometryLoader - { + public static final class Loader implements IGeometryLoader { public static final FramedModel.Loader INSTANCE = new FramedModel.Loader(); - private Loader() - { + private Loader() { } @Override - public FramedModel read(JsonObject jsonObject, JsonDeserializationContext deserializationContext) - { + public FramedModel read(JsonObject jsonObject, JsonDeserializationContext deserializationContext) { List itemPasses = new ArrayList<>(); ImmutableMap.Builder childrenBuilder = ImmutableMap.builder(); readChildren(jsonObject, "children", deserializationContext, childrenBuilder, itemPasses, false); @@ -483,11 +455,9 @@ public FramedModel read(JsonObject jsonObject, JsonDeserializationContext deseri if (children.isEmpty()) throw new JsonParseException("Composite model requires a \"children\" element with at least one element."); - if (jsonObject.has("item_render_order")) - { + if (jsonObject.has("item_render_order")) { itemPasses.clear(); - for (var element : jsonObject.getAsJsonArray("item_render_order")) - { + for (var element : jsonObject.getAsJsonArray("item_render_order")) { var name = element.getAsString(); if (!children.containsKey(name)) throw new JsonParseException("Specified \"" + name + "\" in \"item_render_order\", but that is not a child of this model."); @@ -498,13 +468,11 @@ public FramedModel read(JsonObject jsonObject, JsonDeserializationContext deseri return new FramedModel(children, ImmutableList.copyOf(itemPasses), logWarning); } - private boolean readChildren(JsonObject jsonObject, String name, JsonDeserializationContext deserializationContext, ImmutableMap.Builder children, List itemPasses, boolean logWarning) - { + private boolean readChildren(JsonObject jsonObject, String name, JsonDeserializationContext deserializationContext, ImmutableMap.Builder children, List itemPasses, boolean logWarning) { if (!jsonObject.has(name)) return false; var childrenJsonObject = jsonObject.getAsJsonObject(name); - for (Map.Entry entry : childrenJsonObject.entrySet()) - { + for (Map.Entry entry : childrenJsonObject.entrySet()) { children.put(entry.getKey(), deserializationContext.deserialize(entry.getValue(), BlockModel.class)); itemPasses.add(entry.getKey()); // We can do this because GSON preserves ordering during deserialization } @@ -525,10 +493,8 @@ public ItemModel(Baked baked, ItemStack itemStack) { @Override public List getQuads(@Nullable BlockState state, @Nullable Direction side, RandomSource rand, ModelData extraData, @Nullable RenderType renderType) { List> quadLists = new ArrayList<>(); - for (Map.Entry entry : baked.children.entrySet()) - { - if (renderType == null || (state != null && entry.getValue().getRenderTypes(state, rand, extraData).contains(renderType))) - { + for (Map.Entry entry : baked.children.entrySet()) { + if (renderType == null || (state != null && entry.getValue().getRenderTypes(state, rand, extraData).contains(renderType))) { List quads = entry.getValue().getQuads(state, side, rand, Data.resolve(extraData, entry.getKey()), renderType); FramedDrawerModelData framedDrawerModelData = FramedDrawerBlock.getDrawerModelData(itemStack); diff --git a/src/main/java/com/buuz135/functionalstorage/client/model/FramedDrawerModelData.java b/src/main/java/com/buuz135/functionalstorage/client/model/FramedDrawerModelData.java index 30912368..ac65e7bb 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/model/FramedDrawerModelData.java +++ b/src/main/java/com/buuz135/functionalstorage/client/model/FramedDrawerModelData.java @@ -65,7 +65,7 @@ public void deserializeNBT(CompoundTag nbt) { this.generateCode(); } - private void generateCode(){ + private void generateCode() { this.code = ""; this.design.forEach((s, item) -> { this.code += (s + BuiltInRegistries.ITEM.getKey(item)); diff --git a/src/main/java/com/buuz135/functionalstorage/item/StorageUpgradeItem.java b/src/main/java/com/buuz135/functionalstorage/item/StorageUpgradeItem.java index c2953a3b..33c9eefe 100644 --- a/src/main/java/com/buuz135/functionalstorage/item/StorageUpgradeItem.java +++ b/src/main/java/com/buuz135/functionalstorage/item/StorageUpgradeItem.java @@ -14,7 +14,7 @@ import java.util.List; -public class StorageUpgradeItem extends UpgradeItem{ +public class StorageUpgradeItem extends UpgradeItem { private final StorageTier storageTier; diff --git a/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java b/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java index eb1cf7c6..dcef3d85 100644 --- a/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java +++ b/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java @@ -90,12 +90,12 @@ public void addTooltipDetails(@Nullable BasicItem.Key key, ItemStack stack, List super.addTooltipDetails(key, stack, tooltip, advanced); tooltip.add(Component.translatable("upgrade.type").withStyle(ChatFormatting.YELLOW).append(Component.translatable("upgrade.type." + getType().name().toLowerCase(Locale.ROOT)).withStyle(ChatFormatting.WHITE))); Item item = stack.getItem(); - if (item.equals(FunctionalStorage.PULLING_UPGRADE.get()) || item.equals(FunctionalStorage.PUSHING_UPGRADE.get()) || item.equals(FunctionalStorage.COLLECTOR_UPGRADE.get())) { + if ((item.equals(FunctionalStorage.PULLING_UPGRADE.get()) || item.equals(FunctionalStorage.PUSHING_UPGRADE.get()) || item.equals(FunctionalStorage.COLLECTOR_UPGRADE.get())) && stack.hasData(FSAttachments.DIRECTION)) { tooltip.add(Component.translatable("item.utility.direction").withStyle(ChatFormatting.YELLOW).append(Component.translatable(WordUtils.capitalize(getDirection(stack).getName().toLowerCase(Locale.ROOT))).withStyle(ChatFormatting.WHITE))); tooltip.add(Component.literal("")); tooltip.add(Component.translatable("item.utility.direction.desc").withStyle(ChatFormatting.GRAY)); } - if (item.equals(FunctionalStorage.REDSTONE_UPGRADE.get())) { + if (item.equals(FunctionalStorage.REDSTONE_UPGRADE.get()) && stack.hasData(FSAttachments.SLOT)) { tooltip.add(Component.translatable("item.utility.slot").withStyle(ChatFormatting.YELLOW).append(Component.literal(stack.getData(FSAttachments.SLOT).toString()).withStyle(ChatFormatting.WHITE))); tooltip.add(Component.literal("")); tooltip.add(Component.translatable("item.utility.direction.desc").withStyle(ChatFormatting.GRAY)); diff --git a/src/main/java/com/buuz135/functionalstorage/util/ConnectedDrawers.java b/src/main/java/com/buuz135/functionalstorage/util/ConnectedDrawers.java index 1468ee08..6d451c16 100644 --- a/src/main/java/com/buuz135/functionalstorage/util/ConnectedDrawers.java +++ b/src/main/java/com/buuz135/functionalstorage/util/ConnectedDrawers.java @@ -23,7 +23,7 @@ public class ConnectedDrawers implements INBTSerializable { - private StorageControllerTile controllerTile; + private final StorageControllerTile controllerTile; private List connectedDrawers; private List itemHandlers; @@ -32,7 +32,7 @@ public class ConnectedDrawers implements INBTSerializable { private int extensions; private VoxelShape cachedVoxelShape; - public ConnectedDrawers(Level level, StorageControllerTile controllerTile) { + public ConnectedDrawers(Level level, StorageControllerTile controllerTile) { this.controllerTile = controllerTile; this.connectedDrawers = new ArrayList<>(); diff --git a/src/main/java/com/buuz135/functionalstorage/util/NumberUtils.java b/src/main/java/com/buuz135/functionalstorage/util/NumberUtils.java index 6e0d2823..59fc2151 100644 --- a/src/main/java/com/buuz135/functionalstorage/util/NumberUtils.java +++ b/src/main/java/com/buuz135/functionalstorage/util/NumberUtils.java @@ -4,7 +4,7 @@ public class NumberUtils { - private static DecimalFormat formatterWithUnits = new DecimalFormat("####0.#"); + private static final DecimalFormat formatterWithUnits = new DecimalFormat("####0.#"); public static String getFormatedBigNumber(int number) { if (number >= 1000000000) { //BILLION diff --git a/src/main/java/com/buuz135/functionalstorage/util/StorageTags.java b/src/main/java/com/buuz135/functionalstorage/util/StorageTags.java index 9e974811..b9ed4a0b 100644 --- a/src/main/java/com/buuz135/functionalstorage/util/StorageTags.java +++ b/src/main/java/com/buuz135/functionalstorage/util/StorageTags.java @@ -8,7 +8,7 @@ public class StorageTags { - public static TagKey DRAWER = ItemTags.create(new ResourceLocation(FunctionalStorage.MOD_ID, "drawer")); - public static TagKey IGNORE_CRAFTING_CHECK = ItemTags.create(new ResourceLocation(FunctionalStorage.MOD_ID, "ignore_crafting_check")); + public static final TagKey DRAWER = ItemTags.create(new ResourceLocation(FunctionalStorage.MOD_ID, "drawer")); + public static final TagKey IGNORE_CRAFTING_CHECK = ItemTags.create(new ResourceLocation(FunctionalStorage.MOD_ID, "ignore_crafting_check")); } From 72fa0c19745bb649a5bda71c3c5549592b9c92fd Mon Sep 17 00:00:00 2001 From: Matyrobbrt Date: Mon, 8 Apr 2024 00:24:34 +0300 Subject: [PATCH 06/20] Viewer compat --- build.gradle | 2 + .../361def3a0b0e87157892b021be1ddec9d13d5e52 | 4 +- .../58b100d11464fc6de03e6a16617c8d741d90a73a | 4 +- .../9b4b2fe28e6a198629709c0c8772cb00a8b15d4a | 4 +- .../assets/functionalstorage/lang/en_us.json | 1 + .../functionalstorage/tags/items/drawer.json | 24 +- .../minecraft/tags/blocks/mineable/axe.json | 24 +- .../functionalstorage/FunctionalStorage.java | 81 ++-- .../block/CompactingDrawerBlock.java | 37 -- .../functionalstorage/block/DrawerBlock.java | 4 +- .../block/tile/ArmoryCabinetTile.java | 7 + .../block/tile/FluidDrawerTile.java | 5 + .../tile/ItemControllableDrawerTile.java | 5 + .../functionalstorage/client/ClientSetup.java | 27 ++ .../functionalstorage/compat/TOPPlugin.java | 22 -- .../compat/jade/DrawerComponentProvider.java | 97 +++++ .../compat/jade/FSJadePlugin.java | 19 + .../compat/top/CustomElementItemStack.java | 191 +++++----- .../compat/top/FunctionalDrawerProvider.java | 360 +++++++++--------- .../compat/top/TOPPlugin.java | 21 + .../data/FunctionalStorageLangProvider.java | 2 + .../functionalstorage/item/UpgradeItem.java | 51 ++- 22 files changed, 572 insertions(+), 420 deletions(-) create mode 100644 src/main/java/com/buuz135/functionalstorage/client/ClientSetup.java delete mode 100644 src/main/java/com/buuz135/functionalstorage/compat/TOPPlugin.java create mode 100644 src/main/java/com/buuz135/functionalstorage/compat/jade/DrawerComponentProvider.java create mode 100644 src/main/java/com/buuz135/functionalstorage/compat/jade/FSJadePlugin.java create mode 100644 src/main/java/com/buuz135/functionalstorage/compat/top/TOPPlugin.java diff --git a/build.gradle b/build.gradle index f00161ab..a8916c66 100644 --- a/build.gradle +++ b/build.gradle @@ -75,6 +75,8 @@ dependencies { compileOnly "mezz.jei:jei-1.20.4-neoforge-api:$jei_version" runtimeOnly "mezz.jei:jei-1.20.4-neoforge:$jei_version" implementation "curse.maven:refined-storage-243076:5165548" + implementation "curse.maven:jade-324717:5109393" + compileOnly "curse.maven:the-one-probe-245211:5159289" implementation('com.hrznstudio:titanium') runtimeOnly('com.hrznstudio:Titanium:1.20.4-2.4.0') diff --git a/src/generated/resources/.cache/361def3a0b0e87157892b021be1ddec9d13d5e52 b/src/generated/resources/.cache/361def3a0b0e87157892b021be1ddec9d13d5e52 index e14d3ed7..5b314f2e 100644 --- a/src/generated/resources/.cache/361def3a0b0e87157892b021be1ddec9d13d5e52 +++ b/src/generated/resources/.cache/361def3a0b0e87157892b021be1ddec9d13d5e52 @@ -1,2 +1,2 @@ -// 1.20.4 2024-04-07T00:54:11.3182077 Languages: en_us for mod: functionalstorage -112cce2d4db4dc706b7fdd988dd505ea0046bacc assets/functionalstorage/lang/en_us.json +// 1.20.4 2024-04-08T00:24:18.5149232 Languages: en_us for mod: functionalstorage +19777c8bec78c9b2fee083a0691e2a5733abf052 assets/functionalstorage/lang/en_us.json diff --git a/src/generated/resources/.cache/58b100d11464fc6de03e6a16617c8d741d90a73a b/src/generated/resources/.cache/58b100d11464fc6de03e6a16617c8d741d90a73a index 36048dd4..592ca22d 100644 --- a/src/generated/resources/.cache/58b100d11464fc6de03e6a16617c8d741d90a73a +++ b/src/generated/resources/.cache/58b100d11464fc6de03e6a16617c8d741d90a73a @@ -1,2 +1,2 @@ -// 1.20.4 2024-04-07T00:54:11.3292104 Functional Storage Item Tags -e72c53e88ffb2ff0aed4d46bafae940a49fe9e97 data/functionalstorage/tags/items/drawer.json +// 1.20.4 2024-04-08T00:24:18.518918 Functional Storage Item Tags +6c2aa8af2200df22b202c6a5806cc67c8d6d5ec8 data/functionalstorage/tags/items/drawer.json diff --git a/src/generated/resources/.cache/9b4b2fe28e6a198629709c0c8772cb00a8b15d4a b/src/generated/resources/.cache/9b4b2fe28e6a198629709c0c8772cb00a8b15d4a index 02405431..6f284f8d 100644 --- a/src/generated/resources/.cache/9b4b2fe28e6a198629709c0c8772cb00a8b15d4a +++ b/src/generated/resources/.cache/9b4b2fe28e6a198629709c0c8772cb00a8b15d4a @@ -1,3 +1,3 @@ -// 1.20.4 2024-04-07T00:54:11.3412364 Tags for minecraft:block mod id functionalstorage -e72c53e88ffb2ff0aed4d46bafae940a49fe9e97 data/minecraft/tags/blocks/mineable/axe.json +// 1.20.4 2024-04-08T00:24:18.5209168 Tags for minecraft:block mod id functionalstorage +6c2aa8af2200df22b202c6a5806cc67c8d6d5ec8 data/minecraft/tags/blocks/mineable/axe.json 4b6fc75faca16170a17220f0e301b16866f4bc5c data/minecraft/tags/blocks/mineable/pickaxe.json diff --git a/src/generated/resources/assets/functionalstorage/lang/en_us.json b/src/generated/resources/assets/functionalstorage/lang/en_us.json index 2013cc8f..95adccd1 100644 --- a/src/generated/resources/assets/functionalstorage/lang/en_us.json +++ b/src/generated/resources/assets/functionalstorage/lang/en_us.json @@ -45,6 +45,7 @@ "block.functionalstorage.warped_1": "Warped Drawer (1x1)", "block.functionalstorage.warped_2": "Warped Drawer (1x2)", "block.functionalstorage.warped_4": "Warped Drawer (2x2)", + "config.jade.plugin_functionalstorage.drawer": "Functional Storage Drawers", "configurationtool.configmode": "Config Mode: ", "configurationtool.configmode.indicator": "Swap indicator modes", "configurationtool.configmode.indicator.mode_0": "Hidden", diff --git a/src/generated/resources/data/functionalstorage/tags/items/drawer.json b/src/generated/resources/data/functionalstorage/tags/items/drawer.json index bb20db0b..1f2e45d3 100644 --- a/src/generated/resources/data/functionalstorage/tags/items/drawer.json +++ b/src/generated/resources/data/functionalstorage/tags/items/drawer.json @@ -1,16 +1,5 @@ { "values": [ - "functionalstorage:oak_4", - "functionalstorage:spruce_4", - "functionalstorage:birch_4", - "functionalstorage:jungle_4", - "functionalstorage:acacia_4", - "functionalstorage:dark_oak_4", - "functionalstorage:crimson_4", - "functionalstorage:warped_4", - "functionalstorage:mangrove_4", - "functionalstorage:cherry_4", - "functionalstorage:framed_4", "functionalstorage:oak_2", "functionalstorage:spruce_2", "functionalstorage:birch_2", @@ -32,6 +21,17 @@ "functionalstorage:warped_1", "functionalstorage:mangrove_1", "functionalstorage:cherry_1", - "functionalstorage:framed_1" + "functionalstorage:framed_1", + "functionalstorage:oak_4", + "functionalstorage:spruce_4", + "functionalstorage:birch_4", + "functionalstorage:jungle_4", + "functionalstorage:acacia_4", + "functionalstorage:dark_oak_4", + "functionalstorage:crimson_4", + "functionalstorage:warped_4", + "functionalstorage:mangrove_4", + "functionalstorage:cherry_4", + "functionalstorage:framed_4" ] } \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json b/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json index bb20db0b..1f2e45d3 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json +++ b/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json @@ -1,16 +1,5 @@ { "values": [ - "functionalstorage:oak_4", - "functionalstorage:spruce_4", - "functionalstorage:birch_4", - "functionalstorage:jungle_4", - "functionalstorage:acacia_4", - "functionalstorage:dark_oak_4", - "functionalstorage:crimson_4", - "functionalstorage:warped_4", - "functionalstorage:mangrove_4", - "functionalstorage:cherry_4", - "functionalstorage:framed_4", "functionalstorage:oak_2", "functionalstorage:spruce_2", "functionalstorage:birch_2", @@ -32,6 +21,17 @@ "functionalstorage:warped_1", "functionalstorage:mangrove_1", "functionalstorage:cherry_1", - "functionalstorage:framed_1" + "functionalstorage:framed_1", + "functionalstorage:oak_4", + "functionalstorage:spruce_4", + "functionalstorage:birch_4", + "functionalstorage:jungle_4", + "functionalstorage:acacia_4", + "functionalstorage:dark_oak_4", + "functionalstorage:crimson_4", + "functionalstorage:warped_4", + "functionalstorage:mangrove_4", + "functionalstorage:cherry_4", + "functionalstorage:framed_4" ] } \ No newline at end of file diff --git a/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java b/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java index d80556ef..5d85a6a5 100644 --- a/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java +++ b/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java @@ -28,6 +28,7 @@ import com.buuz135.functionalstorage.block.tile.ItemControllableDrawerTile; import com.buuz135.functionalstorage.block.tile.SimpleCompactingDrawerTile; import com.buuz135.functionalstorage.block.tile.StorageControllerTile; +import com.buuz135.functionalstorage.client.ClientSetup; import com.buuz135.functionalstorage.client.CompactingDrawerRenderer; import com.buuz135.functionalstorage.client.ControllerRenderer; import com.buuz135.functionalstorage.client.DrawerRenderer; @@ -80,6 +81,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; +import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; @@ -93,7 +95,9 @@ import net.minecraft.world.phys.shapes.VoxelShape; import net.neoforged.api.distmarker.Dist; import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.bus.api.EventPriority; import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.ModLoadingContext; import net.neoforged.fml.common.Mod; import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; import net.neoforged.neoforge.capabilities.Capabilities; @@ -110,11 +114,13 @@ import net.neoforged.neoforge.common.crafting.IngredientType; import net.neoforged.neoforge.common.util.NonNullLazy; import net.neoforged.neoforge.data.event.GatherDataEvent; +import net.neoforged.neoforge.event.entity.player.ItemTooltipEvent; import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent; import net.neoforged.neoforge.event.level.BlockEvent; import net.neoforged.neoforge.items.IItemHandler; import net.neoforged.neoforge.registries.DeferredHolder; import net.neoforged.neoforge.registries.NeoForgeRegistries; +import net.neoforged.neoforge.registries.RegisterEvent; import org.apache.commons.lang3.tuple.Pair; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -208,50 +214,19 @@ public FunctionalStorage(Dist dist, IEventBus modBus) { .subscribe(); EventManager.mod(RegisterCapabilitiesEvent.class).process(event -> { - class Registrar { - void register(Class tp, Function func, BlockWithTile... types) { - for (var type : types) { - event.registerBlockEntity(Capabilities.ItemHandler.BLOCK, type.type().get(), (object, context) -> { - if (tp.isInstance(object)) { - return func.apply(tp.cast(object)); - } - return null; - }); - } + event.registerItem(Capabilities.ItemHandler.ITEM, (object, context) -> { + if (object.getItem() instanceof DrawerBlock.DrawerItem di) { + return di.initCapabilities(object); } - } - final var reg = new Registrar(); - reg.register(ArmoryCabinetTile.class, ac -> ac.handler, ARMORY_CABINET); - reg.register(CompactingDrawerTile.class, cd -> cd.handler, COMPACTING_DRAWER, FRAMED_COMPACTING_DRAWER); - - for (var type : List.of(FLUID_DRAWER_1, FLUID_DRAWER_2, FLUID_DRAWER_4)) { - event.registerBlockEntity(Capabilities.FluidHandler.BLOCK, type.type().get(), (object, context) -> { - if (object instanceof FluidDrawerTile fd) { - return fd.fluidHandler; - } - return null; - }); - } - for (var type : List.of(FRAMED_DRAWER_CONTROLLER, DRAWER_CONTROLLER)) { - event.registerBlockEntity(Capabilities.FluidHandler.BLOCK, type.type().get(), (object, context) -> { - if (object instanceof StorageControllerTile sc) { - return sc.fluidHandler; - } - return null; - }); - } + return null; + }, DRAWER_TYPES.values().stream().flatMap(List::stream).map(bl -> (ItemLike)bl.block().get()).toArray(ItemLike[]::new)); - BuiltInRegistries.BLOCK_ENTITY_TYPE.holders() - .filter(hol -> hol.key().location().getNamespace().equals(MOD_ID)) - .map(Holder::value) - .forEach(betype -> { - event.registerBlockEntity(Capabilities.ItemHandler.BLOCK, betype, (object, context) -> { - if (object instanceof ItemControllableDrawerTile icd) { - return icd.getStorage(); - } - return null; - }); - }); + event.registerItem(Capabilities.ItemHandler.ITEM, (object, context) -> { + if (object.getItem() instanceof CompactingDrawerBlock.CompactingDrawerItem di) { + return di.initCapabilities(object); + } + return null; + }, COMPACTING_DRAWER.asItem(), SIMPLE_COMPACTING_DRAWER.asItem(), FRAMED_COMPACTING_DRAWER.asItem(), FRAMED_SIMPLE_COMPACTING_DRAWER.asItem()); }); } @@ -272,7 +247,6 @@ protected void initModules() { } } } - // TODO - items for normal drawers FLUID_DRAWER_1 = getRegistries().registerBlockWithTile("fluid_1", () -> new FluidDrawerBlock(DrawerType.X_1, BlockBehaviour.Properties.ofFullCopy(Blocks.STONE_BRICKS)), TAB); FLUID_DRAWER_2 = getRegistries().registerBlockWithTile("fluid_2", () -> new FluidDrawerBlock(DrawerType.X_2, BlockBehaviour.Properties.ofFullCopy(Blocks.STONE_BRICKS)), TAB); FLUID_DRAWER_4 = getRegistries().registerBlockWithTile("fluid_4", () -> new FluidDrawerBlock(DrawerType.X_4, BlockBehaviour.Properties.ofFullCopy(Blocks.STONE_BRICKS)), TAB); @@ -310,16 +284,8 @@ public boolean isFoil(ItemStack p_41453_) { return true; } }); - - FRAMED_BLOCKS = getRegistries().getRegistry(Registries.BLOCK) - .getEntries().stream() - .filter(bl -> bl.value() instanceof FramedBlock) - .map(Holder::value) - .toList(); - DrawerlessWoodIngredient.TYPE = getRegistries().registerGeneric(NeoForgeRegistries.Keys.INGREDIENT_TYPES, DrawerlessWoodIngredient.NAME.getPath(), () -> new IngredientType<>(DrawerlessWoodIngredient.CODEC)); - getRegistries().registerGeneric(Registries.RECIPE_SERIALIZER, "framed_recipe", () -> FramedDrawerRecipe.SERIALIZER); this.addCreativeTab("main", () -> new ItemStack(DRAWER_CONTROLLER), MOD_ID, TAB); @@ -327,6 +293,17 @@ public boolean isFoil(ItemStack p_41453_) { CUSTOM_COMPACTING_RECIPE_TYPE = getRegistries().registerGeneric(Registries.RECIPE_TYPE, "custom_compacting", () -> RecipeType.simple(new ResourceLocation(MOD_ID, "custom_compacting"))); CUSTOM_COMPACTING_RECIPE_SERIALIZER = getRegistries().registerGeneric(Registries.RECIPE_SERIALIZER, "custom_compacting", () -> new GenericSerializer<>(CustomCompactingRecipe.class, CUSTOM_COMPACTING_RECIPE_TYPE::value, CustomCompactingRecipe.CODEC)); + + ModLoadingContext.get().getActiveContainer().getEventBus() + .addListener(EventPriority.LOWEST, (final RegisterEvent regEvent) -> { + if (regEvent.getRegistryKey() == Registries.BLOCK) { + FRAMED_BLOCKS = getRegistries().getRegistry(Registries.BLOCK) + .getEntries().stream() + .filter(bl -> bl.value() instanceof FramedBlock) + .map(Holder::value) + .toList(); + } + }); } public enum DrawerType { @@ -466,7 +443,7 @@ public void onClient() { EventManager.mod(ModelEvent.RegisterGeometryLoaders.class).process(modelRegistryEvent -> { modelRegistryEvent.register(new ResourceLocation(MOD_ID, "framedblock"), FramedModel.Loader.INSTANCE); }).subscribe(); - + ClientSetup.init(); } @Override diff --git a/src/main/java/com/buuz135/functionalstorage/block/CompactingDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/CompactingDrawerBlock.java index 1b22eca0..c71b6b8e 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/CompactingDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/CompactingDrawerBlock.java @@ -2,62 +2,30 @@ import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.block.tile.CompactingDrawerTile; -import com.buuz135.functionalstorage.block.tile.ControllableDrawerTile; -import com.buuz135.functionalstorage.block.tile.StorageControllerTile; import com.buuz135.functionalstorage.inventory.item.CompactingStackItemHandler; -import com.buuz135.functionalstorage.item.ConfigurationToolItem; -import com.buuz135.functionalstorage.item.FSAttachments; -import com.buuz135.functionalstorage.item.LinkingToolItem; import com.buuz135.functionalstorage.util.StorageTags; import com.google.common.collect.Multimap; import com.google.common.collect.MultimapBuilder; import com.hrznstudio.titanium.block.RotatableBlock; -import com.hrznstudio.titanium.datagenerator.loot.block.BasicBlockLootTables; import com.hrznstudio.titanium.recipe.generator.TitaniumShapedRecipeBuilder; -import com.hrznstudio.titanium.util.RayTraceUtils; -import com.hrznstudio.titanium.util.TileUtil; -import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; -import net.minecraft.core.NonNullList; import net.minecraft.data.recipes.RecipeOutput; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResult; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.tooltip.TooltipComponent; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.BlockGetter; -import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.block.state.StateDefinition; -import net.minecraft.world.level.storage.loot.LootParams; -import net.minecraft.world.level.storage.loot.LootTable; -import net.minecraft.world.level.storage.loot.parameters.LootContextParams; -import net.minecraft.world.phys.BlockHitResult; -import net.minecraft.world.phys.HitResult; -import net.minecraft.world.phys.shapes.BooleanOp; -import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; import net.neoforged.neoforge.common.Tags; import net.neoforged.neoforge.items.IItemHandler; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Collection; import java.util.List; -import java.util.Optional; public class CompactingDrawerBlock extends Drawer { @@ -128,11 +96,6 @@ public CompactingDrawerItem(Block p_40565_, net.minecraft.world.item.Item.Proper this.slots = slots; } - @Override - public Optional getTooltipImage(ItemStack stack) { - return super.getTooltipImage(stack); - } - public IItemHandler initCapabilities(ItemStack stack) { return new CompactingStackItemHandler(stack, slots); } diff --git a/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java index 84328b0c..8fde6695 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java @@ -213,8 +213,7 @@ public IWoodType getWoodType() { } public static class DrawerItem extends BlockItem{ - - private DrawerBlock drawerBlock; + private final DrawerBlock drawerBlock; public DrawerItem(DrawerBlock p_40565_, net.minecraft.world.item.Item.Properties p_40566_, TitaniumTab tab) { super(p_40565_, p_40566_); this.drawerBlock = p_40565_; @@ -227,5 +226,4 @@ public IItemHandler initCapabilities(ItemStack stack) { } } - } diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/ArmoryCabinetTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/ArmoryCabinetTile.java index a943b775..dfd81958 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/ArmoryCabinetTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/ArmoryCabinetTile.java @@ -5,6 +5,7 @@ import com.hrznstudio.titanium.block.BasicTileBlock; import com.hrznstudio.titanium.block.tile.ActiveTile; import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.Connection; import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; @@ -12,6 +13,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.neoforged.neoforge.items.IItemHandler; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import javax.annotation.Nonnull; @@ -65,4 +67,9 @@ public boolean isEverythingEmpty() { public ArmoryCabinetTile getSelf() { return this; } + + @Override + public IItemHandler getItemHandler(@Nullable Direction direction) { + return getStorage(); + } } diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java index e0ec8b7c..e6c4b510 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java @@ -33,6 +33,7 @@ import net.neoforged.neoforge.fluids.capability.wrappers.BucketPickupHandlerWrapper; import net.neoforged.neoforge.fluids.capability.wrappers.FluidBlockWrapper; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.nio.charset.StandardCharsets; import java.util.Optional; @@ -309,4 +310,8 @@ public ItemStack extractItem(int slot, int amount, boolean simulate) { } + @Override + public IFluidHandler getFluidHandler(@Nullable Direction direction) { + return fluidHandler; + } } diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java index c1e0c667..6cefbd6e 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java @@ -28,6 +28,7 @@ import net.neoforged.neoforge.items.IItemHandler; import net.neoforged.neoforge.items.ItemHandlerHelper; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.util.HashMap; import java.util.UUID; @@ -239,4 +240,8 @@ public int getTitleColor() { return ChatFormatting.DARK_GRAY.getColor(); } + @Override + public IItemHandler getItemHandler(@Nullable Direction direction) { + return getStorage(); + } } diff --git a/src/main/java/com/buuz135/functionalstorage/client/ClientSetup.java b/src/main/java/com/buuz135/functionalstorage/client/ClientSetup.java new file mode 100644 index 00000000..e651b11c --- /dev/null +++ b/src/main/java/com/buuz135/functionalstorage/client/ClientSetup.java @@ -0,0 +1,27 @@ +package com.buuz135.functionalstorage.client; + +import com.buuz135.functionalstorage.block.tile.ItemControllableDrawerTile; +import com.buuz135.functionalstorage.item.FSAttachments; +import com.buuz135.functionalstorage.item.UpgradeItem; +import com.hrznstudio.titanium.block.RotatableBlock; +import com.hrznstudio.titanium.client.screen.container.BasicAddonScreen; +import com.hrznstudio.titanium.event.handler.EventManager; +import net.minecraft.ChatFormatting; +import net.minecraft.client.Minecraft; +import net.minecraft.network.chat.Component; +import net.neoforged.neoforge.event.entity.player.ItemTooltipEvent; + +public class ClientSetup { + public static void init() { + EventManager.forge(ItemTooltipEvent.class).filter( + event -> UpgradeItem.isDirectionUpgrade(event.getItemStack().getItem()) && event.getItemStack().hasData(FSAttachments.DIRECTION) + ).filter(event -> Minecraft.getInstance().screen != null && Minecraft.getInstance().screen instanceof BasicAddonScreen bcs && bcs.getMenu().getObject() instanceof ItemControllableDrawerTile) + .process(event -> { + var sc = (BasicAddonScreen) Minecraft.getInstance().screen; + var direction = ((ItemControllableDrawerTile) sc.getMenu().getObject()).getBlockState().getValue(RotatableBlock.FACING_HORIZONTAL); + event.getToolTip().add(Component.literal("Relative direction: ").append(UpgradeItem.getRelativeDirection( + UpgradeItem.getDirection(event.getItemStack()), direction + ).withStyle(ChatFormatting.GOLD))); + }).subscribe(); + } +} diff --git a/src/main/java/com/buuz135/functionalstorage/compat/TOPPlugin.java b/src/main/java/com/buuz135/functionalstorage/compat/TOPPlugin.java deleted file mode 100644 index a417d247..00000000 --- a/src/main/java/com/buuz135/functionalstorage/compat/TOPPlugin.java +++ /dev/null @@ -1,22 +0,0 @@ -//package com.buuz135.functionalstorage.compat; -// -//import com.buuz135.functionalstorage.compat.top.FunctionalDrawerProvider; -//import com.hrznstudio.titanium.annotation.plugin.FeaturePlugin; -//import com.hrznstudio.titanium.event.handler.EventManager; -//import com.hrznstudio.titanium.plugin.FeaturePluginInstance; -//import com.hrznstudio.titanium.plugin.PluginPhase; -//import net.neoforged.fml.InterModComms; -//import net.neoforged.fml.event.lifecycle.InterModEnqueueEvent; -// -//@FeaturePlugin(value = "theoneprobe", type = FeaturePlugin.FeaturePluginType.MOD) -//public class TOPPlugin implements FeaturePluginInstance { -// @Override -// public void execute(PluginPhase phase) { -// if (phase == PluginPhase.CONSTRUCTION) { -// EventManager.mod(InterModEnqueueEvent.class).process(interModEnqueueEvent -> { -// InterModComms.sendTo("theoneprobe", "getTheOneProbe", () -> FunctionalDrawerProvider.REGISTER); -// }).subscribe(); -// } -// } -// -//} diff --git a/src/main/java/com/buuz135/functionalstorage/compat/jade/DrawerComponentProvider.java b/src/main/java/com/buuz135/functionalstorage/compat/jade/DrawerComponentProvider.java new file mode 100644 index 00000000..c2fcf59a --- /dev/null +++ b/src/main/java/com/buuz135/functionalstorage/compat/jade/DrawerComponentProvider.java @@ -0,0 +1,97 @@ +package com.buuz135.functionalstorage.compat.jade; + +import com.buuz135.functionalstorage.FunctionalStorage; +import com.buuz135.functionalstorage.block.tile.ItemControllableDrawerTile; +import com.buuz135.functionalstorage.inventory.BigInventoryHandler; +import com.buuz135.functionalstorage.inventory.CompactingInventoryHandler; +import com.buuz135.functionalstorage.item.UpgradeItem; +import com.buuz135.functionalstorage.util.NumberUtils; +import com.mojang.datafixers.util.Pair; +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.world.phys.Vec2; +import snownee.jade.api.BlockAccessor; +import snownee.jade.api.IBlockComponentProvider; +import snownee.jade.api.ITooltip; +import snownee.jade.api.config.IPluginConfig; +import snownee.jade.api.ui.BoxStyle; +import snownee.jade.api.ui.IElement; +import snownee.jade.api.ui.IElementHelper; + +import java.util.ArrayList; + +public enum DrawerComponentProvider implements IBlockComponentProvider { + INSTANCE; + public static final ResourceLocation ITEM_STORAGE = new ResourceLocation("minecraft:item_storage"); + + public static final ResourceLocation ID = new ResourceLocation(FunctionalStorage.MOD_ID, "drawer"); + + @Override + public void appendTooltip(ITooltip iTooltip, BlockAccessor blockAccessor, IPluginConfig iPluginConfig) { + iTooltip.remove(ITEM_STORAGE); + + var helper = IElementHelper.get(); + if (blockAccessor.getBlockEntity() instanceof ItemControllableDrawerTile tile) { + if (!tile.isEverythingEmpty()) { + var stacks = new ArrayList>(); + if (tile.getStorage() instanceof BigInventoryHandler bigInv) { + for (int slot = 0; slot < tile.getStorage().getSlots(); slot++) { + var stack = bigInv.getStoredStacks().get(slot); + if (stack.getStack().getItem() != Items.AIR) { + stacks.add(new Pair<>(stack.getStack().copyWithCount(stack.getAmount()), bigInv.getSlotLimit(slot))); + } + } + } else if (tile.getStorage() instanceof CompactingInventoryHandler compacting) { + var results = compacting.getResultList(); + for (int i = 0; i < results.size(); i++) { + var result = results.get(i); + if (result.getResult().getItem() != Items.AIR) { + stacks.add(new Pair<>(result.getResult().copyWithCount(compacting.getStackInSlot(i).getCount()), compacting.getSlotLimit(i))); + } + } + } + + if (!stacks.isEmpty()) { + var contentsBox = helper.tooltip(); + iTooltip.add(helper.text(Component.literal("Contents:"))); + for (var stack : stacks) { + // Account for locked slots too + boolean wasEmpty = stack.getFirst().getCount() == 0; + if (stack.getFirst().getCount() == 0) stack.getFirst().setCount(1); + IElement icon = helper.item(stack.getFirst().copy(), 0.86f, "").size(new Vec2(.86f * 18, .86f * 18)).translate(new Vec2(0, -1)); + if (wasEmpty) stack.getFirst().shrink(1); + contentsBox.add(icon); + contentsBox.append( + helper.text(Component.literal("x ").append(NumberUtils.getFormatedBigNumber(stack.getFirst().getCount()) + " / " + NumberUtils.getFormatedBigNumber(stack.getSecond()))) + .translate(new Vec2(4, (.86f * 18 - 10) / 2)) + ); + } + iTooltip.add(helper.box(contentsBox, BoxStyle.getNestedBox())); + } + + if (Screen.hasShiftDown()) { + var upInv = tile.getUtilityUpgrades(); + for (int i = 0; i < upInv.getSlots(); i++) { + var stack = upInv.getStackInSlot(i); + if (stack.getItem() instanceof UpgradeItem ui) { + iTooltip.add(ui.getDescription(stack, tile)); + } + } + } + } + } + } + + @Override + public int getDefaultPriority() { + return 4999; + } + + @Override + public ResourceLocation getUid() { + return ID; + } +} diff --git a/src/main/java/com/buuz135/functionalstorage/compat/jade/FSJadePlugin.java b/src/main/java/com/buuz135/functionalstorage/compat/jade/FSJadePlugin.java new file mode 100644 index 00000000..4b72247a --- /dev/null +++ b/src/main/java/com/buuz135/functionalstorage/compat/jade/FSJadePlugin.java @@ -0,0 +1,19 @@ +package com.buuz135.functionalstorage.compat.jade; + +import com.buuz135.functionalstorage.block.Drawer; +import snownee.jade.api.IWailaClientRegistration; +import snownee.jade.api.IWailaCommonRegistration; +import snownee.jade.api.IWailaPlugin; +import snownee.jade.api.WailaPlugin; + +@WailaPlugin +public class FSJadePlugin implements IWailaPlugin { + @Override + public void registerClient(IWailaClientRegistration registration) { + registration.registerBlockComponent(DrawerComponentProvider.INSTANCE, Drawer.class); + } + + @Override + public void register(IWailaCommonRegistration registration) { + } +} diff --git a/src/main/java/com/buuz135/functionalstorage/compat/top/CustomElementItemStack.java b/src/main/java/com/buuz135/functionalstorage/compat/top/CustomElementItemStack.java index 4e94ea39..45731d43 100644 --- a/src/main/java/com/buuz135/functionalstorage/compat/top/CustomElementItemStack.java +++ b/src/main/java/com/buuz135/functionalstorage/compat/top/CustomElementItemStack.java @@ -1,95 +1,96 @@ -//package com.buuz135.functionalstorage.compat.top; -// -// -//import com.buuz135.functionalstorage.FunctionalStorage; -//import com.mojang.blaze3d.vertex.PoseStack; -//import mcjty.theoneprobe.api.IElement; -//import mcjty.theoneprobe.api.IItemStyle; -//import mcjty.theoneprobe.apiimpl.styles.ItemStyle; -//import mcjty.theoneprobe.network.NetworkTools; -//import mcjty.theoneprobe.rendering.RenderHelper; -//import net.minecraft.ChatFormatting; -//import net.minecraft.client.Minecraft; -//import net.minecraft.client.gui.GuiGraphics; -//import net.minecraft.client.renderer.entity.ItemRenderer; -//import net.minecraft.network.FriendlyByteBuf; -//import net.minecraft.resources.ResourceLocation; -//import net.minecraft.world.item.ItemStack; -// -//public class CustomElementItemStack implements IElement { -// -// public static ResourceLocation RL = new ResourceLocation(FunctionalStorage.MOD_ID, "drawer_element"); -// -// private final ItemStack itemStack; -// private final IItemStyle style; -// private final String display; -// private boolean displayName; -// -// public CustomElementItemStack(ItemStack itemStack, String display, IItemStyle style) { -// this.itemStack = itemStack; -// this.style = style; -// this.display = display; -// this.displayName = false; -// } -// -// public CustomElementItemStack(ItemStack itemStack, String display, IItemStyle style, boolean displayName) { -// this(itemStack, display, style); -// this.displayName = true; -// } -// -// public CustomElementItemStack(FriendlyByteBuf buf) { -// if (buf.readBoolean()) { -// this.itemStack = NetworkTools.readItemStack(buf); -// } else { -// this.itemStack = ItemStack.EMPTY; -// } -// -// this.style = (new ItemStyle()).width(buf.readInt()).height(buf.readInt()); -// this.display = buf.readUtf(); -// this.displayName = buf.readBoolean(); -// } -// -// public void render(GuiGraphics matrixStack, int x, int y) { -// ItemRenderer itemRender = Minecraft.getInstance().getItemRenderer(); -// if (!itemStack.isEmpty()) { -// int size = itemStack.getCount(); -// -// if (!RenderHelper.renderItemStack(Minecraft.getInstance(), itemRender, itemStack, matrixStack, x + (style.getWidth() - 18) / 2, y + (style.getHeight() - 18) / 2, display)) { -// Minecraft var10000 = Minecraft.getInstance(); -// ChatFormatting var10004 = ChatFormatting.RED; -// RenderHelper.renderText(var10000, matrixStack, x, y, var10004 + "ERROR: " + itemStack.getHoverName()); -// } -// if (this.displayName){ -// RenderHelper.renderText(Minecraft.getInstance(), matrixStack, x + 22, y + 7, itemStack.getHoverName()); -// } -// -// } -// -// } -// -// public int getWidth() { -// return this.style.getWidth() + (this.displayName ? Minecraft.getInstance().font.width(itemStack.getHoverName().getString()) : 0) ; -// } -// -// public int getHeight() { -// return this.style.getHeight(); -// } -// -// public void toBytes(FriendlyByteBuf buf) { -// if (!this.itemStack.isEmpty()) { -// buf.writeBoolean(true); -// NetworkTools.writeItemStack(buf, this.itemStack); -// } else { -// buf.writeBoolean(false); -// } -// -// buf.writeInt(this.style.getWidth()); -// buf.writeInt(this.style.getHeight()); -// buf.writeUtf(this.display); -// buf.writeBoolean(this.displayName); -// } -// -// public ResourceLocation getID() { -// return RL; -// } -//} +package com.buuz135.functionalstorage.compat.top; + + +import com.buuz135.functionalstorage.FunctionalStorage; +import mcjty.theoneprobe.api.IElement; +import mcjty.theoneprobe.api.IItemStyle; +import mcjty.theoneprobe.apiimpl.styles.ItemStyle; +import mcjty.theoneprobe.network.NetworkTools; +import mcjty.theoneprobe.rendering.RenderHelper; +import net.minecraft.ChatFormatting; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.renderer.entity.ItemRenderer; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; + +public class CustomElementItemStack implements IElement { + + public static ResourceLocation RL = new ResourceLocation(FunctionalStorage.MOD_ID, "drawer_element"); + + private final ItemStack itemStack; + private final IItemStyle style; + private final String display; + private boolean displayName; + + public CustomElementItemStack(ItemStack itemStack, String display, IItemStyle style) { + this.itemStack = itemStack; + this.style = style; + this.display = display; + this.displayName = false; + } + + public CustomElementItemStack(ItemStack itemStack, String display, IItemStyle style, boolean displayName) { + this(itemStack, display, style); + this.displayName = true; + } + + public CustomElementItemStack(FriendlyByteBuf buf) { + if (buf.readBoolean()) { + this.itemStack = NetworkTools.readItemStack(buf); + } else { + this.itemStack = ItemStack.EMPTY; + } + + this.style = (new ItemStyle()).width(buf.readInt()).height(buf.readInt()); + this.display = buf.readUtf(); + this.displayName = buf.readBoolean(); + } + + @Override + public void render(GuiGraphics matrixStack, int x, int y) { + ItemRenderer itemRender = Minecraft.getInstance().getItemRenderer(); + if (!itemStack.isEmpty()) { + if (!RenderHelper.renderItemStack(Minecraft.getInstance(), itemRender, itemStack, matrixStack, x + (style.getWidth() - 18) / 2, y + (style.getHeight() - 18) / 2, display)) { + Minecraft var10000 = Minecraft.getInstance(); + ChatFormatting var10004 = ChatFormatting.RED; + RenderHelper.renderText(var10000, matrixStack, x, y, var10004 + "ERROR: " + itemStack.getHoverName()); + } + if (this.displayName){ + RenderHelper.renderText(Minecraft.getInstance(), matrixStack, x + 22, y + 7, itemStack.getHoverName()); + } + } + + } + + @Override + public int getWidth() { + return this.style.getWidth() + (this.displayName ? Minecraft.getInstance().font.width(itemStack.getHoverName().getString()) : 0) ; + } + + @Override + public int getHeight() { + return this.style.getHeight(); + } + + @Override + public void toBytes(FriendlyByteBuf buf) { + if (!this.itemStack.isEmpty()) { + buf.writeBoolean(true); + NetworkTools.writeItemStack(buf, this.itemStack); + } else { + buf.writeBoolean(false); + } + + buf.writeInt(this.style.getWidth()); + buf.writeInt(this.style.getHeight()); + buf.writeUtf(this.display); + buf.writeBoolean(this.displayName); + } + + @Override + public ResourceLocation getID() { + return RL; + } +} diff --git a/src/main/java/com/buuz135/functionalstorage/compat/top/FunctionalDrawerProvider.java b/src/main/java/com/buuz135/functionalstorage/compat/top/FunctionalDrawerProvider.java index 39816d7b..1e3fe24f 100644 --- a/src/main/java/com/buuz135/functionalstorage/compat/top/FunctionalDrawerProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/compat/top/FunctionalDrawerProvider.java @@ -1,180 +1,180 @@ -//package com.buuz135.functionalstorage.compat.top; -// -//import com.buuz135.functionalstorage.FunctionalStorage; -//import com.buuz135.functionalstorage.block.EnderDrawerBlock; -//import com.buuz135.functionalstorage.block.tile.*; -//import com.buuz135.functionalstorage.inventory.BigInventoryHandler; -//import com.buuz135.functionalstorage.inventory.CompactingInventoryHandler; -//import com.buuz135.functionalstorage.inventory.EnderInventoryHandler; -//import com.buuz135.functionalstorage.item.UpgradeItem; -//import com.buuz135.functionalstorage.util.NumberUtils; -//import com.buuz135.functionalstorage.world.EnderSavedData; -//import mcjty.theoneprobe.api.*; -//import mcjty.theoneprobe.apiimpl.elements.ElementHorizontal; -//import mcjty.theoneprobe.apiimpl.elements.ElementTank; -//import mcjty.theoneprobe.apiimpl.elements.ElementVertical; -//import mcjty.theoneprobe.apiimpl.styles.ProgressStyle; -//import net.minecraft.network.FriendlyByteBuf; -//import net.minecraft.network.chat.Component; -//import net.minecraft.resources.ResourceLocation; -//import net.minecraft.world.entity.player.Player; -//import net.minecraft.world.item.ItemStack; -//import net.minecraft.world.level.Level; -//import net.minecraft.world.level.block.entity.BlockEntity; -//import net.minecraft.world.level.block.state.BlockState; -//import org.apache.commons.lang3.text.WordUtils; -// -//import java.awt.Color; -//import java.util.Locale; -//import java.util.function.Function; -// -//public class FunctionalDrawerProvider implements IProbeInfoProvider { -// -// public static Function REGISTER = iTheOneProbe -> { -// iTheOneProbe.registerProvider(new FunctionalDrawerProvider()); -// iTheOneProbe.registerElementFactory(new IElementFactory() { -// @Override -// public IElement createElement(FriendlyByteBuf friendlyByteBuf) { -// return new CustomElementItemStack(friendlyByteBuf); -// } -// -// @Override -// public ResourceLocation getId() { -// return CustomElementItemStack.RL; -// } -// }); -// return null; -// }; -// -// @Override -// public ResourceLocation getID() { -// return new ResourceLocation(FunctionalStorage.MOD_ID, "drawer"); -// } -// -// @Override -// public void addProbeInfo(ProbeMode probeMode, IProbeInfo iProbeInfo, Player player, Level level, BlockState blockState, IProbeHitData iProbeHitData) { -// BlockEntity blockEntity = level.getBlockEntity(iProbeHitData.getPos()); -// if (blockEntity instanceof ControllableDrawerTile && !(blockEntity instanceof StorageControllerTile) && !(blockEntity instanceof StorageControllerExtensionTile)) { -// iProbeInfo.getElements().removeIf(iElement -> iElement instanceof ElementVertical); -// ElementVertical vertical = new ElementVertical(); -// if (blockEntity instanceof DrawerTile) { -// BigInventoryHandler handler = ((DrawerTile) blockEntity).getHandler(); -// if (handler.getSlots() == 1 || player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED) { -// ElementVertical elementVertical = new ElementVertical(iProbeInfo.defaultLayoutStyle().spacing(2).leftPadding(7).rightPadding(7)); -// elementVertical.getStyle().borderColor(Color.CYAN.darker().getRGB()); -// for (int i = 0; i < handler.getStoredStacks().size(); i++) { -// BigInventoryHandler.BigStack storedStack = handler.getStoredStacks().get(i); -// if (storedStack.getAmount() > 0 || (handler.isLocked() && !storedStack.getStack().isEmpty())) { -// elementVertical.element(new CustomElementItemStack(storedStack.getStack(), NumberUtils.getFormatedBigNumber(handler.getStackInSlot(i).getCount()) + "/" + NumberUtils.getFormatedBigNumber(handler.getSlotLimit(i)), iProbeInfo.defaultItemStyle(), true)); -// } -// } -// if (elementVertical.getElements().size() > 0) vertical.element(elementVertical); -// vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); -// } else { -// ElementHorizontal abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().spacing(8).leftPadding(7).rightPadding(7)); -// abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); -// for (int i = 0; i < handler.getStoredStacks().size(); i++) { -// BigInventoryHandler.BigStack storedStack = handler.getStoredStacks().get(i); -// if (storedStack.getAmount() > 0 || (handler.isLocked() && !storedStack.getStack().isEmpty())) { -// abstractElementPanel.element(new CustomElementItemStack(storedStack.getStack(), NumberUtils.getFormatedBigNumber(handler.getStackInSlot(i).getCount()) + "/" + NumberUtils.getFormatedBigNumber(handler.getSlotLimit(i)), iProbeInfo.defaultItemStyle())); -// } -// } -// if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); -// vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); -// } -// } -// if (blockEntity instanceof EnderDrawerTile) { -// ElementHorizontal abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().spacing(8).leftPadding(7).rightPadding(7)); -// abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); -// EnderInventoryHandler savedData = EnderSavedData.getInstance(level).getFrequency(((EnderDrawerTile) blockEntity).getFrequency()); -// for (int i = 0; i < savedData.getStoredStacks().size(); i++) { -// BigInventoryHandler.BigStack storedStack = savedData.getStoredStacks().get(i); -// if (storedStack.getAmount() > 0 || (savedData.isLocked() && !storedStack.getStack().isEmpty())) { -// abstractElementPanel.element(new CustomElementItemStack(storedStack.getStack(), NumberUtils.getFormatedBigNumber(storedStack.getAmount()) + "/" + NumberUtils.getFormatedBigNumber(savedData.getSlotLimit(i)), iProbeInfo.defaultItemStyle(), player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED)); -// } -// } -// if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); -// ElementVertical elementVertical = new ElementVertical(iProbeInfo.defaultLayoutStyle()); -// elementVertical.getStyle().borderColor(Color.CYAN.darker().getRGB()); -// elementVertical.text(Component.translatable("linkingtool.ender.frequency")); -// vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); -// abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().leftPadding(4).topPadding(2).rightPadding(4)); -// for (ItemStack stack : EnderDrawerBlock.getFrequencyDisplay(((EnderDrawerTile) blockEntity).getFrequency())) { -// abstractElementPanel.element(new CustomElementItemStack(stack, "", iProbeInfo.defaultItemStyle())); -// } -// elementVertical.element(abstractElementPanel); -// vertical.element(elementVertical); -// vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); -// } -// if (blockEntity instanceof CompactingDrawerTile) { -// CompactingInventoryHandler inventoryHandler = ((CompactingDrawerTile) blockEntity).getHandler(); -// if (player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED || inventoryHandler.isCreative()) { -// ElementVertical abstractElementPanel = new ElementVertical(iProbeInfo.defaultLayoutStyle().spacing(2).leftPadding(7).rightPadding(7)); -// abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); -// abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(2).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(2).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(2)), iProbeInfo.defaultItemStyle(), true)); -// abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(1).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(1).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(1)), iProbeInfo.defaultItemStyle(), true)); -// abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(0).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(0).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(0)), iProbeInfo.defaultItemStyle(), true)); -// if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); -// } else { -// ElementHorizontal abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().spacing(8).leftPadding(7).rightPadding(7)); -// abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); -// int amount = inventoryHandler.getAmount(); -// abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(2).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(2).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(2)), iProbeInfo.defaultItemStyle())); -// amount -= inventoryHandler.getResultList().get(2).getNeeded() * inventoryHandler.getStackInSlot(2).getCount(); -// abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(1).getResult(), NumberUtils.getFormatedBigNumber((int) Math.floor(amount / inventoryHandler.getResultList().get(1).getNeeded())), iProbeInfo.defaultItemStyle())); -// amount -= inventoryHandler.getResultList().get(1).getNeeded() * Math.floor(amount / inventoryHandler.getResultList().get(1).getNeeded()); -// abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(0).getResult(), NumberUtils.getFormatedBigNumber((int) Math.floor(amount / inventoryHandler.getResultList().get(0).getNeeded())), iProbeInfo.defaultItemStyle())); -// if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); -// } -// vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); -// } -// if (blockEntity instanceof SimpleCompactingDrawerTile) { -// CompactingInventoryHandler inventoryHandler = ((SimpleCompactingDrawerTile) blockEntity).getHandler(); -// if (player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED || inventoryHandler.isCreative()) { -// ElementVertical abstractElementPanel = new ElementVertical(iProbeInfo.defaultLayoutStyle().spacing(2).leftPadding(7).rightPadding(7)); -// abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); -// abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(1).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(1).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(1)), iProbeInfo.defaultItemStyle(), true)); -// abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(0).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(0).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(0)), iProbeInfo.defaultItemStyle(), true)); -// if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); -// } else { -// ElementHorizontal abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().spacing(8).leftPadding(7).rightPadding(7)); -// abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); -// int amount = inventoryHandler.getAmount(); -// abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(1).getResult(), NumberUtils.getFormatedBigNumber((int) Math.floor(amount / inventoryHandler.getResultList().get(1).getNeeded())), iProbeInfo.defaultItemStyle())); -// amount -= inventoryHandler.getResultList().get(1).getNeeded() * Math.floor(amount / inventoryHandler.getResultList().get(1).getNeeded()); -// abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(0).getResult(), NumberUtils.getFormatedBigNumber((int) Math.floor(amount / inventoryHandler.getResultList().get(0).getNeeded())), iProbeInfo.defaultItemStyle())); -// if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); -// } -// vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); -// } -// if (blockEntity instanceof FluidDrawerTile fluidDrawerTile && (player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED)) { -// ElementVertical tanksVertical = new ElementVertical(iProbeInfo.defaultLayoutStyle().spacing(2)); -// for (int i = 0; i < fluidDrawerTile.getFluidHandler().getTanks(); i++) { -// var tankReference = TankReference.createTank(fluidDrawerTile.getFluidHandler().getTankList()[i]); -// tanksVertical.element(new ElementTank(tankReference, new ProgressStyle().numberFormat(NumberFormat.COMPACT))); -// } -// iProbeInfo.element(tanksVertical); -// } -// if (player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED) { -// ElementHorizontal abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().topPadding(0).spacing(8).leftPadding(7).rightPadding(7)); -// abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); -// for (int i = 0; i < ((ControllableDrawerTile) blockEntity).getUtilityUpgrades().getSlots(); i++) { -// ItemStack stack = ((ControllableDrawerTile) blockEntity).getUtilityUpgrades().getStackInSlot(i); -// if (!stack.isEmpty()) { -// String extra = ""; -// if (stack.is(FunctionalStorage.PUSHING_UPGRADE.get()) || stack.is(FunctionalStorage.PULLING_UPGRADE.get()) || stack.is(FunctionalStorage.COLLECTOR_UPGRADE.get())) { -// extra = WordUtils.capitalize(UpgradeItem.getDirection(stack).name().toLowerCase(Locale.ROOT)); -// if (extra.equals("Up")) { -// extra = " " + extra; -// } -// } -// abstractElementPanel.element(new CustomElementItemStack(stack, extra, iProbeInfo.defaultItemStyle())); -// } -// } -// if (abstractElementPanel.getElements().size() > 0) vertical.element(abstractElementPanel); -// } -// iProbeInfo.element(vertical); -// } -// -// } -//} +package com.buuz135.functionalstorage.compat.top; + +import com.buuz135.functionalstorage.FunctionalStorage; +import com.buuz135.functionalstorage.block.EnderDrawerBlock; +import com.buuz135.functionalstorage.block.tile.*; +import com.buuz135.functionalstorage.inventory.BigInventoryHandler; +import com.buuz135.functionalstorage.inventory.CompactingInventoryHandler; +import com.buuz135.functionalstorage.inventory.EnderInventoryHandler; +import com.buuz135.functionalstorage.item.UpgradeItem; +import com.buuz135.functionalstorage.util.NumberUtils; +import com.buuz135.functionalstorage.world.EnderSavedData; +import mcjty.theoneprobe.api.*; +import mcjty.theoneprobe.apiimpl.elements.ElementHorizontal; +import mcjty.theoneprobe.apiimpl.elements.ElementTank; +import mcjty.theoneprobe.apiimpl.elements.ElementVertical; +import mcjty.theoneprobe.apiimpl.styles.ProgressStyle; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import org.apache.commons.lang3.text.WordUtils; + +import java.awt.Color; +import java.util.Locale; +import java.util.function.Function; + +public class FunctionalDrawerProvider implements IProbeInfoProvider { + + public static final Function REGISTER = iTheOneProbe -> { + iTheOneProbe.registerProvider(new FunctionalDrawerProvider()); + iTheOneProbe.registerElementFactory(new IElementFactory() { + @Override + public IElement createElement(FriendlyByteBuf friendlyByteBuf) { + return new CustomElementItemStack(friendlyByteBuf); + } + + @Override + public ResourceLocation getId() { + return CustomElementItemStack.RL; + } + }); + return null; + }; + + @Override + public ResourceLocation getID() { + return new ResourceLocation(FunctionalStorage.MOD_ID, "drawer"); + } + + @Override + public void addProbeInfo(ProbeMode probeMode, IProbeInfo iProbeInfo, Player player, Level level, BlockState blockState, IProbeHitData iProbeHitData) { + BlockEntity blockEntity = level.getBlockEntity(iProbeHitData.getPos()); + if (blockEntity instanceof ControllableDrawerTile && !(blockEntity instanceof StorageControllerTile) && !(blockEntity instanceof StorageControllerExtensionTile)) { + iProbeInfo.getElements().removeIf(iElement -> iElement instanceof ElementVertical); + ElementVertical vertical = new ElementVertical(); + if (blockEntity instanceof DrawerTile) { + BigInventoryHandler handler = ((DrawerTile) blockEntity).getHandler(); + if (handler.getSlots() == 1 || player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED) { + ElementVertical elementVertical = new ElementVertical(iProbeInfo.defaultLayoutStyle().spacing(2).leftPadding(7).rightPadding(7)); + elementVertical.getStyle().borderColor(Color.CYAN.darker().getRGB()); + for (int i = 0; i < handler.getStoredStacks().size(); i++) { + BigInventoryHandler.BigStack storedStack = handler.getStoredStacks().get(i); + if (storedStack.getAmount() > 0 || (handler.isLocked() && !storedStack.getStack().isEmpty())) { + elementVertical.element(new CustomElementItemStack(storedStack.getStack(), NumberUtils.getFormatedBigNumber(handler.getStackInSlot(i).getCount()) + "/" + NumberUtils.getFormatedBigNumber(handler.getSlotLimit(i)), iProbeInfo.defaultItemStyle(), true)); + } + } + if (!elementVertical.getElements().isEmpty()) vertical.element(elementVertical); + vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); + } else { + ElementHorizontal abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().spacing(8).leftPadding(7).rightPadding(7)); + abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); + for (int i = 0; i < handler.getStoredStacks().size(); i++) { + BigInventoryHandler.BigStack storedStack = handler.getStoredStacks().get(i); + if (storedStack.getAmount() > 0 || (handler.isLocked() && !storedStack.getStack().isEmpty())) { + abstractElementPanel.element(new CustomElementItemStack(storedStack.getStack(), NumberUtils.getFormatedBigNumber(handler.getStackInSlot(i).getCount()) + "/" + NumberUtils.getFormatedBigNumber(handler.getSlotLimit(i)), iProbeInfo.defaultItemStyle())); + } + } + if (!abstractElementPanel.getElements().isEmpty()) vertical.element(abstractElementPanel); + vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); + } + } + if (blockEntity instanceof EnderDrawerTile) { + ElementHorizontal abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().spacing(8).leftPadding(7).rightPadding(7)); + abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); + EnderInventoryHandler savedData = EnderSavedData.getInstance(level).getFrequency(((EnderDrawerTile) blockEntity).getFrequency()); + for (int i = 0; i < savedData.getStoredStacks().size(); i++) { + BigInventoryHandler.BigStack storedStack = savedData.getStoredStacks().get(i); + if (storedStack.getAmount() > 0 || (savedData.isLocked() && !storedStack.getStack().isEmpty())) { + abstractElementPanel.element(new CustomElementItemStack(storedStack.getStack(), NumberUtils.getFormatedBigNumber(storedStack.getAmount()) + "/" + NumberUtils.getFormatedBigNumber(savedData.getSlotLimit(i)), iProbeInfo.defaultItemStyle(), player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED)); + } + } + if (!abstractElementPanel.getElements().isEmpty()) vertical.element(abstractElementPanel); + ElementVertical elementVertical = new ElementVertical(iProbeInfo.defaultLayoutStyle()); + elementVertical.getStyle().borderColor(Color.CYAN.darker().getRGB()); + elementVertical.text(Component.translatable("linkingtool.ender.frequency")); + vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); + abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().leftPadding(4).topPadding(2).rightPadding(4)); + for (ItemStack stack : EnderDrawerBlock.getFrequencyDisplay(((EnderDrawerTile) blockEntity).getFrequency())) { + abstractElementPanel.element(new CustomElementItemStack(stack, "", iProbeInfo.defaultItemStyle())); + } + elementVertical.element(abstractElementPanel); + vertical.element(elementVertical); + vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); + } + if (blockEntity instanceof CompactingDrawerTile) { + CompactingInventoryHandler inventoryHandler = ((CompactingDrawerTile) blockEntity).getHandler(); + if (player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED || inventoryHandler.isCreative()) { + ElementVertical abstractElementPanel = new ElementVertical(iProbeInfo.defaultLayoutStyle().spacing(2).leftPadding(7).rightPadding(7)); + abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); + abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(2).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(2).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(2)), iProbeInfo.defaultItemStyle(), true)); + abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(1).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(1).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(1)), iProbeInfo.defaultItemStyle(), true)); + abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(0).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(0).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(0)), iProbeInfo.defaultItemStyle(), true)); + if (!abstractElementPanel.getElements().isEmpty()) vertical.element(abstractElementPanel); + } else { + ElementHorizontal abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().spacing(8).leftPadding(7).rightPadding(7)); + abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); + int amount = inventoryHandler.getAmount(); + abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(2).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(2).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(2)), iProbeInfo.defaultItemStyle())); + amount -= inventoryHandler.getResultList().get(2).getNeeded() * inventoryHandler.getStackInSlot(2).getCount(); + abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(1).getResult(), NumberUtils.getFormatedBigNumber((int) Math.floor(amount / inventoryHandler.getResultList().get(1).getNeeded())), iProbeInfo.defaultItemStyle())); + amount -= (int) (inventoryHandler.getResultList().get(1).getNeeded() * Math.floor(amount / inventoryHandler.getResultList().get(1).getNeeded())); + abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(0).getResult(), NumberUtils.getFormatedBigNumber((int) Math.floor(amount / inventoryHandler.getResultList().get(0).getNeeded())), iProbeInfo.defaultItemStyle())); + if (!abstractElementPanel.getElements().isEmpty()) vertical.element(abstractElementPanel); + } + vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); + } + if (blockEntity instanceof SimpleCompactingDrawerTile) { + CompactingInventoryHandler inventoryHandler = ((SimpleCompactingDrawerTile) blockEntity).getHandler(); + if (player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED || inventoryHandler.isCreative()) { + ElementVertical abstractElementPanel = new ElementVertical(iProbeInfo.defaultLayoutStyle().spacing(2).leftPadding(7).rightPadding(7)); + abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); + abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(1).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(1).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(1)), iProbeInfo.defaultItemStyle(), true)); + abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(0).getResult(), NumberUtils.getFormatedBigNumber(inventoryHandler.getStackInSlot(0).getCount()) + "/" + NumberUtils.getFormatedBigNumber(inventoryHandler.getSlotLimit(0)), iProbeInfo.defaultItemStyle(), true)); + if (!abstractElementPanel.getElements().isEmpty()) vertical.element(abstractElementPanel); + } else { + ElementHorizontal abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().spacing(8).leftPadding(7).rightPadding(7)); + abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); + int amount = inventoryHandler.getAmount(); + abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(1).getResult(), NumberUtils.getFormatedBigNumber((int) Math.floor(amount / inventoryHandler.getResultList().get(1).getNeeded())), iProbeInfo.defaultItemStyle())); + amount -= (int) (inventoryHandler.getResultList().get(1).getNeeded() * Math.floor(amount / inventoryHandler.getResultList().get(1).getNeeded())); + abstractElementPanel.element(new CustomElementItemStack(inventoryHandler.getResultList().get(0).getResult(), NumberUtils.getFormatedBigNumber((int) Math.floor(amount / inventoryHandler.getResultList().get(0).getNeeded())), iProbeInfo.defaultItemStyle())); + if (!abstractElementPanel.getElements().isEmpty()) vertical.element(abstractElementPanel); + } + vertical.element(new ElementVertical(iProbeInfo.defaultLayoutStyle().topPadding(4))); + } + if (blockEntity instanceof FluidDrawerTile fluidDrawerTile && (player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED)) { + ElementVertical tanksVertical = new ElementVertical(iProbeInfo.defaultLayoutStyle().spacing(2)); + for (int i = 0; i < fluidDrawerTile.getFluidHandler().getTanks(); i++) { + var tankReference = TankReference.createTank(fluidDrawerTile.getFluidHandler().getTankList()[i]); + tanksVertical.element(new ElementTank(tankReference, new ProgressStyle().numberFormat(NumberFormat.COMPACT))); + } + iProbeInfo.element(tanksVertical); + } + if (player.isShiftKeyDown() || probeMode == ProbeMode.EXTENDED) { + ElementHorizontal abstractElementPanel = new ElementHorizontal(iProbeInfo.defaultLayoutStyle().topPadding(0).spacing(8).leftPadding(7).rightPadding(7)); + abstractElementPanel.getStyle().borderColor(Color.CYAN.darker().getRGB()); + for (int i = 0; i < ((ControllableDrawerTile) blockEntity).getUtilityUpgrades().getSlots(); i++) { + ItemStack stack = ((ControllableDrawerTile) blockEntity).getUtilityUpgrades().getStackInSlot(i); + if (!stack.isEmpty()) { + String extra = ""; + if (stack.is(FunctionalStorage.PUSHING_UPGRADE.get()) || stack.is(FunctionalStorage.PULLING_UPGRADE.get()) || stack.is(FunctionalStorage.COLLECTOR_UPGRADE.get())) { + extra = WordUtils.capitalize(UpgradeItem.getDirection(stack).name().toLowerCase(Locale.ROOT)); + if (extra.equals("Up")) { + extra = " " + extra; + } + } + abstractElementPanel.element(new CustomElementItemStack(stack, extra, iProbeInfo.defaultItemStyle())); + } + } + if (!abstractElementPanel.getElements().isEmpty()) vertical.element(abstractElementPanel); + } + iProbeInfo.element(vertical); + } + + } +} diff --git a/src/main/java/com/buuz135/functionalstorage/compat/top/TOPPlugin.java b/src/main/java/com/buuz135/functionalstorage/compat/top/TOPPlugin.java new file mode 100644 index 00000000..42488492 --- /dev/null +++ b/src/main/java/com/buuz135/functionalstorage/compat/top/TOPPlugin.java @@ -0,0 +1,21 @@ +package com.buuz135.functionalstorage.compat.top; + +import com.hrznstudio.titanium.annotation.plugin.FeaturePlugin; +import com.hrznstudio.titanium.event.handler.EventManager; +import com.hrznstudio.titanium.plugin.FeaturePluginInstance; +import com.hrznstudio.titanium.plugin.PluginPhase; +import net.neoforged.fml.InterModComms; +import net.neoforged.fml.event.lifecycle.InterModEnqueueEvent; + +@FeaturePlugin(value = "theoneprobe", type = FeaturePlugin.FeaturePluginType.MOD) +public class TOPPlugin implements FeaturePluginInstance { + @Override + public void execute(PluginPhase phase) { + if (phase == PluginPhase.CONSTRUCTION) { + EventManager.mod(InterModEnqueueEvent.class).process(interModEnqueueEvent -> { + InterModComms.sendTo("theoneprobe", "getTheOneProbe", () -> FunctionalDrawerProvider.REGISTER); + }).subscribe(); + } + } + +} diff --git a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageLangProvider.java b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageLangProvider.java index bb2db5c1..42847654 100644 --- a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageLangProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageLangProvider.java @@ -96,5 +96,7 @@ protected void addTranslations() { this.add("gui.functionalstorage.storage", "Storage"); this.add("gui.functionalstorage.utility", "Utility"); this.add("gui.functionalstorage.storage_range", "Range"); + + this.add("config.jade.plugin_functionalstorage.drawer", "Functional Storage Drawers"); } } diff --git a/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java b/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java index dcef3d85..21baa5aa 100644 --- a/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java +++ b/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java @@ -1,10 +1,14 @@ package com.buuz135.functionalstorage.item; import com.buuz135.functionalstorage.FunctionalStorage; +import com.buuz135.functionalstorage.block.tile.ControllableDrawerTile; +import com.buuz135.functionalstorage.block.tile.FluidDrawerTile; +import com.hrznstudio.titanium.block.RotatableBlock; import com.hrznstudio.titanium.item.BasicItem; import net.minecraft.ChatFormatting; import net.minecraft.core.Direction; import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; import net.minecraft.sounds.SoundEvents; import net.minecraft.world.entity.SlotAccess; import net.minecraft.world.entity.player.Player; @@ -90,7 +94,7 @@ public void addTooltipDetails(@Nullable BasicItem.Key key, ItemStack stack, List super.addTooltipDetails(key, stack, tooltip, advanced); tooltip.add(Component.translatable("upgrade.type").withStyle(ChatFormatting.YELLOW).append(Component.translatable("upgrade.type." + getType().name().toLowerCase(Locale.ROOT)).withStyle(ChatFormatting.WHITE))); Item item = stack.getItem(); - if ((item.equals(FunctionalStorage.PULLING_UPGRADE.get()) || item.equals(FunctionalStorage.PUSHING_UPGRADE.get()) || item.equals(FunctionalStorage.COLLECTOR_UPGRADE.get())) && stack.hasData(FSAttachments.DIRECTION)) { + if (isDirectionUpgrade(item) && stack.hasData(FSAttachments.DIRECTION)) { tooltip.add(Component.translatable("item.utility.direction").withStyle(ChatFormatting.YELLOW).append(Component.translatable(WordUtils.capitalize(getDirection(stack).getName().toLowerCase(Locale.ROOT))).withStyle(ChatFormatting.WHITE))); tooltip.add(Component.literal("")); tooltip.add(Component.translatable("item.utility.direction.desc").withStyle(ChatFormatting.GRAY)); @@ -103,6 +107,51 @@ public void addTooltipDetails(@Nullable BasicItem.Key key, ItemStack stack, List } + public static boolean isDirectionUpgrade(Item item) { + return (item.equals(FunctionalStorage.PULLING_UPGRADE.get()) || item.equals(FunctionalStorage.PUSHING_UPGRADE.get()) || item.equals(FunctionalStorage.COLLECTOR_UPGRADE.get())); + } + + @Nullable + public Component getDescription(ItemStack stack, ControllableDrawerTile tile) { + var dir = tile.getBlockState().getValue(RotatableBlock.FACING_HORIZONTAL); + var type = tile instanceof FluidDrawerTile ? "fluids" : "items"; + if (this == FunctionalStorage.PUSHING_UPGRADE.get()) { + return Component.literal("Pushes " + type + ": ").append(getRelativeDirection( + getDirection(stack), dir + ).withStyle(ChatFormatting.GOLD)); + } else if (this == FunctionalStorage.PULLING_UPGRADE.get()) { + return Component.literal("Pulls " + type + ": ").append(getRelativeDirection( + getDirection(stack), dir + ).withStyle(ChatFormatting.GOLD)); + } else if (this == FunctionalStorage.COLLECTOR_UPGRADE.get()) { + return Component.literal("Collects item entities: ").append(getRelativeDirection( + getDirection(stack), dir + ).withStyle(ChatFormatting.GOLD)); + } else if (this == FunctionalStorage.VOID_UPGRADE.get()) { + return Component.literal("Voids excess " + type); + } else if (this == FunctionalStorage.REDSTONE_UPGRADE.get()) { + return Component.literal("Emitting redstone signal for slot ").append(Component.literal( + String.valueOf(stack.getData(FSAttachments.SLOT)) + ).withStyle(ChatFormatting.RED)); + } + return null; + } + + public static MutableComponent getRelativeDirection(Direction upgrade, Direction facing) { + if (upgrade == facing) { + return Component.literal("front"); + } else if (upgrade == facing.getOpposite()) { + return Component.literal("back"); + } else if (upgrade == Direction.UP) { + return Component.literal("up"); + } else if (upgrade == Direction.DOWN) { + return Component.literal("down"); + } else if (upgrade == facing.getClockWise()) { + return Component.literal("left"); + } + return Component.literal("right"); + } + @Override public boolean hasTooltipDetails(@Nullable BasicItem.Key key) { return key == null; From f5cffd847ec43af14f292af6adbed77f8b9deaa9 Mon Sep 17 00:00:00 2001 From: Matyrobbrt Date: Mon, 8 Apr 2024 18:43:51 +0300 Subject: [PATCH 07/20] Fixes and translations --- gradle.properties | 4 +- .../361def3a0b0e87157892b021be1ddec9d13d5e52 | 4 +- .../58b100d11464fc6de03e6a16617c8d741d90a73a | 4 +- .../9b4b2fe28e6a198629709c0c8772cb00a8b15d4a | 4 +- .../assets/functionalstorage/lang/en_us.json | 17 ++++ .../functionalstorage/tags/items/drawer.json | 24 +++--- .../minecraft/tags/blocks/mineable/axe.json | 24 +++--- .../functionalstorage/FunctionalStorage.java | 11 ++- .../block/tile/FluidDrawerTile.java | 9 +++ .../tile/ItemControllableDrawerTile.java | 9 +++ .../functionalstorage/client/ClientSetup.java | 2 +- .../client/FluidDrawerRenderer.java | 12 +-- .../compat/jade/DrawerComponentProvider.java | 81 ++++++++++++++++--- .../data/FunctionalStorageLangProvider.java | 20 +++++ .../item/CompactingStackItemHandler.java | 2 +- .../functionalstorage/item/UpgradeItem.java | 24 +++--- .../functionalstorage/util/TooltipUtil.java | 3 + src/main/resources/META-INF/mods.toml | 2 +- 18 files changed, 188 insertions(+), 68 deletions(-) diff --git a/gradle.properties b/gradle.properties index f7581260..db9aa017 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.jvmargs=-Xmx2048M modGroup=com.buuz135 -mod_version=2.4.0 -modBaseName=rsrequestify +mod_version=1.0.0 +modBaseName=functionalstorage neo_version=20.4.200 jei_version=17.3.0.49 diff --git a/src/generated/resources/.cache/361def3a0b0e87157892b021be1ddec9d13d5e52 b/src/generated/resources/.cache/361def3a0b0e87157892b021be1ddec9d13d5e52 index 5b314f2e..0f9b7f7f 100644 --- a/src/generated/resources/.cache/361def3a0b0e87157892b021be1ddec9d13d5e52 +++ b/src/generated/resources/.cache/361def3a0b0e87157892b021be1ddec9d13d5e52 @@ -1,2 +1,2 @@ -// 1.20.4 2024-04-08T00:24:18.5149232 Languages: en_us for mod: functionalstorage -19777c8bec78c9b2fee083a0691e2a5733abf052 assets/functionalstorage/lang/en_us.json +// 1.20.4 2024-04-08T18:04:01.0611315 Languages: en_us for mod: functionalstorage +b19790b3d072a6c205ea1c45096b36437dde4fbf assets/functionalstorage/lang/en_us.json diff --git a/src/generated/resources/.cache/58b100d11464fc6de03e6a16617c8d741d90a73a b/src/generated/resources/.cache/58b100d11464fc6de03e6a16617c8d741d90a73a index 592ca22d..1d41c38d 100644 --- a/src/generated/resources/.cache/58b100d11464fc6de03e6a16617c8d741d90a73a +++ b/src/generated/resources/.cache/58b100d11464fc6de03e6a16617c8d741d90a73a @@ -1,2 +1,2 @@ -// 1.20.4 2024-04-08T00:24:18.518918 Functional Storage Item Tags -6c2aa8af2200df22b202c6a5806cc67c8d6d5ec8 data/functionalstorage/tags/items/drawer.json +// 1.20.4 2024-04-08T16:50:44.7219947 Functional Storage Item Tags +e72c53e88ffb2ff0aed4d46bafae940a49fe9e97 data/functionalstorage/tags/items/drawer.json diff --git a/src/generated/resources/.cache/9b4b2fe28e6a198629709c0c8772cb00a8b15d4a b/src/generated/resources/.cache/9b4b2fe28e6a198629709c0c8772cb00a8b15d4a index 6f284f8d..d16a39c6 100644 --- a/src/generated/resources/.cache/9b4b2fe28e6a198629709c0c8772cb00a8b15d4a +++ b/src/generated/resources/.cache/9b4b2fe28e6a198629709c0c8772cb00a8b15d4a @@ -1,3 +1,3 @@ -// 1.20.4 2024-04-08T00:24:18.5209168 Tags for minecraft:block mod id functionalstorage -6c2aa8af2200df22b202c6a5806cc67c8d6d5ec8 data/minecraft/tags/blocks/mineable/axe.json +// 1.20.4 2024-04-08T16:50:44.7249944 Tags for minecraft:block mod id functionalstorage +e72c53e88ffb2ff0aed4d46bafae940a49fe9e97 data/minecraft/tags/blocks/mineable/axe.json 4b6fc75faca16170a17220f0e301b16866f4bc5c data/minecraft/tags/blocks/mineable/pickaxe.json diff --git a/src/generated/resources/assets/functionalstorage/lang/en_us.json b/src/generated/resources/assets/functionalstorage/lang/en_us.json index 95adccd1..7e1d4212 100644 --- a/src/generated/resources/assets/functionalstorage/lang/en_us.json +++ b/src/generated/resources/assets/functionalstorage/lang/en_us.json @@ -58,6 +58,23 @@ "configurationtool.configmode.toggle_upgrades": "Hide/Show Upgrade Renders", "configurationtool.use": "Sneak + Right Click in the air to change modes. Right click a drawer to toggle the option.", "drawer.block.contents": "Contents: ", + "drawer.block.multiplier": "Storage multiplier: %s", + "drawer_upgrade.functionalstorage.collect.fluid": "Picks up fluids: %s", + "drawer_upgrade.functionalstorage.collect.item": "Collects item entities: %s", + "drawer_upgrade.functionalstorage.pull.fluid": "Pulls fluids: %s", + "drawer_upgrade.functionalstorage.pull.item": "Pulls items: %s", + "drawer_upgrade.functionalstorage.push.fluid": "Pushes fluids: %s", + "drawer_upgrade.functionalstorage.push.item": "Pushes items: %s", + "drawer_upgrade.functionalstorage.redstone": "Emitting redstone signal for slot %s", + "drawer_upgrade.functionalstorage.relative_direction": "Relative direction: %s", + "drawer_upgrade.functionalstorage.sides.back": "back", + "drawer_upgrade.functionalstorage.sides.down": "down", + "drawer_upgrade.functionalstorage.sides.front": "front", + "drawer_upgrade.functionalstorage.sides.left": "left", + "drawer_upgrade.functionalstorage.sides.right": "right", + "drawer_upgrade.functionalstorage.sides.up": "up", + "drawer_upgrade.functionalstorage.void.fluid": "Voids excess fluids", + "drawer_upgrade.functionalstorage.void.item": "Voids excess items", "frameddrawer.use": "How 2 Change Texture: \nInside a crafting window place the block you want use the texture of for the outside of the drawer in the first slot of the crafting window, on the second slot put the block that will be used for the texture on the inside of the framed drawer and on the third slot put a framed drawer. You can change the drawer divider texture by adding a block into the 4th slot\n", "gui.functionalstorage.amount": "Amount: ", "gui.functionalstorage.fluid": "Fluid: ", diff --git a/src/generated/resources/data/functionalstorage/tags/items/drawer.json b/src/generated/resources/data/functionalstorage/tags/items/drawer.json index 1f2e45d3..bb20db0b 100644 --- a/src/generated/resources/data/functionalstorage/tags/items/drawer.json +++ b/src/generated/resources/data/functionalstorage/tags/items/drawer.json @@ -1,5 +1,16 @@ { "values": [ + "functionalstorage:oak_4", + "functionalstorage:spruce_4", + "functionalstorage:birch_4", + "functionalstorage:jungle_4", + "functionalstorage:acacia_4", + "functionalstorage:dark_oak_4", + "functionalstorage:crimson_4", + "functionalstorage:warped_4", + "functionalstorage:mangrove_4", + "functionalstorage:cherry_4", + "functionalstorage:framed_4", "functionalstorage:oak_2", "functionalstorage:spruce_2", "functionalstorage:birch_2", @@ -21,17 +32,6 @@ "functionalstorage:warped_1", "functionalstorage:mangrove_1", "functionalstorage:cherry_1", - "functionalstorage:framed_1", - "functionalstorage:oak_4", - "functionalstorage:spruce_4", - "functionalstorage:birch_4", - "functionalstorage:jungle_4", - "functionalstorage:acacia_4", - "functionalstorage:dark_oak_4", - "functionalstorage:crimson_4", - "functionalstorage:warped_4", - "functionalstorage:mangrove_4", - "functionalstorage:cherry_4", - "functionalstorage:framed_4" + "functionalstorage:framed_1" ] } \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json b/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json index 1f2e45d3..bb20db0b 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json +++ b/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json @@ -1,5 +1,16 @@ { "values": [ + "functionalstorage:oak_4", + "functionalstorage:spruce_4", + "functionalstorage:birch_4", + "functionalstorage:jungle_4", + "functionalstorage:acacia_4", + "functionalstorage:dark_oak_4", + "functionalstorage:crimson_4", + "functionalstorage:warped_4", + "functionalstorage:mangrove_4", + "functionalstorage:cherry_4", + "functionalstorage:framed_4", "functionalstorage:oak_2", "functionalstorage:spruce_2", "functionalstorage:birch_2", @@ -21,17 +32,6 @@ "functionalstorage:warped_1", "functionalstorage:mangrove_1", "functionalstorage:cherry_1", - "functionalstorage:framed_1", - "functionalstorage:oak_4", - "functionalstorage:spruce_4", - "functionalstorage:birch_4", - "functionalstorage:jungle_4", - "functionalstorage:acacia_4", - "functionalstorage:dark_oak_4", - "functionalstorage:crimson_4", - "functionalstorage:warped_4", - "functionalstorage:mangrove_4", - "functionalstorage:cherry_4", - "functionalstorage:framed_4" + "functionalstorage:framed_1" ] } \ No newline at end of file diff --git a/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java b/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java index 5d85a6a5..3427a00a 100644 --- a/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java +++ b/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java @@ -79,6 +79,7 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.ItemLike; @@ -213,7 +214,7 @@ public FunctionalStorage(Dist dist, IEventBus modBus) { }) .subscribe(); - EventManager.mod(RegisterCapabilitiesEvent.class).process(event -> { + modBus.addListener((final RegisterCapabilitiesEvent event) -> { event.registerItem(Capabilities.ItemHandler.ITEM, (object, context) -> { if (object.getItem() instanceof DrawerBlock.DrawerItem di) { return di.initCapabilities(object); @@ -412,7 +413,7 @@ public void onClient() { ItemBlockRenderTypes.setRenderLayer(FRAMED_SIMPLE_COMPACTING_DRAWER.getBlock(), RenderType.cutout()); }).subscribe(); EventManager.forge(RenderTooltipEvent.Pre.class).process(itemTooltipEvent -> { - if (itemTooltipEvent.getItemStack().getItem().equals(FunctionalStorage.ENDER_DRAWER.getBlock().asItem()) && itemTooltipEvent.getItemStack().hasTag()) { + if (itemTooltipEvent.getItemStack().getItem().equals(FunctionalStorage.ENDER_DRAWER.getBlock().asItem()) && itemTooltipEvent.getItemStack().hasData(FSAttachments.TILE)) { TooltipUtil.renderItems(itemTooltipEvent.getGraphics(), EnderDrawerBlock.getFrequencyDisplay(itemTooltipEvent.getItemStack().getData(FSAttachments.TILE).getString("frequency")), itemTooltipEvent.getX() + 14, itemTooltipEvent.getY() + 11); } if (itemTooltipEvent.getItemStack().is(FunctionalStorage.LINKING_TOOL.get()) && itemTooltipEvent.getItemStack().hasData(FSAttachments.ENDER_FREQUENCY)) { @@ -423,8 +424,10 @@ public void onClient() { if (iItemHandler instanceof DrawerStackItemHandler) { int i = 0; for (BigInventoryHandler.BigStack storedStack : ((DrawerStackItemHandler) iItemHandler).getStoredStacks()) { - TooltipUtil.renderItemAdvanced(itemTooltipEvent.getGraphics(), storedStack.getStack(), itemTooltipEvent.getX() + 20 + 26 * i, itemTooltipEvent.getY() + 11, 512, NumberUtils.getFormatedBigNumber(storedStack.getAmount()) + "/" + NumberUtils.getFormatedBigNumber(iItemHandler.getSlotLimit(i))); - ++i; + if (storedStack.getStack().getItem() != Items.AIR) { + TooltipUtil.renderItemAdvanced(itemTooltipEvent.getGraphics(), storedStack.getStack(), itemTooltipEvent.getX() + 20 + 32 * i, itemTooltipEvent.getY() + 11, 512, NumberUtils.getFormatedBigNumber(storedStack.getAmount()) + "/" + NumberUtils.getFormatedBigNumber(iItemHandler.getSlotLimit(i))); + ++i; + } } } if (iItemHandler instanceof CompactingStackItemHandler compactingStackItemHandler) { diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java index e6c4b510..650144ee 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java @@ -266,6 +266,15 @@ public boolean isEverythingEmpty() { return true; } + public boolean isInventoryEmpty() { + for (int i = 0; i < getFluidHandler().getTanks(); i++) { + if (!getFluidHandler().getFluidInTank(i).isEmpty()) { + return false; + } + } + return false; + } + @Override public InventoryComponent> getStorageUpgradesConstructor() { return new InventoryComponent>("storage_upgrades", 10, 70, getStorageSlotAmount()) { diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java index 6cefbd6e..2121bdfb 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java @@ -235,6 +235,15 @@ public boolean isEverythingEmpty() { return true; } + public boolean isInventoryEmpty() { + for (int i = 0; i < getStorage().getSlots(); i++) { + if (!getStorage().getStackInSlot(i).isEmpty()) { + return false; + } + } + return true; + } + @Override public int getTitleColor() { return ChatFormatting.DARK_GRAY.getColor(); diff --git a/src/main/java/com/buuz135/functionalstorage/client/ClientSetup.java b/src/main/java/com/buuz135/functionalstorage/client/ClientSetup.java index e651b11c..f828c327 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/ClientSetup.java +++ b/src/main/java/com/buuz135/functionalstorage/client/ClientSetup.java @@ -19,7 +19,7 @@ public static void init() { .process(event -> { var sc = (BasicAddonScreen) Minecraft.getInstance().screen; var direction = ((ItemControllableDrawerTile) sc.getMenu().getObject()).getBlockState().getValue(RotatableBlock.FACING_HORIZONTAL); - event.getToolTip().add(Component.literal("Relative direction: ").append(UpgradeItem.getRelativeDirection( + event.getToolTip().add(Component.translatable("drawer_upgrade.functionalstorage.relative_direction", UpgradeItem.getRelativeDirection( UpgradeItem.getDirection(event.getItemStack()), direction ).withStyle(ChatFormatting.GOLD))); }).subscribe(); diff --git a/src/main/java/com/buuz135/functionalstorage/client/FluidDrawerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/FluidDrawerRenderer.java index 040a2bb7..3b722a7d 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/FluidDrawerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/FluidDrawerRenderer.java @@ -47,12 +47,12 @@ public static void renderFluidStack(PoseStack matrixStack, MultiBufferSource buf float y2 = (float) bounds.maxY; float z1 = (float) bounds.minZ; float z2 = (float) bounds.maxZ; - float bx1 = (float) bounds.minX * 16; - float bx2 = (float) bounds.maxX * 16; - float by1 = (float) bounds.minY * 16; - float by2 = (float) bounds.maxY * 16; - float bz1 = (float) bounds.minZ * 16; - float bz2 = (float) bounds.maxZ * 16; + float bx1 = (float) bounds.minX* 1.0f; + float bx2 = (float) bounds.maxX* 1.0f; + float by1 = (float) bounds.minY* 1.0f; + float by2 = (float) bounds.maxY* 1.0f; + float bz1 = (float) bounds.minZ* 1.0f; + float bz2 = (float) bounds.maxZ* 1.0f; Matrix4f posMat = matrixStack.last().pose(); diff --git a/src/main/java/com/buuz135/functionalstorage/compat/jade/DrawerComponentProvider.java b/src/main/java/com/buuz135/functionalstorage/compat/jade/DrawerComponentProvider.java index c2fcf59a..f188a4ef 100644 --- a/src/main/java/com/buuz135/functionalstorage/compat/jade/DrawerComponentProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/compat/jade/DrawerComponentProvider.java @@ -1,25 +1,40 @@ package com.buuz135.functionalstorage.compat.jade; import com.buuz135.functionalstorage.FunctionalStorage; +import com.buuz135.functionalstorage.block.EnderDrawerBlock; +import com.buuz135.functionalstorage.block.tile.ControllableDrawerTile; +import com.buuz135.functionalstorage.block.tile.EnderDrawerTile; +import com.buuz135.functionalstorage.block.tile.FluidDrawerTile; import com.buuz135.functionalstorage.block.tile.ItemControllableDrawerTile; import com.buuz135.functionalstorage.inventory.BigInventoryHandler; import com.buuz135.functionalstorage.inventory.CompactingInventoryHandler; +import com.buuz135.functionalstorage.inventory.EnderInventoryHandler; import com.buuz135.functionalstorage.item.UpgradeItem; +import com.buuz135.functionalstorage.network.EnderDrawerSyncMessage; import com.buuz135.functionalstorage.util.NumberUtils; +import com.buuz135.functionalstorage.world.EnderSavedData; import com.mojang.datafixers.util.Pair; +import net.minecraft.ChatFormatting; +import net.minecraft.client.Minecraft; import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.vehicle.Minecart; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; +import net.minecraft.world.level.material.Fluids; import net.minecraft.world.phys.Vec2; +import net.neoforged.neoforge.fluids.FluidStack; import snownee.jade.api.BlockAccessor; import snownee.jade.api.IBlockComponentProvider; import snownee.jade.api.ITooltip; import snownee.jade.api.config.IPluginConfig; +import snownee.jade.api.fluid.JadeFluidObject; import snownee.jade.api.ui.BoxStyle; import snownee.jade.api.ui.IElement; import snownee.jade.api.ui.IElementHelper; +import snownee.jade.api.ui.ProgressStyle; +import snownee.jade.api.view.FluidView; import java.util.ArrayList; @@ -32,13 +47,22 @@ public enum DrawerComponentProvider implements IBlockComponentProvider { @Override public void appendTooltip(ITooltip iTooltip, BlockAccessor blockAccessor, IPluginConfig iPluginConfig) { iTooltip.remove(ITEM_STORAGE); + iTooltip.remove(new ResourceLocation("minecraft:fluid_storage")); var helper = IElementHelper.get(); - if (blockAccessor.getBlockEntity() instanceof ItemControllableDrawerTile tile) { - if (!tile.isEverythingEmpty()) { + if (blockAccessor.getBlockEntity() instanceof ControllableDrawerTile controllable) { + if (blockAccessor.getBlockEntity() instanceof ItemControllableDrawerTile tile) { var stacks = new ArrayList>(); - if (tile.getStorage() instanceof BigInventoryHandler bigInv) { - for (int slot = 0; slot < tile.getStorage().getSlots(); slot++) { + if (tile instanceof EnderDrawerTile ed && ed.getFrequency() != null) { + var inv = EnderSavedData.getInstance(Minecraft.getInstance().level).getFrequency(ed.getFrequency()); + for (int slot = 0; slot < inv.getSlots(); slot++) { + var stack = inv.getStoredStacks().get(slot); + if (stack.getStack().getItem() != Items.AIR) { + stacks.add(new Pair<>(stack.getStack().copyWithCount(stack.getAmount()), inv.getSlotLimit(slot))); + } + } + } else if (tile.getStorage() instanceof BigInventoryHandler bigInv) { + for (int slot = 0; slot < bigInv.getStoredStacks().size(); slot++) { var stack = bigInv.getStoredStacks().get(slot); if (stack.getStack().getItem() != Items.AIR) { stacks.add(new Pair<>(stack.getStack().copyWithCount(stack.getAmount()), bigInv.getSlotLimit(slot))); @@ -56,7 +80,7 @@ public void appendTooltip(ITooltip iTooltip, BlockAccessor blockAccessor, IPlugi if (!stacks.isEmpty()) { var contentsBox = helper.tooltip(); - iTooltip.add(helper.text(Component.literal("Contents:"))); + iTooltip.add(helper.text(Component.translatable("drawer.block.contents"))); for (var stack : stacks) { // Account for locked slots too boolean wasEmpty = stack.getFirst().getCount() == 0; @@ -71,17 +95,52 @@ public void appendTooltip(ITooltip iTooltip, BlockAccessor blockAccessor, IPlugi } iTooltip.add(helper.box(contentsBox, BoxStyle.getNestedBox())); } + } else if (blockAccessor.getBlockEntity() instanceof FluidDrawerTile tile) { + if (!tile.isInventoryEmpty()) { + var stacks = new ArrayList>(); + for (int slot = 0; slot < tile.getFluidHandler().getTanks(); slot++) { + var stack = tile.getFluidHandler().getTankList()[slot]; + if (stack.getFluid().getFluid() != Fluids.EMPTY) { + stacks.add(new Pair<>(stack.getFluid().copyWithAmount(stack.getFluidAmount()), tile.getFluidHandler().getTankCapacity(slot))); + } + } - if (Screen.hasShiftDown()) { - var upInv = tile.getUtilityUpgrades(); - for (int i = 0; i < upInv.getSlots(); i++) { - var stack = upInv.getStackInSlot(i); - if (stack.getItem() instanceof UpgradeItem ui) { - iTooltip.add(ui.getDescription(stack, tile)); + if (!stacks.isEmpty()) { + var contentsBox = helper.tooltip(); + iTooltip.add(helper.text(Component.translatable("drawer.block.contents"))); + for (var stack : stacks) { + var view = new FluidView(helper.fluid(JadeFluidObject.of(stack.getFirst().getRawFluid()))); + ProgressStyle progressStyle = helper.progressStyle().overlay(view.overlay); + contentsBox.add(helper.progress((float) stack.getFirst().getAmount() / stack.getSecond(), Component.empty().append(stack.getFirst().getDisplayName()).append(Component.literal(" x ").append(NumberUtils.getFormatedFluidBigNumber(stack.getFirst().getAmount()) + " / " + NumberUtils.getFormatedFluidBigNumber(stack.getSecond()))), progressStyle, BoxStyle.getNestedBox(), true)); } + iTooltip.add(helper.box(contentsBox, BoxStyle.getNestedBox())); } } } + + if (controllable instanceof EnderDrawerTile ender && ender.getFrequency() != null) { + var freq = EnderDrawerBlock.getFrequencyDisplay(ender.getFrequency()); + var contentsBox = helper.tooltip(); + iTooltip.add(helper.text(Component.translatable("linkingtool.ender.frequency"))); + for (var stack : freq) { + contentsBox.append(helper.item(stack)); + } + iTooltip.add(helper.box(contentsBox, BoxStyle.getNestedBox())); + } + + if (Screen.hasShiftDown()) { + var upInv = controllable.getUtilityUpgrades(); + for (int i = 0; i < upInv.getSlots(); i++) { + var stack = upInv.getStackInSlot(i); + if (stack.getItem() instanceof UpgradeItem ui) { + iTooltip.add(ui.getDescription(stack, controllable)); + } + } + if (controllable.getStorageMultiplier() > 1) { + iTooltip.add(Component.translatable("drawer.block.multiplier", + Component.literal("x" + controllable.getStorageMultiplier()).withStyle(ChatFormatting.GOLD))); + } + } } } diff --git a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageLangProvider.java b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageLangProvider.java index 42847654..2bbb7086 100644 --- a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageLangProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageLangProvider.java @@ -85,6 +85,7 @@ protected void addTranslations() { this.add("linkingtool.ender.frequency", "Frequency: "); this.add("linkingtool.ender.clear", "Sneak + Right Click in the air to clear frequency."); this.add("drawer.block.contents", "Contents: "); + this.add("drawer.block.multiplier", "Storage multiplier: %s"); this.add("frameddrawer.use", "How 2 Change Texture: \nInside a crafting window place the block you want use the texture of for the outside of the drawer in the first slot of the crafting window, on the second slot put the block that will be used for the texture on the inside of the framed drawer and on the third slot put a framed drawer. You can change the drawer divider texture by adding a block into the 4th slot\n"); this.add("item.utility.slot", "Slot: "); this.add("item.utility.slot.desc", "Right click in a GUI to change slot"); @@ -97,6 +98,25 @@ protected void addTranslations() { this.add("gui.functionalstorage.utility", "Utility"); this.add("gui.functionalstorage.storage_range", "Range"); + this.add("drawer_upgrade.functionalstorage.sides.up", "up"); + this.add("drawer_upgrade.functionalstorage.sides.down", "down"); + this.add("drawer_upgrade.functionalstorage.sides.left", "left"); + this.add("drawer_upgrade.functionalstorage.sides.right", "right"); + this.add("drawer_upgrade.functionalstorage.sides.front", "front"); + this.add("drawer_upgrade.functionalstorage.sides.back", "back"); + + this.add("drawer_upgrade.functionalstorage.void.item", "Voids excess items"); + this.add("drawer_upgrade.functionalstorage.void.fluid", "Voids excess fluids"); + this.add("drawer_upgrade.functionalstorage.pull.item", "Pulls items: %s"); + this.add("drawer_upgrade.functionalstorage.pull.fluid", "Pulls fluids: %s"); + this.add("drawer_upgrade.functionalstorage.push.item", "Pushes items: %s"); + this.add("drawer_upgrade.functionalstorage.push.fluid", "Pushes fluids: %s"); + this.add("drawer_upgrade.functionalstorage.collect.item", "Collects item entities: %s"); + this.add("drawer_upgrade.functionalstorage.collect.fluid", "Picks up fluids: %s"); + + this.add("drawer_upgrade.functionalstorage.redstone", "Emitting redstone signal for slot %s"); + this.add("drawer_upgrade.functionalstorage.relative_direction", "Relative direction: %s"); + this.add("config.jade.plugin_functionalstorage.drawer", "Functional Storage Drawers"); } } diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingStackItemHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingStackItemHandler.java index 29eabaaf..a4ab502e 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingStackItemHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingStackItemHandler.java @@ -49,7 +49,7 @@ public CompactingStackItemHandler(ItemStack stack, int slots) { this.downgrade = false; this.isVoid = false; this.isCreative = false; - if (stack.hasTag()) { + if (stack.hasData(FSAttachments.TILE)) { var tile = stack.getData(FSAttachments.TILE); deserializeNBT(tile.getCompound("handler")); for (Tag tag : tile.getCompound("storageUpgrades").getList("Items", Tag.TAG_COMPOUND)) { diff --git a/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java b/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java index 21baa5aa..93caafdd 100644 --- a/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java +++ b/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java @@ -114,23 +114,23 @@ public static boolean isDirectionUpgrade(Item item) { @Nullable public Component getDescription(ItemStack stack, ControllableDrawerTile tile) { var dir = tile.getBlockState().getValue(RotatableBlock.FACING_HORIZONTAL); - var type = tile instanceof FluidDrawerTile ? "fluids" : "items"; + var type = tile instanceof FluidDrawerTile ? "fluid" : "item"; if (this == FunctionalStorage.PUSHING_UPGRADE.get()) { - return Component.literal("Pushes " + type + ": ").append(getRelativeDirection( + return Component.translatable("drawer_upgrade.functionalstorage.push." + type, getRelativeDirection( getDirection(stack), dir ).withStyle(ChatFormatting.GOLD)); } else if (this == FunctionalStorage.PULLING_UPGRADE.get()) { - return Component.literal("Pulls " + type + ": ").append(getRelativeDirection( + return Component.translatable("drawer_upgrade.functionalstorage.pull." + type, getRelativeDirection( getDirection(stack), dir ).withStyle(ChatFormatting.GOLD)); } else if (this == FunctionalStorage.COLLECTOR_UPGRADE.get()) { - return Component.literal("Collects item entities: ").append(getRelativeDirection( + return Component.translatable("drawer_upgrade.functionalstorage.collect." + type, getRelativeDirection( getDirection(stack), dir ).withStyle(ChatFormatting.GOLD)); } else if (this == FunctionalStorage.VOID_UPGRADE.get()) { - return Component.literal("Voids excess " + type); + return Component.translatable("drawer_upgrade.functionalstorage.void." + type); } else if (this == FunctionalStorage.REDSTONE_UPGRADE.get()) { - return Component.literal("Emitting redstone signal for slot ").append(Component.literal( + return Component.translatable("drawer_upgrade.functionalstorage.redstone", Component.literal( String.valueOf(stack.getData(FSAttachments.SLOT)) ).withStyle(ChatFormatting.RED)); } @@ -139,17 +139,17 @@ public Component getDescription(ItemStack stack, ControllableDrawerTile tile) public static MutableComponent getRelativeDirection(Direction upgrade, Direction facing) { if (upgrade == facing) { - return Component.literal("front"); + return Component.translatable("drawer_upgrade.functionalstorage.sides.front"); } else if (upgrade == facing.getOpposite()) { - return Component.literal("back"); + return Component.translatable("drawer_upgrade.functionalstorage.sides.back"); } else if (upgrade == Direction.UP) { - return Component.literal("up"); + return Component.translatable("drawer_upgrade.functionalstorage.sides.up"); } else if (upgrade == Direction.DOWN) { - return Component.literal("down"); + return Component.translatable("drawer_upgrade.functionalstorage.sides.down"); } else if (upgrade == facing.getClockWise()) { - return Component.literal("left"); + return Component.translatable("drawer_upgrade.functionalstorage.sides.left"); } - return Component.literal("right"); + return Component.translatable("drawer_upgrade.functionalstorage.sides.right"); } @Override diff --git a/src/main/java/com/buuz135/functionalstorage/util/TooltipUtil.java b/src/main/java/com/buuz135/functionalstorage/util/TooltipUtil.java index 8cbadd35..95260454 100644 --- a/src/main/java/com/buuz135/functionalstorage/util/TooltipUtil.java +++ b/src/main/java/com/buuz135/functionalstorage/util/TooltipUtil.java @@ -34,8 +34,11 @@ public static void renderItemIntoGUI(GuiGraphics guiGraphics, ItemStack stack, i } public static void renderItemAdvanced(GuiGraphics guiGraphics, ItemStack stack, int x, int y, int z, String amount) { + guiGraphics.pose().pushPose(); + guiGraphics.pose().translate(0, 0, z); renderItemModelIntoGUI(guiGraphics, stack, x, y, z, Minecraft.getInstance().getItemRenderer().getModel(stack, (Level) null, (LivingEntity) null, 0)); renderItemStackOverlay(guiGraphics, Minecraft.getInstance().font, stack, x, y, amount, amount.length() - 2); + guiGraphics.pose().popPose(); } public static void renderItemStackOverlay(GuiGraphics guiGraphics, Font fr, ItemStack stack, int xPosition, int yPosition, @Nullable String text, int scaled) { diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 4c94d4d8..f43db184 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -59,7 +59,7 @@ side = "BOTH" [[dependencies.functionalstorage]] modId = "titanium" type = "required" -versionRange = "[1,)" # TODO - fix version +versionRange = "[1.20.4-4,)" # This version range declares a minimum of the current minecraft version up to but not including the next major version ordering = "NONE" side = "BOTH" From 740c57defe53740b320a618ccfc6092069c768e4 Mon Sep 17 00:00:00 2001 From: Matyrobbrt Date: Sat, 13 Apr 2024 11:42:52 +0300 Subject: [PATCH 08/20] Performance improvements --- .../block/tile/ControllableDrawerTile.java | 11 ++++++++++- .../block/tile/ItemControllableDrawerTile.java | 6 ++---- .../client/ControllerRenderer.java | 6 ++++++ .../inventory/BigInventoryHandler.java | 13 +++++++++---- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/ControllableDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/ControllableDrawerTile.java index 9141559a..373c2b74 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/ControllableDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/ControllableDrawerTile.java @@ -62,7 +62,16 @@ public ControllableDrawerTile(BasicTileBlock base, BlockEntityType entityT } if (getUtilitySlotAmount() > 0){ this.addInventory((InventoryComponent) (this.utilityUpgrades = new InventoryComponent>("utility_upgrades", 114, 70, getUtilitySlotAmount()) - .setInputFilter((stack, integer) -> stack.getItem() instanceof UpgradeItem && ((UpgradeItem) stack.getItem()).getType() == UpgradeItem.Type.UTILITY) + .setInputFilter((stack, integer) -> { + if (stack.is(FunctionalStorage.VOID_UPGRADE)) { + for (int i = 0; i < utilityUpgrades.getSlots(); i++) { + if (utilityUpgrades.getStackInSlot(i).is(FunctionalStorage.VOID_UPGRADE)) { + return false; + } + } + } + return stack.getItem() instanceof UpgradeItem && ((UpgradeItem) stack.getItem()).getType() == UpgradeItem.Type.UTILITY; + }) .setSlotLimit(1) .setOnSlotChanged((itemStack, integer) -> { needsUpgradeCache = true; diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java index 2121bdfb..b32e8703 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java @@ -78,8 +78,7 @@ public void serverTick(Level level, BlockPos pos, BlockState state, T blockEntit if (hasWorked) break; } } - } - if (item.equals(FunctionalStorage.PUSHING_UPGRADE.get())) { + } else if (item.equals(FunctionalStorage.PUSHING_UPGRADE.get())) { Direction direction = UpgradeItem.getDirection(stack); var otherHandler = level.getCapability(Capabilities.ItemHandler.BLOCK, pos.relative(direction), direction.getOpposite()); if (otherHandler != null) { @@ -100,8 +99,7 @@ public void serverTick(Level level, BlockPos pos, BlockState state, T blockEntit if (hasWorked) break; } } - } - if (item.equals(FunctionalStorage.COLLECTOR_UPGRADE.get())) { + } else if (item.equals(FunctionalStorage.COLLECTOR_UPGRADE.get())) { Direction direction = UpgradeItem.getDirection(stack); AABB box = new AABB(pos.relative(direction)); for (ItemEntity entitiesOfClass : level.getEntitiesOfClass(ItemEntity.class, box)) { diff --git a/src/main/java/com/buuz135/functionalstorage/client/ControllerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/ControllerRenderer.java index 027e8b2f..4013c418 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/ControllerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/ControllerRenderer.java @@ -26,6 +26,7 @@ import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; +import net.neoforged.neoforge.client.extensions.IBlockEntityRendererExtension; import org.joml.Matrix4f; import java.util.List; @@ -126,6 +127,11 @@ public boolean shouldRenderOffScreen(StorageControllerTile p_112306_) { return true; } + @Override + public AABB getRenderBoundingBox(StorageControllerTile blockEntity) { + return IBlockEntityRendererExtension.INFINITE_EXTENT_AABB; + } + private static RenderType AREA_TYPE = createRenderType(); public static RenderType createRenderType() { diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/BigInventoryHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/BigInventoryHandler.java index e6ac9b4c..bbfe0847 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/BigInventoryHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/BigInventoryHandler.java @@ -18,7 +18,7 @@ public abstract class BigInventoryHandler implements IItemHandler, INBTSerializa public static String AMOUNT = "Amount"; private final FunctionalStorage.DrawerType type; - private List storedStacks; + private final List storedStacks; public BigInventoryHandler(FunctionalStorage.DrawerType type) { this.type = type; @@ -39,9 +39,10 @@ public int getSlots() { public ItemStack getStackInSlot(int slot) { if (type.getSlots() == slot) return ItemStack.EMPTY; BigStack bigStack = this.storedStacks.get(slot); - ItemStack copied = bigStack.getStack().copy(); - copied.setCount(isCreative() ? Integer.MAX_VALUE : bigStack.getAmount()); - return copied; + if (isCreative()) { + return bigStack.slotStack.copyWithCount(Integer.MAX_VALUE); + } + return bigStack.slotStack; } @Nonnull @@ -168,11 +169,13 @@ public List getStoredStacks() { public static class BigStack { private ItemStack stack; + private ItemStack slotStack; private int amount; public BigStack(ItemStack stack, int amount) { this.stack = stack.copy(); this.amount = amount; + this.slotStack = stack.copyWithCount(amount); } public ItemStack getStack() { @@ -181,6 +184,7 @@ public ItemStack getStack() { public void setStack(ItemStack stack) { this.stack = stack.copy(); + this.slotStack = stack.copyWithCount(amount); } public int getAmount() { @@ -189,6 +193,7 @@ public int getAmount() { public void setAmount(int amount) { this.amount = amount; + this.slotStack.setCount(amount); } } } From e620632976fb2b67055d296f0fb531a8074eb00d Mon Sep 17 00:00:00 2001 From: Matyrobbrt Date: Sun, 14 Apr 2024 22:21:33 +0300 Subject: [PATCH 09/20] Fix accidental recipe replacement --- gradle.properties | 2 +- .../58b100d11464fc6de03e6a16617c8d741d90a73a | 4 +- .../9b4b2fe28e6a198629709c0c8772cb00a8b15d4a | 4 +- .../9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e | 14 +++--- .../functionalstorage/tags/items/drawer.json | 44 +++++++++---------- .../compacting}/amethyst.json | 0 .../compacting}/glowstone.json | 0 .../compacting/ice.json} | 0 .../compacting}/melon.json | 0 .../compacting/packed_ice.json} | 0 .../compacting}/quartz.json | 0 .../minecraft/tags/blocks/mineable/axe.json | 44 +++++++++---------- .../FunctionalStorageRecipesProvider.java | 12 ++--- 13 files changed, 62 insertions(+), 62 deletions(-) rename src/generated/resources/data/minecraft/recipes/{ => functionalstorage/compacting}/amethyst.json (100%) rename src/generated/resources/data/minecraft/recipes/{ => functionalstorage/compacting}/glowstone.json (100%) rename src/generated/resources/data/minecraft/recipes/{packed_ice.json => functionalstorage/compacting/ice.json} (100%) rename src/generated/resources/data/minecraft/recipes/{ => functionalstorage/compacting}/melon.json (100%) rename src/generated/resources/data/minecraft/recipes/{blue_ice.json => functionalstorage/compacting/packed_ice.json} (100%) rename src/generated/resources/data/minecraft/recipes/{ => functionalstorage/compacting}/quartz.json (100%) diff --git a/gradle.properties b/gradle.properties index db9aa017..d60be2a8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ org.gradle.jvmargs=-Xmx2048M modGroup=com.buuz135 -mod_version=1.0.0 +mod_version=1.0.2 modBaseName=functionalstorage neo_version=20.4.200 diff --git a/src/generated/resources/.cache/58b100d11464fc6de03e6a16617c8d741d90a73a b/src/generated/resources/.cache/58b100d11464fc6de03e6a16617c8d741d90a73a index 1d41c38d..e4096339 100644 --- a/src/generated/resources/.cache/58b100d11464fc6de03e6a16617c8d741d90a73a +++ b/src/generated/resources/.cache/58b100d11464fc6de03e6a16617c8d741d90a73a @@ -1,2 +1,2 @@ -// 1.20.4 2024-04-08T16:50:44.7219947 Functional Storage Item Tags -e72c53e88ffb2ff0aed4d46bafae940a49fe9e97 data/functionalstorage/tags/items/drawer.json +// 1.20.4 2024-04-14T22:20:37.4521204 Functional Storage Item Tags +4d333a46912a79be0238da4591cc570d83f3577f data/functionalstorage/tags/items/drawer.json diff --git a/src/generated/resources/.cache/9b4b2fe28e6a198629709c0c8772cb00a8b15d4a b/src/generated/resources/.cache/9b4b2fe28e6a198629709c0c8772cb00a8b15d4a index d16a39c6..f42968c7 100644 --- a/src/generated/resources/.cache/9b4b2fe28e6a198629709c0c8772cb00a8b15d4a +++ b/src/generated/resources/.cache/9b4b2fe28e6a198629709c0c8772cb00a8b15d4a @@ -1,3 +1,3 @@ -// 1.20.4 2024-04-08T16:50:44.7249944 Tags for minecraft:block mod id functionalstorage -e72c53e88ffb2ff0aed4d46bafae940a49fe9e97 data/minecraft/tags/blocks/mineable/axe.json +// 1.20.4 2024-04-14T22:20:37.467108 Tags for minecraft:block mod id functionalstorage +4d333a46912a79be0238da4591cc570d83f3577f data/minecraft/tags/blocks/mineable/axe.json 4b6fc75faca16170a17220f0e301b16866f4bc5c data/minecraft/tags/blocks/mineable/pickaxe.json diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index 2afda1a8..72832122 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,4 +1,4 @@ -// 1.20.4 2024-04-07T00:54:11.3332477 Recipes +// 1.20.4 2024-04-14T22:20:37.4581111 Recipes 72528341b7f8317bcd4b46b536d3eea663345706 data/functionalstorage/advancements/recipes/misc/acacia_1.json b0e04e073c0a2d4f3398b977678a581b581a6e99 data/functionalstorage/advancements/recipes/misc/acacia_2.json 53e29bff9cf54d0d489a66ad711b40f7d6c1d4f5 data/functionalstorage/advancements/recipes/misc/acacia_4.json @@ -115,9 +115,9 @@ f336fee45abfd07c1f2810275b816b04f606448c data/functionalstorage/recipes/storage_ f016626b869686a6657b772c100d9e923b58cf39 data/functionalstorage/recipes/warped_1.json b034bdc06d0734de160f9c857b630e9261d6df01 data/functionalstorage/recipes/warped_2.json 53ba0cbca3c75a9f90ec12d241622d743cfadcc4 data/functionalstorage/recipes/warped_4.json -435084d750577a3e1e31113cb6976f65ce98170b data/minecraft/recipes/amethyst.json -185e1f0c092f5aef2db16ff27daf7796ea578fbf data/minecraft/recipes/blue_ice.json -59f83e20d8a359a63417b2d6dad0ddc0b1657bac data/minecraft/recipes/glowstone.json -286fc95fc2f0fbe0341b751cf5bfdab1007bd6e3 data/minecraft/recipes/melon.json -e9c6ff4fbcb2617dc7fd7f4371db0ead6cea7154 data/minecraft/recipes/packed_ice.json -6fb23d653de5174dc0094f8a81c933162b0ad806 data/minecraft/recipes/quartz.json +435084d750577a3e1e31113cb6976f65ce98170b data/minecraft/recipes/functionalstorage/compacting/amethyst.json +59f83e20d8a359a63417b2d6dad0ddc0b1657bac data/minecraft/recipes/functionalstorage/compacting/glowstone.json +e9c6ff4fbcb2617dc7fd7f4371db0ead6cea7154 data/minecraft/recipes/functionalstorage/compacting/ice.json +286fc95fc2f0fbe0341b751cf5bfdab1007bd6e3 data/minecraft/recipes/functionalstorage/compacting/melon.json +185e1f0c092f5aef2db16ff27daf7796ea578fbf data/minecraft/recipes/functionalstorage/compacting/packed_ice.json +6fb23d653de5174dc0094f8a81c933162b0ad806 data/minecraft/recipes/functionalstorage/compacting/quartz.json diff --git a/src/generated/resources/data/functionalstorage/tags/items/drawer.json b/src/generated/resources/data/functionalstorage/tags/items/drawer.json index bb20db0b..0084ea57 100644 --- a/src/generated/resources/data/functionalstorage/tags/items/drawer.json +++ b/src/generated/resources/data/functionalstorage/tags/items/drawer.json @@ -1,16 +1,16 @@ { "values": [ - "functionalstorage:oak_4", - "functionalstorage:spruce_4", - "functionalstorage:birch_4", - "functionalstorage:jungle_4", - "functionalstorage:acacia_4", - "functionalstorage:dark_oak_4", - "functionalstorage:crimson_4", - "functionalstorage:warped_4", - "functionalstorage:mangrove_4", - "functionalstorage:cherry_4", - "functionalstorage:framed_4", + "functionalstorage:oak_1", + "functionalstorage:spruce_1", + "functionalstorage:birch_1", + "functionalstorage:jungle_1", + "functionalstorage:acacia_1", + "functionalstorage:dark_oak_1", + "functionalstorage:crimson_1", + "functionalstorage:warped_1", + "functionalstorage:mangrove_1", + "functionalstorage:cherry_1", + "functionalstorage:framed_1", "functionalstorage:oak_2", "functionalstorage:spruce_2", "functionalstorage:birch_2", @@ -22,16 +22,16 @@ "functionalstorage:mangrove_2", "functionalstorage:cherry_2", "functionalstorage:framed_2", - "functionalstorage:oak_1", - "functionalstorage:spruce_1", - "functionalstorage:birch_1", - "functionalstorage:jungle_1", - "functionalstorage:acacia_1", - "functionalstorage:dark_oak_1", - "functionalstorage:crimson_1", - "functionalstorage:warped_1", - "functionalstorage:mangrove_1", - "functionalstorage:cherry_1", - "functionalstorage:framed_1" + "functionalstorage:oak_4", + "functionalstorage:spruce_4", + "functionalstorage:birch_4", + "functionalstorage:jungle_4", + "functionalstorage:acacia_4", + "functionalstorage:dark_oak_4", + "functionalstorage:crimson_4", + "functionalstorage:warped_4", + "functionalstorage:mangrove_4", + "functionalstorage:cherry_4", + "functionalstorage:framed_4" ] } \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/recipes/amethyst.json b/src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/amethyst.json similarity index 100% rename from src/generated/resources/data/minecraft/recipes/amethyst.json rename to src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/amethyst.json diff --git a/src/generated/resources/data/minecraft/recipes/glowstone.json b/src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/glowstone.json similarity index 100% rename from src/generated/resources/data/minecraft/recipes/glowstone.json rename to src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/glowstone.json diff --git a/src/generated/resources/data/minecraft/recipes/packed_ice.json b/src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/ice.json similarity index 100% rename from src/generated/resources/data/minecraft/recipes/packed_ice.json rename to src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/ice.json diff --git a/src/generated/resources/data/minecraft/recipes/melon.json b/src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/melon.json similarity index 100% rename from src/generated/resources/data/minecraft/recipes/melon.json rename to src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/melon.json diff --git a/src/generated/resources/data/minecraft/recipes/blue_ice.json b/src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/packed_ice.json similarity index 100% rename from src/generated/resources/data/minecraft/recipes/blue_ice.json rename to src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/packed_ice.json diff --git a/src/generated/resources/data/minecraft/recipes/quartz.json b/src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/quartz.json similarity index 100% rename from src/generated/resources/data/minecraft/recipes/quartz.json rename to src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/quartz.json diff --git a/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json b/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json index bb20db0b..0084ea57 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json +++ b/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json @@ -1,16 +1,16 @@ { "values": [ - "functionalstorage:oak_4", - "functionalstorage:spruce_4", - "functionalstorage:birch_4", - "functionalstorage:jungle_4", - "functionalstorage:acacia_4", - "functionalstorage:dark_oak_4", - "functionalstorage:crimson_4", - "functionalstorage:warped_4", - "functionalstorage:mangrove_4", - "functionalstorage:cherry_4", - "functionalstorage:framed_4", + "functionalstorage:oak_1", + "functionalstorage:spruce_1", + "functionalstorage:birch_1", + "functionalstorage:jungle_1", + "functionalstorage:acacia_1", + "functionalstorage:dark_oak_1", + "functionalstorage:crimson_1", + "functionalstorage:warped_1", + "functionalstorage:mangrove_1", + "functionalstorage:cherry_1", + "functionalstorage:framed_1", "functionalstorage:oak_2", "functionalstorage:spruce_2", "functionalstorage:birch_2", @@ -22,16 +22,16 @@ "functionalstorage:mangrove_2", "functionalstorage:cherry_2", "functionalstorage:framed_2", - "functionalstorage:oak_1", - "functionalstorage:spruce_1", - "functionalstorage:birch_1", - "functionalstorage:jungle_1", - "functionalstorage:acacia_1", - "functionalstorage:dark_oak_1", - "functionalstorage:crimson_1", - "functionalstorage:warped_1", - "functionalstorage:mangrove_1", - "functionalstorage:cherry_1", - "functionalstorage:framed_1" + "functionalstorage:oak_4", + "functionalstorage:spruce_4", + "functionalstorage:birch_4", + "functionalstorage:jungle_4", + "functionalstorage:acacia_4", + "functionalstorage:dark_oak_4", + "functionalstorage:crimson_4", + "functionalstorage:warped_4", + "functionalstorage:mangrove_4", + "functionalstorage:cherry_4", + "functionalstorage:framed_4" ] } \ No newline at end of file diff --git a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageRecipesProvider.java b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageRecipesProvider.java index ed06b643..86d079f0 100644 --- a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageRecipesProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageRecipesProvider.java @@ -135,11 +135,11 @@ protected void buildRecipes(RecipeOutput output) { .define('L', StorageTags.DRAWER) .save(output); - new CustomCompactingRecipe(new ItemStack(Items.GLOWSTONE_DUST, 4), new ItemStack(Items.GLOWSTONE)).save(output); - new CustomCompactingRecipe(new ItemStack(Items.MELON_SLICE, 9), new ItemStack(Items.MELON)).save(output); - new CustomCompactingRecipe(new ItemStack(Items.QUARTZ, 4), new ItemStack(Items.QUARTZ_BLOCK)).save(output, new ResourceLocation("quartz")); - new CustomCompactingRecipe(new ItemStack(Items.ICE, 9), new ItemStack(Items.PACKED_ICE)).save(output); - new CustomCompactingRecipe(new ItemStack(Items.PACKED_ICE, 9), new ItemStack(Items.BLUE_ICE)).save(output); - new CustomCompactingRecipe(new ItemStack(Items.AMETHYST_SHARD, 4), new ItemStack(Items.AMETHYST_BLOCK)).save(output, new ResourceLocation("amethyst")); + new CustomCompactingRecipe(new ItemStack(Items.GLOWSTONE_DUST, 4), new ItemStack(Items.GLOWSTONE)).save(output, new ResourceLocation("functionalstorage/compacting/glowstone")); + new CustomCompactingRecipe(new ItemStack(Items.MELON_SLICE, 9), new ItemStack(Items.MELON)).save(output, new ResourceLocation("functionalstorage/compacting/melon")); + new CustomCompactingRecipe(new ItemStack(Items.QUARTZ, 4), new ItemStack(Items.QUARTZ_BLOCK)).save(output, new ResourceLocation("functionalstorage/compacting/quartz")); + new CustomCompactingRecipe(new ItemStack(Items.ICE, 9), new ItemStack(Items.PACKED_ICE)).save(output, new ResourceLocation("functionalstorage/compacting/ice")); + new CustomCompactingRecipe(new ItemStack(Items.PACKED_ICE, 9), new ItemStack(Items.BLUE_ICE)).save(output, new ResourceLocation("functionalstorage/compacting/packed_ice")); + new CustomCompactingRecipe(new ItemStack(Items.AMETHYST_SHARD, 4), new ItemStack(Items.AMETHYST_BLOCK)).save(output, new ResourceLocation("functionalstorage/compacting/amethyst")); } } From f6c1db0c864631abee9201ed1b6f307c5874ef25 Mon Sep 17 00:00:00 2001 From: Matyrobbrt Date: Wed, 26 Jun 2024 22:53:40 +0300 Subject: [PATCH 10/20] Initial 1.21 port --- build.gradle | 99 ++++--- gradle.properties | 7 +- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 257 +++++++----------- gradlew.bat | 53 ++-- settings.gradle | 8 - .../functionalstorage/FunctionalStorage.java | 51 ++-- .../block/ArmoryCabinetBlock.java | 10 +- .../block/ControllerExtensionBlock.java | 5 +- .../functionalstorage/block/Drawer.java | 57 ++-- .../functionalstorage/block/DrawerBlock.java | 13 +- .../block/DrawerControllerBlock.java | 4 +- .../block/EnderDrawerBlock.java | 12 +- .../block/FluidDrawerBlock.java | 16 +- .../block/FramedControllerExtensionBlock.java | 6 +- .../block/FramedDrawerBlock.java | 18 +- .../block/FramedDrawerControllerBlock.java | 6 +- .../block/StorageControllerBlock.java | 27 +- .../StorageControllerExtensionBlock.java | 27 +- .../block/tile/ArmoryCabinetTile.java | 10 +- .../block/tile/CompactingDrawerTile.java | 2 +- .../block/tile/ControllableDrawerTile.java | 7 +- .../block/tile/DrawerTile.java | 2 +- .../block/tile/EnderDrawerTile.java | 7 +- .../block/tile/FluidDrawerTile.java | 8 +- .../tile/ItemControllableDrawerTile.java | 7 +- .../tile/SimpleCompactingDrawerTile.java | 2 +- .../client/BaseDrawerRenderer.java | 10 +- .../functionalstorage/client/ClientSetup.java | 2 +- .../client/CompactingDrawerRenderer.java | 6 +- .../client/ControllerRenderer.java | 120 ++++---- .../client/DrawerRenderer.java | 46 ++-- .../client/FluidDrawerRenderer.java | 16 +- .../client/FramedColors.java | 6 +- .../SimpleCompactingDrawerRenderer.java | 4 +- .../client/gui/FluidDrawerInfoGuiAddon.java | 2 +- .../client/loader/FramedModel.java | 7 +- .../client/model/FramedDrawerModelData.java | 6 +- .../compat/jade/DrawerComponentProvider.java | 10 +- .../compat/jei/CompactingRecipeCategory.java | 4 +- .../compat/jei/JEIPlugin.java | 2 +- .../compat/top/CustomElementItemStack.java | 7 +- .../compat/top/FunctionalDrawerProvider.java | 5 +- .../FunctionalStorageBlockstateProvider.java | 12 +- .../FunctionalStorageRecipesProvider.java | 33 +-- .../fluid/BigFluidHandler.java | 21 +- .../fluid/ControllerFluidHandler.java | 4 +- .../ArmoryCabinetInventoryHandler.java | 16 +- .../inventory/BigInventoryHandler.java | 19 +- .../inventory/CompactingInventoryHandler.java | 29 +- .../inventory/EnderInventoryHandler.java | 8 +- .../item/CompactingStackItemHandler.java | 36 +-- .../item/DrawerStackItemHandler.java | 36 +-- .../item/ConfigurationToolItem.java | 4 +- .../functionalstorage/item/FSAttachments.java | 66 +++-- .../item/LinkingToolItem.java | 52 ++-- .../functionalstorage/item/UpgradeItem.java | 22 +- .../network/EnderDrawerSyncMessage.java | 13 +- .../recipe/CustomCompactingRecipe.java | 17 +- .../recipe/DrawerlessWoodIngredient.java | 18 +- .../recipe/FramedDrawerRecipe.java | 6 +- .../util/CompactingUtil.java | 35 +-- .../util/ConnectedDrawers.java | 4 +- .../functionalstorage/util/StorageTags.java | 4 +- .../buuz135/functionalstorage/util/Utils.java | 38 +++ .../world/EnderSavedData.java | 9 +- .../{mods.toml => neoforge.mods.toml} | 4 +- 67 files changed, 760 insertions(+), 722 deletions(-) create mode 100644 src/main/java/com/buuz135/functionalstorage/util/Utils.java rename src/main/resources/META-INF/{mods.toml => neoforge.mods.toml} (98%) diff --git a/build.gradle b/build.gradle index a8916c66..c94eb667 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,6 @@ plugins { - id 'java-library' - id 'eclipse' - id 'idea' + id 'net.neoforged.moddev' version '0.1.112' id 'maven-publish' - id 'net.neoforged.gradle.userdev' version '7.0.97' } final mcVersion = project.neo_version.split('\\.', 3).with { @@ -12,6 +9,12 @@ final mcVersion = project.neo_version.split('\\.', 3).with { version = mcVersion + "-" + mod_version group = modGroup +sourceSets { + main { + resources.srcDir('src/generated/resources') + } +} + repositories { maven { name = "BlameJared maven" @@ -23,67 +26,48 @@ repositories { includeGroup "curse.maven" } } - maven { - url(rootProject.file('../Titanium/repo')) - } } base { archivesName = modBaseName } -// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. -java.toolchain.languageVersion = JavaLanguageVersion.of(17) +// Mojang ships Java 21 to end users in 1.18+, so your mod should target Java 21. +java.toolchain.languageVersion = JavaLanguageVersion.of(21) -// Default run configurations. -// These can be tweaked, removed, or duplicated as needed. -runs { - configureEach { - // Recommended logging level for the console - // You can set various levels here. - // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels - systemProperty 'forge.logging.console.level', 'debug' +neoForge { + version = "${neo_version}" - modSource project.sourceSets.main + parchment { + minecraftVersion = '1.21' + mappingsVersion = '2024.06.23' } - client { - } - - server { - programArgument '--nogui' + runs { + client { + client() + } + server { + server() + } } - data { - // example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it - // workingDirectory project.file('run-data') - - // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. - programArguments.addAll '--mod', 'functionalstorage', '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath() + mods { + functionalstorage { + sourceSet sourceSets.main + } } } -minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/accesstransformer.cfg') - -// Include resources generated by data generators. -sourceSets.main.resources { srcDir 'src/generated/resources' } - -dependencies { - implementation "net.neoforged:neoforge:${neo_version}" - - compileOnly "mezz.jei:jei-1.20.4-common-api:$jei_version" - compileOnly "mezz.jei:jei-1.20.4-neoforge-api:$jei_version" - runtimeOnly "mezz.jei:jei-1.20.4-neoforge:$jei_version" - implementation "curse.maven:refined-storage-243076:5165548" - implementation "curse.maven:jade-324717:5109393" - compileOnly "curse.maven:the-one-probe-245211:5159289" - - implementation('com.hrznstudio:titanium') - runtimeOnly('com.hrznstudio:Titanium:1.20.4-2.4.0') -} - -tasks.configureEach { - if (it.name.startsWith('neoForm')) it.enabled = false +dependencies { + compileOnly "mezz.jei:jei-1.21-common-api:$jei_version" + compileOnly "mezz.jei:jei-1.21-neoforge-api:$jei_version" +// runtimeOnly "mezz.jei:jei-1.21-neoforge:$jei_version" + implementation('com.hrznstudio:titanium') { + transitive = false + } + implementation "curse.maven:jade-324717:5444008" + implementation "curse.maven:the-one-probe-245211:5475189" } jar { @@ -102,4 +86,19 @@ jar { tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation + options.compilerArgs << '-Xmaxerrs' << '500' +} + +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + } + } + repositories { + maven { + name 'repo' + url(file('repo')) + } + } } diff --git a/gradle.properties b/gradle.properties index d60be2a8..3bd7a1d9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,8 +3,5 @@ modGroup=com.buuz135 mod_version=1.0.2 modBaseName=functionalstorage -neo_version=20.4.200 -jei_version=17.3.0.49 - -neogradle.subsystems.parchment.minecraftVersion=1.20.4 -neogradle.subsystems.parchment.mappingsVersion=2024.02.25 +neo_version=21.0.37-beta +jei_version=19.0.0.9 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37aef8d3..20db9ad5 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.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index c53aefaa..744e882e 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ -#!/bin/sh +#!/usr/bin/env sh # -# Copyright © 2015-2021 the original authors. +# Copyright 2015 the original author or authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,101 +17,67 @@ # ############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# +## +## Gradle start up script for UN*X +## ############################################################################## # Attempt to set APP_HOME - # Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi done - -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null APP_NAME="Gradle" -APP_BASE_NAME=${0##*/} +APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum +MAX_FD="maximum" warn () { echo "$*" -} >&2 +} die () { echo echo "$*" echo exit 1 -} >&2 +} # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MSYS* | MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -121,9 +87,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java + JAVACMD="$JAVA_HOME/jre/sh/java" else - JAVACMD=$JAVA_HOME/bin/java + JAVACMD="$JAVA_HOME/bin/java" fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -132,7 +98,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD=java + JAVACMD="java" which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -140,95 +106,80 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi fi -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi # For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg + i=`expr $i + 1` done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 107acd32..8a0b282a 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,19 +1,3 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -24,23 +8,20 @@ @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if "%ERRORLEVEL%" == "0" goto init echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -54,7 +35,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto execute +if exist "%JAVA_EXE%" goto init echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -64,14 +45,34 @@ echo location of your Java installation. goto fail +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% :end @rem End local scope for the variables with windows NT shell diff --git a/settings.gradle b/settings.gradle index 6ee4e0c2..4c731fe3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,11 +1,3 @@ -pluginManagement { - repositories { - mavenLocal() - gradlePluginPortal() - maven { url = 'https://maven.neoforged.net/releases' } - } -} - plugins { id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' } diff --git a/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java b/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java index 3427a00a..f680f7c4 100644 --- a/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java +++ b/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java @@ -15,7 +15,6 @@ import com.buuz135.functionalstorage.block.FramedDrawerControllerBlock; import com.buuz135.functionalstorage.block.FramedSimpleCompactingDrawerBlock; import com.buuz135.functionalstorage.block.SimpleCompactingDrawerBlock; -import com.buuz135.functionalstorage.block.tile.ArmoryCabinetTile; import com.buuz135.functionalstorage.block.tile.CompactingDrawerTile; import com.buuz135.functionalstorage.block.tile.CompactingFramedDrawerTile; import com.buuz135.functionalstorage.block.tile.DrawerControllerTile; @@ -25,9 +24,7 @@ import com.buuz135.functionalstorage.block.tile.FramedDrawerControllerTile; import com.buuz135.functionalstorage.block.tile.FramedDrawerTile; import com.buuz135.functionalstorage.block.tile.FramedSimpleCompactingDrawerTile; -import com.buuz135.functionalstorage.block.tile.ItemControllableDrawerTile; import com.buuz135.functionalstorage.block.tile.SimpleCompactingDrawerTile; -import com.buuz135.functionalstorage.block.tile.StorageControllerTile; import com.buuz135.functionalstorage.client.ClientSetup; import com.buuz135.functionalstorage.client.CompactingDrawerRenderer; import com.buuz135.functionalstorage.client.ControllerRenderer; @@ -57,7 +54,6 @@ import com.buuz135.functionalstorage.util.IWoodType; import com.buuz135.functionalstorage.util.NumberUtils; import com.buuz135.functionalstorage.util.TooltipUtil; -import com.hrznstudio.titanium.block.RotatableBlock; import com.hrznstudio.titanium.datagenerator.loot.TitaniumLootTableProvider; import com.hrznstudio.titanium.datagenerator.model.BlockItemModelGeneratorProvider; import com.hrznstudio.titanium.event.handler.EventManager; @@ -67,33 +63,22 @@ import com.hrznstudio.titanium.network.NetworkHandler; import com.hrznstudio.titanium.recipe.serializer.GenericSerializer; import com.hrznstudio.titanium.tab.TitaniumTab; -import com.hrznstudio.titanium.util.RayTraceUtils; import net.minecraft.client.renderer.ItemBlockRenderTypes; import net.minecraft.client.renderer.RenderType; -import net.minecraft.core.BlockPos; import net.minecraft.core.Holder; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; -import net.minecraft.nbt.CompoundTag; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.ItemLike; -import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.phys.BlockHitResult; -import net.minecraft.world.phys.HitResult; -import net.minecraft.world.phys.shapes.BooleanOp; -import net.minecraft.world.phys.shapes.Shapes; -import net.minecraft.world.phys.shapes.VoxelShape; import net.neoforged.api.distmarker.Dist; import net.neoforged.api.distmarker.OnlyIn; import net.neoforged.bus.api.EventPriority; @@ -113,12 +98,9 @@ import net.neoforged.neoforge.client.model.generators.ModelFile; import net.neoforged.neoforge.common.NeoForgeMod; import net.neoforged.neoforge.common.crafting.IngredientType; -import net.neoforged.neoforge.common.util.NonNullLazy; +import net.neoforged.neoforge.common.util.Lazy; import net.neoforged.neoforge.data.event.GatherDataEvent; -import net.neoforged.neoforge.event.entity.player.ItemTooltipEvent; import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent; -import net.neoforged.neoforge.event.level.BlockEvent; -import net.neoforged.neoforge.items.IItemHandler; import net.neoforged.neoforge.registries.DeferredHolder; import net.neoforged.neoforge.registries.NeoForgeRegistries; import net.neoforged.neoforge.registries.RegisterEvent; @@ -133,7 +115,6 @@ import java.util.Locale; import java.util.Optional; import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Collectors; @@ -149,7 +130,7 @@ public class FunctionalStorage extends ModuleController { } // Directly reference a log4j logger. - public static final Logger LOGGER = LogManager.getLogger(); + private static final Logger LOGGER = LogManager.getLogger(); public static ConcurrentLinkedQueue WOOD_TYPES = new ConcurrentLinkedQueue<>(); @@ -180,7 +161,7 @@ public class FunctionalStorage extends ModuleController { public static DeferredHolder REDSTONE_UPGRADE; public static DeferredHolder CREATIVE_UPGRADE; - public static TitaniumTab TAB = new TitaniumTab(new ResourceLocation(MOD_ID, "main")); + public static TitaniumTab TAB = new TitaniumTab(com.buuz135.functionalstorage.util.Utils.resourceLocation(MOD_ID, "main")); public static Holder> CUSTOM_COMPACTING_RECIPE_SERIALIZER; public static Holder> CUSTOM_COMPACTING_RECIPE_TYPE; @@ -291,7 +272,7 @@ public boolean isFoil(ItemStack p_41453_) { this.addCreativeTab("main", () -> new ItemStack(DRAWER_CONTROLLER), MOD_ID, TAB); - CUSTOM_COMPACTING_RECIPE_TYPE = getRegistries().registerGeneric(Registries.RECIPE_TYPE, "custom_compacting", () -> RecipeType.simple(new ResourceLocation(MOD_ID, "custom_compacting"))); + CUSTOM_COMPACTING_RECIPE_TYPE = getRegistries().registerGeneric(Registries.RECIPE_TYPE, "custom_compacting", () -> RecipeType.simple(com.buuz135.functionalstorage.util.Utils.resourceLocation(MOD_ID, "custom_compacting"))); CUSTOM_COMPACTING_RECIPE_SERIALIZER = getRegistries().registerGeneric(Registries.RECIPE_SERIALIZER, "custom_compacting", () -> new GenericSerializer<>(CustomCompactingRecipe.class, CUSTOM_COMPACTING_RECIPE_TYPE::value, CustomCompactingRecipe.CODEC)); @@ -374,10 +355,10 @@ public void onClient() { item.getItemColors().register((stack, tint) -> { LinkingToolItem.LinkingMode linkingMode = LinkingToolItem.getLinkingMode(stack); LinkingToolItem.ActionMode linkingAction = LinkingToolItem.getActionMode(stack); - if (tint != 0 && stack.hasData(FSAttachments.ENDER_FREQUENCY)) { + if (tint != 0 && stack.has(FSAttachments.ENDER_FREQUENCY)) { return new Color(44, 150, 88).getRGB(); } - if (tint == 3 && stack.hasData(FSAttachments.CONTROLLER)) { + if (tint == 3 && stack.has(FSAttachments.CONTROLLER)) { return Color.RED.getRGB(); } if (tint == 1) { @@ -413,11 +394,11 @@ public void onClient() { ItemBlockRenderTypes.setRenderLayer(FRAMED_SIMPLE_COMPACTING_DRAWER.getBlock(), RenderType.cutout()); }).subscribe(); EventManager.forge(RenderTooltipEvent.Pre.class).process(itemTooltipEvent -> { - if (itemTooltipEvent.getItemStack().getItem().equals(FunctionalStorage.ENDER_DRAWER.getBlock().asItem()) && itemTooltipEvent.getItemStack().hasData(FSAttachments.TILE)) { - TooltipUtil.renderItems(itemTooltipEvent.getGraphics(), EnderDrawerBlock.getFrequencyDisplay(itemTooltipEvent.getItemStack().getData(FSAttachments.TILE).getString("frequency")), itemTooltipEvent.getX() + 14, itemTooltipEvent.getY() + 11); + if (itemTooltipEvent.getItemStack().getItem().equals(FunctionalStorage.ENDER_DRAWER.getBlock().asItem()) && itemTooltipEvent.getItemStack().has(FSAttachments.TILE)) { + TooltipUtil.renderItems(itemTooltipEvent.getGraphics(), EnderDrawerBlock.getFrequencyDisplay(itemTooltipEvent.getItemStack().get(FSAttachments.TILE).getString("frequency")), itemTooltipEvent.getX() + 14, itemTooltipEvent.getY() + 11); } - if (itemTooltipEvent.getItemStack().is(FunctionalStorage.LINKING_TOOL.get()) && itemTooltipEvent.getItemStack().hasData(FSAttachments.ENDER_FREQUENCY)) { - TooltipUtil.renderItems(itemTooltipEvent.getGraphics(), EnderDrawerBlock.getFrequencyDisplay(itemTooltipEvent.getItemStack().getData(FSAttachments.ENDER_FREQUENCY)), itemTooltipEvent.getX() + 14, itemTooltipEvent.getY() + 11); + if (itemTooltipEvent.getItemStack().is(FunctionalStorage.LINKING_TOOL.get()) && itemTooltipEvent.getItemStack().has(FSAttachments.ENDER_FREQUENCY)) { + TooltipUtil.renderItems(itemTooltipEvent.getGraphics(), EnderDrawerBlock.getFrequencyDisplay(itemTooltipEvent.getItemStack().get(FSAttachments.ENDER_FREQUENCY)), itemTooltipEvent.getX() + 14, itemTooltipEvent.getY() + 11); } var iItemHandler = itemTooltipEvent.getItemStack().getCapability(Capabilities.ItemHandler.ITEM); if (iItemHandler != null) { @@ -444,14 +425,14 @@ public void onClient() { } }).subscribe(); EventManager.mod(ModelEvent.RegisterGeometryLoaders.class).process(modelRegistryEvent -> { - modelRegistryEvent.register(new ResourceLocation(MOD_ID, "framedblock"), FramedModel.Loader.INSTANCE); + modelRegistryEvent.register(com.buuz135.functionalstorage.util.Utils.resourceLocation(MOD_ID, "framedblock"), FramedModel.Loader.INSTANCE); }).subscribe(); ClientSetup.init(); } @Override public void addDataProvider(GatherDataEvent event) { - NonNullLazy> blocksToProcess = NonNullLazy.of(() -> + Lazy> blocksToProcess = Lazy.of(() -> BuiltInRegistries.BLOCK.stream() .filter(basicBlock -> Optional.of(BuiltInRegistries.BLOCK.getKey(basicBlock)) .map(ResourceLocation::getNamespace) @@ -462,7 +443,7 @@ public void addDataProvider(GatherDataEvent event) { if (true) { event.getGenerator().addProvider(true, new BlockItemModelGeneratorProvider(event.getGenerator(), MOD_ID, blocksToProcess)); event.getGenerator().addProvider(true, new FunctionalStorageBlockstateProvider(event.getGenerator(), event.getExistingFileHelper(), blocksToProcess)); - event.getGenerator().addProvider(true, new TitaniumLootTableProvider(event.getGenerator(), blocksToProcess)); + event.getGenerator().addProvider(true, new TitaniumLootTableProvider(event.getGenerator(), blocksToProcess, event.getLookupProvider())); var blockTags = new FunctionalStorageBlockTagsProvider(event.getGenerator(), event.getLookupProvider(), MOD_ID, event.getExistingFileHelper()); event.getGenerator().addProvider(true, blockTags); @@ -472,7 +453,7 @@ public void addDataProvider(GatherDataEvent event) { event.getGenerator().addProvider(true, new ItemModelProvider(event.getGenerator().getPackOutput(), MOD_ID, event.getExistingFileHelper()) { @Override protected void registerModels() { - blocksToProcess.get().forEach(block -> withUnchecked(BuiltInRegistries.BLOCK.getKey(block).getPath(), new ResourceLocation(FunctionalStorage.MOD_ID, "block/" + BuiltInRegistries.BLOCK.getKey(block).getPath()))); + blocksToProcess.get().forEach(block -> withUnchecked(BuiltInRegistries.BLOCK.getKey(block).getPath(), com.buuz135.functionalstorage.util.Utils.resourceLocation(FunctionalStorage.MOD_ID, "block/" + BuiltInRegistries.BLOCK.getKey(block).getPath()))); for (StorageUpgradeItem.StorageTier storageTier : STORAGE_UPGRADES.keySet()) { item(STORAGE_UPGRADES.get(storageTier).get()); } @@ -485,7 +466,7 @@ protected void registerModels() { } private void item(Item item) { - withUnchecked(BuiltInRegistries.ITEM.getKey(item).getPath(), new ResourceLocation("minecraft:item/generated")).texture( "layer0", new ResourceLocation(MOD_ID, "item/" + BuiltInRegistries.ITEM.getKey(item).getPath())); + withUnchecked(BuiltInRegistries.ITEM.getKey(item).getPath(), com.buuz135.functionalstorage.util.Utils.resourceLocation("minecraft:item/generated")).texture( "layer0", com.buuz135.functionalstorage.util.Utils.resourceLocation(MOD_ID, "item/" + BuiltInRegistries.ITEM.getKey(item).getPath())); } private ItemModelBuilder withUnchecked(String name, ResourceLocation parent){ @@ -521,6 +502,6 @@ protected void registerModels() { } }); } - event.getGenerator().addProvider(true, new FunctionalStorageRecipesProvider(event.getGenerator(), blocksToProcess)); + event.getGenerator().addProvider(true, new FunctionalStorageRecipesProvider(event.getGenerator(), blocksToProcess, event.getLookupProvider())); } } diff --git a/src/main/java/com/buuz135/functionalstorage/block/ArmoryCabinetBlock.java b/src/main/java/com/buuz135/functionalstorage/block/ArmoryCabinetBlock.java index 9d30bd25..cfca2e0e 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/ArmoryCabinetBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/ArmoryCabinetBlock.java @@ -58,7 +58,7 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) BlockEntity drawerTile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); if (drawerTile instanceof ArmoryCabinetTile) { if (!((ArmoryCabinetTile) drawerTile).isEverythingEmpty()) { - stack.setData(FSAttachments.TILE, drawerTile.saveWithoutMetadata()); + stack.set(FSAttachments.TILE, drawerTile.saveWithoutMetadata(drawerTile.getLevel().registryAccess())); } } stacks.add(stack); @@ -73,11 +73,11 @@ public NonNullList getDynamicDrops(BlockState state, Level worldIn, B @Override public void setPlacedBy(Level level, BlockPos pos, BlockState p_49849_, @Nullable LivingEntity p_49850_, ItemStack stack) { super.setPlacedBy(level, pos, p_49849_, p_49850_, stack); - if (stack.hasData(FSAttachments.TILE)) { + if (stack.has(FSAttachments.TILE)) { BlockEntity entity = level.getBlockEntity(pos); - if (entity instanceof ArmoryCabinetTile) { - entity.load(stack.getData(FSAttachments.TILE)); - ((ArmoryCabinetTile) entity).markForUpdate(); + if (entity instanceof ArmoryCabinetTile et) { + et.loadAdditional(stack.get(FSAttachments.TILE), entity.getLevel().registryAccess()); + et.markForUpdate(); } } } diff --git a/src/main/java/com/buuz135/functionalstorage/block/ControllerExtensionBlock.java b/src/main/java/com/buuz135/functionalstorage/block/ControllerExtensionBlock.java index 517f250d..d16e1baf 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/ControllerExtensionBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/ControllerExtensionBlock.java @@ -11,6 +11,7 @@ import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.storage.loot.LootTable; import net.neoforged.neoforge.common.Tags; +import net.neoforged.neoforge.common.crafting.BlockTagIngredient; import org.jetbrains.annotations.NotNull; public class ControllerExtensionBlock extends StorageControllerExtensionBlock { @@ -28,8 +29,8 @@ public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { public void registerRecipe(RecipeOutput consumer) { TitaniumShapedRecipeBuilder.shapedRecipe(FunctionalStorage.CONTROLLER_EXTENSION.block().get()) .pattern("IBI").pattern("CDC").pattern("IBI") - .define('I', Tags.Items.STONE) - .define('B', Tags.Items.STORAGE_BLOCKS_QUARTZ) + .define('I', Tags.Items.STONES) + .define('B', Items.QUARTZ_BLOCK) .define('C', StorageTags.DRAWER) .define('D', Items.REPEATER) .save(consumer); diff --git a/src/main/java/com/buuz135/functionalstorage/block/Drawer.java b/src/main/java/com/buuz135/functionalstorage/block/Drawer.java index e48357d7..b31c602e 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/Drawer.java +++ b/src/main/java/com/buuz135/functionalstorage/block/Drawer.java @@ -23,8 +23,10 @@ import net.minecraft.network.chat.MutableComponent; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; +import net.minecraft.world.ItemInteractionResult; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.BlockGetter; @@ -90,10 +92,27 @@ public boolean hasIndividualRenderVoxelShape() { } @Override - public InteractionResult use(BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult ray) { - var entity = getBlockEntityAt(level, pos); + protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level worldIn, BlockPos pos, Player player, InteractionHand hand, BlockHitResult ray) { + var entity = getBlockEntityAt(worldIn, pos); if (entity != null) { - return entity.onSlotActivated(player, hand, ray.getDirection(), ray.getLocation().x, ray.getLocation().y, ray.getLocation().z, getHit(state, level, player)); + var result = entity.onSlotActivated(player, hand, ray.getDirection(), ray.getLocation().x, ray.getLocation().y, ray.getLocation().z, getHit(state, worldIn, player)); + if (result == InteractionResult.SUCCESS) { + return ItemInteractionResult.SUCCESS; + } else if (result.consumesAction()) { + return ItemInteractionResult.CONSUME; + } else { + // TODO - validate if this is ok + return ItemInteractionResult.SKIP_DEFAULT_BLOCK_INTERACTION; + } + } + return ItemInteractionResult.SKIP_DEFAULT_BLOCK_INTERACTION; + } + + @Override + protected InteractionResult useWithoutItem(BlockState state, Level worldIn, BlockPos pos, Player player, BlockHitResult ray) { + var entity = getBlockEntityAt(worldIn, pos); + if (entity != null) { + return entity.onSlotActivated(player, InteractionHand.MAIN_HAND, ray.getDirection(), ray.getLocation().x, ray.getLocation().y, ray.getLocation().z, getHit(state, worldIn, player)); } return InteractionResult.PASS; } @@ -122,23 +141,23 @@ public NonNullList getDynamicDrops(BlockState state, Level worldIn, B protected void copyTo(T tile, ItemStack stack) { if (!tile.isEverythingEmpty()) { - stack.setData(FSAttachments.TILE, tile.saveWithoutMetadata()); + stack.set(FSAttachments.TILE, tile.saveWithoutMetadata(tile.getLevel().registryAccess())); } if (tile.isLocked()) { - stack.setData(FSAttachments.LOCKED, tile.isLocked()); + stack.set(FSAttachments.LOCKED, tile.isLocked()); } if (tile instanceof FramedTile framedDrawerTile && framedDrawerTile.getFramedDrawerModelData() != null) { - stack.setData(FSAttachments.STYLE, framedDrawerTile.getFramedDrawerModelData().serializeNBT()); + stack.set(FSAttachments.STYLE, framedDrawerTile.getFramedDrawerModelData().serializeNBT(tile.getLevel().registryAccess())); } } protected void copyFrom(ItemStack stack, T tile) { - tile.setLocked(stack.getData(FSAttachments.LOCKED)); - if (stack.hasData(FSAttachments.TILE)) { - tile.load(stack.getData(FSAttachments.TILE)); + tile.setLocked(stack.getOrDefault(FSAttachments.LOCKED, false)); + if (stack.has(FSAttachments.TILE)) { + tile.loadAdditional(stack.get(FSAttachments.TILE), tile.getLevel().registryAccess()); tile.markForUpdate(); } - if (stack.hasData(FSAttachments.STYLE) && tile instanceof FramedTile framed) { + if (stack.has(FSAttachments.STYLE) && tile instanceof FramedTile framed) { framed.setFramedDrawerModelData(FramedDrawerBlock.getDrawerModelData(stack)); } } @@ -193,7 +212,7 @@ public int getSignal(BlockState p_60483_, BlockGetter blockGetter, BlockPos bloc for (int i = 0; i < tile.getUtilityUpgrades().getSlots(); i++) { ItemStack stack = tile.getUtilityUpgrades().getStackInSlot(i); if (stack.getItem().equals(FunctionalStorage.REDSTONE_UPGRADE.get())){ - int redstoneSlot = stack.getData(FSAttachments.SLOT); + int redstoneSlot = stack.getOrDefault(FSAttachments.SLOT, 0); if (redstoneSlot < tile.getStorage().getSlots()) { int amount = tile.getStorage().getStackInSlot(redstoneSlot).getCount() * 14 / tile.getStorage().getSlotLimit(redstoneSlot); return amount + (amount > 0 ? 1 : 0); @@ -205,17 +224,17 @@ public int getSignal(BlockState p_60483_, BlockGetter blockGetter, BlockPos bloc } @Override - public void appendHoverText(ItemStack stack, @org.jetbrains.annotations.Nullable BlockGetter p_49817_, List tooltip, TooltipFlag p_49819_) { - super.appendHoverText(stack, p_49817_, tooltip, p_49819_); - if (stack.hasData(FSAttachments.TILE)) { + public void appendHoverText(ItemStack stack, Item.TooltipContext context, List tooltipComponents, TooltipFlag tooltipFlag) { + super.appendHoverText(stack, context, tooltipComponents, tooltipFlag); + if (stack.has(FSAttachments.TILE)) { MutableComponent text = Component.translatable("drawer.block.contents"); - tooltip.add(text.withStyle(ChatFormatting.GRAY)); - tooltip.add(Component.literal("")); - tooltip.add(Component.literal("")); + tooltipComponents.add(text.withStyle(ChatFormatting.GRAY)); + tooltipComponents.add(Component.literal("")); + tooltipComponents.add(Component.literal("")); } if (this instanceof FramedBlock) { - tooltip.add(Component.translatable("frameddrawer.use").withStyle(ChatFormatting.GRAY)); + tooltipComponents.add(Component.translatable("frameddrawer.use").withStyle(ChatFormatting.GRAY)); } } @@ -224,7 +243,7 @@ public ItemStack getCloneItemStack(BlockState state, HitResult target, LevelRead BlockEntity entity = level.getBlockEntity(pos); ItemStack stack = new ItemStack(this); if (entity instanceof FramedTile framedDrawerTile && framedDrawerTile.getFramedDrawerModelData() != null && !framedDrawerTile.getFramedDrawerModelData().getDesign().isEmpty()) { - stack.setData(FSAttachments.STYLE, framedDrawerTile.getFramedDrawerModelData().serializeNBT()); + stack.set(FSAttachments.STYLE, framedDrawerTile.getFramedDrawerModelData().serializeNBT(level.registryAccess())); return stack; } if (entity instanceof ControllableDrawerTile tile) { diff --git a/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java index 8fde6695..93698ab8 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java @@ -157,9 +157,9 @@ public void registerRecipe(RecipeOutput consumer) { if (type == FunctionalStorage.DrawerType.X_1) { if (woodType.getName().equals("oak")){ TitaniumShapedRecipeBuilder.shapedRecipe(this) - .setName(new ResourceLocation(FunctionalStorage.MOD_ID, "oak_drawer_alternate_x1")) + .setName(com.buuz135.functionalstorage.util.Utils.resourceLocation(FunctionalStorage.MOD_ID, "oak_drawer_alternate_x1")) .pattern("PPP").pattern("PCP").pattern("PPP") - .define('P', new DrawerlessWoodIngredient()) + .define('P', new DrawerlessWoodIngredient().toVanilla()) .define('C', Tags.Items.CHESTS_WOODEN) .save(consumer); } else { @@ -173,9 +173,9 @@ public void registerRecipe(RecipeOutput consumer) { if (type == FunctionalStorage.DrawerType.X_2){ if (woodType.getName().equals("oak")){ TitaniumShapedRecipeBuilder.shapedRecipe(this, 2) - .setName(new ResourceLocation(FunctionalStorage.MOD_ID, "oak_drawer_alternate_x2")) + .setName(com.buuz135.functionalstorage.util.Utils.resourceLocation(FunctionalStorage.MOD_ID, "oak_drawer_alternate_x2")) .pattern("PCP").pattern("PPP").pattern("PCP") - .define('P', new DrawerlessWoodIngredient()) + .define('P', new DrawerlessWoodIngredient().toVanilla()) .define('C', Tags.Items.CHESTS_WOODEN) .save(consumer); } else { @@ -189,9 +189,9 @@ public void registerRecipe(RecipeOutput consumer) { if (type == FunctionalStorage.DrawerType.X_4){ if (woodType.getName().equals("oak")){ TitaniumShapedRecipeBuilder.shapedRecipe(this, 4) - .setName(new ResourceLocation(FunctionalStorage.MOD_ID, "oak_drawer_alternate_x4")) + .setName(com.buuz135.functionalstorage.util.Utils.resourceLocation(FunctionalStorage.MOD_ID, "oak_drawer_alternate_x4")) .pattern("CPC").pattern("PPP").pattern("CPC") - .define('P', new DrawerlessWoodIngredient()) + .define('P', new DrawerlessWoodIngredient().toVanilla()) .define('C', Tags.Items.CHESTS_WOODEN) .save(consumer); } else { @@ -217,7 +217,6 @@ public static class DrawerItem extends BlockItem{ public DrawerItem(DrawerBlock p_40565_, net.minecraft.world.item.Item.Properties p_40566_, TitaniumTab tab) { super(p_40565_, p_40566_); this.drawerBlock = p_40565_; - tab.getTabList().add(this); } @Nullable diff --git a/src/main/java/com/buuz135/functionalstorage/block/DrawerControllerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/DrawerControllerBlock.java index da204ed2..147db90a 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/DrawerControllerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/DrawerControllerBlock.java @@ -28,8 +28,8 @@ public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { public void registerRecipe(RecipeOutput consumer) { TitaniumShapedRecipeBuilder.shapedRecipe(FunctionalStorage.DRAWER_CONTROLLER.block().get()) .pattern("IBI").pattern("CDC").pattern("IBI") - .define('I', Tags.Items.STONE) - .define('B', Tags.Items.STORAGE_BLOCKS_QUARTZ) + .define('I', Tags.Items.STONES) + .define('B', Items.QUARTZ_BLOCK) .define('C', StorageTags.DRAWER) .define('D', Items.COMPARATOR) .save(consumer); diff --git a/src/main/java/com/buuz135/functionalstorage/block/EnderDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/EnderDrawerBlock.java index 33819b40..e837441e 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/EnderDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/EnderDrawerBlock.java @@ -81,7 +81,7 @@ public Collection getHitShapes(BlockState state) { @Override protected void copyTo(EnderDrawerTile tile, ItemStack stack) { if (!tile.isEverythingEmpty()) { - stack.setData(FSAttachments.TILE, tile.saveWithoutMetadata()); + stack.set(FSAttachments.TILE, tile.saveWithoutMetadata(tile.getLevel().registryAccess())); } } @@ -105,12 +105,12 @@ public void onRemove(BlockState state, Level worldIn, BlockPos pos, BlockState n @Override - public void appendHoverText(ItemStack p_49816_, @Nullable BlockGetter p_49817_, List tooltip, TooltipFlag p_49819_) { - if (p_49816_.hasData(FSAttachments.TILE)) { + public void appendHoverText(ItemStack stack, Item.TooltipContext context, List tooltipComponents, TooltipFlag tooltipFlag) { + if (stack.has(FSAttachments.TILE)) { MutableComponent text = Component.translatable("linkingtool.ender.frequency"); - tooltip.add(text.withStyle(ChatFormatting.GRAY)); - tooltip.add(Component.literal("")); - tooltip.add(Component.literal("")); + tooltipComponents.add(text.withStyle(ChatFormatting.GRAY)); + tooltipComponents.add(Component.literal("")); + tooltipComponents.add(Component.literal("")); } } diff --git a/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java index e2732626..8152dd7d 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java @@ -9,6 +9,7 @@ import com.buuz135.functionalstorage.item.FSAttachments; import com.buuz135.functionalstorage.item.LinkingToolItem; import com.buuz135.functionalstorage.util.NumberUtils; +import com.buuz135.functionalstorage.util.Utils; import com.hrznstudio.titanium.block.RotatableBlock; import com.hrznstudio.titanium.datagenerator.loot.block.BasicBlockLootTables; import com.hrznstudio.titanium.recipe.generator.TitaniumShapedRecipeBuilder; @@ -20,13 +21,16 @@ import net.minecraft.core.NonNullList; import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.NbtOps; import net.minecraft.network.chat.Component; +import net.minecraft.resources.RegistryOps; import net.minecraft.tags.ItemTags; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.TooltipFlag; @@ -133,14 +137,14 @@ public FunctionalStorage.DrawerType getType() { } @Override - public void appendHoverText(ItemStack itemStack, @Nullable BlockGetter p_49817_, List tooltip, TooltipFlag p_49819_) { - if (itemStack.hasData(FSAttachments.TILE)) { - var tileTag = itemStack.getData(FSAttachments.TILE).getCompound("fluidHandler"); + public void appendHoverText(ItemStack itemStack, Item.TooltipContext context, List tooltip, TooltipFlag tooltipFlag) { + if (itemStack.has(FSAttachments.TILE)) { + var tileTag = itemStack.get(FSAttachments.TILE).getCompound("fluidHandler"); tooltip.add(Component.translatable("drawer.block.contents").withStyle(ChatFormatting.GRAY)); for (int i = 0; i < type.getSlots(); i++) { - FluidStack stack = FluidStack.loadFluidStackFromNBT(tileTag.getCompound(i + "")); + FluidStack stack = FluidStack.CODEC.decode(RegistryOps.create(NbtOps.INSTANCE, Utils.registryAccess()), tileTag.getCompound(i + "")).getOrThrow().getFirst(); if (!stack.isEmpty()) - tooltip.add(Component.literal(" - " + ChatFormatting.YELLOW + NumberUtils.getFormatedFluidBigNumber(stack.getAmount()) + ChatFormatting.WHITE + " of ").append(stack.getDisplayName().copy().withStyle(ChatFormatting.GOLD))); + tooltip.add(Component.literal(" - " + ChatFormatting.YELLOW + NumberUtils.getFormatedFluidBigNumber(stack.getAmount()) + ChatFormatting.WHITE + " of ").append(stack.getHoverName().copy().withStyle(ChatFormatting.GOLD))); } } } @@ -152,7 +156,7 @@ public int getSignal(BlockState p_60483_, BlockGetter blockGetter, BlockPos bloc for (int i = 0; i < tile.getUtilityUpgrades().getSlots(); i++) { ItemStack stack = tile.getUtilityUpgrades().getStackInSlot(i); if (stack.getItem().equals(FunctionalStorage.REDSTONE_UPGRADE.get())) { - int redstoneSlot = stack.getData(FSAttachments.SLOT); + int redstoneSlot = stack.getOrDefault(FSAttachments.SLOT, 0); if (redstoneSlot < tile.getFluidHandler().getTanks()) { return tile.getFluidHandler().getFluidInTank(redstoneSlot).getAmount() * 15 / tile.getFluidHandler().getTankCapacity(redstoneSlot); } diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java index 09dd2620..a038f5ab 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedControllerExtensionBlock.java @@ -54,7 +54,7 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) if (blockEntity instanceof FramedControllerExtensionTile framedControllerExtensionTile) { if (framedControllerExtensionTile.getFramedDrawerModelData() != null) { - stack.setData(FSAttachments.STYLE, framedControllerExtensionTile.getFramedDrawerModelData().serializeNBT()); + stack.set(FSAttachments.STYLE, framedControllerExtensionTile.getFramedDrawerModelData().serializeNBT(blockEntity.getLevel().registryAccess())); } } @@ -69,7 +69,7 @@ public ItemStack getCloneItemStack(BlockState state, HitResult target, LevelRead if (framedControllerExtensionTile.getFramedDrawerModelData() != null) { if (!framedControllerExtensionTile.getFramedDrawerModelData().getDesign().isEmpty()) { ItemStack stack = new ItemStack(this); - stack.setData(FSAttachments.STYLE, framedControllerExtensionTile.getFramedDrawerModelData().serializeNBT()); + stack.set(FSAttachments.STYLE, framedControllerExtensionTile.getFramedDrawerModelData().serializeNBT(level.registryAccess())); return stack; } } @@ -82,7 +82,7 @@ public void registerRecipe(RecipeOutput consumer) { TitaniumShapedRecipeBuilder.shapedRecipe(FunctionalStorage.FRAMED_CONTROLLER_EXTENSION.block().get()) .pattern("IBI").pattern("CDC").pattern("IBI") .define('I', Items.IRON_NUGGET) - .define('B', Tags.Items.STORAGE_BLOCKS_QUARTZ) + .define('B', Items.QUARTZ_BLOCK) .define('C', StorageTags.DRAWER) .define('D', Items.REPEATER) .save(consumer); diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java index a9594fdf..a797f745 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java @@ -54,22 +54,22 @@ public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { } public static FramedDrawerModelData getDrawerModelData(ItemStack stack){ - if (stack.hasData(FSAttachments.STYLE)){ - CompoundTag tag = stack.getData(FSAttachments.STYLE); + if (stack.has(FSAttachments.STYLE)) { + CompoundTag tag = stack.get(FSAttachments.STYLE); if (tag.isEmpty()) return null; HashMap data = new HashMap<>(); - data.put("particle", BuiltInRegistries.ITEM.get(new ResourceLocation(tag.getString("particle")))); - data.put("front", BuiltInRegistries.ITEM.get(new ResourceLocation(tag.getString("front")))); - data.put("side", BuiltInRegistries.ITEM.get(new ResourceLocation(tag.getString("side")))); - data.put("front_divider", BuiltInRegistries.ITEM.get(new ResourceLocation(tag.getString("front_divider")))); + data.put("particle", BuiltInRegistries.ITEM.get(com.buuz135.functionalstorage.util.Utils.resourceLocation(tag.getString("particle")))); + data.put("front", BuiltInRegistries.ITEM.get(com.buuz135.functionalstorage.util.Utils.resourceLocation(tag.getString("front")))); + data.put("side", BuiltInRegistries.ITEM.get(com.buuz135.functionalstorage.util.Utils.resourceLocation(tag.getString("side")))); + data.put("front_divider", BuiltInRegistries.ITEM.get(com.buuz135.functionalstorage.util.Utils.resourceLocation(tag.getString("front_divider")))); return new FramedDrawerModelData(data); } return null; } public static ItemStack fill(ItemStack first, ItemStack second, ItemStack drawer, ItemStack divider){ - drawer = ItemHandlerHelper.copyStackWithSize(drawer, 1); - CompoundTag style = drawer.getData(FSAttachments.STYLE); + drawer = drawer.copyWithCount(1); + CompoundTag style = drawer.get(FSAttachments.STYLE); style.putString("particle", BuiltInRegistries.ITEM.getKey(first.getItem()).toString()); style.putString("side", BuiltInRegistries.ITEM.getKey(first.getItem()).toString()); style.putString("front", BuiltInRegistries.ITEM.getKey(second.getItem()).toString()); @@ -78,7 +78,7 @@ public static ItemStack fill(ItemStack first, ItemStack second, ItemStack drawer } else { style.putString("front_divider", BuiltInRegistries.ITEM.getKey(divider.getItem()).toString()); } - drawer.setData(FSAttachments.STYLE, style); + drawer.set(FSAttachments.STYLE, style); return drawer; } diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerControllerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerControllerBlock.java index 5e6e5296..29a737f4 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerControllerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerControllerBlock.java @@ -53,7 +53,7 @@ public List getDrops(BlockState p_60537_, LootParams.Builder builder) if (blockEntity instanceof FramedDrawerControllerTile framedControllerTile) { if (framedControllerTile.getFramedDrawerModelData() != null) { - stack.setData(FSAttachments.STYLE, framedControllerTile.getFramedDrawerModelData().serializeNBT()); + stack.set(FSAttachments.STYLE, framedControllerTile.getFramedDrawerModelData().serializeNBT(blockEntity.getLevel().registryAccess())); } } @@ -68,7 +68,7 @@ public ItemStack getCloneItemStack(BlockState state, HitResult target, LevelRead if (framedDrawerControllerTile.getFramedDrawerModelData() != null) { if (!framedDrawerControllerTile.getFramedDrawerModelData().getDesign().isEmpty()) { ItemStack stack = new ItemStack(this); - stack.setData(FSAttachments.STYLE, framedDrawerControllerTile.getFramedDrawerModelData().serializeNBT()); + stack.set(FSAttachments.STYLE, framedDrawerControllerTile.getFramedDrawerModelData().serializeNBT(blockEntity.getLevel().registryAccess())); return stack; } } @@ -81,7 +81,7 @@ public void registerRecipe(RecipeOutput consumer) { TitaniumShapedRecipeBuilder.shapedRecipe(FunctionalStorage.FRAMED_DRAWER_CONTROLLER.block().get()) .pattern("IBI").pattern("CDC").pattern("IBI") .define('I', Items.IRON_NUGGET) - .define('B', Tags.Items.STORAGE_BLOCKS_QUARTZ) + .define('B', Items.QUARTZ_BLOCK) .define('C', StorageTags.DRAWER) .define('D', Items.COMPARATOR) .save(consumer); diff --git a/src/main/java/com/buuz135/functionalstorage/block/StorageControllerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/StorageControllerBlock.java index 0430a9c2..4568ba4f 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/StorageControllerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/StorageControllerBlock.java @@ -9,7 +9,9 @@ import net.minecraft.core.Direction; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; +import net.minecraft.world.ItemInteractionResult; import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; @@ -41,8 +43,29 @@ protected void createBlockStateDefinition(StateDefinition.Builder storageTile.onSlotActivated(player, hand, ray.getDirection(), ray.getLocation().x, ray.getLocation().y, ray.getLocation().z)).orElse(InteractionResult.PASS); + protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level worldIn, BlockPos pos, Player player, InteractionHand hand, BlockHitResult ray) { + var entity = TileUtil.getTileEntity(worldIn, pos, StorageControllerTile.class).orElse(null); + if (entity != null) { + var result = entity.onSlotActivated(player, hand, ray.getDirection(), ray.getLocation().x, ray.getLocation().y, ray.getLocation().z); + if (result == InteractionResult.SUCCESS) { + return ItemInteractionResult.SUCCESS; + } else if (result.consumesAction()) { + return ItemInteractionResult.CONSUME; + } else { + // TODO - validate if this is ok + return ItemInteractionResult.SKIP_DEFAULT_BLOCK_INTERACTION; + } + } + return ItemInteractionResult.SKIP_DEFAULT_BLOCK_INTERACTION; + } + + @Override + protected InteractionResult useWithoutItem(BlockState state, Level worldIn, BlockPos pos, Player player, BlockHitResult ray) { + var entity = TileUtil.getTileEntity(worldIn, pos, StorageControllerTile.class).orElse(null); + if (entity != null) { + return entity.onSlotActivated(player, InteractionHand.MAIN_HAND, ray.getDirection(), ray.getLocation().x, ray.getLocation().y, ray.getLocation().z); + } + return InteractionResult.PASS; } @Override diff --git a/src/main/java/com/buuz135/functionalstorage/block/StorageControllerExtensionBlock.java b/src/main/java/com/buuz135/functionalstorage/block/StorageControllerExtensionBlock.java index a5322b4f..9247ae31 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/StorageControllerExtensionBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/StorageControllerExtensionBlock.java @@ -10,7 +10,9 @@ import net.minecraft.core.Direction; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; +import net.minecraft.world.ItemInteractionResult; import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; @@ -39,8 +41,29 @@ protected void createBlockStateDefinition(StateDefinition.Builder drawerTile.onSlotActivated(player, hand, ray.getDirection(), ray.getLocation().x, ray.getLocation().y, ray.getLocation().z)).orElse(InteractionResult.PASS); + protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level worldIn, BlockPos pos, Player player, InteractionHand hand, BlockHitResult ray) { + var entity = TileUtil.getTileEntity(worldIn, pos, StorageControllerExtensionTile.class).orElse(null); + if (entity != null) { + var result = entity.onSlotActivated(player, hand, ray.getDirection(), ray.getLocation().x, ray.getLocation().y, ray.getLocation().z); + if (result == InteractionResult.SUCCESS) { + return ItemInteractionResult.SUCCESS; + } else if (result.consumesAction()) { + return ItemInteractionResult.CONSUME; + } else { + // TODO - validate if this is ok + return ItemInteractionResult.SKIP_DEFAULT_BLOCK_INTERACTION; + } + } + return ItemInteractionResult.SKIP_DEFAULT_BLOCK_INTERACTION; + } + + @Override + protected InteractionResult useWithoutItem(BlockState state, Level worldIn, BlockPos pos, Player player, BlockHitResult ray) { + var entity = TileUtil.getTileEntity(worldIn, pos, StorageControllerExtensionTile.class).orElse(null); + if (entity != null) { + return entity.onSlotActivated(player, InteractionHand.MAIN_HAND, ray.getDirection(), ray.getLocation().x, ray.getLocation().y, ray.getLocation().z); + } + return InteractionResult.PASS; } @Override diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/ArmoryCabinetTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/ArmoryCabinetTile.java index dfd81958..e60502bf 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/ArmoryCabinetTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/ArmoryCabinetTile.java @@ -6,6 +6,7 @@ import com.hrznstudio.titanium.block.tile.ActiveTile; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.HolderLookup; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.Connection; import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; @@ -38,17 +39,16 @@ public IItemHandler getStorage() { @Override public ClientboundBlockEntityDataPacket getUpdatePacket() { - return ClientboundBlockEntityDataPacket.create(this, blockEntity -> new CompoundTag()); + return ClientboundBlockEntityDataPacket.create(this, (blockEntity, acc) -> new CompoundTag()); } @Override - public void onDataPacket(Connection net, ClientboundBlockEntityDataPacket pkt) { - //super.onDataPacket(net, pkt); + public void onDataPacket(Connection net, ClientboundBlockEntityDataPacket pkt, HolderLookup.Provider provider) { } - @Override + @Override // TODO - wat? @Nonnull - public CompoundTag getUpdateTag() { + public CompoundTag getUpdateTag(HolderLookup.Provider provider) { CompoundTag compoundTag = new CompoundTag(); return compoundTag; } diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingDrawerTile.java index 2bad0f79..16585fa8 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingDrawerTile.java @@ -70,7 +70,7 @@ public boolean isLocked() { public void initClient() { super.initClient(); addGuiAddonFactory(() -> new DrawerInfoGuiAddon(64, 16, - new ResourceLocation(FunctionalStorage.MOD_ID, this instanceof CompactingFramedDrawerTile ? "textures/block/framed_front_compacting.png" : "textures/block/compacting_drawer_front.png"), + com.buuz135.functionalstorage.util.Utils.resourceLocation(FunctionalStorage.MOD_ID, this instanceof CompactingFramedDrawerTile ? "textures/block/framed_front_compacting.png" : "textures/block/compacting_drawer_front.png"), 3, integer -> { if (integer == 0) return Pair.of(28, 28); diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/ControllableDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/ControllableDrawerTile.java index 373c2b74..91351bba 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/ControllableDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/ControllableDrawerTile.java @@ -19,6 +19,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; +import net.minecraft.world.ItemInteractionResult; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; @@ -209,7 +210,7 @@ public InteractionResult onSlotActivated(Player playerIn, InteractionHand hand, } } } - if (super.onActivated(playerIn, hand, facing, hitX, hitY, hitZ) == InteractionResult.SUCCESS) { + if (super.onActivated(playerIn, hand, facing, hitX, hitY, hitZ) == ItemInteractionResult.SUCCESS) { return InteractionResult.SUCCESS; } if (slot == -1) { @@ -359,7 +360,7 @@ public void setAdvancedValue(ConfigurationToolItem.ConfigurationAction configura } @Override - public CompoundTag serializeNBT() { + public CompoundTag serializeNBT(net.minecraft.core.HolderLookup.Provider provider) { CompoundTag compoundTag = new CompoundTag(); for (ConfigurationToolItem.ConfigurationAction action : this.options.keySet()) { compoundTag.putBoolean(action.name(), this.options.get(action)); @@ -371,7 +372,7 @@ public CompoundTag serializeNBT() { } @Override - public void deserializeNBT(CompoundTag nbt) { + public void deserializeNBT(net.minecraft.core.HolderLookup.Provider provider, CompoundTag nbt) { for (String allKey : nbt.getAllKeys()) { if (allKey.startsWith("Advanced: ")) { this.advancedOptions.put(ConfigurationToolItem.ConfigurationAction.valueOf(allKey.replace("Advanced: ", "")), nbt.getInt(allKey)); diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/DrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/DrawerTile.java index 4825b560..e01a86a1 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/DrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/DrawerTile.java @@ -71,7 +71,7 @@ public boolean isCreative() { public void initClient() { super.initClient(); addGuiAddonFactory(() -> new DrawerInfoGuiAddon(64, 16, - new ResourceLocation(FunctionalStorage.MOD_ID, "textures/block/" + woodType.getName() + "_front_" + type.getSlots() + ".png"), + com.buuz135.functionalstorage.util.Utils.resourceLocation(FunctionalStorage.MOD_ID, "textures/block/" + woodType.getName() + "_front_" + type.getSlots() + ".png"), type.getSlots(), type.getSlotPosition(), integer -> getHandler().getStackInSlot(integer), diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/EnderDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/EnderDrawerTile.java index ee2daa5a..077ddc82 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/EnderDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/EnderDrawerTile.java @@ -9,6 +9,7 @@ import com.hrznstudio.titanium.block.BasicTileBlock; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.HolderLookup; import net.minecraft.nbt.CompoundTag; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; @@ -49,7 +50,7 @@ public void setLevel(Level p_155231_) { public void initClient() { super.initClient(); addGuiAddonFactory(() -> new DrawerInfoGuiAddon(64, 16, - new ResourceLocation(FunctionalStorage.MOD_ID, "textures/block/ender_front.png"), + com.buuz135.functionalstorage.util.Utils.resourceLocation(FunctionalStorage.MOD_ID, "textures/block/ender_front.png"), 1, FunctionalStorage.DrawerType.X_1.getSlotPosition(), integer -> getStorage().getStackInSlot(integer), @@ -98,9 +99,9 @@ public void onClicked(Player playerIn, int slot) { } @Override - public void load(CompoundTag compound) { + public void loadAdditional(CompoundTag compound, HolderLookup.Provider provider) { String oldFreq = this.frequency; - super.load(compound); + super.loadAdditional(compound, provider); if (!this.frequency.equalsIgnoreCase(oldFreq) && level instanceof ServerLevel){ setFrequency(this.frequency); } diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java index 650144ee..0589df14 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/FluidDrawerTile.java @@ -28,10 +28,8 @@ import net.neoforged.neoforge.capabilities.Capabilities; import net.neoforged.neoforge.common.util.FakePlayerFactory; import net.neoforged.neoforge.fluids.FluidUtil; -import net.neoforged.neoforge.fluids.IFluidBlock; import net.neoforged.neoforge.fluids.capability.IFluidHandler; import net.neoforged.neoforge.fluids.capability.wrappers.BucketPickupHandlerWrapper; -import net.neoforged.neoforge.fluids.capability.wrappers.FluidBlockWrapper; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -89,7 +87,7 @@ public void initClient() { } String finalSlotName = slotName; addGuiAddonFactory(() -> new FluidDrawerInfoGuiAddon(64, 16, - new ResourceLocation(FunctionalStorage.MOD_ID, "textures/block/fluid_front" + finalSlotName + ".png"), + com.buuz135.functionalstorage.util.Utils.resourceLocation(FunctionalStorage.MOD_ID, "textures/block/fluid_front" + finalSlotName + ".png"), type.getSlots(), type.getSlotPosition(), this::getFluidHandler, @@ -152,9 +150,7 @@ public void serverTick(Level level, BlockPos pos, BlockState stateOwn, FluidDraw BlockState state = level.getBlockState(pos.relative(direction)); Block block = state.getBlock(); IFluidHandler targetFluidHandler = null; - if (block instanceof IFluidBlock) { - targetFluidHandler = new FluidBlockWrapper((IFluidBlock) block, level, pos.relative(direction)); - } else if (block instanceof BucketPickup) { + if (block instanceof BucketPickup) { targetFluidHandler = new BucketPickupHandlerWrapper(FakePlayerFactory.get((ServerLevel) level, FP), (BucketPickup) block, level, pos.relative(direction)); } if (targetFluidHandler != null) { diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java index b32e8703..aaf276fa 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/ItemControllableDrawerTile.java @@ -12,6 +12,7 @@ import net.minecraft.core.Direction; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; +import net.minecraft.world.ItemInteractionResult; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; @@ -103,13 +104,13 @@ public void serverTick(Level level, BlockPos pos, BlockState state, T blockEntit Direction direction = UpgradeItem.getDirection(stack); AABB box = new AABB(pos.relative(direction)); for (ItemEntity entitiesOfClass : level.getEntitiesOfClass(ItemEntity.class, box)) { - ItemStack pulledStack = ItemHandlerHelper.copyStackWithSize(entitiesOfClass.getItem(), Math.min(entitiesOfClass.getItem().getCount(), FunctionalStorageConfig.UPGRADE_COLLECTOR_ITEMS)); + ItemStack pulledStack = entitiesOfClass.getItem().copyWithCount(Math.min(entitiesOfClass.getItem().getCount(), FunctionalStorageConfig.UPGRADE_COLLECTOR_ITEMS)); if (pulledStack.isEmpty()) continue; boolean hasWorked = false; for (int ourSlot = 0; ourSlot < this.getStorage().getSlots(); ourSlot++) { ItemStack simulated = getStorage().insertItem(ourSlot, pulledStack, true); if (simulated.getCount() != pulledStack.getCount()) { - getStorage().insertItem(ourSlot, ItemHandlerHelper.copyStackWithSize(entitiesOfClass.getItem(), pulledStack.getCount() - simulated.getCount()), false); + getStorage().insertItem(ourSlot, entitiesOfClass.getItem().copyWithCount(pulledStack.getCount() - simulated.getCount()), false); entitiesOfClass.getItem().shrink(pulledStack.getCount() - simulated.getCount()); hasWorked = true; break; @@ -127,7 +128,7 @@ public void serverTick(Level level, BlockPos pos, BlockState state, T blockEntit @Override public InteractionResult onSlotActivated(Player playerIn, InteractionHand hand, Direction facing, double hitX, double hitY, double hitZ, int slot) { ItemStack stack = playerIn.getItemInHand(hand); - if (super.onActivated(playerIn, hand, facing, hitX, hitY, hitZ) == InteractionResult.SUCCESS) { + if (super.onActivated(playerIn, hand, facing, hitX, hitY, hitZ) == ItemInteractionResult.SUCCESS) { return InteractionResult.SUCCESS; } if (slot != -1 && isServer()) { diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/SimpleCompactingDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/SimpleCompactingDrawerTile.java index ad46df59..300e61fb 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/SimpleCompactingDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/SimpleCompactingDrawerTile.java @@ -70,7 +70,7 @@ public boolean isLocked() { public void initClient() { super.initClient(); addGuiAddonFactory(() -> new DrawerInfoGuiAddon(64, 16, - new ResourceLocation(FunctionalStorage.MOD_ID, "textures/block/simple_compacting_drawer_front.png"), + com.buuz135.functionalstorage.util.Utils.resourceLocation(FunctionalStorage.MOD_ID, "textures/block/simple_compacting_drawer_front.png"), 2, integer -> { if (integer == 0) return Pair.of(16, 28); diff --git a/src/main/java/com/buuz135/functionalstorage/client/BaseDrawerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/BaseDrawerRenderer.java index 29cc1a70..48befb3c 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/BaseDrawerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/BaseDrawerRenderer.java @@ -21,23 +21,23 @@ public final void render(T tile, float partialTicks, PoseStack matrixStack, Mult matrixStack.pushPose(); Direction facing = tile.getFacingDirection(); - matrixStack.mulPoseMatrix(createTransformMatrix( + matrixStack.mulPose(createTransformMatrix( new Vector3f(0), new Vector3f(0, 180, 0), 1)); if (facing == Direction.NORTH) { - matrixStack.mulPoseMatrix(createTransformMatrix( + matrixStack.mulPose(createTransformMatrix( new Vector3f(-1, 0, 0), new Vector3f(0), 1)); } else if (facing == Direction.EAST) { - matrixStack.mulPoseMatrix(createTransformMatrix( + matrixStack.mulPose(createTransformMatrix( new Vector3f(-1, 0, -1), new Vector3f(0, -90, 0), 1)); } else if (facing == Direction.SOUTH) { - matrixStack.mulPoseMatrix(createTransformMatrix( + matrixStack.mulPose(createTransformMatrix( new Vector3f(0, 0, -1), new Vector3f(0, 180, 0), 1)); } else if (facing == Direction.WEST) { - matrixStack.mulPoseMatrix(createTransformMatrix( + matrixStack.mulPose(createTransformMatrix( new Vector3f(0, 0, 0), new Vector3f(0, 90, 0), 1)); } diff --git a/src/main/java/com/buuz135/functionalstorage/client/ClientSetup.java b/src/main/java/com/buuz135/functionalstorage/client/ClientSetup.java index f828c327..9f965972 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/ClientSetup.java +++ b/src/main/java/com/buuz135/functionalstorage/client/ClientSetup.java @@ -14,7 +14,7 @@ public class ClientSetup { public static void init() { EventManager.forge(ItemTooltipEvent.class).filter( - event -> UpgradeItem.isDirectionUpgrade(event.getItemStack().getItem()) && event.getItemStack().hasData(FSAttachments.DIRECTION) + event -> UpgradeItem.isDirectionUpgrade(event.getItemStack().getItem()) && event.getItemStack().has(FSAttachments.DIRECTION) ).filter(event -> Minecraft.getInstance().screen != null && Minecraft.getInstance().screen instanceof BasicAddonScreen bcs && bcs.getMenu().getObject() instanceof ItemControllableDrawerTile) .process(event -> { var sc = (BasicAddonScreen) Minecraft.getInstance().screen; diff --git a/src/main/java/com/buuz135/functionalstorage/client/CompactingDrawerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/CompactingDrawerRenderer.java index 3d7969fa..2cf0f0e9 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/CompactingDrawerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/CompactingDrawerRenderer.java @@ -21,7 +21,7 @@ public void renderItems(CompactingDrawerTile tile, float partialTicks, PoseStack ItemStack stack = tile.getHandler().getResultList().get(0).getResult(); if (!stack.isEmpty()){ matrixStack.pushPose(); - matrixStack.mulPoseMatrix(createTransformMatrix( + matrixStack.mulPose(createTransformMatrix( new Vector3f(.75f, .27f, .0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); DrawerRenderer.renderStack(matrixStack, bufferIn, combinedLightIn, combinedOverlayIn, stack, tile.getHandler().getStackInSlot(0).getCount(),tile.getHandler().getSlotLimit(0), 0.02f, tile.getDrawerOptions(), tile.getLevel()); matrixStack.popPose(); @@ -29,7 +29,7 @@ public void renderItems(CompactingDrawerTile tile, float partialTicks, PoseStack stack = tile.getHandler().getResultList().get(1).getResult(); if (!stack.isEmpty()){ matrixStack.pushPose(); - matrixStack.mulPoseMatrix(createTransformMatrix( + matrixStack.mulPose(createTransformMatrix( new Vector3f(.25f, .27f, .0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); DrawerRenderer.renderStack(matrixStack, bufferIn, combinedLightIn, combinedOverlayIn, stack, tile.getHandler().getStackInSlot(1).getCount(), tile.getHandler().getSlotLimit(1), 0.02f, tile.getDrawerOptions(), tile.getLevel()); matrixStack.popPose(); @@ -37,7 +37,7 @@ public void renderItems(CompactingDrawerTile tile, float partialTicks, PoseStack stack = tile.getHandler().getResultList().get(2).getResult(); if (!stack.isEmpty()){ matrixStack.pushPose(); - matrixStack.mulPoseMatrix(createTransformMatrix( + matrixStack.mulPose(createTransformMatrix( new Vector3f(.5f, .77f, .0005f),new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); DrawerRenderer.renderStack(matrixStack, bufferIn, combinedLightIn, combinedOverlayIn, stack, tile.getHandler().getStackInSlot(2).getCount(), tile.getHandler().getSlotLimit(2), 0.02f, tile.getDrawerOptions(), tile.getLevel()); matrixStack.popPose(); diff --git a/src/main/java/com/buuz135/functionalstorage/client/ControllerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/ControllerRenderer.java index 4013c418..94bdba68 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/ControllerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/ControllerRenderer.java @@ -26,26 +26,24 @@ import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import net.neoforged.neoforge.client.extensions.IBlockEntityRendererExtension; import org.joml.Matrix4f; import java.util.List; -import java.util.OptionalDouble; public class ControllerRenderer implements BlockEntityRenderer> { public static RenderType TYPE = RenderType.create("custom_lines", DefaultVertexFormat.POSITION_COLOR_NORMAL, VertexFormat.Mode.LINES, 256, false, false,RenderType.CompositeState.builder() .setShaderState(new RenderStateShard.ShaderStateShard(GameRenderer::getRendertypeLinesShader)) .setDepthTestState(new RenderStateShard.DepthTestStateShard("always", 519)) - .setLineState(new RenderStateShard.LineStateShard(OptionalDouble.empty())) +// .set(new RenderStateShard.LineStateShard(OptionalDouble.empty())) .setLayeringState(new RenderStateShard.LayeringStateShard("view_offset_z_layering", () -> { - PoseStack posestack = RenderSystem.getModelViewStack(); - posestack.pushPose(); + var posestack = RenderSystem.getModelViewStack(); + posestack.pushMatrix(); posestack.scale(0.99975586F, 0.99975586F, 0.99975586F); RenderSystem.applyModelViewMatrix(); }, () -> { - PoseStack posestack = RenderSystem.getModelViewStack(); - posestack.popPose(); + var posestack = RenderSystem.getModelViewStack(); + posestack.popMatrix(); RenderSystem.applyModelViewMatrix(); })) .setCullState(new RenderStateShard.CullStateShard(false)) @@ -62,8 +60,8 @@ private static void renderShape(PoseStack p_109783_, VertexConsumer p_109784_, V f /= f3; f1 /= f3; f2 /= f3; - p_109784_.vertex(posestack$pose.pose(), (float) (p_194324_ + p_109786_), (float) (p_194325_ + p_109787_), (float) (p_194326_ + p_109788_)).color(p_109789_, p_109790_, p_109791_, p_109792_).normal(posestack$pose.normal(), f, f1, f2).endVertex(); - p_109784_.vertex(posestack$pose.pose(), (float) (p_194327_ + p_109786_), (float) (p_194328_ + p_109787_), (float) (p_194329_ + p_109788_)).color(p_109789_, p_109790_, p_109791_, p_109792_).normal(posestack$pose.normal(), f, f1, f2).endVertex(); + p_109784_.addVertex(posestack$pose.pose(), (float) (p_194324_ + p_109786_), (float) (p_194325_ + p_109787_), (float) (p_194326_ + p_109788_)).setColor(p_109789_, p_109790_, p_109791_, p_109792_).setNormal(posestack$pose, f, f1, f2); + p_109784_.addVertex(posestack$pose.pose(), (float) (p_194327_ + p_109786_), (float) (p_194328_ + p_109787_), (float) (p_194329_ + p_109788_)).setColor(p_109789_, p_109790_, p_109791_, p_109792_).setNormal(posestack$pose, f, f1, f2); }); } @@ -72,10 +70,10 @@ public void render(StorageControllerTile tile, float partialTicks, PoseStack mat ItemStack stack = Minecraft.getInstance().player.getMainHandItem(); if (stack.isEmpty()) return; if (stack.getItem() instanceof LinkingToolItem) { - BlockPos controller = stack.getData(FSAttachments.CONTROLLER); + BlockPos controller = FSAttachments.CONTROLLER.get(stack); if (!controller.equals(tile.getBlockPos())) return; - if (stack.hasData(FSAttachments.FIRST_POSITION)) { - BlockPos firstPos = stack.getData(FSAttachments.FIRST_POSITION); + if (stack.has(FSAttachments.FIRST_POSITION)) { + BlockPos firstPos = stack.get(FSAttachments.FIRST_POSITION); HitResult result = RayTraceUtils.rayTraceSimple(Minecraft.getInstance().level, Minecraft.getInstance().player, 8, partialTicks); if (result.getType() == HitResult.Type.BLOCK){ BlockPos hit = ((BlockHitResult)result).getBlockPos(); @@ -129,7 +127,7 @@ public boolean shouldRenderOffScreen(StorageControllerTile p_112306_) { @Override public AABB getRenderBoundingBox(StorageControllerTile blockEntity) { - return IBlockEntityRendererExtension.INFINITE_EXTENT_AABB; + return AABB.INFINITE; } private static RenderType AREA_TYPE = createRenderType(); @@ -162,70 +160,70 @@ private void renderFaces(PoseStack stack, MultiBufferSource renderTypeBuffer, AA buffer = renderTypeBuffer.getBuffer(AREA_TYPE); - buffer.vertex(matrix, x1, y1, z1).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x1, y2, z1).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y2, z1).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y1, z1).color(red, green, blue, alpha).endVertex(); + buffer.addVertex(matrix, x1, y1, z1).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x1, y2, z1).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y2, z1).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y1, z1).setColor(red, green, blue, alpha); - buffer.vertex(matrix, x1, y1, z1).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y1, z1).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y2, z1).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x1, y2, z1).color(red, green, blue, alpha).endVertex(); + buffer.addVertex(matrix, x1, y1, z1).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y1, z1).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y2, z1).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x1, y2, z1).setColor(red, green, blue, alpha); - buffer.vertex(matrix, x1, y1, z2).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y1, z2).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y2, z2).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x1, y2, z2).color(red, green, blue, alpha).endVertex(); + buffer.addVertex(matrix, x1, y1, z2).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y1, z2).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y2, z2).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x1, y2, z2).setColor(red, green, blue, alpha); - buffer.vertex(matrix, x1, y1, z2).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x1, y2, z2).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y2, z2).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y1, z2).color(red, green, blue, alpha).endVertex(); + buffer.addVertex(matrix, x1, y1, z2).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x1, y2, z2).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y2, z2).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y1, z2).setColor(red, green, blue, alpha); - buffer.vertex(matrix, x1, y1, z1).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y1, z1).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y1, z2).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x1, y1, z2).color(red, green, blue, alpha).endVertex(); + buffer.addVertex(matrix, x1, y1, z1).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y1, z1).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y1, z2).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x1, y1, z2).setColor(red, green, blue, alpha); - buffer.vertex(matrix, x1, y1, z1).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x1, y1, z2).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y1, z2).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y1, z1).color(red, green, blue, alpha).endVertex(); + buffer.addVertex(matrix, x1, y1, z1).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x1, y1, z2).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y1, z2).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y1, z1).setColor(red, green, blue, alpha); - buffer.vertex(matrix, x1, y2, z1).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x1, y2, z2).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y2, z2).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y2, z1).color(red, green, blue, alpha).endVertex(); + buffer.addVertex(matrix, x1, y2, z1).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x1, y2, z2).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y2, z2).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y2, z1).setColor(red, green, blue, alpha); - buffer.vertex(matrix, x1, y2, z1).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y2, z1).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y2, z2).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x1, y2, z2).color(red, green, blue, alpha).endVertex(); + buffer.addVertex(matrix, x1, y2, z1).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y2, z1).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y2, z2).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x1, y2, z2).setColor(red, green, blue, alpha); - buffer.vertex(matrix, x1, y1, z1).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x1, y1, z2).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x1, y2, z2).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x1, y2, z1).color(red, green, blue, alpha).endVertex(); + buffer.addVertex(matrix, x1, y1, z1).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x1, y1, z2).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x1, y2, z2).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x1, y2, z1).setColor(red, green, blue, alpha); - buffer.vertex(matrix, x1, y1, z1).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x1, y2, z1).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x1, y2, z2).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x1, y1, z2).color(red, green, blue, alpha).endVertex(); + buffer.addVertex(matrix, x1, y1, z1).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x1, y2, z1).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x1, y2, z2).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x1, y1, z2).setColor(red, green, blue, alpha); - buffer.vertex(matrix, x2, y1, z1).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y2, z1).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y2, z2).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y1, z2).color(red, green, blue, alpha).endVertex(); + buffer.addVertex(matrix, x2, y1, z1).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y2, z1).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y2, z2).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y1, z2).setColor(red, green, blue, alpha); - buffer.vertex(matrix, x2, y1, z1).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y1, z2).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y2, z2).color(red, green, blue, alpha).endVertex(); - buffer.vertex(matrix, x2, y2, z1).color(red, green, blue, alpha).endVertex(); + buffer.addVertex(matrix, x2, y1, z1).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y1, z2).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y2, z2).setColor(red, green, blue, alpha); + buffer.addVertex(matrix, x2, y2, z1).setColor(red, green, blue, alpha); } } diff --git a/src/main/java/com/buuz135/functionalstorage/client/DrawerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/DrawerRenderer.java index 95b0bf2b..4bd91ea0 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/DrawerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/DrawerRenderer.java @@ -60,7 +60,7 @@ public static void renderUpgrades(PoseStack matrixStack, MultiBufferSource buffe } if (tile.isVoid()){ matrixStack.pushPose(); - matrixStack.mulPoseMatrix(createTransformMatrix( + matrixStack.mulPose(createTransformMatrix( new Vector3f(0.969f,0.031f,0.469f/16.0f), new Vector3f(0), scale)); Minecraft.getInstance().getItemRenderer().renderStatic(new ItemStack(FunctionalStorage.VOID_UPGRADE.get()), ItemDisplayContext.NONE, combinedLightIn, combinedOverlayIn, matrixStack, bufferIn, tile.getLevel(),0); matrixStack.popPose(); @@ -70,7 +70,7 @@ public static void renderUpgrades(PoseStack matrixStack, MultiBufferSource buffe public static void renderIndicator(PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn, float progress, ControllableDrawerTile.DrawerOptions options) { var indicatiorValue = options.getAdvancedValue(ConfigurationToolItem.ConfigurationAction.INDICATOR); if (indicatiorValue != 0) { - TextureAtlasSprite still = Minecraft.getInstance().getTextureAtlas(InventoryMenu.BLOCK_ATLAS).apply(new ResourceLocation(FunctionalStorage.MOD_ID, "block/indicator")); + TextureAtlasSprite still = Minecraft.getInstance().getTextureAtlas(InventoryMenu.BLOCK_ATLAS).apply(com.buuz135.functionalstorage.util.Utils.resourceLocation(FunctionalStorage.MOD_ID, "block/indicator")); VertexConsumer builder = bufferIn.getBuffer(RenderType.translucent()); Matrix4f posMat = matrixStack.last().pose(); float red = 1; @@ -91,22 +91,22 @@ public static void renderIndicator(PoseStack matrixStack, MultiBufferSource buff float v1 = still.getV(bz1); float v2 = still.getV(bz2); if (indicatiorValue != 3) { //HIDE IN MODE 3 NO BG - builder.vertex(posMat, x2, y1, z2).color(red, green, blue, alpha).uv(u2, v1).overlayCoords(combinedOverlayIn).uv2(combinedLightIn).normal(0f, 0f, 1f).endVertex(); - builder.vertex(posMat, x2, y2, z2).color(red, green, blue, alpha).uv(u2, v2).overlayCoords(combinedOverlayIn).uv2(combinedLightIn).normal(0f, 0f, 1f).endVertex(); - builder.vertex(posMat, x1, y2, z2).color(red, green, blue, alpha).uv(u1, v2).overlayCoords(combinedOverlayIn).uv2(combinedLightIn).normal(0f, 0f, 1f).endVertex(); - builder.vertex(posMat, x1, y1, z2).color(red, green, blue, alpha).uv(u1, v1).overlayCoords(combinedOverlayIn).uv2(combinedLightIn).normal(0f, 0f, 1f).endVertex(); + builder.addVertex(posMat, x2, y1, z2).setColor(red, green, blue, alpha).setUv(u2, v1).setOverlay(combinedOverlayIn).setNormal(0f, 0f, 1f); + builder.addVertex(posMat, x2, y2, z2).setColor(red, green, blue, alpha).setUv(u2, v2).setOverlay(combinedOverlayIn).setNormal(0f, 0f, 1f); + builder.addVertex(posMat, x1, y2, z2).setColor(red, green, blue, alpha).setUv(u1, v2).setOverlay(combinedOverlayIn).setNormal(0f, 0f, 1f); + builder.addVertex(posMat, x1, y1, z2).setColor(red, green, blue, alpha).setUv(u1, v1).setOverlay(combinedOverlayIn).setNormal(0f, 0f, 1f); } - u2 = still.getU((float) (bx2 * progress)); + u2 = still.getU((bx2 * progress)); x2 = x1 + 0.5f * progress; z2 = 0.0001f; v1 = still.getV(8); v2 = still.getV(10); if (indicatiorValue == 1 || progress >= 1) { - builder.vertex(posMat, x2, y1, z2).color(red, green, blue, alpha).uv(u2, v1).overlayCoords(combinedOverlayIn).uv2(combinedLightIn).normal(0f, 0f, 1f).endVertex(); - builder.vertex(posMat, x2, y2, z2).color(red, green, blue, alpha).uv(u2, v2).overlayCoords(combinedOverlayIn).uv2(combinedLightIn).normal(0f, 0f, 1f).endVertex(); - builder.vertex(posMat, x1, y2, z2).color(red, green, blue, alpha).uv(u1, v2).overlayCoords(combinedOverlayIn).uv2(combinedLightIn).normal(0f, 0f, 1f).endVertex(); - builder.vertex(posMat, x1, y1, z2).color(red, green, blue, alpha).uv(u1, v1).overlayCoords(combinedOverlayIn).uv2(combinedLightIn).normal(0f, 0f, 1f).endVertex(); + builder.addVertex(posMat, x2, y1, z2).setColor(red, green, blue, alpha).setUv(u2, v1).setOverlay(combinedOverlayIn).setNormal(0f, 0f, 1f); + builder.addVertex(posMat, x2, y2, z2).setColor(red, green, blue, alpha).setUv(u2, v2).setOverlay(combinedOverlayIn).setNormal(0f, 0f, 1f); + builder.addVertex(posMat, x1, y2, z2).setColor(red, green, blue, alpha).setUv(u1, v2).setOverlay(combinedOverlayIn).setNormal(0f, 0f, 1f); + builder.addVertex(posMat, x1, y1, z2).setColor(red, green, blue, alpha).setUv(u1, v1).setOverlay(combinedOverlayIn).setNormal(0f, 0f, 1f); } } } @@ -124,14 +124,14 @@ private void render2Slot(PoseStack matrixStack, MultiBufferSource bufferIn, int BigInventoryHandler inventoryHandler = (BigInventoryHandler) tile.getStorage(); if (!inventoryHandler.getStoredStacks().get(0).getStack().isEmpty()){ matrixStack.pushPose(); - matrixStack.mulPoseMatrix(createTransformMatrix(new Vector3f(0.5f, 0.27f, 0.0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); + matrixStack.mulPose(createTransformMatrix(new Vector3f(0.5f, 0.27f, 0.0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); ItemStack stack = inventoryHandler.getStoredStacks().get(0).getStack(); renderStack(matrixStack, bufferIn, combinedLightIn, combinedOverlayIn, stack, inventoryHandler.getStackInSlot(0).getCount(), inventoryHandler.getSlotLimit(0),0.02f, tile.getDrawerOptions(), tile.getLevel()); matrixStack.popPose(); } if (!inventoryHandler.getStoredStacks().get(1).getStack().isEmpty()){ matrixStack.pushPose(); - matrixStack.mulPoseMatrix(createTransformMatrix( + matrixStack.mulPose(createTransformMatrix( new Vector3f(0.5f, 0.77f, 0.0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); ItemStack stack = inventoryHandler.getStoredStacks().get(1).getStack(); renderStack(matrixStack, bufferIn, combinedLightIn, combinedOverlayIn, stack, inventoryHandler.getStackInSlot(1).getCount(), inventoryHandler.getSlotLimit(1),0.02f, tile.getDrawerOptions(), tile.getLevel()); @@ -142,7 +142,7 @@ private void render4Slot(PoseStack matrixStack, MultiBufferSource bufferIn, int BigInventoryHandler inventoryHandler = (BigInventoryHandler) tile.getStorage(); if (!inventoryHandler.getStoredStacks().get(0).getStack().isEmpty()){ //BOTTOM RIGHT matrixStack.pushPose(); - matrixStack.mulPoseMatrix(createTransformMatrix( + matrixStack.mulPose(createTransformMatrix( new Vector3f(.75f, .27f, .0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); ItemStack stack = inventoryHandler.getStoredStacks().get(0).getStack(); renderStack(matrixStack, bufferIn, combinedLightIn, combinedOverlayIn, stack, inventoryHandler.getStackInSlot(0).getCount(), inventoryHandler.getSlotLimit(0),0.02f, tile.getDrawerOptions(), tile.getLevel()); @@ -150,7 +150,7 @@ private void render4Slot(PoseStack matrixStack, MultiBufferSource bufferIn, int } if (!inventoryHandler.getStoredStacks().get(1).getStack().isEmpty()){ //BOTTOM LEFT matrixStack.pushPose(); - matrixStack.mulPoseMatrix(createTransformMatrix( + matrixStack.mulPose(createTransformMatrix( new Vector3f(.25f, .27f, .0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); ItemStack stack = inventoryHandler.getStoredStacks().get(1).getStack(); renderStack(matrixStack, bufferIn, combinedLightIn, combinedOverlayIn, stack, inventoryHandler.getStackInSlot(1).getCount(), inventoryHandler.getSlotLimit(1),0.02f, tile.getDrawerOptions(), tile.getLevel()); @@ -158,7 +158,7 @@ private void render4Slot(PoseStack matrixStack, MultiBufferSource bufferIn, int } if (!inventoryHandler.getStoredStacks().get(2).getStack().isEmpty()){ //TOP RIGHT matrixStack.pushPose(); - matrixStack.mulPoseMatrix(createTransformMatrix( + matrixStack.mulPose(createTransformMatrix( new Vector3f(.75f, .77f, .0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); ItemStack stack = inventoryHandler.getStoredStacks().get(2).getStack(); renderStack(matrixStack, bufferIn, combinedLightIn, combinedOverlayIn, stack, inventoryHandler.getStackInSlot(2).getCount(), inventoryHandler.getSlotLimit(2),0.02f, tile.getDrawerOptions(), tile.getLevel()); @@ -166,7 +166,7 @@ private void render4Slot(PoseStack matrixStack, MultiBufferSource bufferIn, int } if (!inventoryHandler.getStoredStacks().get(3).getStack().isEmpty()){ //TOP LEFT matrixStack.pushPose(); - matrixStack.mulPoseMatrix(createTransformMatrix( + matrixStack.mulPose(createTransformMatrix( new Vector3f(.25f, .77f, .0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); ItemStack stack = inventoryHandler.getStoredStacks().get(3).getStack(); renderStack(matrixStack, bufferIn, combinedLightIn, combinedOverlayIn, stack, inventoryHandler.getStackInSlot(3).getCount(), inventoryHandler.getSlotLimit(3),0.02f, tile.getDrawerOptions(), tile.getLevel()); @@ -181,11 +181,11 @@ public static void renderStack(PoseStack matrixStack, MultiBufferSource bufferIn BakedModel model = Minecraft.getInstance().getItemRenderer().getModel(stack, Minecraft.getInstance().level, null, 0); if (model.isGui3d()){ float thickness = (float)FunctionalStorageClientConfig.DRAWER_RENDER_THICKNESS; - // Avoid scaling normal matrix by using mulPoseMatrix() instead of scale() - matrixStack.mulPoseMatrix(createTransformMatrix( + // Avoid scaling normal matrix by using mulPose() instead of scale() + matrixStack.mulPose(createTransformMatrix( new Vector3f(0), new Vector3f(0), new Vector3f(.75f, .75f, thickness))); } else { - matrixStack.mulPoseMatrix(createTransformMatrix( + matrixStack.mulPose(createTransformMatrix( new Vector3f(0), new Vector3f(0), .4f)); } @@ -195,13 +195,13 @@ public static void renderStack(PoseStack matrixStack, MultiBufferSource bufferIn Minecraft.getInstance().getItemRenderer().renderStatic(stack, ItemDisplayContext.FIXED, combinedLightIn, combinedOverlayIn, matrixStack, bufferIn, level,0); } - matrixStack.mulPoseMatrix(createTransformMatrix( + matrixStack.mulPose(createTransformMatrix( new Vector3f(0), new Vector3f(0, 180, 0), 1)); if (!model.isGui3d()){ - matrixStack.mulPoseMatrix(createTransformMatrix( + matrixStack.mulPose(createTransformMatrix( new Vector3f(0), new Vector3f(0), new Vector3f(0.5f / 0.4f, 0.5f / 0.4f, 1))); } else { - matrixStack.mulPoseMatrix(createTransformMatrix( + matrixStack.mulPose(createTransformMatrix( new Vector3f(0), new Vector3f(0), .665f)); } diff --git a/src/main/java/com/buuz135/functionalstorage/client/FluidDrawerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/FluidDrawerRenderer.java index 3b722a7d..1d8ab505 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/FluidDrawerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/FluidDrawerRenderer.java @@ -64,10 +64,10 @@ public static void renderFluidStack(PoseStack matrixStack, MultiBufferSource buf float u2 = still.getU(bx2); float v1 = still.getV(bz1); float v2 = still.getV(bz2); - builder.vertex(posMat, x1, y2, z2).color(red, green, blue, alpha).uv(u1, v2).overlayCoords(combinedOverlay).uv2(combinedLight).normal(0f, 1f, 0f).endVertex(); - builder.vertex(posMat, x2, y2, z2).color(red, green, blue, alpha).uv(u2, v2).overlayCoords(combinedOverlay).uv2(combinedLight).normal(0f, 1f, 0f).endVertex(); - builder.vertex(posMat, x2, y2, z1).color(red, green, blue, alpha).uv(u2, v1).overlayCoords(combinedOverlay).uv2(combinedLight).normal(0f, 1f, 0f).endVertex(); - builder.vertex(posMat, x1, y2, z1).color(red, green, blue, alpha).uv(u1, v1).overlayCoords(combinedOverlay).uv2(combinedLight).normal(0f, 1f, 0f).endVertex(); + builder.addVertex(posMat, x1, y2, z2).setColor(red, green, blue, alpha).setUv(u1, v2).setOverlay(combinedOverlay).setNormal(0f, 1f, 0f); + builder.addVertex(posMat, x2, y2, z2).setColor(red, green, blue, alpha).setUv(u2, v2).setOverlay(combinedOverlay).setNormal(0f, 1f, 0f); + builder.addVertex(posMat, x2, y2, z1).setColor(red, green, blue, alpha).setUv(u2, v1).setOverlay(combinedOverlay).setNormal(0f, 1f, 0f); + builder.addVertex(posMat, x1, y2, z1).setColor(red, green, blue, alpha).setUv(u1, v1).setOverlay(combinedOverlay).setNormal(0f, 1f, 0f); } //FRONT if (true) { @@ -75,10 +75,10 @@ public static void renderFluidStack(PoseStack matrixStack, MultiBufferSource buf float u2 = still.getU(bx2); float v1 = still.getV(by1); float v2 = still.getV(by2); - builder.vertex(posMat, x2, y1, z2).color(red, green, blue, alpha).uv(u2, v1).overlayCoords(combinedOverlay).uv2(combinedLight).normal(0f, 0f, 1f).endVertex(); - builder.vertex(posMat, x2, y2, z2).color(red, green, blue, alpha).uv(u2, v2).overlayCoords(combinedOverlay).uv2(combinedLight).normal(0f, 0f, 1f).endVertex(); - builder.vertex(posMat, x1, y2, z2).color(red, green, blue, alpha).uv(u1, v2).overlayCoords(combinedOverlay).uv2(combinedLight).normal(0f, 0f, 1f).endVertex(); - builder.vertex(posMat, x1, y1, z2).color(red, green, blue, alpha).uv(u1, v1).overlayCoords(combinedOverlay).uv2(combinedLight).normal(0f, 0f, 1f).endVertex(); + builder.addVertex(posMat, x2, y1, z2).setColor(red, green, blue, alpha).setUv(u2, v1).setOverlay(combinedOverlay).setNormal(0f, 0f, 1f); + builder.addVertex(posMat, x2, y2, z2).setColor(red, green, blue, alpha).setUv(u2, v2).setOverlay(combinedOverlay).setNormal(0f, 0f, 1f); + builder.addVertex(posMat, x1, y2, z2).setColor(red, green, blue, alpha).setUv(u1, v2).setOverlay(combinedOverlay).setNormal(0f, 0f, 1f); + builder.addVertex(posMat, x1, y1, z2).setColor(red, green, blue, alpha).setUv(u1, v1).setOverlay(combinedOverlay).setNormal(0f, 0f, 1f); } matrixStack.popPose(); diff --git a/src/main/java/com/buuz135/functionalstorage/client/FramedColors.java b/src/main/java/com/buuz135/functionalstorage/client/FramedColors.java index 1549e5b6..16aacd67 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/FramedColors.java +++ b/src/main/java/com/buuz135/functionalstorage/client/FramedColors.java @@ -1,10 +1,8 @@ package com.buuz135.functionalstorage.client; import com.buuz135.functionalstorage.FunctionalStorage; -import com.buuz135.functionalstorage.block.CompactingFramedDrawerBlock; import com.buuz135.functionalstorage.block.FramedBlock; import com.buuz135.functionalstorage.block.FramedDrawerBlock; -import com.buuz135.functionalstorage.block.FramedDrawerControllerBlock; import com.buuz135.functionalstorage.block.tile.FramedTile; import com.buuz135.functionalstorage.client.model.FramedDrawerModelData; import net.minecraft.client.Minecraft; @@ -19,13 +17,13 @@ import net.minecraft.world.level.block.state.BlockState; import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.SubscribeEvent; -import net.neoforged.fml.common.Mod; +import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.neoforge.client.event.RegisterColorHandlersEvent; import org.jetbrains.annotations.Nullable; import java.util.Map; -@Mod.EventBusSubscriber(modid = FunctionalStorage.MOD_ID, value = Dist.CLIENT, bus = Mod.EventBusSubscriber.Bus.MOD) +@EventBusSubscriber(modid = FunctionalStorage.MOD_ID, value = Dist.CLIENT, bus = EventBusSubscriber.Bus.MOD) public class FramedColors implements BlockColor, ItemColor { @Override diff --git a/src/main/java/com/buuz135/functionalstorage/client/SimpleCompactingDrawerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/SimpleCompactingDrawerRenderer.java index 6ad28ba3..75fb3a0a 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/SimpleCompactingDrawerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/SimpleCompactingDrawerRenderer.java @@ -19,7 +19,7 @@ public void renderItems(SimpleCompactingDrawerTile tile, float partialTicks, Pos ItemStack stack = tile.getHandler().getResultList().get(0).getResult(); if (!stack.isEmpty()) { matrixStack.pushPose(); - matrixStack.mulPoseMatrix(createTransformMatrix( + matrixStack.mulPose(createTransformMatrix( new Vector3f(0.5f, 0.27f, 0.0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); DrawerRenderer.renderStack(matrixStack, bufferIn, combinedLightIn, combinedOverlayIn, stack, tile.getHandler().getStackInSlot(0).getCount(),tile.getHandler().getSlotLimit(0), 0.02f, tile.getDrawerOptions(), tile.getLevel()); matrixStack.popPose(); @@ -27,7 +27,7 @@ public void renderItems(SimpleCompactingDrawerTile tile, float partialTicks, Pos stack = tile.getHandler().getResultList().get(1).getResult(); if (!stack.isEmpty()) { matrixStack.pushPose(); - matrixStack.mulPoseMatrix(createTransformMatrix( + matrixStack.mulPose(createTransformMatrix( new Vector3f(0.5f, 0.77f, 0.0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); DrawerRenderer.renderStack(matrixStack, bufferIn, combinedLightIn, combinedOverlayIn, stack, tile.getHandler().getStackInSlot(1).getCount(), tile.getHandler().getSlotLimit(1),0.02f, tile.getDrawerOptions(), tile.getLevel()); matrixStack.popPose(); diff --git a/src/main/java/com/buuz135/functionalstorage/client/gui/FluidDrawerInfoGuiAddon.java b/src/main/java/com/buuz135/functionalstorage/client/gui/FluidDrawerInfoGuiAddon.java index fe57d1b4..0fe88728 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/gui/FluidDrawerInfoGuiAddon.java +++ b/src/main/java/com/buuz135/functionalstorage/client/gui/FluidDrawerInfoGuiAddon.java @@ -133,7 +133,7 @@ public void drawForegroundLayer(GuiGraphics guiGraphics, Screen screen, IAssetPr if (over.isEmpty()) { componentList.add(Component.translatable("gui.functionalstorage.fluid").withStyle(ChatFormatting.GOLD).append(Component.literal("Empty").withStyle(ChatFormatting.WHITE))); } else { - componentList.add(Component.translatable("gui.functionalstorage.fluid").withStyle(ChatFormatting.GOLD).append(over.getDisplayName().copy().withStyle(ChatFormatting.WHITE))); + componentList.add(Component.translatable("gui.functionalstorage.fluid").withStyle(ChatFormatting.GOLD).append(over.getHoverName().copy().withStyle(ChatFormatting.WHITE))); var amount = NumberUtils.getFormatedFluidBigNumber(over.getAmount()) + "/" + NumberUtils.getFormatedFluidBigNumber(slotMaxAmount.apply(i)); componentList.add(Component.translatable("gui.functionalstorage.amount").withStyle(ChatFormatting.GOLD).append(Component.literal(amount).withStyle(ChatFormatting.WHITE))); } diff --git a/src/main/java/com/buuz135/functionalstorage/client/loader/FramedModel.java b/src/main/java/com/buuz135/functionalstorage/client/loader/FramedModel.java index 14da172f..382e557e 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/loader/FramedModel.java +++ b/src/main/java/com/buuz135/functionalstorage/client/loader/FramedModel.java @@ -81,10 +81,7 @@ public void resolveParents(Function modelGetter, } @Override - public BakedModel bake(IGeometryBakingContext context, ModelBaker bakery, Function spriteGetter, ModelState modelState, ItemOverrides overrides, ResourceLocation modelLocation) { - if (logWarning) - LOGGER.warn("Model \"" + modelLocation + "\" is using the deprecated \"parts\" field in its composite model instead of \"children\". This field will be removed in 1.20."); - + public BakedModel bake(IGeometryBakingContext context, ModelBaker baker, Function spriteGetter, ModelState modelState, ItemOverrides overrides) { Material particleLocation = context.getMaterial("particle"); TextureAtlasSprite particle = spriteGetter.apply(particleLocation); @@ -98,7 +95,7 @@ public BakedModel bake(IGeometryBakingContext context, ModelBaker bakery, Functi if (!context.isComponentVisible(name, true)) continue; var model = entry.getValue(); - bakedPartsBuilder.put(name, model.bake(bakery, model, spriteGetter, modelState, modelLocation, true)); + bakedPartsBuilder.put(name, model.bake(baker, model, spriteGetter, modelState, true)); } var bakedParts = bakedPartsBuilder.build(); diff --git a/src/main/java/com/buuz135/functionalstorage/client/model/FramedDrawerModelData.java b/src/main/java/com/buuz135/functionalstorage/client/model/FramedDrawerModelData.java index ac65e7bb..3e387473 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/model/FramedDrawerModelData.java +++ b/src/main/java/com/buuz135/functionalstorage/client/model/FramedDrawerModelData.java @@ -50,17 +50,17 @@ public Map getDesign() { } @Override - public CompoundTag serializeNBT() { + public CompoundTag serializeNBT(net.minecraft.core.HolderLookup.Provider provider) { CompoundTag compoundTag = new CompoundTag(); design.forEach((s, item) -> compoundTag.putString(s, BuiltInRegistries.ITEM.getKey(item).toString())); return compoundTag; } @Override - public void deserializeNBT(CompoundTag nbt) { + public void deserializeNBT(net.minecraft.core.HolderLookup.Provider provider, CompoundTag nbt) { design = new HashMap<>(); for (String allKey : nbt.getAllKeys()) { - design.put(allKey, BuiltInRegistries.ITEM.get(new ResourceLocation(nbt.getString(allKey)))); + design.put(allKey, BuiltInRegistries.ITEM.get(com.buuz135.functionalstorage.util.Utils.resourceLocation(nbt.getString(allKey)))); } this.generateCode(); } diff --git a/src/main/java/com/buuz135/functionalstorage/compat/jade/DrawerComponentProvider.java b/src/main/java/com/buuz135/functionalstorage/compat/jade/DrawerComponentProvider.java index f188a4ef..2e4701db 100644 --- a/src/main/java/com/buuz135/functionalstorage/compat/jade/DrawerComponentProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/compat/jade/DrawerComponentProvider.java @@ -40,14 +40,14 @@ public enum DrawerComponentProvider implements IBlockComponentProvider { INSTANCE; - public static final ResourceLocation ITEM_STORAGE = new ResourceLocation("minecraft:item_storage"); + public static final ResourceLocation ITEM_STORAGE = com.buuz135.functionalstorage.util.Utils.resourceLocation("minecraft:item_storage"); - public static final ResourceLocation ID = new ResourceLocation(FunctionalStorage.MOD_ID, "drawer"); + public static final ResourceLocation ID = com.buuz135.functionalstorage.util.Utils.resourceLocation(FunctionalStorage.MOD_ID, "drawer"); @Override public void appendTooltip(ITooltip iTooltip, BlockAccessor blockAccessor, IPluginConfig iPluginConfig) { iTooltip.remove(ITEM_STORAGE); - iTooltip.remove(new ResourceLocation("minecraft:fluid_storage")); + iTooltip.remove(com.buuz135.functionalstorage.util.Utils.resourceLocation("minecraft:fluid_storage")); var helper = IElementHelper.get(); if (blockAccessor.getBlockEntity() instanceof ControllableDrawerTile controllable) { @@ -109,9 +109,9 @@ public void appendTooltip(ITooltip iTooltip, BlockAccessor blockAccessor, IPlugi var contentsBox = helper.tooltip(); iTooltip.add(helper.text(Component.translatable("drawer.block.contents"))); for (var stack : stacks) { - var view = new FluidView(helper.fluid(JadeFluidObject.of(stack.getFirst().getRawFluid()))); + var view = new FluidView(helper.fluid(JadeFluidObject.of(stack.getFirst().getFluid()))); ProgressStyle progressStyle = helper.progressStyle().overlay(view.overlay); - contentsBox.add(helper.progress((float) stack.getFirst().getAmount() / stack.getSecond(), Component.empty().append(stack.getFirst().getDisplayName()).append(Component.literal(" x ").append(NumberUtils.getFormatedFluidBigNumber(stack.getFirst().getAmount()) + " / " + NumberUtils.getFormatedFluidBigNumber(stack.getSecond()))), progressStyle, BoxStyle.getNestedBox(), true)); + contentsBox.add(helper.progress((float) stack.getFirst().getAmount() / stack.getSecond(), Component.empty().append(stack.getFirst().getHoverName()).append(Component.literal(" x ").append(NumberUtils.getFormatedFluidBigNumber(stack.getFirst().getAmount()) + " / " + NumberUtils.getFormatedFluidBigNumber(stack.getSecond()))), progressStyle, BoxStyle.getNestedBox(), true)); } iTooltip.add(helper.box(contentsBox, BoxStyle.getNestedBox())); } diff --git a/src/main/java/com/buuz135/functionalstorage/compat/jei/CompactingRecipeCategory.java b/src/main/java/com/buuz135/functionalstorage/compat/jei/CompactingRecipeCategory.java index 97065d30..2ce331c1 100644 --- a/src/main/java/com/buuz135/functionalstorage/compat/jei/CompactingRecipeCategory.java +++ b/src/main/java/com/buuz135/functionalstorage/compat/jei/CompactingRecipeCategory.java @@ -53,7 +53,7 @@ public void setRecipe(IRecipeLayoutBuilder builder, CustomCompactingRecipe recip @Override public void draw(CustomCompactingRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics guiGraphics, double mouseX, double mouseY) { - //new ResourceLocation(FunctionalStorage.MOD_ID, "textures/block/compacting_drawer_front.png") - guiGraphics.blit(new ResourceLocation(FunctionalStorage.MOD_ID, "textures/block/compacting_drawer_front.png"), 0,0, 64,64, 64, 64, 64,64); + //com.buuz135.functionalstorage.util.Utils.resourceLocation(FunctionalStorage.MOD_ID, "textures/block/compacting_drawer_front.png") + guiGraphics.blit(com.buuz135.functionalstorage.util.Utils.resourceLocation(FunctionalStorage.MOD_ID, "textures/block/compacting_drawer_front.png"), 0,0, 64,64, 64, 64, 64,64); } } diff --git a/src/main/java/com/buuz135/functionalstorage/compat/jei/JEIPlugin.java b/src/main/java/com/buuz135/functionalstorage/compat/jei/JEIPlugin.java index 05ee6e76..f71a20cc 100644 --- a/src/main/java/com/buuz135/functionalstorage/compat/jei/JEIPlugin.java +++ b/src/main/java/com/buuz135/functionalstorage/compat/jei/JEIPlugin.java @@ -16,7 +16,7 @@ @JeiPlugin public class JEIPlugin implements IModPlugin { - public static ResourceLocation PLUGIN_ID = new ResourceLocation(FunctionalStorage.MOD_ID, "main"); + public static ResourceLocation PLUGIN_ID = com.buuz135.functionalstorage.util.Utils.resourceLocation(FunctionalStorage.MOD_ID, "main"); private CompactingRecipeCategory compactingRecipeCategory; diff --git a/src/main/java/com/buuz135/functionalstorage/compat/top/CustomElementItemStack.java b/src/main/java/com/buuz135/functionalstorage/compat/top/CustomElementItemStack.java index 45731d43..dbd09e33 100644 --- a/src/main/java/com/buuz135/functionalstorage/compat/top/CustomElementItemStack.java +++ b/src/main/java/com/buuz135/functionalstorage/compat/top/CustomElementItemStack.java @@ -12,12 +12,13 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.renderer.entity.ItemRenderer; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; public class CustomElementItemStack implements IElement { - public static ResourceLocation RL = new ResourceLocation(FunctionalStorage.MOD_ID, "drawer_element"); + public static ResourceLocation RL = com.buuz135.functionalstorage.util.Utils.resourceLocation(FunctionalStorage.MOD_ID, "drawer_element"); private final ItemStack itemStack; private final IItemStyle style; @@ -36,7 +37,7 @@ public CustomElementItemStack(ItemStack itemStack, String display, IItemStyle st this.displayName = true; } - public CustomElementItemStack(FriendlyByteBuf buf) { + public CustomElementItemStack(RegistryFriendlyByteBuf buf) { if (buf.readBoolean()) { this.itemStack = NetworkTools.readItemStack(buf); } else { @@ -75,7 +76,7 @@ public int getHeight() { } @Override - public void toBytes(FriendlyByteBuf buf) { + public void toBytes(RegistryFriendlyByteBuf buf) { if (!this.itemStack.isEmpty()) { buf.writeBoolean(true); NetworkTools.writeItemStack(buf, this.itemStack); diff --git a/src/main/java/com/buuz135/functionalstorage/compat/top/FunctionalDrawerProvider.java b/src/main/java/com/buuz135/functionalstorage/compat/top/FunctionalDrawerProvider.java index 1e3fe24f..83b1255e 100644 --- a/src/main/java/com/buuz135/functionalstorage/compat/top/FunctionalDrawerProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/compat/top/FunctionalDrawerProvider.java @@ -15,6 +15,7 @@ import mcjty.theoneprobe.apiimpl.elements.ElementVertical; import mcjty.theoneprobe.apiimpl.styles.ProgressStyle; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Player; @@ -34,7 +35,7 @@ public class FunctionalDrawerProvider implements IProbeInfoProvider { iTheOneProbe.registerProvider(new FunctionalDrawerProvider()); iTheOneProbe.registerElementFactory(new IElementFactory() { @Override - public IElement createElement(FriendlyByteBuf friendlyByteBuf) { + public IElement createElement(RegistryFriendlyByteBuf friendlyByteBuf) { return new CustomElementItemStack(friendlyByteBuf); } @@ -48,7 +49,7 @@ public ResourceLocation getId() { @Override public ResourceLocation getID() { - return new ResourceLocation(FunctionalStorage.MOD_ID, "drawer"); + return com.buuz135.functionalstorage.util.Utils.resourceLocation(FunctionalStorage.MOD_ID, "drawer"); } @Override diff --git a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageBlockstateProvider.java b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageBlockstateProvider.java index 71810df7..75e1e814 100644 --- a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageBlockstateProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageBlockstateProvider.java @@ -18,26 +18,24 @@ import net.neoforged.neoforge.client.model.generators.ModelFile; import net.neoforged.neoforge.client.model.generators.VariantBlockStateBuilder; import net.neoforged.neoforge.common.data.ExistingFileHelper; -import net.neoforged.neoforge.common.util.NonNullLazy; +import net.neoforged.neoforge.common.util.Lazy; import java.util.List; public class FunctionalStorageBlockstateProvider extends BlockStateProvider { - private ExistingFileHelper helper; - private final NonNullLazy> blocks; + private final Lazy> blocks; - public FunctionalStorageBlockstateProvider(DataGenerator gen, ExistingFileHelper exFileHelper, NonNullLazy> blocks) { + public FunctionalStorageBlockstateProvider(DataGenerator gen, ExistingFileHelper exFileHelper, Lazy> blocks) { super(gen.getPackOutput(), FunctionalStorage.MOD_ID, exFileHelper); - this.helper = exFileHelper; this.blocks = blocks; } public static ResourceLocation getModel(Block block) { - return new ResourceLocation(BuiltInRegistries.BLOCK.getKey(block).getNamespace(), "block/" + BuiltInRegistries.BLOCK.getKey(block).getPath()); + return com.buuz135.functionalstorage.util.Utils.resourceLocation(BuiltInRegistries.BLOCK.getKey(block).getNamespace(), "block/" + BuiltInRegistries.BLOCK.getKey(block).getPath()); } public static ResourceLocation getModelLocked(Block block) { - return new ResourceLocation(BuiltInRegistries.BLOCK.getKey(block).getNamespace(), "block/" + BuiltInRegistries.BLOCK.getKey(block).getPath() + "_locked"); + return com.buuz135.functionalstorage.util.Utils.resourceLocation(BuiltInRegistries.BLOCK.getKey(block).getNamespace(), "block/" + BuiltInRegistries.BLOCK.getKey(block).getPath() + "_locked"); } @Override diff --git a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageRecipesProvider.java b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageRecipesProvider.java index 86d079f0..3a93f5c0 100644 --- a/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageRecipesProvider.java +++ b/src/main/java/com/buuz135/functionalstorage/data/FunctionalStorageRecipesProvider.java @@ -5,22 +5,23 @@ import com.buuz135.functionalstorage.util.StorageTags; import com.hrznstudio.titanium.block.BasicBlock; import com.hrznstudio.titanium.recipe.generator.TitaniumShapedRecipeBuilder; +import net.minecraft.core.HolderLookup; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.data.DataGenerator; import net.minecraft.data.recipes.RecipeCategory; import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.data.recipes.RecipeProvider; import net.minecraft.data.recipes.SmithingTransformRecipeBuilder; -import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.ItemTags; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.block.Block; import net.neoforged.neoforge.common.Tags; -import net.neoforged.neoforge.common.util.NonNullLazy; +import net.neoforged.neoforge.common.util.Lazy; import java.util.List; +import java.util.concurrent.CompletableFuture; import static com.buuz135.functionalstorage.FunctionalStorage.ARMORY_CABINET; import static com.buuz135.functionalstorage.FunctionalStorage.COLLECTOR_UPGRADE; @@ -35,10 +36,10 @@ public class FunctionalStorageRecipesProvider extends RecipeProvider { - private final NonNullLazy> blocksToProcess; + private final Lazy> blocksToProcess; - public FunctionalStorageRecipesProvider(DataGenerator generator, NonNullLazy> blocksToProcess) { - super(generator.getPackOutput()); + public FunctionalStorageRecipesProvider(DataGenerator generator, Lazy> blocksToProcess, CompletableFuture prov) { + super(generator.getPackOutput(), prov); this.blocksToProcess = blocksToProcess; } @@ -52,7 +53,7 @@ protected void buildRecipes(RecipeOutput output) { .save(output); TitaniumShapedRecipeBuilder.shapedRecipe(VOID_UPGRADE.get()) .pattern("III").pattern("IDI").pattern("III") - .define('I', Tags.Items.OBSIDIAN) + .define('I', Tags.Items.OBSIDIANS) .define('D', StorageTags.DRAWER) .save(output); TitaniumShapedRecipeBuilder.shapedRecipe(CONFIGURATION_TOOL.get()) @@ -102,28 +103,28 @@ protected void buildRecipes(RecipeOutput output) { .save(output, BuiltInRegistries.ITEM.getKey(STORAGE_UPGRADES.get(StorageUpgradeItem.StorageTier.NETHERITE).get())); TitaniumShapedRecipeBuilder.shapedRecipe(ARMORY_CABINET.getBlock()) .pattern("ICI").pattern("CDC").pattern("IBI") - .define('I', Tags.Items.STONE) + .define('I', Tags.Items.STONES) .define('B', Tags.Items.INGOTS_NETHERITE) .define('C', StorageTags.DRAWER) .define('D', Items.COMPARATOR) .save(output); TitaniumShapedRecipeBuilder.shapedRecipe(PULLING_UPGRADE.get()) .pattern("ICI").pattern("IDI").pattern("IBI") - .define('I', Tags.Items.STONE) + .define('I', Tags.Items.STONES) .define('B', Tags.Items.DUSTS_REDSTONE) .define('C', Items.HOPPER) .define('D', StorageTags.DRAWER) .save(output); TitaniumShapedRecipeBuilder.shapedRecipe(PUSHING_UPGRADE.get()) .pattern("IBI").pattern("IDI").pattern("IRI") - .define('I', Tags.Items.STONE) + .define('I', Tags.Items.STONES) .define('B', Tags.Items.DUSTS_REDSTONE) .define('R', Items.HOPPER) .define('D', StorageTags.DRAWER) .save(output); TitaniumShapedRecipeBuilder.shapedRecipe(COLLECTOR_UPGRADE.get()) .pattern("IBI").pattern("RDR").pattern("IBI") - .define('I', Tags.Items.STONE) + .define('I', Tags.Items.STONES) .define('B', Items.HOPPER) .define('R', Tags.Items.DUSTS_REDSTONE) .define('D', StorageTags.DRAWER) @@ -135,11 +136,11 @@ protected void buildRecipes(RecipeOutput output) { .define('L', StorageTags.DRAWER) .save(output); - new CustomCompactingRecipe(new ItemStack(Items.GLOWSTONE_DUST, 4), new ItemStack(Items.GLOWSTONE)).save(output, new ResourceLocation("functionalstorage/compacting/glowstone")); - new CustomCompactingRecipe(new ItemStack(Items.MELON_SLICE, 9), new ItemStack(Items.MELON)).save(output, new ResourceLocation("functionalstorage/compacting/melon")); - new CustomCompactingRecipe(new ItemStack(Items.QUARTZ, 4), new ItemStack(Items.QUARTZ_BLOCK)).save(output, new ResourceLocation("functionalstorage/compacting/quartz")); - new CustomCompactingRecipe(new ItemStack(Items.ICE, 9), new ItemStack(Items.PACKED_ICE)).save(output, new ResourceLocation("functionalstorage/compacting/ice")); - new CustomCompactingRecipe(new ItemStack(Items.PACKED_ICE, 9), new ItemStack(Items.BLUE_ICE)).save(output, new ResourceLocation("functionalstorage/compacting/packed_ice")); - new CustomCompactingRecipe(new ItemStack(Items.AMETHYST_SHARD, 4), new ItemStack(Items.AMETHYST_BLOCK)).save(output, new ResourceLocation("functionalstorage/compacting/amethyst")); + new CustomCompactingRecipe(new ItemStack(Items.GLOWSTONE_DUST, 4), new ItemStack(Items.GLOWSTONE)).save(output, com.buuz135.functionalstorage.util.Utils.resourceLocation("functionalstorage/compacting/glowstone")); + new CustomCompactingRecipe(new ItemStack(Items.MELON_SLICE, 9), new ItemStack(Items.MELON)).save(output, com.buuz135.functionalstorage.util.Utils.resourceLocation("functionalstorage/compacting/melon")); + new CustomCompactingRecipe(new ItemStack(Items.QUARTZ, 4), new ItemStack(Items.QUARTZ_BLOCK)).save(output, com.buuz135.functionalstorage.util.Utils.resourceLocation("functionalstorage/compacting/quartz")); + new CustomCompactingRecipe(new ItemStack(Items.ICE, 9), new ItemStack(Items.PACKED_ICE)).save(output, com.buuz135.functionalstorage.util.Utils.resourceLocation("functionalstorage/compacting/ice")); + new CustomCompactingRecipe(new ItemStack(Items.PACKED_ICE, 9), new ItemStack(Items.BLUE_ICE)).save(output, com.buuz135.functionalstorage.util.Utils.resourceLocation("functionalstorage/compacting/packed_ice")); + new CustomCompactingRecipe(new ItemStack(Items.AMETHYST_SHARD, 4), new ItemStack(Items.AMETHYST_BLOCK)).save(output, com.buuz135.functionalstorage.util.Utils.resourceLocation("functionalstorage/compacting/amethyst")); } } diff --git a/src/main/java/com/buuz135/functionalstorage/fluid/BigFluidHandler.java b/src/main/java/com/buuz135/functionalstorage/fluid/BigFluidHandler.java index a9c9cd87..4bd3a505 100644 --- a/src/main/java/com/buuz135/functionalstorage/fluid/BigFluidHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/fluid/BigFluidHandler.java @@ -1,6 +1,9 @@ package com.buuz135.functionalstorage.fluid; +import com.buuz135.functionalstorage.util.Utils; import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.NbtOps; +import net.minecraft.resources.RegistryOps; import net.neoforged.neoforge.common.util.INBTSerializable; import net.neoforged.neoforge.fluids.FluidStack; import net.neoforged.neoforge.fluids.capability.IFluidHandler; @@ -24,7 +27,7 @@ public BigFluidHandler(int size, int capacity) { int finalI = i; this.tanks[i] = new CustomFluidTank(capacity, fluidStack -> { if (isDrawerLocked()) { - return fluidStack.isFluidEqual(this.filterStack[finalI]); + return FluidStack.isSameFluidSameComponents(fluidStack, this.filterStack[finalI]); } return true; }); @@ -79,7 +82,7 @@ public int fill(FluidStack resource, FluidAction action) { @Override public FluidStack drain(FluidStack resource, FluidAction action) { for (CustomFluidTank tank : tanks) { - if (!tank.getFluid().isEmpty() && tank.getFluid().isFluidEqual(resource) && !tank.drain(resource, FluidAction.SIMULATE).isEmpty()) { + if (!tank.getFluid().isEmpty() && FluidStack.isSameFluidSameComponents(tank.getFluid(), resource) && !tank.drain(resource, FluidAction.SIMULATE).isEmpty()) { FluidStack ret = tank.drain(resource, action); if (action == FluidAction.EXECUTE) onChange(); return ret; @@ -117,23 +120,23 @@ public void setCapacity(int capacity) { } @Override - public CompoundTag serializeNBT() { + public CompoundTag serializeNBT(net.minecraft.core.HolderLookup.Provider provider) { CompoundTag compoundTag = new CompoundTag(); for (int i = 0; i < this.tanks.length; i++) { - compoundTag.put(i + "", this.tanks[i].writeToNBT(new CompoundTag())); - compoundTag.put("Locked" + i, this.filterStack[i].writeToNBT(new CompoundTag())); + compoundTag.put(i + "", this.tanks[i].writeToNBT(provider, new CompoundTag())); + compoundTag.put("Locked" + i, FluidStack.CODEC.encodeStart(RegistryOps.create(NbtOps.INSTANCE, provider), this.filterStack[i]).getOrThrow()); } compoundTag.putInt("Capacity", this.capacity); return compoundTag; } @Override - public void deserializeNBT(CompoundTag nbt) { + public void deserializeNBT(net.minecraft.core.HolderLookup.Provider provider, CompoundTag nbt) { this.capacity = nbt.getInt("Capacity"); for (int i = 0; i < this.tanks.length; i++) { - this.tanks[i].readFromNBT(nbt.getCompound(i + "")); + this.tanks[i].readFromNBT(provider, nbt.getCompound(i + "")); this.tanks[i].setCapacity(this.capacity); - this.filterStack[i] = FluidStack.loadFluidStackFromNBT(nbt.getCompound("Locked" + i)); + this.filterStack[i] = Utils.deserializeFluid(provider, nbt.getCompound("Locked" + i)); } } @@ -171,7 +174,7 @@ public CustomFluidTank(int capacity, Predicate validator) { public int fill(FluidStack resource, FluidAction action) { int amount = super.fill(resource, action); if (isDrawerVoid() - && ((isDrawerLocked() && isFluidValid(resource)) || (!getFluid().isEmpty() && getFluid().isFluidEqual(resource)))) + && ((isDrawerLocked() && isFluidValid(resource)) || (!getFluid().isEmpty() && FluidStack.isSameFluidSameComponents(getFluid(), resource)))) return resource.getAmount(); return amount; } diff --git a/src/main/java/com/buuz135/functionalstorage/fluid/ControllerFluidHandler.java b/src/main/java/com/buuz135/functionalstorage/fluid/ControllerFluidHandler.java index 89f16d1f..6109ce11 100644 --- a/src/main/java/com/buuz135/functionalstorage/fluid/ControllerFluidHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/fluid/ControllerFluidHandler.java @@ -63,7 +63,7 @@ public boolean isFluidValid(int tank, @NotNull FluidStack stack) { @Override public int fill(FluidStack resource, FluidAction action) { for (HandlerTankSelector selector : this.selectors) { - if (!selector.getStackInSlot().isEmpty() && selector.getStackInSlot().isFluidEqual(resource)) { + if (!selector.getStackInSlot().isEmpty() && FluidStack.isSameFluidSameComponents(selector.getStackInSlot(), resource)) { return selector.fill(resource, action); } } @@ -78,7 +78,7 @@ public int fill(FluidStack resource, FluidAction action) { @Override public @NotNull FluidStack drain(FluidStack resource, FluidAction action) { for (HandlerTankSelector selector : this.selectors) { - if (!selector.getStackInSlot().isEmpty() && selector.getStackInSlot().isFluidEqual(resource)) { + if (!selector.getStackInSlot().isEmpty() && FluidStack.isSameFluidSameComponents(selector.getStackInSlot(), resource)) { return selector.drain(resource, action); } } diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/ArmoryCabinetInventoryHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/ArmoryCabinetInventoryHandler.java index cf54bd5b..c44c510a 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/ArmoryCabinetInventoryHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/ArmoryCabinetInventoryHandler.java @@ -1,10 +1,12 @@ package com.buuz135.functionalstorage.inventory; import com.buuz135.functionalstorage.block.config.FunctionalStorageConfig; +import net.minecraft.core.component.DataComponents; import net.minecraft.nbt.CompoundTag; -import net.minecraft.world.item.HorseArmorItem; +import net.minecraft.nbt.NbtOps; +import net.minecraft.resources.RegistryOps; +import net.minecraft.world.item.AnimalArmorItem; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.RecordItem; import net.neoforged.neoforge.capabilities.Capabilities; import net.neoforged.neoforge.common.util.INBTSerializable; import net.neoforged.neoforge.items.IItemHandler; @@ -78,16 +80,16 @@ private boolean isValid(int slot, @NotNull ItemStack stack) { private boolean isCertifiedStack(ItemStack stack){ if (stack.getCapability(Capabilities.ItemHandler.ITEM) != null) return false; if (stack.getMaxStackSize() > 1) return false; - return stack.hasTag() || stack.isDamageableItem() || stack.isEnchantable() || stack.getItem() instanceof RecordItem || stack.getItem() instanceof HorseArmorItem; + return stack.isDamageableItem() || stack.isEnchantable() || stack.has(DataComponents.JUKEBOX_PLAYABLE) || stack.getItem() instanceof AnimalArmorItem; } @Override - public CompoundTag serializeNBT() { + public CompoundTag serializeNBT(net.minecraft.core.HolderLookup.Provider provider) { CompoundTag compoundTag = new CompoundTag(); for (int i = 0; i < this.stackList.size(); i++) { ItemStack stack = this.stackList.get(i); if (!stack.isEmpty()){ - compoundTag.put(String.valueOf(i), stack.save(new CompoundTag())); + compoundTag.put(String.valueOf(i), stack.saveOptional(provider)); } } return compoundTag; @@ -102,12 +104,12 @@ private List create(){ } @Override - public void deserializeNBT(CompoundTag nbt) { + public void deserializeNBT(net.minecraft.core.HolderLookup.Provider provider, CompoundTag nbt) { this.stackList = create(); for (String allKey : nbt.getAllKeys()) { int pos = Integer.parseInt(allKey); if (pos < this.stackList.size()){ - this.stackList.set(pos, ItemStack.of(nbt.getCompound(allKey))); + this.stackList.set(pos, ItemStack.CODEC.decode(RegistryOps.create(NbtOps.INSTANCE, provider), nbt.getCompound(allKey)).getOrThrow().getFirst()); } } } diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/BigInventoryHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/BigInventoryHandler.java index bbfe0847..41dd47db 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/BigInventoryHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/BigInventoryHandler.java @@ -1,6 +1,7 @@ package com.buuz135.functionalstorage.inventory; import com.buuz135.functionalstorage.FunctionalStorage; +import com.buuz135.functionalstorage.util.Utils; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.ItemStack; import net.neoforged.neoforge.common.util.INBTSerializable; @@ -55,12 +56,12 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate int inserted = Math.min(getSlotLimit(slot) - bigStack.getAmount(), stack.getCount()); if (!simulate) { if (bigStack.getStack().isEmpty()) - bigStack.setStack(ItemHandlerHelper.copyStackWithSize(stack, stack.getMaxStackSize())); + bigStack.setStack(stack.copyWithCount(stack.getMaxStackSize())); bigStack.setAmount(Math.min(bigStack.getAmount() + inserted, getSlotLimit(slot))); onChange(); } if (inserted == stack.getCount() || isVoid()) return ItemStack.EMPTY; - return ItemHandlerHelper.copyStackWithSize(stack, stack.getCount() - inserted); + return stack.copyWithCount(stack.getCount() - inserted); } return stack; } @@ -87,7 +88,7 @@ public ItemStack extractItem(int slot, int amount, boolean simulate) { bigStack.setAmount(bigStack.getAmount() - amount); onChange(); } - return ItemHandlerHelper.copyStackWithSize(bigStack.getStack(), amount); + return bigStack.getStack().copyWithCount(amount); } } return ItemStack.EMPTY; @@ -116,25 +117,25 @@ private boolean isValid(int slot, @Nonnull ItemStack stack){ BigStack bigStack = this.storedStacks.get(slot); ItemStack fl = bigStack.getStack(); if (isLocked() && fl.isEmpty()) return false; - return fl.isEmpty() || (ItemStack.isSameItemSameTags(fl, stack)); + return fl.isEmpty() || (ItemStack.isSameItemSameComponents(fl, stack)); } return false; } private boolean isVoidValid(ItemStack stack){ for (BigStack storedStack : this.storedStacks) { - if (ItemStack.isSameItemSameTags(storedStack.getStack(), stack)) return true; + if (ItemStack.isSameItemSameComponents(storedStack.getStack(), stack)) return true; } return false; } @Override - public CompoundTag serializeNBT() { + public CompoundTag serializeNBT(net.minecraft.core.HolderLookup.Provider provider) { CompoundTag compoundTag = new CompoundTag(); CompoundTag items = new CompoundTag(); for (int i = 0; i < this.storedStacks.size(); i++) { CompoundTag bigStack = new CompoundTag(); - bigStack.put(STACK, this.storedStacks.get(i).getStack().save(new CompoundTag())); + bigStack.put(STACK, this.storedStacks.get(i).getStack().saveOptional(provider)); bigStack.putInt(AMOUNT, this.storedStacks.get(i).getAmount()); items.put(i + "", bigStack); } @@ -143,9 +144,9 @@ public CompoundTag serializeNBT() { } @Override - public void deserializeNBT(CompoundTag nbt) { + public void deserializeNBT(net.minecraft.core.HolderLookup.Provider provider, CompoundTag nbt) { for (String allKey : nbt.getCompound(BIG_ITEMS).getAllKeys()) { - this.storedStacks.get(Integer.parseInt(allKey)).setStack(ItemStack.of(nbt.getCompound(BIG_ITEMS).getCompound(allKey).getCompound(STACK))); + this.storedStacks.get(Integer.parseInt(allKey)).setStack(Utils.deserialize(provider, nbt.getCompound(BIG_ITEMS).getCompound(allKey).getCompound(STACK))); this.storedStacks.get(Integer.parseInt(allKey)).setAmount(nbt.getCompound(BIG_ITEMS).getCompound(allKey).getInt(AMOUNT)); } } diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/CompactingInventoryHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/CompactingInventoryHandler.java index 27dbe5f7..09cf5f1c 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/CompactingInventoryHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/CompactingInventoryHandler.java @@ -1,6 +1,7 @@ package com.buuz135.functionalstorage.inventory; import com.buuz135.functionalstorage.util.CompactingUtil; +import com.buuz135.functionalstorage.util.Utils; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.ItemStack; import net.neoforged.neoforge.common.util.INBTSerializable; @@ -12,10 +13,10 @@ public abstract class CompactingInventoryHandler implements IItemHandler, INBTSerializable, ILockable { - public static String PARENT = "Parent"; - public static String BIG_ITEMS = "BigItems"; - public static String STACK = "Stack"; - public static String AMOUNT = "Amount"; + public static final String PARENT = "Parent"; + public static final String BIG_ITEMS = "BigItems"; + public static final String STACK = "Stack"; + public static final String AMOUNT = "Amount"; public int totalAmount; @@ -67,7 +68,7 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate onChange(); } if (inserted == stack.getCount() * result.getNeeded() || isVoid()) return ItemStack.EMPTY; - return ItemHandlerHelper.copyStackWithSize(stack, stack.getCount() - inserted / result.getNeeded()); + return stack.copyWithCount(stack.getCount() - inserted / result.getNeeded()); } return stack; @@ -75,7 +76,7 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate private boolean isVoidValid(ItemStack stack) { for (CompactingUtil.Result result : this.resultList) { - if (ItemStack.isSameItemSameTags(result.getResult(), stack)) return true; + if (ItemStack.isSameItemSameComponents(result.getResult(), stack)) return true; } return false; } @@ -131,7 +132,7 @@ public ItemStack extractItem(int slot, int amount, boolean simulate) { this.amount -= stackAmount; onChange(); } - return ItemHandlerHelper.copyStackWithSize(bigStack.getResult(), amount); + return bigStack.getResult().copyWithCount(amount); } @@ -164,20 +165,20 @@ private boolean isValid(int slot, @Nonnull ItemStack stack){ if (slot < this.slots) { CompactingUtil.Result bigStack = this.resultList.get(slot); ItemStack fl = bigStack.getResult(); - return !fl.isEmpty() && ItemStack.isSameItemSameTags(fl, stack); + return !fl.isEmpty() && ItemStack.isSameItemSameComponents(fl, stack); } return false; } @Override - public CompoundTag serializeNBT() { + public CompoundTag serializeNBT(net.minecraft.core.HolderLookup.Provider provider) { CompoundTag compoundTag = new CompoundTag(); - compoundTag.put(PARENT, this.getParent().save(new CompoundTag())); + compoundTag.put(PARENT, this.getParent().saveOptional(provider)); compoundTag.putInt(AMOUNT, this.amount); CompoundTag items = new CompoundTag(); for (int i = 0; i < this.resultList.size(); i++) { CompoundTag bigStack = new CompoundTag(); - bigStack.put(STACK, this.resultList.get(i).getResult().save(new CompoundTag())); + bigStack.put(STACK, this.resultList.get(i).getResult().saveOptional(provider)); bigStack.putInt(AMOUNT, this.resultList.get(i).getNeeded()); items.put(i + "", bigStack); } @@ -186,11 +187,11 @@ public CompoundTag serializeNBT() { } @Override - public void deserializeNBT(CompoundTag nbt) { - this.parent = ItemStack.of(nbt.getCompound(PARENT)); + public void deserializeNBT(net.minecraft.core.HolderLookup.Provider provider, CompoundTag nbt) { + this.parent = Utils.deserialize(provider, nbt.getCompound(PARENT)); this.amount = nbt.getInt(AMOUNT); for (String allKey : nbt.getCompound(BIG_ITEMS).getAllKeys()) { - this.resultList.get(Integer.parseInt(allKey)).setResult(ItemStack.of(nbt.getCompound(BIG_ITEMS).getCompound(allKey).getCompound(STACK))); + this.resultList.get(Integer.parseInt(allKey)).setResult(Utils.deserialize(provider, nbt.getCompound(BIG_ITEMS).getCompound(allKey).getCompound(STACK))); this.resultList.get(Integer.parseInt(allKey)).setNeeded(Math.max(1, nbt.getCompound(BIG_ITEMS).getCompound(allKey).getInt(AMOUNT))); } } diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/EnderInventoryHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/EnderInventoryHandler.java index 5f78ec19..473abdf3 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/EnderInventoryHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/EnderInventoryHandler.java @@ -21,16 +21,16 @@ public EnderInventoryHandler(String frequency, EnderSavedData manager) { } @Override - public CompoundTag serializeNBT() { - CompoundTag compoundTag = super.serializeNBT(); + public CompoundTag serializeNBT(net.minecraft.core.HolderLookup.Provider provider) { + CompoundTag compoundTag = super.serializeNBT(provider); compoundTag.putBoolean(NBT_LOCKED, this.locked); compoundTag.putBoolean(NBT_VOID, this.voidItems); return compoundTag; } @Override - public void deserializeNBT(CompoundTag nbt) { - super.deserializeNBT(nbt); + public void deserializeNBT(net.minecraft.core.HolderLookup.Provider provider, CompoundTag nbt) { + super.deserializeNBT(provider, nbt); this.locked = nbt.getBoolean(NBT_LOCKED); this.voidItems = nbt.getBoolean(NBT_VOID); } diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingStackItemHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingStackItemHandler.java index a4ab502e..0cf394b2 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingStackItemHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/item/CompactingStackItemHandler.java @@ -4,6 +4,7 @@ import com.buuz135.functionalstorage.item.FSAttachments; import com.buuz135.functionalstorage.item.StorageUpgradeItem; import com.buuz135.functionalstorage.util.CompactingUtil; +import com.buuz135.functionalstorage.util.Utils; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; import net.minecraft.world.item.ItemStack; @@ -49,11 +50,11 @@ public CompactingStackItemHandler(ItemStack stack, int slots) { this.downgrade = false; this.isVoid = false; this.isCreative = false; - if (stack.hasData(FSAttachments.TILE)) { - var tile = stack.getData(FSAttachments.TILE); - deserializeNBT(tile.getCompound("handler")); + if (stack.has(FSAttachments.TILE)) { + var tile = stack.get(FSAttachments.TILE); + deserializeNBT(Utils.registryAccess(), tile.getCompound("handler")); for (Tag tag : tile.getCompound("storageUpgrades").getList("Items", Tag.TAG_COMPOUND)) { - ItemStack itemStack = ItemStack.of((CompoundTag) tag); + ItemStack itemStack = Utils.deserialize(Utils.registryAccess(), (CompoundTag) tag); if (itemStack.getItem() instanceof StorageUpgradeItem) { if (multiplier == 1) multiplier = ((StorageUpgradeItem) itemStack.getItem()).getStorageMultiplier(); else multiplier *= ((StorageUpgradeItem) itemStack.getItem()).getStorageMultiplier(); @@ -66,7 +67,7 @@ public CompactingStackItemHandler(ItemStack stack, int slots) { } } for (Tag tag : tile.getCompound("utilityUpgrades").getList("Items", Tag.TAG_COMPOUND)) { - ItemStack itemStack = ItemStack.of((CompoundTag) tag); + ItemStack itemStack = Utils.deserialize(Utils.registryAccess(), (CompoundTag) tag); if (itemStack.getItem().equals(FunctionalStorage.VOID_UPGRADE.get())) { this.isVoid = true; } @@ -104,14 +105,14 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate onChange(); } if (inserted == stack.getCount() * result.getNeeded() || isVoid()) return ItemStack.EMPTY; - return ItemHandlerHelper.copyStackWithSize(stack, stack.getCount() - inserted / result.getNeeded()); + return stack.copyWithCount(stack.getCount() - inserted / result.getNeeded()); } return stack; } private boolean isVoidValid(ItemStack stack) { for (CompactingUtil.Result result : this.resultList) { - if (ItemStack.isSameItemSameTags(result.getResult(), stack)) return true; + if (ItemStack.isSameItemSameComponents(result.getResult(), stack)) return true; } return false; } @@ -163,7 +164,7 @@ public ItemStack extractItem(int slot, int amount, boolean simulate) { this.amount -= stackAmount; onChange(); } - return ItemHandlerHelper.copyStackWithSize(bigStack.getResult(), amount); + return bigStack.getResult().copyWithCount(amount); } @@ -196,20 +197,20 @@ private boolean isValid(int slot, @Nonnull ItemStack stack) { if (slot < this.slots) { CompactingUtil.Result bigStack = this.resultList.get(slot); ItemStack fl = bigStack.getResult(); - return !fl.isEmpty() && ItemStack.isSameItemSameTags(fl, stack); + return !fl.isEmpty() && ItemStack.isSameItemSameComponents(fl, stack); } return false; } @Override - public CompoundTag serializeNBT() { + public CompoundTag serializeNBT(net.minecraft.core.HolderLookup.Provider provider) { CompoundTag compoundTag = new CompoundTag(); - compoundTag.put(PARENT, this.getParent().save(new CompoundTag())); + compoundTag.put(PARENT, this.getParent().saveOptional(provider)); compoundTag.putInt(AMOUNT, this.amount); CompoundTag items = new CompoundTag(); for (int i = 0; i < this.resultList.size(); i++) { CompoundTag bigStack = new CompoundTag(); - bigStack.put(STACK, this.resultList.get(i).getResult().save(new CompoundTag())); + bigStack.put(STACK, this.resultList.get(i).getResult().saveOptional(provider)); bigStack.putInt(AMOUNT, this.resultList.get(i).getNeeded()); items.put(i + "", bigStack); } @@ -218,19 +219,18 @@ public CompoundTag serializeNBT() { } @Override - public void deserializeNBT(CompoundTag nbt) { - this.parent = ItemStack.of(nbt.getCompound(PARENT)); + public void deserializeNBT(net.minecraft.core.HolderLookup.Provider provider, CompoundTag nbt) { + this.parent = Utils.deserialize(provider, nbt.getCompound(PARENT)); this.amount = nbt.getInt(AMOUNT); for (String allKey : nbt.getCompound(BIG_ITEMS).getAllKeys()) { - this.resultList.get(Integer.parseInt(allKey)).setResult(ItemStack.of(nbt.getCompound(BIG_ITEMS).getCompound(allKey).getCompound(STACK))); + this.resultList.get(Integer.parseInt(allKey)).setResult(Utils.deserialize(provider, nbt.getCompound(BIG_ITEMS).getCompound(allKey).getCompound(STACK))); this.resultList.get(Integer.parseInt(allKey)).setNeeded(Math.max(1, nbt.getCompound(BIG_ITEMS).getCompound(allKey).getInt(AMOUNT))); } } public void onChange() { - if (stack.hasData(FSAttachments.TILE)) - stack.setData(FSAttachments.TILE, new CompoundTag()); - stack.getData(FSAttachments.TILE).put("handler", serializeNBT()); + stack.set(FSAttachments.TILE, new CompoundTag()); + stack.get(FSAttachments.TILE).put("handler", serializeNBT(Utils.registryAccess())); } public int getMultiplier() { diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerStackItemHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerStackItemHandler.java index 5f95ed78..06df3fe9 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerStackItemHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/item/DrawerStackItemHandler.java @@ -5,18 +5,20 @@ import com.buuz135.functionalstorage.inventory.BigInventoryHandler.BigStack; import com.buuz135.functionalstorage.item.FSAttachments; import com.buuz135.functionalstorage.item.StorageUpgradeItem; +import com.buuz135.functionalstorage.util.Utils; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; import net.minecraft.world.item.ItemStack; import net.neoforged.neoforge.common.util.INBTSerializable; import net.neoforged.neoforge.items.IItemHandler; -import net.neoforged.neoforge.items.ItemHandlerHelper; import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; -import static com.buuz135.functionalstorage.inventory.BigInventoryHandler.*; +import static com.buuz135.functionalstorage.inventory.BigInventoryHandler.AMOUNT; +import static com.buuz135.functionalstorage.inventory.BigInventoryHandler.BIG_ITEMS; +import static com.buuz135.functionalstorage.inventory.BigInventoryHandler.STACK; public class DrawerStackItemHandler implements IItemHandler, INBTSerializable { @@ -37,11 +39,12 @@ public DrawerStackItemHandler(ItemStack stack, FunctionalStorage.DrawerType draw for (int i = 0; i < drawerType.getSlots(); i++) { this.storedStacks.add(i, new BigInventoryHandler.BigStack(ItemStack.EMPTY, 0)); } - if (stack.hasData(FSAttachments.TILE)) { - var tile = stack.getData(FSAttachments.TILE); - deserializeNBT(tile.getCompound("handler")); + if (stack.has(FSAttachments.TILE)) { + var tile = stack.get(FSAttachments.TILE); + var access = Utils.registryAccess(); + deserializeNBT(access, tile.getCompound("handler")); for (Tag tag : tile.getCompound("storageUpgrades").getList("Items", Tag.TAG_COMPOUND)) { - ItemStack itemStack = ItemStack.of((CompoundTag) tag); + ItemStack itemStack = Utils.deserialize(access, (CompoundTag) tag); if (itemStack.getItem() instanceof StorageUpgradeItem) { if (multiplier == 1) multiplier = ((StorageUpgradeItem) itemStack.getItem()).getStorageMultiplier(); else multiplier *= ((StorageUpgradeItem) itemStack.getItem()).getStorageMultiplier(); @@ -51,7 +54,7 @@ public DrawerStackItemHandler(ItemStack stack, FunctionalStorage.DrawerType draw } } for (Tag tag : tile.getCompound("utilityUpgrades").getList("Items", Tag.TAG_COMPOUND)) { - ItemStack itemStack = ItemStack.of((CompoundTag) tag); + ItemStack itemStack = Utils.deserialize(access, (CompoundTag) tag); if (itemStack.getItem().equals(FunctionalStorage.VOID_UPGRADE.get())) { this.isVoid = true; } @@ -60,12 +63,12 @@ public DrawerStackItemHandler(ItemStack stack, FunctionalStorage.DrawerType draw } @Override - public CompoundTag serializeNBT() { + public CompoundTag serializeNBT(net.minecraft.core.HolderLookup.Provider provider) { CompoundTag compoundTag = new CompoundTag(); CompoundTag items = new CompoundTag(); for (int i = 0; i < this.storedStacks.size(); i++) { CompoundTag bigStack = new CompoundTag(); - bigStack.put(STACK, this.storedStacks.get(i).getStack().save(new CompoundTag())); + bigStack.put(STACK, this.storedStacks.get(i).getStack().saveOptional(provider)); bigStack.putInt(AMOUNT, this.storedStacks.get(i).getAmount()); items.put(i + "", bigStack); } @@ -74,9 +77,9 @@ public CompoundTag serializeNBT() { } @Override - public void deserializeNBT(CompoundTag nbt) { + public void deserializeNBT(net.minecraft.core.HolderLookup.Provider provider, CompoundTag nbt) { for (String allKey : nbt.getCompound(BIG_ITEMS).getAllKeys()) { - this.storedStacks.get(Integer.parseInt(allKey)).setStack(ItemStack.of(nbt.getCompound(BIG_ITEMS).getCompound(allKey).getCompound(STACK))); + this.storedStacks.get(Integer.parseInt(allKey)).setStack(Utils.deserialize(provider, nbt.getCompound(BIG_ITEMS).getCompound(allKey).getCompound(STACK))); this.storedStacks.get(Integer.parseInt(allKey)).setAmount(nbt.getCompound(BIG_ITEMS).getCompound(allKey).getInt(AMOUNT)); } } @@ -107,7 +110,7 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate onChange(); } if (inserted == stack.getCount() || isVoid()) return ItemStack.EMPTY; - return ItemHandlerHelper.copyStackWithSize(stack, stack.getCount() - inserted); + return stack.copyWithCount(stack.getCount() - inserted); } return stack; } @@ -117,16 +120,15 @@ private boolean isVoid() { } private void onChange() { - if (stack.hasData(FSAttachments.TILE)) - stack.setData(FSAttachments.TILE, new CompoundTag()); - stack.getData(FSAttachments.TILE).put("handler", serializeNBT()); + stack.set(FSAttachments.TILE, new CompoundTag()); + stack.get(FSAttachments.TILE).put("handler", serializeNBT(Utils.registryAccess())); } private boolean isValid(int slot, @Nonnull ItemStack stack) { if (slot < type.getSlots()) { BigStack bigStack = this.storedStacks.get(slot); ItemStack fl = bigStack.getStack(); - return fl.isEmpty() || ItemStack.isSameItemSameTags(fl, stack); + return fl.isEmpty() || ItemStack.isSameItemSameComponents(fl, stack); } return false; } @@ -153,7 +155,7 @@ public ItemStack extractItem(int slot, int amount, boolean simulate) { bigStack.setAmount(bigStack.getAmount() - amount); onChange(); } - return ItemHandlerHelper.copyStackWithSize(bigStack.getStack(), amount); + return bigStack.getStack().copyWithCount(amount); } } return ItemStack.EMPTY; diff --git a/src/main/java/com/buuz135/functionalstorage/item/ConfigurationToolItem.java b/src/main/java/com/buuz135/functionalstorage/item/ConfigurationToolItem.java index 4b1f5cf1..690c50fc 100644 --- a/src/main/java/com/buuz135/functionalstorage/item/ConfigurationToolItem.java +++ b/src/main/java/com/buuz135/functionalstorage/item/ConfigurationToolItem.java @@ -29,7 +29,7 @@ public class ConfigurationToolItem extends BasicItem { public static ConfigurationAction getAction(ItemStack stack) { - return stack.getData(FSAttachments.CONFIGURATION_ACTION); + return stack.getOrDefault(FSAttachments.CONFIGURATION_ACTION, ConfigurationAction.LOCKING); } public ConfigurationToolItem() { @@ -66,7 +66,7 @@ public InteractionResultHolder use(Level p_41432_, Player player, Int if (player.isShiftKeyDown()) { ConfigurationAction action = getAction(stack); ConfigurationAction newAction = ConfigurationAction.values()[(Arrays.asList(ConfigurationAction.values()).indexOf(action) + 1) % ConfigurationAction.values().length]; - stack.setData(FSAttachments.CONFIGURATION_ACTION, newAction); + stack.set(FSAttachments.CONFIGURATION_ACTION, newAction); player.displayClientMessage(Component.literal("Swapped mode to ").setStyle(Style.EMPTY.withColor(newAction.getColor())) .append(Component.translatable("configurationtool.configmode." + newAction.name().toLowerCase(Locale.ROOT))), true); player.playSound(SoundEvents.ITEM_FRAME_REMOVE_ITEM, 0.5f, 1); diff --git a/src/main/java/com/buuz135/functionalstorage/item/FSAttachments.java b/src/main/java/com/buuz135/functionalstorage/item/FSAttachments.java index 4892a906..5c5fe1c7 100644 --- a/src/main/java/com/buuz135/functionalstorage/item/FSAttachments.java +++ b/src/main/java/com/buuz135/functionalstorage/item/FSAttachments.java @@ -1,45 +1,67 @@ package com.buuz135.functionalstorage.item; import com.buuz135.functionalstorage.FunctionalStorage; +import com.google.common.base.Suppliers; import com.mojang.serialization.Codec; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.component.DataComponentType; +import net.minecraft.core.registries.Registries; import net.minecraft.nbt.CompoundTag; import net.minecraft.util.Unit; -import net.neoforged.neoforge.attachment.AttachmentType; +import net.minecraft.world.item.ItemStack; import net.neoforged.neoforge.registries.DeferredRegister; -import net.neoforged.neoforge.registries.NeoForgeRegistries; import java.util.function.Supplier; import java.util.function.UnaryOperator; public class FSAttachments { - public static final DeferredRegister> DR = DeferredRegister.create(NeoForgeRegistries.ATTACHMENT_TYPES, FunctionalStorage.MOD_ID); + public static final DeferredRegister> DR = DeferredRegister.create(Registries.DATA_COMPONENT_TYPE, FunctionalStorage.MOD_ID); - public static final Supplier> CONFIGURATION_ACTION = - register("configuration_action", () -> ConfigurationToolItem.ConfigurationAction.LOCKING, builder -> builder.serialize(ConfigurationToolItem.ConfigurationAction.CODEC)); + public static final Supplier> CONFIGURATION_ACTION = + register("configuration_action", () -> ConfigurationToolItem.ConfigurationAction.LOCKING, builder -> builder.persistent(ConfigurationToolItem.ConfigurationAction.CODEC)); - public static final Supplier> ACTION_MODE = - register("action_mode", () -> LinkingToolItem.ActionMode.ADD, builder -> builder.serialize(LinkingToolItem.ActionMode.CODEC)); + public static final Supplier> ACTION_MODE = + register("action_mode", () -> LinkingToolItem.ActionMode.ADD, builder -> builder.persistent(LinkingToolItem.ActionMode.CODEC)); - public static final Supplier> LINKING_MODE = - register("linking_mode", () -> LinkingToolItem.LinkingMode.SINGLE, builder -> builder.serialize(LinkingToolItem.LinkingMode.CODEC)); + public static final Supplier> LINKING_MODE = + register("linking_mode", () -> LinkingToolItem.LinkingMode.SINGLE, builder -> builder.persistent(LinkingToolItem.LinkingMode.CODEC)); - public static final Supplier> FIRST_POSITION = - register("first_pos", () -> BlockPos.ZERO, builder -> builder.serialize(BlockPos.CODEC)); - public static final Supplier> CONTROLLER = - register("controller_position", () -> BlockPos.ZERO, builder -> builder.serialize(BlockPos.CODEC)); + public static final Supplier> FIRST_POSITION = + register("first_pos", () -> BlockPos.ZERO, builder -> builder.persistent(BlockPos.CODEC)); + public static final ComponentSupplier CONTROLLER = + register("controller_position", () -> BlockPos.ZERO, builder -> builder.persistent(BlockPos.CODEC)); - public static final Supplier> ENDER_FREQUENCY = register("ender_frequency", () -> "", op -> op.serialize(Codec.STRING)); - public static final Supplier> ENDER_SAFETY = register("ender_safety", () -> Unit.INSTANCE, op -> op.serialize(Codec.unit(Unit.INSTANCE))); - public static final Supplier> DIRECTION = register("direction", () -> Direction.NORTH, op -> op.serialize(Direction.CODEC)); - public static final Supplier> SLOT = register("slot", () -> 0, op -> op.serialize(Codec.intRange(0, UpgradeItem.MAX_SLOT - 1))); - public static final Supplier> LOCKED = register("locked", () -> false, op -> op.serialize(Codec.BOOL)); + public static final Supplier> ENDER_FREQUENCY = register("ender_frequency", () -> "", op -> op.persistent(Codec.STRING)); + public static final Supplier> ENDER_SAFETY = register("ender_safety", () -> Unit.INSTANCE, op -> op.persistent(Codec.unit(Unit.INSTANCE))); + public static final Supplier> DIRECTION = register("direction", () -> Direction.NORTH, op -> op.persistent(Direction.CODEC)); + public static final Supplier> SLOT = register("slot", () -> 0, op -> op.persistent(Codec.intRange(0, UpgradeItem.MAX_SLOT - 1))); + public static final Supplier> LOCKED = register("locked", () -> false, op -> op.persistent(Codec.BOOL)); - public static final Supplier> TILE = register("tile", CompoundTag::new, op -> op.serialize(CompoundTag.CODEC)); - public static final Supplier> STYLE = register("style", CompoundTag::new, op -> op.serialize(CompoundTag.CODEC)); + public static final Supplier> TILE = register("tile", CompoundTag::new, op -> op.persistent(CompoundTag.CODEC)); + public static final Supplier> STYLE = register("style", CompoundTag::new, op -> op.persistent(CompoundTag.CODEC)); - private static Supplier> register(String name, Supplier defaultVal, UnaryOperator> op) { - return DR.register(name, () -> op.apply(AttachmentType.builder(defaultVal)).build()); + private static ComponentSupplier register(String name, Supplier defaultVal, UnaryOperator> op) { + var registered = DR.register(name, () -> op.apply(DataComponentType.builder()).build()); + return new ComponentSupplier<>(registered, defaultVal); + } + + public static class ComponentSupplier implements Supplier> { + private final Supplier> type; + private final Supplier defaultSupplier; + + public ComponentSupplier(Supplier> type, Supplier defaultSupplier) { + this.type = type; + this.defaultSupplier = Suppliers.memoize(defaultSupplier::get); + } + + public T get(ItemStack stack) { + return stack.getOrDefault(type, defaultSupplier.get()); + } + + @Override + public DataComponentType get() { + return type.get(); + } } } diff --git a/src/main/java/com/buuz135/functionalstorage/item/LinkingToolItem.java b/src/main/java/com/buuz135/functionalstorage/item/LinkingToolItem.java index 050466ac..31a53383 100644 --- a/src/main/java/com/buuz135/functionalstorage/item/LinkingToolItem.java +++ b/src/main/java/com/buuz135/functionalstorage/item/LinkingToolItem.java @@ -40,11 +40,11 @@ public class LinkingToolItem extends BasicItem { public static LinkingMode getLinkingMode(ItemStack stack) { - return stack.getData(FSAttachments.LINKING_MODE); + return stack.getOrDefault(FSAttachments.LINKING_MODE, LinkingMode.SINGLE); } public static ActionMode getActionMode(ItemStack stack) { - return stack.getData(FSAttachments.ACTION_MODE); + return stack.getOrDefault(FSAttachments.ACTION_MODE, ActionMode.ADD); } static { @@ -52,7 +52,7 @@ public static ActionMode getActionMode(ItemStack stack) { ItemStack stack = leftClickBlock.getItemStack(); BlockEntity blockEntity = leftClickBlock.getLevel().getBlockEntity(leftClickBlock.getPos()); if (blockEntity instanceof EnderDrawerTile tile) { - stack.setData(FSAttachments.ENDER_FREQUENCY, tile.getFrequency()); + stack.set(FSAttachments.ENDER_FREQUENCY, tile.getFrequency()); leftClickBlock.getEntity().displayClientMessage(Component.literal("Stored frequency in the tool").setStyle(Style.EMPTY.withColor(LinkingMode.SINGLE.color)), true); leftClickBlock.setCanceled(true); } @@ -66,7 +66,7 @@ public LinkingToolItem() { @Override public boolean isFoil(ItemStack stack) { - return stack.hasData(FSAttachments.ENDER_FREQUENCY); + return stack.has(FSAttachments.ENDER_FREQUENCY); } @Override @@ -74,7 +74,7 @@ public boolean canAttackBlock(BlockState state, Level level, BlockPos pos, Playe ItemStack stack = player.getItemInHand(InteractionHand.MAIN_HAND); BlockEntity blockEntity = level.getBlockEntity(pos); if (blockEntity instanceof EnderDrawerTile tile) { - stack.setData(FSAttachments.ENDER_FREQUENCY, tile.getFrequency()); + stack.set(FSAttachments.ENDER_FREQUENCY, tile.getFrequency()); player.displayClientMessage(Component.literal("Stored frequency in the tool").setStyle(Style.EMPTY.withColor(LinkingMode.SINGLE.color)), true); return false; } @@ -90,28 +90,28 @@ public InteractionResult useOn(UseOnContext context) { LinkingMode linkingMode = getLinkingMode(stack); ActionMode linkingAction = getActionMode(stack); if (blockEntity instanceof EnderDrawerTile){ - if (stack.hasData(FSAttachments.ENDER_FREQUENCY)){ - String frequency = stack.getData(FSAttachments.ENDER_FREQUENCY); + if (stack.has(FSAttachments.ENDER_FREQUENCY)){ + String frequency = stack.get(FSAttachments.ENDER_FREQUENCY); EnderInventoryHandler inventory = EnderSavedData.getInstance(context.getLevel()).getFrequency(((EnderDrawerTile) blockEntity).getFrequency()); - if (inventory.getStackInSlot(0).isEmpty() || (context.getPlayer().isShiftKeyDown() && stack.hasData(FSAttachments.ENDER_SAFETY))) { + if (inventory.getStackInSlot(0).isEmpty() || (context.getPlayer().isShiftKeyDown() && stack.has(FSAttachments.ENDER_SAFETY))) { ((EnderDrawerTile) blockEntity).setFrequency(frequency); context.getPlayer().displayClientMessage(Component.literal("Changed drawer frequency").setStyle(Style.EMPTY.withColor(linkingMode.color)), true); - stack.removeData(FSAttachments.ENDER_SAFETY); + stack.remove(FSAttachments.ENDER_SAFETY); } else { context.getPlayer().displayClientMessage(Component.literal("Cannot change frequency, there are items in the drawer. Sneak + Right Click again to ignore this safety").withStyle(ChatFormatting.RED), true); - stack.setData(FSAttachments.ENDER_SAFETY, Unit.INSTANCE); + stack.set(FSAttachments.ENDER_SAFETY, Unit.INSTANCE); } return InteractionResult.SUCCESS; } } if (blockEntity instanceof StorageControllerTile) { - stack.setData(FSAttachments.CONTROLLER, pos); + stack.set(FSAttachments.CONTROLLER, pos); context.getPlayer().playSound(SoundEvents.ITEM_FRAME_ADD_ITEM, 0.5f, 1); context.getPlayer().displayClientMessage(Component.literal("Controller configured to the tool").withStyle(ChatFormatting.GREEN), true); - stack.removeData(FSAttachments.ENDER_FREQUENCY); + stack.remove(FSAttachments.ENDER_FREQUENCY); return InteractionResult.SUCCESS; - } else if (blockEntity instanceof ControllableDrawerTile && stack.hasData(FSAttachments.CONTROLLER)) { - BlockEntity controller = level.getBlockEntity(stack.getData(FSAttachments.CONTROLLER)); + } else if (blockEntity instanceof ControllableDrawerTile && stack.has(FSAttachments.CONTROLLER)) { + BlockEntity controller = level.getBlockEntity(stack.get(FSAttachments.CONTROLLER)); if (controller instanceof StorageControllerTile) { if (linkingMode == LinkingMode.SINGLE) { if (((StorageControllerTile) controller).addConnectedDrawers(linkingAction, pos)){ @@ -122,8 +122,8 @@ public InteractionResult useOn(UseOnContext context) { } } } else { - if (stack.hasData(FSAttachments.FIRST_POSITION)) { - BlockPos firstPos = stack.getData(FSAttachments.FIRST_POSITION); + if (stack.has(FSAttachments.FIRST_POSITION)) { + BlockPos firstPos = stack.get(FSAttachments.FIRST_POSITION); AABB aabb = new AABB(Math.min(firstPos.getX(), pos.getX()), Math.min(firstPos.getY(), pos.getY()), Math.min(firstPos.getZ(), pos.getZ()), Math.max(firstPos.getX(), pos.getX()) + 1, Math.max(firstPos.getY(), pos.getY()) + 1, Math.max(firstPos.getZ(), pos.getZ()) + 1); if (((StorageControllerTile) controller).addConnectedDrawers(linkingAction, getBlockPosInAABB(aabb).toArray(BlockPos[]::new))){ if (linkingAction == ActionMode.ADD){ @@ -132,9 +132,9 @@ public InteractionResult useOn(UseOnContext context) { context.getPlayer().displayClientMessage(Component.literal("Removed drawers from the controller").setStyle(Style.EMPTY.withColor(linkingMode.color)), true); } } - stack.removeData(FSAttachments.FIRST_POSITION); + stack.remove(FSAttachments.FIRST_POSITION); } else { - stack.setData(FSAttachments.FIRST_POSITION, pos); + stack.set(FSAttachments.FIRST_POSITION, pos); } } context.getPlayer().playSound(SoundEvents.ITEM_FRAME_ROTATE_ITEM, 0.5f, 1); @@ -148,22 +148,22 @@ public InteractionResult useOn(UseOnContext context) { public InteractionResultHolder use(Level p_41432_, Player player, InteractionHand hand) { ItemStack stack = player.getItemInHand(hand); if (!stack.isEmpty()) { - if (stack.hasData(FSAttachments.ENDER_FREQUENCY)) { + if (stack.has(FSAttachments.ENDER_FREQUENCY)) { if (player.isShiftKeyDown()) { - stack.removeData(FSAttachments.ENDER_FREQUENCY); + stack.remove(FSAttachments.ENDER_FREQUENCY); player.displayClientMessage(Component.literal("Cleared drawer frequency").setStyle(Style.EMPTY.withColor(ActionMode.ADD.getColor())), true); } } else { if (player.isShiftKeyDown()) { LinkingMode linkingMode = getLinkingMode(stack); LinkingMode newMode = linkingMode == LinkingMode.SINGLE ? LinkingMode.MULTIPLE : LinkingMode.SINGLE; - stack.setData(FSAttachments.LINKING_MODE, newMode); + stack.set(FSAttachments.LINKING_MODE, newMode); player.displayClientMessage(Component.literal("Swapped mode to " + newMode.name().toLowerCase(Locale.ROOT)).setStyle(Style.EMPTY.withColor(LinkingMode.MULTIPLE.getColor())), true); - stack.removeData(FSAttachments.FIRST_POSITION); + stack.remove(FSAttachments.FIRST_POSITION); } else { ActionMode linkingMode = getActionMode(stack); ActionMode newMode = linkingMode == ActionMode.ADD ? ActionMode.REMOVE : ActionMode.ADD; - stack.setData(FSAttachments.ACTION_MODE, newMode); + stack.set(FSAttachments.ACTION_MODE, newMode); player.displayClientMessage(Component.literal("Swapped action to " + newMode.name().toLowerCase(Locale.ROOT)).setStyle(Style.EMPTY.withColor(ActionMode.REMOVE.getColor())), true); } } @@ -179,7 +179,7 @@ public void addTooltipDetails(@Nullable BasicItem.Key key, ItemStack stack, List LinkingMode linkingMode = getLinkingMode(stack); ActionMode linkingAction = getActionMode(stack); if (key == null) { - if (stack.hasData(FSAttachments.ENDER_FREQUENCY)) { + if (stack.has(FSAttachments.ENDER_FREQUENCY)) { MutableComponent text = Component.translatable("linkingtool.ender.frequency"); //frequencyDisplay.forEach(item -> text.append(item.getName(new ItemStack(item)))); tooltip.add(text.withStyle(ChatFormatting.GRAY)); @@ -191,8 +191,8 @@ public void addTooltipDetails(@Nullable BasicItem.Key key, ItemStack stack, List .append(Component.translatable("linkingtool.linkingmode." + linkingMode.name().toLowerCase(Locale.ROOT)).withStyle(Style.EMPTY.withColor(linkingMode.getColor())))); tooltip.add(Component.translatable("linkingtool.linkingaction").withStyle(ChatFormatting.YELLOW) .append(Component.translatable("linkingtool.linkingaction." + linkingAction.name().toLowerCase(Locale.ROOT)).withStyle(Style.EMPTY.withColor(linkingAction.getColor())))); - if (stack.hasData(FSAttachments.CONTROLLER)) { - var pos = stack.getData(FSAttachments.CONTROLLER); + if (stack.has(FSAttachments.CONTROLLER)) { + var pos = stack.get(FSAttachments.CONTROLLER); tooltip.add(Component.translatable("linkingtool.controller").withStyle(ChatFormatting.YELLOW) .append(Component.literal(pos.getX() + "" + ChatFormatting.WHITE + ", " + ChatFormatting.DARK_AQUA + pos.getY() + ChatFormatting.WHITE + ", " + ChatFormatting.DARK_AQUA + pos.getZ()).withStyle(ChatFormatting.DARK_AQUA))); } else { diff --git a/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java b/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java index 93caafdd..5aede47e 100644 --- a/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java +++ b/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java @@ -29,10 +29,10 @@ public class UpgradeItem extends BasicItem { public static final int MAX_SLOT = 4; public static Direction getDirection(ItemStack stack){ - if (stack.hasData(FSAttachments.DIRECTION)) { + if (stack.has(FSAttachments.DIRECTION)) { Item item = stack.getItem(); if (item.equals(FunctionalStorage.PULLING_UPGRADE.get()) || item.equals(FunctionalStorage.PUSHING_UPGRADE.get()) || item.equals(FunctionalStorage.COLLECTOR_UPGRADE.get())) { - return stack.getData(FSAttachments.DIRECTION); + return stack.get(FSAttachments.DIRECTION); } } return Direction.NORTH; @@ -55,10 +55,10 @@ public void onCraftedBy(ItemStack p_41447_, Level p_41448_, Player p_41449_) { private ItemStack initNbt(ItemStack stack){ Item item = stack.getItem(); if (item.equals(FunctionalStorage.PULLING_UPGRADE.get()) || item.equals(FunctionalStorage.PUSHING_UPGRADE.get()) || item.equals(FunctionalStorage.COLLECTOR_UPGRADE.get())){ - stack.setData(FSAttachments.DIRECTION, Direction.NORTH); + stack.set(FSAttachments.DIRECTION, Direction.NORTH); } if (item.equals(FunctionalStorage.REDSTONE_UPGRADE.get())){ - stack.setData(FSAttachments.SLOT, 0); + stack.set(FSAttachments.SLOT, 0); } return stack; } @@ -75,13 +75,13 @@ public boolean overrideOtherStackedOnMe(ItemStack first, ItemStack second, Slot if (item.equals(FunctionalStorage.PULLING_UPGRADE.get()) || item.equals(FunctionalStorage.PUSHING_UPGRADE.get()) || item.equals(FunctionalStorage.COLLECTOR_UPGRADE.get())){ Direction direction = getDirection(first); Direction next = Direction.values()[(Arrays.asList(Direction.values()).indexOf(direction) + 1 ) % Direction.values().length]; - first.setData(FSAttachments.DIRECTION, next); + first.set(FSAttachments.DIRECTION, next); p_150896_.playSound(SoundEvents.UI_BUTTON_CLICK.value(), 0.5f, 1); return true; } if (item.equals(FunctionalStorage.REDSTONE_UPGRADE.get())){ - int slot = first.getData(FSAttachments.SLOT); - first.setData(FSAttachments.SLOT, (slot + 1) % MAX_SLOT); + int slot = first.getOrDefault(FSAttachments.SLOT, 0); + first.set(FSAttachments.SLOT, (slot + 1) % MAX_SLOT); p_150896_.playSound(SoundEvents.UI_BUTTON_CLICK.value(), 0.5f, 1); return true; } @@ -94,13 +94,13 @@ public void addTooltipDetails(@Nullable BasicItem.Key key, ItemStack stack, List super.addTooltipDetails(key, stack, tooltip, advanced); tooltip.add(Component.translatable("upgrade.type").withStyle(ChatFormatting.YELLOW).append(Component.translatable("upgrade.type." + getType().name().toLowerCase(Locale.ROOT)).withStyle(ChatFormatting.WHITE))); Item item = stack.getItem(); - if (isDirectionUpgrade(item) && stack.hasData(FSAttachments.DIRECTION)) { + if (isDirectionUpgrade(item) && stack.has(FSAttachments.DIRECTION)) { tooltip.add(Component.translatable("item.utility.direction").withStyle(ChatFormatting.YELLOW).append(Component.translatable(WordUtils.capitalize(getDirection(stack).getName().toLowerCase(Locale.ROOT))).withStyle(ChatFormatting.WHITE))); tooltip.add(Component.literal("")); tooltip.add(Component.translatable("item.utility.direction.desc").withStyle(ChatFormatting.GRAY)); } - if (item.equals(FunctionalStorage.REDSTONE_UPGRADE.get()) && stack.hasData(FSAttachments.SLOT)) { - tooltip.add(Component.translatable("item.utility.slot").withStyle(ChatFormatting.YELLOW).append(Component.literal(stack.getData(FSAttachments.SLOT).toString()).withStyle(ChatFormatting.WHITE))); + if (item.equals(FunctionalStorage.REDSTONE_UPGRADE.get()) && stack.has(FSAttachments.SLOT)) { + tooltip.add(Component.translatable("item.utility.slot").withStyle(ChatFormatting.YELLOW).append(Component.literal(stack.get(FSAttachments.SLOT).toString()).withStyle(ChatFormatting.WHITE))); tooltip.add(Component.literal("")); tooltip.add(Component.translatable("item.utility.direction.desc").withStyle(ChatFormatting.GRAY)); } @@ -131,7 +131,7 @@ public Component getDescription(ItemStack stack, ControllableDrawerTile tile) return Component.translatable("drawer_upgrade.functionalstorage.void." + type); } else if (this == FunctionalStorage.REDSTONE_UPGRADE.get()) { return Component.translatable("drawer_upgrade.functionalstorage.redstone", Component.literal( - String.valueOf(stack.getData(FSAttachments.SLOT)) + String.valueOf(stack.getOrDefault(FSAttachments.SLOT, 0)) ).withStyle(ChatFormatting.RED)); } return null; diff --git a/src/main/java/com/buuz135/functionalstorage/network/EnderDrawerSyncMessage.java b/src/main/java/com/buuz135/functionalstorage/network/EnderDrawerSyncMessage.java index ff37bc27..4301cfc2 100644 --- a/src/main/java/com/buuz135/functionalstorage/network/EnderDrawerSyncMessage.java +++ b/src/main/java/com/buuz135/functionalstorage/network/EnderDrawerSyncMessage.java @@ -4,19 +4,18 @@ import com.buuz135.functionalstorage.world.EnderSavedData; import com.hrznstudio.titanium.network.CompoundSerializableDataHandler; import com.hrznstudio.titanium.network.Message; -import net.minecraft.client.Minecraft; -import net.neoforged.neoforge.network.handling.PlayPayloadContext; +import net.neoforged.neoforge.network.handling.IPayloadContext; public class EnderDrawerSyncMessage extends Message { static { CompoundSerializableDataHandler.map(EnderInventoryHandler.class, buf -> { EnderInventoryHandler handler = new EnderInventoryHandler(buf.readUtf(), EnderSavedData.CLIENT); - handler.deserializeNBT(buf.readNbt()); + handler.deserializeNBT(buf.registryAccess(), buf.readNbt()); return handler; }, (buf, handler1) -> { buf.writeUtf(handler1.getFrequency()); - buf.writeNbt(handler1.serializeNBT()); + buf.writeNbt(handler1.serializeNBT(buf.registryAccess())); }); } @@ -33,9 +32,7 @@ public EnderDrawerSyncMessage() { } @Override - protected void handleMessage(PlayPayloadContext context) { - context.workHandler().execute(() -> { - EnderSavedData.getInstance(Minecraft.getInstance().level).setFrenquency(frequency, handler); - }); + protected void handleMessage(IPayloadContext context) { + EnderSavedData.getInstance(context.player().level()).setFrenquency(frequency, handler); } } diff --git a/src/main/java/com/buuz135/functionalstorage/recipe/CustomCompactingRecipe.java b/src/main/java/com/buuz135/functionalstorage/recipe/CustomCompactingRecipe.java index 5880f3fb..690546a8 100644 --- a/src/main/java/com/buuz135/functionalstorage/recipe/CustomCompactingRecipe.java +++ b/src/main/java/com/buuz135/functionalstorage/recipe/CustomCompactingRecipe.java @@ -2,13 +2,16 @@ import com.buuz135.functionalstorage.FunctionalStorage; import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; import com.mojang.serialization.codecs.RecordCodecBuilder; +import net.minecraft.core.HolderLookup; import net.minecraft.core.RegistryAccess; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.Container; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.CraftingInput; import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; @@ -17,10 +20,10 @@ import java.util.ArrayList; import java.util.List; -public class CustomCompactingRecipe implements Recipe { - public static final Codec CODEC = RecordCodecBuilder.create(in -> in.group( - ItemStack.ITEM_WITH_COUNT_CODEC.fieldOf("lower_input").forGetter(CustomCompactingRecipe::getLower_input), - ItemStack.ITEM_WITH_COUNT_CODEC.fieldOf("higher_input").forGetter(CustomCompactingRecipe::getHigher_input) +public class CustomCompactingRecipe implements Recipe { + public static final MapCodec CODEC = RecordCodecBuilder.mapCodec(in -> in.group( + ItemStack.CODEC.fieldOf("lower_input").forGetter(CustomCompactingRecipe::getLower_input), + ItemStack.CODEC.fieldOf("higher_input").forGetter(CustomCompactingRecipe::getHigher_input) ).apply(in, CustomCompactingRecipe::new)); public static List RECIPES = new ArrayList<>(); @@ -38,12 +41,12 @@ public CustomCompactingRecipe(ItemStack lower_input, ItemStack higher_input) { } @Override - public boolean matches(Container inv, Level worldIn) { + public boolean matches(CraftingInput input, Level level) { return false; } @Override - public ItemStack assemble(Container inv, RegistryAccess access) { + public ItemStack assemble(CraftingInput input, HolderLookup.Provider registries) { return ItemStack.EMPTY; } @@ -53,7 +56,7 @@ public boolean canCraftInDimensions(int width, int height) { } @Override - public ItemStack getResultItem(RegistryAccess access) { + public ItemStack getResultItem(HolderLookup.Provider access) { return ItemStack.EMPTY; } diff --git a/src/main/java/com/buuz135/functionalstorage/recipe/DrawerlessWoodIngredient.java b/src/main/java/com/buuz135/functionalstorage/recipe/DrawerlessWoodIngredient.java index e2231a64..c9b6c962 100644 --- a/src/main/java/com/buuz135/functionalstorage/recipe/DrawerlessWoodIngredient.java +++ b/src/main/java/com/buuz135/functionalstorage/recipe/DrawerlessWoodIngredient.java @@ -2,6 +2,7 @@ import com.hrznstudio.titanium.util.TagUtil; import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; import net.minecraft.core.Holder; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; @@ -10,6 +11,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; +import net.neoforged.neoforge.common.crafting.ICustomIngredient; import net.neoforged.neoforge.common.crafting.IngredientType; import org.jetbrains.annotations.Nullable; @@ -19,20 +21,16 @@ import static com.buuz135.functionalstorage.FunctionalStorage.MOD_ID; -public class DrawerlessWoodIngredient extends Ingredient { - public static final Codec CODEC = Codec.unit(DrawerlessWoodIngredient::new); +public class DrawerlessWoodIngredient implements ICustomIngredient { + public static final MapCodec CODEC = MapCodec.unit(DrawerlessWoodIngredient::new); public static Holder> TYPE; - public static final ResourceLocation NAME = new ResourceLocation(MOD_ID, "woodless"); + public static final ResourceLocation NAME = com.buuz135.functionalstorage.util.Utils.resourceLocation(MOD_ID, "woodless"); private List woodless; - public DrawerlessWoodIngredient() { - super(Stream.empty()); - } - @Override - public ItemStack[] getItems() { - return getWoods().stream().map(ItemStack::new).toArray(ItemStack[]::new); + public Stream getItems() { + return getWoods().stream().map(ItemStack::new); } @Override @@ -41,7 +39,7 @@ public boolean test(@Nullable ItemStack stack) { } @Override - public boolean synchronizeWithContents() { + public boolean isSimple() { return false; } diff --git a/src/main/java/com/buuz135/functionalstorage/recipe/FramedDrawerRecipe.java b/src/main/java/com/buuz135/functionalstorage/recipe/FramedDrawerRecipe.java index 246b463b..27bf9c75 100644 --- a/src/main/java/com/buuz135/functionalstorage/recipe/FramedDrawerRecipe.java +++ b/src/main/java/com/buuz135/functionalstorage/recipe/FramedDrawerRecipe.java @@ -6,11 +6,13 @@ import com.buuz135.functionalstorage.block.FramedDrawerBlock; import com.buuz135.functionalstorage.block.FramedDrawerControllerBlock; import com.buuz135.functionalstorage.block.FramedSimpleCompactingDrawerBlock; +import net.minecraft.core.HolderLookup; import net.minecraft.core.RegistryAccess; import net.minecraft.world.inventory.CraftingContainer; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.CraftingBookCategory; +import net.minecraft.world.item.crafting.CraftingInput; import net.minecraft.world.item.crafting.CustomRecipe; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.SimpleCraftingRecipeSerializer; @@ -49,7 +51,7 @@ public static boolean matchesSimpleCompacting(ItemStack first, ItemStack second, } @Override - public boolean matches(CraftingContainer inv, Level worldIn) { + public boolean matches(CraftingInput inv, Level worldIn) { return matches(inv.getItem(0), inv.getItem(1), inv.getItem(2)) || matchesCompacting(inv.getItem(0), inv.getItem(1), inv.getItem(2)) || matchesSimpleCompacting(inv.getItem(0), inv.getItem(1), inv.getItem(2)) || @@ -58,7 +60,7 @@ public boolean matches(CraftingContainer inv, Level worldIn) { } @Override - public ItemStack assemble(CraftingContainer inv, RegistryAccess registryAccess) { + public ItemStack assemble(CraftingInput inv, HolderLookup.Provider registryAccess) { if (matches(inv.getItem(0), inv.getItem(1), inv.getItem(2)) || matchesCompacting(inv.getItem(0), inv.getItem(1), inv.getItem(2)) || matchesSimpleCompacting(inv.getItem(0), inv.getItem(1), inv.getItem(2)) || diff --git a/src/main/java/com/buuz135/functionalstorage/util/CompactingUtil.java b/src/main/java/com/buuz135/functionalstorage/util/CompactingUtil.java index 0e29e872..d86495b8 100644 --- a/src/main/java/com/buuz135/functionalstorage/util/CompactingUtil.java +++ b/src/main/java/com/buuz135/functionalstorage/util/CompactingUtil.java @@ -6,21 +6,19 @@ import net.minecraft.core.NonNullList; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.CraftingContainer; -import net.minecraft.world.inventory.TransientCraftingContainer; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.CraftingInput; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.Level; -import net.neoforged.neoforge.items.ItemHandlerHelper; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.IntStream; /** @@ -83,12 +81,12 @@ public List getResults() { private Result findUpperTier(ItemStack stack){ for (CustomCompactingRecipe recipe : this.recipes) { if (ItemStack.isSameItem(recipe.lower_input, stack)) { - return new Result(ItemHandlerHelper.copyStackWithSize(recipe.higher_input, 1), recipe.lower_input.getCount()); + return new Result(recipe.higher_input.copyWithCount(1), recipe.lower_input.getCount()); } } //Checking 3x3 int sizeCheck = 9; - CraftingContainer container = createContainerAndFill(3, stack); + var container = createContainerAndFill(3, stack); List outputs = findAllMatchingRecipes(container); List realOutputs = new ArrayList<>(); if (outputs.size() == 0){ @@ -125,7 +123,7 @@ private Result findUpperTier(ItemStack stack){ private Result findLowerTier(ItemStack stack){ for (CustomCompactingRecipe recipe : this.recipes) { if (ItemStack.isSameItem(recipe.higher_input, stack)) { - return new Result(ItemHandlerHelper.copyStackWithSize(recipe.lower_input, 1), recipe.lower_input.getCount()); + return new Result(recipe.lower_input.copyWithCount(1), recipe.lower_input.getCount()); } } List candidates = new ArrayList<>(); @@ -141,7 +139,7 @@ private Result findLowerTier(ItemStack stack){ candidates.add(match); candidatesRate.put(match, recipeSize); } - CraftingContainer container = createContainerAndFill(1, output); + var container = createContainerAndFill(1, output); List matchStacks = findAllMatchingRecipes(container); for (ItemStack matchStack : matchStacks) { if (ItemStack.isSameItem(match, matchStack) && matchStack.getCount() == recipeSize) { @@ -163,7 +161,7 @@ private Result findLowerTier(ItemStack stack){ return new Result(ItemStack.EMPTY, 0); } - private List findAllMatchingRecipes(CraftingContainer crafting) { + private List findAllMatchingRecipes(CraftingInput crafting) { List candidates = new ArrayList<>(); for (var rcp : level.getRecipeManager().getRecipesFor(RecipeType.CRAFTING, crafting, level)) { var recipe = rcp.value(); @@ -218,22 +216,9 @@ private ItemStack tryMatch(ItemStack stack, NonNullList ingredients) return match; } - private CraftingContainer createContainerAndFill(int size, ItemStack stack){ - CraftingContainer inventoryCrafting = new TransientCraftingContainer(new AbstractContainerMenu(null, 0) { - @Override - public ItemStack quickMoveStack(Player p_38941_, int p_38942_) { - return ItemStack.EMPTY; - } - - @Override - public boolean stillValid(Player playerIn) { - return false; - } - }, size, size); - for (int i = 0; i < size * size; i++) { - inventoryCrafting.setItem(i, stack.copy()); - } - return inventoryCrafting; + private CraftingInput createContainerAndFill(int size, ItemStack stack){ + return CraftingInput.of(size, size, IntStream.range(0, size * size) + .mapToObj(i -> stack.copy()).toList()); } public static class Result{ diff --git a/src/main/java/com/buuz135/functionalstorage/util/ConnectedDrawers.java b/src/main/java/com/buuz135/functionalstorage/util/ConnectedDrawers.java index 6d451c16..657a7634 100644 --- a/src/main/java/com/buuz135/functionalstorage/util/ConnectedDrawers.java +++ b/src/main/java/com/buuz135/functionalstorage/util/ConnectedDrawers.java @@ -89,7 +89,7 @@ public void rebuildShapes() { } @Override - public CompoundTag serializeNBT() { + public CompoundTag serializeNBT(net.minecraft.core.HolderLookup.Provider provider) { CompoundTag compoundTag = new CompoundTag(); for (int i = 0; i < this.connectedDrawers.size(); i++) { compoundTag.putLong(i + "", this.connectedDrawers.get(i)); @@ -98,7 +98,7 @@ public CompoundTag serializeNBT() { } @Override - public void deserializeNBT(CompoundTag nbt) { + public void deserializeNBT(net.minecraft.core.HolderLookup.Provider provider, CompoundTag nbt) { this.connectedDrawers = new ArrayList<>(); for (String allKey : nbt.getAllKeys()) { connectedDrawers.add(nbt.getLong(allKey)); diff --git a/src/main/java/com/buuz135/functionalstorage/util/StorageTags.java b/src/main/java/com/buuz135/functionalstorage/util/StorageTags.java index b9ed4a0b..abae327b 100644 --- a/src/main/java/com/buuz135/functionalstorage/util/StorageTags.java +++ b/src/main/java/com/buuz135/functionalstorage/util/StorageTags.java @@ -8,7 +8,7 @@ public class StorageTags { - public static final TagKey DRAWER = ItemTags.create(new ResourceLocation(FunctionalStorage.MOD_ID, "drawer")); - public static final TagKey IGNORE_CRAFTING_CHECK = ItemTags.create(new ResourceLocation(FunctionalStorage.MOD_ID, "ignore_crafting_check")); + public static final TagKey DRAWER = ItemTags.create(com.buuz135.functionalstorage.util.Utils.resourceLocation(FunctionalStorage.MOD_ID, "drawer")); + public static final TagKey IGNORE_CRAFTING_CHECK = ItemTags.create(com.buuz135.functionalstorage.util.Utils.resourceLocation(FunctionalStorage.MOD_ID, "ignore_crafting_check")); } diff --git a/src/main/java/com/buuz135/functionalstorage/util/Utils.java b/src/main/java/com/buuz135/functionalstorage/util/Utils.java new file mode 100644 index 00000000..d0df8b72 --- /dev/null +++ b/src/main/java/com/buuz135/functionalstorage/util/Utils.java @@ -0,0 +1,38 @@ +package com.buuz135.functionalstorage.util; + +import net.minecraft.core.HolderLookup; +import net.minecraft.core.RegistryAccess; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.NbtOps; +import net.minecraft.resources.RegistryOps; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.neoforged.fml.LogicalSide; +import net.neoforged.neoforge.common.util.LogicalSidedProvider; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.server.ServerLifecycleHooks; + +public class Utils { + public static ResourceLocation resourceLocation(String toParse) { + return ResourceLocation.parse(toParse); + } + + public static ResourceLocation resourceLocation(String namespace, String path) { + return ResourceLocation.fromNamespaceAndPath(namespace, path); + } + + public static ItemStack deserialize(HolderLookup.Provider provider, CompoundTag tag) { + return ItemStack.OPTIONAL_CODEC.decode(RegistryOps.create(NbtOps.INSTANCE, provider), tag).getOrThrow().getFirst(); + } + + public static FluidStack deserializeFluid(HolderLookup.Provider provider, CompoundTag tag) { + return FluidStack.OPTIONAL_CODEC.decode(RegistryOps.create(NbtOps.INSTANCE, provider), tag).getOrThrow().getFirst(); + } + + public static RegistryAccess registryAccess() { + if (ServerLifecycleHooks.getCurrentServer() != null) { + return ServerLifecycleHooks.getCurrentServer().registryAccess(); + } + return LogicalSidedProvider.CLIENTWORLD.get(LogicalSide.CLIENT).orElseThrow().registryAccess(); + } +} diff --git a/src/main/java/com/buuz135/functionalstorage/world/EnderSavedData.java b/src/main/java/com/buuz135/functionalstorage/world/EnderSavedData.java index 43ac94b6..ce8783a0 100644 --- a/src/main/java/com/buuz135/functionalstorage/world/EnderSavedData.java +++ b/src/main/java/com/buuz135/functionalstorage/world/EnderSavedData.java @@ -2,6 +2,7 @@ import com.buuz135.functionalstorage.inventory.EnderInventoryHandler; import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.core.HolderLookup; import net.minecraft.nbt.CompoundTag; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.Level; @@ -29,7 +30,7 @@ public static EnderSavedData getInstance(LevelAccessor accessor){ if (accessor instanceof ServerLevel){ ServerLevel serverWorld = ((ServerLevel) accessor).getServer().getLevel(Level.OVERWORLD); EnderSavedData data = serverWorld.getDataStorage().computeIfAbsent( - new Factory(() -> new EnderSavedData((ServerLevel)accessor), tag -> EnderSavedData.load(tag, (ServerLevel) accessor)), NAME); + new Factory<>(() -> new EnderSavedData((ServerLevel)accessor), (tag, prov) -> EnderSavedData.load(tag, (ServerLevel) accessor)), NAME); return data; } else if (accessor instanceof ClientLevel){ return CLIENT; @@ -43,7 +44,7 @@ private static EnderSavedData load(CompoundTag compoundTag, Level level) { CompoundTag backpacks = compoundTag.getCompound("Ender"); for (String s : backpacks.getAllKeys()) { EnderInventoryHandler hander = new EnderInventoryHandler(s, manager); - hander.deserializeNBT(backpacks.getCompound(s)); + hander.deserializeNBT(level.registryAccess(), backpacks.getCompound(s)); manager.itemHandlers.put(s, hander); } @@ -59,9 +60,9 @@ public void setFrenquency(String frequency, EnderInventoryHandler handler){ } @Override - public CompoundTag save(CompoundTag tag) { + public CompoundTag save(CompoundTag tag, HolderLookup.Provider provider) { CompoundTag nbt = new CompoundTag(); - itemHandlers.forEach((s, iItemHandler) -> nbt.put(s, iItemHandler.serializeNBT())); + itemHandlers.forEach((s, iItemHandler) -> nbt.put(s, iItemHandler.serializeNBT(provider))); tag.put("Ender", nbt); return tag; } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/neoforge.mods.toml similarity index 98% rename from src/main/resources/META-INF/mods.toml rename to src/main/resources/META-INF/neoforge.mods.toml index f43db184..0eefdee3 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/neoforge.mods.toml @@ -43,7 +43,7 @@ modId = "neoforge" #mandatory # Does this dependency have to exist - if not, ordering below must be specified type = "required" # The version range of the dependency -versionRange = "[20.4,)" #mandatory +versionRange = "[21,)" #mandatory # An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory ordering = "NONE" # Side this dependency is applied on - BOTH, CLIENT or SERVER @@ -53,7 +53,7 @@ side = "BOTH" modId = "minecraft" type = "required" # This version range declares a minimum of the current minecraft version up to but not including the next major version -versionRange = "[1.20.4,)" +versionRange = "[1.21,)" ordering = "NONE" side = "BOTH" [[dependencies.functionalstorage]] From 11c9eca298168679e6a045533c6223b3d0a6fc60 Mon Sep 17 00:00:00 2001 From: Matyrobbrt Date: Tue, 2 Jul 2024 16:34:18 +0300 Subject: [PATCH 11/20] Run datagen --- build.gradle | 4 + .../15b6275091e1d61ba43a63172e99581ffd5ac41e | 2 +- .../361def3a0b0e87157892b021be1ddec9d13d5e52 | 2 +- .../424df6c0265e09414e636289f261813cd93f4aa2 | 2 +- .../58b100d11464fc6de03e6a16617c8d741d90a73a | 4 +- .../59eb3dbb5f86130e09b3c62d89b9525ee01cf52d | 94 +++---- .../7b7965c95f0313555fafc7c653e689cdb94b8fca | 2 +- .../9b4b2fe28e6a198629709c0c8772cb00a8b15d4a | 6 +- .../9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e | 246 +++++++++--------- .../f4bc6a534340ffb17710ab19bf013aa0d2f1f9d9 | 2 +- .../recipes/misc/acacia_1.json | 4 +- .../recipes/misc/acacia_2.json | 4 +- .../recipes/misc/acacia_4.json | 4 +- .../recipes/misc/armory_cabinet.json | 2 +- .../recipes/misc/birch_1.json | 4 +- .../recipes/misc/birch_2.json | 4 +- .../recipes/misc/birch_4.json | 4 +- .../recipes/misc/cherry_1.json | 4 +- .../recipes/misc/cherry_2.json | 4 +- .../recipes/misc/cherry_4.json | 4 +- .../recipes/misc/collector_upgrade.json | 2 +- .../recipes/misc/compacting_drawer.json | 4 +- .../misc/compacting_framed_drawer.json | 4 +- .../recipes/misc/configuration_tool.json | 4 +- .../recipes/misc/controller_extension.json | 2 +- .../recipes/misc/copper_upgrade.json | 4 +- .../recipes/misc/crimson_1.json | 4 +- .../recipes/misc/crimson_2.json | 4 +- .../recipes/misc/crimson_4.json | 4 +- .../recipes/misc/dark_oak_1.json | 4 +- .../recipes/misc/dark_oak_2.json | 4 +- .../recipes/misc/dark_oak_4.json | 4 +- .../recipes/misc/diamond_upgrade.json | 2 +- .../recipes/misc/ender_drawer.json | 2 +- .../recipes/misc/fluid_1.json | 2 +- .../recipes/misc/fluid_2.json | 2 +- .../recipes/misc/fluid_4.json | 2 +- .../recipes/misc/framed_1.json | 4 +- .../recipes/misc/framed_2.json | 4 +- .../recipes/misc/framed_4.json | 4 +- .../misc/framed_controller_extension.json | 4 +- .../misc/framed_simple_compacting_drawer.json | 4 +- .../misc/framed_storage_controller.json | 4 +- .../recipes/misc/gold_upgrade.json | 2 +- .../recipes/misc/iron_downgrade.json | 2 +- .../recipes/misc/jungle_1.json | 4 +- .../recipes/misc/jungle_2.json | 4 +- .../recipes/misc/jungle_4.json | 4 +- .../recipes/misc/linking_tool.json | 4 +- .../recipes/misc/mangrove_1.json | 4 +- .../recipes/misc/mangrove_2.json | 4 +- .../recipes/misc/mangrove_4.json | 4 +- .../recipes/misc/netherite_upgrade.json | 4 +- .../recipes/misc/oak_1.json | 4 +- .../recipes/misc/oak_2.json | 4 +- .../recipes/misc/oak_4.json | 4 +- .../recipes/misc/puller_upgrade.json | 2 +- .../recipes/misc/pusher_upgrade.json | 2 +- .../recipes/misc/redstone_upgrade.json | 4 +- .../misc/simple_compacting_drawer.json | 4 +- .../recipes/misc/spruce_1.json | 4 +- .../recipes/misc/spruce_2.json | 4 +- .../recipes/misc/spruce_4.json | 4 +- .../recipes/misc/storage_controller.json | 2 +- .../recipes/misc/void_upgrade.json | 2 +- .../recipes/misc/warped_1.json | 4 +- .../recipes/misc/warped_2.json | 4 +- .../recipes/misc/warped_4.json | 4 +- .../blocks/acacia_1.json | 0 .../blocks/acacia_2.json | 0 .../blocks/acacia_4.json | 0 .../blocks/armory_cabinet.json | 0 .../blocks/birch_1.json | 0 .../blocks/birch_2.json | 0 .../blocks/birch_4.json | 0 .../blocks/cherry_1.json | 0 .../blocks/cherry_2.json | 0 .../blocks/cherry_4.json | 0 .../blocks/compacting_drawer.json | 0 .../blocks/compacting_framed_drawer.json | 0 .../blocks/controller_extension.json | 0 .../blocks/crimson_1.json | 0 .../blocks/crimson_2.json | 0 .../blocks/crimson_4.json | 0 .../blocks/dark_oak_1.json | 0 .../blocks/dark_oak_2.json | 0 .../blocks/dark_oak_4.json | 0 .../blocks/ender_drawer.json | 0 .../blocks/fluid_1.json | 0 .../blocks/fluid_2.json | 0 .../blocks/fluid_4.json | 0 .../blocks/framed_1.json | 0 .../blocks/framed_2.json | 0 .../blocks/framed_4.json | 0 .../blocks/framed_controller_extension.json | 0 .../framed_simple_compacting_drawer.json | 0 .../blocks/framed_storage_controller.json | 0 .../blocks/jungle_1.json | 0 .../blocks/jungle_2.json | 0 .../blocks/jungle_4.json | 0 .../blocks/mangrove_1.json | 0 .../blocks/mangrove_2.json | 0 .../blocks/mangrove_4.json | 0 .../blocks/oak_1.json | 0 .../blocks/oak_2.json | 0 .../blocks/oak_4.json | 0 .../blocks/simple_compacting_drawer.json | 0 .../blocks/spruce_1.json | 0 .../blocks/spruce_2.json | 0 .../blocks/spruce_4.json | 0 .../blocks/storage_controller.json | 0 .../blocks/warped_1.json | 0 .../blocks/warped_2.json | 0 .../blocks/warped_4.json | 0 .../{recipes => recipe}/acacia_1.json | 5 +- .../{recipes => recipe}/acacia_2.json | 4 +- .../{recipes => recipe}/acacia_4.json | 4 +- .../{recipes => recipe}/armory_cabinet.json | 7 +- .../{recipes => recipe}/birch_1.json | 5 +- .../{recipes => recipe}/birch_2.json | 4 +- .../{recipes => recipe}/birch_4.json | 4 +- .../{recipes => recipe}/cherry_1.json | 5 +- .../{recipes => recipe}/cherry_2.json | 4 +- .../{recipes => recipe}/cherry_4.json | 4 +- .../collector_upgrade.json | 7 +- .../compacting_drawer.json | 5 +- .../compacting_framed_drawer.json | 5 +- .../configuration_tool.json | 5 +- .../controller_extension.json | 7 +- .../{recipes => recipe}/copper_upgrade.json | 5 +- .../{recipes => recipe}/crimson_1.json | 5 +- .../{recipes => recipe}/crimson_2.json | 4 +- .../{recipes => recipe}/crimson_4.json | 4 +- .../{recipes => recipe}/dark_oak_1.json | 5 +- .../{recipes => recipe}/dark_oak_2.json | 4 +- .../{recipes => recipe}/dark_oak_4.json | 4 +- .../{recipes => recipe}/diamond_upgrade.json | 9 +- .../{recipes => recipe}/ender_drawer.json | 5 +- .../{recipes => recipe}/fluid_1.json | 3 +- .../{recipes => recipe}/fluid_2.json | 2 +- .../{recipes => recipe}/fluid_4.json | 2 +- .../{recipes => recipe}/framed_1.json | 5 +- .../{recipes => recipe}/framed_2.json | 4 +- .../{recipes => recipe}/framed_4.json | 4 +- .../framed_controller_extension.json | 5 +- .../framed_simple_compacting_drawer.json | 5 +- .../framed_storage_controller.json | 5 +- .../{recipes => recipe}/gold_upgrade.json | 9 +- .../{recipes => recipe}/iron_downgrade.json | 5 +- .../{recipes => recipe}/jungle_1.json | 5 +- .../{recipes => recipe}/jungle_2.json | 4 +- .../{recipes => recipe}/jungle_4.json | 4 +- .../{recipes => recipe}/linking_tool.json | 5 +- .../{recipes => recipe}/mangrove_1.json | 5 +- .../{recipes => recipe}/mangrove_2.json | 4 +- .../{recipes => recipe}/mangrove_4.json | 4 +- .../netherite_upgrade.json | 3 +- .../{recipes => recipe}/oak_1.json | 5 +- .../{recipes => recipe}/oak_2.json | 4 +- .../{recipes => recipe}/oak_4.json | 4 +- .../{recipes => recipe}/puller_upgrade.json | 7 +- .../{recipes => recipe}/pusher_upgrade.json | 7 +- .../{recipes => recipe}/redstone_upgrade.json | 3 +- .../simple_compacting_drawer.json | 5 +- .../{recipes => recipe}/spruce_1.json | 5 +- .../{recipes => recipe}/spruce_2.json | 4 +- .../{recipes => recipe}/spruce_4.json | 4 +- .../storage_controller.json | 7 +- .../{recipes => recipe}/void_upgrade.json | 5 +- .../{recipes => recipe}/warped_1.json | 5 +- .../{recipes => recipe}/warped_2.json | 4 +- .../{recipes => recipe}/warped_4.json | 4 +- .../tags/{items => item}/drawer.json | 24 +- .../compacting/amethyst.json | 5 +- .../compacting/glowstone.json | 5 +- .../functionalstorage/compacting/ice.json | 5 +- .../functionalstorage/compacting/melon.json | 5 +- .../compacting/packed_ice.json | 5 +- .../functionalstorage/compacting/quartz.json | 5 +- .../tags/{blocks => block}/mineable/axe.json | 24 +- .../{blocks => block}/mineable/pickaxe.json | 0 .../functionalstorage/FunctionalStorage.java | 19 +- 182 files changed, 450 insertions(+), 491 deletions(-) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/acacia_1.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/acacia_2.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/acacia_4.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/armory_cabinet.json (95%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/birch_1.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/birch_2.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/birch_4.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/cherry_1.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/cherry_2.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/cherry_4.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/collector_upgrade.json (95%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/compacting_drawer.json (90%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/compacting_framed_drawer.json (90%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/configuration_tool.json (90%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/controller_extension.json (95%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/copper_upgrade.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/crimson_1.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/crimson_2.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/crimson_4.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/dark_oak_1.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/dark_oak_2.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/dark_oak_4.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/diamond_upgrade.json (94%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/ender_drawer.json (94%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/fluid_1.json (94%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/fluid_2.json (94%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/fluid_4.json (94%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/framed_1.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/framed_2.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/framed_4.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/framed_controller_extension.json (90%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/framed_simple_compacting_drawer.json (90%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/framed_storage_controller.json (90%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/gold_upgrade.json (94%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/iron_downgrade.json (94%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/jungle_1.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/jungle_2.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/jungle_4.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/linking_tool.json (90%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/mangrove_1.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/mangrove_2.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/mangrove_4.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/netherite_upgrade.json (87%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/oak_1.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/oak_2.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/oak_4.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/puller_upgrade.json (95%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/pusher_upgrade.json (95%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/redstone_upgrade.json (90%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/simple_compacting_drawer.json (91%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/spruce_1.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/spruce_2.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/spruce_4.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/storage_controller.json (95%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/void_upgrade.json (94%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/warped_1.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/warped_2.json (89%) rename src/generated/resources/data/functionalstorage/{advancements => advancement}/recipes/misc/warped_4.json (89%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/acacia_1.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/acacia_2.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/acacia_4.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/armory_cabinet.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/birch_1.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/birch_2.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/birch_4.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/cherry_1.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/cherry_2.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/cherry_4.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/compacting_drawer.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/compacting_framed_drawer.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/controller_extension.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/crimson_1.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/crimson_2.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/crimson_4.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/dark_oak_1.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/dark_oak_2.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/dark_oak_4.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/ender_drawer.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/fluid_1.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/fluid_2.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/fluid_4.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/framed_1.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/framed_2.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/framed_4.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/framed_controller_extension.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/framed_simple_compacting_drawer.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/framed_storage_controller.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/jungle_1.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/jungle_2.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/jungle_4.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/mangrove_1.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/mangrove_2.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/mangrove_4.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/oak_1.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/oak_2.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/oak_4.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/simple_compacting_drawer.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/spruce_1.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/spruce_2.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/spruce_4.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/storage_controller.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/warped_1.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/warped_2.json (100%) rename src/generated/resources/data/functionalstorage/{loot_tables => loot_table}/blocks/warped_4.json (100%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/acacia_1.json (80%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/acacia_2.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/acacia_4.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/armory_cabinet.json (78%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/birch_1.json (80%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/birch_2.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/birch_4.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/cherry_1.json (80%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/cherry_2.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/cherry_4.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/collector_upgrade.json (78%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/compacting_drawer.json (83%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/compacting_framed_drawer.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/configuration_tool.json (83%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/controller_extension.json (76%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/copper_upgrade.json (83%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/crimson_1.json (80%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/crimson_2.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/crimson_4.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/dark_oak_1.json (80%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/dark_oak_2.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/dark_oak_4.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/diamond_upgrade.json (71%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/ender_drawer.json (81%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/fluid_1.json (87%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/fluid_2.json (90%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/fluid_4.json (90%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/framed_1.json (80%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/framed_2.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/framed_4.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/framed_controller_extension.json (80%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/framed_simple_compacting_drawer.json (81%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/framed_storage_controller.json (81%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/gold_upgrade.json (71%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/iron_downgrade.json (79%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/jungle_1.json (80%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/jungle_2.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/jungle_4.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/linking_tool.json (83%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/mangrove_1.json (80%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/mangrove_2.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/mangrove_4.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/netherite_upgrade.json (80%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/oak_1.json (80%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/oak_2.json (83%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/oak_4.json (83%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/puller_upgrade.json (78%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/pusher_upgrade.json (78%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/redstone_upgrade.json (88%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/simple_compacting_drawer.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/spruce_1.json (80%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/spruce_2.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/spruce_4.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/storage_controller.json (77%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/void_upgrade.json (80%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/warped_1.json (80%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/warped_2.json (82%) rename src/generated/resources/data/functionalstorage/{recipes => recipe}/warped_4.json (82%) rename src/generated/resources/data/functionalstorage/tags/{items => item}/drawer.json (94%) rename src/generated/resources/data/minecraft/{recipes => recipe}/functionalstorage/compacting/amethyst.json (56%) rename src/generated/resources/data/minecraft/{recipes => recipe}/functionalstorage/compacting/glowstone.json (57%) rename src/generated/resources/data/minecraft/{recipes => recipe}/functionalstorage/compacting/ice.json (60%) rename src/generated/resources/data/minecraft/{recipes => recipe}/functionalstorage/compacting/melon.json (59%) rename src/generated/resources/data/minecraft/{recipes => recipe}/functionalstorage/compacting/packed_ice.json (59%) rename src/generated/resources/data/minecraft/{recipes => recipe}/functionalstorage/compacting/quartz.json (59%) rename src/generated/resources/data/minecraft/tags/{blocks => block}/mineable/axe.json (94%) rename src/generated/resources/data/minecraft/tags/{blocks => block}/mineable/pickaxe.json (100%) diff --git a/build.gradle b/build.gradle index c94eb667..4e1f5cf3 100644 --- a/build.gradle +++ b/build.gradle @@ -50,6 +50,10 @@ neoForge { server { server() } + data { + data() + programArguments.addAll '--mod', 'functionalstorage', '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath() + } } mods { diff --git a/src/generated/resources/.cache/15b6275091e1d61ba43a63172e99581ffd5ac41e b/src/generated/resources/.cache/15b6275091e1d61ba43a63172e99581ffd5ac41e index 7b62f64a..743a2526 100644 --- a/src/generated/resources/.cache/15b6275091e1d61ba43a63172e99581ffd5ac41e +++ b/src/generated/resources/.cache/15b6275091e1d61ba43a63172e99581ffd5ac41e @@ -1,4 +1,4 @@ -// 1.20.4 2024-04-07T00:54:11.3462225 Item Models: functionalstorage +// 1.21 2024-07-02T16:34:01.4609354 Item Models: functionalstorage 05946c7f40bf42b62f86e70d637524afd795cad2 assets/functionalstorage/models/item/acacia_1.json 9e4990cfbaa0ce0612d18b497169377fe24ee704 assets/functionalstorage/models/item/acacia_2.json 648c9170a8c4c6068d0fdcf1ff7f6bf387902f3c assets/functionalstorage/models/item/acacia_4.json diff --git a/src/generated/resources/.cache/361def3a0b0e87157892b021be1ddec9d13d5e52 b/src/generated/resources/.cache/361def3a0b0e87157892b021be1ddec9d13d5e52 index 0f9b7f7f..9ad75acc 100644 --- a/src/generated/resources/.cache/361def3a0b0e87157892b021be1ddec9d13d5e52 +++ b/src/generated/resources/.cache/361def3a0b0e87157892b021be1ddec9d13d5e52 @@ -1,2 +1,2 @@ -// 1.20.4 2024-04-08T18:04:01.0611315 Languages: en_us for mod: functionalstorage +// 1.21 2024-07-02T16:34:01.4489282 Languages: en_us for mod: functionalstorage b19790b3d072a6c205ea1c45096b36437dde4fbf assets/functionalstorage/lang/en_us.json diff --git a/src/generated/resources/.cache/424df6c0265e09414e636289f261813cd93f4aa2 b/src/generated/resources/.cache/424df6c0265e09414e636289f261813cd93f4aa2 index 7b3364a5..cf32d61b 100644 --- a/src/generated/resources/.cache/424df6c0265e09414e636289f261813cd93f4aa2 +++ b/src/generated/resources/.cache/424df6c0265e09414e636289f261813cd93f4aa2 @@ -1,4 +1,4 @@ -// 1.20.4 2024-04-07T00:54:11.3102053 Block States: functionalstorage +// 1.21 2024-07-02T16:34:01.4459294 Block States: functionalstorage b1f76f1b67016350af532beb6de3ffdc4d9a07be assets/functionalstorage/blockstates/acacia_1.json a4e462d9775fd4aefa673952d4d69f9d90b2e823 assets/functionalstorage/blockstates/acacia_2.json ecd77b58fb3d746ab8e2109adf686ea01cf5d96a assets/functionalstorage/blockstates/acacia_4.json diff --git a/src/generated/resources/.cache/58b100d11464fc6de03e6a16617c8d741d90a73a b/src/generated/resources/.cache/58b100d11464fc6de03e6a16617c8d741d90a73a index e4096339..3e7c028c 100644 --- a/src/generated/resources/.cache/58b100d11464fc6de03e6a16617c8d741d90a73a +++ b/src/generated/resources/.cache/58b100d11464fc6de03e6a16617c8d741d90a73a @@ -1,2 +1,2 @@ -// 1.20.4 2024-04-14T22:20:37.4521204 Functional Storage Item Tags -4d333a46912a79be0238da4591cc570d83f3577f data/functionalstorage/tags/items/drawer.json +// 1.21 2024-07-02T16:34:01.4539336 Functional Storage Item Tags +8b034c911e8c686ec4be3958ef0037f905d31b31 data/functionalstorage/tags/item/drawer.json diff --git a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d index 9403e23e..17668640 100644 --- a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d +++ b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d @@ -1,47 +1,47 @@ -// 1.20.4 2024-04-07T00:54:11.3242122 Loot Tables -d78cf8442a9d36bff4abc1107f1217f4a4418c8e data/functionalstorage/loot_tables/blocks/acacia_1.json -47f3265cef09634f6f2d136757304488a7cf1c75 data/functionalstorage/loot_tables/blocks/acacia_2.json -769595131ba5623e061d1fada4a22af5fd00cb69 data/functionalstorage/loot_tables/blocks/acacia_4.json -6c1ab49efb00472b3dbc5930626f2b492d1331dd data/functionalstorage/loot_tables/blocks/armory_cabinet.json -4e99e8cc8aa95dc1bc422c198410deae5d205ce4 data/functionalstorage/loot_tables/blocks/birch_1.json -a4f6db831ddd292c1b19d3176a5256b36a8c51a5 data/functionalstorage/loot_tables/blocks/birch_2.json -4899a11badc269283c5946f3d64d020153022d00 data/functionalstorage/loot_tables/blocks/birch_4.json -c7221cb4ac7a7e125178c890e3c8b919d9cce062 data/functionalstorage/loot_tables/blocks/cherry_1.json -fbb515425f7c3aa6f0bab8057bed31e3d7c1172b data/functionalstorage/loot_tables/blocks/cherry_2.json -b0b462916d144cb042acb82dff15f7c161f42bbd data/functionalstorage/loot_tables/blocks/cherry_4.json -e1a426e256e4031a81b983cc537c13b7c4c5c9eb data/functionalstorage/loot_tables/blocks/compacting_drawer.json -5038237c92e4fa2a4fa189f5181040b814213c94 data/functionalstorage/loot_tables/blocks/compacting_framed_drawer.json -a4c2de7cfc3a741dc3a9a8d16399349facca783c data/functionalstorage/loot_tables/blocks/controller_extension.json -e7030950636e53d3b548717566b5d609efd7b8af data/functionalstorage/loot_tables/blocks/crimson_1.json -cdef2c2deb0a26cf9b7b4abaa885b1040510504f data/functionalstorage/loot_tables/blocks/crimson_2.json -1c17ca71dd7de014ce48b007487861b29bf9ffcf data/functionalstorage/loot_tables/blocks/crimson_4.json -e5e3c2e1f3f503ca217ab4379abc3ac500c22fb2 data/functionalstorage/loot_tables/blocks/dark_oak_1.json -984b3ed4a10f2f555796e8e6a84d80a32a7e3001 data/functionalstorage/loot_tables/blocks/dark_oak_2.json -4cd7a0df745215f8fb8464b8689fccbad5bbe85f data/functionalstorage/loot_tables/blocks/dark_oak_4.json -e78f6a5085f22199a5f7e9cf6f7fae5cd6e28c72 data/functionalstorage/loot_tables/blocks/ender_drawer.json -13a7ffa4f1eb9e6b7e28a55a00a0e185c8bd9d94 data/functionalstorage/loot_tables/blocks/fluid_1.json -70da9de9d22aad27439d4eec83e5458da150cd3f data/functionalstorage/loot_tables/blocks/fluid_2.json -8a7887176d5d53872f37c4266ffdc7f2447cd8df data/functionalstorage/loot_tables/blocks/fluid_4.json -0f1467ca25f52412c37908ada40610f8e6a3068a data/functionalstorage/loot_tables/blocks/framed_1.json -799b3dc4a002bbf0ac20a3c8b1827cf42673affb data/functionalstorage/loot_tables/blocks/framed_2.json -2faf0c684a20da3cd731b56685903ca1724f67d7 data/functionalstorage/loot_tables/blocks/framed_4.json -a07bc575d23810ae47f9f157a164302ee728c5f2 data/functionalstorage/loot_tables/blocks/framed_controller_extension.json -cf1bb3214330e19fee50cbc3a71f7704751239d4 data/functionalstorage/loot_tables/blocks/framed_simple_compacting_drawer.json -41acd837bd91f3e02c3ae90b4f632c6b33d8d302 data/functionalstorage/loot_tables/blocks/framed_storage_controller.json -bdef97337c16c1ad48d8a807785621750eace79f data/functionalstorage/loot_tables/blocks/jungle_1.json -5fe236d5c8a7452b050a46afde7c9e6afbd1fc3f data/functionalstorage/loot_tables/blocks/jungle_2.json -663e96081446e9ab71a3485730566d0e34499d46 data/functionalstorage/loot_tables/blocks/jungle_4.json -e31e7f3925fe807816d0aafa5239acd886fd0f0f data/functionalstorage/loot_tables/blocks/mangrove_1.json -df5485a539d62c02b1719592db6c1a563feac255 data/functionalstorage/loot_tables/blocks/mangrove_2.json -38b633e9c9010a14c5804e229298fbe8dd051ff9 data/functionalstorage/loot_tables/blocks/mangrove_4.json -c831cf9282597c417d89244b46765236e74ab034 data/functionalstorage/loot_tables/blocks/oak_1.json -a298d5e03587a92faea300414b114c1790e5d6a6 data/functionalstorage/loot_tables/blocks/oak_2.json -c75ea89f3ba53b515c3e806c88593e20c9a1fa6d data/functionalstorage/loot_tables/blocks/oak_4.json -7388fb11858c77a7e7245cf880be8a79b9d8e815 data/functionalstorage/loot_tables/blocks/simple_compacting_drawer.json -b6c2d6617a8068fda74e545a9a33b2904f6e68a8 data/functionalstorage/loot_tables/blocks/spruce_1.json -84b342defa8a36fd4669b4df2bb9a78f579a3c65 data/functionalstorage/loot_tables/blocks/spruce_2.json -8f66edc8e160b3585bbb456e5561396208315e31 data/functionalstorage/loot_tables/blocks/spruce_4.json -1ff2899a3a1dd9e1bd4fbb2703b3194ae650bb09 data/functionalstorage/loot_tables/blocks/storage_controller.json -da8063c665fce09310b4ef6101b96b88c27dc9b1 data/functionalstorage/loot_tables/blocks/warped_1.json -010107c7ce5d20fb3b210ed6aca4ad64af652bfb data/functionalstorage/loot_tables/blocks/warped_2.json -2dbae762e58071d439419aae8db8486fd906678f data/functionalstorage/loot_tables/blocks/warped_4.json +// 1.21 2024-07-02T16:34:01.4519399 Loot Tables +d78cf8442a9d36bff4abc1107f1217f4a4418c8e data/functionalstorage/loot_table/blocks/acacia_1.json +47f3265cef09634f6f2d136757304488a7cf1c75 data/functionalstorage/loot_table/blocks/acacia_2.json +769595131ba5623e061d1fada4a22af5fd00cb69 data/functionalstorage/loot_table/blocks/acacia_4.json +6c1ab49efb00472b3dbc5930626f2b492d1331dd data/functionalstorage/loot_table/blocks/armory_cabinet.json +4e99e8cc8aa95dc1bc422c198410deae5d205ce4 data/functionalstorage/loot_table/blocks/birch_1.json +a4f6db831ddd292c1b19d3176a5256b36a8c51a5 data/functionalstorage/loot_table/blocks/birch_2.json +4899a11badc269283c5946f3d64d020153022d00 data/functionalstorage/loot_table/blocks/birch_4.json +c7221cb4ac7a7e125178c890e3c8b919d9cce062 data/functionalstorage/loot_table/blocks/cherry_1.json +fbb515425f7c3aa6f0bab8057bed31e3d7c1172b data/functionalstorage/loot_table/blocks/cherry_2.json +b0b462916d144cb042acb82dff15f7c161f42bbd data/functionalstorage/loot_table/blocks/cherry_4.json +e1a426e256e4031a81b983cc537c13b7c4c5c9eb data/functionalstorage/loot_table/blocks/compacting_drawer.json +5038237c92e4fa2a4fa189f5181040b814213c94 data/functionalstorage/loot_table/blocks/compacting_framed_drawer.json +a4c2de7cfc3a741dc3a9a8d16399349facca783c data/functionalstorage/loot_table/blocks/controller_extension.json +e7030950636e53d3b548717566b5d609efd7b8af data/functionalstorage/loot_table/blocks/crimson_1.json +cdef2c2deb0a26cf9b7b4abaa885b1040510504f data/functionalstorage/loot_table/blocks/crimson_2.json +1c17ca71dd7de014ce48b007487861b29bf9ffcf data/functionalstorage/loot_table/blocks/crimson_4.json +e5e3c2e1f3f503ca217ab4379abc3ac500c22fb2 data/functionalstorage/loot_table/blocks/dark_oak_1.json +984b3ed4a10f2f555796e8e6a84d80a32a7e3001 data/functionalstorage/loot_table/blocks/dark_oak_2.json +4cd7a0df745215f8fb8464b8689fccbad5bbe85f data/functionalstorage/loot_table/blocks/dark_oak_4.json +e78f6a5085f22199a5f7e9cf6f7fae5cd6e28c72 data/functionalstorage/loot_table/blocks/ender_drawer.json +13a7ffa4f1eb9e6b7e28a55a00a0e185c8bd9d94 data/functionalstorage/loot_table/blocks/fluid_1.json +70da9de9d22aad27439d4eec83e5458da150cd3f data/functionalstorage/loot_table/blocks/fluid_2.json +8a7887176d5d53872f37c4266ffdc7f2447cd8df data/functionalstorage/loot_table/blocks/fluid_4.json +0f1467ca25f52412c37908ada40610f8e6a3068a data/functionalstorage/loot_table/blocks/framed_1.json +799b3dc4a002bbf0ac20a3c8b1827cf42673affb data/functionalstorage/loot_table/blocks/framed_2.json +2faf0c684a20da3cd731b56685903ca1724f67d7 data/functionalstorage/loot_table/blocks/framed_4.json +a07bc575d23810ae47f9f157a164302ee728c5f2 data/functionalstorage/loot_table/blocks/framed_controller_extension.json +cf1bb3214330e19fee50cbc3a71f7704751239d4 data/functionalstorage/loot_table/blocks/framed_simple_compacting_drawer.json +41acd837bd91f3e02c3ae90b4f632c6b33d8d302 data/functionalstorage/loot_table/blocks/framed_storage_controller.json +bdef97337c16c1ad48d8a807785621750eace79f data/functionalstorage/loot_table/blocks/jungle_1.json +5fe236d5c8a7452b050a46afde7c9e6afbd1fc3f data/functionalstorage/loot_table/blocks/jungle_2.json +663e96081446e9ab71a3485730566d0e34499d46 data/functionalstorage/loot_table/blocks/jungle_4.json +e31e7f3925fe807816d0aafa5239acd886fd0f0f data/functionalstorage/loot_table/blocks/mangrove_1.json +df5485a539d62c02b1719592db6c1a563feac255 data/functionalstorage/loot_table/blocks/mangrove_2.json +38b633e9c9010a14c5804e229298fbe8dd051ff9 data/functionalstorage/loot_table/blocks/mangrove_4.json +c831cf9282597c417d89244b46765236e74ab034 data/functionalstorage/loot_table/blocks/oak_1.json +a298d5e03587a92faea300414b114c1790e5d6a6 data/functionalstorage/loot_table/blocks/oak_2.json +c75ea89f3ba53b515c3e806c88593e20c9a1fa6d data/functionalstorage/loot_table/blocks/oak_4.json +7388fb11858c77a7e7245cf880be8a79b9d8e815 data/functionalstorage/loot_table/blocks/simple_compacting_drawer.json +b6c2d6617a8068fda74e545a9a33b2904f6e68a8 data/functionalstorage/loot_table/blocks/spruce_1.json +84b342defa8a36fd4669b4df2bb9a78f579a3c65 data/functionalstorage/loot_table/blocks/spruce_2.json +8f66edc8e160b3585bbb456e5561396208315e31 data/functionalstorage/loot_table/blocks/spruce_4.json +1ff2899a3a1dd9e1bd4fbb2703b3194ae650bb09 data/functionalstorage/loot_table/blocks/storage_controller.json +da8063c665fce09310b4ef6101b96b88c27dc9b1 data/functionalstorage/loot_table/blocks/warped_1.json +010107c7ce5d20fb3b210ed6aca4ad64af652bfb data/functionalstorage/loot_table/blocks/warped_2.json +2dbae762e58071d439419aae8db8486fd906678f data/functionalstorage/loot_table/blocks/warped_4.json diff --git a/src/generated/resources/.cache/7b7965c95f0313555fafc7c653e689cdb94b8fca b/src/generated/resources/.cache/7b7965c95f0313555fafc7c653e689cdb94b8fca index 4575dab6..436ceb14 100644 --- a/src/generated/resources/.cache/7b7965c95f0313555fafc7c653e689cdb94b8fca +++ b/src/generated/resources/.cache/7b7965c95f0313555fafc7c653e689cdb94b8fca @@ -1 +1 @@ -// 1.20.4 2024-04-07T00:54:11.3432297 Block Model Item Generator (functionalstorage) +// 1.21 2024-07-02T16:34:01.4589334 Block Model Item Generator (functionalstorage) diff --git a/src/generated/resources/.cache/9b4b2fe28e6a198629709c0c8772cb00a8b15d4a b/src/generated/resources/.cache/9b4b2fe28e6a198629709c0c8772cb00a8b15d4a index f42968c7..0592ab2d 100644 --- a/src/generated/resources/.cache/9b4b2fe28e6a198629709c0c8772cb00a8b15d4a +++ b/src/generated/resources/.cache/9b4b2fe28e6a198629709c0c8772cb00a8b15d4a @@ -1,3 +1,3 @@ -// 1.20.4 2024-04-14T22:20:37.467108 Tags for minecraft:block mod id functionalstorage -4d333a46912a79be0238da4591cc570d83f3577f data/minecraft/tags/blocks/mineable/axe.json -4b6fc75faca16170a17220f0e301b16866f4bc5c data/minecraft/tags/blocks/mineable/pickaxe.json +// 1.21 2024-07-02T16:34:01.4579286 Tags for minecraft:block mod id functionalstorage +8b034c911e8c686ec4be3958ef0037f905d31b31 data/minecraft/tags/block/mineable/axe.json +4b6fc75faca16170a17220f0e301b16866f4bc5c data/minecraft/tags/block/mineable/pickaxe.json diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index 72832122..68a24120 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,123 +1,123 @@ -// 1.20.4 2024-04-14T22:20:37.4581111 Recipes -72528341b7f8317bcd4b46b536d3eea663345706 data/functionalstorage/advancements/recipes/misc/acacia_1.json -b0e04e073c0a2d4f3398b977678a581b581a6e99 data/functionalstorage/advancements/recipes/misc/acacia_2.json -53e29bff9cf54d0d489a66ad711b40f7d6c1d4f5 data/functionalstorage/advancements/recipes/misc/acacia_4.json -2a7334decaf62bff448c6c115330add1976bf2e2 data/functionalstorage/advancements/recipes/misc/armory_cabinet.json -8f67f6e972e051d893c3e37c45a6c306807f0088 data/functionalstorage/advancements/recipes/misc/birch_1.json -da1abea18171c7607f018dfc15571ef1282c029a data/functionalstorage/advancements/recipes/misc/birch_2.json -29212901bf63a0c7fe7ed6f21f4448a56db240aa data/functionalstorage/advancements/recipes/misc/birch_4.json -89beef3273716ec2b728b73ebad81900fb247ced data/functionalstorage/advancements/recipes/misc/cherry_1.json -5f6c76fcd6de4d8e2e5521a1ae918a9ebc1d07cd data/functionalstorage/advancements/recipes/misc/cherry_2.json -45f254412a67c8d66d0744ede97d9620e3245b72 data/functionalstorage/advancements/recipes/misc/cherry_4.json -8d2bb5a10c9611e2bbfb85c8806940669c6e37b1 data/functionalstorage/advancements/recipes/misc/collector_upgrade.json -3e24d840d865c134762187738f62f36e6ece3979 data/functionalstorage/advancements/recipes/misc/compacting_drawer.json -662b5411d4360261bd5e9ecdb95f6bf1f602ff43 data/functionalstorage/advancements/recipes/misc/compacting_framed_drawer.json -01187729211d5160962cfa7d8cb71325f24dd7c4 data/functionalstorage/advancements/recipes/misc/configuration_tool.json -76dc7498bf4a1b3bf773b925797cddc5d9dbac64 data/functionalstorage/advancements/recipes/misc/controller_extension.json -2c11bf8a787b29646e54b7ec9219472aee19a395 data/functionalstorage/advancements/recipes/misc/copper_upgrade.json -a15b34eb48ca5f2352b383f4118636ab7ff5d92b data/functionalstorage/advancements/recipes/misc/crimson_1.json -9119a6d51628db1593965b3c852b4001f1bcae5e data/functionalstorage/advancements/recipes/misc/crimson_2.json -1d7d23180458082a0068aba086bbd11ad8da7da0 data/functionalstorage/advancements/recipes/misc/crimson_4.json -3505933b96df3f9a7c8b66ceba9c06d608a2c3f8 data/functionalstorage/advancements/recipes/misc/dark_oak_1.json -41e2153173dbb1a7bd1f2762aa81d1942f6051de data/functionalstorage/advancements/recipes/misc/dark_oak_2.json -3653d9f71579562eabe086f75fc2d76020661a66 data/functionalstorage/advancements/recipes/misc/dark_oak_4.json -fc20d9f9c332f3b240865b85006676171da8370d data/functionalstorage/advancements/recipes/misc/diamond_upgrade.json -bff17300ad3fe2ab48158a27baa332e0abfbe355 data/functionalstorage/advancements/recipes/misc/ender_drawer.json -ae9c1d5ae29b1ff206162f4f2842ef7838c0ec54 data/functionalstorage/advancements/recipes/misc/fluid_1.json -efacdded2485f2b481af5a086e339132a9c651e0 data/functionalstorage/advancements/recipes/misc/fluid_2.json -737736f0450add8ac042ef629f36816547e8fabf data/functionalstorage/advancements/recipes/misc/fluid_4.json -15f0c9409a5f784ad795f2d279af40cd708d0fd1 data/functionalstorage/advancements/recipes/misc/framed_1.json -f06238ecabe94704bca8ee7f4e2995ac8be6a01b data/functionalstorage/advancements/recipes/misc/framed_2.json -5c7483913a6efc86baafa592ff726c42f0939f9d data/functionalstorage/advancements/recipes/misc/framed_4.json -1cd42abd49da5dd5c9b498c8bbba6a1ee0ecb7c7 data/functionalstorage/advancements/recipes/misc/framed_controller_extension.json -13dc59583bb9f10d6a10dfd39ce3aec6fc1d9f90 data/functionalstorage/advancements/recipes/misc/framed_simple_compacting_drawer.json -09ecfaca636f83f254f1ccb4c56bdbdb1502a7d1 data/functionalstorage/advancements/recipes/misc/framed_storage_controller.json -f73ac90d0c48b6c4babec29b0e0ec3e3fa6dfbe3 data/functionalstorage/advancements/recipes/misc/gold_upgrade.json -3c79a5c491fad66512cd57d219187547c7b15e1f data/functionalstorage/advancements/recipes/misc/iron_downgrade.json -36ec68ac31b4db1b57515ee1648c720eb854abe8 data/functionalstorage/advancements/recipes/misc/jungle_1.json -f8b6f36370e163305531f81b5fcd1d8dea61efdf data/functionalstorage/advancements/recipes/misc/jungle_2.json -80de247b237795914fdd2155a498592612986818 data/functionalstorage/advancements/recipes/misc/jungle_4.json -1e6dd147cbf262e5309e03a8c472cd8d24e683db data/functionalstorage/advancements/recipes/misc/linking_tool.json -8a64fd833efca6509aca8c3fe07b6d063e034f8c data/functionalstorage/advancements/recipes/misc/mangrove_1.json -edaf84d35549e5599c5f06dc5e4df83e89271f15 data/functionalstorage/advancements/recipes/misc/mangrove_2.json -00e08eec2a68f76cb2f2dce583bc42d4126d872c data/functionalstorage/advancements/recipes/misc/mangrove_4.json -d9417abf98d878f51c9d3c6fd11ac9173406204c data/functionalstorage/advancements/recipes/misc/netherite_upgrade.json -a29201b45c7a89c8813d32002df598b5b6de427a data/functionalstorage/advancements/recipes/misc/oak_1.json -5714424f64e49b013e3b62a48acb03e06350d1b3 data/functionalstorage/advancements/recipes/misc/oak_2.json -69a5e037a143f31c15c7d5f7a68f76290d9652eb data/functionalstorage/advancements/recipes/misc/oak_4.json -90c46bfee588b98d53147c2e2052145eac5283fb data/functionalstorage/advancements/recipes/misc/puller_upgrade.json -f244341504e8eacb43f0394c5394cd3936810205 data/functionalstorage/advancements/recipes/misc/pusher_upgrade.json -9b4211a8a66f2ec076cc1f868963a9d275eefc7b data/functionalstorage/advancements/recipes/misc/redstone_upgrade.json -c49563600aafeae88ec9a8c282d295b80f354f44 data/functionalstorage/advancements/recipes/misc/simple_compacting_drawer.json -23b9b83d4b557fa3f14bc670b274f2846c002f9b data/functionalstorage/advancements/recipes/misc/spruce_1.json -1a8feaf3bb60a4a1c9ab727d99e551abbe03ec17 data/functionalstorage/advancements/recipes/misc/spruce_2.json -138f509e6bf2ba1829bd8fd4a2153f10d3d21e25 data/functionalstorage/advancements/recipes/misc/spruce_4.json -1d003afdafcdffad75b7baa603244543875d0f2e data/functionalstorage/advancements/recipes/misc/storage_controller.json -a7a1b82e23a41741322848067aad65b75454ad15 data/functionalstorage/advancements/recipes/misc/void_upgrade.json -ecbc7279e43455b49833bbbc42e5d25dd9bd3543 data/functionalstorage/advancements/recipes/misc/warped_1.json -5307459f80390f94cf2a8eabc24bc32e1e07feb9 data/functionalstorage/advancements/recipes/misc/warped_2.json -e51abea248741e4b5b077a557f263b5a87e2718f data/functionalstorage/advancements/recipes/misc/warped_4.json -22ce4e567c90b52264edfc8b9fda64fa14285845 data/functionalstorage/recipes/acacia_1.json -2a89941c5106fa4fdc38607f74738c3f8a3fc062 data/functionalstorage/recipes/acacia_2.json -64092ca74d93e8866a12d4a45f6b6e55c877f851 data/functionalstorage/recipes/acacia_4.json -ea0953692767a8d1379a3d03bfc821db63ac73ee data/functionalstorage/recipes/armory_cabinet.json -a5f273badce95bc72c6f89c9e3c294628cc853cf data/functionalstorage/recipes/birch_1.json -83c1b6dfaff3611b211b55b1637fd0f9c2e2247c data/functionalstorage/recipes/birch_2.json -f3dd17063422fd6d69d844dffc5e80782ee72787 data/functionalstorage/recipes/birch_4.json -34f066e2c59572edfa88b9ee4ffef83f2c8bf502 data/functionalstorage/recipes/cherry_1.json -6614914bb71f64e5c547533e0211207b7cebf0eb data/functionalstorage/recipes/cherry_2.json -2b33273ed754dd8319d8495e88e2f9c8c260e72c data/functionalstorage/recipes/cherry_4.json -e1942ad5a1a83c8b20c386829216eaa2a6cee19f data/functionalstorage/recipes/collector_upgrade.json -1947695f2c428e8199326909db58b787c65a4a7b data/functionalstorage/recipes/compacting_drawer.json -342862de5e3b39ed26feeb11a18833076ce1be36 data/functionalstorage/recipes/compacting_framed_drawer.json -8773914553d57d91061d489b1c598085d0de483e data/functionalstorage/recipes/configuration_tool.json -7a599b829e8eb8d56601add0cd655073a326cddb data/functionalstorage/recipes/controller_extension.json -c789d6af57dd0ccaf216c49ee391718e29e25379 data/functionalstorage/recipes/copper_upgrade.json -bc5524de6ecbd953b197c414d9b63b096dd7c48e data/functionalstorage/recipes/crimson_1.json -a2a88219643657dfaec7bbaa3f7d9e1847d9ebb7 data/functionalstorage/recipes/crimson_2.json -aa6cc89aea0929522092b6403a5ff8455c0b957c data/functionalstorage/recipes/crimson_4.json -16126610451714756f2854544604684b366d01f9 data/functionalstorage/recipes/dark_oak_1.json -644c43a6427c955e7217e237d0738d1847b2a4ba data/functionalstorage/recipes/dark_oak_2.json -0a12df6c07e9912cdac70380de5f0f1f1b9b5815 data/functionalstorage/recipes/dark_oak_4.json -6c46a4b98a21b662e92e6ff1082acd5ea64d37b4 data/functionalstorage/recipes/diamond_upgrade.json -a1705b747a0834cf91bdb35163d0ea4d50e99839 data/functionalstorage/recipes/ender_drawer.json -1dce91d3b325b06b67ecb9633bd55e30583fc04f data/functionalstorage/recipes/fluid_1.json -4c843ba14f4b041de50249e6f07d4b41f2fccf0f data/functionalstorage/recipes/fluid_2.json -e5c96130c9e6c372d1434768d6967a255085355f data/functionalstorage/recipes/fluid_4.json -12ad9980f708d010aa9325fe06b225da5b46c0cb data/functionalstorage/recipes/framed_1.json -0363e14a8e2a472ef0a90750da4576653ca4cb76 data/functionalstorage/recipes/framed_2.json -e531379d5cd5a1823b896f5278d89f2cd9750222 data/functionalstorage/recipes/framed_4.json -e639ca500bf44e34936cdb10f48878c9e1fd998c data/functionalstorage/recipes/framed_controller_extension.json -d5df59688f8a7df3575ff8481f6b9d2d4d472227 data/functionalstorage/recipes/framed_simple_compacting_drawer.json -c353224254e7923f8e66adaf17f4df874d1dcbdf data/functionalstorage/recipes/framed_storage_controller.json -255c3bdc5015be03d75a1a70e42b50e85c5a1567 data/functionalstorage/recipes/gold_upgrade.json -702769474f6595cebaf3d4517d65a4f69a9dbedc data/functionalstorage/recipes/iron_downgrade.json -88f21b369f13e7551057094c3c27f354ae58fb7c data/functionalstorage/recipes/jungle_1.json -73ef1849777d9676b32459ad848ecb939bbdd1e0 data/functionalstorage/recipes/jungle_2.json -dcad1b94f98a14de7f9248b8a4229429a13862e0 data/functionalstorage/recipes/jungle_4.json -a237a1bd9c909abfd9c6e70e50fc7457b07aca2e data/functionalstorage/recipes/linking_tool.json -86882f70ef2119613d08ec144929a7b2c3decc38 data/functionalstorage/recipes/mangrove_1.json -26712b44b3e320eb615bd1d7ac500420c6b69946 data/functionalstorage/recipes/mangrove_2.json -a24948b011d3c542c159ecf17aeb7effccbc83de data/functionalstorage/recipes/mangrove_4.json -263afed3953c17b4a3940302e788b36b9fbe76eb data/functionalstorage/recipes/netherite_upgrade.json -0daac04d5e593be8afb420d7b068b5d0a0a7e759 data/functionalstorage/recipes/oak_1.json -87727eeccd7271b330812f379e9a5e5bc6cf5de9 data/functionalstorage/recipes/oak_2.json -e729c5d55e191f2d1bd99a7217a3833291483ecb data/functionalstorage/recipes/oak_4.json -9c919a3baeaa9b3deae92ef802ddb6f07b1fa2f8 data/functionalstorage/recipes/puller_upgrade.json -055f291a2c7df167b3417931c3ce324e9a3b4efc data/functionalstorage/recipes/pusher_upgrade.json -25d723eedc951d40516c197b5b85cba0ff2cc64b data/functionalstorage/recipes/redstone_upgrade.json -cf0d2dbd7131c865223a85f7a1c4e314cf6167b6 data/functionalstorage/recipes/simple_compacting_drawer.json -a9e8d25c0ee7f0442675427627072906b34c8b4d data/functionalstorage/recipes/spruce_1.json -9e0b9a5c99d072155f01ccd335acf9c2fca96bc9 data/functionalstorage/recipes/spruce_2.json -6c782d5e81f1a152dbc1849391164b6c533f576b data/functionalstorage/recipes/spruce_4.json -f336fee45abfd07c1f2810275b816b04f606448c data/functionalstorage/recipes/storage_controller.json -1660fde05871583966ad2fc9a7882ac7a5066e20 data/functionalstorage/recipes/void_upgrade.json -f016626b869686a6657b772c100d9e923b58cf39 data/functionalstorage/recipes/warped_1.json -b034bdc06d0734de160f9c857b630e9261d6df01 data/functionalstorage/recipes/warped_2.json -53ba0cbca3c75a9f90ec12d241622d743cfadcc4 data/functionalstorage/recipes/warped_4.json -435084d750577a3e1e31113cb6976f65ce98170b data/minecraft/recipes/functionalstorage/compacting/amethyst.json -59f83e20d8a359a63417b2d6dad0ddc0b1657bac data/minecraft/recipes/functionalstorage/compacting/glowstone.json -e9c6ff4fbcb2617dc7fd7f4371db0ead6cea7154 data/minecraft/recipes/functionalstorage/compacting/ice.json -286fc95fc2f0fbe0341b751cf5bfdab1007bd6e3 data/minecraft/recipes/functionalstorage/compacting/melon.json -185e1f0c092f5aef2db16ff27daf7796ea578fbf data/minecraft/recipes/functionalstorage/compacting/packed_ice.json -6fb23d653de5174dc0094f8a81c933162b0ad806 data/minecraft/recipes/functionalstorage/compacting/quartz.json +// 1.21 2024-07-02T16:34:01.4549328 Recipes +f07485f3ee5257c2b12fcf149c60ddd20ed73fe1 data/functionalstorage/advancement/recipes/misc/acacia_1.json +8cce3aada48266b5e41df6e04b01ab1fd2224a4c data/functionalstorage/advancement/recipes/misc/acacia_2.json +8bc6f134a188d7ec701a472feeb93bccc9a115f3 data/functionalstorage/advancement/recipes/misc/acacia_4.json +013bebba212e7c910b2120b4cd0cb0aa0a51296c data/functionalstorage/advancement/recipes/misc/armory_cabinet.json +7148349418a85e1f5211f02fdb50dedb98530b5c data/functionalstorage/advancement/recipes/misc/birch_1.json +7dccbffdca9d47b36d270adcd7d4c77436aa3730 data/functionalstorage/advancement/recipes/misc/birch_2.json +642b7744641842a7f762db59fc60f8e511cd5539 data/functionalstorage/advancement/recipes/misc/birch_4.json +f1a02965cbbb75de65bf74b3def4ea4e99f19098 data/functionalstorage/advancement/recipes/misc/cherry_1.json +84dd9c2a2ce80d0202244736248fc9afbff62a6c data/functionalstorage/advancement/recipes/misc/cherry_2.json +1135382d815395682324be184d9731a9a249e762 data/functionalstorage/advancement/recipes/misc/cherry_4.json +7def510128aa7c74f9cd7e39e91c3bec38e9d2b7 data/functionalstorage/advancement/recipes/misc/collector_upgrade.json +828e38e02e5a1eef9d8d58c33827592b42842d5e data/functionalstorage/advancement/recipes/misc/compacting_drawer.json +c8ff800f9821ed035b4eb03495924f444dc75602 data/functionalstorage/advancement/recipes/misc/compacting_framed_drawer.json +1125f812821fc93d03e8a63830486db9424bf649 data/functionalstorage/advancement/recipes/misc/configuration_tool.json +cf7785b44d3d9cb244c47b3d417ecd055f590f6e data/functionalstorage/advancement/recipes/misc/controller_extension.json +56f463f83a921e41ffeab0b9be620138e00af1c2 data/functionalstorage/advancement/recipes/misc/copper_upgrade.json +abfc232bfd307176bbe414ca37fb04ccabb12bed data/functionalstorage/advancement/recipes/misc/crimson_1.json +bb70c322af1d6b3e3ec07986a44254c50765e555 data/functionalstorage/advancement/recipes/misc/crimson_2.json +1a27de3204d8db8c30af32a80a91a538fe0c7443 data/functionalstorage/advancement/recipes/misc/crimson_4.json +17715b6070438a52f941a75a7b8ba91717f065c6 data/functionalstorage/advancement/recipes/misc/dark_oak_1.json +3fcad0306dbd6448f295c94309e821a418087a13 data/functionalstorage/advancement/recipes/misc/dark_oak_2.json +9a84c01eead337a91820d2a551a7d340622a93d0 data/functionalstorage/advancement/recipes/misc/dark_oak_4.json +cb3d2919446edf0ecaf1125f50af2c4dc52e05c0 data/functionalstorage/advancement/recipes/misc/diamond_upgrade.json +bc6997ceddce44e90b4dbfbab14e384178f5ad05 data/functionalstorage/advancement/recipes/misc/ender_drawer.json +ee349f295d4714c2f996212567d30b696e5492b1 data/functionalstorage/advancement/recipes/misc/fluid_1.json +50ae74dd40b20e288ca6db3b4cac054f14548098 data/functionalstorage/advancement/recipes/misc/fluid_2.json +9f4d6ab4cf507f97c077f26d28e7b09c2fddd923 data/functionalstorage/advancement/recipes/misc/fluid_4.json +98655bc5e690915708d3a6ac474c8e8d3f5cc50f data/functionalstorage/advancement/recipes/misc/framed_1.json +beda8db0912170145812269375f1abe2e38d6c73 data/functionalstorage/advancement/recipes/misc/framed_2.json +30dec1e9937d7dcd466e6026a49db03794d4eb4f data/functionalstorage/advancement/recipes/misc/framed_4.json +9bcb372069e1ad2199677ff729dc56e8e42261ee data/functionalstorage/advancement/recipes/misc/framed_controller_extension.json +ee985bc4600ef7e2bc06a76147082b77fd7b8070 data/functionalstorage/advancement/recipes/misc/framed_simple_compacting_drawer.json +7b0f8e3b385abe93146af415949548caadf5cbda data/functionalstorage/advancement/recipes/misc/framed_storage_controller.json +435d0e125a24ebcf07e67f6cb104785fec479c16 data/functionalstorage/advancement/recipes/misc/gold_upgrade.json +23115c9f93a3bf8fe45b0bee672cfa2b1704ed11 data/functionalstorage/advancement/recipes/misc/iron_downgrade.json +262dc3b4cf1c8f20550fecd05341410bc9925a25 data/functionalstorage/advancement/recipes/misc/jungle_1.json +00d995b7658e32e7935a8a125c429bfe8a9aae18 data/functionalstorage/advancement/recipes/misc/jungle_2.json +f602b5069bd4113e5d6aeb602a03bf423930ba43 data/functionalstorage/advancement/recipes/misc/jungle_4.json +25d84daa7aecaa238c75d8b54cea885a70593285 data/functionalstorage/advancement/recipes/misc/linking_tool.json +4963b81b82fa9db96330ac1dc81f6a8571889ed8 data/functionalstorage/advancement/recipes/misc/mangrove_1.json +fda8a3b6b2a999e4aac7c87a61fd6aed8b0fa7c1 data/functionalstorage/advancement/recipes/misc/mangrove_2.json +e46defd4894df5a4afaafffe0ff81b9534b7b443 data/functionalstorage/advancement/recipes/misc/mangrove_4.json +b0c69118acd0443bcbbfb48e430649cace0f5da4 data/functionalstorage/advancement/recipes/misc/netherite_upgrade.json +f74f098ece5a237a77167ea8a8e21adad7eb0ea8 data/functionalstorage/advancement/recipes/misc/oak_1.json +9b119c96262b977f9392a974a00bdd1599f3ab4b data/functionalstorage/advancement/recipes/misc/oak_2.json +c80f7e9dd1b842064a6022ca70252e014bcbe78d data/functionalstorage/advancement/recipes/misc/oak_4.json +6ff3017bd51bb87d785d65a23659e9e94205e0ec data/functionalstorage/advancement/recipes/misc/puller_upgrade.json +d9c6f6b3bd529a8f95e58142803ea6bb0dd3972e data/functionalstorage/advancement/recipes/misc/pusher_upgrade.json +2c2a6f2849c070210a0a6f8d5c311b30b20203da data/functionalstorage/advancement/recipes/misc/redstone_upgrade.json +47310c768d3dedd3ba4d36d482ea080f11300a4b data/functionalstorage/advancement/recipes/misc/simple_compacting_drawer.json +7d2e55897afc7c855c4c7628458704b6c10f4d91 data/functionalstorage/advancement/recipes/misc/spruce_1.json +95a09bac35651fa109765c17f8094969a24afb03 data/functionalstorage/advancement/recipes/misc/spruce_2.json +f027778cf8a284a14c37206d901a52505afa850f data/functionalstorage/advancement/recipes/misc/spruce_4.json +65fe1f437f206861cfee431e0deae8731c02d996 data/functionalstorage/advancement/recipes/misc/storage_controller.json +09f46709d86b97003bdfed3709430451bf59367d data/functionalstorage/advancement/recipes/misc/void_upgrade.json +8c783bd51358da44000a9ff76926f571e2cea6c4 data/functionalstorage/advancement/recipes/misc/warped_1.json +daddde4854e12f609b8978359fee6bd4a01c632d data/functionalstorage/advancement/recipes/misc/warped_2.json +cb190e17de37c04d062208b29909c3dfef672896 data/functionalstorage/advancement/recipes/misc/warped_4.json +bdc03a25608cf678230392d53e0976692728adca data/functionalstorage/recipe/acacia_1.json +a44a7f2f4eaf7543c623f5dfdbe06739365cc347 data/functionalstorage/recipe/acacia_2.json +0921e7c354a8f9b028371313ae49bf6cfb864aaa data/functionalstorage/recipe/acacia_4.json +3c81bb03b3e428c2b6ecd247e82cb548290523a5 data/functionalstorage/recipe/armory_cabinet.json +a00048cee88ed3b56c964639f356a61293bb6feb data/functionalstorage/recipe/birch_1.json +234cf5f9c2441a9d0541298de146a0da1e5f7e03 data/functionalstorage/recipe/birch_2.json +90def2b50fb81317d0304a38be8ca6878857035e data/functionalstorage/recipe/birch_4.json +dd7232feb8b5861f983c3e8ab764b8451c00d86e data/functionalstorage/recipe/cherry_1.json +7993db743da0bf8eff4d532e3b8e8a02eee3ec6a data/functionalstorage/recipe/cherry_2.json +908796ef8c4b9ccf5c6c4c6a2c46d745785902b7 data/functionalstorage/recipe/cherry_4.json +aa6bc43b316c906bb4bed3a937cd741e96707e6c data/functionalstorage/recipe/collector_upgrade.json +d7986db2e81bdf1203fe73d2e712c8a6b0f4a025 data/functionalstorage/recipe/compacting_drawer.json +54fbb1148b251b50152f8a8b25e8ec0df9a34f48 data/functionalstorage/recipe/compacting_framed_drawer.json +6f30ad4d6db3f4506bbfb30b341bc5da439f0d85 data/functionalstorage/recipe/configuration_tool.json +6adce5bd8278fa8018bbb480b0c0e72218ffd8fe data/functionalstorage/recipe/controller_extension.json +64fa161bc6136f1a951976aa1fba4fc14b9760b3 data/functionalstorage/recipe/copper_upgrade.json +3229c19689f1d3fb9c40dd5f4d012712a4eacfea data/functionalstorage/recipe/crimson_1.json +6aa18d21efde5ec54ca7a281df632e995a035e11 data/functionalstorage/recipe/crimson_2.json +62ab9b7e039d30e1aabfab262213b8555815f046 data/functionalstorage/recipe/crimson_4.json +b427e0cd3febda66f9b4d62889e612219abde33e data/functionalstorage/recipe/dark_oak_1.json +452ae9131d5e4a4f2ebac6856d29f4fd62610a40 data/functionalstorage/recipe/dark_oak_2.json +6f321ccd0e4de78db193c8c8d57ead3fa59f3b5f data/functionalstorage/recipe/dark_oak_4.json +eb9bb377de509179bbd58d99addcfdc425a2eb85 data/functionalstorage/recipe/diamond_upgrade.json +cf34adf45409fde2b3aaeeeb8176787c6dd04cd0 data/functionalstorage/recipe/ender_drawer.json +203dd43c2f6fa43a2b6259c42450b1435ef6c677 data/functionalstorage/recipe/fluid_1.json +753d4bfc05e095a35b3a042f9b4dbeedb77797d3 data/functionalstorage/recipe/fluid_2.json +ebaaf06047c1c3ccb1501983f517213f8ea5c8a3 data/functionalstorage/recipe/fluid_4.json +2dfab75c50e1901ff08b551c23b36494b1229772 data/functionalstorage/recipe/framed_1.json +927c676cd49b94924dab7be23df9125785569791 data/functionalstorage/recipe/framed_2.json +7386d0afa41e8822972d33e71ae8b2ea9bce381c data/functionalstorage/recipe/framed_4.json +87373fc820c0f2f7a44aeaf87a10f4a36467271c data/functionalstorage/recipe/framed_controller_extension.json +5ae168463c2b7c87be1c8f0e256a63db968c5526 data/functionalstorage/recipe/framed_simple_compacting_drawer.json +87673337c2a857220dc59a961a11e61bcd362e94 data/functionalstorage/recipe/framed_storage_controller.json +2fe7733f81bfed2bf87d9e723af4c2e7b0a90f25 data/functionalstorage/recipe/gold_upgrade.json +fe108defd4502878ea2e744712c8beacededdf7b data/functionalstorage/recipe/iron_downgrade.json +aa10f7d47d0750e1e8eaaa6b8b0f72142b85f724 data/functionalstorage/recipe/jungle_1.json +70655d34741529d017efd962e4553215dbeae8c8 data/functionalstorage/recipe/jungle_2.json +f44e1d52e46d52e1ebbb1f261870d30ab6af4691 data/functionalstorage/recipe/jungle_4.json +d048d2588452bf51bd73f777282a27905f27fe4c data/functionalstorage/recipe/linking_tool.json +1483eea337c0c588311efecb02cd15518ff27c78 data/functionalstorage/recipe/mangrove_1.json +40c7731174402803808953a36c366aeefd3adc41 data/functionalstorage/recipe/mangrove_2.json +1c40593391bd4214bfd0c7c92fd932715bccfac6 data/functionalstorage/recipe/mangrove_4.json +3eb5787d82246de2020ee88db277f8beff8b92a0 data/functionalstorage/recipe/netherite_upgrade.json +5a6cf085d8d0de5e740121594a58275be75194dc data/functionalstorage/recipe/oak_1.json +313ba2b13a47f15bade3eeb606ef5a3b74a449ba data/functionalstorage/recipe/oak_2.json +863b7345eb9d872144eb49ee2f0d3a740e972990 data/functionalstorage/recipe/oak_4.json +a7ec2fd7e409c9fe329a972f8caf8a2f74e31e9e data/functionalstorage/recipe/puller_upgrade.json +0f54ff3aa2caa38c35c467783e2c6c7a449c6785 data/functionalstorage/recipe/pusher_upgrade.json +7cf0ad077a5a1872fdd04c5b3218b8d71a6e90d8 data/functionalstorage/recipe/redstone_upgrade.json +a6d66aa0d1ffc4d10f6f695573708948ec0c077b data/functionalstorage/recipe/simple_compacting_drawer.json +0b8fa429a17312ccdc2c90a4dc4ba5dd44ab06c9 data/functionalstorage/recipe/spruce_1.json +7b796d2070a9d994e52da67e9bb4eb5e57f9504d data/functionalstorage/recipe/spruce_2.json +6a5225220f58da38911a5350a42e32ab4afd6e47 data/functionalstorage/recipe/spruce_4.json +5a8828f8b555da83872fac8c504ae09696b34da1 data/functionalstorage/recipe/storage_controller.json +8abc2a8c37fb32f2d9818f5409d4cbad4f51cebc data/functionalstorage/recipe/void_upgrade.json +ded5cf48ed485115fc2eec2d9f680177ebeb4d5b data/functionalstorage/recipe/warped_1.json +1496ac044b8b31511ee9485c8c646ec8a1770410 data/functionalstorage/recipe/warped_2.json +5594b0b140f29bea952395137cf4dfbd5f4d1154 data/functionalstorage/recipe/warped_4.json +74158cbf025bacbd94985a450dac448945a3adda data/minecraft/recipe/functionalstorage/compacting/amethyst.json +b67f9d3568b5f9fde9b6b5b40cc88b2b1e1de9ac data/minecraft/recipe/functionalstorage/compacting/glowstone.json +f9faeb313babf7bea8ec73a9c72ca8d14d1604e3 data/minecraft/recipe/functionalstorage/compacting/ice.json +ddace85b911eb7a522bc5f6444de4206c282ee41 data/minecraft/recipe/functionalstorage/compacting/melon.json +bc213e06291806eb868ac59de071fb1b639aff05 data/minecraft/recipe/functionalstorage/compacting/packed_ice.json +094ef87e936be9fe3c790a22a023ca641c092a70 data/minecraft/recipe/functionalstorage/compacting/quartz.json diff --git a/src/generated/resources/.cache/f4bc6a534340ffb17710ab19bf013aa0d2f1f9d9 b/src/generated/resources/.cache/f4bc6a534340ffb17710ab19bf013aa0d2f1f9d9 index ca4508a6..b585868f 100644 --- a/src/generated/resources/.cache/f4bc6a534340ffb17710ab19bf013aa0d2f1f9d9 +++ b/src/generated/resources/.cache/f4bc6a534340ffb17710ab19bf013aa0d2f1f9d9 @@ -1,4 +1,4 @@ -// 1.20.4 2024-04-07T00:54:11.3202025 Block Models: functionalstorage +// 1.21 2024-07-02T16:34:01.4499335 Block Models: functionalstorage 9a3565a126dac6771b78fa3f5f3f2b6e3c858dd8 assets/functionalstorage/models/block/acacia_1_locked.json fb054b9a925853b52f05fc4402de2b58b2d3a72f assets/functionalstorage/models/block/acacia_2_locked.json b8c2c3e1a316d39c881a4532b04a18d19d6d9c55 assets/functionalstorage/models/block/acacia_4_locked.json diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_1.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/acacia_1.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_1.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/acacia_1.json index bb56d9c9..3128091a 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_1.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/acacia_1.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:acacia_planks" - ] + "items": "minecraft:acacia_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_2.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/acacia_2.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_2.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/acacia_2.json index e6d8d572..05bcc827 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_2.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/acacia_2.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:acacia_planks" - ] + "items": "minecraft:acacia_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_4.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/acacia_4.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_4.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/acacia_4.json index 257cc153..09c9e27d 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/acacia_4.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/acacia_4.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:acacia_planks" - ] + "items": "minecraft:acacia_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/armory_cabinet.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/armory_cabinet.json similarity index 95% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/armory_cabinet.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/armory_cabinet.json index 2e09f5ca..f98b9366 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/armory_cabinet.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/armory_cabinet.json @@ -11,7 +11,7 @@ "conditions": { "items": [ { - "tag": "forge:stone" + "items": "#c:stones" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_1.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/birch_1.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_1.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/birch_1.json index b1a3eaf5..c5a08657 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_1.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/birch_1.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:birch_planks" - ] + "items": "minecraft:birch_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_2.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/birch_2.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_2.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/birch_2.json index 7ac03800..046cff79 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_2.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/birch_2.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:birch_planks" - ] + "items": "minecraft:birch_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_4.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/birch_4.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_4.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/birch_4.json index 1a738f3b..94870f91 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/birch_4.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/birch_4.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:birch_planks" - ] + "items": "minecraft:birch_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_1.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/cherry_1.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_1.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/cherry_1.json index 601ef6e2..47c0bc6e 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_1.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/cherry_1.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:cherry_planks" - ] + "items": "minecraft:cherry_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_2.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/cherry_2.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_2.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/cherry_2.json index 502a52a0..c590e353 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_2.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/cherry_2.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:cherry_planks" - ] + "items": "minecraft:cherry_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_4.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/cherry_4.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_4.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/cherry_4.json index 9e668a5c..4ffa3950 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/cherry_4.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/cherry_4.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:cherry_planks" - ] + "items": "minecraft:cherry_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/collector_upgrade.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/collector_upgrade.json similarity index 95% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/collector_upgrade.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/collector_upgrade.json index d3608151..9a2c3a46 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/collector_upgrade.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/collector_upgrade.json @@ -11,7 +11,7 @@ "conditions": { "items": [ { - "tag": "forge:stone" + "items": "#c:stones" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/compacting_drawer.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/compacting_drawer.json similarity index 90% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/compacting_drawer.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/compacting_drawer.json index 0c678f69..e1c17ed1 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/compacting_drawer.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/compacting_drawer.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:stone" - ] + "items": "minecraft:stone" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/compacting_framed_drawer.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/compacting_framed_drawer.json similarity index 90% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/compacting_framed_drawer.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/compacting_framed_drawer.json index c204022b..84f0a63b 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/compacting_framed_drawer.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/compacting_framed_drawer.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:iron_nugget" - ] + "items": "minecraft:iron_nugget" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/configuration_tool.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/configuration_tool.json similarity index 90% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/configuration_tool.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/configuration_tool.json index f16f1df9..e8c8d69f 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/configuration_tool.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/configuration_tool.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:paper" - ] + "items": "minecraft:paper" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/controller_extension.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/controller_extension.json similarity index 95% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/controller_extension.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/controller_extension.json index 2cba6fb3..910fbca4 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/controller_extension.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/controller_extension.json @@ -11,7 +11,7 @@ "conditions": { "items": [ { - "tag": "forge:stone" + "items": "#c:stones" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/copper_upgrade.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/copper_upgrade.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/copper_upgrade.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/copper_upgrade.json index 1f727249..c0c45f49 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/copper_upgrade.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/copper_upgrade.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:copper_ingot" - ] + "items": "minecraft:copper_ingot" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_1.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/crimson_1.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_1.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/crimson_1.json index a0a67ff6..4e4670bd 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_1.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/crimson_1.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:crimson_planks" - ] + "items": "minecraft:crimson_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_2.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/crimson_2.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_2.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/crimson_2.json index 38b49e92..a5302753 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_2.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/crimson_2.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:crimson_planks" - ] + "items": "minecraft:crimson_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_4.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/crimson_4.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_4.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/crimson_4.json index 6ec19ade..977dd828 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/crimson_4.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/crimson_4.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:crimson_planks" - ] + "items": "minecraft:crimson_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_1.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/dark_oak_1.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_1.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/dark_oak_1.json index f14bc9bc..3ebb2687 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_1.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/dark_oak_1.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:dark_oak_planks" - ] + "items": "minecraft:dark_oak_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_2.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/dark_oak_2.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_2.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/dark_oak_2.json index c5acc613..07998e6c 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_2.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/dark_oak_2.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:dark_oak_planks" - ] + "items": "minecraft:dark_oak_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_4.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/dark_oak_4.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_4.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/dark_oak_4.json index db2544b1..43b99978 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/dark_oak_4.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/dark_oak_4.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:dark_oak_planks" - ] + "items": "minecraft:dark_oak_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/diamond_upgrade.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/diamond_upgrade.json similarity index 94% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/diamond_upgrade.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/diamond_upgrade.json index 5793bfc5..d740b21d 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/diamond_upgrade.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/diamond_upgrade.json @@ -11,7 +11,7 @@ "conditions": { "items": [ { - "tag": "forge:gems/diamond" + "items": "#c:gems/diamond" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/ender_drawer.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/ender_drawer.json similarity index 94% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/ender_drawer.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/ender_drawer.json index 3d4bf5fe..85d3f007 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/ender_drawer.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/ender_drawer.json @@ -11,7 +11,7 @@ "conditions": { "items": [ { - "tag": "minecraft:planks" + "items": "#minecraft:planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_1.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/fluid_1.json similarity index 94% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_1.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/fluid_1.json index 70c33545..688d24f8 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_1.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/fluid_1.json @@ -11,7 +11,7 @@ "conditions": { "items": [ { - "tag": "minecraft:planks" + "items": "#minecraft:planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_2.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/fluid_2.json similarity index 94% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_2.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/fluid_2.json index b6064133..2489635d 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_2.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/fluid_2.json @@ -11,7 +11,7 @@ "conditions": { "items": [ { - "tag": "minecraft:planks" + "items": "#minecraft:planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_4.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/fluid_4.json similarity index 94% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_4.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/fluid_4.json index ca7770d1..55fd5930 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/fluid_4.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/fluid_4.json @@ -11,7 +11,7 @@ "conditions": { "items": [ { - "tag": "minecraft:planks" + "items": "#minecraft:planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_1.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/framed_1.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_1.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/framed_1.json index f48abfd5..48f37d68 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_1.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/framed_1.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:iron_nugget" - ] + "items": "minecraft:iron_nugget" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_2.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/framed_2.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_2.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/framed_2.json index 9fb63aaf..cf6ffb8f 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_2.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/framed_2.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:iron_nugget" - ] + "items": "minecraft:iron_nugget" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_4.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/framed_4.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_4.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/framed_4.json index f3fbab01..55c7b115 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_4.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/framed_4.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:iron_nugget" - ] + "items": "minecraft:iron_nugget" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_controller_extension.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/framed_controller_extension.json similarity index 90% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_controller_extension.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/framed_controller_extension.json index fb04e282..790a2a6a 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_controller_extension.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/framed_controller_extension.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:iron_nugget" - ] + "items": "minecraft:iron_nugget" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_simple_compacting_drawer.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/framed_simple_compacting_drawer.json similarity index 90% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_simple_compacting_drawer.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/framed_simple_compacting_drawer.json index 77aa5176..4738ddf0 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_simple_compacting_drawer.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/framed_simple_compacting_drawer.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:iron_nugget" - ] + "items": "minecraft:iron_nugget" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_storage_controller.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/framed_storage_controller.json similarity index 90% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_storage_controller.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/framed_storage_controller.json index a324ec21..0ef9daee 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/framed_storage_controller.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/framed_storage_controller.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:iron_nugget" - ] + "items": "minecraft:iron_nugget" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/gold_upgrade.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/gold_upgrade.json similarity index 94% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/gold_upgrade.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/gold_upgrade.json index 9c4fcf9e..cbd0c6d4 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/gold_upgrade.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/gold_upgrade.json @@ -11,7 +11,7 @@ "conditions": { "items": [ { - "tag": "forge:ingots/gold" + "items": "#c:ingots/gold" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/iron_downgrade.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/iron_downgrade.json similarity index 94% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/iron_downgrade.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/iron_downgrade.json index 7bedccd6..5b6b2fbe 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/iron_downgrade.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/iron_downgrade.json @@ -11,7 +11,7 @@ "conditions": { "items": [ { - "tag": "forge:ingots/iron" + "items": "#c:ingots/iron" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_1.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/jungle_1.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_1.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/jungle_1.json index 9d0e54d5..3af43096 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_1.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/jungle_1.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:jungle_planks" - ] + "items": "minecraft:jungle_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_2.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/jungle_2.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_2.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/jungle_2.json index b3f73174..08faa312 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_2.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/jungle_2.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:jungle_planks" - ] + "items": "minecraft:jungle_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_4.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/jungle_4.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_4.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/jungle_4.json index bf5dd7f2..541992f4 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/jungle_4.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/jungle_4.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:jungle_planks" - ] + "items": "minecraft:jungle_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/linking_tool.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/linking_tool.json similarity index 90% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/linking_tool.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/linking_tool.json index 3746e671..d5a90a62 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/linking_tool.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/linking_tool.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:paper" - ] + "items": "minecraft:paper" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_1.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/mangrove_1.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_1.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/mangrove_1.json index 4f008307..0a2e62db 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_1.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/mangrove_1.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:mangrove_planks" - ] + "items": "minecraft:mangrove_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_2.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/mangrove_2.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_2.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/mangrove_2.json index 0174c583..fbed13bb 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_2.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/mangrove_2.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:mangrove_planks" - ] + "items": "minecraft:mangrove_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_4.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/mangrove_4.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_4.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/mangrove_4.json index 3b15c817..007be9f3 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/mangrove_4.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/mangrove_4.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:mangrove_planks" - ] + "items": "minecraft:mangrove_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/netherite_upgrade.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/netherite_upgrade.json similarity index 87% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/netherite_upgrade.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/netherite_upgrade.json index 5f66c507..862f5633 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/netherite_upgrade.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/netherite_upgrade.json @@ -5,9 +5,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:netherite_ingot" - ] + "items": "minecraft:netherite_ingot" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_1.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/oak_1.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_1.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/oak_1.json index 4103d50c..c5ada276 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_1.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/oak_1.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:oak_planks" - ] + "items": "minecraft:oak_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_2.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/oak_2.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_2.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/oak_2.json index 100cf4cd..bda44746 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_2.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/oak_2.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:oak_planks" - ] + "items": "minecraft:oak_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_4.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/oak_4.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_4.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/oak_4.json index 5c3c2d20..e5d1839b 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/oak_4.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/oak_4.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:oak_planks" - ] + "items": "minecraft:oak_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/puller_upgrade.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/puller_upgrade.json similarity index 95% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/puller_upgrade.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/puller_upgrade.json index 9befe62d..f238aaed 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/puller_upgrade.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/puller_upgrade.json @@ -11,7 +11,7 @@ "conditions": { "items": [ { - "tag": "forge:stone" + "items": "#c:stones" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/pusher_upgrade.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/pusher_upgrade.json similarity index 95% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/pusher_upgrade.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/pusher_upgrade.json index 64c78e37..f092bdf0 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/pusher_upgrade.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/pusher_upgrade.json @@ -11,7 +11,7 @@ "conditions": { "items": [ { - "tag": "forge:stone" + "items": "#c:stones" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/redstone_upgrade.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/redstone_upgrade.json similarity index 90% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/redstone_upgrade.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/redstone_upgrade.json index cbc974cd..f4f6bd46 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/redstone_upgrade.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/redstone_upgrade.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:redstone" - ] + "items": "minecraft:redstone" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/simple_compacting_drawer.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/simple_compacting_drawer.json similarity index 91% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/simple_compacting_drawer.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/simple_compacting_drawer.json index b389bc15..b3f50f9a 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/simple_compacting_drawer.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/simple_compacting_drawer.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:stone" - ] + "items": "minecraft:stone" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_1.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/spruce_1.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_1.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/spruce_1.json index f617aff6..e47fba2f 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_1.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/spruce_1.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:spruce_planks" - ] + "items": "minecraft:spruce_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_2.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/spruce_2.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_2.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/spruce_2.json index 358ba28a..d811f952 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_2.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/spruce_2.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:spruce_planks" - ] + "items": "minecraft:spruce_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_4.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/spruce_4.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_4.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/spruce_4.json index a1d932fd..fa43064e 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/spruce_4.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/spruce_4.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:spruce_planks" - ] + "items": "minecraft:spruce_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/storage_controller.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/storage_controller.json similarity index 95% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/storage_controller.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/storage_controller.json index 7bee4dbd..23d7a1b3 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/storage_controller.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/storage_controller.json @@ -11,7 +11,7 @@ "conditions": { "items": [ { - "tag": "forge:stone" + "items": "#c:stones" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/void_upgrade.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/void_upgrade.json similarity index 94% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/void_upgrade.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/void_upgrade.json index 1cc2c8e3..c114897f 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/void_upgrade.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/void_upgrade.json @@ -11,7 +11,7 @@ "conditions": { "items": [ { - "tag": "forge:obsidian" + "items": "#c:obsidians" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_1.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/warped_1.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_1.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/warped_1.json index d4a0f3d4..3f63c209 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_1.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/warped_1.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:warped_planks" - ] + "items": "minecraft:warped_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_2.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/warped_2.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_2.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/warped_2.json index 16bc8f50..3ef46459 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_2.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/warped_2.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:warped_planks" - ] + "items": "minecraft:warped_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_4.json b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/warped_4.json similarity index 89% rename from src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_4.json rename to src/generated/resources/data/functionalstorage/advancement/recipes/misc/warped_4.json index 11269b5e..ca0eaf35 100644 --- a/src/generated/resources/data/functionalstorage/advancements/recipes/misc/warped_4.json +++ b/src/generated/resources/data/functionalstorage/advancement/recipes/misc/warped_4.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:warped_planks" - ] + "items": "minecraft:warped_planks" } ] }, diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/acacia_1.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/acacia_1.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/acacia_1.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/acacia_1.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/acacia_2.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/acacia_2.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/acacia_2.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/acacia_2.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/acacia_4.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/acacia_4.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/acacia_4.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/acacia_4.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/armory_cabinet.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/armory_cabinet.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/armory_cabinet.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/armory_cabinet.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/birch_1.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/birch_1.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/birch_1.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/birch_1.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/birch_2.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/birch_2.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/birch_2.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/birch_2.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/birch_4.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/birch_4.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/birch_4.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/birch_4.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/cherry_1.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/cherry_1.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/cherry_1.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/cherry_1.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/cherry_2.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/cherry_2.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/cherry_2.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/cherry_2.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/cherry_4.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/cherry_4.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/cherry_4.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/cherry_4.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/compacting_drawer.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/compacting_drawer.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/compacting_drawer.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/compacting_drawer.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/compacting_framed_drawer.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/compacting_framed_drawer.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/compacting_framed_drawer.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/compacting_framed_drawer.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/controller_extension.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/controller_extension.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/controller_extension.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/controller_extension.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/crimson_1.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/crimson_1.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/crimson_1.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/crimson_1.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/crimson_2.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/crimson_2.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/crimson_2.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/crimson_2.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/crimson_4.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/crimson_4.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/crimson_4.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/crimson_4.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/dark_oak_1.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/dark_oak_1.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/dark_oak_1.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/dark_oak_1.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/dark_oak_2.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/dark_oak_2.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/dark_oak_2.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/dark_oak_2.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/dark_oak_4.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/dark_oak_4.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/dark_oak_4.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/dark_oak_4.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/ender_drawer.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/ender_drawer.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/ender_drawer.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/ender_drawer.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/fluid_1.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/fluid_1.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/fluid_1.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/fluid_1.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/fluid_2.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/fluid_2.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/fluid_2.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/fluid_2.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/fluid_4.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/fluid_4.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/fluid_4.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/fluid_4.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/framed_1.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/framed_1.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/framed_1.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/framed_1.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/framed_2.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/framed_2.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/framed_2.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/framed_2.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/framed_4.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/framed_4.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/framed_4.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/framed_4.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/framed_controller_extension.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/framed_controller_extension.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/framed_controller_extension.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/framed_controller_extension.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/framed_simple_compacting_drawer.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/framed_simple_compacting_drawer.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/framed_simple_compacting_drawer.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/framed_simple_compacting_drawer.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/framed_storage_controller.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/framed_storage_controller.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/framed_storage_controller.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/framed_storage_controller.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/jungle_1.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/jungle_1.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/jungle_1.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/jungle_1.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/jungle_2.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/jungle_2.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/jungle_2.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/jungle_2.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/jungle_4.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/jungle_4.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/jungle_4.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/jungle_4.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/mangrove_1.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/mangrove_1.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/mangrove_1.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/mangrove_1.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/mangrove_2.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/mangrove_2.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/mangrove_2.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/mangrove_2.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/mangrove_4.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/mangrove_4.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/mangrove_4.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/mangrove_4.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/oak_1.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/oak_1.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/oak_1.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/oak_1.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/oak_2.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/oak_2.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/oak_2.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/oak_2.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/oak_4.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/oak_4.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/oak_4.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/oak_4.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/simple_compacting_drawer.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/simple_compacting_drawer.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/simple_compacting_drawer.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/simple_compacting_drawer.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/spruce_1.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/spruce_1.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/spruce_1.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/spruce_1.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/spruce_2.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/spruce_2.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/spruce_2.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/spruce_2.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/spruce_4.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/spruce_4.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/spruce_4.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/spruce_4.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/storage_controller.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/storage_controller.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/storage_controller.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/storage_controller.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/warped_1.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/warped_1.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/warped_1.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/warped_1.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/warped_2.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/warped_2.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/warped_2.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/warped_2.json diff --git a/src/generated/resources/data/functionalstorage/loot_tables/blocks/warped_4.json b/src/generated/resources/data/functionalstorage/loot_table/blocks/warped_4.json similarity index 100% rename from src/generated/resources/data/functionalstorage/loot_tables/blocks/warped_4.json rename to src/generated/resources/data/functionalstorage/loot_table/blocks/warped_4.json diff --git a/src/generated/resources/data/functionalstorage/recipes/acacia_1.json b/src/generated/resources/data/functionalstorage/recipe/acacia_1.json similarity index 80% rename from src/generated/resources/data/functionalstorage/recipes/acacia_1.json rename to src/generated/resources/data/functionalstorage/recipe/acacia_1.json index befe501e..7ef135b4 100644 --- a/src/generated/resources/data/functionalstorage/recipes/acacia_1.json +++ b/src/generated/resources/data/functionalstorage/recipe/acacia_1.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:acacia_planks" @@ -21,6 +21,7 @@ "PPP" ], "result": { - "item": "functionalstorage:acacia_1" + "count": 1, + "id": "functionalstorage:acacia_1" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/acacia_2.json b/src/generated/resources/data/functionalstorage/recipe/acacia_2.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/acacia_2.json rename to src/generated/resources/data/functionalstorage/recipe/acacia_2.json index 8626284c..644b3996 100644 --- a/src/generated/resources/data/functionalstorage/recipes/acacia_2.json +++ b/src/generated/resources/data/functionalstorage/recipe/acacia_2.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:acacia_planks" @@ -22,6 +22,6 @@ ], "result": { "count": 2, - "item": "functionalstorage:acacia_2" + "id": "functionalstorage:acacia_2" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/acacia_4.json b/src/generated/resources/data/functionalstorage/recipe/acacia_4.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/acacia_4.json rename to src/generated/resources/data/functionalstorage/recipe/acacia_4.json index 473c712d..39ff5432 100644 --- a/src/generated/resources/data/functionalstorage/recipes/acacia_4.json +++ b/src/generated/resources/data/functionalstorage/recipe/acacia_4.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:acacia_planks" @@ -22,6 +22,6 @@ ], "result": { "count": 4, - "item": "functionalstorage:acacia_4" + "id": "functionalstorage:acacia_4" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/armory_cabinet.json b/src/generated/resources/data/functionalstorage/recipe/armory_cabinet.json similarity index 78% rename from src/generated/resources/data/functionalstorage/recipes/armory_cabinet.json rename to src/generated/resources/data/functionalstorage/recipe/armory_cabinet.json index 7d7cd33c..7699655e 100644 --- a/src/generated/resources/data/functionalstorage/recipes/armory_cabinet.json +++ b/src/generated/resources/data/functionalstorage/recipe/armory_cabinet.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "B": { - "tag": "forge:ingots/netherite" + "tag": "c:ingots/netherite" }, "C": { "tag": "functionalstorage:drawer" @@ -18,7 +18,7 @@ "item": "minecraft:comparator" }, "I": { - "tag": "forge:stone" + "tag": "c:stones" } }, "pattern": [ @@ -27,6 +27,7 @@ "IBI" ], "result": { - "item": "functionalstorage:armory_cabinet" + "count": 1, + "id": "functionalstorage:armory_cabinet" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/birch_1.json b/src/generated/resources/data/functionalstorage/recipe/birch_1.json similarity index 80% rename from src/generated/resources/data/functionalstorage/recipes/birch_1.json rename to src/generated/resources/data/functionalstorage/recipe/birch_1.json index 21895c89..f83f67a6 100644 --- a/src/generated/resources/data/functionalstorage/recipes/birch_1.json +++ b/src/generated/resources/data/functionalstorage/recipe/birch_1.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:birch_planks" @@ -21,6 +21,7 @@ "PPP" ], "result": { - "item": "functionalstorage:birch_1" + "count": 1, + "id": "functionalstorage:birch_1" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/birch_2.json b/src/generated/resources/data/functionalstorage/recipe/birch_2.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/birch_2.json rename to src/generated/resources/data/functionalstorage/recipe/birch_2.json index d7420128..dc3c78bb 100644 --- a/src/generated/resources/data/functionalstorage/recipes/birch_2.json +++ b/src/generated/resources/data/functionalstorage/recipe/birch_2.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:birch_planks" @@ -22,6 +22,6 @@ ], "result": { "count": 2, - "item": "functionalstorage:birch_2" + "id": "functionalstorage:birch_2" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/birch_4.json b/src/generated/resources/data/functionalstorage/recipe/birch_4.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/birch_4.json rename to src/generated/resources/data/functionalstorage/recipe/birch_4.json index 8a9c74bc..5f89b3c4 100644 --- a/src/generated/resources/data/functionalstorage/recipes/birch_4.json +++ b/src/generated/resources/data/functionalstorage/recipe/birch_4.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:birch_planks" @@ -22,6 +22,6 @@ ], "result": { "count": 4, - "item": "functionalstorage:birch_4" + "id": "functionalstorage:birch_4" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/cherry_1.json b/src/generated/resources/data/functionalstorage/recipe/cherry_1.json similarity index 80% rename from src/generated/resources/data/functionalstorage/recipes/cherry_1.json rename to src/generated/resources/data/functionalstorage/recipe/cherry_1.json index 53ba92d3..eaf7423f 100644 --- a/src/generated/resources/data/functionalstorage/recipes/cherry_1.json +++ b/src/generated/resources/data/functionalstorage/recipe/cherry_1.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:cherry_planks" @@ -21,6 +21,7 @@ "PPP" ], "result": { - "item": "functionalstorage:cherry_1" + "count": 1, + "id": "functionalstorage:cherry_1" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/cherry_2.json b/src/generated/resources/data/functionalstorage/recipe/cherry_2.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/cherry_2.json rename to src/generated/resources/data/functionalstorage/recipe/cherry_2.json index 7fc18e60..d695eff5 100644 --- a/src/generated/resources/data/functionalstorage/recipes/cherry_2.json +++ b/src/generated/resources/data/functionalstorage/recipe/cherry_2.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:cherry_planks" @@ -22,6 +22,6 @@ ], "result": { "count": 2, - "item": "functionalstorage:cherry_2" + "id": "functionalstorage:cherry_2" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/cherry_4.json b/src/generated/resources/data/functionalstorage/recipe/cherry_4.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/cherry_4.json rename to src/generated/resources/data/functionalstorage/recipe/cherry_4.json index b03f43ae..13ef4fd7 100644 --- a/src/generated/resources/data/functionalstorage/recipes/cherry_4.json +++ b/src/generated/resources/data/functionalstorage/recipe/cherry_4.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:cherry_planks" @@ -22,6 +22,6 @@ ], "result": { "count": 4, - "item": "functionalstorage:cherry_4" + "id": "functionalstorage:cherry_4" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/collector_upgrade.json b/src/generated/resources/data/functionalstorage/recipe/collector_upgrade.json similarity index 78% rename from src/generated/resources/data/functionalstorage/recipes/collector_upgrade.json rename to src/generated/resources/data/functionalstorage/recipe/collector_upgrade.json index d9013f5e..43d6d997 100644 --- a/src/generated/resources/data/functionalstorage/recipes/collector_upgrade.json +++ b/src/generated/resources/data/functionalstorage/recipe/collector_upgrade.json @@ -15,10 +15,10 @@ "tag": "functionalstorage:drawer" }, "I": { - "tag": "forge:stone" + "tag": "c:stones" }, "R": { - "tag": "forge:dusts/redstone" + "tag": "c:dusts/redstone" } }, "pattern": [ @@ -27,6 +27,7 @@ "IBI" ], "result": { - "item": "functionalstorage:collector_upgrade" + "count": 1, + "id": "functionalstorage:collector_upgrade" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/compacting_drawer.json b/src/generated/resources/data/functionalstorage/recipe/compacting_drawer.json similarity index 83% rename from src/generated/resources/data/functionalstorage/recipes/compacting_drawer.json rename to src/generated/resources/data/functionalstorage/recipe/compacting_drawer.json index adb81144..3e935269 100644 --- a/src/generated/resources/data/functionalstorage/recipes/compacting_drawer.json +++ b/src/generated/resources/data/functionalstorage/recipe/compacting_drawer.json @@ -12,7 +12,7 @@ "tag": "functionalstorage:drawer" }, "I": { - "tag": "forge:ingots/iron" + "tag": "c:ingots/iron" }, "P": { "item": "minecraft:piston" @@ -27,6 +27,7 @@ "SIS" ], "result": { - "item": "functionalstorage:compacting_drawer" + "count": 1, + "id": "functionalstorage:compacting_drawer" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/compacting_framed_drawer.json b/src/generated/resources/data/functionalstorage/recipe/compacting_framed_drawer.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/compacting_framed_drawer.json rename to src/generated/resources/data/functionalstorage/recipe/compacting_framed_drawer.json index 06ecce57..4af1a6e1 100644 --- a/src/generated/resources/data/functionalstorage/recipes/compacting_framed_drawer.json +++ b/src/generated/resources/data/functionalstorage/recipe/compacting_framed_drawer.json @@ -12,7 +12,7 @@ "tag": "functionalstorage:drawer" }, "I": { - "tag": "forge:ingots/iron" + "tag": "c:ingots/iron" }, "P": { "item": "minecraft:piston" @@ -27,6 +27,7 @@ "SIS" ], "result": { - "item": "functionalstorage:compacting_framed_drawer" + "count": 1, + "id": "functionalstorage:compacting_framed_drawer" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/configuration_tool.json b/src/generated/resources/data/functionalstorage/recipe/configuration_tool.json similarity index 83% rename from src/generated/resources/data/functionalstorage/recipes/configuration_tool.json rename to src/generated/resources/data/functionalstorage/recipe/configuration_tool.json index 7fad5bad..0b156c3f 100644 --- a/src/generated/resources/data/functionalstorage/recipes/configuration_tool.json +++ b/src/generated/resources/data/functionalstorage/recipe/configuration_tool.json @@ -15,7 +15,7 @@ "item": "minecraft:emerald" }, "G": { - "tag": "forge:ingots/gold" + "tag": "c:ingots/gold" }, "P": { "item": "minecraft:paper" @@ -27,6 +27,7 @@ "PEP" ], "result": { - "item": "functionalstorage:configuration_tool" + "count": 1, + "id": "functionalstorage:configuration_tool" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/controller_extension.json b/src/generated/resources/data/functionalstorage/recipe/controller_extension.json similarity index 76% rename from src/generated/resources/data/functionalstorage/recipes/controller_extension.json rename to src/generated/resources/data/functionalstorage/recipe/controller_extension.json index fafc065e..5054767e 100644 --- a/src/generated/resources/data/functionalstorage/recipes/controller_extension.json +++ b/src/generated/resources/data/functionalstorage/recipe/controller_extension.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "B": { - "tag": "forge:storage_blocks/quartz" + "item": "minecraft:quartz_block" }, "C": { "tag": "functionalstorage:drawer" @@ -18,7 +18,7 @@ "item": "minecraft:repeater" }, "I": { - "tag": "forge:stone" + "tag": "c:stones" } }, "pattern": [ @@ -27,6 +27,7 @@ "IBI" ], "result": { - "item": "functionalstorage:controller_extension" + "count": 1, + "id": "functionalstorage:controller_extension" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/copper_upgrade.json b/src/generated/resources/data/functionalstorage/recipe/copper_upgrade.json similarity index 83% rename from src/generated/resources/data/functionalstorage/recipes/copper_upgrade.json rename to src/generated/resources/data/functionalstorage/recipe/copper_upgrade.json index 4ef5b225..b0cfcd1f 100644 --- a/src/generated/resources/data/functionalstorage/recipes/copper_upgrade.json +++ b/src/generated/resources/data/functionalstorage/recipe/copper_upgrade.json @@ -12,7 +12,7 @@ "item": "minecraft:copper_block" }, "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "D": { "tag": "functionalstorage:drawer" @@ -27,6 +27,7 @@ "IBI" ], "result": { - "item": "functionalstorage:copper_upgrade" + "count": 1, + "id": "functionalstorage:copper_upgrade" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/crimson_1.json b/src/generated/resources/data/functionalstorage/recipe/crimson_1.json similarity index 80% rename from src/generated/resources/data/functionalstorage/recipes/crimson_1.json rename to src/generated/resources/data/functionalstorage/recipe/crimson_1.json index 499eb8a7..c4c72594 100644 --- a/src/generated/resources/data/functionalstorage/recipes/crimson_1.json +++ b/src/generated/resources/data/functionalstorage/recipe/crimson_1.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:crimson_planks" @@ -21,6 +21,7 @@ "PPP" ], "result": { - "item": "functionalstorage:crimson_1" + "count": 1, + "id": "functionalstorage:crimson_1" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/crimson_2.json b/src/generated/resources/data/functionalstorage/recipe/crimson_2.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/crimson_2.json rename to src/generated/resources/data/functionalstorage/recipe/crimson_2.json index 4858f58b..6bbe07b6 100644 --- a/src/generated/resources/data/functionalstorage/recipes/crimson_2.json +++ b/src/generated/resources/data/functionalstorage/recipe/crimson_2.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:crimson_planks" @@ -22,6 +22,6 @@ ], "result": { "count": 2, - "item": "functionalstorage:crimson_2" + "id": "functionalstorage:crimson_2" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/crimson_4.json b/src/generated/resources/data/functionalstorage/recipe/crimson_4.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/crimson_4.json rename to src/generated/resources/data/functionalstorage/recipe/crimson_4.json index 9ccb20f6..eebebb13 100644 --- a/src/generated/resources/data/functionalstorage/recipes/crimson_4.json +++ b/src/generated/resources/data/functionalstorage/recipe/crimson_4.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:crimson_planks" @@ -22,6 +22,6 @@ ], "result": { "count": 4, - "item": "functionalstorage:crimson_4" + "id": "functionalstorage:crimson_4" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/dark_oak_1.json b/src/generated/resources/data/functionalstorage/recipe/dark_oak_1.json similarity index 80% rename from src/generated/resources/data/functionalstorage/recipes/dark_oak_1.json rename to src/generated/resources/data/functionalstorage/recipe/dark_oak_1.json index 372862fb..abe37a6f 100644 --- a/src/generated/resources/data/functionalstorage/recipes/dark_oak_1.json +++ b/src/generated/resources/data/functionalstorage/recipe/dark_oak_1.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:dark_oak_planks" @@ -21,6 +21,7 @@ "PPP" ], "result": { - "item": "functionalstorage:dark_oak_1" + "count": 1, + "id": "functionalstorage:dark_oak_1" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/dark_oak_2.json b/src/generated/resources/data/functionalstorage/recipe/dark_oak_2.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/dark_oak_2.json rename to src/generated/resources/data/functionalstorage/recipe/dark_oak_2.json index 1b79aedc..00bf89fc 100644 --- a/src/generated/resources/data/functionalstorage/recipes/dark_oak_2.json +++ b/src/generated/resources/data/functionalstorage/recipe/dark_oak_2.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:dark_oak_planks" @@ -22,6 +22,6 @@ ], "result": { "count": 2, - "item": "functionalstorage:dark_oak_2" + "id": "functionalstorage:dark_oak_2" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/dark_oak_4.json b/src/generated/resources/data/functionalstorage/recipe/dark_oak_4.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/dark_oak_4.json rename to src/generated/resources/data/functionalstorage/recipe/dark_oak_4.json index ea7d6419..5aed907a 100644 --- a/src/generated/resources/data/functionalstorage/recipes/dark_oak_4.json +++ b/src/generated/resources/data/functionalstorage/recipe/dark_oak_4.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:dark_oak_planks" @@ -22,6 +22,6 @@ ], "result": { "count": 4, - "item": "functionalstorage:dark_oak_4" + "id": "functionalstorage:dark_oak_4" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/diamond_upgrade.json b/src/generated/resources/data/functionalstorage/recipe/diamond_upgrade.json similarity index 71% rename from src/generated/resources/data/functionalstorage/recipes/diamond_upgrade.json rename to src/generated/resources/data/functionalstorage/recipe/diamond_upgrade.json index bfbd6763..53201235 100644 --- a/src/generated/resources/data/functionalstorage/recipes/diamond_upgrade.json +++ b/src/generated/resources/data/functionalstorage/recipe/diamond_upgrade.json @@ -9,16 +9,16 @@ "category": "misc", "key": { "B": { - "tag": "forge:storage_blocks/diamond" + "tag": "c:storage_blocks/diamond" }, "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "D": { "item": "functionalstorage:gold_upgrade" }, "I": { - "tag": "forge:gems/diamond" + "tag": "c:gems/diamond" } }, "pattern": [ @@ -27,6 +27,7 @@ "IBI" ], "result": { - "item": "functionalstorage:diamond_upgrade" + "count": 1, + "id": "functionalstorage:diamond_upgrade" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/ender_drawer.json b/src/generated/resources/data/functionalstorage/recipe/ender_drawer.json similarity index 81% rename from src/generated/resources/data/functionalstorage/recipes/ender_drawer.json rename to src/generated/resources/data/functionalstorage/recipe/ender_drawer.json index 1941d15a..ee1e5bd4 100644 --- a/src/generated/resources/data/functionalstorage/recipes/ender_drawer.json +++ b/src/generated/resources/data/functionalstorage/recipe/ender_drawer.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/ender" + "tag": "c:chests/ender" }, "L": { "tag": "functionalstorage:drawer" @@ -24,6 +24,7 @@ "PPP" ], "result": { - "item": "functionalstorage:ender_drawer" + "count": 1, + "id": "functionalstorage:ender_drawer" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/fluid_1.json b/src/generated/resources/data/functionalstorage/recipe/fluid_1.json similarity index 87% rename from src/generated/resources/data/functionalstorage/recipes/fluid_1.json rename to src/generated/resources/data/functionalstorage/recipe/fluid_1.json index 59b4d50c..bd6c7ef1 100644 --- a/src/generated/resources/data/functionalstorage/recipes/fluid_1.json +++ b/src/generated/resources/data/functionalstorage/recipe/fluid_1.json @@ -21,6 +21,7 @@ "PPP" ], "result": { - "item": "functionalstorage:fluid_1" + "count": 1, + "id": "functionalstorage:fluid_1" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/fluid_2.json b/src/generated/resources/data/functionalstorage/recipe/fluid_2.json similarity index 90% rename from src/generated/resources/data/functionalstorage/recipes/fluid_2.json rename to src/generated/resources/data/functionalstorage/recipe/fluid_2.json index f7113b2c..355d5a41 100644 --- a/src/generated/resources/data/functionalstorage/recipes/fluid_2.json +++ b/src/generated/resources/data/functionalstorage/recipe/fluid_2.json @@ -22,6 +22,6 @@ ], "result": { "count": 2, - "item": "functionalstorage:fluid_2" + "id": "functionalstorage:fluid_2" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/fluid_4.json b/src/generated/resources/data/functionalstorage/recipe/fluid_4.json similarity index 90% rename from src/generated/resources/data/functionalstorage/recipes/fluid_4.json rename to src/generated/resources/data/functionalstorage/recipe/fluid_4.json index 58204ce1..ff4c763d 100644 --- a/src/generated/resources/data/functionalstorage/recipes/fluid_4.json +++ b/src/generated/resources/data/functionalstorage/recipe/fluid_4.json @@ -22,6 +22,6 @@ ], "result": { "count": 4, - "item": "functionalstorage:fluid_4" + "id": "functionalstorage:fluid_4" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/framed_1.json b/src/generated/resources/data/functionalstorage/recipe/framed_1.json similarity index 80% rename from src/generated/resources/data/functionalstorage/recipes/framed_1.json rename to src/generated/resources/data/functionalstorage/recipe/framed_1.json index 6bb970d7..688c8626 100644 --- a/src/generated/resources/data/functionalstorage/recipes/framed_1.json +++ b/src/generated/resources/data/functionalstorage/recipe/framed_1.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:iron_nugget" @@ -21,6 +21,7 @@ "PPP" ], "result": { - "item": "functionalstorage:framed_1" + "count": 1, + "id": "functionalstorage:framed_1" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/framed_2.json b/src/generated/resources/data/functionalstorage/recipe/framed_2.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/framed_2.json rename to src/generated/resources/data/functionalstorage/recipe/framed_2.json index adf56d9c..cf3bfb56 100644 --- a/src/generated/resources/data/functionalstorage/recipes/framed_2.json +++ b/src/generated/resources/data/functionalstorage/recipe/framed_2.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:iron_nugget" @@ -22,6 +22,6 @@ ], "result": { "count": 2, - "item": "functionalstorage:framed_2" + "id": "functionalstorage:framed_2" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/framed_4.json b/src/generated/resources/data/functionalstorage/recipe/framed_4.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/framed_4.json rename to src/generated/resources/data/functionalstorage/recipe/framed_4.json index 4731de99..6571abc2 100644 --- a/src/generated/resources/data/functionalstorage/recipes/framed_4.json +++ b/src/generated/resources/data/functionalstorage/recipe/framed_4.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:iron_nugget" @@ -22,6 +22,6 @@ ], "result": { "count": 4, - "item": "functionalstorage:framed_4" + "id": "functionalstorage:framed_4" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/framed_controller_extension.json b/src/generated/resources/data/functionalstorage/recipe/framed_controller_extension.json similarity index 80% rename from src/generated/resources/data/functionalstorage/recipes/framed_controller_extension.json rename to src/generated/resources/data/functionalstorage/recipe/framed_controller_extension.json index 7efc2472..050cadc2 100644 --- a/src/generated/resources/data/functionalstorage/recipes/framed_controller_extension.json +++ b/src/generated/resources/data/functionalstorage/recipe/framed_controller_extension.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "B": { - "tag": "forge:storage_blocks/quartz" + "item": "minecraft:quartz_block" }, "C": { "tag": "functionalstorage:drawer" @@ -27,6 +27,7 @@ "IBI" ], "result": { - "item": "functionalstorage:framed_controller_extension" + "count": 1, + "id": "functionalstorage:framed_controller_extension" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/framed_simple_compacting_drawer.json b/src/generated/resources/data/functionalstorage/recipe/framed_simple_compacting_drawer.json similarity index 81% rename from src/generated/resources/data/functionalstorage/recipes/framed_simple_compacting_drawer.json rename to src/generated/resources/data/functionalstorage/recipe/framed_simple_compacting_drawer.json index ed91529b..5a5dc258 100644 --- a/src/generated/resources/data/functionalstorage/recipes/framed_simple_compacting_drawer.json +++ b/src/generated/resources/data/functionalstorage/recipe/framed_simple_compacting_drawer.json @@ -12,7 +12,7 @@ "tag": "functionalstorage:drawer" }, "I": { - "tag": "forge:ingots/iron" + "tag": "c:ingots/iron" }, "P": { "item": "minecraft:piston" @@ -27,6 +27,7 @@ "SIS" ], "result": { - "item": "functionalstorage:framed_simple_compacting_drawer" + "count": 1, + "id": "functionalstorage:framed_simple_compacting_drawer" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/framed_storage_controller.json b/src/generated/resources/data/functionalstorage/recipe/framed_storage_controller.json similarity index 81% rename from src/generated/resources/data/functionalstorage/recipes/framed_storage_controller.json rename to src/generated/resources/data/functionalstorage/recipe/framed_storage_controller.json index d7f9eaa0..fc920baa 100644 --- a/src/generated/resources/data/functionalstorage/recipes/framed_storage_controller.json +++ b/src/generated/resources/data/functionalstorage/recipe/framed_storage_controller.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "B": { - "tag": "forge:storage_blocks/quartz" + "item": "minecraft:quartz_block" }, "C": { "tag": "functionalstorage:drawer" @@ -27,6 +27,7 @@ "IBI" ], "result": { - "item": "functionalstorage:framed_storage_controller" + "count": 1, + "id": "functionalstorage:framed_storage_controller" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/gold_upgrade.json b/src/generated/resources/data/functionalstorage/recipe/gold_upgrade.json similarity index 71% rename from src/generated/resources/data/functionalstorage/recipes/gold_upgrade.json rename to src/generated/resources/data/functionalstorage/recipe/gold_upgrade.json index 103ec755..04bc75c2 100644 --- a/src/generated/resources/data/functionalstorage/recipes/gold_upgrade.json +++ b/src/generated/resources/data/functionalstorage/recipe/gold_upgrade.json @@ -9,16 +9,16 @@ "category": "misc", "key": { "B": { - "tag": "forge:storage_blocks/gold" + "tag": "c:storage_blocks/gold" }, "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "D": { "item": "functionalstorage:copper_upgrade" }, "I": { - "tag": "forge:ingots/gold" + "tag": "c:ingots/gold" } }, "pattern": [ @@ -27,6 +27,7 @@ "BIB" ], "result": { - "item": "functionalstorage:gold_upgrade" + "count": 1, + "id": "functionalstorage:gold_upgrade" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/iron_downgrade.json b/src/generated/resources/data/functionalstorage/recipe/iron_downgrade.json similarity index 79% rename from src/generated/resources/data/functionalstorage/recipes/iron_downgrade.json rename to src/generated/resources/data/functionalstorage/recipe/iron_downgrade.json index be63a129..3192a56c 100644 --- a/src/generated/resources/data/functionalstorage/recipes/iron_downgrade.json +++ b/src/generated/resources/data/functionalstorage/recipe/iron_downgrade.json @@ -12,7 +12,7 @@ "tag": "functionalstorage:drawer" }, "I": { - "tag": "forge:ingots/iron" + "tag": "c:ingots/iron" } }, "pattern": [ @@ -21,6 +21,7 @@ "III" ], "result": { - "item": "functionalstorage:iron_downgrade" + "count": 1, + "id": "functionalstorage:iron_downgrade" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/jungle_1.json b/src/generated/resources/data/functionalstorage/recipe/jungle_1.json similarity index 80% rename from src/generated/resources/data/functionalstorage/recipes/jungle_1.json rename to src/generated/resources/data/functionalstorage/recipe/jungle_1.json index 707ffbac..00be3917 100644 --- a/src/generated/resources/data/functionalstorage/recipes/jungle_1.json +++ b/src/generated/resources/data/functionalstorage/recipe/jungle_1.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:jungle_planks" @@ -21,6 +21,7 @@ "PPP" ], "result": { - "item": "functionalstorage:jungle_1" + "count": 1, + "id": "functionalstorage:jungle_1" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/jungle_2.json b/src/generated/resources/data/functionalstorage/recipe/jungle_2.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/jungle_2.json rename to src/generated/resources/data/functionalstorage/recipe/jungle_2.json index a898f74c..5b249f30 100644 --- a/src/generated/resources/data/functionalstorage/recipes/jungle_2.json +++ b/src/generated/resources/data/functionalstorage/recipe/jungle_2.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:jungle_planks" @@ -22,6 +22,6 @@ ], "result": { "count": 2, - "item": "functionalstorage:jungle_2" + "id": "functionalstorage:jungle_2" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/jungle_4.json b/src/generated/resources/data/functionalstorage/recipe/jungle_4.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/jungle_4.json rename to src/generated/resources/data/functionalstorage/recipe/jungle_4.json index 00734ad3..c8725d2f 100644 --- a/src/generated/resources/data/functionalstorage/recipes/jungle_4.json +++ b/src/generated/resources/data/functionalstorage/recipe/jungle_4.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:jungle_planks" @@ -22,6 +22,6 @@ ], "result": { "count": 4, - "item": "functionalstorage:jungle_4" + "id": "functionalstorage:jungle_4" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/linking_tool.json b/src/generated/resources/data/functionalstorage/recipe/linking_tool.json similarity index 83% rename from src/generated/resources/data/functionalstorage/recipes/linking_tool.json rename to src/generated/resources/data/functionalstorage/recipe/linking_tool.json index aa950547..59526cdf 100644 --- a/src/generated/resources/data/functionalstorage/recipes/linking_tool.json +++ b/src/generated/resources/data/functionalstorage/recipe/linking_tool.json @@ -15,7 +15,7 @@ "item": "minecraft:diamond" }, "G": { - "tag": "forge:ingots/gold" + "tag": "c:ingots/gold" }, "P": { "item": "minecraft:paper" @@ -27,6 +27,7 @@ "PEP" ], "result": { - "item": "functionalstorage:linking_tool" + "count": 1, + "id": "functionalstorage:linking_tool" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/mangrove_1.json b/src/generated/resources/data/functionalstorage/recipe/mangrove_1.json similarity index 80% rename from src/generated/resources/data/functionalstorage/recipes/mangrove_1.json rename to src/generated/resources/data/functionalstorage/recipe/mangrove_1.json index 69f4322d..fc51b827 100644 --- a/src/generated/resources/data/functionalstorage/recipes/mangrove_1.json +++ b/src/generated/resources/data/functionalstorage/recipe/mangrove_1.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:mangrove_planks" @@ -21,6 +21,7 @@ "PPP" ], "result": { - "item": "functionalstorage:mangrove_1" + "count": 1, + "id": "functionalstorage:mangrove_1" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/mangrove_2.json b/src/generated/resources/data/functionalstorage/recipe/mangrove_2.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/mangrove_2.json rename to src/generated/resources/data/functionalstorage/recipe/mangrove_2.json index 7242f89d..9c7352e3 100644 --- a/src/generated/resources/data/functionalstorage/recipes/mangrove_2.json +++ b/src/generated/resources/data/functionalstorage/recipe/mangrove_2.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:mangrove_planks" @@ -22,6 +22,6 @@ ], "result": { "count": 2, - "item": "functionalstorage:mangrove_2" + "id": "functionalstorage:mangrove_2" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/mangrove_4.json b/src/generated/resources/data/functionalstorage/recipe/mangrove_4.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/mangrove_4.json rename to src/generated/resources/data/functionalstorage/recipe/mangrove_4.json index a5590628..0de333d6 100644 --- a/src/generated/resources/data/functionalstorage/recipes/mangrove_4.json +++ b/src/generated/resources/data/functionalstorage/recipe/mangrove_4.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:mangrove_planks" @@ -22,6 +22,6 @@ ], "result": { "count": 4, - "item": "functionalstorage:mangrove_4" + "id": "functionalstorage:mangrove_4" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/netherite_upgrade.json b/src/generated/resources/data/functionalstorage/recipe/netherite_upgrade.json similarity index 80% rename from src/generated/resources/data/functionalstorage/recipes/netherite_upgrade.json rename to src/generated/resources/data/functionalstorage/recipe/netherite_upgrade.json index 79c358cf..282abe86 100644 --- a/src/generated/resources/data/functionalstorage/recipes/netherite_upgrade.json +++ b/src/generated/resources/data/functionalstorage/recipe/netherite_upgrade.json @@ -7,7 +7,8 @@ "item": "functionalstorage:diamond_upgrade" }, "result": { - "item": "functionalstorage:netherite_upgrade" + "count": 1, + "id": "functionalstorage:netherite_upgrade" }, "template": { "item": "minecraft:netherite_upgrade_smithing_template" diff --git a/src/generated/resources/data/functionalstorage/recipes/oak_1.json b/src/generated/resources/data/functionalstorage/recipe/oak_1.json similarity index 80% rename from src/generated/resources/data/functionalstorage/recipes/oak_1.json rename to src/generated/resources/data/functionalstorage/recipe/oak_1.json index 54cb95b2..5b6ac581 100644 --- a/src/generated/resources/data/functionalstorage/recipes/oak_1.json +++ b/src/generated/resources/data/functionalstorage/recipe/oak_1.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "type": "functionalstorage:woodless" @@ -21,6 +21,7 @@ "PPP" ], "result": { - "item": "functionalstorage:oak_1" + "count": 1, + "id": "functionalstorage:oak_1" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/oak_2.json b/src/generated/resources/data/functionalstorage/recipe/oak_2.json similarity index 83% rename from src/generated/resources/data/functionalstorage/recipes/oak_2.json rename to src/generated/resources/data/functionalstorage/recipe/oak_2.json index 3892da10..04699006 100644 --- a/src/generated/resources/data/functionalstorage/recipes/oak_2.json +++ b/src/generated/resources/data/functionalstorage/recipe/oak_2.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "type": "functionalstorage:woodless" @@ -22,6 +22,6 @@ ], "result": { "count": 2, - "item": "functionalstorage:oak_2" + "id": "functionalstorage:oak_2" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/oak_4.json b/src/generated/resources/data/functionalstorage/recipe/oak_4.json similarity index 83% rename from src/generated/resources/data/functionalstorage/recipes/oak_4.json rename to src/generated/resources/data/functionalstorage/recipe/oak_4.json index 3651b0b7..4994d2b4 100644 --- a/src/generated/resources/data/functionalstorage/recipes/oak_4.json +++ b/src/generated/resources/data/functionalstorage/recipe/oak_4.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "type": "functionalstorage:woodless" @@ -22,6 +22,6 @@ ], "result": { "count": 4, - "item": "functionalstorage:oak_4" + "id": "functionalstorage:oak_4" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/puller_upgrade.json b/src/generated/resources/data/functionalstorage/recipe/puller_upgrade.json similarity index 78% rename from src/generated/resources/data/functionalstorage/recipes/puller_upgrade.json rename to src/generated/resources/data/functionalstorage/recipe/puller_upgrade.json index 7861c62c..c4af841c 100644 --- a/src/generated/resources/data/functionalstorage/recipes/puller_upgrade.json +++ b/src/generated/resources/data/functionalstorage/recipe/puller_upgrade.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "B": { - "tag": "forge:dusts/redstone" + "tag": "c:dusts/redstone" }, "C": { "item": "minecraft:hopper" @@ -18,7 +18,7 @@ "tag": "functionalstorage:drawer" }, "I": { - "tag": "forge:stone" + "tag": "c:stones" } }, "pattern": [ @@ -27,6 +27,7 @@ "IBI" ], "result": { - "item": "functionalstorage:puller_upgrade" + "count": 1, + "id": "functionalstorage:puller_upgrade" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/pusher_upgrade.json b/src/generated/resources/data/functionalstorage/recipe/pusher_upgrade.json similarity index 78% rename from src/generated/resources/data/functionalstorage/recipes/pusher_upgrade.json rename to src/generated/resources/data/functionalstorage/recipe/pusher_upgrade.json index bcfd3491..cc0c76bb 100644 --- a/src/generated/resources/data/functionalstorage/recipes/pusher_upgrade.json +++ b/src/generated/resources/data/functionalstorage/recipe/pusher_upgrade.json @@ -9,13 +9,13 @@ "category": "misc", "key": { "B": { - "tag": "forge:dusts/redstone" + "tag": "c:dusts/redstone" }, "D": { "tag": "functionalstorage:drawer" }, "I": { - "tag": "forge:stone" + "tag": "c:stones" }, "R": { "item": "minecraft:hopper" @@ -27,6 +27,7 @@ "IRI" ], "result": { - "item": "functionalstorage:pusher_upgrade" + "count": 1, + "id": "functionalstorage:pusher_upgrade" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/redstone_upgrade.json b/src/generated/resources/data/functionalstorage/recipe/redstone_upgrade.json similarity index 88% rename from src/generated/resources/data/functionalstorage/recipes/redstone_upgrade.json rename to src/generated/resources/data/functionalstorage/recipe/redstone_upgrade.json index 1fd9c198..a014a25c 100644 --- a/src/generated/resources/data/functionalstorage/recipes/redstone_upgrade.json +++ b/src/generated/resources/data/functionalstorage/recipe/redstone_upgrade.json @@ -27,6 +27,7 @@ "IBI" ], "result": { - "item": "functionalstorage:redstone_upgrade" + "count": 1, + "id": "functionalstorage:redstone_upgrade" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/simple_compacting_drawer.json b/src/generated/resources/data/functionalstorage/recipe/simple_compacting_drawer.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/simple_compacting_drawer.json rename to src/generated/resources/data/functionalstorage/recipe/simple_compacting_drawer.json index 952bd933..ce8446a1 100644 --- a/src/generated/resources/data/functionalstorage/recipes/simple_compacting_drawer.json +++ b/src/generated/resources/data/functionalstorage/recipe/simple_compacting_drawer.json @@ -12,7 +12,7 @@ "tag": "functionalstorage:drawer" }, "I": { - "tag": "forge:ingots/iron" + "tag": "c:ingots/iron" }, "P": { "item": "minecraft:piston" @@ -27,6 +27,7 @@ "SIS" ], "result": { - "item": "functionalstorage:simple_compacting_drawer" + "count": 1, + "id": "functionalstorage:simple_compacting_drawer" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/spruce_1.json b/src/generated/resources/data/functionalstorage/recipe/spruce_1.json similarity index 80% rename from src/generated/resources/data/functionalstorage/recipes/spruce_1.json rename to src/generated/resources/data/functionalstorage/recipe/spruce_1.json index 4510aee1..2dd2ef29 100644 --- a/src/generated/resources/data/functionalstorage/recipes/spruce_1.json +++ b/src/generated/resources/data/functionalstorage/recipe/spruce_1.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:spruce_planks" @@ -21,6 +21,7 @@ "PPP" ], "result": { - "item": "functionalstorage:spruce_1" + "count": 1, + "id": "functionalstorage:spruce_1" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/spruce_2.json b/src/generated/resources/data/functionalstorage/recipe/spruce_2.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/spruce_2.json rename to src/generated/resources/data/functionalstorage/recipe/spruce_2.json index c5fad6a1..58e399a2 100644 --- a/src/generated/resources/data/functionalstorage/recipes/spruce_2.json +++ b/src/generated/resources/data/functionalstorage/recipe/spruce_2.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:spruce_planks" @@ -22,6 +22,6 @@ ], "result": { "count": 2, - "item": "functionalstorage:spruce_2" + "id": "functionalstorage:spruce_2" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/spruce_4.json b/src/generated/resources/data/functionalstorage/recipe/spruce_4.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/spruce_4.json rename to src/generated/resources/data/functionalstorage/recipe/spruce_4.json index 58c588b8..fa7cd71e 100644 --- a/src/generated/resources/data/functionalstorage/recipes/spruce_4.json +++ b/src/generated/resources/data/functionalstorage/recipe/spruce_4.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:spruce_planks" @@ -22,6 +22,6 @@ ], "result": { "count": 4, - "item": "functionalstorage:spruce_4" + "id": "functionalstorage:spruce_4" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/storage_controller.json b/src/generated/resources/data/functionalstorage/recipe/storage_controller.json similarity index 77% rename from src/generated/resources/data/functionalstorage/recipes/storage_controller.json rename to src/generated/resources/data/functionalstorage/recipe/storage_controller.json index 07419ca3..ca1ba35e 100644 --- a/src/generated/resources/data/functionalstorage/recipes/storage_controller.json +++ b/src/generated/resources/data/functionalstorage/recipe/storage_controller.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "B": { - "tag": "forge:storage_blocks/quartz" + "item": "minecraft:quartz_block" }, "C": { "tag": "functionalstorage:drawer" @@ -18,7 +18,7 @@ "item": "minecraft:comparator" }, "I": { - "tag": "forge:stone" + "tag": "c:stones" } }, "pattern": [ @@ -27,6 +27,7 @@ "IBI" ], "result": { - "item": "functionalstorage:storage_controller" + "count": 1, + "id": "functionalstorage:storage_controller" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/void_upgrade.json b/src/generated/resources/data/functionalstorage/recipe/void_upgrade.json similarity index 80% rename from src/generated/resources/data/functionalstorage/recipes/void_upgrade.json rename to src/generated/resources/data/functionalstorage/recipe/void_upgrade.json index 11c960c4..1cd309d2 100644 --- a/src/generated/resources/data/functionalstorage/recipes/void_upgrade.json +++ b/src/generated/resources/data/functionalstorage/recipe/void_upgrade.json @@ -12,7 +12,7 @@ "tag": "functionalstorage:drawer" }, "I": { - "tag": "forge:obsidian" + "tag": "c:obsidians" } }, "pattern": [ @@ -21,6 +21,7 @@ "III" ], "result": { - "item": "functionalstorage:void_upgrade" + "count": 1, + "id": "functionalstorage:void_upgrade" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/warped_1.json b/src/generated/resources/data/functionalstorage/recipe/warped_1.json similarity index 80% rename from src/generated/resources/data/functionalstorage/recipes/warped_1.json rename to src/generated/resources/data/functionalstorage/recipe/warped_1.json index 1cd750ae..fc9968c9 100644 --- a/src/generated/resources/data/functionalstorage/recipes/warped_1.json +++ b/src/generated/resources/data/functionalstorage/recipe/warped_1.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:warped_planks" @@ -21,6 +21,7 @@ "PPP" ], "result": { - "item": "functionalstorage:warped_1" + "count": 1, + "id": "functionalstorage:warped_1" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/warped_2.json b/src/generated/resources/data/functionalstorage/recipe/warped_2.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/warped_2.json rename to src/generated/resources/data/functionalstorage/recipe/warped_2.json index 5ced37c4..5ec94d18 100644 --- a/src/generated/resources/data/functionalstorage/recipes/warped_2.json +++ b/src/generated/resources/data/functionalstorage/recipe/warped_2.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:warped_planks" @@ -22,6 +22,6 @@ ], "result": { "count": 2, - "item": "functionalstorage:warped_2" + "id": "functionalstorage:warped_2" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/recipes/warped_4.json b/src/generated/resources/data/functionalstorage/recipe/warped_4.json similarity index 82% rename from src/generated/resources/data/functionalstorage/recipes/warped_4.json rename to src/generated/resources/data/functionalstorage/recipe/warped_4.json index e420cf3c..44264630 100644 --- a/src/generated/resources/data/functionalstorage/recipes/warped_4.json +++ b/src/generated/resources/data/functionalstorage/recipe/warped_4.json @@ -9,7 +9,7 @@ "category": "misc", "key": { "C": { - "tag": "forge:chests/wooden" + "tag": "c:chests/wooden" }, "P": { "item": "minecraft:warped_planks" @@ -22,6 +22,6 @@ ], "result": { "count": 4, - "item": "functionalstorage:warped_4" + "id": "functionalstorage:warped_4" } } \ No newline at end of file diff --git a/src/generated/resources/data/functionalstorage/tags/items/drawer.json b/src/generated/resources/data/functionalstorage/tags/item/drawer.json similarity index 94% rename from src/generated/resources/data/functionalstorage/tags/items/drawer.json rename to src/generated/resources/data/functionalstorage/tags/item/drawer.json index 0084ea57..eac0cbca 100644 --- a/src/generated/resources/data/functionalstorage/tags/items/drawer.json +++ b/src/generated/resources/data/functionalstorage/tags/item/drawer.json @@ -11,17 +11,6 @@ "functionalstorage:mangrove_1", "functionalstorage:cherry_1", "functionalstorage:framed_1", - "functionalstorage:oak_2", - "functionalstorage:spruce_2", - "functionalstorage:birch_2", - "functionalstorage:jungle_2", - "functionalstorage:acacia_2", - "functionalstorage:dark_oak_2", - "functionalstorage:crimson_2", - "functionalstorage:warped_2", - "functionalstorage:mangrove_2", - "functionalstorage:cherry_2", - "functionalstorage:framed_2", "functionalstorage:oak_4", "functionalstorage:spruce_4", "functionalstorage:birch_4", @@ -32,6 +21,17 @@ "functionalstorage:warped_4", "functionalstorage:mangrove_4", "functionalstorage:cherry_4", - "functionalstorage:framed_4" + "functionalstorage:framed_4", + "functionalstorage:oak_2", + "functionalstorage:spruce_2", + "functionalstorage:birch_2", + "functionalstorage:jungle_2", + "functionalstorage:acacia_2", + "functionalstorage:dark_oak_2", + "functionalstorage:crimson_2", + "functionalstorage:warped_2", + "functionalstorage:mangrove_2", + "functionalstorage:cherry_2", + "functionalstorage:framed_2" ] } \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/amethyst.json b/src/generated/resources/data/minecraft/recipe/functionalstorage/compacting/amethyst.json similarity index 56% rename from src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/amethyst.json rename to src/generated/resources/data/minecraft/recipe/functionalstorage/compacting/amethyst.json index 7cf19ea0..35b2b498 100644 --- a/src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/amethyst.json +++ b/src/generated/resources/data/minecraft/recipe/functionalstorage/compacting/amethyst.json @@ -1,10 +1,11 @@ { "type": "functionalstorage:custom_compacting", "higher_input": { - "item": "minecraft:amethyst_block" + "count": 1, + "id": "minecraft:amethyst_block" }, "lower_input": { "count": 4, - "item": "minecraft:amethyst_shard" + "id": "minecraft:amethyst_shard" } } \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/glowstone.json b/src/generated/resources/data/minecraft/recipe/functionalstorage/compacting/glowstone.json similarity index 57% rename from src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/glowstone.json rename to src/generated/resources/data/minecraft/recipe/functionalstorage/compacting/glowstone.json index 37ad6b17..3890a5b8 100644 --- a/src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/glowstone.json +++ b/src/generated/resources/data/minecraft/recipe/functionalstorage/compacting/glowstone.json @@ -1,10 +1,11 @@ { "type": "functionalstorage:custom_compacting", "higher_input": { - "item": "minecraft:glowstone" + "count": 1, + "id": "minecraft:glowstone" }, "lower_input": { "count": 4, - "item": "minecraft:glowstone_dust" + "id": "minecraft:glowstone_dust" } } \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/ice.json b/src/generated/resources/data/minecraft/recipe/functionalstorage/compacting/ice.json similarity index 60% rename from src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/ice.json rename to src/generated/resources/data/minecraft/recipe/functionalstorage/compacting/ice.json index 1425fc4a..c978d3d0 100644 --- a/src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/ice.json +++ b/src/generated/resources/data/minecraft/recipe/functionalstorage/compacting/ice.json @@ -1,10 +1,11 @@ { "type": "functionalstorage:custom_compacting", "higher_input": { - "item": "minecraft:packed_ice" + "count": 1, + "id": "minecraft:packed_ice" }, "lower_input": { "count": 9, - "item": "minecraft:ice" + "id": "minecraft:ice" } } \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/melon.json b/src/generated/resources/data/minecraft/recipe/functionalstorage/compacting/melon.json similarity index 59% rename from src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/melon.json rename to src/generated/resources/data/minecraft/recipe/functionalstorage/compacting/melon.json index e48931bd..51ba76c3 100644 --- a/src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/melon.json +++ b/src/generated/resources/data/minecraft/recipe/functionalstorage/compacting/melon.json @@ -1,10 +1,11 @@ { "type": "functionalstorage:custom_compacting", "higher_input": { - "item": "minecraft:melon" + "count": 1, + "id": "minecraft:melon" }, "lower_input": { "count": 9, - "item": "minecraft:melon_slice" + "id": "minecraft:melon_slice" } } \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/packed_ice.json b/src/generated/resources/data/minecraft/recipe/functionalstorage/compacting/packed_ice.json similarity index 59% rename from src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/packed_ice.json rename to src/generated/resources/data/minecraft/recipe/functionalstorage/compacting/packed_ice.json index 46ba85a2..04936133 100644 --- a/src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/packed_ice.json +++ b/src/generated/resources/data/minecraft/recipe/functionalstorage/compacting/packed_ice.json @@ -1,10 +1,11 @@ { "type": "functionalstorage:custom_compacting", "higher_input": { - "item": "minecraft:blue_ice" + "count": 1, + "id": "minecraft:blue_ice" }, "lower_input": { "count": 9, - "item": "minecraft:packed_ice" + "id": "minecraft:packed_ice" } } \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/quartz.json b/src/generated/resources/data/minecraft/recipe/functionalstorage/compacting/quartz.json similarity index 59% rename from src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/quartz.json rename to src/generated/resources/data/minecraft/recipe/functionalstorage/compacting/quartz.json index ec46807b..44f3a38d 100644 --- a/src/generated/resources/data/minecraft/recipes/functionalstorage/compacting/quartz.json +++ b/src/generated/resources/data/minecraft/recipe/functionalstorage/compacting/quartz.json @@ -1,10 +1,11 @@ { "type": "functionalstorage:custom_compacting", "higher_input": { - "item": "minecraft:quartz_block" + "count": 1, + "id": "minecraft:quartz_block" }, "lower_input": { "count": 4, - "item": "minecraft:quartz" + "id": "minecraft:quartz" } } \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json b/src/generated/resources/data/minecraft/tags/block/mineable/axe.json similarity index 94% rename from src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json rename to src/generated/resources/data/minecraft/tags/block/mineable/axe.json index 0084ea57..eac0cbca 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json +++ b/src/generated/resources/data/minecraft/tags/block/mineable/axe.json @@ -11,17 +11,6 @@ "functionalstorage:mangrove_1", "functionalstorage:cherry_1", "functionalstorage:framed_1", - "functionalstorage:oak_2", - "functionalstorage:spruce_2", - "functionalstorage:birch_2", - "functionalstorage:jungle_2", - "functionalstorage:acacia_2", - "functionalstorage:dark_oak_2", - "functionalstorage:crimson_2", - "functionalstorage:warped_2", - "functionalstorage:mangrove_2", - "functionalstorage:cherry_2", - "functionalstorage:framed_2", "functionalstorage:oak_4", "functionalstorage:spruce_4", "functionalstorage:birch_4", @@ -32,6 +21,17 @@ "functionalstorage:warped_4", "functionalstorage:mangrove_4", "functionalstorage:cherry_4", - "functionalstorage:framed_4" + "functionalstorage:framed_4", + "functionalstorage:oak_2", + "functionalstorage:spruce_2", + "functionalstorage:birch_2", + "functionalstorage:jungle_2", + "functionalstorage:acacia_2", + "functionalstorage:dark_oak_2", + "functionalstorage:crimson_2", + "functionalstorage:warped_2", + "functionalstorage:mangrove_2", + "functionalstorage:cherry_2", + "functionalstorage:framed_2" ] } \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/src/generated/resources/data/minecraft/tags/block/mineable/pickaxe.json similarity index 100% rename from src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json rename to src/generated/resources/data/minecraft/tags/block/mineable/pickaxe.json diff --git a/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java b/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java index f680f7c4..52fc2f1e 100644 --- a/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java +++ b/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java @@ -69,6 +69,7 @@ import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceLocation; +import net.minecraft.util.FastColor; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; @@ -83,6 +84,7 @@ import net.neoforged.api.distmarker.OnlyIn; import net.neoforged.bus.api.EventPriority; import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.ModContainer; import net.neoforged.fml.ModLoadingContext; import net.neoforged.fml.common.Mod; import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; @@ -166,7 +168,8 @@ public class FunctionalStorage extends ModuleController { public static Holder> CUSTOM_COMPACTING_RECIPE_TYPE; - public FunctionalStorage(Dist dist, IEventBus modBus) { + public FunctionalStorage(Dist dist, IEventBus modBus, ModContainer container) { + super(container); NeoForgeMod.enableMilkFluid(); FSAttachments.DR.register(modBus); if (dist.isClient()) { @@ -356,25 +359,25 @@ public void onClient() { LinkingToolItem.LinkingMode linkingMode = LinkingToolItem.getLinkingMode(stack); LinkingToolItem.ActionMode linkingAction = LinkingToolItem.getActionMode(stack); if (tint != 0 && stack.has(FSAttachments.ENDER_FREQUENCY)) { - return new Color(44, 150, 88).getRGB(); + return FastColor.ARGB32.opaque(new Color(44, 150, 88).getRGB()); } if (tint == 3 && stack.has(FSAttachments.CONTROLLER)) { - return Color.RED.getRGB(); + return FastColor.ARGB32.opaque(Color.RED.getRGB()); } if (tint == 1) { - return linkingMode.getColor().getValue(); + return FastColor.ARGB32.opaque(linkingMode.getColor().getValue()); } if (tint == 2) { - return linkingAction.getColor().getValue(); + return FastColor.ARGB32.opaque(linkingAction.getColor().getValue()); } - return 0xffffff; + return -1; }, LINKING_TOOL.get()); item.getItemColors().register((stack, tint) -> { ConfigurationToolItem.ConfigurationAction action = ConfigurationToolItem.getAction(stack); if (tint == 1) { - return action.getColor().getValue(); + return FastColor.ARGB32.opaque(action.getColor().getValue()); } - return 0xffffff; + return -1; }, CONFIGURATION_TOOL.get()); }).subscribe(); EventManager.mod(FMLClientSetupEvent.class).process(event -> { From 20d3396041ce94fdc1d66852adb0edf1077dad72 Mon Sep 17 00:00:00 2001 From: Matyrobbrt Date: Tue, 2 Jul 2024 23:12:23 +0300 Subject: [PATCH 12/20] Updates --- build.gradle | 6 ++++-- gradle.properties | 4 ++-- .../block/FluidDrawerBlock.java | 2 +- .../client/FluidDrawerRenderer.java | 17 +++++++++-------- .../fluid/BigFluidHandler.java | 2 +- .../resources/META-INF/accesstransformer.cfg | 7 +------ 6 files changed, 18 insertions(+), 20 deletions(-) diff --git a/build.gradle b/build.gradle index 4e1f5cf3..315e2390 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'net.neoforged.moddev' version '0.1.112' + id 'net.neoforged.moddev' version '0.1.120' id 'maven-publish' } @@ -43,6 +43,8 @@ neoForge { mappingsVersion = '2024.06.23' } + validateAccessTransformers = true + runs { client { client() @@ -66,7 +68,7 @@ neoForge { dependencies { compileOnly "mezz.jei:jei-1.21-common-api:$jei_version" compileOnly "mezz.jei:jei-1.21-neoforge-api:$jei_version" -// runtimeOnly "mezz.jei:jei-1.21-neoforge:$jei_version" + runtimeOnly "mezz.jei:jei-1.21-neoforge:$jei_version" implementation('com.hrznstudio:titanium') { transitive = false } diff --git a/gradle.properties b/gradle.properties index 3bd7a1d9..234cf2e0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,5 +3,5 @@ modGroup=com.buuz135 mod_version=1.0.2 modBaseName=functionalstorage -neo_version=21.0.37-beta -jei_version=19.0.0.9 +neo_version=21.0.47-beta +jei_version=19.0.0.14 diff --git a/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java index 8152dd7d..2879fe4f 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java @@ -142,7 +142,7 @@ public void appendHoverText(ItemStack itemStack, Item.TooltipContext context, Li var tileTag = itemStack.get(FSAttachments.TILE).getCompound("fluidHandler"); tooltip.add(Component.translatable("drawer.block.contents").withStyle(ChatFormatting.GRAY)); for (int i = 0; i < type.getSlots(); i++) { - FluidStack stack = FluidStack.CODEC.decode(RegistryOps.create(NbtOps.INSTANCE, Utils.registryAccess()), tileTag.getCompound(i + "")).getOrThrow().getFirst(); + FluidStack stack = FluidStack.OPTIONAL_CODEC.decode(RegistryOps.create(NbtOps.INSTANCE, Utils.registryAccess()), tileTag.getCompound(i + "")).getOrThrow().getFirst(); if (!stack.isEmpty()) tooltip.add(Component.literal(" - " + ChatFormatting.YELLOW + NumberUtils.getFormatedFluidBigNumber(stack.getAmount()) + ChatFormatting.WHITE + " of ").append(stack.getHoverName().copy().withStyle(ChatFormatting.GOLD))); } diff --git a/src/main/java/com/buuz135/functionalstorage/client/FluidDrawerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/FluidDrawerRenderer.java index 1d8ab505..683c9889 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/FluidDrawerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/FluidDrawerRenderer.java @@ -6,6 +6,7 @@ import com.buuz135.functionalstorage.fluid.BigFluidHandler; import com.buuz135.functionalstorage.item.ConfigurationToolItem; import com.buuz135.functionalstorage.util.NumberUtils; +import com.mojang.blaze3d.vertex.BufferUploader; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.math.Axis; @@ -64,10 +65,10 @@ public static void renderFluidStack(PoseStack matrixStack, MultiBufferSource buf float u2 = still.getU(bx2); float v1 = still.getV(bz1); float v2 = still.getV(bz2); - builder.addVertex(posMat, x1, y2, z2).setColor(red, green, blue, alpha).setUv(u1, v2).setOverlay(combinedOverlay).setNormal(0f, 1f, 0f); - builder.addVertex(posMat, x2, y2, z2).setColor(red, green, blue, alpha).setUv(u2, v2).setOverlay(combinedOverlay).setNormal(0f, 1f, 0f); - builder.addVertex(posMat, x2, y2, z1).setColor(red, green, blue, alpha).setUv(u2, v1).setOverlay(combinedOverlay).setNormal(0f, 1f, 0f); - builder.addVertex(posMat, x1, y2, z1).setColor(red, green, blue, alpha).setUv(u1, v1).setOverlay(combinedOverlay).setNormal(0f, 1f, 0f); + builder.addVertex(posMat, x1, y2, z2).setColor(red, green, blue, alpha).setUv(u1, v2).setOverlay(combinedOverlay).setLight(combinedLight).setNormal(0f, 1f, 0f); + builder.addVertex(posMat, x2, y2, z2).setColor(red, green, blue, alpha).setUv(u2, v2).setOverlay(combinedOverlay).setLight(combinedLight).setNormal(0f, 1f, 0f); + builder.addVertex(posMat, x2, y2, z1).setColor(red, green, blue, alpha).setUv(u2, v1).setOverlay(combinedOverlay).setLight(combinedLight).setNormal(0f, 1f, 0f); + builder.addVertex(posMat, x1, y2, z1).setColor(red, green, blue, alpha).setUv(u1, v1).setOverlay(combinedOverlay).setLight(combinedLight).setNormal(0f, 1f, 0f); } //FRONT if (true) { @@ -75,10 +76,10 @@ public static void renderFluidStack(PoseStack matrixStack, MultiBufferSource buf float u2 = still.getU(bx2); float v1 = still.getV(by1); float v2 = still.getV(by2); - builder.addVertex(posMat, x2, y1, z2).setColor(red, green, blue, alpha).setUv(u2, v1).setOverlay(combinedOverlay).setNormal(0f, 0f, 1f); - builder.addVertex(posMat, x2, y2, z2).setColor(red, green, blue, alpha).setUv(u2, v2).setOverlay(combinedOverlay).setNormal(0f, 0f, 1f); - builder.addVertex(posMat, x1, y2, z2).setColor(red, green, blue, alpha).setUv(u1, v2).setOverlay(combinedOverlay).setNormal(0f, 0f, 1f); - builder.addVertex(posMat, x1, y1, z2).setColor(red, green, blue, alpha).setUv(u1, v1).setOverlay(combinedOverlay).setNormal(0f, 0f, 1f); + builder.addVertex(posMat, x2, y1, z2).setColor(red, green, blue, alpha).setUv(u2, v1).setOverlay(combinedOverlay).setLight(combinedLight).setNormal(0f, 0f, 1f); + builder.addVertex(posMat, x2, y2, z2).setColor(red, green, blue, alpha).setUv(u2, v2).setOverlay(combinedOverlay).setLight(combinedLight).setNormal(0f, 0f, 1f); + builder.addVertex(posMat, x1, y2, z2).setColor(red, green, blue, alpha).setUv(u1, v2).setOverlay(combinedOverlay).setLight(combinedLight).setNormal(0f, 0f, 1f); + builder.addVertex(posMat, x1, y1, z2).setColor(red, green, blue, alpha).setUv(u1, v1).setOverlay(combinedOverlay).setLight(combinedLight).setNormal(0f, 0f, 1f); } matrixStack.popPose(); diff --git a/src/main/java/com/buuz135/functionalstorage/fluid/BigFluidHandler.java b/src/main/java/com/buuz135/functionalstorage/fluid/BigFluidHandler.java index 4bd3a505..f5789ed9 100644 --- a/src/main/java/com/buuz135/functionalstorage/fluid/BigFluidHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/fluid/BigFluidHandler.java @@ -124,7 +124,7 @@ public CompoundTag serializeNBT(net.minecraft.core.HolderLookup.Provider provide CompoundTag compoundTag = new CompoundTag(); for (int i = 0; i < this.tanks.length; i++) { compoundTag.put(i + "", this.tanks[i].writeToNBT(provider, new CompoundTag())); - compoundTag.put("Locked" + i, FluidStack.CODEC.encodeStart(RegistryOps.create(NbtOps.INSTANCE, provider), this.filterStack[i]).getOrThrow()); + compoundTag.put("Locked" + i, FluidStack.OPTIONAL_CODEC.encodeStart(RegistryOps.create(NbtOps.INSTANCE, provider), this.filterStack[i]).getOrThrow()); } compoundTag.putInt("Capacity", this.capacity); return compoundTag; diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index aac003ac..4b55dc60 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -1,7 +1,2 @@ public net.minecraft.client.renderer.RenderStateShard$LineStateShard -public net.minecraft.client.renderer.block.model.BlockModel f_111419_ # parentLocation -public net.minecraft.client.renderer.block.model.BlockModel m_111437_(Lnet/minecraft/client/renderer/block/model/BlockElement;Lnet/minecraft/client/renderer/block/model/BlockElementFace;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraft/core/Direction;Lnet/minecraft/client/resources/model/ModelState;Lnet/minecraft/resources/ResourceLocation;)Lnet/minecraft/client/renderer/block/model/BakedQuad; # bakeFace -public net.minecraft.client.renderer.block.model.BlockModel$Deserializer m_111503_(Lnet/minecraft/resources/ResourceLocation;Ljava/lang/String;)Lcom/mojang/datafixers/util/Either; # findTexture - -public net.minecraft.client.resources.model.WeightedBakedModel f_119542_ # baseModel -public net.minecraft.client.resources.model.MultiPartBakedModel f_119459_ # selectors \ No newline at end of file +public net.minecraft.client.renderer.LevelRenderer renderShape(Lcom/mojang/blaze3d/vertex/PoseStack;Lcom/mojang/blaze3d/vertex/VertexConsumer;Lnet/minecraft/world/phys/shapes/VoxelShape;DDDFFFF)V From e3c52ce661b16f78caaa8d9f7557905cdcf0f6e6 Mon Sep 17 00:00:00 2001 From: Matyrobbrt Date: Wed, 3 Jul 2024 14:11:43 +0300 Subject: [PATCH 13/20] Rerun datagen --- .../361def3a0b0e87157892b021be1ddec9d13d5e52 | 4 +- .../client/item/CompactingDrawerISTER.java | 82 +++++++--------- .../client/item/DrawerISTER.java | 95 ++++++++----------- .../client/item/FluidDrawerISTER.java | 67 ++++--------- .../client/item/FunctionalStorageISTER.java | 40 +++++++- 5 files changed, 127 insertions(+), 161 deletions(-) diff --git a/src/generated/resources/.cache/361def3a0b0e87157892b021be1ddec9d13d5e52 b/src/generated/resources/.cache/361def3a0b0e87157892b021be1ddec9d13d5e52 index 9ad75acc..18e8d0c8 100644 --- a/src/generated/resources/.cache/361def3a0b0e87157892b021be1ddec9d13d5e52 +++ b/src/generated/resources/.cache/361def3a0b0e87157892b021be1ddec9d13d5e52 @@ -1,2 +1,2 @@ -// 1.21 2024-07-02T16:34:01.4489282 Languages: en_us for mod: functionalstorage -b19790b3d072a6c205ea1c45096b36437dde4fbf assets/functionalstorage/lang/en_us.json +// 1.21 2024-07-03T14:10:47.9813049 Languages: en_us for mod: functionalstorage +420714f8a154b4e1d2b704bd200b1357ac682aa9 assets/functionalstorage/lang/en_us.json diff --git a/src/main/java/com/buuz135/functionalstorage/client/item/CompactingDrawerISTER.java b/src/main/java/com/buuz135/functionalstorage/client/item/CompactingDrawerISTER.java index 6c99fa5d..1e71cb3a 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/item/CompactingDrawerISTER.java +++ b/src/main/java/com/buuz135/functionalstorage/client/item/CompactingDrawerISTER.java @@ -1,41 +1,41 @@ package com.buuz135.functionalstorage.client.item; -import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.block.tile.ControllableDrawerTile; import com.buuz135.functionalstorage.client.DrawerRenderer; import com.buuz135.functionalstorage.client.model.FramedDrawerModelData; +import com.buuz135.functionalstorage.item.FSAttachments; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Axis; -import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; -import it.unimi.dsi.fastutil.objects.Object2ObjectFunction; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.packs.resources.ResourceManager; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.client.model.data.ModelData; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.client.model.data.ModelData; import org.jetbrains.annotations.NotNull; import org.joml.Vector3f; import java.util.HashMap; +import java.util.IdentityHashMap; import static com.buuz135.functionalstorage.util.MathUtils.createTransformMatrix; -public class CompactingDrawerISTER extends FunctionalStorageISTER{ +public class CompactingDrawerISTER extends FunctionalStorageISTER { public static CompactingDrawerISTER NORMAL = new CompactingDrawerISTER(false); public static CompactingDrawerISTER SIMPLE = new CompactingDrawerISTER(true); private final boolean simple; - private final Object2ObjectArrayMap modelCache; + private final IdentityHashMap modelCache; public CompactingDrawerISTER(boolean simple) { this.simple = simple; - this.modelCache = new Object2ObjectArrayMap<>(); + this.modelCache = new IdentityHashMap<>(); } @Override @@ -44,76 +44,60 @@ public void onResourceManagerReload(@NotNull ResourceManager resourceManager) { } @Override - public void renderByItem(@NotNull ItemStack stack, @NotNull ItemDisplayContext displayContext, @NotNull PoseStack matrix, @NotNull MultiBufferSource renderer, int light, int overlayLight) { - var modelData = ModelData.EMPTY; - if (stack.hasTag() && stack.getTag().contains("Style")){ - modelData = modelCache.computeIfAbsent(stack.hashCode(), new Object2ObjectFunction() { - @Override - public ModelData get(Object o) { - var tag = stack.getTag().getCompound("Style"); - HashMap data = new HashMap<>(); - data.put("particle", ForgeRegistries.ITEMS.getValue(new ResourceLocation(tag.getString("particle")))); - data.put("front", ForgeRegistries.ITEMS.getValue(new ResourceLocation(tag.getString("front")))); - data.put("side", ForgeRegistries.ITEMS.getValue(new ResourceLocation(tag.getString("side")))); - data.put("front_divider", ForgeRegistries.ITEMS.getValue(new ResourceLocation(tag.getString("front_divider")))); - var framedDrawerModelData = new FramedDrawerModelData(data); - return ModelData.builder().with(FramedDrawerModelData.FRAMED_PROPERTY, framedDrawerModelData).build(); - } - }); - } + public void renderByItem(HolderLookup.Provider access, @NotNull ItemStack stack, @NotNull ItemDisplayContext displayContext, @NotNull PoseStack matrix, @NotNull MultiBufferSource renderer, int light, int overlayLight) { + var modelData = getData(stack); renderBlockItem(stack, displayContext, matrix, renderer, light, overlayLight, modelData); - if (stack.hasTag()){ + if (stack.has(FSAttachments.TILE)) { var options = new ControllableDrawerTile.DrawerOptions(); - if (stack.getTag().contains("Tile")) options.deserializeNBT(stack.getTagElement("Tile").getCompound("drawerOptions")); + options.deserializeNBT(Minecraft.getInstance().level.registryAccess(), stack.get(FSAttachments.TILE).getCompound("drawerOptions")); matrix.mulPose(Axis.YP.rotationDegrees(180)); - matrix.translate(-1,0,0); - stack.getCapability(ForgeCapabilities.ITEM_HANDLER).ifPresent(iItemHandler -> { + matrix.translate(-1, 0, 0); + var iItemHandler = stack.getCapability(Capabilities.ItemHandler.ITEM); + if (iItemHandler != null) { if (simple) { ItemStack internalStack = iItemHandler.getStackInSlot(0); - if (!internalStack.isEmpty()){ + if (!internalStack.isEmpty()) { matrix.pushPose(); - matrix.mulPoseMatrix(createTransformMatrix( + matrix.mulPose(createTransformMatrix( new Vector3f(0.5f, 0.27f, 0.0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); - DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, internalStack, internalStack.getCount(), iItemHandler.getSlotLimit(0), 0.02f, options, Minecraft.getInstance().level); + DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, internalStack, internalStack.getCount(), iItemHandler.getSlotLimit(0), 0.02f, options, Minecraft.getInstance().level); matrix.popPose(); } internalStack = iItemHandler.getStackInSlot(1); - if (!internalStack.isEmpty()){ + if (!internalStack.isEmpty()) { matrix.pushPose(); - matrix.mulPoseMatrix(createTransformMatrix( + matrix.mulPose(createTransformMatrix( new Vector3f(0.5f, 0.77f, 0.0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); - DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, internalStack, internalStack.getCount(), iItemHandler.getSlotLimit(1), 0.02f, options, Minecraft.getInstance().level); + DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, internalStack, internalStack.getCount(), iItemHandler.getSlotLimit(1), 0.02f, options, Minecraft.getInstance().level); matrix.popPose(); } } else { ItemStack internalStack = iItemHandler.getStackInSlot(0); - if (!internalStack.isEmpty()){ + if (!internalStack.isEmpty()) { matrix.pushPose(); - matrix.mulPoseMatrix(createTransformMatrix( + matrix.mulPose(createTransformMatrix( new Vector3f(.75f, .27f, .0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); - DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, internalStack, internalStack.getCount(), iItemHandler.getSlotLimit(0), 0.02f, options, Minecraft.getInstance().level); + DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, internalStack, internalStack.getCount(), iItemHandler.getSlotLimit(0), 0.02f, options, Minecraft.getInstance().level); matrix.popPose(); } internalStack = iItemHandler.getStackInSlot(1); - if (!internalStack.isEmpty()){ + if (!internalStack.isEmpty()) { matrix.pushPose(); - matrix.mulPoseMatrix(createTransformMatrix( + matrix.mulPose(createTransformMatrix( new Vector3f(.25f, .27f, .0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); - DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, internalStack, internalStack.getCount(), iItemHandler.getSlotLimit(1), 0.02f, options, Minecraft.getInstance().level); + DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, internalStack, internalStack.getCount(), iItemHandler.getSlotLimit(1), 0.02f, options, Minecraft.getInstance().level); matrix.popPose(); } internalStack = iItemHandler.getStackInSlot(2); - if (!internalStack.isEmpty()){ + if (!internalStack.isEmpty()) { matrix.pushPose(); - matrix.mulPoseMatrix(createTransformMatrix( - new Vector3f(.5f, .77f, .0005f),new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); - DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, internalStack, internalStack.getCount(), iItemHandler.getSlotLimit(2), 0.02f, options, Minecraft.getInstance().level); + matrix.mulPose(createTransformMatrix( + new Vector3f(.5f, .77f, .0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); + DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, internalStack, internalStack.getCount(), iItemHandler.getSlotLimit(2), 0.02f, options, Minecraft.getInstance().level); matrix.popPose(); } } - - }); + } } - } } diff --git a/src/main/java/com/buuz135/functionalstorage/client/item/DrawerISTER.java b/src/main/java/com/buuz135/functionalstorage/client/item/DrawerISTER.java index 07d51459..d9e4e211 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/item/DrawerISTER.java +++ b/src/main/java/com/buuz135/functionalstorage/client/item/DrawerISTER.java @@ -3,41 +3,37 @@ import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.block.tile.ControllableDrawerTile; import com.buuz135.functionalstorage.client.DrawerRenderer; -import com.buuz135.functionalstorage.client.model.FramedDrawerModelData; +import com.buuz135.functionalstorage.item.FSAttachments; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Axis; -import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; -import it.unimi.dsi.fastutil.objects.Object2ObjectFunction; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.MultiBufferSource; -import net.minecraft.resources.ResourceLocation; +import net.minecraft.core.HolderLookup; import net.minecraft.server.packs.resources.ResourceManager; -import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.client.model.data.ModelData; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.client.model.data.ModelData; import org.jetbrains.annotations.NotNull; import org.joml.Vector3f; -import java.util.HashMap; +import java.util.IdentityHashMap; import static com.buuz135.functionalstorage.util.MathUtils.createTransformMatrix; public class DrawerISTER extends FunctionalStorageISTER{ - public static DrawerISTER SLOT_1 = new DrawerISTER(FunctionalStorage.DrawerType.X_1); - public static DrawerISTER SLOT_2 = new DrawerISTER(FunctionalStorage.DrawerType.X_2); - public static DrawerISTER SLOT_4 = new DrawerISTER(FunctionalStorage.DrawerType.X_4); + public static final DrawerISTER SLOT_1 = new DrawerISTER(FunctionalStorage.DrawerType.X_1); + public static final DrawerISTER SLOT_2 = new DrawerISTER(FunctionalStorage.DrawerType.X_2); + public static final DrawerISTER SLOT_4 = new DrawerISTER(FunctionalStorage.DrawerType.X_4); private final FunctionalStorage.DrawerType type; - private final Object2ObjectArrayMap modelCache; + private final IdentityHashMap modelCache; public DrawerISTER(FunctionalStorage.DrawerType type) { this.type = type; - this.modelCache = new Object2ObjectArrayMap<>(); + this.modelCache = new IdentityHashMap<>(); } @Override @@ -46,87 +42,72 @@ public void onResourceManagerReload(@NotNull ResourceManager resourceManager) { } @Override - public void renderByItem(@NotNull ItemStack stack, @NotNull ItemDisplayContext displayContext, @NotNull PoseStack matrix, @NotNull MultiBufferSource renderer, int light, int overlayLight) { - var modelData = ModelData.EMPTY; - if (stack.hasTag() && stack.getTag().contains("Style")){ - modelData = modelCache.computeIfAbsent(stack.hashCode(), new Object2ObjectFunction() { - @Override - public ModelData get(Object o) { - var tag = stack.getTag().getCompound("Style"); - HashMap data = new HashMap<>(); - data.put("particle", ForgeRegistries.ITEMS.getValue(new ResourceLocation(tag.getString("particle")))); - data.put("front", ForgeRegistries.ITEMS.getValue(new ResourceLocation(tag.getString("front")))); - data.put("side", ForgeRegistries.ITEMS.getValue(new ResourceLocation(tag.getString("side")))); - data.put("front_divider", ForgeRegistries.ITEMS.getValue(new ResourceLocation(tag.getString("front_divider")))); - var framedDrawerModelData = new FramedDrawerModelData(data); - return ModelData.builder().with(FramedDrawerModelData.FRAMED_PROPERTY, framedDrawerModelData).build(); - } - }); - } + public void renderByItem(HolderLookup.Provider access, @NotNull ItemStack stack, @NotNull ItemDisplayContext displayContext, @NotNull PoseStack matrix, @NotNull MultiBufferSource renderer, int light, int overlayLight) { + var modelData = getData(stack); renderBlockItem(stack, displayContext, matrix, renderer, light, overlayLight, modelData); - if (stack.hasTag()){ + if (stack.has(FSAttachments.TILE)) { var options = new ControllableDrawerTile.DrawerOptions(); - if (stack.getTag().contains("Tile")) options.deserializeNBT(stack.getTagElement("Tile").getCompound("drawerOptions")); + options.deserializeNBT(Minecraft.getInstance().level.registryAccess(), stack.get(FSAttachments.TILE).getCompound("drawerOptions")); matrix.mulPose(Axis.YP.rotationDegrees(180)); matrix.translate(-1,0,0); - stack.getCapability(ForgeCapabilities.ITEM_HANDLER).ifPresent(iItemHandler -> { - if (type == FunctionalStorage.DrawerType.X_1){ - if (!iItemHandler.getStackInSlot(0).isEmpty()){ + var iItemHandler = stack.getCapability(Capabilities.ItemHandler.ITEM); + if (iItemHandler != null) { + if (type == FunctionalStorage.DrawerType.X_1) { + if (!iItemHandler.getStackInSlot(0).isEmpty()) { matrix.translate(0.5, 0.5, 0); - DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, iItemHandler.getStackInSlot(0), iItemHandler.getStackInSlot(0).getCount(), iItemHandler.getSlotLimit(0), 0.02f, options , Minecraft.getInstance().level); + DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, iItemHandler.getStackInSlot(0), iItemHandler.getStackInSlot(0).getCount(), iItemHandler.getSlotLimit(0), 0.02f, options, Minecraft.getInstance().level); } } else if (type == FunctionalStorage.DrawerType.X_2) { - if (!iItemHandler.getStackInSlot(0).isEmpty()){ + if (!iItemHandler.getStackInSlot(0).isEmpty()) { matrix.pushPose(); - matrix.mulPoseMatrix(createTransformMatrix(new Vector3f(0.5f, 0.27f, 0.0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); + matrix.mulPose(createTransformMatrix(new Vector3f(0.5f, 0.27f, 0.0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); ItemStack insideStack = iItemHandler.getStackInSlot(0); - DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, insideStack, insideStack.getCount(), iItemHandler.getSlotLimit(0),0.02f, options, Minecraft.getInstance().level); + DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, insideStack, insideStack.getCount(), iItemHandler.getSlotLimit(0), 0.02f, options, Minecraft.getInstance().level); matrix.popPose(); } - if (!iItemHandler.getStackInSlot(1).isEmpty()){ + if (!iItemHandler.getStackInSlot(1).isEmpty()) { matrix.pushPose(); - matrix.mulPoseMatrix(createTransformMatrix( + matrix.mulPose(createTransformMatrix( new Vector3f(0.5f, 0.77f, 0.0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); ItemStack insideStack = iItemHandler.getStackInSlot(1); - DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, insideStack, insideStack.getCount(), iItemHandler.getSlotLimit(1),0.02f, options, Minecraft.getInstance().level); + DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, insideStack, insideStack.getCount(), iItemHandler.getSlotLimit(1), 0.02f, options, Minecraft.getInstance().level); matrix.popPose(); } } else if (type == FunctionalStorage.DrawerType.X_4) { - if (!iItemHandler.getStackInSlot(0).isEmpty()){ //BOTTOM RIGHT + if (!iItemHandler.getStackInSlot(0).isEmpty()) { //BOTTOM RIGHT matrix.pushPose(); - matrix.mulPoseMatrix(createTransformMatrix( + matrix.mulPose(createTransformMatrix( new Vector3f(.75f, .27f, .0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); ItemStack insideStack = iItemHandler.getStackInSlot(0); - DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, insideStack, insideStack.getCount(), iItemHandler.getSlotLimit(0),0.02f, options, Minecraft.getInstance().level); + DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, insideStack, insideStack.getCount(), iItemHandler.getSlotLimit(0), 0.02f, options, Minecraft.getInstance().level); matrix.popPose(); } - if (!iItemHandler.getStackInSlot(1).isEmpty()){ //BOTTOM LEFT + if (!iItemHandler.getStackInSlot(1).isEmpty()) { //BOTTOM LEFT matrix.pushPose(); - matrix.mulPoseMatrix(createTransformMatrix( + matrix.mulPose(createTransformMatrix( new Vector3f(.25f, .27f, .0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); ItemStack insideStack = iItemHandler.getStackInSlot(1); - DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, insideStack, insideStack.getCount(), iItemHandler.getSlotLimit(1),0.02f, options, Minecraft.getInstance().level); + DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, insideStack, insideStack.getCount(), iItemHandler.getSlotLimit(1), 0.02f, options, Minecraft.getInstance().level); matrix.popPose(); } - if (!iItemHandler.getStackInSlot(2).isEmpty()){ //TOP RIGHT + if (!iItemHandler.getStackInSlot(2).isEmpty()) { //TOP RIGHT matrix.pushPose(); - matrix.mulPoseMatrix(createTransformMatrix( + matrix.mulPose(createTransformMatrix( new Vector3f(.75f, .77f, .0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); ItemStack insideStack = iItemHandler.getStackInSlot(2); - DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, insideStack, insideStack.getCount(), iItemHandler.getSlotLimit(2),0.02f, options, Minecraft.getInstance().level); + DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, insideStack, insideStack.getCount(), iItemHandler.getSlotLimit(2), 0.02f, options, Minecraft.getInstance().level); matrix.popPose(); } - if (!iItemHandler.getStackInSlot(3).isEmpty()){ //TOP LEFT + if (!iItemHandler.getStackInSlot(3).isEmpty()) { //TOP LEFT matrix.pushPose(); - matrix.mulPoseMatrix(createTransformMatrix( + matrix.mulPose(createTransformMatrix( new Vector3f(.25f, .77f, .0005f), new Vector3f(0), new Vector3f(.5f, .5f, 1.0f))); ItemStack insideStack = iItemHandler.getStackInSlot(3); - DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, insideStack, insideStack.getCount(), iItemHandler.getSlotLimit(3),0.02f, options, Minecraft.getInstance().level); + DrawerRenderer.renderStack(matrix, renderer, light, overlayLight, insideStack, insideStack.getCount(), iItemHandler.getSlotLimit(3), 0.02f, options, Minecraft.getInstance().level); matrix.popPose(); } } - - }); + } } } diff --git a/src/main/java/com/buuz135/functionalstorage/client/item/FluidDrawerISTER.java b/src/main/java/com/buuz135/functionalstorage/client/item/FluidDrawerISTER.java index c187ead5..c61f8856 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/item/FluidDrawerISTER.java +++ b/src/main/java/com/buuz135/functionalstorage/client/item/FluidDrawerISTER.java @@ -2,45 +2,31 @@ import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.block.tile.ControllableDrawerTile; -import com.buuz135.functionalstorage.client.DrawerRenderer; import com.buuz135.functionalstorage.client.FluidDrawerRenderer; -import com.buuz135.functionalstorage.client.model.FramedDrawerModelData; +import com.buuz135.functionalstorage.item.FSAttachments; +import com.buuz135.functionalstorage.util.Utils; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Axis; -import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; -import it.unimi.dsi.fastutil.objects.Object2ObjectFunction; -import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.MultiBufferSource; -import net.minecraft.resources.ResourceLocation; +import net.minecraft.core.HolderLookup; import net.minecraft.server.packs.resources.ResourceManager; -import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.item.ItemStack; import net.minecraft.world.phys.AABB; -import net.minecraftforge.client.model.data.ModelData; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.fluids.FluidStack; import org.jetbrains.annotations.NotNull; -import org.joml.Vector3f; - -import java.util.HashMap; - -import static com.buuz135.functionalstorage.util.MathUtils.createTransformMatrix; public class FluidDrawerISTER extends FunctionalStorageISTER{ - public static FluidDrawerISTER SLOT_1 = new FluidDrawerISTER(FunctionalStorage.DrawerType.X_1); - public static FluidDrawerISTER SLOT_2 = new FluidDrawerISTER(FunctionalStorage.DrawerType.X_2); - public static FluidDrawerISTER SLOT_4 = new FluidDrawerISTER(FunctionalStorage.DrawerType.X_4); + public static final FluidDrawerISTER SLOT_1 = new FluidDrawerISTER(FunctionalStorage.DrawerType.X_1); + public static final FluidDrawerISTER SLOT_2 = new FluidDrawerISTER(FunctionalStorage.DrawerType.X_2); + public static final FluidDrawerISTER SLOT_4 = new FluidDrawerISTER(FunctionalStorage.DrawerType.X_4); private final FunctionalStorage.DrawerType type; - private final Object2ObjectArrayMap modelCache; public FluidDrawerISTER(FunctionalStorage.DrawerType type) { this.type = type; - this.modelCache = new Object2ObjectArrayMap<>(); } @Override @@ -49,45 +35,30 @@ public void onResourceManagerReload(@NotNull ResourceManager resourceManager) { } @Override - public void renderByItem(@NotNull ItemStack stack, @NotNull ItemDisplayContext displayContext, @NotNull PoseStack matrix, @NotNull MultiBufferSource renderer, int light, int overlayLight) { - var modelData = ModelData.EMPTY; - if (stack.hasTag() && stack.getTag().contains("Style")){ - modelData = modelCache.computeIfAbsent(stack.hashCode(), new Object2ObjectFunction() { - @Override - public ModelData get(Object o) { - var tag = stack.getTag().getCompound("Style"); - HashMap data = new HashMap<>(); - data.put("particle", ForgeRegistries.ITEMS.getValue(new ResourceLocation(tag.getString("particle")))); - data.put("front", ForgeRegistries.ITEMS.getValue(new ResourceLocation(tag.getString("front")))); - data.put("side", ForgeRegistries.ITEMS.getValue(new ResourceLocation(tag.getString("side")))); - data.put("front_divider", ForgeRegistries.ITEMS.getValue(new ResourceLocation(tag.getString("front_divider")))); - var framedDrawerModelData = new FramedDrawerModelData(data); - return ModelData.builder().with(FramedDrawerModelData.FRAMED_PROPERTY, framedDrawerModelData).build(); - } - }); - } + public void renderByItem(HolderLookup.Provider access, @NotNull ItemStack stack, @NotNull ItemDisplayContext displayContext, @NotNull PoseStack matrix, @NotNull MultiBufferSource renderer, int light, int overlayLight) { + var modelData = getData(stack); renderBlockItem(stack, displayContext, matrix, renderer, light, overlayLight, modelData); - if (stack.hasTag() && stack.getTag().contains("Tile")){ + if (stack.has(FSAttachments.TILE)) { var options = new ControllableDrawerTile.DrawerOptions(); - if (stack.getTag().contains("Tile")) options.deserializeNBT(stack.getTagElement("Tile").getCompound("drawerOptions")); + options.deserializeNBT(access, stack.get(FSAttachments.TILE).getCompound("drawerOptions")); matrix.mulPose(Axis.YP.rotationDegrees(180)); matrix.translate(-1,0,-1); - var tileTag = stack.getTag().getCompound("Tile").getCompound("fluidHandler"); + var tileTag = stack.get(FSAttachments.TILE).getCompound("fluidHandler"); if (type == FunctionalStorage.DrawerType.X_1){ - FluidStack fluidStack = FluidStack.loadFluidStackFromNBT(tileTag.getCompound(0 + "")); + FluidStack fluidStack = Utils.deserializeFluid(access, tileTag.getCompound(0 + "")); if (!fluidStack.isEmpty()){ int displayAmount = fluidStack.getAmount(); AABB bounds = new AABB(1 / 16D, 1.25 / 16D, 1 / 16D, 15 / 16D, 1.25 / 16D + (fluidStack.getAmount() / (double) fluidStack.getAmount()) * (12.5 / 16D), 15 / 16D); FluidDrawerRenderer.renderFluidStack(matrix, renderer, light, overlayLight, fluidStack, displayAmount, fluidStack.getAmount(), 0.007f, options, bounds, false, false); } } else if (type == FunctionalStorage.DrawerType.X_2) { - FluidStack fluidStack = FluidStack.loadFluidStackFromNBT(tileTag.getCompound(0 + "")); + FluidStack fluidStack = Utils.deserializeFluid(access, tileTag.getCompound(0 + "")); if (!fluidStack.isEmpty()){ int displayAmount = fluidStack.getAmount(); AABB bounds = new AABB(1 / 16D, 1.25 / 16D, 1 / 16D, 15 / 16D, 1.25 / 16D + (fluidStack.getAmount() / (double) fluidStack.getAmount()) * (5.5 / 16D), 15 / 16D); FluidDrawerRenderer.renderFluidStack(matrix, renderer, light, overlayLight, fluidStack, displayAmount, fluidStack.getAmount(), 0.007f, options, bounds, false, true); } - fluidStack = FluidStack.loadFluidStackFromNBT(tileTag.getCompound(1 + "")); + fluidStack = Utils.deserializeFluid(access, tileTag.getCompound(1 + "")); if (!fluidStack.isEmpty()){ matrix.pushPose(); matrix.translate(0, 0.5, 0); @@ -97,7 +68,7 @@ public ModelData get(Object o) { matrix.popPose(); } } else if (type == FunctionalStorage.DrawerType.X_4) { - FluidStack fluidStack = FluidStack.loadFluidStackFromNBT(tileTag.getCompound(0 + "")); + FluidStack fluidStack = Utils.deserializeFluid(access, tileTag.getCompound(0 + "")); if (!fluidStack.isEmpty()){ matrix.pushPose(); matrix.translate(0.5, 0, 0); @@ -106,7 +77,7 @@ public ModelData get(Object o) { FluidDrawerRenderer.renderFluidStack(matrix, renderer, light, overlayLight, fluidStack, displayAmount, fluidStack.getAmount(), 0.007f, options, bounds, true, true); matrix.popPose(); } - fluidStack = FluidStack.loadFluidStackFromNBT(tileTag.getCompound(1 + "")); + fluidStack = Utils.deserializeFluid(access, tileTag.getCompound(1 + "")); if (!fluidStack.isEmpty()){ matrix.pushPose(); int displayAmount = fluidStack.getAmount(); @@ -114,7 +85,7 @@ public ModelData get(Object o) { FluidDrawerRenderer.renderFluidStack(matrix, renderer, light, overlayLight, fluidStack, displayAmount, fluidStack.getAmount(), 0.007f, options, bounds, true, true); matrix.popPose(); } - fluidStack = FluidStack.loadFluidStackFromNBT(tileTag.getCompound(2 + "")); + fluidStack = Utils.deserializeFluid(access, tileTag.getCompound(2 + "")); if (!fluidStack.isEmpty()){ matrix.pushPose(); matrix.translate(0.5, 0.5, 0); @@ -123,7 +94,7 @@ public ModelData get(Object o) { FluidDrawerRenderer.renderFluidStack(matrix, renderer, light, overlayLight, fluidStack, displayAmount, fluidStack.getAmount(), 0.007f, options, bounds, true, true); matrix.popPose(); } - fluidStack = FluidStack.loadFluidStackFromNBT(tileTag.getCompound(3 + "")); + fluidStack = Utils.deserializeFluid(access, tileTag.getCompound(3 + "")); if (!fluidStack.isEmpty()){ matrix.pushPose(); matrix.translate(0, 0.5, 0); diff --git a/src/main/java/com/buuz135/functionalstorage/client/item/FunctionalStorageISTER.java b/src/main/java/com/buuz135/functionalstorage/client/item/FunctionalStorageISTER.java index aa1f0527..d8f53abc 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/item/FunctionalStorageISTER.java +++ b/src/main/java/com/buuz135/functionalstorage/client/item/FunctionalStorageISTER.java @@ -1,8 +1,11 @@ package com.buuz135.functionalstorage.client.item; -import com.buuz135.functionalstorage.FunctionalStorage; +import com.buuz135.functionalstorage.client.model.FramedDrawerModelData; +import com.buuz135.functionalstorage.item.FSAttachments; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; +import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap; +import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import net.minecraft.client.Camera; import net.minecraft.client.Minecraft; import net.minecraft.client.model.geom.EntityModelSet; @@ -13,21 +16,27 @@ import net.minecraft.client.renderer.entity.ItemRenderer; import net.minecraft.client.resources.model.BakedModel; import net.minecraft.core.Direction; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.packs.resources.ResourceManager; import net.minecraft.util.RandomSource; import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.HalfTransparentBlock; import net.minecraft.world.level.block.StainedGlassPaneBlock; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.client.RenderTypeHelper; -import net.minecraftforge.client.model.data.ModelData; +import net.neoforged.neoforge.client.model.data.ModelData; import org.jetbrains.annotations.NotNull; +import java.util.HashMap; + public abstract class FunctionalStorageISTER extends BlockEntityWithoutLevelRenderer { + protected final Int2ObjectMap modelCache = new Int2ObjectArrayMap<>(); public FunctionalStorageISTER() { super(Minecraft.getInstance().getBlockEntityRenderDispatcher(), Minecraft.getInstance().getEntityModels()); @@ -52,10 +61,14 @@ protected Camera getCamera() { @Override public abstract void onResourceManagerReload(@NotNull ResourceManager resourceManager); - @Override - public abstract void renderByItem(@NotNull ItemStack stack, @NotNull ItemDisplayContext displayContext, @NotNull PoseStack matrix, @NotNull MultiBufferSource renderer, + public abstract void renderByItem(HolderLookup.Provider access, @NotNull ItemStack stack, @NotNull ItemDisplayContext displayContext, @NotNull PoseStack matrix, @NotNull MultiBufferSource renderer, int light, int overlayLight); + @Override + public void renderByItem(ItemStack stack, ItemDisplayContext displayContext, PoseStack poseStack, MultiBufferSource buffer, int packedLight, int packedOverlay) { + renderByItem(Minecraft.getInstance().level.registryAccess(), stack, displayContext, poseStack, buffer, packedLight, packedOverlay); + } + /** * @implNote Heavily based on/from vanilla's ItemRenderer#render code that calls the renderByItem method on the ISBER */ @@ -107,6 +120,23 @@ protected void renderBlockItem(@NotNull ItemStack stack, @NotNull ItemDisplayCon } + protected ModelData getData(ItemStack stack) { + ModelData modelData = ModelData.EMPTY; + if (stack.has(FSAttachments.STYLE)) { + var tag = stack.get(FSAttachments.STYLE); + modelData = modelCache.computeIfAbsent(tag.hashCode(), o -> { + HashMap data = new HashMap<>(); + data.put("particle", BuiltInRegistries.ITEM.get(ResourceLocation.parse(tag.getString("particle")))); + data.put("front", BuiltInRegistries.ITEM.get(ResourceLocation.parse(tag.getString("front")))); + data.put("side", BuiltInRegistries.ITEM.get(ResourceLocation.parse(tag.getString("side")))); + data.put("front_divider", BuiltInRegistries.ITEM.get(ResourceLocation.parse(tag.getString("front_divider")))); + var framedDrawerModelData = new FramedDrawerModelData(data); + return ModelData.builder().with(FramedDrawerModelData.FRAMED_PROPERTY, framedDrawerModelData).build(); + }); + } + return modelData; + } + private static boolean isLeftHand(ItemDisplayContext type) { return type == ItemDisplayContext.FIRST_PERSON_LEFT_HAND || type == ItemDisplayContext.THIRD_PERSON_LEFT_HAND; From dbaefdc81e8c0d2973f6af9d908435b6afb8a5d7 Mon Sep 17 00:00:00 2001 From: Matyrobbrt Date: Wed, 3 Jul 2024 14:52:48 +0300 Subject: [PATCH 14/20] Fixes --- build.gradle | 2 +- .../functionalstorage/block/DrawerBlock.java | 1 - .../block/FluidDrawerBlock.java | 3 +-- .../client/item/FluidDrawerISTER.java | 21 ++++++++++++------- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index 18f6e817..f17dd884 100644 --- a/build.gradle +++ b/build.gradle @@ -72,7 +72,7 @@ dependencies { transitive = false } implementation "curse.maven:jade-324717:5444008" - implementation "curse.maven:the-one-probe-245211:5475189" + compileOnly "curse.maven:the-one-probe-245211:5475189" } jar { diff --git a/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java index 8a2e81ac..ff7fc9bc 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/DrawerBlock.java @@ -189,7 +189,6 @@ public static class DrawerItem extends BlockItem{ public DrawerItem(DrawerBlock drawerBlock, Properties properties, TitaniumTab tab) { super(drawerBlock, properties); this.drawerBlock = drawerBlock; - tab.getTabList().add(this); } @Nullable diff --git a/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java index fcd4caf3..3613773d 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FluidDrawerBlock.java @@ -119,7 +119,7 @@ public void appendHoverText(ItemStack itemStack, Item.TooltipContext context, Li var tileTag = itemStack.get(FSAttachments.TILE).getCompound("fluidHandler"); tooltip.add(Component.translatable("drawer.block.contents").withStyle(ChatFormatting.GRAY)); for (int i = 0; i < type.getSlots(); i++) { - FluidStack stack = FluidStack.OPTIONAL_CODEC.decode(RegistryOps.create(NbtOps.INSTANCE, Utils.registryAccess()), tileTag.getCompound(i + "")).getOrThrow().getFirst(); + FluidStack stack = FluidStack.OPTIONAL_CODEC.decode(RegistryOps.create(NbtOps.INSTANCE, Utils.registryAccess()), tileTag.getCompound(i + "").getCompound("Fluid")).getOrThrow().getFirst(); if (!stack.isEmpty()) tooltip.add(Component.literal(" - " + ChatFormatting.YELLOW + NumberUtils.getFormatedFluidBigNumber(stack.getAmount()) + ChatFormatting.WHITE + " of ").append(stack.getHoverName().copy().withStyle(ChatFormatting.GOLD))); } @@ -150,7 +150,6 @@ public static class FluidDrawerItem extends BlockItem { public FluidDrawerItem(FluidDrawerBlock block, Properties props, TitaniumTab tab) { super(block, props); this.drawerBlock = block; - tab.getTabList().add(this); } @Override diff --git a/src/main/java/com/buuz135/functionalstorage/client/item/FluidDrawerISTER.java b/src/main/java/com/buuz135/functionalstorage/client/item/FluidDrawerISTER.java index c61f8856..d5e53fab 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/item/FluidDrawerISTER.java +++ b/src/main/java/com/buuz135/functionalstorage/client/item/FluidDrawerISTER.java @@ -9,9 +9,11 @@ import com.mojang.math.Axis; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.core.HolderLookup; +import net.minecraft.nbt.CompoundTag; import net.minecraft.server.packs.resources.ResourceManager; import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.material.Fluids; import net.minecraft.world.phys.AABB; import net.neoforged.neoforge.fluids.FluidStack; import org.jetbrains.annotations.NotNull; @@ -45,20 +47,20 @@ public void renderByItem(HolderLookup.Provider access, @NotNull ItemStack stack, matrix.translate(-1,0,-1); var tileTag = stack.get(FSAttachments.TILE).getCompound("fluidHandler"); if (type == FunctionalStorage.DrawerType.X_1){ - FluidStack fluidStack = Utils.deserializeFluid(access, tileTag.getCompound(0 + "")); + FluidStack fluidStack = deserialize(access, tileTag, 0); if (!fluidStack.isEmpty()){ int displayAmount = fluidStack.getAmount(); AABB bounds = new AABB(1 / 16D, 1.25 / 16D, 1 / 16D, 15 / 16D, 1.25 / 16D + (fluidStack.getAmount() / (double) fluidStack.getAmount()) * (12.5 / 16D), 15 / 16D); FluidDrawerRenderer.renderFluidStack(matrix, renderer, light, overlayLight, fluidStack, displayAmount, fluidStack.getAmount(), 0.007f, options, bounds, false, false); } } else if (type == FunctionalStorage.DrawerType.X_2) { - FluidStack fluidStack = Utils.deserializeFluid(access, tileTag.getCompound(0 + "")); + FluidStack fluidStack = deserialize(access, tileTag, 0); if (!fluidStack.isEmpty()){ int displayAmount = fluidStack.getAmount(); AABB bounds = new AABB(1 / 16D, 1.25 / 16D, 1 / 16D, 15 / 16D, 1.25 / 16D + (fluidStack.getAmount() / (double) fluidStack.getAmount()) * (5.5 / 16D), 15 / 16D); FluidDrawerRenderer.renderFluidStack(matrix, renderer, light, overlayLight, fluidStack, displayAmount, fluidStack.getAmount(), 0.007f, options, bounds, false, true); } - fluidStack = Utils.deserializeFluid(access, tileTag.getCompound(1 + "")); + fluidStack = deserialize(access, tileTag, 1); if (!fluidStack.isEmpty()){ matrix.pushPose(); matrix.translate(0, 0.5, 0); @@ -68,7 +70,7 @@ public void renderByItem(HolderLookup.Provider access, @NotNull ItemStack stack, matrix.popPose(); } } else if (type == FunctionalStorage.DrawerType.X_4) { - FluidStack fluidStack = Utils.deserializeFluid(access, tileTag.getCompound(0 + "")); + FluidStack fluidStack = deserialize(access, tileTag, 0); if (!fluidStack.isEmpty()){ matrix.pushPose(); matrix.translate(0.5, 0, 0); @@ -77,7 +79,7 @@ public void renderByItem(HolderLookup.Provider access, @NotNull ItemStack stack, FluidDrawerRenderer.renderFluidStack(matrix, renderer, light, overlayLight, fluidStack, displayAmount, fluidStack.getAmount(), 0.007f, options, bounds, true, true); matrix.popPose(); } - fluidStack = Utils.deserializeFluid(access, tileTag.getCompound(1 + "")); + fluidStack = deserialize(access, tileTag, 1); if (!fluidStack.isEmpty()){ matrix.pushPose(); int displayAmount = fluidStack.getAmount(); @@ -85,7 +87,7 @@ public void renderByItem(HolderLookup.Provider access, @NotNull ItemStack stack, FluidDrawerRenderer.renderFluidStack(matrix, renderer, light, overlayLight, fluidStack, displayAmount, fluidStack.getAmount(), 0.007f, options, bounds, true, true); matrix.popPose(); } - fluidStack = Utils.deserializeFluid(access, tileTag.getCompound(2 + "")); + fluidStack = deserialize(access, tileTag, 2); if (!fluidStack.isEmpty()){ matrix.pushPose(); matrix.translate(0.5, 0.5, 0); @@ -94,7 +96,7 @@ public void renderByItem(HolderLookup.Provider access, @NotNull ItemStack stack, FluidDrawerRenderer.renderFluidStack(matrix, renderer, light, overlayLight, fluidStack, displayAmount, fluidStack.getAmount(), 0.007f, options, bounds, true, true); matrix.popPose(); } - fluidStack = Utils.deserializeFluid(access, tileTag.getCompound(3 + "")); + fluidStack = deserialize(access, tileTag, 3); if (!fluidStack.isEmpty()){ matrix.pushPose(); matrix.translate(0, 0.5, 0); @@ -106,4 +108,9 @@ public void renderByItem(HolderLookup.Provider access, @NotNull ItemStack stack, } } } + + public static FluidStack deserialize(HolderLookup.Provider access, CompoundTag tileTag, int i) { + var fluidTag = tileTag.getCompound(String.valueOf(i)); + return Utils.deserializeFluid(access, fluidTag.getCompound("Fluid")); + } } From c6ae865dd6c5de23c4ad6b1ffdf2fbd3d822a09f Mon Sep 17 00:00:00 2001 From: Buuz135 Date: Sat, 6 Jul 2024 16:44:46 +0200 Subject: [PATCH 15/20] Added Rid --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index f17dd884..1fb00fc7 100644 --- a/build.gradle +++ b/build.gradle @@ -78,11 +78,11 @@ dependencies { jar { manifest { attributes(["Specification-Title" : project.name, - "Specification-Vendor" : "Buuz135", + "Specification-Vendor" : "Buuz135, Rid", "Specification-Version" : "1.0", "Implementation-Title" : project.name, "Implementation-Version" : "${project.version}", - "Implementation-Vendor" : "Buuz135", + "Implementation-Vendor" : "Buuz135, Rid", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), "ModSide" : "BOTH" ]) From 144569a25d00165ab97f01fde2bbc07d65575972 Mon Sep 17 00:00:00 2001 From: Buuz135 Date: Sat, 6 Jul 2024 17:04:20 +0200 Subject: [PATCH 16/20] Updated publish, bug report, settings --- .github/ISSUE_TEMPLATE/1-21-bug-report.md | 15 +++++++++++++++ .github/workflows/publish.yaml | 6 +++--- build.gradle | 7 ++++--- settings.gradle | 8 +------- 4 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/1-21-bug-report.md diff --git a/.github/ISSUE_TEMPLATE/1-21-bug-report.md b/.github/ISSUE_TEMPLATE/1-21-bug-report.md new file mode 100644 index 00000000..b56df83c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1-21-bug-report.md @@ -0,0 +1,15 @@ +--- +name: 1.20 Bug report +about: Create a report to help us improve +title: "[1.21] Issue Title" +labels: 'type: bug, version: 1.21' +assignees: '' + +--- +**DO NOT REPORT AN ISSUE IF YOU HAVEN'T TESTED THE ISSUE WITH THE LATEST VERSION IN CURSEFORGE** + +**Functional Storage Version:** + +**Titanium Version:** + +**Crashlog If Applicable (Upload to pastebin/gist):** diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 9669b54e..718032a6 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -34,9 +34,9 @@ jobs: files-secondary: build/libs/*-@(dev|sources).jar version-type: beta version: ${{ github.ref_name }} - loaders: forge - game-versions: 1.20.1 - java: 17 + loaders: neoforge + game-versions: 1.21 + java: 21 name: "" changelog: "https://github.com/Buuz135/FunctionalStorage/blob/main/CHANGELOG.md" dependencies: | diff --git a/build.gradle b/build.gradle index 1fb00fc7..8da7095b 100644 --- a/build.gradle +++ b/build.gradle @@ -61,6 +61,9 @@ neoForge { functionalstorage { sourceSet sourceSets.main } + titanium { + sourceSet sourceSets.main + } } } @@ -68,9 +71,7 @@ dependencies { compileOnly "mezz.jei:jei-1.21-common-api:$jei_version" compileOnly "mezz.jei:jei-1.21-neoforge-api:$jei_version" runtimeOnly "mezz.jei:jei-1.21-neoforge:$jei_version" - implementation('com.hrznstudio:titanium') { - transitive = false - } + implementation project.dependencies.create('com.hrznstudio:titanium:1.21-4.0.12') implementation "curse.maven:jade-324717:5444008" compileOnly "curse.maven:the-one-probe-245211:5475189" } diff --git a/settings.gradle b/settings.gradle index 4c731fe3..82707da9 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,9 +1,3 @@ plugins { id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' -} - -includeBuild('../Titanium') { - dependencySubstitution { - substitute module('com.hrznstudio:titanium') using project(':') - } -} +} \ No newline at end of file From ebf6b5bb79a45727923ef082b3d53aab576378bd Mon Sep 17 00:00:00 2001 From: Buuz135 Date: Sat, 6 Jul 2024 17:20:46 +0200 Subject: [PATCH 17/20] Fixed progress bar indicators --- .../client/DrawerRenderer.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/buuz135/functionalstorage/client/DrawerRenderer.java b/src/main/java/com/buuz135/functionalstorage/client/DrawerRenderer.java index 4bd91ea0..7e9d3c41 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/DrawerRenderer.java +++ b/src/main/java/com/buuz135/functionalstorage/client/DrawerRenderer.java @@ -82,31 +82,31 @@ public static void renderIndicator(PoseStack matrixStack, MultiBufferSource buff float y1 = -6.65F / 16F; float y2 = y1 + 1.25f / 16F; float z2 = 0; - float bx1 = 0; - float bx2 = 8; - float bz1 = 0; - float bz2 = 2; + float bx1 = 0 / 16F; + float bx2 = 8 / 16F; + float bz1 = 0 / 16F; + float bz2 = 2 / 16F; float u1 = still.getU(bx1); float u2 = still.getU(bx2); float v1 = still.getV(bz1); float v2 = still.getV(bz2); - if (indicatiorValue != 3) { //HIDE IN MODE 3 NO BG - builder.addVertex(posMat, x2, y1, z2).setColor(red, green, blue, alpha).setUv(u2, v1).setOverlay(combinedOverlayIn).setNormal(0f, 0f, 1f); - builder.addVertex(posMat, x2, y2, z2).setColor(red, green, blue, alpha).setUv(u2, v2).setOverlay(combinedOverlayIn).setNormal(0f, 0f, 1f); - builder.addVertex(posMat, x1, y2, z2).setColor(red, green, blue, alpha).setUv(u1, v2).setOverlay(combinedOverlayIn).setNormal(0f, 0f, 1f); - builder.addVertex(posMat, x1, y1, z2).setColor(red, green, blue, alpha).setUv(u1, v1).setOverlay(combinedOverlayIn).setNormal(0f, 0f, 1f); + if (indicatiorValue != 3 ) { //HIDE IN MODE 3 NO BG + builder.addVertex(posMat, x2, y1, z2).setColor(red, green, blue, alpha).setUv(u2, v1).setOverlay(combinedOverlayIn).setLight(combinedLightIn).setNormal(0f, 0f, 1f); + builder.addVertex(posMat, x2, y2, z2).setColor(red, green, blue, alpha).setUv(u2, v2).setOverlay(combinedOverlayIn).setLight(combinedLightIn).setNormal(0f, 0f, 1f); + builder.addVertex(posMat, x1, y2, z2).setColor(red, green, blue, alpha).setUv(u1, v2).setOverlay(combinedOverlayIn).setLight(combinedLightIn).setNormal(0f, 0f, 1f); + builder.addVertex(posMat, x1, y1, z2).setColor(red, green, blue, alpha).setUv(u1, v1).setOverlay(combinedOverlayIn).setLight(combinedLightIn).setNormal(0f, 0f, 1f); } u2 = still.getU((bx2 * progress)); x2 = x1 + 0.5f * progress; z2 = 0.0001f; - v1 = still.getV(8); - v2 = still.getV(10); + v1 = still.getV(8 / 16F); + v2 = still.getV(10 / 16F); if (indicatiorValue == 1 || progress >= 1) { - builder.addVertex(posMat, x2, y1, z2).setColor(red, green, blue, alpha).setUv(u2, v1).setOverlay(combinedOverlayIn).setNormal(0f, 0f, 1f); - builder.addVertex(posMat, x2, y2, z2).setColor(red, green, blue, alpha).setUv(u2, v2).setOverlay(combinedOverlayIn).setNormal(0f, 0f, 1f); - builder.addVertex(posMat, x1, y2, z2).setColor(red, green, blue, alpha).setUv(u1, v2).setOverlay(combinedOverlayIn).setNormal(0f, 0f, 1f); - builder.addVertex(posMat, x1, y1, z2).setColor(red, green, blue, alpha).setUv(u1, v1).setOverlay(combinedOverlayIn).setNormal(0f, 0f, 1f); + builder.addVertex(posMat, x2, y1, z2).setColor(red, green, blue, alpha).setUv(u2, v1).setOverlay(combinedOverlayIn).setLight(combinedLightIn).setNormal(0f, 0f, 1f); + builder.addVertex(posMat, x2, y2, z2).setColor(red, green, blue, alpha).setUv(u2, v2).setOverlay(combinedOverlayIn).setLight(combinedLightIn).setNormal(0f, 0f, 1f); + builder.addVertex(posMat, x1, y2, z2).setColor(red, green, blue, alpha).setUv(u1, v2).setOverlay(combinedOverlayIn).setLight(combinedLightIn).setNormal(0f, 0f, 1f); + builder.addVertex(posMat, x1, y1, z2).setColor(red, green, blue, alpha).setUv(u1, v1).setOverlay(combinedOverlayIn).setLight(combinedLightIn).setNormal(0f, 0f, 1f); } } } From 23f1cce51b3cd22828950a0a89532565f2cef388 Mon Sep 17 00:00:00 2001 From: Buuz135 Date: Sat, 6 Jul 2024 17:47:50 +0200 Subject: [PATCH 18/20] Fixed framed drawers --- .../buuz135/functionalstorage/FunctionalStorage.java | 10 ++++++++-- .../functionalstorage/block/FramedDrawerBlock.java | 4 ++-- .../functionalstorage/recipe/FramedDrawerRecipe.java | 10 +++++----- .../data/functionalstorage/recipe/framed.json | 4 ++++ .../data/functionalstorage/recipes/framed.json | 3 --- 5 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 src/main/resources/data/functionalstorage/recipe/framed.json delete mode 100644 src/main/resources/data/functionalstorage/recipes/framed.json diff --git a/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java b/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java index b944b2af..57eb1eee 100644 --- a/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java +++ b/src/main/java/com/buuz135/functionalstorage/FunctionalStorage.java @@ -75,6 +75,7 @@ import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; +import net.minecraft.world.item.crafting.SimpleCraftingRecipeSerializer; import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; @@ -164,9 +165,11 @@ public class FunctionalStorage extends ModuleController { public static DeferredHolder CREATIVE_UPGRADE; public static TitaniumTab TAB = new TitaniumTab(com.buuz135.functionalstorage.util.Utils.resourceLocation(MOD_ID, "main")); + public static Holder> CUSTOM_COMPACTING_RECIPE_SERIALIZER; public static Holder> CUSTOM_COMPACTING_RECIPE_TYPE; - + public static Holder> FRAMED_RECIPE_SERIALIZER; + public static Holder> FRAMED_RECIPE_TYPE; public FunctionalStorage(Dist dist, IEventBus modBus, ModContainer container) { super(container); @@ -274,7 +277,6 @@ public boolean isFoil(ItemStack p_41453_) { }); DrawerlessWoodIngredient.TYPE = getRegistries().registerGeneric(NeoForgeRegistries.Keys.INGREDIENT_TYPES, DrawerlessWoodIngredient.NAME.getPath(), () -> new IngredientType<>(DrawerlessWoodIngredient.CODEC)); - getRegistries().registerGeneric(Registries.RECIPE_SERIALIZER, "framed_recipe", () -> FramedDrawerRecipe.SERIALIZER); this.addCreativeTab("main", () -> new ItemStack(DRAWER_CONTROLLER), MOD_ID, TAB); @@ -282,6 +284,10 @@ public boolean isFoil(ItemStack p_41453_) { CUSTOM_COMPACTING_RECIPE_SERIALIZER = getRegistries().registerGeneric(Registries.RECIPE_SERIALIZER, "custom_compacting", () -> new GenericSerializer<>(CustomCompactingRecipe.class, CUSTOM_COMPACTING_RECIPE_TYPE::value, CustomCompactingRecipe.CODEC)); + FRAMED_RECIPE_TYPE = getRegistries().registerGeneric(Registries.RECIPE_TYPE, "framed_recipe", () -> RecipeType.simple(com.buuz135.functionalstorage.util.Utils.resourceLocation(MOD_ID, "framed_recipe"))); + + FRAMED_RECIPE_SERIALIZER = getRegistries().registerGeneric(Registries.RECIPE_SERIALIZER, "framed_recipe", () -> new SimpleCraftingRecipeSerializer<>((c) -> new FramedDrawerRecipe())); + ModLoadingContext.get().getActiveContainer().getEventBus() .addListener(EventPriority.LOWEST, (final RegisterEvent regEvent) -> { if (regEvent.getRegistryKey() == Registries.BLOCK) { diff --git a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java index a797f745..64ae05fe 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java +++ b/src/main/java/com/buuz135/functionalstorage/block/FramedDrawerBlock.java @@ -55,7 +55,7 @@ public BlockEntityType.BlockEntitySupplier getTileEntityFactory() { public static FramedDrawerModelData getDrawerModelData(ItemStack stack){ if (stack.has(FSAttachments.STYLE)) { - CompoundTag tag = stack.get(FSAttachments.STYLE); + CompoundTag tag = stack.getOrDefault(FSAttachments.STYLE, new CompoundTag()); if (tag.isEmpty()) return null; HashMap data = new HashMap<>(); data.put("particle", BuiltInRegistries.ITEM.get(com.buuz135.functionalstorage.util.Utils.resourceLocation(tag.getString("particle")))); @@ -69,7 +69,7 @@ public static FramedDrawerModelData getDrawerModelData(ItemStack stack){ public static ItemStack fill(ItemStack first, ItemStack second, ItemStack drawer, ItemStack divider){ drawer = drawer.copyWithCount(1); - CompoundTag style = drawer.get(FSAttachments.STYLE); + CompoundTag style = drawer.getOrDefault(FSAttachments.STYLE, new CompoundTag()); style.putString("particle", BuiltInRegistries.ITEM.getKey(first.getItem()).toString()); style.putString("side", BuiltInRegistries.ITEM.getKey(first.getItem()).toString()); style.putString("front", BuiltInRegistries.ITEM.getKey(second.getItem()).toString()); diff --git a/src/main/java/com/buuz135/functionalstorage/recipe/FramedDrawerRecipe.java b/src/main/java/com/buuz135/functionalstorage/recipe/FramedDrawerRecipe.java index 27bf9c75..4d304884 100644 --- a/src/main/java/com/buuz135/functionalstorage/recipe/FramedDrawerRecipe.java +++ b/src/main/java/com/buuz135/functionalstorage/recipe/FramedDrawerRecipe.java @@ -1,6 +1,7 @@ package com.buuz135.functionalstorage.recipe; +import com.buuz135.functionalstorage.FunctionalStorage; import com.buuz135.functionalstorage.block.CompactingFramedDrawerBlock; import com.buuz135.functionalstorage.block.FramedControllerExtensionBlock; import com.buuz135.functionalstorage.block.FramedDrawerBlock; @@ -20,7 +21,6 @@ public class FramedDrawerRecipe extends CustomRecipe { - public static RecipeSerializer SERIALIZER = new SimpleCraftingRecipeSerializer<>((c) -> new FramedDrawerRecipe()); public FramedDrawerRecipe() { super(CraftingBookCategory.MISC); @@ -52,6 +52,7 @@ public static boolean matchesSimpleCompacting(ItemStack first, ItemStack second, @Override public boolean matches(CraftingInput inv, Level worldIn) { + if (inv.size() < 3) return false; return matches(inv.getItem(0), inv.getItem(1), inv.getItem(2)) || matchesCompacting(inv.getItem(0), inv.getItem(1), inv.getItem(2)) || matchesSimpleCompacting(inv.getItem(0), inv.getItem(1), inv.getItem(2)) || @@ -65,9 +66,8 @@ public ItemStack assemble(CraftingInput inv, HolderLookup.Provider registryAcces matchesCompacting(inv.getItem(0), inv.getItem(1), inv.getItem(2)) || matchesSimpleCompacting(inv.getItem(0), inv.getItem(1), inv.getItem(2)) || matchesController(inv.getItem(0), inv.getItem(1), inv.getItem(2)) || - matchesControllerExtension(inv.getItem(0), inv.getItem(1), inv.getItem(2))) - { - return FramedDrawerBlock.fill(inv.getItem(0), inv.getItem(1), inv.getItem(2).copy(), inv.getItem(3)); + matchesControllerExtension(inv.getItem(0), inv.getItem(1), inv.getItem(2))) { + return FramedDrawerBlock.fill(inv.getItem(0), inv.getItem(1), inv.getItem(2).copy(), inv.size() >= 4 ? inv.getItem(3) : ItemStack.EMPTY); } return ItemStack.EMPTY; @@ -80,6 +80,6 @@ public boolean canCraftInDimensions(int width, int height) { @Override public RecipeSerializer getSerializer() { - return SERIALIZER; + return FunctionalStorage.FRAMED_RECIPE_SERIALIZER.value(); } } diff --git a/src/main/resources/data/functionalstorage/recipe/framed.json b/src/main/resources/data/functionalstorage/recipe/framed.json new file mode 100644 index 00000000..086a4cdf --- /dev/null +++ b/src/main/resources/data/functionalstorage/recipe/framed.json @@ -0,0 +1,4 @@ +{ + "type": "functionalstorage:framed_recipe", + "category": "misc" +} \ No newline at end of file diff --git a/src/main/resources/data/functionalstorage/recipes/framed.json b/src/main/resources/data/functionalstorage/recipes/framed.json deleted file mode 100644 index d05b81a7..00000000 --- a/src/main/resources/data/functionalstorage/recipes/framed.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "functionalstorage:framed_recipe" -} \ No newline at end of file From b9f32fc15ffcd1cd06980bca2c5f0a0acb0be657 Mon Sep 17 00:00:00 2001 From: Buuz135 Date: Sat, 6 Jul 2024 18:14:25 +0200 Subject: [PATCH 19/20] Improved relative tooltip --- .../functionalstorage/client/ClientSetup.java | 5 ++--- .../functionalstorage/item/UpgradeItem.java | 15 +++------------ 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/buuz135/functionalstorage/client/ClientSetup.java b/src/main/java/com/buuz135/functionalstorage/client/ClientSetup.java index 9f965972..764f46a3 100644 --- a/src/main/java/com/buuz135/functionalstorage/client/ClientSetup.java +++ b/src/main/java/com/buuz135/functionalstorage/client/ClientSetup.java @@ -6,6 +6,7 @@ import com.hrznstudio.titanium.block.RotatableBlock; import com.hrznstudio.titanium.client.screen.container.BasicAddonScreen; import com.hrznstudio.titanium.event.handler.EventManager; +import com.hrznstudio.titanium.util.FacingUtil; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.network.chat.Component; @@ -19,9 +20,7 @@ public static void init() { .process(event -> { var sc = (BasicAddonScreen) Minecraft.getInstance().screen; var direction = ((ItemControllableDrawerTile) sc.getMenu().getObject()).getBlockState().getValue(RotatableBlock.FACING_HORIZONTAL); - event.getToolTip().add(Component.translatable("drawer_upgrade.functionalstorage.relative_direction", UpgradeItem.getRelativeDirection( - UpgradeItem.getDirection(event.getItemStack()), direction - ).withStyle(ChatFormatting.GOLD))); + event.getToolTip().add(3, Component.translatable("drawer_upgrade.functionalstorage.relative_direction", UpgradeItem.getRelativeDirection(direction, UpgradeItem.getDirection(event.getItemStack()))).withStyle(ChatFormatting.YELLOW)); }).subscribe(); } } diff --git a/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java b/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java index 5aede47e..becd8c94 100644 --- a/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java +++ b/src/main/java/com/buuz135/functionalstorage/item/UpgradeItem.java @@ -5,6 +5,7 @@ import com.buuz135.functionalstorage.block.tile.FluidDrawerTile; import com.hrznstudio.titanium.block.RotatableBlock; import com.hrznstudio.titanium.item.BasicItem; +import com.hrznstudio.titanium.util.FacingUtil; import net.minecraft.ChatFormatting; import net.minecraft.core.Direction; import net.minecraft.network.chat.Component; @@ -138,18 +139,8 @@ public Component getDescription(ItemStack stack, ControllableDrawerTile tile) } public static MutableComponent getRelativeDirection(Direction upgrade, Direction facing) { - if (upgrade == facing) { - return Component.translatable("drawer_upgrade.functionalstorage.sides.front"); - } else if (upgrade == facing.getOpposite()) { - return Component.translatable("drawer_upgrade.functionalstorage.sides.back"); - } else if (upgrade == Direction.UP) { - return Component.translatable("drawer_upgrade.functionalstorage.sides.up"); - } else if (upgrade == Direction.DOWN) { - return Component.translatable("drawer_upgrade.functionalstorage.sides.down"); - } else if (upgrade == facing.getClockWise()) { - return Component.translatable("drawer_upgrade.functionalstorage.sides.left"); - } - return Component.translatable("drawer_upgrade.functionalstorage.sides.right"); + return Component.translatable( + "tooltip.titanium.facing_handler." + FacingUtil.getFacingRelative(upgrade, facing).name().toLowerCase()).withStyle(ChatFormatting.WHITE); } @Override From 90ad4112686db9d4c9509c7470b9d0c912f841f5 Mon Sep 17 00:00:00 2001 From: Buuz135 Date: Sat, 6 Jul 2024 18:17:13 +0200 Subject: [PATCH 20/20] Increased version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 234cf2e0..69833704 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ org.gradle.jvmargs=-Xmx2048M modGroup=com.buuz135 -mod_version=1.0.2 +mod_version=1.3.0 modBaseName=functionalstorage neo_version=21.0.47-beta