From 63fbbb334e1ca1c5b8840bf1f68e056858264e5e Mon Sep 17 00:00:00 2001 From: Mrbysco Date: Mon, 4 Mar 2024 20:21:48 +0100 Subject: [PATCH] Unfinished port to 1.20.4 Neo --- .gitignore | 1 + build.gradle | 95 +++---- gradle.properties | 9 +- gradle/wrapper/gradle-wrapper.jar | Bin 61574 -> 43462 bytes gradle/wrapper/gradle-wrapper.properties | 3 +- gradlew | 29 +- gradlew.bat | 20 +- logs/debug.log | 0 logs/latest.log | 0 settings.gradle | 9 +- .../api/ActuallyAdditionsAPI.java | 67 +++-- .../api/booklet/IBookletChapter.java | 4 +- .../api/booklet/IBookletEntry.java | 4 +- .../api/booklet/IBookletPage.java | 6 +- .../data/ActuallyAdditionsData.java | 27 +- .../data/AdvancementGenerator.java | 77 ++--- .../data/BlockRecipeGenerator.java | 31 +- .../data/BlockStateGenerator.java | 22 +- .../data/BlockTagsGenerator.java | 4 +- .../data/ColorChangeGenerator.java | 54 ++-- .../data/CrushingRecipeGenerator.java | 24 +- .../data/DamageTypeTagsGenerator.java | 2 +- .../data/EmpoweringRecipeGenerator.java | 44 ++- .../data/FuelRecipeGenerator.java | 51 ++-- .../data/ItemModelGenerator.java | 20 +- .../data/ItemRecipeGenerator.java | 172 +++++------- .../data/ItemTagsGenerator.java | 2 +- .../data/LaserRecipeGenerator.java | 59 ++-- .../data/LootTableGenerator.java | 4 +- .../data/MiningLensGenerator.java | 38 ++- .../data/MiscMachineRecipeGenerator.java | 31 +- .../data/SoundsGenerator.java | 4 +- .../actuallyadditions/mod/AASounds.java | 18 +- .../mod/ActuallyAdditions.java | 89 +++--- .../mod/ActuallyAdditionsClient.java | 12 +- .../actuallyadditions/mod/ActuallyTabs.java | 4 +- .../mod/ClientRegistryHandler.java | 6 +- .../mod/blocks/ActuallyBlocks.java | 66 +++-- .../mod/blocks/BlockAtomicReconstructor.java | 4 +- .../mod/blocks/BlockCanolaPress.java | 6 +- .../mod/blocks/BlockCoffeeMachine.java | 4 +- .../mod/blocks/BlockFermentingBarrel.java | 6 +- .../mod/blocks/BlockFluidCollector.java | 2 +- .../mod/blocks/BlockLaserRelay.java | 4 +- .../blocks/BlockLavaFactoryController.java | 4 +- .../mod/blocks/BlockOilGenerator.java | 4 +- .../mod/blocks/BlockPhantom.java | 4 +- .../mod/blocks/BlockPlayerInterface.java | 4 +- .../mod/blocks/BlockShockSuppressor.java | 8 +- .../mod/blocks/BlockVerticalDigger.java | 4 +- .../mod/blocks/IHudDisplay.java | 4 +- .../mod/blocks/VoxelShapes.java | 1 - .../mod/blocks/base/AACrops.java | 4 +- .../mod/blocks/base/BlockBushBase.java | 8 + .../mod/blocks/base/BlockContainerBase.java | 13 +- .../mod/blocks/base/BlockPlant.java | 4 +- .../blocks/render/ReconstructorRenderer.java | 11 + .../mod/blocks/render/RenderBatteryBox.java | 14 +- .../mod/blocks/render/RenderDisplayStand.java | 4 +- .../mod/blocks/render/RenderEmpowerer.java | 9 +- .../mod/booklet/page/PageCrafting.java | 6 +- .../mod/booklet/page/PageFurnace.java | 20 +- .../mod/config/CommonConfig.java | 54 ++-- .../conditions/BoolConfigCondition.java | 46 ++- .../mod/crafting/ActuallyRecipes.java | 51 ++-- .../mod/crafting/ColorChangeRecipe.java | 96 ++----- .../mod/crafting/CrushingRecipe.java | 244 +++++++--------- .../mod/crafting/EmpowererRecipe.java | 222 ++++++--------- .../mod/crafting/FermentingRecipe.java | 155 ++++------ .../mod/crafting/LaserRecipe.java | 102 ++----- .../mod/crafting/LiquidFuelRecipe.java | 134 +++------ .../mod/crafting/MiningLensRecipe.java | 98 ++----- .../mod/crafting/PressingRecipe.java | 113 +++----- .../mod/crafting/SolidFuelRecipe.java | 88 ++---- .../mod/crafting/TargetNBTIngredient.java | 150 +++++----- .../mod/crafting/WrappedRecipe.java | 6 +- .../mod/entity/EntityWorm.java | 14 +- .../mod/entity/InitEntities.java | 4 +- .../mod/entity/RenderWorm.java | 4 +- .../mod/event/ClientEvents.java | 14 +- .../mod/event/CommonEvents.java | 16 +- .../actuallyadditions/mod/fluids/AATank.java | 4 +- .../actuallyadditions/mod/fluids/FluidAA.java | 32 +-- .../mod/fluids/InitFluids.java | 16 +- .../mod/fluids/OutputOnlyFluidTank.java | 4 +- .../mod/gen/village/BasicTradeList.java | 12 +- .../mod/inventory/ActuallyContainers.java | 61 ++-- .../mod/inventory/ContainerCoalGenerator.java | 4 +- .../mod/inventory/ContainerEnergizer.java | 6 +- .../mod/inventory/ContainerEnervator.java | 4 +- .../mod/inventory/ContainerFurnaceDouble.java | 8 +- .../mod/inventory/SackContainer.java | 4 +- .../mod/inventory/gui/Buttons.java | 4 +- .../mod/inventory/gui/CrusherScreen.java | 4 +- .../mod/inventory/gui/EnergyDisplay.java | 4 +- .../mod/inventory/gui/FilterSettingsGui.java | 4 +- .../mod/inventory/gui/FluidDisplay.java | 12 +- .../mod/inventory/gui/GuiBreaker.java | 4 +- .../mod/inventory/gui/GuiCanolaPress.java | 4 +- .../mod/inventory/gui/GuiCoalGenerator.java | 4 +- .../mod/inventory/gui/GuiCoffeeMachine.java | 4 +- .../inventory/gui/GuiDirectionalBreaker.java | 4 +- .../mod/inventory/gui/GuiDrill.java | 4 +- .../mod/inventory/gui/GuiDropper.java | 4 +- .../mod/inventory/gui/GuiEnergizer.java | 4 +- .../mod/inventory/gui/GuiEnervator.java | 4 +- .../mod/inventory/gui/GuiFarmer.java | 4 +- .../mod/inventory/gui/GuiFeeder.java | 4 +- .../inventory/gui/GuiFermentingBarrel.java | 4 +- .../mod/inventory/gui/GuiFilter.java | 4 +- .../mod/inventory/gui/GuiFireworkBox.java | 4 +- .../mod/inventory/gui/GuiFluidCollector.java | 4 +- .../mod/inventory/gui/GuiFurnaceDouble.java | 4 +- .../gui/GuiLaserRelayItemWhitelist.java | 4 +- .../mod/inventory/gui/GuiMiner.java | 4 +- .../mod/inventory/gui/GuiOilGenerator.java | 4 +- .../mod/inventory/gui/GuiPhantomPlacer.java | 4 +- .../mod/inventory/gui/GuiRangedCollector.java | 4 +- .../mod/inventory/gui/GuiSmileyCloud.java | 2 +- .../mod/inventory/gui/GuiXPSolidifier.java | 4 +- .../mod/inventory/gui/SackGui.java | 2 +- .../mod/inventory/gui/TexturedButton.java | 4 +- .../slot/SlotItemHandlerUnconditioned.java | 2 +- .../mod/items/ActuallyItems.java | 244 ++++++++-------- .../mod/items/AllInOneTool.java | 4 +- .../mod/items/DrillItem.java | 23 +- .../mod/items/ItemBattery.java | 12 +- .../mod/items/ItemBooklet.java | 8 +- .../mod/items/ItemCoffee.java | 16 +- .../mod/items/ItemCrafterOnAStick.java | 4 +- .../mod/items/ItemEngineerGoggles.java | 16 +- .../mod/items/ItemFillingWand.java | 4 +- .../mod/items/ItemFilter.java | 8 +- .../mod/items/ItemGrowthRing.java | 2 +- .../mod/items/ItemLaserWrench.java | 4 +- .../mod/items/ItemLeafBlower.java | 4 +- .../mod/items/ItemPhantomConnector.java | 14 +- .../mod/items/ItemPlayerProbe.java | 4 +- .../mod/items/ItemShovelAA.java | 2 +- .../mod/items/ItemSolidifiedExperience.java | 2 +- .../mod/items/ItemWaterBowl.java | 10 +- .../mod/items/ItemWingsOfTheBats.java | 6 +- .../actuallyadditions/mod/items/Sack.java | 13 +- .../actuallyadditions/mod/items/Worm.java | 6 +- .../mod/items/base/ItemEnergy.java | 110 ++++---- .../mod/items/lens/LensKiller.java | 2 +- .../mod/items/lens/LensMining.java | 7 +- .../mod/jei/FermentingCategory.java | 4 +- .../mod/jei/JEIActuallyAdditionsPlugin.java | 19 +- .../mod/material/ArmorMaterials.java | 4 +- .../mod/material/ToolMaterials.java | 18 +- .../mod/misc/DispenserHandlerFertilize.java | 10 +- .../mod/misc/apiimpl/MethodHandler.java | 27 +- .../apiimpl/farmer/DefaultFarmerBehavior.java | 4 +- .../farmer/NetherWartFarmerBehavior.java | 2 +- .../mod/misc/special/SpecialRenderInit.java | 16 +- .../mod/network/IDataHandler.java | 4 +- .../mod/network/PacketClientToServer.java | 54 ++-- .../mod/network/PacketHandler.java | 156 +++++------ .../mod/network/PacketHandlerHelper.java | 14 +- .../mod/network/PacketServerToClient.java | 50 ++-- .../mod/particle/ActuallyParticles.java | 15 +- .../mod/particle/LaserItemParticleData.java | 10 +- .../mod/recipe/CrusherRecipeRegistry.java | 21 +- .../actuallyadditions/mod/sack/SackData.java | 13 +- .../mod/sack/SackManager.java | 19 +- .../mod/tile/CustomEnergyStorage.java | 2 +- .../mod/tile/FilterSettings.java | 4 +- .../mod/tile/IEnergyDisplay.java | 4 +- .../tile/TileEntityAtomicReconstructor.java | 19 +- .../mod/tile/TileEntityBase.java | 39 +-- .../mod/tile/TileEntityBatteryBox.java | 20 +- .../mod/tile/TileEntityBioReactor.java | 10 +- .../mod/tile/TileEntityBreaker.java | 10 +- .../mod/tile/TileEntityCanolaPress.java | 34 ++- .../mod/tile/TileEntityCoalGenerator.java | 35 ++- .../mod/tile/TileEntityCoffeeMachine.java | 25 +- .../mod/tile/TileEntityCompost.java | 6 +- .../mod/tile/TileEntityCrusher.java | 21 +- .../mod/tile/TileEntityDisplayStand.java | 8 +- .../mod/tile/TileEntityEmpowerer.java | 32 ++- .../mod/tile/TileEntityEnergizer.java | 19 +- .../mod/tile/TileEntityEnervator.java | 15 +- .../mod/tile/TileEntityFarmer.java | 8 +- .../mod/tile/TileEntityFermentingBarrel.java | 48 ++-- .../mod/tile/TileEntityFireworkBox.java | 8 +- .../mod/tile/TileEntityFluidCollector.java | 12 +- .../mod/tile/TileEntityFurnaceSolar.java | 2 +- .../mod/tile/TileEntityHeatCollector.java | 9 +- .../mod/tile/TileEntityInventoryBase.java | 13 +- .../mod/tile/TileEntityItemInterface.java | 22 +- .../tile/TileEntityItemInterfaceHopping.java | 10 +- .../mod/tile/TileEntityLaserRelay.java | 22 +- .../mod/tile/TileEntityLaserRelayEnergy.java | 18 +- .../mod/tile/TileEntityLaserRelayFluids.java | 20 +- .../mod/tile/TileEntityLaserRelayItem.java | 12 +- .../tile/TileEntityLavaFactoryController.java | 8 +- .../mod/tile/TileEntityLeafGenerator.java | 6 +- .../mod/tile/TileEntityLongRangeBreaker.java | 6 +- .../mod/tile/TileEntityOilGenerator.java | 39 ++- .../mod/tile/TileEntityPhantomEnergyface.java | 8 +- .../mod/tile/TileEntityPhantomItemface.java | 8 +- .../mod/tile/TileEntityPhantomLiquiface.java | 8 +- .../tile/TileEntityPhantomRedstoneface.java | 2 +- .../mod/tile/TileEntityPhantomface.java | 8 +- .../mod/tile/TileEntityPlayerInterface.java | 16 +- .../mod/tile/TileEntityPoweredFurnace.java | 6 +- .../mod/tile/TileEntityShockSuppressor.java | 6 +- .../mod/tile/TileEntityVerticalDigger.java | 18 +- .../mod/update/UpdateChecker.java | 12 +- .../actuallyadditions/mod/util/AssetUtil.java | 12 +- .../mod/util/ItemStackHandlerAA.java | 2 +- .../actuallyadditions/mod/util/ItemUtil.java | 4 +- .../actuallyadditions/mod/util/Lang.java | 2 +- .../mod/util/NetHandlerSpaghettiServer.java | 265 ------------------ .../actuallyadditions/mod/util/RefHelp.java | 2 +- .../actuallyadditions/mod/util/StackUtil.java | 13 +- .../mod/util/StringUtil.java | 4 +- .../actuallyadditions/mod/util/Util.java | 2 +- .../actuallyadditions/mod/util/WorldUtil.java | 67 ++--- .../SlotlessableItemHandlerWrapper.java | 10 +- .../mod/util/crafting/RecipeHandler.java | 16 +- .../mod/util/crafting/RecipeHelper.java | 88 +++--- .../registration/AABlockReg.java | 9 +- .../resources/META-INF/accesstransformer.cfg | 4 +- src/main/resources/META-INF/mods.toml | 12 +- src/main/resources/pack.mcmeta | 7 +- 227 files changed, 2271 insertions(+), 3043 deletions(-) delete mode 100644 logs/debug.log delete mode 100644 logs/latest.log delete mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/util/NetHandlerSpaghettiServer.java diff --git a/.gitignore b/.gitignore index 45a3bec5d..5cd074a6a 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ /classes /bin/ /run/ +/runs/ *.classpath *.project diff --git a/build.gradle b/build.gradle index 25b10ac27..a754aaa41 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,9 @@ plugins { + id 'java-library' id 'eclipse' id 'idea' id 'maven-publish' - id 'net.minecraftforge.gradle' version '[6.0,6.2)' - id 'org.parchmentmc.librarian.forgegradle' version '1.+' + id 'net.neoforged.gradle.userdev' version '7.0.96' } version = "$mod_version" @@ -16,44 +16,49 @@ if (System.getenv('BUILD_NUMBER') != null) { version += "." + System.getenv('BUILD_NUMBER') } +// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. java.toolchain.languageVersion = JavaLanguageVersion.of(17) -minecraft { - mappings channel: 'parchment', version: "${parchment_version}-${game_version}" - // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. +if (rootProject.file('src/main/resources/META-INF/accesstransformer.cfg').exists()) { + minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/accesstransformer.cfg') +} +//minecraft.accessTransformers.entry public net.minecraft.client.Minecraft textureManager # textureManager - accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') +runs { + // applies to all the run configs below + configureEach { net.neoforged.gradle.dsl.common.runs.run.Run run -> + // Recommended logging data for a userdev environment + systemProperty 'forge.logging.markers', 'REGISTRIES' - runs { - client { - workingDirectory project.file('run') - - mods { - actuallyadditions { - source sourceSets.main - } - } + // Recommended logging level for the console + systemProperty 'forge.logging.console.level', 'debug' + + //Limit ram usage for the dev environment to 4GB + jvmArgument '-Xmx4G' + + if (run.project.javaToolchains.launcherFor(java.toolchain).map { it.metadata.vendor }.getOrElse("").contains("JetBrains")) { + run.jvmArgument("-XX:+AllowEnhancedClassRedefinition") } - server { - workingDirectory project.file('run') - mods { - actuallyadditions { - source sourceSets.main - } - } - } + modSource project.sourceSets.main + } - data { - workingDirectory project.file('run') - args '--mod', 'actuallyadditions', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') + client { + // Comma-separated list of namespaces to load gametests from. Empty = all namespaces. + systemProperty 'neoforge.enabledGameTestNamespaces', "actuallyadditions" + } - mods { - actuallyadditions { - source sourceSets.main - } - } - } + server { + systemProperty 'neoforge.enabledGameTestNamespaces', "actuallyadditions" + 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', "actuallyadditions", '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath() } } @@ -64,20 +69,23 @@ repositories { url = "https://maven.blamejared.com" } maven { - url = "https://www.cursemaven.com" + url "https://cursemaven.com" + content { + includeGroup "curse.maven" + } } } dependencies { - minecraft "net.minecraftforge:forge:${game_version}-${forge_version}" + implementation "net.neoforged:neoforge:${neo_version}" - compileOnly fg.deobf("mezz.jei:jei-${game_version}-common-api:${jei_version}") - compileOnly fg.deobf("mezz.jei:jei-${game_version}-forge-api:${jei_version}") + compileOnly "mezz.jei:jei-${game_version}-common-api:${jei_version}" + compileOnly "mezz.jei:jei-${game_version}-neoforge-api:${jei_version}" - runtimeOnly fg.deobf("mezz.jei:jei-${game_version}-forge:${jei_version}") + runtimeOnly "mezz.jei:jei-${game_version}-neoforge:${jei_version}" - runtimeOnly fg.deobf("curse.maven:the-one-probe-245211:4629624") - runtimeOnly fg.deobf("curse.maven:mekanism-268560:5125665") + runtimeOnly "curse.maven:the-one-probe-245211:5084077" + runtimeOnly "curse.maven:mekanism-268560:5155329" } // not sure if this is still needed @@ -107,12 +115,6 @@ jar { from sourceSets.main.output } -task deobfJar(type: Jar) { - from sourceSets.main.output - from sourceSets.main.java - archiveClassifier.set('dev') -} - task apiJar(type: Jar) { from sourceSets.main.output from sourceSets.main.java @@ -135,7 +137,7 @@ task sourcesJar(type: Jar) { } artifacts { - archives deobfJar, sourcesJar, apiJar, javadocJar + archives sourcesJar, apiJar, javadocJar } publishing { @@ -148,7 +150,6 @@ publishing { from components.java - artifact deobfJar artifact sourcesJar artifact apiJar artifact javadocJar diff --git a/gradle.properties b/gradle.properties index b8c4072a7..484609bcf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,11 +6,12 @@ org.gradle.daemon=false mod_version=1.1.52 # Forge -game_version=1.20.1 -forge_version=47.1.3 +game_version=1.20.4 +neo_version=20.4.190 # Parchment (Mappings) -parchment_version=2023.09.03 +neogradle.subsystems.parchment.minecraftVersion=1.20.4 +neogradle.subsystems.parchment.mappingsVersion=2024.02.25 # Other mods -jei_version=15.3.0.4 +jei_version=17.3.0.49 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cbfa754578e88a3dae77fce6e3dea56edbf..d64cd4917707c1f8861d8cb53dd15194d4248596 100644 GIT binary patch literal 43462 zcma&NWl&^owk(X(xVyW%ySuwf;qI=D6|RlDJ2cR^yEKh!@I- zp9QeisK*rlxC>+~7Dk4IxIRsKBHqdR9b3+fyL=ynHmIDe&|>O*VlvO+%z5;9Z$|DJ zb4dO}-R=MKr^6EKJiOrJdLnCJn>np?~vU-1sSFgPu;pthGwf}bG z(1db%xwr#x)r+`4AGu$j7~u2MpVs3VpLp|mx&;>`0p0vH6kF+D2CY0fVdQOZ@h;A` z{infNyvmFUiu*XG}RNMNwXrbec_*a3N=2zJ|Wh5z* z5rAX$JJR{#zP>KY**>xHTuw?|-Rg|o24V)74HcfVT;WtQHXlE+_4iPE8QE#DUm%x0 zEKr75ur~W%w#-My3Tj`hH6EuEW+8K-^5P62$7Sc5OK+22qj&Pd1;)1#4tKihi=~8C zHiQSst0cpri6%OeaR`PY>HH_;CPaRNty%WTm4{wDK8V6gCZlG@U3$~JQZ;HPvDJcT1V{ z?>H@13MJcCNe#5z+MecYNi@VT5|&UiN1D4ATT+%M+h4c$t;C#UAs3O_q=GxK0}8%8 z8J(_M9bayxN}69ex4dzM_P3oh@ZGREjVvn%%r7=xjkqxJP4kj}5tlf;QosR=%4L5y zWhgejO=vao5oX%mOHbhJ8V+SG&K5dABn6!Wi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zM$o=3-mQ0Zgd?ZtaI> zQVHP1W3v1lbw>|?z@2MO(Ex!5KybKQ@+JRAg1>nzpP-!@3!th3rV=o?eiZ~fQRWy_ zfA!U9^bUL+z_$VJI=ic;{epla<&J@W-QMPZm^kTQ8a^2TX^TDpza*^tOu!WZ=T!PT z+0lJ*HuRnNGobNk0PbPT?i;^h{&0u+-fejISNv#9&j~Ep2;dYspntgzwR6<$@0dTQ z!qLe3Ztc=Ozy!btCcx!G$U7FlBRe}-L(E|RpH%_gt4m_LJllX3!iRYJEPvxcJ>C76 zfBy0_zKaYn{3yG6@;}S&+BeJk5X}$Kchp<Ea-=>VDg&zi*8xM0-ya!{ zcDN@>%H#vMwugU&1KN9pqA6-?Q8N@Dz?VlJ3IDfz#i#_RxgQS*>K+|Q@bek+s7#Qk z(5NZ-4xs&$j)X=@(1(hLn)vPj&pP>Nyu)emQ1MW6)g0hqXa5oJ_slh@(5MMS4xnG= z{0aK#F@_p=e}FdAa3tEl!|+j?h8h`t0CvCmNU%dOwEq<+jmm-=n|r|G^7QX4N4o(v zPU!%%w(Cet)Zev3QA?;TMm_aEK!5(~Nc6pJlp|sQP@z%JI}f0_`u+rc`1Df^j0G&s ScNgau(U?ep-K_E5zy1%ZQTdPn diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37aef8d3f..a80b22ce5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ 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.6-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 65dcd68d6..1aa94a426 100755 --- a/gradlew +++ b/gradlew @@ -83,10 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# 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"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,10 +131,13 @@ location of your Java installation." fi else 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. + if ! command -v java >/dev/null 2>&1 + then + 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 location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then done 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. + +# 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"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index 6689b85be..7101f8e46 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/logs/debug.log b/logs/debug.log deleted file mode 100644 index e69de29bb..000000000 diff --git a/logs/latest.log b/logs/latest.log deleted file mode 100644 index e69de29bb..000000000 diff --git a/settings.gradle b/settings.gradle index b7fe2dc86..b03169b5f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,13 +2,12 @@ pluginManagement { repositories { gradlePluginPortal() maven { - name = 'MinecraftForge' - url = 'https://maven.minecraftforge.net/' + name = 'Official NeoForge Maven' + url = 'https://maven.neoforged.net/releases' } - maven { url = 'https://maven.parchmentmc.org' } } } plugins { - id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0' -} \ No newline at end of file + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java b/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java index 692d4d5ba..fa006af74 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java @@ -20,6 +20,7 @@ import de.ellpeck.actuallyadditions.api.lens.Lens; import de.ellpeck.actuallyadditions.api.lens.LensConversion; import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient; import de.ellpeck.actuallyadditions.api.recipe.WeightedOre; +import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.crafting.ColorChangeRecipe; import de.ellpeck.actuallyadditions.mod.crafting.CrushingRecipe; import de.ellpeck.actuallyadditions.mod.crafting.EmpowererRecipe; @@ -35,9 +36,12 @@ import de.ellpeck.actuallyadditions.mod.items.lens.LensDetonation; import de.ellpeck.actuallyadditions.mod.items.lens.LensDisenchanting; import de.ellpeck.actuallyadditions.mod.items.lens.LensKiller; import de.ellpeck.actuallyadditions.mod.items.lens.LensMining; +import net.minecraft.core.NonNullList; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; +import net.minecraft.world.item.crafting.RecipeHolder; import java.util.ArrayList; import java.util.List; @@ -48,15 +52,15 @@ public final class ActuallyAdditionsAPI { public static final String API_ID = MOD_ID + "api"; public static final String API_VERSION = "34"; - public static final List CRUSHER_RECIPES = new ArrayList<>(); - public static final List EMPOWERER_RECIPES = new ArrayList<>(); - public static final List COLOR_CHANGE_RECIPES = new ArrayList<>(); - public static final List SOLID_FUEL_RECIPES = new ArrayList<>(); - public static final List LIQUID_FUEL_RECIPES = new ArrayList<>(); - public static final List PRESSING_RECIPES = new ArrayList<>(); - public static final List FERMENTING_RECIPES = new ArrayList<>(); - public static final List CONVERSION_LASER_RECIPES = new ArrayList<>(); - public static final List MINING_LENS_RECIPES = new ArrayList<>(); + public static final List> CRUSHER_RECIPES = new ArrayList<>(); + public static final List> EMPOWERER_RECIPES = new ArrayList<>(); + public static final List> COLOR_CHANGE_RECIPES = new ArrayList<>(); + public static final List> SOLID_FUEL_RECIPES = new ArrayList<>(); + public static final List> LIQUID_FUEL_RECIPES = new ArrayList<>(); + public static final List> PRESSING_RECIPES = new ArrayList<>(); + public static final List> FERMENTING_RECIPES = new ArrayList<>(); + public static final List> CONVERSION_LASER_RECIPES = new ArrayList<>(); + public static final List> MINING_LENS_RECIPES = new ArrayList<>(); /** * Farmer behaviors are sorted when first accessed, this will not be done until after loading, but do not add behaviors at runtime. @@ -142,28 +146,30 @@ public final class ActuallyAdditionsAPI { * Adds a Recipe to the Crusher Recipe Registry * * @param input The input as an ItemStack - * @param outputOne The first output as an ItemStack - * @param outputTwo The second output as an ItemStack (can be ItemStack.EMPTY if there should be none) - * @param outputTwoChance The chance of the second output (0 won't occur at all, 100 will all the time) + * @param outputOne The first stack as an ItemStack + * @param outputTwo The second stack as an ItemStack (can be ItemStack.EMPTY if there should be none) + * @param outputTwoChance The chance of the second stack (0 won't occur at all, 100 will all the time) */ public static void addCrusherRecipe(ItemStack input, ItemStack outputOne, ItemStack outputTwo, int outputTwoChance) { - CRUSHER_RECIPES.add(new CrushingRecipe(Ingredient.of(input), outputOne, 1.0f, outputTwo.isEmpty() + ResourceLocation id = new ResourceLocation(ActuallyAdditions.MODID, BuiltInRegistries.ITEM.getKey(input.getItem()).getPath() + "_crushing"); + CRUSHER_RECIPES.add(new RecipeHolder<>(id, new CrushingRecipe(Ingredient.of(input), outputOne, 1.0f, outputTwo.isEmpty() ? ItemStack.EMPTY - : outputTwo, outputTwoChance)); + : outputTwo, outputTwoChance))); } /** * Adds a Recipe to the Crusher Recipe Registry * * @param input The input as an Ingredient - * @param outputOne The first output as an ItemStack - * @param outputTwo The second output as an ItemStack (can be ItemStack.EMPTY if there should be none) - * @param outputTwoChance The chance of the second output (0 won't occur at all, 100 will all the time) + * @param outputOne The first stack as an ItemStack + * @param outputTwo The second stack as an ItemStack (can be ItemStack.EMPTY if there should be none) + * @param outputTwoChance The chance of the second stack (0 won't occur at all, 100 will all the time) */ public static void addCrusherRecipe(Ingredient input, ItemStack outputOne, ItemStack outputTwo, int outputTwoChance) { - CRUSHER_RECIPES.add(new CrushingRecipe(input, outputOne, 1.0f, outputTwo.isEmpty() - ? ItemStack.EMPTY - : outputTwo, outputTwoChance)); + ResourceLocation id = new ResourceLocation(ActuallyAdditions.MODID, BuiltInRegistries.ITEM.getKey(input.getItems()[0].getItem()).getPath() + "_crushing"); + CRUSHER_RECIPES.add(new RecipeHolder<>(id, new CrushingRecipe(input, outputOne, 1.0f, outputTwo.isEmpty() + ? ItemStack.EMPTY + : outputTwo, outputTwoChance))); } /** @@ -172,10 +178,10 @@ public final class ActuallyAdditionsAPI { * * @param inputs The inputs as an ItemStack List, stacksizes are ignored * @param outputOnes The first outputs as an ItemStack List, stacksizes are ignored - * @param outputOneAmounts The amount of the first output, will be equal for all entries in the list + * @param outputOneAmounts The amount of the first stack, will be equal for all entries in the list * @param outputTwos The second outputs as a List (can be null or empty if there should be none) - * @param outputTwoAmounts The amount of the second output, will be equal for all entries in the list - * @param outputTwoChance The chance of the second output (0 won't occur at all, 100 will all the time) + * @param outputTwoAmounts The amount of the second stack, will be equal for all entries in the list + * @param outputTwoChance The chance of the second stack (0 won't occur at all, 100 will all the time) */ public static boolean addCrusherRecipes(List inputs, List outputOnes, int outputOneAmounts, List outputTwos, int outputTwoAmounts, int outputTwoChance) { return methodHandler.addCrusherRecipes(inputs, outputOnes, outputOneAmounts, outputTwos, outputTwoAmounts, outputTwoChance); @@ -188,7 +194,8 @@ public final class ActuallyAdditionsAPI { } public static void addEmpowererRecipe(ResourceLocation id, Ingredient input, ItemStack output, Ingredient modifier1, Ingredient modifier2, Ingredient modifier3, Ingredient modifier4, int energyPerStand, int time, int particleColor) { - EMPOWERER_RECIPES.add(new EmpowererRecipe(id, output, input, modifier1, modifier2, modifier3, modifier4, energyPerStand, time, particleColor)); + EmpowererRecipe recipe = new EmpowererRecipe(output, input, NonNullList.of(modifier1, modifier2, modifier3, modifier4), energyPerStand, time, particleColor); + EMPOWERER_RECIPES.add(new RecipeHolder<>(id, recipe)); } /** @@ -196,19 +203,19 @@ public final class ActuallyAdditionsAPI { * StackSizes can only be 1 and greater ones will be ignored * * @param input The input as an ItemStack - * @param output The output as an ItemStack + * @param output The stack as an ItemStack * @param energyUse The amount of RF used per conversion * @param type The type of lens used for the conversion. To use the default type, use method below. * Note how this always has to be the same instance of the lens type that the item also has for it to work! */ @Deprecated public static void addReconstructorLensConversionRecipe(ItemStack input, ItemStack output, int energyUse, LensConversion type) { - //RECONSTRUCTOR_LENS_CONVERSION_RECIPES.add(new LensConversionRecipe(input, output, energyUse, type)); + //RECONSTRUCTOR_LENS_CONVERSION_RECIPES.add(new LensConversionRecipe(input, stack, energyUse, type)); } @Deprecated public static void addReconstructorLensConversionRecipe(ItemStack input, ItemStack output, int energyUse) { - //addReconstructorLensConversionRecipe(input, output, energyUse, lensDefaultConversion); + //addReconstructorLensConversionRecipe(input, stack, energyUse, lensDefaultConversion); } /** @@ -216,17 +223,17 @@ public final class ActuallyAdditionsAPI { * StackSizes can only be 1 and greater ones will be ignored * * @param input The input as an ItemStack - * @param output The output as an ItemStack + * @param output The stack as an ItemStack * @param energyUse The amount of RF used per conversion * @param type The type of lens used for the conversion. To use the default type, use method below. * Note how this always has to be the same instance of the lens type that the item also has for it to work! */ public static void addReconstructorLensConversionRecipe(Ingredient input, ItemStack output, int energyUse, LensConversion type) { - //RECONSTRUCTOR_LENS_CONVERSION_RECIPES.add(new LensConversionRecipe(input, output, energyUse, type)); + //RECONSTRUCTOR_LENS_CONVERSION_RECIPES.add(new LensConversionRecipe(input, stack, energyUse, type)); } public static void addReconstructorLensConversionRecipe(Ingredient input, ItemStack output, int energyUse) { - //addReconstructorLensConversionRecipe(input, output, energyUse, lensDefaultConversion); + //addReconstructorLensConversionRecipe(input, stack, energyUse, lensDefaultConversion); } /** * Adds an ingredient to the Coffee Machine ingredient list diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletChapter.java b/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletChapter.java index bac2207da..8c8c3cdab 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletChapter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletChapter.java @@ -11,8 +11,8 @@ package de.ellpeck.actuallyadditions.api.booklet; 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; public interface IBookletChapter { diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletEntry.java b/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletEntry.java index b91e0beac..aacfc8bbb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletEntry.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletEntry.java @@ -10,8 +10,8 @@ package de.ellpeck.actuallyadditions.api.booklet; -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 java.util.List; diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletPage.java b/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletPage.java index ca84df9b8..5af30f3f8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletPage.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletPage.java @@ -13,9 +13,9 @@ package de.ellpeck.actuallyadditions.api.booklet; import de.ellpeck.actuallyadditions.api.booklet.internal.GuiBookletBase; import net.minecraft.client.gui.components.Button; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.fluids.FluidStack; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.fluids.FluidStack; import java.util.List; diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/ActuallyAdditionsData.java b/src/main/java/de/ellpeck/actuallyadditions/data/ActuallyAdditionsData.java index 9e871e407..f2674fdc5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/ActuallyAdditionsData.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/ActuallyAdditionsData.java @@ -3,6 +3,7 @@ package de.ellpeck.actuallyadditions.data; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.config.conditions.BoolConfigCondition; import de.ellpeck.actuallyadditions.mod.misc.ActuallyDamageTypes; +import net.minecraft.core.Cloner; import net.minecraft.core.HolderLookup; import net.minecraft.core.RegistryAccess; import net.minecraft.core.RegistrySetBuilder; @@ -12,12 +13,12 @@ import net.minecraft.data.DataGenerator; import net.minecraft.data.PackOutput; import net.minecraft.data.registries.VanillaRegistries; import net.minecraft.world.damagesource.DamageType; -import net.minecraftforge.common.crafting.CraftingHelper; -import net.minecraftforge.common.data.DatapackBuiltinEntriesProvider; -import net.minecraftforge.common.data.ExistingFileHelper; -import net.minecraftforge.data.event.GatherDataEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; +import net.neoforged.neoforge.common.crafting.CraftingHelper; +import net.neoforged.neoforge.common.data.DatapackBuiltinEntriesProvider; +import net.neoforged.neoforge.common.data.ExistingFileHelper; +import net.neoforged.neoforge.data.event.GatherDataEvent; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.Mod; import java.util.Set; import java.util.concurrent.CompletableFuture; @@ -27,10 +28,10 @@ public class ActuallyAdditionsData { @SubscribeEvent public static void runGenerator(GatherDataEvent event) { - CraftingHelper.register(BoolConfigCondition.Serializer.INSTANCE); DataGenerator generator = event.getGenerator(); PackOutput packOutput = generator.getPackOutput(); - CompletableFuture lookupProvider = CompletableFuture.supplyAsync(ActuallyAdditionsData::getProvider); + CompletableFuture patchedProvider = CompletableFuture.supplyAsync(ActuallyAdditionsData::getProvider); + CompletableFuture lookupProvider = CompletableFuture.supplyAsync(() -> ActuallyAdditionsData.getProvider().full()); ExistingFileHelper helper = event.getExistingFileHelper(); // generator.addProvider(new GeneratorLanguage(generator)); @@ -58,18 +59,20 @@ public class ActuallyAdditionsData { generator.addProvider(true, new SoundsGenerator(packOutput, helper)); generator.addProvider(event.includeServer(), new DatapackBuiltinEntriesProvider( - packOutput, lookupProvider, Set.of(ActuallyAdditions.MODID))); + packOutput, patchedProvider, Set.of(ActuallyAdditions.MODID))); } - private static HolderLookup.Provider getProvider() { + private static RegistrySetBuilder.PatchedRegistries getProvider() { final RegistrySetBuilder registryBuilder = new RegistrySetBuilder(); registryBuilder.add(Registries.DAMAGE_TYPE, (context) -> { context.register(ActuallyDamageTypes.ATOMIC_RECONSTRUCTOR, new DamageType("actuallyadditions.atomic_reconstructor", 0.0F)); }); // We need the BIOME registry to be present, so we can use a biome tag, doesn't matter that it's empty - registryBuilder.add(Registries.BIOME, context -> { + registryBuilder.add(Registries.BIOME, $ -> { }); RegistryAccess.Frozen regAccess = RegistryAccess.fromRegistryOfRegistries(BuiltInRegistries.REGISTRY); - return registryBuilder.buildPatch(regAccess, VanillaRegistries.createLookup()); + Cloner.Factory cloner$factory = new Cloner.Factory(); + net.neoforged.neoforge.registries.DataPackRegistriesHooks.getDataPackRegistriesWithDimensions().forEach(data -> data.runWithArguments(cloner$factory::addCodec)); + return registryBuilder.buildPatch(regAccess, VanillaRegistries.createLookup(), cloner$factory); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/AdvancementGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/AdvancementGenerator.java index 221f18e29..adc475477 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/AdvancementGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/AdvancementGenerator.java @@ -4,8 +4,10 @@ import de.ellpeck.actuallyadditions.api.ActuallyTags; import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; import net.minecraft.advancements.Advancement; +import net.minecraft.advancements.AdvancementHolder; +import net.minecraft.advancements.AdvancementType; +import net.minecraft.advancements.CriteriaTriggers; import net.minecraft.advancements.DisplayInfo; -import net.minecraft.advancements.FrameType; import net.minecraft.advancements.critereon.ImpossibleTrigger; import net.minecraft.advancements.critereon.InventoryChangeTrigger; import net.minecraft.advancements.critereon.ItemPredicate; @@ -13,37 +15,38 @@ import net.minecraft.core.HolderLookup; import net.minecraft.data.PackOutput; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.common.data.ExistingFileHelper; -import net.minecraftforge.common.data.ForgeAdvancementProvider; +import net.neoforged.neoforge.common.data.AdvancementProvider; +import net.neoforged.neoforge.common.data.ExistingFileHelper; import java.util.List; +import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.function.Consumer; -public class AdvancementGenerator extends ForgeAdvancementProvider { +public class AdvancementGenerator extends AdvancementProvider { public AdvancementGenerator(PackOutput packOutput, CompletableFuture registries, ExistingFileHelper existingFileHelper) { super(packOutput, registries, existingFileHelper, List.of(new ActuallyAdvancementGenerator())); } public static class ActuallyAdvancementGenerator implements AdvancementGenerator { @Override - public void generate(HolderLookup.Provider registries, Consumer consumer, ExistingFileHelper existingFileHelper) { - Advancement root = Advancement.Builder.advancement() + public void generate(HolderLookup.Provider registries, Consumer consumer, ExistingFileHelper existingFileHelper) { + AdvancementHolder root = Advancement.Builder.advancement() .display(new DisplayInfo(ActuallyItems.ITEM_BOOKLET.get().getDefaultInstance(), Component.translatable("achievement.actuallyadditions.openBooklet"), Component.translatable("achievement.actuallyadditions.openBooklet.desc"), - new ResourceLocation("textures/gui/advancements/backgrounds/stone.png"), FrameType.TASK, true, true, false)) - .addCriterion("right_click", new ImpossibleTrigger.TriggerInstance()) + Optional.of(new ResourceLocation("textures/gui/advancements/backgrounds/stone.png")), AdvancementType.TASK, true, true, false)) + .addCriterion("right_click", CriteriaTriggers.IMPOSSIBLE.createCriterion(new ImpossibleTrigger.TriggerInstance())) .save(consumer, "actuallyadditions:root"); //TODO: Underwater Treasure Chest Advancement? - Advancement phantomFace = Advancement.Builder.advancement() + AdvancementHolder phantomFace = Advancement.Builder.advancement() .parent(root) .display(new DisplayInfo(ActuallyBlocks.PHANTOM_ITEMFACE.get().asItem().getDefaultInstance(), Component.translatable("achievement.actuallyadditions.craftPhantomface"), Component.translatable("achievement.actuallyadditions.craftPhantomface.desc"), - new ResourceLocation("textures/blocks/stone.png"), FrameType.TASK, true, true, false)) + Optional.of(new ResourceLocation("textures/blocks/stone.png")), AdvancementType.TASK, true, true, false)) .addCriterion("phantom_face", InventoryChangeTrigger.TriggerInstance.hasItems(ActuallyBlocks.PHANTOM_ITEMFACE.get())) .save(consumer, "actuallyadditions:craft_phantom_face"); @@ -53,7 +56,7 @@ public class AdvancementGenerator extends ForgeAdvancementProvider { .display(new DisplayInfo(ActuallyBlocks.PHANTOM_LIQUIFACE.get().asItem().getDefaultInstance(), Component.translatable("achievement.actuallyadditions.craftLiquiface"), Component.translatable("achievement.actuallyadditions.craftLiquiface.desc"), - null, FrameType.TASK, true, true, false)) + null, AdvancementType.TASK, true, true, false)) .addCriterion("liquiface", InventoryChangeTrigger.TriggerInstance.hasItems(ActuallyBlocks.PHANTOM_LIQUIFACE.get())) .save(consumer, "actuallyadditions:craft_liquiface"); @@ -62,17 +65,17 @@ public class AdvancementGenerator extends ForgeAdvancementProvider { .display(new DisplayInfo(ActuallyBlocks.PHANTOM_ENERGYFACE.get().asItem().getDefaultInstance(), Component.translatable("achievement.actuallyadditions.craftEnergyface"), Component.translatable("achievement.actuallyadditions.craftEnergyface.desc"), - null, FrameType.TASK, true, true, false)) + null, AdvancementType.TASK, true, true, false)) .addCriterion("energyface", InventoryChangeTrigger.TriggerInstance.hasItems(ActuallyBlocks.PHANTOM_ENERGYFACE.get())) .save(consumer, "actuallyadditions:craft_energyface"); - Advancement coalGenerator = Advancement.Builder.advancement() + AdvancementHolder coalGenerator = Advancement.Builder.advancement() .parent(root) .display(new DisplayInfo(ActuallyBlocks.COAL_GENERATOR.get().asItem().getDefaultInstance(), Component.translatable("achievement.actuallyadditions.craftCoalGen"), Component.translatable("achievement.actuallyadditions.craftCoalGen.desc"), - null, FrameType.TASK, true, true, false)) + null, AdvancementType.TASK, true, true, false)) .addCriterion("coal_generator", InventoryChangeTrigger.TriggerInstance.hasItems(ActuallyBlocks.COAL_GENERATOR.get())) .save(consumer, "actuallyadditions:craft_coal_generator"); @@ -81,16 +84,16 @@ public class AdvancementGenerator extends ForgeAdvancementProvider { .display(new DisplayInfo(ActuallyBlocks.LEAF_GENERATOR.get().asItem().getDefaultInstance(), Component.translatable("achievement.actuallyadditions.craftLeafGen"), Component.translatable("achievement.actuallyadditions.craftLeafGen.desc"), - null, FrameType.TASK, true, true, false)) + null, AdvancementType.TASK, true, true, false)) .addCriterion("leaf_generator", InventoryChangeTrigger.TriggerInstance.hasItems(ActuallyBlocks.LEAF_GENERATOR.get())) .save(consumer, "actuallyadditions:craft_leaf_generator"); - Advancement coffeeBeans = Advancement.Builder.advancement() + AdvancementHolder coffeeBeans = Advancement.Builder.advancement() .parent(coalGenerator) .display(new DisplayInfo(ActuallyItems.COFFEE_BEANS.get().getDefaultInstance(), Component.translatable("achievement.actuallyadditions.pickUpCoffee"), Component.translatable("achievement.actuallyadditions.pickUpCoffee.desc"), - null, FrameType.TASK, true, true, false)) + null, AdvancementType.TASK, true, true, false)) .addCriterion("coffee_beans", InventoryChangeTrigger.TriggerInstance.hasItems(ActuallyItems.COFFEE_BEANS.get())) .save(consumer, "actuallyadditions:pickup_coffee"); @@ -99,25 +102,25 @@ public class AdvancementGenerator extends ForgeAdvancementProvider { .display(new DisplayInfo(ActuallyBlocks.COFFEE_MACHINE.get().asItem().getDefaultInstance(), Component.translatable("achievement.actuallyadditions.craftCoffeeMachine"), Component.translatable("achievement.actuallyadditions.craftCoffeeMachine.desc"), - null, FrameType.TASK, true, true, false)) + null, AdvancementType.TASK, true, true, false)) .addCriterion("coffee_machine", InventoryChangeTrigger.TriggerInstance.hasItems(ActuallyBlocks.COFFEE_MACHINE.get())) .save(consumer, "actuallyadditions:craft_coffee_machine"); - Advancement reconstructor = Advancement.Builder.advancement() + AdvancementHolder reconstructor = Advancement.Builder.advancement() .parent(coalGenerator) .display(new DisplayInfo(ActuallyBlocks.ATOMIC_RECONSTRUCTOR.get().asItem().getDefaultInstance(), Component.translatable("achievement.actuallyadditions.craftReconstructor"), Component.translatable("achievement.actuallyadditions.craftReconstructor.desc"), - null, FrameType.TASK, true, true, false)) + null, AdvancementType.TASK, true, true, false)) .addCriterion("atomic_reconstructor", InventoryChangeTrigger.TriggerInstance.hasItems(ActuallyBlocks.ATOMIC_RECONSTRUCTOR.get())) .save(consumer, "actuallyadditions:craft_reconstructor"); - Advancement makeFirstCrystal = Advancement.Builder.advancement() + AdvancementHolder makeFirstCrystal = Advancement.Builder.advancement() .parent(reconstructor) .display(new DisplayInfo(ActuallyItems.EMERADIC_CRYSTAL.get().getDefaultInstance(), Component.translatable("achievement.actuallyadditions.makeCrystal"), Component.translatable("achievement.actuallyadditions.makeCrystal.desc"), - null, FrameType.TASK, true, true, false)) + null, AdvancementType.TASK, true, true, false)) .addCriterion("crystal", InventoryChangeTrigger.TriggerInstance.hasItems( ItemPredicate.Builder.item().of(ActuallyTags.Items.CRYSTALS).build()) ) @@ -128,82 +131,82 @@ public class AdvancementGenerator extends ForgeAdvancementProvider { .display(new DisplayInfo(ActuallyBlocks.EMPOWERER.get().asItem().getDefaultInstance(), Component.translatable("achievement.actuallyadditions.craftEmpowerer"), Component.translatable("achievement.actuallyadditions.craftEmpowerer.desc"), - null, FrameType.TASK, true, true, false)) + null, AdvancementType.TASK, true, true, false)) .addCriterion("empowerer", InventoryChangeTrigger.TriggerInstance.hasItems(ActuallyBlocks.EMPOWERER.get())) .save(consumer, "actuallyadditions:craft_empowerer"); - Advancement craftCrusher = Advancement.Builder.advancement() + AdvancementHolder craftCrusher = Advancement.Builder.advancement() .parent(reconstructor) .display(new DisplayInfo(ActuallyBlocks.CRUSHER.get().asItem().getDefaultInstance(), Component.translatable("achievement.actuallyadditions.craftCrusher"), Component.translatable("achievement.actuallyadditions.craftCrusher.desc"), - null, FrameType.TASK, true, true, false)) + null, AdvancementType.TASK, true, true, false)) .addCriterion("crystal", InventoryChangeTrigger.TriggerInstance.hasItems( ItemPredicate.Builder.item().of(ActuallyBlocks.CRUSHER.get()).build()) ) .save(consumer, "actuallyadditions:craft_crusher"); - Advancement craftDoubleCrusher = Advancement.Builder.advancement() + AdvancementHolder craftDoubleCrusher = Advancement.Builder.advancement() .parent(craftCrusher) .display(new DisplayInfo(ActuallyBlocks.CRUSHER_DOUBLE.get().asItem().getDefaultInstance(), Component.translatable("achievement.actuallyadditions.craftDoubleCrusher"), Component.translatable("achievement.actuallyadditions.craftDoubleCrusher.desc"), - null, FrameType.TASK, true, true, false)) + null, AdvancementType.TASK, true, true, false)) .addCriterion("crystal", InventoryChangeTrigger.TriggerInstance.hasItems( ItemPredicate.Builder.item().of(ActuallyBlocks.CRUSHER_DOUBLE.get()).build()) ) .save(consumer, "actuallyadditions:craft_double_crusher"); - Advancement craftLaserRelay = Advancement.Builder.advancement() + AdvancementHolder craftLaserRelay = Advancement.Builder.advancement() .parent(reconstructor) .display(new DisplayInfo(ActuallyBlocks.LASER_RELAY.get().asItem().getDefaultInstance(), Component.translatable("achievement.actuallyadditions.craftLaserRelay"), Component.translatable("achievement.actuallyadditions.craftLaserRelay.desc"), - null, FrameType.TASK, true, true, false)) + null, AdvancementType.TASK, true, true, false)) .addCriterion("laser_relay", InventoryChangeTrigger.TriggerInstance.hasItems( ItemPredicate.Builder.item().of(ActuallyBlocks.LASER_RELAY.get()).build()) ) .save(consumer, "actuallyadditions:craft_laser_relay"); - Advancement craftLaserRelayAdvanced = Advancement.Builder.advancement() + AdvancementHolder craftLaserRelayAdvanced = Advancement.Builder.advancement() .parent(craftLaserRelay) .display(new DisplayInfo(ActuallyBlocks.LASER_RELAY_ADVANCED.get().asItem().getDefaultInstance(), Component.translatable("achievement.actuallyadditions.craftLaserRelayAdvanced"), Component.translatable("achievement.actuallyadditions.craftLaserRelayAdvanced.desc"), - null, FrameType.TASK, true, true, false)) + null, AdvancementType.TASK, true, true, false)) .addCriterion("laser_relay_advanced", InventoryChangeTrigger.TriggerInstance.hasItems( ItemPredicate.Builder.item().of(ActuallyBlocks.LASER_RELAY_ADVANCED.get()).build()) ) .save(consumer, "actuallyadditions:craft_laser_relay_advanced"); - Advancement craftLaserRelayExtreme = Advancement.Builder.advancement() + AdvancementHolder craftLaserRelayExtreme = Advancement.Builder.advancement() .parent(craftLaserRelayAdvanced) .display(new DisplayInfo(ActuallyBlocks.LASER_RELAY_EXTREME.get().asItem().getDefaultInstance(), Component.translatable("achievement.actuallyadditions.craftLaserRelayExtreme"), Component.translatable("achievement.actuallyadditions.craftLaserRelayExtreme.desc"), - null, FrameType.TASK, true, true, false)) + null, AdvancementType.TASK, true, true, false)) .addCriterion("laser_relay_extreme", InventoryChangeTrigger.TriggerInstance.hasItems( ItemPredicate.Builder.item().of(ActuallyBlocks.LASER_RELAY_EXTREME.get()).build()) ) .save(consumer, "actuallyadditions:craft_laser_relay_extreme"); - Advancement craftLaserRelayItem = Advancement.Builder.advancement() + AdvancementHolder craftLaserRelayItem = Advancement.Builder.advancement() .parent(craftLaserRelay) .display(new DisplayInfo(ActuallyBlocks.LASER_RELAY_ITEM.get().asItem().getDefaultInstance(), Component.translatable("achievement.actuallyadditions.craftLaserRelayItem"), Component.translatable("achievement.actuallyadditions.craftLaserRelayItem.desc"), - null, FrameType.TASK, true, true, false)) + null, AdvancementType.TASK, true, true, false)) .addCriterion("laser_relay_item", InventoryChangeTrigger.TriggerInstance.hasItems( ItemPredicate.Builder.item().of(ActuallyBlocks.LASER_RELAY_ITEM.get()).build()) ) .save(consumer, "actuallyadditions:craft_laser_relay_item"); - Advancement craftItemInterface = Advancement.Builder.advancement() + AdvancementHolder craftItemInterface = Advancement.Builder.advancement() .parent(craftLaserRelay) .display(new DisplayInfo(ActuallyBlocks.ITEM_INTERFACE.get().asItem().getDefaultInstance(), Component.translatable("achievement.actuallyadditions.craftItemInterface"), Component.translatable("achievement.actuallyadditions.craftItemInterface.desc"), - null, FrameType.TASK, true, true, false)) + null, AdvancementType.TASK, true, true, false)) .addCriterion("item_interface", InventoryChangeTrigger.TriggerInstance.hasItems( ItemPredicate.Builder.item().of(ActuallyBlocks.ITEM_INTERFACE.get()).build()) ) diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java index e6eeb5898..defe709cb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/BlockRecipeGenerator.java @@ -1,26 +1,21 @@ package de.ellpeck.actuallyadditions.data; -import com.google.gson.JsonObject; import de.ellpeck.actuallyadditions.api.ActuallyTags; import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; -import net.minecraft.data.CachedOutput; import net.minecraft.data.PackOutput; -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.ShapedRecipeBuilder; import net.minecraft.data.recipes.ShapelessRecipeBuilder; import net.minecraft.tags.ItemTags; import net.minecraft.world.item.Items; import net.minecraft.world.level.ItemLike; -import net.minecraftforge.common.Tags; -import org.jetbrains.annotations.Nullable; +import net.neoforged.neoforge.common.Tags; import javax.annotation.Nonnull; import java.util.Arrays; -import java.util.concurrent.CompletableFuture; -import java.util.function.Consumer; public class BlockRecipeGenerator extends RecipeProvider { public BlockRecipeGenerator(PackOutput packOutput) { @@ -28,7 +23,7 @@ public class BlockRecipeGenerator extends RecipeProvider { } @Override - protected void buildRecipes(@Nonnull Consumer consumer) { + protected void buildRecipes(@Nonnull RecipeOutput consumer) { //Battery Box Recipe.shapeless(ActuallyBlocks.BATTERY_BOX.getItem()).ingredients(ActuallyBlocks.ENERGIZER.get(), ActuallyBlocks.ENERVATOR.get(), ActuallyItems.BASIC_COIL.get()).save(consumer); @@ -232,11 +227,11 @@ public class BlockRecipeGenerator extends RecipeProvider { } - @Override - protected @Nullable CompletableFuture saveAdvancement(CachedOutput output, FinishedRecipe finishedRecipe, JsonObject advancementJson) { - return null; - //Nope... maybe later... - } +// @Override //TODO: Flanks do your RecipeOutput wrapper thingy ;) +// protected @Nullable CompletableFuture saveAdvancement(CachedOutput stack, FinishedRecipe finishedRecipe, JsonObject advancementJson) { +// return null; +// //Nope... maybe later... +// } public static class Recipe { public static Shapeless shapeless(ItemLike result) { @@ -255,15 +250,15 @@ public class BlockRecipeGenerator extends RecipeProvider { return new Shaped(result, count); } - public static void stairs(ItemLike result, ItemLike resource, Consumer consumer) { + public static void stairs(ItemLike result, ItemLike resource, RecipeOutput consumer) { Recipe.shaped(result).patternSingleKey('Q', resource, "Q ", "QQ ", "QQQ").save(consumer); } - public static void wall(ItemLike result, ItemLike resource, Consumer consumer) { + public static void wall(ItemLike result, ItemLike resource, RecipeOutput consumer) { Recipe.shaped(result).patternSingleKey('Q', resource, "QQQ", "QQQ").save(consumer); } - public static void slab(ItemLike result, ItemLike resource, Consumer consumer) { + public static void slab(ItemLike result, ItemLike resource, RecipeOutput consumer) { Recipe.shaped(result).patternSingleKey('Q', resource, "QQQ").save(consumer); } @@ -282,7 +277,7 @@ public class BlockRecipeGenerator extends RecipeProvider { } @Override - public void save(Consumer consumer) { + public void save(RecipeOutput consumer) { this.unlockedBy("has_book", has(ActuallyItems.ITEM_BOOKLET.get())); super.save(consumer); } @@ -320,7 +315,7 @@ public class BlockRecipeGenerator extends RecipeProvider { } @Override - public void save(Consumer consumerIn) { + public void save(RecipeOutput consumerIn) { this.unlockedBy("has_book", has(ActuallyItems.ITEM_BOOKLET.get())); super.save(consumerIn); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/BlockStateGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/BlockStateGenerator.java index 4531b9568..3d9e4bd0c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/BlockStateGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/BlockStateGenerator.java @@ -4,6 +4,7 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.blocks.BlockTinyTorch; import net.minecraft.core.Direction; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.data.PackOutput; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.block.Block; @@ -12,11 +13,10 @@ import net.minecraft.world.level.block.SlabBlock; import net.minecraft.world.level.block.StairBlock; import net.minecraft.world.level.block.WallBlock; import net.minecraft.world.level.block.state.properties.BlockStateProperties; -import net.minecraftforge.client.model.generators.BlockStateProvider; -import net.minecraftforge.client.model.generators.ConfiguredModel; -import net.minecraftforge.client.model.generators.ModelFile; -import net.minecraftforge.common.data.ExistingFileHelper; -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.common.data.ExistingFileHelper; import java.util.function.Supplier; @@ -210,7 +210,7 @@ public class BlockStateGenerator extends BlockStateProvider { } private void standardBlock(Supplier block) { - ResourceLocation name = ForgeRegistries.BLOCKS.getKey(block.get()); + ResourceLocation name = BuiltInRegistries.BLOCK.getKey(block.get()); ModelFile model = new ModelFile.UncheckedModelFile(modLoc("block/" + name.getPath())); assert name != null; @@ -218,7 +218,7 @@ public class BlockStateGenerator extends BlockStateProvider { } private void standardBlockWithCube(Supplier block) { - ResourceLocation name = ForgeRegistries.BLOCKS.getKey(block.get()); + ResourceLocation name = BuiltInRegistries.BLOCK.getKey(block.get()); assert name != null; ModelFile model = models().cubeAll(name.toString(), modLoc("block/" + name.getPath())); @@ -226,7 +226,7 @@ public class BlockStateGenerator extends BlockStateProvider { } private void buildLitState(Supplier block) { - ResourceLocation name = ForgeRegistries.BLOCKS.getKey(block.get()); + ResourceLocation name = BuiltInRegistries.BLOCK.getKey(block.get()); assert name != null; getVariantBuilder(block.get()) @@ -237,7 +237,7 @@ public class BlockStateGenerator extends BlockStateProvider { } private void fullyDirectionalBlock(Supplier block) { - ResourceLocation name = ForgeRegistries.BLOCKS.getKey(block.get()); + ResourceLocation name = BuiltInRegistries.BLOCK.getKey(block.get()); ModelFile model = new ModelFile.UncheckedModelFile(modLoc("block/" + name.getPath())); ModelFile verModel = new ModelFile.UncheckedModelFile(modLoc("block/" + name.getPath() + "_ver")); @@ -246,7 +246,7 @@ public class BlockStateGenerator extends BlockStateProvider { } private void horizontallyDirectionalBlock(Supplier block) { - ResourceLocation name = ForgeRegistries.BLOCKS.getKey(block.get()); + ResourceLocation name = BuiltInRegistries.BLOCK.getKey(block.get()); ModelFile model = new ModelFile.UncheckedModelFile(modLoc("block/" + name.getPath())); assert name != null; @@ -255,7 +255,7 @@ public class BlockStateGenerator extends BlockStateProvider { private void tinyTorchBlock(Supplier block) { assert block.get() instanceof BlockTinyTorch; - ResourceLocation name = ForgeRegistries.BLOCKS.getKey(block.get()); + ResourceLocation name = BuiltInRegistries.BLOCK.getKey(block.get()); ModelFile model = new ModelFile.UncheckedModelFile(modLoc("block/" + name.getPath())); ModelFile wallModel = new ModelFile.UncheckedModelFile(modLoc("block/" + name.getPath() + "_wall")); diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/BlockTagsGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/BlockTagsGenerator.java index e4fc488ac..f1ba1af4a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/BlockTagsGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/BlockTagsGenerator.java @@ -6,8 +6,8 @@ import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import net.minecraft.core.HolderLookup; import net.minecraft.data.PackOutput; import net.minecraft.tags.BlockTags; -import net.minecraftforge.common.data.BlockTagsProvider; -import net.minecraftforge.common.data.ExistingFileHelper; +import net.neoforged.neoforge.common.data.BlockTagsProvider; +import net.neoforged.neoforge.common.data.ExistingFileHelper; import javax.annotation.Nullable; import java.util.concurrent.CompletableFuture; diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/ColorChangeGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/ColorChangeGenerator.java index a728efde8..e22d39bf6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/ColorChangeGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/ColorChangeGenerator.java @@ -1,24 +1,19 @@ package de.ellpeck.actuallyadditions.data; -import com.google.gson.JsonObject; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.crafting.ColorChangeRecipe; -import net.minecraft.data.CachedOutput; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.data.PackOutput; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.data.recipes.RecipeProvider; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.ItemLike; -import net.minecraftforge.registries.ForgeRegistries; -import org.jetbrains.annotations.Nullable; import javax.annotation.Nonnull; -import java.util.concurrent.CompletableFuture; -import java.util.function.Consumer; public class ColorChangeGenerator extends RecipeProvider { public ColorChangeGenerator(PackOutput packOutput) { @@ -30,13 +25,14 @@ public class ColorChangeGenerator extends RecipeProvider { return "Color Change " + super.getName(); } - @Override - protected @Nullable CompletableFuture saveAdvancement(CachedOutput output, FinishedRecipe finishedRecipe, JsonObject advancementJson) { - return null; //Nope... - } +// @Override //TODO: Flanks do your RecipeOutput wrapper thingy ;) +// protected @Nullable CompletableFuture saveAdvancement(CachedOutput stack, FinishedRecipe finishedRecipe, JsonObject advancementJson) { +// return null; +// //Nope... maybe later... +// } @Override - protected void buildRecipes(@Nonnull Consumer consumer) { + protected void buildRecipes(@Nonnull RecipeOutput consumer) { buildWool(consumer); buildStainedGlass(consumer); buildStainedGlassPane(consumer); @@ -47,7 +43,7 @@ public class ColorChangeGenerator extends RecipeProvider { buildDye(consumer); } - private void buildWool(@Nonnull Consumer c) { + private void buildWool(@Nonnull RecipeOutput c) { //Wool changeColor(c, Items.WHITE_WOOL, Items.BLACK_WOOL); changeColor(c, Items.ORANGE_WOOL, Items.WHITE_WOOL); @@ -67,7 +63,7 @@ public class ColorChangeGenerator extends RecipeProvider { changeColor(c, Items.BLACK_WOOL, Items.RED_WOOL); } - private void buildStainedGlass(@Nonnull Consumer c) { + private void buildStainedGlass(@Nonnull RecipeOutput c) { changeColor(c, Items.WHITE_STAINED_GLASS, Items.BLACK_STAINED_GLASS); changeColor(c, Items.ORANGE_STAINED_GLASS, Items.WHITE_STAINED_GLASS); changeColor(c, Items.MAGENTA_STAINED_GLASS, Items.ORANGE_STAINED_GLASS); @@ -86,7 +82,7 @@ public class ColorChangeGenerator extends RecipeProvider { changeColor(c, Items.BLACK_STAINED_GLASS, Items.RED_STAINED_GLASS); } - private void buildStainedGlassPane(@Nonnull Consumer c) { + private void buildStainedGlassPane(@Nonnull RecipeOutput c) { changeColor(c, Items.WHITE_STAINED_GLASS_PANE, Items.BLACK_STAINED_GLASS_PANE); changeColor(c, Items.ORANGE_STAINED_GLASS_PANE, Items.WHITE_STAINED_GLASS_PANE); changeColor(c, Items.MAGENTA_STAINED_GLASS_PANE, Items.ORANGE_STAINED_GLASS_PANE); @@ -105,7 +101,7 @@ public class ColorChangeGenerator extends RecipeProvider { changeColor(c, Items.BLACK_STAINED_GLASS_PANE, Items.RED_STAINED_GLASS_PANE); } - private void buildTerracotta(@Nonnull Consumer c) { + private void buildTerracotta(@Nonnull RecipeOutput c) { changeColor(c, Items.WHITE_TERRACOTTA, Items.BLACK_TERRACOTTA); changeColor(c, Items.ORANGE_TERRACOTTA, Items.WHITE_TERRACOTTA); changeColor(c, Items.MAGENTA_TERRACOTTA, Items.ORANGE_TERRACOTTA); @@ -124,7 +120,7 @@ public class ColorChangeGenerator extends RecipeProvider { changeColor(c, Items.BLACK_TERRACOTTA, Items.RED_TERRACOTTA); } - private void buildGlazedTerracotta(@Nonnull Consumer c) { + private void buildGlazedTerracotta(@Nonnull RecipeOutput c) { changeColor(c, Items.WHITE_GLAZED_TERRACOTTA, Items.BLACK_GLAZED_TERRACOTTA); changeColor(c, Items.ORANGE_GLAZED_TERRACOTTA, Items.WHITE_GLAZED_TERRACOTTA); changeColor(c, Items.MAGENTA_GLAZED_TERRACOTTA, Items.ORANGE_GLAZED_TERRACOTTA); @@ -143,7 +139,7 @@ public class ColorChangeGenerator extends RecipeProvider { changeColor(c, Items.BLACK_GLAZED_TERRACOTTA, Items.RED_GLAZED_TERRACOTTA); } - private void buildCarpet(@Nonnull Consumer c) { + private void buildCarpet(@Nonnull RecipeOutput c) { changeColor(c, Items.WHITE_CARPET, Items.BLACK_CARPET); changeColor(c, Items.ORANGE_CARPET, Items.WHITE_CARPET); changeColor(c, Items.MAGENTA_CARPET, Items.ORANGE_CARPET); @@ -162,7 +158,7 @@ public class ColorChangeGenerator extends RecipeProvider { changeColor(c, Items.BLACK_CARPET, Items.RED_CARPET); } - private void buildLamps(@Nonnull Consumer c) { + private void buildLamps(@Nonnull RecipeOutput c) { changeColor(c, ActuallyBlocks.LAMP_WHITE.getItem(), ActuallyBlocks.LAMP_BLACK.getItem()); changeColor(c, ActuallyBlocks.LAMP_ORANGE.getItem(), ActuallyBlocks.LAMP_WHITE.getItem()); changeColor(c, ActuallyBlocks.LAMP_MAGENTA.getItem(), ActuallyBlocks.LAMP_ORANGE.getItem()); @@ -181,7 +177,7 @@ public class ColorChangeGenerator extends RecipeProvider { changeColor(c, ActuallyBlocks.LAMP_BLACK.getItem(), ActuallyBlocks.LAMP_RED.getItem()); } - private void buildDye(@Nonnull Consumer c) { + private void buildDye(@Nonnull RecipeOutput c) { changeColor(c, Items.WHITE_DYE, Items.BLACK_DYE); changeColor(c, Items.ORANGE_DYE, Items.WHITE_DYE); changeColor(c, Items.MAGENTA_DYE, Items.ORANGE_DYE); @@ -201,16 +197,16 @@ public class ColorChangeGenerator extends RecipeProvider { } - private void changeColor(Consumer consumer, ItemLike output, Ingredient input) { - consumer.accept(new ColorChangeRecipe.Result(new ResourceLocation(ActuallyAdditions.MODID, "colorchange/" + ForgeRegistries.ITEMS.getKey(output.asItem()).getPath()), - input, output)); + private void changeColor(RecipeOutput consumer, ItemLike output, Ingredient input) { + consumer.accept(new ResourceLocation(ActuallyAdditions.MODID, "colorchange/" + BuiltInRegistries.ITEM.getKey(output.asItem()).getPath()), + new ColorChangeRecipe(output.asItem().getDefaultInstance(), input), null); } - private void changeColor(Consumer consumer, ItemLike output, ItemLike input) { - consumer.accept(new ColorChangeRecipe.Result(new ResourceLocation(ActuallyAdditions.MODID, "colorchange/" + ForgeRegistries.ITEMS.getKey(output.asItem()).getPath()), - Ingredient.of(input), output)); + private void changeColor(RecipeOutput consumer, ItemLike output, ItemLike input) { + consumer.accept(new ResourceLocation(ActuallyAdditions.MODID, "colorchange/" + BuiltInRegistries.ITEM.getKey(output.asItem()).getPath()), + new ColorChangeRecipe(output.asItem().getDefaultInstance(), Ingredient.of(input)), null); } - private void changeColor(Consumer consumer, ItemLike output, ItemStack input) { - consumer.accept(new ColorChangeRecipe.Result(new ResourceLocation(ActuallyAdditions.MODID, "colorchange/" + ForgeRegistries.ITEMS.getKey(output.asItem()).getPath()), - Ingredient.of(input), output)); + private void changeColor(RecipeOutput consumer, ItemLike output, ItemStack input) { + consumer.accept(new ResourceLocation(ActuallyAdditions.MODID, "colorchange/" + BuiltInRegistries.ITEM.getKey(output.asItem()).getPath()), + new ColorChangeRecipe(output.asItem().getDefaultInstance(), Ingredient.of(input)), null); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/CrushingRecipeGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/CrushingRecipeGenerator.java index ae9c23b91..312927a85 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/CrushingRecipeGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/CrushingRecipeGenerator.java @@ -1,19 +1,14 @@ package de.ellpeck.actuallyadditions.data; -import com.google.gson.JsonObject; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.crafting.CrushingRecipe; -import net.minecraft.data.CachedOutput; import net.minecraft.data.PackOutput; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.data.recipes.RecipeProvider; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; -import org.jetbrains.annotations.Nullable; - -import java.util.concurrent.CompletableFuture; -import java.util.function.Consumer; public class CrushingRecipeGenerator extends RecipeProvider { public CrushingRecipeGenerator(PackOutput packOutput) { @@ -25,14 +20,15 @@ public class CrushingRecipeGenerator extends RecipeProvider { return "Crushing " + super.getName(); } - @Override - protected @Nullable CompletableFuture saveAdvancement(CachedOutput output, FinishedRecipe finishedRecipe, JsonObject advancementJson) { - return null; //Nope... - } +// @Override //TODO: Flanks do your RecipeOutput wrapper thingy ;) +// protected @Nullable CompletableFuture saveAdvancement(CachedOutput stack, FinishedRecipe finishedRecipe, JsonObject advancementJson) { +// return null; +// //Nope... maybe later... +// } @Override - protected void buildRecipes(Consumer consumer) { - consumer.accept(new CrushingRecipe.Result(new ResourceLocation(ActuallyAdditions.MODID, "crushing/bone_crusher"), - Ingredient.of(Items.BONE), Items.BONE_MEAL, 6, 1.0f , Items.AIR, 0, 0.0f)); + protected void buildRecipes(RecipeOutput consumer) { + CrushingRecipe recipe = new CrushingRecipe(Ingredient.of(Items.BONE), new ItemStack(Items.BONE_MEAL, 6), 1.0f, ItemStack.EMPTY, 0.0f); + consumer.accept(new ResourceLocation(ActuallyAdditions.MODID, "crushing/iron_crusher"), recipe, null); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/DamageTypeTagsGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/DamageTypeTagsGenerator.java index 017acd3d1..e4bfd836b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/DamageTypeTagsGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/DamageTypeTagsGenerator.java @@ -6,7 +6,7 @@ import net.minecraft.core.HolderLookup; import net.minecraft.data.PackOutput; import net.minecraft.data.tags.DamageTypeTagsProvider; import net.minecraft.tags.DamageTypeTags; -import net.minecraftforge.common.data.ExistingFileHelper; +import net.neoforged.neoforge.common.data.ExistingFileHelper; import org.jetbrains.annotations.Nullable; import java.util.concurrent.CompletableFuture; diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/EmpoweringRecipeGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/EmpoweringRecipeGenerator.java index 262e19f08..317f3d744 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/EmpoweringRecipeGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/EmpoweringRecipeGenerator.java @@ -1,14 +1,14 @@ package de.ellpeck.actuallyadditions.data; -import com.google.gson.JsonObject; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.crafting.EmpowererRecipe; import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; import de.ellpeck.actuallyadditions.mod.items.metalists.Crystals; -import net.minecraft.data.CachedOutput; +import net.minecraft.core.NonNullList; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.data.PackOutput; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.data.recipes.RecipeProvider; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.ItemTags; @@ -18,14 +18,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.ItemLike; -import net.minecraftforge.common.Tags; -import net.minecraftforge.registries.ForgeRegistries; -import org.jetbrains.annotations.Nullable; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.CompletableFuture; -import java.util.function.Consumer; +import net.neoforged.neoforge.common.Tags; public class EmpoweringRecipeGenerator extends RecipeProvider { public EmpoweringRecipeGenerator(PackOutput packOutput) { @@ -37,13 +30,14 @@ public class EmpoweringRecipeGenerator extends RecipeProvider { return "Empowering " + super.getName(); } - @Override - protected @Nullable CompletableFuture saveAdvancement(CachedOutput output, FinishedRecipe finishedRecipe, JsonObject advancementJson) { - return null; //Nope... - } +// @Override //TODO: Flanks do your RecipeOutput wrapper thingy ;) +// protected @Nullable CompletableFuture saveAdvancement(CachedOutput stack, FinishedRecipe finishedRecipe, JsonObject advancementJson) { +// return null; +// //Nope... maybe later... +// } @Override - protected void buildRecipes(Consumer consumer) { + protected void buildRecipes(RecipeOutput consumer) { EmpoweringBuilder.builder(ActuallyItems.EMPOWERED_RESTONIA_CRYSTAL.get(), ActuallyItems.RESTONIA_CRYSTAL.get(), 5000, 50, Crystals.REDSTONE.conversionColorParticles) .addModifier(Tags.Items.DYES_RED) .addModifier(Items.NETHER_BRICK) @@ -124,7 +118,7 @@ public class EmpoweringRecipeGenerator extends RecipeProvider { private final int energy; private final int time; private final int color; - private final List modifiers = new ArrayList<>(); + private final NonNullList modifiers = NonNullList.create(); public EmpoweringBuilder(ItemLike resultIn, Ingredient baseIn, int energyIn, int timeIn, int colorIn) { result = resultIn.asItem(); @@ -140,14 +134,14 @@ public class EmpoweringRecipeGenerator extends RecipeProvider { public EmpoweringBuilder addModifier(ItemLike input) { if (modifiers.size() >= 4) - throw new IllegalStateException("too many modifiers for empowering recipe, input: " + ForgeRegistries.ITEMS.getKey(input.asItem())); + throw new IllegalStateException("too many modifiers for empowering recipe, input: " + BuiltInRegistries.ITEM.getKey(input.asItem())); modifiers.add(Ingredient.of(input)); return this; } public EmpoweringBuilder addModifier(ItemStack input) { if (modifiers.size() >= 4) - throw new IllegalStateException("too many modifiers for empowering recipe, input: " + ForgeRegistries.ITEMS.getKey(input.getItem())); + throw new IllegalStateException("too many modifiers for empowering recipe, input: " + BuiltInRegistries.ITEM.getKey(input.getItem())); modifiers.add(Ingredient.of(input)); return this; } @@ -159,17 +153,21 @@ public class EmpoweringRecipeGenerator extends RecipeProvider { return this; } - public void save(Consumer consumer, ResourceLocation name) { + public void save(RecipeOutput consumer, ResourceLocation name) { if (modifiers.size() != 4) throw new IllegalStateException("invalid modifier count: " + modifiers.size() + ", recipe: " + name.toString()); - consumer.accept(new EmpowererRecipe.Result(name, result, base, modifiers.get(0), modifiers.get(1), modifiers.get(2), modifiers.get(3), energy, color, time)); + + EmpowererRecipe recipe = new EmpowererRecipe(result.getDefaultInstance(), base, modifiers, energy, color, time); + consumer.accept(name, recipe, null); } - public void save(Consumer consumer, String name) { + public void save(RecipeOutput consumer, String name) { ResourceLocation res = new ResourceLocation(ActuallyAdditions.MODID, "empowering/" + name); if (modifiers.size() != 4) throw new IllegalStateException("invalid modifier count: " + modifiers.size() + ", recipe: " + res); - consumer.accept(new EmpowererRecipe.Result(res, result, base, modifiers.get(0), modifiers.get(1), modifiers.get(2), modifiers.get(3), energy, color, time)); + + EmpowererRecipe recipe = new EmpowererRecipe(result.getDefaultInstance(), base, modifiers, energy, color, time); + consumer.accept(res, recipe, null); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/FuelRecipeGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/FuelRecipeGenerator.java index cfc0b60cd..dd69caa9d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/FuelRecipeGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/FuelRecipeGenerator.java @@ -1,26 +1,21 @@ package de.ellpeck.actuallyadditions.data; -import com.google.gson.JsonObject; import de.ellpeck.actuallyadditions.api.ActuallyTags; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.crafting.LiquidFuelRecipe; import de.ellpeck.actuallyadditions.mod.crafting.SolidFuelRecipe; import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; -import net.minecraft.data.CachedOutput; import net.minecraft.data.PackOutput; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.data.recipes.RecipeProvider; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; -import net.minecraftforge.fluids.FluidStack; -import org.jetbrains.annotations.Nullable; +import net.neoforged.neoforge.fluids.FluidStack; import javax.annotation.Nonnull; -import java.util.concurrent.CompletableFuture; -import java.util.function.Consumer; public class FuelRecipeGenerator extends RecipeProvider { public FuelRecipeGenerator(PackOutput packOutput) { @@ -32,13 +27,14 @@ public class FuelRecipeGenerator extends RecipeProvider { return "Fuel " + super.getName(); } - @Override - protected @Nullable CompletableFuture saveAdvancement(CachedOutput output, FinishedRecipe finishedRecipe, JsonObject advancementJson) { - return null; //Nope... - } +// @Override //TODO: Flanks do your RecipeOutput wrapper thingy ;) +// protected @Nullable CompletableFuture saveAdvancement(CachedOutput stack, FinishedRecipe finishedRecipe, JsonObject advancementJson) { +// return null; +// //Nope... maybe later... +// } @Override - protected void buildRecipes(@Nonnull Consumer consumer) { + protected void buildRecipes(@Nonnull RecipeOutput consumer) { addSolid(consumer, "coal", Items.COAL, 32000, 1600); addSolid(consumer, "stick", Items.STICK, 2000, 100); addSolid(consumer, "tiny-coal", ActuallyTags.Items.TINY_COALS, 4000, 200); @@ -46,26 +42,29 @@ public class FuelRecipeGenerator extends RecipeProvider { addSolid(consumer, "coal-block", Items.COAL_BLOCK, 320000, 16000); addSolid(consumer, "lava", Items.LAVA_BUCKET, 400000, 20000); - consumer.accept(new LiquidFuelRecipe.Result(new ResourceLocation(ActuallyAdditions.MODID, "liquid_fuel/canola_oil"), - new FluidStack(InitFluids.CANOLA_OIL.get(), 50), 4000, 100)); + consumer.accept(new ResourceLocation(ActuallyAdditions.MODID, "liquid_fuel/canola_oil"), new LiquidFuelRecipe( + new FluidStack(InitFluids.CANOLA_OIL.get(), 50), 4000, 100), null); - consumer.accept(new LiquidFuelRecipe.Result(new ResourceLocation(ActuallyAdditions.MODID, "liquid_fuel/refined_canola_oil"), - new FluidStack(InitFluids.REFINED_CANOLA_OIL.get(), 50), 9600, 120)); + consumer.accept(new ResourceLocation(ActuallyAdditions.MODID, "liquid_fuel/refined_canola_oil"), new LiquidFuelRecipe( + new FluidStack(InitFluids.REFINED_CANOLA_OIL.get(), 50), 9600, 120), null); - consumer.accept(new LiquidFuelRecipe.Result(new ResourceLocation(ActuallyAdditions.MODID, "liquid_fuel/crystallized_canola_oil"), - new FluidStack(InitFluids.CRYSTALLIZED_OIL.get(), 50), 28000, 280)); + consumer.accept(new ResourceLocation(ActuallyAdditions.MODID, "liquid_fuel/crystallized_canola_oil"),new LiquidFuelRecipe( + new FluidStack(InitFluids.CRYSTALLIZED_OIL.get(), 50), 28000, 280), null); - consumer.accept(new LiquidFuelRecipe.Result(new ResourceLocation(ActuallyAdditions.MODID, "liquid_fuel/empowered_canola_oil"), - new FluidStack(InitFluids.EMPOWERED_OIL.get(), 50), 48000, 400)); + consumer.accept(new ResourceLocation(ActuallyAdditions.MODID, "liquid_fuel/empowered_canola_oil"), new LiquidFuelRecipe( + new FluidStack(InitFluids.EMPOWERED_OIL.get(), 50), 48000, 400), null); } - private void addSolid(Consumer consumer, String name, Item item, int energy, int burnTime) { - consumer.accept(new SolidFuelRecipe.Result(new ResourceLocation(ActuallyAdditions.MODID, "solid_fuel/"+name), Ingredient.of(item), energy, burnTime)); + private void addSolid(RecipeOutput consumer, String name, Item item, int energy, int burnTime) { + ResourceLocation id = new ResourceLocation(ActuallyAdditions.MODID, "solid_fuel/"+name); + consumer.accept(id, new SolidFuelRecipe(Ingredient.of(item), energy, burnTime), null); } - private void addSolid(Consumer consumer, String name, Ingredient item, int energy, int burnTime) { - consumer.accept(new SolidFuelRecipe.Result(new ResourceLocation(ActuallyAdditions.MODID, "solid_fuel/"+name), item, energy, burnTime)); + private void addSolid(RecipeOutput consumer, String name, Ingredient item, int energy, int burnTime) { + ResourceLocation id = new ResourceLocation(ActuallyAdditions.MODID, "solid_fuel/"+name); + consumer.accept(id, new SolidFuelRecipe(item, energy, burnTime), null); } - private void addSolid(Consumer consumer, String name, TagKey tag, int energy, int burnTime) { - consumer.accept(new SolidFuelRecipe.Result(new ResourceLocation(ActuallyAdditions.MODID, "solid_fuel/"+name), Ingredient.of(tag), energy, burnTime)); + private void addSolid(RecipeOutput consumer, String name, TagKey tag, int energy, int burnTime) { + ResourceLocation id = new ResourceLocation(ActuallyAdditions.MODID, "solid_fuel/"+name); + consumer.accept(id, new SolidFuelRecipe(Ingredient.of(tag), energy, burnTime), null); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/ItemModelGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/ItemModelGenerator.java index 5497ef1af..5ec5cfa20 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/ItemModelGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/ItemModelGenerator.java @@ -6,17 +6,17 @@ import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.fluids.FluidAA; import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.data.PackOutput; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.WallBlock; -import net.minecraftforge.client.model.generators.ItemModelProvider; -import net.minecraftforge.client.model.generators.ModelFile; -import net.minecraftforge.client.model.generators.loaders.DynamicFluidContainerModelBuilder; -import net.minecraftforge.common.data.ExistingFileHelper; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.client.model.generators.ItemModelProvider; +import net.neoforged.neoforge.client.model.generators.ModelFile; +import net.neoforged.neoforge.client.model.generators.loaders.DynamicFluidContainerModelBuilder; +import net.neoforged.neoforge.common.data.ExistingFileHelper; +import net.neoforged.neoforge.registries.DeferredHolder; import java.util.Set; import java.util.function.Supplier; @@ -71,16 +71,16 @@ public class ItemModelGenerator extends ItemModelProvider { .override().predicate(new ResourceLocation(ActuallyAdditions.MODID, "snail"), 1F) .model(getBuilder("snail").parent(getExistingFile(mcLoc("item/handheld"))).texture("layer0", "item/snail")).end();*/ - String torchPath = ForgeRegistries.ITEMS.getKey(ActuallyBlocks.TINY_TORCH.getItem()).getPath(); + String torchPath = BuiltInRegistries.ITEM.getKey(ActuallyBlocks.TINY_TORCH.getItem()).getPath(); singleTexture(torchPath, mcLoc("item/generated"), "layer0", modLoc("block/" + torchPath)); } private void generateBucket(FluidAA fluidSupplier) { - withExistingParent(ForgeRegistries.ITEMS.getKey(fluidSupplier.getBucket()).getPath(), "forge:item/bucket") + withExistingParent(BuiltInRegistries.ITEM.getKey(fluidSupplier.getBucket()).getPath(), "forge:item/bucket") .customLoader((builder, template) -> DynamicFluidContainerModelBuilder.begin(builder, template).fluid(fluidSupplier.get())); } - private void registerBlockModel(RegistryObject block) { + private void registerBlockModel(DeferredHolder block) { String path = block.getId().getPath(); if (block.get() instanceof WallBlock) { String name = path; @@ -93,7 +93,7 @@ public class ItemModelGenerator extends ItemModelProvider { } private void simpleItem(Supplier item) { - String path = ForgeRegistries.ITEMS.getKey(item.get()).getPath(); + String path = BuiltInRegistries.ITEM.getKey(item.get()).getPath(); singleTexture(path, mcLoc("item/handheld"), "layer0", modLoc("item/" + path)); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/ItemRecipeGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/ItemRecipeGenerator.java index bbd7b87ab..05227cc68 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/ItemRecipeGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/ItemRecipeGenerator.java @@ -1,17 +1,13 @@ package de.ellpeck.actuallyadditions.data; -import com.google.gson.JsonObject; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.config.conditions.BoolConfigCondition; -import de.ellpeck.actuallyadditions.mod.crafting.ActuallyRecipes; -import de.ellpeck.actuallyadditions.mod.crafting.TargetNBTIngredient; -import de.ellpeck.actuallyadditions.mod.crafting.WrappedRecipe; import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; -import net.minecraft.data.CachedOutput; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.data.PackOutput; -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.ShapedRecipeBuilder; import net.minecraft.data.recipes.ShapelessRecipeBuilder; @@ -22,17 +18,12 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.enchantment.Enchantments; import net.minecraft.world.level.ItemLike; -import net.minecraftforge.common.Tags; -import net.minecraftforge.common.crafting.ConditionalRecipe; -import net.minecraftforge.common.crafting.StrictNBTIngredient; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; -import org.jetbrains.annotations.Nullable; +import net.neoforged.neoforge.common.Tags; +import net.neoforged.neoforge.common.crafting.NBTIngredient; +import net.neoforged.neoforge.registries.DeferredItem; import javax.annotation.Nonnull; import java.util.Arrays; -import java.util.concurrent.CompletableFuture; -import java.util.function.Consumer; public class ItemRecipeGenerator extends RecipeProvider { public ItemRecipeGenerator(PackOutput packOutput) { @@ -45,7 +36,7 @@ public class ItemRecipeGenerator extends RecipeProvider { } @Override - protected void buildRecipes(Consumer consumer) { + protected void buildRecipes(RecipeOutput consumer) { generatePaxels(consumer); //Goggles @@ -156,7 +147,7 @@ public class ItemRecipeGenerator extends RecipeProvider { Recipe.shapeless(ActuallyItems.LENS_OF_THE_KILLER.get()) .requires(Items.DIAMOND_SWORD) .requires(ActuallyItems.LENS_OF_CERTAIN_DEATH.get()) - .requires(StrictNBTIngredient.of(enchantedBook)).save(consumer); + .requires(NBTIngredient.of(true, enchantedBook)).save(consumer); //Filter @@ -374,45 +365,45 @@ public class ItemRecipeGenerator extends RecipeProvider { .define('C', ActuallyItems.ADVANCED_COIL.get()) .save(consumer); - //Double Battery - Recipe.shaped(ActuallyItems.DOUBLE_BATTERY.get()) - .pattern(" R ") - .pattern("ICI") - .pattern("III") - .define('R', TargetNBTIngredient.of(ActuallyItems.SINGLE_BATTERY.get())) - .define('I', ActuallyItems.ENORI_CRYSTAL.get()) - .define('C', ActuallyItems.ADVANCED_COIL.get()) - .save(WrappedRecipe.Inject(consumer, ActuallyRecipes.KEEP_DATA_SHAPED_RECIPE.get())); - - //Triple Battery - Recipe.shaped(ActuallyItems.TRIPLE_BATTERY.get()) - .pattern(" R ") - .pattern("ICI") - .pattern("III") - .define('R', TargetNBTIngredient.of(ActuallyItems.DOUBLE_BATTERY.get())) - .define('I', ActuallyItems.EMPOWERED_ENORI_CRYSTAL.get()) - .define('C', ActuallyItems.ADVANCED_COIL.get()) - .save(WrappedRecipe.Inject(consumer, ActuallyRecipes.KEEP_DATA_SHAPED_RECIPE.get())); - - //Quad Battery - Recipe.shaped(ActuallyItems.QUADRUPLE_BATTERY.get()) - .pattern(" R ") - .pattern("ICI") - .pattern("III") - .define('R', TargetNBTIngredient.of(ActuallyItems.TRIPLE_BATTERY.get())) - .define('I', ActuallyItems.EMPOWERED_ENORI_CRYSTAL.get()) - .define('C', ActuallyItems.ADVANCED_COIL.get()) - .save(WrappedRecipe.Inject(consumer, ActuallyRecipes.KEEP_DATA_SHAPED_RECIPE.get())); - - //Quintuple Battery - Recipe.shaped(ActuallyItems.QUINTUPLE_BATTERY.get()) - .pattern(" R ") - .pattern("ICI") - .pattern("III") - .define('R', TargetNBTIngredient.of(ActuallyItems.QUADRUPLE_BATTERY.get())) - .define('I', ActuallyItems.EMPOWERED_DIAMATINE_CRYSTAL.get()) - .define('C', ActuallyItems.ADVANCED_COIL.get()) - .save(WrappedRecipe.Inject(consumer, ActuallyRecipes.KEEP_DATA_SHAPED_RECIPE.get())); +// //Double Battery TODO: Flanks please fix these :) +// Recipe.shaped(ActuallyItems.DOUBLE_BATTERY.get()) +// .pattern(" R ") +// .pattern("ICI") +// .pattern("III") +// .define('R', TargetNBTIngredient.of(ActuallyItems.SINGLE_BATTERY.get())) +// .define('I', ActuallyItems.ENORI_CRYSTAL.get()) +// .define('C', ActuallyItems.ADVANCED_COIL.get()) +// .save(WrappedRecipe.Inject(consumer, ActuallyRecipes.KEEP_DATA_SHAPED_RECIPE.get())); +// +// //Triple Battery +// Recipe.shaped(ActuallyItems.TRIPLE_BATTERY.get()) +// .pattern(" R ") +// .pattern("ICI") +// .pattern("III") +// .define('R', TargetNBTIngredient.of(ActuallyItems.DOUBLE_BATTERY.get())) +// .define('I', ActuallyItems.EMPOWERED_ENORI_CRYSTAL.get()) +// .define('C', ActuallyItems.ADVANCED_COIL.get()) +// .save(WrappedRecipe.Inject(consumer, ActuallyRecipes.KEEP_DATA_SHAPED_RECIPE.get())); +// +// //Quad Battery +// Recipe.shaped(ActuallyItems.QUADRUPLE_BATTERY.get()) +// .pattern(" R ") +// .pattern("ICI") +// .pattern("III") +// .define('R', TargetNBTIngredient.of(ActuallyItems.TRIPLE_BATTERY.get())) +// .define('I', ActuallyItems.EMPOWERED_ENORI_CRYSTAL.get()) +// .define('C', ActuallyItems.ADVANCED_COIL.get()) +// .save(WrappedRecipe.Inject(consumer, ActuallyRecipes.KEEP_DATA_SHAPED_RECIPE.get())); +// +// //Quintuple Battery +// Recipe.shaped(ActuallyItems.QUINTUPLE_BATTERY.get()) +// .pattern(" R ") +// .pattern("ICI") +// .pattern("III") +// .define('R', TargetNBTIngredient.of(ActuallyItems.QUADRUPLE_BATTERY.get())) +// .define('I', ActuallyItems.EMPOWERED_DIAMATINE_CRYSTAL.get()) +// .define('C', ActuallyItems.ADVANCED_COIL.get()) +// .save(WrappedRecipe.Inject(consumer, ActuallyRecipes.KEEP_DATA_SHAPED_RECIPE.get())); //Magnet Ring Recipe.shaped(ActuallyItems.RING_OF_MAGNETIZING.get()) @@ -433,31 +424,19 @@ public class ItemRecipeGenerator extends RecipeProvider { Recipe.shapeless(ActuallyItems.CRAFTER_ON_A_STICK.get()).requires(Items.CRAFTING_TABLE).requires(ItemTags.SIGNS).save(consumer); - ConditionalRecipe.builder() - .addCondition(new BoolConfigCondition("tinyCoalStuff")) - .addRecipe( - Recipe.shapeless(ActuallyItems.TINY_COAL.get(), 8) - .requires(Items.COAL)::save) - .generateAdvancement().build(consumer, new ResourceLocation(ActuallyAdditions.MODID, "coal_to_tiny")); - ConditionalRecipe.builder() - .addCondition(new BoolConfigCondition("tinyCoalStuff")) - .addRecipe( - Recipe.shapeless(ActuallyItems.TINY_CHARCOAL.get(), 8) - .requires(Items.CHARCOAL)::save) - .generateAdvancement().build(consumer, new ResourceLocation(ActuallyAdditions.MODID, "charcoal_to_tiny")); + RecipeOutput boolConsumer = consumer.withConditions(new BoolConfigCondition("tinyCoalStuff")); - ConditionalRecipe.builder() - .addCondition(new BoolConfigCondition("tinyCoalStuff")) - .addRecipe( - Recipe.shaped(Items.COAL) - .pattern("CCC", "C C", "CCC").define('C', ActuallyItems.TINY_COAL.get())::save) - .generateAdvancement().build(consumer, new ResourceLocation(ActuallyAdditions.MODID, "tiny_to_coal")); - ConditionalRecipe.builder() - .addCondition(new BoolConfigCondition("tinyCoalStuff")) - .addRecipe( - Recipe.shaped(Items.CHARCOAL) - .pattern("CCC", "C C", "CCC").define('C', ActuallyItems.TINY_CHARCOAL.get())::save) - .generateAdvancement().build(consumer, new ResourceLocation(ActuallyAdditions.MODID, "tiny_to_charcoal")); + Recipe.shapeless(ActuallyItems.TINY_COAL.get(), 8) + .requires(Items.COAL) + .save(boolConsumer, new ResourceLocation(ActuallyAdditions.MODID, "coal_to_tiny")); + Recipe.shapeless(ActuallyItems.TINY_CHARCOAL.get(), 8) + .requires(Items.CHARCOAL).save(boolConsumer, new ResourceLocation(ActuallyAdditions.MODID, "charcoal_to_tiny")); + Recipe.shaped(Items.COAL) + .pattern("CCC", "C C", "CCC").define('C', ActuallyItems.TINY_COAL.get()) + .save(boolConsumer, new ResourceLocation(ActuallyAdditions.MODID, "tiny_to_coal")); + Recipe.shaped(Items.CHARCOAL) + .pattern("CCC", "C C", "CCC").define('C', ActuallyItems.TINY_CHARCOAL.get()) + .save(boolConsumer, new ResourceLocation(ActuallyAdditions.MODID, "tiny_to_charcoal")); //Canola Seeds Recipe.shapeless(ActuallyItems.CANOLA_SEEDS.get()) @@ -516,7 +495,7 @@ public class ItemRecipeGenerator extends RecipeProvider { // GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.COAL.ordinal()), new ItemStack(Items.COAL), 1F); } - protected void generatePaxels(Consumer consumer) { + protected void generatePaxels(RecipeOutput consumer) { addPaxel(consumer, ActuallyItems.WOODEN_AIOT, Items.WOODEN_AXE, Items.WOODEN_PICKAXE, Items.WOODEN_SWORD, Items.WOODEN_SHOVEL, Items.WOODEN_HOE); addPaxel(consumer, ActuallyItems.STONE_AIOT, Items.STONE_AXE, Items.STONE_PICKAXE, Items.STONE_SWORD, Items.STONE_SHOVEL, Items.STONE_HOE); addPaxel(consumer, ActuallyItems.IRON_AIOT, Items.IRON_AXE, Items.IRON_PICKAXE, Items.IRON_SWORD, Items.IRON_SHOVEL, Items.IRON_HOE); @@ -525,7 +504,7 @@ public class ItemRecipeGenerator extends RecipeProvider { addPaxel(consumer, ActuallyItems.NETHERITE_AIOT, Items.NETHERITE_AXE, Items.NETHERITE_PICKAXE, Items.NETHERITE_SWORD, Items.NETHERITE_SHOVEL, Items.NETHERITE_HOE); } - public static void addPaxel(Consumer consumer, RegistryObject output, Item axe, Item pickaxe, Item sword, Item shovel, Item hoe) { + public static void addPaxel(RecipeOutput consumer, DeferredItem output, Item axe, Item pickaxe, Item sword, Item shovel, Item hoe) { Recipe.shapeless(output.get()) .requires(axe) .requires(pickaxe) @@ -535,7 +514,7 @@ public class ItemRecipeGenerator extends RecipeProvider { .save(consumer); } - public static void addPaxel(Consumer consumer, RegistryObject output, RegistryObject axe, RegistryObject pickaxe, RegistryObject sword, RegistryObject shovel, RegistryObject hoe) { + public static void addPaxel(RecipeOutput consumer, DeferredItem output, DeferredItem axe, DeferredItem pickaxe, DeferredItem sword, DeferredItem shovel, DeferredItem hoe) { Recipe.shapeless(output.get()) .requires(axe.get()) .requires(pickaxe.get()) @@ -545,25 +524,26 @@ public class ItemRecipeGenerator extends RecipeProvider { .save(consumer); } - public static void decompress(Consumer consumer, RegistryObject output, RegistryObject input) { - ResourceLocation key = ForgeRegistries.ITEMS.getKey(output.get()); + public static void decompress(RecipeOutput consumer, DeferredItem output, DeferredItem input) { + ResourceLocation key = BuiltInRegistries.ITEM.getKey(output.get()); Recipe.shapeless(output.get(), 9).requires(input.get()).save(consumer, new ResourceLocation(key.getNamespace(), "decompress/" + key.getPath())); } - public static void compress(Consumer consumer, RegistryObject output, RegistryObject input) { - ResourceLocation key = ForgeRegistries.ITEMS.getKey(output.get()); + public static void compress(RecipeOutput consumer, DeferredItem output, DeferredItem input) { + ResourceLocation key = BuiltInRegistries.ITEM.getKey(output.get()); Recipe.shaped(output.get()).pattern("xxx","xxx", "xxx").define('x', input.get()).save(consumer, new ResourceLocation(key.getNamespace(), "compress/" + key.getPath())); } - public static void addShard(Consumer consumer, RegistryObject shard, RegistryObject crystal) { + public static void addShard(RecipeOutput consumer, DeferredItem shard, DeferredItem crystal) { compress(consumer, crystal, shard); decompress(consumer, shard, crystal); } - @Override - protected @Nullable CompletableFuture saveAdvancement(CachedOutput output, FinishedRecipe finishedRecipe, JsonObject advancementJson) { - return null; //Nope... - } +// @Override //TODO: Flanks do your RecipeOutput wrapper thingy ;) +// protected @Nullable CompletableFuture saveAdvancement(CachedOutput stack, FinishedRecipe finishedRecipe, JsonObject advancementJson) { +// return null; +// //Nope... maybe later... +// } - public static void addToolAndArmorRecipes(Consumer consumer, RegistryObject base, RegistryObject pickaxe, RegistryObject sword, RegistryObject axe, RegistryObject shovel, RegistryObject hoe, RegistryObject helm, RegistryObject chest, RegistryObject pants, RegistryObject boots) { + public static void addToolAndArmorRecipes(RecipeOutput consumer, DeferredItem base, DeferredItem pickaxe, DeferredItem sword, DeferredItem axe, DeferredItem shovel, DeferredItem hoe, DeferredItem helm, DeferredItem chest, DeferredItem pants, DeferredItem boots) { //Pickaxe Recipe.shaped(pickaxe.get()) .pattern("EEE", " S ", " S ") @@ -662,7 +642,7 @@ public class ItemRecipeGenerator extends RecipeProvider { } @Override - public void save(@Nonnull Consumer consumer) { + public void save(@Nonnull RecipeOutput consumer) { this.unlockedBy("has_book", has(ActuallyItems.ITEM_BOOKLET.get())); if (this.name != null) { this.save(consumer, this.name); @@ -671,7 +651,7 @@ public class ItemRecipeGenerator extends RecipeProvider { } } @Override - public void save(@Nonnull Consumer consumer, @Nonnull ResourceLocation location) { + public void save(@Nonnull RecipeOutput consumer, @Nonnull ResourceLocation location) { this.unlockedBy("", has(Items.AIR)); super.save(consumer, location); } @@ -714,13 +694,13 @@ public class ItemRecipeGenerator extends RecipeProvider { } @Override - public void save(@Nonnull Consumer consumerIn) { + public void save(@Nonnull RecipeOutput consumerIn) { this.unlockedBy("has_book", has(ActuallyItems.ITEM_BOOKLET.get())); super.save(consumerIn); } @Override - public void save(@Nonnull Consumer consumer, @Nonnull ResourceLocation location) { + public void save(@Nonnull RecipeOutput consumer, @Nonnull ResourceLocation location) { this.unlockedBy("", has(Items.AIR)); super.save(consumer, location); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/ItemTagsGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/ItemTagsGenerator.java index d4ea4a216..8ff59a227 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/ItemTagsGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/ItemTagsGenerator.java @@ -8,7 +8,7 @@ import net.minecraft.data.PackOutput; import net.minecraft.data.tags.ItemTagsProvider; import net.minecraft.data.tags.TagsProvider; import net.minecraft.world.level.block.Block; -import net.minecraftforge.common.data.ExistingFileHelper; +import net.neoforged.neoforge.common.data.ExistingFileHelper; import java.util.concurrent.CompletableFuture; diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/LaserRecipeGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/LaserRecipeGenerator.java index 6265fbe17..575256556 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/LaserRecipeGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/LaserRecipeGenerator.java @@ -1,13 +1,12 @@ package de.ellpeck.actuallyadditions.data; -import com.google.gson.JsonObject; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.crafting.LaserRecipe; import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; -import net.minecraft.data.CachedOutput; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.data.PackOutput; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.data.recipes.RecipeProvider; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.ItemTags; @@ -16,12 +15,7 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.ItemLike; -import net.minecraftforge.common.Tags; -import net.minecraftforge.registries.ForgeRegistries; -import org.jetbrains.annotations.Nullable; - -import java.util.concurrent.CompletableFuture; -import java.util.function.Consumer; +import net.neoforged.neoforge.common.Tags; public class LaserRecipeGenerator extends RecipeProvider { public LaserRecipeGenerator(PackOutput packOutput) { @@ -33,13 +27,14 @@ public class LaserRecipeGenerator extends RecipeProvider { return "Laser " + super.getName(); } - @Override - protected @Nullable CompletableFuture saveAdvancement(CachedOutput output, FinishedRecipe finishedRecipe, JsonObject advancementJson) { - return null; //Nope... - } +// @Override //TODO: Flanks do your RecipeOutput wrapper thingy ;) +// protected @Nullable CompletableFuture saveAdvancement(CachedOutput stack, FinishedRecipe finishedRecipe, JsonObject advancementJson) { +// return null; +// //Nope... maybe later... +// } @Override - protected void buildRecipes(Consumer consumer) { + protected void buildRecipes(RecipeOutput consumer) { //Crystal Blocks laserCrystalizeRecipe(consumer, ActuallyBlocks.RESTONIA_CRYSTAL.getItem(), Tags.Items.STORAGE_BLOCKS_REDSTONE, 400); laserCrystalizeRecipe(consumer, ActuallyBlocks.PALIS_CRYSTAL.getItem(), Tags.Items.STORAGE_BLOCKS_LAPIS, 400); @@ -78,28 +73,28 @@ public class LaserRecipeGenerator extends RecipeProvider { } - private void laserRecipe(Consumer consumer, ItemLike output, Ingredient input, int energy) { - consumer.accept(new LaserRecipe.Result(new ResourceLocation(ActuallyAdditions.MODID, "laser/" + ForgeRegistries.ITEMS.getKey(output.asItem()).getPath()), - input, energy, output)); + private void laserRecipe(RecipeOutput consumer, ItemLike output, Ingredient input, int energy) { + ResourceLocation id = new ResourceLocation(ActuallyAdditions.MODID, "laser/" + BuiltInRegistries.ITEM.getKey(output.asItem()).getPath()); + consumer.accept(id, new LaserRecipe(output.asItem().getDefaultInstance(), input, energy), null); } - private void laserRecipe(Consumer consumer, ItemLike output, TagKey input, int energy) { - consumer.accept(new LaserRecipe.Result(new ResourceLocation(ActuallyAdditions.MODID, "laser/" + ForgeRegistries.ITEMS.getKey(output.asItem()).getPath()), - Ingredient.of(input), energy, output)); + private void laserRecipe(RecipeOutput consumer, ItemLike output, TagKey input, int energy) { + ResourceLocation id = new ResourceLocation(ActuallyAdditions.MODID, "laser/" + BuiltInRegistries.ITEM.getKey(output.asItem()).getPath()); + consumer.accept(id, new LaserRecipe(output.asItem().getDefaultInstance(), Ingredient.of(input), energy), null); } - private void laserRecipe(Consumer consumer, ItemLike output, ItemLike input, int energy) { - consumer.accept(new LaserRecipe.Result(new ResourceLocation(ActuallyAdditions.MODID, "laser/" + ForgeRegistries.ITEMS.getKey(output.asItem()).getPath()), - Ingredient.of(input), energy, output)); + private void laserRecipe(RecipeOutput consumer, ItemLike output, ItemLike input, int energy) { + ResourceLocation id = new ResourceLocation(ActuallyAdditions.MODID, "laser/" + BuiltInRegistries.ITEM.getKey(output.asItem()).getPath()); + consumer.accept(id, new LaserRecipe(output.asItem().getDefaultInstance(), Ingredient.of(input), energy), null);; } - private void laserCrystalizeRecipe(Consumer consumer, ItemLike output, Ingredient input, int energy) { - consumer.accept(new LaserRecipe.Result(new ResourceLocation(ActuallyAdditions.MODID, "laser/crystalize_" + ForgeRegistries.ITEMS.getKey(output.asItem()).getPath()), - input, energy, output)); + private void laserCrystalizeRecipe(RecipeOutput consumer, ItemLike output, Ingredient input, int energy) { + ResourceLocation id = new ResourceLocation(ActuallyAdditions.MODID, "laser/crystalize_" + BuiltInRegistries.ITEM.getKey(output.asItem()).getPath()); + consumer.accept(id, new LaserRecipe(output.asItem().getDefaultInstance(), input, energy), null); } - private void laserCrystalizeRecipe(Consumer consumer, ItemLike output, TagKey input, int energy) { - consumer.accept(new LaserRecipe.Result(new ResourceLocation(ActuallyAdditions.MODID, "laser/crystalize_" + ForgeRegistries.ITEMS.getKey(output.asItem()).getPath()), - Ingredient.of(input), energy, output)); + private void laserCrystalizeRecipe(RecipeOutput consumer, ItemLike output, TagKey input, int energy) { + ResourceLocation id = new ResourceLocation(ActuallyAdditions.MODID, "laser/crystalize_" + BuiltInRegistries.ITEM.getKey(output.asItem()).getPath()); + consumer.accept(id, new LaserRecipe(output.asItem().getDefaultInstance(), Ingredient.of(input), energy), null); } - private void laserCrystalizeRecipe(Consumer consumer, ItemLike output, ItemLike input, int energy) { - consumer.accept(new LaserRecipe.Result(new ResourceLocation(ActuallyAdditions.MODID, "laser/crystalize_" + ForgeRegistries.ITEMS.getKey(output.asItem()).getPath()), - Ingredient.of(input), energy, output)); + private void laserCrystalizeRecipe(RecipeOutput consumer, ItemLike output, ItemLike input, int energy) { + ResourceLocation id = new ResourceLocation(ActuallyAdditions.MODID, "laser/crystalize_" + BuiltInRegistries.ITEM.getKey(output.asItem()).getPath()); + consumer.accept(id, new LaserRecipe(output.asItem().getDefaultInstance(), Ingredient.of(input), energy), null); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/LootTableGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/LootTableGenerator.java index e445a6b71..55c81ef3f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/LootTableGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/LootTableGenerator.java @@ -24,7 +24,7 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; import net.minecraft.world.level.storage.loot.predicates.LootItemBlockStatePropertyCondition; import net.minecraft.world.level.storage.loot.providers.nbt.ContextNbtProvider; import net.minecraft.world.level.storage.loot.providers.number.ConstantValue; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.registries.DeferredHolder; import javax.annotation.Nonnull; import java.util.List; @@ -236,7 +236,7 @@ public class LootTableGenerator extends LootTableProvider { InitFluids.EMPOWERED_OIL.getBlock() ); - return ActuallyBlocks.BLOCKS.getEntries().stream().map(RegistryObject::get).filter(e -> !ignoreForNow.contains(e)).collect(Collectors.toList()); + return ActuallyBlocks.BLOCKS.getEntries().stream().map(DeferredHolder::get).filter(e -> !ignoreForNow.contains(e)).collect(Collectors.toList()); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/MiningLensGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/MiningLensGenerator.java index 7aed2a5c8..685ca07f6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/MiningLensGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/MiningLensGenerator.java @@ -1,11 +1,9 @@ package de.ellpeck.actuallyadditions.data; -import com.google.gson.JsonObject; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.crafting.MiningLensRecipe; -import net.minecraft.data.CachedOutput; import net.minecraft.data.PackOutput; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.data.recipes.RecipeProvider; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; @@ -13,11 +11,7 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.ItemLike; -import net.minecraftforge.common.Tags; -import org.jetbrains.annotations.Nullable; - -import java.util.concurrent.CompletableFuture; -import java.util.function.Consumer; +import net.neoforged.neoforge.common.Tags; public class MiningLensGenerator extends RecipeProvider { public MiningLensGenerator(PackOutput packOutput) { @@ -29,41 +23,41 @@ public class MiningLensGenerator extends RecipeProvider { return "Mining Lens " + super.getName(); } - @Override - protected @Nullable CompletableFuture saveAdvancement(CachedOutput output, FinishedRecipe finishedRecipe, JsonObject advancementJson) { - return null; //Nope... - } +// @Override //TODO: Flanks do your RecipeOutput wrapper thingy ;) +// protected @Nullable CompletableFuture saveAdvancement(CachedOutput stack, FinishedRecipe finishedRecipe, JsonObject advancementJson) { +// return null; +// //Nope... maybe later... +// } @Override - protected void buildRecipes(Consumer consumer) { + protected void buildRecipes(RecipeOutput consumer) { buildMiningLens(consumer); } // private String getItemName(ItemLike item) { -// return ForgeRegistries.ITEMS.getKey(item.asItem()).getPath(); +// return BuiltInRegistries.ITEM.getKey(item.asItem()).getPath(); // } private ResourceLocation folderRecipe(String folder, String recipe) { return new ResourceLocation(ActuallyAdditions.MODID, folder + "/" + recipe); } - private void buildStoneOre(Consumer consumer, int weight, ItemLike output) { + private void buildStoneOre(RecipeOutput consumer, int weight, ItemLike output) { buildTagOre(consumer, Tags.Items.STONE, "stone", weight, output); } - private void buildNetherOre(Consumer consumer, int weight, ItemLike output) { + private void buildNetherOre(RecipeOutput consumer, int weight, ItemLike output) { buildTagOre(consumer, Tags.Items.NETHERRACK, "nether", weight, output); } - private void buildTagOre(Consumer consumer, TagKey tag, String prefix, int weight, ItemLike output) { - consumer.accept(new MiningLensRecipe.Result( - folderRecipe("mininglens", prefix + "_" + getItemName(output)), + private void buildTagOre(RecipeOutput consumer, TagKey tag, String prefix, int weight, ItemLike output) { + consumer.accept(folderRecipe("mininglens", prefix + "_" + getItemName(output)), new MiningLensRecipe( Ingredient.of(tag), weight, - output - )); + output.asItem().getDefaultInstance() + ), null); } - private void buildMiningLens(Consumer consumer) { + private void buildMiningLens(RecipeOutput consumer) { buildStoneOre(consumer, 5000, Items.COAL_ORE); buildStoneOre(consumer, 3000, Items.IRON_ORE); buildStoneOre(consumer, 500, Items.GOLD_ORE); diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/MiscMachineRecipeGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/MiscMachineRecipeGenerator.java index 932fbcb33..9bc0db19a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/MiscMachineRecipeGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/MiscMachineRecipeGenerator.java @@ -1,22 +1,16 @@ package de.ellpeck.actuallyadditions.data; -import com.google.gson.JsonObject; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.crafting.FermentingRecipe; import de.ellpeck.actuallyadditions.mod.crafting.PressingRecipe; import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; -import net.minecraft.data.CachedOutput; import net.minecraft.data.PackOutput; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.data.recipes.RecipeProvider; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.crafting.Ingredient; -import net.minecraftforge.fluids.FluidStack; -import org.jetbrains.annotations.Nullable; - -import java.util.concurrent.CompletableFuture; -import java.util.function.Consumer; +import net.neoforged.neoforge.fluids.FluidStack; public class MiscMachineRecipeGenerator extends RecipeProvider { public MiscMachineRecipeGenerator(PackOutput packOutput) { @@ -28,22 +22,23 @@ public class MiscMachineRecipeGenerator extends RecipeProvider { return "Misc " + super.getName(); } - @Override - protected @Nullable CompletableFuture saveAdvancement(CachedOutput output, FinishedRecipe finishedRecipe, JsonObject advancementJson) { - return null; //Nope... - } +// @Override //TODO: Flanks do your RecipeOutput wrapper thingy ;) +// protected @Nullable CompletableFuture saveAdvancement(CachedOutput stack, FinishedRecipe finishedRecipe, JsonObject advancementJson) { +// return null; +// //Nope... maybe later... +// } @Override - protected void buildRecipes(Consumer consumer) { - consumer.accept(new PressingRecipe.Result(folderRecipe("pressing", "canola"), - Ingredient.of(ActuallyItems.CANOLA.get()), new FluidStack(InitFluids.CANOLA_OIL.get(), 80))); + protected void buildRecipes(RecipeOutput consumer) { + consumer.accept(folderRecipe("pressing", "canola"), new PressingRecipe( + Ingredient.of(ActuallyItems.CANOLA.get()), new FluidStack(InitFluids.CANOLA_OIL.get(), 80)), null); - consumer.accept(new FermentingRecipe.Result(folderRecipe("fermenting", "refined_canola"), - new FluidStack(InitFluids.CANOLA_OIL.get(), 80), new FluidStack(InitFluids.REFINED_CANOLA_OIL.get(), 80), 100)); + consumer.accept(folderRecipe("fermenting", "refined_canola"), new FermentingRecipe( + new FluidStack(InitFluids.CANOLA_OIL.get(), 80), new FluidStack(InitFluids.REFINED_CANOLA_OIL.get(), 80), 100), null); } // private String getItemName(ItemLike item) { -// return ForgeRegistries.ITEMS.getKey(item.asItem()).getPath(); +// return BuiltInRegistries.ITEM.getKey(item.asItem()).getPath(); // } private ResourceLocation folderRecipe(String folder, String recipe) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/SoundsGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/SoundsGenerator.java index 99cdb69fe..b0b750031 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/SoundsGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/SoundsGenerator.java @@ -4,8 +4,8 @@ import de.ellpeck.actuallyadditions.mod.AASounds; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import net.minecraft.data.PackOutput; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.common.data.ExistingFileHelper; -import net.minecraftforge.common.data.SoundDefinitionsProvider; +import net.neoforged.neoforge.common.data.ExistingFileHelper; +import net.neoforged.neoforge.common.data.SoundDefinitionsProvider; public class SoundsGenerator extends SoundDefinitionsProvider { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/AASounds.java b/src/main/java/de/ellpeck/actuallyadditions/mod/AASounds.java index 730fb984b..e57da7c3e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/AASounds.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/AASounds.java @@ -1,19 +1,19 @@ package de.ellpeck.actuallyadditions.mod; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundEvent; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredRegister; public class AASounds { - public static final DeferredRegister SOUNDS = DeferredRegister.create(ForgeRegistries.SOUND_EVENTS, ActuallyAdditions.MODID); + public static final DeferredRegister SOUNDS = DeferredRegister.create(BuiltInRegistries.SOUND_EVENT, ActuallyAdditions.MODID); - public static RegistryObject RECONSTRUCTOR = SOUNDS.register("reconstructor", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ActuallyAdditions.MODID, "reconstructor"))); - public static RegistryObject CRUSHER = SOUNDS.register("crusher", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ActuallyAdditions.MODID, "crusher"))); - public static RegistryObject COFFEE_MACHINE = SOUNDS.register("coffee_machine", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ActuallyAdditions.MODID, "coffee_machine"))); - public static RegistryObject DUH_DUH_DUH_DUUUH = SOUNDS.register("duh_duh_duh_duuuh", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ActuallyAdditions.MODID, "duh_duh_duh_duuuh"))); + public static DeferredHolder RECONSTRUCTOR = SOUNDS.register("reconstructor", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ActuallyAdditions.MODID, "reconstructor"))); + public static DeferredHolder CRUSHER = SOUNDS.register("crusher", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ActuallyAdditions.MODID, "crusher"))); + public static DeferredHolder COFFEE_MACHINE = SOUNDS.register("coffee_machine", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ActuallyAdditions.MODID, "coffee_machine"))); + public static DeferredHolder DUH_DUH_DUH_DUUUH = SOUNDS.register("duh_duh_duh_duuuh", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ActuallyAdditions.MODID, "duh_duh_duh_duuuh"))); public static void init(IEventBus bus) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java index 1e9014a3f..527031eb5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod; +import com.mojang.serialization.Codec; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.ActuallyTags; import de.ellpeck.actuallyadditions.api.farmer.IFarmerBehavior; @@ -18,7 +19,6 @@ import de.ellpeck.actuallyadditions.mod.config.CommonConfig; import de.ellpeck.actuallyadditions.mod.config.conditions.BoolConfigCondition; import de.ellpeck.actuallyadditions.mod.crafting.ActuallyRecipes; import de.ellpeck.actuallyadditions.mod.crafting.CrusherCrafting; -import de.ellpeck.actuallyadditions.mod.crafting.TargetNBTIngredient; import de.ellpeck.actuallyadditions.mod.data.WorldData; import de.ellpeck.actuallyadditions.mod.entity.EntityWorm; import de.ellpeck.actuallyadditions.mod.entity.InitEntities; @@ -36,33 +36,34 @@ import de.ellpeck.actuallyadditions.mod.network.PacketHandler; import de.ellpeck.actuallyadditions.mod.particle.ActuallyParticles; import de.ellpeck.actuallyadditions.mod.update.UpdateChecker; import de.ellpeck.actuallyadditions.mod.util.ResourceReloader; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.MobCategory; import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.client.event.RegisterParticleProvidersEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.crafting.CraftingHelper; -import net.minecraftforge.event.AddReloadListenerEvent; -import net.minecraftforge.event.server.ServerStartedEvent; -import net.minecraftforge.event.server.ServerStoppedEvent; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.fml.DistExecutor; -import net.minecraftforge.fml.ModLoadingContext; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.config.ModConfig; -import net.minecraftforge.fml.event.config.ModConfigEvent; -import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; -import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; -import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.ModLoadingContext; +import net.neoforged.fml.common.Mod; +import net.neoforged.fml.config.ModConfig; +import net.neoforged.fml.event.config.ModConfigEvent; +import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; +import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; +import net.neoforged.fml.loading.FMLEnvironment; +import net.neoforged.neoforge.client.event.RegisterParticleProvidersEvent; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.common.conditions.ICondition; +import net.neoforged.neoforge.event.AddReloadListenerEvent; +import net.neoforged.neoforge.event.server.ServerStartedEvent; +import net.neoforged.neoforge.event.server.ServerStoppedEvent; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredRegister; +import net.neoforged.neoforge.registries.NeoForgeRegistries; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import java.util.function.Supplier; + @Mod(ActuallyAdditions.MODID) public class ActuallyAdditions { @@ -78,16 +79,18 @@ public class ActuallyAdditions { public static final Logger LOGGER = LogManager.getLogger(NAME); - public static final DeferredRegister> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, MODID); - public static final RegistryObject> ENTITY_WORM = ENTITIES.register("worm", () -> EntityType.Builder.of(EntityWorm::new, MobCategory.MISC).build(MODID + ":worm")); + private static final DeferredRegister> ENTITIES = DeferredRegister.create(BuiltInRegistries.ENTITY_TYPE, MODID); + public static final Supplier> ENTITY_WORM = ENTITIES.register("worm", () -> EntityType.Builder.of(EntityWorm::new, MobCategory.MISC).build(MODID + ":worm")); + + private static final DeferredRegister> CONDITION_CODECS = DeferredRegister.create(NeoForgeRegistries.Keys.CONDITION_CODECS, MODID); + public static final DeferredHolder, Codec> BOOL_CONFIG_CONDITION = CONDITION_CODECS.register("bool_config_condition", () -> BoolConfigCondition.CODEC); + public static boolean commonCapsLoaded; - public ActuallyAdditions() { + public ActuallyAdditions(IEventBus eventBus) { ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, CommonConfig.COMMON_CONFIG); - IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus(); - ActuallyBlocks.init(eventBus); ActuallyItems.init(eventBus); ActuallyTabs.init(eventBus); @@ -95,25 +98,27 @@ public class ActuallyAdditions { AASounds.init(eventBus); ActuallyContainers.CONTAINERS.register(eventBus); ENTITIES.register(eventBus); + CONDITION_CODECS.register(eventBus); eventBus.addListener(this::onConfigReload); ActuallyParticles.init(eventBus); ActuallyTags.init(); - MinecraftForge.EVENT_BUS.addListener(this::serverStarted); - MinecraftForge.EVENT_BUS.addListener(this::serverStopped); - MinecraftForge.EVENT_BUS.register(new CommonEvents()); - MinecraftForge.EVENT_BUS.register(new DungeonLoot()); - MinecraftForge.EVENT_BUS.addListener(ActuallyAdditions::reloadEvent); - MinecraftForge.EVENT_BUS.addListener(Worm::onHoe); + NeoForge.EVENT_BUS.addListener(this::serverStarted); + NeoForge.EVENT_BUS.addListener(this::serverStopped); + NeoForge.EVENT_BUS.register(new CommonEvents()); + NeoForge.EVENT_BUS.register(new DungeonLoot()); + NeoForge.EVENT_BUS.addListener(ActuallyAdditions::reloadEvent); + NeoForge.EVENT_BUS.addListener(Worm::onHoe); InitFluids.init(eventBus); + eventBus.addListener(PacketHandler::register); eventBus.addListener(this::setup); - DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> { - eventBus.addListener(this::clientSetup); - eventBus.addListener(ActuallyAdditionsClient::setupSpecialRenders); - eventBus.addListener(this::particleFactoryRegister); - }); + if (FMLEnvironment.dist.isClient()) { + eventBus.addListener(this::clientSetup); + eventBus.addListener(ActuallyAdditionsClient::setupSpecialRenders); + eventBus.addListener(this::particleFactoryRegister); + } IFarmerBehavior.initBehaviors(); } @@ -122,17 +127,11 @@ public class ActuallyAdditions { } private void setup(FMLCommonSetupEvent event) { - PacketHandler.init(); - - event.enqueueWork(() -> { - CraftingHelper.register(BoolConfigCondition.Serializer.INSTANCE); - }); - ActuallyAdditionsAPI.methodHandler = new MethodHandler(); ActuallyAdditionsAPI.connectionHandler = new LaserRelayConnectionHandler(); //Lenses.init(); // CompatUtil.registerCraftingTweaks(); - event.enqueueWork(() -> CraftingHelper.register(TargetNBTIngredient.Serializer.NAME, TargetNBTIngredient.SERIALIZER)); +// event.enqueueWork(() -> CraftingHelper.register(TargetNBTIngredient.Serializer.NAME, TargetNBTIngredient.SERIALIZER)); TODO: Flanks fix the Target NBT ingredient! commonCapsLoaded = false; // Loader.isModLoaded("commoncapabilities"); @@ -146,8 +145,8 @@ public class ActuallyAdditions { } private void onConfigReload(ModConfigEvent event) { - Item item1 = ForgeRegistries.ITEMS.getValue(new ResourceLocation(CommonConfig.Other.REDSTONECONFIGURATOR.get())); - Item item2 = ForgeRegistries.ITEMS.getValue(new ResourceLocation(CommonConfig.Other.RELAYCONFIGURATOR.get())); + Item item1 = BuiltInRegistries.ITEM.get(new ResourceLocation(CommonConfig.Other.REDSTONECONFIGURATOR.get())); + Item item2 = BuiltInRegistries.ITEM.get(new ResourceLocation(CommonConfig.Other.RELAYCONFIGURATOR.get())); CommonConfig.Other.redstoneConfigureItem = item1 != null?item1: Items.AIR; CommonConfig.Other.relayConfigureItem = item2 != null?item2: Items.AIR; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditionsClient.java b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditionsClient.java index ac36911f3..7c0390445 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditionsClient.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditionsClient.java @@ -60,9 +60,9 @@ import net.minecraft.core.BlockPos; import net.minecraft.network.protocol.game.ServerboundPlayerActionPacket; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.phys.BlockHitResult; -import net.minecraftforge.client.event.EntityRenderersEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; +import net.neoforged.neoforge.client.event.EntityRenderersEvent; +import net.neoforged.neoforge.common.NeoForge; public class ActuallyAdditionsClient { @@ -93,9 +93,9 @@ public class ActuallyAdditionsClient { MenuScreens.register(ActuallyContainers.RANGED_COLLECTOR_CONTAINER.get(), GuiRangedCollector::new); MenuScreens.register(ActuallyContainers.XPSOLIDIFIER_CONTAINER.get(), GuiXPSolidifier::new); // From old proxy - MinecraftForge.EVENT_BUS.register(new ClientEvents()); - MinecraftForge.EVENT_BUS.register(new ClientRegistryHandler()); - MinecraftForge.EVENT_BUS.register(new SpecialRenderInit()); + NeoForge.EVENT_BUS.register(new ClientEvents()); + NeoForge.EVENT_BUS.register(new ClientRegistryHandler()); + NeoForge.EVENT_BUS.register(new SpecialRenderInit()); event.enqueueWork(() -> ItemProperties.register(ActuallyItems.WORM.get(), new ResourceLocation(ActuallyAdditions.MODID, "snail"), diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyTabs.java b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyTabs.java index a55fe9b43..0435d3e2b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyTabs.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyTabs.java @@ -7,8 +7,8 @@ import net.minecraft.network.chat.Component; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.CreativeModeTabs; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.registries.DeferredRegister; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredRegister; import java.util.List; import java.util.function.Supplier; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/ClientRegistryHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/ClientRegistryHandler.java index ecb790eb8..a045ca688 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/ClientRegistryHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/ClientRegistryHandler.java @@ -3,9 +3,9 @@ package de.ellpeck.actuallyadditions.mod; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.material.Fluid; -import net.minecraftforge.client.event.ModelEvent.BakingCompleted; -import net.minecraftforge.client.event.ModelEvent.RegisterGeometryLoaders; -import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.neoforge.client.event.ModelEvent.BakingCompleted; +import net.neoforged.neoforge.client.event.ModelEvent.RegisterGeometryLoaders; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java index 10b84d788..c1d8029b8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/ActuallyBlocks.java @@ -13,6 +13,7 @@ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.AACrops; import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; +import de.ellpeck.actuallyadditions.mod.items.base.ItemEnergy; import de.ellpeck.actuallyadditions.mod.items.metalists.Crystals; import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBatteryBox; @@ -62,6 +63,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityShockSuppressor; import de.ellpeck.actuallyadditions.mod.tile.TileEntityVerticalDigger; import de.ellpeck.actuallyadditions.mod.tile.TileEntityXPSolidifier; import de.ellpeck.actuallyadditions.registration.AABlockReg; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; @@ -73,19 +75,20 @@ import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.material.PushReaction; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredRegister; import java.util.function.Supplier; public final class ActuallyBlocks { - public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, ActuallyAdditions.MODID); - public static final DeferredRegister> TILES = DeferredRegister.create(ForgeRegistries.BLOCK_ENTITY_TYPES, ActuallyAdditions.MODID); + public static final DeferredRegister.Blocks BLOCKS = DeferredRegister.createBlocks(ActuallyAdditions.MODID); + public static final DeferredRegister> TILES = DeferredRegister.create(BuiltInRegistries.BLOCK_ENTITY_TYPE, ActuallyAdditions.MODID); public static final Item.Properties defaultBlockItemProperties = new Item.Properties().stacksTo(64); - public static final BlockBehaviour.Properties miscBlockProperties = BlockBehaviour.Properties.copy(Blocks.STONE).requiresCorrectToolForDrops().strength(1.5f, 10f); + public static final BlockBehaviour.Properties miscBlockProperties = BlockBehaviour.Properties.ofFullCopy(Blocks.STONE).requiresCorrectToolForDrops().strength(1.5f, 10f); // Casings public static final AABlockReg WOOD_CASING = new AABlockReg<>("wood_casing", () -> new ActuallyBlock(miscBlockProperties), ActuallyBlock::createBlockItem); @@ -274,32 +277,32 @@ public final class ActuallyBlocks { public static final AABlockReg BLACK_QUARTZ_BRICK = new AABlockReg<>("black_quartz_brick_block", () -> new ActuallyBlock(miscBlockProperties), (b) -> new AABlockItem(b, defaultBlockItemProperties)); //Walls - public static final AABlockReg ETHETIC_GREEN_WALL = new AABlockReg<>("ethetic_green_wall", () -> new WallBlock(BlockBehaviour.Properties.copy(ETHETIC_GREEN_BLOCK.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); - public static final AABlockReg ETHETIC_WHITE_WALL = new AABlockReg<>("ethetic_white_wall", () -> new WallBlock(BlockBehaviour.Properties.copy(ETHETIC_WHITE_BLOCK.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); - public static final AABlockReg BLACK_QUARTZ_WALL = new AABlockReg<>("black_quartz_wall", () -> new WallBlock(BlockBehaviour.Properties.copy(BLACK_QUARTZ.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); - public static final AABlockReg CHISELED_BLACK_QUARTZ_WALL = new AABlockReg<>("chiseled_black_quartz_wall", () -> new WallBlock(BlockBehaviour.Properties.copy(CHISELED_BLACK_QUARTZ.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); - public static final AABlockReg SMOOTH_BLACK_QUARTZ_WALL = new AABlockReg<>("smooth_black_quartz_wall", () -> new WallBlock(BlockBehaviour.Properties.copy(CHISELED_BLACK_QUARTZ.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); - public static final AABlockReg BLACK_QUARTZ_BRICK_WALL = new AABlockReg<>("black_quartz_brick_wall", () -> new WallBlock(BlockBehaviour.Properties.copy(CHISELED_BLACK_QUARTZ.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); - public static final AABlockReg BLACK_QUARTZ_PILLAR_WALL = new AABlockReg<>("black_quartz_pillar_wall", () -> new WallBlock(BlockBehaviour.Properties.copy(BLACK_QUARTZ_PILLAR.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg ETHETIC_GREEN_WALL = new AABlockReg<>("ethetic_green_wall", () -> new WallBlock(BlockBehaviour.Properties.ofFullCopy(ETHETIC_GREEN_BLOCK.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg ETHETIC_WHITE_WALL = new AABlockReg<>("ethetic_white_wall", () -> new WallBlock(BlockBehaviour.Properties.ofFullCopy(ETHETIC_WHITE_BLOCK.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg BLACK_QUARTZ_WALL = new AABlockReg<>("black_quartz_wall", () -> new WallBlock(BlockBehaviour.Properties.ofFullCopy(BLACK_QUARTZ.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg CHISELED_BLACK_QUARTZ_WALL = new AABlockReg<>("chiseled_black_quartz_wall", () -> new WallBlock(BlockBehaviour.Properties.ofFullCopy(CHISELED_BLACK_QUARTZ.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg SMOOTH_BLACK_QUARTZ_WALL = new AABlockReg<>("smooth_black_quartz_wall", () -> new WallBlock(BlockBehaviour.Properties.ofFullCopy(CHISELED_BLACK_QUARTZ.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg BLACK_QUARTZ_BRICK_WALL = new AABlockReg<>("black_quartz_brick_wall", () -> new WallBlock(BlockBehaviour.Properties.ofFullCopy(CHISELED_BLACK_QUARTZ.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg BLACK_QUARTZ_PILLAR_WALL = new AABlockReg<>("black_quartz_pillar_wall", () -> new WallBlock(BlockBehaviour.Properties.ofFullCopy(BLACK_QUARTZ_PILLAR.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); //Slabs - public static final AABlockReg ETHETIC_GREEN_SLAB = new AABlockReg<>("ethetic_green_slab", () -> new SlabBlock(BlockBehaviour.Properties.copy(ETHETIC_GREEN_BLOCK.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); - public static final AABlockReg ETHETIC_WHITE_SLAB = new AABlockReg<>("ethetic_white_slab", () -> new SlabBlock(BlockBehaviour.Properties.copy(ETHETIC_WHITE_BLOCK.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); - public static final AABlockReg BLACK_QUARTZ_SLAB = new AABlockReg<>("black_quartz_slab", () -> new SlabBlock(BlockBehaviour.Properties.copy(BLACK_QUARTZ.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); - public static final AABlockReg CHISELED_BLACK_QUARTZ_SLAB = new AABlockReg<>("chiseled_black_quartz_slab", () -> new SlabBlock(BlockBehaviour.Properties.copy(CHISELED_BLACK_QUARTZ.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); - public static final AABlockReg BLACK_QUARTZ_PILLAR_SLAB = new AABlockReg<>("black_quartz_pillar_slab", () -> new SlabBlock(BlockBehaviour.Properties.copy(BLACK_QUARTZ_PILLAR.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); - public static final AABlockReg SMOOTH_BLACK_QUARTZ_SLAB = new AABlockReg<>("smooth_black_quartz_slab", () -> new SlabBlock(BlockBehaviour.Properties.copy(BLACK_QUARTZ_PILLAR.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); - public static final AABlockReg BLACK_QUARTZ_BRICK_SLAB = new AABlockReg<>("black_quartz_brick_slab", () -> new SlabBlock(BlockBehaviour.Properties.copy(BLACK_QUARTZ_PILLAR.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg ETHETIC_GREEN_SLAB = new AABlockReg<>("ethetic_green_slab", () -> new SlabBlock(BlockBehaviour.Properties.ofFullCopy(ETHETIC_GREEN_BLOCK.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg ETHETIC_WHITE_SLAB = new AABlockReg<>("ethetic_white_slab", () -> new SlabBlock(BlockBehaviour.Properties.ofFullCopy(ETHETIC_WHITE_BLOCK.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg BLACK_QUARTZ_SLAB = new AABlockReg<>("black_quartz_slab", () -> new SlabBlock(BlockBehaviour.Properties.ofFullCopy(BLACK_QUARTZ.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg CHISELED_BLACK_QUARTZ_SLAB = new AABlockReg<>("chiseled_black_quartz_slab", () -> new SlabBlock(BlockBehaviour.Properties.ofFullCopy(CHISELED_BLACK_QUARTZ.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg BLACK_QUARTZ_PILLAR_SLAB = new AABlockReg<>("black_quartz_pillar_slab", () -> new SlabBlock(BlockBehaviour.Properties.ofFullCopy(BLACK_QUARTZ_PILLAR.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg SMOOTH_BLACK_QUARTZ_SLAB = new AABlockReg<>("smooth_black_quartz_slab", () -> new SlabBlock(BlockBehaviour.Properties.ofFullCopy(BLACK_QUARTZ_PILLAR.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg BLACK_QUARTZ_BRICK_SLAB = new AABlockReg<>("black_quartz_brick_slab", () -> new SlabBlock(BlockBehaviour.Properties.ofFullCopy(BLACK_QUARTZ_PILLAR.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); //Stairs - public static final AABlockReg ETHETIC_GREEN_STAIRS = new AABlockReg<>("ethetic_green_stairs", () -> new StairBlock(() -> ETHETIC_GREEN_BLOCK.get().defaultBlockState(), BlockBehaviour.Properties.copy(ETHETIC_GREEN_BLOCK.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); - public static final AABlockReg ETHETIC_WHITE_STAIRS = new AABlockReg<>("ethetic_white_stairs", () -> new StairBlock(() -> ETHETIC_WHITE_BLOCK.get().defaultBlockState(), BlockBehaviour.Properties.copy(ETHETIC_WHITE_BLOCK.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); - public static final AABlockReg BLACK_QUARTZ_STAIR = new AABlockReg<>("black_quartz_stair", () -> new StairBlock(() -> BLACK_QUARTZ.get().defaultBlockState(), BlockBehaviour.Properties.copy(BLACK_QUARTZ.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); - public static final AABlockReg CHISELED_BLACK_QUARTZ_STAIR = new AABlockReg<>("chiseled_black_quartz_stair", () -> new StairBlock(() -> CHISELED_BLACK_QUARTZ.get().defaultBlockState(), BlockBehaviour.Properties.copy(CHISELED_BLACK_QUARTZ.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); - public static final AABlockReg BLACK_QUARTZ_PILLAR_STAIR = new AABlockReg<>("black_quartz_pillar_stair", () -> new StairBlock(() -> BLACK_QUARTZ_PILLAR.get().defaultBlockState(), BlockBehaviour.Properties.copy(BLACK_QUARTZ_PILLAR.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); - public static final AABlockReg SMOOTH_BLACK_QUARTZ_STAIR = new AABlockReg<>("smooth_black_quartz_stair", () -> new StairBlock(() -> BLACK_QUARTZ_PILLAR.get().defaultBlockState(), BlockBehaviour.Properties.copy(BLACK_QUARTZ_PILLAR.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); - public static final AABlockReg BLACK_QUARTZ_BRICK_STAIR = new AABlockReg<>("black_quartz_brick_stair", () -> new StairBlock(() -> BLACK_QUARTZ_PILLAR.get().defaultBlockState(), BlockBehaviour.Properties.copy(BLACK_QUARTZ_PILLAR.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg ETHETIC_GREEN_STAIRS = new AABlockReg<>("ethetic_green_stairs", () -> new StairBlock(() -> ETHETIC_GREEN_BLOCK.get().defaultBlockState(), BlockBehaviour.Properties.ofFullCopy(ETHETIC_GREEN_BLOCK.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg ETHETIC_WHITE_STAIRS = new AABlockReg<>("ethetic_white_stairs", () -> new StairBlock(() -> ETHETIC_WHITE_BLOCK.get().defaultBlockState(), BlockBehaviour.Properties.ofFullCopy(ETHETIC_WHITE_BLOCK.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg BLACK_QUARTZ_STAIR = new AABlockReg<>("black_quartz_stair", () -> new StairBlock(() -> BLACK_QUARTZ.get().defaultBlockState(), BlockBehaviour.Properties.ofFullCopy(BLACK_QUARTZ.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg CHISELED_BLACK_QUARTZ_STAIR = new AABlockReg<>("chiseled_black_quartz_stair", () -> new StairBlock(() -> CHISELED_BLACK_QUARTZ.get().defaultBlockState(), BlockBehaviour.Properties.ofFullCopy(CHISELED_BLACK_QUARTZ.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg BLACK_QUARTZ_PILLAR_STAIR = new AABlockReg<>("black_quartz_pillar_stair", () -> new StairBlock(() -> BLACK_QUARTZ_PILLAR.get().defaultBlockState(), BlockBehaviour.Properties.ofFullCopy(BLACK_QUARTZ_PILLAR.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg SMOOTH_BLACK_QUARTZ_STAIR = new AABlockReg<>("smooth_black_quartz_stair", () -> new StairBlock(() -> BLACK_QUARTZ_PILLAR.get().defaultBlockState(), BlockBehaviour.Properties.ofFullCopy(BLACK_QUARTZ_PILLAR.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); + public static final AABlockReg BLACK_QUARTZ_BRICK_STAIR = new AABlockReg<>("black_quartz_brick_stair", () -> new StairBlock(() -> BLACK_QUARTZ_PILLAR.get().defaultBlockState(), BlockBehaviour.Properties.ofFullCopy(BLACK_QUARTZ_PILLAR.get())), (b) -> new AABlockItem(b, defaultBlockItemProperties)); @@ -318,11 +321,11 @@ public final class ActuallyBlocks { (b) -> new AABlockItem(b, defaultBlockItemProperties)); public static BlockBehaviour.Properties defaultPickProps(float hardness, float resistance) { - return BlockBehaviour.Properties.copy(Blocks.STONE).requiresCorrectToolForDrops().strength(hardness, resistance).sound(SoundType.STONE); + return BlockBehaviour.Properties.ofFullCopy(Blocks.STONE).requiresCorrectToolForDrops().strength(hardness, resistance).sound(SoundType.STONE); } public static BlockBehaviour.Properties defaultPickProps() { - return BlockBehaviour.Properties.copy(Blocks.STONE).requiresCorrectToolForDrops().strength(1.5F, 10.0F).sound(SoundType.STONE); + return BlockBehaviour.Properties.ofFullCopy(Blocks.STONE).requiresCorrectToolForDrops().strength(1.5F, 10.0F).sound(SoundType.STONE); } public static BlockBehaviour.Properties defaultCropProps() { @@ -332,5 +335,10 @@ public final class ActuallyBlocks { public static void init(IEventBus evt) { BLOCKS.register(evt); TILES.register(evt); + evt.addListener(ActuallyBlocks::registerCapabilities); + } + + public static void registerCapabilities(RegisterCapabilitiesEvent event) { + //TODO: Register caps to the BlockEntities that have them } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java index df2c55733..42a6ac420 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java @@ -39,8 +39,8 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.DirectionProperty; 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.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCanolaPress.java index a3f93a854..3bd50b1ff 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCanolaPress.java @@ -13,7 +13,6 @@ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCanolaPress; import net.minecraft.core.BlockPos; -import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; @@ -26,8 +25,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraftforge.fluids.FluidUtil; -import net.minecraftforge.network.NetworkHooks; +import net.neoforged.neoforge.fluids.FluidUtil; import javax.annotation.Nullable; @@ -63,7 +61,7 @@ public class BlockCanolaPress extends BlockContainerBase { return InteractionResult.SUCCESS; if (!player.isShiftKeyDown()) { if (!FluidUtil.interactWithFluidHandler(player, hand, tile.tank)) - NetworkHooks.openScreen((ServerPlayer) player, tile, pos); + player.openMenu(tile, pos); return InteractionResult.SUCCESS; } return InteractionResult.PASS; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java index 9e4eee42f..622f24b00 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java @@ -13,7 +13,6 @@ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.blocks.base.DirectionalBlock; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine; import net.minecraft.core.BlockPos; -import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; @@ -26,7 +25,6 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraftforge.network.NetworkHooks; import javax.annotation.Nullable; @@ -41,7 +39,7 @@ public class BlockCoffeeMachine extends DirectionalBlock.Container { TileEntityCoffeeMachine tile = (TileEntityCoffeeMachine) world.getBlockEntity(pos); if (tile != null) { if (!this.tryUseItemOnTank(player, hand, tile.tank)) { - NetworkHooks.openScreen((ServerPlayer) player, tile, pos); + player.openMenu(tile, pos); } } return InteractionResult.PASS; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFermentingBarrel.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFermentingBarrel.java index 09f372b70..76bbef17c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFermentingBarrel.java @@ -13,7 +13,6 @@ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFermentingBarrel; import net.minecraft.core.BlockPos; -import net.minecraft.server.level.ServerPlayer; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import net.minecraft.world.InteractionHand; @@ -33,8 +32,7 @@ import net.minecraft.world.level.material.MapColor; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraftforge.fluids.FluidUtil; -import net.minecraftforge.network.NetworkHooks; +import net.neoforged.neoforge.fluids.FluidUtil; import javax.annotation.Nullable; @@ -68,7 +66,7 @@ public class BlockFermentingBarrel extends BlockContainerBase { ItemStack stack = player.getItemInHand(hand); world.playSound(null, pos, stack.getItem() == Items.BUCKET ? SoundEvents.BUCKET_EMPTY:SoundEvents.BUCKET_FILL, SoundSource.BLOCKS, 1.0F, 1.0F); } else - NetworkHooks.openScreen((ServerPlayer) player, tile, pos); + player.openMenu(tile, pos); return InteractionResult.SUCCESS; } return InteractionResult.PASS; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFluidCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFluidCollector.java index dcb613740..b063bbb2c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFluidCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFluidCollector.java @@ -26,7 +26,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraftforge.fluids.FluidUtil; +import net.neoforged.neoforge.fluids.FluidUtil; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java index 6dafbd937..16a19fc89 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java @@ -49,8 +49,8 @@ import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -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 javax.annotation.Nullable; import java.util.ArrayList; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLavaFactoryController.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLavaFactoryController.java index db2c964f8..df4f90be2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLavaFactoryController.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLavaFactoryController.java @@ -31,8 +31,8 @@ import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -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 javax.annotation.Nullable; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java index 60585bd7f..045f8a150 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java @@ -15,7 +15,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.server.level.ServerLevel; -import net.minecraft.server.level.ServerPlayer; import net.minecraft.util.RandomSource; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; @@ -29,7 +28,6 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraftforge.network.NetworkHooks; import javax.annotation.Nullable; @@ -70,7 +68,7 @@ public class BlockOilGenerator extends DirectionalBlock.Container { TileEntityOilGenerator generator = (TileEntityOilGenerator) world.getBlockEntity(pos); if (generator != null) { if (!this.tryUseItemOnTank(player, hand, generator.tank)) { - NetworkHooks.openScreen((ServerPlayer) player, generator, pos); + player.openMenu(generator, pos); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java index 077674bcb..27a981791 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java @@ -43,8 +43,8 @@ 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.Vec3; -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 javax.annotation.Nullable; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPlayerInterface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPlayerInterface.java index 85515225b..872487dca 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPlayerInterface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPlayerInterface.java @@ -30,8 +30,8 @@ import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -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 javax.annotation.Nullable; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockShockSuppressor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockShockSuppressor.java index fcfbc82c4..c25280622 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockShockSuppressor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockShockSuppressor.java @@ -23,9 +23,9 @@ import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.level.ExplosionEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.event.level.ExplosionEvent; import javax.annotation.Nullable; import java.util.ArrayList; @@ -36,7 +36,7 @@ public class BlockShockSuppressor extends Block implements EntityBlock { public BlockShockSuppressor() { super(ActuallyBlocks.defaultPickProps(20F, 2000.0F)); - MinecraftForge.EVENT_BUS.register(this); + NeoForge.EVENT_BUS.register(this); } @SubscribeEvent diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockVerticalDigger.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockVerticalDigger.java index 0bd109fae..5ecaa42de 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockVerticalDigger.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockVerticalDigger.java @@ -30,8 +30,8 @@ import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -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 javax.annotation.Nullable; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/IHudDisplay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/IHudDisplay.java index bc4debac4..e09065dc5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/IHudDisplay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/IHudDisplay.java @@ -16,8 +16,8 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; public interface IHudDisplay { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/VoxelShapes.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/VoxelShapes.java index aa3e56b86..bc943fee3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/VoxelShapes.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/VoxelShapes.java @@ -1,7 +1,6 @@ package de.ellpeck.actuallyadditions.mod.blocks; import net.minecraft.world.level.block.Block; -import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.shapes.BooleanOp; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/AACrops.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/AACrops.java index a4f70df7f..1345e1172 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/AACrops.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/AACrops.java @@ -8,8 +8,8 @@ import java.util.function.Supplier; public class AACrops extends CropBlock { Supplier itemSupplier; - public AACrops(Properties p_i48421_1_, Supplier seedSupplier) { - super(p_i48421_1_); + public AACrops(Properties properties, Supplier seedSupplier) { + super(properties); this.itemSupplier = seedSupplier; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBushBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBushBase.java index ded3dfaab..d1a0a39a5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBushBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBushBase.java @@ -10,11 +10,19 @@ package de.ellpeck.actuallyadditions.mod.blocks.base; +import com.mojang.serialization.MapCodec; import net.minecraft.world.level.block.BushBlock; import net.minecraft.world.level.block.SoundType; public class BlockBushBase extends BushBlock { + public static final MapCodec CODEC = simpleCodec(BlockBushBase::new); + public BlockBushBase(Properties properties) { super(properties.sound(SoundType.GRASS)); } + + @Override + protected MapCodec codec() { + return CODEC; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java index 82afdaa49..1d17f9b87 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java @@ -20,7 +20,6 @@ import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.server.level.ServerLevel; -import net.minecraft.server.level.ServerPlayer; import net.minecraft.util.RandomSource; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; @@ -36,9 +35,8 @@ import net.minecraft.world.level.block.EntityBlock; import net.minecraft.world.level.block.RenderShape; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.fluids.FluidUtil; -import net.minecraftforge.fluids.capability.templates.FluidTank; -import net.minecraftforge.network.NetworkHooks; +import net.neoforged.neoforge.fluids.FluidUtil; +import net.neoforged.neoforge.fluids.capability.templates.FluidTank; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -52,7 +50,7 @@ public abstract class BlockContainerBase extends Block implements EntityBlock { if (!world.isClientSide) { BlockEntity tile = world.getBlockEntity(pos); if (expectedInstance.isInstance(tile)) { - NetworkHooks.openScreen((ServerPlayer) player, (MenuProvider) tile, pos); + player.openMenu((MenuProvider) tile); } return InteractionResult.SUCCESS; } @@ -184,14 +182,15 @@ public abstract class BlockContainerBase extends Block implements EntityBlock { } @Override - public void playerWillDestroy(@Nonnull Level world, @Nonnull BlockPos pos, @Nonnull BlockState state, Player player) { - super.playerWillDestroy(world, pos, state, player); + public BlockState playerWillDestroy(@Nonnull Level world, @Nonnull BlockPos pos, @Nonnull BlockState state, Player player) { + BlockState theState = super.playerWillDestroy(world, pos, state, player); if (!player.isCreative()) { BlockEntity tile = world.getBlockEntity(pos); if (tile instanceof TileEntityBase && ((TileEntityBase) tile).stopFromDropping) { player.displayClientMessage(Component.translatable("info." + ActuallyAdditions.MODID + ".machineBroke").withStyle(ChatFormatting.RED), false); } } + return theState; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java index 7c48ecaa0..8d23cc6dc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java @@ -28,8 +28,8 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.material.PushReaction; import net.minecraft.world.phys.BlockHitResult; -import net.minecraftforge.common.PlantType; -import net.minecraftforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.common.PlantType; +import net.neoforged.neoforge.items.ItemHandlerHelper; import java.util.List; import java.util.function.Supplier; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/ReconstructorRenderer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/ReconstructorRenderer.java index 25e7a02c4..b06ad3d49 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/ReconstructorRenderer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/ReconstructorRenderer.java @@ -21,6 +21,9 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.phys.AABB; +import net.minecraft.world.phys.Vec3; import javax.annotation.Nonnull; @@ -75,4 +78,12 @@ public class ReconstructorRenderer implements BlockEntityRenderer 0.0f; } + + @Override + public AABB getRenderBoundingBox(TileEntityAtomicReconstructor blockEntity) { + if (blockEntity.getProgress() > 0.0f) + return new AABB(Vec3.atCenterOf(blockEntity.getBlockPos()), Vec3.atCenterOf(blockEntity.getBlockPos()).add(1,1,1).relative(blockEntity.getBlockState().getValue(BlockStateProperties.FACING), 11)); + else + return BlockEntityRenderer.super.getRenderBoundingBox(blockEntity); + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderBatteryBox.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderBatteryBox.java index 16c3b6606..efdf3dcdd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderBatteryBox.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderBatteryBox.java @@ -24,14 +24,16 @@ import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; import net.minecraft.client.resources.language.I18n; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.capabilities.Capabilities; import org.joml.Matrix4f; +import java.util.Optional; + @OnlyIn(Dist.CLIENT) public class RenderBatteryBox implements BlockEntityRenderer { public RenderBatteryBox(BlockEntityRendererProvider.Context context) { @@ -52,7 +54,7 @@ public class RenderBatteryBox implements BlockEntityRenderer { + Optional.ofNullable(stack.getCapability(Capabilities.EnergyStorage.ITEM)).ifPresent(cap -> { Font font = Minecraft.getInstance().font; String energyTotal = Lang.cleanEnergyValues(cap, false); @@ -91,7 +93,7 @@ public class RenderBatteryBox implements BlockEntityRenderer { public RenderEmpowerer(BlockEntityRendererProvider.Context context) { @@ -51,7 +52,7 @@ public class RenderEmpowerer implements BlockEntityRenderer try { AssetUtil.renderItemInWorld(stack, combinedLight, combinedOverlay, matrices, buffer); } catch (Exception e) { - ActuallyAdditions.LOGGER.error("Something went wrong trying to render an item in an empowerer! The item is " + ForgeRegistries.ITEMS.getKey(stack.getItem()) + "!", e); + ActuallyAdditions.LOGGER.error("Something went wrong trying to render an item in an empowerer! The item is " + BuiltInRegistries.ITEM.getKey(stack.getItem()) + "!", e); } matrices.popPose(); @@ -72,12 +73,12 @@ public class RenderEmpowerer implements BlockEntityRenderer */ if (tile.getCurrentRecipe() != null) { - EmpowererRecipe recipe = tile.getCurrentRecipe(); + RecipeHolder holder = tile.getCurrentRecipe(); for (int i = 0; i <= 3; i++) { Direction facing = Direction.from2DDataValue(i); BlockPos offset = new BlockPos(0,0,0).relative(facing, 3); - AssetUtil.renderLaser(matrices, buffer, new Vec3(0.0d, 0.0d, 0.0d), new Vec3(offset.getX(), offset.getY() + 0.45, offset.getZ()), 80, recipe.getParticleColors(), 1.0f ,0.1F); + AssetUtil.renderLaser(matrices, buffer, new Vec3(0.0d, 0.0d, 0.0d), new Vec3(offset.getX(), offset.getY() + 0.45, offset.getZ()), 80, holder.value().getParticleColors(), 1.0f ,0.1F); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java index eee7dce40..8d6fb52f7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java @@ -108,9 +108,9 @@ // if (!this.recipes.isEmpty()) { // for (IRecipe recipe : this.recipes) { // if (recipe != null) { -// ItemStack output = recipe.getResultItem(); -// if (StackUtil.isValid(output)) { -// ItemStack copy = output.copy(); +// ItemStack stack = recipe.getResultItem(); +// if (StackUtil.isValid(stack)) { +// ItemStack copy = stack.copy(); // /* // if (this.isWildcard) { // copy.setItemDamage(Util.WILDCARD); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java index bbef79bb3..398357dac 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java @@ -27,23 +27,23 @@ //public class PageFurnace extends BookletPage { // // private final ItemStack input; -// private final ItemStack output; +// private final ItemStack stack; // -// public PageFurnace(int localizationKey, ItemStack output) { -// this(localizationKey, output, 0); +// public PageFurnace(int localizationKey, ItemStack stack) { +// this(localizationKey, stack, 0); // } // -// public PageFurnace(int localizationKey, ItemStack output, int priority) { +// public PageFurnace(int localizationKey, ItemStack stack, int priority) { // super(localizationKey, priority); -// this.output = output; -// this.input = getInputForOutput(output); +// this.stack = stack; +// this.input = getInputForOutput(stack); // } // -// private static ItemStack getInputForOutput(ItemStack output) { +// private static ItemStack getInputForOutput(ItemStack stack) { // for (Map.Entry entry : FurnaceRecipes.instance().getSmeltingList().entrySet()) { // ItemStack stack = entry.getValue(); // if (StackUtil.isValid(stack)) { -// if (stack.sameItem(output)) { +// if (stack.sameItem(stack)) { // return entry.getKey(); // } // } @@ -70,13 +70,13 @@ // super.init(gui, startX, startY); // // gui.addOrModifyItemRenderer(this.input, startX + 23 + 1, startY + 10 + 5, 1F, true); -// gui.addOrModifyItemRenderer(this.output, startX + 23 + 59, startY + 10 + 5, 1F, false); +// gui.addOrModifyItemRenderer(this.stack, startX + 23 + 59, startY + 10 + 5, 1F, false); // } // // @Override // public void getItemStacksForPage(List list) { // super.getItemStacksForPage(list); // -// list.add(this.output); +// list.add(this.stack); // } //} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/CommonConfig.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/CommonConfig.java index 0ea6e80f5..d66fd51a9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/CommonConfig.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/CommonConfig.java @@ -2,14 +2,14 @@ package de.ellpeck.actuallyadditions.mod.config; import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; -import net.minecraftforge.common.ForgeConfigSpec; +import net.neoforged.neoforge.common.ModConfigSpec; import java.util.ArrayList; import java.util.List; public class CommonConfig { - private static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder(); - public static ForgeConfigSpec COMMON_CONFIG; + private static final ModConfigSpec.Builder BUILDER = new ModConfigSpec.Builder(); + public static ModConfigSpec COMMON_CONFIG; static { Other.build(); @@ -19,7 +19,7 @@ public class CommonConfig { } public static class ItemSettings { - public static ForgeConfigSpec.ConfigValue> DRILL_EXTRA_MINING_WHITELIST; + public static ModConfigSpec.ConfigValue> DRILL_EXTRA_MINING_WHITELIST; public static void build() { BUILDER.comment("Item settings").push("itemsSettings"); @@ -35,11 +35,11 @@ public class CommonConfig { } public static class Machines { - public static ForgeConfigSpec.IntValue FARMER_AREA; - public static ForgeConfigSpec.IntValue RECONSTRUCTOR_POWER; - public static ForgeConfigSpec.IntValue OIL_GENERATOR_TRANSFER; - public static ForgeConfigSpec.IntValue MINER_LENS_ENERGY; - public static ForgeConfigSpec.BooleanValue LASER_RELAY_LOSS; + public static ModConfigSpec.IntValue FARMER_AREA; + public static ModConfigSpec.IntValue RECONSTRUCTOR_POWER; + public static ModConfigSpec.IntValue OIL_GENERATOR_TRANSFER; + public static ModConfigSpec.IntValue MINER_LENS_ENERGY; + public static ModConfigSpec.BooleanValue LASER_RELAY_LOSS; public static void build() { BUILDER.comment("Machine Settings").push("machineSettings"); @@ -55,24 +55,24 @@ public class CommonConfig { } public static class Other { - public static ForgeConfigSpec.BooleanValue SOLID_XP_ALWAYS_ORBS; - public static ForgeConfigSpec.BooleanValue DO_UPDATE_CHECK; - public static ForgeConfigSpec.BooleanValue UPDATE_CHECK_VERSION_SPECIFIC; - public static ForgeConfigSpec.BooleanValue DO_CAT_DROPS; - public static ForgeConfigSpec.IntValue FUR_CHANCE; - public static ForgeConfigSpec.BooleanValue WORMS; - public static ForgeConfigSpec.IntValue WORMS_DIE_TIME; - public static ForgeConfigSpec.BooleanValue CTRL_EXTRA_INFO; - public static ForgeConfigSpec.BooleanValue CTRL_INFO_FOR_EXTRA_INFO; - public static ForgeConfigSpec.BooleanValue GIVE_BOOKLET_ON_FIRST_CRAFT; - public static ForgeConfigSpec.BooleanValue DUNGEON_LOOT; - public static ForgeConfigSpec.BooleanValue WATER_BOWL; - public static ForgeConfigSpec.BooleanValue WATER_BOWL_LOSS; - public static ForgeConfigSpec.BooleanValue TINY_COAL_STUFF; - public static ForgeConfigSpec.BooleanValue SUPER_DUPER_HARD_MODE; - public static ForgeConfigSpec.BooleanValue MOST_BLAND_PERSON_EVER; - public static ForgeConfigSpec.ConfigValue REDSTONECONFIGURATOR; - public static ForgeConfigSpec.ConfigValue RELAYCONFIGURATOR; + public static ModConfigSpec.BooleanValue SOLID_XP_ALWAYS_ORBS; + public static ModConfigSpec.BooleanValue DO_UPDATE_CHECK; + public static ModConfigSpec.BooleanValue UPDATE_CHECK_VERSION_SPECIFIC; + public static ModConfigSpec.BooleanValue DO_CAT_DROPS; + public static ModConfigSpec.IntValue FUR_CHANCE; + public static ModConfigSpec.BooleanValue WORMS; + public static ModConfigSpec.IntValue WORMS_DIE_TIME; + public static ModConfigSpec.BooleanValue CTRL_EXTRA_INFO; + public static ModConfigSpec.BooleanValue CTRL_INFO_FOR_EXTRA_INFO; + public static ModConfigSpec.BooleanValue GIVE_BOOKLET_ON_FIRST_CRAFT; + public static ModConfigSpec.BooleanValue DUNGEON_LOOT; + public static ModConfigSpec.BooleanValue WATER_BOWL; + public static ModConfigSpec.BooleanValue WATER_BOWL_LOSS; + public static ModConfigSpec.BooleanValue TINY_COAL_STUFF; + public static ModConfigSpec.BooleanValue SUPER_DUPER_HARD_MODE; + public static ModConfigSpec.BooleanValue MOST_BLAND_PERSON_EVER; + public static ModConfigSpec.ConfigValue REDSTONECONFIGURATOR; + public static ModConfigSpec.ConfigValue RELAYCONFIGURATOR; public static Item redstoneConfigureItem = Items.AIR; public static Item relayConfigureItem = Items.AIR; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/conditions/BoolConfigCondition.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/conditions/BoolConfigCondition.java index 71862a652..2af945086 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/conditions/BoolConfigCondition.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/conditions/BoolConfigCondition.java @@ -1,24 +1,19 @@ package de.ellpeck.actuallyadditions.mod.config.conditions; -import com.google.gson.JsonObject; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.config.CommonConfig; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.common.crafting.conditions.ICondition; -import net.minecraftforge.common.crafting.conditions.IConditionSerializer; +import net.neoforged.neoforge.common.conditions.ICondition; -public class BoolConfigCondition implements ICondition { +public record BoolConfigCondition(String boolConfig) implements ICondition { + public static Codec CODEC = RecordCodecBuilder.create( + builder -> builder + .group( + Codec.STRING.fieldOf("boolConfig").forGetter(BoolConfigCondition::boolConfig)) + .apply(builder, BoolConfigCondition::new)); private static final ResourceLocation NAME = new ResourceLocation(ActuallyAdditions.MODID, "bool_config_condition"); - private final String boolConfig; - - public BoolConfigCondition(String config) { - this.boolConfig = config; - } - - @Override - public ResourceLocation getID() { - return NAME; - } @Override public boolean test(IContext condition) { @@ -30,22 +25,13 @@ public class BoolConfigCondition implements ICondition { } } - public static class Serializer implements IConditionSerializer { - public static final BoolConfigCondition.Serializer INSTANCE = new BoolConfigCondition.Serializer(); + @Override + public Codec codec() { + return CODEC; + } - @Override - public void write(JsonObject json, BoolConfigCondition value) { - json.addProperty("config_name", value.boolConfig); - } - - @Override - public BoolConfigCondition read(JsonObject json) { - return new BoolConfigCondition(json.get("config_name").getAsString()); - } - - @Override - public ResourceLocation getID() { - return BoolConfigCondition.NAME; - } + @Override + public String toString() { + return "ConfigEnabled(\"" + boolConfig + "\")"; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ActuallyRecipes.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ActuallyRecipes.java index 6d73dba83..7a7b32eb4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ActuallyRecipes.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ActuallyRecipes.java @@ -1,45 +1,46 @@ package de.ellpeck.actuallyadditions.mod.crafting; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredRegister; + +import java.util.function.Supplier; public class ActuallyRecipes { - public static final DeferredRegister> SERIALIZERS = DeferredRegister.create(ForgeRegistries.RECIPE_SERIALIZERS, ActuallyAdditions.MODID); + public static final DeferredRegister> SERIALIZERS = DeferredRegister.create(BuiltInRegistries.RECIPE_SERIALIZER, ActuallyAdditions.MODID); public static void init(IEventBus bus) { SERIALIZERS.register(bus); Types.RECIPE_TYPES.register(bus); } - public static final RegistryObject> KEEP_DATA_SHAPED_RECIPE = SERIALIZERS.register(RecipeKeepDataShaped.NAME, RecipeKeepDataShaped.Serializer::new); - public static final RegistryObject> LASER_RECIPE = SERIALIZERS.register(LaserRecipe.NAME, LaserRecipe.Serializer::new); - public static final RegistryObject> EMPOWERING_RECIPE = SERIALIZERS.register(EmpowererRecipe.NAME, EmpowererRecipe.Serializer::new); - public static final RegistryObject> CRUSHING_RECIPE = SERIALIZERS.register(CrushingRecipe.NAME, CrushingRecipe.Serializer::new); - public static final RegistryObject> SOLID_FUEL_RECIPE = SERIALIZERS.register(SolidFuelRecipe.NAME, SolidFuelRecipe.Serializer::new); - public static final RegistryObject> LIQUID_FUEL_RECIPE = SERIALIZERS.register(LiquidFuelRecipe.NAME, LiquidFuelRecipe.Serializer::new); - public static final RegistryObject> PRESSING_RECIPE = SERIALIZERS.register(PressingRecipe.NAME, PressingRecipe.Serializer::new); - public static final RegistryObject> FERMENTING_RECIPE = SERIALIZERS.register(FermentingRecipe.NAME, FermentingRecipe.Serializer::new); - public static final RegistryObject> COLOR_CHANGE_RECIPE = SERIALIZERS.register(ColorChangeRecipe.NAME, ColorChangeRecipe.Serializer::new); - public static final RegistryObject> MINING_LENS_RECIPE = SERIALIZERS.register(MiningLensRecipe.NAME, MiningLensRecipe.Serializer::new); + public static final Supplier> KEEP_DATA_SHAPED_RECIPE = SERIALIZERS.register(RecipeKeepDataShaped.NAME, RecipeKeepDataShaped.Serializer::new); + public static final Supplier> LASER_RECIPE = SERIALIZERS.register(LaserRecipe.NAME, LaserRecipe.Serializer::new); + public static final Supplier> EMPOWERING_RECIPE = SERIALIZERS.register(EmpowererRecipe.NAME, EmpowererRecipe.Serializer::new); + public static final Supplier> CRUSHING_RECIPE = SERIALIZERS.register(CrushingRecipe.NAME, CrushingRecipe.Serializer::new); + public static final Supplier> SOLID_FUEL_RECIPE = SERIALIZERS.register(SolidFuelRecipe.NAME, SolidFuelRecipe.Serializer::new); + public static final Supplier> LIQUID_FUEL_RECIPE = SERIALIZERS.register(LiquidFuelRecipe.NAME, LiquidFuelRecipe.Serializer::new); + public static final Supplier> PRESSING_RECIPE = SERIALIZERS.register(PressingRecipe.NAME, PressingRecipe.Serializer::new); + public static final Supplier> FERMENTING_RECIPE = SERIALIZERS.register(FermentingRecipe.NAME, FermentingRecipe.Serializer::new); + public static final Supplier> COLOR_CHANGE_RECIPE = SERIALIZERS.register(ColorChangeRecipe.NAME, ColorChangeRecipe.Serializer::new); + public static final Supplier> MINING_LENS_RECIPE = SERIALIZERS.register(MiningLensRecipe.NAME, MiningLensRecipe.Serializer::new); public static class Types { - public static final DeferredRegister> RECIPE_TYPES = DeferredRegister.create(ForgeRegistries.RECIPE_TYPES, ActuallyAdditions.MODID); + public static final DeferredRegister> RECIPE_TYPES = DeferredRegister.create(BuiltInRegistries.RECIPE_TYPE, ActuallyAdditions.MODID); - public static final RegistryObject> LASER = RECIPE_TYPES.register("laser", () -> new RecipeType<>() {}); - public static final RegistryObject> EMPOWERING = RECIPE_TYPES.register("empower", () -> new RecipeType<>() {}); - public static final RegistryObject> CRUSHING = RECIPE_TYPES.register("crushing", () -> new RecipeType<>() {}); - public static final RegistryObject> SOLID_FUEL = RECIPE_TYPES.register("solid_fuel", () -> new RecipeType<>() {}); - public static final RegistryObject> LIQUID_FUEL = RECIPE_TYPES.register("liquid_fuel", () -> new RecipeType<>() {}); - public static final RegistryObject> PRESSING = RECIPE_TYPES.register("pressing", () -> new RecipeType<>() {}); - public static final RegistryObject> FERMENTING = RECIPE_TYPES.register("fermenting", () -> new RecipeType<>() {}); - public static final RegistryObject> COLOR_CHANGE = RECIPE_TYPES.register("color_change", () -> new RecipeType<>() {}); - public static final RegistryObject> MINING_LENS = RECIPE_TYPES.register("mining_lens", () -> new RecipeType<>() {}); + public static final Supplier> LASER = RECIPE_TYPES.register("laser", () -> new RecipeType<>() {}); + public static final Supplier> EMPOWERING = RECIPE_TYPES.register("empower", () -> new RecipeType<>() {}); + public static final Supplier> CRUSHING = RECIPE_TYPES.register("crushing", () -> new RecipeType<>() {}); + public static final Supplier> SOLID_FUEL = RECIPE_TYPES.register("solid_fuel", () -> new RecipeType<>() {}); + public static final Supplier> LIQUID_FUEL = RECIPE_TYPES.register("liquid_fuel", () -> new RecipeType<>() {}); + public static final Supplier> PRESSING = RECIPE_TYPES.register("pressing", () -> new RecipeType<>() {}); + public static final Supplier> FERMENTING = RECIPE_TYPES.register("fermenting", () -> new RecipeType<>() {}); + public static final Supplier> COLOR_CHANGE = RECIPE_TYPES.register("color_change", () -> new RecipeType<>() {}); + public static final Supplier> MINING_LENS = RECIPE_TYPES.register("mining_lens", () -> new RecipeType<>() {}); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ColorChangeRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ColorChangeRecipe.java index 187da6737..5631d5098 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ColorChangeRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ColorChangeRecipe.java @@ -1,21 +1,18 @@ package de.ellpeck.actuallyadditions.mod.crafting; -import com.google.gson.JsonObject; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import net.minecraft.core.RegistryAccess; -import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.util.GsonHelper; import net.minecraft.world.Container; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.RecipeHolder; 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.minecraftforge.registries.ForgeRegistries; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -26,12 +23,10 @@ public class ColorChangeRecipe implements Recipe { private final Ingredient input; private final ItemStack output; - private final ResourceLocation id; - public ColorChangeRecipe(ResourceLocation id, ItemStack output, Ingredient input) { + public ColorChangeRecipe(ItemStack output, Ingredient input) { this.input = input; this.output = output; - this.id = id; } @Override @@ -59,8 +54,8 @@ public class ColorChangeRecipe implements Recipe { return false; } - public static Optional getRecipeForStack(ItemStack stack) { - return ActuallyAdditionsAPI.COLOR_CHANGE_RECIPES.stream().filter(recipe -> recipe.matches(stack)).findFirst(); + public static Optional> getRecipeForStack(ItemStack stack) { + return ActuallyAdditionsAPI.COLOR_CHANGE_RECIPES.stream().filter(recipe -> recipe.value().matches(stack)).findFirst(); } @Nonnull @@ -69,12 +64,6 @@ public class ColorChangeRecipe implements Recipe { return output.copy(); } - @Nonnull - @Override - public ResourceLocation getId() { - return id; - } - @Nonnull @Override public RecipeSerializer getSerializer() { @@ -87,21 +76,34 @@ public class ColorChangeRecipe implements Recipe { } public static class Serializer implements RecipeSerializer { - @Override - public ColorChangeRecipe fromJson(@Nonnull ResourceLocation pRecipeId, @Nonnull JsonObject pJson) { - Ingredient ingredient = Ingredient.fromJson(GsonHelper.getAsJsonObject(pJson, "ingredient")); - JsonObject resultObject = GsonHelper.getAsJsonObject(pJson, "result"); - ItemStack result = new ItemStack(GsonHelper.getAsItem(resultObject, "item")); + private static final Codec CODEC = RecordCodecBuilder.create( + instance -> instance.group( + ItemStack.RESULT_CODEC.fieldOf("result").forGetter(recipe -> recipe.output), + Ingredient.CODEC_NONEMPTY.fieldOf("ingredient").forGetter(recipe -> recipe.input) + ) + .apply(instance, ColorChangeRecipe::new) + ); - return new ColorChangeRecipe(pRecipeId, result, ingredient); +// @Override +// public ColorChangeRecipe fromJson(@Nonnull ResourceLocation pRecipeId, @Nonnull JsonObject pJson) { +// Ingredient ingredient = Ingredient.fromJson(GsonHelper.getAsJsonObject(pJson, "ingredient")); +// JsonObject resultObject = GsonHelper.getAsJsonObject(pJson, "result"); +// ItemStack result = new ItemStack(GsonHelper.getAsItem(resultObject, "item")); +// +// return new ColorChangeRecipe(pRecipeId, result, ingredient); +// } + + @Override + public Codec codec() { + return CODEC; } @Nullable @Override - public ColorChangeRecipe fromNetwork(@Nonnull ResourceLocation pRecipeId, @Nonnull FriendlyByteBuf pBuffer) { + public ColorChangeRecipe fromNetwork(@Nonnull FriendlyByteBuf pBuffer) { Ingredient ingredient = Ingredient.fromNetwork(pBuffer); ItemStack result = pBuffer.readItem(); - return new ColorChangeRecipe(pRecipeId, result, ingredient); + return new ColorChangeRecipe(result, ingredient); } @Override @@ -110,48 +112,4 @@ public class ColorChangeRecipe implements Recipe { pBuffer.writeItem(pRecipe.output); } } - - public static class Result implements FinishedRecipe { - private final ResourceLocation id; - private final Ingredient itemIngredient; - private final ItemLike output; - - public Result(ResourceLocation id, Ingredient itemIngredient, ItemLike output) { - this.id = id; - this.itemIngredient = itemIngredient; - this.output = output; - } - - @Override - public void serializeRecipeData(JsonObject pJson) { - pJson.add("ingredient", itemIngredient.toJson()); - - JsonObject resultObject = new JsonObject(); - resultObject.addProperty("item", ForgeRegistries.ITEMS.getKey(output.asItem()).toString()); - - pJson.add("result", resultObject); - } - - @Override - public ResourceLocation getId() { - return id; - } - - @Override - public RecipeSerializer getType() { - return ActuallyRecipes.COLOR_CHANGE_RECIPE.get(); - } - - @Nullable - @Override - public JsonObject serializeAdvancement() { - return null; - } - - @Nullable - @Override - public ResourceLocation getAdvancementId() { - return null; - } - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/CrushingRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/CrushingRecipe.java index bc64f5c7a..6b1044723 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/CrushingRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/CrushingRecipe.java @@ -1,51 +1,41 @@ package de.ellpeck.actuallyadditions.mod.crafting; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; +import com.mojang.serialization.Codec; +import com.mojang.serialization.DataResult; +import com.mojang.serialization.codecs.RecordCodecBuilder; +import net.minecraft.core.NonNullList; import net.minecraft.core.RegistryAccess; -import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.util.GsonHelper; import net.minecraft.world.Container; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; 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.ItemLike; import net.minecraft.world.level.Level; -import net.minecraftforge.registries.ForgeRegistries; import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class CrushingRecipe implements Recipe { public static String NAME = "crushing"; - private final ResourceLocation id; protected Ingredient input; - protected ItemStack outputOne; - protected ItemStack outputTwo; - protected float chance1; - protected float chance2; + protected NonNullList outputs; - public CrushingRecipe(ResourceLocation id, Ingredient input, ItemStack outputOne, float chance1, ItemStack outputTwo, float chance2) { - this.id = id; + public CrushingRecipe(Ingredient input, NonNullList outputList) { this.input = input; - this.outputOne = outputOne; - this.outputTwo = outputTwo; - this.chance1 = chance1; - this.chance2 = chance2; + this.outputs = outputList; } public CrushingRecipe(Ingredient input, ItemStack outputOne, float chance1, ItemStack outputTwo, float chance2) { - this.id = new ResourceLocation(ActuallyAdditions.MODID, ForgeRegistries.ITEMS.getKey(input.getItems()[0].getItem()).getPath() + "_crushing"); - this.input = input; - this.outputOne = outputOne; - this.outputTwo = outputTwo; - this.chance1 = chance1; - this.chance2 = chance2; + this(input, createList(new CrushingResult(outputOne, chance1), new CrushingResult(outputTwo, chance2))); + } + + private static NonNullList createList(CrushingResult... results) { + NonNullList list = NonNullList.create(); + for (CrushingResult result : results) { + list.add(result); + } + return list; } @Override @@ -76,13 +66,7 @@ public class CrushingRecipe implements Recipe { @Override @Nonnull public ItemStack getResultItem(RegistryAccess pRegistryAccess) { - return outputOne; - } - - @Override - @Nonnull - public ResourceLocation getId() { - return id; + return this.outputs.get(0).stack.copy(); } @Override @@ -98,137 +82,119 @@ public class CrushingRecipe implements Recipe { } public ItemStack getOutputOne() { - return this.outputOne; + return this.outputs.get(0).stack; } public ItemStack getOutputTwo() { - return this.outputTwo; + return this.outputs.get(1).stack; } public float getFirstChance() { - return this.chance1; + return this.outputs.get(0).chance; } public float getSecondChance() { - return this.chance2; + return this.outputs.get(1).chance; } public Ingredient getInput() { return this.input; } + + public record CrushingResult(ItemStack stack, float chance) { + public static final CrushingResult EMPTY = new CrushingResult(ItemStack.EMPTY, 0.0F); + }; + public static class Serializer implements RecipeSerializer { + private static final Codec RESULT_CODEC = RecordCodecBuilder.create( + instance -> instance.group( + ItemStack.ITEM_WITH_COUNT_CODEC.fieldOf("result").forGetter(result -> result.stack), + Codec.FLOAT.optionalFieldOf("chance", 1.0F).forGetter(recipe -> recipe.chance) + ) + .apply(instance, CrushingResult::new) + ); + + private static final Codec CODEC = RecordCodecBuilder.create( + instance -> instance.group( + Ingredient.CODEC_NONEMPTY.fieldOf("ingredient").forGetter(recipe -> recipe.input), + RESULT_CODEC + .listOf() + .fieldOf("result") + .flatXmap( + array -> { + CrushingResult[] resultArray = array.toArray(CrushingResult[]::new); + NonNullList results = NonNullList.withSize(2, CrushingResult.EMPTY); + if (resultArray.length < 1) { + return DataResult.error(() -> "Recipe must contain at least 1 result"); + } else if (resultArray.length > 2) { + return DataResult.error(() -> "Too many results for crushing recipe. The maximum is: 2"); + } else { + for (int i = 0; i < resultArray.length; i++) { + results.set(i, resultArray[i]); + } + return DataResult.success(results); + } + }, + DataResult::success + ) + .forGetter(recipe -> recipe.outputs) + ) + .apply(instance, CrushingRecipe::new) + ); @Override - @Nonnull - public CrushingRecipe fromJson(@Nonnull ResourceLocation pRecipeId, @Nonnull JsonObject pJson) { - Ingredient ingredient = Ingredient.fromJson(GsonHelper.getAsJsonObject(pJson, "ingredient")); - - JsonArray resultList = GsonHelper.getAsJsonArray(pJson, "result"); - if (resultList.size() < 1) - throw new IllegalStateException(pRecipeId.toString() + ": Recipe must contain at least 1 result item"); - - JsonObject result1 = resultList.get(0).getAsJsonObject(); - int count1 = GsonHelper.getAsInt(result1, "count", 0); - ItemStack output1 = new ItemStack(GsonHelper.getAsItem(result1, "item"), count1); - float chance1 = GsonHelper.getAsFloat(result1, "chance"); - - ItemStack output2 = ItemStack.EMPTY; - float chance2 = 1.0f; - if (resultList.size() > 1) { - JsonObject result2 = resultList.get(1).getAsJsonObject(); - int count2 = GsonHelper.getAsInt(result2, "count", 0); - output2 = new ItemStack(GsonHelper.getAsItem(result2, "item"), count2); - chance2 = GsonHelper.getAsFloat(result2, "chance"); - } - - return new CrushingRecipe(pRecipeId, ingredient, output1, chance1, output2, chance2); + public Codec codec() { + return CODEC; } - @Override - public CrushingRecipe fromNetwork(@Nonnull ResourceLocation pRecipeId, @Nonnull FriendlyByteBuf pBuffer) { - Ingredient ingredient = Ingredient.fromNetwork(pBuffer); - ItemStack output1 = pBuffer.readItem(); - ItemStack output2 = pBuffer.readItem(); - float chance1 = pBuffer.readFloat(); - float chance2 = pBuffer.readFloat(); +// @Override +// @Nonnull +// public CrushingRecipe fromJson(@Nonnull ResourceLocation pRecipeId, @Nonnull JsonObject pJson) { +// Ingredient ingredient = Ingredient.fromJson(GsonHelper.getAsJsonObject(pJson, "ingredient")); +// +// JsonArray resultList = GsonHelper.getAsJsonArray(pJson, "result"); +// if (resultList.size() < 1) +// throw new IllegalStateException(pRecipeId.toString() + ": Recipe must contain at least 1 result item"); +// +// JsonObject result1 = resultList.get(0).getAsJsonObject(); +// int count1 = GsonHelper.getAsInt(result1, "count", 0); +// ItemStack output1 = new ItemStack(GsonHelper.getAsItem(result1, "item"), count1); +// float chance1 = GsonHelper.getAsFloat(result1, "chance"); +// +// ItemStack output2 = ItemStack.EMPTY; +// float chance2 = 1.0f; +// if (resultList.size() > 1) { +// JsonObject result2 = resultList.get(1).getAsJsonObject(); +// int count2 = GsonHelper.getAsInt(result2, "count", 0); +// output2 = new ItemStack(GsonHelper.getAsItem(result2, "item"), count2); +// chance2 = GsonHelper.getAsFloat(result2, "chance"); +// } +// +// return new CrushingRecipe(pRecipeId, ingredient, output1, chance1, output2, chance2); +// } - return new CrushingRecipe(pRecipeId, ingredient, output1, chance1, output2, chance2); + @Override + public CrushingRecipe fromNetwork(@Nonnull FriendlyByteBuf pBuffer) { + Ingredient ingredient = Ingredient.fromNetwork(pBuffer); + + int i = pBuffer.readVarInt(); + + NonNullList nonnulllist = NonNullList.withSize(i, CrushingResult.EMPTY); + for (int j = 0; j < nonnulllist.size(); ++j) { + nonnulllist.set(j, new CrushingResult(pBuffer.readItem(), pBuffer.readFloat())); + } + + return new CrushingRecipe(ingredient, nonnulllist); } @Override public void toNetwork(@Nonnull FriendlyByteBuf pBuffer, CrushingRecipe pRecipe) { pRecipe.input.toNetwork(pBuffer); - pBuffer.writeItem(pRecipe.outputOne); - pBuffer.writeItem(pRecipe.outputTwo); - pBuffer.writeFloat(pRecipe.chance1); - pBuffer.writeFloat(pRecipe.chance2); - } - } - - public static class Result implements FinishedRecipe { - private final ResourceLocation id; - protected Ingredient input; - protected ItemLike outputOne; - protected int countOne; - protected float outputChance1; - protected ItemLike outputTwo; - protected int countTwo; - protected float outputChance2; - - public Result(ResourceLocation id, Ingredient input, ItemLike outputOne, int countOne, float outputChance1, ItemLike outputTwo, int countTwo, float outputChance2) { - this.id = id; - this.countOne = countOne; - this.countTwo = countTwo; - this.input = input; - this.outputOne = outputOne; - this.outputTwo = outputTwo; - this.outputChance1 = outputChance1; - this.outputChance2 = outputChance2; - } - - @Override - public void serializeRecipeData(JsonObject pJson) { - pJson.add("ingredient", input.toJson()); - - JsonObject result1 = new JsonObject(); - result1.addProperty("item", ForgeRegistries.ITEMS.getKey(outputOne.asItem()).toString()); - result1.addProperty("count", countOne); - result1.addProperty("chance", outputChance1); - - JsonObject result2 = new JsonObject(); - result2.addProperty("item", ForgeRegistries.ITEMS.getKey(outputTwo.asItem()).toString()); - result2.addProperty("count", countTwo); - result2.addProperty("chance", outputChance2); - - JsonArray resultList = new JsonArray(); - resultList.add(result1); - resultList.add(result2); - - pJson.add("result", resultList); - } - - @Override - @Nonnull - public ResourceLocation getId() { - return id; - } - - @Override - @Nonnull - public RecipeSerializer getType() { - return ActuallyRecipes.CRUSHING_RECIPE.get(); - } - - @Nullable - @Override - public JsonObject serializeAdvancement() { - return null; - } - - @Nullable - @Override - public ResourceLocation getAdvancementId() { - return null; + pBuffer.writeVarInt(pRecipe.outputs.size()); + for (CrushingResult result : pRecipe.outputs) { + pBuffer.writeItem(result.stack); + pBuffer.writeFloat(result.chance); + } } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/EmpowererRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/EmpowererRecipe.java index d5258cb3c..51fd80ff6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/EmpowererRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/EmpowererRecipe.java @@ -1,21 +1,18 @@ package de.ellpeck.actuallyadditions.mod.crafting; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; +import com.mojang.serialization.Codec; +import com.mojang.serialization.DataResult; +import com.mojang.serialization.codecs.RecordCodecBuilder; +import net.minecraft.core.NonNullList; import net.minecraft.core.RegistryAccess; -import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.util.GsonHelper; import net.minecraft.world.Container; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; 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.ItemLike; import net.minecraft.world.level.Level; -import net.minecraftforge.registries.ForgeRegistries; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -24,27 +21,19 @@ import java.util.List; public class EmpowererRecipe implements Recipe { public static String NAME = "empowering"; - private final ResourceLocation id; protected final Ingredient input; protected final ItemStack output; - protected final Ingredient modifier1; - protected final Ingredient modifier2; - protected final Ingredient modifier3; - protected final Ingredient modifier4; + protected final NonNullList modifiers; protected final int energyPerStand; protected final int particleColor; protected final int time; - public EmpowererRecipe(ResourceLocation id, ItemStack output, Ingredient input, Ingredient modifier1, Ingredient modifier2, Ingredient modifier3, Ingredient modifier4, int energyPerStand, int particleColor, int time) { - this.id = id; + public EmpowererRecipe(ItemStack output, Ingredient input, NonNullList modifiers, int energyPerStand, int particleColor, int time) { this.input = input; this.output = output; - this.modifier1 = modifier1; - this.modifier2 = modifier2; - this.modifier3 = modifier3; - this.modifier4 = modifier4; + this.modifiers = modifiers; this.energyPerStand = energyPerStand; this.particleColor = particleColor; this.time = time; @@ -57,17 +46,17 @@ public class EmpowererRecipe implements Recipe { ItemStack[] stacks = {stand1, stand2, stand3, stand4}; boolean[] unused = {true, true, true, true}; for (ItemStack s : stacks) { - if (unused[0] && this.modifier1.test(s)) { - matches.add(this.modifier1); + if (unused[0] && this.modifiers.get(0).test(s)) { + matches.add(this.modifiers.get(0)); unused[0] = false; - } else if (unused[1] && this.modifier2.test(s)) { - matches.add(this.modifier2); + } else if (unused[1] && this.modifiers.get(1).test(s)) { + matches.add(this.modifiers.get(1)); unused[1] = false; - } else if (unused[2] && this.modifier3.test(s)) { - matches.add(this.modifier3); + } else if (unused[2] && this.modifiers.get(2).test(s)) { + matches.add(this.modifiers.get(2)); unused[2] = false; - } else if (unused[3] && this.modifier4.test(s)) { - matches.add(this.modifier4); + } else if (unused[3] && this.modifiers.get(3).test(s)) { + matches.add(this.modifiers.get(3)); unused[3] = false; } } @@ -102,12 +91,6 @@ public class EmpowererRecipe implements Recipe { return output; } - @Override - @Nonnull - public ResourceLocation getId() { - return id; - } - @Override @Nonnull public RecipeSerializer getSerializer() { @@ -129,19 +112,19 @@ public class EmpowererRecipe implements Recipe { } public Ingredient getStandOne() { - return this.modifier1; + return this.modifiers.get(0); } public Ingredient getStandTwo() { - return this.modifier2; + return this.modifiers.get(1); } public Ingredient getStandThree() { - return this.modifier3; + return this.modifiers.get(2); } public Ingredient getStandFour() { - return this.modifier4; + return this.modifiers.get(3); } public int getTime() { @@ -157,127 +140,92 @@ public class EmpowererRecipe implements Recipe { } public static class Serializer implements RecipeSerializer { + private static final Codec CODEC = RecordCodecBuilder.create( + instance -> instance.group( + ItemStack.RESULT_CODEC.fieldOf("result").forGetter(recipe -> recipe.output), + Ingredient.CODEC_NONEMPTY.fieldOf("base").forGetter(recipe -> recipe.input), + Ingredient.CODEC_NONEMPTY + .listOf() + .fieldOf("modifiers") + .flatXmap( + list -> { + Ingredient[] aingredient = list + .toArray(Ingredient[]::new); + if (aingredient.length == 0) { + return DataResult.error(() -> "No modifiers for Empowering recipe"); + } else { + return aingredient.length != 4 + ? DataResult.error(() -> "Must have exactly 4 modifiers. has: %s".formatted(aingredient.length)) + : DataResult.success(NonNullList.of(Ingredient.EMPTY, aingredient)); + } + }, + DataResult::success + ) + .forGetter(recipe -> recipe.modifiers), + Codec.INT.fieldOf("energy").forGetter(recipe -> recipe.energyPerStand), + Codec.INT.fieldOf("color").forGetter(recipe -> recipe.particleColor), + Codec.INT.fieldOf("time").forGetter(recipe -> recipe.time) + ) + .apply(instance, EmpowererRecipe::new) + ); + @Override - @Nonnull - public EmpowererRecipe fromJson(@Nonnull ResourceLocation pRecipeId, @Nonnull JsonObject pJson) { - Ingredient base = Ingredient.fromJson(GsonHelper.getAsJsonObject(pJson, "base")); - - JsonArray modifiers = GsonHelper.getAsJsonArray(pJson, "modifiers"); - if (modifiers.size() != 4) - throw new IllegalStateException(pRecipeId.toString() + ": Must have exactly 4 modifiers, has: " + modifiers.size()); - - Ingredient mod1 = Ingredient.fromJson(modifiers.get(0)); - Ingredient mod2 = Ingredient.fromJson(modifiers.get(1)); - Ingredient mod3 = Ingredient.fromJson(modifiers.get(2)); - Ingredient mod4 = Ingredient.fromJson(modifiers.get(3)); - int energy = GsonHelper.getAsInt(pJson, "energy"); - int color = GsonHelper.getAsInt(pJson, "color"); - int time = GsonHelper.getAsInt(pJson, "time"); - JsonObject resultObject = GsonHelper.getAsJsonObject(pJson, "result"); - ItemStack result = new ItemStack(GsonHelper.getAsItem(resultObject, "item")); - - return new EmpowererRecipe(pRecipeId, result, base, mod1, mod2, mod3, mod4, energy, color, time); + public Codec codec() { + return CODEC; } + // @Override +// @Nonnull +// public EmpowererRecipe fromJson(@Nonnull ResourceLocation pRecipeId, @Nonnull JsonObject pJson) { +// Ingredient base = Ingredient.fromJson(GsonHelper.getAsJsonObject(pJson, "base")); +// +// JsonArray modifiers = GsonHelper.getAsJsonArray(pJson, "modifiers"); +// if (modifiers.size() != 4) +// throw new IllegalStateException(pRecipeId.toString() + ": Must have exactly 4 modifiers, has: " + modifiers.size()); +// +// Ingredient mod1 = Ingredient.fromJson(modifiers.get(0)); +// Ingredient mod2 = Ingredient.fromJson(modifiers.get(1)); +// Ingredient mod3 = Ingredient.fromJson(modifiers.get(2)); +// Ingredient mod4 = Ingredient.fromJson(modifiers.get(3)); +// int energy = GsonHelper.getAsInt(pJson, "energy"); +// int color = GsonHelper.getAsInt(pJson, "color"); +// int time = GsonHelper.getAsInt(pJson, "time"); +// JsonObject resultObject = GsonHelper.getAsJsonObject(pJson, "result"); +// ItemStack result = new ItemStack(GsonHelper.getAsItem(resultObject, "item")); +// +// return new EmpowererRecipe(pRecipeId, result, base, mod1, mod2, mod3, mod4, energy, color, time); +// } + @Nullable @Override - public EmpowererRecipe fromNetwork(@Nonnull ResourceLocation pRecipeId, FriendlyByteBuf pBuffer) { + public EmpowererRecipe fromNetwork(FriendlyByteBuf pBuffer) { ItemStack result = pBuffer.readItem(); Ingredient input = Ingredient.fromNetwork(pBuffer); - Ingredient mod1 = Ingredient.fromNetwork(pBuffer); - Ingredient mod2 = Ingredient.fromNetwork(pBuffer); - Ingredient mod3 = Ingredient.fromNetwork(pBuffer); - Ingredient mod4 = Ingredient.fromNetwork(pBuffer); + + int i = pBuffer.readVarInt(); + NonNullList nonnulllist = NonNullList.withSize(i, Ingredient.EMPTY); + for (int j = 0; j < nonnulllist.size(); ++j) { + nonnulllist.set(j, Ingredient.fromNetwork(pBuffer)); + } + int energy = pBuffer.readInt(); int color = pBuffer.readInt(); int time = pBuffer.readInt(); - return new EmpowererRecipe(pRecipeId, result, input, mod1, mod2, mod3, mod4, energy, color, time); + return new EmpowererRecipe(result, input, nonnulllist, energy, color, time); } @Override public void toNetwork(FriendlyByteBuf pBuffer, EmpowererRecipe pRecipe) { pBuffer.writeItem(pRecipe.output); pRecipe.input.toNetwork(pBuffer); - pRecipe.modifier1.toNetwork(pBuffer); - pRecipe.modifier2.toNetwork(pBuffer); - pRecipe.modifier3.toNetwork(pBuffer); - pRecipe.modifier4.toNetwork(pBuffer); + pBuffer.writeVarInt(pRecipe.modifiers.size()); + for (Ingredient modifier : pRecipe.modifiers) { + modifier.toNetwork(pBuffer); + } pBuffer.writeInt(pRecipe.energyPerStand); pBuffer.writeInt(pRecipe.particleColor); pBuffer.writeInt(pRecipe.time); } } - - public static class Result implements FinishedRecipe { - private final ResourceLocation id; - private final Ingredient base; - private final Ingredient mod1; - private final Ingredient mod2; - private final Ingredient mod3; - private final Ingredient mod4; - private final int energy; - private final int color; - private final int time; - private final ItemLike output; - - public Result(ResourceLocation id, ItemLike output, Ingredient input, Ingredient modifier1, Ingredient modifier2, Ingredient modifier3, Ingredient modifier4, int energyPerStand, int particleColor, int time) { - this.id = id; - this.base = input; - this.output = output; - this.mod1 = modifier1; - this.mod2 = modifier2; - this.mod3 = modifier3; - this.mod4 = modifier4; - this.energy = energyPerStand; - this.color = particleColor; - this.time = time; - } - - @Override - public void serializeRecipeData(JsonObject pJson) { - pJson.add("base", base.toJson()); - - JsonArray modifiers = new JsonArray(); - - modifiers.add(mod1.toJson()); - modifiers.add(mod2.toJson()); - modifiers.add(mod3.toJson()); - modifiers.add(mod4.toJson()); - - pJson.add("modifiers", modifiers); - pJson.addProperty("energy", energy); - pJson.addProperty("time", time); - pJson.addProperty("color", color); - - JsonObject resultObject = new JsonObject(); - resultObject.addProperty("item", ForgeRegistries.ITEMS.getKey(output.asItem()).toString()); - - pJson.add("result", resultObject); - } - - @Override - @Nonnull - public ResourceLocation getId() { - return id; - } - - @Override - @Nonnull - public RecipeSerializer getType() { - return ActuallyRecipes.EMPOWERING_RECIPE.get(); - } - - @Nullable - @Override - public JsonObject serializeAdvancement() { - return null; - } - - @Nullable - @Override - public ResourceLocation getAdvancementId() { - return null; - } - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/FermentingRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/FermentingRecipe.java index 87294bd72..538495e15 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/FermentingRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/FermentingRecipe.java @@ -1,22 +1,17 @@ package de.ellpeck.actuallyadditions.mod.crafting; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import de.ellpeck.actuallyadditions.mod.inventory.gui.FluidDisplay; import net.minecraft.core.RegistryAccess; -import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.util.GsonHelper; 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 net.minecraft.world.level.material.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.fluids.FluidStack; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -24,7 +19,6 @@ import java.util.Optional; public class FermentingRecipe implements Recipe { public static final String NAME = "fermenting"; - private final ResourceLocation ID; private final FluidStack input; private final FluidStack output; private final int time; @@ -32,8 +26,7 @@ public class FermentingRecipe implements Recipe { private Optional inputDisplay; private Optional outputDisplay; - public FermentingRecipe(ResourceLocation ID, FluidStack input, FluidStack output, int timeIn) { - this.ID = ID; + public FermentingRecipe(FluidStack input, FluidStack output, int timeIn) { this.input = input; this.output = output; this.time = timeIn; @@ -102,12 +95,6 @@ public class FermentingRecipe implements Recipe { return ItemStack.EMPTY; } - @Nonnull - @Override - public ResourceLocation getId() { - return ID; - } - @Nonnull @Override public RecipeSerializer getSerializer() { @@ -121,110 +108,62 @@ public class FermentingRecipe implements Recipe { } public static class Serializer implements RecipeSerializer { - @Nonnull + private static final Codec CODEC = RecordCodecBuilder.create( + instance -> instance.group( + FluidStack.CODEC.fieldOf("ingredient").forGetter(recipe -> recipe.input), + FluidStack.CODEC.fieldOf("result").forGetter(recipe -> recipe.output), + Codec.INT.fieldOf("time").forGetter(recipe -> recipe.time) + ) + .apply(instance, FermentingRecipe::new) + ); + +// @Nonnull +// @Override +// public FermentingRecipe fromJson(@Nonnull ResourceLocation pRecipeId, @Nonnull JsonObject pJson) { +// JsonObject ingredient = pJson.getAsJsonObject("ingredient"); +// +// ResourceLocation fluidRes = new ResourceLocation(GsonHelper.getAsString(ingredient, "fluid")); +// Fluid fluid = BuiltInRegistries.FLUIDS.getValue(fluidRes); +// if (fluid == null) +// throw new JsonParseException("Unknown fluid '" + fluidRes + "'"); +// int inputAmount = GsonHelper.getAsInt(ingredient, "amount", 80); +// FluidStack input = new FluidStack(fluid, inputAmount); +// +// JsonObject result = pJson.getAsJsonObject("result"); +// ResourceLocation fluidOutputRes = new ResourceLocation(GsonHelper.getAsString(result, "fluid")); +// int outputAmount = GsonHelper.getAsInt(result, "amount"); +// Fluid fluidOutput = BuiltInRegistries.FLUIDS.getValue(fluidOutputRes); +// if(fluidOutput == null) +// throw new JsonParseException("Unknown fluid '" + fluidRes + "'"); +// FluidStack output = new FluidStack(fluidOutput, outputAmount); +// +// int time = GsonHelper.getAsInt(pJson, "time", 100); +// +// return new FermentingRecipe(pRecipeId, input, output, time); +// } + + @Override - public FermentingRecipe fromJson(@Nonnull ResourceLocation pRecipeId, @Nonnull JsonObject pJson) { - JsonObject ingredient = pJson.getAsJsonObject("ingredient"); - - ResourceLocation fluidRes = new ResourceLocation(GsonHelper.getAsString(ingredient, "fluid")); - Fluid fluid = ForgeRegistries.FLUIDS.getValue(fluidRes); - if (fluid == null) - throw new JsonParseException("Unknown fluid '" + fluidRes + "'"); - int inputAmount = GsonHelper.getAsInt(ingredient, "amount", 80); - FluidStack input = new FluidStack(fluid, inputAmount); - - JsonObject result = pJson.getAsJsonObject("result"); - ResourceLocation fluidOutputRes = new ResourceLocation(GsonHelper.getAsString(result, "fluid")); - int outputAmount = GsonHelper.getAsInt(result, "amount"); - Fluid fluidOutput = ForgeRegistries.FLUIDS.getValue(fluidOutputRes); - if(fluidOutput == null) - throw new JsonParseException("Unknown fluid '" + fluidRes + "'"); - FluidStack output = new FluidStack(fluidOutput, outputAmount); - - int time = GsonHelper.getAsInt(pJson, "time", 100); - - return new FermentingRecipe(pRecipeId, input, output, time); + public Codec codec() { + return CODEC; } @Nullable @Override - public FermentingRecipe fromNetwork(@Nonnull ResourceLocation pRecipeId, @Nonnull FriendlyByteBuf pBuffer) { - ResourceLocation inputRes = new ResourceLocation(pBuffer.readUtf()); - int inputAmount = pBuffer.readInt(); - Fluid inputFluid = ForgeRegistries.FLUIDS.getValue(inputRes); - if(inputFluid == null) - throw new JsonParseException("Unknown input fluid '" + inputRes + "'"); - FluidStack input = new FluidStack(inputFluid, inputAmount); - - ResourceLocation outputRes = new ResourceLocation(pBuffer.readUtf()); - int outputAmount = pBuffer.readInt(); - Fluid outputFluid = ForgeRegistries.FLUIDS.getValue(outputRes); - if(outputFluid == null) - throw new JsonParseException("Unknown output fluid '" + outputRes + "'"); - FluidStack output = new FluidStack(outputFluid, outputAmount); - + public FermentingRecipe fromNetwork(@Nonnull FriendlyByteBuf pBuffer) { + FluidStack input = FluidStack.readFromPacket(pBuffer); + FluidStack output = FluidStack.readFromPacket(pBuffer); int time = pBuffer.readInt(); - return new FermentingRecipe(pRecipeId, input, output, time); + return new FermentingRecipe(input, output, time); } @Override public void toNetwork(@Nonnull FriendlyByteBuf pBuffer, @Nonnull FermentingRecipe pRecipe) { - pBuffer.writeUtf(ForgeRegistries.FLUIDS.getKey(pRecipe.input.getFluid()).toString()); - pBuffer.writeInt(pRecipe.input.getAmount()); - pBuffer.writeUtf(ForgeRegistries.FLUIDS.getKey(pRecipe.output.getFluid()).toString()); + pRecipe.input.writeToPacket(pBuffer); + pRecipe.output.writeToPacket(pBuffer); pBuffer.writeInt(pRecipe.output.getAmount()); pBuffer.writeInt(pRecipe.time); } } - public static class Result implements FinishedRecipe { - private final ResourceLocation ID; - private final FluidStack input; - private final FluidStack output; - private final int time; - - public Result(ResourceLocation ID, FluidStack input, FluidStack output, int timeIn) { - this.ID = ID; - this.input = input; - this.output = output; - this.time = timeIn; - } - - @Override - public void serializeRecipeData(JsonObject pJson) { - JsonObject ingredient = new JsonObject(); - ingredient.addProperty("fluid", ForgeRegistries.FLUIDS.getKey(input.getFluid()).toString()); - ingredient.addProperty("amount", input.getAmount()); - - JsonObject result = new JsonObject(); - result.addProperty("fluid", ForgeRegistries.FLUIDS.getKey(output.getFluid()).toString()); - result.addProperty("amount", output.getAmount()); - - pJson.add("ingredient", ingredient); - pJson.add("result", result); - pJson.addProperty("time", time); - } - - @Override - public ResourceLocation getId() { - return ID; - } - - @Override - public RecipeSerializer getType() { - return ActuallyRecipes.FERMENTING_RECIPE.get(); - } - - @Nullable - @Override - public JsonObject serializeAdvancement() { - return null; - } - - @Nullable - @Override - public ResourceLocation getAdvancementId() { - return null; - } - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/LaserRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/LaserRecipe.java index 19a46bff8..de7087b7f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/LaserRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/LaserRecipe.java @@ -1,21 +1,18 @@ package de.ellpeck.actuallyadditions.mod.crafting; -import com.google.gson.JsonObject; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import net.minecraft.core.RegistryAccess; -import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.util.GsonHelper; import net.minecraft.world.Container; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.RecipeHolder; 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.minecraftforge.registries.ForgeRegistries; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -27,13 +24,11 @@ public class LaserRecipe implements Recipe { private ItemStack result; private Ingredient itemIngredient; private int energy; - private ResourceLocation id; - public LaserRecipe(ResourceLocation id, ItemStack result, Ingredient itemIngredient, int energy) { + public LaserRecipe(ItemStack result, Ingredient itemIngredient, int energy) { this.result = result; this.itemIngredient = itemIngredient; this.energy = energy; - this.id = id; } public int getEnergy() { @@ -78,11 +73,6 @@ public class LaserRecipe implements Recipe { return result; } - @Override - public ResourceLocation getId() { - return id; - } - @Override public RecipeSerializer getSerializer() { return ActuallyRecipes.LASER_RECIPE.get(); @@ -93,8 +83,8 @@ public class LaserRecipe implements Recipe { return ActuallyRecipes.Types.LASER.get(); } - public static Optional getRecipeForStack(ItemStack stack) { - return ActuallyAdditionsAPI.CONVERSION_LASER_RECIPES.stream().filter(recipe -> recipe.matches(stack)).findFirst(); + public static Optional> getRecipeForStack(ItemStack stack) { + return ActuallyAdditionsAPI.CONVERSION_LASER_RECIPES.stream().filter(recipe -> recipe.value().matches(stack)).findFirst(); } public boolean validInput(ItemStack stack) { @@ -102,23 +92,38 @@ public class LaserRecipe implements Recipe { } public static class Serializer implements RecipeSerializer { - @Override - public LaserRecipe fromJson(@Nonnull ResourceLocation pRecipeId, @Nonnull JsonObject pJson) { - Ingredient ingredient = Ingredient.fromJson(GsonHelper.getAsJsonObject(pJson, "ingredient")); - int energy = GsonHelper.getAsInt(pJson, "energy"); - JsonObject resultObject = GsonHelper.getAsJsonObject(pJson, "result"); - ItemStack result = new ItemStack(GsonHelper.getAsItem(resultObject, "item")); + private static final Codec CODEC = RecordCodecBuilder.create( + instance -> instance.group( + ItemStack.RESULT_CODEC.fieldOf("result").forGetter(recipe -> recipe.result), + Ingredient.CODEC_NONEMPTY.fieldOf("ingredient").forGetter(recipe -> recipe.itemIngredient), + Codec.INT.fieldOf("energy").forGetter(recipe -> recipe.energy) + ) + .apply(instance, LaserRecipe::new) + ); - return new LaserRecipe(pRecipeId, result, ingredient, energy); +// @Override +// public LaserRecipe fromJson(@Nonnull ResourceLocation pRecipeId, @Nonnull JsonObject pJson) { +// Ingredient ingredient = Ingredient.fromJson(GsonHelper.getAsJsonObject(pJson, "ingredient")); +// int energy = GsonHelper.getAsInt(pJson, "energy"); +// JsonObject resultObject = GsonHelper.getAsJsonObject(pJson, "result"); +// ItemStack result = new ItemStack(GsonHelper.getAsItem(resultObject, "item")); +// +// return new LaserRecipe(pRecipeId, result, ingredient, energy); +// } + + + @Override + public Codec codec() { + return CODEC; } @Nullable @Override - public LaserRecipe fromNetwork(@Nonnull ResourceLocation pRecipeId, @Nonnull FriendlyByteBuf pBuffer) { + public LaserRecipe fromNetwork(@Nonnull FriendlyByteBuf pBuffer) { Ingredient ingredient = Ingredient.fromNetwork(pBuffer); int energy = pBuffer.readInt(); ItemStack result = pBuffer.readItem(); - return new LaserRecipe(pRecipeId, result, ingredient, energy); + return new LaserRecipe(result, ingredient, energy); } @Override @@ -128,51 +133,4 @@ public class LaserRecipe implements Recipe { pBuffer.writeItem(pRecipe.result); } } - - public static class Result implements FinishedRecipe { - private ResourceLocation id; - private Ingredient itemIngredient; - private int energy; - private ItemLike output; - - public Result(ResourceLocation id, Ingredient itemIngredient, int energy, ItemLike output) { - this.id = id; - this.itemIngredient = itemIngredient; - this.energy = energy; - this.output = output; - } - - @Override - public void serializeRecipeData(JsonObject pJson) { - pJson.add("ingredient", itemIngredient.toJson()); - pJson.addProperty("energy", energy); - - JsonObject resultObject = new JsonObject(); - resultObject.addProperty("item", ForgeRegistries.ITEMS.getKey(output.asItem()).toString()); - - pJson.add("result", resultObject); - } - - @Override - public ResourceLocation getId() { - return id; - } - - @Override - public RecipeSerializer getType() { - return ActuallyRecipes.LASER_RECIPE.get(); - } - - @Nullable - @Override - public JsonObject serializeAdvancement() { - return null; - } - - @Nullable - @Override - public ResourceLocation getAdvancementId() { - return null; - } - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/LiquidFuelRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/LiquidFuelRecipe.java index ccd19def2..66bca25d9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/LiquidFuelRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/LiquidFuelRecipe.java @@ -1,44 +1,35 @@ package de.ellpeck.actuallyadditions.mod.crafting; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.core.RegistryAccess; -import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.util.GsonHelper; 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 net.minecraft.world.level.material.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.fluids.FluidStack; import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class LiquidFuelRecipe implements Recipe { public static String NAME = "liquid_fuel"; private FluidStack fuel; private int burnTime; private int totalEnergy; - private ResourceLocation id; /** * Oil generator recipe - * @param id ResourceLocation of the recipe * @param fuel The fluid * @param totalEnergy The total power generated. * @param burnTime The length the fluid burns for, in ticks. */ - public LiquidFuelRecipe(ResourceLocation id, FluidStack fuel, int totalEnergy, int burnTime) { + public LiquidFuelRecipe( FluidStack fuel, int totalEnergy, int burnTime) { this.fuel = fuel; this.burnTime = burnTime; this.totalEnergy = totalEnergy; - this.id = id; } public int getBurnTime() { @@ -88,12 +79,6 @@ public class LiquidFuelRecipe implements Recipe { return ItemStack.EMPTY; } - @Nonnull - @Override - public ResourceLocation getId() { - return id; - } - @Nonnull @Override public RecipeSerializer getSerializer() { @@ -107,96 +92,51 @@ public class LiquidFuelRecipe implements Recipe { } public static class Serializer implements RecipeSerializer { - @Nonnull + private static final Codec CODEC = RecordCodecBuilder.create( + instance -> instance.group( + FluidStack.CODEC.fieldOf("fuel").forGetter(recipe -> recipe.fuel), + Codec.INT.fieldOf("total_energy").forGetter(recipe -> recipe.burnTime), + Codec.INT.fieldOf("burn_time").forGetter(recipe -> recipe.totalEnergy) + ) + .apply(instance, LiquidFuelRecipe::new) + ); + +// @Nonnull +// @Override +// public LiquidFuelRecipe fromJson(@Nonnull ResourceLocation pId, JsonObject pJson) { +// JsonObject ingredient = pJson.getAsJsonObject("ingredient"); +// +// ResourceLocation fluidRes = new ResourceLocation(GsonHelper.getAsString(ingredient, "fluid")); +// Fluid fluid = BuiltInRegistries.FLUIDS.getValue(fluidRes); +// if (fluid == null) +// throw new JsonParseException("Unknown fluid '" + fluidRes + "'"); +// int inputAmount = GsonHelper.getAsInt(ingredient, "amount", 50); +// FluidStack input = new FluidStack(fluid, inputAmount); +// +// JsonObject result = pJson.getAsJsonObject("result"); +// int totalEnergy = result.get("total_energy").getAsInt(); +// int burnTime = result.get("burn_time").getAsInt(); +// return new LiquidFuelRecipe(pId, input, totalEnergy, burnTime); +// } + @Override - public LiquidFuelRecipe fromJson(@Nonnull ResourceLocation pId, JsonObject pJson) { - JsonObject ingredient = pJson.getAsJsonObject("ingredient"); - - ResourceLocation fluidRes = new ResourceLocation(GsonHelper.getAsString(ingredient, "fluid")); - Fluid fluid = ForgeRegistries.FLUIDS.getValue(fluidRes); - if (fluid == null) - throw new JsonParseException("Unknown fluid '" + fluidRes + "'"); - int inputAmount = GsonHelper.getAsInt(ingredient, "amount", 50); - FluidStack input = new FluidStack(fluid, inputAmount); - - JsonObject result = pJson.getAsJsonObject("result"); - int totalEnergy = result.get("total_energy").getAsInt(); - int burnTime = result.get("burn_time").getAsInt(); - return new LiquidFuelRecipe(pId, input, totalEnergy, burnTime); + public Codec codec() { + return CODEC; } @Override - public LiquidFuelRecipe fromNetwork(@Nonnull ResourceLocation pId, @Nonnull FriendlyByteBuf pBuffer) { - ResourceLocation inputRes = new ResourceLocation(pBuffer.readUtf()); - int inputAmount = pBuffer.readInt(); - Fluid inputFluid = ForgeRegistries.FLUIDS.getValue(inputRes); - if(inputFluid == null) - throw new JsonParseException("Unknown input fluid '" + inputRes + "'"); - FluidStack input = new FluidStack(inputFluid, inputAmount); - + public LiquidFuelRecipe fromNetwork(@Nonnull FriendlyByteBuf pBuffer) { + FluidStack input = FluidStack.readFromPacket(pBuffer); int totalEnergy = pBuffer.readInt(); int burnTime = pBuffer.readInt(); - return new LiquidFuelRecipe(pId, input, totalEnergy, burnTime); + return new LiquidFuelRecipe(input, totalEnergy, burnTime); } @Override public void toNetwork(@Nonnull FriendlyByteBuf pBuffer, LiquidFuelRecipe pRecipe) { - pBuffer.writeUtf(ForgeRegistries.FLUIDS.getKey(pRecipe.fuel.getFluid()).toString()); - pBuffer.writeInt(pRecipe.fuel.getAmount()); + pRecipe.fuel.writeToPacket(pBuffer); pBuffer.writeInt(pRecipe.totalEnergy); pBuffer.writeInt(pRecipe.burnTime); } } - - public static class Result implements FinishedRecipe { - private FluidStack fuel; - private int burnTime; - private int totalEnergy; - private ResourceLocation id; - - public Result(ResourceLocation id, FluidStack fuel, int totalEnergy, int burnTime) { - this.fuel = fuel; - this.burnTime = burnTime; - this.totalEnergy = totalEnergy; - this.id = id; - } - - @Override - public void serializeRecipeData(JsonObject pJson) { - JsonObject ingredient = new JsonObject(); - ingredient.addProperty("fluid", ForgeRegistries.FLUIDS.getKey(fuel.getFluid()).toString()); - ingredient.addProperty("amount", fuel.getAmount()); - - JsonObject result = new JsonObject(); - result.addProperty("total_energy", totalEnergy); - result.addProperty("burn_time", burnTime); - - pJson.add("ingredient", ingredient); - pJson.add("result", result); - } - - @Nonnull - @Override - public ResourceLocation getId() { - return id; - } - - @Nonnull - @Override - public RecipeSerializer getType() { - return ActuallyRecipes.LIQUID_FUEL_RECIPE.get(); - } - - @Nullable - @Override - public JsonObject serializeAdvancement() { - return null; - } - - @Nullable - @Override - public ResourceLocation getAdvancementId() { - return null; - } - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/MiningLensRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/MiningLensRecipe.java index aab82a228..8b13378b5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/MiningLensRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/MiningLensRecipe.java @@ -1,11 +1,9 @@ package de.ellpeck.actuallyadditions.mod.crafting; -import com.google.gson.JsonObject; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.core.RegistryAccess; -import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.util.GsonHelper; import net.minecraft.util.random.Weight; import net.minecraft.util.random.WeightedEntry; import net.minecraft.world.Container; @@ -14,9 +12,7 @@ import net.minecraft.world.item.crafting.Ingredient; 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.ItemLike; import net.minecraft.world.level.Level; -import net.minecraftforge.registries.ForgeRegistries; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -24,19 +20,16 @@ import javax.annotation.Nullable; public class MiningLensRecipe implements Recipe, WeightedEntry { public static final String NAME = "mining_lens"; - private final ResourceLocation id; private final int weight; private final Ingredient input; //private final int weight; private final ItemStack output; - public MiningLensRecipe(ResourceLocation id, Ingredient input, int weight, ItemStack output) { - super(); + public MiningLensRecipe(Ingredient input, int weight, ItemStack output) { this.weight = weight; this.input = input; //this.weight = weight; this.output = output; - this.id = id; } public Weight getWeight() { @@ -77,11 +70,6 @@ public class MiningLensRecipe implements Recipe, WeightedEntry { return output; } - @Override - public ResourceLocation getId() { - return id; - } - @Override public RecipeSerializer getSerializer() { return ActuallyRecipes.MINING_LENS_RECIPE.get(); @@ -93,23 +81,38 @@ public class MiningLensRecipe implements Recipe, WeightedEntry { } public static class Serializer implements RecipeSerializer { - @Override - public MiningLensRecipe fromJson(@Nonnull ResourceLocation pRecipeId, @Nonnull JsonObject pJson) { - Ingredient ingredient = Ingredient.fromJson(GsonHelper.getAsJsonObject(pJson, "ingredient")); - int weight = GsonHelper.getAsInt(pJson, "weight"); - JsonObject resultObject = GsonHelper.getAsJsonObject(pJson, "result"); - ItemStack result = new ItemStack(GsonHelper.getAsItem(resultObject, "item")); + private static final Codec CODEC = RecordCodecBuilder.create( + instance -> instance.group( + Ingredient.CODEC_NONEMPTY.fieldOf("ingredient").forGetter(recipe -> recipe.input), + Codec.INT.fieldOf("weight").forGetter(recipe -> recipe.weight), + ItemStack.RESULT_CODEC.fieldOf("result").forGetter(recipe -> recipe.output) + ) + .apply(instance, MiningLensRecipe::new) + ); - return new MiningLensRecipe(pRecipeId, ingredient, weight, result); +// @Override +// public MiningLensRecipe fromJson(@Nonnull ResourceLocation pRecipeId, @Nonnull JsonObject pJson) { +// Ingredient ingredient = Ingredient.fromJson(GsonHelper.getAsJsonObject(pJson, "ingredient")); +// int weight = GsonHelper.getAsInt(pJson, "weight"); +// JsonObject resultObject = GsonHelper.getAsJsonObject(pJson, "result"); +// ItemStack result = new ItemStack(GsonHelper.getAsItem(resultObject, "item")); +// +// return new MiningLensRecipe(pRecipeId, ingredient, weight, result); +// } + + + @Override + public Codec codec() { + return CODEC; } @Nullable @Override - public MiningLensRecipe fromNetwork(@Nonnull ResourceLocation pRecipeId, @Nonnull FriendlyByteBuf pBuffer) { + public MiningLensRecipe fromNetwork(@Nonnull FriendlyByteBuf pBuffer) { Ingredient ingredient = Ingredient.fromNetwork(pBuffer); int weight = pBuffer.readInt(); ItemStack result = pBuffer.readItem(); - return new MiningLensRecipe(pRecipeId, ingredient, weight, result); + return new MiningLensRecipe(ingredient, weight, result); } @Override @@ -119,51 +122,4 @@ public class MiningLensRecipe implements Recipe, WeightedEntry { pBuffer.writeItem(pRecipe.output); } } - - public static class Result implements FinishedRecipe { - private final ResourceLocation id; - private final Ingredient itemIngredient; - private final int weight; - private final ItemLike output; - - public Result(ResourceLocation id, Ingredient itemIngredient, int weight, ItemLike output) { - this.id = id; - this.itemIngredient = itemIngredient; - this.weight = weight; - this.output = output; - } - - @Override - public void serializeRecipeData(JsonObject pJson) { - pJson.add("ingredient", itemIngredient.toJson()); - pJson.addProperty("weight", weight); - - JsonObject resultObject = new JsonObject(); - resultObject.addProperty("item", ForgeRegistries.ITEMS.getKey(output.asItem()).toString()); - - pJson.add("result", resultObject); - } - - @Override - public ResourceLocation getId() { - return id; - } - - @Override - public RecipeSerializer getType() { - return ActuallyRecipes.MINING_LENS_RECIPE.get(); - } - - @Nullable - @Override - public JsonObject serializeAdvancement() { - return null; - } - - @Nullable - @Override - public ResourceLocation getAdvancementId() { - return null; - } - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/PressingRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/PressingRecipe.java index 14616115e..b153d714a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/PressingRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/PressingRecipe.java @@ -1,12 +1,9 @@ package de.ellpeck.actuallyadditions.mod.crafting; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.core.RegistryAccess; -import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.util.GsonHelper; import net.minecraft.world.Container; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; @@ -14,21 +11,17 @@ 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 net.minecraft.world.level.material.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.fluids.FluidStack; import javax.annotation.Nonnull; import javax.annotation.Nullable; public class PressingRecipe implements Recipe { public static final String NAME = "pressing"; - private final ResourceLocation ID; private final Ingredient input; private final FluidStack output; - public PressingRecipe(ResourceLocation ID, Ingredient input, FluidStack output) { - this.ID = ID; + public PressingRecipe(Ingredient input, FluidStack output) { this.input = input; this.output = output; } @@ -62,11 +55,6 @@ public class PressingRecipe implements Recipe { return ItemStack.EMPTY; } - @Override - public ResourceLocation getId() { - return ID; - } - @Override public RecipeSerializer getSerializer() { return ActuallyRecipes.PRESSING_RECIPE.get(); @@ -78,82 +66,47 @@ public class PressingRecipe implements Recipe { } public static class Serializer implements RecipeSerializer { - @Nonnull - @Override - public PressingRecipe fromJson(@Nonnull ResourceLocation pRecipeId, @Nonnull JsonObject pJson) { - Ingredient ingredient = Ingredient.fromJson(GsonHelper.getAsJsonObject(pJson, "ingredient")); - JsonObject result = pJson.getAsJsonObject("result"); - ResourceLocation fluidRes = new ResourceLocation(GsonHelper.getAsString(result, "fluid")); - int fluidAmount = GsonHelper.getAsInt(result, "amount"); - Fluid fluid = ForgeRegistries.FLUIDS.getValue(fluidRes); - if(fluid == null) - throw new JsonParseException("Unknown fluid '" + fluidRes + "'"); - FluidStack output = new FluidStack(fluid, fluidAmount); + private static final Codec CODEC = RecordCodecBuilder.create( + instance -> instance.group( + Ingredient.CODEC_NONEMPTY.fieldOf("ingredient").forGetter(recipe -> recipe.input), + FluidStack.CODEC.fieldOf("fluid").forGetter(recipe -> recipe.output) + ) + .apply(instance, PressingRecipe::new) + ); - return new PressingRecipe(pRecipeId, ingredient, output); +// @Nonnull +// @Override +// public PressingRecipe fromJson(@Nonnull ResourceLocation pRecipeId, @Nonnull JsonObject pJson) { +// Ingredient ingredient = Ingredient.fromJson(GsonHelper.getAsJsonObject(pJson, "ingredient")); +// JsonObject result = pJson.getAsJsonObject("result"); +// ResourceLocation fluidRes = new ResourceLocation(GsonHelper.getAsString(result, "fluid")); +// int fluidAmount = GsonHelper.getAsInt(result, "amount"); +// Fluid fluid = BuiltInRegistries.FLUIDS.getValue(fluidRes); +// if(fluid == null) +// throw new JsonParseException("Unknown fluid '" + fluidRes + "'"); +// FluidStack output = new FluidStack(fluid, fluidAmount); +// +// return new PressingRecipe(pRecipeId, ingredient, output); +// } + + @Override + public Codec codec() { + return CODEC; } @Nullable @Override - public PressingRecipe fromNetwork(@Nonnull ResourceLocation pRecipeId, @Nonnull FriendlyByteBuf pBuffer) { + public PressingRecipe fromNetwork(@Nonnull FriendlyByteBuf pBuffer) { Ingredient ingredient = Ingredient.fromNetwork(pBuffer); - ResourceLocation fluidRes = new ResourceLocation(pBuffer.readUtf()); - int fluidAmount = pBuffer.readInt(); - Fluid fluid = ForgeRegistries.FLUIDS.getValue(fluidRes); - if(fluid == null) - throw new JsonParseException("Unknown fluid '" + fluidRes + "'"); - FluidStack output = new FluidStack(fluid, fluidAmount); + FluidStack output = FluidStack.readFromPacket(pBuffer); - return new PressingRecipe(pRecipeId, ingredient, output); + return new PressingRecipe(ingredient, output); } @Override public void toNetwork(@Nonnull FriendlyByteBuf pBuffer, @Nonnull PressingRecipe pRecipe) { pRecipe.input.toNetwork(pBuffer); - pBuffer.writeUtf(ForgeRegistries.FLUIDS.getKey(pRecipe.output.getFluid()).toString()); - pBuffer.writeInt(pRecipe.output.getAmount()); - } - } - public static class Result implements FinishedRecipe { - private final ResourceLocation ID; - private final Ingredient input; - private final FluidStack output; - - public Result(ResourceLocation ID, Ingredient input, FluidStack output) { - this.ID = ID; - this.input = input; - this.output = output; - } - - @Override - public void serializeRecipeData(JsonObject pJson) { - pJson.add("ingredient", input.toJson()); - JsonObject result = new JsonObject(); - result.addProperty("fluid", ForgeRegistries.FLUIDS.getKey(output.getFluid()).toString()); - result.addProperty("amount", output.getAmount()); - pJson.add("result", result); - } - - @Override - public ResourceLocation getId() { - return ID; - } - - @Override - public RecipeSerializer getType() { - return ActuallyRecipes.PRESSING_RECIPE.get(); - } - - @Nullable - @Override - public JsonObject serializeAdvancement() { - return null; - } - - @Nullable - @Override - public ResourceLocation getAdvancementId() { - return null; + pRecipe.output.writeToPacket(pBuffer); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/SolidFuelRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/SolidFuelRecipe.java index 6b4085979..b3389be30 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/SolidFuelRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/SolidFuelRecipe.java @@ -1,10 +1,9 @@ package de.ellpeck.actuallyadditions.mod.crafting; -import com.google.gson.JsonObject; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.core.RegistryAccess; -import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.Recipe; @@ -12,20 +11,16 @@ import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.Level; -import javax.annotation.Nullable; - public class SolidFuelRecipe implements Recipe { public static String NAME = "solid_fuel"; private Ingredient itemIngredient; private int burnTime; private int totalEnergy; - private ResourceLocation id; - public SolidFuelRecipe(ResourceLocation id, Ingredient itemIngredient, int totalEnergy, int burnTime) { + public SolidFuelRecipe(Ingredient itemIngredient, int totalEnergy, int burnTime) { this.itemIngredient = itemIngredient; this.burnTime = burnTime; this.totalEnergy = totalEnergy; - this.id = id; } public int getBurnTime() { @@ -65,11 +60,6 @@ public class SolidFuelRecipe implements Recipe { return ItemStack.EMPTY; } - @Override - public ResourceLocation getId() { - return id; - } - @Override public RecipeSerializer getSerializer() { return ActuallyRecipes.SOLID_FUEL_RECIPE.get(); @@ -81,20 +71,35 @@ public class SolidFuelRecipe implements Recipe { } public static class Serializer implements RecipeSerializer { + private static final Codec CODEC = RecordCodecBuilder.create( + instance -> instance.group( + Ingredient.CODEC_NONEMPTY.fieldOf("item").forGetter(recipe -> recipe.itemIngredient), + Codec.INT.fieldOf("total_energy").forGetter(recipe -> recipe.totalEnergy), + Codec.INT.fieldOf("burn_time").forGetter(recipe -> recipe.burnTime) + ) + .apply(instance, SolidFuelRecipe::new) + ); + +// @Override +// public SolidFuelRecipe fromJson(ResourceLocation pId, JsonObject pJson) { +// Ingredient itemIngredient = Ingredient.fromJson(pJson.get("item")); +// int totalEnergy = pJson.get("total_energy").getAsInt(); +// int burnTime = pJson.get("burn_time").getAsInt(); +// return new SolidFuelRecipe(pId, itemIngredient, totalEnergy, burnTime); +// } + + @Override - public SolidFuelRecipe fromJson(ResourceLocation pId, JsonObject pJson) { - Ingredient itemIngredient = Ingredient.fromJson(pJson.get("item")); - int totalEnergy = pJson.get("total_energy").getAsInt(); - int burnTime = pJson.get("burn_time").getAsInt(); - return new SolidFuelRecipe(pId, itemIngredient, totalEnergy, burnTime); + public Codec codec() { + return CODEC; } @Override - public SolidFuelRecipe fromNetwork(ResourceLocation pId, FriendlyByteBuf pBuffer) { + public SolidFuelRecipe fromNetwork(FriendlyByteBuf pBuffer) { Ingredient itemIngredient = Ingredient.fromNetwork(pBuffer); int totalEnergy = pBuffer.readInt(); int burnTime = pBuffer.readInt(); - return new SolidFuelRecipe(pId, itemIngredient, totalEnergy, burnTime); + return new SolidFuelRecipe(itemIngredient, totalEnergy, burnTime); } @Override @@ -104,47 +109,4 @@ public class SolidFuelRecipe implements Recipe { pBuffer.writeInt(pRecipe.burnTime); } } - - public static class Result implements FinishedRecipe { - private Ingredient itemIngredient; - private int burnTime; - private int totalEnergy; - private ResourceLocation id; - - public Result(ResourceLocation id, Ingredient itemIngredient, int totalEnergy, int burnTime) { - this.itemIngredient = itemIngredient; - this.burnTime = burnTime; - this.totalEnergy = totalEnergy; - this.id = id; - } - - @Override - public void serializeRecipeData(JsonObject pJson) { - pJson.add("item", itemIngredient.toJson()); - pJson.addProperty("total_energy", totalEnergy); - pJson.addProperty("burn_time", burnTime); - } - - @Override - public ResourceLocation getId() { - return id; - } - - @Override - public RecipeSerializer getType() { - return ActuallyRecipes.SOLID_FUEL_RECIPE.get(); - } - - @Nullable - @Override - public JsonObject serializeAdvancement() { - return null; - } - - @Nullable - @Override - public ResourceLocation getAdvancementId() { - return null; - } - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/TargetNBTIngredient.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/TargetNBTIngredient.java index 4c3cd32db..946e41785 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/TargetNBTIngredient.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/TargetNBTIngredient.java @@ -1,75 +1,75 @@ -package de.ellpeck.actuallyadditions.mod.crafting; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.tags.TagKey; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.Ingredient; -import net.minecraft.world.level.ItemLike; -import net.minecraftforge.common.crafting.IIngredientSerializer; - -import javax.annotation.Nonnull; -import java.util.stream.Stream; - -public class TargetNBTIngredient extends Ingredient { - public TargetNBTIngredient(Stream itemLists) { - super(itemLists); - } - - @Override - @Nonnull - public IIngredientSerializer getSerializer() { - return SERIALIZER; - } - - public static TargetNBTIngredient of(ItemLike itemProvider) { - return new TargetNBTIngredient(Stream.of(new ItemValue(new ItemStack(itemProvider)))); - } - public static TargetNBTIngredient of(ItemStack itemStack) { - return new TargetNBTIngredient(Stream.of(new ItemValue(itemStack))); - } - @Nonnull - public static TargetNBTIngredient of(@Nonnull TagKey tag) { - return new TargetNBTIngredient(Stream.of(new TagValue(tag))); - } - - - - @Override - @Nonnull - public JsonElement toJson() { - JsonObject tmp = super.toJson().getAsJsonObject(); - tmp.addProperty("type", Serializer.NAME.toString()); - return tmp; - } - - - public static Serializer SERIALIZER = new Serializer(); - public static class Serializer implements IIngredientSerializer { - public static ResourceLocation NAME = new ResourceLocation(ActuallyAdditions.MODID, "nbt_target"); - - @Override - @Nonnull - public TargetNBTIngredient parse(FriendlyByteBuf buffer) { - return new TargetNBTIngredient(Stream.generate(() -> new ItemValue(buffer.readItem())).limit(buffer.readVarInt())); - } - - @Override - @Nonnull - public TargetNBTIngredient parse(@Nonnull JsonObject json) { - return new TargetNBTIngredient(Stream.of(Ingredient.valueFromJson(json))); - } - - @Override - public void write(FriendlyByteBuf buffer, TargetNBTIngredient ingredient) { - ItemStack[] items = ingredient.getItems(); - buffer.writeVarInt(items.length); - - for (ItemStack stack : items) - buffer.writeItem(stack); - } - } -} +//package de.ellpeck.actuallyadditions.mod.crafting; +// +//import com.google.gson.JsonElement; +//import com.google.gson.JsonObject; +//import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; +//import net.minecraft.network.FriendlyByteBuf; +//import net.minecraft.resources.ResourceLocation; +//import net.minecraft.tags.TagKey; +//import net.minecraft.world.item.ItemStack; +//import net.minecraft.world.item.crafting.Ingredient; +//import net.minecraft.world.level.ItemLike; +//import net.neoforged.neoforge.common.crafting.IIngredientSerializer; +// +//import javax.annotation.Nonnull; +//import java.util.stream.Stream; +// +//public class TargetNBTIngredient extends Ingredient { TODO: FLANKS PLEASE :D +// public TargetNBTIngredient(Stream itemLists) { +// super(itemLists); +// } +// +// @Override +// @Nonnull +// public IIngredientSerializer getSerializer() { +// return SERIALIZER; +// } +// +// public static TargetNBTIngredient of(ItemLike itemProvider) { +// return new TargetNBTIngredient(Stream.of(new ItemValue(new ItemStack(itemProvider)))); +// } +// public static TargetNBTIngredient of(ItemStack itemStack) { +// return new TargetNBTIngredient(Stream.of(new ItemValue(itemStack))); +// } +// @Nonnull +// public static TargetNBTIngredient of(@Nonnull TagKey tag) { +// return new TargetNBTIngredient(Stream.of(new TagValue(tag))); +// } +// +// +// +// @Override +// @Nonnull +// public JsonElement toJson() { +// JsonObject tmp = super.toJson().getAsJsonObject(); +// tmp.addProperty("type", Serializer.NAME.toString()); +// return tmp; +// } +// +// +// public static Serializer SERIALIZER = new Serializer(); +// public static class Serializer implements IIngredientSerializer { +// public static ResourceLocation NAME = new ResourceLocation(ActuallyAdditions.MODID, "nbt_target"); +// +// @Override +// @Nonnull +// public TargetNBTIngredient parse(FriendlyByteBuf buffer) { +// return new TargetNBTIngredient(Stream.generate(() -> new ItemValue(buffer.readItem())).limit(buffer.readVarInt())); +// } +// +// @Override +// @Nonnull +// public TargetNBTIngredient parse(@Nonnull JsonObject json) { +// return new TargetNBTIngredient(Stream.of(Ingredient.valueFromJson(json))); +// } +// +// @Override +// public void write(FriendlyByteBuf buffer, TargetNBTIngredient ingredient) { +// ItemStack[] items = ingredient.getItems(); +// buffer.writeVarInt(items.length); +// +// for (ItemStack stack : items) +// buffer.writeItem(stack); +// } +// } +//} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/WrappedRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/WrappedRecipe.java index 9b202d371..88bad3acf 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/WrappedRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/WrappedRecipe.java @@ -4,7 +4,7 @@ import com.google.gson.JsonObject; import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.crafting.RecipeSerializer; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.registries.BuiltInRegistries; import javax.annotation.Nullable; import java.util.function.Consumer; @@ -36,9 +36,9 @@ public class WrappedRecipe implements FinishedRecipe { JsonObject jsonObject = new JsonObject(); if (serializerOverride != null) - jsonObject.addProperty("type", ForgeRegistries.RECIPE_SERIALIZERS.getKey(serializerOverride).toString()); + jsonObject.addProperty("type", BuiltInRegistries.RECIPE_SERIALIZERS.getKey(serializerOverride).toString()); else - jsonObject.addProperty("type", ForgeRegistries.RECIPE_SERIALIZERS.getKey(inner.getType()).toString()); + jsonObject.addProperty("type", BuiltInRegistries.RECIPE_SERIALIZERS.getKey(inner.getType()).toString()); serializeRecipeData(jsonObject); return jsonObject; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/entity/EntityWorm.java b/src/main/java/de/ellpeck/actuallyadditions/mod/entity/EntityWorm.java index d4abb5856..efb1a8e44 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/entity/EntityWorm.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/entity/EntityWorm.java @@ -13,8 +13,6 @@ package de.ellpeck.actuallyadditions.mod.entity; import de.ellpeck.actuallyadditions.mod.config.CommonConfig; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; -import net.minecraft.network.protocol.Packet; -import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; @@ -27,10 +25,9 @@ import net.minecraft.world.level.block.FarmBlock; import net.minecraft.world.level.block.GrassBlock; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.AABB; -import net.minecraftforge.common.FarmlandWaterManager; -import net.minecraftforge.common.IPlantable; -import net.minecraftforge.common.ticket.AABBTicket; -import net.minecraftforge.network.NetworkHooks; +import net.neoforged.neoforge.common.FarmlandWaterManager; +import net.neoforged.neoforge.common.IPlantable; +import net.neoforged.neoforge.common.ticket.AABBTicket; public class EntityWorm extends Entity { @@ -164,9 +161,4 @@ public class EntityWorm extends Entity { protected void addAdditionalSaveData(CompoundTag compound) { compound.putInt("Timer", this.timer); } - - @Override - public Packet getAddEntityPacket() { - return NetworkHooks.getEntitySpawningPacket(this); - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/entity/InitEntities.java b/src/main/java/de/ellpeck/actuallyadditions/mod/entity/InitEntities.java index 882aedac6..4af063657 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/entity/InitEntities.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/entity/InitEntities.java @@ -11,8 +11,8 @@ package de.ellpeck.actuallyadditions.mod.entity; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; public final class InitEntities { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/entity/RenderWorm.java b/src/main/java/de/ellpeck/actuallyadditions/mod/entity/RenderWorm.java index f589e1619..30ebccf37 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/entity/RenderWorm.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/entity/RenderWorm.java @@ -24,8 +24,8 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.inventory.InventoryMenu; import net.minecraft.world.item.ItemDisplayContext; 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; @OnlyIn(Dist.CLIENT) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java index 2037ff64d..734783e4a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java @@ -33,13 +33,13 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; 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.client.event.RenderGuiOverlayEvent; -import net.minecraftforge.client.gui.overlay.GuiOverlayManager; -import net.minecraftforge.event.TickEvent; -import net.minecraftforge.event.entity.player.ItemTooltipEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.neoforge.client.event.RenderGuiOverlayEvent; +import net.neoforged.neoforge.client.gui.overlay.GuiOverlayManager; +import net.neoforged.neoforge.event.TickEvent; +import net.neoforged.neoforge.event.entity.player.ItemTooltipEvent; @OnlyIn(Dist.CLIENT) public class ClientEvents { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/CommonEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/CommonEvents.java index a3662246b..49b7868f2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/CommonEvents.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/CommonEvents.java @@ -23,6 +23,7 @@ import de.ellpeck.actuallyadditions.mod.tile.FilterSettings; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA; import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.monster.Spider; @@ -30,13 +31,12 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.event.entity.living.LivingDropsEvent; -import net.minecraftforge.event.entity.player.EntityItemPickupEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.event.level.BlockEvent; -import net.minecraftforge.eventbus.api.Event; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.bus.api.Event; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.neoforge.event.entity.living.LivingDropsEvent; +import net.neoforged.neoforge.event.entity.player.EntityItemPickupEvent; +import net.neoforged.neoforge.event.entity.player.PlayerEvent; +import net.neoforged.neoforge.event.level.BlockEvent; import java.util.Locale; @@ -168,7 +168,7 @@ public class CommonEvents { if (CommonConfig.Other.GIVE_BOOKLET_ON_FIRST_CRAFT.get()) { if (!event.getEntity().level().isClientSide && StackUtil.isValid(event.getCrafting()) && event.getCrafting().getItem() != ActuallyItems.ITEM_BOOKLET.get()) { - String name = ForgeRegistries.ITEMS.getKey(event.getCrafting().getItem()).toString(); + String name = BuiltInRegistries.ITEM.getKey(event.getCrafting().getItem()).toString(); if (name != null && name.toLowerCase(Locale.ROOT).contains(ActuallyAdditions.MODID)) { PlayerData.PlayerSave save = PlayerData.getDataFromPlayer(event.getEntity()); if (save != null && !save.bookGottenAlready) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/AATank.java b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/AATank.java index dd05ac97d..2d8d5bf25 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/AATank.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/AATank.java @@ -1,7 +1,7 @@ package de.ellpeck.actuallyadditions.mod.fluids; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.templates.FluidTank; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.capability.templates.FluidTank; import javax.annotation.Nonnull; import java.util.function.Predicate; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/FluidAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/FluidAA.java index 6665b48dd..130619433 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/FluidAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/FluidAA.java @@ -25,11 +25,11 @@ import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.material.FlowingFluid; import net.minecraft.world.level.material.Fluid; import net.minecraft.world.level.pathfinder.BlockPathTypes; -import net.minecraftforge.client.extensions.common.IClientFluidTypeExtensions; -import net.minecraftforge.common.SoundActions; -import net.minecraftforge.fluids.FluidType; -import net.minecraftforge.fluids.ForgeFlowingFluid; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.client.extensions.common.IClientFluidTypeExtensions; +import net.neoforged.neoforge.common.SoundActions; +import net.neoforged.neoforge.fluids.BaseFlowingFluid; +import net.neoforged.neoforge.fluids.FluidType; +import net.neoforged.neoforge.registries.DeferredItem; import java.util.function.Consumer; import java.util.function.Supplier; @@ -38,19 +38,19 @@ public class FluidAA implements Supplier { private String name; private final ResourceLocation stillTexture; private final ResourceLocation flowingTexture; - private RegistryObject fluidType; - private RegistryObject source; - private RegistryObject flowing; - private RegistryObject fluidBlock; - private RegistryObject bucket; + private Supplier fluidType; + private Supplier source; + private Supplier flowing; + private Supplier fluidBlock; + private DeferredItem bucket; public String getName() { return name; } - public static ForgeFlowingFluid.Properties createProperties(Supplier type, Supplier still, Supplier flowing, - RegistryObject bucket, Supplier block) { - return new ForgeFlowingFluid.Properties(type, still, flowing) + public static BaseFlowingFluid.Properties createProperties(Supplier type, Supplier still, Supplier flowing, + DeferredItem bucket, Supplier block) { + return new BaseFlowingFluid.Properties(type, still, flowing) .bucket(bucket).block(block); } @@ -76,9 +76,9 @@ public class FluidAA implements Supplier { } }); - source = InitFluids.FLUIDS.register(name, () -> new ForgeFlowingFluid.Source(createProperties(fluidType, source, flowing, bucket, fluidBlock))); - flowing = InitFluids.FLUIDS.register(name + "_flowing", () -> new ForgeFlowingFluid.Flowing(createProperties(fluidType, source, flowing, bucket, fluidBlock))); - fluidBlock = ActuallyBlocks.BLOCKS.register(name, () -> new LiquidBlock(source, BlockBehaviour.Properties.copy(Blocks.WATER))); + source = InitFluids.FLUIDS.register(name, () -> new BaseFlowingFluid.Source(createProperties(fluidType, source, flowing, bucket, fluidBlock))); + flowing = InitFluids.FLUIDS.register(name + "_flowing", () -> new BaseFlowingFluid.Flowing(createProperties(fluidType, source, flowing, bucket, fluidBlock))); + fluidBlock = ActuallyBlocks.BLOCKS.register(name, () -> new LiquidBlock(source, BlockBehaviour.Properties.ofFullCopy(Blocks.WATER))); bucket = ActuallyItems.ITEMS.register(name + "_bucket", () -> new BucketItem(source, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1))); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java index a828b639c..19981eb37 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java @@ -11,17 +11,17 @@ package de.ellpeck.actuallyadditions.mod.fluids; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import net.minecraft.world.level.block.Block; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.level.material.Fluid; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.fluids.FluidType; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.fluids.FluidType; +import net.neoforged.neoforge.registries.DeferredRegister; +import net.neoforged.neoforge.registries.NeoForgeRegistries; public final class InitFluids { - public static final DeferredRegister FLUIDS = DeferredRegister.create(ForgeRegistries.FLUIDS, ActuallyAdditions.MODID); - public static final DeferredRegister FLUID_TYPES = DeferredRegister.create(ForgeRegistries.Keys.FLUID_TYPES, ActuallyAdditions.MODID); - public static final DeferredRegister FLUID_BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, ActuallyAdditions.MODID); + public static final DeferredRegister FLUIDS = DeferredRegister.create(BuiltInRegistries.FLUID, ActuallyAdditions.MODID); + public static final DeferredRegister FLUID_TYPES = DeferredRegister.create(NeoForgeRegistries.Keys.FLUID_TYPES, ActuallyAdditions.MODID); + public static final DeferredRegister.Blocks FLUID_BLOCKS = DeferredRegister.createBlocks(ActuallyAdditions.MODID); public static final FluidAA CANOLA_OIL = new FluidAA("canola_oil", "fluid/canola_oil"); public static final FluidAA REFINED_CANOLA_OIL = new FluidAA("refined_canola_oil", "fluid/refined_canola_oil"); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/OutputOnlyFluidTank.java b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/OutputOnlyFluidTank.java index ceffa015d..d7dd5bfb4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/OutputOnlyFluidTank.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/OutputOnlyFluidTank.java @@ -1,7 +1,7 @@ package de.ellpeck.actuallyadditions.mod.fluids; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.templates.FluidTank; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.capability.templates.FluidTank; import java.util.function.Predicate; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/BasicTradeList.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/BasicTradeList.java index a19abff19..983d7e3f1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/BasicTradeList.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/BasicTradeList.java @@ -24,18 +24,18 @@ // // private final ItemStack input; // private final PriceInfo inputAmount; -// private final ItemStack output; +// private final ItemStack stack; // private final PriceInfo outputAmount; // -// public BasicTradeList(ItemStack input, PriceInfo inputAmount, ItemStack output, PriceInfo outputAmount) { +// public BasicTradeList(ItemStack input, PriceInfo inputAmount, ItemStack stack, PriceInfo outputAmount) { // this.input = input; // this.inputAmount = inputAmount; -// this.output = output; +// this.stack = stack; // this.outputAmount = outputAmount; // } // -// public BasicTradeList(PriceInfo emeraldInput, ItemStack output, PriceInfo outputAmount) { -// this(new ItemStack(Items.EMERALD), emeraldInput, output, outputAmount); +// public BasicTradeList(PriceInfo emeraldInput, ItemStack stack, PriceInfo outputAmount) { +// this(new ItemStack(Items.EMERALD), emeraldInput, stack, outputAmount); // } // // public BasicTradeList(ItemStack input, PriceInfo inputAmount, PriceInfo emeraldOutput) { @@ -46,7 +46,7 @@ // public void addMerchantRecipe(IMerchant merchant, MerchantRecipeList recipeList, Random random) { // ItemStack in = this.input.copy(); // in.setCount(this.inputAmount.getPrice(random)); -// ItemStack out = this.output.copy(); +// ItemStack out = this.stack.copy(); // out.setCount(this.outputAmount.getPrice(random)); // recipeList.add(new MerchantRecipe(in, out)); // } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ActuallyContainers.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ActuallyContainers.java index 896f8ec26..a83d49703 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ActuallyContainers.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ActuallyContainers.java @@ -1,41 +1,42 @@ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.inventory.MenuType; -import net.minecraftforge.common.extensions.IForgeMenuType; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.common.extensions.IMenuTypeExtension; +import net.neoforged.neoforge.registries.DeferredRegister; + +import java.util.function.Supplier; public class ActuallyContainers { - public static final DeferredRegister> CONTAINERS = DeferredRegister.create(ForgeRegistries.MENU_TYPES, ActuallyAdditions.MODID); + public static final DeferredRegister> CONTAINERS = DeferredRegister.create(BuiltInRegistries.MENU, ActuallyAdditions.MODID); - public static final RegistryObject> BAG_CONTAINER = CONTAINERS.register("bag_container", () -> IForgeMenuType.create(SackContainer::fromNetwork)); - public static final RegistryObject> BIO_REACTOR_CONTAINER = CONTAINERS.register("bioreactor_container", () -> IForgeMenuType.create(ContainerBioReactor::fromNetwork)); - public static final RegistryObject> BREAKER_CONTAINER = CONTAINERS.register("breaker_container", () -> IForgeMenuType.create(ContainerBreaker::fromNetwork)); - public static final RegistryObject> CANOLA_PRESS_CONTAINER = CONTAINERS.register("canola_press_container", () -> IForgeMenuType.create(ContainerCanolaPress::fromNetwork)); - public static final RegistryObject> COAL_GENERATOR_CONTAINER = CONTAINERS.register("coal_generator_container", () -> IForgeMenuType.create(ContainerCoalGenerator::fromNetwork)); - public static final RegistryObject> COFFEE_MACHINE_CONTAINER = CONTAINERS.register("coffee_machine_container", () -> IForgeMenuType.create(ContainerCoffeeMachine::fromNetwork)); - public static final RegistryObject> DIRECTIONAL_BREAKER_CONTAINER = CONTAINERS.register("directional_breaker_container", () -> IForgeMenuType.create(ContainerDirectionalBreaker::fromNetwork)); - public static final RegistryObject> DRILL_CONTAINER = CONTAINERS.register("drill_container", () -> IForgeMenuType.create(ContainerDrill::fromNetwork)); - public static final RegistryObject> DROPPER_CONTAINER = CONTAINERS.register("dropper_container", () -> IForgeMenuType.create(ContainerDropper::fromNetwork)); - public static final RegistryObject> ENERVATOR_CONTAINER = CONTAINERS.register("enervator_container", () -> IForgeMenuType.create(ContainerEnervator::fromNetwork)); - public static final RegistryObject> ENERGIZER_CONTAINER = CONTAINERS.register("energizer_container", () -> IForgeMenuType.create(ContainerEnergizer::fromNetwork)); + public static final Supplier> BAG_CONTAINER = CONTAINERS.register("bag_container", () -> IMenuTypeExtension.create(SackContainer::fromNetwork)); + public static final Supplier> BIO_REACTOR_CONTAINER = CONTAINERS.register("bioreactor_container", () -> IMenuTypeExtension.create(ContainerBioReactor::fromNetwork)); + public static final Supplier> BREAKER_CONTAINER = CONTAINERS.register("breaker_container", () -> IMenuTypeExtension.create(ContainerBreaker::fromNetwork)); + public static final Supplier> CANOLA_PRESS_CONTAINER = CONTAINERS.register("canola_press_container", () -> IMenuTypeExtension.create(ContainerCanolaPress::fromNetwork)); + public static final Supplier> COAL_GENERATOR_CONTAINER = CONTAINERS.register("coal_generator_container", () -> IMenuTypeExtension.create(ContainerCoalGenerator::fromNetwork)); + public static final Supplier> COFFEE_MACHINE_CONTAINER = CONTAINERS.register("coffee_machine_container", () -> IMenuTypeExtension.create(ContainerCoffeeMachine::fromNetwork)); + public static final Supplier> DIRECTIONAL_BREAKER_CONTAINER = CONTAINERS.register("directional_breaker_container", () -> IMenuTypeExtension.create(ContainerDirectionalBreaker::fromNetwork)); + public static final Supplier> DRILL_CONTAINER = CONTAINERS.register("drill_container", () -> IMenuTypeExtension.create(ContainerDrill::fromNetwork)); + public static final Supplier> DROPPER_CONTAINER = CONTAINERS.register("dropper_container", () -> IMenuTypeExtension.create(ContainerDropper::fromNetwork)); + public static final Supplier> ENERVATOR_CONTAINER = CONTAINERS.register("enervator_container", () -> IMenuTypeExtension.create(ContainerEnervator::fromNetwork)); + public static final Supplier> ENERGIZER_CONTAINER = CONTAINERS.register("energizer_container", () -> IMenuTypeExtension.create(ContainerEnergizer::fromNetwork)); - public static final RegistryObject> FARMER_CONTAINER = CONTAINERS.register("farmer_container", () -> IForgeMenuType.create(ContainerFarmer::fromNetwork)); - public static final RegistryObject> FEEDER_CONTAINER = CONTAINERS.register("feeder_container", () -> IForgeMenuType.create(ContainerFeeder::fromNetwork)); - public static final RegistryObject> FERMENTING_BARREL_CONTAINER = CONTAINERS.register("fermenting_barrel_container", () -> IForgeMenuType.create(ContainerFermentingBarrel::fromNetwork)); - public static final RegistryObject> FILTER_CONTAINER = CONTAINERS.register("filter_container", () -> IForgeMenuType.create(ContainerFilter::fromNetwork)); - public static final RegistryObject> FIREWORK_BOX_CONTAINER = CONTAINERS.register("firework_box_container", () -> IForgeMenuType.create(ContainerFireworkBox::fromNetwork)); - public static final RegistryObject> FLUID_COLLECTOR_CONTAINER = CONTAINERS.register("fluid_collector_container", () -> IForgeMenuType.create(ContainerFluidCollector::fromNetwork)); - public static final RegistryObject> FURNACE_DOUBLE_CONTAINER = CONTAINERS.register("furnace_double_container", () -> IForgeMenuType.create(ContainerFurnaceDouble::fromNetwork)); - public static final RegistryObject> GRINDER_CONTAINER = CONTAINERS.register("grinder_container", () -> IForgeMenuType.create(CrusherContainer::fromNetwork)); - public static final RegistryObject> LASER_RELAY_ITEM_WHITELIST_CONTAINER = CONTAINERS.register("laser_relay_item_whitelist_container", () -> IForgeMenuType.create(ContainerLaserRelayItemWhitelist::fromNetwork)); - public static final RegistryObject> MINER_CONTAINER = CONTAINERS.register("miner_container", () -> IForgeMenuType.create(ContainerMiner::fromNetwork)); - public static final RegistryObject> OIL_GENERATOR_CONTAINER = CONTAINERS.register("oil_generator_container", () -> IForgeMenuType.create(ContainerOilGenerator::fromNetwork)); - public static final RegistryObject> PHANTOM_PLACER_CONTAINER = CONTAINERS.register("phantom_placer_container", () -> IForgeMenuType.create(ContainerPhantomPlacer::fromNetwork)); - public static final RegistryObject> RANGED_COLLECTOR_CONTAINER = CONTAINERS.register("ranged_collector_container", () -> IForgeMenuType.create(ContainerRangedCollector::fromNetwork)); - public static final RegistryObject> XPSOLIDIFIER_CONTAINER = CONTAINERS.register("xpsolidifier_container", () -> IForgeMenuType.create(ContainerXPSolidifier::fromNetwork)); + public static final Supplier> FARMER_CONTAINER = CONTAINERS.register("farmer_container", () -> IMenuTypeExtension.create(ContainerFarmer::fromNetwork)); + public static final Supplier> FEEDER_CONTAINER = CONTAINERS.register("feeder_container", () -> IMenuTypeExtension.create(ContainerFeeder::fromNetwork)); + public static final Supplier> FERMENTING_BARREL_CONTAINER = CONTAINERS.register("fermenting_barrel_container", () -> IMenuTypeExtension.create(ContainerFermentingBarrel::fromNetwork)); + public static final Supplier> FILTER_CONTAINER = CONTAINERS.register("filter_container", () -> IMenuTypeExtension.create(ContainerFilter::fromNetwork)); + public static final Supplier> FIREWORK_BOX_CONTAINER = CONTAINERS.register("firework_box_container", () -> IMenuTypeExtension.create(ContainerFireworkBox::fromNetwork)); + public static final Supplier> FLUID_COLLECTOR_CONTAINER = CONTAINERS.register("fluid_collector_container", () -> IMenuTypeExtension.create(ContainerFluidCollector::fromNetwork)); + public static final Supplier> FURNACE_DOUBLE_CONTAINER = CONTAINERS.register("furnace_double_container", () -> IMenuTypeExtension.create(ContainerFurnaceDouble::fromNetwork)); + public static final Supplier> GRINDER_CONTAINER = CONTAINERS.register("grinder_container", () -> IMenuTypeExtension.create(CrusherContainer::fromNetwork)); + public static final Supplier> LASER_RELAY_ITEM_WHITELIST_CONTAINER = CONTAINERS.register("laser_relay_item_whitelist_container", () -> IMenuTypeExtension.create(ContainerLaserRelayItemWhitelist::fromNetwork)); + public static final Supplier> MINER_CONTAINER = CONTAINERS.register("miner_container", () -> IMenuTypeExtension.create(ContainerMiner::fromNetwork)); + public static final Supplier> OIL_GENERATOR_CONTAINER = CONTAINERS.register("oil_generator_container", () -> IMenuTypeExtension.create(ContainerOilGenerator::fromNetwork)); + public static final Supplier> PHANTOM_PLACER_CONTAINER = CONTAINERS.register("phantom_placer_container", () -> IMenuTypeExtension.create(ContainerPhantomPlacer::fromNetwork)); + public static final Supplier> RANGED_COLLECTOR_CONTAINER = CONTAINERS.register("ranged_collector_container", () -> IMenuTypeExtension.create(ContainerRangedCollector::fromNetwork)); + public static final Supplier> XPSOLIDIFIER_CONTAINER = CONTAINERS.register("xpsolidifier_container", () -> IMenuTypeExtension.create(ContainerXPSolidifier::fromNetwork)); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoalGenerator.java index 8783f8246..b044353fa 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoalGenerator.java @@ -19,7 +19,7 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.ForgeHooks; +import net.neoforged.neoforge.common.CommonHooks; import java.util.Objects; @@ -63,7 +63,7 @@ public class ContainerCoalGenerator extends AbstractContainerMenu { //Other Slots in Inventory excluded if (slot >= inventoryStart) { //Shift from Inventory - if (ForgeHooks.getBurnTime(newStack, null) > 0) { + if (CommonHooks.getBurnTime(newStack, null) > 0) { if (!this.moveItemStackTo(newStack, 0, 1, false)) { return ItemStack.EMPTY; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java index a2e1d2b3a..ae8af6a62 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java @@ -23,7 +23,7 @@ import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ArmorItem; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.enchantment.EnchantmentHelper; -import net.minecraftforge.common.capabilities.ForgeCapabilities; +import net.neoforged.neoforge.capabilities.Capabilities; import java.util.Objects; @@ -43,7 +43,7 @@ public class ContainerEnergizer extends AbstractContainerMenu { this.addSlot(new SlotItemHandlerUnconditioned(this.energizer.inv, 0, 76, 73) { @Override public boolean mayPlace(ItemStack stack) { - return super.mayPlace(stack) && stack.getCapability(ForgeCapabilities.ENERGY, null).isPresent(); + return super.mayPlace(stack) && stack.getCapability(Capabilities.EnergyStorage.ITEM, null) != null; } }); this.addSlot(new SlotOutput(this.energizer.inv, 1, 76, 42)); @@ -110,7 +110,7 @@ public class ContainerEnergizer extends AbstractContainerMenu { //Other Slots in Inventory excluded else if (slot >= inventoryStart) { //Shift from Inventory - if (newStack.getCapability(ForgeCapabilities.ENERGY, null).isPresent()) { + if (newStack.getCapability(Capabilities.EnergyStorage.ITEM, null) != null) { if (!this.moveItemStackTo(newStack, 0, 1, false)) { return ItemStack.EMPTY; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java index c8b535ab7..2e4a64a88 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java @@ -22,7 +22,7 @@ import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ArmorItem; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.capabilities.ForgeCapabilities; +import net.neoforged.neoforge.capabilities.Capabilities; import java.util.Objects; @@ -98,7 +98,7 @@ public class ContainerEnervator extends AbstractContainerMenu { //Other Slots in Inventory excluded else if (slot >= inventoryStart) { //Shift from Inventory - if (newStack.getCapability(ForgeCapabilities.ENERGY).isPresent()) { + if (newStack.getCapability(Capabilities.EnergyStorage.ITEM) != null) { if (!this.moveItemStackTo(newStack, 0, 1, false)) { return ItemStack.EMPTY; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java index a23f79047..7afda6fda 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java @@ -22,7 +22,9 @@ import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.item.crafting.RecipeType; +import net.minecraft.world.item.crafting.SmeltingRecipe; import javax.annotation.Nonnull; import java.util.Objects; @@ -78,12 +80,12 @@ public class ContainerFurnaceDouble extends AbstractContainerMenu { //Other Slots in Inventory excluded else if (slot >= inventoryStart) { // TODO: VALIDATE - Recipe irecipe = this.furnace.getLevel().getRecipeManager().getRecipeFor(RecipeType.SMELTING, new SingleItem(newStack), this.furnace.getLevel()).orElse(null); - if (irecipe == null) { + RecipeHolder recipeHolder = this.furnace.getLevel().getRecipeManager().getRecipeFor(RecipeType.SMELTING, new SingleItem(newStack), this.furnace.getLevel()).orElse(null); + if (recipeHolder == null) { return ItemStack.EMPTY; } - ItemStack recipeOutput = irecipe.getResultItem(player.level().registryAccess()); + ItemStack recipeOutput = recipeHolder.value().getResultItem(player.level().registryAccess()); //Shift from Inventory if (StackUtil.isValid(recipeOutput)) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/SackContainer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/SackContainer.java index 111521b85..e211f0269 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/SackContainer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/SackContainer.java @@ -27,8 +27,8 @@ import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.ClickType; import net.minecraft.world.inventory.Slot; 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 javax.annotation.Nonnull; import java.util.UUID; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/Buttons.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/Buttons.java index f0b094011..63035674f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/Buttons.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/Buttons.java @@ -8,8 +8,8 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.Button; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; public class Buttons { @OnlyIn(Dist.CLIENT) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/CrusherScreen.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/CrusherScreen.java index 29df27cdc..2967d1ac6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/CrusherScreen.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/CrusherScreen.java @@ -20,8 +20,8 @@ import net.minecraft.client.gui.components.Button; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -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 javax.annotation.Nonnull; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/EnergyDisplay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/EnergyDisplay.java index 59bf92835..bf023f18a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/EnergyDisplay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/EnergyDisplay.java @@ -16,8 +16,8 @@ import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; -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 java.text.NumberFormat; import java.util.ArrayList; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FilterSettingsGui.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FilterSettingsGui.java index d73a110c8..8dda63a13 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FilterSettingsGui.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FilterSettingsGui.java @@ -18,8 +18,8 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.Renderable; import net.minecraft.network.chat.Component; -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 java.util.ArrayList; import java.util.List; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FluidDisplay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FluidDisplay.java index 96bc686d2..a053b8f25 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FluidDisplay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FluidDisplay.java @@ -17,12 +17,12 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.material.Fluid; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.client.extensions.common.IClientFluidTypeExtensions; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidTank; -import net.minecraftforge.fluids.capability.IFluidHandler; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.client.extensions.common.IClientFluidTypeExtensions; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.IFluidTank; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; import javax.annotation.Nonnull; import java.text.NumberFormat; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBreaker.java index f59c3e654..3dc28bc51 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBreaker.java @@ -18,8 +18,8 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -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 javax.annotation.Nonnull; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java index 995e6cb5c..5d2a5e171 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java @@ -18,8 +18,8 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -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 javax.annotation.Nonnull; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java index f212e25f2..f8e9b4925 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java @@ -18,8 +18,8 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -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 javax.annotation.Nonnull; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java index 845716070..3ab28200c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java @@ -21,8 +21,8 @@ import net.minecraft.client.gui.components.Button; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -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 javax.annotation.Nonnull; import java.util.Collections; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java index c5d431a7c..061dcf5bf 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java @@ -18,8 +18,8 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -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 javax.annotation.Nonnull; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDrill.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDrill.java index 7f0d1103e..91148a935 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDrill.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDrill.java @@ -19,8 +19,8 @@ import net.minecraft.client.resources.language.I18n; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -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 javax.annotation.Nonnull; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDropper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDropper.java index d8d009973..6b0a9a45e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDropper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDropper.java @@ -18,8 +18,8 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnergizer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnergizer.java index 31238a2a3..283823578 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnergizer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnergizer.java @@ -18,8 +18,8 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -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 javax.annotation.Nonnull; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnervator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnervator.java index 42d026498..6f8998c44 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnervator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnervator.java @@ -18,8 +18,8 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -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 javax.annotation.Nonnull; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFarmer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFarmer.java index 485bbc420..2be96ba81 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFarmer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFarmer.java @@ -18,8 +18,8 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -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 javax.annotation.Nonnull; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFeeder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFeeder.java index 8158e0515..4e482af8c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFeeder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFeeder.java @@ -20,8 +20,8 @@ import net.minecraft.client.resources.language.I18n; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -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 javax.annotation.Nonnull; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFermentingBarrel.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFermentingBarrel.java index 6215b8002..2b01d9bad 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFermentingBarrel.java @@ -18,8 +18,8 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -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 javax.annotation.Nonnull; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFilter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFilter.java index f59b90250..20f263572 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFilter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFilter.java @@ -19,8 +19,8 @@ import net.minecraft.client.resources.language.I18n; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -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 javax.annotation.Nonnull; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFireworkBox.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFireworkBox.java index 0adabe05e..5aac4e906 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFireworkBox.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFireworkBox.java @@ -16,8 +16,8 @@ import net.minecraft.client.gui.components.AbstractSliderButton; import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; // TODO: FIX ME @OnlyIn(Dist.CLIENT) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFluidCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFluidCollector.java index 7ecaaa477..7504a8d4b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFluidCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFluidCollector.java @@ -18,8 +18,8 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -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 javax.annotation.Nonnull; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFurnaceDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFurnaceDouble.java index 1ab98202f..5204fd855 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFurnaceDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFurnaceDouble.java @@ -22,8 +22,8 @@ import net.minecraft.client.gui.components.Button; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -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 javax.annotation.Nonnull; import java.util.Collections; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiLaserRelayItemWhitelist.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiLaserRelayItemWhitelist.java index fa827ae6d..87e81c860 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiLaserRelayItemWhitelist.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiLaserRelayItemWhitelist.java @@ -21,8 +21,8 @@ import net.minecraft.client.resources.language.I18n; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -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 javax.annotation.Nonnull; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiMiner.java index 25c27714e..c81ca4774 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiMiner.java @@ -18,8 +18,8 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java index 6c5026668..c2efdfbe5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java @@ -20,8 +20,8 @@ import net.minecraft.client.resources.language.I18n; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -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 javax.annotation.Nonnull; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiPhantomPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiPhantomPlacer.java index 55b1410f6..bc7289f3f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiPhantomPlacer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiPhantomPlacer.java @@ -18,8 +18,8 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -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 javax.annotation.Nonnull; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRangedCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRangedCollector.java index 97db97c7f..38caebee4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRangedCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRangedCollector.java @@ -18,8 +18,8 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -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 javax.annotation.Nonnull; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiSmileyCloud.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiSmileyCloud.java index 485b30b94..3a64b0198 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiSmileyCloud.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiSmileyCloud.java @@ -122,6 +122,6 @@ // compound.putInt("PlayerID", Minecraft.getInstance().player.getEntityId()); // compound.putInt("TextID", textID); // compound.setString("Text", text); -// PacketHandler.THE_NETWORK.sendToServer(new PacketClientToServer(compound, PacketHandler.GUI_STRING_TO_TILE_HANDLER)); +// PacketDistributor.SERVER.noArg().send(new PacketClientToServer(compound, PacketHandler.GUI_STRING_TO_TILE_HANDLER)); // } //} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java index 929d3bd05..6390fcf2c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java @@ -18,8 +18,8 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/SackGui.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/SackGui.java index 3af40510f..3e7a6615e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/SackGui.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/SackGui.java @@ -56,7 +56,7 @@ public class SackGui extends AAScreen { // data.putInt("ButtonID", button.id); // data.putInt("PlayerID", Minecraft.getInstance().player.getId()); // data.putInt("WorldID", Minecraft.getInstance().level.provider.getDimension()); -// PacketHandler.THE_NETWORK.sendToServer(new PacketClientToServer(data, PacketHandler.GUI_BUTTON_TO_CONTAINER_HANDLER)); +// PacketDistributor.SERVER.noArg().send(new PacketClientToServer(data, PacketHandler.GUI_BUTTON_TO_CONTAINER_HANDLER)); // } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/TexturedButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/TexturedButton.java index b5f4b7efc..e3dde93ba 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/TexturedButton.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/TexturedButton.java @@ -17,8 +17,8 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.Button; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; -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 java.util.ArrayList; import java.util.List; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/slot/SlotItemHandlerUnconditioned.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/slot/SlotItemHandlerUnconditioned.java index 8b8f67c53..d9cdc0896 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/slot/SlotItemHandlerUnconditioned.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/slot/SlotItemHandlerUnconditioned.java @@ -13,7 +13,7 @@ package de.ellpeck.actuallyadditions.mod.inventory.slot; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.items.SlotItemHandler; +import net.neoforged.neoforge.items.SlotItemHandler; import javax.annotation.Nonnull; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ActuallyItems.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ActuallyItems.java index 46cbc0c57..d7c247e3f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ActuallyItems.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ActuallyItems.java @@ -16,15 +16,18 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.AABlockItem; import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; +import de.ellpeck.actuallyadditions.mod.items.base.ItemEnergy; import de.ellpeck.actuallyadditions.mod.items.lens.ItemLens; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Tiers; import net.minecraft.world.item.crafting.RecipeType; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredItem; +import net.neoforged.neoforge.registries.DeferredRegister; import org.jetbrains.annotations.Nullable; import javax.annotation.Nonnull; @@ -32,151 +35,151 @@ import java.util.Set; import java.util.function.Supplier; public final class ActuallyItems { - public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, ActuallyAdditions.MODID); + public static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(ActuallyAdditions.MODID); // MISC ITEMS - public static final RegistryObject CANOLA = ITEMS.register("canola", ItemBase::new); - public static final RegistryObject COFFEE_CUP = ITEMS.register("coffee_cup", ItemBase::new); - public static final RegistryObject PAPER_CONE = ITEMS.register("paper_cone", ItemBase::new); - public static final RegistryObject DOUGH = ITEMS.register("dough", ItemBase::new); - public static final RegistryObject RING = ITEMS.register("ring", ItemBase::new); - public static final RegistryObject BASIC_COIL = ITEMS.register("basic_coil", ItemBase::new); - public static final RegistryObject ADVANCED_COIL = ITEMS.register("advanced_coil", ItemBase::new); - public static final RegistryObject RICE = ITEMS.register("rice", ItemBase::new); - public static final RegistryObject RICE_DOUGH = ITEMS.register("rice_dough", ItemBase::new); - public static final RegistryObject TINY_COAL = ITEMS.register("tiny_coal", () -> new ItemBase() { + public static final DeferredItem CANOLA = ITEMS.register("canola", () -> new ItemBase()); + public static final DeferredItem COFFEE_CUP = ITEMS.register("coffee_cup", () -> new ItemBase()); + public static final DeferredItem PAPER_CONE = ITEMS.register("paper_cone", () -> new ItemBase()); + public static final DeferredItem DOUGH = ITEMS.register("dough", () -> new ItemBase()); + public static final DeferredItem RING = ITEMS.register("ring", () -> new ItemBase()); + public static final DeferredItem BASIC_COIL = ITEMS.register("basic_coil", () -> new ItemBase()); + public static final DeferredItem ADVANCED_COIL = ITEMS.register("advanced_coil", () -> new ItemBase()); + public static final DeferredItem RICE = ITEMS.register("rice", () -> new ItemBase()); + public static final DeferredItem RICE_DOUGH = ITEMS.register("rice_dough", () -> new ItemBase()); + public static final DeferredItem TINY_COAL = ITEMS.register("tiny_coal", () -> new ItemBase() { @Override public int getBurnTime(ItemStack itemStack, @Nullable RecipeType recipeType) { return 200; } }); - public static final RegistryObject TINY_CHARCOAL = ITEMS.register("tiny_charcoal", () -> new ItemBase() { + public static final DeferredItem TINY_CHARCOAL = ITEMS.register("tiny_charcoal", () -> new ItemBase() { @Override public int getBurnTime(ItemStack itemStack, @Nullable RecipeType recipeType) { return 200; } }); - public static final RegistryObject RICE_SLIMEBALL = ITEMS.register("rice_slimeball", ItemBase::new); - public static final RegistryObject EMPTY_CUP = ITEMS.register("empty_cup", ItemBase::new); - public static final RegistryObject BATS_WING = ITEMS.register("bats_wing", ItemBase::new); - public static final RegistryObject DRILL_CORE = ITEMS.register("drill_core", ItemBase::new); - public static final RegistryObject LENS = ITEMS.register("lens", ItemBase::new); - public static final RegistryObject ENDER_STAR = ITEMS.register("ender_star", () -> new ItemBase() { + public static final DeferredItem RICE_SLIMEBALL = ITEMS.register("rice_slimeball", () -> new ItemBase()); + public static final DeferredItem EMPTY_CUP = ITEMS.register("empty_cup", () -> new ItemBase()); + public static final DeferredItem BATS_WING = ITEMS.register("bats_wing", () -> new ItemBase()); + public static final DeferredItem DRILL_CORE = ITEMS.register("drill_core", () -> new ItemBase()); + public static final DeferredItem LENS = ITEMS.register("lens", () -> new ItemBase()); + public static final DeferredItem ENDER_STAR = ITEMS.register("ender_star", () -> new ItemBase() { @Override public boolean isFoil(@Nonnull ItemStack pStack) { return true; } }); - public static final RegistryObject CRYSTALLIZED_CANOLA_SEED = ITEMS.register("crystallized_canola_seed", () -> new CanolaSeed(false)); - public static final RegistryObject EMPOWERED_CANOLA_SEED = ITEMS.register("empowered_canola_seed", () -> new CanolaSeed(true)); + public static final DeferredItem CRYSTALLIZED_CANOLA_SEED = ITEMS.register("crystallized_canola_seed", () -> new CanolaSeed(false)); + public static final DeferredItem EMPOWERED_CANOLA_SEED = ITEMS.register("empowered_canola_seed", () -> new CanolaSeed(true)); // SHARDS - public static final RegistryObject RESTONIA_CRYSTAL_SHARD = ITEMS.register("restonia_crystal_shard", ItemBase::new); - public static final RegistryObject PALIS_CRYSTAL_SHARD = ITEMS.register("palis_crystal_shard", ItemBase::new); - public static final RegistryObject DIAMATINE_CRYSTAL_SHARD = ITEMS.register("diamatine_crystal_shard", ItemBase::new); - public static final RegistryObject VOID_CRYSTAL_SHARD = ITEMS.register("void_crystal_shard", ItemBase::new); - public static final RegistryObject EMERADIC_CRYSTAL_SHARD = ITEMS.register("emeradic_crystal_shard", ItemBase::new); - public static final RegistryObject ENORI_CRYSTAL_SHARD = ITEMS.register("enori_crystal_shard", ItemBase::new); + public static final DeferredItem RESTONIA_CRYSTAL_SHARD = ITEMS.register("restonia_crystal_shard", () -> new ItemBase()); + public static final DeferredItem PALIS_CRYSTAL_SHARD = ITEMS.register("palis_crystal_shard", () -> new ItemBase()); + public static final DeferredItem DIAMATINE_CRYSTAL_SHARD = ITEMS.register("diamatine_crystal_shard", () -> new ItemBase()); + public static final DeferredItem VOID_CRYSTAL_SHARD = ITEMS.register("void_crystal_shard", () -> new ItemBase()); + public static final DeferredItem EMERADIC_CRYSTAL_SHARD = ITEMS.register("emeradic_crystal_shard", () -> new ItemBase()); + public static final DeferredItem ENORI_CRYSTAL_SHARD = ITEMS.register("enori_crystal_shard", () -> new ItemBase()); // CRYSTALS - public static final RegistryObject RESTONIA_CRYSTAL = ITEMS.register("restonia_crystal", ItemCrystal::new); - public static final RegistryObject PALIS_CRYSTAL = ITEMS.register("palis_crystal", ItemCrystal::new); - public static final RegistryObject DIAMATINE_CRYSTAL = ITEMS.register("diamatine_crystal", ItemCrystal::new); - public static final RegistryObject VOID_CRYSTAL = ITEMS.register("void_crystal", ItemCrystal::new); - public static final RegistryObject EMERADIC_CRYSTAL = ITEMS.register("emeradic_crystal", ItemCrystal::new); - public static final RegistryObject ENORI_CRYSTAL = ITEMS.register("enori_crystal", ItemCrystal::new); + public static final DeferredItem RESTONIA_CRYSTAL = ITEMS.register("restonia_crystal", () -> new ItemCrystal()); + public static final DeferredItem PALIS_CRYSTAL = ITEMS.register("palis_crystal", () -> new ItemCrystal()); + public static final DeferredItem DIAMATINE_CRYSTAL = ITEMS.register("diamatine_crystal", () -> new ItemCrystal()); + public static final DeferredItem VOID_CRYSTAL = ITEMS.register("void_crystal", () -> new ItemCrystal()); + public static final DeferredItem EMERADIC_CRYSTAL = ITEMS.register("emeradic_crystal", () -> new ItemCrystal()); + public static final DeferredItem ENORI_CRYSTAL = ITEMS.register("enori_crystal", () -> new ItemCrystal()); - public static final RegistryObject EMPOWERED_RESTONIA_CRYSTAL = ITEMS.register("empowered_restonia_crystal", () -> new ItemCrystal(true)); - public static final RegistryObject EMPOWERED_PALIS_CRYSTAL = ITEMS.register("empowered_palis_crystal", () -> new ItemCrystal(true)); - public static final RegistryObject EMPOWERED_DIAMATINE_CRYSTAL = ITEMS.register("empowered_diamatine_crystal", () -> new ItemCrystal(true)); - public static final RegistryObject EMPOWERED_VOID_CRYSTAL = ITEMS.register("empowered_void_crystal", () -> new ItemCrystal(true)); - public static final RegistryObject EMPOWERED_EMERADIC_CRYSTAL = ITEMS.register("empowered_emeradic_crystal", () -> new ItemCrystal(true)); - public static final RegistryObject EMPOWERED_ENORI_CRYSTAL = ITEMS.register("empowered_enori_crystal", () -> new ItemCrystal(true)); + public static final DeferredItem EMPOWERED_RESTONIA_CRYSTAL = ITEMS.register("empowered_restonia_crystal", () -> new ItemCrystal(true)); + public static final DeferredItem EMPOWERED_PALIS_CRYSTAL = ITEMS.register("empowered_palis_crystal", () -> new ItemCrystal(true)); + public static final DeferredItem EMPOWERED_DIAMATINE_CRYSTAL = ITEMS.register("empowered_diamatine_crystal", () -> new ItemCrystal(true)); + public static final DeferredItem EMPOWERED_VOID_CRYSTAL = ITEMS.register("empowered_void_crystal", () -> new ItemCrystal(true)); + public static final DeferredItem EMPOWERED_EMERADIC_CRYSTAL = ITEMS.register("empowered_emeradic_crystal", () -> new ItemCrystal(true)); + public static final DeferredItem EMPOWERED_ENORI_CRYSTAL = ITEMS.register("empowered_enori_crystal", () -> new ItemCrystal(true)); // BLACK QUARTZ - public static final RegistryObject BLACK_QUARTZ = ITEMS.register("black_quartz", ItemBase::new); + public static final DeferredItem BLACK_QUARTZ = ITEMS.register("black_quartz", () -> new ItemBase()); - public static final RegistryObject ENGINEERS_GOGGLES_ADVANCED = ITEMS.register("engineers_goggles_advanced", () -> new ItemEngineerGoggles(true)); - public static final RegistryObject ENGINEERS_GOGGLES = ITEMS.register("engineers_goggles", () -> new ItemEngineerGoggles(false)); - public static final RegistryObject LASER_UPGRADE_RANGE = ITEMS.register("laser_upgrade_range", ItemLaserRelayUpgrade::new); - public static final RegistryObject LASER_UPGRADE_INVISIBILITY = ITEMS.register("laser_upgrade_invisibility", ItemLaserRelayUpgrade::new); + public static final DeferredItem ENGINEERS_GOGGLES_ADVANCED = ITEMS.register("engineers_goggles_advanced", () -> new ItemEngineerGoggles(true)); + public static final DeferredItem ENGINEERS_GOGGLES = ITEMS.register("engineers_goggles", () -> new ItemEngineerGoggles(false)); + public static final DeferredItem LASER_UPGRADE_RANGE = ITEMS.register("laser_upgrade_range", ItemLaserRelayUpgrade::new); + public static final DeferredItem LASER_UPGRADE_INVISIBILITY = ITEMS.register("laser_upgrade_invisibility", ItemLaserRelayUpgrade::new); public static final Supplier HANDHELD_FILLER = ITEMS.register("handheld_filler", ItemFillingWand::new); - public static final RegistryObject TRAVELERS_SACK = ITEMS.register("travelers_sack", () -> new Sack(false)); - public static final RegistryObject VOID_SACK = ITEMS.register("void_sack", () -> new Sack(true)); - public static final RegistryObject WORM = ITEMS.register("worm", Worm::new); - public static final RegistryObject PLAYER_PROBE = ITEMS.register("player_probe", ItemPlayerProbe::new); - public static final RegistryObject FILTER = ITEMS.register("filter", ItemFilter::new); - public static final RegistryObject WATER_BOWL = ITEMS.register("water_bowl", ItemWaterBowl::new); - public static final RegistryObject CRATE_KEEPER = ITEMS.register("crate_keeper", () -> new ItemGeneric(defaultProps().stacksTo(1))); - public static final RegistryObject LENS_OF_COLOR = ITEMS.register("lens_of_color", () -> new ItemLens(ActuallyAdditionsAPI.lensColor)); - public static final RegistryObject LENS_OF_DETONATION = ITEMS.register("lens_of_detonation", () -> new ItemLens(ActuallyAdditionsAPI.lensDetonation)); - public static final RegistryObject LENS_OF_CERTAIN_DEATH = ITEMS.register("lens_of_certain_death", () -> new ItemLens(ActuallyAdditionsAPI.lensDeath)); - public static final RegistryObject LENS_OF_THE_KILLER = ITEMS.register("lens_of_the_killer", () -> new ItemLens(ActuallyAdditionsAPI.lensEvenMoarDeath)); - public static final RegistryObject LENS_OF_DISENCHANTING = ITEMS.register("lens_of_disenchanting", () -> new ItemLens(ActuallyAdditionsAPI.lensDisenchanting)); - public static final RegistryObject LENS_OF_THE_MINER = ITEMS.register("lens_of_the_miner", () -> new ItemLens(ActuallyAdditionsAPI.lensMining)); - public static final RegistryObject LASER_WRENCH = ITEMS.register("laser_wrench", ItemLaserWrench::new); - // public static final RegistryObject itemChestToCrateUpgrade = ITEMS.register("", new ItemChestToCrateUpgrade("chest_to_crate_upgrade", TileEntityChest.class, InitBlocks.blockGiantChest.getDefaultState())); - // public static final RegistryObject itemSmallToMediumCrateUpgrade = ITEMS.register("", new ItemChestToCrateUpgrade("small_to_medium_crate_upgrade", TileEntityGiantChest.class, InitBlocks.blockGiantChestMedium.getDefaultState())); - // public static final RegistryObject itemMediumToLargeCrateUpgrade = ITEMS.register("", new ItemChestToCrateUpgrade("medium_to_large_crate_upgrade", TileEntityGiantChestMedium.class, InitBlocks.blockGiantChestLarge.getDefaultState())); - public static final RegistryObject ITEM_BOOKLET = ITEMS.register("booklet", ItemBooklet::new); - public static final RegistryObject RING_OF_GROWTH = ITEMS.register("ring_of_growth", ItemGrowthRing::new); - public static final RegistryObject RING_OF_MAGNETIZING = ITEMS.register("ring_of_magnetizing", ItemMagnetRing::new); - public static final RegistryObject TELEPORT_STAFF = ITEMS.register("teleport_staff", ItemTeleportStaff::new); - public static final RegistryObject WINGS_OF_THE_BATS = ITEMS.register("wings_of_the_bats", ItemWingsOfTheBats::new); + public static final DeferredItem TRAVELERS_SACK = ITEMS.register("travelers_sack", () -> new Sack(false)); + public static final DeferredItem VOID_SACK = ITEMS.register("void_sack", () -> new Sack(true)); + public static final DeferredItem WORM = ITEMS.register("worm", Worm::new); + public static final DeferredItem PLAYER_PROBE = ITEMS.register("player_probe", ItemPlayerProbe::new); + public static final DeferredItem FILTER = ITEMS.register("filter", ItemFilter::new); + public static final DeferredItem WATER_BOWL = ITEMS.register("water_bowl", ItemWaterBowl::new); + public static final DeferredItem CRATE_KEEPER = ITEMS.register("crate_keeper", () -> new ItemGeneric(defaultProps().stacksTo(1))); + public static final DeferredItem LENS_OF_COLOR = ITEMS.register("lens_of_color", () -> new ItemLens(ActuallyAdditionsAPI.lensColor)); + public static final DeferredItem LENS_OF_DETONATION = ITEMS.register("lens_of_detonation", () -> new ItemLens(ActuallyAdditionsAPI.lensDetonation)); + public static final DeferredItem LENS_OF_CERTAIN_DEATH = ITEMS.register("lens_of_certain_death", () -> new ItemLens(ActuallyAdditionsAPI.lensDeath)); + public static final DeferredItem LENS_OF_THE_KILLER = ITEMS.register("lens_of_the_killer", () -> new ItemLens(ActuallyAdditionsAPI.lensEvenMoarDeath)); + public static final DeferredItem LENS_OF_DISENCHANTING = ITEMS.register("lens_of_disenchanting", () -> new ItemLens(ActuallyAdditionsAPI.lensDisenchanting)); + public static final DeferredItem LENS_OF_THE_MINER = ITEMS.register("lens_of_the_miner", () -> new ItemLens(ActuallyAdditionsAPI.lensMining)); + public static final DeferredItem LASER_WRENCH = ITEMS.register("laser_wrench", ItemLaserWrench::new); + // public static final DeferredItem itemChestToCrateUpgrade = ITEMS.register("", new ItemChestToCrateUpgrade("chest_to_crate_upgrade", TileEntityChest.class, InitBlocks.blockGiantChest.getDefaultState())); + // public static final DeferredItem itemSmallToMediumCrateUpgrade = ITEMS.register("", new ItemChestToCrateUpgrade("small_to_medium_crate_upgrade", TileEntityGiantChest.class, InitBlocks.blockGiantChestMedium.getDefaultState())); + // public static final DeferredItem itemMediumToLargeCrateUpgrade = ITEMS.register("", new ItemChestToCrateUpgrade("medium_to_large_crate_upgrade", TileEntityGiantChestMedium.class, InitBlocks.blockGiantChestLarge.getDefaultState())); + public static final DeferredItem ITEM_BOOKLET = ITEMS.register("booklet", ItemBooklet::new); + public static final DeferredItem RING_OF_GROWTH = ITEMS.register("ring_of_growth", ItemGrowthRing::new); + public static final DeferredItem RING_OF_MAGNETIZING = ITEMS.register("ring_of_magnetizing", ItemMagnetRing::new); + public static final DeferredItem TELEPORT_STAFF = ITEMS.register("teleport_staff", ItemTeleportStaff::new); + public static final DeferredItem WINGS_OF_THE_BATS = ITEMS.register("wings_of_the_bats", ItemWingsOfTheBats::new); - public static final RegistryObject DRILL_MAIN = ITEMS.register("drill_light_blue", DrillItem::new); - public static final RegistryObject DRILL_BLACK = ITEMS.register("drill_black", DrillItem::new); - public static final RegistryObject DRILL_BLUE = ITEMS.register("drill_blue", DrillItem::new); - public static final RegistryObject DRILL_BROWN = ITEMS.register("drill_brown", DrillItem::new); - public static final RegistryObject DRILL_CYAN = ITEMS.register("drill_cyan", DrillItem::new); - public static final RegistryObject DRILL_GRAY = ITEMS.register("drill_gray", DrillItem::new); - public static final RegistryObject DRILL_GREEN = ITEMS.register("drill_green", DrillItem::new); - public static final RegistryObject DRILL_LIGHT_GRAY = ITEMS.register("drill_light_gray", DrillItem::new); - public static final RegistryObject DRILL_LIME = ITEMS.register("drill_lime", DrillItem::new); - public static final RegistryObject DRILL_MAGENTA = ITEMS.register("drill_magenta", DrillItem::new); - public static final RegistryObject DRILL_ORANGE = ITEMS.register("drill_orange", DrillItem::new); - public static final RegistryObject DRILL_PINK = ITEMS.register("drill_pink", DrillItem::new); - public static final RegistryObject DRILL_PURPLE = ITEMS.register("drill_purple", DrillItem::new); - public static final RegistryObject DRILL_RED = ITEMS.register("drill_red", DrillItem::new); - public static final RegistryObject DRILL_WHITE = ITEMS.register("drill_white", DrillItem::new); - public static final RegistryObject DRILL_YELLOW = ITEMS.register("drill_yellow", DrillItem::new); + public static final DeferredItem DRILL_MAIN = ITEMS.register("drill_light_blue", DrillItem::new); + public static final DeferredItem DRILL_BLACK = ITEMS.register("drill_black", DrillItem::new); + public static final DeferredItem DRILL_BLUE = ITEMS.register("drill_blue", DrillItem::new); + public static final DeferredItem DRILL_BROWN = ITEMS.register("drill_brown", DrillItem::new); + public static final DeferredItem DRILL_CYAN = ITEMS.register("drill_cyan", DrillItem::new); + public static final DeferredItem DRILL_GRAY = ITEMS.register("drill_gray", DrillItem::new); + public static final DeferredItem DRILL_GREEN = ITEMS.register("drill_green", DrillItem::new); + public static final DeferredItem DRILL_LIGHT_GRAY = ITEMS.register("drill_light_gray", DrillItem::new); + public static final DeferredItem DRILL_LIME = ITEMS.register("drill_lime", DrillItem::new); + public static final DeferredItem DRILL_MAGENTA = ITEMS.register("drill_magenta", DrillItem::new); + public static final DeferredItem DRILL_ORANGE = ITEMS.register("drill_orange", DrillItem::new); + public static final DeferredItem DRILL_PINK = ITEMS.register("drill_pink", DrillItem::new); + public static final DeferredItem DRILL_PURPLE = ITEMS.register("drill_purple", DrillItem::new); + public static final DeferredItem DRILL_RED = ITEMS.register("drill_red", DrillItem::new); + public static final DeferredItem DRILL_WHITE = ITEMS.register("drill_white", DrillItem::new); + public static final DeferredItem DRILL_YELLOW = ITEMS.register("drill_yellow", DrillItem::new); - public static final RegistryObject SINGLE_BATTERY = ITEMS.register("single_battery", () -> new ItemBattery(200000, 1000)); - public static final RegistryObject DOUBLE_BATTERY = ITEMS.register("double_battery", () -> new ItemBattery(350000, 5000)); - public static final RegistryObject TRIPLE_BATTERY = ITEMS.register("triple_battery", () -> new ItemBattery(600000, 10000)); - public static final RegistryObject QUADRUPLE_BATTERY = ITEMS.register("quadruple_battery", () -> new ItemBattery(1000000, 30000)); - public static final RegistryObject QUINTUPLE_BATTERY = ITEMS.register("quintuple_battery", () -> new ItemBattery(2000000, 100000)); - public static final RegistryObject DRILL_UPGRADE_SPEED = ITEMS.register("drill_upgrade_speed", () -> new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.SPEED)); - public static final RegistryObject DRILL_UPGRADE_SPEED_II = ITEMS.register("drill_upgrade_speed_ii", () -> new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.SPEED_II)); - public static final RegistryObject DRILL_UPGRADE_SPEED_III = ITEMS.register("drill_upgrade_speed_iii", () -> new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.SPEED_III)); - public static final RegistryObject DRILL_UPGRADE_SILK_TOUCH = ITEMS.register("drill_upgrade_silk_touch", () -> new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.SILK_TOUCH)); - public static final RegistryObject DRILL_UPGRADE_FORTUNE = ITEMS.register("drill_upgrade_fortune", () -> new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.FORTUNE)); - public static final RegistryObject DRILL_UPGRADE_FORTUNE_II = ITEMS.register("drill_upgrade_fortune_ii", () -> new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.FORTUNE_II)); - public static final RegistryObject DRILL_UPGRADE_THREE_BY_THREE = ITEMS.register("drill_upgrade_three_by_three", () -> new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.THREE_BY_THREE)); - public static final RegistryObject DRILL_UPGRADE_FIVE_BY_FIVE = ITEMS.register("drill_upgrade_five_by_five", () -> new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE)); - public static final RegistryObject DRILL_UPGRADE_BLOCK_PLACING = ITEMS.register("drill_upgrade_block_placing", () -> new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.PLACER)); - public static final RegistryObject PHANTOM_CONNECTOR = ITEMS.register("phantom_connector", ItemPhantomConnector::new); - //public static final RegistryObject FOOD = ITEMS.register("food", ItemBase::new); //just... food? //TODO - public static final RegistryObject CRAFTER_ON_A_STICK = ITEMS.register("crafter_on_a_stick", ItemCrafterOnAStick::new); - //public static final RegistryObject DUST = ITEMS.register("dust", ItemDust::new); //TODO flatten - public static final RegistryObject SOLIDIFIED_EXPERIENCE = ITEMS.register("solidified_experience", ItemSolidifiedExperience::new); - public static final RegistryObject LEAF_BLOWER = ITEMS.register("leaf_blower", () -> new ItemLeafBlower(false)); - public static final RegistryObject ADVANCED_LEAF_BLOWER = ITEMS.register("advanced_leaf_blower", () -> new ItemLeafBlower(true)); + public static final DeferredItem SINGLE_BATTERY = ITEMS.register("single_battery", () -> new ItemBattery(200000, 1000)); + public static final DeferredItem DOUBLE_BATTERY = ITEMS.register("double_battery", () -> new ItemBattery(350000, 5000)); + public static final DeferredItem TRIPLE_BATTERY = ITEMS.register("triple_battery", () -> new ItemBattery(600000, 10000)); + public static final DeferredItem QUADRUPLE_BATTERY = ITEMS.register("quadruple_battery", () -> new ItemBattery(1000000, 30000)); + public static final DeferredItem QUINTUPLE_BATTERY = ITEMS.register("quintuple_battery", () -> new ItemBattery(2000000, 100000)); + public static final DeferredItem DRILL_UPGRADE_SPEED = ITEMS.register("drill_upgrade_speed", () -> new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.SPEED)); + public static final DeferredItem DRILL_UPGRADE_SPEED_II = ITEMS.register("drill_upgrade_speed_ii", () -> new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.SPEED_II)); + public static final DeferredItem DRILL_UPGRADE_SPEED_III = ITEMS.register("drill_upgrade_speed_iii", () -> new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.SPEED_III)); + public static final DeferredItem DRILL_UPGRADE_SILK_TOUCH = ITEMS.register("drill_upgrade_silk_touch", () -> new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.SILK_TOUCH)); + public static final DeferredItem DRILL_UPGRADE_FORTUNE = ITEMS.register("drill_upgrade_fortune", () -> new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.FORTUNE)); + public static final DeferredItem DRILL_UPGRADE_FORTUNE_II = ITEMS.register("drill_upgrade_fortune_ii", () -> new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.FORTUNE_II)); + public static final DeferredItem DRILL_UPGRADE_THREE_BY_THREE = ITEMS.register("drill_upgrade_three_by_three", () -> new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.THREE_BY_THREE)); + public static final DeferredItem DRILL_UPGRADE_FIVE_BY_FIVE = ITEMS.register("drill_upgrade_five_by_five", () -> new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE)); + public static final DeferredItem DRILL_UPGRADE_BLOCK_PLACING = ITEMS.register("drill_upgrade_block_placing", () -> new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.PLACER)); + public static final DeferredItem PHANTOM_CONNECTOR = ITEMS.register("phantom_connector", ItemPhantomConnector::new); + //public static final DeferredItem FOOD = ITEMS.register("food", () -> new ItemBase()); //just... food? //TODO + public static final DeferredItem CRAFTER_ON_A_STICK = ITEMS.register("crafter_on_a_stick", ItemCrafterOnAStick::new); + //public static final DeferredItem DUST = ITEMS.register("dust", ItemDust::new); //TODO flatten + public static final DeferredItem SOLIDIFIED_EXPERIENCE = ITEMS.register("solidified_experience", ItemSolidifiedExperience::new); + public static final DeferredItem LEAF_BLOWER = ITEMS.register("leaf_blower", () -> new ItemLeafBlower(false)); + public static final DeferredItem ADVANCED_LEAF_BLOWER = ITEMS.register("advanced_leaf_blower", () -> new ItemLeafBlower(true)); - public static final RegistryObject COFFEE_BEANS = ITEMS.register("coffee_beans", () -> new AABlockItem.AASeedItem(ActuallyBlocks.COFFEE.get(), ActuallyItems.defaultProps())); + public static final DeferredItem COFFEE_BEANS = ITEMS.register("coffee_beans", () -> new AABlockItem.AASeedItem(ActuallyBlocks.COFFEE.get(), ActuallyItems.defaultProps())); - public static final RegistryObject RICE_SEEDS = ITEMS.register("rice_seeds", () -> new AABlockItem.AASeedItem(ActuallyBlocks.RICE.get(), ActuallyItems.defaultProps())); //() -> new ItemSeed("seedRice", ActuallyBlocks.RICE.get(), FOOD.get(), TheFoods.RICE.ordinal())); - public static final RegistryObject CANOLA_SEEDS = ITEMS.register("canola_seeds", () -> new AABlockItem.AASeedItem(ActuallyBlocks.CANOLA.get(), ActuallyItems.defaultProps())); //() -> new ItemFoodSeed("seedCanola", ActuallyBlocks.CANOLA, itemMisc, 0, 1, 0.01F, 10).setPotionEffect(new PotionEffect(MobEffects.NAUSEA, 1000, 0), 0.2F)); - public static final RegistryObject FLAX_SEEDS = ITEMS.register("flax_seeds", () -> new AABlockItem.AASeedItem(ActuallyBlocks.FLAX.get(), ActuallyItems.defaultProps())); //() -> new ItemSeed("seedFlax", ActuallyBlocks.FLAX, Items.STRING, 0)); + public static final DeferredItem RICE_SEEDS = ITEMS.register("rice_seeds", () -> new AABlockItem.AASeedItem(ActuallyBlocks.RICE.get(), ActuallyItems.defaultProps())); //() -> new ItemSeed("seedRice", ActuallyBlocks.RICE.get(), FOOD.get(), TheFoods.RICE.ordinal())); + public static final DeferredItem CANOLA_SEEDS = ITEMS.register("canola_seeds", () -> new AABlockItem.AASeedItem(ActuallyBlocks.CANOLA.get(), ActuallyItems.defaultProps())); //() -> new ItemFoodSeed("seedCanola", ActuallyBlocks.CANOLA, itemMisc, 0, 1, 0.01F, 10).setPotionEffect(new PotionEffect(MobEffects.NAUSEA, 1000, 0), 0.2F)); + public static final DeferredItem FLAX_SEEDS = ITEMS.register("flax_seeds", () -> new AABlockItem.AASeedItem(ActuallyBlocks.FLAX.get(), ActuallyItems.defaultProps())); //() -> new ItemSeed("seedFlax", ActuallyBlocks.FLAX, Items.STRING, 0)); // TOOLS & ARMOR - public static final RegistryObject WOODEN_AIOT = ITEMS.register("wooden_aiot", () -> new AllInOneTool(Tiers.WOOD)); - public static final RegistryObject STONE_AIOT = ITEMS.register("stone_aiot", () -> new AllInOneTool(Tiers.STONE)); - public static final RegistryObject IRON_AIOT = ITEMS.register("iron_aiot", () -> new AllInOneTool(Tiers.IRON)); - public static final RegistryObject GOLD_AIOT = ITEMS.register("gold_aiot", () -> new AllInOneTool(Tiers.GOLD)); - public static final RegistryObject DIAMOND_AIOT = ITEMS.register("diamond_aiot", () -> new AllInOneTool(Tiers.DIAMOND)); - public static final RegistryObject NETHERITE_AIOT = ITEMS.register("netherite_aiot", () -> new AllInOneTool(Tiers.NETHERITE)); + public static final DeferredItem WOODEN_AIOT = ITEMS.register("wooden_aiot", () -> new AllInOneTool(Tiers.WOOD)); + public static final DeferredItem STONE_AIOT = ITEMS.register("stone_aiot", () -> new AllInOneTool(Tiers.STONE)); + public static final DeferredItem IRON_AIOT = ITEMS.register("iron_aiot", () -> new AllInOneTool(Tiers.IRON)); + public static final DeferredItem GOLD_AIOT = ITEMS.register("gold_aiot", () -> new AllInOneTool(Tiers.GOLD)); + public static final DeferredItem DIAMOND_AIOT = ITEMS.register("diamond_aiot", () -> new AllInOneTool(Tiers.DIAMOND)); + public static final DeferredItem NETHERITE_AIOT = ITEMS.register("netherite_aiot", () -> new AllInOneTool(Tiers.NETHERITE)); public static final Set> SIMPLE_ITEMS = ImmutableSet.of( // Crystals @@ -220,5 +223,14 @@ public final class ActuallyItems { public static void init(IEventBus evt) { ITEMS.register(evt); + evt.addListener(ActuallyItems::registerCapabilities); + } + + public static void registerCapabilities(RegisterCapabilitiesEvent event) { + for(DeferredHolder holder : ITEMS.getEntries()) { + if(holder.get() instanceof ItemEnergy energyItem) { + //TODO: Register the CustomEnergyStorage capability to the ItemEnergy extending items + } + } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/AllInOneTool.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/AllInOneTool.java index 1528cc87b..93ecc96e9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/AllInOneTool.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/AllInOneTool.java @@ -9,8 +9,8 @@ import net.minecraft.world.item.Items; import net.minecraft.world.item.Tier; import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.item.enchantment.Enchantment; -import net.minecraftforge.common.ToolAction; -import net.minecraftforge.common.ToolActions; +import net.neoforged.neoforge.common.ToolAction; +import net.neoforged.neoforge.common.ToolActions; public class AllInOneTool extends DiggerItem implements IActuallyItem { private final Tier tier; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/DrillItem.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/DrillItem.java index 3df6394d7..1915e6e2a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/DrillItem.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/DrillItem.java @@ -24,6 +24,7 @@ import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; @@ -49,13 +50,13 @@ import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.common.ForgeHooks; -import net.minecraftforge.common.Tags; -import net.minecraftforge.common.ToolAction; -import net.minecraftforge.common.ToolActions; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.IItemHandlerModifiable; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.common.CommonHooks; +import net.neoforged.neoforge.common.Tags; +import net.neoforged.neoforge.common.TierSortingRegistry; +import net.neoforged.neoforge.common.ToolAction; +import net.neoforged.neoforge.common.ToolActions; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.IItemHandlerModifiable; public class DrillItem extends ItemEnergy { @@ -76,8 +77,8 @@ public class DrillItem extends ItemEnergy { @Override public boolean isCorrectToolForDrops(BlockState pBlock) { Tier tier = Tiers.NETHERITE; //Use Nettherite as the tier as it has the same harvest level as the drill - if (net.minecraftforge.common.TierSortingRegistry.isTierSorted(tier)) { - return net.minecraftforge.common.TierSortingRegistry.isCorrectTierForDrops(tier, pBlock) && pBlock.is(ActuallyTags.Blocks.MINEABLE_WITH_DRILL); + if (TierSortingRegistry.isTierSorted(tier)) { + return TierSortingRegistry.isCorrectTierForDrops(tier, pBlock) && pBlock.is(ActuallyTags.Blocks.MINEABLE_WITH_DRILL); } if (HARVEST_LEVEL < 3 && pBlock.is(BlockTags.NEEDS_DIAMOND_TOOL)) { return false; @@ -475,7 +476,7 @@ public class DrillItem extends ItemEnergy { Block block = state.getBlock(); float hardness = state.getDestroySpeed(world, pos); - boolean canHarvest = (ForgeHooks.isCorrectToolForDrops(state, player) || this.isCorrectToolForDrops(stack, state)) && (!isExtra || this.getDestroySpeed(stack, world.getBlockState(pos)) > 1.0F); + boolean canHarvest = (CommonHooks.isCorrectToolForDrops(state, player) || this.isCorrectToolForDrops(stack, state)) && (!isExtra || this.getDestroySpeed(stack, world.getBlockState(pos)) > 1.0F); if (hardness >= 0.0F && (!isExtra || canHarvest && !state.hasBlockEntity())) { if (!player.isCreative()) { this.extractEnergyInternal(stack, use, false); @@ -488,7 +489,7 @@ public class DrillItem extends ItemEnergy { private boolean hasExtraWhitelist(Block block) { if (block != null) { - ResourceLocation location = ForgeRegistries.BLOCKS.getKey(block); + ResourceLocation location = BuiltInRegistries.BLOCK.getKey(block); if (location != null) { String name = location.toString(); if (name != null) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java index 7d0871831..c03d3f805 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java @@ -20,15 +20,15 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; -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.energy.IEnergyStorage; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.energy.IEnergyStorage; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.List; +import java.util.Optional; public class ItemBattery extends ItemEnergy { @@ -47,7 +47,7 @@ public class ItemBattery extends ItemEnergy { for (int i = 0; i < player.getInventory().getContainerSize(); i++) { ItemStack slot = player.getInventory().getItem(i); if (!slot.isEmpty() && slot.getCount() == 1) { - LazyOptional energy = slot.getCapability(ForgeCapabilities.ENERGY); + Optional energy = Optional.ofNullable(slot.getCapability(Capabilities.EnergyStorage.ITEM)); energy.ifPresent(cap -> { int extractable = this.extractEnergy(stack, Integer.MAX_VALUE, true); int received = cap.receiveEnergy(extractable, false); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java index 2cc70eb80..fd7c45bfe 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java @@ -16,7 +16,7 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.IHudDisplay; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import net.minecraft.ChatFormatting; -import net.minecraft.advancements.Advancement; +import net.minecraft.advancements.AdvancementHolder; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; @@ -33,8 +33,8 @@ import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.Level; import net.minecraft.world.phys.HitResult; -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 javax.annotation.Nullable; import java.util.List; @@ -72,7 +72,7 @@ public class ItemBooklet extends ItemBase implements IHudDisplay { ServerPlayer serverPlayer = (ServerPlayer) player; PlayerAdvancements advancements = serverPlayer.getAdvancements(); ServerAdvancementManager manager = player.getServer().getAdvancements(); - Advancement advancement = manager.getAdvancement(new ResourceLocation(ActuallyAdditions.MODID, "root")); + AdvancementHolder advancement = manager.get(new ResourceLocation(ActuallyAdditions.MODID, "root")); if (advancement != null && !advancements.getOrStartProgress(advancement).isDone()) { advancements.award(advancement, "right_click"); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCoffee.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCoffee.java index 4327b72ba..6f15830df 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCoffee.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCoffee.java @@ -26,9 +26,9 @@ import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.fml.ModList; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.fml.ModList; import javax.annotation.Nullable; import java.util.List; @@ -101,11 +101,11 @@ public class ItemCoffee extends ItemFoodBase { // return EnumAction.DRINK; //} - @Nullable - @Override - public CompoundTag getShareTag(ItemStack stack) { - return super.getShareTag(stack); - } +// @Nullable +// @Override +// public CompoundTag getShareTag(ItemStack stack) { +// return super.getShareTag(stack); +// } @OnlyIn(Dist.CLIENT) @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrafterOnAStick.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrafterOnAStick.java index d6c66f096..6c3aef5c4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrafterOnAStick.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrafterOnAStick.java @@ -12,7 +12,6 @@ package de.ellpeck.actuallyadditions.mod.items; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import net.minecraft.network.chat.Component; -import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResultHolder; @@ -21,7 +20,6 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.CraftingMenu; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; -import net.minecraftforge.network.NetworkHooks; import javax.annotation.Nonnull; @@ -36,7 +34,7 @@ public class ItemCrafterOnAStick extends ItemBase { @Override public InteractionResultHolder use(Level world, @Nonnull Player player, @Nonnull InteractionHand hand) { if (!world.isClientSide) { - NetworkHooks.openScreen((ServerPlayer) player, new SimpleMenuProvider((windowId, playerInventory, playerEntity) -> new CraftingMenu(windowId, playerInventory), CONTAINER_TITLE)); + player.openMenu(new SimpleMenuProvider((windowId, playerInventory, playerEntity) -> new CraftingMenu(windowId, playerInventory), CONTAINER_TITLE)); } return new InteractionResultHolder<>(InteractionResult.SUCCESS, player.getItemInHand(hand)); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemEngineerGoggles.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemEngineerGoggles.java index b4c020413..30ee2227f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemEngineerGoggles.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemEngineerGoggles.java @@ -20,12 +20,12 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.phys.AABB; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.TickEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.DistExecutor; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.loading.FMLEnvironment; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.event.TickEvent; import java.util.List; import java.util.Set; @@ -40,7 +40,9 @@ public class ItemEngineerGoggles extends ItemArmorAA implements IGoggles { super(ArmorMaterials.GOGGLES, Type.HELMET, ActuallyItems.defaultProps().setNoRepair().durability(0)); this.displayMobs = displayMobs; - DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> MinecraftForge.EVENT_BUS.register(this)); + if (FMLEnvironment.dist.isClient()) { + NeoForge.EVENT_BUS.register(this); + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFillingWand.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFillingWand.java index a760b6d31..cf4e7d308 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFillingWand.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFillingWand.java @@ -33,8 +33,8 @@ import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.state.BlockState; 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.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; import javax.annotation.Nullable; import java.util.List; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFilter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFilter.java index 17abdbbf7..137f40cc0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFilter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFilter.java @@ -15,7 +15,6 @@ import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.network.chat.Component; -import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResultHolder; import net.minecraft.world.SimpleMenuProvider; @@ -23,9 +22,8 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.network.NetworkHooks; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; import javax.annotation.Nullable; import java.util.List; @@ -39,7 +37,7 @@ public class ItemFilter extends ItemBase { @Override public InteractionResultHolder use(Level world, Player player, InteractionHand hand) { if (!world.isClientSide && hand == InteractionHand.MAIN_HAND) { - NetworkHooks.openScreen((ServerPlayer) player, new SimpleMenuProvider((windowId, inv, playerEnt) -> new ContainerFilter(windowId, inv), Component.empty())); + player.openMenu(new SimpleMenuProvider((windowId, inv, playerEnt) -> new ContainerFilter(windowId, inv), Component.empty())); // player.openGui(ActuallyAdditions.INSTANCE, GuiHandler.GuiTypes.FILTER.ordinal(), world, (int) player.posX, (int) player.posY, (int) player.posZ); } return InteractionResultHolder.pass(player.getItemInHand(hand)); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemGrowthRing.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemGrowthRing.java index 0f880f69c..e3c969042 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemGrowthRing.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemGrowthRing.java @@ -23,7 +23,7 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.BonemealableBlock; import net.minecraft.world.level.block.GrassBlock; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.IPlantable; +import net.neoforged.neoforge.common.IPlantable; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java index 2ddc2ff90..1c2820c9d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java @@ -24,8 +24,8 @@ import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; -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 java.util.List; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLeafBlower.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLeafBlower.java index da7ed3160..8b477e4fb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLeafBlower.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLeafBlower.java @@ -29,7 +29,7 @@ import net.minecraft.world.level.block.BushBlock; import net.minecraft.world.level.block.LeavesBlock; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.IForgeShearable; +import net.neoforged.neoforge.common.IShearable; import javax.annotation.Nonnull; import java.util.ArrayList; @@ -104,7 +104,7 @@ public class ItemLeafBlower extends ItemBase implements IDisplayStandItem { BlockPos pos = new BlockPos(x + reachX, y + reachY, z + reachZ); Block block = world.getBlockState(pos).getBlock(); - if ((block instanceof BushBlock || block instanceof IForgeShearable) && (this.isAdvanced || !(block instanceof LeavesBlock))) { + if ((block instanceof BushBlock || block instanceof IShearable) && (this.isAdvanced || !(block instanceof LeavesBlock))) { breakPositions.add(pos); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java index 2f0ce9478..b01cf910e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java @@ -27,8 +27,8 @@ import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; -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 javax.annotation.Nullable; import java.util.List; @@ -106,11 +106,11 @@ public class ItemPhantomConnector extends ItemBase { return InteractionResult.SUCCESS; } - @Nullable - @Override - public CompoundTag getShareTag(ItemStack stack) { - return new CompoundTag(); - } +// @Nullable +// @Override +// public CompoundTag getShareTag(ItemStack stack) { +// return new CompoundTag(); +// } @OnlyIn(Dist.CLIENT) @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPlayerProbe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPlayerProbe.java index 93e0a8a92..d7d987acc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPlayerProbe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPlayerProbe.java @@ -26,8 +26,8 @@ import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; -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 javax.annotation.Nullable; import java.util.List; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemShovelAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemShovelAA.java index 210e1da5d..5914074b6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemShovelAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemShovelAA.java @@ -29,7 +29,7 @@ import java.util.Set; public class ItemShovelAA extends ItemToolAA { - private static final Set EFFECTIVE_ON = Sets.newHashSet(Blocks.CLAY, Blocks.DIRT, Blocks.FARMLAND, Blocks.GRASS, Blocks.GRAVEL, Blocks.MYCELIUM, Blocks.SAND, Blocks.SNOW, Blocks.SNOW_BLOCK, Blocks.SOUL_SAND, Blocks.DIRT_PATH); + private static final Set EFFECTIVE_ON = Sets.newHashSet(Blocks.CLAY, Blocks.DIRT, Blocks.FARMLAND, Blocks.GRASS_BLOCK, Blocks.GRAVEL, Blocks.MYCELIUM, Blocks.SAND, Blocks.SNOW, Blocks.SNOW_BLOCK, Blocks.SOUL_SAND, Blocks.DIRT_PATH); public ItemShovelAA(float p_i48512_1_, float p_i48512_2_, Tier p_i48512_3_, TagKey p_i48512_4_, Properties p_i48512_5_, String name, ItemStack repairItem, TagKey repairTag) { super(p_i48512_1_, p_i48512_2_, p_i48512_3_, p_i48512_4_, p_i48512_5_, name, repairItem, repairTag); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java index 54ab6d4b4..00ff90094 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java @@ -19,7 +19,7 @@ import net.minecraft.world.entity.ExperienceOrb; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; -import net.minecraftforge.common.util.FakePlayer; +import net.neoforged.neoforge.common.util.FakePlayer; public class ItemSolidifiedExperience extends ItemBase { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterBowl.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterBowl.java index bbd60814c..2373b4921 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterBowl.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterBowl.java @@ -34,9 +34,9 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.event.ForgeEventFactory; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.neoforge.event.EventHooks; +import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent; public class ItemWaterBowl extends ItemBase { @@ -56,7 +56,7 @@ public class ItemWaterBowl extends ItemBase { } BlockHitResult trace = (BlockHitResult) rayTrace; - InteractionResultHolder result = ForgeEventFactory.onBucketUse(event.getEntity(), event.getLevel(), event.getItemStack(), trace); + InteractionResultHolder result = EventHooks.onBucketUse(event.getEntity(), event.getLevel(), event.getItemStack(), trace); if (result == null) { if (event.getEntity().mayUseItemAt(trace.getBlockPos().relative(trace.getDirection()), trace.getDirection(), event.getItemStack())) { BlockState state = event.getLevel().getBlockState(trace.getBlockPos()); @@ -92,7 +92,7 @@ public class ItemWaterBowl extends ItemBase { ItemStack stack = player.getItemInHand(hand); HitResult trace = WorldUtil.getNearestBlockWithDefaultReachDistance(world, player); - InteractionResultHolder result = ForgeEventFactory.onBucketUse(player, world, stack, trace); + InteractionResultHolder result = EventHooks.onBucketUse(player, world, stack, trace); if (result != null) { return result; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java index 9d0fee2e9..f19e046e2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java @@ -25,9 +25,9 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.SwordItem; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.event.entity.living.LivingDropsEvent; -import net.minecraftforge.event.entity.living.LivingEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.neoforge.event.entity.living.LivingDropsEvent; +import net.neoforged.neoforge.event.entity.living.LivingEvent; public class ItemWingsOfTheBats extends ItemBase { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/Sack.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/Sack.java index fae3f4e7f..4f81e49d5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/Sack.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/Sack.java @@ -16,6 +16,7 @@ import de.ellpeck.actuallyadditions.mod.sack.SackData; import de.ellpeck.actuallyadditions.mod.sack.SackManager; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA; import de.ellpeck.actuallyadditions.mod.util.StackUtil; +import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.InteractionHand; @@ -27,9 +28,9 @@ 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 net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.network.NetworkHooks; +import net.neoforged.neoforge.capabilities.Capabilities; +import java.util.Optional; import java.util.UUID; public class Sack extends ItemBase { @@ -44,12 +45,14 @@ public class Sack extends ItemBase { public InteractionResult useOn(UseOnContext context) { ItemStack stack = context.getPlayer().getItemInHand(context.getHand()); if (!this.isVoid) { - BlockEntity tile = context.getLevel().getBlockEntity(context.getClickedPos()); + Level level = context.getLevel(); + BlockPos clickedPos = context.getClickedPos(); + BlockEntity tile = level.getBlockEntity(clickedPos); if (tile != null) { if (!context.getLevel().isClientSide) { ItemStackHandlerAA inv = new ItemStackHandlerAA(28); - boolean changed = tile.getCapability(ForgeCapabilities.ITEM_HANDLER, context.getClickedFace()) + boolean changed = Optional.ofNullable(level.getCapability(Capabilities.ItemHandler.BLOCK, clickedPos, context.getClickedFace())) .map(cap -> { boolean localChanged = false; DrillItem.loadSlotsFromNBT(inv, stack); @@ -99,7 +102,7 @@ public class Sack extends ItemBase { data.updateAccessRecords(player.getName().getString(), System.currentTimeMillis()); - NetworkHooks.openScreen((ServerPlayer) player, new SimpleMenuProvider((id, inv, entity) -> + player.openMenu(new SimpleMenuProvider((id, inv, entity) -> new SackContainer(id, inv, uuid, data.getSpecialHandler()), sackStack.getHoverName()), (buffer -> buffer.writeUUID(uuid))); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/Worm.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/Worm.java index b6fbcff70..d4cbfe8ed 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/Worm.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/Worm.java @@ -23,9 +23,9 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.AABB; -import net.minecraftforge.common.ToolActions; -import net.minecraftforge.event.level.BlockEvent; -import net.minecraftforge.eventbus.api.Event; +import net.neoforged.bus.api.Event; +import net.neoforged.neoforge.common.ToolActions; +import net.neoforged.neoforge.event.level.BlockEvent; import java.util.List; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemEnergy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemEnergy.java index 06ac10d04..aa93d7e53 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemEnergy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemEnergy.java @@ -12,25 +12,19 @@ package de.ellpeck.actuallyadditions.mod.items.base; import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; import de.ellpeck.actuallyadditions.mod.tile.CustomEnergyStorage; -import net.minecraft.core.Direction; -import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; -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.capabilities.ICapabilityProvider; -import net.minecraftforge.common.capabilities.ICapabilitySerializable; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.energy.IEnergyStorage; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.text.NumberFormat; import java.util.List; +import java.util.Optional; public abstract class ItemEnergy extends ItemBase { @@ -98,7 +92,7 @@ public abstract class ItemEnergy extends ItemBase { } public void setEnergy(ItemStack stack, int energy) { - stack.getCapability(ForgeCapabilities.ENERGY, null).ifPresent(cap -> { + Optional.ofNullable(stack.getCapability(Capabilities.EnergyStorage.ITEM, null)).ifPresent(cap -> { if (cap instanceof CustomEnergyStorage) { ((CustomEnergyStorage) cap).setEnergyStored(energy); } @@ -107,13 +101,13 @@ public abstract class ItemEnergy extends ItemBase { @Deprecated public int receiveEnergyInternal(ItemStack stack, int maxReceive, boolean simulate) { - return stack.getCapability(ForgeCapabilities.ENERGY) + return Optional.ofNullable(stack.getCapability(Capabilities.EnergyStorage.ITEM, null)) .map(cap -> ((CustomEnergyStorage) cap).receiveEnergyInternal(maxReceive, simulate)) .orElse(0); } public int extractEnergyInternal(ItemStack stack, int maxExtract, boolean simulate) { - return stack.getCapability(ForgeCapabilities.ENERGY) + return Optional.ofNullable(stack.getCapability(Capabilities.EnergyStorage.ITEM, null)) .map(cap -> cap instanceof CustomEnergyStorage ? ((CustomEnergyStorage) cap).extractEnergyInternal(maxExtract, simulate) : 0) @@ -122,68 +116,68 @@ public abstract class ItemEnergy extends ItemBase { @Deprecated public int receiveEnergy(ItemStack stack, int maxReceive, boolean simulate) { - return stack.getCapability(ForgeCapabilities.ENERGY) + return Optional.ofNullable(stack.getCapability(Capabilities.EnergyStorage.ITEM, null)) .map(cap -> cap.receiveEnergy(maxReceive, simulate)) .orElse(0); } public int extractEnergy(ItemStack stack, int maxExtract, boolean simulate) { - return stack.getCapability(ForgeCapabilities.ENERGY) + return Optional.ofNullable(stack.getCapability(Capabilities.EnergyStorage.ITEM, null)) .map(cap -> cap.extractEnergy(maxExtract, simulate)) .orElse(0); } public int getEnergyStored(ItemStack stack) { - return stack.getCapability(ForgeCapabilities.ENERGY, null) + return Optional.ofNullable(stack.getCapability(Capabilities.EnergyStorage.ITEM, null)) .map(IEnergyStorage::getEnergyStored) .orElse(0); } public int getMaxEnergyStored(ItemStack stack) { - return stack.getCapability(ForgeCapabilities.ENERGY, null) + return Optional.ofNullable(stack.getCapability(Capabilities.EnergyStorage.ITEM, null)) .map(IEnergyStorage::getMaxEnergyStored) .orElse(0); } - @Override - public ICapabilityProvider initCapabilities(ItemStack stack, CompoundTag nbt) { - return new EnergyCapabilityProvider(stack, this); - } +// @Override TODO: Register Energy cap/attachment +// public ICapabilityProvider initCapabilities(ItemStack stack, CompoundTag nbt) { +// return new EnergyCapabilityProvider(stack, this); +// } - private static class EnergyCapabilityProvider implements ICapabilitySerializable { - - public final CustomEnergyStorage storage; - private final LazyOptional energyCapability; - - private final ItemStack stack; - - public EnergyCapabilityProvider(ItemStack stack, ItemEnergy item) { - this.storage = new CustomEnergyStorage(item.maxPower, item.transfer, item.transfer); - this.energyCapability = LazyOptional.of(() -> this.storage); - this.stack = stack; - } - - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == ForgeCapabilities.ENERGY) { - return this.energyCapability.cast(); - } - return LazyOptional.empty(); - } - - @Override - public CompoundTag serializeNBT() { - if (this.storage.isDirty()) - stack.getOrCreateTag().putInt("Energy", this.storage.getEnergyStored()); - this.storage.clearDirty(); - return new CompoundTag(); - } - - @Override - public void deserializeNBT(CompoundTag nbt) { - if (stack.getOrCreateTag().contains("Energy")) - this.storage.setEnergyStored(stack.getOrCreateTag().getInt("Energy")); - } - } +// private static class EnergyCapabilityProvider implements ICapabilitySerializable { +// +// public final CustomEnergyStorage storage; +// private final LazyOptional energyCapability; +// +// private final ItemStack stack; +// +// public EnergyCapabilityProvider(ItemStack stack, ItemEnergy item) { +// this.storage = new CustomEnergyStorage(item.maxPower, item.transfer, item.transfer); +// this.energyCapability = LazyOptional.of(() -> this.storage); +// this.stack = stack; +// } +// +// @Nonnull +// @Override +// public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { +// if (cap == Capabilities.ENERGY) { +// return this.energyCapability.cast(); +// } +// return LazyOptional.empty(); +// } +// +// @Override +// public CompoundTag serializeNBT() { +// if (this.storage.isDirty()) +// stack.getOrCreateTag().putInt("Energy", this.storage.getEnergyStored()); +// this.storage.clearDirty(); +// return new CompoundTag(); +// } +// +// @Override +// public void deserializeNBT(CompoundTag nbt) { +// if (stack.getOrCreateTag().contains("Energy")) +// this.storage.setEnergyStored(stack.getOrCreateTag().getInt("Energy")); +// } +// } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensKiller.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensKiller.java index 2112fefef..0179a62be 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensKiller.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensKiller.java @@ -13,7 +13,7 @@ package de.ellpeck.actuallyadditions.mod.items.lens; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.entity.LivingEntity; -import net.minecraftforge.common.util.FakePlayerFactory; +import net.neoforged.neoforge.common.util.FakePlayerFactory; public class LensKiller extends LensDeath { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensMining.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensMining.java index 5bd727d8d..e88a74acc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensMining.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensMining.java @@ -19,6 +19,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.util.random.WeightedRandom; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; @@ -83,9 +84,9 @@ public class LensMining extends Lens { Block hitBlock = hitState.getBlock(); ItemStack item = new ItemStack(hitBlock.asItem()); - for(MiningLensRecipe r:ActuallyAdditionsAPI.MINING_LENS_RECIPES) { - if (r.matches(item)) - ores.add(r); + for(RecipeHolder r:ActuallyAdditionsAPI.MINING_LENS_RECIPES) { + if (r.value().matches(item)) + ores.add(r.value()); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/FermentingCategory.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/FermentingCategory.java index 0c590febd..2789e183a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/FermentingCategory.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/FermentingCategory.java @@ -2,7 +2,6 @@ package de.ellpeck.actuallyadditions.mod.jei; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.crafting.FermentingRecipe; -import de.ellpeck.actuallyadditions.mod.inventory.gui.FluidDisplay; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import mezz.jei.api.gui.builder.IRecipeLayoutBuilder; import mezz.jei.api.gui.drawable.IDrawable; @@ -16,8 +15,7 @@ import mezz.jei.api.recipe.category.IRecipeCategory; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidType; +import net.neoforged.neoforge.fluids.FluidStack; public class FermentingCategory implements IRecipeCategory { private final IDrawableStatic background; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java index 29053df08..ae494d86b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java @@ -28,6 +28,7 @@ import mezz.jei.api.registration.IRecipeRegistration; import net.minecraft.client.Minecraft; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.level.Level; @JeiPlugin @@ -46,9 +47,9 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin { public void registerCategories(IRecipeCategoryRegistration registry) { IJeiHelpers helpers = registry.getJeiHelpers(); - registry.addRecipeCategories(new FermentingCategory(helpers.getGuiHelper())); //TODO: re-enable after refactor jei compat - registry.addRecipeCategories(new LaserRecipeCategory(helpers.getGuiHelper())); //TODO: re-enable after refactor jei compat - registry.addRecipeCategories(new EmpowererRecipeCategory(helpers.getGuiHelper())); //TODO: re-enable after refactor jei compat + registry.addRecipeCategories(new FermentingCategory(helpers.getGuiHelper())); + registry.addRecipeCategories(new LaserRecipeCategory(helpers.getGuiHelper())); + registry.addRecipeCategories(new EmpowererRecipeCategory(helpers.getGuiHelper())); //registry.addRecipeCategories(new CoffeeMachineRecipeCategory(helpers.getGuiHelper()), new CompostRecipeCategory(helpers.getGuiHelper()), new CrusherRecipeCategory(helpers.getGuiHelper()), new ReconstructorRecipeCategory(helpers.getGuiHelper()), new EmpowererRecipeCategory(helpers.getGuiHelper()), new BookletRecipeCategory(helpers.getGuiHelper())); } @@ -56,9 +57,9 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin { @Override public void registerRecipeCatalysts(IRecipeCatalystRegistration registry) { registry.addRecipeCatalyst(new ItemStack(ActuallyItems.CRAFTER_ON_A_STICK.get()), RecipeTypes.CRAFTING); - registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.FERMENTING_BARREL.getItem()), FERMENTING); //TODO: re-enable after refactor jei compat - registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.ATOMIC_RECONSTRUCTOR.getItem()), LASER); //TODO: re-enable after refactor jei compat - registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.EMPOWERER.getItem()), EMPOWERER); //TODO: re-enable after refactor jei compat + registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.FERMENTING_BARREL.getItem()), FERMENTING); + registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.ATOMIC_RECONSTRUCTOR.getItem()), LASER); + registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.EMPOWERER.getItem()), EMPOWERER); // registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.blockFurnaceDouble.get()), VanillaRecipeCategoryUid.SMELTING); // registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.blockGrinder.get()), CrusherRecipeCategory.NAME); @@ -74,9 +75,9 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin { public void registerRecipes(IRecipeRegistration registry) { Level level = Minecraft.getInstance().level; - registry.addRecipes(FERMENTING, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.FERMENTING.get())); //TODO: re-enable after refactor jei compat - registry.addRecipes(LASER, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.LASER.get())); //TODO: re-enable after refactor jei compat - registry.addRecipes(EMPOWERER, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.EMPOWERING.get())); //TODO: re-enable after refactor jei compat + registry.addRecipes(FERMENTING, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.FERMENTING.get()).stream().map(RecipeHolder::value).toList()); + registry.addRecipes(LASER, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.LASER.get()).stream().map(RecipeHolder::value).toList()); + registry.addRecipes(EMPOWERER, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.EMPOWERING.get()).stream().map(RecipeHolder::value).toList()); //registry.addRecipes(ActuallyAdditionsAPI.BOOKLET_PAGES_WITH_ITEM_OR_FLUID_DATA, BookletRecipeCategory.NAME); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/material/ArmorMaterials.java b/src/main/java/de/ellpeck/actuallyadditions/mod/material/ArmorMaterials.java index 878527c21..b25c3830e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/material/ArmorMaterials.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/material/ArmorMaterials.java @@ -9,8 +9,8 @@ import net.minecraft.util.LazyLoadedValue; import net.minecraft.world.item.ArmorItem; import net.minecraft.world.item.ArmorMaterial; import net.minecraft.world.item.crafting.Ingredient; -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 java.util.EnumMap; import java.util.function.Supplier; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/material/ToolMaterials.java b/src/main/java/de/ellpeck/actuallyadditions/mod/material/ToolMaterials.java index b3ee70b63..80853fdb2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/material/ToolMaterials.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/material/ToolMaterials.java @@ -7,8 +7,8 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Tier; import net.minecraft.world.item.Tiers; import net.minecraft.world.item.crafting.Ingredient; -import net.minecraftforge.common.ForgeTier; -import net.minecraftforge.common.TierSortingRegistry; +import net.neoforged.neoforge.common.SimpleTier; +import net.neoforged.neoforge.common.TierSortingRegistry; import java.util.List; @@ -16,11 +16,11 @@ import java.util.List; * todo: review to ensure all values act as intended */ public class ToolMaterials { - public static final Tier BLACK_QUARTZ = TierSortingRegistry.registerTier(new ForgeTier(2, 280, 6.5f, 2.0f, 10, ActuallyTags.Blocks.NEEDS_BLACK_QUARTZ_TOOL, () -> Ingredient.of(ActuallyItems.BLACK_QUARTZ.get())), new ResourceLocation(ActuallyAdditions.MODID, "black_quartz"), List.of(Tiers.IRON), List.of(Tiers.DIAMOND)); - public static final Tier RESTONIA = TierSortingRegistry.registerTier(new ForgeTier(2, 300, 7.0f, 2.25f, 12, ActuallyTags.Blocks.NEEDS_RESTONIA_TOOL, () -> Ingredient.of(ActuallyItems.RESTONIA_CRYSTAL.get())), new ResourceLocation(ActuallyAdditions.MODID, "restonia"), List.of(Tiers.IRON), List.of(Tiers.DIAMOND)); - public static final Tier PALIS = TierSortingRegistry.registerTier(new ForgeTier(2, 300, 7.0f, 2.25f, 12, ActuallyTags.Blocks.NEEDS_PALIS_TOOL, () -> Ingredient.of(ActuallyItems.PALIS_CRYSTAL.get())), new ResourceLocation(ActuallyAdditions.MODID, "palis"), List.of(Tiers.IRON), List.of(Tiers.DIAMOND)); - public static final Tier DIAMATINE = TierSortingRegistry.registerTier(new ForgeTier(3, 1600, 9.0f, 4.0f, 14, ActuallyTags.Blocks.NEEDS_DIAMATINE_TOOL, () -> Ingredient.of(ActuallyItems.DIAMATINE_CRYSTAL.get())), new ResourceLocation(ActuallyAdditions.MODID, "diamatine"), List.of(Tiers.DIAMOND), List.of(Tiers.NETHERITE)); - public static final Tier VOID = TierSortingRegistry.registerTier(new ForgeTier(2, 280, 6.0f, 2.0f, 8, ActuallyTags.Blocks.NEEDS_VOID_TOOL, () -> Ingredient.of(ActuallyItems.VOID_CRYSTAL.get())), new ResourceLocation(ActuallyAdditions.MODID, "void"), List.of(Tiers.IRON), List.of(Tiers.DIAMOND)); - public static final Tier EMERADIC = TierSortingRegistry.registerTier(new ForgeTier(4, 2200, 9.5f, 5.55f, 18, ActuallyTags.Blocks.NEEDS_EMERADIC_TOOL, () -> Ingredient.of(ActuallyItems.EMERADIC_CRYSTAL.get())), new ResourceLocation(ActuallyAdditions.MODID, "emeradic"), List.of(Tiers.NETHERITE), List.of()); - public static final Tier ENORI = TierSortingRegistry.registerTier(new ForgeTier(2, 280, 6.25f, 6.25f, 15, ActuallyTags.Blocks.NEEDS_ENORI_TOOL, () -> Ingredient.of(ActuallyItems.ENORI_CRYSTAL.get())), new ResourceLocation(ActuallyAdditions.MODID, "enori"), List.of(Tiers.IRON), List.of(Tiers.DIAMOND)); + public static final Tier BLACK_QUARTZ = TierSortingRegistry.registerTier(new SimpleTier(2, 280, 6.5f, 2.0f, 10, ActuallyTags.Blocks.NEEDS_BLACK_QUARTZ_TOOL, () -> Ingredient.of(ActuallyItems.BLACK_QUARTZ.get())), new ResourceLocation(ActuallyAdditions.MODID, "black_quartz"), List.of(Tiers.IRON), List.of(Tiers.DIAMOND)); + public static final Tier RESTONIA = TierSortingRegistry.registerTier(new SimpleTier(2, 300, 7.0f, 2.25f, 12, ActuallyTags.Blocks.NEEDS_RESTONIA_TOOL, () -> Ingredient.of(ActuallyItems.RESTONIA_CRYSTAL.get())), new ResourceLocation(ActuallyAdditions.MODID, "restonia"), List.of(Tiers.IRON), List.of(Tiers.DIAMOND)); + public static final Tier PALIS = TierSortingRegistry.registerTier(new SimpleTier(2, 300, 7.0f, 2.25f, 12, ActuallyTags.Blocks.NEEDS_PALIS_TOOL, () -> Ingredient.of(ActuallyItems.PALIS_CRYSTAL.get())), new ResourceLocation(ActuallyAdditions.MODID, "palis"), List.of(Tiers.IRON), List.of(Tiers.DIAMOND)); + public static final Tier DIAMATINE = TierSortingRegistry.registerTier(new SimpleTier(3, 1600, 9.0f, 4.0f, 14, ActuallyTags.Blocks.NEEDS_DIAMATINE_TOOL, () -> Ingredient.of(ActuallyItems.DIAMATINE_CRYSTAL.get())), new ResourceLocation(ActuallyAdditions.MODID, "diamatine"), List.of(Tiers.DIAMOND), List.of(Tiers.NETHERITE)); + public static final Tier VOID = TierSortingRegistry.registerTier(new SimpleTier(2, 280, 6.0f, 2.0f, 8, ActuallyTags.Blocks.NEEDS_VOID_TOOL, () -> Ingredient.of(ActuallyItems.VOID_CRYSTAL.get())), new ResourceLocation(ActuallyAdditions.MODID, "void"), List.of(Tiers.IRON), List.of(Tiers.DIAMOND)); + public static final Tier EMERADIC = TierSortingRegistry.registerTier(new SimpleTier(4, 2200, 9.5f, 5.55f, 18, ActuallyTags.Blocks.NEEDS_EMERADIC_TOOL, () -> Ingredient.of(ActuallyItems.EMERADIC_CRYSTAL.get())), new ResourceLocation(ActuallyAdditions.MODID, "emeradic"), List.of(Tiers.NETHERITE), List.of()); + public static final Tier ENORI = TierSortingRegistry.registerTier(new SimpleTier(2, 280, 6.25f, 6.25f, 15, ActuallyTags.Blocks.NEEDS_ENORI_TOOL, () -> Ingredient.of(ActuallyItems.ENORI_CRYSTAL.get())), new ResourceLocation(ActuallyAdditions.MODID, "enori"), List.of(Tiers.IRON), List.of(Tiers.DIAMOND)); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DispenserHandlerFertilize.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DispenserHandlerFertilize.java index d727f9ae2..940871789 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DispenserHandlerFertilize.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DispenserHandlerFertilize.java @@ -11,8 +11,8 @@ package de.ellpeck.actuallyadditions.mod.misc; import net.minecraft.core.BlockPos; -import net.minecraft.core.BlockSource; import net.minecraft.core.Direction; +import net.minecraft.core.dispenser.BlockSource; import net.minecraft.core.dispenser.DefaultDispenseItemBehavior; import net.minecraft.world.item.BoneMealItem; import net.minecraft.world.item.ItemStack; @@ -23,11 +23,11 @@ public class DispenserHandlerFertilize extends DefaultDispenseItemBehavior { @Override public ItemStack execute(BlockSource source, ItemStack stack) { - Direction facing = source.getBlockState().getValue(BlockStateProperties.FACING); - BlockPos pos = source.getPos().relative(facing); + Direction facing = source.state().getValue(BlockStateProperties.FACING); + BlockPos pos = source.pos().relative(facing); - if (BoneMealItem.growCrop(stack, source.getLevel(), pos)) { - source.getLevel().levelEvent(2005, pos, 0); + if (BoneMealItem.growCrop(stack, source.level(), pos)) { + source.level().levelEvent(2005, pos, 0); } return stack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/apiimpl/MethodHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/apiimpl/MethodHandler.java index 4e657c424..b0f56557e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/apiimpl/MethodHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/apiimpl/MethodHandler.java @@ -15,18 +15,21 @@ import de.ellpeck.actuallyadditions.api.internal.IMethodHandler; import de.ellpeck.actuallyadditions.api.lens.Lens; import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient; import de.ellpeck.actuallyadditions.mod.blocks.BlockLaserRelay; +import de.ellpeck.actuallyadditions.mod.crafting.ColorChangeRecipe; import de.ellpeck.actuallyadditions.mod.crafting.LaserRecipe; import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Vec3i; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.effect.MobEffect; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; @@ -116,7 +119,7 @@ public class MethodHandler implements IMethodHandler { int counter = tag.getInt("Counter"); while (counter > 0) { CompoundTag compound = (CompoundTag) tag.get(counter + ""); - MobEffectInstance effect = new MobEffectInstance(MobEffect.byId(compound.getInt("ID")), compound.getInt("Duration"), compound.getByte("Amplifier")); + MobEffectInstance effect = new MobEffectInstance(BuiltInRegistries.MOB_EFFECT.byId(compound.getInt("ID")), compound.getInt("Duration"), compound.getByte("Amplifier")); effects.add(effect); counter--; } @@ -157,14 +160,15 @@ public class MethodHandler implements IMethodHandler { if (state.getBlock() instanceof BlockLaserRelay) { continue; } - Optional recipe = LaserRecipe.getRecipeForStack(new ItemStack(state.getBlock())); - if (recipe.isPresent() && tile.getEnergy() >= recipe.get().getEnergy()) { - ItemStack output = recipe.get().getResultItem(tile.getWorldObject().registryAccess()).copy(); + Optional> holder = LaserRecipe.getRecipeForStack(new ItemStack(state.getBlock())); + if (holder.isPresent() && tile.getEnergy() >= holder.get().value().getEnergy()) { + LaserRecipe recipe = holder.get().value(); + ItemStack output = recipe.getResultItem(tile.getWorldObject().registryAccess()).copy(); if (!output.isEmpty()) { tile.getWorldObject().levelEvent(2001, pos, Block.getId(state)); if (output.getItem() instanceof BlockItem) { Block toPlace = Block.byItem(output.getItem()); - BlockState state2Place = toPlace.defaultBlockState(); //.getStateForPlacement(tile.getWorldObject(), pos, facing, 0, 0, 0, output.getMetadata(), FakePlayerFactory.getMinecraft((WorldServer) tile.getWorldObject()), Hand.MAIN_HAND); //TODO + BlockState state2Place = toPlace.defaultBlockState(); //.getStateForPlacement(tile.getWorldObject(), pos, facing, 0, 0, 0, stack.getMetadata(), FakePlayerFactory.getMinecraft((WorldServer) tile.getWorldObject()), Hand.MAIN_HAND); //TODO tile.getWorldObject().setBlock(pos, state2Place, 2); } else { ItemEntity item = new ItemEntity(tile.getWorldObject(), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, output.copy()); @@ -172,7 +176,7 @@ public class MethodHandler implements IMethodHandler { tile.getWorldObject().setBlockAndUpdate(pos, Blocks.AIR.defaultBlockState()); } - tile.extractEnergy(recipe.get().getEnergy()); + tile.extractEnergy(recipe.getEnergy()); break; } } @@ -189,9 +193,10 @@ public class MethodHandler implements IMethodHandler { for (ItemEntity item : items) { ItemStack stack = item.getItem(); if (item.isAlive() && StackUtil.isValid(stack) && !item.getPersistentData().getBoolean("aa_cnv")) { - Optional recipe = LaserRecipe.getRecipeForStack(stack); - if (recipe.isPresent()) { - int itemsPossible = Math.min(tile.getEnergy() / recipe.get().getEnergy(), stack.getCount()); + Optional> holder = LaserRecipe.getRecipeForStack(stack); + if (holder.isPresent()) { + LaserRecipe recipe = holder.get().value(); + int itemsPossible = Math.min(tile.getEnergy() / recipe.getEnergy(), stack.getCount()); if (itemsPossible > 0) { //recipe.transformHook(item.getItem(), null, item.blockPosition(), tile); //TODO empty method @@ -205,14 +210,14 @@ public class MethodHandler implements IMethodHandler { tile.getWorldObject().addFreshEntity(inputLeft); } - ItemStack outputCopy = recipe.get().getResultItem(tile.getWorldObject().registryAccess()).copy(); + ItemStack outputCopy = recipe.getResultItem(tile.getWorldObject().registryAccess()).copy(); outputCopy.setCount(itemsPossible); ItemEntity newItem = new ItemEntity(tile.getWorldObject(), item.getX(), item.getY(), item.getZ(), outputCopy); newItem.getPersistentData().putBoolean("aa_cnv", true); tile.getWorldObject().addFreshEntity(newItem); - tile.extractEnergy(recipe.get().getEnergy() * itemsPossible); + tile.extractEnergy(recipe.getEnergy() * itemsPossible); break; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/apiimpl/farmer/DefaultFarmerBehavior.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/apiimpl/farmer/DefaultFarmerBehavior.java index 36dd620cd..c90b404d6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/apiimpl/farmer/DefaultFarmerBehavior.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/apiimpl/farmer/DefaultFarmerBehavior.java @@ -37,8 +37,8 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.common.IPlantable; -import net.minecraftforge.common.util.FakePlayerFactory; +import net.neoforged.neoforge.common.IPlantable; +import net.neoforged.neoforge.common.util.FakePlayerFactory; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/apiimpl/farmer/NetherWartFarmerBehavior.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/apiimpl/farmer/NetherWartFarmerBehavior.java index c4ea452cd..195e14b35 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/apiimpl/farmer/NetherWartFarmerBehavior.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/apiimpl/farmer/NetherWartFarmerBehavior.java @@ -27,7 +27,7 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.common.IPlantable; +import net.neoforged.neoforge.common.IPlantable; import java.util.List; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/SpecialRenderInit.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/SpecialRenderInit.java index 8c8e475bf..643188f6a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/SpecialRenderInit.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/SpecialRenderInit.java @@ -11,14 +11,14 @@ package de.ellpeck.actuallyadditions.mod.misc.special; import de.ellpeck.actuallyadditions.mod.util.StackUtil; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.Block; -import net.minecraftforge.client.event.RenderPlayerEvent; -import net.minecraftforge.eventbus.api.EventPriority; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.bus.api.EventPriority; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.neoforge.client.event.RenderPlayerEvent; import java.util.HashMap; import java.util.Locale; @@ -72,13 +72,13 @@ public class SpecialRenderInit { } private static ItemStack findItem(ResourceLocation resLoc) { - if (ForgeRegistries.ITEMS.containsKey(resLoc)) { - Item item = ForgeRegistries.ITEMS.getValue(resLoc); + if (BuiltInRegistries.ITEM.containsKey(resLoc)) { + Item item = BuiltInRegistries.ITEM.get(resLoc); if (item != null) { return new ItemStack(item); } - } else if (ForgeRegistries.BLOCKS.containsKey(resLoc)) { - Block block = ForgeRegistries.BLOCKS.getValue(resLoc); + } else if (BuiltInRegistries.BLOCK.containsKey(resLoc)) { + Block block = BuiltInRegistries.BLOCK.get(resLoc); if (block != null) { return new ItemStack(block); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/IDataHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/IDataHandler.java index e6bf22348..41a04ec9a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/IDataHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/network/IDataHandler.java @@ -11,10 +11,10 @@ package de.ellpeck.actuallyadditions.mod.network; import net.minecraft.nbt.CompoundTag; -import net.minecraftforge.network.NetworkEvent; +import net.neoforged.neoforge.network.handling.PlayPayloadContext; public interface IDataHandler { - void handleData(CompoundTag compound, NetworkEvent.Context context); + void handleData(CompoundTag compound, PlayPayloadContext context); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketClientToServer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketClientToServer.java index 6684d2391..7b7eaf541 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketClientToServer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketClientToServer.java @@ -13,49 +13,53 @@ package de.ellpeck.actuallyadditions.mod.network; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.FriendlyByteBuf; -import net.minecraftforge.network.NetworkEvent; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.resources.ResourceLocation; +import net.neoforged.neoforge.network.handling.PlayPayloadContext; +import org.apache.commons.lang3.tuple.Pair; -import java.util.function.Supplier; - -public class PacketClientToServer { - - private CompoundTag data; - private IDataHandler handler; - - public PacketClientToServer() { +public record PacketClientToServer(CompoundTag data, IDataHandler handler) implements CustomPacketPayload { + public static final ResourceLocation ID = new ResourceLocation(ActuallyAdditions.MODID, "client_to_server"); + public PacketClientToServer(Pair data) { + this(data.getLeft(), data.getRight()); } - public PacketClientToServer(CompoundTag data, IDataHandler handler) { - this.data = data; - this.handler = handler; + public PacketClientToServer(final FriendlyByteBuf buffer) { + this(fromBytes(buffer)); } - public static PacketClientToServer fromBytes(FriendlyByteBuf buffer) { + public static Pair fromBytes(FriendlyByteBuf buffer) { try { CompoundTag data = buffer.readNbt(); int handlerId = buffer.readInt(); if (handlerId >= 0 && handlerId < PacketHandler.DATA_HANDLERS.size()) { - return new PacketClientToServer(data, PacketHandler.DATA_HANDLERS.get(handlerId)); + return Pair.of(data, PacketHandler.DATA_HANDLERS.get(handlerId)); } } catch (Exception e) { ActuallyAdditions.LOGGER.error("Something went wrong trying to receive a server packet!", e); } - return new PacketClientToServer(); + return Pair.of(null, null); } - public static void toBytes(PacketClientToServer message, FriendlyByteBuf buffer) { - buffer.writeNbt(message.data); - buffer.writeInt(PacketHandler.DATA_HANDLERS.indexOf(message.handler)); + public void write(FriendlyByteBuf buf) { + buf.writeNbt(data); + buf.writeInt(PacketHandler.DATA_HANDLERS.indexOf(handler)); } - public static void handle(final PacketClientToServer message, final Supplier ctx) { - ctx.get().enqueueWork( () -> { - if (message.data != null && message.handler != null) { - message.handler.handleData(message.data, ctx.get()); - } - }); - ctx.get().setPacketHandled(true); + public static void handle(final PacketClientToServer message, final PlayPayloadContext context) { + context.workHandler().submitAsync( + () -> { + if (message.data != null && message.handler != null) { + message.handler.handleData(message.data, context); + } + } + ); + } + + @Override + public ResourceLocation id() { + return ID; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandler.java index 49ab45a74..bc2db3f23 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandler.java @@ -23,23 +23,21 @@ import net.minecraft.client.Minecraft; import net.minecraft.core.BlockPos; import net.minecraft.core.registries.Registries; import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; -import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.util.FakePlayer; -import net.minecraftforge.network.NetworkDirection; -import net.minecraftforge.network.NetworkEvent; -import net.minecraftforge.network.NetworkRegistry; -import net.minecraftforge.network.PacketDistributor; -import net.minecraftforge.network.simple.SimpleChannel; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.network.PacketDistributor; +import net.neoforged.neoforge.network.event.RegisterPayloadHandlerEvent; +import net.neoforged.neoforge.network.handling.PlayPayloadContext; +import net.neoforged.neoforge.network.registration.IPayloadRegistrar; import java.util.ArrayList; import java.util.List; @@ -50,14 +48,14 @@ public final class PacketHandler { public static final IDataHandler LASER_HANDLER = new IDataHandler() { @Override @OnlyIn(Dist.CLIENT) - public void handleData(CompoundTag compound, NetworkEvent.Context context) { + public void handleData(CompoundTag compound, PlayPayloadContext context) { AssetUtil.spawnLaserWithTimeClient(compound.getDouble("StartX"), compound.getDouble("StartY"), compound.getDouble("StartZ"), compound.getDouble("EndX"), compound.getDouble("EndY"), compound.getDouble("EndZ"), compound.getInt("Color"), compound.getInt("MaxAge"), compound.getDouble("RotationTime"), compound.getFloat("Size"), compound.getFloat("Alpha")); } }; public static final IDataHandler TILE_ENTITY_HANDLER = new IDataHandler() { @Override @OnlyIn(Dist.CLIENT) - public void handleData(CompoundTag compound, NetworkEvent.Context context) { + public void handleData(CompoundTag compound, PlayPayloadContext context) { Level world = Minecraft.getInstance().level; if (world != null) { BlockEntity tile = world.getBlockEntity(new BlockPos(compound.getInt("X"), compound.getInt("Y"), compound.getInt("Z"))); @@ -70,7 +68,7 @@ public final class PacketHandler { public static final IDataHandler LASER_PARTICLE_HANDLER = new IDataHandler() { @Override @OnlyIn(Dist.CLIENT) - public void handleData(CompoundTag compound, NetworkEvent.Context context) { + public void handleData(CompoundTag compound, PlayPayloadContext context) { Minecraft mc = Minecraft.getInstance(); ItemStack stack = ItemStack.of(compound); @@ -90,48 +88,60 @@ public final class PacketHandler { } }; public static final IDataHandler GUI_BUTTON_TO_TILE_HANDLER = (compound, context) -> { - Level world = context.getSender().getServer().getLevel(ResourceKey.create(Registries.DIMENSION, new ResourceLocation(compound.getString("WorldID")))); - BlockEntity tile = world.getBlockEntity(new BlockPos(compound.getInt("X"), compound.getInt("Y"), compound.getInt("Z"))); + if (context.player().isPresent()) { + Player player = context.player().get(); + Level level = player.getServer().getLevel(ResourceKey.create(Registries.DIMENSION, new ResourceLocation(compound.getString("WorldID")))); + BlockEntity tile = level.getBlockEntity(new BlockPos(compound.getInt("X"), compound.getInt("Y"), compound.getInt("Z"))); - if (tile instanceof IButtonReactor reactor) { - Entity entity = world.getEntity(compound.getInt("PlayerID")); - if (entity instanceof Player) { - reactor.onButtonPressed(compound.getInt("ButtonID"), (Player) entity); + if (tile instanceof IButtonReactor reactor) { + Entity entity = level.getEntity(compound.getInt("PlayerID")); + if (entity instanceof Player) { + reactor.onButtonPressed(compound.getInt("ButtonID"), (Player) entity); + } } } }; public static final IDataHandler GUI_BUTTON_TO_CONTAINER_HANDLER = (compound, context) -> { - Level world = context.getSender().getServer().getLevel(ResourceKey.create(Registries.DIMENSION, new ResourceLocation(compound.getString("WorldID")))); - Entity entity = world.getEntity(compound.getInt("PlayerID")); - if (entity instanceof Player) { - AbstractContainerMenu container = ((Player) entity).containerMenu; - if (container instanceof IButtonReactor) { - ((IButtonReactor) container).onButtonPressed(compound.getInt("ButtonID"), (Player) entity); + if (context.player().isPresent()) { + Player player = context.player().get(); + Level level = player.getServer().getLevel(ResourceKey.create(Registries.DIMENSION, new ResourceLocation(compound.getString("WorldID")))); + Entity entity = level.getEntity(compound.getInt("PlayerID")); + if (entity instanceof Player) { + AbstractContainerMenu container = ((Player) entity).containerMenu; + if (container instanceof IButtonReactor) { + ((IButtonReactor) container).onButtonPressed(compound.getInt("ButtonID"), (Player) entity); + } } } }; public static final IDataHandler GUI_NUMBER_TO_TILE_HANDLER = (compound, context) -> { - Level world = context.getSender().getServer().getLevel(ResourceKey.create(Registries.DIMENSION, new ResourceLocation(compound.getString("WorldID")))); - BlockEntity tile = world.getBlockEntity(new BlockPos(compound.getInt("X"), compound.getInt("Y"), compound.getInt("Z"))); + if (context.player().isPresent()) { + Player player = context.player().get(); + Level level = player.getServer().getLevel(ResourceKey.create(Registries.DIMENSION, new ResourceLocation(compound.getString("WorldID")))); + BlockEntity tile = level.getBlockEntity(new BlockPos(compound.getInt("X"), compound.getInt("Y"), compound.getInt("Z"))); - if (tile instanceof INumberReactor reactor) { - reactor.onNumberReceived(compound.getDouble("Number"), compound.getInt("NumberID"), (Player) world.getEntity(compound.getInt("PlayerID"))); + if (tile instanceof INumberReactor reactor) { + reactor.onNumberReceived(compound.getDouble("Number"), compound.getInt("NumberID"), (Player) level.getEntity(compound.getInt("PlayerID"))); + } } }; public static final IDataHandler GUI_STRING_TO_TILE_HANDLER = (compound, context) -> { - Level world = context.getSender().getServer().getLevel(ResourceKey.create(Registries.DIMENSION, new ResourceLocation(compound.getString("WorldID")))); - BlockEntity tile = world.getBlockEntity(new BlockPos(compound.getInt("X"), compound.getInt("Y"), compound.getInt("Z"))); + if (context.player().isPresent()) { + Player player = context.player().get(); + Level level = player.getServer().getLevel(ResourceKey.create(Registries.DIMENSION, new ResourceLocation(compound.getString("WorldID")))); + BlockEntity tile = level.getBlockEntity(new BlockPos(compound.getInt("X"), compound.getInt("Y"), compound.getInt("Z"))); - if (tile instanceof IStringReactor reactor) { - reactor.onTextReceived(compound.getString("Text"), compound.getInt("TextID"), (Player) world.getEntity(compound.getInt("PlayerID"))); + if (tile instanceof IStringReactor reactor) { + reactor.onTextReceived(compound.getString("Text"), compound.getInt("TextID"), (Player) level.getEntity(compound.getInt("PlayerID"))); + } } }; public static final IDataHandler SYNC_PLAYER_DATA = new IDataHandler() { @Override @OnlyIn(Dist.CLIENT) - public void handleData(CompoundTag compound, NetworkEvent.Context context) { + public void handleData(CompoundTag compound, PlayPayloadContext context) { CompoundTag dataTag = compound.getCompound("Data"); - Player player = context.getSender(); //ActuallyAdditions.PROXY.getCurrentPlayer(); + Player player = context.player().get(); //ActuallyAdditions.PROXY.getCurrentPlayer(); if (player != null) { PlayerData.getDataFromPlayer(player).readFromNBT(dataTag, false); @@ -145,52 +155,42 @@ public final class PacketHandler { } }; public static final IDataHandler PLAYER_DATA_TO_SERVER = (compound, context) -> { - Level world = context.getSender().getServer().getLevel(ResourceKey.create(Registries.DIMENSION, new ResourceLocation(compound.getString("World")))); - Player player = world.getServer().getPlayerList().getPlayer(compound.getUUID("UUID")); - if (player != null) { - PlayerData.PlayerSave data = PlayerData.getDataFromPlayer(player); + if (context.player().isPresent()) { + Level level = context.player().get().getServer().getLevel(ResourceKey.create(Registries.DIMENSION, new ResourceLocation(compound.getString("World")))); + Player player = level.getServer().getPlayerList().getPlayer(compound.getUUID("UUID")); + if (player != null) { + PlayerData.PlayerSave data = PlayerData.getDataFromPlayer(player); - int type = compound.getInt("Type"); - if (type == 0) { - data.loadBookmarks(compound.getList("Bookmarks", 8)); - } else if (type == 1) { - data.didBookTutorial = compound.getBoolean("DidBookTutorial"); - } else if (type == 2) { - data.loadTrials(compound.getList("Trials", 8)); + int type = compound.getInt("Type"); + if (type == 0) { + data.loadBookmarks(compound.getList("Bookmarks", 8)); + } else if (type == 1) { + data.didBookTutorial = compound.getBoolean("DidBookTutorial"); + } else if (type == 2) { + data.loadTrials(compound.getList("Trials", 8)); - if (compound.getBoolean("Achievement")) { - //TheAchievements.COMPLETE_TRIALS.get(player); + if (compound.getBoolean("Achievement")) { + //TheAchievements.COMPLETE_TRIALS.get(player); + } } - } - WorldData.get(world).setDirty(); + WorldData.get(level).setDirty(); - if (compound.getBoolean("Log")) { - ActuallyAdditions.LOGGER.info("Receiving changed Player Data for player " + player.getName() + "."); + if (compound.getBoolean("Log")) { + ActuallyAdditions.LOGGER.info("Receiving changed Player Data for player " + player.getName() + "."); + } + } else { + ActuallyAdditions.LOGGER.error("Tried to receive Player Data for UUID " + compound.getUUID("UUID") + ", but he doesn't seem to be present!"); } - } else { - ActuallyAdditions.LOGGER.error("Tried to receive Player Data for UUID " + compound.getUUID("UUID") + ", but he doesn't seem to be present!"); } }; - private static final String PROTOCOL_VERSION = Integer.toString(4); - public static final SimpleChannel THE_NETWORK = NetworkRegistry.newSimpleChannel( - new ResourceLocation(ActuallyAdditions.MODID, "main"), - () -> PROTOCOL_VERSION, - PROTOCOL_VERSION::equals, - PROTOCOL_VERSION::equals - ); - - public static void init() { - THE_NETWORK.messageBuilder(PacketServerToClient.class, 0, NetworkDirection.PLAY_TO_CLIENT) - .decoder(PacketServerToClient::fromBytes) - .encoder(PacketServerToClient::toBytes) - .consumerNetworkThread(PacketServerToClient::handle).add(); - - THE_NETWORK.messageBuilder(PacketClientToServer.class, 1, NetworkDirection.PLAY_TO_SERVER) - .decoder(PacketClientToServer::fromBytes) - .encoder(PacketClientToServer::toBytes) - .consumerNetworkThread(PacketClientToServer::handle).add(); + public static void register(final RegisterPayloadHandlerEvent event) { + final IPayloadRegistrar registrar = event.registrar(ActuallyAdditions.MODID); + registrar.play(PacketServerToClient.ID, PacketServerToClient::new, handler -> handler + .client(PacketServerToClient::handle)); + registrar.play(PacketClientToServer.ID, PacketClientToServer::new, handler -> handler + .server(PacketClientToServer::handle)); DATA_HANDLERS.add(LASER_HANDLER); DATA_HANDLERS.add(TILE_ENTITY_HANDLER); @@ -203,17 +203,7 @@ public final class PacketHandler { DATA_HANDLERS.add(PLAYER_DATA_TO_SERVER); } - public static void sendTo(Object msg, ServerPlayer player) { - if (!(player instanceof FakePlayer)) { - THE_NETWORK.sendTo(msg, player.connection.connection, NetworkDirection.PLAY_TO_CLIENT); - } - } - - public static void sendToServer(Object msg) { - THE_NETWORK.sendToServer(msg); - } - - public static void send(Object msg, PacketDistributor.PacketTarget target) { - THE_NETWORK.send(target, msg); + public static void send(CustomPacketPayload msg, PacketDistributor.PacketTarget target) { + target.send(msg); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandlerHelper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandlerHelper.java index 985c86692..62cabea6a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandlerHelper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandlerHelper.java @@ -20,9 +20,9 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.network.PacketDistributor; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.network.PacketDistributor; public final class PacketHandlerHelper { @@ -36,7 +36,7 @@ public final class PacketHandlerHelper { compound.putString("WorldID", tile.getLevel().dimension().location().toString()); compound.putInt("PlayerID", Minecraft.getInstance().player.getId()); compound.putInt("ButtonID", buttonId); - PacketHandler.THE_NETWORK.sendToServer(new PacketClientToServer(compound, PacketHandler.GUI_BUTTON_TO_TILE_HANDLER)); + PacketDistributor.SERVER.noArg().send(new PacketClientToServer(compound, PacketHandler.GUI_BUTTON_TO_TILE_HANDLER)); } public static void syncPlayerData(Player player, boolean log) { @@ -48,7 +48,7 @@ public final class PacketHandlerHelper { compound.put("Data", data); if (player instanceof ServerPlayer) { - PacketHandler.THE_NETWORK.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new PacketServerToClient(compound, PacketHandler.SYNC_PLAYER_DATA)); + ((ServerPlayer) player).connection.send(new PacketServerToClient(compound, PacketHandler.SYNC_PLAYER_DATA)); } } @@ -84,7 +84,7 @@ public final class PacketHandlerHelper { } } - PacketHandler.THE_NETWORK.sendToServer(new PacketClientToServer(compound, PacketHandler.PLAYER_DATA_TO_SERVER)); + PacketDistributor.SERVER.noArg().send(new PacketClientToServer(compound, PacketHandler.PLAYER_DATA_TO_SERVER)); } } @@ -98,6 +98,6 @@ public final class PacketHandlerHelper { compound.putInt("PlayerID", Minecraft.getInstance().player.getId()); compound.putInt("NumberID", id); compound.putDouble("Number", number); - PacketHandler.THE_NETWORK.sendToServer(new PacketClientToServer(compound, PacketHandler.GUI_NUMBER_TO_TILE_HANDLER)); + PacketDistributor.SERVER.noArg().send(new PacketClientToServer(compound, PacketHandler.GUI_NUMBER_TO_TILE_HANDLER)); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketServerToClient.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketServerToClient.java index 6fb5f0a86..eaf41f360 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketServerToClient.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketServerToClient.java @@ -13,52 +13,54 @@ package de.ellpeck.actuallyadditions.mod.network; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.FriendlyByteBuf; -import net.minecraftforge.network.NetworkEvent; - -import java.util.function.Supplier; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.resources.ResourceLocation; +import net.neoforged.neoforge.network.handling.PlayPayloadContext; +import org.apache.commons.lang3.tuple.Pair; -public class PacketServerToClient { - - private CompoundTag data; - private IDataHandler handler; - - public PacketServerToClient() { +public record PacketServerToClient(CompoundTag data, IDataHandler handler) implements CustomPacketPayload { + public static final ResourceLocation ID = new ResourceLocation(ActuallyAdditions.MODID, "server_to_client"); + public PacketServerToClient(Pair data) { + this(data.getLeft(), data.getRight()); } - public PacketServerToClient(CompoundTag data, IDataHandler handler) { - this.data = data; - this.handler = handler; + public PacketServerToClient(final FriendlyByteBuf buffer) { + this(fromBytes(buffer)); } - public static PacketServerToClient fromBytes(final FriendlyByteBuf buffer) { + public static Pair fromBytes(FriendlyByteBuf buffer) { try { CompoundTag data = buffer.readNbt(); int handlerId = buffer.readInt(); if (handlerId >= 0 && handlerId < PacketHandler.DATA_HANDLERS.size()) { - return new PacketServerToClient(data, PacketHandler.DATA_HANDLERS.get(handlerId)); + return Pair.of(data, PacketHandler.DATA_HANDLERS.get(handlerId)); } } catch (Exception e) { ActuallyAdditions.LOGGER.error("Something went wrong trying to receive a client packet!", e); } - return new PacketServerToClient(); + return Pair.of(null, null); } - public static void toBytes(final PacketServerToClient message, FriendlyByteBuf buffer) { - buffer.writeNbt(message.data); - buffer.writeInt(PacketHandler.DATA_HANDLERS.indexOf(message.handler)); + public void write(FriendlyByteBuf buf) { + buf.writeNbt(data); + buf.writeInt(PacketHandler.DATA_HANDLERS.indexOf(handler)); } - public static void handle(final PacketServerToClient message, final Supplier ctx) { - ctx.get().enqueueWork( + @Override + public ResourceLocation id() { + return ID; + } + + public static void handle(final PacketServerToClient message, final PlayPayloadContext context) { + context.workHandler().submitAsync( () -> { if (message.data != null && message.handler != null) { - message.handler.handleData(message.data, ctx.get()); + message.handler.handleData(message.data, context); } - } - ); - ctx.get().setPacketHandled(true); + } + ); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/particle/ActuallyParticles.java b/src/main/java/de/ellpeck/actuallyadditions/mod/particle/ActuallyParticles.java index e0098657f..f15607fa3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/particle/ActuallyParticles.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/particle/ActuallyParticles.java @@ -2,17 +2,18 @@ package de.ellpeck.actuallyadditions.mod.particle; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import net.minecraft.core.particles.ParticleType; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.minecraft.core.registries.BuiltInRegistries; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredRegister; + +import java.util.function.Supplier; public class ActuallyParticles { - private static final DeferredRegister> PARTICLE_TYPES = DeferredRegister.create(ForgeRegistries.PARTICLE_TYPES, ActuallyAdditions.MODID); + private static final DeferredRegister> PARTICLE_TYPES = DeferredRegister.create(BuiltInRegistries.PARTICLE_TYPE, ActuallyAdditions.MODID); - public static final RegistryObject> LASER_ITEM = PARTICLE_TYPES.register("laser_item", LaserItemParticleType::new); - public static final RegistryObject> BEAM = PARTICLE_TYPES.register("beam", BeamParticleType::new); + public static final Supplier> LASER_ITEM = PARTICLE_TYPES.register("laser_item", LaserItemParticleType::new); + public static final Supplier> BEAM = PARTICLE_TYPES.register("beam", BeamParticleType::new); public static void init(IEventBus evt) { PARTICLE_TYPES.register(evt); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/particle/LaserItemParticleData.java b/src/main/java/de/ellpeck/actuallyadditions/mod/particle/LaserItemParticleData.java index f5b00a846..1dc23cac6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/particle/LaserItemParticleData.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/particle/LaserItemParticleData.java @@ -6,11 +6,11 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.core.particles.ParticleOptions; import net.minecraft.core.particles.ParticleType; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.registries.ForgeRegistries; import java.util.Locale; @@ -33,7 +33,7 @@ public class LaserItemParticleData extends ParticleType i reader.expect(' '); String itemString = reader.readString(); ResourceLocation itemLocation = ResourceLocation.tryParse(itemString); - Item item = itemLocation == null ? null : ForgeRegistries.ITEMS.getValue(itemLocation); + Item item = itemLocation == null ? null : BuiltInRegistries.ITEM.get(itemLocation); ItemStack stack = item == null ? ItemStack.EMPTY : new ItemStack(item); reader.expect(' '); double outputX = reader.readDouble(); @@ -75,7 +75,7 @@ public class LaserItemParticleData extends ParticleType i @Override public void writeToNetwork(FriendlyByteBuf buffer) { - buffer.writeItemStack(this.stack, true); + buffer.writeItem(this.stack); buffer.writeDouble(this.outputX); buffer.writeDouble(this.outputY); buffer.writeDouble(this.outputZ); @@ -83,8 +83,8 @@ public class LaserItemParticleData extends ParticleType i @Override public String writeToString() { - return String.format(Locale.ROOT, "%s %s %.2f %.2f %.2f", ForgeRegistries.PARTICLE_TYPES.getKey(this.getType()), - ForgeRegistries.ITEMS.getKey(this.stack.getItem()), + return String.format(Locale.ROOT, "%s %s %.2f %.2f %.2f", BuiltInRegistries.PARTICLE_TYPE.getKey(this.getType()), + BuiltInRegistries.ITEM.getKey(this.stack.getItem()), this.outputX, this.outputY, this.outputZ); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/CrusherRecipeRegistry.java b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/CrusherRecipeRegistry.java index 29555417d..b1f729393 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/CrusherRecipeRegistry.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/CrusherRecipeRegistry.java @@ -13,6 +13,7 @@ package de.ellpeck.actuallyadditions.mod.recipe; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.mod.crafting.CrushingRecipe; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.RecipeHolder; public final class CrusherRecipeRegistry { // @@ -29,13 +30,13 @@ public final class CrusherRecipeRegistry { // if (ore.substring(0, theCase.theCase.length()).equals(theCase.theCase)) { // String outputOre = theCase.resultPreString + ore.substring(theCase.theCase.length()); // List outputs = OreDictionary.getOres(outputOre, false); - // ItemStack output = outputs.isEmpty() ? ItemStack.EMPTY : outputs.get(0).copy(); - // output.setCount(theCase.resultAmount); - // if (output.isEmpty()) { + // ItemStack stack = outputs.isEmpty() ? ItemStack.EMPTY : outputs.get(0).copy(); + // stack.setCount(theCase.resultAmount); + // if (stack.isEmpty()) { // if (!oresNoResult.contains(ore)) { // oresNoResult.add(ore); // } - // } else ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient(ore), output, StackUtil.getEmpty(), 0); + // } else ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient(ore), stack, StackUtil.getEmpty(), 0); // } // } // } @@ -71,9 +72,9 @@ public final class CrusherRecipeRegistry { // ActuallyAdditions.LOGGER.debug(String.format("Removed %s crusher recipes that had dupliate inputs, %s remain.", removed.size(), usable.size())); // } // - // public static boolean hasBlacklistedOutput(ItemStack output, String[] config) { - // if (StackUtil.isValid(output)) { - // Item item = output.getItem(); + // public static boolean hasBlacklistedOutput(ItemStack stack, String[] config) { + // if (StackUtil.isValid(stack)) { + // Item item = stack.getItem(); // if (item != null) { // String reg = item.getRegistryName().toString(); // @@ -91,7 +92,7 @@ public final class CrusherRecipeRegistry { // } // } // - // if (reg.equals(confReg) && output.getItemDamage() == meta) { return true; } + // if (reg.equals(confReg) && stack.getItemDamage() == meta) { return true; } // } // // return false; @@ -108,8 +109,8 @@ public final class CrusherRecipeRegistry { // } // public static CrushingRecipe getRecipeFromInput(ItemStack input) { - for (CrushingRecipe recipe : ActuallyAdditionsAPI.CRUSHER_RECIPES) - if (recipe.matches(input)) return recipe; + for (RecipeHolder holder : ActuallyAdditionsAPI.CRUSHER_RECIPES) + if (holder.value().matches(input)) return holder.value(); return null; } // diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/sack/SackData.java b/src/main/java/de/ellpeck/actuallyadditions/mod/sack/SackData.java index 7638a8d27..a84abade5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/sack/SackData.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/sack/SackData.java @@ -2,9 +2,8 @@ package de.ellpeck.actuallyadditions.mod.sack; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA; import net.minecraft.nbt.CompoundTag; -import net.minecraftforge.common.util.INBTSerializable; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.IItemHandler; +import net.neoforged.neoforge.common.util.INBTSerializable; +import net.neoforged.neoforge.items.IItemHandler; import java.util.Optional; import java.util.UUID; @@ -15,11 +14,11 @@ public class SackData { private final UUID uuid; private final ItemStackHandlerAA inventory; - private final LazyOptional optional; + private final Optional optional; public final Metadata meta = new Metadata(); - public LazyOptional getOptional() { + public Optional getOptional() { return optional; } @@ -51,7 +50,7 @@ public class SackData { SackManager.get().setDirty(); } }; - optional = LazyOptional.of(() -> inventory); + optional = Optional.ofNullable(inventory); } public SackData(UUID uuid, CompoundTag incoming) { @@ -68,7 +67,7 @@ public class SackData { inventory.deserializeNBT(incoming.getCompound("Inventory")); - optional = LazyOptional.of(() -> inventory); + optional = Optional.ofNullable(inventory); if (incoming.contains("Metadata")) meta.deserializeNBT(incoming.getCompound("Metadata")); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/sack/SackManager.java b/src/main/java/de/ellpeck/actuallyadditions/mod/sack/SackManager.java index 453568033..075c1fd81 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/sack/SackManager.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/sack/SackManager.java @@ -6,10 +6,9 @@ import net.minecraft.nbt.ListTag; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.saveddata.SavedData; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.fml.util.thread.SidedThreadGroups; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.server.ServerLifecycleHooks; +import net.neoforged.fml.util.thread.SidedThreadGroups; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.server.ServerLifecycleHooks; import javax.annotation.Nonnull; import java.util.HashMap; @@ -29,7 +28,7 @@ public class SackManager extends SavedData { public static SackManager get() { if (Thread.currentThread().getThreadGroup() == SidedThreadGroups.SERVER) - return ServerLifecycleHooks.getCurrentServer().getLevel(Level.OVERWORLD).getDataStorage().computeIfAbsent(SackManager::load, SackManager::new, NAME); + return ServerLifecycleHooks.getCurrentServer().getLevel(Level.OVERWORLD).getDataStorage().computeIfAbsent(new Factory<>(SackManager::new, SackManager::load), NAME); else return blankClient; } @@ -48,27 +47,27 @@ public class SackManager extends SavedData { } public void removeSack(UUID uuid) { getSack(uuid).ifPresent(backpack -> { - backpack.getOptional().invalidate(); +// backpack.getOptional().invalidate(); data.remove(uuid); setDirty(); }); } - public LazyOptional getCapability(UUID uuid) { + public Optional getCapability(UUID uuid) { if (data.containsKey(uuid)) return data.get(uuid).getOptional(); - return LazyOptional.empty(); + return Optional.empty(); } - public LazyOptional getCapability(ItemStack stack) { + public Optional getCapability(ItemStack stack) { if (stack.getOrCreateTag().contains("UUID")) { UUID uuid = stack.getTag().getUUID("UUID"); if (data.containsKey(uuid)) return data.get(uuid).getOptional(); } - return LazyOptional.empty(); + return Optional.empty(); } public static SackManager load(CompoundTag nbt) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/CustomEnergyStorage.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/CustomEnergyStorage.java index 89d17e08c..f8c264c9d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/CustomEnergyStorage.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/CustomEnergyStorage.java @@ -11,7 +11,7 @@ package de.ellpeck.actuallyadditions.mod.tile; import net.minecraft.nbt.CompoundTag; -import net.minecraftforge.energy.EnergyStorage; +import net.neoforged.neoforge.energy.EnergyStorage; public class CustomEnergyStorage extends EnergyStorage { boolean dirty = false; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/FilterSettings.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/FilterSettings.java index 68580d557..9651cf699 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/FilterSettings.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/FilterSettings.java @@ -14,10 +14,10 @@ import de.ellpeck.actuallyadditions.mod.inventory.ContainerFilter; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotFilter; import de.ellpeck.actuallyadditions.mod.items.DrillItem; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.registries.ForgeRegistries; public class FilterSettings { public final ItemStackHandlerAA filterInventory; @@ -69,7 +69,7 @@ public class FilterSettings { private static boolean areEqualEnough(ItemStack first, ItemStack second, boolean nbt, boolean mod) { Item firstItem = first.getItem(); Item secondItem = second.getItem(); - if (mod && ForgeRegistries.ITEMS.getKey(firstItem).getNamespace().equals(ForgeRegistries.ITEMS.getKey(secondItem).getNamespace())) { + if (mod && BuiltInRegistries.ITEM.getKey(firstItem).getNamespace().equals(BuiltInRegistries.ITEM.getKey(secondItem).getNamespace())) { return true; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IEnergyDisplay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IEnergyDisplay.java index 810ded57b..8637e7498 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IEnergyDisplay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IEnergyDisplay.java @@ -10,8 +10,8 @@ package de.ellpeck.actuallyadditions.mod.tile; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; public interface IEnergyDisplay { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java index 328e8ba1f..2a4cc1f1f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java @@ -29,16 +29,12 @@ import net.minecraft.world.item.Item; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.block.state.properties.BlockStateProperties; -import net.minecraft.world.phys.AABB; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.neoforge.energy.IEnergyStorage; public class TileEntityAtomicReconstructor extends TileEntityInventoryBase implements IEnergyDisplay, IAtomicReconstructor { public static final int ENERGY_USE = 1000; public final CustomEnergyStorage storage; - public final LazyOptional lazyEnergy; public int counter; private int currentTime; private int oldEnergy; @@ -51,7 +47,6 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple int power = CommonConfig.Machines.RECONSTRUCTOR_POWER.get(); int recieve = Mth.ceil(power * 0.016666F); this.storage = new CustomEnergyStorage(power, recieve, 0); - this.lazyEnergy = LazyOptional.of(() -> this.storage); } public static void shootLaser(IAtomicReconstructor tile, Level world, double startX, double startY, double startZ, double endX, double endY, double endZ, Lens currentLens) { @@ -59,14 +54,6 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple AssetUtil.spawnLaserWithTimeServer(world, startX, startY, startZ, endX, endY, endZ, currentLens.getColor(), 25, 0, 0.2F, 0.8F); } - @Override - public AABB getRenderBoundingBox() { - if (getProgress() > 0.0f) - return new AABB(getPosition(), getPosition().offset(1,1,1).relative(getBlockState().getValue(BlockStateProperties.FACING), 11)); - else - return super.getRenderBoundingBox(); - } - @Override public int getTTL() { return this.ttl; @@ -230,7 +217,7 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple } @Override - public LazyOptional getEnergyStorage(Direction facing) { - return this.lazyEnergy; + public IEnergyStorage getEnergyStorage(Direction facing) { + return this.storage; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java index 0f0f49173..7e85bb333 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java @@ -21,14 +21,10 @@ import net.minecraft.world.entity.player.Player; 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.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.items.IItemHandler; +import net.neoforged.neoforge.energy.IEnergyStorage; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.items.IItemHandler; -import javax.annotation.Nonnull; import javax.annotation.Nullable; public abstract class TileEntityBase extends BlockEntity { @@ -193,7 +189,7 @@ public abstract class TileEntityBase extends BlockEntity { for (Direction side : sides) { BlockEntity tile = this.tilesAround[side.ordinal()]; if (tile != null && provider.canShareTo(tile)) { - WorldUtil.doEnergyInteraction(this, tile, side, amount); + WorldUtil.doEnergyInteraction(this.level, this.getBlockPos(), tile.getBlockPos(), side, amount); } } } @@ -215,7 +211,7 @@ public abstract class TileEntityBase extends BlockEntity { for (Direction side : sides) { BlockEntity tile = this.tilesAround[side.ordinal()]; if (tile != null) { - WorldUtil.doFluidInteraction(this, tile, side, amount); + WorldUtil.doFluidInteraction(this.level, this.getBlockPos(), tile.getBlockPos(), side, amount); } } } @@ -262,29 +258,16 @@ public abstract class TileEntityBase extends BlockEntity { } } - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability capability, @Nullable Direction side) { - if (capability == ForgeCapabilities.ITEM_HANDLER) { - return this.getItemHandler(side).cast(); - } else if (capability == ForgeCapabilities.FLUID_HANDLER) { - return this.getFluidHandler(side).cast(); - } else if (capability == ForgeCapabilities.ENERGY) { - return this.getEnergyStorage(side).cast(); - } - return LazyOptional.empty(); + public IFluidHandler getFluidHandler(Direction facing) { + return null; } - public LazyOptional getFluidHandler(Direction facing) { - return LazyOptional.empty(); + public IEnergyStorage getEnergyStorage(Direction facing) { + return null; } - public LazyOptional getEnergyStorage(Direction facing) { - return LazyOptional.empty(); - } - - public LazyOptional getItemHandler(Direction facing) { - return LazyOptional.empty(); + public IItemHandler getItemHandler(Direction facing) { + return null; } public boolean isRedstoneToggle() { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBatteryBox.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBatteryBox.java index b81879c69..9ca8de363 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBatteryBox.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBatteryBox.java @@ -20,12 +20,12 @@ 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 net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.energy.IEnergyStorage; import java.util.ArrayList; import java.util.List; +import java.util.Optional; public class TileEntityBatteryBox extends TileEntityInventoryBase implements ISharingEnergyProvider { @@ -37,12 +37,12 @@ public class TileEntityBatteryBox extends TileEntityInventoryBase implements ISh } @Override - public LazyOptional getEnergyStorage(Direction facing) { + public IEnergyStorage getEnergyStorage(Direction facing) { ItemStack stack = this.inv.getStackInSlot(0); if (stack.getItem() instanceof ItemBattery) { - return stack.getCapability(ForgeCapabilities.ENERGY, null); + return stack.getCapability(Capabilities.EnergyStorage.ITEM, null); } - return LazyOptional.empty(); + return null; } public static void clientTick(Level level, BlockPos pos, BlockState state, T t) { @@ -55,7 +55,7 @@ public class TileEntityBatteryBox extends TileEntityInventoryBase implements ISh if (t instanceof TileEntityBatteryBox tile) { tile.serverTick(); - LazyOptional cap = tile.getEnergyStorage(null); + Optional cap = Optional.ofNullable(tile.getEnergyStorage(null)); int currStorage = cap.map(storage -> { ItemStack stack = tile.inv.getStackInSlot(0); if (!stack.isEmpty() && ItemUtil.isEnabled(stack)) { @@ -75,7 +75,7 @@ public class TileEntityBatteryBox extends TileEntityInventoryBase implements ISh for (TileEntityBatteryBox te : tiles) { ItemStack battery = te.inv.getStackInSlot(0); if (!battery.isEmpty() && !ItemUtil.isEnabled(battery)) { - int received = te.getCapability(ForgeCapabilities.ENERGY, null).map(e -> e.receiveEnergy(maxPer, false)).orElse(0); + int received = Optional.ofNullable(level.getCapability(Capabilities.EnergyStorage.BLOCK, te.getBlockPos(), null)).map(e -> e.receiveEnergy(maxPer, false)).orElse(0); storage.extractEnergy(received, false); if (storage.getEnergyStored() <= 0) { @@ -109,7 +109,7 @@ public class TileEntityBatteryBox extends TileEntityInventoryBase implements ISh @Override public int getComparatorStrength() { - return this.getEnergyStorage(null) + return Optional.ofNullable(this.getEnergyStorage(null)) .map(cap -> (int) ((float) cap.getEnergyStored() / (float) cap.getMaxEnergyStored() * 15F)) .orElse(0); } @@ -156,7 +156,7 @@ public class TileEntityBatteryBox extends TileEntityInventoryBase implements ISh @Override public int getEnergyToSplitShare() { - return this.getEnergyStorage(null) + return Optional.ofNullable(this.getEnergyStorage(null)) .map(IEnergyStorage::getEnergyStored) .orElse(0); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBioReactor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBioReactor.java index 1eaa879e9..26cf0f1d9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBioReactor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBioReactor.java @@ -31,9 +31,8 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.BonemealableBlock; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.IPlantable; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.neoforge.common.IPlantable; +import net.neoforged.neoforge.energy.IEnergyStorage; import javax.annotation.Nullable; import java.util.ArrayList; @@ -42,7 +41,6 @@ import java.util.List; public class TileEntityBioReactor extends TileEntityInventoryBase implements MenuProvider, ISharingEnergyProvider { public final CustomEnergyStorage storage = new CustomEnergyStorage(200000, 0, 800); - public final LazyOptional lazyEnergy = LazyOptional.of(() -> this.storage); public int burnTime; public int maxBurnTime; @@ -177,8 +175,8 @@ public class TileEntityBioReactor extends TileEntityInventoryBase implements Men } @Override - public LazyOptional getEnergyStorage(Direction facing) { - return this.lazyEnergy; + public IEnergyStorage getEnergyStorage(Direction facing) { + return this.storage; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java index ecdac1286..b8018c0a2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java @@ -13,7 +13,6 @@ package de.ellpeck.actuallyadditions.mod.tile; import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.inventory.ContainerBreaker; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor; -import de.ellpeck.actuallyadditions.mod.util.NetHandlerSpaghettiServer; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.core.BlockPos; @@ -32,9 +31,9 @@ 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.minecraftforge.common.util.FakePlayer; -import net.minecraftforge.common.util.FakePlayerFactory; -import net.minecraftforge.fluids.IFluidBlock; +import net.neoforged.neoforge.common.util.FakePlayer; +import net.neoforged.neoforge.common.util.FakePlayerFactory; +import net.neoforged.neoforge.fluids.IFluidBlock; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -107,9 +106,6 @@ public class TileEntityBreaker extends TileEntityInventoryBase implements MenuPr if (!this.isPlacer && blockToBreak != Blocks.AIR && !(blockToBreak instanceof IFluidBlock) && stateToBreak.getDestroySpeed(this.level, breakCoords) >= 0.0F) { List drops = Block.getDrops(stateToBreak, (ServerLevel) this.level, breakCoords, this.level.getBlockEntity(breakCoords)); FakePlayer fake = FakePlayerFactory.getMinecraft((ServerLevel) this.level); - if (fake.connection == null) { - fake.connection = new NetHandlerSpaghettiServer(fake); - } if (stateToBreak.canHarvestBlock(this.level, breakCoords, fake)) { //TODO might double check this is right mikey if (StackUtil.canAddAll(this.inv, drops, false)) { this.level.destroyBlock(breakCoords, false); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java index e55cce3f3..84371cd24 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java @@ -28,16 +28,16 @@ import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.level.Level; 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.api.distmarker.OnlyIn; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidType; -import net.minecraftforge.fluids.capability.IFluidHandler; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.energy.IEnergyStorage; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.FluidType; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; import javax.annotation.Nullable; import java.util.Optional; @@ -47,10 +47,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements Me public static final int ENERGY_USE = 35; private static final int TIME = 30; public final CustomEnergyStorage storage = new CustomEnergyStorage(40000, 100, 0); - public final LazyOptional lazyEnergy = LazyOptional.of(() -> this.storage); - public final OutputOnlyFluidTank tank = new OutputOnlyFluidTank(2 * FluidType.BUCKET_VOLUME); - public final LazyOptional lazyFluid = LazyOptional.of(() -> this.tank); public int currentProcessTime; private int lastEnergyStored; @@ -106,8 +103,9 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements Me if (t instanceof TileEntityCanolaPress tile) { tile.serverTick(); - Optional recipe = getRecipeForInput(tile.inv.getStackInSlot(0)); - recipe.ifPresent(r -> { + Optional> recipe = getRecipeForInput(tile.inv.getStackInSlot(0)); + recipe.ifPresent(h -> { + PressingRecipe r = h.value(); if ((r.getOutput().isFluidEqual(tile.tank.getFluid()) || tile.tank.isEmpty()) && r.getOutput().getAmount() <= tile.tank.getCapacity() - tile.tank.getFluidAmount()) { if (tile.storage.getEnergyStored() >= ENERGY_USE) { tile.currentProcessTime++; @@ -138,8 +136,8 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements Me return getRecipeForInput(stack).isPresent(); } - public static Optional getRecipeForInput(ItemStack stack) { - return ActuallyAdditionsAPI.PRESSING_RECIPES.stream().filter(recipe -> recipe.matches(new SingleItem(stack), null)).findFirst(); + public static Optional> getRecipeForInput(ItemStack stack) { + return ActuallyAdditionsAPI.PRESSING_RECIPES.stream().filter(recipe -> recipe.value().matches(new SingleItem(stack), null)).findFirst(); } @Override @@ -153,8 +151,8 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements Me } @Override - public LazyOptional getFluidHandler(Direction facing) { - return this.lazyFluid; + public IFluidHandler getFluidHandler(Direction facing) { + return this.tank; } @Override @@ -173,8 +171,8 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements Me } @Override - public LazyOptional getEnergyStorage(Direction facing) { - return this.lazyEnergy; + public IEnergyStorage getEnergyStorage(Direction facing) { + return this.storage; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java index 3ab329e85..d48196eb0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java @@ -27,28 +27,27 @@ import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.level.Level; 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.api.distmarker.OnlyIn; -import net.minecraftforge.common.ForgeHooks; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.common.CommonHooks; +import net.neoforged.neoforge.energy.IEnergyStorage; import javax.annotation.Nullable; public class TileEntityCoalGenerator extends TileEntityInventoryBase implements MenuProvider, ISharingEnergyProvider, IEnergyDisplay { public final CustomEnergyStorage storage = new CustomEnergyStorage(60000, 0, 80); - public final LazyOptional lazyEnergy = LazyOptional.of(() -> this.storage); public int maxBurnTime; public int currentBurnTime; private int lastEnergy; private int lastBurnTime; private int lastCurrentBurnTime; private int lastCompare; - private SolidFuelRecipe currentRecipe = null; + private RecipeHolder currentRecipe = null; public TileEntityCoalGenerator(BlockPos pos, BlockState state) { super(ActuallyBlocks.COAL_GENERATOR.getTileEntityType(), pos, state, 1); @@ -70,7 +69,7 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements compound.putInt("BurnTime", this.currentBurnTime); compound.putInt("MaxBurnTime", this.maxBurnTime); if (currentRecipe != null) - compound.putString("currentRecipe", currentRecipe.getId().toString()); + compound.putString("currentRecipe", currentRecipe.id().toString()); } this.storage.writeToNBT(compound); super.writeSyncableNBT(compound, type); @@ -83,8 +82,8 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements this.maxBurnTime = compound.getInt("MaxBurnTime"); if (compound.contains("currentRecipe")) { ResourceLocation id = new ResourceLocation(compound.getString("currentRecipe")); - for (SolidFuelRecipe fuelRecipe : ActuallyAdditionsAPI.SOLID_FUEL_RECIPES) { - if (fuelRecipe.getId().equals(id)) { + for (RecipeHolder fuelRecipe : ActuallyAdditionsAPI.SOLID_FUEL_RECIPES) { + if (fuelRecipe.id().equals(id)) { this.currentRecipe = fuelRecipe; break; } @@ -109,7 +108,7 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements if (tile.currentBurnTime > 0 && tile.currentRecipe != null) { tile.currentBurnTime--; - int produce = tile.currentRecipe.getTotalEnergy() / tile.currentRecipe.getBurnTime(); + int produce = tile.currentRecipe.value().getTotalEnergy() / tile.currentRecipe.value().getBurnTime(); if (produce > 0) { tile.storage.receiveEnergyInternal(produce, false); } @@ -118,9 +117,9 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements if (!tile.isRedstonePowered && tile.currentBurnTime <= 0 && tile.storage.getEnergyStored() < tile.storage.getMaxEnergyStored()) { ItemStack stack = tile.inv.getStackInSlot(0); if (!stack.isEmpty()) { - ActuallyAdditionsAPI.SOLID_FUEL_RECIPES.stream().filter(r -> r.matches(stack)).findFirst().ifPresent(recipe -> { + ActuallyAdditionsAPI.SOLID_FUEL_RECIPES.stream().filter(r -> r.value().matches(stack)).findFirst().ifPresent(recipe -> { tile.currentRecipe = recipe; - tile.maxBurnTime = recipe.getBurnTime(); + tile.maxBurnTime = recipe.value().getBurnTime(); tile.currentBurnTime = tile.maxBurnTime; tile.inv.setStackInSlot(0, StackUtil.shrinkForContainer(stack, 1)); }); @@ -150,8 +149,8 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements @Override public IAcceptor getAcceptor() { return (slot, stack, automation) -> { - for (SolidFuelRecipe recipe : ActuallyAdditionsAPI.SOLID_FUEL_RECIPES) { - if (recipe.matches(stack))return true; + for (RecipeHolder recipe : ActuallyAdditionsAPI.SOLID_FUEL_RECIPES) { + if (recipe.value().matches(stack))return true; } return false; }; @@ -163,7 +162,7 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements if (!automation) { return true; } - return ForgeHooks.getBurnTime(this.inv.getStackInSlot(0), null) <= 0; + return CommonHooks.getBurnTime(this.inv.getStackInSlot(0), null) <= 0; }; } @@ -188,8 +187,8 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements } @Override - public LazyOptional getEnergyStorage(Direction facing) { - return this.lazyEnergy; + public IEnergyStorage getEnergyStorage(Direction facing) { + return this.storage; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java index cc5b91063..e6d97bf04 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java @@ -35,14 +35,13 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.Fluids; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidType; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.templates.FluidTank; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.energy.IEnergyStorage; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.FluidType; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.fluids.capability.templates.FluidTank; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -59,7 +58,6 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements public static final int TIME_USED = 500; public final CustomEnergyStorage storage = new CustomEnergyStorage(300000, 250, 0); - public final LazyOptional lazyEnergy = LazyOptional.of(() -> this.storage); public final FluidTank tank = new FluidTank(4 * FluidType.BUCKET_VOLUME) { @Nonnull @@ -79,7 +77,6 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements return fluid.getFluid() == Fluids.WATER; } }; - public final LazyOptional lazyTank = LazyOptional.of(() -> this.tank); public int coffeeCacheAmount; public int brewTime; @@ -225,8 +222,8 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements } @Override - public LazyOptional getFluidHandler(Direction facing) { - return this.lazyTank; + public IFluidHandler getFluidHandler(Direction facing) { + return this.tank; } @Override @@ -245,8 +242,8 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements } @Override - public LazyOptional getEnergyStorage(Direction facing) { - return this.lazyEnergy; + public IEnergyStorage getEnergyStorage(Direction facing) { + return this.storage; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java index 80f8ade57..5b7bcadc8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java @@ -81,9 +81,9 @@ // if (this.recipe != null) { // this.conversionTime++; // if (this.conversionTime >= COMPOST_TIME_TICKS) { -// ItemStack output = this.recipe.getOutput().copy(); -// output.setCount(input.getCount()); -// this.inv.setStackInSlot(0, output); +// ItemStack stack = this.recipe.getOutput().copy(); +// stack.setCount(input.getCount()); +// this.inv.setStackInSlot(0, stack); // this.conversionTime = 0; // this.markDirty(); // } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCrusher.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCrusher.java index af0f05012..5edc2d516 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCrusher.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCrusher.java @@ -29,13 +29,13 @@ import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.level.Level; 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.properties.BlockStateProperties; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.neoforge.energy.IEnergyStorage; import javax.annotation.Nullable; import java.util.Optional; @@ -50,7 +50,6 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto public static final int SLOT_OUTPUT_2_2 = 5; public static final int ENERGY_USE = 40; public final CustomEnergyStorage storage = new CustomEnergyStorage(60000, 100, 0); - public final LazyOptional lazyEnergy = LazyOptional.of(() -> this.storage); public int firstCrushTime; public int secondCrushTime; public boolean isDouble; @@ -193,17 +192,17 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto return (slot, automation) -> !automation || slot == SLOT_OUTPUT_1_1 || slot == SLOT_OUTPUT_1_2 || slot == SLOT_OUTPUT_2_1 || slot == SLOT_OUTPUT_2_2; } - public static Optional getRecipeForInput(ItemStack itemStack) { - return ActuallyAdditionsAPI.CRUSHER_RECIPES.stream().filter($ -> $.matches(itemStack)).findFirst(); + public static Optional> getRecipeForInput(ItemStack itemStack) { + return ActuallyAdditionsAPI.CRUSHER_RECIPES.stream().filter($ -> $.value().matches(itemStack)).findFirst(); } public boolean canCrushOn(int theInput, int theFirstOutput, int theSecondOutput) { ItemStack inputStack = this.inv.getStackInSlot(theInput); if (!inputStack.isEmpty()) { - Optional recipeOpt = getRecipeForInput(inputStack); + Optional> recipeOpt = getRecipeForInput(inputStack); if (!recipeOpt.isPresent()) { return false; } - CrushingRecipe recipe = recipeOpt.get(); + CrushingRecipe recipe = recipeOpt.get().value(); ItemStack outputOne = recipe.getOutputOne(); ItemStack outputTwo = recipe.getOutputTwo(); if (!outputOne.isEmpty()) { @@ -220,11 +219,11 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto } public void finishCrushing(int theInput, int theFirstOutput, int theSecondOutput) { - Optional recipeOpt = getRecipeForInput(this.inv.getStackInSlot(theInput)); + Optional> recipeOpt = getRecipeForInput(this.inv.getStackInSlot(theInput)); if (!recipeOpt.isPresent()) { return; } - CrushingRecipe recipe = recipeOpt.get(); + CrushingRecipe recipe = recipeOpt.get().value(); ItemStack outputOne = recipe.getOutputOne(); if (!outputOne.isEmpty()) { @@ -271,8 +270,8 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto } @Override - public LazyOptional getEnergyStorage(Direction facing) { - return this.lazyEnergy; + public IEnergyStorage getEnergyStorage(Direction facing) { + return this.storage; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDisplayStand.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDisplayStand.java index 9e203ddfd..ef4c19a29 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDisplayStand.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDisplayStand.java @@ -23,13 +23,11 @@ import net.minecraft.world.level.Level; 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.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.neoforge.energy.IEnergyStorage; public class TileEntityDisplayStand extends TileEntityInventoryBase implements IEnergyDisplay { public final CustomEnergyStorage storage = new CustomEnergyStorage(80000, 1000, 0); - public final LazyOptional lazyEnergy = LazyOptional.of(() -> this.storage); private int oldEnergy; public TileEntityDisplayStand(BlockPos pos, BlockState state) { @@ -109,8 +107,8 @@ public class TileEntityDisplayStand extends TileEntityInventoryBase implements I } @Override - public LazyOptional getEnergyStorage(Direction facing) { - return this.lazyEnergy; + public IEnergyStorage getEnergyStorage(Direction facing) { + return this.storage; } public ItemStack getStack() { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEmpowerer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEmpowerer.java index 2dac0afa4..e645a5f9c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEmpowerer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEmpowerer.java @@ -23,20 +23,21 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.server.ServerLifecycleHooks; +import net.neoforged.neoforge.server.ServerLifecycleHooks; import javax.annotation.Nullable; public class TileEntityEmpowerer extends TileEntityInventoryBase { public int processTime; - private EmpowererRecipe currentRecipe = null; - private EmpowererRecipe lastRecipe = null; + private RecipeHolder currentRecipe = null; + private RecipeHolder lastRecipe = null; - public EmpowererRecipe getCurrentRecipe(){ + public RecipeHolder getCurrentRecipe(){ return this.currentRecipe; } @@ -45,8 +46,8 @@ public class TileEntityEmpowerer extends TileEntityInventoryBase { } public static boolean isPossibleInput(ItemStack stack) { - for (EmpowererRecipe r : ServerLifecycleHooks.getCurrentServer().getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.EMPOWERING.get())) { - if (r.getInput().test(stack)) { + for (RecipeHolder r : ServerLifecycleHooks.getCurrentServer().getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.EMPOWERING.get())) { + if (r.value().getInput().test(stack)) { return true; } } @@ -54,9 +55,9 @@ public class TileEntityEmpowerer extends TileEntityInventoryBase { } @Nullable - public static EmpowererRecipe findMatchingRecipe(ItemStack base, ItemStack stand1, ItemStack stand2, ItemStack stand3, ItemStack stand4) { - for (EmpowererRecipe r : ServerLifecycleHooks.getCurrentServer().getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.EMPOWERING.get())) { - if (r.matches(base, stand1, stand2, stand3, stand4)) { + public static RecipeHolder findMatchingRecipe(ItemStack base, ItemStack stand1, ItemStack stand2, ItemStack stand3, ItemStack stand4) { + for (RecipeHolder r : ServerLifecycleHooks.getCurrentServer().getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.EMPOWERING.get())) { + if (r.value().matches(base, stand1, stand2, stand3, stand4)) { return r; } } @@ -75,9 +76,10 @@ public class TileEntityEmpowerer extends TileEntityInventoryBase { TileEntityDisplayStand[] stands = tile.getNearbyStands(); if (stands != null) { - EmpowererRecipe recipe = findMatchingRecipe(tile.inv.getStackInSlot(0), stands[0].getStack(), stands[1].getStack(), stands[2].getStack(), stands[3].getStack()); - if (recipe != null) { - tile.currentRecipe = recipe; + RecipeHolder holder = findMatchingRecipe(tile.inv.getStackInSlot(0), stands[0].getStack(), stands[1].getStack(), stands[2].getStack(), stands[3].getStack()); + if (holder != null) { + tile.currentRecipe = holder; + EmpowererRecipe recipe = holder.value(); boolean hasPower = true; @@ -153,7 +155,7 @@ public class TileEntityEmpowerer extends TileEntityInventoryBase { } if (type == NBTType.SYNC) { if (this.currentRecipe != null) - compound.putString("CurrentRecipe", this.currentRecipe.getId().toString()); + compound.putString("CurrentRecipe", this.currentRecipe.id().toString()); else compound.putString("CurrentRecipe", ""); } @@ -168,8 +170,8 @@ public class TileEntityEmpowerer extends TileEntityInventoryBase { if (type == NBTType.SYNC && compound.contains("CurrentRecipe")) { if (!compound.getString("CurrentRecipe").isEmpty()) { ResourceLocation id = new ResourceLocation(compound.getString("CurrentRecipe")); - for (EmpowererRecipe empowererRecipe : ActuallyAdditionsAPI.EMPOWERER_RECIPES) { - if (empowererRecipe.getId().equals(id)) { + for (RecipeHolder empowererRecipe : ActuallyAdditionsAPI.EMPOWERER_RECIPES) { + if (empowererRecipe.id().equals(id)) { this.currentRecipe = empowererRecipe; break; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnergizer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnergizer.java index 2512e040f..665fbac47 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnergizer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnergizer.java @@ -27,16 +27,15 @@ import net.minecraft.world.item.enchantment.EnchantmentHelper; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.energy.IEnergyStorage; import javax.annotation.Nullable; +import java.util.Optional; public class TileEntityEnergizer extends TileEntityInventoryBase implements MenuProvider { public final CustomEnergyStorage storage = new CustomEnergyStorage(50000, 1000, 0); - public final LazyOptional lazyEnergy = LazyOptional.of(() -> this.storage); private int lastEnergy; public TileEntityEnergizer(BlockPos pos, BlockState state) { @@ -67,8 +66,10 @@ public class TileEntityEnergizer extends TileEntityInventoryBase implements Menu if (StackUtil.isValid(tile.inv.getStackInSlot(0)) && !StackUtil.isValid(tile.inv.getStackInSlot(1))) { if (tile.storage.getEnergyStored() > 0) { - int received = tile.inv.getStackInSlot(0).getCapability(ForgeCapabilities.ENERGY, null).map(cap -> cap.receiveEnergy(tile.storage.getEnergyStored(), false)).orElse(0); - boolean canTakeUp = tile.inv.getStackInSlot(0).getCapability(ForgeCapabilities.ENERGY, null).map(cap -> cap.getEnergyStored() >= cap.getMaxEnergyStored()).orElse(false); + Optional capability = Optional.ofNullable(tile.inv.getStackInSlot(0).getCapability(Capabilities.EnergyStorage.ITEM, null)); + + int received = capability.map(cap -> cap.receiveEnergy(tile.storage.getEnergyStored(), false)).orElse(0); + boolean canTakeUp = capability.map(cap -> cap.getEnergyStored() >= cap.getMaxEnergyStored()).orElse(false); if (received > 0) { tile.storage.extractEnergyInternal(received, false); @@ -89,7 +90,7 @@ public class TileEntityEnergizer extends TileEntityInventoryBase implements Menu @Override public IAcceptor getAcceptor() { - return (slot, stack, automation) -> !automation || slot == 0 && stack.getCapability(ForgeCapabilities.ENERGY, null).isPresent(); + return (slot, stack, automation) -> !automation || slot == 0 && stack.getCapability(Capabilities.EnergyStorage.ITEM, null) != null; } @Override @@ -102,8 +103,8 @@ public class TileEntityEnergizer extends TileEntityInventoryBase implements Menu } @Override - public LazyOptional getEnergyStorage(Direction facing) { - return this.lazyEnergy; + public IEnergyStorage getEnergyStorage(Direction facing) { + return this.storage; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java index 4f345f30b..552e42d55 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java @@ -26,16 +26,15 @@ import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.energy.IEnergyStorage; import javax.annotation.Nullable; +import java.util.Optional; public class TileEntityEnervator extends TileEntityInventoryBase implements ISharingEnergyProvider, MenuProvider { public final CustomEnergyStorage storage = new CustomEnergyStorage(50000, 0, 1000); - public final LazyOptional lazyEnergy = LazyOptional.of(() -> this.storage); private int lastEnergy; public TileEntityEnervator(BlockPos pos, BlockState state) { @@ -66,7 +65,7 @@ public class TileEntityEnervator extends TileEntityInventoryBase implements ISha if (StackUtil.isValid(tile.inv.getStackInSlot(0)) && !StackUtil.isValid(tile.inv.getStackInSlot(1))) { if (tile.storage.getEnergyStored() < tile.storage.getMaxEnergyStored()) { - LazyOptional capability = tile.inv.getStackInSlot(0).getCapability(ForgeCapabilities.ENERGY, null); + Optional capability = Optional.ofNullable(tile.inv.getStackInSlot(0).getCapability(Capabilities.EnergyStorage.ITEM, null)); int maxExtract = tile.storage.getMaxEnergyStored() - tile.storage.getEnergyStored(); int extracted = capability.map(cap -> cap.extractEnergy(maxExtract, false)).orElse(0); @@ -91,7 +90,7 @@ public class TileEntityEnervator extends TileEntityInventoryBase implements ISha @Override public IAcceptor getAcceptor() { - return (slot, stack, automation) -> !automation || slot == 0 && stack.getCapability(ForgeCapabilities.ENERGY, null).isPresent(); + return (slot, stack, automation) -> !automation || slot == 0 && stack.getCapability(Capabilities.EnergyStorage.ITEM, null) != null; } @Override @@ -124,8 +123,8 @@ public class TileEntityEnervator extends TileEntityInventoryBase implements ISha } @Override - public LazyOptional getEnergyStorage(Direction facing) { - return this.lazyEnergy; + public IEnergyStorage getEnergyStorage(Direction facing) { + return this.storage; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFarmer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFarmer.java index caee49e52..c4d7711bc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFarmer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFarmer.java @@ -35,8 +35,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.properties.BlockStateProperties; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.neoforge.energy.IEnergyStorage; import javax.annotation.Nullable; import java.util.ArrayList; @@ -47,7 +46,6 @@ public class TileEntityFarmer extends TileEntityInventoryBase implements IFarmer private static final List SORTED_FARMER_BEHAVIORS = new ArrayList<>(); public final CustomEnergyStorage storage = new CustomEnergyStorage(100000, 1000, 0); - public final LazyOptional lazyEnergy = LazyOptional.of(() -> this.storage); private int waitTime; private int checkX; private int checkY; @@ -177,8 +175,8 @@ public class TileEntityFarmer extends TileEntityInventoryBase implements IFarmer } @Override - public LazyOptional getEnergyStorage(Direction facing) { - return this.lazyEnergy; + public IEnergyStorage getEnergyStorage(Direction facing) { + return this.storage; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java index d35bb7b53..3b7eb02ff 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java @@ -22,16 +22,16 @@ import net.minecraft.world.MenuProvider; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.level.Level; 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.api.distmarker.OnlyIn; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidType; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.templates.FluidTank; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.FluidType; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.fluids.capability.templates.FluidTank; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -39,14 +39,13 @@ import java.util.Optional; public class TileEntityFermentingBarrel extends TileEntityBase implements ISharingFluidHandler, MenuProvider { public final FermentingBarrelMultiTank tanks = new FermentingBarrelMultiTank(); - public final LazyOptional fluidOptional = LazyOptional.of(()->tanks); public int currentProcessTime; private int lastInput; private int lastOutput; private int lastProcessTime; private int lastCompare; - private FermentingRecipe currentRecipe; + private RecipeHolder currentRecipe; public TileEntityFermentingBarrel(BlockPos pos, BlockState state) { super(ActuallyBlocks.FERMENTING_BARREL.getTileEntityType(), pos, state); @@ -57,7 +56,7 @@ public class TileEntityFermentingBarrel extends TileEntityBase implements IShari compound.putInt("ProcessTime", this.currentProcessTime); compound.put("tanks", tanks.writeNBT()); if (currentRecipe != null) - compound.putString("currentRecipe", currentRecipe.getId().toString()); + compound.putString("currentRecipe", currentRecipe.id().toString()); super.writeSyncableNBT(compound, type); } @@ -68,7 +67,7 @@ public class TileEntityFermentingBarrel extends TileEntityBase implements IShari tanks.readNBT(compound.getCompound("tanks")); } if (compound.contains("currentRecipe")) { - this.currentRecipe = ActuallyAdditionsAPI.FERMENTING_RECIPES.stream().filter(recipe -> recipe.getId().toString().equals(compound.getString("currentRecipe"))).findFirst().orElse(null); + this.currentRecipe = ActuallyAdditionsAPI.FERMENTING_RECIPES.stream().filter(recipe -> recipe.id().toString().equals(compound.getString("currentRecipe"))).findFirst().orElse(null); } super.readSyncableNBT(compound, type); } @@ -86,19 +85,20 @@ public class TileEntityFermentingBarrel extends TileEntityBase implements IShari if (tile.currentRecipe == null) { //No recipe currently selected, check for one every 20 ticks if (tile.ticksElapsed % 20 == 0) - tile.currentRecipe = ActuallyAdditionsAPI.FERMENTING_RECIPES.stream().filter(recipe -> recipe.matches(tile.tanks.getFluidInTank(0), tile.tanks.getFluidInTank(1))).findFirst().orElse(null); + tile.currentRecipe = ActuallyAdditionsAPI.FERMENTING_RECIPES.stream().filter(recipe -> recipe.value().matches(tile.tanks.getFluidInTank(0), tile.tanks.getFluidInTank(1))).findFirst().orElse(null); } else { - if (tile.tanks.getFluidInTank(0).getAmount() >= tile.currentRecipe.getInput().getAmount() && - tile.tanks.getFluidInTank(0).getFluid().isSame(tile.currentRecipe.getInput().getFluid()) && - (tile.tanks.getFluidInTank(1).getFluid().isSame(tile.currentRecipe.getOutput().getFluid()) || tile.tanks.getFluidInTank(1).isEmpty()) && - tile.currentRecipe.getOutput().getAmount() <= tile.tanks.getTankCapacity(1) - tile.tanks.getFluidInTank(1).getAmount()) { + FermentingRecipe recipe = tile.currentRecipe.value(); + if (tile.tanks.getFluidInTank(0).getAmount() >= recipe.getInput().getAmount() && + tile.tanks.getFluidInTank(0).getFluid().isSame(recipe.getInput().getFluid()) && + (tile.tanks.getFluidInTank(1).getFluid().isSame(recipe.getOutput().getFluid()) || tile.tanks.getFluidInTank(1).isEmpty()) && + recipe.getOutput().getAmount() <= tile.tanks.getTankCapacity(1) - tile.tanks.getFluidInTank(1).getAmount()) { tile.currentProcessTime++; - if (tile.currentProcessTime >= tile.currentRecipe.getTime()) { + if (tile.currentProcessTime >= recipe.getTime()) { tile.currentProcessTime = 0; - tile.tanks.outputTank.fill(tile.currentRecipe.getOutput().copy(), IFluidHandler.FluidAction.EXECUTE); - tile.tanks.inputTank.getFluid().shrink(tile.currentRecipe.getInput().getAmount()); + tile.tanks.outputTank.fill(recipe.getOutput().copy(), IFluidHandler.FluidAction.EXECUTE); + tile.tanks.inputTank.getFluid().shrink(recipe.getInput().getAmount()); } } else { tile.currentProcessTime = 0; @@ -129,7 +129,7 @@ public class TileEntityFermentingBarrel extends TileEntityBase implements IShari @OnlyIn(Dist.CLIENT) public int getProcessScaled(int i) { if (currentRecipe != null) - return this.currentProcessTime * i / currentRecipe.getTime(); + return this.currentProcessTime * i / currentRecipe.value().getTime(); else return this.currentProcessTime * i / 100; } @@ -145,8 +145,8 @@ public class TileEntityFermentingBarrel extends TileEntityBase implements IShari } @Override - public LazyOptional getFluidHandler(Direction facing) { - return fluidOptional; + public IFluidHandler getFluidHandler(Direction facing) { + return tanks; } @Override @@ -180,8 +180,8 @@ public class TileEntityFermentingBarrel extends TileEntityBase implements IShari return getRecipeForInput(stack).isPresent(); } - public static Optional getRecipeForInput(FluidStack stack) { - return ActuallyAdditionsAPI.FERMENTING_RECIPES.stream().filter(recipe -> recipe.matches(stack)).findFirst(); + public static Optional> getRecipeForInput(FluidStack stack) { + return ActuallyAdditionsAPI.FERMENTING_RECIPES.stream().filter(recipe -> recipe.value().matches(stack)).findFirst(); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java index 306371e64..0dd462531 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java @@ -33,8 +33,7 @@ import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.neoforge.energy.IEnergyStorage; import javax.annotation.Nullable; import java.util.ArrayList; @@ -44,7 +43,6 @@ public class TileEntityFireworkBox extends TileEntityBase implements IEnergyDisp public static final int USE_PER_SHOT = 500; public final CustomEnergyStorage storage = new CustomEnergyStorage(20000, 200, 0); - public final LazyOptional lazyEnergy = LazyOptional.of(() -> this.storage); public int intValuePlay = 2; public int chargeAmount = 2; public int flightTime = 2; @@ -289,8 +287,8 @@ public class TileEntityFireworkBox extends TileEntityBase implements IEnergyDisp } @Override - public LazyOptional getEnergyStorage(Direction facing) { - return this.lazyEnergy; + public IEnergyStorage getEnergyStorage(Direction facing) { + return this.storage; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java index 276dd8bbf..819a076bc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java @@ -34,11 +34,11 @@ import net.minecraft.world.level.block.LiquidBlock; 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.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidType; -import net.minecraftforge.fluids.IFluidBlock; -import net.minecraftforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.FluidType; +import net.neoforged.neoforge.fluids.IFluidBlock; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -146,7 +146,7 @@ public class TileEntityFluidCollector extends TileEntityBase implements ISharing } @Override - public LazyOptional getFluidHandler(Direction facing) { + public IFluidHandler getFluidHandler(Direction facing) { return this.lazyTank; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java index 9a0831317..f13c40124 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java @@ -112,7 +112,7 @@ // } // // @Override -// public LazyOptional getEnergyStorage(Direction facing) { +// public IEnergyStorage getEnergyStorage(Direction facing) { // return this.lazyEnergy; // } //} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java index e19c70343..dcebcf24b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java @@ -22,8 +22,8 @@ import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.MagmaBlock; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.energy.IEnergyStorage; import java.util.ArrayList; @@ -32,7 +32,6 @@ public class TileEntityHeatCollector extends TileEntityBase implements ISharingE public static final int ENERGY_PRODUCE = 40; public static final int BLOCKS_NEEDED = 4; public final CustomEnergyStorage storage = new CustomEnergyStorage(30000, 0, 80); - public final LazyOptional lazyEnergy = LazyOptional.of(() -> this.storage); private int oldEnergy; private int disappearTime; @@ -134,8 +133,8 @@ public class TileEntityHeatCollector extends TileEntityBase implements ISharingE } @Override - public LazyOptional getEnergyStorage(Direction facing) { - return this.lazyEnergy; + public IEnergyStorage getEnergyStorage(Direction facing) { + return this.storage; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java index e8d891834..32af3508d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java @@ -21,20 +21,17 @@ import net.minecraft.nbt.ListTag; 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.util.LazyOptional; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.IItemHandlerModifiable; -import net.minecraftforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.IItemHandlerModifiable; +import net.neoforged.neoforge.items.ItemHandlerHelper; public abstract class TileEntityInventoryBase extends TileEntityBase { public final ItemStackHandlerAA inv; - public final LazyOptional lazyInv; public TileEntityInventoryBase(BlockEntityType type, BlockPos pos, BlockState state, int slots) { super(type, pos, state); this.inv = new TileStackHandler(slots); - this.lazyInv = LazyOptional.of(() -> this.inv); } public static void saveSlots(IItemHandler slots, CompoundTag compound) { @@ -73,8 +70,8 @@ public abstract class TileEntityInventoryBase extends TileEntityBase { } @Override - public LazyOptional getItemHandler(Direction facing) { - return this.lazyInv; + public IItemHandler getItemHandler(Direction facing) { + return this.inv; } public IAcceptor getAcceptor() { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemInterface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemInterface.java index ff36c575f..4cbb46ac6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemInterface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemInterface.java @@ -27,17 +27,15 @@ import net.minecraft.world.level.Level; 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.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.IItemHandler; +import net.neoforged.neoforge.items.IItemHandler; import javax.annotation.Nonnull; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Optional; public class TileEntityItemInterface extends TileEntityBase { @@ -45,7 +43,6 @@ public class TileEntityItemInterface extends TileEntityBase { public final Map itemHandlerInfos = new HashMap<>(); public final List slotlessInfos = new ArrayList<>(); protected final SlotlessableItemHandlerWrapper itemHandler; - private final LazyOptional lazyHandlers; public TileEntityLaserRelayItem connectedRelay; private int lastNetworkChangeAmount = -1; private int slotCount; @@ -120,8 +117,7 @@ public class TileEntityItemInterface extends TileEntityBase { // slotlessHandler = CommonCapsUtil.createSlotlessItemViewerHandler(this, normalHandler); // } - this.lazyHandlers = LazyOptional.of(() -> normalHandler); - this.itemHandler = new SlotlessableItemHandlerWrapper(this.lazyHandlers, slotlessHandler); + this.itemHandler = new SlotlessableItemHandlerWrapper(normalHandler, slotlessHandler); } public TileEntityItemInterface(BlockPos pos, BlockState state) { @@ -141,16 +137,10 @@ public class TileEntityItemInterface extends TileEntityBase { } @Override - public LazyOptional getItemHandler(Direction facing) { + public IItemHandler getItemHandler(Direction facing) { return this.itemHandler.getNormalHandler(); } - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability capability, @Nullable Direction side) { - return super.getCapability(capability, side); - } - // TODO: [port] Maybe add back // @SuppressWarnings("unchecked") // @Override @@ -188,7 +178,7 @@ public class TileEntityItemInterface extends TileEntityBase { for (Player player : this.level.players()) { if (player instanceof ServerPlayer) { if (player.distanceToSqr(input.getX(), input.getY(), input.getZ()) <= rangeSq || player.distanceToSqr(output.getX(), output.getY(), output.getZ()) <= rangeSq) { - PacketHandler.sendTo(new PacketServerToClient(compound, PacketHandler.LASER_PARTICLE_HANDLER), (ServerPlayer) player); + ((ServerPlayer) player).connection.send(new PacketServerToClient(compound, PacketHandler.LASER_PARTICLE_HANDLER)); } } } @@ -209,7 +199,7 @@ public class TileEntityItemInterface extends TileEntityBase { int slotsQueried = 0; for (GenericItemHandlerInfo info : this.genericInfos) { for (SlotlessableItemHandlerWrapper handler : info.handlers) { - LazyOptional normalHandler = handler.getNormalHandler(); + Optional normalHandler = Optional.ofNullable(handler.getNormalHandler()); slotsQueried += normalHandler.map(cap -> { int queried = 0; for (int i = 0; i < cap.getSlots(); i++) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemInterfaceHopping.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemInterfaceHopping.java index 7002bff80..ae7ed51ea 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemInterfaceHopping.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemInterfaceHopping.java @@ -26,9 +26,9 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.phys.AABB; -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.util.LazyOptional; +import net.neoforged.neoforge.items.IItemHandler; import java.util.List; @@ -111,7 +111,7 @@ public class TileEntityItemInterfaceHopping extends TileEntityItemInterface { BlockEntity from = this.level.getBlockEntity(this.getBlockPos().relative(Direction.UP)); if (from != null && !(from instanceof TileEntityItemInterface)) { - LazyOptional normal = from.getCapability(ForgeCapabilities.ITEM_HANDLER, Direction.DOWN); + LazyOptional normal = from.getCapability(Capabilities.ITEM_HANDLER, Direction.DOWN); Object slotless = null; // TODO: [port] add back @@ -132,7 +132,7 @@ public class TileEntityItemInterfaceHopping extends TileEntityItemInterface { if (this.level.isLoaded(toPos)) { BlockEntity to = this.level.getBlockEntity(toPos); if (to != null && !(to instanceof TileEntityItemInterface)) { - LazyOptional normal = to.getCapability(ForgeCapabilities.ITEM_HANDLER, facing.getOpposite()); + LazyOptional normal = to.getCapability(Capabilities.ITEM_HANDLER, facing.getOpposite()); Object slotless = null; // TODO: [port] Add back diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java index 552e9ff85..603478ddc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java @@ -26,11 +26,9 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.phys.AABB; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -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.items.IItemHandler; public abstract class TileEntityLaserRelay extends TileEntityInventoryBase { @@ -176,11 +174,11 @@ public abstract class TileEntityLaserRelay extends TileEntityInventoryBase { return this.cachedNetwork; } - @Override - @OnlyIn(Dist.CLIENT) - public AABB getRenderBoundingBox() { - return INFINITE_EXTENT_AABB; - } +// @Override TODO: Fix the renderBoundingBox +// @OnlyIn(Dist.CLIENT) +// public AABB getRenderBoundingBox() { +// return INFINITE_EXTENT_AABB; +// } @Override public boolean shouldSyncSlots() { @@ -188,8 +186,8 @@ public abstract class TileEntityLaserRelay extends TileEntityInventoryBase { } @Override - public LazyOptional getItemHandler(Direction facing) { - return LazyOptional.empty(); + public IItemHandler getItemHandler(Direction facing) { + return null; } public int getMaxRange() { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java index bbd51b46e..04c7c712e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java @@ -28,11 +28,11 @@ import net.minecraft.world.level.Level; 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.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.energy.IEnergyStorage; +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.energy.IEnergyStorage; import java.util.HashMap; import java.util.Map; @@ -114,7 +114,7 @@ public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay { // TODO: [port] this is super hacky, review and fix up @Override - public LazyOptional getEnergyStorage(Direction facing) { + public IEnergyStorage getEnergyStorage(Direction facing) { return LazyOptional.of(() -> this.energyStorages[facing == null ? 0 : facing.ordinal()]); @@ -136,7 +136,7 @@ public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay { if (this.level.hasChunkAt(pos)) { BlockEntity tile = this.level.getBlockEntity(pos); if (tile != null && !(tile instanceof TileEntityLaserRelay)) { - if (tile.getCapability(ForgeCapabilities.ENERGY, side.getOpposite()).isPresent()) { + if (tile.getCapability(Capabilities.ENERGY, side.getOpposite()).isPresent()) { this.receiversAround.put(side, tile); BlockEntity oldTile = old.get(side); @@ -179,7 +179,7 @@ public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay { Direction opp = facing.getOpposite(); if (tile != null) { - Boolean received = tile.getCapability(ForgeCapabilities.ENERGY, opp).map(cap -> cap.receiveEnergy(maxTransfer, true) > 0).orElse(false); + Boolean received = tile.getCapability(Capabilities.ENERGY, opp).map(cap -> cap.receiveEnergy(maxTransfer, true) > 0).orElse(false); if (received) { totalReceiverAmount++; workedOnce = true; @@ -213,7 +213,7 @@ public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay { if (!alreadyChecked.contains(tile.getBlockPos())) { alreadyChecked.add(tile.getBlockPos()); if (theRelay != this || side != from) { - transmitted += tile.getCapability(ForgeCapabilities.ENERGY, opp).map(cap -> { + transmitted += tile.getCapability(Capabilities.ENERGY, opp).map(cap -> { int trans = 0; int theoreticalReceived = cap.receiveEnergy(Math.min(amountPer, lowestCap), true); if (theoreticalReceived > 0) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayFluids.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayFluids.java index 871d39648..6299c9bf5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayFluids.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayFluids.java @@ -26,12 +26,12 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; 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.api.distmarker.OnlyIn; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.IFluidHandler; +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.fluids.FluidStack; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; import javax.annotation.Nonnull; import java.util.HashMap; @@ -133,7 +133,7 @@ public class TileEntityLaserRelayFluids extends TileEntityLaserRelay { if (this.level.hasChunkAt(pos)) { BlockEntity tile = this.level.getBlockEntity(pos); if (tile != null && !(tile instanceof TileEntityLaserRelay)) { - if (tile.getCapability(ForgeCapabilities.FLUID_HANDLER, side.getOpposite()).isPresent()) { + if (tile.getCapability(Capabilities.FLUID_HANDLER, side.getOpposite()).isPresent()) { this.handlersAround.put(side, tile); BlockEntity oldTile = old.get(side); @@ -155,7 +155,7 @@ public class TileEntityLaserRelayFluids extends TileEntityLaserRelay { // TODO: [port] super hacky, find better way of handling this. @Override - public LazyOptional getFluidHandler(Direction facing) { + public IFluidHandler getFluidHandler(Direction facing) { return LazyOptional.of(() -> this.fluidHandlers[facing == null ? 0 : facing.ordinal()]); @@ -194,7 +194,7 @@ public class TileEntityLaserRelayFluids extends TileEntityLaserRelay { BlockEntity tile = theRelay.handlersAround.get(facing); Direction opp = facing.getOpposite(); - boolean received = tile.getCapability(ForgeCapabilities.FLUID_HANDLER, opp).map(cap -> cap.fill(stack, IFluidHandler.FluidAction.SIMULATE) > 0).orElse(false); + boolean received = tile.getCapability(Capabilities.FLUID_HANDLER, opp).map(cap -> cap.fill(stack, IFluidHandler.FluidAction.SIMULATE) > 0).orElse(false); if (received) { totalReceiverAmount++; workedOnce = true; @@ -225,7 +225,7 @@ public class TileEntityLaserRelayFluids extends TileEntityLaserRelay { if (!alreadyChecked.contains(tile.getBlockPos())) { alreadyChecked.add(tile.getBlockPos()); if (theRelay != this || side != from) { - transmitted += tile.getCapability(ForgeCapabilities.FLUID_HANDLER, opp).map(cap -> { + transmitted += tile.getCapability(Capabilities.FLUID_HANDLER, opp).map(cap -> { int trans = 0; FluidStack copy = stack.copy(); copy.setAmount(amountPer); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java index ca72429f4..b85bf4261 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java @@ -29,11 +29,11 @@ import net.minecraft.world.level.Level; 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.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.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 java.util.HashMap; import java.util.HashSet; @@ -92,7 +92,7 @@ public class TileEntityLaserRelayItem extends TileEntityLaserRelay { if (this.level.hasChunkAt(pos)) { BlockEntity tile = this.level.getBlockEntity(pos); if (tile != null && !(tile instanceof TileEntityItemInterface) && !(tile instanceof TileEntityLaserRelay)) { - LazyOptional itemHandler = tile.getCapability(ForgeCapabilities.ITEM_HANDLER, side.getOpposite()); + LazyOptional itemHandler = tile.getCapability(Capabilities.ITEM_HANDLER, side.getOpposite()); Object slotlessHandler = null; // TODO: [port] add this back maybe? diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java index fdc8227f5..787f4737f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java @@ -20,8 +20,7 @@ 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.state.BlockState; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.neoforge.energy.IEnergyStorage; public class TileEntityLavaFactoryController extends TileEntityBase implements IEnergyDisplay { @@ -30,7 +29,6 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I public static final int HAS_AIR = 2; public static final int ENERGY_USE = 150000; public final CustomEnergyStorage storage = new CustomEnergyStorage(300000, 2000, 0); - public final LazyOptional lazyEnergy = LazyOptional.of(() -> this.storage); private int currentWorkTime; private int oldEnergy; @@ -113,7 +111,7 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I } @Override - public LazyOptional getEnergyStorage(Direction facing) { - return this.lazyEnergy; + public IEnergyStorage getEnergyStorage(Direction facing) { + return this.storage; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java index 94987a76a..5e4263222 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java @@ -22,8 +22,8 @@ import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.LeavesBlock; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.energy.IEnergyStorage; import java.util.ArrayList; import java.util.Collections; @@ -139,7 +139,7 @@ public class TileEntityLeafGenerator extends TileEntityBase implements ISharingE } @Override - public LazyOptional getEnergyStorage(Direction facing) { + public IEnergyStorage getEnergyStorage(Direction facing) { return this.lazyEnergy; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLongRangeBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLongRangeBreaker.java index c6e4b7eeb..107324e79 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLongRangeBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLongRangeBreaker.java @@ -30,8 +30,8 @@ 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.state.BlockState; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.energy.IEnergyStorage; import javax.annotation.Nullable; import java.util.List; @@ -141,7 +141,7 @@ public class TileEntityLongRangeBreaker extends TileEntityInventoryBase implemen } @Override - public LazyOptional getEnergyStorage(Direction facing) { + public IEnergyStorage getEnergyStorage(Direction facing) { return this.lazyEnergy; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java index 120c14417..5cf78e177 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java @@ -23,24 +23,23 @@ import net.minecraft.world.MenuProvider; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.level.Level; 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.api.distmarker.OnlyIn; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidType; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.templates.FluidTank; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.energy.IEnergyStorage; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.FluidType; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.fluids.capability.templates.FluidTank; import javax.annotation.Nonnull; import javax.annotation.Nullable; public class TileEntityOilGenerator extends TileEntityBase implements ISharingEnergyProvider, ISharingFluidHandler, MenuProvider { public final CustomEnergyStorage storage = new CustomEnergyStorage(50000, 0, CommonConfig.Machines.OIL_GENERATOR_TRANSFER.get()); - public final LazyOptional lazyEnergy = LazyOptional.of(() -> this.storage); public final FluidTank tank = new FluidTank(2 * FluidType.BUCKET_VOLUME, fluid -> getRecipeForFluid(fluid) != null) { @Nonnull @Override @@ -54,7 +53,6 @@ public class TileEntityOilGenerator extends TileEntityBase implements ISharingEn return FluidStack.EMPTY; } }; - public final LazyOptional lazyTank = LazyOptional.of(() -> this.tank); public int currentEnergyProduce; public int currentBurnTime; public int maxBurnTime; @@ -70,10 +68,10 @@ public class TileEntityOilGenerator extends TileEntityBase implements ISharingEn super(ActuallyBlocks.OIL_GENERATOR.getTileEntityType(), pos, state); } - private static LiquidFuelRecipe getRecipeForFluid(FluidStack fluid) { + private static RecipeHolder getRecipeForFluid(FluidStack fluid) { if (fluid != null) { - for (LiquidFuelRecipe recipe : ActuallyAdditionsAPI.LIQUID_FUEL_RECIPES) { - if (recipe != null && recipe.matches(fluid)) { + for (RecipeHolder recipe : ActuallyAdditionsAPI.LIQUID_FUEL_RECIPES) { + if (recipe != null && recipe.value().matches(fluid)) { return recipe; } } @@ -86,7 +84,7 @@ public class TileEntityOilGenerator extends TileEntityBase implements ISharingEn return this.currentBurnTime * i / this.maxBurnTime; } - private LiquidFuelRecipe getRecipeForCurrentFluid() { + private RecipeHolder getRecipeForCurrentFluid() { FluidStack stack = this.tank.getFluid(); if (!stack.isEmpty()) { return getRecipeForFluid(stack); @@ -138,8 +136,9 @@ public class TileEntityOilGenerator extends TileEntityBase implements ISharingEn tile.storage.receiveEnergyInternal(tile.currentEnergyProduce, false); } else if (!tile.isRedstonePowered) { - LiquidFuelRecipe recipe = tile.getRecipeForCurrentFluid(); - if (recipe != null && tile.storage.getEnergyStored() < tile.storage.getMaxEnergyStored() && tile.tank.getFluidAmount() >= recipe.getFuelAmount()) { + RecipeHolder recipeHolder = tile.getRecipeForCurrentFluid(); + if (recipeHolder != null && tile.storage.getEnergyStored() < tile.storage.getMaxEnergyStored() && tile.tank.getFluidAmount() >= recipeHolder.getFuelAmount()) { + LiquidFuelRecipe recipe = recipeHolder.value(); tile.fuelUsage = recipe.getFuelAmount(); tile.currentEnergyProduce = recipe.getTotalEnergy() / recipe.getBurnTime(); tile.maxBurnTime = recipe.getBurnTime(); @@ -177,8 +176,8 @@ public class TileEntityOilGenerator extends TileEntityBase implements ISharingEn } @Override - public LazyOptional getFluidHandler(Direction facing) { - return this.lazyTank; + public IFluidHandler getFluidHandler(Direction facing) { + return this.tank; } @Override @@ -217,8 +216,8 @@ public class TileEntityOilGenerator extends TileEntityBase implements ISharingEn } @Override - public LazyOptional getEnergyStorage(Direction facing) { - return this.lazyEnergy; + public IEnergyStorage getEnergyStorage(Direction facing) { + return this.storage; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java index 1cce4763e..c0e0b91be 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java @@ -17,8 +17,8 @@ import net.minecraft.core.Direction; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; +import net.neoforged.neoforge.common.capabilities.Capabilities; +import net.neoforged.neoforge.common.capabilities.Capability; public class TileEntityPhantomEnergyface extends TileEntityPhantomface implements ISharingEnergyProvider { @@ -45,7 +45,7 @@ public class TileEntityPhantomEnergyface extends TileEntityPhantomface implement BlockEntity tile = this.level.getBlockEntity(this.boundPosition); if (tile != null && !(tile instanceof TileEntityLaserRelayEnergy)) { for (Direction facing : Direction.values()) { - if (tile.getCapability(ForgeCapabilities.ENERGY, facing).isPresent()) { + if (tile.getCapability(Capabilities.ENERGY, facing).isPresent()) { return true; } } @@ -56,7 +56,7 @@ public class TileEntityPhantomEnergyface extends TileEntityPhantomface implement @Override protected boolean isCapabilitySupported(Capability capability) { - return capability == ForgeCapabilities.ENERGY; + return capability == Capabilities.ENERGY; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java index 810a4c46b..ba7131ba7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java @@ -19,8 +19,8 @@ import net.minecraft.core.Direction; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; +import net.neoforged.neoforge.common.capabilities.Capabilities; +import net.neoforged.neoforge.common.capabilities.Capability; public class TileEntityPhantomItemface extends TileEntityPhantomface { @@ -52,7 +52,7 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface { BlockEntity tile = this.level.getBlockEntity(this.getBoundPosition()); if (tile != null) { for (Direction facing : Direction.values()) { - if (tile.getCapability(ForgeCapabilities.ITEM_HANDLER, facing).isPresent()) { + if (tile.getCapability(Capabilities.ITEM_HANDLER, facing).isPresent()) { return true; } } @@ -63,7 +63,7 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface { @Override protected boolean isCapabilitySupported(Capability capability) { - return capability == ForgeCapabilities.ITEM_HANDLER; + return capability == Capabilities.ITEM_HANDLER; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java index 0bf693d26..12185f52c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java @@ -17,8 +17,8 @@ import net.minecraft.core.Direction; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; +import net.neoforged.neoforge.common.capabilities.Capabilities; +import net.neoforged.neoforge.common.capabilities.Capability; public class TileEntityPhantomLiquiface extends TileEntityPhantomface implements ISharingFluidHandler { @@ -45,7 +45,7 @@ public class TileEntityPhantomLiquiface extends TileEntityPhantomface implements BlockEntity tile = this.level.getBlockEntity(this.boundPosition); if (tile != null && !(tile instanceof TileEntityLaserRelayFluids)) { for (Direction facing : Direction.values()) { - if (tile.getCapability(ForgeCapabilities.FLUID_HANDLER, facing).isPresent()) { + if (tile.getCapability(Capabilities.FLUID_HANDLER, facing).isPresent()) { return true; } } @@ -56,7 +56,7 @@ public class TileEntityPhantomLiquiface extends TileEntityPhantomface implements @Override protected boolean isCapabilitySupported(Capability capability) { - return capability == ForgeCapabilities.FLUID_HANDLER; + return capability == Capabilities.FLUID_HANDLER; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomRedstoneface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomRedstoneface.java index d266e0b13..0c63ca29a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomRedstoneface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomRedstoneface.java @@ -17,7 +17,7 @@ import net.minecraft.world.level.Level; 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.common.capabilities.Capability; +import net.neoforged.neoforge.common.capabilities.Capability; import java.util.Arrays; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java index ee832905f..3dbf4405b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java @@ -22,10 +22,10 @@ import net.minecraft.world.level.block.Block; 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.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.util.LazyOptional; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.common.capabilities.Capability; +import net.neoforged.neoforge.common.util.LazyOptional; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java index 686bb0c40..92777175e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java @@ -20,11 +20,11 @@ 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 net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.wrapper.PlayerInvWrapper; +import net.neoforged.neoforge.common.capabilities.Capabilities; +import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.energy.IEnergyStorage; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.wrapper.PlayerInvWrapper; import java.util.UUID; @@ -58,7 +58,7 @@ public class TileEntityPlayerInterface extends TileEntityBase implements IEnergy // TODO: [port] this might not be a stable way of doing this. @Override - public LazyOptional getItemHandler(Direction facing) { + public IItemHandler getItemHandler(Direction facing) { Player player = this.getPlayer(); if (this.oldPlayer != player) { @@ -93,7 +93,7 @@ public class TileEntityPlayerInterface extends TileEntityBase implements IEnergy ItemStack slot = player.getInventory().getItem(i); if (StackUtil.isValid(slot) && slot.getCount() == 1) { - int received = slot.getCapability(ForgeCapabilities.ENERGY).map(cap -> cap.receiveEnergy(tile.storage.getEnergyStored(), false)).orElse(0); + int received = slot.getCapability(Capabilities.ENERGY).map(cap -> cap.receiveEnergy(tile.storage.getEnergyStored(), false)).orElse(0); if (received > 0) { tile.storage.extractEnergyInternal(received, false); } @@ -148,7 +148,7 @@ public class TileEntityPlayerInterface extends TileEntityBase implements IEnergy } @Override - public LazyOptional getEnergyStorage(Direction facing) { + public IEnergyStorage getEnergyStorage(Direction facing) { return this.lazyEnergy; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPoweredFurnace.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPoweredFurnace.java index 5d0ce9930..ea7806ef1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPoweredFurnace.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPoweredFurnace.java @@ -34,8 +34,8 @@ 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.properties.BlockStateProperties; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.energy.IEnergyStorage; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -249,7 +249,7 @@ public class TileEntityPoweredFurnace extends TileEntityInventoryBase implements } @Override - public LazyOptional getEnergyStorage(Direction facing) { + public IEnergyStorage getEnergyStorage(Direction facing) { return this.lazyEnergy; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityShockSuppressor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityShockSuppressor.java index 274a037a5..5bf4707c7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityShockSuppressor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityShockSuppressor.java @@ -17,8 +17,8 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.energy.IEnergyStorage; import java.util.ArrayList; import java.util.List; @@ -99,7 +99,7 @@ public class TileEntityShockSuppressor extends TileEntityBase implements IEnergy } @Override - public LazyOptional getEnergyStorage(Direction facing) { + public IEnergyStorage getEnergyStorage(Direction facing) { return this.lazyEnergy; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityVerticalDigger.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityVerticalDigger.java index 51c228ac2..e58360bdd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityVerticalDigger.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityVerticalDigger.java @@ -36,12 +36,12 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.common.TierSortingRegistry; -import net.minecraftforge.common.util.FakePlayerFactory; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; -import net.minecraftforge.fluids.IFluidBlock; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.common.TierSortingRegistry; +import net.neoforged.neoforge.common.util.FakePlayerFactory; +import net.neoforged.neoforge.common.util.LazyOptional; +import net.neoforged.neoforge.energy.IEnergyStorage; +import net.neoforged.neoforge.fluids.IFluidBlock; +import net.neoforged.neoforge.registries.BuiltInRegistries; import javax.annotation.Nullable; import java.util.List; @@ -189,7 +189,7 @@ public class TileEntityVerticalDigger extends TileEntityInventoryBase implements // } // } - String reg = ForgeRegistries.BLOCKS.getKey(block).toString(); + String reg = BuiltInRegistries.BLOCK.getKey(block).toString(); if (!reg.isEmpty()) { for (String string : ConfigStringListValues.MINER_EXTRA_WHITELIST.getValue()) { if (reg.equals(string)) { @@ -210,7 +210,7 @@ public class TileEntityVerticalDigger extends TileEntityInventoryBase implements } private boolean isBlacklisted(Block block) { - String reg = ForgeRegistries.BLOCKS.getKey(block).toString(); + String reg = BuiltInRegistries.BLOCK.getKey(block).toString(); if (!reg.isEmpty()) { for (String string : ConfigStringListValues.MINER_BLACKLIST.getValue()) { if (reg.equals(string)) { @@ -249,7 +249,7 @@ public class TileEntityVerticalDigger extends TileEntityInventoryBase implements } @Override - public LazyOptional getEnergyStorage(Direction facing) { + public IEnergyStorage getEnergyStorage(Direction facing) { return this.lazyEnergy; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java index 11887e870..e7e502fd6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java @@ -15,11 +15,11 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.resources.language.I18n; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Player; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.TickEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.event.TickEvent; public class UpdateChecker { @@ -52,7 +52,7 @@ public class UpdateChecker { player.displayClientMessage(Component.Serializer.fromJson(I18n.get("info." + ActuallyAdditions.MODID + ".update.buttons", UpdateChecker.CHANGELOG_LINK, UpdateChecker.DOWNLOAD_LINK)), false); } if (threadFinished) { - MinecraftForge.EVENT_BUS.unregister(this); + NeoForge.EVENT_BUS.unregister(this); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java index a2260c9df..699d81691 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java @@ -42,10 +42,10 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.client.ForgeHooksClient; -import net.minecraftforge.network.PacketDistributor; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.neoforge.client.ClientHooks; +import net.neoforged.neoforge.network.PacketDistributor; import org.joml.Matrix4f; public final class AssetUtil { @@ -115,7 +115,7 @@ public final class AssetUtil { RenderSystem.enableBlend(); // RenderSystem.pushMatrix(); matrices.pushPose(); - model = ForgeHooksClient.handleCameraTransforms(matrices, model, ItemDisplayContext.FIXED, false); + model = ClientHooks.handleCameraTransforms(matrices, model, ItemDisplayContext.FIXED, false); renderer.render(stack, ItemDisplayContext.FIXED, false, matrices, bufferSource, combinedOverlay, combinedLight, model); // RenderSystem.popMatrix(); @@ -232,7 +232,7 @@ public final class AssetUtil { data.putFloat("Size", size); data.putInt("MaxAge", maxAge); data.putFloat("Alpha", alpha); - PacketHandler.THE_NETWORK.send(PacketDistributor.NEAR.with(() -> new PacketDistributor.TargetPoint(startX, startY, startZ, 96, world.dimension())), new PacketServerToClient(data, PacketHandler.LASER_HANDLER)); + PacketDistributor.NEAR.with(() -> new PacketDistributor.TargetPoint(startX, startY, startZ, 96, world.dimension())).send(new PacketServerToClient(data, PacketHandler.LASER_HANDLER)); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemStackHandlerAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemStackHandlerAA.java index 2c194298c..d5068e81c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemStackHandlerAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemStackHandlerAA.java @@ -12,7 +12,7 @@ package de.ellpeck.actuallyadditions.mod.util; import net.minecraft.core.NonNullList; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.items.ItemStackHandler; +import net.neoforged.neoforge.items.ItemStackHandler; /** * The Actually Additions variant of ItemStackHandler. Provides methods to disallow add/removal based on automation context. Defaults to thinking operations are performed by automation. diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemUtil.java index 79f0bdf3b..05a517d92 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemUtil.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod.util; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.InteractionHand; import net.minecraft.world.entity.player.Player; @@ -17,14 +18,13 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentHelper; -import net.minecraftforge.registries.ForgeRegistries; import java.util.Map; public final class ItemUtil { public static Item getItemFromName(String name) { - return ForgeRegistries.ITEMS.getValue(new ResourceLocation(name)); + return BuiltInRegistries.ITEM.get(new ResourceLocation(name)); } // public static boolean contains(ItemStack[] array, ItemStack stack, boolean checkWildcard) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/Lang.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/Lang.java index ffb261931..3e86b41ab 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/Lang.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/Lang.java @@ -1,6 +1,6 @@ package de.ellpeck.actuallyadditions.mod.util; -import net.minecraftforge.energy.IEnergyStorage; +import net.neoforged.neoforge.energy.IEnergyStorage; import java.text.NumberFormat; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/NetHandlerSpaghettiServer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/NetHandlerSpaghettiServer.java deleted file mode 100644 index d7835f40b..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/NetHandlerSpaghettiServer.java +++ /dev/null @@ -1,265 +0,0 @@ -package de.ellpeck.actuallyadditions.mod.util; - -import net.minecraft.network.Connection; -import net.minecraft.network.PacketSendListener; -import net.minecraft.network.chat.Component; -import net.minecraft.network.protocol.Packet; -import net.minecraft.network.protocol.PacketFlow; -import net.minecraft.network.protocol.game.ServerboundAcceptTeleportationPacket; -import net.minecraft.network.protocol.game.ServerboundBlockEntityTagQuery; -import net.minecraft.network.protocol.game.ServerboundChangeDifficultyPacket; -import net.minecraft.network.protocol.game.ServerboundChatPacket; -import net.minecraft.network.protocol.game.ServerboundClientCommandPacket; -import net.minecraft.network.protocol.game.ServerboundClientInformationPacket; -import net.minecraft.network.protocol.game.ServerboundCommandSuggestionPacket; -import net.minecraft.network.protocol.game.ServerboundContainerButtonClickPacket; -import net.minecraft.network.protocol.game.ServerboundContainerClickPacket; -import net.minecraft.network.protocol.game.ServerboundContainerClosePacket; -import net.minecraft.network.protocol.game.ServerboundCustomPayloadPacket; -import net.minecraft.network.protocol.game.ServerboundEditBookPacket; -import net.minecraft.network.protocol.game.ServerboundEntityTagQuery; -import net.minecraft.network.protocol.game.ServerboundInteractPacket; -import net.minecraft.network.protocol.game.ServerboundJigsawGeneratePacket; -import net.minecraft.network.protocol.game.ServerboundKeepAlivePacket; -import net.minecraft.network.protocol.game.ServerboundLockDifficultyPacket; -import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket; -import net.minecraft.network.protocol.game.ServerboundMoveVehiclePacket; -import net.minecraft.network.protocol.game.ServerboundPaddleBoatPacket; -import net.minecraft.network.protocol.game.ServerboundPickItemPacket; -import net.minecraft.network.protocol.game.ServerboundPlaceRecipePacket; -import net.minecraft.network.protocol.game.ServerboundPlayerAbilitiesPacket; -import net.minecraft.network.protocol.game.ServerboundPlayerActionPacket; -import net.minecraft.network.protocol.game.ServerboundPlayerCommandPacket; -import net.minecraft.network.protocol.game.ServerboundPlayerInputPacket; -import net.minecraft.network.protocol.game.ServerboundRecipeBookChangeSettingsPacket; -import net.minecraft.network.protocol.game.ServerboundRecipeBookSeenRecipePacket; -import net.minecraft.network.protocol.game.ServerboundRenameItemPacket; -import net.minecraft.network.protocol.game.ServerboundResourcePackPacket; -import net.minecraft.network.protocol.game.ServerboundSeenAdvancementsPacket; -import net.minecraft.network.protocol.game.ServerboundSelectTradePacket; -import net.minecraft.network.protocol.game.ServerboundSetBeaconPacket; -import net.minecraft.network.protocol.game.ServerboundSetCarriedItemPacket; -import net.minecraft.network.protocol.game.ServerboundSetCommandBlockPacket; -import net.minecraft.network.protocol.game.ServerboundSetCommandMinecartPacket; -import net.minecraft.network.protocol.game.ServerboundSetCreativeModeSlotPacket; -import net.minecraft.network.protocol.game.ServerboundSetJigsawBlockPacket; -import net.minecraft.network.protocol.game.ServerboundSetStructureBlockPacket; -import net.minecraft.network.protocol.game.ServerboundSignUpdatePacket; -import net.minecraft.network.protocol.game.ServerboundSwingPacket; -import net.minecraft.network.protocol.game.ServerboundTeleportToEntityPacket; -import net.minecraft.network.protocol.game.ServerboundUseItemOnPacket; -import net.minecraft.network.protocol.game.ServerboundUseItemPacket; -import net.minecraft.server.network.ServerGamePacketListenerImpl; -import net.minecraft.world.entity.RelativeMovement; -import net.minecraftforge.common.util.FakePlayer; - -import javax.annotation.Nullable; -import java.util.Set; - -public class NetHandlerSpaghettiServer extends ServerGamePacketListenerImpl { - - public NetHandlerSpaghettiServer(FakePlayer player) { - super(null, new Connection(PacketFlow.CLIENTBOUND), player); - } - - @Override - public void disconnect(Component textComponent) { - } - - @Override - public void handlePlayerInput(ServerboundPlayerInputPacket p_147358_1_) { - } - - @Override - public void handleMoveVehicle(ServerboundMoveVehiclePacket p_184338_1_) { - } - - @Override - public void handleAcceptTeleportPacket(ServerboundAcceptTeleportationPacket p_184339_1_) { - } - - @Override - public void handleRecipeBookSeenRecipePacket(ServerboundRecipeBookSeenRecipePacket p_191984_1_) { - } - - @Override - public void handleRecipeBookChangeSettingsPacket(ServerboundRecipeBookChangeSettingsPacket p_241831_1_) { - } - - @Override - public void handleSeenAdvancements(ServerboundSeenAdvancementsPacket p_194027_1_) { - } - - @Override - public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket p_195518_1_) { - } - - @Override - public void handleSetCommandBlock(ServerboundSetCommandBlockPacket p_210153_1_) { - } - - @Override - public void handleSetCommandMinecart(ServerboundSetCommandMinecartPacket p_210158_1_) { - } - - @Override - public void handlePickItem(ServerboundPickItemPacket p_210152_1_) { - } - - @Override - public void handleRenameItem(ServerboundRenameItemPacket p_210155_1_) { - } - - @Override - public void handleSetBeaconPacket(ServerboundSetBeaconPacket p_210154_1_) { - } - - @Override - public void handleSetStructureBlock(ServerboundSetStructureBlockPacket p_210157_1_) { - } - - @Override - public void handleSetJigsawBlock(ServerboundSetJigsawBlockPacket p_217262_1_) { - } - - @Override - public void handleJigsawGenerate(ServerboundJigsawGeneratePacket p_230549_1_) { - } - - @Override - public void handleSelectTrade(ServerboundSelectTradePacket p_210159_1_) { - } - - @Override - public void handleEditBook(ServerboundEditBookPacket p_210156_1_) { - } - - @Override - public void handleEntityTagQuery(ServerboundEntityTagQuery p_211526_1_) { - } - - @Override - public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQuery p_211525_1_) { - } - - @Override - public void handleMovePlayer(ServerboundMovePlayerPacket p_147347_1_) { - } - - @Override - public void teleport(double p_147364_1_, double p_147364_3_, double p_147364_5_, float p_147364_7_, float p_147364_8_) { - } - - @Override - public void teleport(double pX, double pY, double pZ, float pYaw, float pPitch, Set pRelativeSet) { - - } - - @Override - public void handlePlayerAction(ServerboundPlayerActionPacket p_147345_1_) { - } - - @Override - public void handleUseItemOn(ServerboundUseItemOnPacket p_184337_1_) { - } - - @Override - public void handleUseItem(ServerboundUseItemPacket p_147346_1_) { - } - - @Override - public void handleTeleportToEntityPacket(ServerboundTeleportToEntityPacket p_175088_1_) { - } - - @Override - public void handleResourcePackResponse(ServerboundResourcePackPacket p_175086_1_) { - } - - @Override - public void handlePaddleBoat(ServerboundPaddleBoatPacket p_184340_1_) { - } - - @Override - public void onDisconnect(Component p_147231_1_) { - } - - @Override - public void send(Packet p_147359_1_) { - } - - @Override - public void send(Packet pPacket, @Nullable PacketSendListener pListener) { - } - - @Override - public void handleSetCarriedItem(ServerboundSetCarriedItemPacket p_147355_1_) { - } - - @Override - public void handleChat(ServerboundChatPacket p_147354_1_) { - } - - @Override - public void handleAnimate(ServerboundSwingPacket p_175087_1_) { - } - - @Override - public void handlePlayerCommand(ServerboundPlayerCommandPacket p_147357_1_) { - } - - @Override - public void handleInteract(ServerboundInteractPacket p_147340_1_) { - } - - @Override - public void handleClientCommand(ServerboundClientCommandPacket p_147342_1_) { - } - - @Override - public void handleContainerClose(ServerboundContainerClosePacket p_147356_1_) { - } - - @Override - public void handleContainerClick(ServerboundContainerClickPacket p_147351_1_) { - } - - @Override - public void handlePlaceRecipe(ServerboundPlaceRecipePacket p_194308_1_) { - } - - @Override - public void handleContainerButtonClick(ServerboundContainerButtonClickPacket p_147338_1_) { - } - - @Override - public void handleSetCreativeModeSlot(ServerboundSetCreativeModeSlotPacket p_147344_1_) { - } - - @Override - public void handleSignUpdate(ServerboundSignUpdatePacket p_147343_1_) { - } - - @Override - public void handleKeepAlive(ServerboundKeepAlivePacket p_147353_1_) { - } - - @Override - public void handlePlayerAbilities(ServerboundPlayerAbilitiesPacket p_147348_1_) { - } - - @Override - public void handleClientInformation(ServerboundClientInformationPacket p_147352_1_) { - } - - @Override - public void handleCustomPayload(ServerboundCustomPayloadPacket p_147349_1_) { - } - - @Override - public void handleChangeDifficulty(ServerboundChangeDifficultyPacket p_217263_1_) { - } - - @Override - public void handleLockDifficulty(ServerboundLockDifficultyPacket p_217261_1_) { - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/RefHelp.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/RefHelp.java index 2240279df..97838cdf9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/RefHelp.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/RefHelp.java @@ -2,7 +2,7 @@ package de.ellpeck.actuallyadditions.mod.util; import com.google.common.base.MoreObjects; import com.google.common.base.Preconditions; -import net.minecraftforge.fml.loading.FMLLoader; +import net.neoforged.fml.loading.FMLLoader; import org.apache.commons.lang3.StringUtils; import javax.annotation.Nonnull; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/StackUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/StackUtil.java index e51efc290..70234b278 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/StackUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/StackUtil.java @@ -14,7 +14,7 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.util.compat.SlotlessableItemHandlerWrapper; import net.minecraft.core.NonNullList; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.items.IItemHandler; +import net.neoforged.neoforge.items.IItemHandler; import java.util.Collection; import java.util.List; @@ -214,14 +214,17 @@ public final class StackUtil { // } } - return wrapper.getNormalHandler().map(e -> { + IItemHandler normalHandler = wrapper.getNormalHandler(); + if (normalHandler != null) { ItemStack remain = stack.copy(); - for (int i = Math.max(0, slotStart); i < Math.min(slotEnd, e.getSlots()); i++) { - remain = e.insertItem(i, remain, simulate); + for (int i = Math.max(0, slotStart); i < Math.min(slotEnd, normalHandler.getSlots()); i++) { + remain = normalHandler.insertItem(i, remain, simulate); } return remain; - }).orElse(stack); + } else { + return stack; + } } /** diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/StringUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/StringUtil.java index 6c04c0d90..ced2ec537 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/StringUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/StringUtil.java @@ -14,8 +14,8 @@ import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.gui.Font; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.resources.language.I18n; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; @Deprecated public final class StringUtil { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/Util.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/Util.java index dabdd4792..22b4e774c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/Util.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/Util.java @@ -11,7 +11,7 @@ package de.ellpeck.actuallyadditions.mod.util; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import net.minecraftforge.fml.loading.FMLLoader; +import net.neoforged.fml.loading.FMLLoader; public final class Util { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java index edda47bcd..8d9eafd85 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java @@ -33,16 +33,15 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.common.ForgeHooks; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.FakePlayer; -import net.minecraftforge.common.util.FakePlayerFactory; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; -import net.minecraftforge.event.level.BlockEvent.BreakEvent; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.common.CommonHooks; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.common.util.FakePlayer; +import net.neoforged.neoforge.common.util.FakePlayerFactory; +import net.neoforged.neoforge.energy.IEnergyStorage; +import net.neoforged.neoforge.event.level.BlockEvent.BreakEvent; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; import java.util.ArrayList; import java.util.List; @@ -113,38 +112,34 @@ public final class WorldUtil { return extracted; } - public static void doEnergyInteraction(BlockEntity tileFrom, BlockEntity tileTo, Direction sideTo, int maxTransfer) { + public static void doEnergyInteraction(Level level, BlockPos posFrom, BlockPos posTo, Direction sideTo, int maxTransfer) { if (maxTransfer > 0) { Direction opp = sideTo == null ? null : sideTo.getOpposite(); - LazyOptional handlerFrom = tileFrom.getCapability(ForgeCapabilities.ENERGY, sideTo); - LazyOptional handlerTo = tileTo.getCapability(ForgeCapabilities.ENERGY, opp); - handlerFrom.ifPresent((from) -> { - handlerTo.ifPresent((to) -> { - int drain = from.extractEnergy(maxTransfer, true); - if (drain > 0) { - int filled = to.receiveEnergy(drain, false); - from.extractEnergy(filled, false); - } - }); - }); + IEnergyStorage handlerFrom = level.getCapability(Capabilities.EnergyStorage.BLOCK, posFrom, sideTo); + IEnergyStorage handlerTo = level.getCapability(Capabilities.EnergyStorage.BLOCK, posTo, opp); + if (handlerFrom != null && handlerTo != null) { + int drain = handlerFrom.extractEnergy(maxTransfer, true); + if (drain > 0) { + int filled = handlerTo.receiveEnergy(drain, false); + handlerFrom.extractEnergy(filled, false); + } + } } } - public static void doFluidInteraction(BlockEntity tileFrom, BlockEntity tileTo, Direction sideTo, int maxTransfer) { + public static void doFluidInteraction(Level level, BlockPos posFrom, BlockPos posTo, Direction sideTo, int maxTransfer) { if (maxTransfer > 0) { - LazyOptional optionalFrom = tileFrom.getCapability(ForgeCapabilities.FLUID_HANDLER, sideTo); - LazyOptional optionalTo = tileTo.getCapability(ForgeCapabilities.FLUID_HANDLER, sideTo.getOpposite()); - optionalFrom.ifPresent((from) -> { - optionalTo.ifPresent((to) -> { - FluidStack drain = from.drain(maxTransfer, IFluidHandler.FluidAction.SIMULATE); - if (!drain.isEmpty()) { - int filled = to.fill(drain.copy(), IFluidHandler.FluidAction.EXECUTE); - from.drain(filled, IFluidHandler.FluidAction.EXECUTE); - } - }); - }); + IFluidHandler handlerFrom = level.getCapability(Capabilities.FluidHandler.BLOCK, posFrom, sideTo); + IFluidHandler handlerTo = level.getCapability(Capabilities.FluidHandler.BLOCK, posTo, sideTo.getOpposite()); + if (handlerFrom != null && handlerTo != null) { + FluidStack drain = handlerFrom.drain(maxTransfer, IFluidHandler.FluidAction.SIMULATE); + if (!drain.isEmpty()) { + int filled = handlerTo.fill(drain.copy(), IFluidHandler.FluidAction.EXECUTE); + handlerFrom.drain(filled, IFluidHandler.FluidAction.EXECUTE); + } + } } } @@ -298,7 +293,7 @@ public final class WorldUtil { BlockState state = level.getBlockState(pos); BreakEvent event = new BreakEvent(level, pos, state, fake); - if (!MinecraftForge.EVENT_BUS.post(event)) { + if (!NeoForge.EVENT_BUS.post(event).isCanceled()) { //return ForgeEventFactory.fireBlockHarvesting(drops, world, pos, state, 0, 1, false, fake); //TODO what?! } } @@ -336,7 +331,7 @@ public final class WorldUtil { // server sided handling if (!level.isClientSide) { // send the blockbreak event - int xp = ForgeHooks.onBlockBreakEvent(level, ((ServerPlayer) player).gameMode.getGameModeForPlayer(), (ServerPlayer) player, pos); + int xp = CommonHooks.onBlockBreakEvent(level, ((ServerPlayer) player).gameMode.getGameModeForPlayer(), (ServerPlayer) player, pos); if (xp == -1) { return false; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/SlotlessableItemHandlerWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/SlotlessableItemHandlerWrapper.java index f9a54e3bd..45fd25917 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/SlotlessableItemHandlerWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/SlotlessableItemHandlerWrapper.java @@ -10,20 +10,20 @@ package de.ellpeck.actuallyadditions.mod.util.compat; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.IItemHandler; +import net.neoforged.neoforge.items.IItemHandler; public class SlotlessableItemHandlerWrapper { + //TODO: Check if we need this wrapper at all? The previous implementation used CommonCapabilities ISlotlessItemhandler - private final LazyOptional normalHandler; + private final IItemHandler normalHandler; private final Object slotlessHandler; - public SlotlessableItemHandlerWrapper(LazyOptional normalHandler, Object slotlessHandler) { + public SlotlessableItemHandlerWrapper(IItemHandler normalHandler, Object slotlessHandler) { this.normalHandler = normalHandler; this.slotlessHandler = slotlessHandler; } - public LazyOptional getNormalHandler() { + public IItemHandler getNormalHandler() { return this.normalHandler; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/crafting/RecipeHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/crafting/RecipeHandler.java index c12bcf744..547d80bd0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/crafting/RecipeHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/crafting/RecipeHandler.java @@ -17,20 +17,20 @@ // // public static IRecipe lastRecipe; // -// public static void addOreDictRecipe(ItemStack output, Object... inputs) { -// addShapedRecipe(output, inputs); +// public static void addOreDictRecipe(ItemStack stack, Object... inputs) { +// addShapedRecipe(stack, inputs); // } // -// public static void addShapelessOreDictRecipe(ItemStack output, Object... inputs) { -// addShapelessRecipe(output, inputs); +// public static void addShapelessOreDictRecipe(ItemStack stack, Object... inputs) { +// addShapelessRecipe(stack, inputs); // } // -// public static void addShapelessRecipe(ItemStack output, Object... inputs) { -// RecipeHelper.addOldShapeless(output, inputs); +// public static void addShapelessRecipe(ItemStack stack, Object... inputs) { +// RecipeHelper.addOldShapeless(stack, inputs); // } // -// public static void addShapedRecipe(ItemStack output, Object... inputs) { -// RecipeHelper.addOldShaped(output, inputs); +// public static void addShapedRecipe(ItemStack stack, Object... inputs) { +// RecipeHelper.addOldShaped(stack, inputs); // } // //} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/crafting/RecipeHelper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/crafting/RecipeHelper.java index 4e1cf3317..8ef6fe584 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/crafting/RecipeHelper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/crafting/RecipeHelper.java @@ -51,108 +51,108 @@ // /* // * This adds a shaped recipe to the list of crafting recipes, using the forge format. // */ -// public static void addOldShaped(ItemStack output, Object... input) { +// public static void addOldShaped(ItemStack stack, Object... input) { // ShapedPrimer primer = CraftingHelper.parseShaped(input); -// addRecipe(j++, new ShapedRecipes(new ResourceLocation(MODID, "recipes" + j).toString(), primer.width, primer.height, primer.input, output)); +// addRecipe(j++, new ShapedRecipes(new ResourceLocation(MODID, "recipes" + j).toString(), primer.width, primer.height, primer.input, stack)); // } // // /* // * This adds a shaped recipe to the list of crafting recipes, using the forge format, with a custom group. // */ -// public static void addOldShaped(String group, ItemStack output, Object... input) { +// public static void addOldShaped(String group, ItemStack stack, Object... input) { // ShapedPrimer primer = CraftingHelper.parseShaped(input); -// addRecipe(j++, new ShapedRecipes(new ResourceLocation(MODID, group).toString(), primer.width, primer.height, primer.input, output)); +// addRecipe(j++, new ShapedRecipes(new ResourceLocation(MODID, group).toString(), primer.width, primer.height, primer.input, stack)); // } // // /* // * This adds a shaped recipe to the list of crafting recipes, using the forge format, with a custom group. // */ -// public static void addOldShaped(String name, String group, ItemStack output, Object... input) { +// public static void addOldShaped(String name, String group, ItemStack stack, Object... input) { // ShapedPrimer primer = CraftingHelper.parseShaped(input); -// addRecipe(j++, new ShapedRecipes(new ResourceLocation(MODID, group).toString(), primer.width, primer.height, primer.input, output).setRegistryName(MODID, name)); +// addRecipe(j++, new ShapedRecipes(new ResourceLocation(MODID, group).toString(), primer.width, primer.height, primer.input, stack).setRegistryName(MODID, name)); // } // // /* // * This adds a shapeless recipe to the list of crafting recipes, using the forge format. // */ -// public static void addOldShapeless(ItemStack output, Object... input) { -// addRecipe(j++, new ShapelessRecipes(new ResourceLocation(MODID, "recipes" + j).toString(), output, createInput(input))); +// public static void addOldShapeless(ItemStack stack, Object... input) { +// addRecipe(j++, new ShapelessRecipes(new ResourceLocation(MODID, "recipes" + j).toString(), stack, createInput(input))); // } // // /* // * This adds a shapeless recipe to the list of crafting recipes, using the forge format, with a custom group. // */ -// public static void addOldShapeless(String group, ItemStack output, Object... input) { -// addRecipe(j++, new ShapelessRecipes(new ResourceLocation(MODID, group).toString(), output, createInput(input))); +// public static void addOldShapeless(String group, ItemStack stack, Object... input) { +// addRecipe(j++, new ShapelessRecipes(new ResourceLocation(MODID, group).toString(), stack, createInput(input))); // } // -// public static void addOldShapeless(String name, String group, ItemStack output, Object... input) { -// addRecipe(j++, new ShapelessRecipes(new ResourceLocation(MODID, group).toString(), output, createInput(input)).setRegistryName(MODID, name)); +// public static void addOldShapeless(String name, String group, ItemStack stack, Object... input) { +// addRecipe(j++, new ShapelessRecipes(new ResourceLocation(MODID, group).toString(), stack, createInput(input)).setRegistryName(MODID, name)); // } // // /* -// * Adds a shapeless recipe with X output using an array of inputs. Use Strings for OreDictionary support. This array is not ordered. +// * Adds a shapeless recipe with X stack using an array of inputs. Use Strings for OreDictionary support. This array is not ordered. // */ -// public static void addShapeless(ItemStack output, Object... inputs) { -// addRecipe(j++, new ShapelessRecipes(MODID + ":" + j, output, createInput(inputs))); +// public static void addShapeless(ItemStack stack, Object... inputs) { +// addRecipe(j++, new ShapelessRecipes(MODID + ":" + j, stack, createInput(inputs))); // } // -// public static void addShapeless(Item output, Object... inputs) { -// addShapeless(new ItemStack(output), inputs); +// public static void addShapeless(Item stack, Object... inputs) { +// addShapeless(new ItemStack(stack), inputs); // } // -// public static void addShapeless(Block output, Object... inputs) { -// addShapeless(new ItemStack(output), inputs); +// public static void addShapeless(Block stack, Object... inputs) { +// addShapeless(new ItemStack(stack), inputs); // } // // /* -// * Adds a shapeless recipe with X output using an array of inputs. Use Strings for OreDictionary support. This array is not ordered. This has a custom group. +// * Adds a shapeless recipe with X stack using an array of inputs. Use Strings for OreDictionary support. This array is not ordered. This has a custom group. // */ -// public static void addShapeless(String group, ItemStack output, Object... inputs) { -// addRecipe(j++, new ShapelessRecipes(MODID + ":" + group, output, createInput(inputs))); +// public static void addShapeless(String group, ItemStack stack, Object... inputs) { +// addRecipe(j++, new ShapelessRecipes(MODID + ":" + group, stack, createInput(inputs))); // } // -// public static void addShapeless(String group, Item output, Object... inputs) { -// addShapeless(group, new ItemStack(output), inputs); +// public static void addShapeless(String group, Item stack, Object... inputs) { +// addShapeless(group, new ItemStack(stack), inputs); // } // -// public static void addShapeless(String group, Block output, Object... inputs) { -// addShapeless(group, new ItemStack(output), inputs); +// public static void addShapeless(String group, Block stack, Object... inputs) { +// addShapeless(group, new ItemStack(stack), inputs); // } // // /* -// * Adds a shapeless recipe with X output on a crafting grid that is W x H, using an array of inputs. Use null for nothing, use Strings for OreDictionary support, this array must have a length of width * height. +// * Adds a shapeless recipe with X stack on a crafting grid that is W x H, using an array of inputs. Use null for nothing, use Strings for OreDictionary support, this array must have a length of width * height. // * This array is ordered, and items must follow from left to right, top to bottom of the crafting grid. // */ -// public static void addShaped(ItemStack output, int width, int height, Object... input) { -// addRecipe(j++, genShaped(output, width, height, input)); +// public static void addShaped(ItemStack stack, int width, int height, Object... input) { +// addRecipe(j++, genShaped(stack, width, height, input)); // } // -// public static void addShaped(Item output, int width, int height, Object... input) { -// addShaped(new ItemStack(output), width, height, input); +// public static void addShaped(Item stack, int width, int height, Object... input) { +// addShaped(new ItemStack(stack), width, height, input); // } // -// public static void addShaped(Block output, int width, int height, Object... input) { -// addShaped(new ItemStack(output), width, height, input); +// public static void addShaped(Block stack, int width, int height, Object... input) { +// addShaped(new ItemStack(stack), width, height, input); // } // // /* -// * Adds a shapeless recipe with X output on a crafting grid that is W x H, using an array of inputs. Use null for nothing, use Strings for OreDictionary support, this array must have a length of width * height. +// * Adds a shapeless recipe with X stack on a crafting grid that is W x H, using an array of inputs. Use null for nothing, use Strings for OreDictionary support, this array must have a length of width * height. // * This array is ordered, and items must follow from left to right, top to bottom of the crafting grid. This has a custom group. // */ -// public static void addShaped(String group, ItemStack output, int width, int height, Object... input) { -// addRecipe(j++, genShaped(MODID + ":" + group, output, width, height, input)); +// public static void addShaped(String group, ItemStack stack, int width, int height, Object... input) { +// addRecipe(j++, genShaped(MODID + ":" + group, stack, width, height, input)); // } // -// public static void addShaped(String group, Item output, int width, int height, Object... input) { -// addShaped(group, new ItemStack(output), width, height, input); +// public static void addShaped(String group, Item stack, int width, int height, Object... input) { +// addShaped(group, new ItemStack(stack), width, height, input); // } // -// public static void addShaped(String group, Block output, int width, int height, Object... input) { -// addShaped(group, new ItemStack(output), width, height, input); +// public static void addShaped(String group, Block stack, int width, int height, Object... input) { +// addShaped(group, new ItemStack(stack), width, height, input); // } // -// public static ShapedRecipes genShaped(ItemStack output, int l, int w, Object[] input) { +// public static ShapedRecipes genShaped(ItemStack stack, int l, int w, Object[] input) { // if (input[0] instanceof Object[]) { // input = (Object[]) input[0]; // } @@ -173,10 +173,10 @@ // } // } // -// return new ShapedRecipes(MODID + ":" + j, l, w, inputL, output); +// return new ShapedRecipes(MODID + ":" + j, l, w, inputL, stack); // } // -// public static ShapedRecipes genShaped(String group, ItemStack output, int l, int w, Object[] input) { +// public static ShapedRecipes genShaped(String group, ItemStack stack, int l, int w, Object[] input) { // if (input[0] instanceof List) { // input = ((List) input[0]).toArray(); // } else if (input[0] instanceof Object[]) { @@ -201,7 +201,7 @@ // } // } // -// return new ShapedRecipes(group, l, w, inputL, output); +// return new ShapedRecipes(group, l, w, inputL, stack); // } // // public static NonNullList createInput(Object[] input) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/registration/AABlockReg.java b/src/main/java/de/ellpeck/actuallyadditions/registration/AABlockReg.java index a5529448d..9dddacd8a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/registration/AABlockReg.java +++ b/src/main/java/de/ellpeck/actuallyadditions/registration/AABlockReg.java @@ -7,7 +7,8 @@ import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.registries.DeferredBlock; +import net.neoforged.neoforge.registries.DeferredItem; import javax.annotation.Nonnull; import java.util.Objects; @@ -16,9 +17,9 @@ import java.util.function.Supplier; public class AABlockReg implements Supplier { private final String name; - private RegistryObject block; - private RegistryObject item; - private RegistryObject> tileEntityType; + private DeferredBlock block; + private DeferredItem item; + private Supplier> tileEntityType; public AABlockReg(String name, Supplier blockSupplier, Function itemSupplier, BlockEntityType.BlockEntitySupplier tileSupplier) { this.name = name; diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index 456baad49..86d2587cd 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -1,3 +1,3 @@ public net.minecraft.world.damagesource.DamageSources *() # DamageSources -public net.minecraft.world.damagesource.DamageSources f_268645_ # damageTypes -public-f net.minecraft.data.recipes.RecipeProvider m_6055_()Ljava/lang/String; # getName \ No newline at end of file +public net.minecraft.world.damagesource.DamageSources damageTypes +public-f net.minecraft.data.recipes.RecipeProvider getName()Ljava/lang/String; \ No newline at end of file diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 694c2f555..30d6e455f 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,6 +1,6 @@ modLoader="javafml" -loaderVersion="[47,)" +loaderVersion="[2,)" license="MIT" [[mods]] modId="actuallyadditions" @@ -14,15 +14,15 @@ Do you want Automation? Wireless Transport? Better Machines? A cup o' Coffee? Ch ''' [[dependencies.actuallyadditions]] - modId="forge" - mandatory=true - versionRange="[47,)" + modId="neoforge" + type="required" + versionRange="[20.4.167,)" ordering="NONE" side="BOTH" [[dependencies.actuallyadditions]] modId="minecraft" - mandatory=true - versionRange="[1.20.1,1.21)" + type="required" + versionRange="[1.20.4,1.21)" ordering="NONE" side="BOTH" diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index e087718a9..4370def5e 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,7 +1,8 @@ { "pack": { - "description": "actuallyadditions resources", - "pack_format": 6, - "_comment": "A pack_format of 6 requires json lang files and some texture changes from 1.16.2. Note: we require v6 pack meta for all mods." + "description": { + "text": "actuallyadditions resources" + }, + "pack_format": 22 } }