diff --git a/.gitignore b/.gitignore
index d0b65f00..eb49f0ce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,7 +11,6 @@ out
*.ipr
*.iws
*.iml
-.idea
# gradle
build
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 00000000..33e97fdd
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,11 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+
+jarRepositories.xml
+uiDesigner.xml
\ No newline at end of file
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 00000000..41c8fbb4
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 00000000..6e6eec11
--- /dev/null
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 00000000..b589d56e
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 00000000..c26b135d
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/PhosCodeStyle.xml b/.idea/inspectionProfiles/PhosCodeStyle.xml
new file mode 100644
index 00000000..4b5bd5b1
--- /dev/null
+++ b/.idea/inspectionProfiles/PhosCodeStyle.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 00000000..d77aa703
--- /dev/null
+++ b/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 00000000..2bfae1f8
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 00000000..e4f6507d
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/remote-targets.xml b/.idea/remote-targets.xml
new file mode 100644
index 00000000..7a8ddc42
--- /dev/null
+++ b/.idea/remote-targets.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 00000000..35eb1ddf
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Phosphophyllite b/Phosphophyllite
index e4685db6..d1b37c8d 160000
--- a/Phosphophyllite
+++ b/Phosphophyllite
@@ -1 +1 @@
-Subproject commit e4685db6443344fc3ac1b9b844a7fc5f4ee9863c
+Subproject commit d1b37c8d53a79a897de0c219bc12411ea57d809a
diff --git a/Quartz b/Quartz
index 077a68fa..310fc60a 160000
--- a/Quartz
+++ b/Quartz
@@ -1 +1 @@
-Subproject commit 077a68fa5a191044ae67ce493163eaf8b4027d7b
+Subproject commit 310fc60af9a3710ecb3d99d67b3cf0928c765e06
diff --git a/build.gradle b/build.gradle
index ff91782e..f527a318 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,13 +1,14 @@
plugins {
+ id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
- id 'net.neoforged.gradle' version '[6.0.18,6.2)'
- id 'org.spongepowered.mixin' version '0.7.+'
- id 'org.parchmentmc.librarian.forgegradle' version '1.+'
+ id 'net.neoforged.gradle.userdev' version '7.0.+'
+ id 'net.neoforged.gradle.mixin' version '7.0.+'
}
-evaluationDependsOnChildren()
+evaluationDependsOn(':Phosphophyllite')
+evaluationDependsOn(':Quartz')
version = "${majorVersion}.${minorVersion}.${patchVersion}"
if (!"${postfixVersion}".isEmpty()) {
@@ -20,63 +21,53 @@ base {
}
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
-println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
-
-minecraft {
- mappings channel: mapping_channel, version: mapping_version
-
- copyIdeResources = true
- accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
-
- runs {
- // applies to all the run configs below
- configureEach {
- workingDirectory project.file("run/${it.name}")
-
- property 'forge.logging.markers', 'SCAN,REGISTRIES'
- property 'forge.logging.console.level', 'debug'
-
- mods {
- "${mod_id}" {
- source sourceSets.main
- }
- Quartz {
- source project(':Quartz').sourceSets.main
- }
- Phosphophyllite {
- source project(':Phosphophyllite').sourceSets.main
- }
+
+//accessTransformers {
+// file 'src/main/resources/META-INF/accesstransformer.cfg'
+//}
+
+runs {
+ configureEach {
+ workingDirectory project.file("run/${it.name}")
+
+ systemProperty 'forge.logging.markers', 'SCAN,REGISTRIES'
+ systemProperty 'forge.logging.console.level', 'debug'
+
+ modSource project.sourceSets.main
+ modSource project(':Quartz').sourceSets.main
+ modSource project(':Phosphophyllite').sourceSets.main
+
+ dependencies {
+ runtime("org.lwjgl:lwjgl-opencl:3.3.1") {
+ transitive(false)
+ }
+ runtime("org.lwjgl:lwjgl-vulkan:3.3.1"){
+ transitive(false)
}
}
+ }
- client {
- // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
- property 'forge.enabledGameTestNamespaces', mod_id
- }
+ client {
+ systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
+ }
- server {
- property 'forge.enabledGameTestNamespaces', mod_id
- args '--nogui'
- }
+ server {
+ systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
+ programArgument '--nogui'
+ }
- gameTestServer {
- property 'forge.enabledGameTestNamespaces', mod_id
- }
+ gameTestServer {
+ systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
+ }
- data {
- args '--mod', mod_id, '--all', '--existing-mod', 'biggerreactors', '--existing-mod', 'phosphophyllite', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
- }
+ data {
+ programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
}
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
-mixin {
- config 'quartz.mixins.json'
- config 'phosphophyllite.mixins.json'
-}
-
repositories {
maven {
url = "https://www.cursemaven.com"
@@ -101,39 +92,39 @@ repositories {
}
dependencies {
- minecraft "net.neoforged:forge:${mc_version}-${neo_version}"
+ implementation "net.neoforged:neoforge:${neo_version}"
compileOnly project(':Phosphophyllite')
compileOnly project(':Quartz')
compileOnly("cc.tweaked:cc-tweaked-${cc_mc_version}-core-api:${cc_version}")
- compileOnly(fg.deobf("cc.tweaked:cc-tweaked-${cc_mc_version}-forge-api:${cc_version}"))
- runtimeOnly(fg.deobf("cc.tweaked:cc-tweaked-${cc_mc_version}-forge:${cc_version}"))
+ compileOnly("cc.tweaked:cc-tweaked-${cc_mc_version}-forge-api:${cc_version}")
+// runtimeOnly("cc.tweaked:cc-tweaked-${cc_mc_version}-forge:${cc_version}")
- compileOnly(fg.deobf("mezz.jei:jei-${jei_mc_version}-common-api:${jei_version}"))
- compileOnly(fg.deobf("mezz.jei:jei-${jei_mc_version}-forge-api:${jei_version}"))
+ compileOnly("mezz.jei:jei-${jei_mc_version}-common-api:${jei_version}")
+ compileOnly("mezz.jei:jei-${jei_mc_version}-forge-api:${jei_version}")
// at runtime, use the full JEI jar for Forge
- runtimeOnly(fg.deobf("mezz.jei:jei-${jei_mc_version}-forge:${jei_version}"))
+// runtimeOnly("mezz.jei:jei-${jei_mc_version}-forge:${jei_version}")
compileOnly "mekanism:Mekanism:1.19.2-10.3.5.474:api"
-// runtimeOnly fg.deobf('curse.maven:MEK-268560:4041164')
-// runtimeOnly fg.deobf('curse.maven:MEKG-268566:4041168')
-// runtimeOnly fg.deobf('curse.maven:COFHCore-69162:4385216')
-// runtimeOnly fg.deobf('curse.maven:ThermalFoundation-222880:4382373')
-// runtimeOnly fg.deobf('curse.maven:ThermalExpansion-69163:4382371')
-// runtimeOnly fg.deobf('curse.maven:ThermalDynamics-227443:4391160')
+// runtimeOnly 'curse.maven:MEK-268560:4041164'
+// runtimeOnly 'curse.maven:MEKG-268566:4041168'
+// runtimeOnly 'curse.maven:COFHCore-69162:4385216'
+// runtimeOnly 'curse.maven:ThermalFoundation-222880:4382373'
+// runtimeOnly 'curse.maven:ThermalExpansion-69163:4382371'
+// runtimeOnly 'curse.maven:ThermalDynamics-227443:4391160'
-// runtimeOnly fg.deobf('curse.maven:Rubidium-574856:4448157')
- runtimeOnly fg.deobf('curse.maven:Oculus-581495:4578741')
+// runtimeOnly 'curse.maven:Rubidium-574856:4448157'
+// runtimeOnly 'curse.maven:Oculus-581495:4578741'
-// runtimeOnly fg.deobf('curse.maven:WorldStripper-250603:3545856')
-// runtimeOnly fg.deobf('curse.maven:CW-399558:3926815')
+// runtimeOnly 'curse.maven:WorldStripper-250603:3545856')
+// runtimeOnly 'curse.maven:CW-399558:3926815')
- minecraftLibrary("org.lwjgl:lwjgl-opencl:3.3.1") {
+ compileOnly("org.lwjgl:lwjgl-opencl:3.3.1") {
transitive(false)
}
- minecraftLibrary ("org.lwjgl:lwjgl-vulkan:3.3.1"){
+ compileOnly("org.lwjgl:lwjgl-vulkan:3.3.1"){
transitive(false)
}
}
@@ -159,7 +150,7 @@ gradle.projectsEvaluated {
var replaceProperties = [
minecraft_version : mc_version,
neo_version : neo_version,
- loader_version : neo_version.substring(0, neo_version.indexOf('.')),
+ loader_version : loader_version,
version : version,
phos_version_range : project.project(":Phosphophyllite").property("compatibility").toString(),
quartz_version_range: project.project(":Quartz").property("compatibility").toString(),
@@ -215,27 +206,22 @@ publishing {
}
}
-// NeoGradle is dumb, and generates the run configs incorrectly, this fixes them
-tasks.register('zzz_copyRunConfigsToTmpDir', Copy) {
- from '.idea/runConfigurations'
- into '.idea/runConfigurations1'
-}
-
-tasks.register('zzz_depeteTmpDir', Delete) {
- delete '.idea/runConfigurations1'
-}
-
-tasks.register('_createIntellijRunsThatWork', Copy) {
- dependsOn 'genIntellijRuns'
- mustRunAfter 'genIntellijRuns'
- dependsOn 'zzz_copyRunConfigsToTmpDir'
- mustRunAfter 'zzz_copyRunConfigsToTmpDir'
+// NeoGradle bug, this works around it
+gradle.projectsEvaluated {
+ var subProjects = List.of(project.project(':Quartz'), project.project(':Phosphophyllite'))
- from '.idea/runConfigurations1'
- into '.idea/runConfigurations'
- filter { String line -> line.replace("out/production/classes", "build/classes/java/main") }
- filter { String line -> line.replace("out/production/resources", "build/resources/main") }
- filter { String line -> line.replace("copyIntellijResources", "prepareRunClientCompile") }
+ var neoFormJoinDownloadAssetsTaskName = null
+ for (final def taskName in project.tasks.getNames()) {
+ if (taskName.contains("neoFormJoined") && taskName.contains("DownloadAssets")) {
+ neoFormJoinDownloadAssetsTaskName = taskName
+ break
+ }
+ }
- finalizedBy 'zzz_depeteTmpDir'
+ var lastTask = project.tasks.getByPath(neoFormJoinDownloadAssetsTaskName)
+ for (final def subProject in subProjects) {
+ var nextTask = subProject.tasks.getByPath(neoFormJoinDownloadAssetsTaskName);
+ lastTask.mustRunAfter(nextTask)
+ lastTask = nextTask
+ }
}
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index 23cf7483..5cbdcf29 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,10 +1,12 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
-mc_version=1.20.1
-mapping_channel=parchment
-mapping_version=2023.07.09-1.20.1
-neo_version=47.1.76
+mc_version=1.20.4
+mapping_channel=official
+mapping_version=1.20.4
+neo_version=20.4.156-beta
+loader_version=1
+
cc_mc_version=1.20.1
cc_version=1.106.1
diff --git a/src/main/java/net/roguelogix/biggerreactors/BiggerReactors.java b/src/main/java/net/roguelogix/biggerreactors/BiggerReactors.java
index 02eb950f..2c6998ad 100644
--- a/src/main/java/net/roguelogix/biggerreactors/BiggerReactors.java
+++ b/src/main/java/net/roguelogix/biggerreactors/BiggerReactors.java
@@ -3,13 +3,11 @@
import it.unimi.dsi.fastutil.objects.ReferenceArrayList;
import net.minecraft.client.gui.screens.MenuScreens;
import net.minecraft.resources.ResourceLocation;
-import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.fml.common.Mod;
-import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
-import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
-import net.minecraftforge.fml.loading.FMLLoader;
-import net.roguelogix.biggerreactors.machine.client.CyaniteReprocessorScreen;
-import net.roguelogix.biggerreactors.machine.containers.CyaniteReprocessorContainer;
+import net.neoforged.fml.ModLoadingContext;
+import net.neoforged.fml.common.Mod;
+import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
+import net.neoforged.fml.loading.FMLLoader;
+import net.neoforged.neoforge.common.NeoForge;
import net.roguelogix.biggerreactors.multiblocks.heatexchanger.client.HeatExchangerFluidPortScreen;
import net.roguelogix.biggerreactors.multiblocks.heatexchanger.client.HeatExchangerTerminalScreen;
import net.roguelogix.biggerreactors.multiblocks.heatexchanger.containers.HeatExchangerFluidPortContainer;
@@ -41,8 +39,8 @@ public class BiggerReactors {
public BiggerReactors() {
new Registry(new ReferenceArrayList<>(), ReferenceArrayList.of(new ResourceLocation(Phosphophyllite.modid, "creative_tab"), new ResourceLocation(Quartz.modid, "creative_tab")));
- FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onClientSetup);
- MinecraftForge.EVENT_BUS.addListener(this::onReloadData);
+ ModLoadingContext.get().getActiveContainer().getEventBus().addListener(this::onClientSetup);
+ NeoForge.EVENT_BUS.addListener(this::onReloadData);
version = FMLLoader.getLoadingModList().getModFileById(modid).versionString();
}
@@ -55,8 +53,8 @@ public void onReloadData(final ReloadDataEvent reloadDataEvent) {
public void onClientSetup(final FMLClientSetupEvent e) {
// TODO: 6/28/20 Registry.
// Since I already have the comment here, also need to do a capability registry. I have a somewhat dumb capability to register.
- MenuScreens.register(CyaniteReprocessorContainer.INSTANCE,
- CyaniteReprocessorScreen::new);
+// MenuScreens.register(CyaniteReprocessorContainer.INSTANCE,
+// CyaniteReprocessorScreen::new);
MenuScreens.register(ReactorTerminalContainer.INSTANCE,
CommonReactorTerminalScreen::new);
MenuScreens.register(ReactorCoolantPortContainer.INSTANCE,
diff --git a/src/main/java/net/roguelogix/biggerreactors/blocks/materials/DeepslateUraniumOre.java b/src/main/java/net/roguelogix/biggerreactors/blocks/materials/DeepslateUraniumOre.java
index be5fd761..21551e33 100644
--- a/src/main/java/net/roguelogix/biggerreactors/blocks/materials/DeepslateUraniumOre.java
+++ b/src/main/java/net/roguelogix/biggerreactors/blocks/materials/DeepslateUraniumOre.java
@@ -1,5 +1,6 @@
package net.roguelogix.biggerreactors.blocks.materials;
+import net.minecraft.util.valueproviders.ConstantInt;
import net.minecraft.world.level.block.DropExperienceBlock;
import net.minecraft.world.level.block.SoundType;
import net.roguelogix.phosphophyllite.registry.RegisterBlock;
@@ -11,7 +12,7 @@ public class DeepslateUraniumOre extends DropExperienceBlock {
public static final DeepslateUraniumOre INSTANCE = new DeepslateUraniumOre();
public DeepslateUraniumOre() {
- super(
+ super(ConstantInt.of(0),
Properties.of()
.sound(SoundType.DEEPSLATE)
.explosionResistance(3.0F)
diff --git a/src/main/java/net/roguelogix/biggerreactors/blocks/materials/UraniumOre.java b/src/main/java/net/roguelogix/biggerreactors/blocks/materials/UraniumOre.java
index bca46dcd..f1716e01 100644
--- a/src/main/java/net/roguelogix/biggerreactors/blocks/materials/UraniumOre.java
+++ b/src/main/java/net/roguelogix/biggerreactors/blocks/materials/UraniumOre.java
@@ -1,5 +1,6 @@
package net.roguelogix.biggerreactors.blocks.materials;
+import net.minecraft.util.valueproviders.ConstantInt;
import net.minecraft.world.level.block.DropExperienceBlock;
import net.minecraft.world.level.block.SoundType;
import net.roguelogix.phosphophyllite.registry.RegisterBlock;
@@ -10,7 +11,7 @@ public class UraniumOre extends DropExperienceBlock {
public static final UraniumOre INSTANCE = new UraniumOre();
public UraniumOre() {
- super(
+ super(ConstantInt.of(0),
Properties.of()
.sound(SoundType.STONE)
.explosionResistance(3.0F)
diff --git a/src/main/java/net/roguelogix/biggerreactors/client/Biselector.java b/src/main/java/net/roguelogix/biggerreactors/client/Biselector.java
index 6eeb74cd..5e91958b 100644
--- a/src/main/java/net/roguelogix/biggerreactors/client/Biselector.java
+++ b/src/main/java/net/roguelogix/biggerreactors/client/Biselector.java
@@ -6,8 +6,8 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.inventory.AbstractContainerMenu;
-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 net.roguelogix.phosphophyllite.client.gui.screens.PhosphophylliteScreen;
import net.roguelogix.phosphophyllite.client.gui.RenderHelper;
import net.roguelogix.phosphophyllite.client.gui.elements.InteractiveElement;
diff --git a/src/main/java/net/roguelogix/biggerreactors/client/CommonButton.java b/src/main/java/net/roguelogix/biggerreactors/client/CommonButton.java
index 1cd83a89..4d553479 100644
--- a/src/main/java/net/roguelogix/biggerreactors/client/CommonButton.java
+++ b/src/main/java/net/roguelogix/biggerreactors/client/CommonButton.java
@@ -6,8 +6,8 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.inventory.AbstractContainerMenu;
-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 net.roguelogix.phosphophyllite.client.gui.RenderHelper;
import net.roguelogix.phosphophyllite.client.gui.screens.PhosphophylliteScreen;
import net.roguelogix.phosphophyllite.client.gui.elements.InteractiveElement;
diff --git a/src/main/java/net/roguelogix/biggerreactors/client/CommonRender.java b/src/main/java/net/roguelogix/biggerreactors/client/CommonRender.java
index c810e688..ede26eda 100644
--- a/src/main/java/net/roguelogix/biggerreactors/client/CommonRender.java
+++ b/src/main/java/net/roguelogix/biggerreactors/client/CommonRender.java
@@ -6,9 +6,9 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.level.material.Fluid;
-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 net.roguelogix.biggerreactors.BiggerReactors;
import net.roguelogix.phosphophyllite.client.gui.RenderHelper;
import net.roguelogix.phosphophyllite.client.gui.elements.RenderedElement;
diff --git a/src/main/java/net/roguelogix/biggerreactors/client/TextBox.java b/src/main/java/net/roguelogix/biggerreactors/client/TextBox.java
index d51626f2..ec2396d1 100644
--- a/src/main/java/net/roguelogix/biggerreactors/client/TextBox.java
+++ b/src/main/java/net/roguelogix/biggerreactors/client/TextBox.java
@@ -11,8 +11,8 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.inventory.AbstractContainerMenu;
-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 net.roguelogix.biggerreactors.BiggerReactors;
import net.roguelogix.phosphophyllite.client.gui.screens.PhosphophylliteScreen;
import net.roguelogix.phosphophyllite.client.gui.RenderHelper;
diff --git a/src/main/java/net/roguelogix/biggerreactors/client/Triselector.java b/src/main/java/net/roguelogix/biggerreactors/client/Triselector.java
index a8e388d6..d4feb169 100644
--- a/src/main/java/net/roguelogix/biggerreactors/client/Triselector.java
+++ b/src/main/java/net/roguelogix/biggerreactors/client/Triselector.java
@@ -1,16 +1,15 @@
package net.roguelogix.biggerreactors.client;
-import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.inventory.AbstractContainerMenu;
-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 net.roguelogix.phosphophyllite.client.gui.RenderHelper;
-import net.roguelogix.phosphophyllite.client.gui.screens.PhosphophylliteScreen;
import net.roguelogix.phosphophyllite.client.gui.elements.InteractiveElement;
+import net.roguelogix.phosphophyllite.client.gui.screens.PhosphophylliteScreen;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
diff --git a/src/main/java/net/roguelogix/biggerreactors/client/deps/jei/BiggerReactorsJEIPlugin.java b/src/main/java/net/roguelogix/biggerreactors/client/deps/jei/BiggerReactorsJEIPlugin.java
index 8f395064..9ee76e67 100644
--- a/src/main/java/net/roguelogix/biggerreactors/client/deps/jei/BiggerReactorsJEIPlugin.java
+++ b/src/main/java/net/roguelogix/biggerreactors/client/deps/jei/BiggerReactorsJEIPlugin.java
@@ -10,7 +10,7 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.AirBlock;
import net.minecraft.world.level.block.LiquidBlock;
-import net.minecraftforge.fluids.FluidStack;
+import net.neoforged.neoforge.fluids.FluidStack;
import net.roguelogix.biggerreactors.BiggerReactors;
import net.roguelogix.biggerreactors.Config;
import net.roguelogix.biggerreactors.client.deps.jei.classic.reactor.BlockModeratorCategory;
diff --git a/src/main/java/net/roguelogix/biggerreactors/client/deps/jei/classic/reactor/FluidModeratorCategory.java b/src/main/java/net/roguelogix/biggerreactors/client/deps/jei/classic/reactor/FluidModeratorCategory.java
index 51ff7c1c..5f25b7e7 100644
--- a/src/main/java/net/roguelogix/biggerreactors/client/deps/jei/classic/reactor/FluidModeratorCategory.java
+++ b/src/main/java/net/roguelogix/biggerreactors/client/deps/jei/classic/reactor/FluidModeratorCategory.java
@@ -1,6 +1,5 @@
package net.roguelogix.biggerreactors.client.deps.jei.classic.reactor;
-import com.mojang.blaze3d.vertex.PoseStack;
import mezz.jei.api.gui.builder.IRecipeLayoutBuilder;
import mezz.jei.api.gui.drawable.IDrawable;
import mezz.jei.api.gui.ingredient.IRecipeSlotsView;
@@ -14,7 +13,7 @@
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
+import net.neoforged.neoforge.fluids.FluidStack;
import net.roguelogix.biggerreactors.BiggerReactors;
import net.roguelogix.biggerreactors.multiblocks.reactor.blocks.ReactorTerminal;
import net.roguelogix.biggerreactors.registries.ReactorModeratorRegistry;
diff --git a/src/main/java/net/roguelogix/biggerreactors/machine/blocks/CyaniteReprocessor.java b/src/main/java/net/roguelogix/biggerreactors/machine/blocks/CyaniteReprocessor.java
index 01d58056..a48b1fb4 100644
--- a/src/main/java/net/roguelogix/biggerreactors/machine/blocks/CyaniteReprocessor.java
+++ b/src/main/java/net/roguelogix/biggerreactors/machine/blocks/CyaniteReprocessor.java
@@ -1,108 +1,107 @@
-package net.roguelogix.biggerreactors.machine.blocks;
-
-import net.minecraft.core.BlockPos;
-import net.minecraft.core.Direction;
-import net.minecraft.world.InteractionHand;
-import net.minecraft.world.InteractionResult;
-import net.minecraft.world.entity.LivingEntity;
-import net.minecraft.world.entity.player.Player;
-import net.minecraft.world.item.ItemStack;
-import net.minecraft.world.level.Level;
-import net.minecraft.world.level.block.*;
-import net.minecraft.world.level.block.entity.BlockEntity;
-import net.minecraft.world.level.block.entity.BlockEntityTicker;
-import net.minecraft.world.level.block.entity.BlockEntityType;
-import net.minecraft.world.level.block.state.BlockState;
-import net.minecraft.world.level.block.state.StateDefinition;
-import net.minecraft.world.level.block.state.properties.BlockStateProperties;
-import net.minecraft.world.level.block.state.properties.BooleanProperty;
-import net.minecraft.world.level.block.state.properties.DirectionProperty;
-import net.minecraft.world.phys.BlockHitResult;
-import net.minecraftforge.common.ToolAction;
-import net.roguelogix.biggerreactors.machine.tiles.CyaniteReprocessorTile;
-import net.roguelogix.phosphophyllite.registry.RegisterBlock;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-public class CyaniteReprocessor extends BaseEntityBlock implements EntityBlock{
-
- public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
- public static final BooleanProperty ENABLED = BlockStateProperties.ENABLED;
-
- @RegisterBlock(name = "cyanite_reprocessor", tileEntityClass = CyaniteReprocessorTile.class)
- public static final CyaniteReprocessor INSTANCE = new CyaniteReprocessor();
-
- public CyaniteReprocessor() {
- super(Properties.of()
- .sound(SoundType.STONE)
- .destroyTime(1.0F)
- .explosionResistance(1.0F)
- .requiresCorrectToolForDrops());
- this.registerDefaultState(this.getStateDefinition().any()
- .setValue(FACING, Direction.NORTH)
- .setValue(ENABLED, Boolean.FALSE));
- }
-
- public static Direction getFacingFromEntity(BlockPos clickedBlockPos, LivingEntity entity) {
- return Direction.getNearest((float) (entity.getX() - clickedBlockPos.getX()), 0.0F, (float) (entity.getZ() - clickedBlockPos.getZ()));
- }
-
- @Nonnull
- @Override
- public RenderShape getRenderShape(@Nonnull BlockState blockState) {
- return RenderShape.MODEL;
- }
-
- @Nullable
- @Override
- public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
- return CyaniteReprocessorTile.SUPPLIER.create(pos, state);
- }
-
- @Nullable
- @Override
- public BlockEntityTicker getTicker(Level level, BlockState state, BlockEntityType type) {
- return (a, b, c, tile) -> {
- assert tile instanceof CyaniteReprocessorTile;
- ((CyaniteReprocessorTile) tile).tick();
- };
- }
-
- @Override
- public void createBlockStateDefinition(StateDefinition.Builder builder) {
- builder.add(FACING).add(ENABLED);
- }
-
- @Nonnull
- @Override
- public InteractionResult use(@Nonnull BlockState blockState, Level world, @Nonnull BlockPos blockPos, @Nonnull Player player, @Nonnull InteractionHand hand, @Nonnull BlockHitResult trace) {
- BlockEntity tile = world.getBlockEntity(blockPos);
- if (tile instanceof CyaniteReprocessorTile) {
- return ((CyaniteReprocessorTile) tile).onBlockActivated(blockState, world, blockPos, player, hand, trace);
- }
- return InteractionResult.FAIL;
- }
-
-
-
- @Override
- public void onRemove(BlockState blockState, Level world, BlockPos blockPos, BlockState newBlockState, boolean isMoving) {
- if (blockState.getBlock() != newBlockState.getBlock()) {
- BlockEntity tile = world.getBlockEntity(blockPos);
- if (tile instanceof CyaniteReprocessorTile) {
- ((CyaniteReprocessorTile) tile).onReplaced(blockState, world, blockPos, newBlockState, isMoving);
- }
- super.onRemove(blockState, world, blockPos, newBlockState, isMoving);
- }
- }
-
- @Override
- public void setPlacedBy(@Nonnull Level world, @Nonnull BlockPos blockPos, @Nonnull BlockState blockState, @Nullable LivingEntity entity, @Nonnull ItemStack stack) {
- if (entity != null) {
- world.setBlock(blockPos, blockState
- .setValue(FACING, getFacingFromEntity(blockPos, entity))
- .setValue(ENABLED, false), 2);
- }
- }
-}
+//package net.roguelogix.biggerreactors.machine.blocks;
+//
+//import net.minecraft.core.BlockPos;
+//import net.minecraft.core.Direction;
+//import net.minecraft.world.InteractionHand;
+//import net.minecraft.world.InteractionResult;
+//import net.minecraft.world.entity.LivingEntity;
+//import net.minecraft.world.entity.player.Player;
+//import net.minecraft.world.item.ItemStack;
+//import net.minecraft.world.level.Level;
+//import net.minecraft.world.level.block.*;
+//import net.minecraft.world.level.block.entity.BlockEntity;
+//import net.minecraft.world.level.block.entity.BlockEntityTicker;
+//import net.minecraft.world.level.block.entity.BlockEntityType;
+//import net.minecraft.world.level.block.state.BlockState;
+//import net.minecraft.world.level.block.state.StateDefinition;
+//import net.minecraft.world.level.block.state.properties.BlockStateProperties;
+//import net.minecraft.world.level.block.state.properties.BooleanProperty;
+//import net.minecraft.world.level.block.state.properties.DirectionProperty;
+//import net.minecraft.world.phys.BlockHitResult;
+//import net.roguelogix.biggerreactors.machine.tiles.CyaniteReprocessorTile;
+//import net.roguelogix.phosphophyllite.registry.RegisterBlock;
+//
+//import javax.annotation.Nonnull;
+//import javax.annotation.Nullable;
+//
+//public class CyaniteReprocessor extends Block implements EntityBlock{
+//
+// public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
+// public static final BooleanProperty ENABLED = BlockStateProperties.ENABLED;
+//
+// @RegisterBlock(name = "cyanite_reprocessor", tileEntityClass = CyaniteReprocessorTile.class)
+// public static final CyaniteReprocessor INSTANCE = new CyaniteReprocessor();
+//
+// public CyaniteReprocessor() {
+// super(Properties.of()
+// .sound(SoundType.STONE)
+// .destroyTime(1.0F)
+// .explosionResistance(1.0F)
+// .requiresCorrectToolForDrops());
+// this.registerDefaultState(this.getStateDefinition().any()
+// .setValue(FACING, Direction.NORTH)
+// .setValue(ENABLED, Boolean.FALSE));
+// }
+//
+// public static Direction getFacingFromEntity(BlockPos clickedBlockPos, LivingEntity entity) {
+// return Direction.getNearest((float) (entity.getX() - clickedBlockPos.getX()), 0.0F, (float) (entity.getZ() - clickedBlockPos.getZ()));
+// }
+//
+// @Nonnull
+// @Override
+// public RenderShape getRenderShape(@Nonnull BlockState blockState) {
+// return RenderShape.MODEL;
+// }
+//
+// @Nullable
+// @Override
+// public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
+// return CyaniteReprocessorTile.SUPPLIER.create(pos, state);
+// }
+//
+// @Nullable
+// @Override
+// public BlockEntityTicker getTicker(Level level, BlockState state, BlockEntityType type) {
+// return (a, b, c, tile) -> {
+// assert tile instanceof CyaniteReprocessorTile;
+// ((CyaniteReprocessorTile) tile).tick();
+// };
+// }
+//
+// @Override
+// public void createBlockStateDefinition(StateDefinition.Builder builder) {
+// builder.add(FACING).add(ENABLED);
+// }
+//
+// @Nonnull
+// @Override
+// public InteractionResult use(@Nonnull BlockState blockState, Level world, @Nonnull BlockPos blockPos, @Nonnull Player player, @Nonnull InteractionHand hand, @Nonnull BlockHitResult trace) {
+// BlockEntity tile = world.getBlockEntity(blockPos);
+// if (tile instanceof CyaniteReprocessorTile) {
+// return ((CyaniteReprocessorTile) tile).onBlockActivated(blockState, world, blockPos, player, hand, trace);
+// }
+// return InteractionResult.FAIL;
+// }
+//
+//
+//
+// @Override
+// public void onRemove(BlockState blockState, Level world, BlockPos blockPos, BlockState newBlockState, boolean isMoving) {
+// if (blockState.getBlock() != newBlockState.getBlock()) {
+// BlockEntity tile = world.getBlockEntity(blockPos);
+// if (tile instanceof CyaniteReprocessorTile) {
+// ((CyaniteReprocessorTile) tile).onReplaced(blockState, world, blockPos, newBlockState, isMoving);
+// }
+// super.onRemove(blockState, world, blockPos, newBlockState, isMoving);
+// }
+// }
+//
+// @Override
+// public void setPlacedBy(@Nonnull Level world, @Nonnull BlockPos blockPos, @Nonnull BlockState blockState, @Nullable LivingEntity entity, @Nonnull ItemStack stack) {
+// if (entity != null) {
+// world.setBlock(blockPos, blockState
+// .setValue(FACING, getFacingFromEntity(blockPos, entity))
+// .setValue(ENABLED, false), 2);
+// }
+// }
+//}
diff --git a/src/main/java/net/roguelogix/biggerreactors/machine/client/CyaniteReprocessorScreen.java b/src/main/java/net/roguelogix/biggerreactors/machine/client/CyaniteReprocessorScreen.java
index 35f2a0fa..466310a5 100644
--- a/src/main/java/net/roguelogix/biggerreactors/machine/client/CyaniteReprocessorScreen.java
+++ b/src/main/java/net/roguelogix/biggerreactors/machine/client/CyaniteReprocessorScreen.java
@@ -1,117 +1,117 @@
-package net.roguelogix.biggerreactors.machine.client;
-
-import com.mojang.blaze3d.vertex.PoseStack;
-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.minecraft.world.level.material.Fluids;
-import net.roguelogix.biggerreactors.BiggerReactors;
-import net.roguelogix.biggerreactors.client.CommonRender;
-import net.roguelogix.biggerreactors.machine.containers.CyaniteReprocessorContainer;
-import net.roguelogix.biggerreactors.machine.state.CyaniteReprocessorState;
-import net.roguelogix.phosphophyllite.client.gui.screens.PhosphophylliteScreen;
-import net.roguelogix.phosphophyllite.client.gui.RenderHelper;
-import net.roguelogix.phosphophyllite.client.gui.elements.RenderedElement;
-import net.roguelogix.phosphophyllite.client.gui.elements.TooltipElement;
-
-import javax.annotation.Nonnull;
-
-public class CyaniteReprocessorScreen extends PhosphophylliteScreen {
-
- private static final ResourceLocation DEFAULT_TEXTURE = new ResourceLocation(BiggerReactors.modid, "textures/screen/cyanite_reprocessor.png");
-
- private CyaniteReprocessorState cyaniteReprocessorState;
-
- public CyaniteReprocessorScreen(CyaniteReprocessorContainer container, Inventory playerInventory, Component title) {
- super(container, playerInventory, title, DEFAULT_TEXTURE, 176, 175);
-
- // Initialize reprocessor state.
- cyaniteReprocessorState = (CyaniteReprocessorState) this.getMenu().getGuiPacket();
- }
-
- /**
- * Initialize the screen.
- */
- @Override
- public void init() {
- super.init();
-
- // Set title to be drawn in the center.
- this.titleLabelX = (this.getXSize() / 2) - (this.getFont().width(this.getTitle()) / 2);
-
- // Initialize tooltips:
- this.initTooltips();
-
- // Initialize controls:
-
- // Initialize gauges:
- this.initGauges();
-
- // Initialize symbols:
- this.initSymbols();
- }
-
- /**
- * Initialize tooltips.
- */
- public void initTooltips() {
- // (Left) Internal battery:
- this.addScreenElement(new TooltipElement<>(this, 8, 6, 16, 16, Component.translatable("screen.biggerreactors.cyanite_reprocessor.internal_battery.tooltip")));
- }
-
- /**
- * Initialize gauges.
- */
- public void initGauges() {
- // (Top) Internal battery:
- RenderedElement internalBattery = new RenderedElement<>(this, 7, 25, 18, 64, 0, 152, Component.empty());
- internalBattery.onRender = (@Nonnull GuiGraphics graphics, int mX, int mY) -> CommonRender.renderEnergyGauge(graphics,
- internalBattery, cyaniteReprocessorState.energyStored, cyaniteReprocessorState.energyCapacity);
- this.addScreenElement(internalBattery);
-
- // (Top) Water tank:
- RenderedElement waterTank = new RenderedElement<>(this, 151, 25, 18, 64, 0, 152, Component.empty());
- waterTank.onRender = (@Nonnull GuiGraphics graphics, int mX, int mY) -> CommonRender.renderFluidGauge(graphics,
- waterTank, cyaniteReprocessorState.waterStored, cyaniteReprocessorState.waterCapacity,
- Fluids.WATER.getSource());
- this.addScreenElement(waterTank);
-
- // (Center) Progress bar:
- RenderedElement progressBar = new RenderedElement<>(this, 75, 40, 24, 18, 0, 175, null);
- progressBar.onRender = (@Nonnull GuiGraphics graphics, int mX, int mY) -> CyaniteReprocessorScreen.renderProgressBar(graphics,
- progressBar, cyaniteReprocessorState.workTime, cyaniteReprocessorState.workTimeTotal);
- this.addScreenElement(progressBar);
- }
-
- /**
- * Initialize symbols.
- */
- public void initSymbols() {
- // (Right) Water tank symbol:
- RenderedElement waterTankSymbol = new RenderedElement<>(this, 152, 6, 16, 16, 48, 175, Component.translatable("screen.biggerreactors.cyanite_reprocessor.water_tank.tooltip"));
- waterTankSymbol.onRender = (@Nonnull GuiGraphics graphics, int mX, int mY) -> RenderHelper.drawMaskedFluid(graphics,
- waterTankSymbol.x, waterTankSymbol.y, 0,
- waterTankSymbol.width, waterTankSymbol.height,
- waterTankSymbol.u, waterTankSymbol.v, Fluids.WATER.getSource());
- this.addScreenElement(waterTankSymbol);
- }
-
- /**
- * Render the progress bar.
- *
- * @param poseStack The current pose stack.
- * @param symbol The symbol to draw as.
- * @param workTime The time the machine has been working.
- * @param workTimeTotal The total time needed for completion.
- */
- private static void renderProgressBar(@Nonnull GuiGraphics graphics, @Nonnull RenderedElement symbol, int workTime, int workTimeTotal) {
- // If there's no progress, there's no need to draw.
- if ((workTime > 0) && (workTimeTotal > 0)) {
- // Calculate how much needs to be rendered.
- int renderSize = (int) ((symbol.width * workTime) / workTimeTotal);
- // Render progress.
- symbol.blit(graphics, renderSize, symbol.height, symbol.u + 24, symbol.v);
- }
- }
-}
+//package net.roguelogix.biggerreactors.machine.client;
+//
+//import com.mojang.blaze3d.vertex.PoseStack;
+//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.minecraft.world.level.material.Fluids;
+//import net.roguelogix.biggerreactors.BiggerReactors;
+//import net.roguelogix.biggerreactors.client.CommonRender;
+//import net.roguelogix.biggerreactors.machine.containers.CyaniteReprocessorContainer;
+//import net.roguelogix.biggerreactors.machine.state.CyaniteReprocessorState;
+//import net.roguelogix.phosphophyllite.client.gui.screens.PhosphophylliteScreen;
+//import net.roguelogix.phosphophyllite.client.gui.RenderHelper;
+//import net.roguelogix.phosphophyllite.client.gui.elements.RenderedElement;
+//import net.roguelogix.phosphophyllite.client.gui.elements.TooltipElement;
+//
+//import javax.annotation.Nonnull;
+//
+//public class CyaniteReprocessorScreen extends PhosphophylliteScreen {
+//
+// private static final ResourceLocation DEFAULT_TEXTURE = new ResourceLocation(BiggerReactors.modid, "textures/screen/cyanite_reprocessor.png");
+//
+// private CyaniteReprocessorState cyaniteReprocessorState;
+//
+// public CyaniteReprocessorScreen(CyaniteReprocessorContainer container, Inventory playerInventory, Component title) {
+// super(container, playerInventory, title, DEFAULT_TEXTURE, 176, 175);
+//
+// // Initialize reprocessor state.
+// cyaniteReprocessorState = (CyaniteReprocessorState) this.getMenu().getGuiPacket();
+// }
+//
+// /**
+// * Initialize the screen.
+// */
+// @Override
+// public void init() {
+// super.init();
+//
+// // Set title to be drawn in the center.
+// this.titleLabelX = (this.getXSize() / 2) - (this.getFont().width(this.getTitle()) / 2);
+//
+// // Initialize tooltips:
+// this.initTooltips();
+//
+// // Initialize controls:
+//
+// // Initialize gauges:
+// this.initGauges();
+//
+// // Initialize symbols:
+// this.initSymbols();
+// }
+//
+// /**
+// * Initialize tooltips.
+// */
+// public void initTooltips() {
+// // (Left) Internal battery:
+// this.addScreenElement(new TooltipElement<>(this, 8, 6, 16, 16, Component.translatable("screen.biggerreactors.cyanite_reprocessor.internal_battery.tooltip")));
+// }
+//
+// /**
+// * Initialize gauges.
+// */
+// public void initGauges() {
+// // (Top) Internal battery:
+// RenderedElement internalBattery = new RenderedElement<>(this, 7, 25, 18, 64, 0, 152, Component.empty());
+// internalBattery.onRender = (@Nonnull GuiGraphics graphics, int mX, int mY) -> CommonRender.renderEnergyGauge(graphics,
+// internalBattery, cyaniteReprocessorState.energyStored, cyaniteReprocessorState.energyCapacity);
+// this.addScreenElement(internalBattery);
+//
+// // (Top) Water tank:
+// RenderedElement waterTank = new RenderedElement<>(this, 151, 25, 18, 64, 0, 152, Component.empty());
+// waterTank.onRender = (@Nonnull GuiGraphics graphics, int mX, int mY) -> CommonRender.renderFluidGauge(graphics,
+// waterTank, cyaniteReprocessorState.waterStored, cyaniteReprocessorState.waterCapacity,
+// Fluids.WATER.getSource());
+// this.addScreenElement(waterTank);
+//
+// // (Center) Progress bar:
+// RenderedElement progressBar = new RenderedElement<>(this, 75, 40, 24, 18, 0, 175, null);
+// progressBar.onRender = (@Nonnull GuiGraphics graphics, int mX, int mY) -> CyaniteReprocessorScreen.renderProgressBar(graphics,
+// progressBar, cyaniteReprocessorState.workTime, cyaniteReprocessorState.workTimeTotal);
+// this.addScreenElement(progressBar);
+// }
+//
+// /**
+// * Initialize symbols.
+// */
+// public void initSymbols() {
+// // (Right) Water tank symbol:
+// RenderedElement waterTankSymbol = new RenderedElement<>(this, 152, 6, 16, 16, 48, 175, Component.translatable("screen.biggerreactors.cyanite_reprocessor.water_tank.tooltip"));
+// waterTankSymbol.onRender = (@Nonnull GuiGraphics graphics, int mX, int mY) -> RenderHelper.drawMaskedFluid(graphics,
+// waterTankSymbol.x, waterTankSymbol.y, 0,
+// waterTankSymbol.width, waterTankSymbol.height,
+// waterTankSymbol.u, waterTankSymbol.v, Fluids.WATER.getSource());
+// this.addScreenElement(waterTankSymbol);
+// }
+//
+// /**
+// * Render the progress bar.
+// *
+// * @param poseStack The current pose stack.
+// * @param symbol The symbol to draw as.
+// * @param workTime The time the machine has been working.
+// * @param workTimeTotal The total time needed for completion.
+// */
+// private static void renderProgressBar(@Nonnull GuiGraphics graphics, @Nonnull RenderedElement symbol, int workTime, int workTimeTotal) {
+// // If there's no progress, there's no need to draw.
+// if ((workTime > 0) && (workTimeTotal > 0)) {
+// // Calculate how much needs to be rendered.
+// int renderSize = (int) ((symbol.width * workTime) / workTimeTotal);
+// // Render progress.
+// symbol.blit(graphics, renderSize, symbol.height, symbol.u + 24, symbol.v);
+// }
+// }
+//}
diff --git a/src/main/java/net/roguelogix/biggerreactors/machine/containers/CyaniteReprocessorContainer.java b/src/main/java/net/roguelogix/biggerreactors/machine/containers/CyaniteReprocessorContainer.java
index 5831c58a..385bab9f 100644
--- a/src/main/java/net/roguelogix/biggerreactors/machine/containers/CyaniteReprocessorContainer.java
+++ b/src/main/java/net/roguelogix/biggerreactors/machine/containers/CyaniteReprocessorContainer.java
@@ -1,116 +1,116 @@
-package net.roguelogix.biggerreactors.machine.containers;
-
-import net.minecraft.core.BlockPos;
-import net.minecraft.world.entity.player.Player;
-import net.minecraft.world.inventory.AbstractContainerMenu;
-import net.minecraft.world.inventory.ContainerLevelAccess;
-import net.minecraft.world.inventory.MenuType;
-import net.minecraft.world.inventory.Slot;
-import net.minecraft.world.item.ItemStack;
-import net.minecraftforge.items.IItemHandler;
-import net.minecraftforge.items.SlotItemHandler;
-import net.roguelogix.biggerreactors.machine.blocks.CyaniteReprocessor;
-import net.roguelogix.biggerreactors.machine.tiles.CyaniteReprocessorTile;
-import net.roguelogix.biggerreactors.machine.tiles.impl.CyaniteReprocessorItemHandler;
-import net.roguelogix.phosphophyllite.client.gui.GuiSync;
-import net.roguelogix.phosphophyllite.registry.ContainerSupplier;
-import net.roguelogix.phosphophyllite.registry.RegisterContainer;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-@RegisterContainer(name = "cyanite_reprocessor")
-public class CyaniteReprocessorContainer extends AbstractContainerMenu implements GuiSync.IGUIPacketProvider {
-
- @RegisterContainer.Type
- public static MenuType INSTANCE;
- @RegisterContainer.Supplier
- public static final ContainerSupplier SUPPLIER = CyaniteReprocessorContainer::new;
-
- private Player player;
- private CyaniteReprocessorTile tileEntity;
-
- public CyaniteReprocessorContainer(int windowId, BlockPos blockPos, Player player) {
- super(CyaniteReprocessorContainer.INSTANCE, windowId);
- this.player = player;
- this.tileEntity = (CyaniteReprocessorTile) player.level().getBlockEntity(blockPos);
- this.getGuiPacket();
-
- // Populate machine slots.
- if (this.tileEntity != null) {
- IItemHandler handler = tileEntity.getItemHandler();
- // Add input slot.
- this.addSlot(new SlotItemHandler(handler, CyaniteReprocessorItemHandler.INPUT_SLOT_INDEX, 44, 41));
- // Add output slot.
- this.addSlot(new SlotItemHandler(handler, CyaniteReprocessorItemHandler.OUTPUT_SLOT_INDEX, 116, 41));
- }
-
- // Populate player inventory.
- this.populatePlayerInventory();
- }
-
- /**
- * @return The current state of the machine.
- */
- @Nullable
- @Override
- public GuiSync.IGUIPacket getGuiPacket() {
- return this.tileEntity.cyaniteReprocessorState;
- }
-
- @Override
- public boolean stillValid(@Nonnull Player player) {
- assert this.tileEntity.getLevel() != null;
- return stillValid(ContainerLevelAccess.create(tileEntity.getLevel(), tileEntity.getBlockPos()),
- player, CyaniteReprocessor.INSTANCE);
- }
-
- @Nonnull
- @Override
- public ItemStack quickMoveStack(@Nonnull Player player, int index) {
- ItemStack itemStackA = ItemStack.EMPTY;
- Slot slot = this.slots.get(index);
- int inventorySize = this.tileEntity.getContainerSize();
-
- if (slot.hasItem()) {
- ItemStack itemStackB = slot.getItem();
- itemStackA = itemStackB.copy();
-
- if (index < inventorySize) {
- if (!this.moveItemStackTo(itemStackB, inventorySize, this.slots.size(), true)) {
- return ItemStack.EMPTY;
- }
- } else if (!this.moveItemStackTo(itemStackB, 0, inventorySize, false)) {
- return ItemStack.EMPTY;
- }
-
- if (itemStackB.getCount() == 0) {
- slot.set(ItemStack.EMPTY);
- } else {
- slot.setChanged();
- }
- }
-
- return itemStackA;
- }
-
- /**
- * Draw and initialize the player's inventory.
- */
- private void populatePlayerInventory() {
- int guiOffset = 93;
-
- // Add player inventory;
- for (int rowIndex = 0; rowIndex < 3; rowIndex++) {
- for (int columnIndex = 0; columnIndex < 9; columnIndex++) {
- this.addSlot(new Slot(player.getInventory(), (columnIndex + rowIndex * 9 + 9),
- (8 + columnIndex * 18), (guiOffset + rowIndex * 18)));
- }
- }
- // Add player hotbar.
- for (int columnIndex = 0; columnIndex < 9; columnIndex++) {
- this.addSlot(
- new Slot(player.getInventory(), columnIndex, (8 + columnIndex * 18), (guiOffset + 58)));
- }
- }
-}
+//package net.roguelogix.biggerreactors.machine.containers;
+//
+//import net.minecraft.core.BlockPos;
+//import net.minecraft.world.entity.player.Player;
+//import net.minecraft.world.inventory.AbstractContainerMenu;
+//import net.minecraft.world.inventory.ContainerLevelAccess;
+//import net.minecraft.world.inventory.MenuType;
+//import net.minecraft.world.inventory.Slot;
+//import net.minecraft.world.item.ItemStack;
+//import net.minecraftforge.items.IItemHandler;
+//import net.minecraftforge.items.SlotItemHandler;
+//import net.roguelogix.biggerreactors.machine.blocks.CyaniteReprocessor;
+//import net.roguelogix.biggerreactors.machine.tiles.CyaniteReprocessorTile;
+//import net.roguelogix.biggerreactors.machine.tiles.impl.CyaniteReprocessorItemHandler;
+//import net.roguelogix.phosphophyllite.client.gui.GuiSync;
+//import net.roguelogix.phosphophyllite.registry.ContainerSupplier;
+//import net.roguelogix.phosphophyllite.registry.RegisterContainer;
+//
+//import javax.annotation.Nonnull;
+//import javax.annotation.Nullable;
+//
+//@RegisterContainer(name = "cyanite_reprocessor")
+//public class CyaniteReprocessorContainer extends AbstractContainerMenu implements GuiSync.IGUIPacketProvider {
+//
+// @RegisterContainer.Type
+// public static MenuType INSTANCE;
+// @RegisterContainer.Supplier
+// public static final ContainerSupplier SUPPLIER = CyaniteReprocessorContainer::new;
+//
+// private Player player;
+// private CyaniteReprocessorTile tileEntity;
+//
+// public CyaniteReprocessorContainer(int windowId, BlockPos blockPos, Player player) {
+// super(CyaniteReprocessorContainer.INSTANCE, windowId);
+// this.player = player;
+// this.tileEntity = (CyaniteReprocessorTile) player.level().getBlockEntity(blockPos);
+// this.getGuiPacket();
+//
+// // Populate machine slots.
+// if (this.tileEntity != null) {
+// IItemHandler handler = tileEntity.getItemHandler();
+// // Add input slot.
+// this.addSlot(new SlotItemHandler(handler, CyaniteReprocessorItemHandler.INPUT_SLOT_INDEX, 44, 41));
+// // Add output slot.
+// this.addSlot(new SlotItemHandler(handler, CyaniteReprocessorItemHandler.OUTPUT_SLOT_INDEX, 116, 41));
+// }
+//
+// // Populate player inventory.
+// this.populatePlayerInventory();
+// }
+//
+// /**
+// * @return The current state of the machine.
+// */
+// @Nullable
+// @Override
+// public GuiSync.IGUIPacket getGuiPacket() {
+// return this.tileEntity.cyaniteReprocessorState;
+// }
+//
+// @Override
+// public boolean stillValid(@Nonnull Player player) {
+// assert this.tileEntity.getLevel() != null;
+// return stillValid(ContainerLevelAccess.create(tileEntity.getLevel(), tileEntity.getBlockPos()),
+// player, CyaniteReprocessor.INSTANCE);
+// }
+//
+// @Nonnull
+// @Override
+// public ItemStack quickMoveStack(@Nonnull Player player, int index) {
+// ItemStack itemStackA = ItemStack.EMPTY;
+// Slot slot = this.slots.get(index);
+// int inventorySize = this.tileEntity.getContainerSize();
+//
+// if (slot.hasItem()) {
+// ItemStack itemStackB = slot.getItem();
+// itemStackA = itemStackB.copy();
+//
+// if (index < inventorySize) {
+// if (!this.moveItemStackTo(itemStackB, inventorySize, this.slots.size(), true)) {
+// return ItemStack.EMPTY;
+// }
+// } else if (!this.moveItemStackTo(itemStackB, 0, inventorySize, false)) {
+// return ItemStack.EMPTY;
+// }
+//
+// if (itemStackB.getCount() == 0) {
+// slot.set(ItemStack.EMPTY);
+// } else {
+// slot.setChanged();
+// }
+// }
+//
+// return itemStackA;
+// }
+//
+// /**
+// * Draw and initialize the player's inventory.
+// */
+// private void populatePlayerInventory() {
+// int guiOffset = 93;
+//
+// // Add player inventory;
+// for (int rowIndex = 0; rowIndex < 3; rowIndex++) {
+// for (int columnIndex = 0; columnIndex < 9; columnIndex++) {
+// this.addSlot(new Slot(player.getInventory(), (columnIndex + rowIndex * 9 + 9),
+// (8 + columnIndex * 18), (guiOffset + rowIndex * 18)));
+// }
+// }
+// // Add player hotbar.
+// for (int columnIndex = 0; columnIndex < 9; columnIndex++) {
+// this.addSlot(
+// new Slot(player.getInventory(), columnIndex, (8 + columnIndex * 18), (guiOffset + 58)));
+// }
+// }
+//}
diff --git a/src/main/java/net/roguelogix/biggerreactors/machine/state/CyaniteReprocessorState.java b/src/main/java/net/roguelogix/biggerreactors/machine/state/CyaniteReprocessorState.java
index af0971fe..e94faf91 100644
--- a/src/main/java/net/roguelogix/biggerreactors/machine/state/CyaniteReprocessorState.java
+++ b/src/main/java/net/roguelogix/biggerreactors/machine/state/CyaniteReprocessorState.java
@@ -1,72 +1,72 @@
-package net.roguelogix.biggerreactors.machine.state;
-
-import net.roguelogix.biggerreactors.machine.tiles.CyaniteReprocessorTile;
-import net.roguelogix.phosphophyllite.client.gui.GuiSync;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import java.util.HashMap;
-import java.util.Map;
-
-public class CyaniteReprocessorState implements GuiSync.IGUIPacket {
-
- /**
- * The number of ticks the current item has processed for.
- */
- public int workTime = 0;
- /**
- * The total amount of time required to process the item.
- */
- public int workTimeTotal = 0;
-
- /**
- * The amount of energy stored in the machine.
- */
- public int energyStored = 0;
- /**
- * The max energy capacity of the machine.
- */
- public int energyCapacity = 0;
-
- /**
- * The amount of water stored in the machine.
- */
- public int waterStored = 0;
- /**
- * The max water capacity of the machine.
- */
- public int waterCapacity = 0;
-
- /**
- * The tile whose information this belongs to.
- */
- CyaniteReprocessorTile cyaniteReprocessorTile;
-
- public CyaniteReprocessorState(CyaniteReprocessorTile cyaniteReprocessorTile) {
- this.cyaniteReprocessorTile = cyaniteReprocessorTile;
- }
-
- @Override
- public void read(@Nonnull Map, ?> data) {
- this.workTime = (Integer) data.get("workTime");
- this.workTimeTotal = (Integer) data.get("workTimeTotal");
- this.energyStored = (Integer) data.get("energyStored");
- this.energyCapacity = (Integer) data.get("energyCapacity");
- this.waterStored = (Integer) data.get("waterStored");
- this.waterCapacity = (Integer) data.get("waterCapacity");
- }
-
- @Nullable
- @Override
- public Map, ?> write() {
- this.cyaniteReprocessorTile.updateState();
- HashMap data = new HashMap<>();
- data.put("workTime", this.workTime);
- data.put("workTimeTotal", this.workTimeTotal);
- data.put("energyStored", this.energyStored);
- data.put("energyCapacity", this.energyCapacity);
- data.put("waterStored", this.waterStored);
- data.put("waterCapacity", this.waterCapacity);
- return data;
- }
-}
+//package net.roguelogix.biggerreactors.machine.state;
+//
+//import net.roguelogix.biggerreactors.machine.tiles.CyaniteReprocessorTile;
+//import net.roguelogix.phosphophyllite.client.gui.GuiSync;
+//
+//import javax.annotation.Nonnull;
+//import javax.annotation.Nullable;
+//import java.util.HashMap;
+//import java.util.Map;
+//
+//public class CyaniteReprocessorState implements GuiSync.IGUIPacket {
+//
+// /**
+// * The number of ticks the current item has processed for.
+// */
+// public int workTime = 0;
+// /**
+// * The total amount of time required to process the item.
+// */
+// public int workTimeTotal = 0;
+//
+// /**
+// * The amount of energy stored in the machine.
+// */
+// public int energyStored = 0;
+// /**
+// * The max energy capacity of the machine.
+// */
+// public int energyCapacity = 0;
+//
+// /**
+// * The amount of water stored in the machine.
+// */
+// public int waterStored = 0;
+// /**
+// * The max water capacity of the machine.
+// */
+// public int waterCapacity = 0;
+//
+// /**
+// * The tile whose information this belongs to.
+// */
+// CyaniteReprocessorTile cyaniteReprocessorTile;
+//
+// public CyaniteReprocessorState(CyaniteReprocessorTile cyaniteReprocessorTile) {
+// this.cyaniteReprocessorTile = cyaniteReprocessorTile;
+// }
+//
+// @Override
+// public void read(@Nonnull Map, ?> data) {
+// this.workTime = (Integer) data.get("workTime");
+// this.workTimeTotal = (Integer) data.get("workTimeTotal");
+// this.energyStored = (Integer) data.get("energyStored");
+// this.energyCapacity = (Integer) data.get("energyCapacity");
+// this.waterStored = (Integer) data.get("waterStored");
+// this.waterCapacity = (Integer) data.get("waterCapacity");
+// }
+//
+// @Nullable
+// @Override
+// public Map, ?> write() {
+// this.cyaniteReprocessorTile.updateState();
+// HashMap data = new HashMap<>();
+// data.put("workTime", this.workTime);
+// data.put("workTimeTotal", this.workTimeTotal);
+// data.put("energyStored", this.energyStored);
+// data.put("energyCapacity", this.energyCapacity);
+// data.put("waterStored", this.waterStored);
+// data.put("waterCapacity", this.waterCapacity);
+// return data;
+// }
+//}
diff --git a/src/main/java/net/roguelogix/biggerreactors/machine/tiles/CyaniteReprocessorTile.java b/src/main/java/net/roguelogix/biggerreactors/machine/tiles/CyaniteReprocessorTile.java
index 57ea9ebb..d2a79442 100644
--- a/src/main/java/net/roguelogix/biggerreactors/machine/tiles/CyaniteReprocessorTile.java
+++ b/src/main/java/net/roguelogix/biggerreactors/machine/tiles/CyaniteReprocessorTile.java
@@ -1,482 +1,471 @@
-package net.roguelogix.biggerreactors.machine.tiles;
-
-
-import net.minecraft.core.BlockPos;
-import net.minecraft.core.Direction;
-import net.minecraft.nbt.CompoundTag;
-import net.minecraft.network.chat.Component;
-import net.minecraft.server.level.ServerPlayer;
-import net.minecraft.world.*;
-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.Items;
-import net.minecraft.world.level.Level;
-import net.minecraft.world.level.block.entity.BaseContainerBlockEntity;
-import net.minecraft.world.level.block.entity.BlockEntityType;
-import net.minecraft.world.level.block.state.BlockState;
-import net.minecraft.world.level.material.Fluids;
-import net.minecraft.world.phys.BlockHitResult;
-import net.minecraftforge.common.capabilities.Capability;
-import net.minecraftforge.common.capabilities.ForgeCapabilities;
-import net.minecraftforge.common.util.LazyOptional;
-import net.minecraftforge.energy.EnergyStorage;
-import net.minecraftforge.energy.IEnergyStorage;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.IFluidTank;
-import net.minecraftforge.fluids.capability.IFluidHandler;
-import net.minecraftforge.fluids.capability.templates.FluidTank;
-import net.minecraftforge.network.NetworkHooks;
-import net.minecraftforge.items.IItemHandler;
-import net.roguelogix.biggerreactors.BiggerReactors;
-import net.roguelogix.biggerreactors.Config;
-import net.roguelogix.biggerreactors.api.IWorkHandler;
-import net.roguelogix.biggerreactors.api.WorkHandler;
-import net.roguelogix.biggerreactors.machine.blocks.CyaniteReprocessor;
-import net.roguelogix.biggerreactors.machine.containers.CyaniteReprocessorContainer;
-import net.roguelogix.biggerreactors.machine.state.CyaniteReprocessorState;
-import net.roguelogix.biggerreactors.machine.tiles.impl.CyaniteReprocessorItemHandler;
-import net.roguelogix.biggerreactors.items.ingots.BlutoniumIngot;
-import net.roguelogix.phosphophyllite.client.gui.api.IHasUpdatableState;
-import net.roguelogix.phosphophyllite.debug.DebugTool;
-import net.roguelogix.phosphophyllite.registry.RegisterTile;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import java.util.Objects;
-
-public class CyaniteReprocessorTile extends BaseContainerBlockEntity implements MenuProvider, IHasUpdatableState {
-
- @RegisterTile("cyanite_reprocessor")
- public static final BlockEntityType.BlockEntitySupplier SUPPLIER = new RegisterTile.Producer<>(CyaniteReprocessorTile::new);
-
- /**
- * The (mostly) current state of the machine.
- */
- public final CyaniteReprocessorState cyaniteReprocessorState = new CyaniteReprocessorState(this);
- /**
- * The work handler.
- */
- private WorkHandler workHandler;
- /**
- * Capability access to the work handler.
- */
- private final LazyOptional WORK_HANDLER_CAPABILITY = LazyOptional.of(() -> this.workHandler);
- /**
- * The item handler.
- */
- private CyaniteReprocessorItemHandler itemHandler;
- /**
- * Capability access to the item handler.
- */
- private final LazyOptional ITEM_HANDLER_CAPABILITY = LazyOptional.of(() -> this.itemHandler.pipeHandler());
- /**
- * The energy storage.
- */
- private EnergyStorage energyStorage;
- /**
- * Capability access to the energy storage.
- */
- private final LazyOptional ENERGY_STORAGE_CAPABILITY = LazyOptional.of(() -> this.energyStorage);
- /**
- * The fluid tank.
- */
- private FluidTank fluidTank;
- /**
- * Capability access to the fluid tank.
- */
- private final LazyOptional FLUID_TANK_CAPABILITY = LazyOptional.of(() -> this.fluidTank);
- /**
- * "Anti-cheat" item stack, to ensure players don't swap items mid-process.
- *
- * @see CyaniteReprocessorTile#tick()
- */
- private ItemStack itemPresentLastTick = ItemStack.EMPTY;
-
- public CyaniteReprocessorTile(BlockEntityType TYPE, BlockPos pos, BlockState state) {
- super(TYPE, pos, state);
- this.clearContent();
- this.updateState();
- }
-
- /**
- * Do right-click stuff.
- */
- @Nonnull
- public InteractionResult onBlockActivated(@Nonnull BlockState blockState, Level world, @Nonnull BlockPos blockPos, @Nonnull Player player, @Nonnull InteractionHand hand, @Nonnull BlockHitResult trace) {
- // Check for client-side.
- if (world.isClientSide) {
- return InteractionResult.SUCCESS;
- }
-
- // Print tile data.
- if (ItemStack.isSameItem(player.getMainHandItem(), new ItemStack(DebugTool.INSTANCE))) {
- player.sendSystemMessage(Component.literal(String.format("[%s] Progress: %s/%s", BiggerReactors.modid, this.cyaniteReprocessorState.workTime, this.cyaniteReprocessorState.workTimeTotal)));
- player.sendSystemMessage(Component.literal(String.format("[%s] Energy: %s/%s RF", BiggerReactors.modid, this.cyaniteReprocessorState.energyStored, this.cyaniteReprocessorState.energyCapacity)));
- player.sendSystemMessage(Component.literal(String.format("[%s] Fluid Tank: %s/%s mB", BiggerReactors.modid, this.cyaniteReprocessorState.waterStored, this.cyaniteReprocessorState.waterCapacity)));
- return InteractionResult.SUCCESS;
- }
-
- // Do water bucket check.
- if (ItemStack.isSameItem(player.getMainHandItem(), new ItemStack(Items.WATER_BUCKET))) {
- if (this.fluidTank.getFluidAmount() <= (Config.CONFIG.CyaniteReprocessor.WaterTankCapacity - 1000)) {
- this.fluidTank.fill(new FluidStack(Fluids.WATER, 1000), IFluidHandler.FluidAction.EXECUTE);
- player.setItemInHand(InteractionHand.MAIN_HAND, new ItemStack(Items.BUCKET));
- }
- return InteractionResult.SUCCESS;
- }
-
- // Get container and open GUI.
- NetworkHooks.openScreen((ServerPlayer) player, this, blockPos);
- return InteractionResult.SUCCESS;
- }
-
- /**
- * Drop items on destruction.
- */
- public void onReplaced(BlockState blockState, Level world, BlockPos blockPos, BlockState newBlockState, boolean isMoving) {
- ItemStack inputStack = this.itemHandler.getStackInSlot(CyaniteReprocessorItemHandler.INPUT_SLOT_INDEX);
- if (!inputStack.isEmpty()) {
- Containers.dropContents(world, blockPos, new SimpleContainer(inputStack));
- }
-
- ItemStack outputStack = this.itemHandler.getStackInSlot(CyaniteReprocessorItemHandler.OUTPUT_SLOT_INDEX);
- if (!outputStack.isEmpty()) {
- Containers.dropContents(world, blockPos, new SimpleContainer(outputStack));
- }
- }
-
- /**
- * @see CyaniteReprocessorTile#getDefaultName()
- */
- @Override
- public Component getDisplayName() {
- return this.getDefaultName();
- }
-
- /**
- * @return The localized default name for the tile.
- */
- @Override
- protected Component getDefaultName() {
- return Component.translatable("block.biggerreactors.cyanite_reprocessor");
- }
-
- /**
- * Create a GUI container for the tile.
- *
- * @param windowId The window ID to use.
- * @param playerInventory The player's inventory.
- * @return A GUI container to render.
- */
- @Override
- protected AbstractContainerMenu createMenu(int windowId, Inventory playerInventory) {
- return new CyaniteReprocessorContainer(windowId, this.getBlockPos(), playerInventory.player);
- }
-
- /**
- * @return The current state of the tile.
- */
- @Override
- @Nonnull
- public CyaniteReprocessorState getState() {
- this.updateState();
- return this.cyaniteReprocessorState;
- }
-
- /**
- * Call for an update to the current state information.
- */
- @Override
- public void updateState() {
- this.cyaniteReprocessorState.workTime = this.workHandler.getProgress();
- this.cyaniteReprocessorState.workTimeTotal = this.workHandler.getGoal();
- this.cyaniteReprocessorState.energyStored = this.energyStorage.getEnergyStored();
- this.cyaniteReprocessorState.energyCapacity = this.energyStorage.getMaxEnergyStored();
- this.cyaniteReprocessorState.waterStored = this.fluidTank.getFluidAmount();
- this.cyaniteReprocessorState.waterCapacity = this.fluidTank.getCapacity();
- }
-
- /**
- * @return How large this tile's inventory is.
- */
- @Override
- public int getContainerSize() {
- return this.itemHandler.getSlots();
- }
-
- /**
- * @return Whether or not the inventory is empty.
- */
- @Override
- public boolean isEmpty() {
- for (int index = 0; index < this.itemHandler.getSlots(); ++index) {
- if (!this.itemHandler.getStackInSlot(index).isEmpty()) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Gets the item held in the specified slot.
- *
- * @param index The slot index to fetch from.
- * @return Any items held in that slot.
- */
- @Override
- public ItemStack getItem(int index) {
- return this.itemHandler.getStackInSlot(index);
- }
-
- /**
- * Removes the specified number of items from the specified slot.
- *
- * @param index The slot index to remove from.
- * @param count The number of items to remove.
- * @return The items that were removed.
- */
- @Override
- public ItemStack removeItem(int index, int count) {
- return this.itemHandler.getStackInSlot(index).split(count);
- }
-
- /**
- * Removes an entire stack fromm the specified slot.
- *
- * @param index The slot index to remove from.
- * @return The items that were removed.
- */
- @Override
- public ItemStack removeItemNoUpdate(int index) {
- ItemStack itemStack = this.itemHandler.getStackInSlot(index).copy();
- this.itemHandler.setStackInSlot(index, ItemStack.EMPTY);
- return itemStack;
- }
-
- /**
- * Updates the stored items in the specified slot.
- *
- * @param index The slot index to update.
- * @param stack The items to update with.
- */
- @Override
- public void setItem(int index, ItemStack stack) {
- ItemStack oldStack = this.itemHandler.getStackInSlot(index);
- boolean flag = !stack.isEmpty() && ItemStack
- .isSameItem(stack, oldStack);
- this.itemHandler.setStackInSlot(index, stack);
- if (stack.getCount() > this.getMaxStackSize()) {
- stack.setCount(this.getMaxStackSize());
- }
-
- if (index == 0 && !flag) {
- this.workHandler.clear();
- this.setChanged();
- }
- }
-
- /**
- * Clears all data and inventory for this tile.
- */
- @Override
- public void clearContent() {
- // Reset work.
- this.workHandler = new WorkHandler(Config.CONFIG.CyaniteReprocessor.TotalWorkTime);
-
- // Reset items.
- this.itemHandler = new CyaniteReprocessorItemHandler();
- this.itemHandler.setSize(2);
-
- // Reset energy.
- this.energyStorage = new EnergyStorage(Config.CONFIG.CyaniteReprocessor.EnergyTankCapacity);
-
- // Reset fluids.
- this.fluidTank = new FluidTank(Config.CONFIG.CyaniteReprocessor.WaterTankCapacity, fluid -> fluid.getFluid() == Fluids.WATER);
- }
-
- /**
- * Checks if the player can currently use this tile.
- *
- * @param player The player to check.
- * @return True if usable, false otherwise.
- */
- @Override
- public boolean stillValid(Player player) {
- assert this.level != null;
- if (this.level.getBlockEntity(this.getBlockPos()) != this) {
- return false;
- } else {
- return player.distanceToSqr(
- (double) this.getBlockPos().getX() + 0.5D,
- (double) this.getBlockPos().getY() + 0.5D,
- (double) this.getBlockPos().getZ() + 0.5D) <= 64.0D;
- }
- }
-
- /**
- * Read NBT data from the world.
- *
- * @param parentCompound The parent compound to read from.
- */
- @Override
- public void load(@Nonnull CompoundTag parentCompound) {
- super.load(parentCompound);
- CompoundTag childCompound = parentCompound.getCompound("cyaniteReprocessorState");
-
- // Read work.
- this.workHandler = new WorkHandler(childCompound.getInt("workTimeTotal"), childCompound.getInt("workTime"));
- // Read items.
- this.itemHandler.deserializeNBT(childCompound.getCompound("inventory"));
- // Read energy.
- this.energyStorage = new EnergyStorage(childCompound.getInt("energyCapacity"),
- Config.CONFIG.CyaniteReprocessor.TransferRate,
- Config.CONFIG.CyaniteReprocessor.TransferRate,
- childCompound.getInt("energyStored"));
- // Read fluids.
- this.fluidTank = this.fluidTank.readFromNBT(childCompound.getCompound("fluidStorage"));
- }
-
- /**
- * Save NBT data to the world.
- *
- * @param parentCompound The parent compound to append onto.
- * @return The updated compound.
- */
- @Override
- public final void saveAdditional(@Nonnull CompoundTag parentCompound) {
- super.saveAdditional(parentCompound);
- CompoundTag childCompound = new CompoundTag();
-
- // Write work.
- childCompound.putInt("workTime", this.workHandler.getProgress());
- childCompound.putInt("workTimeTotal", this.workHandler.getGoal());
- // Write items.
- childCompound.put("inventory", this.itemHandler.serializeNBT());
- // Write energy.
- childCompound.putInt("energyStored", this.energyStorage.getEnergyStored());
- childCompound.putInt("energyCapacity", this.energyStorage.getMaxEnergyStored());
- // Write fluids.
- childCompound.put("fluidTank", fluidTank.writeToNBT(new CompoundTag()));
-
- parentCompound.put("cyaniteReprocessorState", childCompound);
- }
-
- /**
- * @return Whether or not the machine can perform work.
- * @see CyaniteReprocessorTile#tick()
- */
- private boolean canWork() {
- // If the output slot is full, we cannot work.
- if (this.getItem(CyaniteReprocessorItemHandler.OUTPUT_SLOT_INDEX).getCount() >= 64) {
- return false;
- }
- return (this.energyStorage.getEnergyStored() >= Config.CONFIG.CyaniteReprocessor.EnergyConsumptionPerTick
- && this.fluidTank.getFluidAmount() >= Config.CONFIG.CyaniteReprocessor.WaterConsumptionPerTick);
- }
-
- /**
- * Do work (if possible).
- */
- public void tick() {
- // Check for client-side.
- assert level != null;
- if (level.isClientSide()) {
- return;
- }
-
- boolean doUpdate = false;
- boolean isActive = false;
- ItemStack inputStack = this.itemHandler.getStackInSlot(CyaniteReprocessorItemHandler.INPUT_SLOT_INDEX);
-
- // Check to make sure the player doesn't try to pull a fast one.
- if (!ItemStack.isSameItem(this.itemPresentLastTick, inputStack)) {
- this.workHandler.clear();
- }
- this.itemPresentLastTick = inputStack.copy();
-
- if (inputStack.getCount() >= 2) {
- // Can we continue?
- if (canWork()) {
- isActive = true;
- doUpdate = true;
- this.workHandler.increment(1);
- this.energyStorage.extractEnergy(Config.CONFIG.CyaniteReprocessor.EnergyConsumptionPerTick, false);
- this.fluidTank.drain(Config.CONFIG.CyaniteReprocessor.WaterConsumptionPerTick, IFluidHandler.FluidAction.EXECUTE);
- // We've run out of resources, halt.
- } else if (this.workHandler.getProgress() > 0) {
- this.workHandler.decrement(2);
- }
-
- // Item is done.
- if (this.workHandler.isFinished()) {
- this.itemHandler.extractItem(CyaniteReprocessorItemHandler.INPUT_SLOT_INDEX, 2, false);
- this.itemHandler.insertItem(CyaniteReprocessorItemHandler.OUTPUT_SLOT_INDEX, new ItemStack(BlutoniumIngot.INSTANCE, 1), false);
- this.workHandler.clear();
- }
- }
-
- BlockState currentBlockState = level.getBlockState(this.getBlockPos());
- BlockState newBlockState = currentBlockState.setValue(CyaniteReprocessor.ENABLED, isActive);
- if (!newBlockState.equals(currentBlockState)) {
- this.level.setBlock(this.getBlockPos(), newBlockState, 3);
- doUpdate = true;
- }
-
- if (doUpdate) {
- setChanged();
- }
-
- // Update the current machine state.
- this.updateState();
- }
-
- /**
- * Check if the tile holds a certain capability.
- *
- * @param capability The capability to check for.
- * @param side Which side this capability should belong to.
- * @param The type class of the capability.
- * @return The handler for the capability, if present.
- */
- @Nonnull
- @Override
- public LazyOptional getCapability(@Nonnull Capability capability,
- @Nullable Direction side) {
- // Check for work.
- // TODO: While this capability is exclusive to the Reprocessor for now, it may not always be.
- // The capability is technically implemented, but no registration is done.
- // That oughta be fixed, so it can be checked for here.
- // But I'm lazy, so I'll do that some other time.
- //if (capability.equals(CapabilityWorkHandler.WORK_HANDLER_CAPABILITY)) {
- // return this.WORK_HANDLER_CAPABILITY.cast();
- //}
-
- // Check for items.
- if (capability.equals(ForgeCapabilities.ITEM_HANDLER)) {
- return this.ITEM_HANDLER_CAPABILITY.cast();
- }
-
- // Check for energy.
- if (capability.equals(ForgeCapabilities.ENERGY)) {
- return this.ENERGY_STORAGE_CAPABILITY.cast();
- }
-
- // Check for water.
- if (capability.equals(ForgeCapabilities.FLUID_HANDLER)) {
- return this.FLUID_TANK_CAPABILITY.cast();
- }
-
- return Objects.requireNonNull(super.getCapability(capability, side));
- }
-
- @Override
- public boolean canPlaceItem(int index, ItemStack stack) {
- return this.itemHandler.isItemValid(index, stack);
- }
-
- public CyaniteReprocessorItemHandler getItemHandler() {
- return itemHandler;
- }
-}
+//package net.roguelogix.biggerreactors.machine.tiles;
+//
+//
+//import net.minecraft.core.BlockPos;
+//import net.minecraft.core.Direction;
+//import net.minecraft.nbt.CompoundTag;
+//import net.minecraft.network.chat.Component;
+//import net.minecraft.server.level.ServerPlayer;
+//import net.minecraft.world.*;
+//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.Items;
+//import net.minecraft.world.level.Level;
+//import net.minecraft.world.level.block.entity.BaseContainerBlockEntity;
+//import net.minecraft.world.level.block.entity.BlockEntityType;
+//import net.minecraft.world.level.block.state.BlockState;
+//import net.minecraft.world.level.material.Fluids;
+//import net.minecraft.world.phys.BlockHitResult;
+//import net.roguelogix.biggerreactors.BiggerReactors;
+//import net.roguelogix.biggerreactors.Config;
+//import net.roguelogix.biggerreactors.api.IWorkHandler;
+//import net.roguelogix.biggerreactors.api.WorkHandler;
+//import net.roguelogix.biggerreactors.machine.blocks.CyaniteReprocessor;
+//import net.roguelogix.biggerreactors.machine.containers.CyaniteReprocessorContainer;
+//import net.roguelogix.biggerreactors.machine.state.CyaniteReprocessorState;
+//import net.roguelogix.biggerreactors.machine.tiles.impl.CyaniteReprocessorItemHandler;
+//import net.roguelogix.biggerreactors.items.ingots.BlutoniumIngot;
+//import net.roguelogix.phosphophyllite.client.gui.api.IHasUpdatableState;
+//import net.roguelogix.phosphophyllite.debug.DebugTool;
+//import net.roguelogix.phosphophyllite.registry.RegisterTile;
+//
+//import javax.annotation.Nonnull;
+//import javax.annotation.Nullable;
+//import java.util.Objects;
+//
+//public class CyaniteReprocessorTile extends BaseContainerBlockEntity implements MenuProvider, IHasUpdatableState {
+//
+// @RegisterTile("cyanite_reprocessor")
+// public static final BlockEntityType.BlockEntitySupplier SUPPLIER = new RegisterTile.Producer<>(CyaniteReprocessorTile::new);
+//
+// /**
+// * The (mostly) current state of the machine.
+// */
+// public final CyaniteReprocessorState cyaniteReprocessorState = new CyaniteReprocessorState(this);
+// /**
+// * The work handler.
+// */
+// private WorkHandler workHandler;
+// /**
+// * Capability access to the work handler.
+// */
+// private final LazyOptional WORK_HANDLER_CAPABILITY = LazyOptional.of(() -> this.workHandler);
+// /**
+// * The item handler.
+// */
+// private CyaniteReprocessorItemHandler itemHandler;
+// /**
+// * Capability access to the item handler.
+// */
+// private final LazyOptional ITEM_HANDLER_CAPABILITY = LazyOptional.of(() -> this.itemHandler.pipeHandler());
+// /**
+// * The energy storage.
+// */
+// private EnergyStorage energyStorage;
+// /**
+// * Capability access to the energy storage.
+// */
+// private final LazyOptional ENERGY_STORAGE_CAPABILITY = LazyOptional.of(() -> this.energyStorage);
+// /**
+// * The fluid tank.
+// */
+// private FluidTank fluidTank;
+// /**
+// * Capability access to the fluid tank.
+// */
+// private final LazyOptional FLUID_TANK_CAPABILITY = LazyOptional.of(() -> this.fluidTank);
+// /**
+// * "Anti-cheat" item stack, to ensure players don't swap items mid-process.
+// *
+// * @see CyaniteReprocessorTile#tick()
+// */
+// private ItemStack itemPresentLastTick = ItemStack.EMPTY;
+//
+// public CyaniteReprocessorTile(BlockEntityType TYPE, BlockPos pos, BlockState state) {
+// super(TYPE, pos, state);
+// this.clearContent();
+// this.updateState();
+// }
+//
+// /**
+// * Do right-click stuff.
+// */
+// @Nonnull
+// public InteractionResult onBlockActivated(@Nonnull BlockState blockState, Level world, @Nonnull BlockPos blockPos, @Nonnull Player player, @Nonnull InteractionHand hand, @Nonnull BlockHitResult trace) {
+// // Check for client-side.
+// if (world.isClientSide) {
+// return InteractionResult.SUCCESS;
+// }
+//
+// // Print tile data.
+// if (ItemStack.isSameItem(player.getMainHandItem(), new ItemStack(DebugTool.INSTANCE))) {
+// player.sendSystemMessage(Component.literal(String.format("[%s] Progress: %s/%s", BiggerReactors.modid, this.cyaniteReprocessorState.workTime, this.cyaniteReprocessorState.workTimeTotal)));
+// player.sendSystemMessage(Component.literal(String.format("[%s] Energy: %s/%s RF", BiggerReactors.modid, this.cyaniteReprocessorState.energyStored, this.cyaniteReprocessorState.energyCapacity)));
+// player.sendSystemMessage(Component.literal(String.format("[%s] Fluid Tank: %s/%s mB", BiggerReactors.modid, this.cyaniteReprocessorState.waterStored, this.cyaniteReprocessorState.waterCapacity)));
+// return InteractionResult.SUCCESS;
+// }
+//
+// // Do water bucket check.
+// if (ItemStack.isSameItem(player.getMainHandItem(), new ItemStack(Items.WATER_BUCKET))) {
+// if (this.fluidTank.getFluidAmount() <= (Config.CONFIG.CyaniteReprocessor.WaterTankCapacity - 1000)) {
+// this.fluidTank.fill(new FluidStack(Fluids.WATER, 1000), IFluidHandler.FluidAction.EXECUTE);
+// player.setItemInHand(InteractionHand.MAIN_HAND, new ItemStack(Items.BUCKET));
+// }
+// return InteractionResult.SUCCESS;
+// }
+//
+// // Get container and open GUI.
+// NetworkHooks.openScreen((ServerPlayer) player, this, blockPos);
+// return InteractionResult.SUCCESS;
+// }
+//
+// /**
+// * Drop items on destruction.
+// */
+// public void onReplaced(BlockState blockState, Level world, BlockPos blockPos, BlockState newBlockState, boolean isMoving) {
+// ItemStack inputStack = this.itemHandler.getStackInSlot(CyaniteReprocessorItemHandler.INPUT_SLOT_INDEX);
+// if (!inputStack.isEmpty()) {
+// Containers.dropContents(world, blockPos, new SimpleContainer(inputStack));
+// }
+//
+// ItemStack outputStack = this.itemHandler.getStackInSlot(CyaniteReprocessorItemHandler.OUTPUT_SLOT_INDEX);
+// if (!outputStack.isEmpty()) {
+// Containers.dropContents(world, blockPos, new SimpleContainer(outputStack));
+// }
+// }
+//
+// /**
+// * @see CyaniteReprocessorTile#getDefaultName()
+// */
+// @Override
+// public Component getDisplayName() {
+// return this.getDefaultName();
+// }
+//
+// /**
+// * @return The localized default name for the tile.
+// */
+// @Override
+// protected Component getDefaultName() {
+// return Component.translatable("block.biggerreactors.cyanite_reprocessor");
+// }
+//
+// /**
+// * Create a GUI container for the tile.
+// *
+// * @param windowId The window ID to use.
+// * @param playerInventory The player's inventory.
+// * @return A GUI container to render.
+// */
+// @Override
+// protected AbstractContainerMenu createMenu(int windowId, Inventory playerInventory) {
+// return new CyaniteReprocessorContainer(windowId, this.getBlockPos(), playerInventory.player);
+// }
+//
+// /**
+// * @return The current state of the tile.
+// */
+// @Override
+// @Nonnull
+// public CyaniteReprocessorState getState() {
+// this.updateState();
+// return this.cyaniteReprocessorState;
+// }
+//
+// /**
+// * Call for an update to the current state information.
+// */
+// @Override
+// public void updateState() {
+// this.cyaniteReprocessorState.workTime = this.workHandler.getProgress();
+// this.cyaniteReprocessorState.workTimeTotal = this.workHandler.getGoal();
+// this.cyaniteReprocessorState.energyStored = this.energyStorage.getEnergyStored();
+// this.cyaniteReprocessorState.energyCapacity = this.energyStorage.getMaxEnergyStored();
+// this.cyaniteReprocessorState.waterStored = this.fluidTank.getFluidAmount();
+// this.cyaniteReprocessorState.waterCapacity = this.fluidTank.getCapacity();
+// }
+//
+// /**
+// * @return How large this tile's inventory is.
+// */
+// @Override
+// public int getContainerSize() {
+// return this.itemHandler.getSlots();
+// }
+//
+// /**
+// * @return Whether or not the inventory is empty.
+// */
+// @Override
+// public boolean isEmpty() {
+// for (int index = 0; index < this.itemHandler.getSlots(); ++index) {
+// if (!this.itemHandler.getStackInSlot(index).isEmpty()) {
+// return false;
+// }
+// }
+// return true;
+// }
+//
+// /**
+// * Gets the item held in the specified slot.
+// *
+// * @param index The slot index to fetch from.
+// * @return Any items held in that slot.
+// */
+// @Override
+// public ItemStack getItem(int index) {
+// return this.itemHandler.getStackInSlot(index);
+// }
+//
+// /**
+// * Removes the specified number of items from the specified slot.
+// *
+// * @param index The slot index to remove from.
+// * @param count The number of items to remove.
+// * @return The items that were removed.
+// */
+// @Override
+// public ItemStack removeItem(int index, int count) {
+// return this.itemHandler.getStackInSlot(index).split(count);
+// }
+//
+// /**
+// * Removes an entire stack fromm the specified slot.
+// *
+// * @param index The slot index to remove from.
+// * @return The items that were removed.
+// */
+// @Override
+// public ItemStack removeItemNoUpdate(int index) {
+// ItemStack itemStack = this.itemHandler.getStackInSlot(index).copy();
+// this.itemHandler.setStackInSlot(index, ItemStack.EMPTY);
+// return itemStack;
+// }
+//
+// /**
+// * Updates the stored items in the specified slot.
+// *
+// * @param index The slot index to update.
+// * @param stack The items to update with.
+// */
+// @Override
+// public void setItem(int index, ItemStack stack) {
+// ItemStack oldStack = this.itemHandler.getStackInSlot(index);
+// boolean flag = !stack.isEmpty() && ItemStack
+// .isSameItem(stack, oldStack);
+// this.itemHandler.setStackInSlot(index, stack);
+// if (stack.getCount() > this.getMaxStackSize()) {
+// stack.setCount(this.getMaxStackSize());
+// }
+//
+// if (index == 0 && !flag) {
+// this.workHandler.clear();
+// this.setChanged();
+// }
+// }
+//
+// /**
+// * Clears all data and inventory for this tile.
+// */
+// @Override
+// public void clearContent() {
+// // Reset work.
+// this.workHandler = new WorkHandler(Config.CONFIG.CyaniteReprocessor.TotalWorkTime);
+//
+// // Reset items.
+// this.itemHandler = new CyaniteReprocessorItemHandler();
+// this.itemHandler.setSize(2);
+//
+// // Reset energy.
+// this.energyStorage = new EnergyStorage(Config.CONFIG.CyaniteReprocessor.EnergyTankCapacity);
+//
+// // Reset fluids.
+// this.fluidTank = new FluidTank(Config.CONFIG.CyaniteReprocessor.WaterTankCapacity, fluid -> fluid.getFluid() == Fluids.WATER);
+// }
+//
+// /**
+// * Checks if the player can currently use this tile.
+// *
+// * @param player The player to check.
+// * @return True if usable, false otherwise.
+// */
+// @Override
+// public boolean stillValid(Player player) {
+// assert this.level != null;
+// if (this.level.getBlockEntity(this.getBlockPos()) != this) {
+// return false;
+// } else {
+// return player.distanceToSqr(
+// (double) this.getBlockPos().getX() + 0.5D,
+// (double) this.getBlockPos().getY() + 0.5D,
+// (double) this.getBlockPos().getZ() + 0.5D) <= 64.0D;
+// }
+// }
+//
+// /**
+// * Read NBT data from the world.
+// *
+// * @param parentCompound The parent compound to read from.
+// */
+// @Override
+// public void load(@Nonnull CompoundTag parentCompound) {
+// super.load(parentCompound);
+// CompoundTag childCompound = parentCompound.getCompound("cyaniteReprocessorState");
+//
+// // Read work.
+// this.workHandler = new WorkHandler(childCompound.getInt("workTimeTotal"), childCompound.getInt("workTime"));
+// // Read items.
+// this.itemHandler.deserializeNBT(childCompound.getCompound("inventory"));
+// // Read energy.
+// this.energyStorage = new EnergyStorage(childCompound.getInt("energyCapacity"),
+// Config.CONFIG.CyaniteReprocessor.TransferRate,
+// Config.CONFIG.CyaniteReprocessor.TransferRate,
+// childCompound.getInt("energyStored"));
+// // Read fluids.
+// this.fluidTank = this.fluidTank.readFromNBT(childCompound.getCompound("fluidStorage"));
+// }
+//
+// /**
+// * Save NBT data to the world.
+// *
+// * @param parentCompound The parent compound to append onto.
+// * @return The updated compound.
+// */
+// @Override
+// public final void saveAdditional(@Nonnull CompoundTag parentCompound) {
+// super.saveAdditional(parentCompound);
+// CompoundTag childCompound = new CompoundTag();
+//
+// // Write work.
+// childCompound.putInt("workTime", this.workHandler.getProgress());
+// childCompound.putInt("workTimeTotal", this.workHandler.getGoal());
+// // Write items.
+// childCompound.put("inventory", this.itemHandler.serializeNBT());
+// // Write energy.
+// childCompound.putInt("energyStored", this.energyStorage.getEnergyStored());
+// childCompound.putInt("energyCapacity", this.energyStorage.getMaxEnergyStored());
+// // Write fluids.
+// childCompound.put("fluidTank", fluidTank.writeToNBT(new CompoundTag()));
+//
+// parentCompound.put("cyaniteReprocessorState", childCompound);
+// }
+//
+// /**
+// * @return Whether or not the machine can perform work.
+// * @see CyaniteReprocessorTile#tick()
+// */
+// private boolean canWork() {
+// // If the output slot is full, we cannot work.
+// if (this.getItem(CyaniteReprocessorItemHandler.OUTPUT_SLOT_INDEX).getCount() >= 64) {
+// return false;
+// }
+// return (this.energyStorage.getEnergyStored() >= Config.CONFIG.CyaniteReprocessor.EnergyConsumptionPerTick
+// && this.fluidTank.getFluidAmount() >= Config.CONFIG.CyaniteReprocessor.WaterConsumptionPerTick);
+// }
+//
+// /**
+// * Do work (if possible).
+// */
+// public void tick() {
+// // Check for client-side.
+// assert level != null;
+// if (level.isClientSide()) {
+// return;
+// }
+//
+// boolean doUpdate = false;
+// boolean isActive = false;
+// ItemStack inputStack = this.itemHandler.getStackInSlot(CyaniteReprocessorItemHandler.INPUT_SLOT_INDEX);
+//
+// // Check to make sure the player doesn't try to pull a fast one.
+// if (!ItemStack.isSameItem(this.itemPresentLastTick, inputStack)) {
+// this.workHandler.clear();
+// }
+// this.itemPresentLastTick = inputStack.copy();
+//
+// if (inputStack.getCount() >= 2) {
+// // Can we continue?
+// if (canWork()) {
+// isActive = true;
+// doUpdate = true;
+// this.workHandler.increment(1);
+// this.energyStorage.extractEnergy(Config.CONFIG.CyaniteReprocessor.EnergyConsumptionPerTick, false);
+// this.fluidTank.drain(Config.CONFIG.CyaniteReprocessor.WaterConsumptionPerTick, IFluidHandler.FluidAction.EXECUTE);
+// // We've run out of resources, halt.
+// } else if (this.workHandler.getProgress() > 0) {
+// this.workHandler.decrement(2);
+// }
+//
+// // Item is done.
+// if (this.workHandler.isFinished()) {
+// this.itemHandler.extractItem(CyaniteReprocessorItemHandler.INPUT_SLOT_INDEX, 2, false);
+// this.itemHandler.insertItem(CyaniteReprocessorItemHandler.OUTPUT_SLOT_INDEX, new ItemStack(BlutoniumIngot.INSTANCE, 1), false);
+// this.workHandler.clear();
+// }
+// }
+//
+// BlockState currentBlockState = level.getBlockState(this.getBlockPos());
+// BlockState newBlockState = currentBlockState.setValue(CyaniteReprocessor.ENABLED, isActive);
+// if (!newBlockState.equals(currentBlockState)) {
+// this.level.setBlock(this.getBlockPos(), newBlockState, 3);
+// doUpdate = true;
+// }
+//
+// if (doUpdate) {
+// setChanged();
+// }
+//
+// // Update the current machine state.
+// this.updateState();
+// }
+//
+// /**
+// * Check if the tile holds a certain capability.
+// *
+// * @param capability The capability to check for.
+// * @param side Which side this capability should belong to.
+// * @param The type class of the capability.
+// * @return The handler for the capability, if present.
+// */
+// @Nonnull
+// @Override
+// public LazyOptional getCapability(@Nonnull Capability capability,
+// @Nullable Direction side) {
+// // Check for work.
+// // TODO: While this capability is exclusive to the Reprocessor for now, it may not always be.
+// // The capability is technically implemented, but no registration is done.
+// // That oughta be fixed, so it can be checked for here.
+// // But I'm lazy, so I'll do that some other time.
+// //if (capability.equals(CapabilityWorkHandler.WORK_HANDLER_CAPABILITY)) {
+// // return this.WORK_HANDLER_CAPABILITY.cast();
+// //}
+//
+// // Check for items.
+// if (capability.equals(ForgeCapabilities.ITEM_HANDLER)) {
+// return this.ITEM_HANDLER_CAPABILITY.cast();
+// }
+//
+// // Check for energy.
+// if (capability.equals(ForgeCapabilities.ENERGY)) {
+// return this.ENERGY_STORAGE_CAPABILITY.cast();
+// }
+//
+// // Check for water.
+// if (capability.equals(ForgeCapabilities.FLUID_HANDLER)) {
+// return this.FLUID_TANK_CAPABILITY.cast();
+// }
+//
+// return Objects.requireNonNull(super.getCapability(capability, side));
+// }
+//
+// @Override
+// public boolean canPlaceItem(int index, ItemStack stack) {
+// return this.itemHandler.isItemValid(index, stack);
+// }
+//
+// public CyaniteReprocessorItemHandler getItemHandler() {
+// return itemHandler;
+// }
+//}
diff --git a/src/main/java/net/roguelogix/biggerreactors/machine/tiles/impl/CyaniteReprocessorItemHandler.java b/src/main/java/net/roguelogix/biggerreactors/machine/tiles/impl/CyaniteReprocessorItemHandler.java
index 1f54324b..a9b3c6ee 100644
--- a/src/main/java/net/roguelogix/biggerreactors/machine/tiles/impl/CyaniteReprocessorItemHandler.java
+++ b/src/main/java/net/roguelogix/biggerreactors/machine/tiles/impl/CyaniteReprocessorItemHandler.java
@@ -1,8 +1,8 @@
package net.roguelogix.biggerreactors.machine.tiles.impl;
import net.minecraft.world.item.ItemStack;
-import net.minecraftforge.items.IItemHandler;
-import net.minecraftforge.items.ItemStackHandler;
+import net.neoforged.neoforge.items.IItemHandler;
+import net.neoforged.neoforge.items.ItemStackHandler;
import net.roguelogix.biggerreactors.items.ingots.BlutoniumIngot;
import net.roguelogix.biggerreactors.items.ingots.CyaniteIngot;
diff --git a/src/main/java/net/roguelogix/biggerreactors/multiblocks/heatexchanger/blocks/HeatExchangerBaseBlock.java b/src/main/java/net/roguelogix/biggerreactors/multiblocks/heatexchanger/blocks/HeatExchangerBaseBlock.java
index ed7ce4de..b37a931b 100644
--- a/src/main/java/net/roguelogix/biggerreactors/multiblocks/heatexchanger/blocks/HeatExchangerBaseBlock.java
+++ b/src/main/java/net/roguelogix/biggerreactors/multiblocks/heatexchanger/blocks/HeatExchangerBaseBlock.java
@@ -12,7 +12,6 @@
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
-import net.minecraftforge.network.NetworkHooks;
import net.roguelogix.phosphophyllite.modular.block.PhosphophylliteBlock;
import net.roguelogix.phosphophyllite.multiblock.rectangular.IRectangularMultiblockBlock;
@@ -55,7 +54,7 @@ public InteractionResult onUse(BlockState state, Level level, BlockPos pos, Play
if (hand == InteractionHand.MAIN_HAND && state.hasProperty(ASSEMBLED) && state.getValue(ASSEMBLED)) {
if (level.getBlockEntity(pos) instanceof MenuProvider menuProvider) {
if (!level.isClientSide) {
- NetworkHooks.openScreen((ServerPlayer) player, menuProvider, pos);
+ player.openMenu(menuProvider, pos);
}
return InteractionResult.SUCCESS;
}
diff --git a/src/main/java/net/roguelogix/biggerreactors/multiblocks/heatexchanger/client/HeatExchangerFluidPortScreen.java b/src/main/java/net/roguelogix/biggerreactors/multiblocks/heatexchanger/client/HeatExchangerFluidPortScreen.java
index bcac3ee6..91a8605c 100644
--- a/src/main/java/net/roguelogix/biggerreactors/multiblocks/heatexchanger/client/HeatExchangerFluidPortScreen.java
+++ b/src/main/java/net/roguelogix/biggerreactors/multiblocks/heatexchanger/client/HeatExchangerFluidPortScreen.java
@@ -6,8 +6,8 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvents;
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 net.roguelogix.biggerreactors.BiggerReactors;
import net.roguelogix.biggerreactors.client.Biselector;
import net.roguelogix.biggerreactors.client.SelectorColors;
diff --git a/src/main/java/net/roguelogix/biggerreactors/multiblocks/heatexchanger/client/HeatExchangerTerminalScreen.java b/src/main/java/net/roguelogix/biggerreactors/multiblocks/heatexchanger/client/HeatExchangerTerminalScreen.java
index 7bbfc30d..24ce8a5c 100644
--- a/src/main/java/net/roguelogix/biggerreactors/multiblocks/heatexchanger/client/HeatExchangerTerminalScreen.java
+++ b/src/main/java/net/roguelogix/biggerreactors/multiblocks/heatexchanger/client/HeatExchangerTerminalScreen.java
@@ -9,9 +9,8 @@
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.material.Fluids;
-import net.minecraftforge.api.distmarker.Dist;
-import net.minecraftforge.api.distmarker.OnlyIn;
-import net.minecraftforge.registries.ForgeRegistries;
+import net.neoforged.api.distmarker.Dist;
+import net.neoforged.api.distmarker.OnlyIn;
import net.roguelogix.biggerreactors.BiggerReactors;
import net.roguelogix.biggerreactors.Config;
import net.roguelogix.biggerreactors.client.CommonRender;
@@ -145,22 +144,22 @@ private void initGauges() {
@Override
public void containerTick() {
// Check if condenser intake fluid changed.
- if (!heatExchangerState.condenserIntakeFluid.equals(Objects.requireNonNull(ForgeRegistries.FLUIDS.getKey(condenserIntakeFluid)).toString())) {
+ if (!heatExchangerState.condenserIntakeFluid.equals(Objects.requireNonNull(BuiltInRegistries.FLUID.getKey(condenserIntakeFluid)).toString())) {
condenserIntakeFluid = BuiltInRegistries.FLUID.get(new ResourceLocation(heatExchangerState.condenserIntakeFluid));
}
// Check if evaporator intake fluid changed.
- if (!heatExchangerState.evaporatorIntakeFluid.equals(Objects.requireNonNull(ForgeRegistries.FLUIDS.getKey(evaporatorIntakeFluid)).toString())) {
+ if (!heatExchangerState.evaporatorIntakeFluid.equals(Objects.requireNonNull(BuiltInRegistries.FLUID.getKey(evaporatorIntakeFluid)).toString())) {
evaporatorIntakeFluid = BuiltInRegistries.FLUID.get(new ResourceLocation(heatExchangerState.evaporatorIntakeFluid));
}
// Check if condenser exhaust fluid changed.
- if (!heatExchangerState.condenserExhaustFluid.equals(Objects.requireNonNull(ForgeRegistries.FLUIDS.getKey(condenserExhaustFluid)).toString())) {
+ if (!heatExchangerState.condenserExhaustFluid.equals(Objects.requireNonNull(BuiltInRegistries.FLUID.getKey(condenserExhaustFluid)).toString())) {
condenserExhaustFluid = BuiltInRegistries.FLUID.get(new ResourceLocation(heatExchangerState.condenserExhaustFluid));
}
// Check if evaporator exhaust fluid changed.
- if (!heatExchangerState.evaporatorExhaustFluid.equals(Objects.requireNonNull(ForgeRegistries.FLUIDS.getKey(evaporatorExhaustFluid)).toString())) {
+ if (!heatExchangerState.evaporatorExhaustFluid.equals(Objects.requireNonNull(BuiltInRegistries.FLUID.getKey(evaporatorExhaustFluid)).toString())) {
evaporatorExhaustFluid = BuiltInRegistries.FLUID.get(new ResourceLocation(heatExchangerState.evaporatorExhaustFluid));
}
}
diff --git a/src/main/java/net/roguelogix/biggerreactors/multiblocks/heatexchanger/deps/HeatExchangerPeripheral.java b/src/main/java/net/roguelogix/biggerreactors/multiblocks/heatexchanger/deps/HeatExchangerPeripheral.java
index 55b02a2c..10826d1b 100644
--- a/src/main/java/net/roguelogix/biggerreactors/multiblocks/heatexchanger/deps/HeatExchangerPeripheral.java
+++ b/src/main/java/net/roguelogix/biggerreactors/multiblocks/heatexchanger/deps/HeatExchangerPeripheral.java
@@ -4,8 +4,7 @@
import dan200.computercraft.api.lua.LuaException;
import dan200.computercraft.api.lua.LuaFunction;
import dan200.computercraft.api.peripheral.IPeripheral;
-import net.minecraftforge.common.util.LazyOptional;
-import net.minecraftforge.registries.ForgeRegistries;
+import net.minecraft.core.registries.BuiltInRegistries;
import net.roguelogix.biggerreactors.BiggerReactors;
import net.roguelogix.biggerreactors.multiblocks.heatexchanger.HeatExchangerMultiblockController;
import net.roguelogix.biggerreactors.util.FluidTransitionTank;
@@ -27,8 +26,8 @@ public class HeatExchangerPeripheral implements IPeripheral {
final Channel evaporator;
final InternalEnvironment internalEnvironment;
- public static LazyOptional