From 4f28b03f5d44699d4384a7cd192337970600941f Mon Sep 17 00:00:00 2001 From: Srendi Date: Tue, 24 Dec 2024 03:30:20 +0100 Subject: [PATCH 01/57] Initial 1.21.1 work, just adapted gradle --- build.gradle | 91 +++++++++---------- gradle.properties | 12 ++- .../{mods.toml => neoforge.mods.toml} | 25 ++--- 3 files changed, 64 insertions(+), 64 deletions(-) rename src/main/resources/META-INF/{mods.toml => neoforge.mods.toml} (82%) diff --git a/build.gradle b/build.gradle index efe9efe2c..0fb9014ca 100644 --- a/build.gradle +++ b/build.gradle @@ -1,15 +1,13 @@ import net.darkhax.curseforgegradle.TaskPublishCurseForge import java.text.SimpleDateFormat -import net.neoforged.gradle.dsl.common.runs.run.Run plugins { id "maven-publish" id 'net.darkhax.curseforgegradle' version '1.1.16' id 'org.jetbrains.changelog' version '1.2.1' id "com.modrinth.minotaur" version "2.+" - //id "org.jetbrains.kotlin.jvm" version "1.6.10" - id 'net.neoforged.gradle.userdev' version '7.0.145' + id 'net.neoforged.moddev' version '1.0.21' id "com.github.breadmoirai.github-release" version "2.5.2" id 'checkstyle' id 'java' @@ -17,7 +15,7 @@ plugins { java { toolchain { - languageVersion = JavaLanguageVersion.of(17) + languageVersion = JavaLanguageVersion.of(21) } withSourcesJar() } @@ -57,32 +55,55 @@ def githubKey = secretEnv["GITHUB_KEY"] ?: System.getenv("GITHUB_KEY") // Include resources generated by data generators. sourceSets.main.resources { srcDir 'src/generated/resources' } -minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/accesstransformer.cfg') -runs { - // applies to all the run configs below - configureEach { - systemProperty 'forge.logging.markers', 'REGISTRIES' +neoForge { + // Specify the version of NeoForge to use. + version = project.neo_version - systemProperty 'forge.logging.console.level', 'debug' - - modSource project.sourceSets.main + parchment { + mappingsVersion = project.parchment_mappings_version + minecraftVersion = project.parchment_minecraft_version } - client { run -> setupClientAcc(run) } + runs { + // applies to all the run configs below + configureEach { + systemProperty 'forge.logging.markers', 'REGISTRIES' - server { - systemProperty 'forge.enabledGameTestNamespaces', project.mod_id - } + logLevel = org.slf4j.event.Level.DEBUG + } + + client { + client() + + systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id + } + + server { + server() + systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id + } + + gameTestServer { + type = "gameTestServer" + systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id + } + + data { + data() + + programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath() + } - gameTestServer { - systemProperty 'forge.enabledGameTestNamespaces', project.mod_id } - data { - programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath() + mods { + "${mod_id}" { + sourceSet(sourceSets.main) + } } } + repositories { mavenCentral() maven { @@ -95,7 +116,7 @@ repositories { } maven { name = "Squiddev maven cct" - url = 'https://squiddev.cc/maven/' + url = 'https://maven.squiddev.cc' content { includeGroup("cc.tweaked") includeModule("org.squiddev", "Cobalt") @@ -335,7 +356,7 @@ tasks.withType(ProcessResources).configureEach { inputs.properties replaceProperties - filesMatching(['META-INF/mods.toml']) { + filesMatching(['META-INF/neoforge.mods.toml']) { expand replaceProperties } } @@ -415,37 +436,13 @@ modrinth { } } -// Stolen from mekanism -static void setupClientAcc(Run run) { - //The below if statements are to add args to your gradle.properties file in user home - // (DO NOT add them directly to the gradle.properties file for this project) - // Setting the below properties allows use of your normal Minecraft account in the - // dev environment including having your skin load. Each property also has a comment - // explaining what information to set the value to/format it expects - // One thing to note is because of the caching that goes on, after changing these - // variables, you need to refresh the project and rerun genIntellijRuns/genEclipseRuns - if (run.project.hasProperty('mc_uuid')) { - //Your uuid without any dashes in the middle - run.programArguments('--uuid', (String) run.project.property('mc_uuid')) - } - if (run.project.hasProperty('mc_username')) { - //Your username/display name, this is the name that shows up in chat - // Note: This is not your email, even if you have a Mojang account - run.programArguments('--username', (String) run.project.property('mc_username')) - } - if (run.project.hasProperty('mc_accessToken')) { - //Your access token, you can find it in your '.minecraft/launcher_accounts.json' file - run.programArguments('--accessToken', (String) run.project.property('mc_accessToken')) - } -} - publishing { publications { PublicationContainer publicationContainer -> publicationContainer.register("maven", MavenPublication) { MavenPublication publication -> publication.from((SoftwareComponent) components.java) publication.groupId = project.group publication.version = isSnapshotVersion ? "${minecraft_version}-${version}-${project.teamcityBuild}" : "${minecraft_version}-${version}" - publication.artifactId = isSnapshotVersion ? "advancedperipherals-snapshots" : "advancedperipherals" + publication.artifactId = isSnapshotVersion ? "advancedperipherals-snapshots" : "advancedperipherals" publication.artifacts = [jar, sourcesJar] publication.pom { name.set("AdvancedPeripherals") diff --git a/gradle.properties b/gradle.properties index 32a1fa308..553e1ff18 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,10 +4,12 @@ org.gradle.logging.level=info # Minecraft related mod_id=advancedperipherals -minecraft_version=1.20.4 -neo_version=20.4.231 -loader_version=20 -mod_version=0.7.42a +minecraft_version=1.21.1 +neo_version=21.1.90 +parchment_minecraft_version=1.21.1 +parchment_mappings_version=2024.11.13 +loader_version=4 +mod_version=0.7.43a release_type=alpha neogradle.subsystems.parchment.minecraftVersion=1.20.4 neogradle.subsystems.parchment.mappingsVersion=2024.04.14 @@ -21,7 +23,7 @@ kotlinx_coroutines_version=1.6.0-RC3 ttoolkit_version=0.1.3 # Mod dependencies -cc_version=1.110.2 +cc_version=1.113.1 curios_version=7.4.3+1.20.4 minecolonies_version=1.20.1-1.1.472-BETA appliedenergistics_version=17.13.0-beta diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/neoforge.mods.toml similarity index 82% rename from src/main/resources/META-INF/mods.toml rename to src/main/resources/META-INF/neoforge.mods.toml index 4221c8416..dbe8df113 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/neoforge.mods.toml @@ -1,8 +1,9 @@ modLoader = "javafml" -loaderVersion = "[2,)" +loaderVersion="${loader_version}" license = "All rights reserved" issueTrackerURL = "/~https://github.com/Seniorendi/AdvancedPeripherals/issues" logoFile = "pack.png" + [[mods]] modId = "${mod_id}" version = "${version}" @@ -15,27 +16,27 @@ It also integrates with multiple third party mods. ''' [[accessTransformers]] -file="META-INF/accesstransformer.cfg" +file = "META-INF/accesstransformer.cfg" -[[dependencies.${mod_id}]] +[[dependencies.${ mod_id }]] modId = "neoforge" type = "required" versionRange = "[${neo_version},)" ordering = "NONE" side = "BOTH" -[[dependencies.${mod_id}]] +[[dependencies.${ mod_id }]] modId = "minecraft" type = "required" versionRange = "[${minecraft_version},)" ordering = "NONE" side = "BOTH" -[[dependencies.${mod_id}]] +[[dependencies.${ mod_id }]] modId = "computercraft" type = "required" versionRange = "[${cc_version},)" ordering = "NONE" side = "BOTH" -[[dependencies.${mod_id}]] +[[dependencies.${ mod_id }]] modId = "curios" type = "optional" versionRange = "[${curios_version},)" @@ -47,37 +48,37 @@ type = "optional" versionRange = "[${appliedenergistics_version},)" ordering = "NONE" side = "BOTH" -[[dependencies.${mod_id}]] +[[dependencies.${ mod_id }]] modId = "refinedstorage" type = "optional" versionRange = "[1.13.0-beta4,)" ordnering = "NONE" side = "BOTH" -[[dependencies.${mod_id}]] +[[dependencies.${ mod_id }]] modId = "minecolonies" type = "optional" versionRange = "[${minecolonies_version},)" ordering = "NONE" side = "BOTH" -[[dependencies.${mod_id}]] +[[dependencies.${ mod_id }]] modId = "patchouli" type = "optional" versionRange = "[${patchouli_version},)" ordering = "NONE" side = "BOTH" -[[dependencies.${mod_id}]] +[[dependencies.${ mod_id }]] modId = "create" type = "optional" versionRange = "[0.5.1,)" ordering = "NONE" side = "BOTH" -[[dependencies.${mod_id}]] +[[dependencies.${ mod_id }]] modId = "botania" type = "optional" versionRange = "[${botania_version},)" ordering = "NONE" side = "BOTH" -[[dependencies.${mod_id}]] +[[dependencies.${ mod_id }]] modId = "mekanism" type = "optional" versionRange = "[${mekanism_version},)" From 34c1fe4a1b49bf10a3800ef8da6af42612d29b92 Mon Sep 17 00:00:00 2001 From: Diemoell Date: Fri, 27 Dec 2024 13:03:46 +0800 Subject: [PATCH 02/57] Update 1.21 config file --- .../AdvancedPeripherals.java | 2 +- .../common/configuration/APConfig.java | 38 +++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/AdvancedPeripherals.java b/src/main/java/de/srendi/advancedperipherals/AdvancedPeripherals.java index b29cd9c27..6cd5f609e 100644 --- a/src/main/java/de/srendi/advancedperipherals/AdvancedPeripherals.java +++ b/src/main/java/de/srendi/advancedperipherals/AdvancedPeripherals.java @@ -52,7 +52,7 @@ public static void debug(String message, Level level) { } public static ResourceLocation getRL(String resource) { - return new ResourceLocation(MOD_ID, resource); + return ResourceLocation.fromNamespaceAndPath(MOD_ID, resource); } public void commonSetup(FMLCommonSetupEvent event) { diff --git a/src/main/java/de/srendi/advancedperipherals/common/configuration/APConfig.java b/src/main/java/de/srendi/advancedperipherals/common/configuration/APConfig.java index 5dab5ee3a..2b968ec40 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/configuration/APConfig.java +++ b/src/main/java/de/srendi/advancedperipherals/common/configuration/APConfig.java @@ -1,26 +1,24 @@ package de.srendi.advancedperipherals.common.configuration; -import com.electronwill.nightconfig.core.file.CommentedFileConfig; import net.neoforged.fml.ModContainer; import net.neoforged.fml.ModLoadingContext; -import net.neoforged.fml.config.ConfigFileTypeHandler; -import net.neoforged.fml.config.ModConfig; +import net.neoforged.fml.config.IConfigSpec; import net.neoforged.fml.loading.FMLPaths; -import java.nio.file.Path; -import java.util.function.Function; +import java.util.HashMap; +import java.util.Map; -public class APConfig extends ModConfig { +public class APConfig { - public static final ConfigFileHandler CONFIG_FILE_HANDLER = new ConfigFileHandler(); + // public static final ConfigFileHandler CONFIG_FILE_HANDLER = new ConfigFileHandler(); + private static final Map KNOWN_CONFIGS = new HashMap<>(); public static final GeneralConfig GENERAL_CONFIG = new GeneralConfig(); public static final PeripheralsConfig PERIPHERALS_CONFIG = new PeripheralsConfig(); public static final MetaphysicsConfig METAPHYSICS_CONFIG = new MetaphysicsConfig(); public static final WorldConfig WORLD_CONFIG = new WorldConfig(); - public APConfig(IAPConfig config, ModContainer container) { - super(config.getType(), config.getConfigSpec(), container, "Advancedperipherals/" + config.getFileName() + ".toml"); + public APConfig() { } public static void register(ModLoadingContext context) { @@ -28,18 +26,28 @@ public static void register(ModLoadingContext context) { FMLPaths.getOrCreateGameRelativePath(FMLPaths.CONFIGDIR.get().resolve("Advancedperipherals")); ModContainer modContainer = context.getActiveContainer(); - modContainer.addConfig(new APConfig(GENERAL_CONFIG, modContainer)); - modContainer.addConfig(new APConfig(PERIPHERALS_CONFIG, modContainer)); - modContainer.addConfig(new APConfig(METAPHYSICS_CONFIG, modContainer)); - modContainer.addConfig(new APConfig(WORLD_CONFIG, modContainer)); + APConfigHelper.registerConfig(KNOWN_CONFIGS, modContainer, GENERAL_CONFIG); + APConfigHelper.registerConfig(KNOWN_CONFIGS, modContainer, PERIPHERALS_CONFIG); + APConfigHelper.registerConfig(KNOWN_CONFIGS, modContainer, METAPHYSICS_CONFIG); + APConfigHelper.registerConfig(KNOWN_CONFIGS, modContainer, WORLD_CONFIG); } + public static class APConfigHelper { + public static String getAPConfigFilePath(IAPConfig config) { + return "Advancedperipherals/" + config.getFileName() + ".toml"; + } + + public static void registerConfig(Map knownConfigs, ModContainer modContainer, IAPConfig config) { + modContainer.registerConfig(config.getType(), config.getConfigSpec(), APConfigHelper.getAPConfigFilePath(config)); + knownConfigs.put(config.getConfigSpec(), config); + } + /*@Override public ConfigFileTypeHandler getHandler() { return CONFIG_FILE_HANDLER; }*/ - public static class ConfigFileHandler extends ConfigFileTypeHandler { + /*public static class ConfigFileHandler extends ConfigFileTypeHandler { public static Path getPath(Path path) { if (path.endsWith("serverconfig")) @@ -56,6 +64,6 @@ public Function reader(Path configBasePath) { @Override public void unload(ModConfig config) { super.unload(config); - } + }*/ } } From 4879a60189d0d6e6ca0b0c8d3e70f41f408046f9 Mon Sep 17 00:00:00 2001 From: Diemoell Date: Mon, 30 Dec 2024 19:50:01 +0800 Subject: [PATCH 03/57] Update 1.21 config file --- .../common/configuration/APConfig.java | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/configuration/APConfig.java b/src/main/java/de/srendi/advancedperipherals/common/configuration/APConfig.java index 2b968ec40..3ae818259 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/configuration/APConfig.java +++ b/src/main/java/de/srendi/advancedperipherals/common/configuration/APConfig.java @@ -10,7 +10,6 @@ public class APConfig { - // public static final ConfigFileHandler CONFIG_FILE_HANDLER = new ConfigFileHandler(); private static final Map KNOWN_CONFIGS = new HashMap<>(); public static final GeneralConfig GENERAL_CONFIG = new GeneralConfig(); @@ -41,29 +40,5 @@ public static void registerConfig(Map knownConfigs, ModC modContainer.registerConfig(config.getType(), config.getConfigSpec(), APConfigHelper.getAPConfigFilePath(config)); knownConfigs.put(config.getConfigSpec(), config); } - - /*@Override - public ConfigFileTypeHandler getHandler() { - return CONFIG_FILE_HANDLER; - }*/ - - /*public static class ConfigFileHandler extends ConfigFileTypeHandler { - - public static Path getPath(Path path) { - if (path.endsWith("serverconfig")) - return FMLPaths.CONFIGDIR.get(); - - return path; - } - - @Override - public Function reader(Path configBasePath) { - return super.reader(getPath(configBasePath)); - } - - @Override - public void unload(ModConfig config) { - super.unload(config); - }*/ } } From 1fafc449368b4277c359d48a3bb5ec187d48ea27 Mon Sep 17 00:00:00 2001 From: Diemoell Date: Mon, 30 Dec 2024 21:33:52 +0800 Subject: [PATCH 04/57] Update 1.21 Registry --- .../client/ClientRegistry.java | 18 ++--- .../common/setup/CCRegistration.java | 68 +++++++++---------- 2 files changed, 44 insertions(+), 42 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/client/ClientRegistry.java b/src/main/java/de/srendi/advancedperipherals/client/ClientRegistry.java index 766009aa8..334496867 100644 --- a/src/main/java/de/srendi/advancedperipherals/client/ClientRegistry.java +++ b/src/main/java/de/srendi/advancedperipherals/client/ClientRegistry.java @@ -11,12 +11,14 @@ import net.minecraft.resources.ResourceLocation; import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.fml.common.Mod; import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; import net.neoforged.neoforge.client.event.ModelEvent; import net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent; +import net.neoforged.neoforge.client.event.RegisterMenuScreensEvent; -@Mod.EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID, value = Dist.CLIENT, bus = Mod.EventBusSubscriber.Bus.MOD) +@EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID, value = Dist.CLIENT, bus = EventBusSubscriber.Bus.MOD) public class ClientRegistry { private static final String[] TURTLE_MODELS = new String[]{"turtle_chat_box_upgrade_left", "turtle_chat_box_upgrade_right", "turtle_environment_upgrade_left", "turtle_environment_upgrade_right", "turtle_player_upgrade_left", "turtle_player_upgrade_right", "turtle_geoscanner_upgrade_left", "turtle_geoscanner_upgrade_right"}; @@ -24,23 +26,23 @@ public class ClientRegistry { @SubscribeEvent public static void registerModels(ModelEvent.RegisterAdditional event) { for (String model : TURTLE_MODELS) { - event.register(new ModelResourceLocation(new ResourceLocation(AdvancedPeripherals.MOD_ID, model), "inventory")); + event.register(new ModelResourceLocation(ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, model), "inventory")); } } @SubscribeEvent - public static void onClientSetup(FMLClientSetupEvent event) { - MenuScreens.register(ContainerTypes.INVENTORY_MANAGER_CONTAINER.get(), InventoryManagerScreen::new); + public static void menuRegister(RegisterMenuScreensEvent event) { + event.register(ContainerTypes.INVENTORY_MANAGER_CONTAINER.get(), InventoryManagerScreen::new); } @SubscribeEvent public static void onUpgradeModeller(RegisterTurtleModellersEvent event) { event.register(CCRegistration.CHUNKY_TURTLE.get(), TurtleUpgradeModeller.flatItem()); event.register(CCRegistration.COMPASS_TURTLE.get(), TurtleUpgradeModeller.flatItem()); - event.register(CCRegistration.CHAT_BOX_TURTLE.get(), TurtleUpgradeModeller.sided(new ModelResourceLocation(AdvancedPeripherals.getRL("turtle_chat_box_upgrade_left"), "inventory"), new ModelResourceLocation(AdvancedPeripherals.getRL("turtle_chat_box_upgrade_right"), "inventory"))); - event.register(CCRegistration.ENVIRONMENT_TURTLE.get(), TurtleUpgradeModeller.sided(new ModelResourceLocation(AdvancedPeripherals.getRL("turtle_environment_upgrade_left"), "inventory"), new ModelResourceLocation(AdvancedPeripherals.getRL("turtle_environment_upgrade_right"), "inventory"))); - event.register(CCRegistration.GEO_SCANNER_TURTLE.get(), TurtleUpgradeModeller.sided(new ModelResourceLocation(AdvancedPeripherals.getRL("turtle_geoscanner_upgrade_left"), "inventory"), new ModelResourceLocation(AdvancedPeripherals.getRL("turtle_geoscanner_upgrade_right"), "inventory"))); - event.register(CCRegistration.PLAYER_DETECTOR_TURTLE.get(), TurtleUpgradeModeller.sided(new ModelResourceLocation(AdvancedPeripherals.getRL("turtle_player_upgrade_left"), "inventory"), new ModelResourceLocation(AdvancedPeripherals.getRL("turtle_player_upgrade_right"), "inventory"))); + event.register(CCRegistration.CHAT_BOX_TURTLE.get(), TurtleUpgradeModeller.sided(AdvancedPeripherals.getRL("turtle_chat_box_upgrade_left"), AdvancedPeripherals.getRL("turtle_chat_box_upgrade_right"))); + event.register(CCRegistration.ENVIRONMENT_TURTLE.get(), TurtleUpgradeModeller.sided(AdvancedPeripherals.getRL("turtle_environment_upgrade_left"), AdvancedPeripherals.getRL("turtle_environment_upgrade_right"))); + event.register(CCRegistration.GEO_SCANNER_TURTLE.get(), TurtleUpgradeModeller.sided(AdvancedPeripherals.getRL("turtle_geoscanner_upgrade_left"), AdvancedPeripherals.getRL("turtle_geoscanner_upgrade_right"))); + event.register(CCRegistration.PLAYER_DETECTOR_TURTLE.get(), TurtleUpgradeModeller.sided(AdvancedPeripherals.getRL("turtle_player_upgrade_left"), AdvancedPeripherals.getRL("turtle_player_upgrade_right"))); event.register(CCRegistration.OP_END_TURTLE.get(), new MetaTurtleUpgradeModeller<>()); event.register(CCRegistration.OP_HUSBANDRY_TURTLE.get(), new MetaTurtleUpgradeModeller<>()); event.register(CCRegistration.OP_WEAK_TURTLE.get(), new MetaTurtleUpgradeModeller<>()); diff --git a/src/main/java/de/srendi/advancedperipherals/common/setup/CCRegistration.java b/src/main/java/de/srendi/advancedperipherals/common/setup/CCRegistration.java index 0b5a89c89..35c455514 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/setup/CCRegistration.java +++ b/src/main/java/de/srendi/advancedperipherals/common/setup/CCRegistration.java @@ -2,7 +2,7 @@ import dan200.computercraft.api.pocket.IPocketUpgrade; import dan200.computercraft.api.turtle.ITurtleUpgrade; -import dan200.computercraft.api.upgrades.UpgradeSerialiser; +import dan200.computercraft.api.upgrades.UpgradeType; import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.addons.computercraft.integrations.IntegrationPeripheralProvider; import de.srendi.advancedperipherals.common.addons.computercraft.pocket.PocketChatBoxUpgrade; @@ -26,23 +26,23 @@ public class CCRegistration { - public static final DeferredHolder, UpgradeSerialiser> CHAT_BOX_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.CHATTY_TURTLE.getPath(), () -> UpgradeSerialiser.simpleWithCustomItem(TurtleChatBoxUpgrade::new)); - public static final DeferredHolder, UpgradeSerialiser> PLAYER_DETECTOR_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.PLAYER_TURTLE.getPath(), () -> UpgradeSerialiser.simpleWithCustomItem(TurtlePlayerDetectorUpgrade::new)); - public static final DeferredHolder, UpgradeSerialiser> ENVIRONMENT_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.ENVIRONMENT_TURTLE.getPath(), () -> UpgradeSerialiser.simpleWithCustomItem(TurtleEnvironmentDetectorUpgrade::new)); - public static final DeferredHolder, UpgradeSerialiser> CHUNKY_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.CHUNKY_TURTLE.getPath(), () -> UpgradeSerialiser.simpleWithCustomItem(TurtleChunkyUpgrade::new)); - public static final DeferredHolder, UpgradeSerialiser> GEO_SCANNER_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.GEOSCANNER_TURTLE.getPath(), () -> UpgradeSerialiser.simpleWithCustomItem(TurtleGeoScannerUpgrade::new)); - public static final DeferredHolder, UpgradeSerialiser> COMPASS_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.COMPASS_TURTLE.getPath(), () -> UpgradeSerialiser.simpleWithCustomItem(TurtleCompassUpgrade::new)); - public static final DeferredHolder, UpgradeSerialiser> WEAK_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.WEAK_AUTOMATA.getPath(), () -> UpgradeSerialiser.simpleWithCustomItem(WeakAutomata::new)); - public static final DeferredHolder, UpgradeSerialiser> END_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.END_AUTOMATA.getPath(), () -> UpgradeSerialiser.simpleWithCustomItem(EndAutomata::new)); - public static final DeferredHolder, UpgradeSerialiser> HUSBANDRY_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.HUSBANDRY_AUTOMATA.getPath(), () -> UpgradeSerialiser.simpleWithCustomItem(HusbandryAutomata::new)); - public static final DeferredHolder, UpgradeSerialiser> OP_WEAK_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.OP_WEAK_AUTOMATA.getPath(), () -> UpgradeSerialiser.simpleWithCustomItem(OverpoweredWeakAutomata::new)); - public static final DeferredHolder, UpgradeSerialiser> OP_END_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.OP_END_AUTOMATA.getPath(), () -> UpgradeSerialiser.simpleWithCustomItem(OverpoweredEndAutomata::new)); - public static final DeferredHolder, UpgradeSerialiser> OP_HUSBANDRY_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.OP_HUSBANDRY_AUTOMATA.getPath(), () -> UpgradeSerialiser.simpleWithCustomItem(OverpoweredHusbandryAutomata::new)); + public static final DeferredHolder, UpgradeType> CHAT_BOX_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.CHATTY_TURTLE.getPath(), () -> UpgradeType.simpleWithCustomItem(TurtleChatBoxUpgrade::new)); + public static final DeferredHolder, UpgradeType> PLAYER_DETECTOR_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.PLAYER_TURTLE.getPath(), () -> UpgradeType.simpleWithCustomItem(TurtlePlayerDetectorUpgrade::new)); + public static final DeferredHolder, UpgradeType> ENVIRONMENT_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.ENVIRONMENT_TURTLE.getPath(), () -> UpgradeType.simpleWithCustomItem(TurtleEnvironmentDetectorUpgrade::new)); + public static final DeferredHolder, UpgradeType> CHUNKY_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.CHUNKY_TURTLE.getPath(), () -> UpgradeType.simpleWithCustomItem(TurtleChunkyUpgrade::new)); + public static final DeferredHolder, UpgradeType> GEO_SCANNER_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.GEOSCANNER_TURTLE.getPath(), () -> UpgradeType.simpleWithCustomItem(TurtleGeoScannerUpgrade::new)); + public static final DeferredHolder, UpgradeType> COMPASS_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.COMPASS_TURTLE.getPath(), () -> UpgradeType.simpleWithCustomItem(TurtleCompassUpgrade::new)); + public static final DeferredHolder, UpgradeType> WEAK_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.WEAK_AUTOMATA.getPath(), () -> UpgradeType.simpleWithCustomItem(WeakAutomata::new)); + public static final DeferredHolder, UpgradeType> END_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.END_AUTOMATA.getPath(), () -> UpgradeType.simpleWithCustomItem(EndAutomata::new)); + public static final DeferredHolder, UpgradeType> HUSBANDRY_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.HUSBANDRY_AUTOMATA.getPath(), () -> UpgradeType.simpleWithCustomItem(HusbandryAutomata::new)); + public static final DeferredHolder, UpgradeType> OP_WEAK_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.OP_WEAK_AUTOMATA.getPath(), () -> UpgradeType.simpleWithCustomItem(OverpoweredWeakAutomata::new)); + public static final DeferredHolder, UpgradeType> OP_END_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.OP_END_AUTOMATA.getPath(), () -> UpgradeType.simpleWithCustomItem(OverpoweredEndAutomata::new)); + public static final DeferredHolder, UpgradeType> OP_HUSBANDRY_TURTLE = Registration.TURTLE_SERIALIZER.register(ID.OP_HUSBANDRY_AUTOMATA.getPath(), () -> UpgradeType.simpleWithCustomItem(OverpoweredHusbandryAutomata::new)); - public static final DeferredHolder, UpgradeSerialiser> CHAT_BOX_POCKET = Registration.POCKET_SERIALIZER.register(ID.CHATTY_POCKET.getPath(), () -> UpgradeSerialiser.simpleWithCustomItem(PocketChatBoxUpgrade::new)); - public static final DeferredHolder, UpgradeSerialiser> PLAYER_DETECTOR_POCKET = Registration.POCKET_SERIALIZER.register(ID.PLAYER_POCKET.getPath(), () -> UpgradeSerialiser.simpleWithCustomItem(PocketPlayerDetectorUpgrade::new)); - public static final DeferredHolder, UpgradeSerialiser> ENVIRONMENT_POCKET = Registration.POCKET_SERIALIZER.register(ID.ENVIRONMENT_POCKET.getPath(), () -> UpgradeSerialiser.simpleWithCustomItem(PocketEnvironmentUpgrade::new)); - public static final DeferredHolder, UpgradeSerialiser> GEO_SCANNER_POCKET = Registration.POCKET_SERIALIZER.register(ID.GEOSCANNER_POCKET.getPath(), () -> UpgradeSerialiser.simpleWithCustomItem(PocketGeoScannerUpgrade::new)); + public static final DeferredHolder, UpgradeType> CHAT_BOX_POCKET = Registration.POCKET_SERIALIZER.register(ID.CHATTY_POCKET.getPath(), () -> UpgradeType.simpleWithCustomItem(PocketChatBoxUpgrade::new)); + public static final DeferredHolder, UpgradeType> PLAYER_DETECTOR_POCKET = Registration.POCKET_SERIALIZER.register(ID.PLAYER_POCKET.getPath(), () -> UpgradeType.simpleWithCustomItem(PocketPlayerDetectorUpgrade::new)); + public static final DeferredHolder, UpgradeType> ENVIRONMENT_POCKET = Registration.POCKET_SERIALIZER.register(ID.ENVIRONMENT_POCKET.getPath(), () -> UpgradeType.simpleWithCustomItem(PocketEnvironmentUpgrade::new)); + public static final DeferredHolder, UpgradeType> GEO_SCANNER_POCKET = Registration.POCKET_SERIALIZER.register(ID.GEOSCANNER_POCKET.getPath(), () -> UpgradeType.simpleWithCustomItem(PocketGeoScannerUpgrade::new)); public static IntegrationPeripheralProvider integrationPeripheralProvider; @@ -54,24 +54,24 @@ public static void register() { public static class ID { - public static final ResourceLocation CHATTY_TURTLE = new ResourceLocation(AdvancedPeripherals.MOD_ID, "chatty_turtle"); - public static final ResourceLocation PLAYER_TURTLE = new ResourceLocation(AdvancedPeripherals.MOD_ID, "player_turtle"); - public static final ResourceLocation ENVIRONMENT_TURTLE = new ResourceLocation(AdvancedPeripherals.MOD_ID, "environment_turtle"); - public static final ResourceLocation CHUNKY_TURTLE = new ResourceLocation(AdvancedPeripherals.MOD_ID, "chunky_turtle"); - public static final ResourceLocation GEOSCANNER_TURTLE = new ResourceLocation(AdvancedPeripherals.MOD_ID, "geoscanner_turtle"); - public static final ResourceLocation COMPASS_TURTLE = new ResourceLocation(AdvancedPeripherals.MOD_ID, "compass_turtle"); - public static final ResourceLocation WEAK_AUTOMATA = new ResourceLocation(AdvancedPeripherals.MOD_ID, "weak_automata"); - public static final ResourceLocation END_AUTOMATA = new ResourceLocation(AdvancedPeripherals.MOD_ID, "end_automata"); - public static final ResourceLocation HUSBANDRY_AUTOMATA = new ResourceLocation(AdvancedPeripherals.MOD_ID, "husbandry_automata"); - public static final ResourceLocation OP_WEAK_AUTOMATA = new ResourceLocation(AdvancedPeripherals.MOD_ID, "overpowered_weak_automata"); - public static final ResourceLocation OP_END_AUTOMATA = new ResourceLocation(AdvancedPeripherals.MOD_ID, "overpowered_end_automata"); - public static final ResourceLocation OP_HUSBANDRY_AUTOMATA = new ResourceLocation(AdvancedPeripherals.MOD_ID, "overpowered_husbandry_automata"); + public static final ResourceLocation CHATTY_TURTLE = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "chatty_turtle"); + public static final ResourceLocation PLAYER_TURTLE = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "player_turtle"); + public static final ResourceLocation ENVIRONMENT_TURTLE = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "environment_turtle"); + public static final ResourceLocation CHUNKY_TURTLE = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "chunky_turtle"); + public static final ResourceLocation GEOSCANNER_TURTLE = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "geoscanner_turtle"); + public static final ResourceLocation COMPASS_TURTLE = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "compass_turtle"); + public static final ResourceLocation WEAK_AUTOMATA = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "weak_automata"); + public static final ResourceLocation END_AUTOMATA = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "end_automata"); + public static final ResourceLocation HUSBANDRY_AUTOMATA = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "husbandry_automata"); + public static final ResourceLocation OP_WEAK_AUTOMATA = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "overpowered_weak_automata"); + public static final ResourceLocation OP_END_AUTOMATA = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "overpowered_end_automata"); + public static final ResourceLocation OP_HUSBANDRY_AUTOMATA = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "overpowered_husbandry_automata"); - public static final ResourceLocation CHATTY_POCKET = new ResourceLocation(AdvancedPeripherals.MOD_ID, "chatty_pocket"); - public static final ResourceLocation PLAYER_POCKET = new ResourceLocation(AdvancedPeripherals.MOD_ID, "player_pocket"); - public static final ResourceLocation ENVIRONMENT_POCKET = new ResourceLocation(AdvancedPeripherals.MOD_ID, "environment_pocket"); - public static final ResourceLocation GEOSCANNER_POCKET = new ResourceLocation(AdvancedPeripherals.MOD_ID, "geoscanner_pocket"); - public static final ResourceLocation COLONY_POCKET = new ResourceLocation(AdvancedPeripherals.MOD_ID, "colony_pocket"); + public static final ResourceLocation CHATTY_POCKET = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "chatty_pocket"); + public static final ResourceLocation PLAYER_POCKET = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "player_pocket"); + public static final ResourceLocation ENVIRONMENT_POCKET = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "environment_pocket"); + public static final ResourceLocation GEOSCANNER_POCKET = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "geoscanner_pocket"); + public static final ResourceLocation COLONY_POCKET = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "colony_pocket"); } } From 65423e4e8b5454c9cd89383091872078b65930f5 Mon Sep 17 00:00:00 2001 From: Diemoell Date: Mon, 30 Dec 2024 22:31:46 +0800 Subject: [PATCH 05/57] Update 1.21 EventBusSubscriber --- .../de/srendi/advancedperipherals/common/addons/APAddons.java | 3 ++- .../advancedperipherals/common/commands/APCommands.java | 3 ++- .../advancedperipherals/common/data/DataGenerators.java | 3 ++- .../de/srendi/advancedperipherals/common/events/Events.java | 4 +++- .../srendi/advancedperipherals/common/util/ChunkManager.java | 3 ++- .../srendi/advancedperipherals/common/util/ServerWorker.java | 3 ++- .../advancedperipherals/common/village/VillageStructures.java | 4 +++- .../advancedperipherals/common/village/VillagerTrades.java | 4 +++- .../de/srendi/advancedperipherals/network/APNetworking.java | 3 ++- 9 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java b/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java index f5cde5fcc..9be3f42de 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java @@ -4,10 +4,11 @@ import de.srendi.advancedperipherals.common.addons.refinedstorage.RefinedStorage; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.ModList; +import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.fml.common.Mod; import net.neoforged.fml.event.lifecycle.InterModEnqueueEvent; -@Mod.EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) +@EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID, bus = EventBusSubscriber.Bus.MOD) public class APAddons { public static final String AE2_MODID = "ae2"; diff --git a/src/main/java/de/srendi/advancedperipherals/common/commands/APCommands.java b/src/main/java/de/srendi/advancedperipherals/common/commands/APCommands.java index 83db97245..755d42c10 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/commands/APCommands.java +++ b/src/main/java/de/srendi/advancedperipherals/common/commands/APCommands.java @@ -23,13 +23,14 @@ import net.minecraft.network.chat.HoverEvent; import net.minecraft.server.level.ServerPlayer; import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.event.RegisterCommandsEvent; import java.util.Comparator; -@Mod.EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID) +@EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID) public class APCommands { public static final String ROOT_LITERAL = "advancedperipherals"; public static final String FORCELOAD_LITERAL = "forceload"; diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java b/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java index 6999d3c71..4207e0148 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java @@ -8,13 +8,14 @@ import net.minecraft.data.PackOutput; import net.minecraft.data.registries.VanillaRegistries; import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.common.data.ExistingFileHelper; import net.neoforged.neoforge.data.event.GatherDataEvent; import java.util.concurrent.CompletableFuture; -@Mod.EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) +@EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID, bus = EventBusSubscriber.Bus.MOD) public class DataGenerators { private DataGenerators() { diff --git a/src/main/java/de/srendi/advancedperipherals/common/events/Events.java b/src/main/java/de/srendi/advancedperipherals/common/events/Events.java index 68f90cd45..3a0178bc0 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/events/Events.java +++ b/src/main/java/de/srendi/advancedperipherals/common/events/Events.java @@ -14,8 +14,10 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; +import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.EventPriority; import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.event.CommandEvent; import net.neoforged.neoforge.event.ServerChatEvent; @@ -23,7 +25,7 @@ import java.util.function.Consumer; -@Mod.EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE) +@EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID, value = Dist.CLIENT, bus = EventBusSubscriber.Bus.GAME) public class Events { private static final String PLAYED_BEFORE = "ap_played_before"; diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/ChunkManager.java b/src/main/java/de/srendi/advancedperipherals/common/util/ChunkManager.java index c199ae736..1d0b864f2 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/ChunkManager.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/ChunkManager.java @@ -10,6 +10,7 @@ import net.minecraft.world.level.ChunkPos; import net.minecraft.world.level.saveddata.SavedData; import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.common.world.chunk.RegisterTicketControllersEvent; import net.neoforged.neoforge.common.world.chunk.TicketController; @@ -25,7 +26,7 @@ import java.util.Set; import java.util.UUID; -@Mod.EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID) +@EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID) public class ChunkManager extends SavedData { private static final String DATA_NAME = AdvancedPeripherals.MOD_ID + "_ForcedChunks"; diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/ServerWorker.java b/src/main/java/de/srendi/advancedperipherals/common/util/ServerWorker.java index a39487b29..4844ae37e 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/ServerWorker.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/ServerWorker.java @@ -2,13 +2,14 @@ import de.srendi.advancedperipherals.AdvancedPeripherals; import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.event.TickEvent; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; -@Mod.EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID) +@EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID) public class ServerWorker { private static final Queue callQueue = new ConcurrentLinkedQueue<>(); diff --git a/src/main/java/de/srendi/advancedperipherals/common/village/VillageStructures.java b/src/main/java/de/srendi/advancedperipherals/common/village/VillageStructures.java index 33d7135d2..9e0f86dac 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/village/VillageStructures.java +++ b/src/main/java/de/srendi/advancedperipherals/common/village/VillageStructures.java @@ -12,14 +12,16 @@ import net.minecraft.world.level.levelgen.structure.pools.StructurePoolElement; import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool; import net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessorList; +import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.event.server.ServerAboutToStartEvent; import java.util.ArrayList; import java.util.List; -@Mod.EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE) +@EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID, value = Dist.CLIENT, bus = EventBusSubscriber.Bus.GAME) public class VillageStructures { // Adapted from Pneumaticcraft diff --git a/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrades.java b/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrades.java index 7fff06d20..079f8fe4e 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrades.java +++ b/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrades.java @@ -8,14 +8,16 @@ import de.srendi.advancedperipherals.common.setup.Items; import de.srendi.advancedperipherals.common.setup.Villagers; import de.srendi.advancedperipherals.common.util.inventory.ItemUtil; +import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.event.village.VillagerTradesEvent; import net.neoforged.neoforge.event.village.WandererTradesEvent; import static de.srendi.advancedperipherals.common.village.VillagerTrade.TradeBuilder; -@Mod.EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE) +@EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID, value = Dist.CLIENT, bus = EventBusSubscriber.Bus.GAME) public class VillagerTrades { @SubscribeEvent diff --git a/src/main/java/de/srendi/advancedperipherals/network/APNetworking.java b/src/main/java/de/srendi/advancedperipherals/network/APNetworking.java index f9479d38c..ad09a9795 100644 --- a/src/main/java/de/srendi/advancedperipherals/network/APNetworking.java +++ b/src/main/java/de/srendi/advancedperipherals/network/APNetworking.java @@ -8,13 +8,14 @@ import net.minecraft.server.level.ServerPlayer; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.ModLoadingContext; +import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.common.util.FakePlayer; import net.neoforged.neoforge.network.PacketDistributor; import net.neoforged.neoforge.network.event.RegisterPayloadHandlerEvent; import net.neoforged.neoforge.network.registration.IPayloadRegistrar; -@Mod.EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) +@EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID, bus = EventBusSubscriber.Bus.MOD) public class APNetworking { private static final String PROTOCOL_VERSION = ModLoadingContext.get().getActiveContainer().getModInfo().getVersion().toString(); From 05f9a9466d926933ab3c5cf3014ed6848dad47ff Mon Sep 17 00:00:00 2001 From: Diemoell Date: Mon, 30 Dec 2024 23:07:15 +0800 Subject: [PATCH 06/57] Update 1.21 ResourceLocation --- .../common/addons/refinedstorage/RefinedStorage.java | 2 +- .../common/addons/refinedstorage/RefinedStorageNode.java | 2 +- .../common/container/InventoryManagerScreen.java | 2 +- .../common/data/BlockStatesAndModelsProvider.java | 2 +- .../srendi/advancedperipherals/common/util/ChunkManager.java | 2 +- .../common/util/inventory/FluidFilter.java | 2 +- .../advancedperipherals/common/util/inventory/ItemFilter.java | 2 +- .../advancedperipherals/common/util/inventory/ItemUtil.java | 2 +- .../advancedperipherals/common/village/VillageStructures.java | 4 ++-- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorage.java b/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorage.java index 3889a3edf..b7f5626be 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorage.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorage.java @@ -285,7 +285,7 @@ public static List getFluids(INetwork network) { } public void initiate() { - api.getNetworkNodeRegistry().add(new ResourceLocation(AdvancedPeripherals.MOD_ID, "rs_bridge"), (tag, world, pos) -> read(tag, new RefinedStorageNode(world, pos))); + api.getNetworkNodeRegistry().add(ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "rs_bridge"), (tag, world, pos) -> read(tag, new RefinedStorageNode(world, pos))); } public IRSAPI getApi() { diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorageNode.java b/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorageNode.java index 6c19489de..5c51c924e 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorageNode.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorageNode.java @@ -23,7 +23,7 @@ public int getEnergyUsage() { @Override public ResourceLocation getId() { - return new ResourceLocation(AdvancedPeripherals.MOD_ID, "rs_bridge"); + return ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "rs_bridge"); } @NotNull diff --git a/src/main/java/de/srendi/advancedperipherals/common/container/InventoryManagerScreen.java b/src/main/java/de/srendi/advancedperipherals/common/container/InventoryManagerScreen.java index e4d88e29c..aa7432543 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/container/InventoryManagerScreen.java +++ b/src/main/java/de/srendi/advancedperipherals/common/container/InventoryManagerScreen.java @@ -24,6 +24,6 @@ public int getSizeY() { @Override public ResourceLocation getTexture() { - return new ResourceLocation(AdvancedPeripherals.MOD_ID, "textures/gui/inventory_manager_gui.png"); + return ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "textures/gui/inventory_manager_gui.png"); } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/BlockStatesAndModelsProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/BlockStatesAndModelsProvider.java index 465c1fb84..21dd01688 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/BlockStatesAndModelsProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/BlockStatesAndModelsProvider.java @@ -95,7 +95,7 @@ private BlockModelBuilder generateModel(Block block) { private ResourceLocation blockTexture(Block block, String offset) { ResourceLocation name = key(block); - return new ResourceLocation(name.getNamespace(), ModelProvider.BLOCK_FOLDER + "/" + name.getPath() + "_" + offset); + return ResourceLocation.fromNamespaceAndPath(name.getNamespace(), ModelProvider.BLOCK_FOLDER + "/" + name.getPath() + "_" + offset); } private ResourceLocation key(Block block) { diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/ChunkManager.java b/src/main/java/de/srendi/advancedperipherals/common/util/ChunkManager.java index 1d0b864f2..0f23d2a08 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/ChunkManager.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/ChunkManager.java @@ -242,7 +242,7 @@ private static Map getServerLevels() { } private static ServerLevel getServerLevel(String name) { - ResourceKey key = ResourceKey.create(Registries.DIMENSION, new ResourceLocation(name)); + ResourceKey key = ResourceKey.create(Registries.DIMENSION, ResourceLocation.parse(name)); return ServerLifecycleHooks.getCurrentServer().getLevel(key); } diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidFilter.java b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidFilter.java index 6b38034d6..e34aee6d1 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidFilter.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidFilter.java @@ -37,7 +37,7 @@ public static Pair parse(Map item) { try { String name = TableHelper.getStringField(item, "name"); if (name.startsWith("#")) { - fluidFilter.tag = TagKey.create(Registries.FLUID, new ResourceLocation(name.substring(1))); + fluidFilter.tag = TagKey.create(Registries.FLUID, ResourceLocation.parse(name.substring(1))); } else if ((fluidFilter.fluid = ItemUtil.getRegistryEntry(name, BuiltInRegistries.FLUID)) == null) { return Pair.of(null, "FLUID_NOT_FOUND"); } diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemFilter.java b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemFilter.java index 6f44b63c1..a592c4e6f 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemFilter.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemFilter.java @@ -39,7 +39,7 @@ public static Pair parse(Map item) { try { String name = TableHelper.getStringField(item, "name"); if (name.startsWith("#")) { - itemFilter.tag = TagKey.create(Registries.ITEM, new ResourceLocation(name.substring(1))); + itemFilter.tag = TagKey.create(Registries.ITEM, ResourceLocation.parse(name.substring(1))); } else if ((itemFilter.item = ItemUtil.getRegistryEntry(name, BuiltInRegistries.ITEM)) == null) { return Pair.of(null, "ITEM_NOT_FOUND"); } diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemUtil.java b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemUtil.java index 06805ce18..8a49cdc96 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemUtil.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemUtil.java @@ -33,7 +33,7 @@ private ItemUtil() { public static T getRegistryEntry(String name, Registry forgeRegistry) { ResourceLocation location; try { - location = new ResourceLocation(name); + location = ResourceLocation.parse(name); } catch (ResourceLocationException ex) { location = null; } diff --git a/src/main/java/de/srendi/advancedperipherals/common/village/VillageStructures.java b/src/main/java/de/srendi/advancedperipherals/common/village/VillageStructures.java index 9e0f86dac..854523b80 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/village/VillageStructures.java +++ b/src/main/java/de/srendi/advancedperipherals/common/village/VillageStructures.java @@ -56,13 +56,13 @@ public static void addStructures(ServerAboutToStartEvent event) { return; Holder emptyProcessor = event.getServer().registryAccess().registryOrThrow(Registries.PROCESSOR_LIST) - .getHolderOrThrow(ResourceKey.create(Registries.PROCESSOR_LIST, new ResourceLocation("minecraft:empty"))); + .getHolderOrThrow(ResourceKey.create(Registries.PROCESSOR_LIST, ResourceLocation.parse("minecraft:empty"))); Registry templatePoolRegistry = event.getServer().registryAccess().registryOrThrow(Registries.TEMPLATE_POOL); for (String biome : new String[]{"desert", "snowy", "plains", "savanna", "taiga"}) { AdvancedPeripherals.debug("Register generating scientist_" + biome + " village house"); - addPieceToPool(templatePoolRegistry, emptyProcessor, new ResourceLocation("village/" + biome + "/houses"), AdvancedPeripherals.MOD_ID + ":villages/scientist_" + biome, StructureTemplatePool.Projection.RIGID, APConfig.WORLD_CONFIG.villagerStructureWeight.get()); + addPieceToPool(templatePoolRegistry, emptyProcessor, ResourceLocation.parse("village/" + biome + "/houses"), AdvancedPeripherals.MOD_ID + ":villages/scientist_" + biome, StructureTemplatePool.Projection.RIGID, APConfig.WORLD_CONFIG.villagerStructureWeight.get()); } } } From a35acfde23545d183e9674b1a9500f465826f2e6 Mon Sep 17 00:00:00 2001 From: Diemoell Date: Tue, 31 Dec 2024 01:31:51 +0800 Subject: [PATCH 07/57] Update 1.21 ChunkManager --- .../common/util/ChunkManager.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/ChunkManager.java b/src/main/java/de/srendi/advancedperipherals/common/util/ChunkManager.java index 0f23d2a08..9db32aba2 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/ChunkManager.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/ChunkManager.java @@ -2,6 +2,7 @@ import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.configuration.APConfig; +import net.minecraft.core.HolderLookup; import net.minecraft.core.registries.Registries; import net.minecraft.nbt.CompoundTag; import net.minecraft.resources.ResourceKey; @@ -11,11 +12,10 @@ import net.minecraft.world.level.saveddata.SavedData; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; -import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.common.world.chunk.RegisterTicketControllersEvent; import net.neoforged.neoforge.common.world.chunk.TicketController; -import net.neoforged.neoforge.event.TickEvent; import net.neoforged.neoforge.event.server.ServerStartedEvent; +import net.neoforged.neoforge.event.tick.ServerTickEvent; import net.neoforged.neoforge.server.ServerLifecycleHooks; import org.apache.logging.log4j.Level; import org.jetbrains.annotations.NotNull; @@ -45,7 +45,7 @@ public ChunkManager() { return level.getDataStorage().computeIfAbsent(new SavedData.Factory<>(ChunkManager::new, ChunkManager::load, null), DATA_NAME); } - public static ChunkManager load(@NotNull CompoundTag data) { + public static ChunkManager load(@NotNull CompoundTag data, HolderLookup.Provider provider) { ChunkManager manager = new ChunkManager(); CompoundTag forcedData = data.getCompound(FORCED_CHUNKS_TAG); AdvancedPeripherals.debug("Loading chunk manager from NBT " + data, Level.WARN); @@ -66,12 +66,10 @@ public static void afterServerStarted(ServerStartedEvent event) { } @SubscribeEvent - public static void serverTick(TickEvent.ServerTickEvent event) { - if (event.phase == TickEvent.Phase.END) { + public static void serverTick(ServerTickEvent.Pre event) { + if (event.hasTime()) { tickCounter++; - // run cleanup per chunkLoadValidTime / 10 - final int checkIntervalInTick = APConfig.PERIPHERALS_CONFIG.chunkLoadValidTime.get() * 20 / 10; - if (tickCounter % checkIntervalInTick == 0) { + if (tickCounter % (APConfig.PERIPHERALS_CONFIG.chunkLoadValidTime.get() / 2) == 0) { ChunkManager.get(ServerLifecycleHooks.getCurrentServer().overworld()).cleanup(); } } @@ -222,7 +220,7 @@ public synchronized void cleanup() { } @Override - public synchronized @NotNull CompoundTag save(@NotNull CompoundTag data) { + public synchronized @NotNull CompoundTag save(@NotNull CompoundTag data, HolderLookup.@NotNull Provider registries) { AdvancedPeripherals.debug("Schedule chunk manager save, forcedChunks = " + forcedChunks.size(), Level.WARN); CompoundTag forcedChunksTag = new CompoundTag(); forcedChunks.forEach((key, value) -> forcedChunksTag.put(key.toString(), value.serialize())); From 0b53bab53e38c015e0d01a4cd41ad4e86a0ee755 Mon Sep 17 00:00:00 2001 From: Diemoell Date: Tue, 31 Dec 2024 01:44:43 +0800 Subject: [PATCH 08/57] Update 1.21 canSleepPlayer function --- .../peripheral/EnvironmentDetectorPeripheral.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/EnvironmentDetectorPeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/EnvironmentDetectorPeripheral.java index 7113c7614..b475a3014 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/EnvironmentDetectorPeripheral.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/EnvironmentDetectorPeripheral.java @@ -32,9 +32,8 @@ import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.levelgen.WorldgenRandom; import net.minecraft.world.phys.AABB; -import net.neoforged.bus.api.Event; import net.neoforged.neoforge.common.NeoForge; -import net.neoforged.neoforge.event.entity.player.SleepingTimeCheckEvent; +import net.neoforged.neoforge.event.entity.player.CanContinueSleepingEvent; import net.neoforged.neoforge.server.ServerLifecycleHooks; import org.jetbrains.annotations.NotNull; @@ -244,14 +243,13 @@ public final MethodResult canSleepPlayer(String playername) { if(!player.level().dimensionType().bedWorks()) return MethodResult.of(false, "not_allowed_in_dimension"); - SleepingTimeCheckEvent evt = new SleepingTimeCheckEvent(player, Optional.empty()); + CanContinueSleepingEvent evt = new CanContinueSleepingEvent(player, null); NeoForge.EVENT_BUS.post(evt); - Event.Result canContinueSleep = evt.getResult(); - if (canContinueSleep == Event.Result.DEFAULT) { + if (evt.mayContinueSleeping()) { return MethodResult.of(!player.level().isDay()); } else { - return MethodResult.of(canContinueSleep == Event.Result.ALLOW); + return MethodResult.of(true); } } } From 1c1a68d06ef7d7ee9cb231948e39a425461ef37f Mon Sep 17 00:00:00 2001 From: Diemoell Date: Tue, 31 Dec 2024 01:57:57 +0800 Subject: [PATCH 09/57] Update ServerWorker to 1.21 --- .../advancedperipherals/common/util/ServerWorker.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/ServerWorker.java b/src/main/java/de/srendi/advancedperipherals/common/util/ServerWorker.java index 4844ae37e..3d2ffc731 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/ServerWorker.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/ServerWorker.java @@ -3,8 +3,7 @@ import de.srendi.advancedperipherals.AdvancedPeripherals; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; -import net.neoforged.fml.common.Mod; -import net.neoforged.neoforge.event.TickEvent; +import net.neoforged.neoforge.event.tick.ServerTickEvent; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; @@ -21,8 +20,8 @@ public static void add(final Runnable call) { } @SubscribeEvent - public static void serverTick(TickEvent.ServerTickEvent event) { - if (event.phase == TickEvent.Phase.END) { + public static void serverTick(ServerTickEvent.Pre event) { + if (event.hasTime()) { while (true) { final Runnable runnable = callQueue.poll(); if (runnable == null) { From 227f6ec2b541c40a7a101704cb163a1c96536a2a Mon Sep 17 00:00:00 2001 From: Diemoell Date: Wed, 1 Jan 2025 16:29:12 +0800 Subject: [PATCH 10/57] Update 1.21 VillagerTrade --- .../common/village/VillagerTrade.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrade.java b/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrade.java index 527931701..8d575735f 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrade.java @@ -5,6 +5,7 @@ import net.minecraft.world.entity.npc.VillagerTrades; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; +import net.minecraft.world.item.trading.ItemCost; import net.minecraft.world.item.trading.MerchantOffer; import net.minecraft.world.level.ItemLike; import net.neoforged.neoforge.event.village.VillagerTradesEvent; @@ -39,16 +40,16 @@ private VillagerTrade(@NotNull Type type, int emeraldAmount, int itemAmount, int public MerchantOffer getOffer(@NotNull Entity trader, @NotNull RandomSource rand) { if (type == Type.EMERALD_FOR_ITEM) { if (itemStack != null) - return new MerchantOffer(itemStack, new ItemStack(Items.EMERALD, emeraldAmount), maxUses, xp, 1); + return new MerchantOffer(new ItemCost(itemStack.getItem()), new ItemStack(Items.EMERALD, emeraldAmount), maxUses, xp, 1); if (item != null) - return new MerchantOffer(new ItemStack(item, itemAmount), new ItemStack(Items.EMERALD, emeraldAmount), maxUses, xp, 1); + return new MerchantOffer(new ItemCost(new ItemStack(item, itemAmount).getItem()), new ItemStack(Items.EMERALD, emeraldAmount), maxUses, xp, 1); } if (type == Type.ITEM_FOR_EMERALD) { if (itemStack != null) - return new MerchantOffer(new ItemStack(Items.EMERALD, emeraldAmount), itemStack, maxUses, xp, 1); + return new MerchantOffer(new ItemCost(new ItemStack(Items.EMERALD, emeraldAmount).getItem()), itemStack, maxUses, xp, 1); if (item != null) - return new MerchantOffer(new ItemStack(Items.EMERALD, emeraldAmount), new ItemStack(item, itemAmount), maxUses, xp, 1); + return new MerchantOffer(new ItemCost(new ItemStack(Items.EMERALD, emeraldAmount).getItem()), new ItemStack(item, itemAmount), maxUses, xp, 1); } return null; } From b2ea619d44ceb4c8a143b141d579f5b2543494ca Mon Sep 17 00:00:00 2001 From: Diemoell Date: Wed, 1 Jan 2025 17:06:16 +0800 Subject: [PATCH 11/57] Update upgrade to 1.21 --- .../addons/computercraft/pocket/PocketChatBoxUpgrade.java | 7 +++++++ .../computercraft/pocket/PocketEnvironmentUpgrade.java | 7 +++++++ .../computercraft/pocket/PocketGeoScannerUpgrade.java | 7 +++++++ .../computercraft/pocket/PocketPlayerDetectorUpgrade.java | 7 +++++++ .../computercraft/turtles/TurtleChatBoxUpgrade.java | 8 ++++++++ .../addons/computercraft/turtles/TurtleChunkyUpgrade.java | 8 ++++++++ .../computercraft/turtles/TurtleCompassUpgrade.java | 7 +++++++ .../turtles/TurtleEnvironmentDetectorUpgrade.java | 8 ++++++++ .../computercraft/turtles/TurtleGeoScannerUpgrade.java | 8 ++++++++ .../turtles/TurtlePlayerDetectorUpgrade.java | 8 ++++++++ .../advancedperipherals/lib/pocket/BasePocketUpgrade.java | 2 +- .../lib/turtle/PeripheralTurtleUpgrade.java | 2 +- 12 files changed, 77 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketChatBoxUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketChatBoxUpgrade.java index e0a17833b..710074ccc 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketChatBoxUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketChatBoxUpgrade.java @@ -1,7 +1,10 @@ package de.srendi.advancedperipherals.common.addons.computercraft.pocket; import dan200.computercraft.api.pocket.IPocketAccess; +import dan200.computercraft.api.pocket.IPocketUpgrade; +import dan200.computercraft.api.upgrades.UpgradeType; import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.ChatBoxPeripheral; +import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.pocket.BasePocketUpgrade; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; @@ -19,4 +22,8 @@ public ChatBoxPeripheral getPeripheral(IPocketAccess access) { return new ChatBoxPeripheral(access); } + @Override + public UpgradeType getType() { + return CCRegistration.CHAT_BOX_POCKET.get(); + } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketEnvironmentUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketEnvironmentUpgrade.java index dc6719b17..3d7f239cb 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketEnvironmentUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketEnvironmentUpgrade.java @@ -1,7 +1,10 @@ package de.srendi.advancedperipherals.common.addons.computercraft.pocket; import dan200.computercraft.api.pocket.IPocketAccess; +import dan200.computercraft.api.pocket.IPocketUpgrade; +import dan200.computercraft.api.upgrades.UpgradeType; import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.EnvironmentDetectorPeripheral; +import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.pocket.BasePocketUpgrade; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; @@ -20,4 +23,8 @@ public EnvironmentDetectorPeripheral getPeripheral(@NotNull IPocketAccess iPocke return new EnvironmentDetectorPeripheral(iPocketAccess); } + @Override + public UpgradeType getType() { + return CCRegistration.ENVIRONMENT_POCKET.get(); + } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketGeoScannerUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketGeoScannerUpgrade.java index 98823d94a..fb73500b8 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketGeoScannerUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketGeoScannerUpgrade.java @@ -1,7 +1,10 @@ package de.srendi.advancedperipherals.common.addons.computercraft.pocket; import dan200.computercraft.api.pocket.IPocketAccess; +import dan200.computercraft.api.pocket.IPocketUpgrade; +import dan200.computercraft.api.upgrades.UpgradeType; import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.GeoScannerPeripheral; +import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.pocket.BasePocketUpgrade; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; @@ -20,4 +23,8 @@ public GeoScannerPeripheral getPeripheral(@NotNull IPocketAccess iPocketAccess) return new GeoScannerPeripheral(iPocketAccess); } + @Override + public UpgradeType getType() { + return CCRegistration.GEO_SCANNER_POCKET.get(); + } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketPlayerDetectorUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketPlayerDetectorUpgrade.java index 1e2b6bb43..f0ba68e1a 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketPlayerDetectorUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketPlayerDetectorUpgrade.java @@ -1,7 +1,10 @@ package de.srendi.advancedperipherals.common.addons.computercraft.pocket; import dan200.computercraft.api.pocket.IPocketAccess; +import dan200.computercraft.api.pocket.IPocketUpgrade; +import dan200.computercraft.api.upgrades.UpgradeType; import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.PlayerDetectorPeripheral; +import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.pocket.BasePocketUpgrade; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; @@ -20,4 +23,8 @@ public PlayerDetectorPeripheral getPeripheral(@NotNull IPocketAccess iPocketAcce return new PlayerDetectorPeripheral(iPocketAccess); } + @Override + public UpgradeType getType() { + return CCRegistration.PLAYER_DETECTOR_POCKET.get(); + } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChatBoxUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChatBoxUpgrade.java index b82aafab2..4f19c9608 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChatBoxUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChatBoxUpgrade.java @@ -1,9 +1,12 @@ package de.srendi.advancedperipherals.common.addons.computercraft.turtles; import dan200.computercraft.api.turtle.ITurtleAccess; +import dan200.computercraft.api.turtle.ITurtleUpgrade; import dan200.computercraft.api.turtle.TurtleSide; +import dan200.computercraft.api.upgrades.UpgradeType; import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.ChatBoxPeripheral; +import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.PeripheralTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.resources.ResourceLocation; @@ -30,6 +33,11 @@ protected ChatBoxPeripheral buildPeripheral(@NotNull ITurtleAccess turtle, @NotN return new ChatBoxPeripheral(turtle, side); } + @Override + public UpgradeType getType() { + return CCRegistration.CHAT_BOX_TURTLE.get(); + } + @Override public void update(@NotNull ITurtleAccess turtle, @NotNull TurtleSide side) { super.update(turtle, side); diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChunkyUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChunkyUpgrade.java index bed242638..955c7cc5e 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChunkyUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChunkyUpgrade.java @@ -2,9 +2,12 @@ import dan200.computercraft.api.peripheral.IPeripheral; import dan200.computercraft.api.turtle.ITurtleAccess; +import dan200.computercraft.api.turtle.ITurtleUpgrade; import dan200.computercraft.api.turtle.TurtleSide; +import dan200.computercraft.api.upgrades.UpgradeType; import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.ChunkyPeripheral; import de.srendi.advancedperipherals.common.configuration.APConfig; +import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.PeripheralTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.resources.ResourceLocation; @@ -33,6 +36,11 @@ protected ChunkyPeripheral buildPeripheral(@NotNull ITurtleAccess turtle, @NotNu return new ChunkyPeripheral(turtle, side); } + @Override + public UpgradeType getType() { + return CCRegistration.CHUNKY_TURTLE.get(); + } + @Override public void update(@NotNull ITurtleAccess turtle, @NotNull TurtleSide side) { // Add a chunk to the Chunk Manager every 10 ticks, if it's not already forced. diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleCompassUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleCompassUpgrade.java index d7a1482d9..a4335d1e2 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleCompassUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleCompassUpgrade.java @@ -1,8 +1,11 @@ package de.srendi.advancedperipherals.common.addons.computercraft.turtles; import dan200.computercraft.api.turtle.ITurtleAccess; +import dan200.computercraft.api.turtle.ITurtleUpgrade; import dan200.computercraft.api.turtle.TurtleSide; +import dan200.computercraft.api.upgrades.UpgradeType; import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.CompassPeripheral; +import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.PeripheralTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.resources.ResourceLocation; @@ -30,4 +33,8 @@ protected CompassPeripheral buildPeripheral(@NotNull ITurtleAccess turtle, @NotN return new CompassPeripheral(turtle, side); } + @Override + public UpgradeType getType() { + return CCRegistration.COMPASS_TURTLE.get(); + } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleEnvironmentDetectorUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleEnvironmentDetectorUpgrade.java index f30886d5c..11c5eeb90 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleEnvironmentDetectorUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleEnvironmentDetectorUpgrade.java @@ -1,9 +1,12 @@ package de.srendi.advancedperipherals.common.addons.computercraft.turtles; import dan200.computercraft.api.turtle.ITurtleAccess; +import dan200.computercraft.api.turtle.ITurtleUpgrade; import dan200.computercraft.api.turtle.TurtleSide; +import dan200.computercraft.api.upgrades.UpgradeType; import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.EnvironmentDetectorPeripheral; +import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.PeripheralTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.resources.ResourceLocation; @@ -30,4 +33,9 @@ public ModelResourceLocation getRightModel() { protected EnvironmentDetectorPeripheral buildPeripheral(@NotNull ITurtleAccess turtle, @NotNull TurtleSide side) { return new EnvironmentDetectorPeripheral(turtle, side); } + + @Override + public UpgradeType getType() { + return CCRegistration.ENVIRONMENT_TURTLE.get(); + } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleGeoScannerUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleGeoScannerUpgrade.java index f2f927f2e..2b0fb0a09 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleGeoScannerUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleGeoScannerUpgrade.java @@ -1,9 +1,12 @@ package de.srendi.advancedperipherals.common.addons.computercraft.turtles; import dan200.computercraft.api.turtle.ITurtleAccess; +import dan200.computercraft.api.turtle.ITurtleUpgrade; import dan200.computercraft.api.turtle.TurtleSide; +import dan200.computercraft.api.upgrades.UpgradeType; import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.GeoScannerPeripheral; +import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.PeripheralTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.resources.ResourceLocation; @@ -30,4 +33,9 @@ public ModelResourceLocation getRightModel() { protected GeoScannerPeripheral buildPeripheral(@NotNull ITurtleAccess turtle, @NotNull TurtleSide side) { return new GeoScannerPeripheral(turtle, side); } + + @Override + public UpgradeType getType() { + return CCRegistration.GEO_SCANNER_TURTLE.get(); + } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtlePlayerDetectorUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtlePlayerDetectorUpgrade.java index 135e19eb9..c73b0ae8c 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtlePlayerDetectorUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtlePlayerDetectorUpgrade.java @@ -1,9 +1,12 @@ package de.srendi.advancedperipherals.common.addons.computercraft.turtles; import dan200.computercraft.api.turtle.ITurtleAccess; +import dan200.computercraft.api.turtle.ITurtleUpgrade; import dan200.computercraft.api.turtle.TurtleSide; +import dan200.computercraft.api.upgrades.UpgradeType; import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.PlayerDetectorPeripheral; +import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.PeripheralTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.resources.ResourceLocation; @@ -30,4 +33,9 @@ public ModelResourceLocation getRightModel() { protected PlayerDetectorPeripheral buildPeripheral(@NotNull ITurtleAccess turtle, @NotNull TurtleSide side) { return new PlayerDetectorPeripheral(turtle, side); } + + @Override + public UpgradeType getType() { + return CCRegistration.PLAYER_DETECTOR_TURTLE.get(); + } } diff --git a/src/main/java/de/srendi/advancedperipherals/lib/pocket/BasePocketUpgrade.java b/src/main/java/de/srendi/advancedperipherals/lib/pocket/BasePocketUpgrade.java index 291a333de..8dbfa33f3 100644 --- a/src/main/java/de/srendi/advancedperipherals/lib/pocket/BasePocketUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/lib/pocket/BasePocketUpgrade.java @@ -16,7 +16,7 @@ public abstract class BasePocketUpgrade> extends Ab protected T peripheral; protected BasePocketUpgrade(ResourceLocation id, ItemStack stack) { - super(id, TranslationUtil.pocket(id.getPath()), stack); + super(TranslationUtil.pocket(id.getPath()), stack); } protected abstract T getPeripheral(IPocketAccess access); diff --git a/src/main/java/de/srendi/advancedperipherals/lib/turtle/PeripheralTurtleUpgrade.java b/src/main/java/de/srendi/advancedperipherals/lib/turtle/PeripheralTurtleUpgrade.java index cfc08b134..be5ab7de2 100644 --- a/src/main/java/de/srendi/advancedperipherals/lib/turtle/PeripheralTurtleUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/lib/turtle/PeripheralTurtleUpgrade.java @@ -19,7 +19,7 @@ public abstract class PeripheralTurtleUpgrade> exte protected int tick; protected PeripheralTurtleUpgrade(ResourceLocation id, ItemStack item) { - super(id, TurtleUpgradeType.PERIPHERAL, TranslationUtil.turtle(id.getPath()), item); + super(TurtleUpgradeType.PERIPHERAL, TranslationUtil.turtle(id.getPath()), item); } public abstract ModelResourceLocation getLeftModel(); From b2a3496d77f3cad742e7f9634dc3f410c26ab132 Mon Sep 17 00:00:00 2001 From: Diemoell Date: Thu, 2 Jan 2025 01:46:05 +0800 Subject: [PATCH 12/57] Update some provider and datagen to 1.21 --- .../common/data/DataGenerators.java | 7 ++- .../common/data/PocketUpgradesProvider.java | 41 ++++++++----- .../common/data/RecipesProvider.java | 29 +++++++-- .../common/data/TurtleUpgradesProvider.java | 60 +++++++++++-------- .../common/setup/Registration.java | 6 +- 5 files changed, 93 insertions(+), 50 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java b/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java index 4207e0148..32a3f0c10 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java @@ -26,13 +26,14 @@ public static void genData(GatherDataEvent event) { DataGenerator generator = event.getGenerator(); PackOutput packOutput = event.getGenerator().getPackOutput(); ExistingFileHelper existingFileHelper = event.getExistingFileHelper(); + CompletableFuture lookupProvider = event.getLookupProvider(); CompletableFuture completablefuture = CompletableFuture.supplyAsync(VanillaRegistries::createLookup, Util.backgroundExecutor()); generator.addProvider(event.includeServer(), new BlockTagsProvider(packOutput, completablefuture, existingFileHelper, Registration.BLOCKS)); - generator.addProvider(event.includeServer(), new RecipesProvider(packOutput)); + generator.addProvider(event.includeServer(), new RecipesProvider(packOutput, lookupProvider)); generator.addProvider(event.includeServer(), new BlockLootTablesProvider(packOutput)); - generator.addProvider(event.includeServer(), new TurtleUpgradesProvider(packOutput)); - generator.addProvider(event.includeServer(), new PocketUpgradesProvider(packOutput)); + TurtleUpgradesProvider.generate(generator.getVanillaPack(true), completablefuture); + PocketUpgradesProvider.generate(generator.getVanillaPack(true), completablefuture); generator.addProvider(event.includeServer(), new PoiTypeProvider(packOutput, completablefuture, existingFileHelper)); generator.addProvider(event.includeServer(), new BlockStatesAndModelsProvider(packOutput, existingFileHelper)); diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java index 8e01dd26c..d59287f20 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java @@ -1,25 +1,38 @@ package de.srendi.advancedperipherals.common.data; -import dan200.computercraft.api.pocket.IPocketUpgrade; -import dan200.computercraft.api.pocket.PocketUpgradeDataProvider; -import dan200.computercraft.api.upgrades.UpgradeSerialiser; +import dan200.computercraft.api.turtle.ITurtleUpgrade; +import de.srendi.advancedperipherals.AdvancedPeripherals; +import de.srendi.advancedperipherals.common.addons.computercraft.turtles.*; import de.srendi.advancedperipherals.common.setup.Blocks; import de.srendi.advancedperipherals.common.setup.CCRegistration; -import net.minecraft.data.PackOutput; +import net.minecraft.Util; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.RegistrySetBuilder; +import net.minecraft.data.DataGenerator; +import net.minecraft.data.registries.RegistryPatchGenerator; +import net.minecraft.resources.ResourceKey; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.neoforged.neoforge.common.data.DatapackBuiltinEntriesProvider; -import java.util.function.Consumer; +import java.util.Set; +import java.util.concurrent.CompletableFuture; -public class PocketUpgradesProvider extends PocketUpgradeDataProvider { +public class PocketUpgradesProvider { - public PocketUpgradesProvider(PackOutput output) { - super(output); + public static void generate(DataGenerator.PackGenerator output, CompletableFuture registries) { + var newRegistries = RegistryPatchGenerator.createLookup(registries, Util.make(new RegistrySetBuilder(), builder -> { + builder.add(ITurtleUpgrade.REGISTRY, upgrades -> { + upgrades.register(id(CCRegistration.ID.CHATTY_POCKET), new TurtleChatBoxUpgrade(CCRegistration.ID.CHATTY_POCKET, new ItemStack(Blocks.CHAT_BOX.get()))); + upgrades.register(id(CCRegistration.ID.PLAYER_POCKET), new TurtlePlayerDetectorUpgrade(CCRegistration.ID.PLAYER_POCKET, new ItemStack(Blocks.PLAYER_DETECTOR.get()))); + upgrades.register(id(CCRegistration.ID.ENVIRONMENT_POCKET), new TurtleEnvironmentDetectorUpgrade(CCRegistration.ID.ENVIRONMENT_POCKET, new ItemStack(Blocks.ENVIRONMENT_DETECTOR.get()))); + upgrades.register(id(CCRegistration.ID.GEOSCANNER_TURTLE), new TurtleGeoScannerUpgrade(CCRegistration.ID.GEOSCANNER_TURTLE, new ItemStack(Blocks.GEO_SCANNER.get()))); + }); + })); + output.addProvider(o -> new DatapackBuiltinEntriesProvider(o, newRegistries, Set.of(AdvancedPeripherals.MOD_ID))); } - @Override - protected void addUpgrades(Consumer>> consumer) { - simpleWithCustomItem(CCRegistration.ID.CHATTY_POCKET, CCRegistration.CHAT_BOX_POCKET.get(), Blocks.CHAT_BOX.get().asItem()).add(consumer); - simpleWithCustomItem(CCRegistration.ID.PLAYER_POCKET, CCRegistration.PLAYER_DETECTOR_POCKET.get(), Blocks.PLAYER_DETECTOR.get().asItem()).add(consumer); - simpleWithCustomItem(CCRegistration.ID.ENVIRONMENT_POCKET, CCRegistration.ENVIRONMENT_POCKET.get(), Blocks.ENVIRONMENT_DETECTOR.get().asItem()).add(consumer); - simpleWithCustomItem(CCRegistration.ID.GEOSCANNER_POCKET, CCRegistration.GEO_SCANNER_POCKET.get(), Blocks.GEO_SCANNER.get().asItem()).add(consumer); + public static ResourceKey id(ResourceLocation id) { + return ITurtleUpgrade.createKey(id); } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/RecipesProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/RecipesProvider.java index 8faf507c4..2679b1cfe 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/RecipesProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/RecipesProvider.java @@ -6,6 +6,8 @@ import dan200.computercraft.shared.ModRegistry; import de.srendi.advancedperipherals.common.addons.APAddons; import de.srendi.advancedperipherals.common.setup.Blocks; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.component.DataComponents; import net.minecraft.data.PackOutput; import net.minecraft.data.recipes.RecipeCategory; import net.minecraft.data.recipes.RecipeOutput; @@ -15,21 +17,22 @@ import net.minecraft.tags.ItemTags; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; -import net.minecraft.world.item.alchemy.PotionUtils; +import net.minecraft.world.item.alchemy.PotionContents; import net.minecraft.world.item.alchemy.Potions; import net.minecraft.world.level.block.Block; import net.neoforged.neoforge.common.Tags; import net.neoforged.neoforge.common.conditions.IConditionBuilder; import net.neoforged.neoforge.common.conditions.ModLoadedCondition; -import net.neoforged.neoforge.common.crafting.NBTIngredient; + +import java.util.concurrent.CompletableFuture; public class RecipesProvider extends RecipeProvider implements IConditionBuilder { private static final Block CASING = Blocks.PERIPHERAL_CASING.get(); private static final String HAS_ITEM = "has_item"; - public RecipesProvider(PackOutput pGenerator) { - super(pGenerator); + public RecipesProvider(PackOutput pGenerator, CompletableFuture lookupProvider) { + super(pGenerator, lookupProvider); } @@ -49,7 +52,7 @@ protected void buildRecipes(RecipeOutput recipeOutput) { ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, Blocks.INVENTORY_MANAGER.get()).define('I', Tags.Items.INGOTS_IRON).define('C', Tags.Items.CHESTS).define('A', CASING).pattern("ICI").pattern("CAC").pattern("ICI").unlockedBy(HAS_ITEM, has(CASING)).save(recipeOutput); - ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, de.srendi.advancedperipherals.common.setup.Items.MEMORY_CARD.get()).define('I', Tags.Items.INGOTS_IRON).define('W', Tags.Items.GLASS_WHITE).define('O', Items.OBSERVER).define('G', Tags.Items.INGOTS_GOLD).pattern("IWI").pattern("IOI").pattern(" G ").unlockedBy(HAS_ITEM, has(Items.OBSERVER)).save(recipeOutput); + ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, de.srendi.advancedperipherals.common.setup.Items.MEMORY_CARD.get()).define('I', Tags.Items.INGOTS_IRON).define('W', Tags.Items.GLASS_BLOCKS_CHEAP).define('O', Items.OBSERVER).define('G', Tags.Items.INGOTS_GOLD).pattern("IWI").pattern("IOI").pattern(" G ").unlockedBy(HAS_ITEM, has(Items.OBSERVER)).save(recipeOutput); ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, Blocks.PERIPHERAL_CASING.get()).define('I', Tags.Items.INGOTS_IRON).define('i', Items.IRON_BARS).define('R', Tags.Items.STORAGE_BLOCKS_REDSTONE).pattern("IiI").pattern("iRi").pattern("IiI").unlockedBy(HAS_ITEM, has(Items.REDSTONE_BLOCK)).save(recipeOutput); @@ -67,7 +70,21 @@ protected void buildRecipes(RecipeOutput recipeOutput) { ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, Blocks.RS_BRIDGE.get()).define('Q', RSItems.QUARTZ_ENRICHED_IRON.get()).define('A', CASING).define('I', RSBlocks.INTERFACE.get()).pattern("QIQ").pattern("IAI").pattern("QIQ").unlockedBy(HAS_ITEM, has(CASING)).save(recipeOutput.withConditions(new ModLoadedCondition(APAddons.REFINEDSTORAGE_MODID))); - ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, de.srendi.advancedperipherals.common.setup.Items.WEAK_AUTOMATA_CORE.get()).define('A', CASING).define('R', Tags.Items.STORAGE_BLOCKS_REDSTONE).define('S', Items.SOUL_LANTERN).define('D', Tags.Items.GEMS_DIAMOND).define('L', NBTIngredient.of(true, PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.LONG_REGENERATION))).pattern("RAR").pattern("DSD").pattern("RLR").unlockedBy(HAS_ITEM, has(CASING)).save(recipeOutput); + ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, de.srendi.advancedperipherals.common.setup.Items.WEAK_AUTOMATA_CORE.get()) + .define('A', CASING) + .define('R', Tags.Items.STORAGE_BLOCKS_REDSTONE) + .define('S', Items.SOUL_LANTERN) + .define('D', Tags.Items.GEMS_DIAMOND) + .define('L', () -> { + ItemStack potion = Items.POTION.getDefaultInstance(); + potion.update(DataComponents.POTION_CONTENTS, PotionContents.EMPTY, Potions.LONG_REGENERATION, PotionContents::withPotion); + return potion.getItem(); + }) + .pattern("RAR") + .pattern("DSD") + .pattern("RLR") + .unlockedBy(HAS_ITEM, has(CASING)) + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.REDSTONE, de.srendi.advancedperipherals.common.setup.Items.OVERPOWERED_WEAK_AUTOMATA_CORE.get()).requires(de.srendi.advancedperipherals.common.setup.Items.WEAK_AUTOMATA_CORE.get()).requires(Items.NETHER_STAR).unlockedBy(HAS_ITEM, has(de.srendi.advancedperipherals.common.setup.Items.WEAK_AUTOMATA_CORE.get())).save(recipeOutput); diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java index 7db008935..61d5067e6 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java @@ -1,37 +1,49 @@ package de.srendi.advancedperipherals.common.data; import dan200.computercraft.api.turtle.ITurtleUpgrade; -import dan200.computercraft.api.turtle.TurtleUpgradeDataProvider; -import dan200.computercraft.api.upgrades.UpgradeSerialiser; +import de.srendi.advancedperipherals.AdvancedPeripherals; +import de.srendi.advancedperipherals.common.addons.computercraft.turtles.*; +import de.srendi.advancedperipherals.common.addons.computercraft.turtles.metaphysics.*; import de.srendi.advancedperipherals.common.setup.Blocks; import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.common.setup.Items; -import net.minecraft.data.PackOutput; -import org.jetbrains.annotations.NotNull; +import net.minecraft.Util; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.RegistrySetBuilder; +import net.minecraft.data.DataGenerator; +import net.minecraft.data.registries.RegistryPatchGenerator; +import net.minecraft.resources.ResourceKey; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.neoforged.neoforge.common.data.DatapackBuiltinEntriesProvider; -import java.util.function.Consumer; +import java.util.Set; +import java.util.concurrent.CompletableFuture; -public class TurtleUpgradesProvider extends TurtleUpgradeDataProvider { +public class TurtleUpgradesProvider { - public TurtleUpgradesProvider(PackOutput generator) { - super(generator); + public static void generate(DataGenerator.PackGenerator output, CompletableFuture registries) { + var newRegistries = RegistryPatchGenerator.createLookup(registries, Util.make(new RegistrySetBuilder(), builder -> { + builder.add(ITurtleUpgrade.REGISTRY, upgrades -> { + upgrades.register(id(CCRegistration.ID.CHATTY_TURTLE), new TurtleChatBoxUpgrade(CCRegistration.ID.CHATTY_TURTLE, new ItemStack(Blocks.CHAT_BOX.get()))); + upgrades.register(id(CCRegistration.ID.PLAYER_TURTLE), new TurtlePlayerDetectorUpgrade(CCRegistration.ID.PLAYER_TURTLE, new ItemStack(Blocks.PLAYER_DETECTOR.get()))); + upgrades.register(id(CCRegistration.ID.ENVIRONMENT_TURTLE), new TurtleEnvironmentDetectorUpgrade(CCRegistration.ID.ENVIRONMENT_TURTLE, new ItemStack(Blocks.ENVIRONMENT_DETECTOR.get()))); + upgrades.register(id(CCRegistration.ID.CHUNKY_TURTLE), new TurtleChunkyUpgrade(CCRegistration.ID.CHUNKY_TURTLE, new ItemStack(Items.CHUNK_CONTROLLER))); + upgrades.register(id(CCRegistration.ID.GEOSCANNER_TURTLE), new TurtleGeoScannerUpgrade(CCRegistration.ID.GEOSCANNER_TURTLE, new ItemStack(Blocks.ENVIRONMENT_DETECTOR.get()))); + upgrades.register(id(CCRegistration.ID.COMPASS_TURTLE), new TurtleCompassUpgrade(CCRegistration.ID.COMPASS_TURTLE, new ItemStack(net.minecraft.world.item.Items.COMPASS))); + upgrades.register(id(CCRegistration.ID.WEAK_AUTOMATA), new WeakAutomata(CCRegistration.ID.WEAK_AUTOMATA, new ItemStack(Items.WEAK_AUTOMATA_CORE.get()))); + upgrades.register(id(CCRegistration.ID.END_AUTOMATA), new EndAutomata(CCRegistration.ID.END_AUTOMATA, new ItemStack(Items.END_AUTOMATA_CORE.get()))); + upgrades.register(id(CCRegistration.ID.HUSBANDRY_AUTOMATA), new HusbandryAutomata(CCRegistration.ID.HUSBANDRY_AUTOMATA, new ItemStack(Items.HUSBANDRY_AUTOMATA_CORE.get()))); + upgrades.register(id(CCRegistration.ID.OP_WEAK_AUTOMATA), new OverpoweredWeakAutomata(CCRegistration.ID.OP_WEAK_AUTOMATA, new ItemStack(Items.OVERPOWERED_WEAK_AUTOMATA_CORE.get()))); + upgrades.register(id(CCRegistration.ID.OP_END_AUTOMATA), new OverpoweredEndAutomata(CCRegistration.ID.OP_END_AUTOMATA, new ItemStack(Items.OVERPOWERED_END_AUTOMATA_CORE.get()))); + upgrades.register(id(CCRegistration.ID.OP_HUSBANDRY_AUTOMATA), new OverpoweredHusbandryAutomata(CCRegistration.ID.OP_HUSBANDRY_AUTOMATA, new ItemStack(Items.OVERPOWERED_HUSBANDRY_AUTOMATA_CORE.get()))); + }); + })); + output.addProvider(o -> new DatapackBuiltinEntriesProvider(o, newRegistries, Set.of(AdvancedPeripherals.MOD_ID))); } - @Override - protected void addUpgrades(@NotNull Consumer>> addUpgrade) { - simpleWithCustomItem(CCRegistration.ID.CHATTY_TURTLE, CCRegistration.CHAT_BOX_TURTLE.get(), Blocks.CHAT_BOX.get().asItem()).add(addUpgrade); - simpleWithCustomItem(CCRegistration.ID.PLAYER_TURTLE, CCRegistration.PLAYER_DETECTOR_TURTLE.get(), Blocks.PLAYER_DETECTOR.get().asItem()).add(addUpgrade); - simpleWithCustomItem(CCRegistration.ID.ENVIRONMENT_TURTLE, CCRegistration.ENVIRONMENT_TURTLE.get(), Blocks.ENVIRONMENT_DETECTOR.get().asItem()).add(addUpgrade); - simpleWithCustomItem(CCRegistration.ID.CHUNKY_TURTLE, CCRegistration.CHUNKY_TURTLE.get(), Items.CHUNK_CONTROLLER.get()).add(addUpgrade); - simpleWithCustomItem(CCRegistration.ID.GEOSCANNER_TURTLE, CCRegistration.GEO_SCANNER_TURTLE.get(), Blocks.GEO_SCANNER.get().asItem()).add(addUpgrade); - simpleWithCustomItem(CCRegistration.ID.COMPASS_TURTLE, CCRegistration.COMPASS_TURTLE.get(), net.minecraft.world.item.Items.COMPASS).add(addUpgrade); - simpleWithCustomItem(CCRegistration.ID.WEAK_AUTOMATA, CCRegistration.WEAK_TURTLE.get(), Items.WEAK_AUTOMATA_CORE.get()).add(addUpgrade); - simpleWithCustomItem(CCRegistration.ID.END_AUTOMATA, CCRegistration.END_TURTLE.get(), Items.END_AUTOMATA_CORE.get()).add(addUpgrade); - simpleWithCustomItem(CCRegistration.ID.HUSBANDRY_AUTOMATA, CCRegistration.HUSBANDRY_TURTLE.get(), Items.HUSBANDRY_AUTOMATA_CORE.get()).add(addUpgrade); - simpleWithCustomItem(CCRegistration.ID.OP_WEAK_AUTOMATA, CCRegistration.OP_WEAK_TURTLE.get(), Items.OVERPOWERED_WEAK_AUTOMATA_CORE.get()).add(addUpgrade); - simpleWithCustomItem(CCRegistration.ID.OP_END_AUTOMATA, CCRegistration.OP_END_TURTLE.get(), Items.OVERPOWERED_END_AUTOMATA_CORE.get()).add(addUpgrade); - simpleWithCustomItem(CCRegistration.ID.OP_HUSBANDRY_AUTOMATA, CCRegistration.OP_HUSBANDRY_TURTLE.get(), Items.OVERPOWERED_HUSBANDRY_AUTOMATA_CORE.get()).add(addUpgrade); - + public static ResourceKey id(ResourceLocation id) { + return ITurtleUpgrade.createKey(id); } -} +} \ No newline at end of file diff --git a/src/main/java/de/srendi/advancedperipherals/common/setup/Registration.java b/src/main/java/de/srendi/advancedperipherals/common/setup/Registration.java index 80c8e0a63..4cc942457 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/setup/Registration.java +++ b/src/main/java/de/srendi/advancedperipherals/common/setup/Registration.java @@ -2,7 +2,7 @@ import dan200.computercraft.api.pocket.IPocketUpgrade; import dan200.computercraft.api.turtle.ITurtleUpgrade; -import dan200.computercraft.api.upgrades.UpgradeSerialiser; +import dan200.computercraft.api.upgrades.UpgradeType; import de.srendi.advancedperipherals.AdvancedPeripherals; import net.minecraft.core.registries.Registries; import net.minecraft.world.entity.ai.village.poi.PoiType; @@ -21,8 +21,8 @@ public class Registration { public static final DeferredRegister> CONTAINER_TYPES = DeferredRegister.create(Registries.MENU, AdvancedPeripherals.MOD_ID); public static final DeferredRegister POI_TYPES = DeferredRegister.create(Registries.POINT_OF_INTEREST_TYPE, AdvancedPeripherals.MOD_ID); public static final DeferredRegister VILLAGER_PROFESSIONS = DeferredRegister.create(Registries.VILLAGER_PROFESSION, AdvancedPeripherals.MOD_ID); - public static final DeferredRegister> TURTLE_SERIALIZER = DeferredRegister.create(ITurtleUpgrade.serialiserRegistryKey(), AdvancedPeripherals.MOD_ID); - public static final DeferredRegister> POCKET_SERIALIZER = DeferredRegister.create(IPocketUpgrade.serialiserRegistryKey(), AdvancedPeripherals.MOD_ID); + public static final DeferredRegister> TURTLE_SERIALIZER = DeferredRegister.create(ITurtleUpgrade.typeRegistry(), AdvancedPeripherals.MOD_ID); + public static final DeferredRegister> POCKET_SERIALIZER = DeferredRegister.create(IPocketUpgrade.typeRegistry(), AdvancedPeripherals.MOD_ID); public static final DeferredRegister CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, AdvancedPeripherals.MOD_ID); public static void register(IEventBus modEventBus) { From b6f924f80d58163a43431ab8ae9ccfb7b69faf3d Mon Sep 17 00:00:00 2001 From: Diemoell <648226449@qq.com> Date: Thu, 2 Jan 2025 10:50:26 +0800 Subject: [PATCH 13/57] Replace all ResourceLocation.fromNamespaceAndPath with AdvancedPeripherals.getRL --- .../client/ClientRegistry.java | 3 +- .../addons/refinedstorage/RefinedStorage.java | 2 +- .../refinedstorage/RefinedStorageNode.java | 2 +- .../container/InventoryManagerScreen.java | 2 +- .../common/setup/CCRegistration.java | 34 +++++++++---------- 5 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/client/ClientRegistry.java b/src/main/java/de/srendi/advancedperipherals/client/ClientRegistry.java index 334496867..f13cc06b3 100644 --- a/src/main/java/de/srendi/advancedperipherals/client/ClientRegistry.java +++ b/src/main/java/de/srendi/advancedperipherals/client/ClientRegistry.java @@ -1,6 +1,7 @@ package de.srendi.advancedperipherals.client; import dan200.computercraft.api.client.turtle.RegisterTurtleModellersEvent; +import dan200.computercraft.api.client.turtle.RegisterTurtleUpgradeModeller; import dan200.computercraft.api.client.turtle.TurtleUpgradeModeller; import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.container.InventoryManagerScreen; @@ -26,7 +27,7 @@ public class ClientRegistry { @SubscribeEvent public static void registerModels(ModelEvent.RegisterAdditional event) { for (String model : TURTLE_MODELS) { - event.register(new ModelResourceLocation(ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, model), "inventory")); + event.register(new ModelResourceLocation(AdvancedPeripherals.getRL(model), "inventory")); } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorage.java b/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorage.java index b7f5626be..ba7032f83 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorage.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorage.java @@ -285,7 +285,7 @@ public static List getFluids(INetwork network) { } public void initiate() { - api.getNetworkNodeRegistry().add(ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "rs_bridge"), (tag, world, pos) -> read(tag, new RefinedStorageNode(world, pos))); + api.getNetworkNodeRegistry().add(AdvancedPeripherals.getRL("rs_bridge"), (tag, world, pos) -> read(tag, new RefinedStorageNode(world, pos))); } public IRSAPI getApi() { diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorageNode.java b/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorageNode.java index 5c51c924e..0aa16f5fb 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorageNode.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorageNode.java @@ -23,7 +23,7 @@ public int getEnergyUsage() { @Override public ResourceLocation getId() { - return ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "rs_bridge"); + return AdvancedPeripherals.getRL("rs_bridge"); } @NotNull diff --git a/src/main/java/de/srendi/advancedperipherals/common/container/InventoryManagerScreen.java b/src/main/java/de/srendi/advancedperipherals/common/container/InventoryManagerScreen.java index aa7432543..12842db5a 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/container/InventoryManagerScreen.java +++ b/src/main/java/de/srendi/advancedperipherals/common/container/InventoryManagerScreen.java @@ -24,6 +24,6 @@ public int getSizeY() { @Override public ResourceLocation getTexture() { - return ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "textures/gui/inventory_manager_gui.png"); + return AdvancedPeripherals.getRL("textures/gui/inventory_manager_gui.png"); } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/setup/CCRegistration.java b/src/main/java/de/srendi/advancedperipherals/common/setup/CCRegistration.java index 35c455514..ed9223f25 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/setup/CCRegistration.java +++ b/src/main/java/de/srendi/advancedperipherals/common/setup/CCRegistration.java @@ -54,24 +54,24 @@ public static void register() { public static class ID { - public static final ResourceLocation CHATTY_TURTLE = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "chatty_turtle"); - public static final ResourceLocation PLAYER_TURTLE = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "player_turtle"); - public static final ResourceLocation ENVIRONMENT_TURTLE = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "environment_turtle"); - public static final ResourceLocation CHUNKY_TURTLE = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "chunky_turtle"); - public static final ResourceLocation GEOSCANNER_TURTLE = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "geoscanner_turtle"); - public static final ResourceLocation COMPASS_TURTLE = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "compass_turtle"); - public static final ResourceLocation WEAK_AUTOMATA = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "weak_automata"); - public static final ResourceLocation END_AUTOMATA = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "end_automata"); - public static final ResourceLocation HUSBANDRY_AUTOMATA = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "husbandry_automata"); - public static final ResourceLocation OP_WEAK_AUTOMATA = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "overpowered_weak_automata"); - public static final ResourceLocation OP_END_AUTOMATA = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "overpowered_end_automata"); - public static final ResourceLocation OP_HUSBANDRY_AUTOMATA = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "overpowered_husbandry_automata"); + public static final ResourceLocation CHATTY_TURTLE = AdvancedPeripherals.getRL("chatty_turtle"); + public static final ResourceLocation PLAYER_TURTLE = AdvancedPeripherals.getRL("player_turtle"); + public static final ResourceLocation ENVIRONMENT_TURTLE = AdvancedPeripherals.getRL("environment_turtle"); + public static final ResourceLocation CHUNKY_TURTLE = AdvancedPeripherals.getRL("chunky_turtle"); + public static final ResourceLocation GEOSCANNER_TURTLE = AdvancedPeripherals.getRL("geoscanner_turtle"); + public static final ResourceLocation COMPASS_TURTLE = AdvancedPeripherals.getRL("compass_turtle"); + public static final ResourceLocation WEAK_AUTOMATA = AdvancedPeripherals.getRL("weak_automata"); + public static final ResourceLocation END_AUTOMATA = AdvancedPeripherals.getRL("end_automata"); + public static final ResourceLocation HUSBANDRY_AUTOMATA = AdvancedPeripherals.getRL("husbandry_automata"); + public static final ResourceLocation OP_WEAK_AUTOMATA = AdvancedPeripherals.getRL("overpowered_weak_automata"); + public static final ResourceLocation OP_END_AUTOMATA = AdvancedPeripherals.getRL("overpowered_end_automata"); + public static final ResourceLocation OP_HUSBANDRY_AUTOMATA = AdvancedPeripherals.getRL("overpowered_husbandry_automata"); - public static final ResourceLocation CHATTY_POCKET = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "chatty_pocket"); - public static final ResourceLocation PLAYER_POCKET = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "player_pocket"); - public static final ResourceLocation ENVIRONMENT_POCKET = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "environment_pocket"); - public static final ResourceLocation GEOSCANNER_POCKET = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "geoscanner_pocket"); - public static final ResourceLocation COLONY_POCKET = ResourceLocation.fromNamespaceAndPath(AdvancedPeripherals.MOD_ID, "colony_pocket"); + public static final ResourceLocation CHATTY_POCKET = AdvancedPeripherals.getRL("chatty_pocket"); + public static final ResourceLocation PLAYER_POCKET = AdvancedPeripherals.getRL("player_pocket"); + public static final ResourceLocation ENVIRONMENT_POCKET = AdvancedPeripherals.getRL("environment_pocket"); + public static final ResourceLocation GEOSCANNER_POCKET = AdvancedPeripherals.getRL("geoscanner_pocket"); + public static final ResourceLocation COLONY_POCKET = AdvancedPeripherals.getRL("colony_pocket"); } } From 0371d2f018697fa51a6d0f073f4ae05ce5a65b60 Mon Sep 17 00:00:00 2001 From: Srendi Date: Sat, 4 Jan 2025 21:36:19 +0100 Subject: [PATCH 14/57] Bump dependencies and remove mods that don't exist anymore --- build.gradle | 66 +++++-------------- gradle.properties | 37 ++++------- .../client/MetaTurtleUpgradeModeller.java | 4 +- .../common/util/fakeplayer/APFakePlayer.java | 9 +-- .../ClockwiseAnimatedTurtleUpgrade.java | 18 ++--- .../network/APNetworking.java | 21 +++--- .../resources/META-INF/accesstransformer.cfg | 6 +- .../resources/META-INF/neoforge.mods.toml | 24 ------- 8 files changed, 61 insertions(+), 124 deletions(-) diff --git a/build.gradle b/build.gradle index 6ccc767fd..76d8adc3d 100644 --- a/build.gradle +++ b/build.gradle @@ -7,10 +7,11 @@ plugins { id 'net.darkhax.curseforgegradle' version '1.1.16' id 'org.jetbrains.changelog' version '1.2.1' id "com.modrinth.minotaur" version "2.+" - id 'net.neoforged.moddev' version '1.0.21' + id 'net.neoforged.moddev' version '2.+' id "com.github.breadmoirai.github-release" version "2.5.2" id 'checkstyle' id 'java' + id 'idea' } java { @@ -65,6 +66,8 @@ neoForge { minecraftVersion = project.parchment_minecraft_version } + validateAccessTransformers = true + runs { // applies to all the run configs below configureEach { @@ -198,7 +201,6 @@ configurations { testModImplementation.extendsFrom(implementation) testModImplementation.extendsFrom(testImplementation) runtimeClasspath.extendsFrom localRuntime - } dependencies { @@ -218,61 +220,34 @@ dependencies { runtimeOnly "mekanism:Mekanism:${mekanism_version}" // Applied Energistics 2 - runtimeOnly "appeng:appliedenergistics2-neoforge:${appliedenergistics_version}" - compileOnly "appeng:appliedenergistics2-neoforge:${appliedenergistics_version}" + runtimeOnly "appeng:appliedenergistics2:${appliedenergistics_version}" + compileOnly "appeng:appliedenergistics2:${appliedenergistics_version}" // Applied Mekanistics runtimeOnly "curse.maven:applied-mekanistics-574300:${appliedmekanistics_version}" compileOnly "curse.maven:applied-mekanistics-574300:${appliedmekanistics_version}" - // Curios - runtimeOnly "top.theillusivec4.curios:curios-neoforge:${curios_version}" - compileOnly "top.theillusivec4.curios:curios-neoforge:${curios_version}:api" - - // Refined Storage - compileOnly "curse.maven:refined-storage-243076:${refinedstorage_version}" - runtimeOnly "curse.maven:refined-storage-243076:${refinedstorage_version}" - // AE2 Things - //compileOnly "curse.maven:ae2things-609977:${ae2things_version}-sources" - //runtimeOnly "curse.maven:ae2things-609977:${ae2things_version}-sources" - - // AE2 Additions - //compileOnly "curse.maven:ae-additions-493962:${ae2additions_version}" - //runtimeOnly "curse.maven:ae-additions-493962:${ae2additions_version}" - - //implementation "thedarkcolour:kotlinforforge:${kotlinforforge_version}" - - // Botania - //compileOnly "vazkii.botania:Botania:${botania_version}" - //runtimeOnly "vazkii.botania:Botania:${botania_version}" + compileOnly "curse.maven:ae2things-609977:${ae2things_version}-sources" + runtimeOnly "curse.maven:ae2things-609977:${ae2things_version}-sources" // Minecolonies // Remove/Comment this section if you want to use runData. - //runtimeOnly "com.ldtteam:minecolonies:${minecolonies_version}" - //runtimeOnly "com.ldtteam:structurize:${structurize_version}" - //runtimeOnly "com.ldtteam:domum_ornamentum:${domumornamentum_version}:universal" - //runtimeOnly "com.ldtteam:blockui:${blockui_version}" + runtimeOnly "com.ldtteam:minecolonies:${minecolonies_version}" + runtimeOnly "com.ldtteam:structurize:${structurize_version}" + runtimeOnly "com.ldtteam:domum-ornamentum:${domumornamentum_version}" + runtimeOnly "com.ldtteam:blockui:${blockui_version}" - //compileOnly "com.ldtteam:minecolonies:${minecolonies_version}" - //compileOnly "com.ldtteam:structurize:${structurize_version}" - //compileOnly "com.ldtteam:domum_ornamentum:${domumornamentum_version}:universal" - //compileOnly "com.ldtteam:blockui:${blockui_version}" + compileOnly "com.ldtteam:minecolonies:${minecolonies_version}" + compileOnly "com.ldtteam:structurize:${structurize_version}" + compileOnly "com.ldtteam:domum-ornamentum:${domumornamentum_version}" + compileOnly "com.ldtteam:blockui:${blockui_version}" //Patchouli - //runtimeOnly "vazkii.patchouli:Patchouli:${patchouli_version}-FORGE" - - // Create - //compileOnly "com.simibubi.create:create-1.20.1:${create_version}:all" - //runtimeOnly "com.simibubi.create:create-1.20.1:${create_version}:all" + runtimeOnly "vazkii.patchouli:Patchouli:${patchouli_version}-NEOFORGE" //Powah implementation "curse.maven:powah-633483:${powah_version}" - implementation "me.shedaniel.cloth:cloth-config-forge:11.1.106" - implementation "dev.architectury:architectury-forge:9.1.10" - - //Removed until fully ported - //testImplementation "site.siredvin.ttoolkit:ttoolkit-${minecraft_version}:${ttoolkit_version}" testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_version}" testImplementation "org.junit.jupiter:junit-jupiter-params:${junit_version}" @@ -285,10 +260,6 @@ dependencies { // Testing stuff // JEI implementation "mezz.jei:jei-${jei_version}" - - // Create Crafts & Additions - //compileOnly "curse.maven:createaddition-439890:${createadditions_version}" - //runtimeOnly "curse.maven:createaddition-439890:${createadditions_version}" } @@ -343,12 +314,9 @@ tasks.withType(ProcessResources).configureEach { mod_id : mod_id, version : version, cc_version : cc_version, - curios_version : curios_version, minecolonies_version : minecolonies_version, appliedenergistics_version: appliedenergistics_version, patchouli_version : patchouli_version, - refinedstorage_version : refinedstorage_version, - botania_version : botania_version, mekanism_version : mekanism_version, ae2things_version : ae2things_version, powah_version : powah_version,] diff --git a/gradle.properties b/gradle.properties index 553e1ff18..5443e7363 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,14 +5,12 @@ org.gradle.logging.level=info # Minecraft related mod_id=advancedperipherals minecraft_version=1.21.1 -neo_version=21.1.90 +neo_version=21.1.93 parchment_minecraft_version=1.21.1 -parchment_mappings_version=2024.11.13 +parchment_mappings_version=2024.11.17 loader_version=4 mod_version=0.7.43a release_type=alpha -neogradle.subsystems.parchment.minecraftVersion=1.20.4 -neogradle.subsystems.parchment.mappingsVersion=2024.04.14 jb_annotations=21.0.1 # Test dependencies @@ -23,29 +21,22 @@ kotlinx_coroutines_version=1.6.0-RC3 ttoolkit_version=0.1.3 # Mod dependencies -cc_version=1.113.1 -curios_version=7.4.3+1.20.4 -minecolonies_version=1.20.1-1.1.472-BETA -appliedenergistics_version=17.13.0-beta -patchouli_version=1.20.1-84 -refinedstorage_version=5165548 -botania_version=1.20.1-443-FORGE -create_version=0.5.1.f-27 -createca_version=5099757 -mekanism_version=1.20.4-10.5.20.41 -ae2things_version=4616683 +cc_version=1.114.2 +minecolonies_version=1.1.846-1.21.1-snapshot +appliedenergistics_version=19.1.2-beta +patchouli_version=1.21-87 +mekanism_version=1.21.1-10.7.8.70 +ae2things_version=5637783 powah_version=4638301 -ae2additions_version=5077081 -kotlinforforge_version=4.10.0 -appliedmekanistics_version=5294358 +appliedmekanistics_version=5978711 # Mod dependencies which are needed for other mods # For minecolonies -structurize_version=1.20.1-1.0.662-BETA -multipiston_version=1.20-1.2.30-ALPHA -blockui_version=1.20.1-0.0.101-ALPHA -domumornamentum_version=1.20-1.0.150-BETA +structurize_version=1.0.755-1.21.1-snapshot +multipiston_version=1.2.51-1.21.1-snapshot +blockui_version=1.0.192-1.21.1-snapshot +domumornamentum_version=1.0.204-1.21.1-snapshot # Mod dependencies for testing stuff(Only used in the dev environment) -jei_version=1.20.4-neoforge:17.3.1.5 +jei_version=1.21.1-neoforge:19.19.6.235 createadditions_version=5099752 \ No newline at end of file diff --git a/src/main/java/de/srendi/advancedperipherals/client/MetaTurtleUpgradeModeller.java b/src/main/java/de/srendi/advancedperipherals/client/MetaTurtleUpgradeModeller.java index fbf19a891..3dd235dad 100644 --- a/src/main/java/de/srendi/advancedperipherals/client/MetaTurtleUpgradeModeller.java +++ b/src/main/java/de/srendi/advancedperipherals/client/MetaTurtleUpgradeModeller.java @@ -9,7 +9,7 @@ import dan200.computercraft.api.turtle.TurtleSide; import de.srendi.advancedperipherals.common.util.DataStorageUtil; import de.srendi.advancedperipherals.lib.turtle.ClockwiseAnimatedTurtleUpgrade; -import net.minecraft.nbt.CompoundTag; +import net.minecraft.core.component.DataComponentPatch; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -17,7 +17,7 @@ public class MetaTurtleUpgradeModeller entityFilter) { - AttributeInstance reachAttribute = getAttribute(NeoForgeMod.BLOCK_REACH.value()); + AttributeInstance reachAttribute = getAttribute(Attributes.BLOCK_INTERACTION_RANGE); if (reachAttribute == null) throw new IllegalArgumentException("How did this happened?"); diff --git a/src/main/java/de/srendi/advancedperipherals/lib/turtle/ClockwiseAnimatedTurtleUpgrade.java b/src/main/java/de/srendi/advancedperipherals/lib/turtle/ClockwiseAnimatedTurtleUpgrade.java index cd04a8976..ee12b191b 100644 --- a/src/main/java/de/srendi/advancedperipherals/lib/turtle/ClockwiseAnimatedTurtleUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/lib/turtle/ClockwiseAnimatedTurtleUpgrade.java @@ -4,6 +4,7 @@ import dan200.computercraft.api.turtle.TurtleSide; import de.srendi.advancedperipherals.common.util.DataStorageUtil; import de.srendi.advancedperipherals.lib.peripherals.IBasePeripheral; +import net.minecraft.core.component.DataComponentPatch; import net.minecraft.nbt.CompoundTag; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; @@ -46,24 +47,25 @@ public void chargeConsumingCallback() { } @Override - public ItemStack getUpgradeItem(CompoundTag upgradeData) { + public ItemStack getUpgradeItem(DataComponentPatch upgradeData) { if (upgradeData.isEmpty()) return getCraftingItem(); - var baseItem = getCraftingItem().copy(); - baseItem.addTagElement(STORED_DATA_TAG, upgradeData); + ItemStack baseItem = getCraftingItem().copy(); + baseItem.applyComponents(upgradeData); return baseItem; } @Override - public CompoundTag getUpgradeData(ItemStack stack) { - var storedData = stack.getTagElement(STORED_DATA_TAG); + public DataComponentPatch getUpgradeData(ItemStack stack) { + var storedData = stack.get(STORED_DATA_TAG); if (storedData == null) - return new CompoundTag(); + return DataComponentPatch.EMPTY; return storedData; } @Override - public boolean isItemSuitable(ItemStack stack) { - if (stack.getTagElement(STORED_DATA_TAG) == null) return super.isItemSuitable(stack); + public boolean isItemSuitable(@NotNull ItemStack stack) { + if (stack.getTagElement(STORED_DATA_TAG) == null) + return super.isItemSuitable(stack); var tweakedStack = stack.copy(); tweakedStack.getOrCreateTag().remove(STORED_DATA_TAG); return super.isItemSuitable(tweakedStack); diff --git a/src/main/java/de/srendi/advancedperipherals/network/APNetworking.java b/src/main/java/de/srendi/advancedperipherals/network/APNetworking.java index ad09a9795..46e588967 100644 --- a/src/main/java/de/srendi/advancedperipherals/network/APNetworking.java +++ b/src/main/java/de/srendi/advancedperipherals/network/APNetworking.java @@ -9,37 +9,36 @@ import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.ModLoadingContext; import net.neoforged.fml.common.EventBusSubscriber; -import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.common.util.FakePlayer; import net.neoforged.neoforge.network.PacketDistributor; -import net.neoforged.neoforge.network.event.RegisterPayloadHandlerEvent; -import net.neoforged.neoforge.network.registration.IPayloadRegistrar; +import net.neoforged.neoforge.network.event.RegisterPayloadHandlersEvent; +import net.neoforged.neoforge.network.registration.PayloadRegistrar; @EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID, bus = EventBusSubscriber.Bus.MOD) public class APNetworking { private static final String PROTOCOL_VERSION = ModLoadingContext.get().getActiveContainer().getModInfo().getVersion().toString(); - public static void init(IPayloadRegistrar registrar) { - registrar.common(ToastToClientPacket.ID, ToastToClientPacket::decode, handler -> handler.client(IAPPacket::handlePacket)); - registrar.common(UsernameToCachePacket.ID, UsernameToCachePacket::decode, handler -> handler.client(IAPPacket::handlePacket)); + public static void init(PayloadRegistrar registrar) { + registrar.playToClient(ToastToClientPacket.ID, ToastToClientPacket::decode, handler -> handler); + registrar.playToClient(UsernameToCachePacket.ID, UsernameToCachePacket::decode, handler -> handler.client(IAPPacket::handlePacket)); - registrar.common(RetrieveUsernamePacket.ID, RetrieveUsernamePacket::decode, handler -> handler.server(IAPPacket::handlePacket)); + registrar.playToServer(RetrieveUsernamePacket.ID, RetrieveUsernamePacket::decode, handler -> handler.server(IAPPacket::handlePacket)); } @SubscribeEvent - public static void register(final RegisterPayloadHandlerEvent event) { - final IPayloadRegistrar registrar = event.registrar(AdvancedPeripherals.MOD_ID) + public static void register(final RegisterPayloadHandlersEvent event) { + final PayloadRegistrar registrar = event.registrar(AdvancedPeripherals.MOD_ID) .versioned(PROTOCOL_VERSION); init(registrar); } public static void sendTo(ServerPlayer player, CustomPacketPayload message) { if (!(player instanceof FakePlayer)) { - PacketDistributor.PLAYER.with(player).send(message); + PacketDistributor.sendToPlayer(player, message); } } public static void sendToServer(CustomPacketPayload message) { - PacketDistributor.SERVER.noArg().send(message); + PacketDistributor.sendToServer(message); } } diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index f1fbe1461..2b4b6c889 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -1,5 +1,5 @@ public net.minecraft.world.level.block.entity.BeaconBlockEntity primaryPower # primaryPower public net.minecraft.world.level.block.entity.BeaconBlockEntity secondaryPower # secondaryPower -public-f net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool rawTemplates # rawTemplates -public-f net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool templates # templates -public net.minecraft.world.level.block.Blocks m_50805_(Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/BlockGetter;Lnet/minecraft/core/BlockPos;)Z # never \ No newline at end of file +public net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool rawTemplates # rawTemplates +public net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool templates # templates +public-f net.minecraft.world.entity.Entity getEyeHeight(Lnet/minecraft/world/entity/Pose;)F # getEyeHeight \ No newline at end of file diff --git a/src/main/resources/META-INF/neoforge.mods.toml b/src/main/resources/META-INF/neoforge.mods.toml index dbe8df113..25ce0f826 100644 --- a/src/main/resources/META-INF/neoforge.mods.toml +++ b/src/main/resources/META-INF/neoforge.mods.toml @@ -36,12 +36,6 @@ type = "required" versionRange = "[${cc_version},)" ordering = "NONE" side = "BOTH" -[[dependencies.${ mod_id }]] -modId = "curios" -type = "optional" -versionRange = "[${curios_version},)" -ordering = "NONE" -side = "BOTH" [[dependencies.${mod_id}]] modId = "ae2" type = "optional" @@ -49,12 +43,6 @@ versionRange = "[${appliedenergistics_version},)" ordering = "NONE" side = "BOTH" [[dependencies.${ mod_id }]] -modId = "refinedstorage" -type = "optional" -versionRange = "[1.13.0-beta4,)" -ordnering = "NONE" -side = "BOTH" -[[dependencies.${ mod_id }]] modId = "minecolonies" type = "optional" versionRange = "[${minecolonies_version},)" @@ -67,18 +55,6 @@ versionRange = "[${patchouli_version},)" ordering = "NONE" side = "BOTH" [[dependencies.${ mod_id }]] -modId = "create" -type = "optional" -versionRange = "[0.5.1,)" -ordering = "NONE" -side = "BOTH" -[[dependencies.${ mod_id }]] -modId = "botania" -type = "optional" -versionRange = "[${botania_version},)" -ordering = "NONE" -side = "BOTH" -[[dependencies.${ mod_id }]] modId = "mekanism" type = "optional" versionRange = "[${mekanism_version},)" From e3e4554c4d3bf88d11d3a4f4bb52f997c8a4c163 Mon Sep 17 00:00:00 2001 From: Srendi Date: Sat, 11 Jan 2025 18:40:32 +0100 Subject: [PATCH 15/57] Begone RS Bridge Fixed accesstransformers --- .../common/addons/APAddons.java | 7 +- .../addons/appliedenergistics/AppEngApi.java | 2 +- .../peripheral/RsBridgePeripheral.java | 390 ------------------ .../addons/refinedstorage/RefinedStorage.java | 295 ------------- .../refinedstorage/RefinedStorageNode.java | 34 -- .../addons/refinedstorage/RsFluidHandler.java | 35 -- .../addons/refinedstorage/RsItemHandler.java | 42 -- .../blocks/blockentities/RsBridgeEntity.java | 72 ---- .../common/data/RecipesProvider.java | 4 - .../common/setup/BlockEntityTypes.java | 2 - .../common/util/LuaConverter.java | 8 +- .../network/toclient/ToastToClientPacket.java | 2 +- .../toclient/UsernameToCachePacket.java | 9 + .../toserver/RetrieveUsernamePacket.java | 9 + .../resources/META-INF/accesstransformer.cfg | 4 +- 15 files changed, 29 insertions(+), 886 deletions(-) delete mode 100644 src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/RsBridgePeripheral.java delete mode 100644 src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorage.java delete mode 100644 src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorageNode.java delete mode 100644 src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RsFluidHandler.java delete mode 100644 src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RsItemHandler.java delete mode 100644 src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/RsBridgeEntity.java diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java b/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java index 9be3f42de..0ea6ce53b 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java @@ -1,7 +1,6 @@ package de.srendi.advancedperipherals.common.addons; import de.srendi.advancedperipherals.AdvancedPeripherals; -import de.srendi.advancedperipherals.common.addons.refinedstorage.RefinedStorage; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.ModList; import net.neoforged.fml.common.EventBusSubscriber; @@ -13,7 +12,7 @@ public class APAddons { public static final String AE2_MODID = "ae2"; public static final String CURIOS_MODID = "curios"; - public static final String REFINEDSTORAGE_MODID = "refinedstorage"; + public static final String REFINEDSTORAGETWO_MODID = "refinedstorage2"; public static final String APP_MEKANISTICS_MODID = "appmek"; public static final String PATCHOULI_MODID = "patchouli"; @@ -30,12 +29,10 @@ public static void commonSetup() { ModList modList = ModList.get(); ae2Loaded = modList.isLoaded(AE2_MODID); curiosLoaded = modList.isLoaded(CURIOS_MODID); - refinedStorageLoaded = modList.isLoaded(REFINEDSTORAGE_MODID); + refinedStorageLoaded = modList.isLoaded(REFINEDSTORAGETWO_MODID); appMekLoaded = modList.isLoaded(APP_MEKANISTICS_MODID); patchouliLoaded = modList.isLoaded(PATCHOULI_MODID); - if (refinedStorageLoaded) - RefinedStorage.instance = new RefinedStorage(); } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java b/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java index a115dc287..6190f6a9c 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java @@ -421,7 +421,7 @@ public static long getUsedItemStorage(IGridNode node) { int bytesPerType = cell.getBytesPerType(null); if (cell.getKeyType().getClass().isAssignableFrom(AEKeyType.items().getClass())) { - if (stack.getTag() == null) + if (stack.get() == null) continue; int numOfType = stack.getTag().getLongArray("amts").length; long numItemsInCell = stack.getTag().getLong("ic"); diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/RsBridgePeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/RsBridgePeripheral.java deleted file mode 100644 index d5afa7248..000000000 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/RsBridgePeripheral.java +++ /dev/null @@ -1,390 +0,0 @@ -package de.srendi.advancedperipherals.common.addons.computercraft.peripheral; - -import com.refinedmods.refinedstorage.api.autocrafting.task.CalculationResultType; -import com.refinedmods.refinedstorage.api.autocrafting.task.ICalculationResult; -import com.refinedmods.refinedstorage.api.autocrafting.task.ICraftingTask; -import com.refinedmods.refinedstorage.api.network.INetwork; -import dan200.computercraft.api.lua.IArguments; -import dan200.computercraft.api.lua.LuaException; -import dan200.computercraft.api.lua.LuaFunction; -import dan200.computercraft.api.lua.MethodResult; -import dan200.computercraft.api.peripheral.IComputerAccess; -import de.srendi.advancedperipherals.AdvancedPeripherals; -import de.srendi.advancedperipherals.common.addons.computercraft.owner.BlockEntityPeripheralOwner; -import de.srendi.advancedperipherals.common.addons.refinedstorage.RefinedStorage; -import de.srendi.advancedperipherals.common.addons.refinedstorage.RefinedStorageNode; -import de.srendi.advancedperipherals.common.addons.refinedstorage.RsFluidHandler; -import de.srendi.advancedperipherals.common.addons.refinedstorage.RsItemHandler; -import de.srendi.advancedperipherals.common.blocks.blockentities.RsBridgeEntity; -import de.srendi.advancedperipherals.common.configuration.APConfig; -import de.srendi.advancedperipherals.common.util.Pair; -import de.srendi.advancedperipherals.common.util.inventory.FluidFilter; -import de.srendi.advancedperipherals.common.util.inventory.FluidUtil; -import de.srendi.advancedperipherals.common.util.inventory.InventoryUtil; -import de.srendi.advancedperipherals.common.util.inventory.ItemFilter; -import de.srendi.advancedperipherals.common.util.inventory.ItemUtil; -import de.srendi.advancedperipherals.lib.peripherals.BasePeripheral; -import net.minecraft.world.item.ItemStack; -import net.neoforged.neoforge.fluids.FluidStack; -import net.neoforged.neoforge.fluids.capability.IFluidHandler; -import net.neoforged.neoforge.items.IItemHandler; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.ArrayList; -import java.util.List; - -public class RsBridgePeripheral extends BasePeripheral> { - - public static final String PERIPHERAL_TYPE = "rsBridge"; - - public RsBridgePeripheral(RsBridgeEntity tileEntity) { - super(PERIPHERAL_TYPE, new BlockEntityPeripheralOwner<>(tileEntity)); - } - - private RefinedStorageNode getNode() { - return owner.tileEntity.getNode(); - } - - private INetwork getNetwork() { - return getNode().getNetwork(); - } - - private MethodResult notConnected() { - return MethodResult.of(null, "NOT_CONNECTED"); - } - - @Override - public boolean isEnabled() { - return APConfig.PERIPHERALS_CONFIG.enableRSBridge.get(); - } - - @LuaFunction(mainThread = true) - public final boolean isConnected() { - return getNetwork() != null; - } - - @LuaFunction(mainThread = true) - public final MethodResult listItems() { - if (!isConnected()) - return notConnected(); - - return MethodResult.of(RefinedStorage.listItems(getNetwork())); - } - - @LuaFunction(mainThread = true) - public final MethodResult listCraftableItems() { - if (!isConnected()) - return notConnected(); - - List items = new ArrayList<>(); - RefinedStorage.getCraftableItems(getNetwork()).forEach(item -> items.add(RefinedStorage.getObjectFromStack(item, getNetwork()))); - return MethodResult.of(items); - } - - @LuaFunction(mainThread = true) - public final Object listCraftableFluids() { - if (!isConnected()) - return notConnected(); - - List fluids = new ArrayList<>(); - RefinedStorage.getCraftableFluids(getNetwork()).forEach(fluid -> fluids.add(RefinedStorage.getObjectFromFluid(fluid, getNetwork()))); - return MethodResult.of(fluids); - } - - @LuaFunction(mainThread = true) - public final MethodResult getMaxItemDiskStorage() { - if (!isConnected()) - return notConnected(); - - return MethodResult.of(RefinedStorage.getMaxItemDiskStorage(getNetwork())); - } - - @LuaFunction(mainThread = true) - public final MethodResult getMaxFluidDiskStorage() { - if (!isConnected()) - return notConnected(); - - return MethodResult.of(RefinedStorage.getMaxFluidDiskStorage(getNetwork())); - } - - @LuaFunction(mainThread = true) - public final MethodResult getMaxItemExternalStorage() { - if (!isConnected()) - return notConnected(); - - return MethodResult.of(RefinedStorage.getMaxItemExternalStorage(getNetwork())); - } - - @LuaFunction(mainThread = true) - public final MethodResult getMaxFluidExternalStorage() { - if (!isConnected()) - return notConnected(); - - return MethodResult.of(RefinedStorage.getMaxFluidExternalStorage(getNetwork())); - } - - @LuaFunction(mainThread = true) - public final MethodResult listFluids() { - if (!isConnected()) - return notConnected(); - - return MethodResult.of(RefinedStorage.listFluids(getNetwork())); - } - - @LuaFunction(mainThread = true) - public final MethodResult getEnergyUsage() { - if (!isConnected()) - return notConnected(); - - return MethodResult.of(getNetwork().getEnergyUsage()); - } - - @LuaFunction(mainThread = true) - public final MethodResult getMaxEnergyStorage() { - if (!isConnected()) - return notConnected(); - - return MethodResult.of(getNetwork().getEnergyStorage().getMaxEnergyStored()); - } - - @LuaFunction(mainThread = true) - public final MethodResult getEnergyStorage() { - if (!isConnected()) - return notConnected(); - - return MethodResult.of(getNetwork().getEnergyStorage().getEnergyStored()); - } - - @LuaFunction(mainThread = true) - public final MethodResult getPattern(IArguments arguments) throws LuaException { - if (!isConnected()) - return notConnected(); - - Pair filter = ItemFilter.parse(arguments.getTable(0)); - if (filter.rightPresent()) - return MethodResult.of(false, filter.getRight()); - - ItemFilter parsedFilter = filter.getLeft(); - if (parsedFilter.isEmpty()) - return MethodResult.of(false, "EMPTY_FILTER"); - - ItemStack patternItem = RefinedStorage.findStackFromFilter(getNetwork(), getNetwork().getCraftingManager(), parsedFilter); - - return MethodResult.of(RefinedStorage.getObjectFromPattern(getNetwork().getCraftingManager().getPattern(patternItem), getNetwork())); - } - - protected MethodResult exportToChest(@NotNull IArguments arguments, @Nullable IItemHandler targetInventory) throws LuaException { - RsItemHandler itemHandler = new RsItemHandler(getNetwork()); - if (targetInventory == null) - return MethodResult.of(0, "INVALID_TARGET"); - - Pair filter = ItemFilter.parse(arguments.getTable(0)); - if (filter.rightPresent()) - return MethodResult.of(0, filter.getRight()); - - return MethodResult.of(InventoryUtil.moveItem(itemHandler, targetInventory, filter.getLeft()), null); - } - - protected MethodResult importToSystem(@NotNull IArguments arguments, @Nullable IItemHandler targetInventory) throws LuaException { - RsItemHandler itemHandler = new RsItemHandler(getNetwork()); - if (targetInventory == null) - return MethodResult.of(0, "INVALID_TARGET"); - - Pair filter = ItemFilter.parse(arguments.getTable(0)); - if (filter.rightPresent()) - return MethodResult.of(0, filter.getRight()); - - return MethodResult.of(InventoryUtil.moveItem(targetInventory, itemHandler, filter.getLeft()), null); - } - - protected MethodResult exportToTank(@NotNull IArguments arguments, @Nullable IFluidHandler targetInventory) throws LuaException { - RsFluidHandler itemHandler = new RsFluidHandler(getNetwork()); - if (targetInventory == null) - return MethodResult.of(0, "INVALID_TARGET"); - - Pair filter = FluidFilter.parse(arguments.getTable(0)); - if (filter.rightPresent()) - return MethodResult.of(0, filter.getRight()); - - return MethodResult.of(InventoryUtil.moveFluid(itemHandler, targetInventory, filter.getLeft()), null); - } - - protected MethodResult importToSystem(@NotNull IArguments arguments, @Nullable IFluidHandler targetInventory) throws LuaException { - RsFluidHandler itemHandler = new RsFluidHandler(getNetwork()); - if (targetInventory == null) - return MethodResult.of(0, "INVALID_TARGET"); - - Pair filter = FluidFilter.parse(arguments.getTable(0)); - if (filter.rightPresent()) - return MethodResult.of(0, filter.getRight()); - - return MethodResult.of(InventoryUtil.moveFluid(targetInventory, itemHandler, filter.getLeft()), null); - } - - @LuaFunction(mainThread = true) - public final MethodResult exportItem(@NotNull IArguments arguments) throws LuaException { - if (!isConnected()) - return notConnected(); - - IItemHandler inventory = InventoryUtil.getHandlerFromDirection(arguments.getString(1), owner); - return exportToChest(arguments, inventory); - } - - @LuaFunction(mainThread = true) - public final MethodResult exportItemToPeripheral(IComputerAccess computer, IArguments arguments) throws LuaException { - if (!isConnected()) - return notConnected(); - - IItemHandler inventory = InventoryUtil.getHandlerFromName(computer, arguments.getString(1)); - return exportToChest(arguments, inventory); - } - - @LuaFunction(mainThread = true) - public final MethodResult importItem(IArguments arguments) throws LuaException { - if (!isConnected()) - return notConnected(); - - IItemHandler inventory = InventoryUtil.getHandlerFromDirection(arguments.getString(1), owner); - return importToSystem(arguments, inventory); - } - - @LuaFunction(mainThread = true) - public final MethodResult importItemFromPeripheral(IComputerAccess computer, IArguments arguments) throws LuaException { - if (!isConnected()) - return notConnected(); - - IItemHandler inventory = InventoryUtil.getHandlerFromName(computer, arguments.getString(1)); - return importToSystem(arguments, inventory); - } - - @LuaFunction(mainThread = true) - public final MethodResult exportFluid(@NotNull IArguments arguments) throws LuaException { - if (!isConnected()) - return notConnected(); - - IFluidHandler inventory = FluidUtil.getHandlerFromDirection(arguments.getString(1), owner); - return exportToTank(arguments, inventory); - } - - @LuaFunction(mainThread = true) - public final MethodResult exportFluidToPeripheral(IComputerAccess computer, IArguments arguments) throws LuaException { - if (!isConnected()) - return notConnected(); - - IFluidHandler inventory = FluidUtil.getHandlerFromName(computer, arguments.getString(1)); - return exportToTank(arguments, inventory); - } - - @LuaFunction(mainThread = true) - public final MethodResult importFluid(IArguments arguments) throws LuaException { - if (!isConnected()) - return notConnected(); - - IFluidHandler inventory = FluidUtil.getHandlerFromDirection(arguments.getString(1), owner); - return importToSystem(arguments, inventory); - } - - @LuaFunction(mainThread = true) - public final MethodResult importFluidFromPeripheral(IComputerAccess computer, IArguments arguments) throws LuaException { - if (!isConnected()) - return notConnected(); - - IFluidHandler inventory = FluidUtil.getHandlerFromName(computer, arguments.getString(1)); - return importToSystem(arguments, inventory); - } - - @LuaFunction(mainThread = true) - public final MethodResult getItem(IArguments arguments) throws LuaException { - if (!isConnected()) - return notConnected(); - - Pair filter = ItemFilter.parse(arguments.getTable(0)); - if (filter.rightPresent()) - return MethodResult.of(null, filter.getRight()); - - ItemStack item = RefinedStorage.findStackFromFilter(getNetwork(), getNetwork().getCraftingManager(), filter.getLeft()); - if (item.isEmpty()) - return MethodResult.of(null, "NOT_FOUND"); - return MethodResult.of(RefinedStorage.getObjectFromStack(item, getNetwork())); - } - - @LuaFunction(mainThread = true) - public final MethodResult craftItem(IArguments arguments) throws LuaException { - if (!isConnected()) - return notConnected(); - - - Pair filter = ItemFilter.parse(arguments.getTable(0)); - if (filter.rightPresent()) - return MethodResult.of(null, filter.getRight()); - - ItemStack stack = RefinedStorage.findStackFromFilter(getNetwork(), getNetwork().getCraftingManager(), filter.getLeft()); - if (stack.isEmpty()) - return MethodResult.of(null, "NOT_CRAFTABLE"); - - ICalculationResult result = getNetwork().getCraftingManager().create(stack, filter.getLeft().getCount()); - CalculationResultType type = result.getType(); - if (type == CalculationResultType.OK) - getNetwork().getCraftingManager().start(result.getTask()); - AdvancedPeripherals.debug("Crafting Result of '" + ItemUtil.getRegistryKey(stack).toString() + "':" + type); - return MethodResult.of(type == CalculationResultType.OK); - } - - @LuaFunction(mainThread = true) - public final MethodResult craftFluid(IArguments arguments) throws LuaException { - if (!isConnected()) - return notConnected(); - - Pair filter = FluidFilter.parse(arguments.getTable(0)); - if (filter.rightPresent()) - return MethodResult.of(null, filter.getRight()); - - FluidStack stack = RefinedStorage.findFluidFromFilter(getNetwork(), getNetwork().getCraftingManager(), filter.getLeft()); - if (stack.isEmpty()) - return MethodResult.of(null, "NOT_CRAFTABLE"); - - ICalculationResult result = getNetwork().getCraftingManager().create(stack, filter.getLeft().getCount()); - getNetwork().getCraftingManager().getPatterns(); - CalculationResultType type = result.getType(); - if (type == CalculationResultType.OK) - getNetwork().getCraftingManager().start(result.getTask()); - AdvancedPeripherals.debug("Crafting Result of '" + FluidUtil.getRegistryKey(stack).toString() + "':" + type); - return MethodResult.of(type == CalculationResultType.OK); - } - - @LuaFunction(mainThread = true) - public final MethodResult isItemCrafting(IArguments arguments) throws LuaException { - if (!isConnected()) - return notConnected(); - Pair filter = ItemFilter.parse(arguments.getTable(0)); - if (filter.rightPresent()) - return MethodResult.of(null, filter.getRight()); - - ItemStack stack = RefinedStorage.findStackFromFilter(getNetwork(), getNetwork().getCraftingManager(), filter.getLeft()); - if (stack.isEmpty()) - return MethodResult.of(null, "NOT_CRAFTABLE"); - - for (ICraftingTask task : getNetwork().getCraftingManager().getTasks()) { - ItemStack taskStack = task.getRequested().getItem(); - if (taskStack != null && taskStack.is(stack.getItem())) - return MethodResult.of(true); - } - return MethodResult.of(false); - } - - @LuaFunction(mainThread = true) - public final MethodResult isItemCraftable(IArguments arguments) throws LuaException { - if (!isConnected()) - return notConnected(); - - Pair filter = ItemFilter.parse(arguments.getTable(0)); - if (filter.rightPresent()) - return MethodResult.of(false, filter.getRight()); - - ItemFilter parsedFilter = filter.getLeft(); - if (parsedFilter.isEmpty()) - return MethodResult.of(false, "EMPTY_FILTER"); - return MethodResult.of(RefinedStorage.isItemCraftable(getNetwork(), parsedFilter.toItemStack())); - } -} diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorage.java b/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorage.java deleted file mode 100644 index ba7032f83..000000000 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorage.java +++ /dev/null @@ -1,295 +0,0 @@ -package de.srendi.advancedperipherals.common.addons.refinedstorage; - -import com.refinedmods.refinedstorage.api.IRSAPI; -import com.refinedmods.refinedstorage.api.autocrafting.ICraftingManager; -import com.refinedmods.refinedstorage.api.autocrafting.ICraftingPattern; -import com.refinedmods.refinedstorage.api.network.INetwork; -import com.refinedmods.refinedstorage.api.network.node.INetworkNode; -import com.refinedmods.refinedstorage.api.storage.IStorage; -import com.refinedmods.refinedstorage.api.storage.cache.IStorageCache; -import com.refinedmods.refinedstorage.api.storage.disk.IStorageDisk; -import com.refinedmods.refinedstorage.api.storage.externalstorage.IExternalStorage; -import com.refinedmods.refinedstorage.api.util.StackListEntry; -import com.refinedmods.refinedstorage.apiimpl.API; -import com.refinedmods.refinedstorage.apiimpl.network.node.NetworkNode; -import dan200.computercraft.shared.util.NBTUtil; -import de.srendi.advancedperipherals.AdvancedPeripherals; -import de.srendi.advancedperipherals.common.util.LuaConverter; -import de.srendi.advancedperipherals.common.util.inventory.FluidFilter; -import de.srendi.advancedperipherals.common.util.inventory.ItemFilter; -import de.srendi.advancedperipherals.common.util.inventory.ItemUtil; -import net.minecraft.core.NonNullList; -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.tags.TagKey; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.material.Fluid; -import net.neoforged.neoforge.fluids.FluidStack; -import org.jetbrains.annotations.Nullable; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Supplier; -import java.util.stream.Stream; - -public class RefinedStorage { - - public static RefinedStorage instance; - - private final IRSAPI api; - - public RefinedStorage() { - api = API.instance(); - initiate(); - } - - private static INetworkNode read(CompoundTag tag, NetworkNode node) { - node.read(tag); - return node; - } - - public static ItemStack findStackFromStack(INetwork network, @Nullable ICraftingManager crafting, ItemStack item) { - return findStackFromFilter(network, crafting, ItemFilter.fromStack(item)); - } - - public static ItemStack findStackFromFilter(INetwork network, @Nullable ICraftingManager crafting, ItemFilter filter) { - for (StackListEntry temp : network.getItemStorageCache().getList().getStacks()) { - if (filter.test(temp.getStack())) - return temp.getStack().copy(); - } - - if (crafting == null) - return ItemStack.EMPTY; - - for (ICraftingPattern pattern : crafting.getPatterns()) { - for(ItemStack stack : pattern.getOutputs()) { - if (filter.test(stack)) - return stack.copy(); - } - } - - return ItemStack.EMPTY; - } - - public static FluidStack findFluidFromStack(INetwork network, @Nullable ICraftingManager crafting, FluidStack stack) { - return findFluidFromFilter(network, crafting, FluidFilter.fromStack(stack)); - } - - public static FluidStack findFluidFromFilter(INetwork network, @Nullable ICraftingManager crafting, FluidFilter filter) { - for (StackListEntry temp : network.getFluidStorageCache().getList().getStacks()) { - if (filter.test(temp.getStack())) - return temp.getStack().copy(); - } - - if (crafting == null) - return FluidStack.EMPTY; - - for (ICraftingPattern pattern : crafting.getPatterns()) { - if (pattern.getFluidOutputs().stream().anyMatch(filter::test)) - return pattern.getFluidOutputs().stream().filter(filter::test).findFirst().orElse(FluidStack.EMPTY).copy(); - } - - return FluidStack.EMPTY; - } - - public static Object listFluids(INetwork network) { - List fluids = new ArrayList<>(); - getFluids(network).forEach(item -> fluids.add(getObjectFromFluid(item, network))); - return fluids; - } - - public static Object listItems(INetwork network) { - List items = new ArrayList<>(); - getItems(network).forEach(item -> items.add(getObjectFromStack(item, network))); - return items; - } - - public static boolean isItemCraftable(INetwork network, ItemStack stack) { - return network.getCraftingManager().getPattern(stack) != null; - } - - public static boolean isFluidCraftable(INetwork network, FluidStack stack) { - return network.getCraftingManager().getPattern(stack) != null; - } - - public static long getMaxItemDiskStorage(INetwork network) { - long total = 0; - boolean creative = false; - for (IStorage store : network.getItemStorageCache().getStorages()) { - if (store instanceof IStorageDisk storageDisk) { - int cap = storageDisk.getCapacity(); - if (cap > 0) total += cap; - else creative = true; - } - } - return creative ? -1 : total; - } - - public static long getMaxFluidDiskStorage(INetwork network) { - long total = 0; - boolean creative = false; - for (IStorage store : network.getFluidStorageCache().getStorages()) { - if (store instanceof IStorageDisk storageDisk) { - int cap = storageDisk.getCapacity(); - if (cap > 0) total += cap; - else creative = true; - } - } - return creative ? -1 : total; - } - - public static long getMaxItemExternalStorage(INetwork network) { - long total = 0; - for (IStorage store : network.getItemStorageCache().getStorages()) { - if (store instanceof IExternalStorage externalStorage) { - total += externalStorage.getCapacity(); - } - } - return total; - } - - public static long getMaxFluidExternalStorage(INetwork network) { - long total = 0; - for (IStorage store : network.getFluidStorageCache().getStorages()) { - if (store instanceof IExternalStorage externalStorage) { - total += externalStorage.getCapacity(); - } - } - return total; - } - - public static Object getObjectFromPattern(ICraftingPattern pattern, INetwork network) { - if (pattern == null) return null; - Map map = new HashMap<>(); - List outputsList = pattern.getOutputs(); - List outputs = new ArrayList<>(); - for (ItemStack itemStack : outputsList) - outputs.add(getObjectFromStack(itemStack, network)); - - map.put("outputs", outputs); - - List> inputList = pattern.getInputs(); - List inputs = new ArrayList<>(); - for (List singleInputList : inputList) { - List inputs1 = new ArrayList<>(); - for (ItemStack stack : singleInputList) - inputs1.add(getObjectFromStack(stack, network)); - inputs.add(inputs1); - } - - List byproducts = new ArrayList<>(); - if (!pattern.isProcessing()) { - List byproductsList = pattern.getByproducts(); - for (ItemStack stack : byproductsList) - byproducts.add(getObjectFromStack(stack, network)); - } - - map.put("inputs", inputs); - map.put("outputs", outputs); - map.put("byproducts", byproducts); - map.put("processing", pattern.isProcessing()); - return map; - } - - public static Map getObjectFromStack(@Nullable ItemStack itemStack, INetwork network) { - if (itemStack == null) - return Collections.emptyMap(); - - Map map = new HashMap<>(); - CompoundTag nbt = itemStack.getTag(); - Supplier>> tags = () -> itemStack.getItem().builtInRegistryHolder().tags(); - map.put("fingerprint", ItemUtil.getFingerprint(itemStack)); - map.put("name", ItemUtil.getRegistryKey(itemStack.getItem()).toString()); - map.put("amount", itemStack.getCount()); - map.put("displayName", itemStack.getDisplayName().getString()); - map.put("isCraftable", isItemCraftable(network, itemStack)); - map.put("nbt", nbt == null ? null : NBTUtil.toLua(nbt)); - map.put("tags", tags.get().findAny().isEmpty() ? null : LuaConverter.tagsToList(tags)); - - return map; - } - - public static Map getObjectFromFluid(@Nullable FluidStack fluidStack, INetwork network) { - if (fluidStack == null) - return Collections.emptyMap(); - - Map map = new HashMap<>(); - Supplier>> tags = () -> fluidStack.getFluid().builtInRegistryHolder().tags(); - map.put("name", BuiltInRegistries.FLUID.getKey(fluidStack.getFluid()).toString()); - map.put("amount", fluidStack.getAmount()); - map.put("displayName", fluidStack.getDisplayName().getString()); - map.put("isCraftable", isFluidCraftable(network, fluidStack)); - map.put("tags", tags.get().findAny().isEmpty() ? null : LuaConverter.tagsToList(tags)); - - return map; - } - - public static Object getItem(INetwork network, ItemStack item) { - for (ItemStack itemStack : getItems(network)) { - if (itemStack.is(item.getItem()) && Objects.equals(itemStack.getTag(), item.getTag())) - return getObjectFromStack(itemStack, network); - } - return null; - } - - public static List getCraftableItems(INetwork network) { - IStorageCache cache = network.getItemStorageCache(); - Collection> craftableEntries = cache.getCraftablesList().getStacks(); - List result = new ArrayList<>(craftableEntries.size()); - - for (StackListEntry entry : craftableEntries) { - result.add(entry.getStack().copy()); - } - - return result; - } - - public static List getCraftableFluids(INetwork network) { - IStorageCache cache = network.getFluidStorageCache(); - Collection> craftableEntries = cache.getCraftablesList().getStacks(); - List result = new ArrayList<>(craftableEntries.size()); - - for (StackListEntry entry : craftableEntries) - result.add(entry.getStack().copy()); - - return result; - } - - public static List getItems(INetwork network) { - IStorageCache cache = network.getItemStorageCache(); - Collection> entries = cache.getList().getStacks(); - List result = new ArrayList<>(entries.size()); - - for (StackListEntry entry : entries) - result.add(entry.getStack().copy()); - - return result; - } - - public static List getFluids(INetwork network) { - IStorageCache cache = network.getFluidStorageCache(); - Collection> entries = cache.getList().getStacks(); - List result = new ArrayList<>(entries.size()); - - for (StackListEntry entry : entries) - result.add(entry.getStack().copy()); - - return result; - } - - public void initiate() { - api.getNetworkNodeRegistry().add(AdvancedPeripherals.getRL("rs_bridge"), (tag, world, pos) -> read(tag, new RefinedStorageNode(world, pos))); - } - - public IRSAPI getApi() { - return api; - } - -} diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorageNode.java b/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorageNode.java deleted file mode 100644 index 0aa16f5fb..000000000 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorageNode.java +++ /dev/null @@ -1,34 +0,0 @@ -package de.srendi.advancedperipherals.common.addons.refinedstorage; - - -import com.refinedmods.refinedstorage.apiimpl.network.node.NetworkNode; -import de.srendi.advancedperipherals.AdvancedPeripherals; -import de.srendi.advancedperipherals.common.configuration.APConfig; -import net.minecraft.core.BlockPos; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import org.jetbrains.annotations.NotNull; - -public class RefinedStorageNode extends NetworkNode { - - public RefinedStorageNode(Level level, BlockPos pos) { - super(level, pos); - } - - @Override - public int getEnergyUsage() { - return APConfig.PERIPHERALS_CONFIG.rsConsumption.get(); - } - - @Override - public ResourceLocation getId() { - return AdvancedPeripherals.getRL("rs_bridge"); - } - - @NotNull - @Override - public ItemStack getItemStack() { - return super.getItemStack(); - } -} diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RsFluidHandler.java b/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RsFluidHandler.java deleted file mode 100644 index b099b9f6a..000000000 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RsFluidHandler.java +++ /dev/null @@ -1,35 +0,0 @@ -package de.srendi.advancedperipherals.common.addons.refinedstorage; - -import com.refinedmods.refinedstorage.api.network.INetwork; -import com.refinedmods.refinedstorage.api.util.Action; -import com.refinedmods.refinedstorage.api.util.IComparer; -import de.srendi.advancedperipherals.common.util.inventory.FluidFilter; -import de.srendi.advancedperipherals.common.util.inventory.IStorageSystemFluidHandler; -import net.neoforged.neoforge.fluids.FluidStack; -import org.jetbrains.annotations.NotNull; - -public class RsFluidHandler implements IStorageSystemFluidHandler { - - @NotNull - private final INetwork network; - - public RsFluidHandler(@NotNull INetwork network) { - this.network = network; - } - - @Override - public int fill(FluidStack resource, FluidAction action) { - if(resource.isEmpty()) - return 0; - return resource.getAmount() - network.insertFluid(resource, resource.getAmount(), action == FluidAction.SIMULATE ? Action.SIMULATE : Action.PERFORM).getAmount(); - } - - @NotNull - @Override - public FluidStack drain(FluidFilter filter, FluidAction simulate) { - FluidStack fluid = RefinedStorage.findFluidFromFilter(network, null, filter); - if(fluid == null) - return FluidStack.EMPTY; - return network.extractFluid(fluid, filter.getCount(), IComparer.COMPARE_QUANTITY, simulate == FluidAction.SIMULATE ? Action.SIMULATE : Action.PERFORM); - } -} diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RsItemHandler.java b/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RsItemHandler.java deleted file mode 100644 index a95035903..000000000 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RsItemHandler.java +++ /dev/null @@ -1,42 +0,0 @@ -package de.srendi.advancedperipherals.common.addons.refinedstorage; - -import com.refinedmods.refinedstorage.api.network.INetwork; -import com.refinedmods.refinedstorage.api.util.Action; -import com.refinedmods.refinedstorage.api.util.IComparer; -import de.srendi.advancedperipherals.AdvancedPeripherals; -import de.srendi.advancedperipherals.common.util.inventory.IStorageSystemItemHandler; -import de.srendi.advancedperipherals.common.util.inventory.ItemFilter; -import net.minecraft.world.item.ItemStack; -import org.jetbrains.annotations.NotNull; - -/** - * Used to transfer item between an inventory and the RS system. - * @see de.srendi.advancedperipherals.common.addons.computercraft.peripheral.RsBridgePeripheral - */ -public class RsItemHandler implements IStorageSystemItemHandler { - - @NotNull - private final INetwork network; - - public RsItemHandler(@NotNull INetwork network) { - this.network = network; - } - - @NotNull - @Override - public ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate) { - return network.insertItem(stack, stack.getCount(), simulate ? Action.SIMULATE : Action.PERFORM); - } - - @Override - public ItemStack extractItem(ItemFilter filter, int count, boolean simulate) { - ItemStack item = RefinedStorage.findStackFromFilter(network, network.getCraftingManager(), filter); - AdvancedPeripherals.debug("Trying to extract item: " + item + " from filter: " + filter); - if(item == null) - return ItemStack.EMPTY; - ItemStack extracted = network.extractItem(item, count, IComparer.COMPARE_NBT, simulate ? Action.SIMULATE : Action.PERFORM); - AdvancedPeripherals.debug("Extracted item: " + extracted + " from filter: " + filter); - return extracted; - } - -} diff --git a/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/RsBridgeEntity.java b/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/RsBridgeEntity.java deleted file mode 100644 index c0733ce7f..000000000 --- a/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/RsBridgeEntity.java +++ /dev/null @@ -1,72 +0,0 @@ -package de.srendi.advancedperipherals.common.blocks.blockentities; - -import com.refinedmods.refinedstorage.api.network.node.INetworkNodeProxy; -import com.refinedmods.refinedstorage.blockentity.NetworkNodeBlockEntity; -import com.refinedmods.refinedstorage.blockentity.config.IRedstoneConfigurable; -import com.refinedmods.refinedstorage.blockentity.data.BlockEntitySynchronizationSpec; -import dan200.computercraft.api.peripheral.IPeripheral; -import de.srendi.advancedperipherals.AdvancedPeripherals; -import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.RsBridgePeripheral; -import de.srendi.advancedperipherals.common.addons.refinedstorage.RefinedStorageNode; -import de.srendi.advancedperipherals.common.blocks.base.ICapabilityProvider; -import de.srendi.advancedperipherals.common.setup.BlockEntityTypes; -import de.srendi.advancedperipherals.lib.peripherals.IPeripheralTileEntity; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.state.BlockState; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public class RsBridgeEntity extends NetworkNodeBlockEntity implements INetworkNodeProxy, IRedstoneConfigurable, IPeripheralTileEntity, ICapabilityProvider { - - private static final String PERIPHERAL_SETTINGS = "AP_SETTINGS"; - //I have no clue what this does, but it works - private static final BlockEntitySynchronizationSpec SPEC = BlockEntitySynchronizationSpec.builder().build(); - protected CompoundTag peripheralSettings; - protected RsBridgePeripheral peripheral = new RsBridgePeripheral(this); - - public RsBridgeEntity(BlockPos pos, BlockState state) { - super(BlockEntityTypes.RS_BRIDGE.get(), pos, state, SPEC, null); - peripheralSettings = new CompoundTag(); - } - - @Nullable - @Override - public IPeripheral createPeripheralCap(@Nullable Direction side) { - if (peripheral.isEnabled()) { - return peripheral; - } else { - AdvancedPeripherals.debug(peripheral.getType() + " is disabled, you can enable it in the Configuration."); - return null; - } - } - - public RefinedStorageNode createNode(Level level, BlockPos blockPos) { - return new RefinedStorageNode(level, blockPos); - } - - @Override - public void saveAdditional(@NotNull CompoundTag compound) { - super.saveAdditional(compound); - if (!peripheralSettings.isEmpty()) compound.put(PERIPHERAL_SETTINGS, peripheralSettings); - } - - @Override - public void load(@NotNull CompoundTag compound) { - peripheralSettings = compound.getCompound(PERIPHERAL_SETTINGS); - super.load(compound); - } - - @Override - public CompoundTag getPeripheralSettings() { - return peripheralSettings; - } - - @Override - public void markSettingsChanged() { - setChanged(); - } - -} diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/RecipesProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/RecipesProvider.java index 2679b1cfe..0ce6f1ad9 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/RecipesProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/RecipesProvider.java @@ -1,8 +1,6 @@ package de.srendi.advancedperipherals.common.data; import appeng.core.definitions.AEBlocks; -import com.refinedmods.refinedstorage.RSBlocks; -import com.refinedmods.refinedstorage.RSItems; import dan200.computercraft.shared.ModRegistry; import de.srendi.advancedperipherals.common.addons.APAddons; import de.srendi.advancedperipherals.common.setup.Blocks; @@ -68,8 +66,6 @@ protected void buildRecipes(RecipeOutput recipeOutput) { ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, Blocks.ME_BRIDGE.get()).define('F', AEBlocks.FLUIX_BLOCK.asItem()).define('A', CASING).define('I', AEBlocks.INTERFACE.asItem()).pattern("FIF").pattern("IAI").pattern("FIF").unlockedBy(HAS_ITEM, has(CASING)).save(recipeOutput.withConditions(new ModLoadedCondition(APAddons.AE2_MODID))); - ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, Blocks.RS_BRIDGE.get()).define('Q', RSItems.QUARTZ_ENRICHED_IRON.get()).define('A', CASING).define('I', RSBlocks.INTERFACE.get()).pattern("QIQ").pattern("IAI").pattern("QIQ").unlockedBy(HAS_ITEM, has(CASING)).save(recipeOutput.withConditions(new ModLoadedCondition(APAddons.REFINEDSTORAGE_MODID))); - ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, de.srendi.advancedperipherals.common.setup.Items.WEAK_AUTOMATA_CORE.get()) .define('A', CASING) .define('R', Tags.Items.STORAGE_BLOCKS_REDSTONE) diff --git a/src/main/java/de/srendi/advancedperipherals/common/setup/BlockEntityTypes.java b/src/main/java/de/srendi/advancedperipherals/common/setup/BlockEntityTypes.java index f1a5827e5..67a2fba5d 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/setup/BlockEntityTypes.java +++ b/src/main/java/de/srendi/advancedperipherals/common/setup/BlockEntityTypes.java @@ -12,7 +12,6 @@ import de.srendi.advancedperipherals.common.blocks.blockentities.NBTStorageEntity; import de.srendi.advancedperipherals.common.blocks.blockentities.PlayerDetectorEntity; import de.srendi.advancedperipherals.common.blocks.blockentities.RedstoneIntegratorEntity; -import de.srendi.advancedperipherals.common.blocks.blockentities.RsBridgeEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.neoforged.neoforge.registries.DeferredHolder; @@ -22,7 +21,6 @@ public class BlockEntityTypes { public static final DeferredHolder, BlockEntityType> ENVIRONMENT_DETECTOR = Registration.BLOCK_ENTITIES.register("environment_detector", () -> new BlockEntityType<>(EnvironmentDetectorEntity::new, Sets.newHashSet(Blocks.ENVIRONMENT_DETECTOR.get()), null)); public static final DeferredHolder, BlockEntityType> PLAYER_DETECTOR = Registration.BLOCK_ENTITIES.register("player_detector", () -> new BlockEntityType<>(PlayerDetectorEntity::new, Sets.newHashSet(Blocks.PLAYER_DETECTOR.get()), null)); public static final DeferredHolder, BlockEntityType> ME_BRIDGE = APAddons.ae2Loaded ? Registration.BLOCK_ENTITIES.register("me_bridge", () -> new BlockEntityType<>(MeBridgeEntity::new, Sets.newHashSet(Blocks.ME_BRIDGE.get()), null)) : null; - public static final DeferredHolder, BlockEntityType> RS_BRIDGE = APAddons.refinedStorageLoaded ? Registration.BLOCK_ENTITIES.register("rs_bridge", () -> new BlockEntityType<>(RsBridgeEntity::new, Sets.newHashSet(Blocks.RS_BRIDGE.get()), null)) : null; public static final DeferredHolder, BlockEntityType> ENERGY_DETECTOR = Registration.BLOCK_ENTITIES.register("energy_detector", () -> new BlockEntityType<>(EnergyDetectorEntity::new, Sets.newHashSet(Blocks.ENERGY_DETECTOR.get()), null)); public static final DeferredHolder, BlockEntityType> INVENTORY_MANAGER = Registration.BLOCK_ENTITIES.register("inventory_manager", () -> new BlockEntityType<>(InventoryManagerEntity::new, Sets.newHashSet(Blocks.INVENTORY_MANAGER.get()), null)); public static final DeferredHolder, BlockEntityType> REDSTONE_INTEGRATOR = Registration.BLOCK_ENTITIES.register("redstone_integrator", () -> new BlockEntityType<>(RedstoneIntegratorEntity::new, Sets.newHashSet(Blocks.REDSTONE_INTEGRATOR.get()), null)); diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java b/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java index 4bad04579..c1adb7fec 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java @@ -5,6 +5,8 @@ import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.InventoryManagerPeripheral; import de.srendi.advancedperipherals.common.util.inventory.ItemUtil; import net.minecraft.core.BlockPos; +import net.minecraft.core.component.DataComponentMap; +import net.minecraft.core.component.DataComponents; import net.minecraft.nbt.CompoundTag; import net.minecraft.tags.TagKey; import net.minecraft.util.StringRepresentable; @@ -52,7 +54,7 @@ public static Map animalToLua(Animal animal, ItemStack itemInHan data.put("inLove", animal.isInLove()); data.put("aggressive", animal.isAggressive()); if (animal instanceof IShearable shareable && !itemInHand.isEmpty()) { - data.put("shareable", shareable.isShearable(itemInHand, animal.level(), animal.blockPosition())); + data.put("shareable", shareable.isShearable(null, itemInHand, animal.level(), animal.blockPosition())); } return data; } @@ -103,11 +105,11 @@ public static Object posToObject(BlockPos pos) { public static Map stackToObject(@NotNull ItemStack stack) { if (stack.isEmpty()) return new HashMap<>(); Map map = itemToObject(stack.getItem()); - CompoundTag nbt = stack.copy().getOrCreateTag(); + DataComponentMap components = stack.copy().getComponents(); map.put("count", stack.getCount()); map.put("displayName", stack.getDisplayName().getString()); map.put("maxStackSize", stack.getMaxStackSize()); - map.put("nbt", NBTUtil.toLua(nbt)); + map.put("nbt", NBTUtil.toLua(components.)); map.put("fingerprint", ItemUtil.getFingerprint(stack)); return map; } diff --git a/src/main/java/de/srendi/advancedperipherals/network/toclient/ToastToClientPacket.java b/src/main/java/de/srendi/advancedperipherals/network/toclient/ToastToClientPacket.java index 2fd684528..01b025ac4 100644 --- a/src/main/java/de/srendi/advancedperipherals/network/toclient/ToastToClientPacket.java +++ b/src/main/java/de/srendi/advancedperipherals/network/toclient/ToastToClientPacket.java @@ -23,7 +23,7 @@ public ToastToClientPacket(Component title, Component component) { } public static ToastToClientPacket decode(FriendlyByteBuf buffer) { - return new ToastToClientPacket(buffer.readComponent(), buffer.readComponent()); + return new ToastToClientPacket(buffer.read(), buffer.readComponent()); } @Override diff --git a/src/main/java/de/srendi/advancedperipherals/network/toclient/UsernameToCachePacket.java b/src/main/java/de/srendi/advancedperipherals/network/toclient/UsernameToCachePacket.java index 81aa27e23..f08476332 100644 --- a/src/main/java/de/srendi/advancedperipherals/network/toclient/UsernameToCachePacket.java +++ b/src/main/java/de/srendi/advancedperipherals/network/toclient/UsernameToCachePacket.java @@ -4,6 +4,7 @@ import de.srendi.advancedperipherals.client.ClientUUIDCache; import de.srendi.advancedperipherals.network.IAPPacket; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; import net.minecraft.resources.ResourceLocation; import net.neoforged.neoforge.network.handling.IPayloadContext; import org.jetbrains.annotations.NotNull; @@ -42,4 +43,12 @@ public void write(FriendlyByteBuf buffer) { public ResourceLocation id() { return ID; } + + /** + * @return + */ + @Override + public Type type() { + return null; + } } diff --git a/src/main/java/de/srendi/advancedperipherals/network/toserver/RetrieveUsernamePacket.java b/src/main/java/de/srendi/advancedperipherals/network/toserver/RetrieveUsernamePacket.java index 63200bc1e..125ea8030 100644 --- a/src/main/java/de/srendi/advancedperipherals/network/toserver/RetrieveUsernamePacket.java +++ b/src/main/java/de/srendi/advancedperipherals/network/toserver/RetrieveUsernamePacket.java @@ -6,6 +6,7 @@ import de.srendi.advancedperipherals.network.IAPPacket; import de.srendi.advancedperipherals.network.toclient.UsernameToCachePacket; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerPlayer; import net.neoforged.neoforge.network.handling.IPayloadContext; @@ -57,4 +58,12 @@ public void write(FriendlyByteBuf buffer) { public ResourceLocation id() { return ID; } + + /** + * @return + */ + @Override + public Type type() { + return null; + } } diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index 2b4b6c889..12aa70070 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -1,5 +1,5 @@ public net.minecraft.world.level.block.entity.BeaconBlockEntity primaryPower # primaryPower public net.minecraft.world.level.block.entity.BeaconBlockEntity secondaryPower # secondaryPower -public net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool rawTemplates # rawTemplates -public net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool templates # templates +public-f net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool rawTemplates # rawTemplates +public-f net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool templates # templates public-f net.minecraft.world.entity.Entity getEyeHeight(Lnet/minecraft/world/entity/Pose;)F # getEyeHeight \ No newline at end of file From ea5dde9cb09b32e1f46daa92ce0867691e24774d Mon Sep 17 00:00:00 2001 From: Srendi Date: Sun, 12 Jan 2025 05:34:55 +0100 Subject: [PATCH 16/57] Further porting, mostly Data Component work. The stuff that needs the most data component love is now our operation ability system where different operations have different data components that we need to register --- build.gradle | 1 + .../advancedperipherals/APCreativeTab.java | 61 ++++++++------- .../addons/appliedenergistics/AppEngApi.java | 24 +++--- .../appliedenergistics/MeItemHandler.java | 2 +- .../integrations/BeaconIntegration.java | 8 +- .../owner/BlockEntityPeripheralOwner.java | 5 +- .../computercraft/owner/FuelAbility.java | 14 ++-- .../computercraft/owner/IPeripheralOwner.java | 6 +- .../computercraft/owner/OperationAbility.java | 7 +- .../owner/PocketPeripheralOwner.java | 8 +- .../owner/TurtlePeripheralOwner.java | 11 ++- .../peripheral/BlockReaderPeripheral.java | 3 +- .../peripheral/ChatBoxPeripheral.java | 12 +-- .../peripheral/ChunkyPeripheral.java | 15 ++-- .../pocket/PocketChatBoxUpgrade.java | 4 +- .../pocket/PocketEnvironmentUpgrade.java | 4 +- .../pocket/PocketGeoScannerUpgrade.java | 4 +- .../pocket/PocketPlayerDetectorUpgrade.java | 4 +- .../turtles/TurtleChatBoxUpgrade.java | 4 +- .../turtles/TurtleChunkyUpgrade.java | 4 +- .../turtles/TurtleCompassUpgrade.java | 4 +- .../TurtleEnvironmentDetectorUpgrade.java | 4 +- .../turtles/TurtleGeoScannerUpgrade.java | 4 +- .../turtles/TurtlePlayerDetectorUpgrade.java | 4 +- .../turtles/metaphysics/EndAutomata.java | 12 ++- .../metaphysics/HusbandryAutomata.java | 12 ++- .../metaphysics/OverpoweredEndAutomata.java | 12 ++- .../OverpoweredHusbandryAutomata.java | 12 ++- .../metaphysics/OverpoweredWeakAutomata.java | 12 ++- .../turtles/metaphysics/WeakAutomata.java | 12 ++- .../common/blocks/PlayerDetectorBlock.java | 6 +- .../blocks/base/BaseBlockEntityBlock.java | 15 ++-- .../blocks/base/PeripheralBlockEntity.java | 30 +++++--- .../base/PoweredPeripheralBlockEntity.java | 9 ++- .../blockentities/EnergyDetectorEntity.java | 19 ++--- .../blockentities/InventoryManagerEntity.java | 21 +++--- .../blockentities/NBTStorageEntity.java | 9 ++- .../RedstoneIntegratorEntity.java | 9 ++- .../common/commands/APCommands.java | 3 +- .../common/data/BlockLootTables.java | 7 +- .../common/data/BlockLootTablesProvider.java | 12 ++- .../data/BlockStatesAndModelsProvider.java | 1 - .../common/data/DataGenerators.java | 2 +- .../common/data/EnUsLanguageProvider.java | 2 - .../common/data/PocketUpgradesProvider.java | 8 +- .../common/data/TurtleUpgradesProvider.java | 24 +++--- .../common/events/Events.java | 8 +- .../common/items/MemoryCardItem.java | 21 +++--- .../common/items/WeakAutomataCore.java | 15 ++-- .../common/items/base/BaseBlockItem.java | 4 +- .../common/items/base/BaseItem.java | 8 +- .../common/setup/Blocks.java | 1 - .../common/setup/DataComponents.java | 75 +++++++++++++++++++ .../common/setup/Registration.java | 2 + .../common/util/DataStorageUtil.java | 39 +++++++--- .../common/util/LuaConverter.java | 2 +- .../fakeplayer/FakePlayerProviderTurtle.java | 15 +++- .../common/util/inventory/FluidFilter.java | 11 +-- .../common/util/inventory/FluidUtil.java | 2 +- .../common/util/inventory/ItemFilter.java | 11 +-- .../common/util/inventory/ItemUtil.java | 30 ++------ .../common/village/VillagerTrades.java | 4 +- .../ClockwiseAnimatedTurtleUpgrade.java | 8 +- .../network/APNetworking.java | 9 +-- .../network/toclient/ToastToClientPacket.java | 14 +++- .../toclient/UsernameToCachePacket.java | 7 +- .../toserver/RetrieveUsernamePacket.java | 7 +- .../resources/META-INF/accesstransformer.cfg | 2 + 68 files changed, 476 insertions(+), 285 deletions(-) create mode 100644 src/main/java/de/srendi/advancedperipherals/common/setup/DataComponents.java diff --git a/build.gradle b/build.gradle index 76d8adc3d..76dcc2a62 100644 --- a/build.gradle +++ b/build.gradle @@ -245,6 +245,7 @@ dependencies { //Patchouli runtimeOnly "vazkii.patchouli:Patchouli:${patchouli_version}-NEOFORGE" + compileOnly "vazkii.patchouli:Patchouli:${patchouli_version}-NEOFORGE" //Powah implementation "curse.maven:powah-633483:${powah_version}" diff --git a/src/main/java/de/srendi/advancedperipherals/APCreativeTab.java b/src/main/java/de/srendi/advancedperipherals/APCreativeTab.java index 7b923bc7a..95fc97c4b 100644 --- a/src/main/java/de/srendi/advancedperipherals/APCreativeTab.java +++ b/src/main/java/de/srendi/advancedperipherals/APCreativeTab.java @@ -1,55 +1,66 @@ package de.srendi.advancedperipherals; +import dan200.computercraft.api.pocket.IPocketUpgrade; +import dan200.computercraft.api.turtle.ITurtleUpgrade; +import dan200.computercraft.api.upgrades.UpgradeBase; +import dan200.computercraft.api.upgrades.UpgradeData; +import dan200.computercraft.api.upgrades.UpgradeType; +import dan200.computercraft.shared.ModRegistry; +import dan200.computercraft.shared.pocket.items.PocketComputerItem; +import dan200.computercraft.shared.turtle.items.TurtleItem; +import dan200.computercraft.shared.util.DataComponentUtil; import de.srendi.advancedperipherals.common.setup.Blocks; import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.common.setup.Registration; import de.srendi.advancedperipherals.common.util.inventory.ItemUtil; +import net.minecraft.core.Holder; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.component.DataComponentType; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.ItemLike; import net.neoforged.neoforge.registries.DeferredHolder; import java.util.Collection; +import java.util.Objects; import java.util.Set; +import java.util.stream.Stream; public class APCreativeTab { public static void populateCreativeTabBuilder(CreativeModeTab.Builder builder) { builder.displayItems((set, out) -> { Registration.ITEMS.getEntries().stream().map(DeferredHolder::get).forEach(out::accept); - out.acceptAll(pocketUpgrade(CCRegistration.ID.COLONY_POCKET)); - out.acceptAll(pocketUpgrade(CCRegistration.ID.CHATTY_POCKET)); - out.acceptAll(pocketUpgrade(CCRegistration.ID.PLAYER_POCKET)); - out.acceptAll(pocketUpgrade(CCRegistration.ID.ENVIRONMENT_POCKET)); - out.acceptAll(pocketUpgrade(CCRegistration.ID.GEOSCANNER_POCKET)); - - out.acceptAll(turtleUpgrade(CCRegistration.ID.CHATTY_TURTLE)); - out.acceptAll(turtleUpgrade(CCRegistration.ID.CHUNKY_TURTLE)); - out.acceptAll(turtleUpgrade(CCRegistration.ID.COMPASS_TURTLE)); - out.acceptAll(turtleUpgrade(CCRegistration.ID.PLAYER_TURTLE)); - out.acceptAll(turtleUpgrade(CCRegistration.ID.ENVIRONMENT_TURTLE)); - out.acceptAll(turtleUpgrade(CCRegistration.ID.GEOSCANNER_TURTLE)); - - out.acceptAll(turtleUpgrade(CCRegistration.ID.WEAK_AUTOMATA)); - out.acceptAll(turtleUpgrade(CCRegistration.ID.OP_WEAK_AUTOMATA)); - out.acceptAll(turtleUpgrade(CCRegistration.ID.HUSBANDRY_AUTOMATA)); - out.acceptAll(turtleUpgrade(CCRegistration.ID.OP_HUSBANDRY_AUTOMATA)); - out.acceptAll(turtleUpgrade(CCRegistration.ID.END_AUTOMATA)); - out.acceptAll(turtleUpgrade(CCRegistration.ID.OP_END_AUTOMATA)); + + addTurtle(out, ModRegistry.Items.TURTLE_NORMAL.get(), set.holders()); + addTurtle(out, ModRegistry.Items.TURTLE_ADVANCED.get(), set.holders()); + addPocket(out, ModRegistry.Items.POCKET_COMPUTER_NORMAL.get(), set.holders()); + addPocket(out, ModRegistry.Items.POCKET_COMPUTER_ADVANCED.get(), set.holders()); }); builder.icon(() -> new ItemStack(Blocks.CHAT_BOX.get())); builder.title(Component.translatable("advancedperipherals.name")); } - private static Collection pocketUpgrade(ResourceLocation pocketId) { - return Set.of(ItemUtil.makePocket(ItemUtil.POCKET_NORMAL, pocketId.toString()), - ItemUtil.makePocket(ItemUtil.POCKET_ADVANCED, pocketId.toString())); + // Friendly stolen from CC:Tweaked ModRegistry.class + private static boolean isOurUpgrade(Holder.Reference upgrade) { + String namespace = upgrade.key().location().getNamespace(); + return namespace.equals(AdvancedPeripherals.MOD_ID); + } + + private static void addTurtle(CreativeModeTab.Output out, TurtleItem turtle, HolderLookup.Provider registries) { + out.accept(new ItemStack(turtle)); + Stream filteredItemStacks = registries.lookupOrThrow(ITurtleUpgrade.REGISTRY).listElements().filter(APCreativeTab::isOurUpgrade).map((x) -> DataComponentUtil.createStack(turtle, ModRegistry.DataComponents.RIGHT_TURTLE_UPGRADE.get(), UpgradeData.ofDefault(x))); + Objects.requireNonNull(out); + filteredItemStacks.forEach(out::accept); } - private static Collection turtleUpgrade(ResourceLocation pocketId) { - return Set.of(ItemUtil.makeTurtle(ItemUtil.TURTLE_NORMAL, pocketId.toString()), - ItemUtil.makeTurtle(ItemUtil.TURTLE_ADVANCED, pocketId.toString())); + private static void addPocket(CreativeModeTab.Output out, PocketComputerItem pocket, HolderLookup.Provider registries) { + out.accept(new ItemStack(pocket)); + Stream filteredItemStacks = registries.lookupOrThrow(IPocketUpgrade.REGISTRY).listElements().filter(APCreativeTab::isOurUpgrade).map((x) -> DataComponentUtil.createStack(pocket, ModRegistry.DataComponents.POCKET_UPGRADE.get(), UpgradeData.ofDefault(x))); + Objects.requireNonNull(out); + filteredItemStacks.forEach(out::accept); } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java b/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java index 6190f6a9c..12e3b5122 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java @@ -162,13 +162,13 @@ public static Map getObjectFromStack(Pair getObjectFromItemStack(Pair stack, @Nullable ICraftingService craftingService) { Map map = new HashMap<>(); String displayName = stack.getRight().getDisplayName().getString(); - CompoundTag nbt = stack.getRight().toTag(); + //CompoundTag nbt = stack.getRight().toTag(); long amount = stack.getLeft(); map.put("fingerprint", ItemUtil.getFingerprint(stack.getRight().toStack())); map.put("name", ItemUtil.getRegistryKey(stack.getRight().getItem()).toString()); map.put("amount", amount); map.put("displayName", displayName); - map.put("nbt", NBTUtil.toLua(nbt)); + //map.put("nbt", NBTUtil.toLua(nbt)); map.put("tags", LuaConverter.tagsToList(() -> stack.getRight().getItem().builtInRegistryHolder().tags())); map.put("isCraftable", craftingService != null && craftingService.isCraftable(stack.getRight())); @@ -193,7 +193,7 @@ private static Map getObjectFromGasStack(Pair map.put("name", stack.getRight().getStack().getTypeRegistryName().toString()); map.put("amount", amount); map.put("displayName", stack.getRight().getDisplayName().getString()); - map.put("tags", LuaConverter.tagsToList(() -> stack.getRight().getStack().getType().getTags())); + map.put("tags", LuaConverter.tagsToList(() -> stack.getRight().getStack().getTags())); return map; } @@ -421,10 +421,11 @@ public static long getUsedItemStorage(IGridNode node) { int bytesPerType = cell.getBytesPerType(null); if (cell.getKeyType().getClass().isAssignableFrom(AEKeyType.items().getClass())) { - if (stack.get() == null) - continue; - int numOfType = stack.getTag().getLongArray("amts").length; - long numItemsInCell = stack.getTag().getLong("ic"); + //if (stack.get() == null) + // continue; + //TODO + int numOfType = 0;//stack.get().getLongArray("amts").length; + long numItemsInCell = 0;//stack.getTag().getLong("ic"); used += ((int) Math.ceil(((double) numItemsInCell) / 8)) + ((long) bytesPerType * numOfType); } @@ -466,10 +467,11 @@ public static long getUsedFluidStorage(IGridNode node) { int bytesPerType = cell.getBytesPerType(null); if (cell.getKeyType().getClass().isAssignableFrom(AEKeyType.fluids().getClass())) { - if (stack.getTag() == null) - continue; - int numOfType = stack.getTag().getLongArray("amts").length; - long numBucketsInCell = stack.getTag().getLong("ic") / 1000; + //if (stack.getTag() == null) + // continue; + //TODO + int numOfType = 0;//stack.getTag().getLongArray("amts").length; + long numBucketsInCell = 0;//stack.getTag().getLong("ic") / 1000; used += ((int) Math.ceil(((double) numBucketsInCell) / 8)) + ((long) bytesPerType * numOfType); } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/MeItemHandler.java b/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/MeItemHandler.java index a3542cda3..ef7c6f71d 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/MeItemHandler.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/MeItemHandler.java @@ -30,7 +30,7 @@ public MeItemHandler(@NotNull MEStorage storageMonitor, @NotNull IActionSource a @NotNull @Override public ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate) { - AEItemKey itemKey = AEItemKey.of(stack.getItem(), stack.getTag()); + AEItemKey itemKey = AEItemKey.of(stack); long inserted = storageMonitor.insert(itemKey, stack.getCount(), simulate ? Actionable.SIMULATE : Actionable.MODULATE, actionSource); ItemStack insertedStack = stack.copy(); // Safe to cast here, the amount will never be higher than 64 diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/integrations/BeaconIntegration.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/integrations/BeaconIntegration.java index 0f8d5a28b..9c9732b2e 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/integrations/BeaconIntegration.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/integrations/BeaconIntegration.java @@ -13,19 +13,17 @@ public String getPeripheralType() { @LuaFunction(mainThread = true) public final int getLevel(BeaconBlockEntity blockEntity) { - // because levels are now protected field .... why? - CompoundTag savedData = blockEntity.saveWithoutMetadata(); - return savedData.getInt("Levels"); + return blockEntity.levels; } @LuaFunction(mainThread = true) public final String getPrimaryEffect(BeaconBlockEntity blockEntity) { - return blockEntity.primaryPower == null ? "none" : blockEntity.primaryPower.getDescriptionId(); + return blockEntity.primaryPower == null ? "none" : blockEntity.primaryPower.getRegisteredName(); } @LuaFunction(mainThread = true) public final String getSecondaryEffect(BeaconBlockEntity blockEntity) { - return blockEntity.secondaryPower == null ? "none" : blockEntity.secondaryPower.getDescriptionId(); + return blockEntity.secondaryPower == null ? "none" : blockEntity.secondaryPower.getRegisteredName(); } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/BlockEntityPeripheralOwner.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/BlockEntityPeripheralOwner.java index a244c1073..a1172b560 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/BlockEntityPeripheralOwner.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/BlockEntityPeripheralOwner.java @@ -8,7 +8,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.FrontAndTop; -import net.minecraft.nbt.CompoundTag; +import net.minecraft.core.component.DataComponentPatch; import net.minecraft.network.chat.Component; import net.minecraft.world.Nameable; import net.minecraft.world.entity.player.Player; @@ -75,9 +75,8 @@ public Player getOwner() { return null; } - @NotNull @Override - public CompoundTag getDataStorage() { + public DataComponentPatch getDataStorage() { return DataStorageUtil.getDataStorage(tileEntity); } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/FuelAbility.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/FuelAbility.java index 07245d648..391d637c1 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/FuelAbility.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/FuelAbility.java @@ -3,13 +3,16 @@ import dan200.computercraft.api.lua.LuaFunction; import dan200.computercraft.api.lua.MethodResult; import de.srendi.advancedperipherals.lib.peripherals.IPeripheralPlugin; -import net.minecraft.nbt.CompoundTag; +import net.minecraft.core.component.DataComponentMap; +import net.minecraft.core.component.DataComponentPatch; +import net.minecraft.core.component.PatchedDataComponentMap; import org.jetbrains.annotations.NotNull; import java.util.Map; +import static de.srendi.advancedperipherals.common.setup.DataComponents.FUEL_CONSUMPTION_RATE; + public abstract class FuelAbility implements IOwnerAbility, IPeripheralPlugin { - protected static final String FUEL_CONSUMING_RATE_SETTING = "FUEL_CONSUMING_RATE"; protected static final int DEFAULT_FUEL_CONSUMING_RATE = 1; protected @NotNull T owner; @@ -26,8 +29,8 @@ public FuelAbility(@NotNull T owner) { * @return the fuel consumption rate */ protected int getConsumptionRate() { - CompoundTag settings = owner.getDataStorage(); - int rate = settings.getInt(FUEL_CONSUMING_RATE_SETTING); + DataComponentPatch settings = owner.getDataStorage(); + int rate = settings.get(FUEL_CONSUMPTION_RATE.get()).get(); if (rate == 0) { setConsumptionRate(DEFAULT_FUEL_CONSUMING_RATE); return DEFAULT_FUEL_CONSUMING_RATE; @@ -44,7 +47,8 @@ protected void setConsumptionRate(int rate) { if (rate < DEFAULT_FUEL_CONSUMING_RATE) rate = DEFAULT_FUEL_CONSUMING_RATE; int maxFuelRate = getMaxFuelConsumptionRate(); if (rate > maxFuelRate) rate = maxFuelRate; - owner.getDataStorage().putInt(FUEL_CONSUMING_RATE_SETTING, rate); + PatchedDataComponentMap settings = PatchedDataComponentMap.fromPatch(DataComponentMap.EMPTY, owner.getDataStorage()); + settings.set(FUEL_CONSUMPTION_RATE.get(), rate); } public abstract boolean isFuelConsumptionDisable(); diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/IPeripheralOwner.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/IPeripheralOwner.java index c99e9442b..c07c0c230 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/IPeripheralOwner.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/IPeripheralOwner.java @@ -5,7 +5,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.FrontAndTop; -import net.minecraft.nbt.CompoundTag; +import net.minecraft.core.component.DataComponentPatch; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; @@ -29,7 +29,9 @@ public interface IPeripheralOwner { @Nullable Player getOwner(); - @NotNull CompoundTag getDataStorage(); + DataComponentPatch getDataStorage(); + + void putDataStorage(DataComponentPatch dataStorage); void markDataStorageDirty(); diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java index af5cf5718..27716fdd4 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java @@ -8,6 +8,9 @@ import de.srendi.advancedperipherals.lib.peripherals.IPeripheralFunction; import de.srendi.advancedperipherals.lib.peripherals.IPeripheralOperation; import de.srendi.advancedperipherals.lib.peripherals.IPeripheralPlugin; +import net.minecraft.core.component.DataComponentMap; +import net.minecraft.core.component.DataComponentPatch; +import net.minecraft.core.component.PatchedDataComponentMap; import net.minecraft.nbt.CompoundTag; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -32,8 +35,8 @@ public OperationAbility(IPeripheralOwner owner) { protected void setCooldown(@NotNull IPeripheralOperation operation, int cooldown) { if (cooldown > 0) { - CompoundTag dataStorage = owner.getDataStorage(); - if (!dataStorage.contains(COOLDOWNS_TAG)) dataStorage.put(COOLDOWNS_TAG, new CompoundTag()); + PatchedDataComponentMap patch = PatchedDataComponentMap.fromPatch(DataComponentMap.EMPTY, owner.getDataStorage()); + if (!patch.has(COOLDOWNS_TAG)) patch.put(COOLDOWNS_TAG, new CompoundTag()); dataStorage.getCompound(COOLDOWNS_TAG).putLong(operation.settingsName(), Timestamp.valueOf(LocalDateTime.now().plus(cooldown, ChronoUnit.MILLIS)).getTime()); } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/PocketPeripheralOwner.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/PocketPeripheralOwner.java index 5cd8e588c..e9754c80d 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/PocketPeripheralOwner.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/PocketPeripheralOwner.java @@ -7,7 +7,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.FrontAndTop; -import net.minecraft.nbt.CompoundTag; +import net.minecraft.core.component.DataComponentPatch; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; @@ -75,15 +75,15 @@ public Player getOwner() { return null; } - @NotNull @Override - public CompoundTag getDataStorage() { + public DataComponentPatch getDataStorage() { return DataStorageUtil.getDataStorage(pocket); } @Override public void markDataStorageDirty() { - pocket.updateUpgradeNBTData(); + //TODO do we still need this? + //pocket.updateUpgradeNBTData(); } @Override diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/TurtlePeripheralOwner.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/TurtlePeripheralOwner.java index 2d7446e1c..9683f84a9 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/TurtlePeripheralOwner.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/TurtlePeripheralOwner.java @@ -10,7 +10,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.FrontAndTop; -import net.minecraft.nbt.CompoundTag; +import net.minecraft.core.component.DataComponentPatch; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; @@ -67,15 +67,18 @@ public Player getOwner() { return turtle.getLevel().getPlayerByUUID(owningPlayer.getId()); } - @NotNull @Override - public CompoundTag getDataStorage() { + public DataComponentPatch getDataStorage() { return DataStorageUtil.getDataStorage(turtle, side); } + @Override + public void putDataStorage(DataComponentPatch dataStorage) { + DataStorageUtil.putDataStorage(turtle, side, dataStorage); + } + @Override public void markDataStorageDirty() { - turtle.updateUpgradeNBTData(side); } @Override diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/BlockReaderPeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/BlockReaderPeripheral.java index 9ffa730e4..d9daf309d 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/BlockReaderPeripheral.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/BlockReaderPeripheral.java @@ -7,6 +7,7 @@ import de.srendi.advancedperipherals.common.configuration.APConfig; import de.srendi.advancedperipherals.common.util.LuaConverter; import de.srendi.advancedperipherals.lib.peripherals.BasePeripheral; +import net.minecraft.core.RegistryAccess; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntity; @@ -42,7 +43,7 @@ public final Object getBlockData() { BlockEntity target = getLevel().getBlockEntity(getPos().relative(owner.getFacing())); if (target == null) return null; - return NBTUtil.toLua(target.saveWithoutMetadata()); + return NBTUtil.toLua(target.saveWithoutMetadata(RegistryAccess.EMPTY)); } @LuaFunction(mainThread = true) diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ChatBoxPeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ChatBoxPeripheral.java index 18f134a59..97b14edf7 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ChatBoxPeripheral.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ChatBoxPeripheral.java @@ -23,6 +23,8 @@ import de.srendi.advancedperipherals.lib.peripherals.IPeripheralFunction; import de.srendi.advancedperipherals.network.APNetworking; import de.srendi.advancedperipherals.network.toclient.ToastToClientPacket; +import net.minecraft.core.RegistryAccess; +import net.minecraft.core.registries.Registries; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceKey; @@ -74,7 +76,7 @@ private MutableComponent appendPrefix(String prefix, String brackets, String col if (!prefix.isEmpty()) { MutableComponent formattablePrefix; try { - formattablePrefix = MutableComponent.Serializer.fromJson(prefix); + formattablePrefix = MutableComponent.Serializer.fromJson(prefix, RegistryAccess.EMPTY); prefixComponent = formattablePrefix; } catch (JsonSyntaxException exception) { AdvancedPeripherals.debug("Non json prefix, using plain text instead."); @@ -113,7 +115,7 @@ public final MethodResult sendFormattedMessage(@NotNull IArguments arguments) th int maxRange = APConfig.PERIPHERALS_CONFIG.chatBoxMaxRange.get(); int range = arguments.optInt(4, -1); ResourceKey dimension = getLevel().dimension(); - MutableComponent component = Component.Serializer.fromJson(message); + MutableComponent component = Component.Serializer.fromJson(message, RegistryAccess.EMPTY); if (component == null) return MethodResult.of(null, "incorrect json"); @@ -172,7 +174,7 @@ public final MethodResult sendFormattedMessageToPlayer(@NotNull IArguments argum if (player == null) return MethodResult.of(null, "incorrect player name/uuid"); - MutableComponent component = Component.Serializer.fromJson(message); + MutableComponent component = Component.Serializer.fromJson(message, RegistryAccess.EMPTY); if (component == null) return MethodResult.of(null, "incorrect json"); @@ -207,11 +209,11 @@ public final MethodResult sendFormattedToastToPlayer(@NotNull IArguments argumen if (player == null) return MethodResult.of(null, "incorrect player name/uuid"); - MutableComponent messageComponent = Component.Serializer.fromJson(message); + MutableComponent messageComponent = Component.Serializer.fromJson(message, RegistryAccess.EMPTY); if (messageComponent == null) return MethodResult.of(null, "incorrect json for message"); - MutableComponent titleComponent = Component.Serializer.fromJson(title); + MutableComponent titleComponent = Component.Serializer.fromJson(title, RegistryAccess.EMPTY); if (titleComponent == null) return MethodResult.of(null, "incorrect json for title"); diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ChunkyPeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ChunkyPeripheral.java index 94829b12f..ef1a51752 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ChunkyPeripheral.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ChunkyPeripheral.java @@ -7,6 +7,9 @@ import de.srendi.advancedperipherals.common.configuration.APConfig; import de.srendi.advancedperipherals.common.util.ChunkManager; import de.srendi.advancedperipherals.lib.peripherals.BasePeripheral; +import net.minecraft.core.component.DataComponentMap; +import net.minecraft.core.component.DataComponentPatch; +import net.minecraft.core.component.PatchedDataComponentMap; import net.minecraft.nbt.CompoundTag; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.ChunkPos; @@ -16,6 +19,8 @@ import java.util.Objects; import java.util.UUID; +import static de.srendi.advancedperipherals.common.setup.DataComponents.CHUNKY_ID; + public class ChunkyPeripheral extends BasePeripheral { public static final String PERIPHERAL_TYPE = "chunky"; @@ -27,12 +32,12 @@ public ChunkyPeripheral(ITurtleAccess turtle, TurtleSide side) { } protected UUID getUUID() { - CompoundTag data = owner.getDataStorage(); - if (!data.contains(UUID_TAG)) { - data.putUUID(UUID_TAG, UUID.randomUUID()); - owner.markDataStorageDirty(); + PatchedDataComponentMap patch = PatchedDataComponentMap.fromPatch(DataComponentMap.EMPTY, owner.getDataStorage()); + if (!patch.has(CHUNKY_ID.get())) { + patch.set(CHUNKY_ID.get(), UUID.randomUUID()); + owner.putDataStorage(patch.asPatch()); } - return data.getUUID(UUID_TAG); + return patch.get(CHUNKY_ID.get()); } public ChunkPos getChunkPos() { diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketChatBoxUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketChatBoxUpgrade.java index 710074ccc..1a1ebd248 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketChatBoxUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketChatBoxUpgrade.java @@ -12,8 +12,8 @@ public class PocketChatBoxUpgrade extends BasePocketUpgrade { - public PocketChatBoxUpgrade(ResourceLocation id, ItemStack stack) { - super(id, stack); + public PocketChatBoxUpgrade(ItemStack stack) { + super(CCRegistration.ID.CHATTY_POCKET, stack); } @Nullable diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketEnvironmentUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketEnvironmentUpgrade.java index 3d7f239cb..ab30af21d 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketEnvironmentUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketEnvironmentUpgrade.java @@ -13,8 +13,8 @@ public class PocketEnvironmentUpgrade extends BasePocketUpgrade { - public PocketEnvironmentUpgrade(ResourceLocation id, ItemStack stack) { - super(id, stack); + public PocketEnvironmentUpgrade(ItemStack stack) { + super(CCRegistration.ID.ENVIRONMENT_POCKET, stack); } @Nullable diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketGeoScannerUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketGeoScannerUpgrade.java index fb73500b8..a4bb177e3 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketGeoScannerUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketGeoScannerUpgrade.java @@ -13,8 +13,8 @@ public class PocketGeoScannerUpgrade extends BasePocketUpgrade { - public PocketGeoScannerUpgrade(ResourceLocation id, ItemStack stack) { - super(id, stack); + public PocketGeoScannerUpgrade(ItemStack stack) { + super(CCRegistration.ID.GEOSCANNER_POCKET, stack); } @Nullable diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketPlayerDetectorUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketPlayerDetectorUpgrade.java index f0ba68e1a..b6f8857d8 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketPlayerDetectorUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketPlayerDetectorUpgrade.java @@ -13,8 +13,8 @@ public class PocketPlayerDetectorUpgrade extends BasePocketUpgrade { - public PocketPlayerDetectorUpgrade(ResourceLocation id, ItemStack stack) { - super(id, stack); + public PocketPlayerDetectorUpgrade(ItemStack stack) { + super(CCRegistration.ID.PLAYER_POCKET, stack); } @Nullable diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChatBoxUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChatBoxUpgrade.java index 4f19c9608..353a20811 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChatBoxUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChatBoxUpgrade.java @@ -14,8 +14,8 @@ import org.jetbrains.annotations.NotNull; public class TurtleChatBoxUpgrade extends PeripheralTurtleUpgrade { - public TurtleChatBoxUpgrade(ResourceLocation id, ItemStack item) { - super(id, item); + public TurtleChatBoxUpgrade(ItemStack item) { + super(CCRegistration.ID.CHATTY_TURTLE, item); } @Override diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChunkyUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChunkyUpgrade.java index 955c7cc5e..9f90db42b 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChunkyUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChunkyUpgrade.java @@ -17,8 +17,8 @@ public class TurtleChunkyUpgrade extends PeripheralTurtleUpgrade { private int updateTick = 0; - public TurtleChunkyUpgrade(ResourceLocation id, ItemStack stack) { - super(id, stack); + public TurtleChunkyUpgrade(ItemStack stack) { + super(CCRegistration.ID.CHUNKY_TURTLE, stack); } @Override diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleCompassUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleCompassUpgrade.java index a4335d1e2..2eb2c5b19 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleCompassUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleCompassUpgrade.java @@ -14,8 +14,8 @@ public class TurtleCompassUpgrade extends PeripheralTurtleUpgrade { - public TurtleCompassUpgrade(ResourceLocation id, ItemStack stack) { - super(id, stack); + public TurtleCompassUpgrade(ItemStack stack) { + super(CCRegistration.ID.COMPASS_TURTLE, stack); } @Override diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleEnvironmentDetectorUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleEnvironmentDetectorUpgrade.java index 11c5eeb90..5a2389ade 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleEnvironmentDetectorUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleEnvironmentDetectorUpgrade.java @@ -15,8 +15,8 @@ public class TurtleEnvironmentDetectorUpgrade extends PeripheralTurtleUpgrade { - public TurtleEnvironmentDetectorUpgrade(ResourceLocation id, ItemStack stack) { - super(id, stack); + public TurtleEnvironmentDetectorUpgrade(ItemStack stack) { + super(CCRegistration.ID.ENVIRONMENT_TURTLE, stack); } @Override diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleGeoScannerUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleGeoScannerUpgrade.java index 2b0fb0a09..8838a2018 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleGeoScannerUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleGeoScannerUpgrade.java @@ -15,8 +15,8 @@ public class TurtleGeoScannerUpgrade extends PeripheralTurtleUpgrade { - public TurtleGeoScannerUpgrade(ResourceLocation id, ItemStack stack) { - super(id, stack); + public TurtleGeoScannerUpgrade(ItemStack stack) { + super(CCRegistration.ID.GEOSCANNER_TURTLE, stack); } @Override diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtlePlayerDetectorUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtlePlayerDetectorUpgrade.java index c73b0ae8c..337aa50ae 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtlePlayerDetectorUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtlePlayerDetectorUpgrade.java @@ -15,8 +15,8 @@ public class TurtlePlayerDetectorUpgrade extends PeripheralTurtleUpgrade { - public TurtlePlayerDetectorUpgrade(ResourceLocation id, ItemStack stack) { - super(id, stack); + public TurtlePlayerDetectorUpgrade(ItemStack stack) { + super(CCRegistration.ID.PLAYER_TURTLE, stack); } @Override diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/EndAutomata.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/EndAutomata.java index 3d100360e..be1b10646 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/EndAutomata.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/EndAutomata.java @@ -1,8 +1,11 @@ package de.srendi.advancedperipherals.common.addons.computercraft.turtles.metaphysics; import dan200.computercraft.api.turtle.ITurtleAccess; +import dan200.computercraft.api.turtle.ITurtleUpgrade; import dan200.computercraft.api.turtle.TurtleSide; +import dan200.computercraft.api.upgrades.UpgradeType; import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.metaphysics.EndAutomataCorePeripheral; +import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.ClockwiseAnimatedTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.resources.ResourceLocation; @@ -11,8 +14,8 @@ public class EndAutomata extends ClockwiseAnimatedTurtleUpgrade { - public EndAutomata(ResourceLocation id, ItemStack stack) { - super(id, stack); + public EndAutomata(ItemStack stack) { + super(CCRegistration.ID.END_AUTOMATA, stack); } @Override @@ -29,4 +32,9 @@ public ModelResourceLocation getRightModel() { protected EndAutomataCorePeripheral buildPeripheral(@NotNull ITurtleAccess turtle, @NotNull TurtleSide side) { return new EndAutomataCorePeripheral(turtle, side); } + + @Override + public UpgradeType getType() { + return CCRegistration.END_TURTLE.get(); + } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/HusbandryAutomata.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/HusbandryAutomata.java index 898710cb9..5e3726c8d 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/HusbandryAutomata.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/HusbandryAutomata.java @@ -1,8 +1,11 @@ package de.srendi.advancedperipherals.common.addons.computercraft.turtles.metaphysics; import dan200.computercraft.api.turtle.ITurtleAccess; +import dan200.computercraft.api.turtle.ITurtleUpgrade; import dan200.computercraft.api.turtle.TurtleSide; +import dan200.computercraft.api.upgrades.UpgradeType; import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.metaphysics.HusbandryAutomataCorePeripheral; +import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.ClockwiseAnimatedTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.resources.ResourceLocation; @@ -10,8 +13,8 @@ import org.jetbrains.annotations.NotNull; public class HusbandryAutomata extends ClockwiseAnimatedTurtleUpgrade { - public HusbandryAutomata(ResourceLocation id, ItemStack stack) { - super(id, stack); + public HusbandryAutomata(ItemStack stack) { + super(CCRegistration.ID.HUSBANDRY_AUTOMATA, stack); } @Override @@ -28,4 +31,9 @@ public ModelResourceLocation getRightModel() { protected HusbandryAutomataCorePeripheral buildPeripheral(@NotNull ITurtleAccess turtle, @NotNull TurtleSide side) { return new HusbandryAutomataCorePeripheral(turtle, side); } + + @Override + public UpgradeType getType() { + return CCRegistration.HUSBANDRY_TURTLE.get(); + } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredEndAutomata.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredEndAutomata.java index 408965f4e..448acb988 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredEndAutomata.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredEndAutomata.java @@ -1,8 +1,11 @@ package de.srendi.advancedperipherals.common.addons.computercraft.turtles.metaphysics; import dan200.computercraft.api.turtle.ITurtleAccess; +import dan200.computercraft.api.turtle.ITurtleUpgrade; import dan200.computercraft.api.turtle.TurtleSide; +import dan200.computercraft.api.upgrades.UpgradeType; import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.metaphysics.OverpoweredEndAutomataCorePeripheral; +import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.ClockwiseAnimatedTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.resources.ResourceLocation; @@ -11,8 +14,8 @@ public class OverpoweredEndAutomata extends ClockwiseAnimatedTurtleUpgrade { - public OverpoweredEndAutomata(ResourceLocation id, ItemStack stack) { - super(id, stack); + public OverpoweredEndAutomata(ItemStack stack) { + super(CCRegistration.ID.OP_END_AUTOMATA, stack); } @Override @@ -29,4 +32,9 @@ public ModelResourceLocation getRightModel() { protected OverpoweredEndAutomataCorePeripheral buildPeripheral(@NotNull ITurtleAccess turtle, @NotNull TurtleSide side) { return new OverpoweredEndAutomataCorePeripheral(turtle, side); } + + @Override + public UpgradeType getType() { + return CCRegistration.OP_END_TURTLE.get(); + } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredHusbandryAutomata.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredHusbandryAutomata.java index 83f1e27d8..adbe03354 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredHusbandryAutomata.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredHusbandryAutomata.java @@ -1,8 +1,11 @@ package de.srendi.advancedperipherals.common.addons.computercraft.turtles.metaphysics; import dan200.computercraft.api.turtle.ITurtleAccess; +import dan200.computercraft.api.turtle.ITurtleUpgrade; import dan200.computercraft.api.turtle.TurtleSide; +import dan200.computercraft.api.upgrades.UpgradeType; import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.metaphysics.OverpoweredHusbandryAutomataCorePeripheral; +import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.ClockwiseAnimatedTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.resources.ResourceLocation; @@ -11,8 +14,8 @@ public class OverpoweredHusbandryAutomata extends ClockwiseAnimatedTurtleUpgrade { - public OverpoweredHusbandryAutomata(ResourceLocation id, ItemStack stack) { - super(id, stack); + public OverpoweredHusbandryAutomata(ItemStack stack) { + super(CCRegistration.ID.HUSBANDRY_AUTOMATA, stack); } @Override @@ -29,4 +32,9 @@ public ModelResourceLocation getRightModel() { protected OverpoweredHusbandryAutomataCorePeripheral buildPeripheral(@NotNull ITurtleAccess turtle, @NotNull TurtleSide side) { return new OverpoweredHusbandryAutomataCorePeripheral(turtle, side); } + + @Override + public UpgradeType getType() { + return CCRegistration.OP_HUSBANDRY_TURTLE.get(); + } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredWeakAutomata.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredWeakAutomata.java index 4ed87f62c..301fd7ce5 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredWeakAutomata.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredWeakAutomata.java @@ -1,8 +1,11 @@ package de.srendi.advancedperipherals.common.addons.computercraft.turtles.metaphysics; import dan200.computercraft.api.turtle.ITurtleAccess; +import dan200.computercraft.api.turtle.ITurtleUpgrade; import dan200.computercraft.api.turtle.TurtleSide; +import dan200.computercraft.api.upgrades.UpgradeType; import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.metaphysics.OverpoweredWeakAutomataCorePeripheral; +import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.ClockwiseAnimatedTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.resources.ResourceLocation; @@ -11,8 +14,8 @@ public class OverpoweredWeakAutomata extends ClockwiseAnimatedTurtleUpgrade { - public OverpoweredWeakAutomata(ResourceLocation id, ItemStack stack) { - super(id, stack); + public OverpoweredWeakAutomata(ItemStack stack) { + super(CCRegistration.ID.OP_WEAK_AUTOMATA, stack); } @Override @@ -29,4 +32,9 @@ public ModelResourceLocation getRightModel() { protected OverpoweredWeakAutomataCorePeripheral buildPeripheral(@NotNull ITurtleAccess turtle, @NotNull TurtleSide side) { return new OverpoweredWeakAutomataCorePeripheral(turtle, side); } + + @Override + public UpgradeType getType() { + return CCRegistration.OP_WEAK_TURTLE.get(); + } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/WeakAutomata.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/WeakAutomata.java index 3d35bfa0c..1051ab5ca 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/WeakAutomata.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/WeakAutomata.java @@ -1,8 +1,11 @@ package de.srendi.advancedperipherals.common.addons.computercraft.turtles.metaphysics; import dan200.computercraft.api.turtle.ITurtleAccess; +import dan200.computercraft.api.turtle.ITurtleUpgrade; import dan200.computercraft.api.turtle.TurtleSide; +import dan200.computercraft.api.upgrades.UpgradeType; import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.metaphysics.WeakAutomataCorePeripheral; +import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.ClockwiseAnimatedTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.resources.ResourceLocation; @@ -11,8 +14,8 @@ public class WeakAutomata extends ClockwiseAnimatedTurtleUpgrade { - public WeakAutomata(ResourceLocation id, ItemStack stack) { - super(id, stack); + public WeakAutomata(ItemStack stack) { + super(CCRegistration.ID.WEAK_AUTOMATA, stack); } @Override @@ -29,4 +32,9 @@ public ModelResourceLocation getRightModel() { protected WeakAutomataCorePeripheral buildPeripheral(@NotNull ITurtleAccess turtle, @NotNull TurtleSide side) { return new WeakAutomataCorePeripheral(turtle, side); } + + @Override + public UpgradeType getType() { + return CCRegistration.WEAK_TURTLE.get(); + } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/blocks/PlayerDetectorBlock.java b/src/main/java/de/srendi/advancedperipherals/common/blocks/PlayerDetectorBlock.java index 5da7a86ff..663bc6a79 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/blocks/PlayerDetectorBlock.java +++ b/src/main/java/de/srendi/advancedperipherals/common/blocks/PlayerDetectorBlock.java @@ -29,9 +29,9 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta } @Override - public @NotNull InteractionResult use(@NotNull BlockState state, Level levelIn, @NotNull BlockPos pos, @NotNull Player player, @NotNull InteractionHand handIn, @NotNull BlockHitResult hit) { + public @NotNull InteractionResult useWithoutItem(@NotNull BlockState state, Level levelIn, @NotNull BlockPos pos, @NotNull Player player, @NotNull BlockHitResult hit) { if (!APConfig.PERIPHERALS_CONFIG.enablePlayerDetector.get()) - return super.use(state, levelIn, pos, player, handIn, hit); + return super.useWithoutItem(state, levelIn, pos, player, hit); BlockEntity tileEntity = levelIn.getBlockEntity(pos); if (tileEntity instanceof PlayerDetectorEntity entity) { for (IComputerAccess computer : entity.getConnectedComputers()) { @@ -39,7 +39,7 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta } } - return super.use(state, levelIn, pos, player, handIn, hit); + return super.useWithoutItem(state, levelIn, pos, player, hit); } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/blocks/base/BaseBlockEntityBlock.java b/src/main/java/de/srendi/advancedperipherals/common/blocks/base/BaseBlockEntityBlock.java index 5b54d510c..b3e3bbc11 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/blocks/base/BaseBlockEntityBlock.java +++ b/src/main/java/de/srendi/advancedperipherals/common/blocks/base/BaseBlockEntityBlock.java @@ -8,6 +8,7 @@ import net.minecraft.world.Containers; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; +import net.minecraft.world.ItemInteractionResult; import net.minecraft.world.MenuProvider; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; @@ -41,16 +42,16 @@ public BaseBlockEntityBlock(boolean belongToTickingEntity, Properties properties @NotNull @Override - public InteractionResult use(@NotNull BlockState state, Level levelIn, @NotNull BlockPos pos, @NotNull Player player, @NotNull InteractionHand handIn, @NotNull BlockHitResult hit) { - if (levelIn.isClientSide) return InteractionResult.SUCCESS; + public ItemInteractionResult useItemOn(@NotNull ItemStack stack, @NotNull BlockState state, Level levelIn, @NotNull BlockPos pos, @NotNull Player player, @NotNull InteractionHand handIn, @NotNull BlockHitResult hit) { + if (levelIn.isClientSide) return ItemInteractionResult.SUCCESS; BlockEntity tileEntity = levelIn.getBlockEntity(pos); - if (tileEntity != null && !(tileEntity instanceof IInventoryBlock)) return InteractionResult.PASS; + if (tileEntity != null && !(tileEntity instanceof IInventoryBlock)) return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; MenuProvider namedContainerProvider = this.getMenuProvider(state, levelIn, pos); if (namedContainerProvider != null) { - if (!(player instanceof ServerPlayer serverPlayerEntity)) return InteractionResult.PASS; + if (!(player instanceof ServerPlayer serverPlayerEntity)) return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; serverPlayerEntity.openMenu(namedContainerProvider, pos); } - return InteractionResult.SUCCESS; + return ItemInteractionResult.SUCCESS; } @Override @@ -68,8 +69,8 @@ public void setPlacedBy(@NotNull Level worldIn, @NotNull BlockPos pos, @NotNull if (worldIn.getBlockEntity(pos) == null) return; //Used for the lua function getName() - if (stack.hasCustomHoverName() && worldIn.getBlockEntity(pos) instanceof BaseContainerBlockEntity blockEntity) { - blockEntity.setCustomName(stack.getHoverName()); + if (worldIn.getBlockEntity(pos) instanceof BaseContainerBlockEntity blockEntity) { + blockEntity.name = stack.getHoverName(); } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/blocks/base/PeripheralBlockEntity.java b/src/main/java/de/srendi/advancedperipherals/common/blocks/base/PeripheralBlockEntity.java index d2cb59e16..90d9f0620 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/blocks/base/PeripheralBlockEntity.java +++ b/src/main/java/de/srendi/advancedperipherals/common/blocks/base/PeripheralBlockEntity.java @@ -7,6 +7,7 @@ import de.srendi.advancedperipherals.lib.peripherals.IPeripheralTileEntity; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.HolderLookup; import net.minecraft.core.NonNullList; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; @@ -95,17 +96,17 @@ public ITextComponent getDisplayName() { }*/ @Override - public void saveAdditional(@NotNull CompoundTag compound) { - super.saveAdditional(compound); - ContainerHelper.saveAllItems(compound, items); - if (!peripheralSettings.isEmpty()) compound.put(PERIPHERAL_SETTINGS_KEY, peripheralSettings); + protected void saveAdditional(@NotNull CompoundTag tag, @NotNull HolderLookup.Provider provider) { + super.saveAdditional(tag, provider); + ContainerHelper.saveAllItems(tag, items, provider); + if (!peripheralSettings.isEmpty()) tag.put(PERIPHERAL_SETTINGS_KEY, peripheralSettings); } @Override - public void load(@NotNull CompoundTag compound) { - ContainerHelper.loadAllItems(compound, items); - peripheralSettings = compound.getCompound(PERIPHERAL_SETTINGS_KEY); - super.load(compound); + protected void loadAdditional(@NotNull CompoundTag tag, @NotNull HolderLookup.Provider provider) { + ContainerHelper.loadAllItems(tag, items, provider); + peripheralSettings = tag.getCompound(PERIPHERAL_SETTINGS_KEY); + super.loadAdditional(tag, provider); } @Override @@ -125,7 +126,7 @@ protected AbstractContainerMenu createMenu(int id, @NotNull Inventory player) { } @Override - public int[] getSlotsForFace(@NotNull Direction side) { + public int @NotNull [] getSlotsForFace(@NotNull Direction side) { return new int[]{0}; } @@ -182,6 +183,17 @@ public void setItem(int index, @NotNull ItemStack stack) { } } + @NotNull + @Override + public NonNullList getItems() { + return items; + } + + @Override + public void setItems(@NotNull NonNullList items) { + this.items = items; + } + @Override public boolean stillValid(@NotNull Player player) { return true; diff --git a/src/main/java/de/srendi/advancedperipherals/common/blocks/base/PoweredPeripheralBlockEntity.java b/src/main/java/de/srendi/advancedperipherals/common/blocks/base/PoweredPeripheralBlockEntity.java index e39242118..82ff21ba0 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/blocks/base/PoweredPeripheralBlockEntity.java +++ b/src/main/java/de/srendi/advancedperipherals/common/blocks/base/PoweredPeripheralBlockEntity.java @@ -4,6 +4,7 @@ import de.srendi.advancedperipherals.lib.peripherals.BasePeripheral; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.HolderLookup; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; @@ -28,15 +29,15 @@ public PoweredPeripheralBlockEntity(BlockEntityType tileEntityTypeIn, BlockPo protected abstract int getMaxEnergyStored(); @Override - public void saveAdditional(@NotNull CompoundTag compound) { - super.saveAdditional(compound); + public void saveAdditional(@NotNull CompoundTag compound, @NotNull HolderLookup.Provider provider) { + super.saveAdditional(compound, provider); if (energyStorage != null) compound.putInt("energy", energyStorage.getEnergyStored()); } @Override - public void load(@NotNull CompoundTag compound) { - super.load(compound); + public void loadAdditional(@NotNull CompoundTag compound, @NotNull HolderLookup.Provider provider) { + super.loadAdditional(compound, provider); if (energyStorage != null) energyStorage.receiveEnergy(compound.getInt("energy") - energyStorage.getEnergyStored(), false); } diff --git a/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/EnergyDetectorEntity.java b/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/EnergyDetectorEntity.java index a523f7561..2e50c9252 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/EnergyDetectorEntity.java +++ b/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/EnergyDetectorEntity.java @@ -7,6 +7,7 @@ import de.srendi.advancedperipherals.common.util.EnergyStorageProxy; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.HolderLookup; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.JigsawBlock; @@ -57,9 +58,15 @@ public IEnergyStorage createEnergyStorageCap(@Nullable Direction direction) { } @Override - public void saveAdditional(@NotNull CompoundTag compound) { - super.saveAdditional(compound); - compound.putInt("rateLimit", storageProxy.getMaxTransferRate()); + protected void saveAdditional(@NotNull CompoundTag tag, @NotNull HolderLookup.Provider provider) { + tag.putInt("transferRate", transferRate); + super.saveAdditional(tag, provider); + } + + @Override + protected void loadAdditional(@NotNull CompoundTag tag, @NotNull HolderLookup.Provider provider) { + transferRate = tag.getInt("transferRate"); + super.loadAdditional(tag, provider); } @Override @@ -71,12 +78,6 @@ public void handleTick(Level level, BlockState state, Bl } } - @Override - public void deserializeNBT(CompoundTag nbt) { - storageProxy.setMaxTransferRate(nbt.getInt("rateLimit")); - super.deserializeNBT(nbt); - } - public void invalidateStorages() { outReceivingStorage = null; } diff --git a/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/InventoryManagerEntity.java b/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/InventoryManagerEntity.java index 315745535..64a2f3078 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/InventoryManagerEntity.java +++ b/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/InventoryManagerEntity.java @@ -8,6 +8,7 @@ import de.srendi.advancedperipherals.common.setup.BlockEntityTypes; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.HolderLookup; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; @@ -22,6 +23,7 @@ import java.util.UUID; import static de.srendi.advancedperipherals.common.items.MemoryCardItem.OWNER_NBT_KEY; +import static de.srendi.advancedperipherals.common.setup.DataComponents.OWNER; public class InventoryManagerEntity extends PeripheralBlockEntity implements IInventoryBlock { @@ -55,9 +57,9 @@ public boolean canPlaceItemThroughFace(int index, @NotNull ItemStack itemStackIn @Override public void setItem(int index, @NotNull ItemStack stack) { if (stack.getItem() instanceof MemoryCardItem) { - if (stack.hasTag() && stack.getTag().contains(OWNER_NBT_KEY)) { - this.owner = stack.getTag().getUUID(OWNER_NBT_KEY); - stack.getTag().remove(OWNER_NBT_KEY); + if (stack.has(OWNER)) { + this.owner = stack.get(OWNER); + stack.remove(OWNER); } else if (stack != this.getItem(index)) { // Only clear owner when the new card item is not the current item this.owner = null; @@ -75,18 +77,16 @@ public Component getDisplayName() { } @Override - public void load(CompoundTag data) { + public void loadAdditional(CompoundTag data, @NotNull HolderLookup.Provider provider) { if (data.contains("ownerId")) { this.owner = data.getUUID("ownerId"); } - super.load(data); - // Fresh the memory card for backward compatibility - this.setItem(0, this.getItem(0)); + super.loadAdditional(data, provider); } @Override - public void saveAdditional(CompoundTag data) { - super.saveAdditional(data); + public void saveAdditional(@NotNull CompoundTag data, @NotNull HolderLookup.Provider provider) { + super.saveAdditional(data, provider); if (this.owner != null) { data.putUUID("ownerId", this.owner); } @@ -96,7 +96,6 @@ public Player getOwnerPlayer() { if (this.owner == null) { return null; } - Player player = ServerLifecycleHooks.getCurrentServer().getPlayerList().getPlayer(this.owner); - return player; + return ServerLifecycleHooks.getCurrentServer().getPlayerList().getPlayer(this.owner); } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/NBTStorageEntity.java b/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/NBTStorageEntity.java index 707fec188..758520d95 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/NBTStorageEntity.java +++ b/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/NBTStorageEntity.java @@ -4,6 +4,7 @@ import de.srendi.advancedperipherals.common.blocks.base.PeripheralBlockEntity; import de.srendi.advancedperipherals.common.setup.BlockEntityTypes; import net.minecraft.core.BlockPos; +import net.minecraft.core.HolderLookup; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.level.block.state.BlockState; import org.jetbrains.annotations.NotNull; @@ -32,15 +33,15 @@ public void setStored(CompoundTag newStored) { } @Override - public void saveAdditional(@NotNull CompoundTag compound) { - super.saveAdditional(compound); + public void saveAdditional(@NotNull CompoundTag compound, HolderLookup.@NotNull Provider provider) { + super.saveAdditional(compound, provider); compound.put("storedData", stored); } @Override - public void load(@NotNull CompoundTag compound) { + public void loadAdditional(@NotNull CompoundTag compound, HolderLookup.@NotNull Provider provider) { stored = compound.getCompound("storedData"); - super.load(compound); + super.loadAdditional(compound, provider); } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/RedstoneIntegratorEntity.java b/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/RedstoneIntegratorEntity.java index 1987a1bf0..2d8e9f829 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/RedstoneIntegratorEntity.java +++ b/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/RedstoneIntegratorEntity.java @@ -7,6 +7,7 @@ import de.srendi.advancedperipherals.common.util.ServerWorker; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.HolderLookup; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.RedStoneWireBlock; @@ -62,16 +63,16 @@ public void setOutput(Direction direction, int power) { } @Override - public void load(@NotNull CompoundTag compound) { + public void loadAdditional(@NotNull CompoundTag compound, @NotNull HolderLookup.Provider provider) { for (Direction direction : Direction.values()) { setRedstoneOutput(direction, compound.getInt(direction.name() + "Power")); } - super.load(compound); + super.loadAdditional(compound, provider); } @Override - public void saveAdditional(@NotNull CompoundTag compound) { - super.saveAdditional(compound); + public void saveAdditional(@NotNull CompoundTag compound, @NotNull HolderLookup.Provider provider) { + super.saveAdditional(compound, provider); int i = 0; for (Direction direction : Direction.values()) { compound.putInt(direction.name() + "Power", power[i]); diff --git a/src/main/java/de/srendi/advancedperipherals/common/commands/APCommands.java b/src/main/java/de/srendi/advancedperipherals/common/commands/APCommands.java index 755d42c10..869b987de 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/commands/APCommands.java +++ b/src/main/java/de/srendi/advancedperipherals/common/commands/APCommands.java @@ -90,9 +90,8 @@ private static int forceloadDump(CommandSourceStack source) throws CommandSyntax TableBuilder table = new TableBuilder("ChunkyTurtles", "Computer", "Position"); ServerComputer[] computers = ServerContext.get(source.getServer()).registry().getComputers().stream().filter((computer) -> { - Environment env = computer.getComputer().getEnvironment(); for (ComputerSide side : ComputerSide.values()) { - if (env.getPeripheral(side) instanceof ChunkyPeripheral) { + if (computer.getPeripheral(side) instanceof ChunkyPeripheral) { return true; } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/BlockLootTables.java b/src/main/java/de/srendi/advancedperipherals/common/data/BlockLootTables.java index 73eea6265..7e6be38ed 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/BlockLootTables.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/BlockLootTables.java @@ -1,6 +1,9 @@ package de.srendi.advancedperipherals.common.data; import de.srendi.advancedperipherals.common.setup.Registration; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.RegistryAccess; +import net.minecraft.core.registries.Registries; import net.minecraft.data.loot.BlockLootSubProvider; import net.minecraft.world.flag.FeatureFlags; import net.minecraft.world.level.block.Block; @@ -11,8 +14,8 @@ public class BlockLootTables extends BlockLootSubProvider { - protected BlockLootTables() { - super(Set.of(), FeatureFlags.REGISTRY.allFlags()); + protected BlockLootTables(HolderLookup.Provider provider) { + super(Set.of(), FeatureFlags.REGISTRY.allFlags(), provider); } @Override diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/BlockLootTablesProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/BlockLootTablesProvider.java index d7ca829da..6244db213 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/BlockLootTablesProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/BlockLootTablesProvider.java @@ -1,9 +1,12 @@ package de.srendi.advancedperipherals.common.data; import com.google.common.collect.ImmutableList; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.WritableRegistry; import net.minecraft.data.PackOutput; import net.minecraft.data.loot.LootTableProvider; import net.minecraft.resources.ResourceLocation; +import net.minecraft.util.ProblemReporter; import net.minecraft.world.level.storage.loot.LootTable; import net.minecraft.world.level.storage.loot.ValidationContext; import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; @@ -12,11 +15,12 @@ import java.util.List; import java.util.Map; import java.util.Set; +import java.util.concurrent.CompletableFuture; public class BlockLootTablesProvider extends LootTableProvider { - public BlockLootTablesProvider(PackOutput output) { - super(output, Set.of(), ImmutableList.of(new SubProviderEntry(BlockLootTables::new, LootContextParamSets.BLOCK))); + public BlockLootTablesProvider(PackOutput output, CompletableFuture lookupProvider) { + super(output, Set.of(), ImmutableList.of(new SubProviderEntry(BlockLootTables::new, LootContextParamSets.BLOCK)), lookupProvider); } @Override @@ -25,7 +29,7 @@ public BlockLootTablesProvider(PackOutput output) { } @Override - protected void validate(Map map, @NotNull ValidationContext validationtracker) { - map.forEach((id, table) -> table.validate(validationtracker)); + protected void validate(@NotNull WritableRegistry writableregistry, @NotNull ValidationContext validationcontext, ProblemReporter.@NotNull Collector problemreporter$collector) { + super.validate(writableregistry, validationcontext, problemreporter$collector); } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/BlockStatesAndModelsProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/BlockStatesAndModelsProvider.java index 21dd01688..11e3a6bac 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/BlockStatesAndModelsProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/BlockStatesAndModelsProvider.java @@ -28,7 +28,6 @@ protected void registerStatesAndModels() { peripheralBlock(Blocks.CHAT_BOX.get(), "front"); peripheralBlock(Blocks.PLAYER_DETECTOR.get(), "side", "front"); peripheralBlock(Blocks.ME_BRIDGE.get(), "front"); - peripheralBlock(Blocks.RS_BRIDGE.get(), "front"); peripheralBlock(Blocks.ENERGY_DETECTOR.get(), "front", "back"); peripheralBlock(Blocks.PERIPHERAL_CASING.get()); peripheralBlock(Blocks.INVENTORY_MANAGER.get(), "front"); diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java b/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java index 32a3f0c10..f55a203b0 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java @@ -31,7 +31,7 @@ public static void genData(GatherDataEvent event) { CompletableFuture completablefuture = CompletableFuture.supplyAsync(VanillaRegistries::createLookup, Util.backgroundExecutor()); generator.addProvider(event.includeServer(), new BlockTagsProvider(packOutput, completablefuture, existingFileHelper, Registration.BLOCKS)); generator.addProvider(event.includeServer(), new RecipesProvider(packOutput, lookupProvider)); - generator.addProvider(event.includeServer(), new BlockLootTablesProvider(packOutput)); + generator.addProvider(event.includeServer(), new BlockLootTablesProvider(packOutput, lookupProvider)); TurtleUpgradesProvider.generate(generator.getVanillaPack(true), completablefuture); PocketUpgradesProvider.generate(generator.getVanillaPack(true), completablefuture); generator.addProvider(event.includeServer(), new PoiTypeProvider(packOutput, completablefuture, existingFileHelper)); diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/EnUsLanguageProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/EnUsLanguageProvider.java index d54d04f2b..46ec81bd5 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/EnUsLanguageProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/EnUsLanguageProvider.java @@ -59,7 +59,6 @@ private void addBlocks() { addBlock(Blocks.GEO_SCANNER, "Geo Scanner"); addBlock(Blocks.INVENTORY_MANAGER, "Inventory Manager"); addBlock(Blocks.ME_BRIDGE, "ME Bridge"); - addBlock(Blocks.RS_BRIDGE, "RS Bridge"); addBlock(Blocks.NBT_STORAGE, "NBT Storage"); addBlock(Blocks.PERIPHERAL_CASING, "Peripheral Casing"); addBlock(Blocks.PLAYER_DETECTOR, "Player Detector"); @@ -108,7 +107,6 @@ private void addTooltips() { addTooltip(Items.CHUNK_CONTROLLER.get(), "&7A crafting ingredient for the Chunky Turtle."); addTooltip(Blocks.ENVIRONMENT_DETECTOR.get(), "&7This peripheral interacts with the minecraft world."); addTooltip(Blocks.PLAYER_DETECTOR.get(), "&7This peripheral can be used to interact with players, but don't be a stalker."); - addTooltip(Blocks.RS_BRIDGE.get(), "&7The RS Bridge interacts with Refined Storage to manage your items."); addTooltip(Blocks.ME_BRIDGE.get(), "&7The ME Bridge interacts with Applied Energistics to manage your items."); addTooltip(Blocks.CHAT_BOX.get(), "&7Interacts with the ingame chat, can read and write messages."); addTooltip(Blocks.PERIPHERAL_CASING.get(), "&7An empty hull without the love it deserves. Used as a crafting ingredient"); diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java index d59287f20..4e2546048 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java @@ -23,10 +23,10 @@ public class PocketUpgradesProvider { public static void generate(DataGenerator.PackGenerator output, CompletableFuture registries) { var newRegistries = RegistryPatchGenerator.createLookup(registries, Util.make(new RegistrySetBuilder(), builder -> { builder.add(ITurtleUpgrade.REGISTRY, upgrades -> { - upgrades.register(id(CCRegistration.ID.CHATTY_POCKET), new TurtleChatBoxUpgrade(CCRegistration.ID.CHATTY_POCKET, new ItemStack(Blocks.CHAT_BOX.get()))); - upgrades.register(id(CCRegistration.ID.PLAYER_POCKET), new TurtlePlayerDetectorUpgrade(CCRegistration.ID.PLAYER_POCKET, new ItemStack(Blocks.PLAYER_DETECTOR.get()))); - upgrades.register(id(CCRegistration.ID.ENVIRONMENT_POCKET), new TurtleEnvironmentDetectorUpgrade(CCRegistration.ID.ENVIRONMENT_POCKET, new ItemStack(Blocks.ENVIRONMENT_DETECTOR.get()))); - upgrades.register(id(CCRegistration.ID.GEOSCANNER_TURTLE), new TurtleGeoScannerUpgrade(CCRegistration.ID.GEOSCANNER_TURTLE, new ItemStack(Blocks.GEO_SCANNER.get()))); + upgrades.register(id(CCRegistration.ID.CHATTY_POCKET), new TurtleChatBoxUpgrade(new ItemStack(Blocks.CHAT_BOX.get()))); + upgrades.register(id(CCRegistration.ID.PLAYER_POCKET), new TurtlePlayerDetectorUpgrade(new ItemStack(Blocks.PLAYER_DETECTOR.get()))); + upgrades.register(id(CCRegistration.ID.ENVIRONMENT_POCKET), new TurtleEnvironmentDetectorUpgrade(new ItemStack(Blocks.ENVIRONMENT_DETECTOR.get()))); + upgrades.register(id(CCRegistration.ID.GEOSCANNER_TURTLE), new TurtleGeoScannerUpgrade(new ItemStack(Blocks.GEO_SCANNER.get()))); }); })); output.addProvider(o -> new DatapackBuiltinEntriesProvider(o, newRegistries, Set.of(AdvancedPeripherals.MOD_ID))); diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java index 61d5067e6..94c66bafc 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java @@ -25,18 +25,18 @@ public class TurtleUpgradesProvider { public static void generate(DataGenerator.PackGenerator output, CompletableFuture registries) { var newRegistries = RegistryPatchGenerator.createLookup(registries, Util.make(new RegistrySetBuilder(), builder -> { builder.add(ITurtleUpgrade.REGISTRY, upgrades -> { - upgrades.register(id(CCRegistration.ID.CHATTY_TURTLE), new TurtleChatBoxUpgrade(CCRegistration.ID.CHATTY_TURTLE, new ItemStack(Blocks.CHAT_BOX.get()))); - upgrades.register(id(CCRegistration.ID.PLAYER_TURTLE), new TurtlePlayerDetectorUpgrade(CCRegistration.ID.PLAYER_TURTLE, new ItemStack(Blocks.PLAYER_DETECTOR.get()))); - upgrades.register(id(CCRegistration.ID.ENVIRONMENT_TURTLE), new TurtleEnvironmentDetectorUpgrade(CCRegistration.ID.ENVIRONMENT_TURTLE, new ItemStack(Blocks.ENVIRONMENT_DETECTOR.get()))); - upgrades.register(id(CCRegistration.ID.CHUNKY_TURTLE), new TurtleChunkyUpgrade(CCRegistration.ID.CHUNKY_TURTLE, new ItemStack(Items.CHUNK_CONTROLLER))); - upgrades.register(id(CCRegistration.ID.GEOSCANNER_TURTLE), new TurtleGeoScannerUpgrade(CCRegistration.ID.GEOSCANNER_TURTLE, new ItemStack(Blocks.ENVIRONMENT_DETECTOR.get()))); - upgrades.register(id(CCRegistration.ID.COMPASS_TURTLE), new TurtleCompassUpgrade(CCRegistration.ID.COMPASS_TURTLE, new ItemStack(net.minecraft.world.item.Items.COMPASS))); - upgrades.register(id(CCRegistration.ID.WEAK_AUTOMATA), new WeakAutomata(CCRegistration.ID.WEAK_AUTOMATA, new ItemStack(Items.WEAK_AUTOMATA_CORE.get()))); - upgrades.register(id(CCRegistration.ID.END_AUTOMATA), new EndAutomata(CCRegistration.ID.END_AUTOMATA, new ItemStack(Items.END_AUTOMATA_CORE.get()))); - upgrades.register(id(CCRegistration.ID.HUSBANDRY_AUTOMATA), new HusbandryAutomata(CCRegistration.ID.HUSBANDRY_AUTOMATA, new ItemStack(Items.HUSBANDRY_AUTOMATA_CORE.get()))); - upgrades.register(id(CCRegistration.ID.OP_WEAK_AUTOMATA), new OverpoweredWeakAutomata(CCRegistration.ID.OP_WEAK_AUTOMATA, new ItemStack(Items.OVERPOWERED_WEAK_AUTOMATA_CORE.get()))); - upgrades.register(id(CCRegistration.ID.OP_END_AUTOMATA), new OverpoweredEndAutomata(CCRegistration.ID.OP_END_AUTOMATA, new ItemStack(Items.OVERPOWERED_END_AUTOMATA_CORE.get()))); - upgrades.register(id(CCRegistration.ID.OP_HUSBANDRY_AUTOMATA), new OverpoweredHusbandryAutomata(CCRegistration.ID.OP_HUSBANDRY_AUTOMATA, new ItemStack(Items.OVERPOWERED_HUSBANDRY_AUTOMATA_CORE.get()))); + upgrades.register(id(CCRegistration.ID.CHATTY_TURTLE), new TurtleChatBoxUpgrade(new ItemStack(Blocks.CHAT_BOX.get()))); + upgrades.register(id(CCRegistration.ID.PLAYER_TURTLE), new TurtlePlayerDetectorUpgrade(new ItemStack(Blocks.PLAYER_DETECTOR.get()))); + upgrades.register(id(CCRegistration.ID.ENVIRONMENT_TURTLE), new TurtleEnvironmentDetectorUpgrade(new ItemStack(Blocks.ENVIRONMENT_DETECTOR.get()))); + upgrades.register(id(CCRegistration.ID.CHUNKY_TURTLE), new TurtleChunkyUpgrade(new ItemStack(Items.CHUNK_CONTROLLER))); + upgrades.register(id(CCRegistration.ID.GEOSCANNER_TURTLE), new TurtleGeoScannerUpgrade(new ItemStack(Blocks.ENVIRONMENT_DETECTOR.get()))); + upgrades.register(id(CCRegistration.ID.COMPASS_TURTLE), new TurtleCompassUpgrade(new ItemStack(net.minecraft.world.item.Items.COMPASS))); + upgrades.register(id(CCRegistration.ID.WEAK_AUTOMATA), new WeakAutomata(new ItemStack(Items.WEAK_AUTOMATA_CORE.get()))); + upgrades.register(id(CCRegistration.ID.END_AUTOMATA), new EndAutomata(new ItemStack(Items.END_AUTOMATA_CORE.get()))); + upgrades.register(id(CCRegistration.ID.HUSBANDRY_AUTOMATA), new HusbandryAutomata(new ItemStack(Items.HUSBANDRY_AUTOMATA_CORE.get()))); + upgrades.register(id(CCRegistration.ID.OP_WEAK_AUTOMATA), new OverpoweredWeakAutomata(new ItemStack(Items.OVERPOWERED_WEAK_AUTOMATA_CORE.get()))); + upgrades.register(id(CCRegistration.ID.OP_END_AUTOMATA), new OverpoweredEndAutomata(new ItemStack(Items.OVERPOWERED_END_AUTOMATA_CORE.get()))); + upgrades.register(id(CCRegistration.ID.OP_HUSBANDRY_AUTOMATA), new OverpoweredHusbandryAutomata(new ItemStack(Items.OVERPOWERED_HUSBANDRY_AUTOMATA_CORE.get()))); }); })); output.addProvider(o -> new DatapackBuiltinEntriesProvider(o, newRegistries, Set.of(AdvancedPeripherals.MOD_ID))); diff --git a/src/main/java/de/srendi/advancedperipherals/common/events/Events.java b/src/main/java/de/srendi/advancedperipherals/common/events/Events.java index 3a0178bc0..41b402122 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/events/Events.java +++ b/src/main/java/de/srendi/advancedperipherals/common/events/Events.java @@ -22,6 +22,8 @@ import net.neoforged.neoforge.event.CommandEvent; import net.neoforged.neoforge.event.ServerChatEvent; import net.neoforged.neoforge.event.entity.player.PlayerEvent; +import vazkii.patchouli.api.PatchouliAPI; +import vazkii.patchouli.common.base.PatchouliAPIImpl; import java.util.function.Consumer; @@ -45,10 +47,8 @@ public static void onWorldJoin(PlayerEvent.PlayerLoggedInEvent event) { // See https://vazkiimods.github.io/Patchouli/docs/patchouli-basics/giving-new if (APConfig.WORLD_CONFIG.givePlayerBookOnJoin.get() && APAddons.patchouliLoaded) { if (!hasPlayedBefore(player)) { - ItemStack book = new ItemStack(ItemUtil.getRegistryEntry("patchouli:guide_book", BuiltInRegistries.ITEM)); - CompoundTag nbt = new CompoundTag(); - nbt.putString("patchouli:book", "advancedperipherals:manual"); - book.setTag(nbt); + PatchouliAPI.IPatchouliAPI patchouli = new PatchouliAPIImpl(); + ItemStack book = patchouli.getBookStack(AdvancedPeripherals.getRL("manual")); player.addItem(book); } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/items/MemoryCardItem.java b/src/main/java/de/srendi/advancedperipherals/common/items/MemoryCardItem.java index 55ae94e96..8135cb02a 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/items/MemoryCardItem.java +++ b/src/main/java/de/srendi/advancedperipherals/common/items/MemoryCardItem.java @@ -13,10 +13,13 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.List; +import static de.srendi.advancedperipherals.common.setup.DataComponents.OWNER; + public class MemoryCardItem extends BaseItem { public static final String OWNER_NBT_KEY = "ownerId"; @@ -31,14 +34,13 @@ public boolean isEnabled() { } @Override - public void appendHoverText(ItemStack stack, @Nullable Level levelIn, List tooltip, TooltipFlag flagIn) { - super.appendHoverText(stack, levelIn, tooltip, flagIn); - CompoundTag data = stack.getOrCreateTag(); + public void appendHoverText(@NotNull ItemStack stack, @NotNull TooltipContext context, @NotNull List tooltip, @NotNull TooltipFlag flagIn) { + super.appendHoverText(stack, context, tooltip, flagIn); Minecraft minecraft = Minecraft.getInstance(); - if (data.contains(OWNER_NBT_KEY)) { - String username = ClientUUIDCache.getUsername(data.getUUID(OWNER_NBT_KEY), minecraft.player.getUUID()); + if (stack.has(OWNER)) { + String username = ClientUUIDCache.getUsername(stack.get(OWNER), minecraft.player.getUUID()); if (username == null) - username = data.getUUID(OWNER_NBT_KEY).toString(); + username = stack.get(OWNER).toString(); tooltip.add(EnumColor.buildTextComponent(Component.translatable("item.advancedperipherals.tooltip.memory_card.bound", username))); } } @@ -47,13 +49,12 @@ public void appendHoverText(ItemStack stack, @Nullable Level levelIn, List use(Level worldIn, Player playerIn, InteractionHand handIn) { if (!worldIn.isClientSide) { ItemStack stack = playerIn.getItemInHand(handIn); - CompoundTag data = stack.getOrCreateTag(); - if (data.contains(OWNER_NBT_KEY)) { + if (stack.has(OWNER)) { playerIn.displayClientMessage(Component.translatable("text.advancedperipherals.removed_player"), true); - data.remove(OWNER_NBT_KEY); + stack.remove(OWNER); } else { playerIn.displayClientMessage(Component.translatable("text.advancedperipherals.added_player"), true); - data.putUUID(OWNER_NBT_KEY, playerIn.getUUID()); + stack.set(OWNER, playerIn.getUUID()); } } return super.use(worldIn, playerIn, handIn); diff --git a/src/main/java/de/srendi/advancedperipherals/common/items/WeakAutomataCore.java b/src/main/java/de/srendi/advancedperipherals/common/items/WeakAutomataCore.java index 15c11c67b..deca557b6 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/items/WeakAutomataCore.java +++ b/src/main/java/de/srendi/advancedperipherals/common/items/WeakAutomataCore.java @@ -57,15 +57,17 @@ public WeakAutomataCore() { } @Override - public void appendHoverText(ItemStack stack, @Nullable Level worldIn, List tooltip, TooltipFlag flagIn) { - super.appendHoverText(stack, worldIn, tooltip, flagIn); - CompoundTag tag = stack.getOrCreateTag(); + public void appendHoverText(@NotNull ItemStack stack, @NotNull TooltipContext context, @NotNull List tooltip, @NotNull TooltipFlag flagIn) { + super.appendHoverText(stack, context, tooltip, flagIn); + + //TODO + /*CompoundTag tag = stack.getOrCreateTag(); CompoundTag consumedData = tag.getCompound(CONSUMER_ENTITY_COMPOUND); consumedData.getAllKeys().forEach(key -> { WeakAutomataCoreRecord record = AUTOMATA_CORE_REGISTRY.get(key); CompoundTag recordData = consumedData.getCompound(key); tooltip.add(EnumColor.buildTextComponent(Component.literal(String.format("Consumed: %d/%d %s", recordData.getInt(CONSUMED_ENTITY_COUNT), record.getRequiredCount(key), recordData.getString(CONSUMED_ENTITY_NAME))))); - }); + });*/ } @Override @@ -77,7 +79,8 @@ public InteractionResult interactLivingEntity(@NotNull ItemStack stack, @NotNull } String entityType = EntityType.getKey(entity.getType()).toString(); if (AUTOMATA_CORE_REGISTRY.containsKey(entityType)) { - CompoundTag tag = stack.getOrCreateTag(); + //TODO + /*CompoundTag tag = stack.getOrCreateTag(); CompoundTag consumedData = tag.getCompound(CONSUMER_ENTITY_COMPOUND); WeakAutomataCoreRecord record; if (consumedData.isEmpty()) { @@ -97,7 +100,7 @@ record = AUTOMATA_CORE_REGISTRY.get(anyKey.get()); player.setItemInHand(hand, new ItemStack(record.resultSoul)); } tag.put(CONSUMER_ENTITY_COMPOUND, consumedData); - return InteractionResult.SUCCESS; + return InteractionResult.SUCCESS;*/ } return InteractionResult.PASS; } diff --git a/src/main/java/de/srendi/advancedperipherals/common/items/base/BaseBlockItem.java b/src/main/java/de/srendi/advancedperipherals/common/items/base/BaseBlockItem.java index 9f639ea1e..7ddf56ec6 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/items/base/BaseBlockItem.java +++ b/src/main/java/de/srendi/advancedperipherals/common/items/base/BaseBlockItem.java @@ -27,8 +27,8 @@ public BaseBlockItem(Block blockIn) { } @Override - public void appendHoverText(ItemStack stack, @Nullable Level levelIn, List tooltip, TooltipFlag flagIn) { - super.appendHoverText(stack, levelIn, tooltip, flagIn); + public void appendHoverText(@NotNull ItemStack stack, @NotNull TooltipContext context, @NotNull List tooltip, @NotNull TooltipFlag flagIn) { + super.appendHoverText(stack, context, tooltip, flagIn); if (!KeybindUtil.isKeyPressed(KeyBindings.DESCRIPTION_KEYBINDING)) { tooltip.add(EnumColor.buildTextComponent(Component.translatable("item.advancedperipherals.tooltip.show_desc", KeyBindings.DESCRIPTION_KEYBINDING.getTranslatedKeyMessage()))); } else { diff --git a/src/main/java/de/srendi/advancedperipherals/common/items/base/BaseItem.java b/src/main/java/de/srendi/advancedperipherals/common/items/base/BaseItem.java index 6f5c0afd8..4f35c0978 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/items/base/BaseItem.java +++ b/src/main/java/de/srendi/advancedperipherals/common/items/base/BaseItem.java @@ -37,14 +37,16 @@ public InteractionResultHolder use(Level worldIn, Player playerIn, In if (this instanceof IInventoryItem inventoryItem) { ServerPlayer serverPlayerEntity = (ServerPlayer) playerIn; ItemStack stack = playerIn.getItemInHand(handIn); - serverPlayerEntity.openMenu(inventoryItem.createContainer(playerIn, stack), buf -> buf.writeItem(stack)); + + //TODO + //serverPlayerEntity.openMenu(inventoryItem.createContainer(playerIn, stack), buf -> buf.write(stack)); } return super.use(worldIn, playerIn, handIn); } @Override - public void appendHoverText(ItemStack stack, @Nullable Level worldIn, List tooltip, TooltipFlag flagIn) { - super.appendHoverText(stack, worldIn, tooltip, flagIn); + public void appendHoverText(@NotNull ItemStack stack, @NotNull TooltipContext context, @NotNull List tooltip, @NotNull TooltipFlag flagIn) { + super.appendHoverText(stack, context, tooltip, flagIn); if (!KeybindUtil.isKeyPressed(KeyBindings.DESCRIPTION_KEYBINDING)) { tooltip.add(EnumColor.buildTextComponent(Component.translatable("item.advancedperipherals.tooltip.show_desc", KeyBindings.DESCRIPTION_KEYBINDING.getTranslatedKeyMessage()))); } else { diff --git a/src/main/java/de/srendi/advancedperipherals/common/setup/Blocks.java b/src/main/java/de/srendi/advancedperipherals/common/setup/Blocks.java index c00fb2a3d..cc32b4a43 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/setup/Blocks.java +++ b/src/main/java/de/srendi/advancedperipherals/common/setup/Blocks.java @@ -23,7 +23,6 @@ public class Blocks { public static final DeferredHolder> CHAT_BOX = register("chat_box", () -> new APBlockEntityBlock<>(BlockEntityTypes.CHAT_BOX, true), () -> new APBlockItem(Blocks.CHAT_BOX.get(), APConfig.PERIPHERALS_CONFIG.enableChatBox::get)); public static final DeferredHolder> PLAYER_DETECTOR = register("player_detector", PlayerDetectorBlock::new, () -> new APBlockItem(Blocks.PLAYER_DETECTOR.get(), APConfig.PERIPHERALS_CONFIG.enablePlayerDetector::get)); public static final DeferredHolder> ME_BRIDGE = register("me_bridge", () -> new APBlockEntityBlock<>(APAddons.ae2Loaded ? BlockEntityTypes.ME_BRIDGE : null, APAddons.ae2Loaded), () -> new APBlockItem(Blocks.ME_BRIDGE.get(), APConfig.PERIPHERALS_CONFIG.enableMEBridge::get)); - public static final DeferredHolder> RS_BRIDGE = register("rs_bridge", () -> new APBlockEntityBlock<>(APAddons.refinedStorageLoaded ? BlockEntityTypes.RS_BRIDGE : null, false), () -> new APBlockItem(Blocks.RS_BRIDGE.get(), APConfig.PERIPHERALS_CONFIG.enableRSBridge::get)); public static final DeferredHolder> ENERGY_DETECTOR = register("energy_detector", () -> new APBlockEntityBlock<>(BlockEntityTypes.ENERGY_DETECTOR, true), () -> new APBlockItem(Blocks.ENERGY_DETECTOR.get(), APConfig.PERIPHERALS_CONFIG.enableEnergyDetector::get)); public static final DeferredHolder PERIPHERAL_CASING = register("peripheral_casing", BaseBlock::new, () -> new APBlockItem(Blocks.PERIPHERAL_CASING.get(), new Item.Properties().stacksTo(16), () -> true)); public static final DeferredHolder> INVENTORY_MANAGER = register("inventory_manager", () -> new APBlockEntityBlock<>(BlockEntityTypes.INVENTORY_MANAGER, false), () -> new APBlockItem(Blocks.INVENTORY_MANAGER.get(), APConfig.PERIPHERALS_CONFIG.enableInventoryManager::get)); diff --git a/src/main/java/de/srendi/advancedperipherals/common/setup/DataComponents.java b/src/main/java/de/srendi/advancedperipherals/common/setup/DataComponents.java new file mode 100644 index 000000000..2724aaadb --- /dev/null +++ b/src/main/java/de/srendi/advancedperipherals/common/setup/DataComponents.java @@ -0,0 +1,75 @@ +package de.srendi.advancedperipherals.common.setup; + +import com.mojang.serialization.Codec; +import net.minecraft.core.Registry; +import net.minecraft.core.UUIDUtil; +import net.minecraft.core.component.DataComponentPatch; +import net.minecraft.core.component.DataComponentType; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.ComponentSerialization; +import net.minecraft.network.codec.ByteBufCodecs; +import net.minecraft.resources.ResourceKey; +import net.minecraft.util.ExtraCodecs; +import net.neoforged.neoforge.registries.DeferredHolder; + +import java.util.UUID; +import java.util.function.UnaryOperator; + +public class DataComponents { + + public static final DeferredHolder, DataComponentType> ENERGY_RATE_LIMIT = registerInt("energy_rate_limit"); + public static final DeferredHolder, DataComponentType> TURTLE_UPGRADE_STORED_DATA = registerDataComponent("stored_data"); + public static final DeferredHolder, DataComponentType> OWNER = registerUUID("owner_id"); + public static final DeferredHolder, DataComponentType> CHUNKY_ID = registerUUID("chunky_id"); + public static final DeferredHolder, DataComponentType> ROTATION_CHARGE_SETTING = registerInt("rotation_charge_setting"); + public static final DeferredHolder, DataComponentType> FUEL_CONSUMPTION_RATE = registerInt("fuel_consumption_rate"); + + public static void register() { + } + + private static DeferredHolder, DataComponentType> simple(String name, UnaryOperator> operator) { + return Registration.DATA_COMPONENT_TYPES.register(name, () -> operator.apply(DataComponentType.builder()).build()); + } + + private static DeferredHolder, DataComponentType> registerBoolean(String name) { + return simple(name, builder -> builder.persistent(Codec.BOOL) + .networkSynchronized(ByteBufCodecs.BOOL)); + } + + private static DeferredHolder, DataComponentType> registerDataComponent(String name) { + return simple(name, builder -> builder.persistent(DataComponentPatch.CODEC) + .networkSynchronized(DataComponentPatch.STREAM_CODEC)); + } + + private static DeferredHolder, DataComponentType> registerNonNegativeInt(String name) { + return simple(name, builder -> builder.persistent(ExtraCodecs.POSITIVE_INT) + .networkSynchronized(ByteBufCodecs.VAR_INT)); + } + + private static DeferredHolder, DataComponentType> registerInt(String name) { + return simple(name, builder -> builder.persistent(Codec.INT) + .networkSynchronized(ByteBufCodecs.VAR_INT)); + } + + private static DeferredHolder, DataComponentType> registerNonNegativeLong(String name) { + return simple(name, builder -> builder.persistent(Codec.LONG) + .networkSynchronized(ByteBufCodecs.VAR_LONG)); + } + + private static DeferredHolder, DataComponentType> registerUUID(String name) { + return simple(name, builder -> builder.persistent(UUIDUtil.CODEC) + .networkSynchronized(UUIDUtil.STREAM_CODEC)); + } + + private static DeferredHolder, DataComponentType> registerComponent(String name) { + return simple(name, builder -> builder.persistent(ComponentSerialization.FLAT_CODEC) + .networkSynchronized(ComponentSerialization.STREAM_CODEC) + .cacheEncoding()); + } + + private static DeferredHolder, DataComponentType>> registerResourceKey(String name, + ResourceKey> registryKey) { + return simple(name, builder -> builder.persistent(ResourceKey.codec(registryKey)) + .networkSynchronized(ResourceKey.streamCodec(registryKey))); + } +} diff --git a/src/main/java/de/srendi/advancedperipherals/common/setup/Registration.java b/src/main/java/de/srendi/advancedperipherals/common/setup/Registration.java index 4cc942457..bce7ebd8f 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/setup/Registration.java +++ b/src/main/java/de/srendi/advancedperipherals/common/setup/Registration.java @@ -4,6 +4,7 @@ import dan200.computercraft.api.turtle.ITurtleUpgrade; import dan200.computercraft.api.upgrades.UpgradeType; import de.srendi.advancedperipherals.AdvancedPeripherals; +import net.minecraft.core.component.DataComponentType; import net.minecraft.core.registries.Registries; import net.minecraft.world.entity.ai.village.poi.PoiType; import net.minecraft.world.entity.npc.VillagerProfession; @@ -24,6 +25,7 @@ public class Registration { public static final DeferredRegister> TURTLE_SERIALIZER = DeferredRegister.create(ITurtleUpgrade.typeRegistry(), AdvancedPeripherals.MOD_ID); public static final DeferredRegister> POCKET_SERIALIZER = DeferredRegister.create(IPocketUpgrade.typeRegistry(), AdvancedPeripherals.MOD_ID); public static final DeferredRegister CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, AdvancedPeripherals.MOD_ID); + public static final DeferredRegister> DATA_COMPONENT_TYPES = DeferredRegister.create(Registries.DATA_COMPONENT_TYPE, AdvancedPeripherals.MOD_ID); public static void register(IEventBus modEventBus) { BLOCKS.register(modEventBus); diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/DataStorageUtil.java b/src/main/java/de/srendi/advancedperipherals/common/util/DataStorageUtil.java index 0499427cc..ba465be07 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/DataStorageUtil.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/DataStorageUtil.java @@ -1,25 +1,39 @@ package de.srendi.advancedperipherals.common.util; import dan200.computercraft.api.pocket.IPocketAccess; +import dan200.computercraft.api.pocket.IPocketUpgrade; import dan200.computercraft.api.turtle.ITurtleAccess; +import dan200.computercraft.api.turtle.ITurtleUpgrade; import dan200.computercraft.api.turtle.TurtleSide; +import dan200.computercraft.api.upgrades.UpgradeData; import de.srendi.advancedperipherals.common.addons.computercraft.owner.IPeripheralOwner; import de.srendi.advancedperipherals.lib.peripherals.IPeripheralTileEntity; +import net.minecraft.core.component.DataComponentPatch; import net.minecraft.nbt.CompoundTag; import org.jetbrains.annotations.NotNull; +import static de.srendi.advancedperipherals.common.setup.DataComponents.ROTATION_CHARGE_SETTING; + public class DataStorageUtil { - public static CompoundTag getDataStorage(@NotNull ITurtleAccess access, @NotNull TurtleSide side) { - return access.getUpgradeNBTData(side); + public static DataComponentPatch getDataStorage(@NotNull ITurtleAccess access, @NotNull TurtleSide side) { + return access.getUpgradeData(side); + } + + public static void putDataStorage(@NotNull ITurtleAccess access, @NotNull TurtleSide side, DataComponentPatch dataComponent) { + access.setUpgradeData(side, dataComponent); } public static CompoundTag getDataStorage(@NotNull IPeripheralTileEntity tileEntity) { return tileEntity.getPeripheralSettings(); } - public static CompoundTag getDataStorage(@NotNull IPocketAccess pocket) { - return pocket.getUpgradeNBTData(); + public static DataComponentPatch getDataStorage(@NotNull IPocketAccess pocket) { + return pocket.getUpgradeData(); + } + + public static void putDataStorage(@NotNull IPocketAccess pocket, DataComponentPatch dataComponent) { + pocket.setUpgradeData(dataComponent); } /** @@ -33,27 +47,28 @@ public static class RotationCharge { /** * Used for gear rotation animation */ - private static final String ROTATION_CHARGE_SETTING = "rotationCharge"; - public static int get(@NotNull ITurtleAccess access, @NotNull TurtleSide side) { - return getDataStorage(access, side).getInt(ROTATION_CHARGE_SETTING); + return getDataStorage(access, side).get(ROTATION_CHARGE_SETTING.get()).get(); } public static boolean consume(@NotNull ITurtleAccess access, @NotNull TurtleSide side) { - CompoundTag data = getDataStorage(access, side); - int currentCharge = data.getInt(ROTATION_CHARGE_SETTING); + //TODO + /*DataComponentPatch data = getDataStorage(access, side); + int currentCharge = data.get(ROTATION_CHARGE_SETTING.get()).get(); if (currentCharge > 0) { - data.putInt(ROTATION_CHARGE_SETTING, Math.max(0, data.getInt(ROTATION_CHARGE_SETTING) - 1)); + data.(ROTATION_CHARGE_SETTING, Math.max(0, data.getInt(ROTATION_CHARGE_SETTING) - 1)); access.updateUpgradeNBTData(side); return true; - } + }*/ return false; } public static void addCycles(IPeripheralOwner owner, int count) { - CompoundTag data = owner.getDataStorage(); + //TODO + /*CompoundTag data = owner.getDataStorage(); data.putInt(ROTATION_CHARGE_SETTING, Math.max(0, data.getInt(ROTATION_CHARGE_SETTING)) + count * ROTATION_STEPS); owner.markDataStorageDirty(); + */ } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java b/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java index c1adb7fec..7c7a13b75 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java @@ -109,7 +109,7 @@ public static Map stackToObject(@NotNull ItemStack stack) { map.put("count", stack.getCount()); map.put("displayName", stack.getDisplayName().getString()); map.put("maxStackSize", stack.getMaxStackSize()); - map.put("nbt", NBTUtil.toLua(components.)); + //map.put("nbt", NBTUtil.toLua(components.stream().forEach(test -> test.toString()))); map.put("fingerprint", ItemUtil.getFingerprint(stack)); return map; } diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/FakePlayerProviderTurtle.java b/src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/FakePlayerProviderTurtle.java index f174a62e5..b42faf7f3 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/FakePlayerProviderTurtle.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/FakePlayerProviderTurtle.java @@ -1,15 +1,22 @@ package de.srendi.advancedperipherals.common.util.fakeplayer; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; import com.mojang.authlib.GameProfile; import dan200.computercraft.api.turtle.ITurtleAccess; import dan200.computercraft.shared.util.InventoryUtil; import dan200.computercraft.shared.util.WorldUtil; +import mezz.jei.core.collect.MultiMap; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.Holder; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.Container; import net.minecraft.world.InteractionHand; import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.ai.attributes.Attribute; +import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.item.ItemStack; @@ -55,7 +62,9 @@ public static void load(APFakePlayer player, ITurtleAccess turtle) { // Add properties ItemStack activeStack = player.getItemInHand(InteractionHand.MAIN_HAND); if (!activeStack.isEmpty()) { - player.getAttributes().addTransientAttributeModifiers(activeStack.getAttributeModifiers(EquipmentSlot.MAINHAND)); + HashMultimap, AttributeModifier> attributes = HashMultimap.create(); + activeStack.getAttributeModifiers().modifiers().forEach(entry -> attributes.put(entry.attribute(), entry.modifier())); + player.getAttributes().addTransientAttributeModifiers(attributes); } } @@ -66,7 +75,9 @@ public static void unload(APFakePlayer player, ITurtleAccess turtle) { // Remove properties ItemStack activeStack = player.getItemInHand(InteractionHand.MAIN_HAND); if (!activeStack.isEmpty()) { - player.getAttributes().removeAttributeModifiers(activeStack.getAttributeModifiers(EquipmentSlot.MAINHAND)); + HashMultimap, AttributeModifier> attributes = HashMultimap.create(); + activeStack.getAttributeModifiers().modifiers().forEach(entry -> attributes.put(entry.attribute(), entry.modifier())); + player.getAttributes().removeAttributeModifiers(attributes); } // Copy primary items into turtle inventory and then insert/drop the rest diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidFilter.java b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidFilter.java index e34aee6d1..b95b004d0 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidFilter.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidFilter.java @@ -17,6 +17,7 @@ import java.util.Map; +//TODO tag public class FluidFilter { private Fluid fluid = Fluids.EMPTY; @@ -74,7 +75,7 @@ public static Pair parse(Map item) { public static FluidFilter fromStack(FluidStack stack) { FluidFilter filter = empty(); filter.fluid = stack.getFluid(); - filter.nbt = stack.hasTag() ? stack.getTag() : null; + //filter.nbt = stack.hasTag() ? stack.getTag() : null; return filter; } @@ -88,7 +89,7 @@ public boolean isEmpty() { public FluidStack toFluidStack() { var result = new FluidStack(fluid, count); - result.setTag(nbt != null ? nbt.copy() : null); + //result.setTag(nbt != null ? nbt.copy() : null); return result; } @@ -109,9 +110,9 @@ public boolean test(FluidStack stack) { if (tag != null && !stack.getFluid().is(tag)) { return false; } - if (nbt != null && !stack.getOrCreateTag().equals(nbt)) { - return false; - } + //if (nbt != null && !stack.getOrCreateTag().equals(nbt)) { + // return false; + //} return true; } diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidUtil.java b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidUtil.java index e7476d15f..548584de8 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidUtil.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidUtil.java @@ -73,7 +73,7 @@ public static IFluidHandler getHandlerFromName(@NotNull IComputerAccess access, @NotNull public static String getFingerprint(@NotNull FluidStack stack) { - String fingerprint = stack.getOrCreateTag() + getRegistryKey(stack).toString() + stack.getDisplayName().getString(); + String fingerprint = stack.getComponents() + getRegistryKey(stack).toString() + stack.getDisplayName().getString(); try { byte[] bytesOfHash = fingerprint.getBytes(StandardCharsets.UTF_8); MessageDigest md = MessageDigest.getInstance("MD5"); diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemFilter.java b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemFilter.java index a592c4e6f..46fc0d0bd 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemFilter.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemFilter.java @@ -17,6 +17,7 @@ import java.util.Map; +//TODO tag public class ItemFilter { private Item item = Items.AIR; @@ -94,7 +95,7 @@ public static Pair parse(Map item) { public static ItemFilter fromStack(ItemStack stack) { ItemFilter filter = empty(); filter.item = stack.getItem(); - filter.nbt = stack.hasTag() ? stack.getTag() : null; + //filter.nbt = stack.hasTag() ? stack.getTag() : null; return filter; } @@ -108,7 +109,7 @@ public boolean isEmpty() { public ItemStack toItemStack() { var result = new ItemStack(item, count); - result.setTag(nbt != null ? nbt.copy() : null); + //result.setTag(nbt != null ? nbt.copy() : null); return result; } @@ -124,9 +125,9 @@ public boolean test(ItemStack stack) { if (tag != null && !stack.is(tag)) { return false; } - if (nbt != null && !stack.getOrCreateTag().equals(nbt)) { - return false; - } + //if (nbt != null && !stack.getOrCreateTag().equals(nbt)) { + // return false; + //} return true; } diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemUtil.java b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemUtil.java index 8a49cdc96..27edfcbd8 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemUtil.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemUtil.java @@ -1,7 +1,12 @@ package de.srendi.advancedperipherals.common.util.inventory; +import dan200.computercraft.api.pocket.IPocketUpgrade; +import dan200.computercraft.api.turtle.ITurtleUpgrade; +import dan200.computercraft.api.upgrades.UpgradeData; import dan200.computercraft.shared.ModRegistry; import de.srendi.advancedperipherals.AdvancedPeripherals; +import de.srendi.advancedperipherals.common.setup.CCRegistration; +import de.srendi.advancedperipherals.common.setup.Registration; import de.srendi.advancedperipherals.common.util.StringUtil; import net.minecraft.ResourceLocationException; import net.minecraft.core.NonNullList; @@ -53,7 +58,7 @@ public static T getRegistryEntry(String name, Registry forgeRegistry) { * @return A generated MD5 hash from the item stack */ public static String getFingerprint(ItemStack stack) { - String fingerprint = stack.getOrCreateTag() + getRegistryKey(stack).toString() + stack.getDisplayName().getString(); + String fingerprint = stack.getComponents() + getRegistryKey(stack).toString() + stack.getDisplayName().getString(); try { byte[] bytesOfHash = fingerprint.getBytes(StandardCharsets.UTF_8); MessageDigest md = MessageDigest.getInstance("MD5"); @@ -65,18 +70,6 @@ public static String getFingerprint(ItemStack stack) { return ""; } - public static ItemStack makeTurtle(Item turtle, String upgrade) { - ItemStack stack = new ItemStack(turtle); - stack.getOrCreateTag().putString("RightUpgrade", upgrade); - return stack; - } - - public static ItemStack makePocket(Item turtle, String upgrade) { - ItemStack stack = new ItemStack(turtle); - stack.getOrCreateTag().putString("Upgrade", upgrade); - return stack; - } - //Gathers all items in handler and returns them public static List getItemsFromItemHandler(IItemHandler handler) { List items = new ArrayList<>(handler.getSlots()); @@ -87,17 +80,6 @@ public static List getItemsFromItemHandler(IItemHandler handler) { return items; } - public static void addComputerItemToTab(ResourceLocation turtleID, ResourceLocation pocketID, NonNullList items) { - if (turtleID != null) { - items.add(makeTurtle(TURTLE_ADVANCED, turtleID.toString())); - items.add(makeTurtle(TURTLE_NORMAL, turtleID.toString())); - } - if (pocketID != null) { - items.add(makePocket(POCKET_ADVANCED, pocketID.toString())); - items.add(makePocket(POCKET_NORMAL, pocketID.toString())); - } - } - public static ResourceLocation getRegistryKey(Item item) { return BuiltInRegistries.ITEM.getKey(item); } diff --git a/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrades.java b/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrades.java index 079f8fe4e..8b85c688f 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrades.java +++ b/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrades.java @@ -58,14 +58,14 @@ public static void registerVillagerTrades(VillagerTradesEvent event) { .setXp(4) .build(); - TradeBuilder.createTrade(event, ItemUtil.makeTurtle(ItemUtil.TURTLE_NORMAL, CCRegistration.ID.ENVIRONMENT_TURTLE.toString()), VillagerTrade.Type.ITEM_FOR_EMERALD, 4, 3) + /*TradeBuilder.createTrade(event, ItemUtil.makeTurtle(ItemUtil.TURTLE_NORMAL, CCRegistration.ID.ENVIRONMENT_TURTLE.toString()), VillagerTrade.Type.ITEM_FOR_EMERALD, 4, 3) .setMaxUses(4) .setXp(5) .build(); TradeBuilder.createTrade(event, ItemUtil.makePocket(ItemUtil.POCKET_ADVANCED, CCRegistration.ID.PLAYER_POCKET.toString()), VillagerTrade.Type.ITEM_FOR_EMERALD, 4, 3) .setMaxUses(4) .setXp(7) - .build(); + .build();*/ TradeBuilder.createTrade(event, Items.CHUNK_CONTROLLER.get(), VillagerTrade.Type.EMERALD_FOR_ITEM, 5, 3) .setMaxUses(6) .setXp(8) diff --git a/src/main/java/de/srendi/advancedperipherals/lib/turtle/ClockwiseAnimatedTurtleUpgrade.java b/src/main/java/de/srendi/advancedperipherals/lib/turtle/ClockwiseAnimatedTurtleUpgrade.java index ee12b191b..9af0ce14e 100644 --- a/src/main/java/de/srendi/advancedperipherals/lib/turtle/ClockwiseAnimatedTurtleUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/lib/turtle/ClockwiseAnimatedTurtleUpgrade.java @@ -10,6 +10,8 @@ import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; +import static de.srendi.advancedperipherals.common.setup.DataComponents.TURTLE_UPGRADE_STORED_DATA; + public abstract class ClockwiseAnimatedTurtleUpgrade> extends PeripheralTurtleUpgrade { public static final String STORED_DATA_TAG = "storedData"; @@ -56,7 +58,7 @@ public ItemStack getUpgradeItem(DataComponentPatch upgradeData) { @Override public DataComponentPatch getUpgradeData(ItemStack stack) { - var storedData = stack.get(STORED_DATA_TAG); + var storedData = stack.get(TURTLE_UPGRADE_STORED_DATA); if (storedData == null) return DataComponentPatch.EMPTY; return storedData; @@ -64,10 +66,10 @@ public DataComponentPatch getUpgradeData(ItemStack stack) { @Override public boolean isItemSuitable(@NotNull ItemStack stack) { - if (stack.getTagElement(STORED_DATA_TAG) == null) + if (!stack.has(TURTLE_UPGRADE_STORED_DATA)) return super.isItemSuitable(stack); var tweakedStack = stack.copy(); - tweakedStack.getOrCreateTag().remove(STORED_DATA_TAG); + tweakedStack.remove(TURTLE_UPGRADE_STORED_DATA); return super.isItemSuitable(tweakedStack); } diff --git a/src/main/java/de/srendi/advancedperipherals/network/APNetworking.java b/src/main/java/de/srendi/advancedperipherals/network/APNetworking.java index 46e588967..05f543d41 100644 --- a/src/main/java/de/srendi/advancedperipherals/network/APNetworking.java +++ b/src/main/java/de/srendi/advancedperipherals/network/APNetworking.java @@ -1,9 +1,6 @@ package de.srendi.advancedperipherals.network; import de.srendi.advancedperipherals.AdvancedPeripherals; -import de.srendi.advancedperipherals.network.toclient.ToastToClientPacket; -import de.srendi.advancedperipherals.network.toclient.UsernameToCachePacket; -import de.srendi.advancedperipherals.network.toserver.RetrieveUsernamePacket; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; import net.minecraft.server.level.ServerPlayer; import net.neoforged.bus.api.SubscribeEvent; @@ -19,10 +16,10 @@ public class APNetworking { private static final String PROTOCOL_VERSION = ModLoadingContext.get().getActiveContainer().getModInfo().getVersion().toString(); public static void init(PayloadRegistrar registrar) { - registrar.playToClient(ToastToClientPacket.ID, ToastToClientPacket::decode, handler -> handler); - registrar.playToClient(UsernameToCachePacket.ID, UsernameToCachePacket::decode, handler -> handler.client(IAPPacket::handlePacket)); + //registrar.playToClient(ToastToClientPacket.ID, ToastToClientPacket::decode, handler -> handler); + //registrar.playToClient(UsernameToCachePacket.ID, UsernameToCachePacket::decode, handler -> handler.client(IAPPacket::handlePacket)); - registrar.playToServer(RetrieveUsernamePacket.ID, RetrieveUsernamePacket::decode, handler -> handler.server(IAPPacket::handlePacket)); + //registrar.playToServer(RetrieveUsernamePacket.ID, RetrieveUsernamePacket::decode, handler -> handler.server(IAPPacket::handlePacket)); } @SubscribeEvent diff --git a/src/main/java/de/srendi/advancedperipherals/network/toclient/ToastToClientPacket.java b/src/main/java/de/srendi/advancedperipherals/network/toclient/ToastToClientPacket.java index 01b025ac4..b528e170f 100644 --- a/src/main/java/de/srendi/advancedperipherals/network/toclient/ToastToClientPacket.java +++ b/src/main/java/de/srendi/advancedperipherals/network/toclient/ToastToClientPacket.java @@ -4,7 +4,9 @@ import de.srendi.advancedperipherals.common.util.ToastUtil; import de.srendi.advancedperipherals.network.IAPPacket; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.chat.Component; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; import net.minecraft.resources.ResourceLocation; import net.neoforged.fml.loading.FMLEnvironment; import net.neoforged.neoforge.network.handling.IPayloadContext; @@ -22,8 +24,8 @@ public ToastToClientPacket(Component title, Component component) { this.component = component; } - public static ToastToClientPacket decode(FriendlyByteBuf buffer) { - return new ToastToClientPacket(buffer.read(), buffer.readComponent()); + public static ToastToClientPacket decode(RegistryFriendlyByteBuf buffer) { + return null; // new ToastToClientPacket(buffer.compo, buffer.readComponent()); } @Override @@ -36,7 +38,7 @@ public void handle(@NotNull IPayloadContext context) { ToastUtil.displayToast(title, component); } - @Override + /*@Override public void write(@NotNull FriendlyByteBuf buffer) { buffer.writeComponent(this.title); buffer.writeComponent(this.component); @@ -46,6 +48,10 @@ public void write(@NotNull FriendlyByteBuf buffer) { @Override public ResourceLocation id() { return ID; - } + }*/ + @Override + public Type type() { + return null; + } } diff --git a/src/main/java/de/srendi/advancedperipherals/network/toclient/UsernameToCachePacket.java b/src/main/java/de/srendi/advancedperipherals/network/toclient/UsernameToCachePacket.java index f08476332..f418ce5be 100644 --- a/src/main/java/de/srendi/advancedperipherals/network/toclient/UsernameToCachePacket.java +++ b/src/main/java/de/srendi/advancedperipherals/network/toclient/UsernameToCachePacket.java @@ -32,7 +32,7 @@ public void handle(IPayloadContext context) { ClientUUIDCache.putUsername(uuid, username); } - @Override + /*@Override public void write(FriendlyByteBuf buffer) { buffer.writeUUID(uuid); buffer.writeUtf(username); @@ -42,11 +42,8 @@ public void write(FriendlyByteBuf buffer) { @Override public ResourceLocation id() { return ID; - } + }*/ - /** - * @return - */ @Override public Type type() { return null; diff --git a/src/main/java/de/srendi/advancedperipherals/network/toserver/RetrieveUsernamePacket.java b/src/main/java/de/srendi/advancedperipherals/network/toserver/RetrieveUsernamePacket.java index 125ea8030..c436ac96d 100644 --- a/src/main/java/de/srendi/advancedperipherals/network/toserver/RetrieveUsernamePacket.java +++ b/src/main/java/de/srendi/advancedperipherals/network/toserver/RetrieveUsernamePacket.java @@ -47,7 +47,7 @@ public void handle(IPayloadContext context) { APNetworking.sendTo(player, new UsernameToCachePacket(gameProfile.get().getId(), gameProfile.get().getName())); } - @Override + /*@Override public void write(FriendlyByteBuf buffer) { buffer.writeUUID(uuid); buffer.writeUUID(requester); @@ -57,11 +57,8 @@ public void write(FriendlyByteBuf buffer) { @Override public ResourceLocation id() { return ID; - } + }*/ - /** - * @return - */ @Override public Type type() { return null; diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index 12aa70070..da4147bc4 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -1,5 +1,7 @@ public net.minecraft.world.level.block.entity.BeaconBlockEntity primaryPower # primaryPower public net.minecraft.world.level.block.entity.BeaconBlockEntity secondaryPower # secondaryPower +public net.minecraft.world.level.block.entity.BeaconBlockEntity levels # levels +public net.minecraft.world.level.block.entity.BaseContainerBlockEntity name # name public-f net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool rawTemplates # rawTemplates public-f net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool templates # templates public-f net.minecraft.world.entity.Entity getEyeHeight(Lnet/minecraft/world/entity/Pose;)F # getEyeHeight \ No newline at end of file From c9bdf48916449540abe7dcde1a90419c9c5332a7 Mon Sep 17 00:00:00 2001 From: Srendi Date: Sun, 12 Jan 2025 17:36:04 +0100 Subject: [PATCH 17/57] More component stuff, the project now builds, but it needs extensive testing. Some automata stuff needs more data component porting and I still have no clue how we convert data components to a lua tag and vice versa. We need that for blocks like the ME Bridge or the Item and Fluid Filters --- .../advancedperipherals/APCreativeTab.java | 8 ------ .../client/ClientRegistry.java | 5 ---- .../common/addons/APAddons.java | 1 - .../addons/appliedenergistics/AppEngApi.java | 14 ++++------ .../integrations/BeaconIntegration.java | 1 - .../operations/SimpleFreeOperation.java | 7 +++++ .../operations/SingleOperation.java | 7 +++++ .../operations/SphereOperation.java | 7 +++++ .../owner/BlockEntityPeripheralOwner.java | 13 +++++++++ .../computercraft/owner/IPeripheralOwner.java | 4 +++ .../computercraft/owner/OperationAbility.java | 28 ++++++++++++------- .../owner/PocketPeripheralOwner.java | 13 +++++++++ .../owner/TurtlePeripheralOwner.java | 8 ++++++ .../peripheral/ChatBoxPeripheral.java | 1 - .../peripheral/ChunkyPeripheral.java | 2 -- .../plugins/AutomataEntityTransferPlugin.java | 15 +++++++--- .../plugins/AutomataWarpingPlugin.java | 21 +++++++------- .../pocket/PocketChatBoxUpgrade.java | 1 - .../pocket/PocketEnvironmentUpgrade.java | 1 - .../pocket/PocketGeoScannerUpgrade.java | 1 - .../pocket/PocketPlayerDetectorUpgrade.java | 1 - .../turtles/TurtleChatBoxUpgrade.java | 1 - .../turtles/TurtleChunkyUpgrade.java | 1 - .../turtles/TurtleCompassUpgrade.java | 1 - .../TurtleEnvironmentDetectorUpgrade.java | 3 +- .../turtles/TurtleGeoScannerUpgrade.java | 1 - .../turtles/TurtlePlayerDetectorUpgrade.java | 1 - .../turtles/metaphysics/EndAutomata.java | 1 - .../metaphysics/HusbandryAutomata.java | 1 - .../metaphysics/OverpoweredEndAutomata.java | 1 - .../OverpoweredHusbandryAutomata.java | 1 - .../metaphysics/OverpoweredWeakAutomata.java | 1 - .../turtles/metaphysics/WeakAutomata.java | 1 - .../common/blocks/PlayerDetectorBlock.java | 1 - .../blocks/base/BaseBlockEntityBlock.java | 1 - .../blockentities/InventoryManagerEntity.java | 1 - .../common/commands/APCommands.java | 2 -- .../common/data/BlockLootTables.java | 2 -- .../common/data/BlockLootTablesProvider.java | 6 ++-- .../common/data/DataGenerators.java | 1 - .../common/data/PocketUpgradesProvider.java | 5 +++- .../common/data/TurtleUpgradesProvider.java | 16 +++++++++-- .../common/events/Events.java | 3 -- .../common/items/MemoryCardItem.java | 2 -- .../common/items/WeakAutomataCore.java | 16 ++++------- .../common/items/base/BaseBlockItem.java | 2 -- .../common/items/base/BaseItem.java | 1 - .../common/setup/DataComponents.java | 24 ++++++++++++++-- .../common/util/DataStorageUtil.java | 3 -- .../common/util/LuaConverter.java | 3 -- .../common/util/fakeplayer/APFakePlayer.java | 3 +- .../fakeplayer/FakePlayerProviderTurtle.java | 4 --- .../common/util/inventory/FluidFilter.java | 2 +- .../common/util/inventory/ItemFilter.java | 2 +- .../common/util/inventory/ItemUtil.java | 6 ---- .../common/village/VillageStructures.java | 1 - .../common/village/VillagerTrades.java | 9 ++---- .../peripherals/IDataComponentProvider.java | 9 ++++++ .../lib/peripherals/IPeripheralOperation.java | 2 +- .../ClockwiseAnimatedTurtleUpgrade.java | 1 - .../network/toclient/ToastToClientPacket.java | 1 - .../toclient/UsernameToCachePacket.java | 1 - .../toserver/RetrieveUsernamePacket.java | 1 - 63 files changed, 168 insertions(+), 136 deletions(-) create mode 100644 src/main/java/de/srendi/advancedperipherals/lib/peripherals/IDataComponentProvider.java diff --git a/src/main/java/de/srendi/advancedperipherals/APCreativeTab.java b/src/main/java/de/srendi/advancedperipherals/APCreativeTab.java index 95fc97c4b..5e1ac417b 100644 --- a/src/main/java/de/srendi/advancedperipherals/APCreativeTab.java +++ b/src/main/java/de/srendi/advancedperipherals/APCreativeTab.java @@ -4,28 +4,20 @@ import dan200.computercraft.api.turtle.ITurtleUpgrade; import dan200.computercraft.api.upgrades.UpgradeBase; import dan200.computercraft.api.upgrades.UpgradeData; -import dan200.computercraft.api.upgrades.UpgradeType; import dan200.computercraft.shared.ModRegistry; import dan200.computercraft.shared.pocket.items.PocketComputerItem; import dan200.computercraft.shared.turtle.items.TurtleItem; import dan200.computercraft.shared.util.DataComponentUtil; import de.srendi.advancedperipherals.common.setup.Blocks; -import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.common.setup.Registration; -import de.srendi.advancedperipherals.common.util.inventory.ItemUtil; import net.minecraft.core.Holder; import net.minecraft.core.HolderLookup; -import net.minecraft.core.component.DataComponentType; import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.ItemLike; import net.neoforged.neoforge.registries.DeferredHolder; -import java.util.Collection; import java.util.Objects; -import java.util.Set; import java.util.stream.Stream; public class APCreativeTab { diff --git a/src/main/java/de/srendi/advancedperipherals/client/ClientRegistry.java b/src/main/java/de/srendi/advancedperipherals/client/ClientRegistry.java index f13cc06b3..75ac2c7c5 100644 --- a/src/main/java/de/srendi/advancedperipherals/client/ClientRegistry.java +++ b/src/main/java/de/srendi/advancedperipherals/client/ClientRegistry.java @@ -1,20 +1,15 @@ package de.srendi.advancedperipherals.client; import dan200.computercraft.api.client.turtle.RegisterTurtleModellersEvent; -import dan200.computercraft.api.client.turtle.RegisterTurtleUpgradeModeller; import dan200.computercraft.api.client.turtle.TurtleUpgradeModeller; import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.container.InventoryManagerScreen; import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.common.setup.ContainerTypes; -import net.minecraft.client.gui.screens.MenuScreens; import net.minecraft.client.resources.model.ModelResourceLocation; -import net.minecraft.resources.ResourceLocation; import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; -import net.neoforged.fml.common.Mod; -import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; import net.neoforged.neoforge.client.event.ModelEvent; import net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent; import net.neoforged.neoforge.client.event.RegisterMenuScreensEvent; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java b/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java index 0ea6ce53b..05f707a41 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java @@ -4,7 +4,6 @@ import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.ModList; import net.neoforged.fml.common.EventBusSubscriber; -import net.neoforged.fml.common.Mod; import net.neoforged.fml.event.lifecycle.InterModEnqueueEvent; @EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID, bus = EventBusSubscriber.Bus.MOD) diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java b/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java index 12e3b5122..87fec86f3 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java @@ -18,7 +18,6 @@ import appeng.api.storage.cells.IBasicCellItem; import appeng.blockentity.storage.DriveBlockEntity; import appeng.parts.storagebus.StorageBusPart; -import dan200.computercraft.shared.util.NBTUtil; import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.addons.APAddons; import de.srendi.advancedperipherals.common.util.LuaConverter; @@ -29,7 +28,6 @@ import it.unimi.dsi.fastutil.objects.Object2LongMap; import me.ramidzkh.mekae2.ae2.MekanismKey; import net.minecraft.core.BlockPos; -import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.ItemStack; import net.neoforged.neoforge.capabilities.Capabilities; import net.neoforged.neoforge.fluids.FluidStack; @@ -422,10 +420,10 @@ public static long getUsedItemStorage(IGridNode node) { if (cell.getKeyType().getClass().isAssignableFrom(AEKeyType.items().getClass())) { //if (stack.get() == null) - // continue; + // continue; //TODO - int numOfType = 0;//stack.get().getLongArray("amts").length; - long numItemsInCell = 0;//stack.getTag().getLong("ic"); + int numOfType = 0; //stack.get().getLongArray("amts").length; + long numItemsInCell = 0; //stack.getTag().getLong("ic"); used += ((int) Math.ceil(((double) numItemsInCell) / 8)) + ((long) bytesPerType * numOfType); } @@ -468,10 +466,10 @@ public static long getUsedFluidStorage(IGridNode node) { if (cell.getKeyType().getClass().isAssignableFrom(AEKeyType.fluids().getClass())) { //if (stack.getTag() == null) - // continue; + // continue; //TODO - int numOfType = 0;//stack.getTag().getLongArray("amts").length; - long numBucketsInCell = 0;//stack.getTag().getLong("ic") / 1000; + int numOfType = 0; //stack.getTag().getLongArray("amts").length; + long numBucketsInCell = 0; //stack.getTag().getLong("ic") / 1000; used += ((int) Math.ceil(((double) numBucketsInCell) / 8)) + ((long) bytesPerType * numOfType); } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/integrations/BeaconIntegration.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/integrations/BeaconIntegration.java index 9c9732b2e..9a38fc263 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/integrations/BeaconIntegration.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/integrations/BeaconIntegration.java @@ -2,7 +2,6 @@ import dan200.computercraft.api.lua.LuaFunction; import de.srendi.advancedperipherals.lib.peripherals.APGenericPeripheral; -import net.minecraft.nbt.CompoundTag; import net.minecraft.world.level.block.entity.BeaconBlockEntity; public class BeaconIntegration implements APGenericPeripheral { diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/operations/SimpleFreeOperation.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/operations/SimpleFreeOperation.java index c6d9895cb..abea3d3ab 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/operations/SimpleFreeOperation.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/operations/SimpleFreeOperation.java @@ -1,6 +1,8 @@ package de.srendi.advancedperipherals.common.addons.computercraft.operations; +import de.srendi.advancedperipherals.common.setup.DataComponents; import de.srendi.advancedperipherals.lib.peripherals.IPeripheralOperation; +import net.minecraft.core.component.DataComponentType; import net.neoforged.neoforge.common.ModConfigSpec; import java.util.HashMap; @@ -44,4 +46,9 @@ public Map computerDescription() { data.put("cooldown", cooldown.get()); return data; } + + @Override + public DataComponentType dataComponentType() { + return DataComponents.SIMPLE_FREE_OPERATION.get(); + } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/operations/SingleOperation.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/operations/SingleOperation.java index 5dc17a210..4c6f933e3 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/operations/SingleOperation.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/operations/SingleOperation.java @@ -1,6 +1,8 @@ package de.srendi.advancedperipherals.common.addons.computercraft.operations; +import de.srendi.advancedperipherals.common.setup.DataComponents; import de.srendi.advancedperipherals.lib.peripherals.IPeripheralOperation; +import net.minecraft.core.component.DataComponentType; import net.neoforged.neoforge.common.ModConfigSpec; import java.util.HashMap; @@ -73,6 +75,11 @@ public void addToConfig(ModConfigSpec.Builder builder) { cost = builder.defineInRange(settingsName() + "Cost", defaultCost, 0, Integer.MAX_VALUE); } + @Override + public DataComponentType dataComponentType() { + return DataComponents.SINGLE_OPERATION.get(); + } + public enum DistancePolicy { IGNORED(d -> 1), LINEAR(d -> d), diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/operations/SphereOperation.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/operations/SphereOperation.java index 7e060f148..7d19b9fa5 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/operations/SphereOperation.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/operations/SphereOperation.java @@ -1,7 +1,9 @@ package de.srendi.advancedperipherals.common.addons.computercraft.operations; import com.google.common.math.IntMath; +import de.srendi.advancedperipherals.common.setup.DataComponents; import de.srendi.advancedperipherals.lib.peripherals.IPeripheralOperation; +import net.minecraft.core.component.DataComponentType; import net.neoforged.neoforge.common.ModConfigSpec; import java.util.HashMap; @@ -80,4 +82,9 @@ public SphereOperationContext free() { public SphereOperationContext cost() { return new SphereOperationContext(getMaxCostRadius()); } + + @Override + public DataComponentType dataComponentType() { + return DataComponents.SPHERE_OPERATION.get(); + } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/BlockEntityPeripheralOwner.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/BlockEntityPeripheralOwner.java index a1172b560..274f58711 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/BlockEntityPeripheralOwner.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/BlockEntityPeripheralOwner.java @@ -1,5 +1,6 @@ package de.srendi.advancedperipherals.common.addons.computercraft.owner; +import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.blocks.base.BaseBlock; import de.srendi.advancedperipherals.common.blocks.blockentities.InventoryManagerEntity; import de.srendi.advancedperipherals.common.util.DataStorageUtil; @@ -9,6 +10,7 @@ import net.minecraft.core.Direction; import net.minecraft.core.FrontAndTop; import net.minecraft.core.component.DataComponentPatch; +import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.world.Nameable; import net.minecraft.world.entity.player.Player; @@ -77,9 +79,20 @@ public Player getOwner() { @Override public DataComponentPatch getDataStorage() { + AdvancedPeripherals.debug("Block Entity peripheral at " + getPos() + " tried to use data component storage but it should instead use nbt storage, report to github!", org.apache.logging.log4j.Level.WARN); + return DataComponentPatch.EMPTY; + } + + @Override + public CompoundTag getNbtStorage() { return DataStorageUtil.getDataStorage(tileEntity); } + @Override + public void putDataStorage(DataComponentPatch dataStorage) { + AdvancedPeripherals.debug("Block Entity peripheral at " + getPos() + " tried to use data component storage but it should instead use nbt storage, report to github!", org.apache.logging.log4j.Level.WARN); + } + @Override public void markDataStorageDirty() { tileEntity.setChanged(); diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/IPeripheralOwner.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/IPeripheralOwner.java index c07c0c230..d5b070074 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/IPeripheralOwner.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/IPeripheralOwner.java @@ -6,6 +6,7 @@ import net.minecraft.core.Direction; import net.minecraft.core.FrontAndTop; import net.minecraft.core.component.DataComponentPatch; +import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; @@ -31,6 +32,9 @@ public interface IPeripheralOwner { DataComponentPatch getDataStorage(); + // Not everything from MC uses the new data component system, so we provide a nbt data storage too + CompoundTag getNbtStorage(); + void putDataStorage(DataComponentPatch dataStorage); void markDataStorageDirty(); diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java index 27716fdd4..ffe76817c 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java @@ -11,18 +11,18 @@ import net.minecraft.core.component.DataComponentMap; import net.minecraft.core.component.DataComponentPatch; import net.minecraft.core.component.PatchedDataComponentMap; -import net.minecraft.nbt.CompoundTag; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.sql.Timestamp; import java.time.LocalDateTime; -import java.time.temporal.ChronoUnit; import java.util.HashMap; import java.util.Map; import java.util.function.BiConsumer; import java.util.function.Consumer; +import static de.srendi.advancedperipherals.common.setup.DataComponents.ABILITY_COOLDOWN; + public class OperationAbility implements IOwnerAbility, IPeripheralPlugin { private static final String COOLDOWNS_TAG = "cooldowns"; @@ -36,19 +36,27 @@ public OperationAbility(IPeripheralOwner owner) { protected void setCooldown(@NotNull IPeripheralOperation operation, int cooldown) { if (cooldown > 0) { PatchedDataComponentMap patch = PatchedDataComponentMap.fromPatch(DataComponentMap.EMPTY, owner.getDataStorage()); - if (!patch.has(COOLDOWNS_TAG)) patch.put(COOLDOWNS_TAG, new CompoundTag()); - dataStorage.getCompound(COOLDOWNS_TAG).putLong(operation.settingsName(), Timestamp.valueOf(LocalDateTime.now().plus(cooldown, ChronoUnit.MILLIS)).getTime()); + if (!patch.has(ABILITY_COOLDOWN.get())) + patch.set(ABILITY_COOLDOWN.get(), DataComponentPatch.EMPTY); + + PatchedDataComponentMap operationPatch = PatchedDataComponentMap.fromPatch(DataComponentMap.EMPTY, patch.get(ABILITY_COOLDOWN.get())); + operationPatch.set(operation.dataComponentType(), (long) cooldown); + + patch.set(ABILITY_COOLDOWN.get(), operationPatch.asPatch()); + owner.putDataStorage(patch.asPatch()); } } protected int getCooldown(@NotNull IPeripheralOperation operation) { - CompoundTag dataStorage = owner.getDataStorage(); - if (!dataStorage.contains(COOLDOWNS_TAG)) return 0; - CompoundTag cooldowns = dataStorage.getCompound(COOLDOWNS_TAG); - String operationName = operation.settingsName(); - if (!cooldowns.contains(operationName)) return 0; + DataComponentPatch componentPatch = owner.getDataStorage(); + + if (componentPatch.get(ABILITY_COOLDOWN.get()).isEmpty()) + return 0; + DataComponentPatch cooldowns = componentPatch.get(ABILITY_COOLDOWN.get()).get(); + if (cooldowns.get(operation.dataComponentType()).isEmpty()) + return 0; long currentTime = Timestamp.valueOf(LocalDateTime.now()).getTime(); - return (int) Math.max(0, cooldowns.getLong(operationName) - currentTime); + return (int) Math.max(0, cooldowns.get(operation.dataComponentType()).get() - currentTime); } public void registerOperation(@NotNull IPeripheralOperation operation) { diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/PocketPeripheralOwner.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/PocketPeripheralOwner.java index e9754c80d..9d0aead1f 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/PocketPeripheralOwner.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/PocketPeripheralOwner.java @@ -1,6 +1,7 @@ package de.srendi.advancedperipherals.common.addons.computercraft.owner; import dan200.computercraft.api.pocket.IPocketAccess; +import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.configuration.APConfig; import de.srendi.advancedperipherals.common.util.DataStorageUtil; import de.srendi.advancedperipherals.common.util.fakeplayer.APFakePlayer; @@ -8,6 +9,7 @@ import net.minecraft.core.Direction; import net.minecraft.core.FrontAndTop; import net.minecraft.core.component.DataComponentPatch; +import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; @@ -80,6 +82,17 @@ public DataComponentPatch getDataStorage() { return DataStorageUtil.getDataStorage(pocket); } + @Override + public CompoundTag getNbtStorage() { + AdvancedPeripherals.debug("Pocket peripheral at " + getPos() + " tried to use nbt storage but it should instead use data component storage, report to github!", org.apache.logging.log4j.Level.WARN); + return null; + } + + @Override + public void putDataStorage(DataComponentPatch dataStorage) { + DataStorageUtil.putDataStorage(pocket, dataStorage); + } + @Override public void markDataStorageDirty() { //TODO do we still need this? diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/TurtlePeripheralOwner.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/TurtlePeripheralOwner.java index 9683f84a9..faaa446ee 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/TurtlePeripheralOwner.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/TurtlePeripheralOwner.java @@ -4,6 +4,7 @@ import dan200.computercraft.api.turtle.ITurtleAccess; import dan200.computercraft.api.turtle.TurtleSide; import dan200.computercraft.shared.util.InventoryUtil; +import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.util.DataStorageUtil; import de.srendi.advancedperipherals.common.util.fakeplayer.APFakePlayer; import de.srendi.advancedperipherals.common.util.fakeplayer.FakePlayerProviderTurtle; @@ -11,6 +12,7 @@ import net.minecraft.core.Direction; import net.minecraft.core.FrontAndTop; import net.minecraft.core.component.DataComponentPatch; +import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; @@ -72,6 +74,12 @@ public DataComponentPatch getDataStorage() { return DataStorageUtil.getDataStorage(turtle, side); } + @Override + public CompoundTag getNbtStorage() { + AdvancedPeripherals.debug("Turtle peripheral at " + getPos() + " tried to use nbt storage but it should instead use data component storage, report to github!", org.apache.logging.log4j.Level.WARN); + return null; + } + @Override public void putDataStorage(DataComponentPatch dataStorage) { DataStorageUtil.putDataStorage(turtle, side, dataStorage); diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ChatBoxPeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ChatBoxPeripheral.java index 97b14edf7..cca72b69a 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ChatBoxPeripheral.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ChatBoxPeripheral.java @@ -24,7 +24,6 @@ import de.srendi.advancedperipherals.network.APNetworking; import de.srendi.advancedperipherals.network.toclient.ToastToClientPacket; import net.minecraft.core.RegistryAccess; -import net.minecraft.core.registries.Registries; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceKey; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ChunkyPeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ChunkyPeripheral.java index ef1a51752..d21e6656d 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ChunkyPeripheral.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ChunkyPeripheral.java @@ -8,9 +8,7 @@ import de.srendi.advancedperipherals.common.util.ChunkManager; import de.srendi.advancedperipherals.lib.peripherals.BasePeripheral; import net.minecraft.core.component.DataComponentMap; -import net.minecraft.core.component.DataComponentPatch; import net.minecraft.core.component.PatchedDataComponentMap; -import net.minecraft.nbt.CompoundTag; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.ChunkPos; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/plugins/AutomataEntityTransferPlugin.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/plugins/AutomataEntityTransferPlugin.java index 27212e8e7..fd4df79df 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/plugins/AutomataEntityTransferPlugin.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/plugins/AutomataEntityTransferPlugin.java @@ -11,6 +11,8 @@ import de.srendi.advancedperipherals.lib.peripherals.AutomataCorePeripheral; import de.srendi.advancedperipherals.lib.peripherals.IPeripheralOperation; import net.minecraft.core.BlockPos; +import net.minecraft.core.component.DataComponentMap; +import net.minecraft.core.component.PatchedDataComponentMap; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; @@ -26,6 +28,7 @@ import java.util.function.Predicate; import static de.srendi.advancedperipherals.common.addons.computercraft.operations.SingleOperation.CAPTURE_ANIMAL; +import static de.srendi.advancedperipherals.common.setup.DataComponents.ENTITY_TRANSFER; public class AutomataEntityTransferPlugin extends AutomataCorePlugin { @@ -44,19 +47,23 @@ public AutomataEntityTransferPlugin(AutomataCorePeripheral automataCore, Predica } protected boolean isEntityInside() { - return !automataCore.getPeripheralOwner().getDataStorage().getCompound(ENTITY_NBT_KEY).isEmpty(); + return automataCore.getPeripheralOwner().getDataStorage().get(ENTITY_TRANSFER.get()).isPresent(); } protected void saveEntity(CompoundTag data) { - automataCore.getPeripheralOwner().getDataStorage().put(ENTITY_NBT_KEY, data); + PatchedDataComponentMap patch = PatchedDataComponentMap.fromPatch(DataComponentMap.EMPTY, automataCore.getPeripheralOwner().getDataStorage()); + patch.set(ENTITY_TRANSFER.get(), data); + automataCore.getPeripheralOwner().putDataStorage(patch.asPatch()); } protected CompoundTag getEntity() { - return automataCore.getPeripheralOwner().getDataStorage().getCompound(ENTITY_NBT_KEY); + return automataCore.getPeripheralOwner().getDataStorage().get(ENTITY_TRANSFER.get()).get(); } protected void removeEntity() { - automataCore.getPeripheralOwner().getDataStorage().remove(ENTITY_NBT_KEY); + PatchedDataComponentMap patch = PatchedDataComponentMap.fromPatch(DataComponentMap.EMPTY, automataCore.getPeripheralOwner().getDataStorage()); + patch.remove(ENTITY_TRANSFER.get()); + automataCore.getPeripheralOwner().putDataStorage(patch.asPatch()); } @Nullable diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/plugins/AutomataWarpingPlugin.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/plugins/AutomataWarpingPlugin.java index 712ce2c29..012c9440d 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/plugins/AutomataWarpingPlugin.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/plugins/AutomataWarpingPlugin.java @@ -13,6 +13,8 @@ import de.srendi.advancedperipherals.lib.peripherals.AutomataCorePeripheral; import de.srendi.advancedperipherals.lib.peripherals.IPeripheralOperation; import net.minecraft.core.BlockPos; +import net.minecraft.core.component.DataComponentMap; +import net.minecraft.core.component.PatchedDataComponentMap; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.level.Level; import org.jetbrains.annotations.NotNull; @@ -21,12 +23,11 @@ import java.util.Objects; import static de.srendi.advancedperipherals.common.addons.computercraft.operations.SingleOperation.WARP; +import static de.srendi.advancedperipherals.common.setup.DataComponents.POINT_DATA_MARK; +import static de.srendi.advancedperipherals.common.setup.DataComponents.WORLD_DATA_MARK; public class AutomataWarpingPlugin extends AutomataCorePlugin { - private static final String POINT_DATA_MARK = "warp_points"; - private static final String WORLD_DATA_MARK = "warp_world"; - public AutomataWarpingPlugin(AutomataCorePeripheral automataCore) { super(automataCore); } @@ -39,18 +40,18 @@ public AutomataWarpingPlugin(AutomataCorePeripheral automataCore) { @NotNull protected Pair getPointData() { TurtlePeripheralOwner owner = automataCore.getPeripheralOwner(); - CompoundTag settings = owner.getDataStorage(); - if (!settings.contains(WORLD_DATA_MARK)) { - settings.putString(WORLD_DATA_MARK, owner.getLevel().dimension().location().toString()); + PatchedDataComponentMap settings = PatchedDataComponentMap.fromPatch(DataComponentMap.EMPTY, owner.getDataStorage()); + if (!settings.has(WORLD_DATA_MARK.get())) { + settings.set(WORLD_DATA_MARK.get(), owner.getLevel().dimension().location().toString()); } else { - String worldName = settings.getString(WORLD_DATA_MARK); + String worldName = settings.get(WORLD_DATA_MARK.get()); if (!owner.getLevel().dimension().location().toString().equals(worldName)) return Pair.onlyLeft(MethodResult.of(null, "Incorrect world for this upgrade")); } - if (!settings.contains(POINT_DATA_MARK)) - settings.put(POINT_DATA_MARK, new CompoundTag()); + if (!settings.has(POINT_DATA_MARK.get())) + settings.set(POINT_DATA_MARK.get(), new CompoundTag()); - return Pair.onlyRight(settings.getCompound(POINT_DATA_MARK)); + return Pair.onlyRight(settings.get(POINT_DATA_MARK.get())); } private int getWarpCost(SingleOperationContext context) { diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketChatBoxUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketChatBoxUpgrade.java index 1a1ebd248..4a2808520 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketChatBoxUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketChatBoxUpgrade.java @@ -6,7 +6,6 @@ import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.ChatBoxPeripheral; import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.pocket.BasePocketUpgrade; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketEnvironmentUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketEnvironmentUpgrade.java index ab30af21d..0783b7b11 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketEnvironmentUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketEnvironmentUpgrade.java @@ -6,7 +6,6 @@ import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.EnvironmentDetectorPeripheral; import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.pocket.BasePocketUpgrade; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketGeoScannerUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketGeoScannerUpgrade.java index a4bb177e3..b28f3e9c1 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketGeoScannerUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketGeoScannerUpgrade.java @@ -6,7 +6,6 @@ import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.GeoScannerPeripheral; import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.pocket.BasePocketUpgrade; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketPlayerDetectorUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketPlayerDetectorUpgrade.java index b6f8857d8..f35f9854d 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketPlayerDetectorUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketPlayerDetectorUpgrade.java @@ -6,7 +6,6 @@ import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.PlayerDetectorPeripheral; import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.pocket.BasePocketUpgrade; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChatBoxUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChatBoxUpgrade.java index 353a20811..fb38c352d 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChatBoxUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChatBoxUpgrade.java @@ -9,7 +9,6 @@ import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.PeripheralTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChunkyUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChunkyUpgrade.java index 9f90db42b..3e92b8aa5 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChunkyUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleChunkyUpgrade.java @@ -10,7 +10,6 @@ import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.PeripheralTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleCompassUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleCompassUpgrade.java index 2eb2c5b19..f763cc168 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleCompassUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleCompassUpgrade.java @@ -8,7 +8,6 @@ import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.PeripheralTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleEnvironmentDetectorUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleEnvironmentDetectorUpgrade.java index 5a2389ade..44d3ae3e9 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleEnvironmentDetectorUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleEnvironmentDetectorUpgrade.java @@ -9,14 +9,13 @@ import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.PeripheralTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; public class TurtleEnvironmentDetectorUpgrade extends PeripheralTurtleUpgrade { public TurtleEnvironmentDetectorUpgrade(ItemStack stack) { - super(CCRegistration.ID.ENVIRONMENT_TURTLE, stack); + super(CCRegistration.ID.ENVIRONMENT_TURTLE, stack); } @Override diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleGeoScannerUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleGeoScannerUpgrade.java index 8838a2018..c792f83d8 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleGeoScannerUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtleGeoScannerUpgrade.java @@ -9,7 +9,6 @@ import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.PeripheralTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtlePlayerDetectorUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtlePlayerDetectorUpgrade.java index 337aa50ae..f82509e0b 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtlePlayerDetectorUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/TurtlePlayerDetectorUpgrade.java @@ -9,7 +9,6 @@ import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.PeripheralTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/EndAutomata.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/EndAutomata.java index be1b10646..a39459f99 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/EndAutomata.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/EndAutomata.java @@ -8,7 +8,6 @@ import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.ClockwiseAnimatedTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/HusbandryAutomata.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/HusbandryAutomata.java index 5e3726c8d..b4d488267 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/HusbandryAutomata.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/HusbandryAutomata.java @@ -8,7 +8,6 @@ import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.ClockwiseAnimatedTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredEndAutomata.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredEndAutomata.java index 448acb988..453ab3671 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredEndAutomata.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredEndAutomata.java @@ -8,7 +8,6 @@ import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.ClockwiseAnimatedTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredHusbandryAutomata.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredHusbandryAutomata.java index adbe03354..005254867 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredHusbandryAutomata.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredHusbandryAutomata.java @@ -8,7 +8,6 @@ import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.ClockwiseAnimatedTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredWeakAutomata.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredWeakAutomata.java index 301fd7ce5..9e049137a 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredWeakAutomata.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/OverpoweredWeakAutomata.java @@ -8,7 +8,6 @@ import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.ClockwiseAnimatedTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/WeakAutomata.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/WeakAutomata.java index 1051ab5ca..a1d067935 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/WeakAutomata.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/turtles/metaphysics/WeakAutomata.java @@ -8,7 +8,6 @@ import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.turtle.ClockwiseAnimatedTurtleUpgrade; import net.minecraft.client.resources.model.ModelResourceLocation; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/de/srendi/advancedperipherals/common/blocks/PlayerDetectorBlock.java b/src/main/java/de/srendi/advancedperipherals/common/blocks/PlayerDetectorBlock.java index 663bc6a79..b6b329096 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/blocks/PlayerDetectorBlock.java +++ b/src/main/java/de/srendi/advancedperipherals/common/blocks/PlayerDetectorBlock.java @@ -6,7 +6,6 @@ import de.srendi.advancedperipherals.common.configuration.APConfig; import de.srendi.advancedperipherals.common.setup.BlockEntityTypes; import net.minecraft.core.BlockPos; -import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; diff --git a/src/main/java/de/srendi/advancedperipherals/common/blocks/base/BaseBlockEntityBlock.java b/src/main/java/de/srendi/advancedperipherals/common/blocks/base/BaseBlockEntityBlock.java index b3e3bbc11..955424eac 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/blocks/base/BaseBlockEntityBlock.java +++ b/src/main/java/de/srendi/advancedperipherals/common/blocks/base/BaseBlockEntityBlock.java @@ -7,7 +7,6 @@ import net.minecraft.world.Container; import net.minecraft.world.Containers; import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResult; import net.minecraft.world.ItemInteractionResult; import net.minecraft.world.MenuProvider; import net.minecraft.world.entity.LivingEntity; diff --git a/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/InventoryManagerEntity.java b/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/InventoryManagerEntity.java index 64a2f3078..06f7b25cd 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/InventoryManagerEntity.java +++ b/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/InventoryManagerEntity.java @@ -22,7 +22,6 @@ import java.util.UUID; -import static de.srendi.advancedperipherals.common.items.MemoryCardItem.OWNER_NBT_KEY; import static de.srendi.advancedperipherals.common.setup.DataComponents.OWNER; public class InventoryManagerEntity extends PeripheralBlockEntity implements IInventoryBlock { diff --git a/src/main/java/de/srendi/advancedperipherals/common/commands/APCommands.java b/src/main/java/de/srendi/advancedperipherals/common/commands/APCommands.java index 869b987de..b2ccf352f 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/commands/APCommands.java +++ b/src/main/java/de/srendi/advancedperipherals/common/commands/APCommands.java @@ -5,7 +5,6 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.mojang.brigadier.tree.LiteralCommandNode; import dan200.computercraft.core.computer.ComputerSide; -import dan200.computercraft.core.computer.Environment; import dan200.computercraft.shared.ModRegistry; import dan200.computercraft.shared.command.text.ChatHelpers; import dan200.computercraft.shared.command.text.TableBuilder; @@ -24,7 +23,6 @@ import net.minecraft.server.level.ServerPlayer; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; -import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.event.RegisterCommandsEvent; import java.util.Comparator; diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/BlockLootTables.java b/src/main/java/de/srendi/advancedperipherals/common/data/BlockLootTables.java index 7e6be38ed..858040054 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/BlockLootTables.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/BlockLootTables.java @@ -2,8 +2,6 @@ import de.srendi.advancedperipherals.common.setup.Registration; import net.minecraft.core.HolderLookup; -import net.minecraft.core.RegistryAccess; -import net.minecraft.core.registries.Registries; import net.minecraft.data.loot.BlockLootSubProvider; import net.minecraft.world.flag.FeatureFlags; import net.minecraft.world.level.block.Block; diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/BlockLootTablesProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/BlockLootTablesProvider.java index 6244db213..c64a6142a 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/BlockLootTablesProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/BlockLootTablesProvider.java @@ -5,7 +5,6 @@ import net.minecraft.core.WritableRegistry; import net.minecraft.data.PackOutput; import net.minecraft.data.loot.LootTableProvider; -import net.minecraft.resources.ResourceLocation; import net.minecraft.util.ProblemReporter; import net.minecraft.world.level.storage.loot.LootTable; import net.minecraft.world.level.storage.loot.ValidationContext; @@ -13,7 +12,6 @@ import org.jetbrains.annotations.NotNull; import java.util.List; -import java.util.Map; import java.util.Set; import java.util.concurrent.CompletableFuture; @@ -29,7 +27,7 @@ public BlockLootTablesProvider(PackOutput output, CompletableFuture writableregistry, @NotNull ValidationContext validationcontext, ProblemReporter.@NotNull Collector problemreporter$collector) { - super.validate(writableregistry, validationcontext, problemreporter$collector); + protected void validate(@NotNull WritableRegistry writableregistry, @NotNull ValidationContext validationcontext, ProblemReporter.@NotNull Collector collector) { + super.validate(writableregistry, validationcontext, collector); } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java b/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java index f55a203b0..2317e3385 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java @@ -9,7 +9,6 @@ import net.minecraft.data.registries.VanillaRegistries; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; -import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.common.data.ExistingFileHelper; import net.neoforged.neoforge.data.event.GatherDataEvent; diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java index 4e2546048..c5f516108 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java @@ -2,7 +2,10 @@ import dan200.computercraft.api.turtle.ITurtleUpgrade; import de.srendi.advancedperipherals.AdvancedPeripherals; -import de.srendi.advancedperipherals.common.addons.computercraft.turtles.*; +import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtleChatBoxUpgrade; +import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtleEnvironmentDetectorUpgrade; +import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtleGeoScannerUpgrade; +import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtlePlayerDetectorUpgrade; import de.srendi.advancedperipherals.common.setup.Blocks; import de.srendi.advancedperipherals.common.setup.CCRegistration; import net.minecraft.Util; diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java index 94c66bafc..a8b667217 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java @@ -2,8 +2,18 @@ import dan200.computercraft.api.turtle.ITurtleUpgrade; import de.srendi.advancedperipherals.AdvancedPeripherals; -import de.srendi.advancedperipherals.common.addons.computercraft.turtles.*; -import de.srendi.advancedperipherals.common.addons.computercraft.turtles.metaphysics.*; +import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtleChatBoxUpgrade; +import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtleChunkyUpgrade; +import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtleCompassUpgrade; +import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtleEnvironmentDetectorUpgrade; +import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtleGeoScannerUpgrade; +import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtlePlayerDetectorUpgrade; +import de.srendi.advancedperipherals.common.addons.computercraft.turtles.metaphysics.EndAutomata; +import de.srendi.advancedperipherals.common.addons.computercraft.turtles.metaphysics.HusbandryAutomata; +import de.srendi.advancedperipherals.common.addons.computercraft.turtles.metaphysics.OverpoweredEndAutomata; +import de.srendi.advancedperipherals.common.addons.computercraft.turtles.metaphysics.OverpoweredHusbandryAutomata; +import de.srendi.advancedperipherals.common.addons.computercraft.turtles.metaphysics.OverpoweredWeakAutomata; +import de.srendi.advancedperipherals.common.addons.computercraft.turtles.metaphysics.WeakAutomata; import de.srendi.advancedperipherals.common.setup.Blocks; import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.common.setup.Items; @@ -46,4 +56,4 @@ public static ResourceKey id(ResourceLocation id) { return ITurtleUpgrade.createKey(id); } -} \ No newline at end of file +} diff --git a/src/main/java/de/srendi/advancedperipherals/common/events/Events.java b/src/main/java/de/srendi/advancedperipherals/common/events/Events.java index 41b402122..e03bb9d70 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/events/Events.java +++ b/src/main/java/de/srendi/advancedperipherals/common/events/Events.java @@ -7,10 +7,8 @@ import de.srendi.advancedperipherals.common.addons.APAddons; import de.srendi.advancedperipherals.common.configuration.APConfig; import de.srendi.advancedperipherals.common.util.Pair; -import de.srendi.advancedperipherals.common.util.inventory.ItemUtil; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.arguments.MessageArgument; -import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; @@ -18,7 +16,6 @@ import net.neoforged.bus.api.EventPriority; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; -import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.event.CommandEvent; import net.neoforged.neoforge.event.ServerChatEvent; import net.neoforged.neoforge.event.entity.player.PlayerEvent; diff --git a/src/main/java/de/srendi/advancedperipherals/common/items/MemoryCardItem.java b/src/main/java/de/srendi/advancedperipherals/common/items/MemoryCardItem.java index 8135cb02a..1f1cb75cd 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/items/MemoryCardItem.java +++ b/src/main/java/de/srendi/advancedperipherals/common/items/MemoryCardItem.java @@ -5,7 +5,6 @@ import de.srendi.advancedperipherals.common.items.base.BaseItem; import de.srendi.advancedperipherals.common.util.EnumColor; import net.minecraft.client.Minecraft; -import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResultHolder; @@ -14,7 +13,6 @@ import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.util.List; diff --git a/src/main/java/de/srendi/advancedperipherals/common/items/WeakAutomataCore.java b/src/main/java/de/srendi/advancedperipherals/common/items/WeakAutomataCore.java index deca557b6..c2631efc5 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/items/WeakAutomataCore.java +++ b/src/main/java/de/srendi/advancedperipherals/common/items/WeakAutomataCore.java @@ -2,29 +2,24 @@ import de.srendi.advancedperipherals.common.configuration.APConfig; import de.srendi.advancedperipherals.common.setup.Items; -import de.srendi.advancedperipherals.common.util.EnumColor; import de.srendi.advancedperipherals.lib.metaphysics.IFeedableAutomataCore; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; -import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; -import net.minecraft.world.level.Level; import net.neoforged.neoforge.common.util.FakePlayer; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Optional; public class WeakAutomataCore extends APItem implements IFeedableAutomataCore { @@ -78,9 +73,10 @@ public InteractionResult interactLivingEntity(@NotNull ItemStack stack, @NotNull return InteractionResult.FAIL; } String entityType = EntityType.getKey(entity.getType()).toString(); - if (AUTOMATA_CORE_REGISTRY.containsKey(entityType)) { - //TODO - /*CompoundTag tag = stack.getOrCreateTag(); + //TODO + /*if (AUTOMATA_CORE_REGISTRY.containsKey(entityType)) { + + CompoundTag tag = stack.getOrCreateTag(); CompoundTag consumedData = tag.getCompound(CONSUMER_ENTITY_COMPOUND); WeakAutomataCoreRecord record; if (consumedData.isEmpty()) { @@ -100,8 +96,8 @@ record = AUTOMATA_CORE_REGISTRY.get(anyKey.get()); player.setItemInHand(hand, new ItemStack(record.resultSoul)); } tag.put(CONSUMER_ENTITY_COMPOUND, consumedData); - return InteractionResult.SUCCESS;*/ - } + return InteractionResult.SUCCESS; + }*/ return InteractionResult.PASS; } diff --git a/src/main/java/de/srendi/advancedperipherals/common/items/base/BaseBlockItem.java b/src/main/java/de/srendi/advancedperipherals/common/items/base/BaseBlockItem.java index 7ddf56ec6..813d1eeff 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/items/base/BaseBlockItem.java +++ b/src/main/java/de/srendi/advancedperipherals/common/items/base/BaseBlockItem.java @@ -8,10 +8,8 @@ import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; -import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.util.List; diff --git a/src/main/java/de/srendi/advancedperipherals/common/items/base/BaseItem.java b/src/main/java/de/srendi/advancedperipherals/common/items/base/BaseItem.java index 4f35c0978..df3d8016b 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/items/base/BaseItem.java +++ b/src/main/java/de/srendi/advancedperipherals/common/items/base/BaseItem.java @@ -15,7 +15,6 @@ import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.util.List; diff --git a/src/main/java/de/srendi/advancedperipherals/common/setup/DataComponents.java b/src/main/java/de/srendi/advancedperipherals/common/setup/DataComponents.java index 2724aaadb..b316f9bfc 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/setup/DataComponents.java +++ b/src/main/java/de/srendi/advancedperipherals/common/setup/DataComponents.java @@ -5,6 +5,7 @@ import net.minecraft.core.UUIDUtil; import net.minecraft.core.component.DataComponentPatch; import net.minecraft.core.component.DataComponentType; +import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.ComponentSerialization; import net.minecraft.network.codec.ByteBufCodecs; @@ -19,14 +20,23 @@ public class DataComponents { public static final DeferredHolder, DataComponentType> ENERGY_RATE_LIMIT = registerInt("energy_rate_limit"); public static final DeferredHolder, DataComponentType> TURTLE_UPGRADE_STORED_DATA = registerDataComponent("stored_data"); + public static final DeferredHolder, DataComponentType> ABILITY_COOLDOWN = registerDataComponent("cooldowns"); public static final DeferredHolder, DataComponentType> OWNER = registerUUID("owner_id"); public static final DeferredHolder, DataComponentType> CHUNKY_ID = registerUUID("chunky_id"); public static final DeferredHolder, DataComponentType> ROTATION_CHARGE_SETTING = registerInt("rotation_charge_setting"); public static final DeferredHolder, DataComponentType> FUEL_CONSUMPTION_RATE = registerInt("fuel_consumption_rate"); + public static final DeferredHolder, DataComponentType> ENTITY_TRANSFER = registerNBT("entity_transfer"); + public static final DeferredHolder, DataComponentType> WORLD_DATA_MARK = registerString("world_data_mark"); + public static final DeferredHolder, DataComponentType> POINT_DATA_MARK = registerNBT("point_dat_mark"); + + public static final DeferredHolder, DataComponentType> SIMPLE_FREE_OPERATION = registerLong("free_operation_cooldown"); + public static final DeferredHolder, DataComponentType> SINGLE_OPERATION = registerLong("single_operation"); + public static final DeferredHolder, DataComponentType> SPHERE_OPERATION = registerLong("sphere_operation"); public static void register() { } + // private static DeferredHolder, DataComponentType> simple(String name, UnaryOperator> operator) { return Registration.DATA_COMPONENT_TYPES.register(name, () -> operator.apply(DataComponentType.builder()).build()); } @@ -36,6 +46,11 @@ private static DeferredHolder, DataComponentType> .networkSynchronized(ByteBufCodecs.BOOL)); } + private static DeferredHolder, DataComponentType> registerString(String name) { + return simple(name, builder -> builder.persistent(Codec.STRING) + .networkSynchronized(ByteBufCodecs.STRING_UTF8)); + } + private static DeferredHolder, DataComponentType> registerDataComponent(String name) { return simple(name, builder -> builder.persistent(DataComponentPatch.CODEC) .networkSynchronized(DataComponentPatch.STREAM_CODEC)); @@ -51,7 +66,7 @@ private static DeferredHolder, DataComponentType> .networkSynchronized(ByteBufCodecs.VAR_INT)); } - private static DeferredHolder, DataComponentType> registerNonNegativeLong(String name) { + private static DeferredHolder, DataComponentType> registerLong(String name) { return simple(name, builder -> builder.persistent(Codec.LONG) .networkSynchronized(ByteBufCodecs.VAR_LONG)); } @@ -61,14 +76,17 @@ private static DeferredHolder, DataComponentType> reg .networkSynchronized(UUIDUtil.STREAM_CODEC)); } + private static DeferredHolder, DataComponentType> registerNBT(String name) { + return simple(name, builder -> builder.persistent(CompoundTag.CODEC)); + } + private static DeferredHolder, DataComponentType> registerComponent(String name) { return simple(name, builder -> builder.persistent(ComponentSerialization.FLAT_CODEC) .networkSynchronized(ComponentSerialization.STREAM_CODEC) .cacheEncoding()); } - private static DeferredHolder, DataComponentType>> registerResourceKey(String name, - ResourceKey> registryKey) { + private static DeferredHolder, DataComponentType>> registerResourceKey(String name, ResourceKey> registryKey) { return simple(name, builder -> builder.persistent(ResourceKey.codec(registryKey)) .networkSynchronized(ResourceKey.streamCodec(registryKey))); } diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/DataStorageUtil.java b/src/main/java/de/srendi/advancedperipherals/common/util/DataStorageUtil.java index ba465be07..4b625aabc 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/DataStorageUtil.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/DataStorageUtil.java @@ -1,11 +1,8 @@ package de.srendi.advancedperipherals.common.util; import dan200.computercraft.api.pocket.IPocketAccess; -import dan200.computercraft.api.pocket.IPocketUpgrade; import dan200.computercraft.api.turtle.ITurtleAccess; -import dan200.computercraft.api.turtle.ITurtleUpgrade; import dan200.computercraft.api.turtle.TurtleSide; -import dan200.computercraft.api.upgrades.UpgradeData; import de.srendi.advancedperipherals.common.addons.computercraft.owner.IPeripheralOwner; import de.srendi.advancedperipherals.lib.peripherals.IPeripheralTileEntity; import net.minecraft.core.component.DataComponentPatch; diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java b/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java index 7c7a13b75..63900d0b6 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java @@ -1,13 +1,10 @@ package de.srendi.advancedperipherals.common.util; import dan200.computercraft.api.lua.LuaException; -import dan200.computercraft.shared.util.NBTUtil; import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.InventoryManagerPeripheral; import de.srendi.advancedperipherals.common.util.inventory.ItemUtil; import net.minecraft.core.BlockPos; import net.minecraft.core.component.DataComponentMap; -import net.minecraft.core.component.DataComponents; -import net.minecraft.nbt.CompoundTag; import net.minecraft.tags.TagKey; import net.minecraft.util.StringRepresentable; import net.minecraft.world.entity.Entity; diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/APFakePlayer.java b/src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/APFakePlayer.java index 4c5ba879d..38757be4f 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/APFakePlayer.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/APFakePlayer.java @@ -38,10 +38,9 @@ import net.minecraft.world.phys.EntityHitResult; import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.Vec3; -import net.neoforged.neoforge.common.util.TriState; import net.neoforged.neoforge.common.CommonHooks; -import net.neoforged.neoforge.common.NeoForgeMod; import net.neoforged.neoforge.common.util.FakePlayer; +import net.neoforged.neoforge.common.util.TriState; import net.neoforged.neoforge.event.EventHooks; import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent; import org.apache.commons.lang3.StringUtils; diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/FakePlayerProviderTurtle.java b/src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/FakePlayerProviderTurtle.java index b42faf7f3..ddd0c990c 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/FakePlayerProviderTurtle.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/FakePlayerProviderTurtle.java @@ -1,20 +1,16 @@ package de.srendi.advancedperipherals.common.util.fakeplayer; -import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; import com.mojang.authlib.GameProfile; import dan200.computercraft.api.turtle.ITurtleAccess; import dan200.computercraft.shared.util.InventoryUtil; import dan200.computercraft.shared.util.WorldUtil; -import mezz.jei.core.collect.MultiMap; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Holder; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.Container; import net.minecraft.world.InteractionHand; -import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.ai.attributes.Attribute; import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.player.Inventory; diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidFilter.java b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidFilter.java index b95b004d0..f7fa4bdfa 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidFilter.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidFilter.java @@ -111,7 +111,7 @@ public boolean test(FluidStack stack) { return false; } //if (nbt != null && !stack.getOrCreateTag().equals(nbt)) { - // return false; + // return false; //} return true; } diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemFilter.java b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemFilter.java index 46fc0d0bd..a0907d668 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemFilter.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemFilter.java @@ -126,7 +126,7 @@ public boolean test(ItemStack stack) { return false; } //if (nbt != null && !stack.getOrCreateTag().equals(nbt)) { - // return false; + // return false; //} return true; } diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemUtil.java b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemUtil.java index 27edfcbd8..498766805 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemUtil.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemUtil.java @@ -1,15 +1,9 @@ package de.srendi.advancedperipherals.common.util.inventory; -import dan200.computercraft.api.pocket.IPocketUpgrade; -import dan200.computercraft.api.turtle.ITurtleUpgrade; -import dan200.computercraft.api.upgrades.UpgradeData; import dan200.computercraft.shared.ModRegistry; import de.srendi.advancedperipherals.AdvancedPeripherals; -import de.srendi.advancedperipherals.common.setup.CCRegistration; -import de.srendi.advancedperipherals.common.setup.Registration; import de.srendi.advancedperipherals.common.util.StringUtil; import net.minecraft.ResourceLocationException; -import net.minecraft.core.NonNullList; import net.minecraft.core.Registry; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; diff --git a/src/main/java/de/srendi/advancedperipherals/common/village/VillageStructures.java b/src/main/java/de/srendi/advancedperipherals/common/village/VillageStructures.java index 854523b80..5324ab75a 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/village/VillageStructures.java +++ b/src/main/java/de/srendi/advancedperipherals/common/village/VillageStructures.java @@ -15,7 +15,6 @@ import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; -import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.event.server.ServerAboutToStartEvent; import java.util.ArrayList; diff --git a/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrades.java b/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrades.java index 8b85c688f..8b9523f75 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrades.java +++ b/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrades.java @@ -4,14 +4,11 @@ import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.configuration.APConfig; import de.srendi.advancedperipherals.common.setup.Blocks; -import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.common.setup.Items; import de.srendi.advancedperipherals.common.setup.Villagers; -import de.srendi.advancedperipherals.common.util.inventory.ItemUtil; import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; -import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.event.village.VillagerTradesEvent; import net.neoforged.neoforge.event.village.WandererTradesEvent; @@ -57,7 +54,7 @@ public static void registerVillagerTrades(VillagerTradesEvent event) { TradeBuilder.createTrade(event, ModRegistry.Blocks.COMPUTER_ADVANCED.get(), VillagerTrade.Type.ITEM_FOR_EMERALD, 3, 2) .setXp(4) .build(); - + //TODO /*TradeBuilder.createTrade(event, ItemUtil.makeTurtle(ItemUtil.TURTLE_NORMAL, CCRegistration.ID.ENVIRONMENT_TURTLE.toString()), VillagerTrade.Type.ITEM_FOR_EMERALD, 4, 3) .setMaxUses(4) .setXp(5) @@ -89,9 +86,9 @@ public static void registerVillagerTrades(VillagerTradesEvent event) { TradeBuilder.createTrade(event, Items.MEMORY_CARD.get(), VillagerTrade.Type.EMERALD_FOR_ITEM, 2, 4) .setXp(4) .build(); - TradeBuilder.createTrade(event, ItemUtil.makeTurtle(ItemUtil.TURTLE_ADVANCED, CCRegistration.ID.CHUNKY_TURTLE.toString()), VillagerTrade.Type.ITEM_FOR_EMERALD, 8, 4) + /*TradeBuilder.createTrade(event, ItemUtil.makeTurtle(ItemUtil.TURTLE_ADVANCED, CCRegistration.ID.CHUNKY_TURTLE.toString()), VillagerTrade.Type.ITEM_FOR_EMERALD, 8, 4) .setXp(7) - .build(); + .build();*/ TradeBuilder.createTrade(event, Items.CHUNK_CONTROLLER.get(), VillagerTrade.Type.ITEM_FOR_EMERALD, 6, 4) .setMaxUses(6) .setXp(6) diff --git a/src/main/java/de/srendi/advancedperipherals/lib/peripherals/IDataComponentProvider.java b/src/main/java/de/srendi/advancedperipherals/lib/peripherals/IDataComponentProvider.java new file mode 100644 index 000000000..370e7c0cc --- /dev/null +++ b/src/main/java/de/srendi/advancedperipherals/lib/peripherals/IDataComponentProvider.java @@ -0,0 +1,9 @@ +package de.srendi.advancedperipherals.lib.peripherals; + +import net.minecraft.core.component.DataComponentType; + +public interface IDataComponentProvider { + + DataComponentType dataComponentType(); + +} diff --git a/src/main/java/de/srendi/advancedperipherals/lib/peripherals/IPeripheralOperation.java b/src/main/java/de/srendi/advancedperipherals/lib/peripherals/IPeripheralOperation.java index 4dfe11fea..37f74a45e 100644 --- a/src/main/java/de/srendi/advancedperipherals/lib/peripherals/IPeripheralOperation.java +++ b/src/main/java/de/srendi/advancedperipherals/lib/peripherals/IPeripheralOperation.java @@ -4,7 +4,7 @@ import java.util.Map; -public interface IPeripheralOperation extends IConfigHandler { +public interface IPeripheralOperation extends IConfigHandler, IDataComponentProvider { int getInitialCooldown(); int getCooldown(T context); diff --git a/src/main/java/de/srendi/advancedperipherals/lib/turtle/ClockwiseAnimatedTurtleUpgrade.java b/src/main/java/de/srendi/advancedperipherals/lib/turtle/ClockwiseAnimatedTurtleUpgrade.java index 9af0ce14e..b0ee707c1 100644 --- a/src/main/java/de/srendi/advancedperipherals/lib/turtle/ClockwiseAnimatedTurtleUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/lib/turtle/ClockwiseAnimatedTurtleUpgrade.java @@ -5,7 +5,6 @@ import de.srendi.advancedperipherals.common.util.DataStorageUtil; import de.srendi.advancedperipherals.lib.peripherals.IBasePeripheral; import net.minecraft.core.component.DataComponentPatch; -import net.minecraft.nbt.CompoundTag; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/de/srendi/advancedperipherals/network/toclient/ToastToClientPacket.java b/src/main/java/de/srendi/advancedperipherals/network/toclient/ToastToClientPacket.java index b528e170f..8830cdb3d 100644 --- a/src/main/java/de/srendi/advancedperipherals/network/toclient/ToastToClientPacket.java +++ b/src/main/java/de/srendi/advancedperipherals/network/toclient/ToastToClientPacket.java @@ -3,7 +3,6 @@ import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.util.ToastUtil; import de.srendi.advancedperipherals.network.IAPPacket; -import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.chat.Component; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; diff --git a/src/main/java/de/srendi/advancedperipherals/network/toclient/UsernameToCachePacket.java b/src/main/java/de/srendi/advancedperipherals/network/toclient/UsernameToCachePacket.java index f418ce5be..6774683ad 100644 --- a/src/main/java/de/srendi/advancedperipherals/network/toclient/UsernameToCachePacket.java +++ b/src/main/java/de/srendi/advancedperipherals/network/toclient/UsernameToCachePacket.java @@ -7,7 +7,6 @@ import net.minecraft.network.protocol.common.custom.CustomPacketPayload; import net.minecraft.resources.ResourceLocation; import net.neoforged.neoforge.network.handling.IPayloadContext; -import org.jetbrains.annotations.NotNull; import java.util.UUID; diff --git a/src/main/java/de/srendi/advancedperipherals/network/toserver/RetrieveUsernamePacket.java b/src/main/java/de/srendi/advancedperipherals/network/toserver/RetrieveUsernamePacket.java index c436ac96d..7b39ebaa3 100644 --- a/src/main/java/de/srendi/advancedperipherals/network/toserver/RetrieveUsernamePacket.java +++ b/src/main/java/de/srendi/advancedperipherals/network/toserver/RetrieveUsernamePacket.java @@ -11,7 +11,6 @@ import net.minecraft.server.level.ServerPlayer; import net.neoforged.neoforge.network.handling.IPayloadContext; import net.neoforged.neoforge.server.ServerLifecycleHooks; -import org.jetbrains.annotations.NotNull; import java.util.Optional; import java.util.UUID; From 7234441e005cc58afd1cb80096f3c39f5ce5418c Mon Sep 17 00:00:00 2001 From: Srendi Date: Sun, 12 Jan 2025 18:01:43 +0100 Subject: [PATCH 18/57] Register data components, disable addons for now since we need to refactor how we access addons classes --- build.gradle | 20 +++++++++---------- .../AdvancedPeripherals.java | 12 ++++------- .../client/ClientRegistry.java | 2 +- .../common/addons/APAddons.java | 2 +- .../computercraft/owner/OperationAbility.java | 2 -- .../common/events/Events.java | 6 +++--- .../common/setup/Registration.java | 2 ++ 7 files changed, 21 insertions(+), 25 deletions(-) diff --git a/build.gradle b/build.gradle index 76dcc2a62..a0433b68e 100644 --- a/build.gradle +++ b/build.gradle @@ -217,26 +217,26 @@ dependencies { // Extended requirements // We don't use the api since we need a specific class from mekanism compileOnly "mekanism:Mekanism:${mekanism_version}" - runtimeOnly "mekanism:Mekanism:${mekanism_version}" + //runtimeOnly "mekanism:Mekanism:${mekanism_version}" // Applied Energistics 2 - runtimeOnly "appeng:appliedenergistics2:${appliedenergistics_version}" + //runtimeOnly "appeng:appliedenergistics2:${appliedenergistics_version}" compileOnly "appeng:appliedenergistics2:${appliedenergistics_version}" // Applied Mekanistics - runtimeOnly "curse.maven:applied-mekanistics-574300:${appliedmekanistics_version}" + //runtimeOnly "curse.maven:applied-mekanistics-574300:${appliedmekanistics_version}" compileOnly "curse.maven:applied-mekanistics-574300:${appliedmekanistics_version}" // AE2 Things compileOnly "curse.maven:ae2things-609977:${ae2things_version}-sources" - runtimeOnly "curse.maven:ae2things-609977:${ae2things_version}-sources" + //runtimeOnly "curse.maven:ae2things-609977:${ae2things_version}-sources" // Minecolonies // Remove/Comment this section if you want to use runData. - runtimeOnly "com.ldtteam:minecolonies:${minecolonies_version}" - runtimeOnly "com.ldtteam:structurize:${structurize_version}" - runtimeOnly "com.ldtteam:domum-ornamentum:${domumornamentum_version}" - runtimeOnly "com.ldtteam:blockui:${blockui_version}" + //runtimeOnly "com.ldtteam:minecolonies:${minecolonies_version}" + //runtimeOnly "com.ldtteam:structurize:${structurize_version}" + //runtimeOnly "com.ldtteam:domum-ornamentum:${domumornamentum_version}" + //runtimeOnly "com.ldtteam:blockui:${blockui_version}" compileOnly "com.ldtteam:minecolonies:${minecolonies_version}" compileOnly "com.ldtteam:structurize:${structurize_version}" @@ -244,11 +244,11 @@ dependencies { compileOnly "com.ldtteam:blockui:${blockui_version}" //Patchouli - runtimeOnly "vazkii.patchouli:Patchouli:${patchouli_version}-NEOFORGE" + //runtimeOnly "vazkii.patchouli:Patchouli:${patchouli_version}-NEOFORGE" compileOnly "vazkii.patchouli:Patchouli:${patchouli_version}-NEOFORGE" //Powah - implementation "curse.maven:powah-633483:${powah_version}" + //implementation "curse.maven:powah-633483:${powah_version}" testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_version}" testImplementation "org.junit.jupiter:junit-jupiter-params:${junit_version}" diff --git a/src/main/java/de/srendi/advancedperipherals/AdvancedPeripherals.java b/src/main/java/de/srendi/advancedperipherals/AdvancedPeripherals.java index 6cd5f609e..b2bd2eed2 100644 --- a/src/main/java/de/srendi/advancedperipherals/AdvancedPeripherals.java +++ b/src/main/java/de/srendi/advancedperipherals/AdvancedPeripherals.java @@ -31,10 +31,10 @@ public class AdvancedPeripherals { public AdvancedPeripherals(IEventBus modBus) { LOGGER.info("AdvancedPeripherals says hello!"); + APAddons.setup(); APConfig.register(ModLoadingContext.get()); - modBus.addListener(this::commonSetup); modBus.addListener(this::registerCapabilities); modBus.addListener(ChunkManager::registerTicketController); @@ -55,10 +55,6 @@ public static ResourceLocation getRL(String resource) { return ResourceLocation.fromNamespaceAndPath(MOD_ID, resource); } - public void commonSetup(FMLCommonSetupEvent event) { - APAddons.commonSetup(); - } - public void registerCapabilities(RegisterCapabilitiesEvent event) { Registration.BLOCK_ENTITIES.getEntries().forEach((entry) -> { @@ -99,10 +95,10 @@ public void registerCapabilities(RegisterCapabilitiesEvent event) { }); }); - if (APAddons.ae2Loaded) - event.registerBlockEntity( + //if (APAddons.ae2Loaded) + /*event.registerBlockEntity( AECapabilities.IN_WORLD_GRID_NODE_HOST, BlockEntityTypes.ME_BRIDGE.get(), - (blockEntity, side) -> blockEntity); + (blockEntity, side) -> blockEntity);*/ } } diff --git a/src/main/java/de/srendi/advancedperipherals/client/ClientRegistry.java b/src/main/java/de/srendi/advancedperipherals/client/ClientRegistry.java index 75ac2c7c5..cb3c290b7 100644 --- a/src/main/java/de/srendi/advancedperipherals/client/ClientRegistry.java +++ b/src/main/java/de/srendi/advancedperipherals/client/ClientRegistry.java @@ -22,7 +22,7 @@ public class ClientRegistry { @SubscribeEvent public static void registerModels(ModelEvent.RegisterAdditional event) { for (String model : TURTLE_MODELS) { - event.register(new ModelResourceLocation(AdvancedPeripherals.getRL(model), "inventory")); + event.register(new ModelResourceLocation(AdvancedPeripherals.getRL(model), "standalone")); } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java b/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java index 05f707a41..e07701c41 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java @@ -24,7 +24,7 @@ public class APAddons { private APAddons() { } - public static void commonSetup() { + public static void setup() { ModList modList = ModList.get(); ae2Loaded = modList.isLoaded(AE2_MODID); curiosLoaded = modList.isLoaded(CURIOS_MODID); diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java index ffe76817c..26c7270c2 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java @@ -24,8 +24,6 @@ import static de.srendi.advancedperipherals.common.setup.DataComponents.ABILITY_COOLDOWN; public class OperationAbility implements IOwnerAbility, IPeripheralPlugin { - private static final String COOLDOWNS_TAG = "cooldowns"; - private final Map> allowedOperations = new HashMap<>(); private final IPeripheralOwner owner; diff --git a/src/main/java/de/srendi/advancedperipherals/common/events/Events.java b/src/main/java/de/srendi/advancedperipherals/common/events/Events.java index e03bb9d70..82653ee95 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/events/Events.java +++ b/src/main/java/de/srendi/advancedperipherals/common/events/Events.java @@ -44,9 +44,9 @@ public static void onWorldJoin(PlayerEvent.PlayerLoggedInEvent event) { // See https://vazkiimods.github.io/Patchouli/docs/patchouli-basics/giving-new if (APConfig.WORLD_CONFIG.givePlayerBookOnJoin.get() && APAddons.patchouliLoaded) { if (!hasPlayedBefore(player)) { - PatchouliAPI.IPatchouliAPI patchouli = new PatchouliAPIImpl(); - ItemStack book = patchouli.getBookStack(AdvancedPeripherals.getRL("manual")); - player.addItem(book); + //PatchouliAPI.IPatchouliAPI patchouli = new PatchouliAPIImpl(); + //ItemStack book = patchouli.getBookStack(AdvancedPeripherals.getRL("manual")); + //player.addItem(book); } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/setup/Registration.java b/src/main/java/de/srendi/advancedperipherals/common/setup/Registration.java index bce7ebd8f..ede366592 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/setup/Registration.java +++ b/src/main/java/de/srendi/advancedperipherals/common/setup/Registration.java @@ -37,6 +37,7 @@ public static void register(IEventBus modEventBus) { TURTLE_SERIALIZER.register(modEventBus); POCKET_SERIALIZER.register(modEventBus); CREATIVE_MODE_TABS.register(modEventBus); + DATA_COMPONENT_TYPES.register(modEventBus); Blocks.register(); BlockEntityTypes.register(); @@ -45,5 +46,6 @@ public static void register(IEventBus modEventBus) { Villagers.register(); CCRegistration.register(); CreativeTabs.register(); + DataComponents.register(); } } From 9524a08e82bb4f83ed561e3ae7703f8ce4acd339 Mon Sep 17 00:00:00 2001 From: Srendi Date: Sun, 12 Jan 2025 18:03:40 +0100 Subject: [PATCH 19/57] Checkstyle --- .../advancedperipherals/AdvancedPeripherals.java | 11 ++++------- .../advancedperipherals/common/events/Events.java | 15 ++++++--------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/AdvancedPeripherals.java b/src/main/java/de/srendi/advancedperipherals/AdvancedPeripherals.java index b2bd2eed2..4734455a5 100644 --- a/src/main/java/de/srendi/advancedperipherals/AdvancedPeripherals.java +++ b/src/main/java/de/srendi/advancedperipherals/AdvancedPeripherals.java @@ -1,18 +1,15 @@ package de.srendi.advancedperipherals; -import appeng.api.AECapabilities; import dan200.computercraft.api.peripheral.PeripheralCapability; import de.srendi.advancedperipherals.common.addons.APAddons; import de.srendi.advancedperipherals.common.blocks.base.ICapabilityProvider; import de.srendi.advancedperipherals.common.configuration.APConfig; -import de.srendi.advancedperipherals.common.setup.BlockEntityTypes; import de.srendi.advancedperipherals.common.setup.Registration; import de.srendi.advancedperipherals.common.util.ChunkManager; import net.minecraft.resources.ResourceLocation; import net.neoforged.bus.api.IEventBus; import net.neoforged.fml.ModLoadingContext; import net.neoforged.fml.common.Mod; -import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; import net.neoforged.neoforge.capabilities.Capabilities; import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent; import org.apache.logging.log4j.Level; @@ -96,9 +93,9 @@ public void registerCapabilities(RegisterCapabilitiesEvent event) { }); //if (APAddons.ae2Loaded) - /*event.registerBlockEntity( - AECapabilities.IN_WORLD_GRID_NODE_HOST, - BlockEntityTypes.ME_BRIDGE.get(), - (blockEntity, side) -> blockEntity);*/ + /*event.registerBlockEntity( + AECapabilities.IN_WORLD_GRID_NODE_HOST, + BlockEntityTypes.ME_BRIDGE.get(), + (blockEntity, side) -> blockEntity);*/ } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/events/Events.java b/src/main/java/de/srendi/advancedperipherals/common/events/Events.java index 82653ee95..af8d1a6da 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/events/Events.java +++ b/src/main/java/de/srendi/advancedperipherals/common/events/Events.java @@ -4,14 +4,12 @@ import com.mojang.brigadier.context.CommandContextBuilder; import com.mojang.brigadier.exceptions.CommandSyntaxException; import de.srendi.advancedperipherals.AdvancedPeripherals; -import de.srendi.advancedperipherals.common.addons.APAddons; import de.srendi.advancedperipherals.common.configuration.APConfig; import de.srendi.advancedperipherals.common.util.Pair; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.arguments.MessageArgument; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.ItemStack; import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.EventPriority; import net.neoforged.bus.api.SubscribeEvent; @@ -19,8 +17,6 @@ import net.neoforged.neoforge.event.CommandEvent; import net.neoforged.neoforge.event.ServerChatEvent; import net.neoforged.neoforge.event.entity.player.PlayerEvent; -import vazkii.patchouli.api.PatchouliAPI; -import vazkii.patchouli.common.base.PatchouliAPIImpl; import java.util.function.Consumer; @@ -42,13 +38,14 @@ public static void onWorldJoin(PlayerEvent.PlayerLoggedInEvent event) { // We could switch to the advancement way to give new players the book. However, that would not allow us to create // a config option for that. So we will stick with the custom solution here. // See https://vazkiimods.github.io/Patchouli/docs/patchouli-basics/giving-new - if (APConfig.WORLD_CONFIG.givePlayerBookOnJoin.get() && APAddons.patchouliLoaded) { + //TODO + /*if (APConfig.WORLD_CONFIG.givePlayerBookOnJoin.get() && APAddons.patchouliLoaded) { if (!hasPlayedBefore(player)) { - //PatchouliAPI.IPatchouliAPI patchouli = new PatchouliAPIImpl(); - //ItemStack book = patchouli.getBookStack(AdvancedPeripherals.getRL("manual")); - //player.addItem(book); + PatchouliAPI.IPatchouliAPI patchouli = new PatchouliAPIImpl(); + ItemStack book = patchouli.getBookStack(AdvancedPeripherals.getRL("manual")); + player.addItem(book); } - } + }*/ putPlayerMessage(Pair.of(getLastPlayerMessageID(), new PlayerMessageObject("playerJoin", player.getName().getString(), player.level().dimension().location().toString(), ""))); } From 53589df68ab62a8e08951ec42a74ffd7c5b43940 Mon Sep 17 00:00:00 2001 From: Srendi Date: Sun, 12 Jan 2025 18:11:01 +0100 Subject: [PATCH 20/57] Change how we manage fake player turtle item/player properties --- .../fakeplayer/FakePlayerProviderTurtle.java | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/FakePlayerProviderTurtle.java b/src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/FakePlayerProviderTurtle.java index ddd0c990c..b6ad75b59 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/FakePlayerProviderTurtle.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/FakePlayerProviderTurtle.java @@ -11,7 +11,9 @@ import net.minecraft.server.level.ServerLevel; import net.minecraft.world.Container; import net.minecraft.world.InteractionHand; +import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.ai.attributes.Attribute; +import net.minecraft.world.entity.ai.attributes.AttributeInstance; import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.item.ItemStack; @@ -35,7 +37,7 @@ public static APFakePlayer getPlayer(ITurtleAccess turtle, GameProfile profile) public static void load(APFakePlayer player, ITurtleAccess turtle) { Direction direction = turtle.getDirection(); - player.setLevel((ServerLevel) turtle.getLevel()); + player.setLevel(turtle.getLevel()); // Player position BlockPos position = turtle.getPosition(); player.moveTo(position.getX() + 0.5, position.getY() + 0.5, position.getZ() + 0.5, direction.toYRot(), 0); @@ -58,9 +60,12 @@ public static void load(APFakePlayer player, ITurtleAccess turtle) { // Add properties ItemStack activeStack = player.getItemInHand(InteractionHand.MAIN_HAND); if (!activeStack.isEmpty()) { - HashMultimap, AttributeModifier> attributes = HashMultimap.create(); - activeStack.getAttributeModifiers().modifiers().forEach(entry -> attributes.put(entry.attribute(), entry.modifier())); - player.getAttributes().addTransientAttributeModifiers(attributes); + activeStack.getAttributeModifiers().forEach(EquipmentSlot.MAINHAND, (attr, modif) -> { + AttributeInstance inst = player.getAttribute(attr); + if (inst != null) { + inst.addOrUpdateTransientModifier(modif); + } + }); } } @@ -71,9 +76,12 @@ public static void unload(APFakePlayer player, ITurtleAccess turtle) { // Remove properties ItemStack activeStack = player.getItemInHand(InteractionHand.MAIN_HAND); if (!activeStack.isEmpty()) { - HashMultimap, AttributeModifier> attributes = HashMultimap.create(); - activeStack.getAttributeModifiers().modifiers().forEach(entry -> attributes.put(entry.attribute(), entry.modifier())); - player.getAttributes().removeAttributeModifiers(attributes); + activeStack.getAttributeModifiers().forEach(EquipmentSlot.MAINHAND, (attr, modif) -> { + AttributeInstance inst = player.getAttribute(attr); + if (inst != null) { + inst.addOrUpdateTransientModifier(modif); + } + }); } // Copy primary items into turtle inventory and then insert/drop the rest From 409fd375e3aa47be4720a20ec93510578aa6bc71 Mon Sep 17 00:00:00 2001 From: Srendi Date: Sun, 12 Jan 2025 18:39:35 +0100 Subject: [PATCH 21/57] Networking port, thanks to @CrazyDev05 ! --- .../fakeplayer/FakePlayerProviderTurtle.java | 4 --- .../network/APNetworking.java | 10 ++++--- .../network/toclient/ToastToClientPacket.java | 29 ++++++------------- .../toclient/UsernameToCachePacket.java | 15 ++++------ .../toserver/RetrieveUsernamePacket.java | 16 ++++------ 5 files changed, 27 insertions(+), 47 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/FakePlayerProviderTurtle.java b/src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/FakePlayerProviderTurtle.java index b6ad75b59..24a882719 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/FakePlayerProviderTurtle.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/FakePlayerProviderTurtle.java @@ -1,20 +1,16 @@ package de.srendi.advancedperipherals.common.util.fakeplayer; -import com.google.common.collect.HashMultimap; import com.mojang.authlib.GameProfile; import dan200.computercraft.api.turtle.ITurtleAccess; import dan200.computercraft.shared.util.InventoryUtil; import dan200.computercraft.shared.util.WorldUtil; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; -import net.minecraft.core.Holder; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.Container; import net.minecraft.world.InteractionHand; import net.minecraft.world.entity.EquipmentSlot; -import net.minecraft.world.entity.ai.attributes.Attribute; import net.minecraft.world.entity.ai.attributes.AttributeInstance; -import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.item.ItemStack; diff --git a/src/main/java/de/srendi/advancedperipherals/network/APNetworking.java b/src/main/java/de/srendi/advancedperipherals/network/APNetworking.java index 05f543d41..765843697 100644 --- a/src/main/java/de/srendi/advancedperipherals/network/APNetworking.java +++ b/src/main/java/de/srendi/advancedperipherals/network/APNetworking.java @@ -1,6 +1,9 @@ package de.srendi.advancedperipherals.network; import de.srendi.advancedperipherals.AdvancedPeripherals; +import de.srendi.advancedperipherals.network.toclient.ToastToClientPacket; +import de.srendi.advancedperipherals.network.toclient.UsernameToCachePacket; +import de.srendi.advancedperipherals.network.toserver.RetrieveUsernamePacket; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; import net.minecraft.server.level.ServerPlayer; import net.neoforged.bus.api.SubscribeEvent; @@ -16,12 +19,11 @@ public class APNetworking { private static final String PROTOCOL_VERSION = ModLoadingContext.get().getActiveContainer().getModInfo().getVersion().toString(); public static void init(PayloadRegistrar registrar) { - //registrar.playToClient(ToastToClientPacket.ID, ToastToClientPacket::decode, handler -> handler); - //registrar.playToClient(UsernameToCachePacket.ID, UsernameToCachePacket::decode, handler -> handler.client(IAPPacket::handlePacket)); + registrar.playToClient(ToastToClientPacket.TYPE, ToastToClientPacket.CODEC, ToastToClientPacket::handle); + registrar.playToClient(UsernameToCachePacket.TYPE, UsernameToCachePacket.CODEC, UsernameToCachePacket::handle); - //registrar.playToServer(RetrieveUsernamePacket.ID, RetrieveUsernamePacket::decode, handler -> handler.server(IAPPacket::handlePacket)); + registrar.playToServer(RetrieveUsernamePacket.TYPE, RetrieveUsernamePacket.CODEC, RetrieveUsernamePacket::handle); } - @SubscribeEvent public static void register(final RegisterPayloadHandlersEvent event) { final PayloadRegistrar registrar = event.registrar(AdvancedPeripherals.MOD_ID) diff --git a/src/main/java/de/srendi/advancedperipherals/network/toclient/ToastToClientPacket.java b/src/main/java/de/srendi/advancedperipherals/network/toclient/ToastToClientPacket.java index 8830cdb3d..6b6fbd0e4 100644 --- a/src/main/java/de/srendi/advancedperipherals/network/toclient/ToastToClientPacket.java +++ b/src/main/java/de/srendi/advancedperipherals/network/toclient/ToastToClientPacket.java @@ -5,15 +5,19 @@ import de.srendi.advancedperipherals.network.IAPPacket; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.chat.Component; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import net.minecraft.resources.ResourceLocation; +import net.minecraft.network.chat.ComponentSerialization; +import net.minecraft.network.codec.StreamCodec; import net.neoforged.fml.loading.FMLEnvironment; import net.neoforged.neoforge.network.handling.IPayloadContext; import org.jetbrains.annotations.NotNull; public class ToastToClientPacket implements IAPPacket { + public static final StreamCodec CODEC = StreamCodec.composite( + ComponentSerialization.STREAM_CODEC, packet -> packet.title, + ComponentSerialization.STREAM_CODEC, packet -> packet.component, + ToastToClientPacket::new); - public static final ResourceLocation ID = AdvancedPeripherals.getRL("toasttoclient"); + public static final Type TYPE = new Type<>(AdvancedPeripherals.getRL("toasttoclient")); private final Component title; private final Component component; @@ -23,10 +27,6 @@ public ToastToClientPacket(Component title, Component component) { this.component = component; } - public static ToastToClientPacket decode(RegistryFriendlyByteBuf buffer) { - return null; // new ToastToClientPacket(buffer.compo, buffer.readComponent()); - } - @Override public void handle(@NotNull IPayloadContext context) { // Should in the theory not happen, but safe is safe. @@ -37,20 +37,9 @@ public void handle(@NotNull IPayloadContext context) { ToastUtil.displayToast(title, component); } - /*@Override - public void write(@NotNull FriendlyByteBuf buffer) { - buffer.writeComponent(this.title); - buffer.writeComponent(this.component); - } - @NotNull @Override - public ResourceLocation id() { - return ID; - }*/ - - @Override - public Type type() { - return null; + public Type type() { + return TYPE; } } diff --git a/src/main/java/de/srendi/advancedperipherals/network/toclient/UsernameToCachePacket.java b/src/main/java/de/srendi/advancedperipherals/network/toclient/UsernameToCachePacket.java index 6774683ad..d0b722e93 100644 --- a/src/main/java/de/srendi/advancedperipherals/network/toclient/UsernameToCachePacket.java +++ b/src/main/java/de/srendi/advancedperipherals/network/toclient/UsernameToCachePacket.java @@ -4,15 +4,18 @@ import de.srendi.advancedperipherals.client.ClientUUIDCache; import de.srendi.advancedperipherals.network.IAPPacket; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.StreamCodec; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import net.minecraft.resources.ResourceLocation; import net.neoforged.neoforge.network.handling.IPayloadContext; +import org.jetbrains.annotations.NotNull; import java.util.UUID; public class UsernameToCachePacket implements IAPPacket { + public static final StreamCodec CODEC = StreamCodec.of((buffer, value) -> value.write(buffer), UsernameToCachePacket::decode); - public static final ResourceLocation ID = AdvancedPeripherals.getRL("usernametocache"); + public static final Type TYPE = new Type<>(AdvancedPeripherals.getRL("usernametocache")); public UUID uuid; public String username; @@ -31,20 +34,14 @@ public void handle(IPayloadContext context) { ClientUUIDCache.putUsername(uuid, username); } - /*@Override public void write(FriendlyByteBuf buffer) { buffer.writeUUID(uuid); buffer.writeUtf(username); } @NotNull - @Override - public ResourceLocation id() { - return ID; - }*/ - @Override public Type type() { - return null; + return TYPE; } } diff --git a/src/main/java/de/srendi/advancedperipherals/network/toserver/RetrieveUsernamePacket.java b/src/main/java/de/srendi/advancedperipherals/network/toserver/RetrieveUsernamePacket.java index 7b39ebaa3..7a3bfe40a 100644 --- a/src/main/java/de/srendi/advancedperipherals/network/toserver/RetrieveUsernamePacket.java +++ b/src/main/java/de/srendi/advancedperipherals/network/toserver/RetrieveUsernamePacket.java @@ -6,18 +6,21 @@ import de.srendi.advancedperipherals.network.IAPPacket; import de.srendi.advancedperipherals.network.toclient.UsernameToCachePacket; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.StreamCodec; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerPlayer; import net.neoforged.neoforge.network.handling.IPayloadContext; import net.neoforged.neoforge.server.ServerLifecycleHooks; +import org.jetbrains.annotations.NotNull; import java.util.Optional; import java.util.UUID; public class RetrieveUsernamePacket implements IAPPacket { + public static final StreamCodec CODEC = StreamCodec.of((buffer, value) -> value.write(buffer), RetrieveUsernamePacket::decode); - public static final ResourceLocation ID = AdvancedPeripherals.getRL("retrieveusername"); + public static final Type TYPE = new Type<>(AdvancedPeripherals.getRL("retrieveusername")); public UUID uuid; public UUID requester; @@ -42,24 +45,17 @@ public void handle(IPayloadContext context) { if (gameProfile.isEmpty()) return; - APNetworking.sendTo(player, new UsernameToCachePacket(gameProfile.get().getId(), gameProfile.get().getName())); } - /*@Override public void write(FriendlyByteBuf buffer) { buffer.writeUUID(uuid); buffer.writeUUID(requester); } @NotNull - @Override - public ResourceLocation id() { - return ID; - }*/ - @Override public Type type() { - return null; + return TYPE; } } From 3d3a9bd6aa1e60a956146cd081ff0f07ce4168cc Mon Sep 17 00:00:00 2001 From: Srendi Date: Mon, 13 Jan 2025 02:28:28 +0100 Subject: [PATCH 22/57] Run data gen, fix more data component stuff --- build.gradle | 2 +- .../2db41954e490230d51b10affff25ee2ee27b8d5b | 2 +- .../2f719b8031aed5e605ed8d6694b19245ca45c6ca | 4 +- .../59eb3dbb5f86130e09b3c62d89b9525ee01cf52d | 25 +++--- .../5a761efb7472ef97566e41e81451930a004134bf | 13 ---- .../9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e | 76 +++++++++---------- .../ae219fa7c7d3297c14e454863eac3998a4eab78c | 5 -- .../b8526e444ae7356037f3a813274f6835d1f3dd16 | 4 +- .../f95c7003282837dabaa33e3ffceec4e6865b5218 | 8 +- .../ff85aeffff7b400453d938ac4326ddfe68257a73 | 13 ++++ .../blockstates/rs_bridge.json | 57 -------------- .../advancedperipherals/lang/en_us.json | 2 - .../models/block/rs_bridge.json | 8 -- .../recipes/redstone/block_reader.json | 4 +- .../recipes/redstone/chat_box.json | 4 +- .../recipes/redstone/chunk_controller.json | 4 +- .../recipes/redstone/computer_tool.json | 4 +- .../recipes/redstone/energy_detector.json | 4 +- .../redstone/environment_detector.json | 4 +- .../recipes/redstone/geo_scanner.json | 4 +- .../recipes/redstone/inventory_manager.json | 4 +- .../recipes/redstone/me_bridge.json | 4 +- .../recipes/redstone/memory_card.json | 4 +- .../recipes/redstone/nbt_storage.json | 4 +- .../overpowered_end_automata_core.json | 4 +- .../overpowered_husbandry_automata_core.json | 4 +- .../overpowered_weak_automata_core.json | 4 +- .../recipes/redstone/peripheral_casing.json | 4 +- .../recipes/redstone/player_detector.json | 4 +- .../recipes/redstone/redstone_integrator.json | 4 +- .../recipes/redstone/weak_automata_core.json | 4 +- .../recipes/redstone/rs_bridge.json | 40 ---------- .../pocket_upgrades/chatty_pocket.json | 4 - .../pocket_upgrades/geoscanner_pocket.json | 4 - .../pocket_upgrades/player_pocket.json | 4 - .../chatty_turtle.json | 0 .../chunky_turtle.json | 0 .../compass_turtle.json | 0 .../end_automata.json | 0 .../environment_turtle.json | 0 .../geoscanner_turtle.json} | 2 +- .../husbandry_automata.json | 0 .../overpowered_end_automata.json | 0 .../overpowered_husbandry_automata.json | 0 .../overpowered_weak_automata.json | 0 .../player_turtle.json | 0 .../weak_automata.json | 0 .../turtle_upgrades/geoscanner_turtle.json | 4 - .../blocks/block_reader.json | 5 +- .../blocks/chat_box.json | 5 +- .../blocks/energy_detector.json | 5 +- .../blocks/environment_detector.json | 5 +- .../blocks/geo_scanner.json | 5 +- .../blocks/inventory_manager.json | 5 +- .../blocks/me_bridge.json | 5 +- .../blocks/nbt_storage.json | 5 +- .../blocks/peripheral_casing.json | 5 +- .../blocks/player_detector.json | 5 +- .../blocks/redstone_integrator.json | 5 +- .../loot_tables/blocks/rs_bridge.json | 27 ------- .../{recipes => recipe}/block_reader.json | 7 +- .../{recipes => recipe}/chat_box.json | 5 +- .../{recipes => recipe}/chunk_controller.json | 7 +- .../{recipes => recipe}/computer_tool.json | 5 +- .../{recipes => recipe}/energy_detector.json | 7 +- .../environment_detector.json | 5 +- .../{recipes => recipe}/geo_scanner.json | 7 +- .../inventory_manager.json | 7 +- .../{recipes => recipe}/me_bridge.json | 3 +- .../{recipes => recipe}/memory_card.json | 9 ++- .../{recipes => recipe}/nbt_storage.json | 9 ++- .../overpowered_end_automata_core.json | 3 +- .../overpowered_husbandry_automata_core.json | 3 +- .../overpowered_weak_automata_core.json | 3 +- .../peripheral_casing.json | 7 +- .../{recipes => recipe}/player_detector.json | 5 +- .../redstone_integrator.json | 5 +- .../weak_automata_core.json | 12 ++- .../recipes/rs_bridge.json | 29 ------- .../tags/blocks/mineable/pickaxe.json | 1 - .../tags/blocks/needs_iron_tool.json | 1 - .../tags/blocks/needs_wood_tool.json | 0 .../addons/appliedenergistics/AppEngApi.java | 7 +- .../computercraft/owner/OperationAbility.java | 36 ++++++--- .../owner/PocketPeripheralOwner.java | 2 - .../common/data/PocketUpgradesProvider.java | 3 +- .../common/items/MemoryCardItem.java | 2 +- .../common/items/WeakAutomataCore.java | 24 +++--- .../common/items/base/BaseItem.java | 13 ++-- .../common/setup/DataComponents.java | 3 +- 90 files changed, 250 insertions(+), 411 deletions(-) delete mode 100644 src/generated/resources/.cache/5a761efb7472ef97566e41e81451930a004134bf delete mode 100644 src/generated/resources/.cache/ae219fa7c7d3297c14e454863eac3998a4eab78c create mode 100644 src/generated/resources/.cache/ff85aeffff7b400453d938ac4326ddfe68257a73 delete mode 100644 src/generated/resources/assets/advancedperipherals/blockstates/rs_bridge.json delete mode 100644 src/generated/resources/assets/advancedperipherals/models/block/rs_bridge.json rename src/generated/resources/data/advancedperipherals/{advancements => advancement}/recipes/redstone/block_reader.json (85%) rename src/generated/resources/data/advancedperipherals/{advancements => advancement}/recipes/redstone/chat_box.json (85%) rename src/generated/resources/data/advancedperipherals/{advancements => advancement}/recipes/redstone/chunk_controller.json (87%) rename src/generated/resources/data/advancedperipherals/{advancements => advancement}/recipes/redstone/computer_tool.json (87%) rename src/generated/resources/data/advancedperipherals/{advancements => advancement}/recipes/redstone/energy_detector.json (85%) rename src/generated/resources/data/advancedperipherals/{advancements => advancement}/recipes/redstone/environment_detector.json (85%) rename src/generated/resources/data/advancedperipherals/{advancements => advancement}/recipes/redstone/geo_scanner.json (85%) rename src/generated/resources/data/advancedperipherals/{advancements => advancement}/recipes/redstone/inventory_manager.json (85%) rename src/generated/resources/data/advancedperipherals/{advancements => advancement}/recipes/redstone/me_bridge.json (87%) rename src/generated/resources/data/advancedperipherals/{advancements => advancement}/recipes/redstone/memory_card.json (88%) rename src/generated/resources/data/advancedperipherals/{advancements => advancement}/recipes/redstone/nbt_storage.json (85%) rename src/generated/resources/data/advancedperipherals/{advancements => advancement}/recipes/redstone/overpowered_end_automata_core.json (86%) rename src/generated/resources/data/advancedperipherals/{advancements => advancement}/recipes/redstone/overpowered_husbandry_automata_core.json (85%) rename src/generated/resources/data/advancedperipherals/{advancements => advancement}/recipes/redstone/overpowered_weak_automata_core.json (86%) rename src/generated/resources/data/advancedperipherals/{advancements => advancement}/recipes/redstone/peripheral_casing.json (87%) rename src/generated/resources/data/advancedperipherals/{advancements => advancement}/recipes/redstone/player_detector.json (85%) rename src/generated/resources/data/advancedperipherals/{advancements => advancement}/recipes/redstone/redstone_integrator.json (85%) rename src/generated/resources/data/advancedperipherals/{advancements => advancement}/recipes/redstone/weak_automata_core.json (85%) delete mode 100644 src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/rs_bridge.json delete mode 100644 src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrades/chatty_pocket.json delete mode 100644 src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrades/geoscanner_pocket.json delete mode 100644 src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrades/player_pocket.json rename src/generated/resources/data/advancedperipherals/computercraft/{turtle_upgrades => turtle_upgrade}/chatty_turtle.json (100%) rename src/generated/resources/data/advancedperipherals/computercraft/{turtle_upgrades => turtle_upgrade}/chunky_turtle.json (100%) rename src/generated/resources/data/advancedperipherals/computercraft/{turtle_upgrades => turtle_upgrade}/compass_turtle.json (100%) rename src/generated/resources/data/advancedperipherals/computercraft/{turtle_upgrades => turtle_upgrade}/end_automata.json (100%) rename src/generated/resources/data/advancedperipherals/computercraft/{turtle_upgrades => turtle_upgrade}/environment_turtle.json (100%) rename src/generated/resources/data/advancedperipherals/computercraft/{pocket_upgrades/environment_pocket.json => turtle_upgrade/geoscanner_turtle.json} (51%) rename src/generated/resources/data/advancedperipherals/computercraft/{turtle_upgrades => turtle_upgrade}/husbandry_automata.json (100%) rename src/generated/resources/data/advancedperipherals/computercraft/{turtle_upgrades => turtle_upgrade}/overpowered_end_automata.json (100%) rename src/generated/resources/data/advancedperipherals/computercraft/{turtle_upgrades => turtle_upgrade}/overpowered_husbandry_automata.json (100%) rename src/generated/resources/data/advancedperipherals/computercraft/{turtle_upgrades => turtle_upgrade}/overpowered_weak_automata.json (100%) rename src/generated/resources/data/advancedperipherals/computercraft/{turtle_upgrades => turtle_upgrade}/player_turtle.json (100%) rename src/generated/resources/data/advancedperipherals/computercraft/{turtle_upgrades => turtle_upgrade}/weak_automata.json (100%) delete mode 100644 src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/geoscanner_turtle.json rename src/generated/resources/data/advancedperipherals/{loot_tables => loot_table}/blocks/block_reader.json (78%) rename src/generated/resources/data/advancedperipherals/{loot_tables => loot_table}/blocks/chat_box.json (78%) rename src/generated/resources/data/advancedperipherals/{loot_tables => loot_table}/blocks/energy_detector.json (79%) rename src/generated/resources/data/advancedperipherals/{loot_tables => loot_table}/blocks/environment_detector.json (79%) rename src/generated/resources/data/advancedperipherals/{loot_tables => loot_table}/blocks/geo_scanner.json (78%) rename src/generated/resources/data/advancedperipherals/{loot_tables => loot_table}/blocks/inventory_manager.json (79%) rename src/generated/resources/data/advancedperipherals/{loot_tables => loot_table}/blocks/me_bridge.json (78%) rename src/generated/resources/data/advancedperipherals/{loot_tables => loot_table}/blocks/nbt_storage.json (78%) rename src/generated/resources/data/advancedperipherals/{loot_tables => loot_table}/blocks/peripheral_casing.json (79%) rename src/generated/resources/data/advancedperipherals/{loot_tables => loot_table}/blocks/player_detector.json (79%) rename src/generated/resources/data/advancedperipherals/{loot_tables => loot_table}/blocks/redstone_integrator.json (79%) delete mode 100644 src/generated/resources/data/advancedperipherals/loot_tables/blocks/rs_bridge.json rename src/generated/resources/data/advancedperipherals/{recipes => recipe}/block_reader.json (74%) rename src/generated/resources/data/advancedperipherals/{recipes => recipe}/chat_box.json (77%) rename src/generated/resources/data/advancedperipherals/{recipes => recipe}/chunk_controller.json (65%) rename src/generated/resources/data/advancedperipherals/{recipes => recipe}/computer_tool.json (71%) rename src/generated/resources/data/advancedperipherals/{recipes => recipe}/energy_detector.json (73%) rename src/generated/resources/data/advancedperipherals/{recipes => recipe}/environment_detector.json (81%) rename src/generated/resources/data/advancedperipherals/{recipes => recipe}/geo_scanner.json (74%) rename src/generated/resources/data/advancedperipherals/{recipes => recipe}/inventory_manager.json (68%) rename src/generated/resources/data/advancedperipherals/{recipes => recipe}/me_bridge.json (87%) rename src/generated/resources/data/advancedperipherals/{recipes => recipe}/memory_card.json (62%) rename src/generated/resources/data/advancedperipherals/{recipes => recipe}/nbt_storage.json (64%) rename src/generated/resources/data/advancedperipherals/{recipes => recipe}/overpowered_end_automata_core.json (74%) rename src/generated/resources/data/advancedperipherals/{recipes => recipe}/overpowered_husbandry_automata_core.json (73%) rename src/generated/resources/data/advancedperipherals/{recipes => recipe}/overpowered_weak_automata_core.json (74%) rename src/generated/resources/data/advancedperipherals/{recipes => recipe}/peripheral_casing.json (64%) rename src/generated/resources/data/advancedperipherals/{recipes => recipe}/player_detector.json (74%) rename src/generated/resources/data/advancedperipherals/{recipes => recipe}/redstone_integrator.json (73%) rename src/generated/resources/data/advancedperipherals/{recipes => recipe}/weak_automata_core.json (55%) delete mode 100644 src/generated/resources/data/advancedperipherals/recipes/rs_bridge.json rename src/generated/resources/data/{forge => neoforge}/tags/blocks/needs_wood_tool.json (100%) diff --git a/build.gradle b/build.gradle index a0433b68e..3ea5c8c14 100644 --- a/build.gradle +++ b/build.gradle @@ -220,7 +220,7 @@ dependencies { //runtimeOnly "mekanism:Mekanism:${mekanism_version}" // Applied Energistics 2 - //runtimeOnly "appeng:appliedenergistics2:${appliedenergistics_version}" + runtimeOnly "appeng:appliedenergistics2:${appliedenergistics_version}" compileOnly "appeng:appliedenergistics2:${appliedenergistics_version}" // Applied Mekanistics diff --git a/src/generated/resources/.cache/2db41954e490230d51b10affff25ee2ee27b8d5b b/src/generated/resources/.cache/2db41954e490230d51b10affff25ee2ee27b8d5b index 9d4678740..be7565fd2 100644 --- a/src/generated/resources/.cache/2db41954e490230d51b10affff25ee2ee27b8d5b +++ b/src/generated/resources/.cache/2db41954e490230d51b10affff25ee2ee27b8d5b @@ -1,2 +1,2 @@ -// 1.20.4 2024-12-22T16:09:31.6895785 AP POI Type Tags +// 1.21.1 2025-01-13T02:27:00.5603826 AP POI Type Tags d3d6b837660a4e213f287ad9d11e12368b90cd8e data/minecraft/tags/point_of_interest_type/acquirable_job_site.json diff --git a/src/generated/resources/.cache/2f719b8031aed5e605ed8d6694b19245ca45c6ca b/src/generated/resources/.cache/2f719b8031aed5e605ed8d6694b19245ca45c6ca index a43e67e3f..0c882f3c2 100644 --- a/src/generated/resources/.cache/2f719b8031aed5e605ed8d6694b19245ca45c6ca +++ b/src/generated/resources/.cache/2f719b8031aed5e605ed8d6694b19245ca45c6ca @@ -1,2 +1,2 @@ -// 1.20.4 2024-12-22T16:09:31.694585 Languages: en_us for mod: advancedperipherals -d669461c50102af6d4058086e2f12af8b0020157 assets/advancedperipherals/lang/en_us.json +// 1.21.1 2025-01-13T02:27:00.5622454 Languages: en_us for mod: advancedperipherals +b733229a45f64a6500a00da10265bc71b8320229 assets/advancedperipherals/lang/en_us.json diff --git a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d index 6200b5c67..b9bc5a85f 100644 --- a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d +++ b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d @@ -1,13 +1,12 @@ -// 1.20.4 2024-12-22T16:09:31.6905785 Loot Tables -fdf4d9f8220d3a5207f8e4334bff2f06cd203b04 data/advancedperipherals/loot_tables/blocks/block_reader.json -8c3dba853066f5f8da0a27b0783e68fc33e8bebc data/advancedperipherals/loot_tables/blocks/chat_box.json -765df45ccaef4e908a480da9cb6f13ab1b4d7545 data/advancedperipherals/loot_tables/blocks/energy_detector.json -9144fbb590a4c6e9cf7b8ef87fc80faf321c7e16 data/advancedperipherals/loot_tables/blocks/environment_detector.json -4e184ec10657d1dc11ee7da33f244b2e23d61460 data/advancedperipherals/loot_tables/blocks/geo_scanner.json -266e98d8eeec6ef465832cac664e5ab05bca96af data/advancedperipherals/loot_tables/blocks/inventory_manager.json -ee86218933f0da283ae1dd6617d74ed41a04575b data/advancedperipherals/loot_tables/blocks/me_bridge.json -6aec9d25423531f9236266e2535d6c4633129935 data/advancedperipherals/loot_tables/blocks/nbt_storage.json -e9ed113da52cddcce17768d0999d4f9aefb4cfa7 data/advancedperipherals/loot_tables/blocks/peripheral_casing.json -33c81013355b11d7c8630c811ddd80232d3c1c7c data/advancedperipherals/loot_tables/blocks/player_detector.json -e88dae55b3850e66ce81752eb060b1e0fe8f707e data/advancedperipherals/loot_tables/blocks/redstone_integrator.json -dfb4e28d40828f2ef96dc9bd7b2a67e40fcd0c78 data/advancedperipherals/loot_tables/blocks/rs_bridge.json +// 1.21.1 2025-01-13T02:27:00.5603826 Loot Tables +9b54955770745d55de988a86cbd08aa9ae23ff86 data/advancedperipherals/loot_table/blocks/block_reader.json +d4f1bc579f83dc67ce9f94d35926d34b8894c990 data/advancedperipherals/loot_table/blocks/chat_box.json +6da40a0a9d46855710272fe9d40bb5a7f0219ff2 data/advancedperipherals/loot_table/blocks/energy_detector.json +85cd3af52c824db96403e6fceea480bceda3a186 data/advancedperipherals/loot_table/blocks/environment_detector.json +7f607d7476252b89a57eb4c227cc69f4f28995e3 data/advancedperipherals/loot_table/blocks/geo_scanner.json +fddf157b52a210846f5737dcc39a16b7ab6a587a data/advancedperipherals/loot_table/blocks/inventory_manager.json +ae62bfa75e39a59374602c8a87cc2afe8b4923dd data/advancedperipherals/loot_table/blocks/me_bridge.json +51ceb7b82ba8424a2c6f03f280c14d1c2d0d18d7 data/advancedperipherals/loot_table/blocks/nbt_storage.json +fa56de9a073f32ab8a65b5f17c57f360a157b5c1 data/advancedperipherals/loot_table/blocks/peripheral_casing.json +d61b1c54dd6da8f0213d5eb8a5b40d78bff5ba90 data/advancedperipherals/loot_table/blocks/player_detector.json +6bad9bed7baa7af4b5ca3cae7c4cb8d47dc7b593 data/advancedperipherals/loot_table/blocks/redstone_integrator.json diff --git a/src/generated/resources/.cache/5a761efb7472ef97566e41e81451930a004134bf b/src/generated/resources/.cache/5a761efb7472ef97566e41e81451930a004134bf deleted file mode 100644 index 8a5b83224..000000000 --- a/src/generated/resources/.cache/5a761efb7472ef97566e41e81451930a004134bf +++ /dev/null @@ -1,13 +0,0 @@ -// 1.20.4 2024-12-22T16:09:31.6865744 Turtle Upgrades -b8f19ae0fb5bb898facc08e3787e0f96c8211881 data/advancedperipherals/computercraft/turtle_upgrades/chatty_turtle.json -fe98c60e7d61139aacf2d0872873e610aac8a37b data/advancedperipherals/computercraft/turtle_upgrades/chunky_turtle.json -ae619da638ad89d7302d832d6c09e2c87401c539 data/advancedperipherals/computercraft/turtle_upgrades/compass_turtle.json -a25b955d6db4ad48d43255d48d05c7f3acd60ea3 data/advancedperipherals/computercraft/turtle_upgrades/end_automata.json -98d71a2e17f3d30bbb76c1ba2f94a1cd610c2cd2 data/advancedperipherals/computercraft/turtle_upgrades/environment_turtle.json -d16f77b8c8c50dfefd757439802a13568cdcd5ec data/advancedperipherals/computercraft/turtle_upgrades/geoscanner_turtle.json -522bb2a1afb9f2be97af7cf65cd9aa159d76d13a data/advancedperipherals/computercraft/turtle_upgrades/husbandry_automata.json -c9b2df2d4fed11f60a8e6f8da77b2fa53dd13572 data/advancedperipherals/computercraft/turtle_upgrades/overpowered_end_automata.json -42fc2b9a2601ef44d617cb18302c2c4fff31d282 data/advancedperipherals/computercraft/turtle_upgrades/overpowered_husbandry_automata.json -fa7743922ef6b4dd3e633f2857e4047d533f13b5 data/advancedperipherals/computercraft/turtle_upgrades/overpowered_weak_automata.json -4054c59ceb099f17c4555fd5f36b2f8b4109f624 data/advancedperipherals/computercraft/turtle_upgrades/player_turtle.json -c8059a2717cfac5b02898658c4d2d52fbd5710d4 data/advancedperipherals/computercraft/turtle_upgrades/weak_automata.json diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index 60ae63aa6..e5f704979 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,39 +1,37 @@ -// 1.20.4 2024-12-26T22:13:53.2984235 Recipes -81b2ee485995edeeb21c577d141a3fb3008561a4 data/advancedperipherals/advancements/recipes/redstone/block_reader.json -4900b8e92c78828e42f434730ad93917bb298a4a data/advancedperipherals/advancements/recipes/redstone/chat_box.json -397a6604bd3c093806aac1eabaa30819a83362ce data/advancedperipherals/advancements/recipes/redstone/chunk_controller.json -15310470ad28a44c968a2e3c56b4107c081f78cd data/advancedperipherals/advancements/recipes/redstone/computer_tool.json -2df5ece90c2fe8855feafab794beab1d00458f63 data/advancedperipherals/advancements/recipes/redstone/energy_detector.json -4b4ad3153a2061dd69646750e437ee85668c2a31 data/advancedperipherals/advancements/recipes/redstone/environment_detector.json -3bafb8fde05ec490e8f0211b0e97382fe713c08e data/advancedperipherals/advancements/recipes/redstone/geo_scanner.json -6f48a77e11a886df80c6672a514bd320915c9dee data/advancedperipherals/advancements/recipes/redstone/inventory_manager.json -7e27b6eb8d0d192dc319f646ba6447d2c9f4bd01 data/advancedperipherals/advancements/recipes/redstone/memory_card.json -e43499b6608246efc710214f24aa8c0ec4a65188 data/advancedperipherals/advancements/recipes/redstone/me_bridge.json -6550380146553418c22f70bef035aa7948fe58c5 data/advancedperipherals/advancements/recipes/redstone/nbt_storage.json -60949a6e0f4e50aee869fe617c256673b37e05f6 data/advancedperipherals/advancements/recipes/redstone/overpowered_end_automata_core.json -f7aaa36a885ee058e357422ef3261ed2e0e06c2f data/advancedperipherals/advancements/recipes/redstone/overpowered_husbandry_automata_core.json -6f8a6c4e74a4208915ec1f4c0065d62294c67c15 data/advancedperipherals/advancements/recipes/redstone/overpowered_weak_automata_core.json -1b08adf8952253e016be01157f749f6ab1bd3f0d data/advancedperipherals/advancements/recipes/redstone/peripheral_casing.json -6cefb0700ed4ff952ade60ca4ef9e48a9c0ff3fb data/advancedperipherals/advancements/recipes/redstone/player_detector.json -8f28aab37ae3dd8935ba3f827f2f0b1101852565 data/advancedperipherals/advancements/recipes/redstone/redstone_integrator.json -66277f490809169783247e32f37b501be83dfa6c data/advancedperipherals/advancements/recipes/redstone/rs_bridge.json -712fb0a23a9ab7cadab8bd05175c247a0b5295b4 data/advancedperipherals/advancements/recipes/redstone/weak_automata_core.json -f8acf88364459d1b38a9ac0fc3a2e87821f98edf data/advancedperipherals/recipes/block_reader.json -b1f3b9f50e62e2f53b23ad14248cb91acb745c37 data/advancedperipherals/recipes/chat_box.json -3c6f45e5977b200c900a71bad4b531d2b7e1164c data/advancedperipherals/recipes/chunk_controller.json -a39d46363291e5d98a8b96e17bfcfd44fbe3789d data/advancedperipherals/recipes/computer_tool.json -66d1e3ed636629a9a5f7e1a8b0b7d222f0300e00 data/advancedperipherals/recipes/energy_detector.json -85920e576d404f5ad78ba228f9d6cb9aed3d4962 data/advancedperipherals/recipes/environment_detector.json -4bf49ae496c60e5487c1e87013ef25e14bb13e3a data/advancedperipherals/recipes/geo_scanner.json -2eb633f159ac1b9feaffab383548f56b573f1519 data/advancedperipherals/recipes/inventory_manager.json -dbefebf13084fce55660cffabb955f25901a30f9 data/advancedperipherals/recipes/memory_card.json -f270bf14c921f717d294d8009356deeabf403053 data/advancedperipherals/recipes/me_bridge.json -fddcb2d34c37f4fd5834e077efd27f2cb6127c73 data/advancedperipherals/recipes/nbt_storage.json -afb8673c5643adbbf69a469776ac4cd908ab17e8 data/advancedperipherals/recipes/overpowered_end_automata_core.json -7c98974c9e5999b0186011ff7f910ae2b3cc76b6 data/advancedperipherals/recipes/overpowered_husbandry_automata_core.json -40110dc9c8616e5c9b30b087cfc2f9254c433025 data/advancedperipherals/recipes/overpowered_weak_automata_core.json -346dd97a088087077c157c29cb1ac7b25b0a0cef data/advancedperipherals/recipes/peripheral_casing.json -cba141d36a134a03ae91869abb91c9695bd92898 data/advancedperipherals/recipes/player_detector.json -d5a72afad727dd9814f4c8ef6b177a0db0bc9989 data/advancedperipherals/recipes/redstone_integrator.json -6354df82d465eba4f7f6c2bedf744a97bd6c8de6 data/advancedperipherals/recipes/rs_bridge.json -96aadb6d4a930083832331a5ad6f1b7970fa4cc7 data/advancedperipherals/recipes/weak_automata_core.json +// 1.21.1 2025-01-13T02:27:00.560897 Recipes +f5ba1f7d129c88dca1a13c8deaae2d269644c7fa data/advancedperipherals/advancement/recipes/redstone/block_reader.json +e172645262ade9fc4a1c999a2c0041711c2eab55 data/advancedperipherals/advancement/recipes/redstone/chat_box.json +213de9a7e340c5eb9c01d82a72e7b58921c5290a data/advancedperipherals/advancement/recipes/redstone/chunk_controller.json +22a3e69547b1747232ad31eae8421e5e19b99fbe data/advancedperipherals/advancement/recipes/redstone/computer_tool.json +6ceff500825afce815e8e18973f1ad4d67c1fe12 data/advancedperipherals/advancement/recipes/redstone/energy_detector.json +a681c8e71de169543d040cb642a73c78c869996a data/advancedperipherals/advancement/recipes/redstone/environment_detector.json +6185db5c5e46fd50689be5a09148fac3ca6597a4 data/advancedperipherals/advancement/recipes/redstone/geo_scanner.json +e42a673e5560588d9e15a588fde9b1007cb5cb92 data/advancedperipherals/advancement/recipes/redstone/inventory_manager.json +baecdaf090fa243789d5556b7805ffef90982b89 data/advancedperipherals/advancement/recipes/redstone/memory_card.json +dc9dca7938a135dd5457ecf87c4f7d381a903412 data/advancedperipherals/advancement/recipes/redstone/me_bridge.json +c348c8990fc9bbd21509241ce44d082588a22acb data/advancedperipherals/advancement/recipes/redstone/nbt_storage.json +f218420f4c94524614229bb2d50e5c7f8e6beb28 data/advancedperipherals/advancement/recipes/redstone/overpowered_end_automata_core.json +5c2eb93fbe93dadac77d14a9c8aa2e93e3e926c0 data/advancedperipherals/advancement/recipes/redstone/overpowered_husbandry_automata_core.json +2c0460050e7eb58ee2600585dc503e6d5570d148 data/advancedperipherals/advancement/recipes/redstone/overpowered_weak_automata_core.json +2c38bc3468e8db1caac94d8ddfff68f50d596439 data/advancedperipherals/advancement/recipes/redstone/peripheral_casing.json +7dd96be9f8e31ce60752727119aa9fc738c43e3b data/advancedperipherals/advancement/recipes/redstone/player_detector.json +38be5210a7d2bb22d63674af46867a1b38c022e1 data/advancedperipherals/advancement/recipes/redstone/redstone_integrator.json +6489fff67f0d703c3a087d728eb4801413b686f5 data/advancedperipherals/advancement/recipes/redstone/weak_automata_core.json +b48e0eed6f4cfbe62c8b7c411e92e3b38ad4e4f9 data/advancedperipherals/recipe/block_reader.json +c8d06dd085c0477f94d90f3a5f0800c3efc08d02 data/advancedperipherals/recipe/chat_box.json +8c04e36fa4b88e827a5587990dc4ad94aade2eab data/advancedperipherals/recipe/chunk_controller.json +94d7248693fc9c5f4a307aaa72cc51136d54c7fe data/advancedperipherals/recipe/computer_tool.json +7e16f0709dfe728a5d1c677d3bee4d82bda28895 data/advancedperipherals/recipe/energy_detector.json +a276eb3b9827c19ced8123f46a69c1a0e767604f data/advancedperipherals/recipe/environment_detector.json +99514e8880e42821c00e7faafb2e722bb01a326c data/advancedperipherals/recipe/geo_scanner.json +68bc0e72ef07f424ea6e911b1aa02c6791100c1a data/advancedperipherals/recipe/inventory_manager.json +4f6d83b8d9f9b07bea06e382ae2858e019f27b8f data/advancedperipherals/recipe/memory_card.json +75c8f4f5c1c9edd1d94f3d9dfb0ac2dc6a1a3cbc data/advancedperipherals/recipe/me_bridge.json +51a26059ee5e9d8572560d404cb9874e8fd30416 data/advancedperipherals/recipe/nbt_storage.json +ba80666226c2a0d1aa30709e31756ca27076069a data/advancedperipherals/recipe/overpowered_end_automata_core.json +54f0e79105f168a6cb67772b39d73f0a6c3da563 data/advancedperipherals/recipe/overpowered_husbandry_automata_core.json +75de49f386b0f8d7a461420bc4c97759da8a1238 data/advancedperipherals/recipe/overpowered_weak_automata_core.json +0d659e0d2c832e4eef3e43cb77ddad64e071345a data/advancedperipherals/recipe/peripheral_casing.json +205166613824976d691cd0503f0e399e5b17616e data/advancedperipherals/recipe/player_detector.json +b219e8902fcea47776cb23c85e25e58efecc8f00 data/advancedperipherals/recipe/redstone_integrator.json +898d1243e5d1038e934f3ef5522aeae2f0468f43 data/advancedperipherals/recipe/weak_automata_core.json diff --git a/src/generated/resources/.cache/ae219fa7c7d3297c14e454863eac3998a4eab78c b/src/generated/resources/.cache/ae219fa7c7d3297c14e454863eac3998a4eab78c deleted file mode 100644 index dd38e436c..000000000 --- a/src/generated/resources/.cache/ae219fa7c7d3297c14e454863eac3998a4eab78c +++ /dev/null @@ -1,5 +0,0 @@ -// 1.20.4 2024-12-22T16:09:31.6935769 Pocket Computer Upgrades -b672635324c0df354e587efc81d0b19a581eae2f data/advancedperipherals/computercraft/pocket_upgrades/chatty_pocket.json -d4647159c2f2693a9c5e8d12bf740635751d29a8 data/advancedperipherals/computercraft/pocket_upgrades/environment_pocket.json -8216a0a7d8ebe3ae738c8fc3626df25eb0a2e07a data/advancedperipherals/computercraft/pocket_upgrades/geoscanner_pocket.json -a38aa83593f7ad0ace98e01bb3b5f06f272ef734 data/advancedperipherals/computercraft/pocket_upgrades/player_pocket.json diff --git a/src/generated/resources/.cache/b8526e444ae7356037f3a813274f6835d1f3dd16 b/src/generated/resources/.cache/b8526e444ae7356037f3a813274f6835d1f3dd16 index 52588e36c..69e8dc93f 100644 --- a/src/generated/resources/.cache/b8526e444ae7356037f3a813274f6835d1f3dd16 +++ b/src/generated/resources/.cache/b8526e444ae7356037f3a813274f6835d1f3dd16 @@ -1,4 +1,4 @@ -// 1.20.4 2024-12-22T16:09:31.694585 Block States: advancedperipherals +// 1.21.1 2025-01-13T02:27:00.560897 Block States: advancedperipherals 5e28ce1be9a6996d982641e5df1fa7162090b8cc assets/advancedperipherals/blockstates/block_reader.json f42bdde60f84fdb312f7cf3b2be461d9c11ebdc8 assets/advancedperipherals/blockstates/chat_box.json 67420f28031606ca03db9a044141bb22b0fa78b7 assets/advancedperipherals/blockstates/energy_detector.json @@ -10,7 +10,6 @@ d1fe6188b0b0ce8779cb9795a746177858cbaa41 assets/advancedperipherals/blockstates/ 51d1ce8b8772773acc82895ff6314370138c9d5a assets/advancedperipherals/blockstates/peripheral_casing.json ff12c7217911184266589813a2c8f9b0d46cfd65 assets/advancedperipherals/blockstates/player_detector.json 726cf2599b0c765bcfacda88a1943be74f985877 assets/advancedperipherals/blockstates/redstone_integrator.json -6b176e8fdb048f7b6678bfbc1c4baf2bcfa67a1f assets/advancedperipherals/blockstates/rs_bridge.json 544ff1ecb58622350b58940036b4b1908e1146da assets/advancedperipherals/models/block/block_reader.json b28693973b6bbbb61e0c1ffc59e8ca98d8bb7e97 assets/advancedperipherals/models/block/chat_box.json 96ef564804fdc2b5184462747935f52baa35c651 assets/advancedperipherals/models/block/energy_detector.json @@ -22,4 +21,3 @@ a647b86b8a7862af738136c9375a5d27d3b08860 assets/advancedperipherals/models/block 36b6ac01be085492aa6298eeb89e6ecaa3cb6f82 assets/advancedperipherals/models/block/peripheral_casing.json 40369caaaf2f593d786a9c64284647fed8ae3a47 assets/advancedperipherals/models/block/player_detector.json bed2ba2ba497ccde06c99712483fe220c277b4be assets/advancedperipherals/models/block/redstone_integrator.json -019c10d5062b5e7ae3e641527b9badab7a50878d assets/advancedperipherals/models/block/rs_bridge.json diff --git a/src/generated/resources/.cache/f95c7003282837dabaa33e3ffceec4e6865b5218 b/src/generated/resources/.cache/f95c7003282837dabaa33e3ffceec4e6865b5218 index c2b367e41..6d57802c8 100644 --- a/src/generated/resources/.cache/f95c7003282837dabaa33e3ffceec4e6865b5218 +++ b/src/generated/resources/.cache/f95c7003282837dabaa33e3ffceec4e6865b5218 @@ -1,4 +1,4 @@ -// 1.20.4 2024-12-22T16:09:31.6885763 Block tags -e1f71dcb4f9e7e36e29b0ad09d6520dc3adfa4a6 data/forge/tags/blocks/needs_wood_tool.json -c51355cf8bc6acdfc555d90d3a4562790e0e006b data/minecraft/tags/blocks/mineable/pickaxe.json -9359859937d9d03ddcb8a5cba399bdea6300c89b data/minecraft/tags/blocks/needs_iron_tool.json +// 1.21.1 2025-01-13T02:27:00.559332 Block tags +5b2e51f09296cc50686a478ed03bd9debc9a395b data/minecraft/tags/blocks/mineable/pickaxe.json +e9a65cdbf463c5378a799f69539feeae82a3e85e data/minecraft/tags/blocks/needs_iron_tool.json +e1f71dcb4f9e7e36e29b0ad09d6520dc3adfa4a6 data/neoforge/tags/blocks/needs_wood_tool.json diff --git a/src/generated/resources/.cache/ff85aeffff7b400453d938ac4326ddfe68257a73 b/src/generated/resources/.cache/ff85aeffff7b400453d938ac4326ddfe68257a73 new file mode 100644 index 000000000..d9a4d3c19 --- /dev/null +++ b/src/generated/resources/.cache/ff85aeffff7b400453d938ac4326ddfe68257a73 @@ -0,0 +1,13 @@ +// 1.21.1 2025-01-13T02:27:00.5583322 vanilla/Registries +b8f19ae0fb5bb898facc08e3787e0f96c8211881 data/advancedperipherals/computercraft/turtle_upgrade/chatty_turtle.json +fe98c60e7d61139aacf2d0872873e610aac8a37b data/advancedperipherals/computercraft/turtle_upgrade/chunky_turtle.json +ae619da638ad89d7302d832d6c09e2c87401c539 data/advancedperipherals/computercraft/turtle_upgrade/compass_turtle.json +a25b955d6db4ad48d43255d48d05c7f3acd60ea3 data/advancedperipherals/computercraft/turtle_upgrade/end_automata.json +98d71a2e17f3d30bbb76c1ba2f94a1cd610c2cd2 data/advancedperipherals/computercraft/turtle_upgrade/environment_turtle.json +a3b3e4cbaedee3a929a4c9775e4f1a4cbd292b42 data/advancedperipherals/computercraft/turtle_upgrade/geoscanner_turtle.json +522bb2a1afb9f2be97af7cf65cd9aa159d76d13a data/advancedperipherals/computercraft/turtle_upgrade/husbandry_automata.json +c9b2df2d4fed11f60a8e6f8da77b2fa53dd13572 data/advancedperipherals/computercraft/turtle_upgrade/overpowered_end_automata.json +42fc2b9a2601ef44d617cb18302c2c4fff31d282 data/advancedperipherals/computercraft/turtle_upgrade/overpowered_husbandry_automata.json +fa7743922ef6b4dd3e633f2857e4047d533f13b5 data/advancedperipherals/computercraft/turtle_upgrade/overpowered_weak_automata.json +4054c59ceb099f17c4555fd5f36b2f8b4109f624 data/advancedperipherals/computercraft/turtle_upgrade/player_turtle.json +c8059a2717cfac5b02898658c4d2d52fbd5710d4 data/advancedperipherals/computercraft/turtle_upgrade/weak_automata.json diff --git a/src/generated/resources/assets/advancedperipherals/blockstates/rs_bridge.json b/src/generated/resources/assets/advancedperipherals/blockstates/rs_bridge.json deleted file mode 100644 index a1b1d565a..000000000 --- a/src/generated/resources/assets/advancedperipherals/blockstates/rs_bridge.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "variants": { - "orientation=down_east": { - "model": "advancedperipherals:block/rs_bridge", - "x": 90, - "y": 90 - }, - "orientation=down_north": { - "model": "advancedperipherals:block/rs_bridge", - "x": 90 - }, - "orientation=down_south": { - "model": "advancedperipherals:block/rs_bridge", - "x": 90, - "y": 180 - }, - "orientation=down_west": { - "model": "advancedperipherals:block/rs_bridge", - "x": 90, - "y": 270 - }, - "orientation=east_up": { - "model": "advancedperipherals:block/rs_bridge", - "y": 90 - }, - "orientation=north_up": { - "model": "advancedperipherals:block/rs_bridge" - }, - "orientation=south_up": { - "model": "advancedperipherals:block/rs_bridge", - "y": 180 - }, - "orientation=up_east": { - "model": "advancedperipherals:block/rs_bridge", - "x": 270, - "y": 90 - }, - "orientation=up_north": { - "model": "advancedperipherals:block/rs_bridge", - "x": 270 - }, - "orientation=up_south": { - "model": "advancedperipherals:block/rs_bridge", - "x": 270, - "y": 180 - }, - "orientation=up_west": { - "model": "advancedperipherals:block/rs_bridge", - "x": 270, - "y": 270 - }, - "orientation=west_up": { - "model": "advancedperipherals:block/rs_bridge", - "y": 270 - } - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/advancedperipherals/lang/en_us.json b/src/generated/resources/assets/advancedperipherals/lang/en_us.json index bc55241ae..1176cb3fd 100644 --- a/src/generated/resources/assets/advancedperipherals/lang/en_us.json +++ b/src/generated/resources/assets/advancedperipherals/lang/en_us.json @@ -27,7 +27,6 @@ "block.advancedperipherals.peripheral_casing": "Peripheral Casing", "block.advancedperipherals.player_detector": "Player Detector", "block.advancedperipherals.redstone_integrator": "Redstone Integrator", - "block.advancedperipherals.rs_bridge": "RS Bridge", "entity.minecraft.villager.advancedperipherals.computer_scientist": "Computer Scientist", "item.advancedperipherals.chunk_controller": "Chunk Controller", "item.advancedperipherals.computer_tool": "Computer Tool", @@ -58,7 +57,6 @@ "item.advancedperipherals.tooltip.peripheral_casing": "&7An empty hull without the love it deserves. Used as a crafting ingredient", "item.advancedperipherals.tooltip.player_detector": "&7This peripheral can be used to interact with players, but don't be a stalker.", "item.advancedperipherals.tooltip.redstone_integrator": "&7This block is able to interact with redstone. Works exactly like the redstone api of an computer.", - "item.advancedperipherals.tooltip.rs_bridge": "&7The RS Bridge interacts with Refined Storage to manage your items.", "item.advancedperipherals.tooltip.show_desc": "&b[&7%s&b] &7For Description", "item.advancedperipherals.tooltip.weak_automata_core": "&7Upgrade for turtles, which makes turtles more useful.", "item.advancedperipherals.weak_automata_core": "Weak Automata Core", diff --git a/src/generated/resources/assets/advancedperipherals/models/block/rs_bridge.json b/src/generated/resources/assets/advancedperipherals/models/block/rs_bridge.json deleted file mode 100644 index 10e0f003a..000000000 --- a/src/generated/resources/assets/advancedperipherals/models/block/rs_bridge.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "minecraft:block/cube_all", - "textures": { - "all": "advancedperipherals:block/rs_bridge", - "north": "advancedperipherals:block/rs_bridge_front", - "particle": "advancedperipherals:block/rs_bridge_front" - } -} \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/block_reader.json b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/block_reader.json similarity index 85% rename from src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/block_reader.json rename to src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/block_reader.json index baff01fb2..3b6c3f43f 100644 --- a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/block_reader.json +++ b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/block_reader.json @@ -5,9 +5,7 @@ "conditions": { "items": [ { - "items": [ - "advancedperipherals:peripheral_casing" - ] + "items": "advancedperipherals:peripheral_casing" } ] }, diff --git a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/chat_box.json b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/chat_box.json similarity index 85% rename from src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/chat_box.json rename to src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/chat_box.json index 69aff301e..66e036f58 100644 --- a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/chat_box.json +++ b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/chat_box.json @@ -5,9 +5,7 @@ "conditions": { "items": [ { - "items": [ - "advancedperipherals:peripheral_casing" - ] + "items": "advancedperipherals:peripheral_casing" } ] }, diff --git a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/chunk_controller.json b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/chunk_controller.json similarity index 87% rename from src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/chunk_controller.json rename to src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/chunk_controller.json index 9146a4ebe..323c64bd8 100644 --- a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/chunk_controller.json +++ b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/chunk_controller.json @@ -5,9 +5,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:respawn_anchor" - ] + "items": "minecraft:respawn_anchor" } ] }, diff --git a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/computer_tool.json b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/computer_tool.json similarity index 87% rename from src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/computer_tool.json rename to src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/computer_tool.json index d9d0b79fe..3672da48a 100644 --- a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/computer_tool.json +++ b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/computer_tool.json @@ -5,9 +5,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:blue_terracotta" - ] + "items": "minecraft:blue_terracotta" } ] }, diff --git a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/energy_detector.json b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/energy_detector.json similarity index 85% rename from src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/energy_detector.json rename to src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/energy_detector.json index 165dc38bd..d3e48cf1b 100644 --- a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/energy_detector.json +++ b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/energy_detector.json @@ -5,9 +5,7 @@ "conditions": { "items": [ { - "items": [ - "advancedperipherals:peripheral_casing" - ] + "items": "advancedperipherals:peripheral_casing" } ] }, diff --git a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/environment_detector.json b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/environment_detector.json similarity index 85% rename from src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/environment_detector.json rename to src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/environment_detector.json index d56a7c98e..35311e197 100644 --- a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/environment_detector.json +++ b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/environment_detector.json @@ -5,9 +5,7 @@ "conditions": { "items": [ { - "items": [ - "advancedperipherals:peripheral_casing" - ] + "items": "advancedperipherals:peripheral_casing" } ] }, diff --git a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/geo_scanner.json b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/geo_scanner.json similarity index 85% rename from src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/geo_scanner.json rename to src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/geo_scanner.json index 1b5f3e59a..fd4981b81 100644 --- a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/geo_scanner.json +++ b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/geo_scanner.json @@ -5,9 +5,7 @@ "conditions": { "items": [ { - "items": [ - "advancedperipherals:peripheral_casing" - ] + "items": "advancedperipherals:peripheral_casing" } ] }, diff --git a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/inventory_manager.json b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/inventory_manager.json similarity index 85% rename from src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/inventory_manager.json rename to src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/inventory_manager.json index 9cfc93ca8..316fad0a6 100644 --- a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/inventory_manager.json +++ b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/inventory_manager.json @@ -5,9 +5,7 @@ "conditions": { "items": [ { - "items": [ - "advancedperipherals:peripheral_casing" - ] + "items": "advancedperipherals:peripheral_casing" } ] }, diff --git a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/me_bridge.json b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/me_bridge.json similarity index 87% rename from src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/me_bridge.json rename to src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/me_bridge.json index 930c9e93c..32fbd51b2 100644 --- a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/me_bridge.json +++ b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/me_bridge.json @@ -11,9 +11,7 @@ "conditions": { "items": [ { - "items": [ - "advancedperipherals:peripheral_casing" - ] + "items": "advancedperipherals:peripheral_casing" } ] }, diff --git a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/memory_card.json b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/memory_card.json similarity index 88% rename from src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/memory_card.json rename to src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/memory_card.json index e5330b121..bd385e3a4 100644 --- a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/memory_card.json +++ b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/memory_card.json @@ -5,9 +5,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:observer" - ] + "items": "minecraft:observer" } ] }, diff --git a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/nbt_storage.json b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/nbt_storage.json similarity index 85% rename from src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/nbt_storage.json rename to src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/nbt_storage.json index 5bfb877ae..b4eb90e53 100644 --- a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/nbt_storage.json +++ b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/nbt_storage.json @@ -5,9 +5,7 @@ "conditions": { "items": [ { - "items": [ - "advancedperipherals:peripheral_casing" - ] + "items": "advancedperipherals:peripheral_casing" } ] }, diff --git a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/overpowered_end_automata_core.json b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/overpowered_end_automata_core.json similarity index 86% rename from src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/overpowered_end_automata_core.json rename to src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/overpowered_end_automata_core.json index 79d0548be..6d4b1b19b 100644 --- a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/overpowered_end_automata_core.json +++ b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/overpowered_end_automata_core.json @@ -5,9 +5,7 @@ "conditions": { "items": [ { - "items": [ - "advancedperipherals:end_automata_core" - ] + "items": "advancedperipherals:end_automata_core" } ] }, diff --git a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/overpowered_husbandry_automata_core.json b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/overpowered_husbandry_automata_core.json similarity index 85% rename from src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/overpowered_husbandry_automata_core.json rename to src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/overpowered_husbandry_automata_core.json index 8b6951afc..42a9e1e84 100644 --- a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/overpowered_husbandry_automata_core.json +++ b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/overpowered_husbandry_automata_core.json @@ -5,9 +5,7 @@ "conditions": { "items": [ { - "items": [ - "advancedperipherals:husbandry_automata_core" - ] + "items": "advancedperipherals:husbandry_automata_core" } ] }, diff --git a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/overpowered_weak_automata_core.json b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/overpowered_weak_automata_core.json similarity index 86% rename from src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/overpowered_weak_automata_core.json rename to src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/overpowered_weak_automata_core.json index c3381a9d6..9037b83e7 100644 --- a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/overpowered_weak_automata_core.json +++ b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/overpowered_weak_automata_core.json @@ -5,9 +5,7 @@ "conditions": { "items": [ { - "items": [ - "advancedperipherals:weak_automata_core" - ] + "items": "advancedperipherals:weak_automata_core" } ] }, diff --git a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/peripheral_casing.json b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/peripheral_casing.json similarity index 87% rename from src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/peripheral_casing.json rename to src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/peripheral_casing.json index 7b892d630..af54056ee 100644 --- a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/peripheral_casing.json +++ b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/peripheral_casing.json @@ -5,9 +5,7 @@ "conditions": { "items": [ { - "items": [ - "minecraft:redstone_block" - ] + "items": "minecraft:redstone_block" } ] }, diff --git a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/player_detector.json b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/player_detector.json similarity index 85% rename from src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/player_detector.json rename to src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/player_detector.json index 48537c8b4..164111fb6 100644 --- a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/player_detector.json +++ b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/player_detector.json @@ -5,9 +5,7 @@ "conditions": { "items": [ { - "items": [ - "advancedperipherals:peripheral_casing" - ] + "items": "advancedperipherals:peripheral_casing" } ] }, diff --git a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/redstone_integrator.json b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/redstone_integrator.json similarity index 85% rename from src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/redstone_integrator.json rename to src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/redstone_integrator.json index 1c5a17343..2265fddf2 100644 --- a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/redstone_integrator.json +++ b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/redstone_integrator.json @@ -5,9 +5,7 @@ "conditions": { "items": [ { - "items": [ - "advancedperipherals:peripheral_casing" - ] + "items": "advancedperipherals:peripheral_casing" } ] }, diff --git a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/weak_automata_core.json b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/weak_automata_core.json similarity index 85% rename from src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/weak_automata_core.json rename to src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/weak_automata_core.json index 40d82492e..81c45ced6 100644 --- a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/weak_automata_core.json +++ b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/weak_automata_core.json @@ -5,9 +5,7 @@ "conditions": { "items": [ { - "items": [ - "advancedperipherals:peripheral_casing" - ] + "items": "advancedperipherals:peripheral_casing" } ] }, diff --git a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/rs_bridge.json b/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/rs_bridge.json deleted file mode 100644 index fb191d49d..000000000 --- a/src/generated/resources/data/advancedperipherals/advancements/recipes/redstone/rs_bridge.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "neoforge:conditions": [ - { - "type": "neoforge:mod_loaded", - "modid": "refinedstorage" - } - ], - "parent": "minecraft:recipes/root", - "criteria": { - "has_item": { - "conditions": { - "items": [ - { - "items": [ - "advancedperipherals:peripheral_casing" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "advancedperipherals:rs_bridge" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_the_recipe", - "has_item" - ] - ], - "rewards": { - "recipes": [ - "advancedperipherals:rs_bridge" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrades/chatty_pocket.json b/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrades/chatty_pocket.json deleted file mode 100644 index 5b739eab0..000000000 --- a/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrades/chatty_pocket.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "advancedperipherals:chatty_pocket", - "item": "advancedperipherals:chat_box" -} \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrades/geoscanner_pocket.json b/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrades/geoscanner_pocket.json deleted file mode 100644 index dffc722c6..000000000 --- a/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrades/geoscanner_pocket.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "advancedperipherals:geoscanner_pocket", - "item": "advancedperipherals:geo_scanner" -} \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrades/player_pocket.json b/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrades/player_pocket.json deleted file mode 100644 index 0c307cb95..000000000 --- a/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrades/player_pocket.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "advancedperipherals:player_pocket", - "item": "advancedperipherals:player_detector" -} \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/chatty_turtle.json b/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/chatty_turtle.json similarity index 100% rename from src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/chatty_turtle.json rename to src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/chatty_turtle.json diff --git a/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/chunky_turtle.json b/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/chunky_turtle.json similarity index 100% rename from src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/chunky_turtle.json rename to src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/chunky_turtle.json diff --git a/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/compass_turtle.json b/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/compass_turtle.json similarity index 100% rename from src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/compass_turtle.json rename to src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/compass_turtle.json diff --git a/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/end_automata.json b/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/end_automata.json similarity index 100% rename from src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/end_automata.json rename to src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/end_automata.json diff --git a/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/environment_turtle.json b/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/environment_turtle.json similarity index 100% rename from src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/environment_turtle.json rename to src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/environment_turtle.json diff --git a/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrades/environment_pocket.json b/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/geoscanner_turtle.json similarity index 51% rename from src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrades/environment_pocket.json rename to src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/geoscanner_turtle.json index 6196caa16..e7f635533 100644 --- a/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrades/environment_pocket.json +++ b/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/geoscanner_turtle.json @@ -1,4 +1,4 @@ { - "type": "advancedperipherals:environment_pocket", + "type": "advancedperipherals:geoscanner_turtle", "item": "advancedperipherals:environment_detector" } \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/husbandry_automata.json b/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/husbandry_automata.json similarity index 100% rename from src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/husbandry_automata.json rename to src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/husbandry_automata.json diff --git a/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/overpowered_end_automata.json b/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/overpowered_end_automata.json similarity index 100% rename from src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/overpowered_end_automata.json rename to src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/overpowered_end_automata.json diff --git a/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/overpowered_husbandry_automata.json b/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/overpowered_husbandry_automata.json similarity index 100% rename from src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/overpowered_husbandry_automata.json rename to src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/overpowered_husbandry_automata.json diff --git a/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/overpowered_weak_automata.json b/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/overpowered_weak_automata.json similarity index 100% rename from src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/overpowered_weak_automata.json rename to src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/overpowered_weak_automata.json diff --git a/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/player_turtle.json b/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/player_turtle.json similarity index 100% rename from src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/player_turtle.json rename to src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/player_turtle.json diff --git a/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/weak_automata.json b/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/weak_automata.json similarity index 100% rename from src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/weak_automata.json rename to src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/weak_automata.json diff --git a/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/geoscanner_turtle.json b/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/geoscanner_turtle.json deleted file mode 100644 index 18daf30be..000000000 --- a/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrades/geoscanner_turtle.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "advancedperipherals:geoscanner_turtle", - "item": "advancedperipherals:geo_scanner" -} \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/block_reader.json b/src/generated/resources/data/advancedperipherals/loot_table/blocks/block_reader.json similarity index 78% rename from src/generated/resources/data/advancedperipherals/loot_tables/blocks/block_reader.json rename to src/generated/resources/data/advancedperipherals/loot_table/blocks/block_reader.json index c6c5746be..343f7fa6d 100644 --- a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/block_reader.json +++ b/src/generated/resources/data/advancedperipherals/loot_table/blocks/block_reader.json @@ -13,7 +13,10 @@ "type": "minecraft:item", "functions": [ { - "function": "minecraft:copy_name", + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], "source": "block_entity" } ], diff --git a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/chat_box.json b/src/generated/resources/data/advancedperipherals/loot_table/blocks/chat_box.json similarity index 78% rename from src/generated/resources/data/advancedperipherals/loot_tables/blocks/chat_box.json rename to src/generated/resources/data/advancedperipherals/loot_table/blocks/chat_box.json index 1c2aef2a3..e51cf3b02 100644 --- a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/chat_box.json +++ b/src/generated/resources/data/advancedperipherals/loot_table/blocks/chat_box.json @@ -13,7 +13,10 @@ "type": "minecraft:item", "functions": [ { - "function": "minecraft:copy_name", + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], "source": "block_entity" } ], diff --git a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/energy_detector.json b/src/generated/resources/data/advancedperipherals/loot_table/blocks/energy_detector.json similarity index 79% rename from src/generated/resources/data/advancedperipherals/loot_tables/blocks/energy_detector.json rename to src/generated/resources/data/advancedperipherals/loot_table/blocks/energy_detector.json index 2b4c2c7b2..66c904f1c 100644 --- a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/energy_detector.json +++ b/src/generated/resources/data/advancedperipherals/loot_table/blocks/energy_detector.json @@ -13,7 +13,10 @@ "type": "minecraft:item", "functions": [ { - "function": "minecraft:copy_name", + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], "source": "block_entity" } ], diff --git a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/environment_detector.json b/src/generated/resources/data/advancedperipherals/loot_table/blocks/environment_detector.json similarity index 79% rename from src/generated/resources/data/advancedperipherals/loot_tables/blocks/environment_detector.json rename to src/generated/resources/data/advancedperipherals/loot_table/blocks/environment_detector.json index 47cbb35c0..72c6d5e16 100644 --- a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/environment_detector.json +++ b/src/generated/resources/data/advancedperipherals/loot_table/blocks/environment_detector.json @@ -13,7 +13,10 @@ "type": "minecraft:item", "functions": [ { - "function": "minecraft:copy_name", + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], "source": "block_entity" } ], diff --git a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/geo_scanner.json b/src/generated/resources/data/advancedperipherals/loot_table/blocks/geo_scanner.json similarity index 78% rename from src/generated/resources/data/advancedperipherals/loot_tables/blocks/geo_scanner.json rename to src/generated/resources/data/advancedperipherals/loot_table/blocks/geo_scanner.json index 7f9d55082..419af5176 100644 --- a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/geo_scanner.json +++ b/src/generated/resources/data/advancedperipherals/loot_table/blocks/geo_scanner.json @@ -13,7 +13,10 @@ "type": "minecraft:item", "functions": [ { - "function": "minecraft:copy_name", + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], "source": "block_entity" } ], diff --git a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/inventory_manager.json b/src/generated/resources/data/advancedperipherals/loot_table/blocks/inventory_manager.json similarity index 79% rename from src/generated/resources/data/advancedperipherals/loot_tables/blocks/inventory_manager.json rename to src/generated/resources/data/advancedperipherals/loot_table/blocks/inventory_manager.json index de0e972f6..6054afad9 100644 --- a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/inventory_manager.json +++ b/src/generated/resources/data/advancedperipherals/loot_table/blocks/inventory_manager.json @@ -13,7 +13,10 @@ "type": "minecraft:item", "functions": [ { - "function": "minecraft:copy_name", + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], "source": "block_entity" } ], diff --git a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/me_bridge.json b/src/generated/resources/data/advancedperipherals/loot_table/blocks/me_bridge.json similarity index 78% rename from src/generated/resources/data/advancedperipherals/loot_tables/blocks/me_bridge.json rename to src/generated/resources/data/advancedperipherals/loot_table/blocks/me_bridge.json index 1921ca589..5f633bbbc 100644 --- a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/me_bridge.json +++ b/src/generated/resources/data/advancedperipherals/loot_table/blocks/me_bridge.json @@ -13,7 +13,10 @@ "type": "minecraft:item", "functions": [ { - "function": "minecraft:copy_name", + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], "source": "block_entity" } ], diff --git a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/nbt_storage.json b/src/generated/resources/data/advancedperipherals/loot_table/blocks/nbt_storage.json similarity index 78% rename from src/generated/resources/data/advancedperipherals/loot_tables/blocks/nbt_storage.json rename to src/generated/resources/data/advancedperipherals/loot_table/blocks/nbt_storage.json index 5b96bf783..90fd59757 100644 --- a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/nbt_storage.json +++ b/src/generated/resources/data/advancedperipherals/loot_table/blocks/nbt_storage.json @@ -13,7 +13,10 @@ "type": "minecraft:item", "functions": [ { - "function": "minecraft:copy_name", + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], "source": "block_entity" } ], diff --git a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/peripheral_casing.json b/src/generated/resources/data/advancedperipherals/loot_table/blocks/peripheral_casing.json similarity index 79% rename from src/generated/resources/data/advancedperipherals/loot_tables/blocks/peripheral_casing.json rename to src/generated/resources/data/advancedperipherals/loot_table/blocks/peripheral_casing.json index ebc512b29..2f5bd44c9 100644 --- a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/peripheral_casing.json +++ b/src/generated/resources/data/advancedperipherals/loot_table/blocks/peripheral_casing.json @@ -13,7 +13,10 @@ "type": "minecraft:item", "functions": [ { - "function": "minecraft:copy_name", + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], "source": "block_entity" } ], diff --git a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/player_detector.json b/src/generated/resources/data/advancedperipherals/loot_table/blocks/player_detector.json similarity index 79% rename from src/generated/resources/data/advancedperipherals/loot_tables/blocks/player_detector.json rename to src/generated/resources/data/advancedperipherals/loot_table/blocks/player_detector.json index 9c06f68ef..41835021a 100644 --- a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/player_detector.json +++ b/src/generated/resources/data/advancedperipherals/loot_table/blocks/player_detector.json @@ -13,7 +13,10 @@ "type": "minecraft:item", "functions": [ { - "function": "minecraft:copy_name", + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], "source": "block_entity" } ], diff --git a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/redstone_integrator.json b/src/generated/resources/data/advancedperipherals/loot_table/blocks/redstone_integrator.json similarity index 79% rename from src/generated/resources/data/advancedperipherals/loot_tables/blocks/redstone_integrator.json rename to src/generated/resources/data/advancedperipherals/loot_table/blocks/redstone_integrator.json index 771e2e3d3..d91f4150c 100644 --- a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/redstone_integrator.json +++ b/src/generated/resources/data/advancedperipherals/loot_table/blocks/redstone_integrator.json @@ -13,7 +13,10 @@ "type": "minecraft:item", "functions": [ { - "function": "minecraft:copy_name", + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], "source": "block_entity" } ], diff --git a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/rs_bridge.json b/src/generated/resources/data/advancedperipherals/loot_tables/blocks/rs_bridge.json deleted file mode 100644 index 5065b7f85..000000000 --- a/src/generated/resources/data/advancedperipherals/loot_tables/blocks/rs_bridge.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "bonus_rolls": 0.0, - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ], - "entries": [ - { - "type": "minecraft:item", - "functions": [ - { - "function": "minecraft:copy_name", - "source": "block_entity" - } - ], - "name": "advancedperipherals:rs_bridge" - } - ], - "rolls": 1.0 - } - ], - "random_sequence": "advancedperipherals:blocks/rs_bridge" -} \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/recipes/block_reader.json b/src/generated/resources/data/advancedperipherals/recipe/block_reader.json similarity index 74% rename from src/generated/resources/data/advancedperipherals/recipes/block_reader.json rename to src/generated/resources/data/advancedperipherals/recipe/block_reader.json index e93bf3731..fc4280770 100644 --- a/src/generated/resources/data/advancedperipherals/recipes/block_reader.json +++ b/src/generated/resources/data/advancedperipherals/recipe/block_reader.json @@ -6,7 +6,7 @@ "item": "advancedperipherals:peripheral_casing" }, "I": { - "tag": "forge:ingots/iron" + "tag": "c:ingots/iron" }, "M": { "item": "computercraft:wired_modem_full" @@ -15,7 +15,7 @@ "item": "minecraft:observer" }, "R": { - "tag": "forge:storage_blocks/redstone" + "tag": "c:storage_blocks/redstone" } }, "pattern": [ @@ -24,6 +24,7 @@ "IRI" ], "result": { - "item": "advancedperipherals:block_reader" + "count": 1, + "id": "advancedperipherals:block_reader" } } \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/recipes/chat_box.json b/src/generated/resources/data/advancedperipherals/recipe/chat_box.json similarity index 77% rename from src/generated/resources/data/advancedperipherals/recipes/chat_box.json rename to src/generated/resources/data/advancedperipherals/recipe/chat_box.json index 832cb15db..d9ddff23c 100644 --- a/src/generated/resources/data/advancedperipherals/recipes/chat_box.json +++ b/src/generated/resources/data/advancedperipherals/recipe/chat_box.json @@ -6,7 +6,7 @@ "item": "advancedperipherals:peripheral_casing" }, "G": { - "tag": "forge:ingots/gold" + "tag": "c:ingots/gold" }, "P": { "tag": "minecraft:logs" @@ -18,6 +18,7 @@ "PGP" ], "result": { - "item": "advancedperipherals:chat_box" + "count": 1, + "id": "advancedperipherals:chat_box" } } \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/recipes/chunk_controller.json b/src/generated/resources/data/advancedperipherals/recipe/chunk_controller.json similarity index 65% rename from src/generated/resources/data/advancedperipherals/recipes/chunk_controller.json rename to src/generated/resources/data/advancedperipherals/recipe/chunk_controller.json index 437a46c6c..a953b2d6a 100644 --- a/src/generated/resources/data/advancedperipherals/recipes/chunk_controller.json +++ b/src/generated/resources/data/advancedperipherals/recipe/chunk_controller.json @@ -6,10 +6,10 @@ "item": "minecraft:ender_eye" }, "I": { - "tag": "forge:ingots/iron" + "tag": "c:ingots/iron" }, "R": { - "tag": "forge:dusts/redstone" + "tag": "c:dusts/redstone" } }, "pattern": [ @@ -18,6 +18,7 @@ "IRI" ], "result": { - "item": "advancedperipherals:chunk_controller" + "count": 1, + "id": "advancedperipherals:chunk_controller" } } \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/recipes/computer_tool.json b/src/generated/resources/data/advancedperipherals/recipe/computer_tool.json similarity index 71% rename from src/generated/resources/data/advancedperipherals/recipes/computer_tool.json rename to src/generated/resources/data/advancedperipherals/recipe/computer_tool.json index 17ad1fb4b..f2c8f2783 100644 --- a/src/generated/resources/data/advancedperipherals/recipes/computer_tool.json +++ b/src/generated/resources/data/advancedperipherals/recipe/computer_tool.json @@ -6,7 +6,7 @@ "item": "minecraft:blue_terracotta" }, "I": { - "tag": "forge:ingots/iron" + "tag": "c:ingots/iron" } }, "pattern": [ @@ -15,6 +15,7 @@ " B " ], "result": { - "item": "advancedperipherals:computer_tool" + "count": 1, + "id": "advancedperipherals:computer_tool" } } \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/recipes/energy_detector.json b/src/generated/resources/data/advancedperipherals/recipe/energy_detector.json similarity index 73% rename from src/generated/resources/data/advancedperipherals/recipes/energy_detector.json rename to src/generated/resources/data/advancedperipherals/recipe/energy_detector.json index c5a2e3adb..2482ddcb2 100644 --- a/src/generated/resources/data/advancedperipherals/recipes/energy_detector.json +++ b/src/generated/resources/data/advancedperipherals/recipe/energy_detector.json @@ -6,13 +6,13 @@ "item": "advancedperipherals:peripheral_casing" }, "B": { - "tag": "forge:storage_blocks/redstone" + "tag": "c:storage_blocks/redstone" }, "C": { "item": "minecraft:comparator" }, "G": { - "tag": "forge:ingots/gold" + "tag": "c:ingots/gold" }, "R": { "item": "minecraft:redstone_torch" @@ -24,6 +24,7 @@ "BGB" ], "result": { - "item": "advancedperipherals:energy_detector" + "count": 1, + "id": "advancedperipherals:energy_detector" } } \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/recipes/environment_detector.json b/src/generated/resources/data/advancedperipherals/recipe/environment_detector.json similarity index 81% rename from src/generated/resources/data/advancedperipherals/recipes/environment_detector.json rename to src/generated/resources/data/advancedperipherals/recipe/environment_detector.json index 819f1e9fe..b69f94aa4 100644 --- a/src/generated/resources/data/advancedperipherals/recipes/environment_detector.json +++ b/src/generated/resources/data/advancedperipherals/recipe/environment_detector.json @@ -6,7 +6,7 @@ "item": "advancedperipherals:peripheral_casing" }, "C": { - "tag": "forge:crops" + "tag": "c:crops" }, "L": { "tag": "minecraft:leaves" @@ -24,6 +24,7 @@ "WCW" ], "result": { - "item": "advancedperipherals:environment_detector" + "count": 1, + "id": "advancedperipherals:environment_detector" } } \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/recipes/geo_scanner.json b/src/generated/resources/data/advancedperipherals/recipe/geo_scanner.json similarity index 74% rename from src/generated/resources/data/advancedperipherals/recipes/geo_scanner.json rename to src/generated/resources/data/advancedperipherals/recipe/geo_scanner.json index 250c20e3d..d9467e1f6 100644 --- a/src/generated/resources/data/advancedperipherals/recipes/geo_scanner.json +++ b/src/generated/resources/data/advancedperipherals/recipe/geo_scanner.json @@ -6,7 +6,7 @@ "item": "advancedperipherals:peripheral_casing" }, "D": { - "tag": "forge:gems/diamond" + "tag": "c:gems/diamond" }, "M": { "item": "computercraft:wired_modem_full" @@ -15,7 +15,7 @@ "item": "minecraft:observer" }, "R": { - "tag": "forge:storage_blocks/redstone" + "tag": "c:storage_blocks/redstone" } }, "pattern": [ @@ -24,6 +24,7 @@ "ROR" ], "result": { - "item": "advancedperipherals:geo_scanner" + "count": 1, + "id": "advancedperipherals:geo_scanner" } } \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/recipes/inventory_manager.json b/src/generated/resources/data/advancedperipherals/recipe/inventory_manager.json similarity index 68% rename from src/generated/resources/data/advancedperipherals/recipes/inventory_manager.json rename to src/generated/resources/data/advancedperipherals/recipe/inventory_manager.json index e6f605ca9..bfe74ea3e 100644 --- a/src/generated/resources/data/advancedperipherals/recipes/inventory_manager.json +++ b/src/generated/resources/data/advancedperipherals/recipe/inventory_manager.json @@ -6,10 +6,10 @@ "item": "advancedperipherals:peripheral_casing" }, "C": { - "tag": "forge:chests" + "tag": "c:chests" }, "I": { - "tag": "forge:ingots/iron" + "tag": "c:ingots/iron" } }, "pattern": [ @@ -18,6 +18,7 @@ "ICI" ], "result": { - "item": "advancedperipherals:inventory_manager" + "count": 1, + "id": "advancedperipherals:inventory_manager" } } \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/recipes/me_bridge.json b/src/generated/resources/data/advancedperipherals/recipe/me_bridge.json similarity index 87% rename from src/generated/resources/data/advancedperipherals/recipes/me_bridge.json rename to src/generated/resources/data/advancedperipherals/recipe/me_bridge.json index 964ed8bb9..bebf8b637 100644 --- a/src/generated/resources/data/advancedperipherals/recipes/me_bridge.json +++ b/src/generated/resources/data/advancedperipherals/recipe/me_bridge.json @@ -24,6 +24,7 @@ "FIF" ], "result": { - "item": "advancedperipherals:me_bridge" + "count": 1, + "id": "advancedperipherals:me_bridge" } } \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/recipes/memory_card.json b/src/generated/resources/data/advancedperipherals/recipe/memory_card.json similarity index 62% rename from src/generated/resources/data/advancedperipherals/recipes/memory_card.json rename to src/generated/resources/data/advancedperipherals/recipe/memory_card.json index 65cae3b62..76c30627e 100644 --- a/src/generated/resources/data/advancedperipherals/recipes/memory_card.json +++ b/src/generated/resources/data/advancedperipherals/recipe/memory_card.json @@ -3,16 +3,16 @@ "category": "redstone", "key": { "G": { - "tag": "forge:ingots/gold" + "tag": "c:ingots/gold" }, "I": { - "tag": "forge:ingots/iron" + "tag": "c:ingots/iron" }, "O": { "item": "minecraft:observer" }, "W": { - "tag": "forge:glass/white" + "tag": "c:glass_blocks/cheap" } }, "pattern": [ @@ -21,6 +21,7 @@ " G " ], "result": { - "item": "advancedperipherals:memory_card" + "count": 1, + "id": "advancedperipherals:memory_card" } } \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/recipes/nbt_storage.json b/src/generated/resources/data/advancedperipherals/recipe/nbt_storage.json similarity index 64% rename from src/generated/resources/data/advancedperipherals/recipes/nbt_storage.json rename to src/generated/resources/data/advancedperipherals/recipe/nbt_storage.json index b933398b0..381ea2dd9 100644 --- a/src/generated/resources/data/advancedperipherals/recipes/nbt_storage.json +++ b/src/generated/resources/data/advancedperipherals/recipe/nbt_storage.json @@ -6,13 +6,13 @@ "item": "advancedperipherals:peripheral_casing" }, "C": { - "tag": "forge:chests" + "tag": "c:chests" }, "I": { - "tag": "forge:ingots/iron" + "tag": "c:ingots/iron" }, "R": { - "tag": "forge:storage_blocks/redstone" + "tag": "c:storage_blocks/redstone" } }, "pattern": [ @@ -21,6 +21,7 @@ "RCR" ], "result": { - "item": "advancedperipherals:nbt_storage" + "count": 1, + "id": "advancedperipherals:nbt_storage" } } \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/recipes/overpowered_end_automata_core.json b/src/generated/resources/data/advancedperipherals/recipe/overpowered_end_automata_core.json similarity index 74% rename from src/generated/resources/data/advancedperipherals/recipes/overpowered_end_automata_core.json rename to src/generated/resources/data/advancedperipherals/recipe/overpowered_end_automata_core.json index 2bcbba59c..7619ef1d6 100644 --- a/src/generated/resources/data/advancedperipherals/recipes/overpowered_end_automata_core.json +++ b/src/generated/resources/data/advancedperipherals/recipe/overpowered_end_automata_core.json @@ -10,6 +10,7 @@ } ], "result": { - "item": "advancedperipherals:overpowered_end_automata_core" + "count": 1, + "id": "advancedperipherals:overpowered_end_automata_core" } } \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/recipes/overpowered_husbandry_automata_core.json b/src/generated/resources/data/advancedperipherals/recipe/overpowered_husbandry_automata_core.json similarity index 73% rename from src/generated/resources/data/advancedperipherals/recipes/overpowered_husbandry_automata_core.json rename to src/generated/resources/data/advancedperipherals/recipe/overpowered_husbandry_automata_core.json index 21d781502..7860851b9 100644 --- a/src/generated/resources/data/advancedperipherals/recipes/overpowered_husbandry_automata_core.json +++ b/src/generated/resources/data/advancedperipherals/recipe/overpowered_husbandry_automata_core.json @@ -10,6 +10,7 @@ } ], "result": { - "item": "advancedperipherals:overpowered_husbandry_automata_core" + "count": 1, + "id": "advancedperipherals:overpowered_husbandry_automata_core" } } \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/recipes/overpowered_weak_automata_core.json b/src/generated/resources/data/advancedperipherals/recipe/overpowered_weak_automata_core.json similarity index 74% rename from src/generated/resources/data/advancedperipherals/recipes/overpowered_weak_automata_core.json rename to src/generated/resources/data/advancedperipherals/recipe/overpowered_weak_automata_core.json index 07bccaddd..32639f766 100644 --- a/src/generated/resources/data/advancedperipherals/recipes/overpowered_weak_automata_core.json +++ b/src/generated/resources/data/advancedperipherals/recipe/overpowered_weak_automata_core.json @@ -10,6 +10,7 @@ } ], "result": { - "item": "advancedperipherals:overpowered_weak_automata_core" + "count": 1, + "id": "advancedperipherals:overpowered_weak_automata_core" } } \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/recipes/peripheral_casing.json b/src/generated/resources/data/advancedperipherals/recipe/peripheral_casing.json similarity index 64% rename from src/generated/resources/data/advancedperipherals/recipes/peripheral_casing.json rename to src/generated/resources/data/advancedperipherals/recipe/peripheral_casing.json index b2c43ded1..7b5ed4567 100644 --- a/src/generated/resources/data/advancedperipherals/recipes/peripheral_casing.json +++ b/src/generated/resources/data/advancedperipherals/recipe/peripheral_casing.json @@ -3,10 +3,10 @@ "category": "redstone", "key": { "I": { - "tag": "forge:ingots/iron" + "tag": "c:ingots/iron" }, "R": { - "tag": "forge:storage_blocks/redstone" + "tag": "c:storage_blocks/redstone" }, "i": { "item": "minecraft:iron_bars" @@ -18,6 +18,7 @@ "IiI" ], "result": { - "item": "advancedperipherals:peripheral_casing" + "count": 1, + "id": "advancedperipherals:peripheral_casing" } } \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/recipes/player_detector.json b/src/generated/resources/data/advancedperipherals/recipe/player_detector.json similarity index 74% rename from src/generated/resources/data/advancedperipherals/recipes/player_detector.json rename to src/generated/resources/data/advancedperipherals/recipe/player_detector.json index 6473313fc..3b29e8644 100644 --- a/src/generated/resources/data/advancedperipherals/recipes/player_detector.json +++ b/src/generated/resources/data/advancedperipherals/recipe/player_detector.json @@ -6,7 +6,7 @@ "item": "advancedperipherals:peripheral_casing" }, "R": { - "tag": "forge:storage_blocks/redstone" + "tag": "c:storage_blocks/redstone" }, "S": { "item": "minecraft:smooth_stone" @@ -18,6 +18,7 @@ "SRS" ], "result": { - "item": "advancedperipherals:player_detector" + "count": 1, + "id": "advancedperipherals:player_detector" } } \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/recipes/redstone_integrator.json b/src/generated/resources/data/advancedperipherals/recipe/redstone_integrator.json similarity index 73% rename from src/generated/resources/data/advancedperipherals/recipes/redstone_integrator.json rename to src/generated/resources/data/advancedperipherals/recipe/redstone_integrator.json index 2608082bd..bb1a98167 100644 --- a/src/generated/resources/data/advancedperipherals/recipes/redstone_integrator.json +++ b/src/generated/resources/data/advancedperipherals/recipe/redstone_integrator.json @@ -9,7 +9,7 @@ "item": "minecraft:comparator" }, "R": { - "tag": "forge:storage_blocks/redstone" + "tag": "c:storage_blocks/redstone" } }, "pattern": [ @@ -18,6 +18,7 @@ "RCR" ], "result": { - "item": "advancedperipherals:redstone_integrator" + "count": 1, + "id": "advancedperipherals:redstone_integrator" } } \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/recipes/weak_automata_core.json b/src/generated/resources/data/advancedperipherals/recipe/weak_automata_core.json similarity index 55% rename from src/generated/resources/data/advancedperipherals/recipes/weak_automata_core.json rename to src/generated/resources/data/advancedperipherals/recipe/weak_automata_core.json index 1b9646b21..ee9f59cb3 100644 --- a/src/generated/resources/data/advancedperipherals/recipes/weak_automata_core.json +++ b/src/generated/resources/data/advancedperipherals/recipe/weak_automata_core.json @@ -6,16 +6,13 @@ "item": "advancedperipherals:peripheral_casing" }, "D": { - "tag": "forge:gems/diamond" + "tag": "c:gems/diamond" }, "L": { - "type": "neoforge:nbt", - "item": "minecraft:potion", - "strict": true, - "tag": "{Potion:\"minecraft:long_regeneration\"}" + "item": "minecraft:potion" }, "R": { - "tag": "forge:storage_blocks/redstone" + "tag": "c:storage_blocks/redstone" }, "S": { "item": "minecraft:soul_lantern" @@ -27,6 +24,7 @@ "RLR" ], "result": { - "item": "advancedperipherals:weak_automata_core" + "count": 1, + "id": "advancedperipherals:weak_automata_core" } } \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/recipes/rs_bridge.json b/src/generated/resources/data/advancedperipherals/recipes/rs_bridge.json deleted file mode 100644 index 7a08c1400..000000000 --- a/src/generated/resources/data/advancedperipherals/recipes/rs_bridge.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "neoforge:conditions": [ - { - "type": "neoforge:mod_loaded", - "modid": "refinedstorage" - } - ], - "type": "minecraft:crafting_shaped", - "category": "redstone", - "key": { - "A": { - "item": "advancedperipherals:peripheral_casing" - }, - "I": { - "item": "refinedstorage:interface" - }, - "Q": { - "item": "refinedstorage:quartz_enriched_iron" - } - }, - "pattern": [ - "QIQ", - "IAI", - "QIQ" - ], - "result": { - "item": "advancedperipherals:rs_bridge" - } -} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json index c1f24be18..ed642e884 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json +++ b/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json @@ -4,7 +4,6 @@ "advancedperipherals:chat_box", "advancedperipherals:player_detector", "advancedperipherals:me_bridge", - "advancedperipherals:rs_bridge", "advancedperipherals:energy_detector", "advancedperipherals:peripheral_casing", "advancedperipherals:inventory_manager", diff --git a/src/generated/resources/data/minecraft/tags/blocks/needs_iron_tool.json b/src/generated/resources/data/minecraft/tags/blocks/needs_iron_tool.json index b3d6c2415..aeb3307c1 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/needs_iron_tool.json +++ b/src/generated/resources/data/minecraft/tags/blocks/needs_iron_tool.json @@ -4,7 +4,6 @@ "advancedperipherals:chat_box", "advancedperipherals:player_detector", "advancedperipherals:me_bridge", - "advancedperipherals:rs_bridge", "advancedperipherals:energy_detector", "advancedperipherals:inventory_manager", "advancedperipherals:redstone_integrator", diff --git a/src/generated/resources/data/forge/tags/blocks/needs_wood_tool.json b/src/generated/resources/data/neoforge/tags/blocks/needs_wood_tool.json similarity index 100% rename from src/generated/resources/data/forge/tags/blocks/needs_wood_tool.json rename to src/generated/resources/data/neoforge/tags/blocks/needs_wood_tool.json diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java b/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java index 87fec86f3..fa35c0228 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java @@ -18,6 +18,7 @@ import appeng.api.storage.cells.IBasicCellItem; import appeng.blockentity.storage.DriveBlockEntity; import appeng.parts.storagebus.StorageBusPart; +import dan200.computercraft.shared.util.NBTUtil; import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.addons.APAddons; import de.srendi.advancedperipherals.common.util.LuaConverter; @@ -28,6 +29,8 @@ import it.unimi.dsi.fastutil.objects.Object2LongMap; import me.ramidzkh.mekae2.ae2.MekanismKey; import net.minecraft.core.BlockPos; +import net.minecraft.core.RegistryAccess; +import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.ItemStack; import net.neoforged.neoforge.capabilities.Capabilities; import net.neoforged.neoforge.fluids.FluidStack; @@ -160,13 +163,13 @@ public static Map getObjectFromStack(Pair getObjectFromItemStack(Pair stack, @Nullable ICraftingService craftingService) { Map map = new HashMap<>(); String displayName = stack.getRight().getDisplayName().getString(); - //CompoundTag nbt = stack.getRight().toTag(); + CompoundTag nbt = stack.getRight().toTag(RegistryAccess.EMPTY); long amount = stack.getLeft(); map.put("fingerprint", ItemUtil.getFingerprint(stack.getRight().toStack())); map.put("name", ItemUtil.getRegistryKey(stack.getRight().getItem()).toString()); map.put("amount", amount); map.put("displayName", displayName); - //map.put("nbt", NBTUtil.toLua(nbt)); + map.put("nbt", NBTUtil.toLua(nbt)); map.put("tags", LuaConverter.tagsToList(() -> stack.getRight().getItem().builtInRegistryHolder().tags())); map.put("isCraftable", craftingService != null && craftingService.isCraftable(stack.getRight())); diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java index 26c7270c2..c3b10afc9 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java @@ -11,11 +11,13 @@ import net.minecraft.core.component.DataComponentMap; import net.minecraft.core.component.DataComponentPatch; import net.minecraft.core.component.PatchedDataComponentMap; +import net.minecraft.nbt.CompoundTag; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.sql.Timestamp; import java.time.LocalDateTime; +import java.time.temporal.ChronoUnit; import java.util.HashMap; import java.util.Map; import java.util.function.BiConsumer; @@ -27,15 +29,22 @@ public class OperationAbility implements IOwnerAbility, IPeripheralPlugin { private final Map> allowedOperations = new HashMap<>(); private final IPeripheralOwner owner; + private static final String COOLDOWNS_TAG = "cooldowns"; + public OperationAbility(IPeripheralOwner owner) { this.owner = owner; } protected void setCooldown(@NotNull IPeripheralOperation operation, int cooldown) { if (cooldown > 0) { + if (owner instanceof BlockEntityPeripheralOwner) { + CompoundTag dataStorage = owner.getNbtStorage(); + if (!dataStorage.contains(COOLDOWNS_TAG)) dataStorage.put(COOLDOWNS_TAG, new CompoundTag()); + dataStorage.getCompound(COOLDOWNS_TAG).putLong(operation.settingsName(), Timestamp.valueOf(LocalDateTime.now().plus(cooldown, ChronoUnit.MILLIS)).getTime()); + } + PatchedDataComponentMap patch = PatchedDataComponentMap.fromPatch(DataComponentMap.EMPTY, owner.getDataStorage()); - if (!patch.has(ABILITY_COOLDOWN.get())) - patch.set(ABILITY_COOLDOWN.get(), DataComponentPatch.EMPTY); + if (!patch.has(ABILITY_COOLDOWN.get())) patch.set(ABILITY_COOLDOWN.get(), DataComponentPatch.EMPTY); PatchedDataComponentMap operationPatch = PatchedDataComponentMap.fromPatch(DataComponentMap.EMPTY, patch.get(ABILITY_COOLDOWN.get())); operationPatch.set(operation.dataComponentType(), (long) cooldown); @@ -46,13 +55,21 @@ protected void setCooldown(@NotNull IPeripheralOperation operation, int coold } protected int getCooldown(@NotNull IPeripheralOperation operation) { + if (owner instanceof BlockEntityPeripheralOwner) { + CompoundTag dataStorage = owner.getNbtStorage(); + if (!dataStorage.contains(COOLDOWNS_TAG)) return 0; + CompoundTag cooldowns = dataStorage.getCompound(COOLDOWNS_TAG); + String operationName = operation.settingsName(); + if (!cooldowns.contains(operationName)) return 0; + long currentTime = Timestamp.valueOf(LocalDateTime.now()).getTime(); + return (int) Math.max(0, cooldowns.getLong(operationName) - currentTime); + } + DataComponentPatch componentPatch = owner.getDataStorage(); - if (componentPatch.get(ABILITY_COOLDOWN.get()).isEmpty()) - return 0; + if (componentPatch.get(ABILITY_COOLDOWN.get()).isEmpty()) return 0; DataComponentPatch cooldowns = componentPatch.get(ABILITY_COOLDOWN.get()).get(); - if (cooldowns.get(operation.dataComponentType()).isEmpty()) - return 0; + if (cooldowns.get(operation.dataComponentType()).isEmpty()) return 0; long currentTime = Timestamp.valueOf(LocalDateTime.now()).getTime(); return (int) Math.max(0, cooldowns.get(operation.dataComponentType()).get() - currentTime); } @@ -96,8 +113,7 @@ public void registerOperation(@NotNull IPeripheralOperation operation) { cooldown = fuelAbility.reduceCooldownAccordingToConsumptionRate(cooldown); } MethodResult result = method.apply(context); - if (successCallback != null) - successCallback.accept(context); + if (successCallback != null) successCallback.accept(context); setCooldown(operation, cooldown); return result; } @@ -125,8 +141,6 @@ public final MethodResult getOperationCooldown(String name) { } public enum FailReason { - COOLDOWN, - NOT_ENOUGH_FUEL, - CHECK_FAILED + COOLDOWN, NOT_ENOUGH_FUEL, CHECK_FAILED } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/PocketPeripheralOwner.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/PocketPeripheralOwner.java index 9d0aead1f..2b97730a6 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/PocketPeripheralOwner.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/PocketPeripheralOwner.java @@ -95,8 +95,6 @@ public void putDataStorage(DataComponentPatch dataStorage) { @Override public void markDataStorageDirty() { - //TODO do we still need this? - //pocket.updateUpgradeNBTData(); } @Override diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java index c5f516108..87ce17856 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java @@ -32,7 +32,8 @@ public static void generate(DataGenerator.PackGenerator output, CompletableFutur upgrades.register(id(CCRegistration.ID.GEOSCANNER_TURTLE), new TurtleGeoScannerUpgrade(new ItemStack(Blocks.GEO_SCANNER.get()))); }); })); - output.addProvider(o -> new DatapackBuiltinEntriesProvider(o, newRegistries, Set.of(AdvancedPeripherals.MOD_ID))); + //TODO - crashes data gen + //output.addProvider(o -> new DatapackBuiltinEntriesProvider(o, newRegistries, Set.of(AdvancedPeripherals.MOD_ID))); } public static ResourceKey id(ResourceLocation id) { diff --git a/src/main/java/de/srendi/advancedperipherals/common/items/MemoryCardItem.java b/src/main/java/de/srendi/advancedperipherals/common/items/MemoryCardItem.java index 1f1cb75cd..06cd7fa72 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/items/MemoryCardItem.java +++ b/src/main/java/de/srendi/advancedperipherals/common/items/MemoryCardItem.java @@ -44,7 +44,7 @@ public void appendHoverText(@NotNull ItemStack stack, @NotNull TooltipContext co } @Override - public InteractionResultHolder use(Level worldIn, Player playerIn, InteractionHand handIn) { + public @NotNull InteractionResultHolder use(Level worldIn, @NotNull Player playerIn, @NotNull InteractionHand handIn) { if (!worldIn.isClientSide) { ItemStack stack = playerIn.getItemInHand(handIn); if (stack.has(OWNER)) { diff --git a/src/main/java/de/srendi/advancedperipherals/common/items/WeakAutomataCore.java b/src/main/java/de/srendi/advancedperipherals/common/items/WeakAutomataCore.java index c2631efc5..77e8294e3 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/items/WeakAutomataCore.java +++ b/src/main/java/de/srendi/advancedperipherals/common/items/WeakAutomataCore.java @@ -2,12 +2,14 @@ import de.srendi.advancedperipherals.common.configuration.APConfig; import de.srendi.advancedperipherals.common.setup.Items; +import de.srendi.advancedperipherals.common.util.EnumColor; import de.srendi.advancedperipherals.lib.metaphysics.IFeedableAutomataCore; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; +import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; @@ -20,12 +22,14 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Optional; + +import static de.srendi.advancedperipherals.common.setup.DataComponents.CONSUMED_ENTITY_COMPOUND; public class WeakAutomataCore extends APItem implements IFeedableAutomataCore { private static final String CONSUMED_ENTITY_COUNT = "consumed_entity_count"; private static final String CONSUMED_ENTITY_NAME = "consumed_entity_name"; - private static final String CONSUMER_ENTITY_COMPOUND = "consumed_entity_compound"; private static final Map AUTOMATA_CORE_REGISTRY = new HashMap<>(); static { @@ -55,14 +59,13 @@ public WeakAutomataCore() { public void appendHoverText(@NotNull ItemStack stack, @NotNull TooltipContext context, @NotNull List tooltip, @NotNull TooltipFlag flagIn) { super.appendHoverText(stack, context, tooltip, flagIn); - //TODO - /*CompoundTag tag = stack.getOrCreateTag(); - CompoundTag consumedData = tag.getCompound(CONSUMER_ENTITY_COMPOUND); + + CompoundTag consumedData = stack.get(CONSUMED_ENTITY_COMPOUND.get()); consumedData.getAllKeys().forEach(key -> { WeakAutomataCoreRecord record = AUTOMATA_CORE_REGISTRY.get(key); CompoundTag recordData = consumedData.getCompound(key); tooltip.add(EnumColor.buildTextComponent(Component.literal(String.format("Consumed: %d/%d %s", recordData.getInt(CONSUMED_ENTITY_COUNT), record.getRequiredCount(key), recordData.getString(CONSUMED_ENTITY_NAME))))); - });*/ + }); } @Override @@ -73,11 +76,10 @@ public InteractionResult interactLivingEntity(@NotNull ItemStack stack, @NotNull return InteractionResult.FAIL; } String entityType = EntityType.getKey(entity.getType()).toString(); - //TODO - /*if (AUTOMATA_CORE_REGISTRY.containsKey(entityType)) { - CompoundTag tag = stack.getOrCreateTag(); - CompoundTag consumedData = tag.getCompound(CONSUMER_ENTITY_COMPOUND); + if (AUTOMATA_CORE_REGISTRY.containsKey(entityType)) { + + CompoundTag consumedData = stack.get(CONSUMED_ENTITY_COMPOUND); WeakAutomataCoreRecord record; if (consumedData.isEmpty()) { record = AUTOMATA_CORE_REGISTRY.get(entityType); @@ -95,9 +97,9 @@ record = AUTOMATA_CORE_REGISTRY.get(anyKey.get()); if (record.isFinished(consumedData)) { player.setItemInHand(hand, new ItemStack(record.resultSoul)); } - tag.put(CONSUMER_ENTITY_COMPOUND, consumedData); + stack.set(CONSUMED_ENTITY_COMPOUND.get(), consumedData); return InteractionResult.SUCCESS; - }*/ + } return InteractionResult.PASS; } diff --git a/src/main/java/de/srendi/advancedperipherals/common/items/base/BaseItem.java b/src/main/java/de/srendi/advancedperipherals/common/items/base/BaseItem.java index df3d8016b..2ee66dcff 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/items/base/BaseItem.java +++ b/src/main/java/de/srendi/advancedperipherals/common/items/base/BaseItem.java @@ -29,16 +29,17 @@ public BaseItem() { super(new Properties()); } + @NotNull @Override - public InteractionResultHolder use(Level worldIn, Player playerIn, InteractionHand handIn) { + public InteractionResultHolder use(Level worldIn, @NotNull Player playerIn, @NotNull InteractionHand handIn) { if (worldIn.isClientSide) return new InteractionResultHolder<>(InteractionResult.PASS, playerIn.getItemInHand(handIn)); if (this instanceof IInventoryItem inventoryItem) { ServerPlayer serverPlayerEntity = (ServerPlayer) playerIn; ItemStack stack = playerIn.getItemInHand(handIn); - - //TODO - //serverPlayerEntity.openMenu(inventoryItem.createContainer(playerIn, stack), buf -> buf.write(stack)); + serverPlayerEntity.openMenu(inventoryItem.createContainer(playerIn, stack), buf -> { + ItemStack.STREAM_CODEC.encode(buf, stack); + }); } return super.use(worldIn, playerIn, handIn); } @@ -55,8 +56,8 @@ public void appendHoverText(@NotNull ItemStack stack, @NotNull TooltipContext co tooltip.add(EnumColor.buildTextComponent(Component.translatable("item.advancedperipherals.tooltip.disabled"))); } - - public @NotNull Component getDescription() { + @NotNull + public Component getDescription() { if (description == null) description = TranslationUtil.itemTooltip(getDescriptionId()); return description; } diff --git a/src/main/java/de/srendi/advancedperipherals/common/setup/DataComponents.java b/src/main/java/de/srendi/advancedperipherals/common/setup/DataComponents.java index b316f9bfc..d30d90a66 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/setup/DataComponents.java +++ b/src/main/java/de/srendi/advancedperipherals/common/setup/DataComponents.java @@ -18,7 +18,6 @@ public class DataComponents { - public static final DeferredHolder, DataComponentType> ENERGY_RATE_LIMIT = registerInt("energy_rate_limit"); public static final DeferredHolder, DataComponentType> TURTLE_UPGRADE_STORED_DATA = registerDataComponent("stored_data"); public static final DeferredHolder, DataComponentType> ABILITY_COOLDOWN = registerDataComponent("cooldowns"); public static final DeferredHolder, DataComponentType> OWNER = registerUUID("owner_id"); @@ -28,6 +27,7 @@ public class DataComponents { public static final DeferredHolder, DataComponentType> ENTITY_TRANSFER = registerNBT("entity_transfer"); public static final DeferredHolder, DataComponentType> WORLD_DATA_MARK = registerString("world_data_mark"); public static final DeferredHolder, DataComponentType> POINT_DATA_MARK = registerNBT("point_dat_mark"); + public static final DeferredHolder, DataComponentType> CONSUMED_ENTITY_COMPOUND = registerNBT("consumed_entity_compound"); public static final DeferredHolder, DataComponentType> SIMPLE_FREE_OPERATION = registerLong("free_operation_cooldown"); public static final DeferredHolder, DataComponentType> SINGLE_OPERATION = registerLong("single_operation"); @@ -36,7 +36,6 @@ public class DataComponents { public static void register() { } - // private static DeferredHolder, DataComponentType> simple(String name, UnaryOperator> operator) { return Registration.DATA_COMPONENT_TYPES.register(name, () -> operator.apply(DataComponentType.builder()).build()); } From 2735edb4a79f1776f84d820055e319aa0d085047 Mon Sep 17 00:00:00 2001 From: Srendi Date: Mon, 13 Jan 2025 02:30:46 +0100 Subject: [PATCH 23/57] Checkstyle --- .../common/addons/computercraft/owner/OperationAbility.java | 5 ++++- .../common/data/PocketUpgradesProvider.java | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java index c3b10afc9..7a42d2543 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java @@ -112,8 +112,11 @@ public void registerOperation(@NotNull IPeripheralOperation operation) { } cooldown = fuelAbility.reduceCooldownAccordingToConsumptionRate(cooldown); } + MethodResult result = method.apply(context); - if (successCallback != null) successCallback.accept(context); + if (successCallback != null) + successCallback.accept(context); + setCooldown(operation, cooldown); return result; } diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java index 87ce17856..5fd8d31c7 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java @@ -1,7 +1,6 @@ package de.srendi.advancedperipherals.common.data; import dan200.computercraft.api.turtle.ITurtleUpgrade; -import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtleChatBoxUpgrade; import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtleEnvironmentDetectorUpgrade; import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtleGeoScannerUpgrade; @@ -16,9 +15,7 @@ import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; -import net.neoforged.neoforge.common.data.DatapackBuiltinEntriesProvider; -import java.util.Set; import java.util.concurrent.CompletableFuture; public class PocketUpgradesProvider { From 1910443bc86563d25a2f7868e02bf3d480e0413c Mon Sep 17 00:00:00 2001 From: Srendi Date: Mon, 13 Jan 2025 02:33:32 +0100 Subject: [PATCH 24/57] Fix crash with weak automata tooltip --- .../common/items/WeakAutomataCore.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/items/WeakAutomataCore.java b/src/main/java/de/srendi/advancedperipherals/common/items/WeakAutomataCore.java index 77e8294e3..a80eabc02 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/items/WeakAutomataCore.java +++ b/src/main/java/de/srendi/advancedperipherals/common/items/WeakAutomataCore.java @@ -59,13 +59,13 @@ public WeakAutomataCore() { public void appendHoverText(@NotNull ItemStack stack, @NotNull TooltipContext context, @NotNull List tooltip, @NotNull TooltipFlag flagIn) { super.appendHoverText(stack, context, tooltip, flagIn); - CompoundTag consumedData = stack.get(CONSUMED_ENTITY_COMPOUND.get()); - consumedData.getAllKeys().forEach(key -> { - WeakAutomataCoreRecord record = AUTOMATA_CORE_REGISTRY.get(key); - CompoundTag recordData = consumedData.getCompound(key); - tooltip.add(EnumColor.buildTextComponent(Component.literal(String.format("Consumed: %d/%d %s", recordData.getInt(CONSUMED_ENTITY_COUNT), record.getRequiredCount(key), recordData.getString(CONSUMED_ENTITY_NAME))))); - }); + if (consumedData != null) + consumedData.getAllKeys().forEach(key -> { + WeakAutomataCoreRecord record = AUTOMATA_CORE_REGISTRY.get(key); + CompoundTag recordData = consumedData.getCompound(key); + tooltip.add(EnumColor.buildTextComponent(Component.literal(String.format("Consumed: %d/%d %s", recordData.getInt(CONSUMED_ENTITY_COUNT), record.getRequiredCount(key), recordData.getString(CONSUMED_ENTITY_NAME))))); + }); } @Override From e1ec1043a86d05c802b6bb62aa8ece518adcc328 Mon Sep 17 00:00:00 2001 From: Srendi Date: Mon, 13 Jan 2025 03:03:02 +0100 Subject: [PATCH 25/57] Fixed weak automata core, fixed data(hopefully) --- .../2db41954e490230d51b10affff25ee2ee27b8d5b | 2 +- .../2f719b8031aed5e605ed8d6694b19245ca45c6ca | 2 +- .../59eb3dbb5f86130e09b3c62d89b9525ee01cf52d | 2 +- .../9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e | 2 +- .../b8526e444ae7356037f3a813274f6835d1f3dd16 | 2 +- .../f95c7003282837dabaa33e3ffceec4e6865b5218 | 2 +- .../ff85aeffff7b400453d938ac4326ddfe68257a73 | 2 +- .../common/items/WeakAutomataCore.java | 5 ++-- .../common/util/DataStorageUtil.java | 29 +++++++++++-------- 9 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/generated/resources/.cache/2db41954e490230d51b10affff25ee2ee27b8d5b b/src/generated/resources/.cache/2db41954e490230d51b10affff25ee2ee27b8d5b index be7565fd2..8cc476514 100644 --- a/src/generated/resources/.cache/2db41954e490230d51b10affff25ee2ee27b8d5b +++ b/src/generated/resources/.cache/2db41954e490230d51b10affff25ee2ee27b8d5b @@ -1,2 +1,2 @@ -// 1.21.1 2025-01-13T02:27:00.5603826 AP POI Type Tags +// 1.21.1 2025-01-13T02:34:51.2705544 AP POI Type Tags d3d6b837660a4e213f287ad9d11e12368b90cd8e data/minecraft/tags/point_of_interest_type/acquirable_job_site.json diff --git a/src/generated/resources/.cache/2f719b8031aed5e605ed8d6694b19245ca45c6ca b/src/generated/resources/.cache/2f719b8031aed5e605ed8d6694b19245ca45c6ca index 0c882f3c2..a47b894f5 100644 --- a/src/generated/resources/.cache/2f719b8031aed5e605ed8d6694b19245ca45c6ca +++ b/src/generated/resources/.cache/2f719b8031aed5e605ed8d6694b19245ca45c6ca @@ -1,2 +1,2 @@ -// 1.21.1 2025-01-13T02:27:00.5622454 Languages: en_us for mod: advancedperipherals +// 1.21.1 2025-01-13T02:34:51.27456 Languages: en_us for mod: advancedperipherals b733229a45f64a6500a00da10265bc71b8320229 assets/advancedperipherals/lang/en_us.json diff --git a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d index b9bc5a85f..15ed6c366 100644 --- a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d +++ b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d @@ -1,4 +1,4 @@ -// 1.21.1 2025-01-13T02:27:00.5603826 Loot Tables +// 1.21.1 2025-01-13T02:34:51.2715601 Loot Tables 9b54955770745d55de988a86cbd08aa9ae23ff86 data/advancedperipherals/loot_table/blocks/block_reader.json d4f1bc579f83dc67ce9f94d35926d34b8894c990 data/advancedperipherals/loot_table/blocks/chat_box.json 6da40a0a9d46855710272fe9d40bb5a7f0219ff2 data/advancedperipherals/loot_table/blocks/energy_detector.json diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index e5f704979..9444a0860 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,4 +1,4 @@ -// 1.21.1 2025-01-13T02:27:00.560897 Recipes +// 1.21.1 2025-01-13T02:34:51.2725595 Recipes f5ba1f7d129c88dca1a13c8deaae2d269644c7fa data/advancedperipherals/advancement/recipes/redstone/block_reader.json e172645262ade9fc4a1c999a2c0041711c2eab55 data/advancedperipherals/advancement/recipes/redstone/chat_box.json 213de9a7e340c5eb9c01d82a72e7b58921c5290a data/advancedperipherals/advancement/recipes/redstone/chunk_controller.json diff --git a/src/generated/resources/.cache/b8526e444ae7356037f3a813274f6835d1f3dd16 b/src/generated/resources/.cache/b8526e444ae7356037f3a813274f6835d1f3dd16 index 69e8dc93f..366350c98 100644 --- a/src/generated/resources/.cache/b8526e444ae7356037f3a813274f6835d1f3dd16 +++ b/src/generated/resources/.cache/b8526e444ae7356037f3a813274f6835d1f3dd16 @@ -1,4 +1,4 @@ -// 1.21.1 2025-01-13T02:27:00.560897 Block States: advancedperipherals +// 1.21.1 2025-01-13T02:34:51.27456 Block States: advancedperipherals 5e28ce1be9a6996d982641e5df1fa7162090b8cc assets/advancedperipherals/blockstates/block_reader.json f42bdde60f84fdb312f7cf3b2be461d9c11ebdc8 assets/advancedperipherals/blockstates/chat_box.json 67420f28031606ca03db9a044141bb22b0fa78b7 assets/advancedperipherals/blockstates/energy_detector.json diff --git a/src/generated/resources/.cache/f95c7003282837dabaa33e3ffceec4e6865b5218 b/src/generated/resources/.cache/f95c7003282837dabaa33e3ffceec4e6865b5218 index 6d57802c8..01c30ea32 100644 --- a/src/generated/resources/.cache/f95c7003282837dabaa33e3ffceec4e6865b5218 +++ b/src/generated/resources/.cache/f95c7003282837dabaa33e3ffceec4e6865b5218 @@ -1,4 +1,4 @@ -// 1.21.1 2025-01-13T02:27:00.559332 Block tags +// 1.21.1 2025-01-13T02:34:51.2705544 Block tags 5b2e51f09296cc50686a478ed03bd9debc9a395b data/minecraft/tags/blocks/mineable/pickaxe.json e9a65cdbf463c5378a799f69539feeae82a3e85e data/minecraft/tags/blocks/needs_iron_tool.json e1f71dcb4f9e7e36e29b0ad09d6520dc3adfa4a6 data/neoforge/tags/blocks/needs_wood_tool.json diff --git a/src/generated/resources/.cache/ff85aeffff7b400453d938ac4326ddfe68257a73 b/src/generated/resources/.cache/ff85aeffff7b400453d938ac4326ddfe68257a73 index d9a4d3c19..db6ec086f 100644 --- a/src/generated/resources/.cache/ff85aeffff7b400453d938ac4326ddfe68257a73 +++ b/src/generated/resources/.cache/ff85aeffff7b400453d938ac4326ddfe68257a73 @@ -1,4 +1,4 @@ -// 1.21.1 2025-01-13T02:27:00.5583322 vanilla/Registries +// 1.21.1 2025-01-13T02:34:51.2685128 vanilla/Registries b8f19ae0fb5bb898facc08e3787e0f96c8211881 data/advancedperipherals/computercraft/turtle_upgrade/chatty_turtle.json fe98c60e7d61139aacf2d0872873e610aac8a37b data/advancedperipherals/computercraft/turtle_upgrade/chunky_turtle.json ae619da638ad89d7302d832d6c09e2c87401c539 data/advancedperipherals/computercraft/turtle_upgrade/compass_turtle.json diff --git a/src/main/java/de/srendi/advancedperipherals/common/items/WeakAutomataCore.java b/src/main/java/de/srendi/advancedperipherals/common/items/WeakAutomataCore.java index a80eabc02..78bf97b1d 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/items/WeakAutomataCore.java +++ b/src/main/java/de/srendi/advancedperipherals/common/items/WeakAutomataCore.java @@ -78,8 +78,9 @@ public InteractionResult interactLivingEntity(@NotNull ItemStack stack, @NotNull String entityType = EntityType.getKey(entity.getType()).toString(); if (AUTOMATA_CORE_REGISTRY.containsKey(entityType)) { - - CompoundTag consumedData = stack.get(CONSUMED_ENTITY_COMPOUND); + CompoundTag consumedData = stack.get(CONSUMED_ENTITY_COMPOUND) == null ? new CompoundTag() : stack.get(CONSUMED_ENTITY_COMPOUND); + if (consumedData == null) + return InteractionResult.PASS; WeakAutomataCoreRecord record; if (consumedData.isEmpty()) { record = AUTOMATA_CORE_REGISTRY.get(entityType); diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/DataStorageUtil.java b/src/main/java/de/srendi/advancedperipherals/common/util/DataStorageUtil.java index 4b625aabc..5d9a67cb0 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/DataStorageUtil.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/DataStorageUtil.java @@ -5,10 +5,14 @@ import dan200.computercraft.api.turtle.TurtleSide; import de.srendi.advancedperipherals.common.addons.computercraft.owner.IPeripheralOwner; import de.srendi.advancedperipherals.lib.peripherals.IPeripheralTileEntity; +import net.minecraft.core.component.DataComponentMap; import net.minecraft.core.component.DataComponentPatch; +import net.minecraft.core.component.PatchedDataComponentMap; import net.minecraft.nbt.CompoundTag; import org.jetbrains.annotations.NotNull; +import java.util.Optional; + import static de.srendi.advancedperipherals.common.setup.DataComponents.ROTATION_CHARGE_SETTING; public class DataStorageUtil { @@ -45,27 +49,28 @@ public static class RotationCharge { * Used for gear rotation animation */ public static int get(@NotNull ITurtleAccess access, @NotNull TurtleSide side) { - return getDataStorage(access, side).get(ROTATION_CHARGE_SETTING.get()).get(); + Optional rotation_charge = getDataStorage(access, side).get(ROTATION_CHARGE_SETTING.get()); + return rotation_charge != null && rotation_charge.isPresent() ? rotation_charge.get() : 0; } public static boolean consume(@NotNull ITurtleAccess access, @NotNull TurtleSide side) { - //TODO - /*DataComponentPatch data = getDataStorage(access, side); - int currentCharge = data.get(ROTATION_CHARGE_SETTING.get()).get(); + PatchedDataComponentMap patch = PatchedDataComponentMap.fromPatch(DataComponentMap.EMPTY, getDataStorage(access, side)); + int currentCharge = get(access, side); if (currentCharge > 0) { - data.(ROTATION_CHARGE_SETTING, Math.max(0, data.getInt(ROTATION_CHARGE_SETTING) - 1)); - access.updateUpgradeNBTData(side); + patch.set(ROTATION_CHARGE_SETTING.get(), Math.max(0, get(access, side) - 1)); + putDataStorage(access, side, patch.asPatch()); return true; - }*/ + } return false; } public static void addCycles(IPeripheralOwner owner, int count) { - //TODO - /*CompoundTag data = owner.getDataStorage(); - data.putInt(ROTATION_CHARGE_SETTING, Math.max(0, data.getInt(ROTATION_CHARGE_SETTING)) + count * ROTATION_STEPS); - owner.markDataStorageDirty(); - */ + PatchedDataComponentMap patch = PatchedDataComponentMap.fromPatch(DataComponentMap.EMPTY, owner.getDataStorage()); + Integer currentCharge = patch.get(ROTATION_CHARGE_SETTING.get()); + if (currentCharge == null) + return; + patch.set(ROTATION_CHARGE_SETTING.get(), Math.max(0, currentCharge) + count * ROTATION_STEPS); + owner.putDataStorage(patch.asPatch()); } } From f6dd6447e03cd5e954711e22559e4116872e52a8 Mon Sep 17 00:00:00 2001 From: Srendi Date: Mon, 13 Jan 2025 03:09:43 +0100 Subject: [PATCH 26/57] Automata Turtle Upgrade spinny again --- .../common/util/DataStorageUtil.java | 6 ++--- .../ClockwiseAnimatedTurtleUpgrade.java | 24 ------------------- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/DataStorageUtil.java b/src/main/java/de/srendi/advancedperipherals/common/util/DataStorageUtil.java index 5d9a67cb0..a870f0f4b 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/DataStorageUtil.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/DataStorageUtil.java @@ -49,8 +49,8 @@ public static class RotationCharge { * Used for gear rotation animation */ public static int get(@NotNull ITurtleAccess access, @NotNull TurtleSide side) { - Optional rotation_charge = getDataStorage(access, side).get(ROTATION_CHARGE_SETTING.get()); - return rotation_charge != null && rotation_charge.isPresent() ? rotation_charge.get() : 0; + Optional rotationCharge = getDataStorage(access, side).get(ROTATION_CHARGE_SETTING.get()); + return rotationCharge != null && rotationCharge.isPresent() ? rotationCharge.get() : 0; } public static boolean consume(@NotNull ITurtleAccess access, @NotNull TurtleSide side) { @@ -68,7 +68,7 @@ public static void addCycles(IPeripheralOwner owner, int count) { PatchedDataComponentMap patch = PatchedDataComponentMap.fromPatch(DataComponentMap.EMPTY, owner.getDataStorage()); Integer currentCharge = patch.get(ROTATION_CHARGE_SETTING.get()); if (currentCharge == null) - return; + currentCharge = 0; patch.set(ROTATION_CHARGE_SETTING.get(), Math.max(0, currentCharge) + count * ROTATION_STEPS); owner.putDataStorage(patch.asPatch()); } diff --git a/src/main/java/de/srendi/advancedperipherals/lib/turtle/ClockwiseAnimatedTurtleUpgrade.java b/src/main/java/de/srendi/advancedperipherals/lib/turtle/ClockwiseAnimatedTurtleUpgrade.java index b0ee707c1..58602e465 100644 --- a/src/main/java/de/srendi/advancedperipherals/lib/turtle/ClockwiseAnimatedTurtleUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/lib/turtle/ClockwiseAnimatedTurtleUpgrade.java @@ -13,35 +13,11 @@ public abstract class ClockwiseAnimatedTurtleUpgrade> extends PeripheralTurtleUpgrade { - public static final String STORED_DATA_TAG = "storedData"; protected ClockwiseAnimatedTurtleUpgrade(ResourceLocation id, ItemStack item) { super(id, item); } - /*@NotNull - @Override - public TransformedModel getModel(@Nullable ITurtleAccess turtle, @NotNull TurtleSide side) { - if (getLeftModel() == null) { - PoseStack stack = new PoseStack(); - stack.pushPose(); - stack.translate(0.0f, 0.5f, 0.5f); - if (turtle != null) { - int rotationStep = DataStorageUtil.RotationCharge.get(turtle, side); - stack.mulPose(Vector3f.XN.rotationDegrees(-10 * rotationStep)); - } - stack.translate(0.0f, -0.5f, -0.5f); - stack.mulPose(Vector3f.YN.rotationDegrees(90)); - if (side == TurtleSide.LEFT) { - stack.translate(0, 0, -0.6); - } else { - stack.translate(0, 0, -1.4); - } - return TransformedModel.of(getCraftingItem(), new Transformation(stack.last().pose())); - } - return TransformedModel.of(side == TurtleSide.LEFT ? getLeftModel() : getRightModel()); - }*/ - // Optional callbacks for addons based on AP public void chargeConsumingCallback() { From 46bf210f6540241c67aa5c24fb4dd69ac880b80b Mon Sep 17 00:00:00 2001 From: Srendi Date: Mon, 13 Jan 2025 03:35:25 +0100 Subject: [PATCH 27/57] Fixed turtle models --- .../srendi/advancedperipherals/client/ClientRegistry.java | 8 ++++---- .../models/block/turtle_chatty_left.json | 4 ++++ .../models/block/turtle_chatty_right.json | 4 ++++ .../models/block/turtle_environment_left.json | 4 ++++ .../models/block/turtle_environment_right.json | 4 ++++ .../models/block/turtle_geoscanner_left.json | 4 ++++ .../models/block/turtle_geoscanner_right.json | 4 ++++ .../models/block/turtle_player_left.json | 4 ++++ .../models/block/turtle_player_right.json | 4 ++++ 9 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 src/main/resources/assets/advancedperipherals/models/block/turtle_chatty_left.json create mode 100644 src/main/resources/assets/advancedperipherals/models/block/turtle_chatty_right.json create mode 100644 src/main/resources/assets/advancedperipherals/models/block/turtle_environment_left.json create mode 100644 src/main/resources/assets/advancedperipherals/models/block/turtle_environment_right.json create mode 100644 src/main/resources/assets/advancedperipherals/models/block/turtle_geoscanner_left.json create mode 100644 src/main/resources/assets/advancedperipherals/models/block/turtle_geoscanner_right.json create mode 100644 src/main/resources/assets/advancedperipherals/models/block/turtle_player_left.json create mode 100644 src/main/resources/assets/advancedperipherals/models/block/turtle_player_right.json diff --git a/src/main/java/de/srendi/advancedperipherals/client/ClientRegistry.java b/src/main/java/de/srendi/advancedperipherals/client/ClientRegistry.java index cb3c290b7..b98eded48 100644 --- a/src/main/java/de/srendi/advancedperipherals/client/ClientRegistry.java +++ b/src/main/java/de/srendi/advancedperipherals/client/ClientRegistry.java @@ -35,10 +35,10 @@ public static void menuRegister(RegisterMenuScreensEvent event) { public static void onUpgradeModeller(RegisterTurtleModellersEvent event) { event.register(CCRegistration.CHUNKY_TURTLE.get(), TurtleUpgradeModeller.flatItem()); event.register(CCRegistration.COMPASS_TURTLE.get(), TurtleUpgradeModeller.flatItem()); - event.register(CCRegistration.CHAT_BOX_TURTLE.get(), TurtleUpgradeModeller.sided(AdvancedPeripherals.getRL("turtle_chat_box_upgrade_left"), AdvancedPeripherals.getRL("turtle_chat_box_upgrade_right"))); - event.register(CCRegistration.ENVIRONMENT_TURTLE.get(), TurtleUpgradeModeller.sided(AdvancedPeripherals.getRL("turtle_environment_upgrade_left"), AdvancedPeripherals.getRL("turtle_environment_upgrade_right"))); - event.register(CCRegistration.GEO_SCANNER_TURTLE.get(), TurtleUpgradeModeller.sided(AdvancedPeripherals.getRL("turtle_geoscanner_upgrade_left"), AdvancedPeripherals.getRL("turtle_geoscanner_upgrade_right"))); - event.register(CCRegistration.PLAYER_DETECTOR_TURTLE.get(), TurtleUpgradeModeller.sided(AdvancedPeripherals.getRL("turtle_player_upgrade_left"), AdvancedPeripherals.getRL("turtle_player_upgrade_right"))); + event.register(CCRegistration.CHAT_BOX_TURTLE.get(), TurtleUpgradeModeller.sided(AdvancedPeripherals.getRL("block/turtle_chatty_left"), AdvancedPeripherals.getRL("block/turtle_chatty_right"))); + event.register(CCRegistration.ENVIRONMENT_TURTLE.get(), TurtleUpgradeModeller.sided(AdvancedPeripherals.getRL("block/turtle_environment_left"), AdvancedPeripherals.getRL("block/turtle_environment_right"))); + event.register(CCRegistration.GEO_SCANNER_TURTLE.get(), TurtleUpgradeModeller.sided(AdvancedPeripherals.getRL("block/turtle_geoscanner_left"), AdvancedPeripherals.getRL("block/turtle_geoscanner_right"))); + event.register(CCRegistration.PLAYER_DETECTOR_TURTLE.get(), TurtleUpgradeModeller.sided(AdvancedPeripherals.getRL("block/turtle_player_left"), AdvancedPeripherals.getRL("block/turtle_player_right"))); event.register(CCRegistration.OP_END_TURTLE.get(), new MetaTurtleUpgradeModeller<>()); event.register(CCRegistration.OP_HUSBANDRY_TURTLE.get(), new MetaTurtleUpgradeModeller<>()); event.register(CCRegistration.OP_WEAK_TURTLE.get(), new MetaTurtleUpgradeModeller<>()); diff --git a/src/main/resources/assets/advancedperipherals/models/block/turtle_chatty_left.json b/src/main/resources/assets/advancedperipherals/models/block/turtle_chatty_left.json new file mode 100644 index 000000000..5e44820a3 --- /dev/null +++ b/src/main/resources/assets/advancedperipherals/models/block/turtle_chatty_left.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/turtle_upgrade_base_left", + "textures": {"texture": "advancedperipherals:block/chat_box"} +} \ No newline at end of file diff --git a/src/main/resources/assets/advancedperipherals/models/block/turtle_chatty_right.json b/src/main/resources/assets/advancedperipherals/models/block/turtle_chatty_right.json new file mode 100644 index 000000000..4ca41794e --- /dev/null +++ b/src/main/resources/assets/advancedperipherals/models/block/turtle_chatty_right.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/turtle_upgrade_base_right", + "textures": {"texture": "advancedperipherals:block/chat_box"} +} \ No newline at end of file diff --git a/src/main/resources/assets/advancedperipherals/models/block/turtle_environment_left.json b/src/main/resources/assets/advancedperipherals/models/block/turtle_environment_left.json new file mode 100644 index 000000000..8a4fc9acd --- /dev/null +++ b/src/main/resources/assets/advancedperipherals/models/block/turtle_environment_left.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/turtle_upgrade_base_left", + "textures": {"texture": "advancedperipherals:block/environment_detector"} +} \ No newline at end of file diff --git a/src/main/resources/assets/advancedperipherals/models/block/turtle_environment_right.json b/src/main/resources/assets/advancedperipherals/models/block/turtle_environment_right.json new file mode 100644 index 000000000..800a144c2 --- /dev/null +++ b/src/main/resources/assets/advancedperipherals/models/block/turtle_environment_right.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/turtle_upgrade_base_right", + "textures": {"texture": "advancedperipherals:block/environment_detector"} +} \ No newline at end of file diff --git a/src/main/resources/assets/advancedperipherals/models/block/turtle_geoscanner_left.json b/src/main/resources/assets/advancedperipherals/models/block/turtle_geoscanner_left.json new file mode 100644 index 000000000..7bfe302a3 --- /dev/null +++ b/src/main/resources/assets/advancedperipherals/models/block/turtle_geoscanner_left.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/turtle_upgrade_base_left", + "textures": {"texture": "advancedperipherals:block/geo_scanner"} +} \ No newline at end of file diff --git a/src/main/resources/assets/advancedperipherals/models/block/turtle_geoscanner_right.json b/src/main/resources/assets/advancedperipherals/models/block/turtle_geoscanner_right.json new file mode 100644 index 000000000..5304628b8 --- /dev/null +++ b/src/main/resources/assets/advancedperipherals/models/block/turtle_geoscanner_right.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/turtle_upgrade_base_right", + "textures": {"texture": "advancedperipherals:block/geo_scanner"} +} \ No newline at end of file diff --git a/src/main/resources/assets/advancedperipherals/models/block/turtle_player_left.json b/src/main/resources/assets/advancedperipherals/models/block/turtle_player_left.json new file mode 100644 index 000000000..0c38ff073 --- /dev/null +++ b/src/main/resources/assets/advancedperipherals/models/block/turtle_player_left.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/turtle_upgrade_base_left", + "textures": {"texture": "advancedperipherals:block/player_detector_front"} +} \ No newline at end of file diff --git a/src/main/resources/assets/advancedperipherals/models/block/turtle_player_right.json b/src/main/resources/assets/advancedperipherals/models/block/turtle_player_right.json new file mode 100644 index 000000000..542305903 --- /dev/null +++ b/src/main/resources/assets/advancedperipherals/models/block/turtle_player_right.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/turtle_upgrade_base_right", + "textures": {"texture": "advancedperipherals:block/player_detector_front"} +} \ No newline at end of file From 65dd24b30511cde14ebc2e341e1d45d5bac11afc Mon Sep 17 00:00:00 2001 From: Srendi Date: Mon, 13 Jan 2025 17:36:44 +0100 Subject: [PATCH 28/57] Fixed pocket and turtle upgrade data provider --- ... 103d9f3f36b01595f1aa5172191e60eff02e6924} | 6 +++- .../2db41954e490230d51b10affff25ee2ee27b8d5b | 2 +- .../2f719b8031aed5e605ed8d6694b19245ca45c6ca | 2 +- .../59eb3dbb5f86130e09b3c62d89b9525ee01cf52d | 2 +- .../9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e | 2 +- .../b8526e444ae7356037f3a813274f6835d1f3dd16 | 2 +- .../f95c7003282837dabaa33e3ffceec4e6865b5218 | 2 +- .../pocket_upgrade/chatty_pocket.json | 4 +++ .../pocket_upgrade/environment_pocket.json | 4 +++ .../pocket_upgrade/geoscanner_pocket.json | 4 +++ .../pocket_upgrade/player_pocket.json | 4 +++ .../common/data/DataGenerators.java | 13 +++++-- .../common/data/PocketUpgradesProvider.java | 34 +++++++++---------- .../common/data/TurtleUpgradesProvider.java | 33 ++++++++---------- 14 files changed, 69 insertions(+), 45 deletions(-) rename src/generated/resources/.cache/{ff85aeffff7b400453d938ac4326ddfe68257a73 => 103d9f3f36b01595f1aa5172191e60eff02e6924} (73%) create mode 100644 src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrade/chatty_pocket.json create mode 100644 src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrade/environment_pocket.json create mode 100644 src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrade/geoscanner_pocket.json create mode 100644 src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrade/player_pocket.json diff --git a/src/generated/resources/.cache/ff85aeffff7b400453d938ac4326ddfe68257a73 b/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 similarity index 73% rename from src/generated/resources/.cache/ff85aeffff7b400453d938ac4326ddfe68257a73 rename to src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 index db6ec086f..b7d3bdd31 100644 --- a/src/generated/resources/.cache/ff85aeffff7b400453d938ac4326ddfe68257a73 +++ b/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 @@ -1,4 +1,8 @@ -// 1.21.1 2025-01-13T02:34:51.2685128 vanilla/Registries +// 1.21.1 2025-01-13T17:34:41.7633686 Registries +b672635324c0df354e587efc81d0b19a581eae2f data/advancedperipherals/computercraft/pocket_upgrade/chatty_pocket.json +d4647159c2f2693a9c5e8d12bf740635751d29a8 data/advancedperipherals/computercraft/pocket_upgrade/environment_pocket.json +8216a0a7d8ebe3ae738c8fc3626df25eb0a2e07a data/advancedperipherals/computercraft/pocket_upgrade/geoscanner_pocket.json +a38aa83593f7ad0ace98e01bb3b5f06f272ef734 data/advancedperipherals/computercraft/pocket_upgrade/player_pocket.json b8f19ae0fb5bb898facc08e3787e0f96c8211881 data/advancedperipherals/computercraft/turtle_upgrade/chatty_turtle.json fe98c60e7d61139aacf2d0872873e610aac8a37b data/advancedperipherals/computercraft/turtle_upgrade/chunky_turtle.json ae619da638ad89d7302d832d6c09e2c87401c539 data/advancedperipherals/computercraft/turtle_upgrade/compass_turtle.json diff --git a/src/generated/resources/.cache/2db41954e490230d51b10affff25ee2ee27b8d5b b/src/generated/resources/.cache/2db41954e490230d51b10affff25ee2ee27b8d5b index 8cc476514..1109593e8 100644 --- a/src/generated/resources/.cache/2db41954e490230d51b10affff25ee2ee27b8d5b +++ b/src/generated/resources/.cache/2db41954e490230d51b10affff25ee2ee27b8d5b @@ -1,2 +1,2 @@ -// 1.21.1 2025-01-13T02:34:51.2705544 AP POI Type Tags +// 1.21.1 2025-01-13T17:28:09.7081276 AP POI Type Tags d3d6b837660a4e213f287ad9d11e12368b90cd8e data/minecraft/tags/point_of_interest_type/acquirable_job_site.json diff --git a/src/generated/resources/.cache/2f719b8031aed5e605ed8d6694b19245ca45c6ca b/src/generated/resources/.cache/2f719b8031aed5e605ed8d6694b19245ca45c6ca index a47b894f5..e31581614 100644 --- a/src/generated/resources/.cache/2f719b8031aed5e605ed8d6694b19245ca45c6ca +++ b/src/generated/resources/.cache/2f719b8031aed5e605ed8d6694b19245ca45c6ca @@ -1,2 +1,2 @@ -// 1.21.1 2025-01-13T02:34:51.27456 Languages: en_us for mod: advancedperipherals +// 1.21.1 2025-01-13T17:28:09.7116313 Languages: en_us for mod: advancedperipherals b733229a45f64a6500a00da10265bc71b8320229 assets/advancedperipherals/lang/en_us.json diff --git a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d index 15ed6c366..aaea0c1cf 100644 --- a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d +++ b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d @@ -1,4 +1,4 @@ -// 1.21.1 2025-01-13T02:34:51.2715601 Loot Tables +// 1.21.1 2025-01-13T17:28:09.7091279 Loot Tables 9b54955770745d55de988a86cbd08aa9ae23ff86 data/advancedperipherals/loot_table/blocks/block_reader.json d4f1bc579f83dc67ce9f94d35926d34b8894c990 data/advancedperipherals/loot_table/blocks/chat_box.json 6da40a0a9d46855710272fe9d40bb5a7f0219ff2 data/advancedperipherals/loot_table/blocks/energy_detector.json diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index 9444a0860..1245ad481 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,4 +1,4 @@ -// 1.21.1 2025-01-13T02:34:51.2725595 Recipes +// 1.21.1 2025-01-13T17:28:09.7101266 Recipes f5ba1f7d129c88dca1a13c8deaae2d269644c7fa data/advancedperipherals/advancement/recipes/redstone/block_reader.json e172645262ade9fc4a1c999a2c0041711c2eab55 data/advancedperipherals/advancement/recipes/redstone/chat_box.json 213de9a7e340c5eb9c01d82a72e7b58921c5290a data/advancedperipherals/advancement/recipes/redstone/chunk_controller.json diff --git a/src/generated/resources/.cache/b8526e444ae7356037f3a813274f6835d1f3dd16 b/src/generated/resources/.cache/b8526e444ae7356037f3a813274f6835d1f3dd16 index 366350c98..7dc9fb650 100644 --- a/src/generated/resources/.cache/b8526e444ae7356037f3a813274f6835d1f3dd16 +++ b/src/generated/resources/.cache/b8526e444ae7356037f3a813274f6835d1f3dd16 @@ -1,4 +1,4 @@ -// 1.21.1 2025-01-13T02:34:51.27456 Block States: advancedperipherals +// 1.21.1 2025-01-13T17:28:09.7101266 Block States: advancedperipherals 5e28ce1be9a6996d982641e5df1fa7162090b8cc assets/advancedperipherals/blockstates/block_reader.json f42bdde60f84fdb312f7cf3b2be461d9c11ebdc8 assets/advancedperipherals/blockstates/chat_box.json 67420f28031606ca03db9a044141bb22b0fa78b7 assets/advancedperipherals/blockstates/energy_detector.json diff --git a/src/generated/resources/.cache/f95c7003282837dabaa33e3ffceec4e6865b5218 b/src/generated/resources/.cache/f95c7003282837dabaa33e3ffceec4e6865b5218 index 01c30ea32..b3dcc715f 100644 --- a/src/generated/resources/.cache/f95c7003282837dabaa33e3ffceec4e6865b5218 +++ b/src/generated/resources/.cache/f95c7003282837dabaa33e3ffceec4e6865b5218 @@ -1,4 +1,4 @@ -// 1.21.1 2025-01-13T02:34:51.2705544 Block tags +// 1.21.1 2025-01-13T17:28:09.7071281 Block tags 5b2e51f09296cc50686a478ed03bd9debc9a395b data/minecraft/tags/blocks/mineable/pickaxe.json e9a65cdbf463c5378a799f69539feeae82a3e85e data/minecraft/tags/blocks/needs_iron_tool.json e1f71dcb4f9e7e36e29b0ad09d6520dc3adfa4a6 data/neoforge/tags/blocks/needs_wood_tool.json diff --git a/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrade/chatty_pocket.json b/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrade/chatty_pocket.json new file mode 100644 index 000000000..5b739eab0 --- /dev/null +++ b/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrade/chatty_pocket.json @@ -0,0 +1,4 @@ +{ + "type": "advancedperipherals:chatty_pocket", + "item": "advancedperipherals:chat_box" +} \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrade/environment_pocket.json b/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrade/environment_pocket.json new file mode 100644 index 000000000..6196caa16 --- /dev/null +++ b/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrade/environment_pocket.json @@ -0,0 +1,4 @@ +{ + "type": "advancedperipherals:environment_pocket", + "item": "advancedperipherals:environment_detector" +} \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrade/geoscanner_pocket.json b/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrade/geoscanner_pocket.json new file mode 100644 index 000000000..dffc722c6 --- /dev/null +++ b/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrade/geoscanner_pocket.json @@ -0,0 +1,4 @@ +{ + "type": "advancedperipherals:geoscanner_pocket", + "item": "advancedperipherals:geo_scanner" +} \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrade/player_pocket.json b/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrade/player_pocket.json new file mode 100644 index 000000000..0c307cb95 --- /dev/null +++ b/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrade/player_pocket.json @@ -0,0 +1,4 @@ +{ + "type": "advancedperipherals:player_pocket", + "item": "advancedperipherals:player_detector" +} \ No newline at end of file diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java b/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java index 2317e3385..fde637cea 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java @@ -1,17 +1,23 @@ package de.srendi.advancedperipherals.common.data; +import dan200.computercraft.api.pocket.IPocketUpgrade; +import dan200.computercraft.api.turtle.ITurtleUpgrade; import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.setup.Registration; import net.minecraft.Util; import net.minecraft.core.HolderLookup; +import net.minecraft.core.RegistrySetBuilder; import net.minecraft.data.DataGenerator; import net.minecraft.data.PackOutput; +import net.minecraft.data.registries.RegistryPatchGenerator; import net.minecraft.data.registries.VanillaRegistries; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; +import net.neoforged.neoforge.common.data.DatapackBuiltinEntriesProvider; import net.neoforged.neoforge.common.data.ExistingFileHelper; import net.neoforged.neoforge.data.event.GatherDataEvent; +import java.util.Set; import java.util.concurrent.CompletableFuture; @EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID, bus = EventBusSubscriber.Bus.MOD) @@ -31,8 +37,11 @@ public static void genData(GatherDataEvent event) { generator.addProvider(event.includeServer(), new BlockTagsProvider(packOutput, completablefuture, existingFileHelper, Registration.BLOCKS)); generator.addProvider(event.includeServer(), new RecipesProvider(packOutput, lookupProvider)); generator.addProvider(event.includeServer(), new BlockLootTablesProvider(packOutput, lookupProvider)); - TurtleUpgradesProvider.generate(generator.getVanillaPack(true), completablefuture); - PocketUpgradesProvider.generate(generator.getVanillaPack(true), completablefuture); + CompletableFuture fullRegistryPatch = RegistryPatchGenerator.createLookup(event.getLookupProvider(), Util.make(new RegistrySetBuilder(), (builder) -> { + builder.add(ITurtleUpgrade.REGISTRY, TurtleUpgradesProvider::addUpgrades); + builder.add(IPocketUpgrade.REGISTRY, PocketUpgradesProvider::addUpgrades); + })); + generator.addProvider(event.includeServer(), new DatapackBuiltinEntriesProvider(packOutput, fullRegistryPatch, null)); generator.addProvider(event.includeServer(), new PoiTypeProvider(packOutput, completablefuture, existingFileHelper)); generator.addProvider(event.includeServer(), new BlockStatesAndModelsProvider(packOutput, existingFileHelper)); diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java index 5fd8d31c7..a3b6bc547 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java @@ -1,10 +1,11 @@ package de.srendi.advancedperipherals.common.data; -import dan200.computercraft.api.turtle.ITurtleUpgrade; -import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtleChatBoxUpgrade; -import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtleEnvironmentDetectorUpgrade; -import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtleGeoScannerUpgrade; -import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtlePlayerDetectorUpgrade; +import dan200.computercraft.api.pocket.IPocketUpgrade; +import de.srendi.advancedperipherals.AdvancedPeripherals; +import de.srendi.advancedperipherals.common.addons.computercraft.pocket.PocketChatBoxUpgrade; +import de.srendi.advancedperipherals.common.addons.computercraft.pocket.PocketEnvironmentUpgrade; +import de.srendi.advancedperipherals.common.addons.computercraft.pocket.PocketGeoScannerUpgrade; +import de.srendi.advancedperipherals.common.addons.computercraft.pocket.PocketPlayerDetectorUpgrade; import de.srendi.advancedperipherals.common.setup.Blocks; import de.srendi.advancedperipherals.common.setup.CCRegistration; import net.minecraft.Util; @@ -12,28 +13,25 @@ import net.minecraft.core.RegistrySetBuilder; import net.minecraft.data.DataGenerator; import net.minecraft.data.registries.RegistryPatchGenerator; +import net.minecraft.data.worldgen.BootstrapContext; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; +import net.neoforged.neoforge.common.data.DatapackBuiltinEntriesProvider; +import java.util.Set; import java.util.concurrent.CompletableFuture; public class PocketUpgradesProvider { - public static void generate(DataGenerator.PackGenerator output, CompletableFuture registries) { - var newRegistries = RegistryPatchGenerator.createLookup(registries, Util.make(new RegistrySetBuilder(), builder -> { - builder.add(ITurtleUpgrade.REGISTRY, upgrades -> { - upgrades.register(id(CCRegistration.ID.CHATTY_POCKET), new TurtleChatBoxUpgrade(new ItemStack(Blocks.CHAT_BOX.get()))); - upgrades.register(id(CCRegistration.ID.PLAYER_POCKET), new TurtlePlayerDetectorUpgrade(new ItemStack(Blocks.PLAYER_DETECTOR.get()))); - upgrades.register(id(CCRegistration.ID.ENVIRONMENT_POCKET), new TurtleEnvironmentDetectorUpgrade(new ItemStack(Blocks.ENVIRONMENT_DETECTOR.get()))); - upgrades.register(id(CCRegistration.ID.GEOSCANNER_TURTLE), new TurtleGeoScannerUpgrade(new ItemStack(Blocks.GEO_SCANNER.get()))); - }); - })); - //TODO - crashes data gen - //output.addProvider(o -> new DatapackBuiltinEntriesProvider(o, newRegistries, Set.of(AdvancedPeripherals.MOD_ID))); + public static void addUpgrades(BootstrapContext upgrades) { + upgrades.register(id(CCRegistration.ID.CHATTY_POCKET), new PocketChatBoxUpgrade(new ItemStack(Blocks.CHAT_BOX.get()))); + upgrades.register(id(CCRegistration.ID.PLAYER_POCKET), new PocketPlayerDetectorUpgrade(new ItemStack(Blocks.PLAYER_DETECTOR.get()))); + upgrades.register(id(CCRegistration.ID.ENVIRONMENT_POCKET), new PocketEnvironmentUpgrade(new ItemStack(Blocks.ENVIRONMENT_DETECTOR.get()))); + upgrades.register(id(CCRegistration.ID.GEOSCANNER_POCKET), new PocketGeoScannerUpgrade(new ItemStack(Blocks.GEO_SCANNER.get()))); } - public static ResourceKey id(ResourceLocation id) { - return ITurtleUpgrade.createKey(id); + public static ResourceKey id(ResourceLocation id) { + return ResourceKey.create(IPocketUpgrade.REGISTRY, id); } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java index a8b667217..70661f564 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java @@ -1,5 +1,6 @@ package de.srendi.advancedperipherals.common.data; +import dan200.computercraft.api.pocket.IPocketUpgrade; import dan200.computercraft.api.turtle.ITurtleUpgrade; import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtleChatBoxUpgrade; @@ -22,6 +23,7 @@ import net.minecraft.core.RegistrySetBuilder; import net.minecraft.data.DataGenerator; import net.minecraft.data.registries.RegistryPatchGenerator; +import net.minecraft.data.worldgen.BootstrapContext; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; @@ -32,24 +34,19 @@ public class TurtleUpgradesProvider { - public static void generate(DataGenerator.PackGenerator output, CompletableFuture registries) { - var newRegistries = RegistryPatchGenerator.createLookup(registries, Util.make(new RegistrySetBuilder(), builder -> { - builder.add(ITurtleUpgrade.REGISTRY, upgrades -> { - upgrades.register(id(CCRegistration.ID.CHATTY_TURTLE), new TurtleChatBoxUpgrade(new ItemStack(Blocks.CHAT_BOX.get()))); - upgrades.register(id(CCRegistration.ID.PLAYER_TURTLE), new TurtlePlayerDetectorUpgrade(new ItemStack(Blocks.PLAYER_DETECTOR.get()))); - upgrades.register(id(CCRegistration.ID.ENVIRONMENT_TURTLE), new TurtleEnvironmentDetectorUpgrade(new ItemStack(Blocks.ENVIRONMENT_DETECTOR.get()))); - upgrades.register(id(CCRegistration.ID.CHUNKY_TURTLE), new TurtleChunkyUpgrade(new ItemStack(Items.CHUNK_CONTROLLER))); - upgrades.register(id(CCRegistration.ID.GEOSCANNER_TURTLE), new TurtleGeoScannerUpgrade(new ItemStack(Blocks.ENVIRONMENT_DETECTOR.get()))); - upgrades.register(id(CCRegistration.ID.COMPASS_TURTLE), new TurtleCompassUpgrade(new ItemStack(net.minecraft.world.item.Items.COMPASS))); - upgrades.register(id(CCRegistration.ID.WEAK_AUTOMATA), new WeakAutomata(new ItemStack(Items.WEAK_AUTOMATA_CORE.get()))); - upgrades.register(id(CCRegistration.ID.END_AUTOMATA), new EndAutomata(new ItemStack(Items.END_AUTOMATA_CORE.get()))); - upgrades.register(id(CCRegistration.ID.HUSBANDRY_AUTOMATA), new HusbandryAutomata(new ItemStack(Items.HUSBANDRY_AUTOMATA_CORE.get()))); - upgrades.register(id(CCRegistration.ID.OP_WEAK_AUTOMATA), new OverpoweredWeakAutomata(new ItemStack(Items.OVERPOWERED_WEAK_AUTOMATA_CORE.get()))); - upgrades.register(id(CCRegistration.ID.OP_END_AUTOMATA), new OverpoweredEndAutomata(new ItemStack(Items.OVERPOWERED_END_AUTOMATA_CORE.get()))); - upgrades.register(id(CCRegistration.ID.OP_HUSBANDRY_AUTOMATA), new OverpoweredHusbandryAutomata(new ItemStack(Items.OVERPOWERED_HUSBANDRY_AUTOMATA_CORE.get()))); - }); - })); - output.addProvider(o -> new DatapackBuiltinEntriesProvider(o, newRegistries, Set.of(AdvancedPeripherals.MOD_ID))); + public static void addUpgrades(BootstrapContext upgrades) { + upgrades.register(id(CCRegistration.ID.CHATTY_TURTLE), new TurtleChatBoxUpgrade(new ItemStack(Blocks.CHAT_BOX.get()))); + upgrades.register(id(CCRegistration.ID.PLAYER_TURTLE), new TurtlePlayerDetectorUpgrade(new ItemStack(Blocks.PLAYER_DETECTOR.get()))); + upgrades.register(id(CCRegistration.ID.ENVIRONMENT_TURTLE), new TurtleEnvironmentDetectorUpgrade(new ItemStack(Blocks.ENVIRONMENT_DETECTOR.get()))); + upgrades.register(id(CCRegistration.ID.CHUNKY_TURTLE), new TurtleChunkyUpgrade(new ItemStack(Items.CHUNK_CONTROLLER))); + upgrades.register(id(CCRegistration.ID.GEOSCANNER_TURTLE), new TurtleGeoScannerUpgrade(new ItemStack(Blocks.ENVIRONMENT_DETECTOR.get()))); + upgrades.register(id(CCRegistration.ID.COMPASS_TURTLE), new TurtleCompassUpgrade(new ItemStack(net.minecraft.world.item.Items.COMPASS))); + upgrades.register(id(CCRegistration.ID.WEAK_AUTOMATA), new WeakAutomata(new ItemStack(Items.WEAK_AUTOMATA_CORE.get()))); + upgrades.register(id(CCRegistration.ID.END_AUTOMATA), new EndAutomata(new ItemStack(Items.END_AUTOMATA_CORE.get()))); + upgrades.register(id(CCRegistration.ID.HUSBANDRY_AUTOMATA), new HusbandryAutomata(new ItemStack(Items.HUSBANDRY_AUTOMATA_CORE.get()))); + upgrades.register(id(CCRegistration.ID.OP_WEAK_AUTOMATA), new OverpoweredWeakAutomata(new ItemStack(Items.OVERPOWERED_WEAK_AUTOMATA_CORE.get()))); + upgrades.register(id(CCRegistration.ID.OP_END_AUTOMATA), new OverpoweredEndAutomata(new ItemStack(Items.OVERPOWERED_END_AUTOMATA_CORE.get()))); + upgrades.register(id(CCRegistration.ID.OP_HUSBANDRY_AUTOMATA), new OverpoweredHusbandryAutomata(new ItemStack(Items.OVERPOWERED_HUSBANDRY_AUTOMATA_CORE.get()))); } public static ResourceKey id(ResourceLocation id) { From 349061ebcf1f15cb5a2f320f2ce074f688c222e6 Mon Sep 17 00:00:00 2001 From: Srendi Date: Mon, 13 Jan 2025 19:12:14 +0100 Subject: [PATCH 29/57] Adapted item and fluid filters to the new component system Fixed the me bridge capabilities and components item keys --- .../AdvancedPeripherals.java | 8 ++--- .../addons/appliedenergistics/AppEngApi.java | 18 +++++++--- .../common/data/DataGenerators.java | 1 - .../common/data/PocketUpgradesProvider.java | 10 ------ .../common/data/TurtleUpgradesProvider.java | 11 ------ .../common/util/DataComponentUtil.java | 15 ++++++++ .../common/util/inventory/FluidFilter.java | 35 +++++++++++-------- .../common/util/inventory/ItemFilter.java | 33 +++++++++-------- 8 files changed, 71 insertions(+), 60 deletions(-) create mode 100644 src/main/java/de/srendi/advancedperipherals/common/util/DataComponentUtil.java diff --git a/src/main/java/de/srendi/advancedperipherals/AdvancedPeripherals.java b/src/main/java/de/srendi/advancedperipherals/AdvancedPeripherals.java index 4734455a5..95a2f8441 100644 --- a/src/main/java/de/srendi/advancedperipherals/AdvancedPeripherals.java +++ b/src/main/java/de/srendi/advancedperipherals/AdvancedPeripherals.java @@ -2,6 +2,7 @@ import dan200.computercraft.api.peripheral.PeripheralCapability; import de.srendi.advancedperipherals.common.addons.APAddons; +import de.srendi.advancedperipherals.common.addons.appliedenergistics.AppEngApi; import de.srendi.advancedperipherals.common.blocks.base.ICapabilityProvider; import de.srendi.advancedperipherals.common.configuration.APConfig; import de.srendi.advancedperipherals.common.setup.Registration; @@ -92,10 +93,7 @@ public void registerCapabilities(RegisterCapabilitiesEvent event) { }); }); - //if (APAddons.ae2Loaded) - /*event.registerBlockEntity( - AECapabilities.IN_WORLD_GRID_NODE_HOST, - BlockEntityTypes.ME_BRIDGE.get(), - (blockEntity, side) -> blockEntity);*/ + if (APAddons.ae2Loaded) + AppEngApi.registerCapabilities(event); } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java b/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java index fa35c0228..2add993f0 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java @@ -1,5 +1,6 @@ package de.srendi.advancedperipherals.common.addons.appliedenergistics; +import appeng.api.AECapabilities; import appeng.api.inventories.InternalInventory; import appeng.api.networking.IGridNode; import appeng.api.networking.crafting.CraftingJobStatus; @@ -21,6 +22,8 @@ import dan200.computercraft.shared.util.NBTUtil; import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.addons.APAddons; +import de.srendi.advancedperipherals.common.setup.BlockEntityTypes; +import de.srendi.advancedperipherals.common.util.DataComponentUtil; import de.srendi.advancedperipherals.common.util.LuaConverter; import de.srendi.advancedperipherals.common.util.Pair; import de.srendi.advancedperipherals.common.util.inventory.FluidFilter; @@ -29,10 +32,10 @@ import it.unimi.dsi.fastutil.objects.Object2LongMap; import me.ramidzkh.mekae2.ae2.MekanismKey; import net.minecraft.core.BlockPos; -import net.minecraft.core.RegistryAccess; -import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.Tag; import net.minecraft.world.item.ItemStack; import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent; import net.neoforged.neoforge.fluids.FluidStack; import net.neoforged.neoforge.fluids.capability.IFluidHandler; import net.neoforged.neoforge.items.IItemHandler; @@ -49,6 +52,13 @@ public class AppEngApi { + public static void registerCapabilities(RegisterCapabilitiesEvent event) { + event.registerBlockEntity( + AECapabilities.IN_WORLD_GRID_NODE_HOST, + BlockEntityTypes.ME_BRIDGE.get(), + (blockEntity, side) -> blockEntity); + } + public static Pair findAEStackFromStack(MEStorage monitor, @Nullable ICraftingService crafting, ItemStack item) { return findAEStackFromFilter(monitor, crafting, ItemFilter.fromStack(item)); } @@ -163,13 +173,13 @@ public static Map getObjectFromStack(Pair getObjectFromItemStack(Pair stack, @Nullable ICraftingService craftingService) { Map map = new HashMap<>(); String displayName = stack.getRight().getDisplayName().getString(); - CompoundTag nbt = stack.getRight().toTag(RegistryAccess.EMPTY); + Tag nbt = DataComponentUtil.toNbt(stack.getRight().getReadOnlyStack().getComponentsPatch()); long amount = stack.getLeft(); map.put("fingerprint", ItemUtil.getFingerprint(stack.getRight().toStack())); map.put("name", ItemUtil.getRegistryKey(stack.getRight().getItem()).toString()); map.put("amount", amount); map.put("displayName", displayName); - map.put("nbt", NBTUtil.toLua(nbt)); + map.put("components", NBTUtil.toLua(nbt)); map.put("tags", LuaConverter.tagsToList(() -> stack.getRight().getItem().builtInRegistryHolder().tags())); map.put("isCraftable", craftingService != null && craftingService.isCraftable(stack.getRight())); diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java b/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java index fde637cea..fbbc3f82a 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/DataGenerators.java @@ -17,7 +17,6 @@ import net.neoforged.neoforge.common.data.ExistingFileHelper; import net.neoforged.neoforge.data.event.GatherDataEvent; -import java.util.Set; import java.util.concurrent.CompletableFuture; @EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID, bus = EventBusSubscriber.Bus.MOD) diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java index a3b6bc547..e5c500824 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java @@ -1,26 +1,16 @@ package de.srendi.advancedperipherals.common.data; import dan200.computercraft.api.pocket.IPocketUpgrade; -import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.addons.computercraft.pocket.PocketChatBoxUpgrade; import de.srendi.advancedperipherals.common.addons.computercraft.pocket.PocketEnvironmentUpgrade; import de.srendi.advancedperipherals.common.addons.computercraft.pocket.PocketGeoScannerUpgrade; import de.srendi.advancedperipherals.common.addons.computercraft.pocket.PocketPlayerDetectorUpgrade; import de.srendi.advancedperipherals.common.setup.Blocks; import de.srendi.advancedperipherals.common.setup.CCRegistration; -import net.minecraft.Util; -import net.minecraft.core.HolderLookup; -import net.minecraft.core.RegistrySetBuilder; -import net.minecraft.data.DataGenerator; -import net.minecraft.data.registries.RegistryPatchGenerator; import net.minecraft.data.worldgen.BootstrapContext; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; -import net.neoforged.neoforge.common.data.DatapackBuiltinEntriesProvider; - -import java.util.Set; -import java.util.concurrent.CompletableFuture; public class PocketUpgradesProvider { diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java index 70661f564..ed487205d 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java @@ -1,8 +1,6 @@ package de.srendi.advancedperipherals.common.data; -import dan200.computercraft.api.pocket.IPocketUpgrade; import dan200.computercraft.api.turtle.ITurtleUpgrade; -import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtleChatBoxUpgrade; import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtleChunkyUpgrade; import de.srendi.advancedperipherals.common.addons.computercraft.turtles.TurtleCompassUpgrade; @@ -18,19 +16,10 @@ import de.srendi.advancedperipherals.common.setup.Blocks; import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.common.setup.Items; -import net.minecraft.Util; -import net.minecraft.core.HolderLookup; -import net.minecraft.core.RegistrySetBuilder; -import net.minecraft.data.DataGenerator; -import net.minecraft.data.registries.RegistryPatchGenerator; import net.minecraft.data.worldgen.BootstrapContext; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; -import net.neoforged.neoforge.common.data.DatapackBuiltinEntriesProvider; - -import java.util.Set; -import java.util.concurrent.CompletableFuture; public class TurtleUpgradesProvider { diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/DataComponentUtil.java b/src/main/java/de/srendi/advancedperipherals/common/util/DataComponentUtil.java new file mode 100644 index 000000000..7931d037c --- /dev/null +++ b/src/main/java/de/srendi/advancedperipherals/common/util/DataComponentUtil.java @@ -0,0 +1,15 @@ +package de.srendi.advancedperipherals.common.util; + +import net.minecraft.core.component.DataComponentPatch; +import net.minecraft.nbt.NbtOps; +import net.minecraft.nbt.Tag; +import net.minecraft.resources.RegistryOps; +import net.neoforged.neoforge.server.ServerLifecycleHooks; + +public class DataComponentUtil { + + public static Tag toNbt(DataComponentPatch patch) { + return DataComponentPatch.CODEC.encodeStart(RegistryOps.create(NbtOps.INSTANCE, ServerLifecycleHooks.getCurrentServer().registryAccess()), patch).getOrThrow(); + } + +} diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidFilter.java b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidFilter.java index f7fa4bdfa..43e3dfb86 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidFilter.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidFilter.java @@ -3,11 +3,12 @@ import dan200.computercraft.api.lua.LuaException; import dan200.computercraft.core.apis.TableHelper; import de.srendi.advancedperipherals.AdvancedPeripherals; +import de.srendi.advancedperipherals.common.util.DataComponentUtil; import de.srendi.advancedperipherals.common.util.NBTUtil; import de.srendi.advancedperipherals.common.util.Pair; +import net.minecraft.core.component.PatchedDataComponentMap; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; -import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; @@ -22,7 +23,8 @@ public class FluidFilter { private Fluid fluid = Fluids.EMPTY; private TagKey tag = null; - private CompoundTag nbt = null; + private Tag componentsAsNbt = null; + private PatchedDataComponentMap components; private int count = 1000; private String fingerprint = ""; @@ -46,11 +48,15 @@ public static Pair parse(Map item) { return Pair.of(null, "NO_VALID_FLUID"); } } - if (item.containsKey("nbt")) { + if (item.containsKey("components")) { try { - fluidFilter.nbt = NBTUtil.fromText(TableHelper.getStringField(item, "nbt")); + fluidFilter.componentsAsNbt = NBTUtil.fromText(TableHelper.getStringField(item, "components")); } catch (LuaException luaException) { - return Pair.of(null, "NO_VALID_NBT"); + try { + fluidFilter.componentsAsNbt = NBTUtil.fromText(TableHelper.getTableField(item, "components").toString()); + } catch (LuaException e) { + return Pair.of(null, "NO_VALID_COMPONENTS"); + } } } if (item.containsKey("fingerprint")) { @@ -75,7 +81,8 @@ public static Pair parse(Map item) { public static FluidFilter fromStack(FluidStack stack) { FluidFilter filter = empty(); filter.fluid = stack.getFluid(); - //filter.nbt = stack.hasTag() ? stack.getTag() : null; + filter.componentsAsNbt = DataComponentUtil.toNbt(stack.getComponentsPatch()); + filter.components = stack.getComponents(); return filter; } @@ -84,12 +91,12 @@ public static FluidFilter empty() { } public boolean isEmpty() { - return fingerprint.isEmpty() && fluid == Fluids.EMPTY && tag == null && nbt == null; + return fingerprint.isEmpty() && fluid == Fluids.EMPTY && tag == null && componentsAsNbt == null; } public FluidStack toFluidStack() { var result = new FluidStack(fluid, count); - //result.setTag(nbt != null ? nbt.copy() : null); + result.applyComponents(components); return result; } @@ -110,9 +117,9 @@ public boolean test(FluidStack stack) { if (tag != null && !stack.getFluid().is(tag)) { return false; } - //if (nbt != null && !stack.getOrCreateTag().equals(nbt)) { - // return false; - //} + if (componentsAsNbt != null && !DataComponentUtil.toNbt(stack.getComponentsPatch()).equals(componentsAsNbt)) { + return false; + } return true; } @@ -124,8 +131,8 @@ public Fluid getFluid() { return fluid; } - public Tag getNbt() { - return nbt; + public Tag getComponentsAsNbt() { + return componentsAsNbt; } @Override @@ -133,7 +140,7 @@ public String toString() { return "FluidFilter{" + "fluid=" + FluidUtil.getRegistryKey(fluid) + ", tag=" + tag + - ", nbt=" + nbt + + ", components=" + componentsAsNbt + ", count=" + count + ", fingerprint='" + fingerprint + '\'' + '}'; diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemFilter.java b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemFilter.java index a0907d668..3a2cca625 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemFilter.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/ItemFilter.java @@ -3,11 +3,12 @@ import dan200.computercraft.api.lua.LuaException; import dan200.computercraft.core.apis.TableHelper; import de.srendi.advancedperipherals.AdvancedPeripherals; +import de.srendi.advancedperipherals.common.util.DataComponentUtil; import de.srendi.advancedperipherals.common.util.NBTUtil; import de.srendi.advancedperipherals.common.util.Pair; +import net.minecraft.core.component.PatchedDataComponentMap; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; -import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; @@ -22,7 +23,8 @@ public class ItemFilter { private Item item = Items.AIR; private TagKey tag = null; - private CompoundTag nbt = null; + private Tag componentsAsNbt = null; + private PatchedDataComponentMap components; private int count = 64; private String fingerprint = ""; public int fromSlot = -1; @@ -48,14 +50,14 @@ public static Pair parse(Map item) { return Pair.of(null, "NO_VALID_ITEM"); } } - if (item.containsKey("nbt")) { + if (item.containsKey("components")) { try { - itemFilter.nbt = NBTUtil.fromText(TableHelper.getStringField(item, "nbt")); + itemFilter.componentsAsNbt = NBTUtil.fromText(TableHelper.getStringField(item, "components")); } catch (LuaException luaException) { try { - itemFilter.nbt = NBTUtil.fromText(TableHelper.getTableField(item, "nbt").toString()); + itemFilter.componentsAsNbt = NBTUtil.fromText(TableHelper.getTableField(item, "components").toString()); } catch (LuaException e) { - return Pair.of(null, "NO_VALID_NBT"); + return Pair.of(null, "NO_VALID_COMPONENTS"); } } } @@ -95,7 +97,8 @@ public static Pair parse(Map item) { public static ItemFilter fromStack(ItemStack stack) { ItemFilter filter = empty(); filter.item = stack.getItem(); - //filter.nbt = stack.hasTag() ? stack.getTag() : null; + filter.componentsAsNbt = DataComponentUtil.toNbt(stack.getComponentsPatch()); + filter.components = (PatchedDataComponentMap) stack.getComponents(); return filter; } @@ -104,12 +107,12 @@ public static ItemFilter empty() { } public boolean isEmpty() { - return fingerprint.isEmpty() && item == Items.AIR && tag == null && nbt == null; + return fingerprint.isEmpty() && item == Items.AIR && tag == null && componentsAsNbt == null; } public ItemStack toItemStack() { var result = new ItemStack(item, count); - //result.setTag(nbt != null ? nbt.copy() : null); + result.applyComponents(components); return result; } @@ -125,9 +128,9 @@ public boolean test(ItemStack stack) { if (tag != null && !stack.is(tag)) { return false; } - //if (nbt != null && !stack.getOrCreateTag().equals(nbt)) { - // return false; - //} + if (componentsAsNbt != null && !DataComponentUtil.toNbt(stack.getComponentsPatch()).equals(componentsAsNbt)) { + return false; + } return true; } @@ -147,8 +150,8 @@ public int getToSlot() { return toSlot; } - public Tag getNbt() { - return nbt; + public Tag getComponentsAsNbt() { + return componentsAsNbt; } @Override @@ -156,7 +159,7 @@ public String toString() { return "ItemFilter{" + "item=" + ItemUtil.getRegistryKey(item) + ", tag=" + tag + - ", nbt=" + nbt + + ", components=" + componentsAsNbt + ", count=" + count + ", fingerprint='" + fingerprint + '\'' + ", fromSlot=" + fromSlot + From 0fcf21c9d3c788f0b1df11201e4da76d396793ec Mon Sep 17 00:00:00 2001 From: Srendi Date: Mon, 13 Jan 2025 21:48:35 +0100 Subject: [PATCH 30/57] Adapt changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53c786e9b..2f0c57a2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [1.21.1-0.7.43a] - 2025-01-13 + +Alpha 1.21.1 release +The only thing that's missing is the colony integrator - we will add that soon. +Please report any bugs to github! + ## [1.20.4-0.7.43a] - 2024-12-27 First official Advanced Peripherals 1.20.4 alpha release. Please report any bug to github! From d2f02fb9edc1144d4e84547dc69782bbdb291537 Mon Sep 17 00:00:00 2001 From: Srendi Date: Mon, 13 Jan 2025 23:40:14 +0100 Subject: [PATCH 31/57] Re added pocket and turtle trades to our villager Changed how we get the pocket position for our PocketPeripheralOwner --- .../owner/PocketPeripheralOwner.java | 10 +- .../common/village/VillagerTrade.java | 102 +++++++++++------- .../common/village/VillagerTrades.java | 16 +-- 3 files changed, 80 insertions(+), 48 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/PocketPeripheralOwner.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/PocketPeripheralOwner.java index 2b97730a6..ab6d54d8a 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/PocketPeripheralOwner.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/PocketPeripheralOwner.java @@ -14,6 +14,7 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; +import net.minecraft.world.phys.Vec3; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -38,17 +39,14 @@ public String getCustomName() { @Nullable @Override public Level getLevel() { - Entity owner = pocket.getEntity(); - if (owner == null) return null; - return owner.getCommandSenderWorld(); + return pocket.getLevel(); } @NotNull @Override public BlockPos getPos() { - Entity owner = pocket.getEntity(); - if (owner == null) return new BlockPos(0, 0, 0); - return owner.blockPosition(); + Vec3 position = pocket.getPosition(); + return new BlockPos((int) position.x, (int) position.y, (int) position.z); } @NotNull diff --git a/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrade.java b/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrade.java index 8d575735f..65114e4e5 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrade.java @@ -1,5 +1,13 @@ package de.srendi.advancedperipherals.common.village; +import dan200.computercraft.api.pocket.IPocketUpgrade; +import dan200.computercraft.api.turtle.ITurtleUpgrade; +import dan200.computercraft.api.upgrades.UpgradeData; +import dan200.computercraft.shared.ModRegistry; +import dan200.computercraft.shared.util.DataComponentUtil; +import net.minecraft.core.Holder; +import net.minecraft.core.RegistryAccess; +import net.minecraft.resources.ResourceLocation; import net.minecraft.util.RandomSource; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.npc.VillagerTrades; @@ -72,40 +80,18 @@ public static class TradeBuilder { private int maxUses = 10; private int xp = 2; - private final ItemLike item; - private final ItemStack itemStack; + private ItemLike item; + private ItemStack itemStack; - private TradeBuilder(VillagerTradesEvent event, ItemLike item, Type type, int emeraldAmount, int professionLevel) { + private TradeBuilder(VillagerTradesEvent event, Type type, int emeraldAmount, int professionLevel) { this.villagerEvent = event; - this.item = item; - this.itemStack = null; - this.type = type; - this.emeraldAmount = emeraldAmount; - this.professionLevel = professionLevel; - } - - private TradeBuilder(VillagerTradesEvent event, ItemStack stack, Type type, int emeraldAmount, int professionLevel) { - this.villagerEvent = event; - this.itemStack = stack; - this.item = null; - this.type = type; - this.emeraldAmount = emeraldAmount; - this.professionLevel = professionLevel; - } - - private TradeBuilder(WandererTradesEvent event, ItemLike item, Type type, int emeraldAmount, int professionLevel) { - this.wandererEvent = event; - this.item = item; - this.itemStack = null; this.type = type; this.emeraldAmount = emeraldAmount; this.professionLevel = professionLevel; } - private TradeBuilder(WandererTradesEvent event, ItemStack stack, Type type, int emeraldAmount, int professionLevel) { + private TradeBuilder(WandererTradesEvent event, Type type, int emeraldAmount, int professionLevel) { this.wandererEvent = event; - this.itemStack = stack; - this.item = null; this.type = type; this.emeraldAmount = emeraldAmount; this.professionLevel = professionLevel; @@ -124,22 +110,20 @@ private TradeBuilder(WandererTradesEvent event, ItemStack stack, Type type, int * @return a builder instance */ public static TradeBuilder createTrade(VillagerTradesEvent event, ItemLike itemLike, Type type, int emeraldAmount, int professionLevel) { - return new TradeBuilder(event, itemLike, type, emeraldAmount, professionLevel); + return new TradeBuilder(event, type, emeraldAmount, professionLevel).withItem(itemLike); } /** * Creates a new TradeBuilder instance. Can be used to create villager trades for normal villagers - * This one is for normal villagers with item stacks * * @param event this should be executed in an event - pass the villager trade event here - * @param itemStack the item for trade * @param type the trade type * @param emeraldAmount the emerald amount of the trade * @param professionLevel the profession level of the villager. 1 to 5 * @return a builder instance */ - public static TradeBuilder createTrade(VillagerTradesEvent event, ItemStack itemStack, Type type, int emeraldAmount, int professionLevel) { - return new TradeBuilder(event, itemStack, type, emeraldAmount, professionLevel); + public static TradeBuilder createTrade(VillagerTradesEvent event, Type type, int emeraldAmount, int professionLevel) { + return new TradeBuilder(event, type, emeraldAmount, professionLevel); } /** @@ -155,22 +139,68 @@ public static TradeBuilder createTrade(VillagerTradesEvent event, ItemStack item * @return a builder instance */ public static TradeBuilder createTrade(WandererTradesEvent event, ItemLike itemLike, Type type, int emeraldAmount, int professionLevel) { - return new TradeBuilder(event, itemLike, type, emeraldAmount, professionLevel); + return new TradeBuilder(event, type, emeraldAmount, professionLevel).withItem(itemLike); } /** * Creates a new TradeBuilder instance. Can be used to create villager trades for wandering traders. - * This one is for normal villagers with item stacks * * @param event this should be executed in an event - pass the villager trade event here - * @param itemStack the item for trade * @param type the trade type * @param emeraldAmount the emerald amount of the trade * @param professionLevel the profession level of the villager. 1 to 5 * @return a builder instance */ - public static TradeBuilder createTrade(WandererTradesEvent event, ItemStack itemStack, Type type, int emeraldAmount, int professionLevel) { - return new TradeBuilder(event, itemStack, type, emeraldAmount, professionLevel); + public static TradeBuilder createTrade(WandererTradesEvent event, Type type, int emeraldAmount, int professionLevel) { + return new TradeBuilder(event, type, emeraldAmount, professionLevel); + } + + public TradeBuilder withItem(ItemLike item) { + this.item = item; + return this; + } + + public TradeBuilder withItemStack(ItemStack itemStack) { + this.itemStack = itemStack; + return this; + } + + /** + * Sets a pocket upgrade as the item stack + * + * @param advanced should it be an advanced pocket computer + * @param id the id of the upgrade + * @return the current instance of the builder + */ + public TradeBuilder withPocketUpgrade(boolean advanced, ResourceLocation id) { + RegistryAccess access = wandererEvent != null ? wandererEvent.getRegistryAccess() : villagerEvent.getRegistryAccess(); + + Holder.Reference pocketUpgrade = access.registryOrThrow(IPocketUpgrade.REGISTRY) + .getHolder(id) + .orElseThrow(); + + ItemStack pocketStack = DataComponentUtil.createStack(advanced ? ModRegistry.Items.POCKET_COMPUTER_ADVANCED.get() : ModRegistry.Items.POCKET_COMPUTER_NORMAL.get(), ModRegistry.DataComponents.POCKET_UPGRADE.get(), UpgradeData.ofDefault(pocketUpgrade)); + + return withItemStack(pocketStack); + } + + /** + * Sets a turtle upgrade as the item stack + * + * @param advanced should it be an advanced turtle + * @param id the id of the upgrade + * @return the current instance of the builder + */ + public TradeBuilder withTurtleUpgrade(boolean advanced, ResourceLocation id) { + RegistryAccess access = wandererEvent != null ? wandererEvent.getRegistryAccess() : villagerEvent.getRegistryAccess(); + + Holder.Reference turtleUpgrade = access.registryOrThrow(ITurtleUpgrade.REGISTRY) + .getHolder(id) + .orElseThrow(); + + ItemStack turtleStack = DataComponentUtil.createStack(advanced ? ModRegistry.Items.TURTLE_ADVANCED.get() : ModRegistry.Items.TURTLE_NORMAL.get(), ModRegistry.DataComponents.RIGHT_TURTLE_UPGRADE.get(), UpgradeData.ofDefault(turtleUpgrade)); + + return withItemStack(turtleStack); } /** diff --git a/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrades.java b/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrades.java index 8b9523f75..89cd3e5d4 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrades.java +++ b/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrades.java @@ -4,6 +4,7 @@ import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.configuration.APConfig; import de.srendi.advancedperipherals.common.setup.Blocks; +import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.common.setup.Items; import de.srendi.advancedperipherals.common.setup.Villagers; import net.neoforged.api.distmarker.Dist; @@ -54,15 +55,17 @@ public static void registerVillagerTrades(VillagerTradesEvent event) { TradeBuilder.createTrade(event, ModRegistry.Blocks.COMPUTER_ADVANCED.get(), VillagerTrade.Type.ITEM_FOR_EMERALD, 3, 2) .setXp(4) .build(); - //TODO - /*TradeBuilder.createTrade(event, ItemUtil.makeTurtle(ItemUtil.TURTLE_NORMAL, CCRegistration.ID.ENVIRONMENT_TURTLE.toString()), VillagerTrade.Type.ITEM_FOR_EMERALD, 4, 3) + TradeBuilder.createTrade(event, VillagerTrade.Type.ITEM_FOR_EMERALD, 4, 3) + .withTurtleUpgrade(false, CCRegistration.ID.ENVIRONMENT_TURTLE) .setMaxUses(4) .setXp(5) .build(); - TradeBuilder.createTrade(event, ItemUtil.makePocket(ItemUtil.POCKET_ADVANCED, CCRegistration.ID.PLAYER_POCKET.toString()), VillagerTrade.Type.ITEM_FOR_EMERALD, 4, 3) + TradeBuilder.createTrade(event, VillagerTrade.Type.ITEM_FOR_EMERALD, 4, 3) + .withPocketUpgrade(true, CCRegistration.ID.PLAYER_POCKET) .setMaxUses(4) .setXp(7) - .build();*/ + .build(); + TradeBuilder.createTrade(event, Items.CHUNK_CONTROLLER.get(), VillagerTrade.Type.EMERALD_FOR_ITEM, 5, 3) .setMaxUses(6) .setXp(8) @@ -86,9 +89,10 @@ public static void registerVillagerTrades(VillagerTradesEvent event) { TradeBuilder.createTrade(event, Items.MEMORY_CARD.get(), VillagerTrade.Type.EMERALD_FOR_ITEM, 2, 4) .setXp(4) .build(); - /*TradeBuilder.createTrade(event, ItemUtil.makeTurtle(ItemUtil.TURTLE_ADVANCED, CCRegistration.ID.CHUNKY_TURTLE.toString()), VillagerTrade.Type.ITEM_FOR_EMERALD, 8, 4) + TradeBuilder.createTrade(event, VillagerTrade.Type.ITEM_FOR_EMERALD, 8, 4) + .withTurtleUpgrade(true, CCRegistration.ID.CHUNKY_TURTLE) .setXp(7) - .build();*/ + .build(); TradeBuilder.createTrade(event, Items.CHUNK_CONTROLLER.get(), VillagerTrade.Type.ITEM_FOR_EMERALD, 6, 4) .setMaxUses(6) .setXp(6) From b0a439d6007428b9e09b43aeddda4114038cbc26 Mon Sep 17 00:00:00 2001 From: Srendi Date: Mon, 13 Jan 2025 23:46:53 +0100 Subject: [PATCH 32/57] Don't throw an exception if a pocket/turtle upgrade was removed by datapacks when used in villager trades --- .../common/village/VillagerTrade.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrade.java b/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrade.java index 65114e4e5..ec9947ee4 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/village/VillagerTrade.java @@ -5,6 +5,7 @@ import dan200.computercraft.api.upgrades.UpgradeData; import dan200.computercraft.shared.ModRegistry; import dan200.computercraft.shared.util.DataComponentUtil; +import de.srendi.advancedperipherals.AdvancedPeripherals; import net.minecraft.core.Holder; import net.minecraft.core.RegistryAccess; import net.minecraft.resources.ResourceLocation; @@ -177,7 +178,11 @@ public TradeBuilder withPocketUpgrade(boolean advanced, ResourceLocation id) { Holder.Reference pocketUpgrade = access.registryOrThrow(IPocketUpgrade.REGISTRY) .getHolder(id) - .orElseThrow(); + .orElse(null); + if (pocketUpgrade == null) { + AdvancedPeripherals.debug("Pocket upgrade " + id + " does not exist or was removed by a datapack, skipping villager trade"); + return this; + } ItemStack pocketStack = DataComponentUtil.createStack(advanced ? ModRegistry.Items.POCKET_COMPUTER_ADVANCED.get() : ModRegistry.Items.POCKET_COMPUTER_NORMAL.get(), ModRegistry.DataComponents.POCKET_UPGRADE.get(), UpgradeData.ofDefault(pocketUpgrade)); @@ -196,7 +201,12 @@ public TradeBuilder withTurtleUpgrade(boolean advanced, ResourceLocation id) { Holder.Reference turtleUpgrade = access.registryOrThrow(ITurtleUpgrade.REGISTRY) .getHolder(id) - .orElseThrow(); + .orElse(null); + + if (turtleUpgrade == null) { + AdvancedPeripherals.debug("Pocket upgrade " + id + " does not exist or was removed by a datapack, skipping villager trade"); + return this; + } ItemStack turtleStack = DataComponentUtil.createStack(advanced ? ModRegistry.Items.TURTLE_ADVANCED.get() : ModRegistry.Items.TURTLE_NORMAL.get(), ModRegistry.DataComponents.RIGHT_TURTLE_UPGRADE.get(), UpgradeData.ofDefault(turtleUpgrade)); From 5e01fe47cdb365786acaa4cdd2710df6a1901185 Mon Sep 17 00:00:00 2001 From: Srendi Date: Tue, 14 Jan 2025 14:50:43 +0100 Subject: [PATCH 33/57] Fixed ME Bridges `getUsedItemStorage` and `getUsedFluidStorage` function --- .../addons/appliedenergistics/AppEngApi.java | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java b/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java index 2add993f0..ba322b56c 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java @@ -18,6 +18,8 @@ import appeng.api.storage.MEStorage; import appeng.api.storage.cells.IBasicCellItem; import appeng.blockentity.storage.DriveBlockEntity; +import appeng.me.cells.BasicCellHandler; +import appeng.me.cells.BasicCellInventory; import appeng.parts.storagebus.StorageBusPart; import dan200.computercraft.shared.util.NBTUtil; import de.srendi.advancedperipherals.AdvancedPeripherals; @@ -429,16 +431,14 @@ public static long getUsedItemStorage(IGridNode node) { continue; if (stack.getItem() instanceof IBasicCellItem cell) { - int bytesPerType = cell.getBytesPerType(null); - if (cell.getKeyType().getClass().isAssignableFrom(AEKeyType.items().getClass())) { - //if (stack.get() == null) - // continue; - //TODO - int numOfType = 0; //stack.get().getLongArray("amts").length; - long numItemsInCell = 0; //stack.getTag().getLong("ic"); - used += ((int) Math.ceil(((double) numItemsInCell) / 8)) + ((long) bytesPerType * numOfType); + BasicCellInventory cellInventory = BasicCellHandler.INSTANCE.getCellInventory(stack, null); + + if (cellInventory == null) + continue; + + used += cellInventory.getUsedBytes(); } } } @@ -475,16 +475,13 @@ public static long getUsedFluidStorage(IGridNode node) { ItemStack stack = inventory.getStackInSlot(i); if (stack.getItem() instanceof IBasicCellItem cell) { - int bytesPerType = cell.getBytesPerType(null); - if (cell.getKeyType().getClass().isAssignableFrom(AEKeyType.fluids().getClass())) { - //if (stack.getTag() == null) - // continue; - //TODO - int numOfType = 0; //stack.getTag().getLongArray("amts").length; - long numBucketsInCell = 0; //stack.getTag().getLong("ic") / 1000; + BasicCellInventory cellInventory = BasicCellHandler.INSTANCE.getCellInventory(stack, null); + + if (cellInventory == null) + continue; - used += ((int) Math.ceil(((double) numBucketsInCell) / 8)) + ((long) bytesPerType * numOfType); + used += cellInventory.getUsedBytes(); } } } From aa24fa0e3af6e30f6efa05e9712d215117e378a1 Mon Sep 17 00:00:00 2001 From: Srendi Date: Tue, 14 Jan 2025 16:23:00 +0100 Subject: [PATCH 34/57] comment github build in PR --- .github/workflows/build-and-test.yaml | 4 + .github/workflows/pr-comment-artifacts.yaml | 111 ++++++++++++++++++++ build.gradle | 2 +- gradle.properties | 1 + 4 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pr-comment-artifacts.yaml diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 3e33d0adf..240ef7e87 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -11,3 +11,7 @@ on: jobs: build-and-test: uses: IntelligenceModding/actions/.github/workflows/build-and-test.yaml@master + with: + build: ${{ github.event_name != 'push' }} + build_name: AdvancedPeripherals + pr: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || '' }} diff --git a/.github/workflows/pr-comment-artifacts.yaml b/.github/workflows/pr-comment-artifacts.yaml new file mode 100644 index 000000000..7a67718df --- /dev/null +++ b/.github/workflows/pr-comment-artifacts.yaml @@ -0,0 +1,111 @@ +# /~https://github.com/orgs/community/discussions/51403 + +name: Comment Artifacts + +on: + workflow_run: + types: + - "completed" + workflows: + - "Build and Test" + +permissions: + actions: read + attestations: read + contents: read + pull-requests: write + +jobs: + parse-metadata: + runs-on: ubuntu-latest + outputs: + PR_NUMBER: ${{ steps.metadata.outputs.PR_NUMBER }} + HEAD_SHA: ${{ steps.metadata.outputs.HEAD_SHA }} + ARTIFACT_ID: ${{ steps.metadata.outputs.ARTIFACT_ID }} + ARTIFACT_URL: ${{ steps.metadata.outputs.ARTIFACT_URL }} + ARTIFACT_EXP: ${{ steps.metadata.outputs.ARTIFACT_EXP }} + steps: + - name: Get Artifact URL & PR Info + id: metadata + env: + GITHUB_TOKEN: ${{ github.token }} + OWNER: ${{ github.repository_owner }} + REPO: ${{ github.event.repository.name }} + WORKFLOW_RUN_EVENT_OBJ: ${{ toJSON(github.event.workflow_run) }} + PREVIOUS_JOB_ID: ${{ github.event.workflow_run.id }} + run: | + echo "Previous Job ID: $PREVIOUS_JOB_ID" + + gh api "/repos/$OWNER/$REPO/actions/runs/$PREVIOUS_JOB_ID/logs" >logs.zip + unzip -p logs.zip 'Build/*.txt' >build.txt + + function parse_var() { + name=$1 + line=$(cat build.txt | grep "output:${name}=") + export parsed=${line#*"output:${name}="} + } + parse_var PR_NUMBER + PR_NUMBER=$parsed + parse_var HEAD_SHA + HEAD_SHA=$parsed + parse_var ARTIFACT_ID + ARTIFACT_ID=$parsed + parse_var ARTIFACT_URL + ARTIFACT_URL=$parsed + + echo "PR Number: $PR_NUMBER" + echo "PR_NUMBER=$PR_NUMBER" >> "$GITHUB_OUTPUT" + + echo "Head sha: $HEAD_SHA" + echo "HEAD_SHA=$HEAD_SHA" >> "$GITHUB_OUTPUT" + + echo "ARTIFACT ID: $ARTIFACT_ID" + echo "ARTIFACT_ID=$ARTIFACT_ID" >> "$GITHUB_OUTPUT" + + echo "ARTIFACT URL: $ARTIFACT_URL" + echo "ARTIFACT_URL=$ARTIFACT_URL" >> "$GITHUB_OUTPUT" + + if [[ "$ARTIFACT_ID" != "" ]]; then + ARTIFACT_EXP=$(gh api "/repos/$OWNER/$REPO/actions/artifacts/$ARTIFACT_ID" -jq ".expires_at") + echo "ARTIFACT EXP: $ARTIFACT_EXP" + echo "ARTIFACT_EXP=$ARTIFACT_EXP" >> "$GITHUB_OUTPUT" + fi + + comment-success: + if: ${{ jobs.parse-metadata.outputs.PR_NUMBER != '' }} + runs-on: ubuntu-latest + steps: + - name: Find Comment + uses: peter-evans/find-comment@v3 + id: fc + with: + issue-number: ${{ jobs.parse-metadata.outputs.PR_NUMBER }} + comment-author: 'github-actions[bot]' + body-includes: '## Build Preview' + + - name: Update Comment + env: + JOB_PATH: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}" + HEAD_SHA: ${{ jobs.parse-metadata.outputs.HEAD_SHA }} + ARTIFACT_URL: ${{ jobs.parse-metadata.outputs.ARTIFACT_URL }} + ARTIFACT_EXP: ${{ jobs.parse-metadata.outputs.ARTIFACT_EXP }} + uses: peter-evans/create-or-update-comment@v4 + with: + issue-number: ${{ jobs.parse-metadata.outputs.PR_NUMBER }} + comment-id: ${{ steps.fc.outputs.comment-id }} + edit-mode: replace + body: |- + ## Build Preview + + [![badge]]($JOB_PATH) + + You can find files attached to the below linked Workflow Run URL (Logs). + + | Name | Link | + |-----------|-------------------------| + | Commit | ${{ env.HEAD_SHA }} | + | Logs | ${{ env.JOB_PATH }} | + ${{ env.ARTIFACT_URL && format('| Jar Files | {0} |', env.ARTIFACT_URL) || '' }} + ${{ env.ARTIFACT_EXP && format('| Expires At | {0} |', env.ARTIFACT_EXP) || '' }} + + [badge]: https://img.shields.io/badge/${{ format('{0}-{1}', github.event.workflow_run.conclusion, github.event.workflow_run.conclusion == 'success' && '3fb950' || 'f85149') }}?style=for-the-badge&logo=github&label=build diff --git a/build.gradle b/build.gradle index 3ea5c8c14..ebc86d618 100644 --- a/build.gradle +++ b/build.gradle @@ -28,7 +28,7 @@ wrapper { def isSnapshotVersion = project.hasProperty('teamcityBuild') -version = "${mod_version}" + (isSnapshotVersion ? "-SNAPSHOT" : "") +version = "${mod_version}" + (isSnapshotVersion ? "-SNAPSHOT" : "") + "${mod_artifact_suffix}" group = 'de.srendi.advancedperipherals' def static getenv(path = ".env") { diff --git a/gradle.properties b/gradle.properties index 5443e7363..ef9a8b077 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,6 +4,7 @@ org.gradle.logging.level=info # Minecraft related mod_id=advancedperipherals +mod_artifact_suffix= minecraft_version=1.21.1 neo_version=21.1.93 parchment_minecraft_version=1.21.1 From a2ab3de34f558e81024c7a7a5f40ef41ecbfb3fc Mon Sep 17 00:00:00 2001 From: Srendi Date: Tue, 14 Jan 2025 16:26:32 +0100 Subject: [PATCH 35/57] Checkstyle --- .../common/addons/appliedenergistics/AppEngApi.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java b/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java index ba322b56c..88f1301e3 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AppEngApi.java @@ -433,7 +433,7 @@ public static long getUsedItemStorage(IGridNode node) { if (stack.getItem() instanceof IBasicCellItem cell) { if (cell.getKeyType().getClass().isAssignableFrom(AEKeyType.items().getClass())) { - BasicCellInventory cellInventory = BasicCellHandler.INSTANCE.getCellInventory(stack, null); + BasicCellInventory cellInventory = BasicCellHandler.INSTANCE.getCellInventory(stack, null); if (cellInventory == null) continue; @@ -476,7 +476,7 @@ public static long getUsedFluidStorage(IGridNode node) { if (stack.getItem() instanceof IBasicCellItem cell) { if (cell.getKeyType().getClass().isAssignableFrom(AEKeyType.fluids().getClass())) { - BasicCellInventory cellInventory = BasicCellHandler.INSTANCE.getCellInventory(stack, null); + BasicCellInventory cellInventory = BasicCellHandler.INSTANCE.getCellInventory(stack, null); if (cellInventory == null) continue; From 3d841a88409c9fbb2b12752b6a9445cf51d07b47 Mon Sep 17 00:00:00 2001 From: Kevin Z Date: Tue, 14 Jan 2025 08:34:48 -0700 Subject: [PATCH 36/57] Update pr-comment-artifacts.yaml I'm dumb should use needs but not jobs Signed-off-by: Kevin Z --- .github/workflows/pr-comment-artifacts.yaml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr-comment-artifacts.yaml b/.github/workflows/pr-comment-artifacts.yaml index 7a67718df..6d29e128a 100644 --- a/.github/workflows/pr-comment-artifacts.yaml +++ b/.github/workflows/pr-comment-artifacts.yaml @@ -72,26 +72,28 @@ jobs: fi comment-success: - if: ${{ jobs.parse-metadata.outputs.PR_NUMBER != '' }} + if: ${{ needs.parse-metadata.outputs.PR_NUMBER != '' }} runs-on: ubuntu-latest + needs: + - parse-metadata steps: - name: Find Comment uses: peter-evans/find-comment@v3 id: fc with: - issue-number: ${{ jobs.parse-metadata.outputs.PR_NUMBER }} + issue-number: ${{ needs.parse-metadata.outputs.PR_NUMBER }} comment-author: 'github-actions[bot]' body-includes: '## Build Preview' - name: Update Comment env: JOB_PATH: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}" - HEAD_SHA: ${{ jobs.parse-metadata.outputs.HEAD_SHA }} - ARTIFACT_URL: ${{ jobs.parse-metadata.outputs.ARTIFACT_URL }} - ARTIFACT_EXP: ${{ jobs.parse-metadata.outputs.ARTIFACT_EXP }} + HEAD_SHA: ${{ needs.parse-metadata.outputs.HEAD_SHA }} + ARTIFACT_URL: ${{ needs.parse-metadata.outputs.ARTIFACT_URL }} + ARTIFACT_EXP: ${{ needs.parse-metadata.outputs.ARTIFACT_EXP }} uses: peter-evans/create-or-update-comment@v4 with: - issue-number: ${{ jobs.parse-metadata.outputs.PR_NUMBER }} + issue-number: ${{ needs.parse-metadata.outputs.PR_NUMBER }} comment-id: ${{ steps.fc.outputs.comment-id }} edit-mode: replace body: |- From ddf5d572d9dc4629f2a21f6d1226dd51cbbe9c46 Mon Sep 17 00:00:00 2001 From: zyxkad Date: Tue, 14 Jan 2025 10:17:36 -0700 Subject: [PATCH 37/57] update pr-comment-artifacts --- .github/workflows/pr-comment-artifacts.yaml | 37 +++++++++++++-------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pr-comment-artifacts.yaml b/.github/workflows/pr-comment-artifacts.yaml index 6d29e128a..3c468be48 100644 --- a/.github/workflows/pr-comment-artifacts.yaml +++ b/.github/workflows/pr-comment-artifacts.yaml @@ -24,6 +24,7 @@ jobs: ARTIFACT_ID: ${{ steps.metadata.outputs.ARTIFACT_ID }} ARTIFACT_URL: ${{ steps.metadata.outputs.ARTIFACT_URL }} ARTIFACT_EXP: ${{ steps.metadata.outputs.ARTIFACT_EXP }} + ARTIFACT_NAME: ${{ steps.metadata.outputs.ARTIFACT_NAME }} steps: - name: Get Artifact URL & PR Info id: metadata @@ -36,40 +37,49 @@ jobs: run: | echo "Previous Job ID: $PREVIOUS_JOB_ID" - gh api "/repos/$OWNER/$REPO/actions/runs/$PREVIOUS_JOB_ID/logs" >logs.zip - unzip -p logs.zip 'Build/*.txt' >build.txt + LOG_URL="/repos/$OWNER/$REPO/actions/runs/$PREVIOUS_JOB_ID/logs" + echo "Getting previous logs: $LOG_URL" + gh api "$LOG_URL" >_logs.zip + echo "Unzipping logs" + unzip -p _logs.zip >_build.txt - function parse_var() { + echo "Parsing logs" + function parse_var { name=$1 - line=$(cat build.txt | grep "output:${name}=") + echo "Parsing output $name" + line=$(cat _build.txt | grep -m 1 "output:${name}=" | cat) export parsed=${line#*"output:${name}="} } parse_var PR_NUMBER PR_NUMBER=$parsed - parse_var HEAD_SHA - HEAD_SHA=$parsed - parse_var ARTIFACT_ID - ARTIFACT_ID=$parsed - parse_var ARTIFACT_URL - ARTIFACT_URL=$parsed - echo "PR Number: $PR_NUMBER" echo "PR_NUMBER=$PR_NUMBER" >> "$GITHUB_OUTPUT" + parse_var HEAD_SHA + HEAD_SHA=$parsed echo "Head sha: $HEAD_SHA" echo "HEAD_SHA=$HEAD_SHA" >> "$GITHUB_OUTPUT" + parse_var ARTIFACT_ID + ARTIFACT_ID=$parsed echo "ARTIFACT ID: $ARTIFACT_ID" echo "ARTIFACT_ID=$ARTIFACT_ID" >> "$GITHUB_OUTPUT" + parse_var ARTIFACT_URL + ARTIFACT_URL=$parsed echo "ARTIFACT URL: $ARTIFACT_URL" echo "ARTIFACT_URL=$ARTIFACT_URL" >> "$GITHUB_OUTPUT" if [[ "$ARTIFACT_ID" != "" ]]; then - ARTIFACT_EXP=$(gh api "/repos/$OWNER/$REPO/actions/artifacts/$ARTIFACT_ID" -jq ".expires_at") + ARTIFACT_INFO="$(gh api "/repos/$OWNER/$REPO/actions/artifacts/$ARTIFACT_ID")" + ARTIFACT_EXP=$(echo "$ARTIFACT_INFO" | jq ".expires_at") echo "ARTIFACT EXP: $ARTIFACT_EXP" echo "ARTIFACT_EXP=$ARTIFACT_EXP" >> "$GITHUB_OUTPUT" + ARTIFACT_NAME=$(echo "$ARTIFACT_INFO" | jq ".name") + echo "ARTIFACT NAME: $ARTIFACT_NAME" + echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> "$GITHUB_OUTPUT" fi + exit 0 comment-success: if: ${{ needs.parse-metadata.outputs.PR_NUMBER != '' }} @@ -91,6 +101,7 @@ jobs: HEAD_SHA: ${{ needs.parse-metadata.outputs.HEAD_SHA }} ARTIFACT_URL: ${{ needs.parse-metadata.outputs.ARTIFACT_URL }} ARTIFACT_EXP: ${{ needs.parse-metadata.outputs.ARTIFACT_EXP }} + ARTIFACT_NAME: ${{ needs.parse-metadata.outputs.ARTIFACT_NAME }} uses: peter-evans/create-or-update-comment@v4 with: issue-number: ${{ needs.parse-metadata.outputs.PR_NUMBER }} @@ -107,7 +118,7 @@ jobs: |-----------|-------------------------| | Commit | ${{ env.HEAD_SHA }} | | Logs | ${{ env.JOB_PATH }} | - ${{ env.ARTIFACT_URL && format('| Jar Files | {0} |', env.ARTIFACT_URL) || '' }} + ${{ env.ARTIFACT_URL && format('| Jar Files | [{0}]({1}) |', env.ARTIFACT_NAME, env.ARTIFACT_URL) || '' }} ${{ env.ARTIFACT_EXP && format('| Expires At | {0} |', env.ARTIFACT_EXP) || '' }} [badge]: https://img.shields.io/badge/${{ format('{0}-{1}', github.event.workflow_run.conclusion, github.event.workflow_run.conclusion == 'success' && '3fb950' || 'f85149') }}?style=for-the-badge&logo=github&label=build From 32c6512c306e3fb3209c5a790870a00a2266b1d8 Mon Sep 17 00:00:00 2001 From: zyxkad Date: Tue, 14 Jan 2025 10:26:33 -0700 Subject: [PATCH 38/57] use raw output --- .github/workflows/pr-comment-artifacts.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-comment-artifacts.yaml b/.github/workflows/pr-comment-artifacts.yaml index 3c468be48..424d186b2 100644 --- a/.github/workflows/pr-comment-artifacts.yaml +++ b/.github/workflows/pr-comment-artifacts.yaml @@ -72,10 +72,10 @@ jobs: if [[ "$ARTIFACT_ID" != "" ]]; then ARTIFACT_INFO="$(gh api "/repos/$OWNER/$REPO/actions/artifacts/$ARTIFACT_ID")" - ARTIFACT_EXP=$(echo "$ARTIFACT_INFO" | jq ".expires_at") + ARTIFACT_EXP=$(echo "$ARTIFACT_INFO" | jq -r ".expires_at") echo "ARTIFACT EXP: $ARTIFACT_EXP" echo "ARTIFACT_EXP=$ARTIFACT_EXP" >> "$GITHUB_OUTPUT" - ARTIFACT_NAME=$(echo "$ARTIFACT_INFO" | jq ".name") + ARTIFACT_NAME=$(echo "$ARTIFACT_INFO" | jq -r ".name") echo "ARTIFACT NAME: $ARTIFACT_NAME" echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> "$GITHUB_OUTPUT" fi From 69d03dc6b7ee5685d0f51cdb152159cf996b8f23 Mon Sep 17 00:00:00 2001 From: Srendi Date: Tue, 14 Jan 2025 19:28:07 +0100 Subject: [PATCH 39/57] Port colony integrator --- build.gradle | 8 +- .../103d9f3f36b01595f1aa5172191e60eff02e6924 | 3 +- .../59eb3dbb5f86130e09b3c62d89b9525ee01cf52d | 3 +- .../9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e | 4 +- .../f95c7003282837dabaa33e3ffceec4e6865b5218 | 6 +- .../blockstates/colony_integrator.json | 57 +++ .../models/block/colony_integrator.json | 9 + .../recipes/redstone/colony_integrator.json | 38 ++ .../pocket_upgrade/colony_pocket.json | 4 + .../loot_table/blocks/colony_integrator.json | 30 ++ .../recipe/colony_integrator.json | 36 ++ .../tags/blocks/mineable/pickaxe.json | 3 +- .../tags/blocks/needs_iron_tool.json | 3 +- .../common/addons/APAddons.java | 3 + .../peripheral/ColonyPeripheral.java | 303 ++++++++++++++ .../pocket/PocketColonyIntegratorUpgrade.java | 27 ++ .../addons/minecolonies/MineColonies.java | 371 ++++++++++++++++++ .../blockentities/ColonyIntegratorEntity.java | 21 + .../data/BlockStatesAndModelsProvider.java | 4 + .../common/data/EnUsLanguageProvider.java | 3 + .../common/data/PocketUpgradesProvider.java | 2 + .../common/data/RecipesProvider.java | 9 + .../common/setup/BlockEntityTypes.java | 2 + .../common/setup/Blocks.java | 1 + .../common/setup/CCRegistration.java | 2 + .../common/util/LuaConverter.java | 7 +- 26 files changed, 944 insertions(+), 15 deletions(-) create mode 100644 src/generated/resources/assets/advancedperipherals/blockstates/colony_integrator.json create mode 100644 src/generated/resources/assets/advancedperipherals/models/block/colony_integrator.json create mode 100644 src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/colony_integrator.json create mode 100644 src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrade/colony_pocket.json create mode 100644 src/generated/resources/data/advancedperipherals/loot_table/blocks/colony_integrator.json create mode 100644 src/generated/resources/data/advancedperipherals/recipe/colony_integrator.json create mode 100644 src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ColonyPeripheral.java create mode 100644 src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketColonyIntegratorUpgrade.java create mode 100644 src/main/java/de/srendi/advancedperipherals/common/addons/minecolonies/MineColonies.java create mode 100644 src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/ColonyIntegratorEntity.java diff --git a/build.gradle b/build.gradle index ebc86d618..60cd4ec88 100644 --- a/build.gradle +++ b/build.gradle @@ -233,10 +233,10 @@ dependencies { // Minecolonies // Remove/Comment this section if you want to use runData. - //runtimeOnly "com.ldtteam:minecolonies:${minecolonies_version}" - //runtimeOnly "com.ldtteam:structurize:${structurize_version}" - //runtimeOnly "com.ldtteam:domum-ornamentum:${domumornamentum_version}" - //runtimeOnly "com.ldtteam:blockui:${blockui_version}" + runtimeOnly "com.ldtteam:minecolonies:${minecolonies_version}" + runtimeOnly "com.ldtteam:structurize:${structurize_version}" + runtimeOnly "com.ldtteam:domum-ornamentum:${domumornamentum_version}" + runtimeOnly "com.ldtteam:blockui:${blockui_version}" compileOnly "com.ldtteam:minecolonies:${minecolonies_version}" compileOnly "com.ldtteam:structurize:${structurize_version}" diff --git a/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 b/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 index b7d3bdd31..d1cded0fa 100644 --- a/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 +++ b/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 @@ -1,5 +1,6 @@ -// 1.21.1 2025-01-13T17:34:41.7633686 Registries +// 1.21.1 2025-01-14T18:51:29.890747 Registries b672635324c0df354e587efc81d0b19a581eae2f data/advancedperipherals/computercraft/pocket_upgrade/chatty_pocket.json +30b8f663613c7ce77048fd69631afcc11a682276 data/advancedperipherals/computercraft/pocket_upgrade/colony_pocket.json d4647159c2f2693a9c5e8d12bf740635751d29a8 data/advancedperipherals/computercraft/pocket_upgrade/environment_pocket.json 8216a0a7d8ebe3ae738c8fc3626df25eb0a2e07a data/advancedperipherals/computercraft/pocket_upgrade/geoscanner_pocket.json a38aa83593f7ad0ace98e01bb3b5f06f272ef734 data/advancedperipherals/computercraft/pocket_upgrade/player_pocket.json diff --git a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d index aaea0c1cf..f4d319548 100644 --- a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d +++ b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d @@ -1,6 +1,7 @@ -// 1.21.1 2025-01-13T17:28:09.7091279 Loot Tables +// 1.21.1 2025-01-14T18:51:29.8897473 Loot Tables 9b54955770745d55de988a86cbd08aa9ae23ff86 data/advancedperipherals/loot_table/blocks/block_reader.json d4f1bc579f83dc67ce9f94d35926d34b8894c990 data/advancedperipherals/loot_table/blocks/chat_box.json +9ac96b8e3da827886d8da459a2f146e8ae3ee798 data/advancedperipherals/loot_table/blocks/colony_integrator.json 6da40a0a9d46855710272fe9d40bb5a7f0219ff2 data/advancedperipherals/loot_table/blocks/energy_detector.json 85cd3af52c824db96403e6fceea480bceda3a186 data/advancedperipherals/loot_table/blocks/environment_detector.json 7f607d7476252b89a57eb4c227cc69f4f28995e3 data/advancedperipherals/loot_table/blocks/geo_scanner.json diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index 1245ad481..7d5df1cf6 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,7 +1,8 @@ -// 1.21.1 2025-01-13T17:28:09.7101266 Recipes +// 1.21.1 2025-01-14T19:12:56.350339 Recipes f5ba1f7d129c88dca1a13c8deaae2d269644c7fa data/advancedperipherals/advancement/recipes/redstone/block_reader.json e172645262ade9fc4a1c999a2c0041711c2eab55 data/advancedperipherals/advancement/recipes/redstone/chat_box.json 213de9a7e340c5eb9c01d82a72e7b58921c5290a data/advancedperipherals/advancement/recipes/redstone/chunk_controller.json +90018942364ec1928abbad8597106d888fa640bd data/advancedperipherals/advancement/recipes/redstone/colony_integrator.json 22a3e69547b1747232ad31eae8421e5e19b99fbe data/advancedperipherals/advancement/recipes/redstone/computer_tool.json 6ceff500825afce815e8e18973f1ad4d67c1fe12 data/advancedperipherals/advancement/recipes/redstone/energy_detector.json a681c8e71de169543d040cb642a73c78c869996a data/advancedperipherals/advancement/recipes/redstone/environment_detector.json @@ -20,6 +21,7 @@ f218420f4c94524614229bb2d50e5c7f8e6beb28 data/advancedperipherals/advancement/re b48e0eed6f4cfbe62c8b7c411e92e3b38ad4e4f9 data/advancedperipherals/recipe/block_reader.json c8d06dd085c0477f94d90f3a5f0800c3efc08d02 data/advancedperipherals/recipe/chat_box.json 8c04e36fa4b88e827a5587990dc4ad94aade2eab data/advancedperipherals/recipe/chunk_controller.json +3c3b7235fbd6c45d8329ee0057e7ddc76fe4c517 data/advancedperipherals/recipe/colony_integrator.json 94d7248693fc9c5f4a307aaa72cc51136d54c7fe data/advancedperipherals/recipe/computer_tool.json 7e16f0709dfe728a5d1c677d3bee4d82bda28895 data/advancedperipherals/recipe/energy_detector.json a276eb3b9827c19ced8123f46a69c1a0e767604f data/advancedperipherals/recipe/environment_detector.json diff --git a/src/generated/resources/.cache/f95c7003282837dabaa33e3ffceec4e6865b5218 b/src/generated/resources/.cache/f95c7003282837dabaa33e3ffceec4e6865b5218 index b3dcc715f..7f7c59f7e 100644 --- a/src/generated/resources/.cache/f95c7003282837dabaa33e3ffceec4e6865b5218 +++ b/src/generated/resources/.cache/f95c7003282837dabaa33e3ffceec4e6865b5218 @@ -1,4 +1,4 @@ -// 1.21.1 2025-01-13T17:28:09.7071281 Block tags -5b2e51f09296cc50686a478ed03bd9debc9a395b data/minecraft/tags/blocks/mineable/pickaxe.json -e9a65cdbf463c5378a799f69539feeae82a3e85e data/minecraft/tags/blocks/needs_iron_tool.json +// 1.21.1 2025-01-14T18:51:29.8886424 Block tags +6566cca83fe6d74441cb2b220aa517b93951dac9 data/minecraft/tags/blocks/mineable/pickaxe.json +5c9d90b6cb82fe772165b794f1eb511db72cb639 data/minecraft/tags/blocks/needs_iron_tool.json e1f71dcb4f9e7e36e29b0ad09d6520dc3adfa4a6 data/neoforge/tags/blocks/needs_wood_tool.json diff --git a/src/generated/resources/assets/advancedperipherals/blockstates/colony_integrator.json b/src/generated/resources/assets/advancedperipherals/blockstates/colony_integrator.json new file mode 100644 index 000000000..22543544e --- /dev/null +++ b/src/generated/resources/assets/advancedperipherals/blockstates/colony_integrator.json @@ -0,0 +1,57 @@ +{ + "variants": { + "orientation=down_east": { + "model": "advancedperipherals:block/colony_integrator", + "x": 90, + "y": 90 + }, + "orientation=down_north": { + "model": "advancedperipherals:block/colony_integrator", + "x": 90 + }, + "orientation=down_south": { + "model": "advancedperipherals:block/colony_integrator", + "x": 90, + "y": 180 + }, + "orientation=down_west": { + "model": "advancedperipherals:block/colony_integrator", + "x": 90, + "y": 270 + }, + "orientation=east_up": { + "model": "advancedperipherals:block/colony_integrator", + "y": 90 + }, + "orientation=north_up": { + "model": "advancedperipherals:block/colony_integrator" + }, + "orientation=south_up": { + "model": "advancedperipherals:block/colony_integrator", + "y": 180 + }, + "orientation=up_east": { + "model": "advancedperipherals:block/colony_integrator", + "x": 270, + "y": 90 + }, + "orientation=up_north": { + "model": "advancedperipherals:block/colony_integrator", + "x": 270 + }, + "orientation=up_south": { + "model": "advancedperipherals:block/colony_integrator", + "x": 270, + "y": 180 + }, + "orientation=up_west": { + "model": "advancedperipherals:block/colony_integrator", + "x": 270, + "y": 270 + }, + "orientation=west_up": { + "model": "advancedperipherals:block/colony_integrator", + "y": 270 + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/advancedperipherals/models/block/colony_integrator.json b/src/generated/resources/assets/advancedperipherals/models/block/colony_integrator.json new file mode 100644 index 000000000..884006124 --- /dev/null +++ b/src/generated/resources/assets/advancedperipherals/models/block/colony_integrator.json @@ -0,0 +1,9 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "advancedperipherals:block/colony_integrator", + "down": "minecraft:block/oak_log_top", + "particle": "advancedperipherals:block/colony_integrator", + "up": "minecraft:block/oak_log_top" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/colony_integrator.json b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/colony_integrator.json new file mode 100644 index 000000000..27dc373d1 --- /dev/null +++ b/src/generated/resources/data/advancedperipherals/advancement/recipes/redstone/colony_integrator.json @@ -0,0 +1,38 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:mod_loaded", + "modid": "minecolonies" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": "advancedperipherals:peripheral_casing" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "advancedperipherals:colony_integrator" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "advancedperipherals:colony_integrator" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrade/colony_pocket.json b/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrade/colony_pocket.json new file mode 100644 index 000000000..7bc588c1d --- /dev/null +++ b/src/generated/resources/data/advancedperipherals/computercraft/pocket_upgrade/colony_pocket.json @@ -0,0 +1,4 @@ +{ + "type": "advancedperipherals:colony_pocket", + "item": "advancedperipherals:colony_integrator" +} \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/loot_table/blocks/colony_integrator.json b/src/generated/resources/data/advancedperipherals/loot_table/blocks/colony_integrator.json new file mode 100644 index 000000000..018188d67 --- /dev/null +++ b/src/generated/resources/data/advancedperipherals/loot_table/blocks/colony_integrator.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], + "name": "advancedperipherals:colony_integrator" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "advancedperipherals:blocks/colony_integrator" +} \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/recipe/colony_integrator.json b/src/generated/resources/data/advancedperipherals/recipe/colony_integrator.json new file mode 100644 index 000000000..4a5e8e785 --- /dev/null +++ b/src/generated/resources/data/advancedperipherals/recipe/colony_integrator.json @@ -0,0 +1,36 @@ +{ + "neoforge:conditions": [ + { + "type": "neoforge:mod_loaded", + "modid": "minecolonies" + } + ], + "type": "minecraft:crafting_shaped", + "category": "redstone", + "key": { + "A": { + "item": "advancedperipherals:peripheral_casing" + }, + "B": { + "item": "minecolonies:build_goggles" + }, + "O": { + "tag": "minecraft:logs" + }, + "R": { + "item": "minecolonies:blockminecoloniesrack" + }, + "S": { + "item": "structurize:sceptergold" + } + }, + "pattern": [ + "ORO", + "BAS", + "ORO" + ], + "result": { + "count": 1, + "id": "advancedperipherals:colony_integrator" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json index ed642e884..7e45c1fe5 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json +++ b/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json @@ -10,6 +10,7 @@ "advancedperipherals:redstone_integrator", "advancedperipherals:block_reader", "advancedperipherals:geo_scanner", - "advancedperipherals:nbt_storage" + "advancedperipherals:nbt_storage", + "advancedperipherals:colony_integrator" ] } \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/blocks/needs_iron_tool.json b/src/generated/resources/data/minecraft/tags/blocks/needs_iron_tool.json index aeb3307c1..785a3def1 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/needs_iron_tool.json +++ b/src/generated/resources/data/minecraft/tags/blocks/needs_iron_tool.json @@ -9,6 +9,7 @@ "advancedperipherals:redstone_integrator", "advancedperipherals:block_reader", "advancedperipherals:geo_scanner", - "advancedperipherals:nbt_storage" + "advancedperipherals:nbt_storage", + "advancedperipherals:colony_integrator" ] } \ No newline at end of file diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java b/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java index e07701c41..449eb8211 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/APAddons.java @@ -14,12 +14,14 @@ public class APAddons { public static final String REFINEDSTORAGETWO_MODID = "refinedstorage2"; public static final String APP_MEKANISTICS_MODID = "appmek"; public static final String PATCHOULI_MODID = "patchouli"; + public static final String MINECOLONIES_MODID = "minecolonies"; public static boolean ae2Loaded; public static boolean curiosLoaded; public static boolean refinedStorageLoaded; public static boolean appMekLoaded; public static boolean patchouliLoaded; + public static boolean minecoloniesLoaded; private APAddons() { } @@ -31,6 +33,7 @@ public static void setup() { refinedStorageLoaded = modList.isLoaded(REFINEDSTORAGETWO_MODID); appMekLoaded = modList.isLoaded(APP_MEKANISTICS_MODID); patchouliLoaded = modList.isLoaded(PATCHOULI_MODID); + minecoloniesLoaded = modList.isLoaded(MINECOLONIES_MODID); } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ColonyPeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ColonyPeripheral.java new file mode 100644 index 000000000..947978734 --- /dev/null +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ColonyPeripheral.java @@ -0,0 +1,303 @@ +package de.srendi.advancedperipherals.common.addons.computercraft.peripheral; + +import com.minecolonies.api.IMinecoloniesAPI; +import com.minecolonies.api.colony.ICivilianData; +import com.minecolonies.api.colony.IColony; +import com.minecolonies.api.colony.IVisitorData; +import com.minecolonies.api.colony.buildings.IBuilding; +import com.minecolonies.api.colony.managers.interfaces.IRegisteredStructureManager; +import com.minecolonies.api.colony.requestsystem.manager.IRequestManager; +import com.minecolonies.api.colony.requestsystem.request.IRequest; +import com.minecolonies.api.colony.requestsystem.requestable.IDeliverable; +import com.minecolonies.api.colony.requestsystem.resolver.player.IPlayerRequestResolver; +import com.minecolonies.api.colony.requestsystem.resolver.retrying.IRetryingRequestResolver; +import com.minecolonies.api.colony.requestsystem.token.IToken; +import com.minecolonies.api.colony.workorders.IWorkOrder; +import com.minecolonies.api.research.IGlobalResearchTree; +import com.mojang.brigadier.exceptions.CommandSyntaxException; +import dan200.computercraft.api.lua.LuaException; +import dan200.computercraft.api.lua.LuaFunction; +import dan200.computercraft.api.pocket.IPocketAccess; +import de.srendi.advancedperipherals.AdvancedPeripherals; +import de.srendi.advancedperipherals.common.addons.APAddons; +import de.srendi.advancedperipherals.common.addons.computercraft.owner.BlockEntityPeripheralOwner; +import de.srendi.advancedperipherals.common.addons.computercraft.owner.IPeripheralOwner; +import de.srendi.advancedperipherals.common.addons.computercraft.owner.PocketPeripheralOwner; +import de.srendi.advancedperipherals.common.addons.minecolonies.MineColonies; +import de.srendi.advancedperipherals.common.blocks.base.PeripheralBlockEntity; +import de.srendi.advancedperipherals.common.configuration.APConfig; +import de.srendi.advancedperipherals.common.util.LuaConverter; +import de.srendi.advancedperipherals.lib.peripherals.BasePeripheral; +import net.minecraft.ChatFormatting; +import net.minecraft.core.BlockPos; +import net.minecraft.resources.ResourceLocation; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +public class ColonyPeripheral extends BasePeripheral { + + public static final String PERIPHERAL_TYPE = "colonyIntegrator"; + + protected boolean hasPermission = true; + + public ColonyPeripheral(PeripheralBlockEntity tileEntity) { + super(PERIPHERAL_TYPE, new BlockEntityPeripheralOwner<>(tileEntity)); + } + + public ColonyPeripheral(IPocketAccess access) { + super(PERIPHERAL_TYPE, new PocketPeripheralOwner(access)); + } + + @Override + public boolean isEnabled() { + return APAddons.minecoloniesLoaded && APConfig.PERIPHERALS_CONFIG.enableColonyIntegrator.get(); + } + + @LuaFunction(mainThread = true) + public final boolean isInColony() { + return getColonyWithoutPermission() != null; + } + + @LuaFunction(mainThread = true) + public final boolean isWithin(Map pos) throws LuaException { + IColony colony = getColonyWithoutPermission(); + + if(colony == null) + return false; + + if (!(pos.containsKey("x") && pos.containsKey("y") && pos.containsKey("z"))) + throw new LuaException("Coordinates expected"); + BlockPos p = new BlockPos(((Number) pos.get("x")).intValue(), ((Number) pos.get("y")).intValue(), ((Number) pos.get("z")).intValue()); + + return colony.isCoordInColony(this.getLevel(), p); + } + + @LuaFunction(mainThread = true) + public final Object getCitizens() throws LuaException { + IColony colony = getColony(); + + List list = new ArrayList<>(); + colony.getCitizenManager().getCitizens().forEach(citizen -> { + list.add(MineColonies.citizenToObject(citizen)); + }); + + return list; + } + + @LuaFunction(mainThread = true) + public final int amountOfConstructionSites() throws LuaException { + return MineColonies.getAmountOfConstructionSites(getColony()); + } + + @LuaFunction(mainThread = true) + public final int getColonyID() throws LuaException { + IColony colony = getColony(); + + return colony.getID(); + } + + @LuaFunction(mainThread = true) + public final String getColonyName() throws LuaException { + IColony colony = getColony(); + + return colony.getName(); + } + + @LuaFunction(mainThread = true) + public final String getColonyStyle() throws LuaException { + IColony colony = getColony(); + + return colony.getStructurePack(); + } + + @LuaFunction(mainThread = true) + public final boolean isActive() throws LuaException { + IColony colony = getColony(); + + return colony.isActive(); + } + + @LuaFunction(mainThread = true) + public final double getHappiness() throws LuaException { + IColony colony = getColony(); + + return colony.getOverallHappiness(); + } + + @LuaFunction(mainThread = true) + public final Object getLocation() throws LuaException { + IColony colony = getColony(); + + return LuaConverter.posToObject(colony.getCenter()); + } + + @LuaFunction(mainThread = true) + public final boolean isUnderAttack() throws LuaException { + IColony colony = getColony(); + + return colony.isColonyUnderAttack(); + } + + @LuaFunction(mainThread = true) + public final boolean isUnderRaid() throws LuaException { + IColony colony = getColony(); + + return colony.getRaiderManager().isRaided(); + } + + @LuaFunction(mainThread = true) + public final int amountOfCitizens() throws LuaException { + IColony colony = getColony(); + + return colony.getCitizenManager().getCurrentCitizenCount(); + } + + @LuaFunction(mainThread = true) + public final int maxOfCitizens() throws LuaException { + IColony colony = getColony(); + + return colony.getCitizenManager().getMaxCitizens(); + } + + @LuaFunction(mainThread = true) + public final int amountOfGraves() throws LuaException { + IColony colony = getColony(); + + return colony.getGraveManager().getGraves().size(); + } + + @LuaFunction(mainThread = true) + public final Object getVisitors() throws LuaException { + IColony colony = getColony(); + + List list = new ArrayList<>(); + for (ICivilianData civilian : colony.getVisitorManager().getCivilianDataMap().values()) { + if (!(civilian instanceof IVisitorData visitorData)) + continue; + list.add(MineColonies.visitorToObject(visitorData)); + } + return list; + } + + @LuaFunction(mainThread = true) + public final Object getBuildings() throws LuaException { + IColony colony = getColony(); + + IRegisteredStructureManager manager = colony.getBuildingManager(); + List buildingData = new ArrayList<>(); + for (Map.Entry building : manager.getBuildings().entrySet()) { + buildingData.add(MineColonies.buildingToObject(manager, building.getValue(), building.getKey())); + } + + return buildingData; + } + + @LuaFunction(mainThread = true) + public final Object getWorkOrders() throws LuaException { + IColony colony = getColony(); + + List worksData = new ArrayList<>(); + for (IWorkOrder workOrder : colony.getWorkManager().getWorkOrders().values()) + worksData.add(MineColonies.workOrderToObject(workOrder)); + + return worksData; + } + + @LuaFunction(mainThread = true) + public final Object getResearch() throws LuaException { + IColony colony = getColony(); + + IGlobalResearchTree globalTree = IGlobalResearchTree.getInstance(); + + Map result = new HashMap<>(); + for (ResourceLocation branch : globalTree.getBranches()) { + try { + result.put(branch.toString(), MineColonies.getResearch(branch, globalTree.getPrimaryResearch(branch), colony)); + } catch (CommandSyntaxException ex) { + AdvancedPeripherals.debug("Error getting research for branch " + branch + ": " + ex.getMessage(), org.apache.logging.log4j.Level.WARN); + ex.printStackTrace(); + } + } + + return result; + } + + @LuaFunction(mainThread = true) + public final Object getWorkOrderResources(int id) throws LuaException { + IColony colony = getColony(); + + IWorkOrder workOrder = colony.getWorkManager().getWorkOrder(id); + if (workOrder == null) return null; + + return MineColonies.builderResourcesToObject(colony, workOrder.getClaimedBy()); + } + + @LuaFunction(mainThread = true) + public final Object getBuilderResources(Map pos) throws LuaException { + IColony colony = getColony(); + + if (!(pos.containsKey("x") && pos.containsKey("y") && pos.containsKey("z"))) + throw new LuaException("Coordinates expected"); + BlockPos blockPos = LuaConverter.convertToBlockPos(pos); + + return MineColonies.builderResourcesToObject(colony, blockPos); + } + + @LuaFunction(mainThread = true) + public final Object getRequests() throws LuaException { + IColony colony = getColony(); + + IRequestManager requestManager = colony.getRequestManager(); + //All requests assigned to players + IPlayerRequestResolver playerResolver = requestManager.getPlayerResolver(); + //All requests not assigned to players + IRetryingRequestResolver requestResolver = requestManager.getRetryingRequestResolver(); + + Set> tokens = new HashSet<>(); + tokens.addAll(playerResolver.getAllAssignedRequests()); + tokens.addAll(requestResolver.getAllAssignedRequests()); + + List> requests = new ArrayList<>(); + for (IToken token : tokens) { + IRequest request = requestManager.getRequestForToken(token); + if (request.getRequest() instanceof IDeliverable) + requests.add(request); + } + + List result = new ArrayList<>(); + requests.forEach(request -> { + IDeliverable deliverableRequest = (IDeliverable) request.getRequest(); + Map map = new HashMap<>(); + map.put("id", request.getId().getIdentifier().toString()); + map.put("name", ChatFormatting.stripFormatting(request.getShortDisplayString().getString())); + map.put("desc", ChatFormatting.stripFormatting(request.getLongDisplayString().getString())); + map.put("state", request.getState().toString()); + map.put("count", deliverableRequest.getCount()); + map.put("minCount", deliverableRequest.getMinimumCount()); + map.put("items", request.getDisplayStacks().stream().map(LuaConverter::stackToObject).collect(Collectors.toList())); + map.put("target", request.getRequester().getRequesterDisplayName(requestManager, request).getString()); + result.add(map); + }); + return result; + } + + private IColony getColony() throws LuaException { + IMinecoloniesAPI api = IMinecoloniesAPI.getInstance(); + IColony colony = api.getColonyManager().getColonyByPosFromWorld(getLevel(), getPos()); + this.hasPermission = !(owner instanceof PocketPeripheralOwner) || MineColonies.hasAccess(owner.getOwner(), colony); + if (colony == null || !this.hasPermission) + throw new LuaException("Here is no colony or you don't have the right permissions"); + return colony; + } + + private IColony getColonyWithoutPermission() { + IMinecoloniesAPI api = IMinecoloniesAPI.getInstance(); + return api.getColonyManager().getColonyByPosFromWorld(getLevel(), getPos()); + } +} diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketColonyIntegratorUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketColonyIntegratorUpgrade.java new file mode 100644 index 000000000..8dbd9ca92 --- /dev/null +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketColonyIntegratorUpgrade.java @@ -0,0 +1,27 @@ +package de.srendi.advancedperipherals.common.addons.computercraft.pocket; + +import dan200.computercraft.api.pocket.IPocketAccess; +import dan200.computercraft.api.pocket.IPocketUpgrade; +import dan200.computercraft.api.upgrades.UpgradeType; +import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.ColonyPeripheral; +import de.srendi.advancedperipherals.common.setup.CCRegistration; +import de.srendi.advancedperipherals.lib.pocket.BasePocketUpgrade; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; + +public class PocketColonyIntegratorUpgrade extends BasePocketUpgrade { + + public PocketColonyIntegratorUpgrade(ItemStack stack) { + super(CCRegistration.ID.COLONY_POCKET, stack); + } + + @Override + protected ColonyPeripheral getPeripheral(IPocketAccess access) { + return new ColonyPeripheral(access); + } + + @Override + public UpgradeType getType() { + return CCRegistration.COLONY_POCKET.get(); + } +} diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/minecolonies/MineColonies.java b/src/main/java/de/srendi/advancedperipherals/common/addons/minecolonies/MineColonies.java new file mode 100644 index 000000000..8d60caa3c --- /dev/null +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/minecolonies/MineColonies.java @@ -0,0 +1,371 @@ +package de.srendi.advancedperipherals.common.addons.minecolonies; + +import com.minecolonies.api.colony.ICitizenData; +import com.minecolonies.api.colony.IColony; +import com.minecolonies.api.colony.IVisitorData; +import com.minecolonies.api.colony.buildings.IBuilding; +import com.minecolonies.api.colony.jobs.IJob; +import com.minecolonies.api.colony.managers.interfaces.IRegisteredStructureManager; +import com.minecolonies.api.colony.permissions.Action; +import com.minecolonies.api.colony.workorders.IWorkOrder; +import com.minecolonies.api.entity.citizen.Skill; +import com.minecolonies.api.research.IGlobalResearch; +import com.minecolonies.api.research.IGlobalResearchTree; +import com.minecolonies.api.research.ILocalResearch; +import com.minecolonies.api.research.ILocalResearchTree; +import com.minecolonies.api.research.IResearchRequirement; +import com.minecolonies.api.research.effects.IResearchEffect; +import com.minecolonies.api.research.util.ResearchState; +import com.minecolonies.core.colony.buildings.AbstractBuildingStructureBuilder; +import com.minecolonies.core.colony.buildings.utils.BuildingBuilderResource; +import com.minecolonies.core.entity.citizen.citizenhandlers.CitizenSkillHandler; +import com.minecolonies.core.research.BuildingResearchRequirement; +import com.mojang.brigadier.exceptions.CommandSyntaxException; +import de.srendi.advancedperipherals.common.util.LuaConverter; +import io.netty.buffer.Unpooled; +import net.minecraft.core.BlockPos; +import net.minecraft.network.Connection; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.ai.attributes.Attributes; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.neoforged.neoforge.common.crafting.SizedIngredient; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.network.connection.ConnectionType; +import net.neoforged.neoforge.server.ServerLifecycleHooks; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; + +public class MineColonies { + + /** + * To ensure that the user of a pocket computer has the appropriate rights. + * + * @param entity the user of the pocket computer + * @param colony the colony where the user is in it + * @return true if the user has the appropriate rights + */ + public static boolean hasAccess(Entity entity, IColony colony) { + if (entity instanceof Player player) { + if (colony != null) { + return colony.getPermissions().hasPermission(player, Action.ACCESS_HUTS); + } + } + return false; + } + + /** + * Converts a citizen to a map + * + * @param citizen the citizen + * @return a map with information about the citizen + */ + public static Object citizenToObject(ICitizenData citizen) { + Map map = new HashMap<>(); + map.put("id", citizen.getId()); + map.put("name", citizen.getName()); + map.put("bedPos", LuaConverter.posToObject(citizen.getBedPos())); + map.put("children", citizen.getChildren()); + map.put("location", LuaConverter.posToObject(citizen.getLastPosition())); + map.put("state", citizen.getStatus() == null ? "Idle" : Component.translatable(citizen.getStatus().getTranslationKey()).getString()); + map.put("age", citizen.isChild() ? "child" : "adult"); + map.put("gender", citizen.isFemale() ? "female" : "male"); + map.put("saturation", citizen.getSaturation()); + map.put("happiness", citizen.getCitizenHappinessHandler().getHappiness(citizen.getColony(), citizen)); + map.put("skills", skillsToObject(citizen.getCitizenSkillHandler().getSkills())); + map.put("work", citizen.getWorkBuilding() == null ? null : jobToObject(citizen.getWorkBuilding(), citizen.getJob())); + map.put("home", citizen.getHomeBuilding() == null ? null : homeToObject(citizen.getHomeBuilding())); + map.put("betterFood", citizen.needsBetterFood()); + map.put("isAsleep", map.get("state").toString().toLowerCase().contains("sleeping")); + map.put("isIdle", map.get("state").toString().toLowerCase().contains("idle")); + citizen.getEntity().ifPresent(entity -> { + map.put("health", entity.getHealth()); + map.put("maxHealth", entity.getMaxHealth()); + map.put("armor", entity.getAttributeValue(Attributes.ARMOR)); + map.put("toughness", entity.getAttributeValue(Attributes.ARMOR_TOUGHNESS)); + }); + + return map; + } + + /** + * Converts a visitor {@link IVisitorData} to a map + * + * @param visitor the visitor + * @return a map with information about the visitor + */ + public static Object visitorToObject(IVisitorData visitor) { + Map map = new HashMap<>(); + map.put("id", visitor.getId()); + map.put("name", visitor.getName()); + map.put("location", LuaConverter.posToObject(visitor.getSittingPosition())); + map.put("age", visitor.isChild() ? "child" : "adult"); + map.put("gender", visitor.isFemale() ? "female" : "male"); + map.put("saturation", visitor.getSaturation()); + map.put("happiness", visitor.getCitizenHappinessHandler().getHappiness(visitor.getColony(), visitor)); + map.put("skills", skillsToObject(visitor.getCitizenSkillHandler().getSkills())); + map.put("recruitCost", LuaConverter.stackToObject(visitor.getRecruitCost())); + + return map; + } + + /** + * Converts a building {@link IBuilding} and job {@link IJob} to a map + * + * @param work the home building + * @param job the job + * @return a map with information about the building and job + */ + public static Object jobToObject(IBuilding work, IJob job) { + Map map = new HashMap<>(); + map.put("location", LuaConverter.posToObject(work.getLocation().getInDimensionLocation())); + map.put("type", work.getSchematicName()); + map.put("level", work.getBuildingLevel()); + map.put("name", work.getBuildingDisplayName()); + map.put("job", job.getJobRegistryEntry().getTranslationKey()); + + return map; + } + + /** + * Converts a home {@link IBuilding} to a map + * + * @param home the home building + * @return a map with information about the home building + */ + public static Object homeToObject(IBuilding home) { + Map map = new HashMap<>(); + map.put("location", LuaConverter.posToObject(home.getLocation().getInDimensionLocation())); + map.put("type", home.getSchematicName()); + map.put("level", home.getBuildingLevel()); + + return map; + } + + /** + * Converts a skill {@link Skill} into a map + * + * @param skills skills as list. Can be obtained via {@link ICitizenData#getCitizenSkillHandler} + * @return a map with information about the skill + */ + public static Object skillsToObject(Map skills) { + Map map = new HashMap<>(); + for (Skill skill : skills.keySet()) { + Map skillData = new HashMap<>(); + skillData.put("level", skills.get(skill).getLevel()); + skillData.put("xp", skills.get(skill).getExperience()); + map.put(skill.name(), skillData); + } + + return map; + } + + /** + * Returns information about the building like structure data, the citizens and some other values + * + * @param buildingManager The building manager of the colony + * @param building The building as instance + * @param pos The location of the buildings block + * @return information about the building + */ + public static Object buildingToObject(IRegisteredStructureManager buildingManager, IBuilding building, BlockPos pos) { + Map structureData = new HashMap<>(); + structureData.put("cornerA", LuaConverter.posToObject(building.getCorners().getA())); + structureData.put("cornerB", LuaConverter.posToObject(building.getCorners().getB())); + structureData.put("rotation", building.getRotationMirror().toString()); + structureData.put("mirror", building.getRotationMirror().isMirrored()); + + List citizensData = new ArrayList<>(); + for (ICitizenData citizen : building.getAllAssignedCitizen()) { + Map citizenData = new HashMap<>(); + citizenData.put("id", citizen.getId()); + citizenData.put("name", citizen.getName()); + citizensData.add(citizenData); + } + + Map map = new HashMap<>(); + map.put("location", LuaConverter.posToObject(pos)); + map.put("type", building.getSchematicName()); + map.put("style", building.getStructurePack()); + map.put("level", building.getBuildingLevel()); + map.put("maxLevel", building.getMaxBuildingLevel()); + map.put("name", building.getBuildingDisplayName()); + map.put("built", building.isBuilt()); + map.put("isWorkingOn", building.hasWorkOrder()); + map.put("priority", building.getPickUpPriority()); + map.put("structure", structureData); + map.put("citizens", citizensData); + map.put("storageBlocks", building.getContainers().size()); + map.put("storageSlots", getStorageSize(building)); + map.put("guarded", buildingManager.hasGuardBuildingNear(building)); + + return map; + } + + /** + * Returns the size of all inventories in this building + * + * @param building the proper building with racks(Or other inventories) + * @return the size of all inventories in this building + */ + public static int getStorageSize(IBuilding building) { + int size = 0; + + for (IItemHandler itemHandler : building.getHandlers()) { + size += itemHandler.getSlots(); + } + + return size; + } + + public static int getAmountOfConstructionSites(IColony colony) { + int constructionSites = 0; + for (IBuilding building : colony.getBuildingManager().getBuildings().values()) { + if (building.hasWorkOrder()) + constructionSites++; + } + + return constructionSites; + } + + public static Object workOrderToObject(IWorkOrder workOrder) { + Map map = new HashMap<>(); + + map.put("builder", LuaConverter.posToObject(workOrder.getClaimedBy())); + map.put("changed", workOrder.isDirty()); + map.put("id", workOrder.getID()); + map.put("priority", workOrder.getPriority()); + map.put("isClaimed", workOrder.isClaimed()); + map.put("location", LuaConverter.posToObject(workOrder.getLocation())); + map.put("type", workOrder.getClass().getSimpleName()); + map.put("buildingName", workOrder.getDisplayName().getString()); + map.put("targetLevel", workOrder.getTargetLevel()); + map.put("workOrderType", workOrder.getWorkOrderType().toString()); + + return map; + } + + /** + * Returns a list with all possible researches + * + * @param branch The branch, there are only a few branches + * @param researches The primary researches of the branch + * @param colony The colony + * @return a list including maps with all possible researches + */ + public static List getResearch(ResourceLocation branch, List researches, IColony colony) throws CommandSyntaxException { + List result = new ArrayList<>(); + if (researches != null) { + for (ResourceLocation researchName : researches) { + //All global possible researches + IGlobalResearchTree globalTree = IGlobalResearchTree.getInstance(); + //The research tree of the colony + ILocalResearchTree colonyTree = colony.getResearchManager().getResearchTree(); + + IGlobalResearch research = globalTree.getResearch(branch, researchName); + if (research == null) + continue; + if (research.isHidden()) + continue; + ILocalResearch colonyResearch = colonyTree.getResearch(branch, researchName); + + List effects = new ArrayList<>(); + for (IResearchEffect researchEffect : research.getEffects()) + effects.add(Component.translatable(researchEffect.getDesc().getKey(), researchEffect.getDesc().getArgs()).getString()); + + List> cost = new ArrayList<>(); + for (SizedIngredient item : research.getCostList()) { + Map researchCost = new HashMap<>(); + List> researchCostItems = new ArrayList<>(); + + for (ItemStack costItem : item.getItems()) + researchCostItems.add(LuaConverter.stackToObject(costItem)); + + researchCost.put("validItems", researchCostItems); + researchCost.put("count", item.count()); + //researchCost.put("", item.getType().getId().toString()); + + cost.add(researchCost); + } + + List> requirements = new ArrayList<>(); + for (IResearchRequirement requirement : research.getResearchRequirement()) { + Map requirementItem = new HashMap<>(); + requirementItem.put("fulfilled", requirement.isFulfilled(colony)); + if (requirement instanceof BuildingResearchRequirement buildingRequirement) { + requirementItem.put("type", "building"); + requirementItem.put("building", buildingRequirement.getBuilding()); + requirementItem.put("level", buildingRequirement.getBuildingLevel()); + } else { + requirementItem.put("type", requirement.getClass().getCanonicalName()); + } + requirementItem.put("desc", requirement.getDesc().getString()); + requirements.add(requirementItem); + } + + Map map = new HashMap<>(); + map.put("id", researchName.toString()); + map.put("name", Component.translatable(research.getName().getKey(), research.getName().getArgs()).getString()); + map.put("requirements", requirements); + map.put("cost", cost); + map.put("researchEffects", effects); + map.put("status", colonyResearch == null ? ResearchState.NOT_STARTED.toString() : colonyResearch.getState().toString()); + map.put("neededTime", colonyResearch == null ? 0 : IGlobalResearchTree.getInstance().getBranchData(colonyResearch.getBranch()).getBaseTime(colonyResearch.getDepth())); + map.put("progress", colonyResearch == null ? 0 : colonyResearch.getProgress()); + + List childrenResearch = getResearch(branch, research.getChildren(), colony); + if (!childrenResearch.isEmpty()) + map.put("children", childrenResearch); + + result.add(map); + } + } + return result; + } + + /** + * Returns the resources(As items) which the builder needs + * + * @param colony The colony + * @param pos The position of the builder's hut block + * @return a map with all needed resources + */ + public static Object builderResourcesToObject(IColony colony, BlockPos pos) { + IBuilding building = colony.getBuildingManager().getBuilding(pos); + if (!(building instanceof AbstractBuildingStructureBuilder builderBuilding)) + return null; + + //We need to tell the building that we want information about it + RegistryFriendlyByteBuf buffer = new RegistryFriendlyByteBuf(Unpooled.buffer(), colony.getWorld().registryAccess(), ConnectionType.OTHER); + builderBuilding.serializeToView(buffer, false); + buffer.release(); + + List resources = new ArrayList<>(builderBuilding.getNeededResources().values()); + resources.sort(new BuildingBuilderResource.ResourceComparator()); + + List result = new ArrayList<>(); + for (BuildingBuilderResource resource : resources) { + Map map = new HashMap<>(); + ItemStack stack = resource.getItemStack().copy(); + + map.put("item", LuaConverter.stackToObject(stack)); + map.put("displayName", resource.getName()); + map.put("available", resource.getAvailable()); + map.put("delivering", resource.getAmountInDelivery()); + map.put("status", resource.getAvailabilityStatus().toString()); + map.put("needed", resource.getAmount()); + result.add(map); + } + + return result; + } + +} diff --git a/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/ColonyIntegratorEntity.java b/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/ColonyIntegratorEntity.java new file mode 100644 index 000000000..8c6504791 --- /dev/null +++ b/src/main/java/de/srendi/advancedperipherals/common/blocks/blockentities/ColonyIntegratorEntity.java @@ -0,0 +1,21 @@ +package de.srendi.advancedperipherals.common.blocks.blockentities; + +import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.ColonyPeripheral; +import de.srendi.advancedperipherals.common.blocks.base.PeripheralBlockEntity; +import de.srendi.advancedperipherals.common.setup.BlockEntityTypes; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.state.BlockState; +import org.jetbrains.annotations.NotNull; + +public class ColonyIntegratorEntity extends PeripheralBlockEntity { + + public ColonyIntegratorEntity(BlockPos pos, BlockState state) { + super(BlockEntityTypes.COLONY_INTEGRATOR.get(), pos, state); + } + + @NotNull + @Override + protected ColonyPeripheral createPeripheral() { + return new ColonyPeripheral(this); + } +} diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/BlockStatesAndModelsProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/BlockStatesAndModelsProvider.java index 11e3a6bac..65591a348 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/BlockStatesAndModelsProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/BlockStatesAndModelsProvider.java @@ -34,6 +34,10 @@ protected void registerStatesAndModels() { peripheralBlock(Blocks.REDSTONE_INTEGRATOR.get(), "front"); peripheralBlock(Blocks.BLOCK_READER.get(), generateModel(Blocks.BLOCK_READER.get(), false, "north", "south", "east", "west", "up", "down")); peripheralBlock(Blocks.GEO_SCANNER.get(), "front"); + peripheralBlock(Blocks.COLONY_INTEGRATOR.get(), generateModel(Blocks.COLONY_INTEGRATOR.get()) + .texture("particle", blockTexture(Blocks.COLONY_INTEGRATOR.get())) + .texture("up", blockTexture(net.minecraft.world.level.block.Blocks.OAK_LOG, "top")) + .texture("down", blockTexture(net.minecraft.world.level.block.Blocks.OAK_LOG, "top"))); peripheralBlock(Blocks.NBT_STORAGE.get(), "front"); } diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/EnUsLanguageProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/EnUsLanguageProvider.java index 46ec81bd5..2dd231d0c 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/EnUsLanguageProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/EnUsLanguageProvider.java @@ -54,6 +54,7 @@ private void addItems() { private void addBlocks() { addBlock(Blocks.BLOCK_READER, "Block Reader"); addBlock(Blocks.CHAT_BOX, "Chat Box"); + addBlock(Blocks.COLONY_INTEGRATOR, "Colony Integrator"); addBlock(Blocks.ENERGY_DETECTOR, "Energy Detector"); addBlock(Blocks.ENVIRONMENT_DETECTOR, "Environment Detector"); addBlock(Blocks.GEO_SCANNER, "Geo Scanner"); @@ -81,6 +82,7 @@ private void addTurtles() { } private void addPockets() { + addPocket(CCRegistration.ID.COLONY_POCKET, "Colony"); addPocket(CCRegistration.ID.COLONY_POCKET, "Colony"); addPocket(CCRegistration.ID.CHATTY_POCKET, "Chatty"); addPocket(CCRegistration.ID.ENVIRONMENT_POCKET, "Environment"); @@ -116,6 +118,7 @@ private void addTooltips() { addTooltip(Blocks.REDSTONE_INTEGRATOR.get(), "&7This block is able to interact with redstone. Works exactly like the redstone api of an computer."); addTooltip(Blocks.BLOCK_READER.get(), "&7Reads nbt data of blocks to interact with blocks which do not have computer support."); addTooltip(Blocks.GEO_SCANNER.get(), "&7Scans the area around it to find some shiny ores."); + addTooltip(Blocks.COLONY_INTEGRATOR.get(), "&7Interacts with Minecolonies to read data about your colony and citizens."); addTooltip(Blocks.NBT_STORAGE.get(), "&7Acts like a storage disk. Can store nbt based data."); addTooltip(Items.WEAK_AUTOMATA_CORE.get(), "&7Upgrade for turtles, which makes turtles more useful."); addTooltip(Items.OVERPOWERED_WEAK_AUTOMATA_CORE.get(), "&7Improved version of the weak automata core, that provides some overpowered uses! Be careful, the upgrade is very fragile."); diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java index e5c500824..13d7e35f7 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/PocketUpgradesProvider.java @@ -2,6 +2,7 @@ import dan200.computercraft.api.pocket.IPocketUpgrade; import de.srendi.advancedperipherals.common.addons.computercraft.pocket.PocketChatBoxUpgrade; +import de.srendi.advancedperipherals.common.addons.computercraft.pocket.PocketColonyIntegratorUpgrade; import de.srendi.advancedperipherals.common.addons.computercraft.pocket.PocketEnvironmentUpgrade; import de.srendi.advancedperipherals.common.addons.computercraft.pocket.PocketGeoScannerUpgrade; import de.srendi.advancedperipherals.common.addons.computercraft.pocket.PocketPlayerDetectorUpgrade; @@ -19,6 +20,7 @@ public static void addUpgrades(BootstrapContext upgrades) { upgrades.register(id(CCRegistration.ID.PLAYER_POCKET), new PocketPlayerDetectorUpgrade(new ItemStack(Blocks.PLAYER_DETECTOR.get()))); upgrades.register(id(CCRegistration.ID.ENVIRONMENT_POCKET), new PocketEnvironmentUpgrade(new ItemStack(Blocks.ENVIRONMENT_DETECTOR.get()))); upgrades.register(id(CCRegistration.ID.GEOSCANNER_POCKET), new PocketGeoScannerUpgrade(new ItemStack(Blocks.GEO_SCANNER.get()))); + upgrades.register(id(CCRegistration.ID.COLONY_POCKET), new PocketColonyIntegratorUpgrade(new ItemStack(Blocks.COLONY_INTEGRATOR.get()))); } public static ResourceKey id(ResourceLocation id) { diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/RecipesProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/RecipesProvider.java index 0ce6f1ad9..0b3f279bc 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/RecipesProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/RecipesProvider.java @@ -1,9 +1,13 @@ package de.srendi.advancedperipherals.common.data; import appeng.core.definitions.AEBlocks; +import com.minecolonies.api.blocks.ModBlocks; +import com.minecolonies.api.items.ModItems; import dan200.computercraft.shared.ModRegistry; +import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.addons.APAddons; import de.srendi.advancedperipherals.common.setup.Blocks; +import de.srendi.advancedperipherals.common.util.RawValue; import net.minecraft.core.HolderLookup; import net.minecraft.core.component.DataComponents; import net.minecraft.data.PackOutput; @@ -12,17 +16,20 @@ import net.minecraft.data.recipes.RecipeProvider; import net.minecraft.data.recipes.ShapedRecipeBuilder; import net.minecraft.data.recipes.ShapelessRecipeBuilder; +import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.ItemTags; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.alchemy.PotionContents; import net.minecraft.world.item.alchemy.Potions; +import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.block.Block; import net.neoforged.neoforge.common.Tags; import net.neoforged.neoforge.common.conditions.IConditionBuilder; import net.neoforged.neoforge.common.conditions.ModLoadedCondition; import java.util.concurrent.CompletableFuture; +import java.util.stream.Stream; public class RecipesProvider extends RecipeProvider implements IConditionBuilder { @@ -66,6 +73,8 @@ protected void buildRecipes(RecipeOutput recipeOutput) { ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, Blocks.ME_BRIDGE.get()).define('F', AEBlocks.FLUIX_BLOCK.asItem()).define('A', CASING).define('I', AEBlocks.INTERFACE.asItem()).pattern("FIF").pattern("IAI").pattern("FIF").unlockedBy(HAS_ITEM, has(CASING)).save(recipeOutput.withConditions(new ModLoadedCondition(APAddons.AE2_MODID))); + ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, Blocks.COLONY_INTEGRATOR.get()).define('O', ItemTags.LOGS).define('A', CASING).define('B', ModItems.buildGoggles).define('S', com.ldtteam.structurize.items.ModItems.buildTool).define('R', ModBlocks.blockRack).pattern("ORO").pattern("BAS").pattern("ORO").unlockedBy(HAS_ITEM, has(CASING)).save(recipeOutput.withConditions(new ModLoadedCondition(APAddons.MINECOLONIES_MODID))); + ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, de.srendi.advancedperipherals.common.setup.Items.WEAK_AUTOMATA_CORE.get()) .define('A', CASING) .define('R', Tags.Items.STORAGE_BLOCKS_REDSTONE) diff --git a/src/main/java/de/srendi/advancedperipherals/common/setup/BlockEntityTypes.java b/src/main/java/de/srendi/advancedperipherals/common/setup/BlockEntityTypes.java index 67a2fba5d..f2fc2fcfe 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/setup/BlockEntityTypes.java +++ b/src/main/java/de/srendi/advancedperipherals/common/setup/BlockEntityTypes.java @@ -4,6 +4,7 @@ import de.srendi.advancedperipherals.common.addons.APAddons; import de.srendi.advancedperipherals.common.blocks.blockentities.BlockReaderEntity; import de.srendi.advancedperipherals.common.blocks.blockentities.ChatBoxEntity; +import de.srendi.advancedperipherals.common.blocks.blockentities.ColonyIntegratorEntity; import de.srendi.advancedperipherals.common.blocks.blockentities.EnergyDetectorEntity; import de.srendi.advancedperipherals.common.blocks.blockentities.EnvironmentDetectorEntity; import de.srendi.advancedperipherals.common.blocks.blockentities.GeoScannerEntity; @@ -24,6 +25,7 @@ public class BlockEntityTypes { public static final DeferredHolder, BlockEntityType> ENERGY_DETECTOR = Registration.BLOCK_ENTITIES.register("energy_detector", () -> new BlockEntityType<>(EnergyDetectorEntity::new, Sets.newHashSet(Blocks.ENERGY_DETECTOR.get()), null)); public static final DeferredHolder, BlockEntityType> INVENTORY_MANAGER = Registration.BLOCK_ENTITIES.register("inventory_manager", () -> new BlockEntityType<>(InventoryManagerEntity::new, Sets.newHashSet(Blocks.INVENTORY_MANAGER.get()), null)); public static final DeferredHolder, BlockEntityType> REDSTONE_INTEGRATOR = Registration.BLOCK_ENTITIES.register("redstone_integrator", () -> new BlockEntityType<>(RedstoneIntegratorEntity::new, Sets.newHashSet(Blocks.REDSTONE_INTEGRATOR.get()), null)); + public static final DeferredHolder, BlockEntityType> COLONY_INTEGRATOR = Registration.BLOCK_ENTITIES.register("colony_integrator", () -> new BlockEntityType<>(ColonyIntegratorEntity::new, Sets.newHashSet(Blocks.COLONY_INTEGRATOR.get()), null)); public static final DeferredHolder, BlockEntityType> BLOCK_READER = Registration.BLOCK_ENTITIES.register("block_reader", () -> new BlockEntityType<>(BlockReaderEntity::new, Sets.newHashSet(Blocks.BLOCK_READER.get()), null)); public static final DeferredHolder, BlockEntityType> GEO_SCANNER = Registration.BLOCK_ENTITIES.register("geo_scanner", () -> new BlockEntityType<>(GeoScannerEntity::new, Sets.newHashSet(Blocks.GEO_SCANNER.get()), null)); public static final DeferredHolder, BlockEntityType> NBT_STORAGE = Registration.BLOCK_ENTITIES.register("nbt_storage", () -> new BlockEntityType<>(NBTStorageEntity::new, Sets.newHashSet(Blocks.NBT_STORAGE.get()), null)); diff --git a/src/main/java/de/srendi/advancedperipherals/common/setup/Blocks.java b/src/main/java/de/srendi/advancedperipherals/common/setup/Blocks.java index cc32b4a43..52de7d557 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/setup/Blocks.java +++ b/src/main/java/de/srendi/advancedperipherals/common/setup/Blocks.java @@ -30,6 +30,7 @@ public class Blocks { public static final DeferredHolder> BLOCK_READER = register("block_reader", () -> new APBlockEntityBlock<>(BlockEntityTypes.BLOCK_READER, true), () -> new APBlockItem(Blocks.BLOCK_READER.get(), APConfig.PERIPHERALS_CONFIG.enableBlockReader::get)); public static final DeferredHolder> GEO_SCANNER = register("geo_scanner", () -> new APBlockEntityBlock<>(BlockEntityTypes.GEO_SCANNER, false), () -> new APBlockItem(Blocks.GEO_SCANNER.get(), APConfig.PERIPHERALS_CONFIG.enableGeoScanner::get)); public static final DeferredHolder> NBT_STORAGE = register("nbt_storage", () -> new APBlockEntityBlock<>(BlockEntityTypes.NBT_STORAGE, false), () -> new APBlockItem(Blocks.NBT_STORAGE.get(), APConfig.PERIPHERALS_CONFIG.enableNBTStorage::get)); + public static final DeferredHolder> COLONY_INTEGRATOR = register("colony_integrator", () -> new APBlockEntityBlock<>(BlockEntityTypes.COLONY_INTEGRATOR, false), () -> new APBlockItem(Blocks.COLONY_INTEGRATOR.get(), APConfig.PERIPHERALS_CONFIG.enableColonyIntegrator::get)); public static void register() { } diff --git a/src/main/java/de/srendi/advancedperipherals/common/setup/CCRegistration.java b/src/main/java/de/srendi/advancedperipherals/common/setup/CCRegistration.java index ed9223f25..6fb2bb3f1 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/setup/CCRegistration.java +++ b/src/main/java/de/srendi/advancedperipherals/common/setup/CCRegistration.java @@ -6,6 +6,7 @@ import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.addons.computercraft.integrations.IntegrationPeripheralProvider; import de.srendi.advancedperipherals.common.addons.computercraft.pocket.PocketChatBoxUpgrade; +import de.srendi.advancedperipherals.common.addons.computercraft.pocket.PocketColonyIntegratorUpgrade; import de.srendi.advancedperipherals.common.addons.computercraft.pocket.PocketEnvironmentUpgrade; import de.srendi.advancedperipherals.common.addons.computercraft.pocket.PocketGeoScannerUpgrade; import de.srendi.advancedperipherals.common.addons.computercraft.pocket.PocketPlayerDetectorUpgrade; @@ -43,6 +44,7 @@ public class CCRegistration { public static final DeferredHolder, UpgradeType> PLAYER_DETECTOR_POCKET = Registration.POCKET_SERIALIZER.register(ID.PLAYER_POCKET.getPath(), () -> UpgradeType.simpleWithCustomItem(PocketPlayerDetectorUpgrade::new)); public static final DeferredHolder, UpgradeType> ENVIRONMENT_POCKET = Registration.POCKET_SERIALIZER.register(ID.ENVIRONMENT_POCKET.getPath(), () -> UpgradeType.simpleWithCustomItem(PocketEnvironmentUpgrade::new)); public static final DeferredHolder, UpgradeType> GEO_SCANNER_POCKET = Registration.POCKET_SERIALIZER.register(ID.GEOSCANNER_POCKET.getPath(), () -> UpgradeType.simpleWithCustomItem(PocketGeoScannerUpgrade::new)); + public static final DeferredHolder, UpgradeType> COLONY_POCKET = Registration.POCKET_SERIALIZER.register(ID.COLONY_POCKET.getPath(), () -> UpgradeType.simpleWithCustomItem(PocketColonyIntegratorUpgrade::new)); public static IntegrationPeripheralProvider integrationPeripheralProvider; diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java b/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java index 63900d0b6..2f8d6ab64 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java @@ -1,10 +1,11 @@ package de.srendi.advancedperipherals.common.util; import dan200.computercraft.api.lua.LuaException; +import dan200.computercraft.shared.util.NBTUtil; import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.InventoryManagerPeripheral; import de.srendi.advancedperipherals.common.util.inventory.ItemUtil; import net.minecraft.core.BlockPos; -import net.minecraft.core.component.DataComponentMap; +import net.minecraft.core.component.DataComponentPatch; import net.minecraft.tags.TagKey; import net.minecraft.util.StringRepresentable; import net.minecraft.world.entity.Entity; @@ -102,11 +103,11 @@ public static Object posToObject(BlockPos pos) { public static Map stackToObject(@NotNull ItemStack stack) { if (stack.isEmpty()) return new HashMap<>(); Map map = itemToObject(stack.getItem()); - DataComponentMap components = stack.copy().getComponents(); + DataComponentPatch components = stack.copy().getComponentsPatch(); map.put("count", stack.getCount()); map.put("displayName", stack.getDisplayName().getString()); map.put("maxStackSize", stack.getMaxStackSize()); - //map.put("nbt", NBTUtil.toLua(components.stream().forEach(test -> test.toString()))); + map.put("nbt", NBTUtil.toLua(DataComponentUtil.toNbt(components))); map.put("fingerprint", ItemUtil.getFingerprint(stack)); return map; } From deb4c75b151ce4bb1620097eaed252d234644499 Mon Sep 17 00:00:00 2001 From: Srendi Date: Tue, 14 Jan 2025 19:37:10 +0100 Subject: [PATCH 40/57] 1.21.1-0.7.44a --- CHANGELOG.md | 9 +++++++++ gradle.properties | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f0c57a2d..87093e0fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [1.21.1-0.7.44a] - 2025-01-14 + +### Added +- Colony Integrator back to 1.21.1 + +### Fixed +- Villager & Wandering trader pocket and turtle trades +- ME Bridges `getUsedItemStorage` and `getUsedFluidStorage` + ## [1.21.1-0.7.43a] - 2025-01-13 Alpha 1.21.1 release diff --git a/gradle.properties b/gradle.properties index ef9a8b077..c0e911d29 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ neo_version=21.1.93 parchment_minecraft_version=1.21.1 parchment_mappings_version=2024.11.17 loader_version=4 -mod_version=0.7.43a +mod_version=0.7.44a release_type=alpha jb_annotations=21.0.1 From b38962cf8a4d3a92228ba86932d1268f7dd69108 Mon Sep 17 00:00:00 2001 From: Srendi Date: Tue, 14 Jan 2025 19:41:43 +0100 Subject: [PATCH 41/57] Checkstyle --- .../computercraft/pocket/PocketColonyIntegratorUpgrade.java | 1 - .../common/addons/minecolonies/MineColonies.java | 4 ---- .../advancedperipherals/common/data/RecipesProvider.java | 5 ----- 3 files changed, 10 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketColonyIntegratorUpgrade.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketColonyIntegratorUpgrade.java index 8dbd9ca92..1ac1f3f53 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketColonyIntegratorUpgrade.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/pocket/PocketColonyIntegratorUpgrade.java @@ -6,7 +6,6 @@ import de.srendi.advancedperipherals.common.addons.computercraft.peripheral.ColonyPeripheral; import de.srendi.advancedperipherals.common.setup.CCRegistration; import de.srendi.advancedperipherals.lib.pocket.BasePocketUpgrade; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; public class PocketColonyIntegratorUpgrade extends BasePocketUpgrade { diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/minecolonies/MineColonies.java b/src/main/java/de/srendi/advancedperipherals/common/addons/minecolonies/MineColonies.java index 8d60caa3c..07c0d9b8a 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/minecolonies/MineColonies.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/minecolonies/MineColonies.java @@ -24,8 +24,6 @@ import de.srendi.advancedperipherals.common.util.LuaConverter; import io.netty.buffer.Unpooled; import net.minecraft.core.BlockPos; -import net.minecraft.network.Connection; -import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; @@ -36,13 +34,11 @@ import net.neoforged.neoforge.common.crafting.SizedIngredient; import net.neoforged.neoforge.items.IItemHandler; import net.neoforged.neoforge.network.connection.ConnectionType; -import net.neoforged.neoforge.server.ServerLifecycleHooks; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.concurrent.atomic.AtomicInteger; public class MineColonies { diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/RecipesProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/RecipesProvider.java index 0b3f279bc..42af11920 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/RecipesProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/RecipesProvider.java @@ -4,10 +4,8 @@ import com.minecolonies.api.blocks.ModBlocks; import com.minecolonies.api.items.ModItems; import dan200.computercraft.shared.ModRegistry; -import de.srendi.advancedperipherals.AdvancedPeripherals; import de.srendi.advancedperipherals.common.addons.APAddons; import de.srendi.advancedperipherals.common.setup.Blocks; -import de.srendi.advancedperipherals.common.util.RawValue; import net.minecraft.core.HolderLookup; import net.minecraft.core.component.DataComponents; import net.minecraft.data.PackOutput; @@ -16,20 +14,17 @@ import net.minecraft.data.recipes.RecipeProvider; import net.minecraft.data.recipes.ShapedRecipeBuilder; import net.minecraft.data.recipes.ShapelessRecipeBuilder; -import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.ItemTags; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.alchemy.PotionContents; import net.minecraft.world.item.alchemy.Potions; -import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.block.Block; import net.neoforged.neoforge.common.Tags; import net.neoforged.neoforge.common.conditions.IConditionBuilder; import net.neoforged.neoforge.common.conditions.ModLoadedCondition; import java.util.concurrent.CompletableFuture; -import java.util.stream.Stream; public class RecipesProvider extends RecipeProvider implements IConditionBuilder { From fe977682b80468ffd503294762649f7aa719ab6d Mon Sep 17 00:00:00 2001 From: zyxkad Date: Tue, 14 Jan 2025 15:10:13 -0700 Subject: [PATCH 42/57] add publish --- .github/workflows/build-and-publish.yaml | 64 +++++++++++++++++++++ .github/workflows/build-and-test.yaml | 17 ------ .github/workflows/pr-comment-artifacts.yaml | 2 +- docs/RELEASE.md | 4 +- gradle.properties | 7 ++- 5 files changed, 73 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/build-and-publish.yaml delete mode 100644 .github/workflows/build-and-test.yaml diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml new file mode 100644 index 000000000..f8b36ff7d --- /dev/null +++ b/.github/workflows/build-and-publish.yaml @@ -0,0 +1,64 @@ +name: Build and Test + +on: + workflow_dispatch: + push: + pull_request: + types: + - opened + - synchronize + +jobs: + generate-artifact-name: + runs-on: self-hosted + outputs: + name: ${{ steps.name.outputs.name }} + steps: + - name: Generate Name + id: name + run: | + if [[ "${{ github.event_name }}" == 'pull_request' ]]; then + suffix="PR ${{ github.event.number }}" + else + ref="${{ github.ref }}" + ref="${ref#refs/heads/}" + suffix="${ref//\//-}" + fi + name="AdvancedPeripherals $suffix" + echo "name: $name" + echo "name=$name" >> "$GITHUB_OUTPUT" + + build-and-test: + needs: + - generate-artifact-name + uses: IntelligenceModding/actions/.github/workflows/build-and-test.yaml@master + with: + build_name: ${{ needs.generate-artifact-name.outputs.name }} + pr: ${{ github.event_name == 'pull_request' && github.event.number || '' }} + check: ${{ github.event_name != 'push' }} + + publish: + if: ${{ github.event_name == 'push' && contains(github.ref, 'release/') }} + runs-on: self-hosted + needs: + - build-and-test + steps: + - name: Checkout sources + uses: actions/checkout@v4 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + - name: Download Builds + uses: actions/download-artifact@v4 + with: + name: ${{ needs.build-and-test.outputs.artifact-name }} + path: build/libs + - name: Patch Changelog + run: ./gradlew patchChangelog + - name: Github Release + run: ./gradlew githubRelease + - name: Publish Maven + run: ./gradlew publishAllPublicationsToPublicRepository + - name: Publish Modrinth + run: ./gradlew modrinth + - name: Publish CurseForge + run: ./gradlew publishCurseForge diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml deleted file mode 100644 index 240ef7e87..000000000 --- a/.github/workflows/build-and-test.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: Build and Test - -on: - workflow_dispatch: - push: - pull_request: - types: - - opened - - synchronize - -jobs: - build-and-test: - uses: IntelligenceModding/actions/.github/workflows/build-and-test.yaml@master - with: - build: ${{ github.event_name != 'push' }} - build_name: AdvancedPeripherals - pr: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || '' }} diff --git a/.github/workflows/pr-comment-artifacts.yaml b/.github/workflows/pr-comment-artifacts.yaml index 424d186b2..8f5b3360a 100644 --- a/.github/workflows/pr-comment-artifacts.yaml +++ b/.github/workflows/pr-comment-artifacts.yaml @@ -110,7 +110,7 @@ jobs: body: |- ## Build Preview - [![badge]]($JOB_PATH) + [![badge]](${{ env.JOB_PATH }}) You can find files attached to the below linked Workflow Run URL (Logs). diff --git a/docs/RELEASE.md b/docs/RELEASE.md index 4f276d4e6..41bce4134 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -33,7 +33,9 @@ PUBLIC_REP_KEY= ### Release process - Execute `./gradlew patchChangelog` or manually update `CHANGELOG.md` and commit result to repository -- Run `git tag -` to create git tag and push it to repository via `git push --tags` +- ~~Run `git tag -` to create git tag and push it to repository via `git push --tags`~~ +- Upload project to github via `./gradlew githubRelease` - Upload project to curseforge via `./gradlew curseforge` - Upload project to modrinth via `./gradlew publishModrinth` +- Upload project to maven via `./gradlew publishAllPublicationsToPublicRepository` - Update `mod_version` to next patch or minor version, what you want diff --git a/gradle.properties b/gradle.properties index c0e911d29..7c34ab6d2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,13 +4,16 @@ org.gradle.logging.level=info # Minecraft related mod_id=advancedperipherals -mod_artifact_suffix= +# do not include mod_version/minecraft_version with equals sign anywhere else in the file (even in comments) +# also do not add space around the equal sign +# since we are using poor grep command to do automation :p +mod_version=0.7.44a minecraft_version=1.21.1 +mod_artifact_suffix= neo_version=21.1.93 parchment_minecraft_version=1.21.1 parchment_mappings_version=2024.11.17 loader_version=4 -mod_version=0.7.44a release_type=alpha jb_annotations=21.0.1 From dcf2a362e3448a9eb17cefb2083a85175087370e Mon Sep 17 00:00:00 2001 From: zyxkad Date: Tue, 14 Jan 2025 15:25:56 -0700 Subject: [PATCH 43/57] search if a pushed commit is in pr and then skip --- .github/workflows/build-and-publish.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index f8b36ff7d..42778924a 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -8,6 +8,10 @@ on: - opened - synchronize +concurrency: + group: build-${{ github.head_ref || github.ref }} + cancel-in-progress: true + jobs: generate-artifact-name: runs-on: self-hosted @@ -20,6 +24,12 @@ jobs: if [[ "${{ github.event_name }}" == 'pull_request' ]]; then suffix="PR ${{ github.event.number }}" else + if [[ "${{ github.event_name }}" == 'push' ]]; then + if gh search prs --json isPullRequest --jq '.[].isPullRequest' "${{ github.sha }}" | grep -m 1 true; then + echo "name=" >> "$GITHUB_OUTPUT" + exit 0 + fi + fi ref="${{ github.ref }}" ref="${ref#refs/heads/}" suffix="${ref//\//-}" @@ -29,6 +39,7 @@ jobs: echo "name=$name" >> "$GITHUB_OUTPUT" build-and-test: + if: ${{ needs.generate-artifact-name.outputs.name != '' }} needs: - generate-artifact-name uses: IntelligenceModding/actions/.github/workflows/build-and-test.yaml@master From 9cd6b5e6065e9792e6ef981d822531ab246f962c Mon Sep 17 00:00:00 2001 From: zyxkad Date: Tue, 14 Jan 2025 15:52:27 -0700 Subject: [PATCH 44/57] Revert "search if a pushed commit is in pr and then skip" This reverts commit dcf2a362e3448a9eb17cefb2083a85175087370e. --- .github/workflows/build-and-publish.yaml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml index 42778924a..f8b36ff7d 100644 --- a/.github/workflows/build-and-publish.yaml +++ b/.github/workflows/build-and-publish.yaml @@ -8,10 +8,6 @@ on: - opened - synchronize -concurrency: - group: build-${{ github.head_ref || github.ref }} - cancel-in-progress: true - jobs: generate-artifact-name: runs-on: self-hosted @@ -24,12 +20,6 @@ jobs: if [[ "${{ github.event_name }}" == 'pull_request' ]]; then suffix="PR ${{ github.event.number }}" else - if [[ "${{ github.event_name }}" == 'push' ]]; then - if gh search prs --json isPullRequest --jq '.[].isPullRequest' "${{ github.sha }}" | grep -m 1 true; then - echo "name=" >> "$GITHUB_OUTPUT" - exit 0 - fi - fi ref="${{ github.ref }}" ref="${ref#refs/heads/}" suffix="${ref//\//-}" @@ -39,7 +29,6 @@ jobs: echo "name=$name" >> "$GITHUB_OUTPUT" build-and-test: - if: ${{ needs.generate-artifact-name.outputs.name != '' }} needs: - generate-artifact-name uses: IntelligenceModding/actions/.github/workflows/build-and-test.yaml@master From 4ea815afdb12184c411a4790740dca9a40e16039 Mon Sep 17 00:00:00 2001 From: Srendi Date: Wed, 15 Jan 2025 02:50:27 +0100 Subject: [PATCH 45/57] Fixed several export/import item functions with block entities that don't export the IItemHandler directly but through a capability --- gradle.properties | 2 +- .../common/util/inventory/InventoryUtil.java | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index 7c34ab6d2..6c14e9fb4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ mod_id=advancedperipherals # do not include mod_version/minecraft_version with equals sign anywhere else in the file (even in comments) # also do not add space around the equal sign # since we are using poor grep command to do automation :p -mod_version=0.7.44a +mod_version=0.7.45a minecraft_version=1.21.1 mod_artifact_suffix= neo_version=21.1.93 diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/InventoryUtil.java b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/InventoryUtil.java index 5c2776d60..9f4a1819a 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/InventoryUtil.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/InventoryUtil.java @@ -5,11 +5,13 @@ import dan200.computercraft.api.peripheral.IPeripheral; import de.srendi.advancedperipherals.common.addons.computercraft.owner.IPeripheralOwner; import de.srendi.advancedperipherals.common.util.CoordUtil; +import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.Container; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; +import net.neoforged.neoforge.capabilities.Capabilities; import net.neoforged.neoforge.fluids.FluidStack; import net.neoforged.neoforge.fluids.capability.IFluidHandler; import net.neoforged.neoforge.items.IItemHandler; @@ -25,11 +27,18 @@ public class InventoryUtil { private InventoryUtil() { } - public static IItemHandler extractHandler(@Nullable Object object) { + public static IItemHandler extractHandler(@Nullable Object object, @Nullable Level level, @Nullable BlockPos pos, @Nullable Direction direction) { if (object instanceof IItemHandler itemHandler) return itemHandler; if (object instanceof Container container) return new InvWrapper(container); + if (object instanceof BlockEntity blockEntity && level == null && pos == null) { + pos = blockEntity.getBlockPos(); + level = blockEntity.getLevel(); + } + if (level != null && pos != null) { + return level.getCapability(Capabilities.ItemHandler.BLOCK, pos, direction != null ? direction : Direction.NORTH); + } return null; } @@ -141,7 +150,7 @@ public static IItemHandler getHandlerFromName(@NotNull IComputerAccess access, S if (location == null) return null; - return extractHandler(location.getTarget()); + return extractHandler(location.getTarget(), null, null, null); } @Nullable @@ -153,6 +162,6 @@ public static IItemHandler getHandlerFromDirection(@NotNull String direction, @N if (target == null) return null; - return extractHandler(target); + return extractHandler(target, level, target.getBlockPos(), relativeDirection.getOpposite()); } } From 1fae723fade8713800741caddb1665fce27ccf91 Mon Sep 17 00:00:00 2001 From: Srendi Date: Wed, 15 Jan 2025 03:05:05 +0100 Subject: [PATCH 46/57] Minecolonies cleanup and refactor --- .../peripheral/ColonyPeripheral.java | 11 ++++----- .../addons/minecolonies/MineColonies.java | 23 ++++++++++--------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ColonyPeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ColonyPeripheral.java index 947978734..21754e8d7 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ColonyPeripheral.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ColonyPeripheral.java @@ -65,17 +65,15 @@ public final boolean isInColony() { } @LuaFunction(mainThread = true) - public final boolean isWithin(Map pos) throws LuaException { + public final boolean isWithin(Map posTable) throws LuaException { IColony colony = getColonyWithoutPermission(); if(colony == null) return false; - if (!(pos.containsKey("x") && pos.containsKey("y") && pos.containsKey("z"))) - throw new LuaException("Coordinates expected"); - BlockPos p = new BlockPos(((Number) pos.get("x")).intValue(), ((Number) pos.get("y")).intValue(), ((Number) pos.get("z")).intValue()); + BlockPos pos = LuaConverter.convertToBlockPos(posTable); - return colony.isCoordInColony(this.getLevel(), p); + return colony.isCoordInColony(this.getLevel(), pos); } @LuaFunction(mainThread = true) @@ -288,8 +286,7 @@ public final Object getRequests() throws LuaException { } private IColony getColony() throws LuaException { - IMinecoloniesAPI api = IMinecoloniesAPI.getInstance(); - IColony colony = api.getColonyManager().getColonyByPosFromWorld(getLevel(), getPos()); + IColony colony = getColonyWithoutPermission(); this.hasPermission = !(owner instanceof PocketPeripheralOwner) || MineColonies.hasAccess(owner.getOwner(), colony); if (colony == null || !this.hasPermission) throw new LuaException("Here is no colony or you don't have the right permissions"); diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/minecolonies/MineColonies.java b/src/main/java/de/srendi/advancedperipherals/common/addons/minecolonies/MineColonies.java index 07c0d9b8a..536643b85 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/minecolonies/MineColonies.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/minecolonies/MineColonies.java @@ -9,6 +9,7 @@ import com.minecolonies.api.colony.permissions.Action; import com.minecolonies.api.colony.workorders.IWorkOrder; import com.minecolonies.api.entity.citizen.Skill; +import com.minecolonies.api.entity.citizen.VisibleCitizenStatus; import com.minecolonies.api.research.IGlobalResearch; import com.minecolonies.api.research.IGlobalResearchTree; import com.minecolonies.api.research.ILocalResearch; @@ -72,7 +73,7 @@ public static Object citizenToObject(ICitizenData citizen) { map.put("children", citizen.getChildren()); map.put("location", LuaConverter.posToObject(citizen.getLastPosition())); map.put("state", citizen.getStatus() == null ? "Idle" : Component.translatable(citizen.getStatus().getTranslationKey()).getString()); - map.put("age", citizen.isChild() ? "child" : "adult"); + map.put("isChild", citizen.isChild() ? "child" : "adult"); map.put("gender", citizen.isFemale() ? "female" : "male"); map.put("saturation", citizen.getSaturation()); map.put("happiness", citizen.getCitizenHappinessHandler().getHappiness(citizen.getColony(), citizen)); @@ -80,8 +81,8 @@ public static Object citizenToObject(ICitizenData citizen) { map.put("work", citizen.getWorkBuilding() == null ? null : jobToObject(citizen.getWorkBuilding(), citizen.getJob())); map.put("home", citizen.getHomeBuilding() == null ? null : homeToObject(citizen.getHomeBuilding())); map.put("betterFood", citizen.needsBetterFood()); - map.put("isAsleep", map.get("state").toString().toLowerCase().contains("sleeping")); - map.put("isIdle", map.get("state").toString().toLowerCase().contains("idle")); + map.put("isAsleep", citizen.getStatus().equals(VisibleCitizenStatus.SLEEP)); + map.put("isIdle", citizen.getStatus().equals(VisibleCitizenStatus.HOUSE)); citizen.getEntity().ifPresent(entity -> { map.put("health", entity.getHealth()); map.put("maxHealth", entity.getMaxHealth()); @@ -103,7 +104,7 @@ public static Object visitorToObject(IVisitorData visitor) { map.put("id", visitor.getId()); map.put("name", visitor.getName()); map.put("location", LuaConverter.posToObject(visitor.getSittingPosition())); - map.put("age", visitor.isChild() ? "child" : "adult"); + map.put("isChild", visitor.isChild() ? "child" : "adult"); map.put("gender", visitor.isFemale() ? "female" : "male"); map.put("saturation", visitor.getSaturation()); map.put("happiness", visitor.getCitizenHappinessHandler().getHappiness(visitor.getColony(), visitor)); @@ -154,11 +155,11 @@ public static Object homeToObject(IBuilding home) { */ public static Object skillsToObject(Map skills) { Map map = new HashMap<>(); - for (Skill skill : skills.keySet()) { + for (Map.Entry skill : skills.entrySet()) { Map skillData = new HashMap<>(); - skillData.put("level", skills.get(skill).getLevel()); - skillData.put("xp", skills.get(skill).getExperience()); - map.put(skill.name(), skillData); + skillData.put("level", skill.getValue().getLevel()); + skillData.put("xp", skill.getValue().getExperience()); + map.put(skill.getKey().name(), skillData); } return map; @@ -195,7 +196,7 @@ public static Object buildingToObject(IRegisteredStructureManager buildingManage map.put("maxLevel", building.getMaxBuildingLevel()); map.put("name", building.getBuildingDisplayName()); map.put("built", building.isBuilt()); - map.put("isWorkingOn", building.hasWorkOrder()); + map.put("isWorking", building.hasWorkOrder()); map.put("priority", building.getPickUpPriority()); map.put("structure", structureData); map.put("citizens", citizensData); @@ -314,7 +315,7 @@ public static List getResearch(ResourceLocation branch, List childrenResearch = getResearch(branch, research.getChildren(), colony); @@ -357,7 +358,7 @@ public static Object builderResourcesToObject(IColony colony, BlockPos pos) { map.put("available", resource.getAvailable()); map.put("delivering", resource.getAmountInDelivery()); map.put("status", resource.getAvailabilityStatus().toString()); - map.put("needed", resource.getAmount()); + map.put("needs", resource.getAmount()); result.add(map); } From 7c33467b275e16aaa0fe50e63b1a5ccc6ef9222a Mon Sep 17 00:00:00 2001 From: Srendi Date: Wed, 15 Jan 2025 03:06:26 +0100 Subject: [PATCH 47/57] Fixed wrong geo scanner turtle registration --- .../advancedperipherals/common/data/EnUsLanguageProvider.java | 1 - .../advancedperipherals/common/data/TurtleUpgradesProvider.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/EnUsLanguageProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/EnUsLanguageProvider.java index 2dd231d0c..ed91f98d8 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/EnUsLanguageProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/EnUsLanguageProvider.java @@ -82,7 +82,6 @@ private void addTurtles() { } private void addPockets() { - addPocket(CCRegistration.ID.COLONY_POCKET, "Colony"); addPocket(CCRegistration.ID.COLONY_POCKET, "Colony"); addPocket(CCRegistration.ID.CHATTY_POCKET, "Chatty"); addPocket(CCRegistration.ID.ENVIRONMENT_POCKET, "Environment"); diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java index ed487205d..0366f9dea 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/TurtleUpgradesProvider.java @@ -28,7 +28,7 @@ public static void addUpgrades(BootstrapContext upgrades) { upgrades.register(id(CCRegistration.ID.PLAYER_TURTLE), new TurtlePlayerDetectorUpgrade(new ItemStack(Blocks.PLAYER_DETECTOR.get()))); upgrades.register(id(CCRegistration.ID.ENVIRONMENT_TURTLE), new TurtleEnvironmentDetectorUpgrade(new ItemStack(Blocks.ENVIRONMENT_DETECTOR.get()))); upgrades.register(id(CCRegistration.ID.CHUNKY_TURTLE), new TurtleChunkyUpgrade(new ItemStack(Items.CHUNK_CONTROLLER))); - upgrades.register(id(CCRegistration.ID.GEOSCANNER_TURTLE), new TurtleGeoScannerUpgrade(new ItemStack(Blocks.ENVIRONMENT_DETECTOR.get()))); + upgrades.register(id(CCRegistration.ID.GEOSCANNER_TURTLE), new TurtleGeoScannerUpgrade(new ItemStack(Blocks.GEO_SCANNER.get()))); upgrades.register(id(CCRegistration.ID.COMPASS_TURTLE), new TurtleCompassUpgrade(new ItemStack(net.minecraft.world.item.Items.COMPASS))); upgrades.register(id(CCRegistration.ID.WEAK_AUTOMATA), new WeakAutomata(new ItemStack(Items.WEAK_AUTOMATA_CORE.get()))); upgrades.register(id(CCRegistration.ID.END_AUTOMATA), new EndAutomata(new ItemStack(Items.END_AUTOMATA_CORE.get()))); From 27cf957213a49957d569629419fe0fb2d95fa04b Mon Sep 17 00:00:00 2001 From: Srendi Date: Wed, 15 Jan 2025 03:06:42 +0100 Subject: [PATCH 48/57] Removed old nbt key name field --- .../srendi/advancedperipherals/common/items/MemoryCardItem.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/items/MemoryCardItem.java b/src/main/java/de/srendi/advancedperipherals/common/items/MemoryCardItem.java index 06cd7fa72..e8df77656 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/items/MemoryCardItem.java +++ b/src/main/java/de/srendi/advancedperipherals/common/items/MemoryCardItem.java @@ -20,8 +20,6 @@ public class MemoryCardItem extends BaseItem { - public static final String OWNER_NBT_KEY = "ownerId"; - public MemoryCardItem() { super(new Properties().stacksTo(1)); } From b6498e8709e74d81b1a549227111e56ac6b3fd8d Mon Sep 17 00:00:00 2001 From: Srendi Date: Wed, 15 Jan 2025 03:07:00 +0100 Subject: [PATCH 49/57] dat -> data --- .../srendi/advancedperipherals/common/setup/DataComponents.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/setup/DataComponents.java b/src/main/java/de/srendi/advancedperipherals/common/setup/DataComponents.java index d30d90a66..ef612b4bb 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/setup/DataComponents.java +++ b/src/main/java/de/srendi/advancedperipherals/common/setup/DataComponents.java @@ -26,7 +26,7 @@ public class DataComponents { public static final DeferredHolder, DataComponentType> FUEL_CONSUMPTION_RATE = registerInt("fuel_consumption_rate"); public static final DeferredHolder, DataComponentType> ENTITY_TRANSFER = registerNBT("entity_transfer"); public static final DeferredHolder, DataComponentType> WORLD_DATA_MARK = registerString("world_data_mark"); - public static final DeferredHolder, DataComponentType> POINT_DATA_MARK = registerNBT("point_dat_mark"); + public static final DeferredHolder, DataComponentType> POINT_DATA_MARK = registerNBT("point_data_mark"); public static final DeferredHolder, DataComponentType> CONSUMED_ENTITY_COMPOUND = registerNBT("consumed_entity_compound"); public static final DeferredHolder, DataComponentType> SIMPLE_FREE_OPERATION = registerLong("free_operation_cooldown"); From 0084c9fca0c2d2d0ceb29b3e7fe91235c408cffc Mon Sep 17 00:00:00 2001 From: Srendi Date: Wed, 15 Jan 2025 03:18:05 +0100 Subject: [PATCH 50/57] Fixed cooldown operations where we didn't set the data component before --- CHANGELOG.md | 7 +++++++ .../addons/computercraft/owner/OperationAbility.java | 12 +++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87093e0fc..2675f40a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + +## First official Advanced Peripherals 1.21.1 alpha release to the whole public. Please report any bug to github! + +### Fixed +- Fixed that several item export and import related functions would not work with blocks from other mods +- Fixed that functions with cooldowns which are used for the first time would throw an error + ## [1.21.1-0.7.44a] - 2025-01-14 ### Added diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java index 7a42d2543..f7f67940a 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/owner/OperationAbility.java @@ -65,11 +65,17 @@ protected int getCooldown(@NotNull IPeripheralOperation operation) { return (int) Math.max(0, cooldowns.getLong(operationName) - currentTime); } - DataComponentPatch componentPatch = owner.getDataStorage(); + PatchedDataComponentMap patch = PatchedDataComponentMap.fromPatch(DataComponentMap.EMPTY, owner.getDataStorage()); - if (componentPatch.get(ABILITY_COOLDOWN.get()).isEmpty()) return 0; - DataComponentPatch cooldowns = componentPatch.get(ABILITY_COOLDOWN.get()).get(); + if (!patch.has(ABILITY_COOLDOWN.get())) { + patch.set(ABILITY_COOLDOWN.get(), DataComponentPatch.EMPTY); + owner.putDataStorage(patch.asPatch()); + } + if (patch.get(ABILITY_COOLDOWN.get()).isEmpty()) return 0; + + DataComponentPatch cooldowns = patch.get(ABILITY_COOLDOWN.get()); if (cooldowns.get(operation.dataComponentType()).isEmpty()) return 0; + long currentTime = Timestamp.valueOf(LocalDateTime.now()).getTime(); return (int) Math.max(0, cooldowns.get(operation.dataComponentType()).get() - currentTime); } From 11d75ca731353177cfa613d8a3093ef736c5bb6b Mon Sep 17 00:00:00 2001 From: Srendi Date: Wed, 15 Jan 2025 03:31:03 +0100 Subject: [PATCH 51/57] New textures! --- CHANGELOG.md | 3 ++ .../103d9f3f36b01595f1aa5172191e60eff02e6924 | 4 +-- .../2f719b8031aed5e605ed8d6694b19245ca45c6ca | 4 +-- .../b8526e444ae7356037f3a813274f6835d1f3dd16 | 22 ++++++------ .../advancedperipherals/lang/en_us.json | 2 ++ .../models/block/chat_box.json | 3 +- .../models/block/colony_integrator.json | 6 ++-- .../models/block/energy_detector.json | 4 ++- .../models/block/environment_detector.json | 3 +- .../models/block/geo_scanner.json | 3 +- .../models/block/inventory_manager.json | 3 +- .../models/block/me_bridge.json | 3 +- .../models/block/nbt_storage.json | 3 +- .../models/block/player_detector.json | 2 +- .../models/block/redstone_integrator.json | 9 +++-- .../turtle_upgrade/geoscanner_turtle.json | 2 +- .../data/BlockStatesAndModelsProvider.java | 32 ++++++++++-------- .../textures/block/ar_controller.png | Bin 784 -> 0 bytes .../textures/block/ar_controller_front.png | Bin 804 -> 0 bytes .../textures/block/block_reader_down.png | Bin 499 -> 438 bytes .../textures/block/block_reader_east.png | Bin 526 -> 512 bytes .../textures/block/block_reader_north.png | Bin 513 -> 604 bytes .../block/block_reader_north.png.mcmeta | 6 ++++ .../textures/block/block_reader_south.png | Bin 498 -> 424 bytes .../textures/block/block_reader_up.png | Bin 490 -> 446 bytes .../textures/block/block_reader_west.png | Bin 524 -> 523 bytes .../textures/block/bottom.png | Bin 0 -> 350 bytes .../textures/block/chat_box.png | Bin 5996 -> 421 bytes .../textures/block/chat_box_front.png | Bin 811 -> 1130 bytes .../textures/block/chat_box_front.png.mcmeta | 6 ++++ .../textures/block/chat_box_top.png | Bin 0 -> 393 bytes .../textures/block/colony_integrator.png | Bin 655 -> 422 bytes .../block/colony_integrator_front.png | Bin 0 -> 1315 bytes .../block/colony_integrator_front.png.mcmeta | 6 ++++ .../textures/block/colony_integrator_top.png | Bin 0 -> 414 bytes .../textures/block/energy_detector.png | Bin 2694 -> 427 bytes .../textures/block/energy_detector_back.png | Bin 2702 -> 498 bytes .../textures/block/energy_detector_east.png | Bin 0 -> 1166 bytes .../block/energy_detector_east.png.mcmeta | 6 ++++ .../textures/block/energy_detector_front.png | Bin 2702 -> 495 bytes .../textures/block/energy_detector_top.png | Bin 0 -> 424 bytes .../textures/block/environment_detector.png | Bin 2694 -> 423 bytes .../block/environment_detector_front.png | Bin 804 -> 1601 bytes .../environment_detector_front.png.mcmeta | 6 ++++ .../block/environment_detector_top.png | Bin 0 -> 419 bytes .../textures/block/geo_scanner.png | Bin 294 -> 432 bytes .../textures/block/geo_scanner_front.png | Bin 430 -> 1105 bytes .../block/geo_scanner_front.png.mcmeta | 6 ++++ .../textures/block/geo_scanner_top.png | Bin 0 -> 412 bytes .../textures/block/inventory_manager.png | Bin 432 -> 424 bytes .../block/inventory_manager_front.png | Bin 450 -> 475 bytes .../textures/block/inventory_manager_top.png | Bin 0 -> 411 bytes .../textures/block/me_bridge.png | Bin 306 -> 426 bytes .../textures/block/me_bridge_front.png | Bin 256 -> 1661 bytes .../textures/block/me_bridge_front.png.mcmeta | 6 ++++ .../textures/block/me_bridge_top.png | Bin 0 -> 411 bytes .../textures/block/nbt_storage.png | Bin 419 -> 427 bytes .../textures/block/nbt_storage_front.png | Bin 451 -> 1572 bytes .../block/nbt_storage_front.png.mcmeta | 6 ++++ .../textures/block/nbt_storage_top.png | Bin 0 -> 417 bytes .../textures/block/peripheral_casing.png | Bin 306 -> 339 bytes .../textures/block/player_detector.png | Bin 2694 -> 0 bytes .../textures/block/player_detector_front.png | Bin 2776 -> 568 bytes .../textures/block/player_detector_side.png | Bin 2776 -> 425 bytes .../textures/block/player_detector_top.png | Bin 0 -> 416 bytes .../textures/block/redstone_integrator.png | Bin 439 -> 0 bytes .../block/redstone_integrator_bottom.png | Bin 0 -> 420 bytes .../block/redstone_integrator_front.png | Bin 452 -> 1484 bytes .../redstone_integrator_front.png.mcmeta | 6 ++++ .../block/redstone_integrator_side.png | Bin 0 -> 480 bytes .../block/redstone_integrator_top.png | Bin 0 -> 410 bytes .../textures/block/rs_bridge.png | Bin 314 -> 423 bytes .../textures/block/rs_bridge_front.png | Bin 445 -> 1595 bytes .../textures/block/rs_bridge_front.png.mcmeta | 6 ++++ .../textures/block/rs_bridge_top.png | Bin 0 -> 403 bytes .../profession/computer_scientist.png | Bin 1836 -> 1072 bytes .../profession/computer_scientist.png | Bin 1639 -> 1212 bytes .../textures/gui/inventory_manager_gui.png | Bin 716 -> 1300 bytes .../textures/item/ar_goggles.png | Bin 960 -> 0 bytes .../textures/item/book.png | Bin 430 -> 528 bytes .../textures/item/chunk_controller.png | Bin 334 -> 461 bytes .../textures/item/computer_tool.png | Bin 369 -> 426 bytes .../textures/item/empty_glasses_slot.png | Bin 163 -> 0 bytes .../textures/item/memory_card.png | Bin 774 -> 352 bytes .../textures/item/metaphysics/base_gear.png | Bin 1516 -> 297 bytes .../textures/item/metaphysics/big_fire.png | Bin 1159 -> 219 bytes .../item/metaphysics/big_fire_green.png | Bin 1211 -> 208 bytes .../item/metaphysics/big_fire_purple.png | Bin 1206 -> 211 bytes .../textures/item/metaphysics/fire.png | Bin 921 -> 131 bytes .../textures/item/metaphysics/fire_green.png | Bin 919 -> 130 bytes .../textures/item/metaphysics/fire_purple.png | Bin 943 -> 130 bytes 91 files changed, 126 insertions(+), 42 deletions(-) delete mode 100644 src/main/resources/assets/advancedperipherals/textures/block/ar_controller.png delete mode 100644 src/main/resources/assets/advancedperipherals/textures/block/ar_controller_front.png create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/block_reader_north.png.mcmeta create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/bottom.png create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/chat_box_front.png.mcmeta create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/chat_box_top.png create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/colony_integrator_front.png create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/colony_integrator_front.png.mcmeta create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/colony_integrator_top.png create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/energy_detector_east.png create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/energy_detector_east.png.mcmeta create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/energy_detector_top.png create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/environment_detector_front.png.mcmeta create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/environment_detector_top.png create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/geo_scanner_front.png.mcmeta create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/geo_scanner_top.png create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/inventory_manager_top.png create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/me_bridge_front.png.mcmeta create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/me_bridge_top.png create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/nbt_storage_front.png.mcmeta create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/nbt_storage_top.png delete mode 100644 src/main/resources/assets/advancedperipherals/textures/block/player_detector.png create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/player_detector_top.png delete mode 100644 src/main/resources/assets/advancedperipherals/textures/block/redstone_integrator.png create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/redstone_integrator_bottom.png create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/redstone_integrator_front.png.mcmeta create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/redstone_integrator_side.png create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/redstone_integrator_top.png create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/rs_bridge_front.png.mcmeta create mode 100644 src/main/resources/assets/advancedperipherals/textures/block/rs_bridge_top.png delete mode 100644 src/main/resources/assets/advancedperipherals/textures/item/ar_goggles.png delete mode 100644 src/main/resources/assets/advancedperipherals/textures/item/empty_glasses_slot.png diff --git a/CHANGELOG.md b/CHANGELOG.md index 2675f40a0..1605d5130 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## First official Advanced Peripherals 1.21.1 alpha release to the whole public. Please report any bug to github! +### Added +- Added our new textures! + ### Fixed - Fixed that several item export and import related functions would not work with blocks from other mods - Fixed that functions with cooldowns which are used for the first time would throw an error diff --git a/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 b/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 index d1cded0fa..cc7d898af 100644 --- a/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 +++ b/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 @@ -1,4 +1,4 @@ -// 1.21.1 2025-01-14T18:51:29.890747 Registries +// 1.21.1 2025-01-15T03:22:26.2758694 Registries b672635324c0df354e587efc81d0b19a581eae2f data/advancedperipherals/computercraft/pocket_upgrade/chatty_pocket.json 30b8f663613c7ce77048fd69631afcc11a682276 data/advancedperipherals/computercraft/pocket_upgrade/colony_pocket.json d4647159c2f2693a9c5e8d12bf740635751d29a8 data/advancedperipherals/computercraft/pocket_upgrade/environment_pocket.json @@ -9,7 +9,7 @@ fe98c60e7d61139aacf2d0872873e610aac8a37b data/advancedperipherals/computercraft/ ae619da638ad89d7302d832d6c09e2c87401c539 data/advancedperipherals/computercraft/turtle_upgrade/compass_turtle.json a25b955d6db4ad48d43255d48d05c7f3acd60ea3 data/advancedperipherals/computercraft/turtle_upgrade/end_automata.json 98d71a2e17f3d30bbb76c1ba2f94a1cd610c2cd2 data/advancedperipherals/computercraft/turtle_upgrade/environment_turtle.json -a3b3e4cbaedee3a929a4c9775e4f1a4cbd292b42 data/advancedperipherals/computercraft/turtle_upgrade/geoscanner_turtle.json +d16f77b8c8c50dfefd757439802a13568cdcd5ec data/advancedperipherals/computercraft/turtle_upgrade/geoscanner_turtle.json 522bb2a1afb9f2be97af7cf65cd9aa159d76d13a data/advancedperipherals/computercraft/turtle_upgrade/husbandry_automata.json c9b2df2d4fed11f60a8e6f8da77b2fa53dd13572 data/advancedperipherals/computercraft/turtle_upgrade/overpowered_end_automata.json 42fc2b9a2601ef44d617cb18302c2c4fff31d282 data/advancedperipherals/computercraft/turtle_upgrade/overpowered_husbandry_automata.json diff --git a/src/generated/resources/.cache/2f719b8031aed5e605ed8d6694b19245ca45c6ca b/src/generated/resources/.cache/2f719b8031aed5e605ed8d6694b19245ca45c6ca index e31581614..f9b340e45 100644 --- a/src/generated/resources/.cache/2f719b8031aed5e605ed8d6694b19245ca45c6ca +++ b/src/generated/resources/.cache/2f719b8031aed5e605ed8d6694b19245ca45c6ca @@ -1,2 +1,2 @@ -// 1.21.1 2025-01-13T17:28:09.7116313 Languages: en_us for mod: advancedperipherals -b733229a45f64a6500a00da10265bc71b8320229 assets/advancedperipherals/lang/en_us.json +// 1.21.1 2025-01-15T03:22:26.2798836 Languages: en_us for mod: advancedperipherals +df95afe714aeff7559b0093257aeca501dabb1e2 assets/advancedperipherals/lang/en_us.json diff --git a/src/generated/resources/.cache/b8526e444ae7356037f3a813274f6835d1f3dd16 b/src/generated/resources/.cache/b8526e444ae7356037f3a813274f6835d1f3dd16 index 7dc9fb650..0b5e6c2a4 100644 --- a/src/generated/resources/.cache/b8526e444ae7356037f3a813274f6835d1f3dd16 +++ b/src/generated/resources/.cache/b8526e444ae7356037f3a813274f6835d1f3dd16 @@ -1,6 +1,7 @@ -// 1.21.1 2025-01-13T17:28:09.7101266 Block States: advancedperipherals +// 1.21.1 2025-01-15T03:30:04.6987737 Block States: advancedperipherals 5e28ce1be9a6996d982641e5df1fa7162090b8cc assets/advancedperipherals/blockstates/block_reader.json f42bdde60f84fdb312f7cf3b2be461d9c11ebdc8 assets/advancedperipherals/blockstates/chat_box.json +1227aa092fcf1327547ace6ccc9db230e45891b0 assets/advancedperipherals/blockstates/colony_integrator.json 67420f28031606ca03db9a044141bb22b0fa78b7 assets/advancedperipherals/blockstates/energy_detector.json 340b5baa62e5e6a2c35a05b4411be5937ac2bbb8 assets/advancedperipherals/blockstates/environment_detector.json 57c00996bcf1d783116a9210842f246612089555 assets/advancedperipherals/blockstates/geo_scanner.json @@ -11,13 +12,14 @@ d1fe6188b0b0ce8779cb9795a746177858cbaa41 assets/advancedperipherals/blockstates/ ff12c7217911184266589813a2c8f9b0d46cfd65 assets/advancedperipherals/blockstates/player_detector.json 726cf2599b0c765bcfacda88a1943be74f985877 assets/advancedperipherals/blockstates/redstone_integrator.json 544ff1ecb58622350b58940036b4b1908e1146da assets/advancedperipherals/models/block/block_reader.json -b28693973b6bbbb61e0c1ffc59e8ca98d8bb7e97 assets/advancedperipherals/models/block/chat_box.json -96ef564804fdc2b5184462747935f52baa35c651 assets/advancedperipherals/models/block/energy_detector.json -41556ddf5c5e67def6efd8e2e0645718d950af25 assets/advancedperipherals/models/block/environment_detector.json -ba233597a497c1032d884fc3058e27b9d965725e assets/advancedperipherals/models/block/geo_scanner.json -fb58e0b712f1f6ce1b2ea4dcfa0747905cf6ed95 assets/advancedperipherals/models/block/inventory_manager.json -75b59d2b73a96a27e3d4a1ed3b9a928b7dff102e assets/advancedperipherals/models/block/me_bridge.json -a647b86b8a7862af738136c9375a5d27d3b08860 assets/advancedperipherals/models/block/nbt_storage.json +dab55424ec184c5495c7ca11e5bbe77210e04c26 assets/advancedperipherals/models/block/chat_box.json +7e207db9b2b170f52565c8ed23bcc92762be6c4d assets/advancedperipherals/models/block/colony_integrator.json +1e9a2e3931bfe77f2d42a95c539b365c4517095d assets/advancedperipherals/models/block/energy_detector.json +434c2505b18d1313c0377c6bf8d5e4dba93765cc assets/advancedperipherals/models/block/environment_detector.json +51ab0a2a78453e711e6aa3c3020b9658bf379628 assets/advancedperipherals/models/block/geo_scanner.json +32f7941037838f9d77c5c3a4eb3b56c8786e500e assets/advancedperipherals/models/block/inventory_manager.json +674d6ee74ef7fd0360c0e1ea0b2e21734f67c096 assets/advancedperipherals/models/block/me_bridge.json +65cdb0ff57aa8439c5d80eea5c741866da9af81e assets/advancedperipherals/models/block/nbt_storage.json 36b6ac01be085492aa6298eeb89e6ecaa3cb6f82 assets/advancedperipherals/models/block/peripheral_casing.json -40369caaaf2f593d786a9c64284647fed8ae3a47 assets/advancedperipherals/models/block/player_detector.json -bed2ba2ba497ccde06c99712483fe220c277b4be assets/advancedperipherals/models/block/redstone_integrator.json +120df29f21059aa9d4dff53bbb80953dee8d5214 assets/advancedperipherals/models/block/player_detector.json +d08b8946e1eb01cc9c8af4fa297b582614d1034b assets/advancedperipherals/models/block/redstone_integrator.json diff --git a/src/generated/resources/assets/advancedperipherals/lang/en_us.json b/src/generated/resources/assets/advancedperipherals/lang/en_us.json index 1176cb3fd..7ac6af552 100644 --- a/src/generated/resources/assets/advancedperipherals/lang/en_us.json +++ b/src/generated/resources/assets/advancedperipherals/lang/en_us.json @@ -18,6 +18,7 @@ "advancements.advancedperipherals.weak_automata_core.description": "Does the afterlife exist in minecraft?", "block.advancedperipherals.block_reader": "Block Reader", "block.advancedperipherals.chat_box": "Chat Box", + "block.advancedperipherals.colony_integrator": "Colony Integrator", "block.advancedperipherals.energy_detector": "Energy Detector", "block.advancedperipherals.environment_detector": "Environment Detector", "block.advancedperipherals.geo_scanner": "Geo Scanner", @@ -39,6 +40,7 @@ "item.advancedperipherals.tooltip.block_reader": "&7Reads nbt data of blocks to interact with blocks which do not have computer support.", "item.advancedperipherals.tooltip.chat_box": "&7Interacts with the ingame chat, can read and write messages.", "item.advancedperipherals.tooltip.chunk_controller": "&7A crafting ingredient for the Chunky Turtle.", + "item.advancedperipherals.tooltip.colony_integrator": "&7Interacts with Minecolonies to read data about your colony and citizens.", "item.advancedperipherals.tooltip.computer_tool": "&7This tool was made to tune our blocks. But for now, it's just a blue useless wrench.", "item.advancedperipherals.tooltip.disabled": "&cThis item is disabled in the config, so you can craft it, but it'll not have any functionality.", "item.advancedperipherals.tooltip.end_automata_core": "&7Upgrade for turtles, that allows basic interaction with the world and teleportation in one dimension.", diff --git a/src/generated/resources/assets/advancedperipherals/models/block/chat_box.json b/src/generated/resources/assets/advancedperipherals/models/block/chat_box.json index 487d0eb4e..b2dc05216 100644 --- a/src/generated/resources/assets/advancedperipherals/models/block/chat_box.json +++ b/src/generated/resources/assets/advancedperipherals/models/block/chat_box.json @@ -3,6 +3,7 @@ "textures": { "all": "advancedperipherals:block/chat_box", "north": "advancedperipherals:block/chat_box_front", - "particle": "advancedperipherals:block/chat_box_front" + "particle": "advancedperipherals:block/chat_box_front", + "up": "advancedperipherals:block/chat_box_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/advancedperipherals/models/block/colony_integrator.json b/src/generated/resources/assets/advancedperipherals/models/block/colony_integrator.json index 884006124..71048304d 100644 --- a/src/generated/resources/assets/advancedperipherals/models/block/colony_integrator.json +++ b/src/generated/resources/assets/advancedperipherals/models/block/colony_integrator.json @@ -2,8 +2,8 @@ "parent": "minecraft:block/cube_all", "textures": { "all": "advancedperipherals:block/colony_integrator", - "down": "minecraft:block/oak_log_top", - "particle": "advancedperipherals:block/colony_integrator", - "up": "minecraft:block/oak_log_top" + "north": "advancedperipherals:block/colony_integrator_front", + "particle": "advancedperipherals:block/colony_integrator_front", + "up": "advancedperipherals:block/colony_integrator_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/advancedperipherals/models/block/energy_detector.json b/src/generated/resources/assets/advancedperipherals/models/block/energy_detector.json index d1b21431d..4b3b4c8d2 100644 --- a/src/generated/resources/assets/advancedperipherals/models/block/energy_detector.json +++ b/src/generated/resources/assets/advancedperipherals/models/block/energy_detector.json @@ -2,8 +2,10 @@ "parent": "minecraft:block/cube_all", "textures": { "all": "advancedperipherals:block/energy_detector", + "east": "advancedperipherals:block/energy_detector_east", "north": "advancedperipherals:block/energy_detector_front", "particle": "advancedperipherals:block/energy_detector_front", - "south": "advancedperipherals:block/energy_detector_back" + "south": "advancedperipherals:block/energy_detector_back", + "up": "advancedperipherals:block/energy_detector_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/advancedperipherals/models/block/environment_detector.json b/src/generated/resources/assets/advancedperipherals/models/block/environment_detector.json index e049a94d1..90630831d 100644 --- a/src/generated/resources/assets/advancedperipherals/models/block/environment_detector.json +++ b/src/generated/resources/assets/advancedperipherals/models/block/environment_detector.json @@ -3,6 +3,7 @@ "textures": { "all": "advancedperipherals:block/environment_detector", "north": "advancedperipherals:block/environment_detector_front", - "particle": "advancedperipherals:block/environment_detector_front" + "particle": "advancedperipherals:block/environment_detector_front", + "up": "advancedperipherals:block/environment_detector_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/advancedperipherals/models/block/geo_scanner.json b/src/generated/resources/assets/advancedperipherals/models/block/geo_scanner.json index d81084e52..6752a0106 100644 --- a/src/generated/resources/assets/advancedperipherals/models/block/geo_scanner.json +++ b/src/generated/resources/assets/advancedperipherals/models/block/geo_scanner.json @@ -3,6 +3,7 @@ "textures": { "all": "advancedperipherals:block/geo_scanner", "north": "advancedperipherals:block/geo_scanner_front", - "particle": "advancedperipherals:block/geo_scanner_front" + "particle": "advancedperipherals:block/geo_scanner_front", + "up": "advancedperipherals:block/geo_scanner_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/advancedperipherals/models/block/inventory_manager.json b/src/generated/resources/assets/advancedperipherals/models/block/inventory_manager.json index 16ac6a767..818e46153 100644 --- a/src/generated/resources/assets/advancedperipherals/models/block/inventory_manager.json +++ b/src/generated/resources/assets/advancedperipherals/models/block/inventory_manager.json @@ -3,6 +3,7 @@ "textures": { "all": "advancedperipherals:block/inventory_manager", "north": "advancedperipherals:block/inventory_manager_front", - "particle": "advancedperipherals:block/inventory_manager_front" + "particle": "advancedperipherals:block/inventory_manager_front", + "up": "advancedperipherals:block/inventory_manager_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/advancedperipherals/models/block/me_bridge.json b/src/generated/resources/assets/advancedperipherals/models/block/me_bridge.json index 0d5355f55..42e6388e4 100644 --- a/src/generated/resources/assets/advancedperipherals/models/block/me_bridge.json +++ b/src/generated/resources/assets/advancedperipherals/models/block/me_bridge.json @@ -3,6 +3,7 @@ "textures": { "all": "advancedperipherals:block/me_bridge", "north": "advancedperipherals:block/me_bridge_front", - "particle": "advancedperipherals:block/me_bridge_front" + "particle": "advancedperipherals:block/me_bridge_front", + "up": "advancedperipherals:block/me_bridge_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/advancedperipherals/models/block/nbt_storage.json b/src/generated/resources/assets/advancedperipherals/models/block/nbt_storage.json index 4472f8466..dce7d353e 100644 --- a/src/generated/resources/assets/advancedperipherals/models/block/nbt_storage.json +++ b/src/generated/resources/assets/advancedperipherals/models/block/nbt_storage.json @@ -3,6 +3,7 @@ "textures": { "all": "advancedperipherals:block/nbt_storage", "north": "advancedperipherals:block/nbt_storage_front", - "particle": "advancedperipherals:block/nbt_storage_front" + "particle": "advancedperipherals:block/nbt_storage_front", + "up": "advancedperipherals:block/nbt_storage_top" } } \ No newline at end of file diff --git a/src/generated/resources/assets/advancedperipherals/models/block/player_detector.json b/src/generated/resources/assets/advancedperipherals/models/block/player_detector.json index f3d2db295..a979dadf1 100644 --- a/src/generated/resources/assets/advancedperipherals/models/block/player_detector.json +++ b/src/generated/resources/assets/advancedperipherals/models/block/player_detector.json @@ -1,12 +1,12 @@ { "parent": "minecraft:block/cube_all", "textures": { - "all": "advancedperipherals:block/player_detector", "east": "advancedperipherals:block/player_detector_side", "north": "advancedperipherals:block/player_detector_front", "particle": "advancedperipherals:block/player_detector_front", "side": "advancedperipherals:block/player_detector_side", "south": "advancedperipherals:block/player_detector_side", + "up": "advancedperipherals:block/player_detector_top", "west": "advancedperipherals:block/player_detector_side" } } \ No newline at end of file diff --git a/src/generated/resources/assets/advancedperipherals/models/block/redstone_integrator.json b/src/generated/resources/assets/advancedperipherals/models/block/redstone_integrator.json index 2fa89aaa5..038dd8561 100644 --- a/src/generated/resources/assets/advancedperipherals/models/block/redstone_integrator.json +++ b/src/generated/resources/assets/advancedperipherals/models/block/redstone_integrator.json @@ -1,8 +1,13 @@ { "parent": "minecraft:block/cube_all", "textures": { - "all": "advancedperipherals:block/redstone_integrator", + "down": "advancedperipherals:block/redstone_integrator_bottom", + "east": "advancedperipherals:block/redstone_integrator_side", "north": "advancedperipherals:block/redstone_integrator_front", - "particle": "advancedperipherals:block/redstone_integrator_front" + "particle": "advancedperipherals:block/redstone_integrator_front", + "side": "advancedperipherals:block/redstone_integrator_side", + "south": "advancedperipherals:block/redstone_integrator_side", + "up": "advancedperipherals:block/redstone_integrator_top", + "west": "advancedperipherals:block/redstone_integrator_side" } } \ No newline at end of file diff --git a/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/geoscanner_turtle.json b/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/geoscanner_turtle.json index e7f635533..18daf30be 100644 --- a/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/geoscanner_turtle.json +++ b/src/generated/resources/data/advancedperipherals/computercraft/turtle_upgrade/geoscanner_turtle.json @@ -1,4 +1,4 @@ { "type": "advancedperipherals:geoscanner_turtle", - "item": "advancedperipherals:environment_detector" + "item": "advancedperipherals:geo_scanner" } \ No newline at end of file diff --git a/src/main/java/de/srendi/advancedperipherals/common/data/BlockStatesAndModelsProvider.java b/src/main/java/de/srendi/advancedperipherals/common/data/BlockStatesAndModelsProvider.java index 65591a348..abb69071b 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/data/BlockStatesAndModelsProvider.java +++ b/src/main/java/de/srendi/advancedperipherals/common/data/BlockStatesAndModelsProvider.java @@ -24,21 +24,23 @@ public BlockStatesAndModelsProvider(PackOutput packOutput, ExistingFileHelper ex @Override protected void registerStatesAndModels() { - peripheralBlock(Blocks.ENVIRONMENT_DETECTOR.get(), "front"); - peripheralBlock(Blocks.CHAT_BOX.get(), "front"); - peripheralBlock(Blocks.PLAYER_DETECTOR.get(), "side", "front"); - peripheralBlock(Blocks.ME_BRIDGE.get(), "front"); - peripheralBlock(Blocks.ENERGY_DETECTOR.get(), "front", "back"); - peripheralBlock(Blocks.PERIPHERAL_CASING.get()); - peripheralBlock(Blocks.INVENTORY_MANAGER.get(), "front"); - peripheralBlock(Blocks.REDSTONE_INTEGRATOR.get(), "front"); + // Define blocks with specific sides and orientations + peripheralBlock(Blocks.ENVIRONMENT_DETECTOR.get(), "front", "top"); + peripheralBlock(Blocks.CHAT_BOX.get(), "front", "top"); + peripheralBlock(Blocks.ME_BRIDGE.get(), "front", "top"); + peripheralBlock(Blocks.ENERGY_DETECTOR.get(), "front", "back", "top", "east"); + peripheralBlock(Blocks.INVENTORY_MANAGER.get(), "front", "top"); + peripheralBlock(Blocks.GEO_SCANNER.get(), "front", "top"); + peripheralBlock(Blocks.COLONY_INTEGRATOR.get(), "front", "top"); + peripheralBlock(Blocks.NBT_STORAGE.get(), "front", "top"); + + // Define blocks with custom model generation + peripheralBlock(Blocks.PLAYER_DETECTOR.get(), generateModel(Blocks.PLAYER_DETECTOR.get(), false, "side", "front", "top")); + peripheralBlock(Blocks.REDSTONE_INTEGRATOR.get(), generateModel(Blocks.REDSTONE_INTEGRATOR.get(), false, "side", "front", "top", "bottom")); peripheralBlock(Blocks.BLOCK_READER.get(), generateModel(Blocks.BLOCK_READER.get(), false, "north", "south", "east", "west", "up", "down")); - peripheralBlock(Blocks.GEO_SCANNER.get(), "front"); - peripheralBlock(Blocks.COLONY_INTEGRATOR.get(), generateModel(Blocks.COLONY_INTEGRATOR.get()) - .texture("particle", blockTexture(Blocks.COLONY_INTEGRATOR.get())) - .texture("up", blockTexture(net.minecraft.world.level.block.Blocks.OAK_LOG, "top")) - .texture("down", blockTexture(net.minecraft.world.level.block.Blocks.OAK_LOG, "top"))); - peripheralBlock(Blocks.NBT_STORAGE.get(), "front"); + + // Define a simple block with all sides having the same texture + peripheralBlock(Blocks.PERIPHERAL_CASING.get()); } private void peripheralBlock(Block block, ModelFile file) { @@ -83,6 +85,8 @@ private BlockModelBuilder generateModel(Block block, boolean hasNormalSide, Stri side = "north"; particleTexture = blockTexture(block, "front"); } + if (side.equals("top")) side = "up"; + if (side.equals("bottom")) side = "down"; if (side.equals("back")) side = "south"; builder.texture(side, blockTexture(block, sideTexture)); diff --git a/src/main/resources/assets/advancedperipherals/textures/block/ar_controller.png b/src/main/resources/assets/advancedperipherals/textures/block/ar_controller.png deleted file mode 100644 index 2fe546d8248230702850e2b54dbc0cdcbeee543c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 784 zcmV+r1MmEaP)4Tx04R}tkv&MmKp2MKrbAE$6^me@v=v%)FuC*(nlvOS zE{=k0!NH%!s)LKOt`4q(Aov5~xH8#OK80CKX8h$aTfzH_kKlt5St1va`C52-^_lx6vi~^xupjmgE?_i;A5=XED6~yy|*YeY0FHMa0ZR1VBW% zyP3IrDJ4UeL`2POu~;zRm$mjWW*};K1ivRh1Zf44>W;R`IL_}4GVHm?R zbNqN?=Y&~zS5*-ihJgpRGDAcF?yl|*z|7cs+HC=d2=M^4>qjD9A5AIpeYbbdweL#P z*1kJ`y(B~8P5=;+(<7qx-P3*Zu>LMh%aZB^S41We5fPMyq)XG*T1zQOY%GH&8L9!G z_TBquTl;RD=TqHXiImqOqV8YM5%dQD#UO=?4pSfZ1#|-nl>C@jx-v%=Y^|H#rwB@i-?30{8)X^!%GFMAz8> O00004Tx04R}tkv&MmKp2MKrbAE$6^me@v=v%)FuC*(nlvOS zE{=k0!NH%!s)LKOt`4q(Aov5~xH8#OK80CKX8h$aTfzH_kKlt5St1va`C52-^_lx6vi~^xupjmgE?_sjx3JnPA7wIU)_B_d{y2zOUi zcTXvm5LZMbs=8b*5nz?O|Hx*u5d^#44y?#P!BPtQVzE$F!BbT|y}TtN5y?4^>4EH? z?vXhK>h2;!L^)?1kO~Bh%T-0@0~%%q*ou2Vr9y zq=J=cn#myCsp{sTA5`?f>#m|=m9Rdo&RRZ zIb(M_Ryh8{-mioG<1ZWk1B{Yl(fjiQrl2UqxrEGYW@2W{+_vp_=D>om;4o8Eb-i9= ilFPsqKGZ1%nfVV-M*@*Y0W#VE0000 diff --git a/src/main/resources/assets/advancedperipherals/textures/block/block_reader_down.png b/src/main/resources/assets/advancedperipherals/textures/block/block_reader_down.png index c42740fa501b867ec3dbfa9bd8661adcf32a59a6..4e039835c06577edb87caaa603dfb938111fd186 100644 GIT binary patch delta 412 zcmV;N0b~C21GWQ@B!3BTNLh0L01FcU01FcV0GgZ_0004KNklb;@5Jg{* z?Ioh10ZVbP!W9xJi8w|oB&sy2X>t+j^l2zKL@F8%5D5jz#E}e*3xwA$lETcgHsn|1 z@$UcgXLc@bAMSrSpvbj^xSl%6*?EBj(CPXn(QIClWqT6?WPjPdk{4_@Nl73dHbmL= zR3#ROsAFGxf4T!;7nfwMz&{(m%-2T5DRON}1sKg1RuxN2wY>E9*sE095RW!`;SB)O z;lNZSCAR_}TeJaXvx;1^ixY}mR|q9%pK(1!mhEvpRT2nVfsgAcwwvT+d|%5?0MbZT zDsXHzQJW42Mt?nxG?RYm`!(Je!YtcUQgzfaCIG4md8eY!R-GIR2S*L^*y)h02P12&DZrrB!2;OQb$4nuFf3k00054NkllW8bAA zCbQY>p>12TEW;SX|3nCZvMdo1^bl4`0pOftDPaT^t-*T_5Pu7mWr^Nb@8Q$yiu&J0 z9RkZ73g@CoA2O`I5AV)SXy3f1Hipydilqdcb10=S#*k$h(!IMQd2+Hi}&Rei=osZr?_Dom-05 zP*vTwB!ocIGtnxw9b#QNc7+ORax&YX2x4hW9xaB^chtK&hrjO&J6_K|? P00000NkvXXu0mjfG!EwS diff --git a/src/main/resources/assets/advancedperipherals/textures/block/block_reader_east.png b/src/main/resources/assets/advancedperipherals/textures/block/block_reader_east.png index a6d3a2147a2947a21818f39dd85b3b77583a2bef..b2fac00a738f19ba13046d85e17b60fe8c409abf 100644 GIT binary patch delta 486 zcmV|1b_sPB!3BTNLh0L01FcU01FcV0GgZ_00059NklljA9L0Z0 zkJv|t+7U@nL?u=_WZ`pkp%PBZ_bc>MFwh|kY^cb=tsJYiTZQvEC&6&J zvmJQL{r!A?|M!3A8@xGv`-d%*Qm#Zw`489S9Rxre#kh481b;MI1275#02-}(yhBkI zRsdk}ebIYqjIkYr=+zGMSM%0^!{v!3*J%d8{%rc+`rX$%Kb}xZad`OLi=17xPRy5O z+jaZV=hy9CfT5eQizprw#bbmJ-c=Njy%S@M&u8euGRCk@GmJ5m#XV(l@43s9Ir%E{ z&q4?qt&vjpGk@5hO%dYGcXe2&85gq&=Qm5LME4vBDJ6~82qC}uhKE@l$|K4b-(#tLpJ0FjqD zd71ZSzWtSW%jY-C9_MiV?b-?$V>mwEhF0G4>E#O!j$Z<*M00S|&g^mkyt{mrA)NJx z$BK`8PpNA~nC?+;2JoXH4DIEqHv=yahLXBgt%HZh%5K_{Zr!bSxlN<(DJ+wpo^a?M cS(o3%Utitql)Uth_5c6?07*qoM6N<$g7EO>VE_OC delta 500 zcmVNn2>qB7VeL%nVRkZ|T{I9vAphV0y}b95 z)oOJNApnqN8Cq-px2me5EK2}H1QkLc%Q678)}(2QwU!V9B7ZVCz4rryvMf=ju4$TL zjEVFR0vmPRz81)>#W^>CsLmC@S_{BhswkT6Jhj%Ss$xCqAzj3(BUx*saJKW&q1Kwi zVhY8U+0L_`z}y(T_nk*Cp6xu3-H}@BxWn?C=k_Cq#gtlWW;@SDUH7SWA$Or37Sp)H z@|^neGce-CgMY7gAV8l&=k_#thlr3$iW=R6HzOpyPlDp*!|z-!bLwwbF-1A8aTDsH zm|mQSCXq9mP!IYdMxd$+iY=cOuiKIy6iui(e)z(xx2^d7uSblEtM;umJs=O7_2lOF zi|ru1!?PzO@|%mFXHooPVwl%s_WWr9&N*^xSx>lAMs12M7fcxy+bGV1#(6hPp@RSs z6k#Xgc|DHeo7Ah=n$9_lG32!O5CWSHW_#zRX@GXHR5w}Bwx;(UV+ qRka;kmL*C=xDDCw_xx+!9_PRB_UvtEoQr_~0000B7$aY0vb|^e}#v%(4j-<(jikjWav*Y#6t>&4&6Lt z?ckr#$pm|F37uM6Bvc`r*h)~Io_vH3CuHHJ$=crV`0m8J?|-{{`by89zW@M0DJ8%( z&0?BYBnUwDepSv@!$`FTuxc0pQmylf#B??#L8EV@yvob~h$shAcOE+#gG9IG0Eqn% zz`9jm0*8Y@bdpkPbF(3L4tg06_r0v~AOP_3Nh9xD7OiHi%ud+wKh$2F~ho5Ckop2s@1d)dLw53)Z98hyEsm! zk*jltvT2&B)UJwh&8{Jzq1f*Ikr52JRR};|*U(+Bx-QSD-@Nf|D4bM|uTy9w@ zB@6)6b=Ye}Li{z@`0;YV7jm;jP_NiI|> zW|F9k;qod1Ai11HP)z5kCIFuMOOmBM=9Oa5w!JOrzxTuG{$97`+`$ii-xc+L_d~bk z_F eejfhIe)t0&%<$*Y)R=bw0000~41^@s6AM^iV00001b5ch_0Itp)=>Px$yGcYrR5*=|lhJA# zK@^6+p54v3D3TgUh-u0qN!}qBxh;7G-?Vt!3*R9T5koD3MuTLS-HdzM3*B*zP&#)z zGv7Bq=j{137!3ZXD$Qn-G)?)R<($J>i--`{;V6nol7u8l5PuO=6%heIRq@{Ay$=sr zYl%O?#uxym;*cal%MyT$G@JoJ5`TnMm04UMlQ{sg1*ZKTnI1|62(f_xHyVcS={eog za~chUOyO=HT%u!2art z-`{_*9FF!RGJlyf6^E+s1l0!+US1AI#K*^&lM|N15qfh$tKHc^Q53o(03w1!QIM3n z1|W(e%54{_Js@;uFG02Wwpx&kpZWalmg41w_3JC$`#X~HGjFTKPO?oMR|zsrnf80+ zlR2=UHHPl}9i^_3ho8Ky7UX#W*Oz4eC{!;7D2f7O3~gW6hFM+mu(?;k+V5@PEfWOZ z`_P)YB+q~CB5!}B3a*&gIkz`N#uze9nO$G*6)V$pZyw6B#5qT7tpzxcd?{i?j&=nT q4q$67v4~KYlx0bt=lpBc$N4XfZ}|7$VjP+P0000R#B!3BTNLh0L01FcU01FcV0GgZ_00046Nkl`m46C?As?SlL{}n zUlak6L!NIyM1N<0qt=@9!Tsavu(v()P%7-L!B8p)A>f>Y5Q1;>wR0|3aC^66plNHQ z(%~(3U;+~JLBYYQIB>skv^&1cPv+IcKrmeZ&?S765oO5W}8nf9o4}@`wbsb?e s>OI+8(?8*J{my`op*%Vr;-~QkJErVX`4!H}00000Ne4wvM6N<$g5Hd{IRF3v delta 472 zcmV;}0Vn>b1M&lqB!2;OQb$4nuFf3k00053Nklc6@^4Tr;b zRi)W%5(EMN6G@WboI^w~gs)$IDl%KcTZBfWMhkyB)tg0;i6wR_CSv(KT zG9nGI)?Pr&$I1({M`kO|wNDUW-VN!b{sqJUG#U*6=8_;UD_Vm-0G=2!O$&{mo>}(V zbPjc_wZw6J1c(TW+8Z)k@$L67)}!%N^KKvS*-WNICwXTqYHu+6Lu=4yJsR^_6%&51 z=z27!HRvNRD}NSde+HBd1Mo#Sq=$;;&&rK00Qn)0*B@W`@^@2FfJ{@$MK3zY=`~Zs z7pZ9ZPI)?XQXlPxY$j7~AMZ(5udJb>HxGAgCR4N<66xt5a*;%j~B0mc0)RQ0|L9rwg+@ zkLXYbITp;aj3h}g&N+Y!NTk7Wd9<`lsaBGma~Kh!42k3TYWw9Vuk$}j8uGV*^aeNp O00000B!3BTNLh0L01FcU01FcV0GgZ_0004SNklvnICwm&{IfX8!qS zXYcar`kMx-Y9=DGm0O;(v2dC$K{sR#`+kw!w-< z?VyKo?OYafAfoTG9X31`2cbx$stkvtkmPQ%0GbQa;%ab$}oJ=*^+x2iz+F O00000Wbc(1L^~iB!2;OQb$4nuFf3k0004`Nkl z-eR%nM1(xgNz;`73FjPDRiTtZ$8eG)0AyLlN~c{0W)K;)(-S4u5OGOz;b>{b9PLdrkp(1ER`e6GLj@AO;hqbN5$|`xd1n3$IK6w zTpn$Z^V49m($5%Uf{E(e9>W(0zv#r#$%c!=KW}yd>-OM;lBok2b+1 zW)y&kgkkO9J%4ah&-s4!E|^?@E4lvtp8dNAv~$Ev=wRATSQi=EIn?bvdj1h;5dXy9 zrw;*M7a7xb@^1%yq7N@EZL0000in)6oo%0 zizVSAb|z6651FAQg$pQniWI<1%Jft;DR=}*s3_=C@B(=X3R0MYj)9R;GO`C-$tbIp z?hF*`T}g)1?7e4q@6Wlry%#S}{;-DD+L=UA^bgnO9TdQ5IDf*e{UD$+27rDL08kmz z;T@K%r40Zu{Wk4viipjiRL6FhJf1WaIGi6_vPd%k2IKg@_Ny<~zCES2=HTFg4|00Z zR3e{eP1g0L4^Nx309&rdHin~J06sl`;(f;r#xWw|^-*BO5)q0tLqu3De{+63@&00- zc`b_6+LbXxQGe9cU@(qR>e^o(jAK4NvwL}Bc>QBWo|tY0Q4~=bgHp<8bSTn{JZajy z*AKj18Dm9kw~!|`(CNjLx3PU2Z?YvKf>MgQvccNp+|pY63IOz7!Em(8Svt3q5MggW z_98mYK`mAb7OO>P3Rk}p0M61mb!EKY#^u*b8$d)jI%={Hh}9MEA3bE}Fd$D1JBLlr zZ7ufpV*ocDTl&py&b#gVl%*z2w<+r$e6I*Y`+3T`=L3XcL|N*lf}7ji9$J%b-LyBk nx-xbOv*f2I9NHsm^PBh!AxZMqA^v)$00000NkvXXu0mjfa-cwZ-03w14A&}=e09tFZEW;Rsh!8?RM1KGXA>f?5CQwxs>QFVy zGOV=};=3OLljax^K}0ad+#*p?6~GunA)fKZ(P)kGp7UXEe~QLhOIeo5v5JpTIfCoi z2$pNc8WvWEFF;LG|E3KspJ%UOxlV1#;fym; z3B02rv{%=_Ap|l}hmhWZ@}6d~;@#{aFYkUOv{!t1dk1y;thWygmMfI^U`_8}(j0R! zG$`*GEZ4mM`535Cr%#c^iotT7N_o%4&@c_UCveW)B5V0rK1UXvTCDH(D1qY`Qwz>H zrq)sn>1KbRmKJHR8o~S4eOk@3EE7q$T_&wE^m%C87U+VdVzQuH&9W?++z3;=BiQ>c oD^*pYM1-3p+wGQrotts~11Sv>{dPOzSO5S307*qoM6N<$g07qC1ONa4 diff --git a/src/main/resources/assets/advancedperipherals/textures/block/bottom.png b/src/main/resources/assets/advancedperipherals/textures/block/bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..604ecb2678322be3a810fda08be63320dc51130c GIT binary patch literal 350 zcmV-k0iphhP)?D_TOmji~rQch;(Z)PUK{1)1oK9;?+8yZzQ?zq-6;z4^2; zeNll)tfB7^5r)2Fx8E9>C)b!NL{e(0Ld-RQqflD?REJpyo=qP$!6(*rlj)ICJ9Si! zP=%O@I!idjn21`j?4Vp6PwKZ*yiWU*rKY)7emkcoY$!{rO&8 w-K9>9{{G={@wb%+=HCVKLs~lDQ>PB_2m36nJ)6Ia1ONa407*qoM6N<$f~v@ti2wiq literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/advancedperipherals/textures/block/chat_box.png b/src/main/resources/assets/advancedperipherals/textures/block/chat_box.png index 1fc9a3ce92e59044c784069e5026c53ca39bd734..134492be41934610c5528ff041d10120e68a6cc0 100644 GIT binary patch delta 407 zcmV;I0cig0E~NvI7=H)`0000V^Z#K0000SaNLh0L01FcU01FcV0GgZ_00043Nkla%2_d9O4vt+*F1b!Wt6|@~u@FJvSjD9;~Yp*>Z)tDj}7EHHKAOA|)aStu;5K zQqi)PJ>+eqL@ITzAYM4;Ar^W=M6m}&k+Zwu;D3Z#>)|U{V^9=1-d%UOn)l8$YpS-tB&m3Y>Fjy9SHJ zH4lVwiuJw5WHNZNw`O?4*Y<+}A7goRI>b-o5A5mgEf6TX%h&(_002ovPDHLkV1j{9 Bv55cx literal 5996 zcmeHLdpMM78y`6)rxlV;V?D#{c>$<-EFV{7^&;9)F-+e#7=f0n3UYj_+ zOhbJueFOqw$ny5^hyR+WK3baa@80&iut6J<5E!iR2b4&uOu`pNK}bcs6hcCALOuc! z*IK+x*x2c;H&PmK=?jAhTE_K*C(q3MChxFqS?<%8rR~w&`IftNjWd^y^xxk9`b;t_ zu^@fWF*vbfZ<5hW{FC!9>jr(3UHb>Gl-W%?*=lTwI%D5idOYBp3lC2O?@8GaPrNs{ zIDY0>1^W&tCZT}TAlt|Vcs!mQ2gEVe$RFm)UrYFNpDST zN;v)obNivpnI{J0Qp?_Wv+6vg(;lYI)sUMeRsGoIFlk`E@A(-HF#_nygYRB>rQWa( zG6_u*zIeIBw_Eik8sM`%E_>2gO?MAg1&Xuo;>HikW5O z$ewzmH1j7&Vp90GTb(SZFAVR;?r?F$XtC`q_vYyzy#2cVSu-b+*0sr~2GkC{B)FMq zR&aZ_HodUeg&2r#EY4bR4MAUDZTNHM zT8*afEqgrc9;KKtjlV`2#9LgRY?g@+UAwt5MVpd0d@H!~K@(KVNXu)!$UN-KN!mOq z$SU1%sI!7;Hs^C z5gB$jI@TFm*QKy+7BUZKa8mHmoA+&DIi9>1;ElIgbF{&(?a|R7%Dvzd-tN2XkDa)? z*uKo)(_v{CyRv!dN=CY2(e-@~`Prh9A&ZckhqJ6ITuW{X(k&ua6PnH2`G$*gSJ)LE zpL&g=2_BxDR@Hzo&0Zu(o>#m)riUtEt_s`$l@SaT1S2`;KhcM^CWYE7mQR~NG{y6JA5OpFggE~m1f%cX@W+}-*0L)RalGuoZk4R z_Q#;;hIL_kY*|mQer;bRbI{mws<+bXTPH?KcG0jX>b|LV4$$Z0mNszNv5Vi7)2dyw zego@KQ0b5(oe^gHI`Nmh%}1TTWK_*?i2uUeB8u86Jj!gqZ0q4-Mg7gj!1Ag#&ntR` zL~B8nQ>~p7<5-EnI*buYZd|=HksjbiKS8X!uVvn$^~`k}Wl0~us79ZySkQ(6S}lLQ zc-|-^j4N`RH-mfS{@e|FH-^pICM`Oi6LMo(W<{CEjoC3X065vbA(cG2wLa7F0vVUP z!mISz+R`=8Z8o81*|_-+G@rRXrTZY+>Q?SD?50?BgVWafP|m@r-KiBuEqbxn=01tI z{*wml;#bXkb5C$`8}C@=1o}}T|1{Bh;dNrghRt2ASn2bs4Q|=mmqu1Kv<7(>-1yCl zdyQF{GflWOJnpyJc~cH#xX9N&%k=zVH|OFZzMWn9U_ke!$CduNx7xo7TvK+g^g)9{ zuL4y#l$V?#%Z*K#y?|@nDe|v z2M!Qw3itFr+iT;xw5g>p{^6qUJQjBuIV@}mFKBnINbNW2p_SjZdKt4C>r!5bIMud< z#0so&{rTAXnpvX744P3@a?hbd9klM)Bg|@U{#n2KPxkiS@?Tv~AIV4$GHk52NZ-Y8 z?lkBA@!)B%E$Y~Cc7@R|)!BW^p7(4#UcR<&c#hfQyOXbYTged!jrBqXgTrDl-kyc< z37E4ci{@SX<;-&{0}4>)+KWpJUnL>qTXHjR0vvZLcX zxB1Mu)JBFps6HnWhrIO)yrl`m#1`w_dt`3HZ;YZPWfbHOF}En()G zrH?_&HI_^ccmHfZ^!_`PpZe}}{t>ob5Wj0!{?wkbMZ+~KF5}@w&(rQM<-&(KFE%j_ z+t07NUkB=hWxmY%?PbCGl}bK9+eHT{rR>ZZB9OxmlY3^#Yoj!;{iY+?Q+ z^Ua;QZ<21eXAc#zoaS3se;@?HB{LPB2Z zJ!sd#l&r`;tsB~h(DXaS^Uk<;VE(65%j3lgAPy~-+o&i;IXoaa zC=*H*LWvlu;sm&o7zGW5g6ENA}}@<8}20@fdrOJZao3Mi!;U z@IWjS1&QE9)znELQ+x5K>XWp42_!NZE=CHTM0f{U2Fc`bnX6dwI1FKQh6hr;U`_xo zH=zg+Kv=0*pmtGh3>97uEG?kw4wzYOhgU;o$RI!=kp)U5Q8bh)TcnCo-Bd`Iv38;Q zNITkZfAja{^2uM|2I07DxgL!d*cnTFyrjl`} z(cMP6U{xpV+ts?L&LB3MI#CZ7)fq))sR}V5MkHAr(&vJc|0-pr_TwR~#`XmKD3H-Ub{%>;WzkB6|#PIh%CHz8d z7O)=&zl=L@d;&ceELecU;fO?{pP!$Pj}Mhfb#rrLIomC!+SBRuWz6}0?zV-6h57mU zmC6So>@`{Hy&V3pi_uxtN5kCyUu$8bu7bt()a}xo{e>|BoB6s6Hf6Cq+ynJmz*Q!J zJf5kEDbFM}8n1!U)%oGb)gw(!fef9jr>O%2ss2oztdxQ0sRIN}o$jZ{b_j_fvn)N% zE($93#gcg(BW#;IGGPXXozT`A@DR!{SUCNMs#w8RD_o(+R`yQE>dTq#&Zn!ZXK{TK z6PfWlrd~}w(sZPPlmBf4ropZOlVLC^b<#ThGy^(fpv2+#yZ5Ny!^t67p1vL>^i}Kr E4g3xE+W-In diff --git a/src/main/resources/assets/advancedperipherals/textures/block/chat_box_front.png b/src/main/resources/assets/advancedperipherals/textures/block/chat_box_front.png index 0eca0ed3c6c5fca11b5b7133a37213d0aaf5e27d..39868fc900197342dfa6439da7e16cdce76419d9 100644 GIT binary patch delta 1123 zcmV-p1f2V;2I>fq7JmUi2m$~A06J)EbpQYW32;bRa{vGf6951U69E94oEQKA1RP03 zK~!jg?VC?%+g2RMzm}d9zr@-Sxvkub*Rqg9*daUgS_Zvzl$ElQ9m+~!%Lr_2gHRYH z+j%fbV6bZsIqlFwU@ffO$eElFhHT-XgE&BZ!{=02L=j- zJfmPex4x%sYMygWXUEC36oe4e@Xz;`b={!aFbn{6h97_WNx57SLNLxb^+B`jglPb{ zxq3QQo6IiVTz@@1nO#a*sdBl*IcGu$ztP~FCu&}^hA<2+TX(`R__Fo}0O=Mk4K7Gm z?sz-Y$(Di;qB&@3ron)k9{_yT{tW=roQ5B0K&+tA#Bt6euk_~JigXL-zIhmVrRr9$ zUfGmxA@WL*SE5N1LNF@P7=FBVO0(>HS0^;f29Pif&3_Lx(}?_ly3|?+0FIOS=)HGS zR*FLUIAx{c>*9maB5=+hKmNUQ1>!ZKb%-n3W_c3;$^alYB>={ll#($<^;DKp{;e=J zHV$B;m`^5oy)Kf;md;Do%K$3gHih-N*eq_e#!&ILKNq;3M0u+ecQ>DVLJgC`k)y`| z=+5!u1AoaRfS(dlN?EUqv9a+m3bWahVHBP?@oE#zZ1!ZaSQs1{+AfzEfIrv%01)`C zUAa-rA3K`aa}NAQ?#UW}gyP|O@W48GI5+R!zLKWSQ~_N#XfW}lb>|_z;t=p~>a!!i zeqDVA9#-#H6b~;B56T~uKPVo0`omlEE`Zxt(tii_hkI8i;vw}r56U0ff`^O;I^wTS zcq$J7G{ev=yRUgr{?Hcu4|vda@i1&BhVAB{#nR3~b@Eo_LSopyRk^^@4(*!mJm|V1 zz2LHS2Y_@%FCIR)`|!s3@%O)5iN|x}{CF=O=Fg5wZ!7l*0KT7oMb{1KZN)ct;X#^) zW`EgtXC?rIy4f`Qo(JU*ZNWpv1Ares9DN2J07RzQ?>s1fXbUPH6c5TD6c6#uiU;Kn z&+&PBs@raj{D7H8_vh*Tc5Bq$U3+L zaS$FTR6HmiURWNKKPVm)4+rpvx#}4JGee69^@rKi1I;iL4~mCAD@+5ljK(lzw`h|E1OhfD2{F36KEvR@t1F!I77=0K= zP-3PYPc5e5Ilk`UFF{6;-2rA>*>bd5g1JuCnGm`3r+N zZ6(EZnnQ?T34d`UAVNkJC6r+yLaRoKi6reuJ^X`?KS3^;TqQ7aET94vlH&*egWuhn z`Kd`aDHsJhUu^qh1PJT`jhbzLAKP~01n@rtS6a(osROg0q}N(n_z39T1}?5!n!E>G z?f?T%x@1U>j20++-Q(R|?Y;eb zrrF;Qm|k+Wpfy|Q0004ENklvD@v4$_Ns6D&C95!ps6w&FnaT01%PZ8uA`ILqu9`pK`)T zq2Jv_1VC$z4<^$?L{)Y7;O?qwW-T`ni5FLD5kU09CIbY-6;)MLMz_|gmt4m6&E4htb`}HKM1O?10HoGhYo#nKdKN=UX&8oH*hB&V z2)!8UqZV@+U!LxB8L0{VY}MTZk$PJ7V&~WH#Vl4YYLU9JglP`!fgkDZnUK>!elZ;8 zFunHj_w#2C+>y{F`m$4Zx0&?{88n&hs+v*?DJ4~%&*#5)jwm#{pJE0x+iW)6 gOB*SXrxU8`5Ai_$#1G%}0ssI207*qoM6N<$g56MT*Z=?k diff --git a/src/main/resources/assets/advancedperipherals/textures/block/chat_box_front.png.mcmeta b/src/main/resources/assets/advancedperipherals/textures/block/chat_box_front.png.mcmeta new file mode 100644 index 000000000..9559c00e4 --- /dev/null +++ b/src/main/resources/assets/advancedperipherals/textures/block/chat_box_front.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": { + "interpolate": false, + "frametime": 2 + } +} diff --git a/src/main/resources/assets/advancedperipherals/textures/block/chat_box_top.png b/src/main/resources/assets/advancedperipherals/textures/block/chat_box_top.png new file mode 100644 index 0000000000000000000000000000000000000000..093f9a4931ff5a624ba99e2be587274e40a4a096 GIT binary patch literal 393 zcmV;40e1e0P)0J6|HR2$NL)q-g^L?b9>Lz=UEo1VvLN(E|c8dKNMB; zd!D^acRlF$c5!*dX1&V2AD^7ket*#}Tby%P(MrvVG2*=^#>i&9%4A#eRj$Z;kBHEv zgorS(%Fel5va0vp45A@z&Xr+Eaf4gd_RMIr$b#QDf(L?0L2D%sT&hC!KlMJ3;UXKVuYaNy# zq6^$(03ZNhF<&s?bEy<#))=hUx3I=U?U{#C;b0AhQb7m-=NyC(OzdmtT&&>ke#1c1)<~x_ zG;PgTI-POPN7rfm=08aM4WHY09`I+^X|9{L=DMo(Ck4(qG;NLf{Dud@ILEq9V>IeL qIat#_;cNTBfRCX(IUVBX@ds)S>mHHPJ#_#8002ovP6b4+LSTZ8udqe{ delta 630 zcmV-+0*U>m1CIreB!2;OQb$4nuFf3k0006>Nkl2rR99UGb=4>ED!T4d^c4ajh^|7D2n4&3!avz=e^7Uf-C^D7)ts5N zRi=w^MhEJ-Iq!jUo^#Igo|Aa;sOXnX!QJcUF|9oS=9j8Gyni7 z&j65B74l~lYCpHB+b)(JRM#~H0LymJHHC9MrvNbY3=QD~9rSA5j122o$q7cUj-u}D zV9w5RYjB&vTz@vI=6Z*CZ5M!QwMkZ00)m2}l2bL#42-g}yh7z`h0~b~p4i|=*gBBz zlu38WM|4d9IzCn`0KB$Ka($YOh372HO>;Y62Oy_vQKHv&@!BpmVaG)T__Pv;IFL)T zS(kb9{tEz0-y1P40Qxi;NCX5~RiSJOo<1(&dWXE4d4I>`HI19a;y=GID!96F+(E%m zalJzTHtQY$mv?_7oK}>eDk+51itLM-HA-Xs$0LO5uGa$_CWiu^BsmEQplk}{RDwQD zX6iway6y5|aXkvsHHAJ+rfvu1mhI51bq53&`+F#x0=MOJWoQ6^{LwfyVaN6$U28Cy z%kp||m2aLuJ^;!4rAyB`@F|;uW^)%QonWu!AtilU?E`-8xum2N?E@bv>GO8}8vsfw z*hp!Ae?O{V=ovn*SZMtsV5pQ$0T8>~=o&+WK|nNTh=QTU{DyG&3#Uu=t&za= QeEE|HP)mS;I7%EHXB=82!y7lkdQSgN>n_U zgBEGfq6KM%N{DDgY!p!bY zvK}V$&g_qvouy5a%{-TxecqYbXWn<-&-;C!_jSGd-uqcBrYMT_Cz2!;_zfR`2cR}o zD;&nT*XI+ybSgzS+(0^&5~B4^b2ak0ePV+*mA@6Cyz8;vf^JZqoku zhoUSn)3n?OPMl}~AhEoN-!Gx63ZM4& z0r2C`KLMbsiYPN|WjSHi!K1ZRI=^|2dso-Fd*=@H_7RWIGI4thzu%9ls^XZ*WN7W^ z&?C?^jYn&%JR7Xx-qlqAPQUsZ@%StNFSfN6w1Q!obP8Ad>CUXxVOX`-M=^iCc^Z#3 z<~S;l2jf2+Ms5EU|HK(le(6SC={!)nM{$ShNS*nU&2$F0x0=95Ev557igxJ{jF=I~ zH)K(wjg7XJ<)pFeK4f^o7P4?a8J;_$%X z0r0eWP$Bvt-)!rHs;X)>Hq7p9TOUlEx=CcptOKh)aJ}{RJJ}=8AHnPM@xrm=qQ57W z7V!FfghF*id5~CIV18kKFY}=Oa0BOh&H_3UZ1W%(405jLEb;g(|4hd0^8gS`Xl!mS zXeDrXAR^cw`XJxz>jSTjw6gU}y3+LlAeeCN`mlW-sH$pV!lZp30RKC0 zaCop4K`Htm-|XuH%jjHw{$Sz>p7&}=$4+h3g0uB!h+gtkJiRKU7#du(tp${T+{kVL!Vsy54 z_mcAm+Uh#vO+#$TY0)ya@&}!ZW+vkxCh68*te{=jo6EJo)*FyQ15*t0w+rVoJ9c~DFrI6T+| zec;aLfx!f;K8Vcq;|kRgnd`@MC|o!?my$m)M&}JVZI1^={=hmq@BaRSe2sJv^#LH5 zaP9iAxVdC~;P?A2OqjH<51{zG!QsJH1p7}PK$+_chCTpiePNI151f3WZhMahdq02h z^!Fc>w7$?b)puam7i_OL=Fb;wuQ%q;7o7FRiqZ$p{=|K&56aq~Xyrj!`xC7^*tPwM Z{{c?Ayn~Tju2}#8002ovPDHLkV1mx}hQi6aZil%7~r`weq6IHA__~8buZCuJvR+ zdFx9q8bw6dcO4?aBvj6`g)iBukGtQN7FG2pWJ0#0sZbp(g^AN7IgnfbPgP?JZD|p? z^6Vj80>sBTQB_}o^BGp)o{%)Wo#s?gTV~6YwzSNa!^XC>N68{G zG!fuyllH0`1=7gtxk9{!b-s>ep6bN~PV07*qo IM6N<$f>-6asQ>@~ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/advancedperipherals/textures/block/energy_detector.png b/src/main/resources/assets/advancedperipherals/textures/block/energy_detector.png index 3d23b2e88f387fedeeeb13b81222c35e50bd12d3..5b994935ba192517fc7de2a0953d8f73e1fb303a 100644 GIT binary patch delta 413 zcmV;O0b>4!6{`b~7=H)`0000V^Z#K0000SaNLh0L01FcU01FcV0GgZ_00049Nkly80e}F2*>uK$&!tj~S!1wV-oqLbk$;zm5{WOQQjkhvHec|v zU-0#19{`e2+HjPjEOHD-DXcNkAm3W#(Q^~6H4m0Wj@f*HvdAHof;EO!+#=OlLl6-+ zq*Bqcm)+%cq(mxptsq`F=OGq)qqUAb$g(}V8xHe0q{wMuuvV zu(94%(GPRmi+`9@c*)`7dRKwcIkIdIBD(q;wbq>Xo}O2yqwSdcQsHO~`cgp%0p}cq z5KQcA=UlAd;c>-4-Bd`&6Vy$`SUR3?&qv!5e)4Z5{)Vs32M_qOZHeo;sklBIe$NV= zbEumN)9D=#gmHNrBja|Al5Al`U^2abw@isPV6QBh&kx0}O&sLjkK`~Lm@??3kY z-^(4rruy;4Q;QJ<8SiiKhTw0Bd7U!`ejokpD`*&Xi{$YH{T>e*)Rd?c2M99bopt^0 zhFx=~y|O6$2sU|weFY;9G)?jPrd`(O8w?&Oev;kL_WRht)VoVBtbgg*g9l&b_rLVY zH7$iLwI!#JC7Ka3`X~OmzI5TO#g|Mwap=0w-~4R$+=2BQ-fB#{VTrRAh~vz@3!B&=JoCeT1B64 z`kX5+dH%>vyYFmkS-R{{+p*Sz8y{NNw0F|V-Ju6p@2`sbuDas>%h$ATtNpERPi*z^ zDY2n8@U}i&ew)5$e&6?w`jTA}ziODfysu*Zj9s;B7u-@>?mw`8_OG|QZ(QD1@xuJY zhg;{4WlP_=;E#fx+n+rizGqpewP4$#wi7~W(b3VXH+{eC((Ur0bBgASX_@!tqQ}QP z{lLQ?EnIlG=*SlZwk_9g+E&>11LA3Zl%IKj>BBP*AAj-WMegvFvK?c4K05XJrjyK4 z1vG81c=THH#!kyWQU0 z+}zmM$g*rrO-*+xvUD<1S6BDeg!6Zlj2jpj*t~hO`)KSW^g35ZsU zfCWJSL6andlQd4d%o@_gCDcG5=PB!%9>Q)CDNZFQ8%ZP*Ikay0y8e!HRHeV|D7lG+DXE#V7&Ov?6Bl_5MIGhc~+xlMX~=9}%=oZ*tXB~_%}9Q)8#5DR zMMaQA*1Dyg4kyo%4m=7N2kzhnfOAf!5@$Fk=>P&x0%tVKaT_Gl&I1)1hKbGK#d(G=_=-I}cKEP(o6IivdEFV;E|7o`uQ77ILP< zA)!?g>(KybC|X2O;%>~$4K4nCS*saIMeAtRn)&O2V2qUY-`sM%A-KoshSu#LartNQs7@=o z0Wv9C_nEnc!IC^vrVVikwRQ!T6VfkF=emH1WsE{QC&vKXa^VD~VbWPt&bfG+7kMX6 zIw=u%I2an|fM~~EWF-|P0aO-e&-&|1)JSp~sEt9rKv}?nvt)tJ$mnxs7MW}Zruayj z#3{Jvkr9evNrt7Xusk)uDhP8+&9AN6+=$>{pV@|LbF*UorgFobsv4Jome&tUYLF(6 zyqfqAk36=F&__;orbC*`qp00*4`?@}SMv@otGKik zo{DeIT szIm^0@8x@KYsQW48@;@E)wnujcuU16r*0aEn}0I=z9#RMy2Z=?0!?gon*aa+ diff --git a/src/main/resources/assets/advancedperipherals/textures/block/energy_detector_back.png b/src/main/resources/assets/advancedperipherals/textures/block/energy_detector_back.png index 231a2e1e56cb7cfeac4e1cc798698bf01d82ddb0..044eef38b3091811ebcb3732b79643d7939f4f6a 100644 GIT binary patch delta 484 zcmVAnB(aZ3wQ%J!BdNq;)L#D)1{4qZU+?Yqf#JbvS)(H@?M2mfvK z`-$ThfA0uvWq;lLa7Jz8em`-a#d^JTYf;xV)uv=P%sSDYQed4z(@p`8v)!(R9hO~w a7ykecYT>lsMl{?20000ZzAf2-LSU4CI$ zbZ0AgU;Am)Big>HOV8NrEPIN3>nAToMZToq>~+i6o>_3)4(Y_8f=L6Lr@S}w#erKl zJbPrujFSbYzsa+1zIW~R{MH{4chmFXaqCN-9e47=?n@(F!C}MS7(DmL<*(OXV&)^C z96J0{k)jklR$4Z1=boMOj?KGtVbsf2`>XO_Qy;kQ?(rggE2O_6qC&*!7O~w_7Mv%&?q{8vDfsTejRFquUxgEPOR1{oT zbGeW7DQ?gv*3VTzaBgFWpF5j(3Ru;oqQc4~3mM`-=g?$4CTVQag_*=Gyf@4QhMEw4 zwhL?V`BAs50@QA`TS?rL6gy}PlAvg%Dn!^o?UXbLT)D6|T~}CwNF);0gv~0eQG#+h zodih}G>t<9u60T}m&7G)Oo}8;Qwua+6%}2SCDfqh!g9Or!eAa|g769NNkT)K-&mXM znl2DtxUj>5Ab_ArlEFzDr=3O(sp8^_&zJR-v~&+)H;E*t5R{c9;_)n6(>)!3$GIk2 z3w0`h2mnoPS9##+0Fpi?6HJM5D05K4U!8OQ8WwE*#`TIRwk-zceir_FrmiG!|rY}Z(*gUpY=G%=( z-dY!CB*+RfFAA)AOFQh2Fh|<)2w?2EJyN!#PMh;KL+vL^3>HNz*xr2L=yh zwu+D>0_;wPFSp@gDpHQyc}Ey$Xde38IGW=e6fIPQGyYAg2xZR2a`Q2G1jrMnxd<%Xk8yfLR^xDLL`jenTG}2G z;~=PWMw6%tlCd*(imYH5igGy8i0MGppkfU&inP)+h6+481yXTPLSmeY0z#3Z7;1E$ zg~`Jfa)!hqp;;2^RspBWYDku2F3iXcHJCD!0cRsEe6~U6O;6JS2i>i`0lHu7zp6a{e0g%g;9iPum$ z=M2+fA?(0O2PNQkJ453f5Nx=UET6h>xU6oPv8E8KM}LWLUZa%TWWYf-tt!+}bLQjR+3*)orLWHY?U^C^y)yC@~SJ zIsGuD25EB0D~bQ`$YDzhz5iraJEXYWveF6nfHu7;A@wu0e{o6iHHbWrG`W98UIk8d zHRs?mi%VJIsR&oF%bA1LSY;1uAVImP@F-q(+sUKw7+>YBtqu+Ul%Hh@2|}@@Sg>@= zp$1_2d0ksR+H&Yn$ep+H=cNa}FMV#s5NznF3DK_Z5hVG-wzG|2eEh?1wD`^6`#wJy zaOa)cFJAnkuQe~U>h-?M>kf)5hTJt`>$xxAA74JpzohJo*W&Zm-M&akUOLca(T+`Q zezMy+U{k@gqG>k_9(lU2H`d$NyC2`3W3O8x)B};)LnWk^D;GWi zNPL2*fR%ud>f!?*pb{vueZ-Z&1y@dp16Pg}BBjvUNoqN@mDxYDI~-nTyfI69NDp8< z2W#Ka_?>_L?fX2=efZJGIB!A-{meN}_fQCc0jO+ND4+-1aVQLfpkDXFAfV88oY82= zD0ue#*-~yw&pD^hdfl7PAcUaAKmGW#{!Sc6rfH?a{VzVBOvXY8gL6)6h~tPpTg+`c z9)-HUSSr%wh7ckQ0?s+5Y&%|8jt_!S+wt^h0JG_g7RhJ^A%rTF9&u++CP7pL(6dyZ zRqw?~5=M`>^SD%;OvapZMhC|^e-PUH;>DQ^Ddick&+Pl=7GO7L!!Lm_2!s%fjt@Xr zjzcH_rfJcpeWeb95r7bimNdTy0QI`JyZ0&WOs}|DD(Z2%F}eiK`QhPj=^M~@LieCM z*~#Pt044w+Pb2`wn3R$+M*Z|GrCiLgvvUi;(ebeMrgwBa%;)(VrSi+^sqc$?o&)gx z`GhCONAo?roSuFy@a^=p@ck12Wvc;j@pjbVy+&IOLzd#cD#dN z)Rp5Fb6>%OVOs;!Xo^7EmBhAsN)5`5T@la>89X3FGaUL#0Z0I4TFpd0uc`!5&eYcw1 z++uFM?^Zi@7;RRf%}Q@W4QdUew54ZQ@X$OS-nZ+(0twT!&f=(<%MlXGJVXZT%5fY= zvB{9yG$E0}Lv!!5|2z+OzpDPyo!5sMu+0@NmWVYExH=Ccob($%g9j2w05XMB1`i!O z?7LOw)>WZ2s5N>UD%z|hZmna7gIXhl2Y))=7Yl);-}@41&T<)gNed);NN?I#S$b&| zcu4D|H4m?i2VD&`4@gys3?6hfpxmZuwU~Plj0lMg9)d!Vs(~t$jM7%$t@bul;?`uT z(y_w~9+K%eNC~9oY#14g7UrKH+Aq+LO#e@Ld|Tv{N7*pCDAQ)x%>5d)BVg*1a z37 zShCT$+)qg80_pEaWcX=XG-0IeHC2ff g<$>zMzkr9o077!}i~^YMrT_o{07*qoM6N<$f;#jh1^@s6 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/advancedperipherals/textures/block/energy_detector_east.png.mcmeta b/src/main/resources/assets/advancedperipherals/textures/block/energy_detector_east.png.mcmeta new file mode 100644 index 000000000..9559c00e4 --- /dev/null +++ b/src/main/resources/assets/advancedperipherals/textures/block/energy_detector_east.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": { + "interpolate": false, + "frametime": 2 + } +} diff --git a/src/main/resources/assets/advancedperipherals/textures/block/energy_detector_front.png b/src/main/resources/assets/advancedperipherals/textures/block/energy_detector_front.png index eed36711fd8ec6c41bde6391ae3b1e71f0765d7d..b08e24afc30663e4bd4674bbfe757d7a02bc93b7 100644 GIT binary patch delta 481 zcmV<70UrL274HL(7=H)`0000V^Z#K0000SaNLh0L01FcU01FcV0GgZ_0004@Nklay~f^Q@6qe+rcctVdax945VkID z=t3Gh0adcWyHKS_@qRFte@W;3=Re0g?>~I3a3F+mKZ)bG#(x_QAOP6!?pwmF!zi+x zl9GP^IZ8?|`2F%;2LMRM2>@kT5(Gi*ZT1XK-<)a%LI|66Fc^9n@>ND>caMCPdHkR2 zU$(3uj$==5ntu1P85ITxPoH^SG=vbf+OEF+;7i!#=Xm0+4GJX*qX;1c4Wq!#a&a=S z>vpF{GR-(U=zm+T8Aet?VA|svH5yN7cY0i$3`nLKpHuqBd(yU^gFKBmqq*-Ol zFu1wB(F$hsnRglB<*P%^!-&@$Q7Fk*;E6Am*?b1T&RW}dqiQ%j_R4UF=i$NsH(IUO z^7FrUG>rSduP64Bd%4w$?PIW9E;c5XWl6ru=yrRxZ2wbWf`V>m0Gru%y)eVF&2Qr$ XsblRS zwfiQHIM5n=0ULCSbs-~kHw<=rM%=a7vn_C}a0|P-<@f%+VJk{+o4j}X$&+t~kM2Ei zUsHZlb@3HsmZ~@E%S-<3DxLO7;Tmw`cloo=+X;= zqq|zb2ii}=AJY!jE&kp%xp-emPwm9{i^tZL?W=zJ-UX$@y~n!7|Ms}^q4_Oi->jQ) zx_M%Mw)F7Lf8_1nx&1_mDT>clsW7d~$8gu%>p36g>!NEh`>OcGQD<{@oX67QF z969<^k)jklF{o_Lu6?`a9Gi3b!tkwChpO^lS0B7#>R1uJ6*5pC@{AidjwDH|)#~^A z>+9=TmaVF)>MTX(4njW3M`~(n-oNFhw~7aLcXw~xxbcg8CeYC^h>DUE`*G)P3>5_@ z)>Q5zeToaTiM6v;5S-l*;%Cp~9RgN0p{TGj$wG!W&^a_2k4YMvbYdnk3-1jxfuSZu zpXtP!eF4-Zs{plGY!(vtB*hLIgCrTdvV?V=q6oRslL_D5FYr3c7?>N^* zYoSgB5RE{S+f^QTI)J2)$^=tl?OJZEb`2ONGuN09Az+$j#0-A2*B8j*jjlz-xMHFW zWCkVhS&Y)I#?0pePk@xb7L z%oY)nM1ak~@a0xKOhw9Z8*dNe49!D-D@SvjouY+`aK_)SicscUEH@v6M}RzGnv3v4 zc?C{ZIIK8~OydrkVQ|hy0TMXqNQ7cA)aW-`9q>9a+Crw6ff%PpWHk<_MwA3Op{4C1 zF%E({XEcebAQ>BDqsR(|p(wjOjkp)68dR)7Mv)ep#!!K0CqXI>N=S@zQ9vkC6hn>9 zvoLwsLe7vlBs5E6T`J&oSq;f@%!wJfp$1cCGT>~ah0oT@yyupBkODhOjs&8@A{*ofd@U)zRCW3ytthH``LiV_on zn$r(cYLF&}yps42j~uqN(0fmItwV~-B`ck94`|c<38|N<{fkSAuU_PVq{+Q2@)~fe zt2qakSzO8rPer(bUCtb|#wvSQ0}0ASg-7v{k*B|a$M{OGyE-)FQ+`HqNDxYjON8Q% zSyUe^KX28xkG35-5_07&|9SBm>$tkxhq|$M$48&;8cLFz-`G+&{p0WUpe0{!kNSUy zpl=R|(blb3@6koBn#NbKRW_l;oUm6AK;Zs{ZWi za`f3!Fr{e9fd0eIob8GAob5S;ZY)E)_Z&j|AwLhW{QBmC6^|N!GrXP#_bW9s=KlrX CPkJf< diff --git a/src/main/resources/assets/advancedperipherals/textures/block/energy_detector_top.png b/src/main/resources/assets/advancedperipherals/textures/block/energy_detector_top.png new file mode 100644 index 0000000000000000000000000000000000000000..a0c133c96477c51e0fd5194075e3066d4ab5f0e9 GIT binary patch literal 424 zcmV;Z0ayNsP)Zl*lW%rnPu-1|7K_BZs*_spPk12!(+)Fs%jx3a*zx2h6td2 z-p1Be98)+4Kr4;`D4eV04cRK&6|hYRV-}H0Y%tO&JoNJY3BYWT12F6+%-#><@y)d- ziBy#|z3@ez(;lQf07k0FJ{|+4J)Wj-haS|mUG)cSH*2r`9XLKyN{91aZ`ctmMOEBEMelSQH%=3~# z(x{kMhlmiFi2#$^J|ex@(3{QyqfQ8>9s1DM9<9lq>0sa8=I@Un4 S+9e7A0000GPM2x literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/advancedperipherals/textures/block/environment_detector.png b/src/main/resources/assets/advancedperipherals/textures/block/environment_detector.png index 3fc5af4526338d615a9a5b17678b13404f1d46cb..3f9a235c7d978f4658a346a0fe3a8f6e93c892a8 100644 GIT binary patch delta 409 zcmV;K0cQS&6{iD`7=H)`0000V^Z#K0000SaNLh0L01FcU01FcV0GgZ_00045Nklyknt|P9Sw&r@b`#mYJ)}m=^ zB*`rg_;HSP9bqyVJUR4cc*57_g8>&~d2-sv&*Klsa}w!->-Nof00000NkvXXu0mjf DZwtHY literal 2694 zcma)83vd%<9$!G(UIndCuu_zrWt39f>?3KjSsF^4q;0TiGfA`+>%cy~q-&GiWp~@8 z?a6uQ++lfWl@1RbH#cI{)0-=FPBV!35d@j;Z}NuVZ;5$bH3fcudh8@LOuAq4c!GY92MuaU zREh%xsd!^((A~6W>D+xQ!hghOU1wj*h{G+jy}r3O5BNrcM~a_ew{(0vH8AIq((4;v zdGW-FfAWW4*>`7KVOw3vMP!v`gp9!%-)}Bm{y_0fbI+f;`}k|e7B3y%yj4yHkkR+s z4{W&=Jpb3wnOWT0GNdH9C9yxePBP}MIA3)3OWVI+IJ^5lfBqoeuzPUrM_VM<-txWn z$2K15eX?Ej`Q|TKaMRz<+_(3kj<$POpXxZ!-m7vQQvI~p15UW z=V;wG_4{KR&drXEb%59P@$%p4`%PRKNZMx(B(sKWi&5OVO zz56$7Ix7FMY~|_prBm6`H?IAzVE4`!&xIdd9cnKaUD0t~C@uPQ@`i1nte&@1K6O>m zk|}KsudVpYloy_S`t9Y*PZyneufVqBu5F`*9iJhd)<5wJpD2BL;puZPU%0^?o?W(U zYTw%zk8iuc+>8A8(Bbjvs#>&uRz?5Vp0WNT{TI%aKU@2++QOH#Ur)ZhQi5-#GT0pP zEn2jQBuTs7-rCyQ+}zBvY;A4rOnyNrsHm^6_dnI_8EP0F9^Srv`*V?9qtNSDYSW!M zf?Pe*ye1*r9xp?X!ndSIyU`wKW(6f-<3xoAwp2oeXauRLO{tvF1q_r2F-dk~pYPm_ zp_1sv+NuI%K=pu5si{u`;l7rL(AOonM67nn^x~Qn3mFo?;LubeF6(T{jakGjyf@7R zhFTD#%Z;@Mf~ZH)0P3(gY$WbWNj)?MNl>QgX%+mIoFD>v3@7%EE;$z;-&wA&Od zMo=!7iy&!&rg4bC^(#W(r`!5rS~T1-l) z7TQE+QKFE;sNGuJdM*kCh=T+Su0uvDhc%?=kMH4<{LLqq1cxDVyq6%eeKF(1=CNKy z=r$wyy>84*kQEg{5?Sk(b~>CqM>_B*U>vxE7XZ#VnJS#&oTLK?JPDl9ERSE-4New- z$pe{f5+sQNhl>%a>^M(Ft8j>3JlhrOe4kOdJi)I*{b5MW;E;<^e7z{Q0&DI6|Zj82(nPo7}8Bs+`z^RdBQAz3< zdqhfru)qN+*8!8jC7PR0GbXJYm!lg3M6<66>W-InFxGNGe)atJccj0|aBDtUu+J;|;+*PB*k( z|AfoGf=5kS(M^y^(Rwe>EeuxWnKEsNOQ^Lgu$+*7c{IKRI4xA+mv?8O= zg;`{>6PV&7X%eU4o<~L~h9w!6uEz4z0IML(Ej7Qk8gnCpgME1$YRt`w^_$8KcdKe# z0$N@_EU7`7Jn|aiXFT%QGD4p?+2sytE{~%2!abnVXidr!OzkIJ(tOR50AyX6Sdo{3 z(_PIwxUAyRR(LAH73^~Mpfy*y!y3p?E*d2EU%a$cvM;}}%=_x%wr5+2 zDlvEsaa8Z>D-Q>3-pk#FhmZ|vPV z^UZ;gLnD6+ZvX8;+re87+BQy`JTQ4p@%m}?$oP)RcQ4*I95?@D_ptngAWy@rfrCZ#*n`FU`v}e z+S-`34+UwY7XcG5FK8q-s3{VurmY%ENi7laQe%y2c2Ud43x9&UFzlYg(uZ$3th=jw zYd&bdjF zb1xSIXwRq>?07%|4T#22@KUZM$&B@=cY8@f$RE^{#(y~%D90FEUA=C}=S!}=IBc`q zXbibmH;kHWi+kP|>@sx;fa#T$t7p1rTCCRDsdM~3Kh?f@AwR2{Q#ieQ2~gesH&V4n9v-YW%b_@crzr1jGnA`1kEnQbwNO=HCFko7c zx0pUvg5gzZwpgRyL_T7AYPwc<(s+39ldb7)cYkKua~cm*F0P?UgEA`r zJOm2b0EB{yIL#G@heLJs06zNQZH)(O>vC#7G`5@)@IVp-y9|u;AaKq}EjxDY{Px(X zBt9fbGGk1=+iPvgQ*U&!*5x5zAN24LC}`7Cjfb#WU9OZxa-RQ|-zM9rxbdwwqj(tq zz<=Ojg7J{RKE(1s_MttaRZugVN8K*=Y7*FsEV4#WjOD4SMZ^IL*aZv=R@A z_e)bwuc7V@<}^SL4}pTVP*4#pX2U)hJQzF}JQzGs!`cRE^OjAz_De}gW^#tZ>a)ux ziy7oU#N}c0mQ4U6{prymP!oFn2hvF>r~vW&X|2=q=Px22qB~bj=Rb;vN(YPLK}#_KdHAj=9i3JCXZ75yJfMpQbXH+* zDZ=xkBfeCAuo8gZw+mzT;rH8K07FZU>5VV(m1h8qnrxBrrE&k^c!}rLZ>o-$cq092 zYg1mx*B9TP22gangD=}2=}+?&t$*S)*Hal^>gv3%@la7+lh{5SJAE2sJZNcHLR|Zx z*@Vf*L)`e15Y5BbBiQ9^XIi#1jh2(X}j#qw|=Yd1O5@%?E4 zMYlVOmTmv?kIR?<{`6z>u)nbpkHy2r;^K+SgP;jrdvx!S!zo9;sGprW2Y*0IbL+Wk z=ecU<$sd}(Kk=g^$bzKzl}Q93Gy%@>?Jn999%* zj0Y{EOIP}$d8jKLME;C73hrq<@ResmK}E1S1k+QBp7S_L zHx?ITQt*)AK3^;k3GVa7@<9FrNzlbZwlfVt$NakZ=hLw~Xc1jaX*Un}4|S!3hnpNz w&E^Sszt!O3|F#dte(A~M;W5sq|MUIQUz-5s>F@2(%m4rY07*qoM6N<$f@d-$f&c&j delta 795 zcmV+$1LXX{45S8-7JmQ`2m$~A0FaSrHUIztglR)VP)S2WAW(8|W@&6?001bFeUUv# z!$25@-=<1MDk5eOamY}eEQpFYN)?M>p|llRbuhW~51KS2DK3tJYr(;v#j1mgv#t)V zf*|+<;^gS0=prS4mlRsWcyQdqd-uNg-FJY{s4&gyngBH2Hh)v`n3T<}N}*STAz}bP zKxUSaNH1pKJHGA_;OkwKXZfG|bM&csi_tX_@fd#N#Fv zNc_lk#p5^5MVAGhDVmwoJh4bD6+2kzU{*3U;%VZDs_B$3WIa|nZ*kTtHP)(=zc8HF zSJGUkIf6KrkbgiD5){->Mg=yawCbc-NYQ@G$3N`)ljKs!RR$x+0;AFrtR8>R(xVxFDs+pyfs>_gw z1XW!wmw$Bl)!2Vzv)KeX+wGRD%wWM)GbcpN ztU)6pgAX*AN`#C6%q*B0099q`>GT2`MZ~R$2sGY*+>miUG^NDb1cb4sZ;HkKjOW~c@< zmcHD!cjc>yNczJ$s+k2c)n{&H`gZ144m7$IXrvfyVYdg)z`(=jEh+0lYK8qCXjS>g zD;w{DLWL?(_j1H5s2$R#YhnO$&LQUvU^bhLZ;mW`qb`#O@* z{!lM=WYXGh+4{@Z-FXlCwLLyPv)!z%_Vo6S>i37LuE_J0da*On*f&d6DT^Z$jo5D1 zM%I$AE#Ui77zvwljKCMcBZP` z613Tq$-S|M@Bz@h&Vj002ENWP1HVGj@O8$QoU3wWO8uwYhn3(_z9=%jL7P1?wlP7Q z{aLVx{5KIG`xaB3Ae~xOqw5&}%(HoCctZ3CEIf~)J4n~Y_tK~X`~gy`(C*y(lK%hz N002ovPDHLkV1lJwy+Qy0 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/advancedperipherals/textures/block/geo_scanner.png b/src/main/resources/assets/advancedperipherals/textures/block/geo_scanner.png index c3be1ef20728866d046b80347cfce03494ced02f..6c37614cb6b7b4ff77f5afb2ad8027f586f35273 100644 GIT binary patch delta 406 zcmV;H0crlG0>v{FCRU-V&!15(w}18JIuB!`WIC3=Xw*g*H<-Pzsoc#_`J^UDEV z5RqR(Ykh`03;+ZGB$I>zmrJD>YmLEteuLJSfV|ihh+H9+f`3#B$#llcZo$>3eE^7j zX~R*BBF``!#b}KQ2Km-J3!WQkt$DD>GbGa)iadi<3av4$;u5LW8iI(pA(aZ2o$M~J z0wq$Za|PkTG50aw8?ANdL7HyaU4QUDLL%zELTe1tbc^Qgl}|@<$w*&K6GKvkEB$5*K8lCgMv#XT2IL-@(Q5xE;aH}5>)&ZZ%*tGeWRxBERRu-2lgOH3x$ zJmAME)-;5{pz~zkn(hf-n-2zD^ySfMA3u#hV7u*`2@kdeo&W#<07*qoM6N<$f+O#` A>Hq)$ delta 267 zcmV+m0rdW`1EvCyB!BHmL_t(Ijg?cojRheL+)8L*5=+jUAQ4+~9orQl_0Z5?Ns!~J-2H?P+w}|i(5k>^veUUe8#{uwCRk}OPj5%kT*^r#` z!1gmDell?Pp*%~!6Z@SG+|20itAjb>Z2X&(i1;o603+g1D1W7}l(M|{3;>)N^g9jZ zJ^FKBdZ4O|2%6bq(C@_78f&e?>HL56V2{}E#9Av`YYTQb0I*EqlM-Heus3Z#=P4{q z{A7&(;=x};dU~L$?^K>6?T#PpAky0cMZ|*b|D%L?W#_ehR(D?c`L3$`0&A|&bhNP} RKL7v#07*qoL84P5=M^32;bRa{vGf6951U69E94oEQKA1OrJ# zK~#90?V3+$8%GqzKZ%vK(@4$QDPH5$F%cxGH(=v`b&L;*pqJuHNuUJcTuLu4qaadlTj+1a};bFj4^0`c@cyFXz5KE zjh05hpC8W4Tayv^zvW`l3Fy6o6VUz$!s3mLv5HWI-W})-XfZRKb8i;J^oX!SHS}K5 zftHTQTaeEI0O)!brl$-U9suNX-i5JvOzMNCh-ZK?hJTkY|E`#S|8pUp1OGW?+uZi9 zFufOd+x1Q;3S8HPqA2pbICfn(7{U4T1^^)YdJC$`U|Afh%J5(eFOO%AL1x{zyZ;JcQqW`xTK$1V61m#m$~ipsFe?%Yx%L=pPvY0E7lV z9W8y_(|;>Rt7ZO?g}vHX_agXbeGLHM6w28aX)9-=-+$1Qvpr`64&njvfOtSW5Jo&` zMjj}B9t=LdfhXBj0D#e%sHt(U1`nQOSCLuz(;IpiHT9+3ner?Mq3d1v>cCiRIq-uD;=z02f%WrP zjo-t5EN52%#9(wLaN)Kqd7$`tP4zxtZGaf!Ws$ zEq@J!3l5_5v_u^j+xpdymHhKCwXi2hG6)st;P42PYnWalHKlYj6&l)gR!-Tx{_D1L8r$@__1tM&rT%U_X&~&@?<~?EZuQ0Of7vr=fwN QV*mgE07*qoM6N<$f)LyefdBvi delta 418 zcmV;T0bTyl2(AN=7JmQ`2nGNE03Y-JVE_OC0drDELIAGL9O(c60cc4?K~y-6b(5is zn?Vr8f0y|td@=+g0)=q);u>+LaH{`H&DqL>o~*4q)&HX^P!m(Ai3)`1!e?rh49iud zZ`u9Qj@jkyn|W_%XK&W)^(%n817K$4oQVkBors|C`vwySpnr3BR;yJ36gBC8`0;q8 z6EF-zQB=rP?MCZjvB2HwR83^90AKEo06gw*ug;V=5l}1F$>Y5WnHdp57ZI3QQ+1s6wsiwJHuo6YNT zxh!*_CYn#lac)*M5nwi(aXOtYbD$n5hTZn+>1r3vD**o-*|F_9>VMOX)itgFAAY|1 zo6w#sIi*CGQo_ub&*xVkNX3QK=X$x$-8mc%<;#v;NE=Dk72d(epN0=?BMF0Q* M07*qoM6N<$f>)KuQvd(} diff --git a/src/main/resources/assets/advancedperipherals/textures/block/geo_scanner_front.png.mcmeta b/src/main/resources/assets/advancedperipherals/textures/block/geo_scanner_front.png.mcmeta new file mode 100644 index 000000000..d6331b7cf --- /dev/null +++ b/src/main/resources/assets/advancedperipherals/textures/block/geo_scanner_front.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": { + "interpolate": true, + "frametime": 4 + } +} diff --git a/src/main/resources/assets/advancedperipherals/textures/block/geo_scanner_top.png b/src/main/resources/assets/advancedperipherals/textures/block/geo_scanner_top.png new file mode 100644 index 0000000000000000000000000000000000000000..c4e38cc3becfc5e56171a1ba5d1f2be3328cde06 GIT binary patch literal 412 zcmV;N0b~A&P)ZAqwEdU6b7KGYZ+q|Z>iU;|sH$BNkqujHH>3dV zqc(PCd5(7ufGp1e@XpojhH_D^1K1;mF^fp;ZZOg`cKUgF0$@Cu0x%r(8Ev^2&u@Vw zRaH8j;}B&3{*fZeqKH@vVDxaisX?>0)3b9{%PQ1*6vg<#&f@V0+M1n(RovJPMv4*EeTV{fYOXBDa%I+VoGECX}!&ed8PcfmWi7BMct z&niSDM2}$(P;X~qjPc|(Gq7?D@pPu!jPuWVU}}zX6QKmd$K4HCuZ5pgWW82Rye341 z)IR#B!3BTNLh0L01FcU01FcV0GgZ_00046Nkl%WHcNk52~#p|uW6 z5YZX#F#r$%Fq_U8@VQiqF>4H#%WGI;BJy%qBJqV(3Q{S|=6?%b_6xo~?E^p(N*j(+ zltqr=D1|j98suAxJbG?IL_Am)IcD<($|8qU3f34_afy_OAhg!pkV-|%UUrw)krJuY zxq^7%n1@*C4H3m2WZ9P84F~@t)LM66!5V`s+v4rznNLr0$;ePm5;o-PI{INQdl8cg zFF9KLBg(QZw13uTeh@jw`-Slen0 s2AwB+Yq}?VZq^L==*y$iA$}Uac1-LEWUZXe00000Ne4wvM6N<$g6|futpET3 delta 406 zcmV;H0crlI1F!>-B!2;OQb$4nuFf3k0004MNkl?UCTd_S);2-5FnPHk%&+U}gXS z5kXZUB4B2S2&$@@#q16ML}tc%y)FS8{?dQ(uImsja5x+aqJIrz<=NQWwk?<$(OzR_ z99PQ`B|x>mfF5wt9@ihAg+;JK5dqP#Rqe~#5-o0ELD)Y%O z_oW0=Bif;t@3>kzHj^hjgP9K|sV43Hxa0#&_-EPa5H55-X=UkY0Rz!qfryTxZWDouoGynhq07*qoM6N<$f`5Up A)&Kwi diff --git a/src/main/resources/assets/advancedperipherals/textures/block/inventory_manager_front.png b/src/main/resources/assets/advancedperipherals/textures/block/inventory_manager_front.png index 9d26f1f0e8b6fa1eff0a272ab46fc584225be71e..932fbf477dd15f33125b98b31933b6ad4f9ea260 100644 GIT binary patch delta 449 zcmV;y0Y3i11KR_TB!3BTNLh0L01FcU01FcV0GgZ_0004vNklKH3xk^jLXxd2LJ>BvYS~+2s^Fol7Cxx9!%51!t)}@N8?eD zKsZSd%Brd=L^$WtX*QqHY22cCc!_ekg2RI{7-O(3D{^)|dop>7QW`1u=ygllNx_z7 zMXE}1&av>ka7Z^9nLR0(F(zlkIfquQ)t9De!ExBio>flRg+dXI!-5%zN2e#pQmOIO zM6r-htm5weL4Q`QotvH$2Yytp%yD!y}dRP08 zf0@J`yTOZbaQLntTo3}^_dy7e_rmvmUnV91P%7;K00u(_!w4(LtZ!gCn_xZ<)C_}4 z8vxwl04d>2XA{`hSCK)zG#&u}-BufhLGkhS4#S}6wmRDKjkaGYFL(00QY{WuF%J8u r7qsx*`vL&`F2cWUEgfz|<>UAR2chd5GSsh600000NkvXXu0mjfGFHjI delta 424 zcmV;Z0ayOp1HuE4B!2;OQb$4nuFf3k0004eNkl`$SN6 z`0gz_j+K!}M}L3cI!Pl;+irb964LD*OGuej(XFX=#>HDwCF#i0~Iclm1}Z S*5nER0000Pe50&NxO@iYbr3buEM`VhY{1ND z_Papl$#=nWQfxp(aMpr|Fwn{_p9RaJ-tB%<)t;!mA*0#Efh6d}Bu%4RaMt=J>Jpl& z_Czgvw<{> zn+O2&m$##%d(25FVR|u*mPezzVEVrS;zc^PzJ03>0Dq6n&kdzEc7Xr@002ovPDHLk FV1gtFu!H~r literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/advancedperipherals/textures/block/me_bridge.png b/src/main/resources/assets/advancedperipherals/textures/block/me_bridge.png index aad32c54be8ebc67b2cd256f572f5302d386187a..0f33f12f00e39b5288f90bd3a6a609bd8d0542a3 100644 GIT binary patch delta 412 zcmV;N0b~BM0;&U$7=H)`0000V^Z#K0000SaNLh0L01FcU01FcV0GgZ_00048Nkl-4)7D6*H)z_Lv2=RFJs-vpeu^Cuf5Z3slL!213~}AGHP`$7?@57k z4ozEQHoN74FwQY!2%}N&$)U6T6E^EF27C|V3j}<@n`|bMQXhLZK0000wOTdE0b9(30 n&gu2>Fv)Z=HF5RuI5B)$r*-pB!-^cB^B6o`{an^LB{Ts5PYi43 diff --git a/src/main/resources/assets/advancedperipherals/textures/block/me_bridge_front.png b/src/main/resources/assets/advancedperipherals/textures/block/me_bridge_front.png index d9ee044177bf8be9e2126921ee2447c5203e5071..72745ec1bc7fb0c334ab4dda00109641b6cd5c09 100644 GIT binary patch delta 1657 zcmV-<28Q{70{sk-7k|JA1^@s64b9_D00009a7bBm000XU000XU0RWnu7ytkUFG)l} zRA_20U+xQ@nU5|ZtIZ4;XqMU7S4?smb|)EK~YtDY)&o}?($+~ zgPNu>@Z=_|TNSAbd$n4nrfK+cNwVIM925ex-VlnaQgdr^Wm#_s1(j;Gie0QgJh9*1 zL;v<3@1M9rA{1tJs7r2bb*q9em*m0Ok)0I)^t*dl*nhrBYFmTs@G%z7jmWKuU!bOG z`U)BcEUVL5DXS~)w>czS~V7F7R*Rk8}a$L0Q^|};n2RL)) zO8{10Eq`Q6- zd%a$lH~jY5FR)=$RO964_TM#4-@=Q(p2-ezeWIv_iR~`?=`T(jIxHUSELm9R;JvkX z<3Tu?Ksm7w9`weaGCDIw%pb(r+f8=(nB1y49)BeD?Kpe88J(Gev-{-1>`;YTpTz^y zJQ%h8ZkYJiJQ&;h&f>vA@Sr#TbbmbXrIt}tmC9n7L@50BJQ$ss0$@BdjWVZF^S%WS z218*gi)AL~QbauwI=m&x1amw{?r6KiTVir91#`$%nC5{mwXEwTWAVW94?Z>z#x7so zAAb)9@2yeOG%Abb{qdl(SVmD*Hghgw{-6ZQo;>iSmdPg3EfAQ<$5DzZwTwv~0L1)3 zHghg+6>l@}lP(otZLdI}ljsR`IsZgNz1!CV4P+`6`vgGElO3faM>2 zJRXc)z6!v|h2j12KyY9)=c1-*4BlGmems*xLDyqtS#!b`{kplPRfo?$P7P$Sy z2Ms(Jytk&GA$H?I)DvOp;YseFxWd4bn*fptLSJopFgcgfwe1Epoj?!Hj<8VN=0OIO zvnF^ja$%UwoC`b!vU!a}C@eh`uy_ELfAC>=FmhoSfa^!ENj{k3fv|hQfpof4{(s$r z2_6W$Pp3N#@kAjo5em2FK_V0;oJ{BjM2mQ0UXu@a)YpOsjf%U}5Kk05=&?CD?=Ju) z5}`1oGgC$$EJjYj37teDTG7Y@fNWlaJo*Wy9S=n0;`-5R%xBy(o+u(2vqN2g#RIVX zgM;NkA{0hZRjwbs2JFNSgrBe{4}XN+&u83*c%rbOam_OJuo+$i;L@3;v2YtGt>X=dO`XckWt$aNb{_!&_oJGYwcgu>6B<0q~x9 zAXu~40{{R3C@l|D00001b5ch_0Itp)=>Px#Do{*RMJp>SFfcGP zGc!+5PfScqIyyQ(KR*Bu?*I_@LPA12aQ8N6;;5*oprD{M)q({|Npy#<}#RYpp;-lMAcMOhD=Ew#L}>cMOJ23=G7jn^~$#I^UqG6zi2I zE1mOu`$t45okK*n1cu45>y5JNP4}~^Kvn$-MIl={-Js{{6T-w!9M?{vbZ%>6C?Tr~ zM8va)umq?dXIoW$2c|RZz@Csayq(dZ;OuwiD>bij6JCPhZt=mO)g!A42CZJrye33s zXClDQ#p}_ld#n>LVSF{N4Nr*XfQ8>9s1MSy@jW!^0DrHp(jeYSVFmyI002ovPDHLk FV1gV*wr&6b literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/advancedperipherals/textures/block/nbt_storage.png b/src/main/resources/assets/advancedperipherals/textures/block/nbt_storage.png index fb9f580b991a40de34455f175054e7109ebc2aab..339272ef82d8c6e74b1b57bad41ae89e1889c84b 100644 GIT binary patch delta 401 zcmV;C0dD@I1FHj&B!3BTNLh0L01FcU01FcV0GgZ_00049NklGYlHT3@!yZ9s zt-}&Tbb@;f00aQcrZWb7E|p@;8iVEX64scAyxf*Zd?A&BRDTMy`GS}Ig0GMJ0FZ>z zhNBc^kz+VYVU39f`PL$jo|_O650*ua*?fVr$RU-2HHKB3BPAjTtu;5KQqi)P-Q{(p zL@ITvAYM4+Ar^W=M6m~1wqbX}!T$)g*4v2;A)o{zTG_{qPK_!~afZ#>}7w$)tMO~v(g`+HE}oI~AIm`*QvAdF+I vZ8Zji&Xb)r-4j07?+p0p%Y)M)ejI;Cq3y|eiP7Ky015yANkvXXu0mjf(*VNC delta 393 zcmV;40e1eY1ET|wB!2;OQb$4nuFf3k00049Nkl++&k!TW28w-k)tqlj;WHW2;jK|)yuIs)5Kve+%B;oETr9f3t zNWkbR@52||#~d7zX>zE|If(iq;JUp? zwt6ON1*B=H03>;i`QV4M#C0000e8h{ z|9~!)Sh96t&p=+2E}4O?#70+ zr861I<@x9V08gGi*|KI)yJcDOSSe1Wjb#^^1g+Xb|Iq0N@FbJ9!0aU9%@4J^w-Td#5J$OQh%8mW|t zU-L+%Ov3f1HvzC(Ta`^Sga?k}5O&!FhKbReBXB)*KueqQZ3k}jker>PTCFra5bgxE z3R=pPwTT*2n{1+I9LI@zL3EF97tqosy4!xUu<2=&z<>2*6NF~~6pQ_Q_2n1x1<}&h zoSkd?Qfo0F`VCl?#e)a`#`<5B*55(vHDjr|6x~sc4*rrKT`&xM-^VZvd0m|QzTfV_ z;NTDd3ybq)vljKbLpIy=SHW z=AV`Tn16p-lC=sC_U-QjAXPkY;D<~$3&5l4XZXI)l?Qoz-=|)87#tj;5i~e-=v_iW z4jz1m#ldepY>SP?Rvw74ziS@oX;Y4U#RJ6y#eV~(50pMoJWxD{*DPvR`atnOG*R(D z@j&SV#RJhq#RJ8ISEmm~@12)7&mO(Z$enY{9=!}C)CaeYOf>bu${M$hOc1WRo$)|3 zz;``#I}@Gf6%Rxc_Ye=hci_h?yXV0lCW;5VjyxE-b57cJ#e*A%FGU`#x@|nrH}l}w z+pLLAMJ8MlMn)nI1wdhi(_*3Pqd*wTe_IqIArIz%bG6Oxw+h2TC6(9=rk` z#Pq?jxuyrA#?eybMc{hq_6ziZ@IbbC)r~Pi^vt$A2!rMWbQ{SC#RH`e_7D%cZ=aPH z*M=wQzI~SZ$TZp6(?E{3;mMtO;GMY+K!50Z7`;W@u^F^{WEZv_d0<{U)z*~y$Q0Sx z)2t0oO52Y5z&mrDp}qm!v6;5oMKoixKF~MwpiwGwci}$iUr*xAm&yEol18bFzg#A$ zRS0So*)!X&7u>NKc`m$A`atP}t$L*GCB9xfc&YjT;IH?7X7t{9IXfqcADCA^!GHVc zHyRBO%?aCP=S1;?p}ql_y8uM`AOIO-gaq+}y9@WJfA~w(=2f@z_<=h%L#XAR+thji zls?#lJZRMi(5expfCT#st+TUt=DM^c-d|{}*W~OB&={GLnqh5tGTDCPP~QMIk4I5V zp$~+I(9VOHJ_xIoE%kx>=&{lVRez-q-XtERQYP8i)6_?%cAtMR)HeX7aiFOW#OFl$ z2X`0l$Miv?;SsF5F&@O$3tGOwP~QN@<}MIwIYvw41V)b0f4<&wy|AM`2t?$<3Au6j z62Yq5)-x~E2f7U*pywkF7`=)IN+0Yw9*83J0YH6ZIynz+9={xE@nIT;V!v6(h?BGgJ^9tedJwS5YAxx@8BYf<_@>4QDY zgQWT(wq6jUakMm!(Ocxi{I_WNC{HQTdZASxY~EkkN*`>yUJ&sEKxRPbTEh5&*v)9Z z#jvyZL9i+RK+miAfzk(imVXBj-(T2DA8gA5cWfrUzt9N}wws+3@j&cmKorT-@`cXw zkv3}qm5-$K!JEv3mli(&I?GQC*Wt$DOL7FJQf6oQiTd;WWZ(5bQ~8OC2Z{$TEq(w| z+(48>JP@<9mNuhfK8orm=7GEHwedjI4C?<(TNT9v#e>&0|3Lk}Q5x~!4ducALSXe$ TUN)Kc00000NkvXXu0mjf$+`fJ delta 439 zcmV;o0Z9I&48sGE7JmQ`2nGNE03Y-JVE_OC0drDELIAGL9O(c60ewkCK~y-6b(6uW z6fqD*k5j28Gm6MO2i(Yfz~Jhw`~VUB0l(ERaP<%u?nY;+pbqGR?$DK>i=oQ2PqXRH ztyJ!;*-ql>JRsI}fx)KpYBm%Wo zn$1jO;nj=RJb%A_$$FDRQA!CX1z5G#Xsw0gUhjI7DW#BeUX=2;xv7`#E{hIK-wSVV z-Y|{j5?ud@yKiPja)$n*W;5fHYi?~u9u72{5go#0R~vKS9{7R#U)~2>KNG!z#T-OS zy52A9{Kp)4CsN;m)5mWyu6qN_tfy!fzlc{u~bD3;O^7002ovPDHLkV1nQk&sG2c diff --git a/src/main/resources/assets/advancedperipherals/textures/block/nbt_storage_front.png.mcmeta b/src/main/resources/assets/advancedperipherals/textures/block/nbt_storage_front.png.mcmeta new file mode 100644 index 000000000..9559c00e4 --- /dev/null +++ b/src/main/resources/assets/advancedperipherals/textures/block/nbt_storage_front.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": { + "interpolate": false, + "frametime": 2 + } +} diff --git a/src/main/resources/assets/advancedperipherals/textures/block/nbt_storage_top.png b/src/main/resources/assets/advancedperipherals/textures/block/nbt_storage_top.png new file mode 100644 index 0000000000000000000000000000000000000000..78f6c6d3a6c8fd2013aa63d0b24f7b52ff059f13 GIT binary patch literal 417 zcmV;S0bc%zP)_k&Swy0>!9GkaffXR3YKt3EauJ4}S zy-1>}^m+%LOt6Ya~!Ek?lLMO|pih@p-MdsBZ zB7Y_VJiLrHs-w+@kH)gMDgfvo_M_nmQ6I4Ie**C!{Wrc%qYm&3p%c)iV|#v?00000 LNkvXXu0mjfR3EsI literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/advancedperipherals/textures/block/peripheral_casing.png b/src/main/resources/assets/advancedperipherals/textures/block/peripheral_casing.png index 20aa776eaa3b48670fd131bce13dda089b81d1aa..258a10387edabe0d804a443e00696934fe7e717c 100644 GIT binary patch delta 324 zcmV-K0lWUP0@DJJ7=H)`0000V^Z#K0000SaNLh0L01FcU01FcV0GgZ_00036Nkl;F|+El7maNrrsdH??v4!{Al6gFvUv>aBkoHUtJJ#p;u)Ok3cUT!c* zDcKOryyG(m00aQfPmfBBMA$_18vr(ug3tK){JIwafa!3!SAV1dqfn8U3ynmWyhqv+ zzJGoJ0L~^74G3|?bbS!5(gt+23&$x!5(zEQzdmY7k;ZjP)Z1%GCB=hxH zj+r$$&U5o}ZJ<>~_V-*v*d_J~79P}zR$>cQfomnVcA>>FGl-d+o$DpC=R||XE_+}v zv^=n8hPbK+)IIB3qaLB~Aa}?c*z%+|f}U(5xGYOoL9uKxmIYql-T{4nJ@ErhQ#;j|doIt^eo-U3d5|@(`1VZXlQiKGAQUuBh4H=c#*`{u|u;I#;5NEcD zU%Ebh>I!mao7nN`Th}KeX0~Tvw$02mj*^vdIb ly*?f$nJ%U#t{xsIhEMCXZvJUlkppxdgQu&X%Q~loCIG5IWUv4L diff --git a/src/main/resources/assets/advancedperipherals/textures/block/player_detector.png b/src/main/resources/assets/advancedperipherals/textures/block/player_detector.png deleted file mode 100644 index 0ee0bb55bc3485ff003df8bfafccf1a38a0939a6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2694 zcma);32+l-6o7+AQLtD+Di)d9*=jA~X3yr>NeF3D+R%oEHUf4$*zEpEmnOT*?zTy* zj;QD;auoql(Lt+#Hf}tDO6J@0Mp4?V9O(wtWARlI8c`@%`GTkKOjko23(L!3#IKY`2Y` z*z#KOYcnPHIy% zuYU2j$BHn9nD(gj#S!-%S3p@yjvQ*77@F(!1Wq7t>Qm-W2T%?0R6)&UczNELu9&cGaZX*XKA^cE|Tz zUN(ANL(hi3y_?s1ehuT7VSSAYo_jA2R*_|E{X6H~e_i)i$5$OJ?!B(;^hea6(E-n7 ztM8WDwMQmIuO8k1YuBG&B)3X$Y}~%$%Egrj9~pe}RqrpwcP2Ux4?aD3*CcOm=`DR# zXMP%Sa>v7O-FyH&9ojJ__Gs1qz6X9TZ0^{7eA#!kziUASt>lqm#3 z&@^3NUtd>O$Fi))T`p2EH5XloFGSlHI-1Hw#DM|q!f;C0Xh-^F;Q}(-*4Z6BBJ0% z=TroVpyC6~Voiq%8arl&`HmLeDWIOIg`-?477`Lb=a5t)E@^DajhbK<-Wy^ZMNAdF z#f{Dlh7g~u0)(+LRsyR^iER`LAqe79g(%zLpPqrhl^bo=b%n+8WHM<@(pFiG;iS{) z#0d(gC=6;~TDzokDNNEz(~u0t4>VpC6I!db=H=heU4&opIookRt=5%#2`uBS{D}Lk2S7iQB{IuUoYSMSnt)RyN`jo!GV-vP0F63l z6p6GEPQu|N8Je*(6?Pbq37QR54R)*nBMB=-p@_h<(;M81E3h1&et8<#1_U%CFcR*0_Au#SNs6UtG_M&7wX8=mk9Kd&e(2xE)J3Po)T$Pwts zg4J6-+;ZSR*jLbba%gDr;@Q;&oevHTEgQ03Sa57f_hTYGW70zO$rt8q+*(4FSFbv; zt)i=NQ(0Hy#PcVq>Vh>V-@kP`-BdUsjPBhKd}3B~H*(G4Ssxu9LtWo9Y4?2Xf~G6h xl&mQp#e8_E_t36Gy`A1^v!;da>GWP=x%S5?^6ze+@t?#JsG8~DTsiOFzW`8nizNU6 diff --git a/src/main/resources/assets/advancedperipherals/textures/block/player_detector_front.png b/src/main/resources/assets/advancedperipherals/textures/block/player_detector_front.png index a2ee80d4311935eca2952ec49f234b197b2004ca..cb29846f2272811539e2bc425785aa14ac33a0a2 100644 GIT binary patch delta 554 zcmV+_0@eN46}SYD8Gi-<001BJ|6u?C010qNS#tmY3ljhU3ljkVnw%H_00HVrL_t(I zjct=nYt&E_h9Be2#|?~F7+Yr}=t?WJi>~?~Dg}!oU3Alx8-Icf-4wU}1i>P>lW{W( zw*{wDO06GI5d45b4Rku=)I}zDlBw?|CvWaK=RN1my?=Cn?cra>P)ZdcQpyWl znJ*v!X0FaqJU!nh)fxcL_W?+?uJ8rUdS`h7fWyy+m5;`lyn_&xxWK}lg^7X!-(P

NX@>7zCiL`lxA#iuG)fnn9+RI!X2LxLXc{WloF@hxz>mf zLa@ELiXLV*8KC)Sg;A=By8*@+tH6;`l4^|*!YWvK`huO^MVq{{yU5zJm$;s9o26Rk zODvBNcLRhFw6-=_U(R^<{u2P}%h1}|V3caWt=Q=(rGKmf02L3>!;H?}F*V1f=D2kB zj;)&99W!wu>P1AosNzDieFT8(`QxtecFYyn|FEAIFvc)HpZ`@I4mf)35-ugg-GFc@ zwh3`JuyOs`ECA83Q$!)XKRD-J`zA@E2-=b)QSb(WAiq3GGPzViAnm&_#?T*}R}PgA sm*Z(}lq2fgg`YpZS)xGMvNAu7f1wZcV0xoda{vGU07*qoM6N<$f(m{Ex&QzG literal 2776 zcma);3vd(18GuFGlmIaVhz)^;Do0=h&gmXH>v1Dl*piWjWm~mGATHx@x?9O-OFD6P zvSb4jAcn!vV4yq`C!Ih8Z7DQ0uNd37!z&4Cnx+Nf&fqwK3@#~6nx>u5dJ=c<^oSs& zv1U$pyZ8U!|JeWEy*6)^D{uUa@fwXL&t2}Uf%gZM>;CV;e;qo>r_qdghIcr;Zihqb z6@?%l2Jpq(JGWKnoIm=(g{KW0seQjMU3&HWEBji{RXKjHd+R4N+SjlAWY0@C>i*n2 zdu9bV^tjbnH(_SuiGmZ0=CyC%`Evemw;dVj+8?ah-$B3d)SzYXUCZFw_e-uEyLwUo z%B`NMGoNjEpVRr_%^jBu&d-@U z{0{kLaL_(a?^sr`=i2n(!xIKR-~Z+NiIdS&2fMdEw5jy+PltMsm;Ae6Rix#;p_hhM zKT>jj_Okx6k$;Z)SKsE-PhLWXy?qlyyUX6{-|$&peaq`Nw|rcYPd;;#>Ur^XQ>Ej2 z(WO5Wv<&}c==Q`Zf4Y1-|JKJPD;IVSUF_*TaO|Z0?b}~W{^I*Hrivd?p}#%>S4Hr8 z{AGoOg*c8I42J6JYLCZ5)3n`gFCQpgbj@BkE6?!Q=3DjY_jqkTk{#Bv#~O zGA~563YG~7aoL7IKU4?d8@4P7C(?XntkNZ!!`yH{!GNFuM&h^`#YvR3C^4jhi^M7` zvzk#UokN&SEXl+$LXTsSNLE^s%bLEjb5Ci>-y8#24UmMm$bzya5S3?VjK#unDc4q9 z0?L%?YnTgS&`s51M&9MF^k(IitcCbUOqEt7Gg2Izm5Ig0u=<{3F%Sk3Xk3CsA}cHN z!LQcg4*!)mcNm8zvfMi)GkH<$!{pIUfsHGc+)f*!I7o8>%X75)Xu??|ffGR#03(G` z<{}(5Q*aSXCW5sv1PB6_$#C3JNoJxfP&kmR=OKhL5r8xi3>x4F4yC9dhcafspau&8 zZ)TGL7>pVHYLSO!&V+OQQ8*mr1gIcsEMko)OIiq&Vi`!ZKn`O7Ml%iq1Zx0@R>?PA z;&s~)Qje#H-Y_Ev1u+7IwF^s`kQU2MTCs0a`x@6*FC?N_K)NZvje4h2mRTao z2|;YE7OMjdfR#r}{U)_6w+8NUk}Nj6M;-n>G_0wLE{7yRY`)t!A6Styl}$4;QHEey*d+!d8ZdDt)WR6pK+tG3 zGfW_(F9|_8!HA$F1nUKs1#CFAEVR0Gea_2BChCDwd^m}t1l;pXe!@%>BuyHSoN9nk zV9J)78=F72ybGIdjk|qwHY~qOe>< zcobiA)xr-z&5LeliC^cN)801a41T}!(Q&R`q4Cg_zm4?0vwr)B#M!OjQRK#%a}Vhr zxU`}Cdu@xR=1*Sy*v?H`4%{%0*#*ysxXV;TOaBd&4X6&EGk{<2C8II>ED6x9Zi^r#JrW`3>#!r|+G%?`XTcZOM=K t9zJWHwe^B{biDJzv|D-NS{I^!`rxNye@Jv~TdsU@xXY@XM@pBk`yV(6vVQ;o diff --git a/src/main/resources/assets/advancedperipherals/textures/block/player_detector_side.png b/src/main/resources/assets/advancedperipherals/textures/block/player_detector_side.png index 19dc3a6e872c1b716e6b355a8f0cc79a4df75c2b..adb368100670958810f1e59ec0d5b624c995455a 100644 GIT binary patch delta 410 zcmV;L0cHN!6{!P|8Gi-<001BJ|6u?C010qNS#tmY3ljhU3ljkVnw%H_00CP`L_t(I zjdfB%PQx$|oJOwQRol=|s`3lqP#yvj593E1cn5+a(GWtK^jYL)7D&Xx4#Dk&N(z~ zjoIvy2f{eUx=v#>>OI+6(?8*J{my`op*%Pp;>Ym^rV|qFH{3I%r~m)}07*qoM6N<$ Ef*dil(*OVf literal 2776 zcma);4RF)e9l*`Djsgu7Xaa?mxuS4}RMv+Tf9UL(#14*$lX$WDXvR@w>Df_YOGc7o zC%_eG;0UY)7@u9%U15c74AzCOh9qRi*IK%+>jpHtgQkTZ869iabvwA_+U!ZOT|?;_ z-^tQ@`u~6bkN5w-r&fQJCvWVuu{xbD&s*-Uf%iw%>)~(1e*-!ppwo?do_D$YUYASn zm&7n11@Oh&JGWIB+&}og+Saf9WY5btm;I$@ z=JX11=xMuo*|_NqCkjq1nA5g>=PUWY-F9TCbAPyIe>?rtXZvma@7ns;zF%_X*wu^1 zS8sPup8i7p8@C=m{NKHgq7*)Fw{WVn^=|pPjvF_2t*I61g#|;?6Tf`u-Ig`8?R7WX zyZ_l8@2@XDnDSVo#*gNF5cpuc$7opf8)g6RuuZ1o(F?VD~UOQq{Z z(WO5YG!OoD;O_WIf4+P-|MtfvE9Z9%TTaO|Y>?Yo~({QSGqCQBbtk-sg1t0MY+ z!Lq`_LLA3UCR25Fwa@3HY1-*@mR~DgaNSurBhU2I#L~HwoOAP^o-zJJYqV#JbYa(; zp3PFv7UkECwZ~dwzgitWye8HzE$wQR+Iip5&`^z|_4vxj(UqZ->!kX5`00(&ef6GQ z&(2Gh7PT!aUbITM15J;Kmp>!xbmJzg*C^eK?NfES(O3B35@kuHk7mV~k>SJ;Fs5R0 zD6P}kovAp(HULE*0uf$tAfI&gB6^;4Ad8DC@yfUh)bZub5(qR`1=;2X*2W>u;=Hl; z6b%V6pfLJWEGo!!%7JKL8a}Jj7^2rilm-W~q|&cVzs*s>IyNb}XPMwb;1^TGiI1A+n=iQ`rjCsER-#xNXQEM8fe z)fD7(4q-O26cfh?BaX#lS!r1*Yy8sA1Eu9)QygG5Ko%1c3(6XSpv=q|i$@c3uC0U& z)G5u^C>O?{o0`RpyvJMV&&sP=i}10yCap?lq&PM!6HiD{?LEh0APQp8xD1IzR#xG| zU#`PF{;O~9F%C^+x%WtB@}k;@$)nvOn@}xz-3~-`kmf{|=V6oXyE3!Ipg)AK<-1_BDBCW$cPHr#3>C=+F&iY(9}4YUYIGOSn? zM&L%0MD!d>&xa@mmJlCfA^?jE5k#+Mo`%lD6f$awL!cHC?UDeah*D4#qYgwx>Qz#v zGhlC|3!nChtfr|c08Z;az4p_(u#}1DvFxNB`zE!oa07K>Qpf_*P5DjKdzG@x5=lvl zQbV;=9jXVcGE(Z-sb#q}aF3G}smVLy@E@RIAFk+fND`%{`+W<56**JsG(>s5wkyyK zJG^)@(+D^uJ;~NFLIl7q7k1#V82^AO51AOV8Biq35G)J3#AHT87S4j&7!w-`o6S~+ z31#$UF{~sR36w-&y}+`74X2fb-jJ@(IT^`h9Z-u8CvlX3d!8joSZRW!NfVM&4KNB! z-BNR7v#T2sZ0!5fU{^OQ+N)M>AQ6v8c_8KFLn}3i$${Ik|D%yZOBedcVfQNxvs_}l z3GM-PN_A2gp=)2GGR*VwED&UIWI^61Je<{>gG&o;cov?Da0IiQIcU{U_OJ#5EEfqL z#n(Nx@B>iylGj}lGz4a~wN5&NKkR;TjHgFzICSOjL%r{;-~J(Sb}M)ixq0T?V}?gA zZ7Bav>w?Mo6Bj}Wm4xLI|3w73ZjiEZ&qu2g1!SmUl3=6MT z4ZL~0x3i)C7lZhFgDddO-#WkJ_wtL&MBiG&s@GPZ-uSbhY-pQ1b?=mYN86Nbi+{NH t@LB7Otrw)DW8D{~+|HBMdJyAt2R|MCeWG*Qa`lVDTUO;hQo4NI{{V32vAF;M diff --git a/src/main/resources/assets/advancedperipherals/textures/block/player_detector_top.png b/src/main/resources/assets/advancedperipherals/textures/block/player_detector_top.png new file mode 100644 index 0000000000000000000000000000000000000000..e2cb43a5d5b7417002354e2335d2d0295f7155a9 GIT binary patch literal 416 zcmV;R0bl-!P)&b z_f4oYb{3YDz5-W>Il{kXuhHU|W%qzDx!l}b=KJQG-8r~_c>H4xYpsTe$W|`QD-1yU zq>aAoNkZWq0QDpRpl~kAEAmNR66i+=RThybR;Z{6i@shz0hnbS09xsIXMFQ==|zmS zmTvddlUzMrM_p7szdwI(&!Fn;|0j#>hzbx2G&}CLMCL>4zwUFtS3n{kHWcfh@pk$ zuz`qp_7GYC@p0BvF}!(U2l|Ah;q5fLlA~Px$aY;l$R5*=wQ?W_|K@ff3+rfi0A&|x%^<8LOO)eW%kYL&Io1Rtx+V%w8L}ZYd=ML&z^uRXn}lLRH;3Bwb`<>prmlEMd9WI9l$BoWZ~c zK9X$qgFesrz$Ov$32b*Ow`<;({r|;!4PuN4F-DNYWHLE h(~L1XlbjVv`~q54?tbV@W}pB7002ovPDHLkV1m?L!g>Gz diff --git a/src/main/resources/assets/advancedperipherals/textures/block/redstone_integrator_bottom.png b/src/main/resources/assets/advancedperipherals/textures/block/redstone_integrator_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..9401704adf19da9df89144b2459672a9607a2a0b GIT binary patch literal 420 zcmV;V0bBlwP)gE4{GqAprZm18a0T z+c=k54d7fB^*z3l&uRd`@6UI1sHzo%NK||5?CvcUcsxBk0&w4L05DF=we_SwGJCQp za+3-$yt<53gscF!uhZ2G>fS;nIoA|mGX;%orG?B$t6D$j`!DcEYZ+BlclhpK8a0g60FRq1Jb2b{~Q5JL-z zV1pJ#&UE%@7s)Gt_;<>p$V~x2Hcv?eu0P)BY4u?pUY&(l$IZzpP)V*|p|U@0e934JYy6D> O000084P5=M^32;bRa{vGf6951U69E94oEQKA1%63H zK~#90?VHbQ+jbPdKUQTsa-$?lM-(?sXhUhpPTOGYxYG_B?6N^mV`bZEl&yyy3S~HH z8H0f-jIlppe?y^%!C+(TFm~u+2UC_MX_6*UoZ5FZ6gJ5EeJA_L z`s(R@3YuHw2bs-|gVvRO=XnwvM58P!Jtus1gVQ1nSsnQ(z_$4AYi8P!Lz z?JAn4g%)%?kD6WM$`9X(t9LvPP18uV9D1$r%D00m02QYp9IFoA*N@ki7}ZDFTlq`; zpqJB8GHINRGBf5p0M`aAP+Zp)4t(|dTWs}BkDS(Zs(%!%GWncAy*2L`$9*>?(b>H3(e;wW$!F~`PP*s8;Kvh+7Jo+94 zfw+hYaDVyo%b{77T}DPU+HIGSkt0jS^l<>{&VkUi+b;W+y`x9D?i}!?3#Acw{l-iD z`E8Tkoksv{Z9W{jvfuH@&&&d#1VJEH{z?m1{^Of{+HIF02(Y%oMK=Ck#qW4*KRnuI zzvG1#Y;8Uiib&F#EPlr$lgZ$BJaklO2-$vK^};0?06n~Pn>L;(_H=J z!)NkfXaUIs$%8?~>EMC0yTaFTc~Gn!u^^u__$Uq!?7GElVIj1@_i3e+AtF7O2lB03l1V4$!L^S+c%gXU|6XR~&DWCiApORoTTUj$%zF_yWcYEsrKztq)^eGN%74o^zKe2hx%4Si4R{tLvn+H9+DtXX9 zE_v``^Wb(+>^DZ4 zOJW|hkUWS)<_j+t4^I3((qO-_s7}&_jC4_my-7z^EpFUl!yl{pwu(CDtQ1% z9!MS}P6G4kwtrSd1p^ZB zAj(>nYb(k6jm=D&k{9~Mu~xY$=NAAOA4ndYV4evQ@W8HH7;}rLeG4Ea5Ar#KqE)77 zmFYUw`0+t&>>PL0DN((cG3STk1IYu)1K~u;gMXO^(R^dXgM%j~D2_GHRJ6(jk1dvK zEAi`zgBi<=IZrF4$oa;;$U%HT^58@~SPrVm=ABg#Z%xOZZ|vE_Gtbe^9GeGrKQ3sc i6cpsVb0q&G9{dB{F1|*@fJf~B0000MN0e2AVLwAzHF)0Mc5E4GMnoVY zU#RPrwX7O^o`1h$)qBFQpShwCS___mszOygaq~OuXNWPPD2k4i<8VVN-BPAOj*`>^su5JxGq5ULRu9gW_C%_n(+6IX zr1l-3fAoP>BBT{~`?&UYO>No#0c$geF(SkmK|~mhMlmN3$SyZ5UAM{wX2yEG_9tsB ismvIoD@j!m5q<%V`R{Uuobu2B0000EjUq zhid}>CT;gmdw+W;k0;)HHZ~sSA}?OOELilr0=)Y=y{*COY<(t^w#)YZ_70P_Lshdr z0!b`Y<#26~=QSqgzdxJh91$UgfOD?YVA6JoNS^iC)8_!pzI>(@SjIpt6b$Y-=ZGQX zi>jJw+IXtUSmExl%FSX3NyPpLwU7%fV_-TvVi}V@#sJE7iuXP<0PufWYJs=kPZ?{v zxC&zjAkDm?nKwnk!J{WYqHJAPaeR853aBcZo9VCOY+7_4-!v+i+#f#xps9Z&M*Z^Y zf)BfUEEb;8$gxHCx$78<5%okPV^6H{U>L>T@)z~tIw1rCnzq0@70Pq(a WFXcj{QuIIo0000KoCWrk--|#gv#I&B%gyKMT!(rP`E`dl9pQ} zLZV2KA_eE*0Hh>Bu|{hOr!cdujrkJtF!ucU^LHnDUMwrlP*n>Nk*i#oH^cy=yAk#r zBnhQ+01T1@fYP}}-f;Lm)CBe?gmo5?Mr^RAaagoozXPxxMgYu*g4p{f*r zM^9FhAHC%5FhWEqokK)w1%`Q1dCBH{+x^{%rh<^o6j(u6I7pJlDU{CDCWa&IPW4e4 zdk8Cl=5h9{V|epI1@;R`!`m5mCHFsj->H3-+wdb8p1wcH`?Xnl|MKDPbX_bW7ZU+C z_m7AOn~qs;De)s@ldQ2kA=(QTzK@}~NVnFvYt;e%0UANRW3TD22><{907*qoM6N<$ Ef^|HtqW}N^ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/advancedperipherals/textures/block/rs_bridge.png b/src/main/resources/assets/advancedperipherals/textures/block/rs_bridge.png index e1b45deb4acdfc80c6f70f805ccba24f1d619a54..1018593f5797320a0ef7a946bfdca69d51152c56 100644 GIT binary patch delta 409 zcmV;K0cQTX0;dCz7=H)`0000V^Z#K0000SaNLh0L01FcU01FcV0GgZ_00045Nkl47v&Lz2VB#u7b5UTmOy@$T&I zcs$AA`Q`P9Ac!a|p|!riJq7>*0J3?;fX}5;j9Fu_THV4L6MvCc`wEFKq*9PdAzLhY z*)RC|ybl0LC~Z7RQI!S8lN8pNXpnC$i|DzD)|v;avOu<2qACkWrC^O=71v0$)(}L* z4XISL>}B_P6Dg5OT`GtdPI-uh-e|335AuA+?uLW^5fV}V6|6DH^BwNqHhg-LYet4@ zlBiL%(GPRoi+`9@c*)_SC(833i0I;P)LL^sczjwP54L9>N`-?p7)k{p1e|jaLNKwf zopZ5*`-e3HOykot|P9Sw&r@j|2-*i&Y@{* z%;z^e5XL#yb%fEV_vBzr|AepY2LnEa^5k@gpT{4zHxlg`6h$j600000NkvXXu0mjf DJ&U#M delta 299 zcmV+`0o4Ad1G)l`7=Hu<0002(-QrRJ0004VQb$4nuFf3k00004XF*Lt006O%3;baP z0000mP)t-sD=RB7FfcPSGfz)XOiWBVIyyf;KLC680Du1gckcjv`9eZM85tQI92}^q zsGy*r#pOdM00009a7bBm000id000id0mpBsWB>pFlSxEDRDT%LV_*C@6I-$n#{8EZ_>*g8CbHq@7&2OHDFK)FWa_l$23C*;fRjuonUjqXLMF{mN@~f x2ulr13k4eJ>?GoB;_TwcAfPB9sKCe|1OU0pEtdXpUU~ok002ovPDHLkV1g+*a-0AF diff --git a/src/main/resources/assets/advancedperipherals/textures/block/rs_bridge_front.png b/src/main/resources/assets/advancedperipherals/textures/block/rs_bridge_front.png index 45b15f39831116d279320d89088de2bcf661981d..e94fa1d59c8f777145d8a4396055e07507865ce7 100644 GIT binary patch delta 1591 zcmV-72FUrn1G@~67k|JA1^@s64b9_D00009a7bBm000XU000XU0RWnu7ytkT?MXyI zRA_##9rAZr*HvH3aY!aVrsX)QFRbfS zt4|3jNmC1GQwv0|-y^K+Xy5$;fRmnA=V4t(n_A%L>P;mmBvlJ14BX-pEz1_8S~e}m z;oOx=v>b<5TYviixWy&TT#PBRv`8dESl4kM-SMa#O&El9ot9;DboC}@F2+Rv^?O24 zdoHwQvq{Tw(54okxFj?ICD1J{q3gP`zh&9D#U;YJ?$tnRkN9e9AFkfS0rc`3>4M4b zhRtEyv~a?JsRh`)+tC2v)z&_G`yn+N@cV-bq0PI5+JC0G?SG)++g*P&*KJ)WpF(aK!~p!*yLWO;gw9x$C-0um&(WnE~LL^^~(`Bb+xr;-&pU z-E`jg2!FuS_xg2{1M6AmReou|;H$@vJvY97-Bjl}zS=K;JzsjCT3E?jDQD0eDJ|}Fut~OIv$Ko8?+pUy2a_@ zgMYdu)U+$8FLZg}<0n4JiPfCmu72k(am$wk3~ z=-i6pgD)OPzn2`4d4u%Qp*)a&-?D7+3b*TtQee7Z_UA#mU{apVDhKMVC)R#*)PDet zhqsRNpnKwuy6TCN2ZxqTEF*xBE|~1h=e;~A-QPw>kZ7c4-C2fgbH-8_(OblIf3*u#TZ0;(Ke zU+CsR%W~40ssI2kdbIM00001b5ch_0Itp)=>Px$cS%G+R49>UQax&0 zK@k3;Z{{&c^$@7m0dxUj2hyg^0YWN+Atz830_s(z%?S){4Xy&oEd;uOc%6qgyLO6M zuL60+@@8jtzMq*lo6QD*ssbQcYmEq1jR-UAVWt3xs;<}T41e(aN zsj8?m#6CTJqYe<%rx^e-+?B5oi-?Qpv;r^BC{7*z{QS{{Za?4P?bxNO>VhQ6W`|gf zndISc*zflwsec1}N=gl()>>;-)lRq8>h3v&8Z*>-3V?Jgq3^(f7)b7Ry9;db)X+qm zS##;-8O3YN+b_2@X6le9WQ0#SnKp;kObo!ie1}g^gBZ#L8Pn_T(jrMWXrBPUMijry zq&SNAWs}bJ!|#u|1&!hBf@Bx~Np}}_C%IfM|J}Llk||-oPcubTkH=%0*cT43{Sv1G alKcxajr*B4OjfA?0000~YX diff --git a/src/main/resources/assets/advancedperipherals/textures/block/rs_bridge_front.png.mcmeta b/src/main/resources/assets/advancedperipherals/textures/block/rs_bridge_front.png.mcmeta new file mode 100644 index 000000000..9559c00e4 --- /dev/null +++ b/src/main/resources/assets/advancedperipherals/textures/block/rs_bridge_front.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": { + "interpolate": false, + "frametime": 2 + } +} diff --git a/src/main/resources/assets/advancedperipherals/textures/block/rs_bridge_top.png b/src/main/resources/assets/advancedperipherals/textures/block/rs_bridge_top.png new file mode 100644 index 0000000000000000000000000000000000000000..38c98a90f9abdd7674f7944aa8a8094ad939f670 GIT binary patch literal 403 zcmV;E0c`$>P)-&Zff4zDU!^~JLu06@m z$8*rdaOQ0Ne(J$+w%faV9Gc3{ei>h(EOM0l5>b{wiyASDnbGDom>Gwr@?<@E&hS~y;KZ0QS@P_F;MprbL&f~zmA&BVTL;%=*Z$_`~ xSSNmj)p8XqkH&Dp^nU|{i!`>r=T;p6{s3yP(H);AqSF8X002ovPDHLkV1k8nu*LuY literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/advancedperipherals/textures/entity/villager/profession/computer_scientist.png b/src/main/resources/assets/advancedperipherals/textures/entity/villager/profession/computer_scientist.png index c42e1afbebb3134ddb4f908b46845dc70d01a778..732775fc57e993d960ad2461ac65a269accfe972 100644 GIT binary patch delta 1051 zcmV+$1mydy4zLK2B!3BTNLh0L01FcU01FcV0GgZ_000BxNklWab6#kr~ zwnuFOiPTnVB|u`+t~dZ!K;j~>V$TiOvEv#@oPtF+w3|vTf+9d9ifJ`tS7unG&l!)$ zjzfuNoch}|izECm4ykp$@0CIuPm*Iq+tBmp|A+`r2DK-&>o4-dEvS^{hfU>l9Q3tV4cXG!bg z>t_JK-u{DZK2787Se%R}0D$3W2;inz()t5y=K{MrT!q{CTB=BXEZVd=A|zyJX;pM^Rv^^ zQt;uU$HtCo)tW^p+p{hx%lp2M$#{~HuuR;m=nY51(w^G+*{Re8K0iB^D)TDnK3=w8 zoyNr?%(DFKFUj$*)&~G@I{hVqxzMVRf(vlYGk>d*@+L)f<<$KI7umetle3MEdW9q* z8S8_wKHiNt@#6iT!Xla(OWfNo9QeNT>$jGhv*u+qB!+@vJ7VuGD(tLwPnfyWpFw1 zsVJ1f^j;k(dPJEA=<7^yH5nEzL#ivMX$;Q!(wovA^S#`Re?aj7vUZgv^%7XWm8qc9 zB28mwtq;_=4XR3W&U4BTX(k1eB+0d>Tz@0^R6Q20lIRN@lWjR?q#>Po!vbznnneJOrAjD;c5Xy@RB5vK)#(!D7(7S zzo`&RWv=Q`>iovWhEvz!9xzwF?p-OFEOGz<002ovPDHLkV1lg|@3;T} delta 1821 zcmV+&2jcj!2&@i}B!2;OQb$4nuFf3k000K&NklP@q78 z0tE&avi-^HuNcm15LqK|1|4I}?DMhP0;aZkyW8Ati#2nBfx(XbA9Xsvv_EZZ-#Uiv zTgR5AvE}JESN~w^g&q5+Ivqm*QcB>|@&YJOpg@6sktrS?eqf8%|F3#g>;HA(Qcr|m zcw#5^KDATz!+$G_004jUFuwTaXZ(Ktf_0yilC^;|fBxO|IZ+fz&+`z5Azar503=BQ z-}e#6F*a=2(6vAkJ#n*2@HY=DLG*+kYCB@y_k92z=EE?A=XuNSFZF(!m7y<&0XUAM zte}_L*2a7s$4UsxVNC^KGT*N-dI2%aHBaB<65ZgC&wn@LC6v7q?!8klIL=?XtmXh{ z^UZh(*TYC#U%j@d)(OYKYva2RURhM;|JnQ*0Km0I(|Vwhp)y<{lobf!Kmuqb5)u+$ z{rIbl;}}3{{+xMp+%|8<1VN0f1SFKjW>bACBg3eS48wC>xI*C6+`PuTS90N%+{`}u zxI#b(2Y;@cegkb+a8mb(;}~HWB1sbE=REj%o`-t9jwDIccej|JT!5JA7mH21Ch71% zDukAl@R&(1zb|DNNHc>g9JE@gRgh*$t2_{L&HKKuwQVushO>ZaJ=JTA$_-40o_*s; z?!IQcq>WL#)sl#o5;%?n$8j|C22!m9$S_YJ&41^`gr3x1_DU)am30}#? z?n9F}J$1s$qzTfr2_YQCoT*{Y^OP`5A@RVNp=oON-1epM6 z)&j)*asd$NBL?(~eTR?Y^wbFesUW`m_&o^WI1 zY26(UZqvpu|1_`KoC(v+MLUi0tY8CoCx7lTlK9@VUXY%=V zJc*7*qame~vR13f+1Xi1eJQ1C+t$=-H7WUJLmTUQAFvvrTuv#?ER1-?M{9V&WPjq8 z6M$Lt1VNCg4d@3EtpQTOC6)r~mJ@)P*Lj&s!U6Q6r(Un;TEM`A{5guEjE~RG&MN<> zd2@ZOR@34Hj|q)NL*`n*paenkXY%bZ4Aq?g0L;zJX)a){_kBN836h)mz7J5ekrdVvnG?3ni8D7bF(J>MJ)2>O%-R%$NsG5{HoqnWPbUPPLTG$uW`D+-erSCd zhFFdkxyL|(YspL*q*<~6a*1xBJv?pkXWVRlO$eZK$q)pA(yCcJ%*@Q7QmJIpka^L- z@8dYFfz&<#LD7*%RUXyJgby4zphZuLtlTa59}_lOg9yQWl&1|!Bh_jZKqm$O9Y#s3 z{7TA3i~55IK?fzKNV8Ei%^T@%Lu083GX#`OsG zt98&jBqO7v0Dxd~XCFbbJD=}P9?8s?09}*3Pi-Kz04^xc^Hi`i-^`#u$Z6RMAqNQn z2?s3%qniK#0tw<~jDPPxd0$&QfASpwz#}hlCM5WaG)v7GKYW`0AMyCaajpO8tH(0W z2hjO#Pd{#Wn@ZoUPrit4&%6RDrB)8}+gDx&+i20e{S-G3PNUI~bkkyL?Xj2Nb^zet za~DzaUEF=&J#d7;*B`zmDG-|P=K#nANp4L;LqoUKd;JA&br$>&^|dUKkk{yO00000 LNkvXXu0mjfvJPWc diff --git a/src/main/resources/assets/advancedperipherals/textures/entity/zombie_villager/profession/computer_scientist.png b/src/main/resources/assets/advancedperipherals/textures/entity/zombie_villager/profession/computer_scientist.png index d5e7a619c798a30c06687e30b9cfb71625e2346a..e1acca553bff867becb703048546132af163baa8 100644 GIT binary patch delta 1193 zcmV;a1Xla!47>@DBYy;gNkl8_5UjUnsPv z-a^kkl|rDDG>6iXYw4vFdPs8!ZP=&x)|z<`J3?P}MV4+wU4c9!|RdGF1S6(EsFBoc{4B9TZWuYVw^MRyMqte=q9UOUo-GR3ec`Bo|5I7Y;{9&qs{) zd3km9`b?UXbMMgt$Ye5ew@thOTz3FfP0!sv@di-UG`t}&EAyLfK^z@D9|6%L|Dw|t zmdV|hZGNrm27j(xxhCX@#Cd@04uoqe>$)+qovs@~TOx4=0LH>~?PRMwO+2*;BXI^0 zgli@*yY3*;5V~%_aU7v7kvIc{;rECzqNd7AVSq`~U{vfAi8R2~tE)mLCxMx?7TG4s zLlS8K09ekga3lB);$_n4OC%CW;?4uSYyD2A1pvt9@_)RZ**!ij9`||xfUJ44Sn?;# z#Lfay=$aXt`J)y~m(Bpp?oC}4dbxB4&@~gx?je)bpr{HIRhhU{j(raB@9zP?8Q1`V zF+OP}2!!X1M0x$_Vh{QhsHPGdOOrZCbgMH)H_cLWqH>fVCW9H5oU>d zFG|)ld4H_+^d5ncSjDXVMx^D%43zCJ#Cq{`&2oKqIQpyf$u2VreA&`*V74 z9Cv0y5@f6|WYW*B*?4d>T#UC(6k(ncHx%GxM1Q9pF5W1V0%H85d)(~@PHy82_kh!! ztnM{xfwQ$tT7$zxk=vVF!aau#PIYd#2owN998cm#p#;Zq&}ueA>%9W2l`^{RE-xQ< z;~54*2>4f0e)rvL)S&AI@|MN#wVF*lynl}i%v%=L)=M}%*hhBB!1m@As+BSx-oJOD zLVxCkhd|}=Mxatv)52;iEC=K*3$MSi8fg3ZS6>1E*49h>UXvMz~VA@WKI6T|V0)J_?Xf>P2E*U~7#EF0h?C#XW2Ru1I%_z8a z`%b`>{Vosu_ubwTPH{yrfIqhV^R}WYg7|8s3?MkgF}ug7K)*rb1~&kWR-;}Q%6{mJ zOqj9g`ncN{rp7offCyzdx00fc(`fDP)NtJGqx-Tg{OgLYncWjcwpuA;Ik%D`?|-=d z&bz6*-+YVgl7U9Oj#jgYyk!ZWv*LmRj61x&xy47nQLm#~DM$Y0Y~#^S{Ml-yj6$&p zVC)?vayhq>+TPsyA0(WO)Qe7g^yeSHqfxKpi?8p_H9|jr|J|riEMjfFguG>;)ofyS zr^by$b->uz=hywSb0MAi^_QPVBqE+D6pQ%q=0~v-4*>rHB7@~-ja@qH00000NkvXX Hu0mjf%C}GQ delta 1623 zcmV-d2B`VG3Fi!uBYyw^b5ch_0Itp)=>Px*AxT6*RCt{2Sxs--Mi6~VEh&knQi=uy z+hN*52vVIAAUX8X9(w6d=&`r{rQZ5$dMnTX@yY#w+onqFI55Rl6eWIXd!S~u`mm&= zuCq@00Nd1xmS$&X-kTW$6)IGyP@zJF3Kc3;sGuo6d2m;ByMG-)uOB|TCpO*xCScd~ zLD!9Lwa!VJJvG=cB8@$~5*3wzd*0}O+q zRx@B2rLAoCi?Q{1VMxvXL60$zuzB7#{@yN@*UbbAjxt7z;r5*=7n^I z8u}FKHGj_F%!shY8PYVD?Xl-Mk|R9NS@|9<9Wb4)?{p2LJmDysNV1FL3}HBy?BDMX zB>DAvN1{GUle6=1tt@KkfUGE1*2pPIn&a@mg*7XBD93HvL>y=EJV!=|ZJS8a9Io4h z=Q*hHRnFH^2F+RxSy5m*6(tcCrBmugX)fuz?|-*t1xN&E+a`cg4gtvb>J~@8KUn!L zEhB)~e;tVAsQ6K3kJz80LM6XpG{ND4yYhKjMgRcRO}_T}+41wYs$DKF{$9JTWdtNy zE>%FizKR_G4YYIsLEUhYyBB+Y?zE`RFgNeYWxz_!iXRSI7P zwe|-}StR)bAd4T8LZB?3id@{DQg{>8+8==I`-32o)u37r09c6#6chXkF_F*k#@)1b>rhVcRC6Xo4aah~rFlfnhj?>o(C+qK4La zr*lV;2UU-4ny5a0{E?s!?e_=LFls{7W`uH+!f@M^R>ih?-~Rp{E-y#(x*uFNJ!zDq znXlgGv8ActKns4L?%E?`^ZQe)g%hRABh=1f9 zfL>D{ph{v8MBv+uSEWNW=qkgIVqsQClC_S2wqe)0|Mly?R@Rnle|o)qFW+Rm<22y= zZS3!NM5i;wt5*|wn(82uLQOqkRj*ZI(hZ!92Nrv2GQP+KvTTHY-+&PL%KOU_v&_O& zfT-W26F3=9IZY8zQO7(LqG+PkeElGDVC7h^eby-EgKP6IJa2N=_2E>X>jti# zjGCuvZ@^d+gTV-Q?pX3(wd3pe2k7;V#L3A^*6SS!RY`~=)aFGeNExIYR*k3YEF0nO z-KLbmtDeX8dPhQStkj}P+d5$RVWMh08U5?8XY9Q7CG$LI;aQui^H8c2$$3PkwrxrR z)eQ?WNPlTFozK5!0Fe8y!7#sc5MQHb8H zuVvW&>f^`4uRWFXjz288@gU)~-@bjjT>Q&=x!-4=Kg=)W+_3TdJl+GQoCl8W*<9?+l8}6kVTUTy z2E%lQJ3@>%Zmd7Ya8JIt?7%&a1IOx0**^T6v6=bXvGt7MRTULK-tPXl^L?YOKm%`u zWAW-3CWjde4l}$P^k+Se_N|+B@I6Tm+_3pK z!?Q{`pebMZ4UWrv%Z{3sDw+IeOT|Gqh2n1p&yV*y`1|`O_Za#uzZ@|wHR`YPqZ}5a z^y|erEW32RGbs2Fjm`iKEVFGty-D!IoY?al1z&8U&>*Ybf*jvYxGl(qdw9cUbH-d& zvvmIAx;tEFw&ehs*NgAW*{1_fNRZ@&pG?!38$lZxy-8q?;K#qEVPlzj! zK6dQb4IkJ4K(LLWySqCyH1z*}`Tq+Up7t`Bo0}ID6adx8E>B$#q1Cy1fi(^Q|oVT|(`aO1Fa1B(RBI5n;fA#bYtU}8e&%T*E@w~1^OvHJ1r9&Mu z{mJv?gsu9n*UnPhaQXB8eLeyeOncs3`fC^W;KqxeAV*^d-i&{K-pYM)x13=|ZRU%+ zj5*97zP&lbAkY8b|G^@L`SFZBd#u4aZ!kT0^`6;o-_P(m^@^X{5B-zarFY=%pZ9B- zZ!;w1VK*F8^n-W9=i_(7b{k1Q`0~GYbu5O%de|)L@8oXP_G{V0f}uT`G0ggZp;F1N zN2(Zd5sC) zI`DDNdoy2#3Yo9Ye;0f_|DW%}Kj#g;kLUk4d^|6jb%9&}`w+tAl@0s3HGT)m^Kr+3 OJnrf0=d#Wzp$PyVDCVI6 diff --git a/src/main/resources/assets/advancedperipherals/textures/item/ar_goggles.png b/src/main/resources/assets/advancedperipherals/textures/item/ar_goggles.png deleted file mode 100644 index 2fc985a1289472c79e3552d61bffa389fd90e974..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 960 zcmaJ=&yUhT7;Sk{Y{K$Ln`{w)JoV8o`c6au7IF8$G9>ES9 zQ}K5t$^Hkw7A70^Xro7u@qmUVL0r|weFU1WIYb>~+S5m$QJLcsywmN`o^fBZuq&7` zMu=RWu{o|>iG0%jPtdX81Sk*&dM1J(+)VnHg(1*opM5L*)$ zd34RSFSw)A$dVD`#{Sjl^%iqa zJl)uqEjGqS9&7L~-!CudJ<(nBthNT(LBzjDd)^VEwW o{67EmYVU3N$Edb{Ey-QF!Sz30z5edEayhU9iwt8mqJM=IsSGEAW8lf!p`HO*gl}u5o}K8Fb$pepD(2N z|KMQsV*7wM&wo|4PgA_R)KS$e!usXKgym2#S@arxp8+%oPh@0T9f4lVa~*h1H}6l;6p{GylJgn&n$hqp9* s$`Zhz!wU}}?>~-$qXZ&_M!^7o0R(x|n{k#w$^ZZW07*qoM6N<$f*zUTA^-pY delta 404 zcmV;F0c-w{1g-;+B!2;OQb$4nuFf3k0004KNklm|`+e_y@4+8K{8kW7WNkOEtEZm&fdUt_Vr@oerZAtY@PFi$cm%y5z{cDmg>nu6 zvsCSph+*JjO$XpU673RoN<=3p1%3FZC$TFnmZEj;^e{q^J)+KWL^zSPd*Qax#4-&e ze+XYFh*0G3juuwVDU@>JdW$pU0Q-f&}M%7d|bz~D@g2h8coAhPH zj+&S56*Nto^dM&6u$?Wcf+x?t=e=|8xz8l=kn`w4Y=7W!7uYcilI&nX-M?^C zr|AGVj*QR0#jnu_fT!az0ne@lU|+81JV{6*1qt+N)f78aRh6o$lJ{QTd&RD)eT|xW z;4RJI@KW?|AlZCIQ54j5&6}6c>EAT9pIy@n3P@>QjvY!t(Qu$>I8X|T9rE5Q1*HqT zR>9QKdfq?r9DfZ5y#4r&jjh)l4F~L>cE)vgu^+W^z4od`|rQ;4-NoaH06ciL3baY&7Zf;>=5tQbbQ0`Mc zIS#1H$*=wkkPxD!ro*~Z%8n&PR(a53o2 zN46KswyyF!d#&+CNq(-m@F9j7ORs#hjMANxpdrL=v5!%O-$B7V?X!#QG0&DAe!=m} xl-+caes=QmcK;XS_Vug3didwpJGOi0-+#^Xsb|(RDWF>zJYD@<);T3K0RZ5!gMI)2 diff --git a/src/main/resources/assets/advancedperipherals/textures/item/computer_tool.png b/src/main/resources/assets/advancedperipherals/textures/item/computer_tool.png index 6e5491733296742830e374bf1ad89bd3f536efaf..ecfe966c92c3a95a32197f473341bf2b7fddff17 100644 GIT binary patch delta 400 zcmV;B0dM~C0;&U$B!3BTNLh0L01FcU01FcV0GgZ_00048NkljyxC(!~KI6UgaB@|(>f$FQ0Oli$Zyx~gUV7-=Lp7a@dF!{Bz28SR uP$I%ky2N~B1wii}s%4|!;Lr~Ks!uP>+ZM!01v~%%00{s|MNUMnLSTZZ7q6KB delta 342 zcmV-c0jd6~1MvcoB!2;OQb$4nuFf3k00004XF*Lt006O%3;baP00009a7bBm000ic z000ic0Tn1pfB*mi21!IgR5(wqlfi0(KoEwfAt#@~T#M2}5h8f;UAzWz@)11dm?!Yk zV_%})8Up4R=)snpJ&Ma_cjK(vC8=Xcn|!d$xX%Cc4T@kqQ!P!?=o&?lO%VhEFvg&+YyIvVG6CmY3w+<#=Q|OV?7`Fv zk|a@>B#vYKToeU3jstm~59S965ESnYYuHpvc-t?a{94)7enKWd9-~S<&s|W0L%IEg zk9UupB@-Z0woh6tL{}vpjq3-1KL3BdN7qv}8#SO5S307*qoM6N<$f?WrZOaK4? diff --git a/src/main/resources/assets/advancedperipherals/textures/item/empty_glasses_slot.png b/src/main/resources/assets/advancedperipherals/textures/item/empty_glasses_slot.png deleted file mode 100644 index 2f5d24e179425294024cee2d1912f0711860806a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 163 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucK?_e8#}EtuWC_+O%x)UIO#c^}Y-EVkmza>m z5Th$Rzle*qdl@2*!ot9Dn}2d?ZiU;+MF76L&rGge z(3+Vasm!y4kM~yz2(wIVY~JJhZO+cGuOb;2*QX7lyBh$ew_>KemQEZ*{1%ZXiBJXrW4!~X;fj~1$D%4Tx04UFukvmHRK@^3*JVen*3PnUL zQbb9SfGCKiM9?N$BoU0-WH&D%k7YMOf~{ajld_0)=APjLw983yDQv`!jA_^nc+ckkl<>HZ~pS&+&1K zL)Dv*>c#&?S1N7k;OGz@*A25QJSiMmEgOnAg?sf}G9`Q<95m&C!k0?d>incQTjw{$ zW;{A2cT+um*%sDXSkIXS;efEekgw>C^QfD6(#83h)B#z8SVWm2j1P?pE95B?l3J9^ ze)o-h`{pQ#M}L>EK^0RRS#shHidvDbX{i~}(=zi^Rqj9Yv@&C(_3oZ9v_0DP>kzbW zLv72pKM!rYb_A{mI4?H+CCO>xUG%M{=HCbJI-FiKHEjpZHlY9BNSeuS$tBB~$-v7A zbSI$a8akKiSvB@KzJvIhJkb^G?!mD9?_K@^+=XZQ4}X%$rT_o{32;bRa{vGi!T-oVOd zu-1y!?U!z!z*tfE2x>tme<6?!xHDndMIf=$uQ`)DGiT1d8T>g1jrMRHrxpYOVHkqv zd9W-C&wulJ=b1)3Y%j-g3{BHe6a^$ng6q0Pt#i0b*hG8^ga<`FaaUYbDW+j h;5d#d`Og0l;2S~td7tKrwB7&!002ovPDHLkV1i?NS(N|) diff --git a/src/main/resources/assets/advancedperipherals/textures/item/metaphysics/base_gear.png b/src/main/resources/assets/advancedperipherals/textures/item/metaphysics/base_gear.png index 062ce0b12389d52498e28ecba2cdc864825cac4b..a12585f2b0241ccd63b310f2217459d79be44164 100644 GIT binary patch delta 270 zcmV+p0rCFq3#kH-B!3BTNLh0L01FcU01FcV0GgZ_0002nNklK(sZUC6+a%nB%=z;Qsa=za#29Qq%09=p9@_%xkr8uq!z$BbCxLt1` zO8GJvj%5*AvaH~#N7!T z*F*UMuV=*hbTE$VH3W571_gP(Sd|w6lplOdR!<=3)4>#J3cQ|?#i?rK|3A|kTx?hU UOq0C>00000Ne4wvM6N<$f*k*I8vp~aDsl@zx)^LKtboki)RIJnirk#MVyg;UC9n!BAR8pCucQE0Qj%?}6yY17;GAES zs$iyPpl6_D$EBd4U{jQmW)z9|8>y;bpKhp8 z8yV>WRp=I1=9MH?=;jqGLkxkLMfuL^+7WFhI$72aI=A0Z9t+{kwK}&`8lN^^X-fc3~az^QA80oL3Bi5)qyOE zt|K5Lza$?Raz&ZRo_QsyMFmB`Pz2j(1ho&h3Usp&mWSqLme|1zKof@Qve5?x8B!2J z;s-1Wj37HM8+~|W+i^{KvF0`~X*~0EaSX8#ES;R~F*#7;c>Vg~)z6I1x;&q@RCuaP zXR1`J%fjxcNbTJLj-Fpuws8Csiru2owMbe}#3Mi?Ok|d;_$i~9Uy7S$-0q$7UNQAn z(yL2b=iXaepZD9GFFrT%hyRtB2xY6c&I&B=4%&suuAKCb_3Q8I%})|` zN&J*Av5ef8D)>_J;uoI&qWt&X!3J?_lmfzLs0p2Q44Hra6Qj)Ey$?1l?)GFm`S$YG zd1r-;lhgyM66PsAn!ImY`Z^C!Bf-g5{rSH7E3^L{>3JdGG&%gx^{}11E7sO{hrDrV z>fzk8TIcw+g!IE7vpiR>{Sq+CW2W)kg3nAx4k)bK_dP?+)$xnaiz>E-o*#~S-EXgo z3n@#|T=St&lrg{ed;ij|H>#fwm+o&q|CaTNHQAF>ZO?Sg_Db5u$|iH+ckgah{~r&-j7{Dg zv@h8-?d$6FhvL(jZLbO>F5IXk|N6FA*_`a}ma%sp3O!z8^eFtv>0BE{b$$NwYF=~s zJ%{rvPP7KkGm}4^=+*V+l0#CFP}a{s?uQH?xILW~E%AoUS?9*=K;Pcu@oU|z_FU80 z!kA^E#Tz*@&8JxWl%DUF8?Sc$+rXI5x%1`ZPUG`#TwP06J~Qo=|F!XZnF6cd_owbX zJGNX_*_MBHO6(J_sCa`nB_F?jF6RkMOo(dx>}%+H^!!QvS3zwnq!Q=fStCB}C?|^_ z=VSNTy#EuFS9RQEQOlpK=*)BFzVqtq!q3z@u2^!*-TcM9H|D;t&8~Y2LOoVIA0@Y3 zzgDz!$DHqBt817|1IpQE%`bfF#(H=Cs~OXFOjz-Of$zDLTlojjQOZ#TO?J%4ZYw)&)c#uozeA{=j56@rR9Pgg&ebxsLQ0KE@6q5uE@ diff --git a/src/main/resources/assets/advancedperipherals/textures/item/metaphysics/big_fire.png b/src/main/resources/assets/advancedperipherals/textures/item/metaphysics/big_fire.png index f93c7193cc23fdb1f80afe537e0a62d14447a232..38b4ee20a92c0edfe7f3cdcc7ac803ed046344d7 100644 GIT binary patch delta 191 zcmZqYyv;a4rJl3EBeIx*fm;}a85w5Hkzin8==F4Q46*1<{`3F8J+o>OA*)o327kI1x{1A-`Ph@%Y`1pDWi4?^*S2tNy^%$7#lJOHiajNU#)`<(a rC4eB|Uz=roSQyXpa0&O%Ow0_OOX4aXah+NQbQy!EtDnm{r-UW|vXM?t literal 1159 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|T2doC(|mmy zw18|523AHk24;{F1|}dO#lQ+?Gcb5DO2gSfj2Z|v?U@WLP&H9N8pPBA5pbG$0V7m3 zP;3DcT(!UgW&|6gZ)3N}G9blS;1OBOz@VoL!i*J5?aLS#nD{e8B1$5BeXNr6bM+Ea z@{>~aDsl@zx)^LKtboki)RIJnirk#MVyg;UC9n!BAR8pCucQE0Qj%?}6yY17;GAES zs$iyPpl6_D$EBd4U{jQmW)z9|8>y;bpKhp8 z8yV>WRp=I1=9MH?=;jqGLkxkLMfuL^+7WFhI$72aI=A0Z9t+{kwK}&`8lN^^X-fc3~az^QA80oL3Bi5)qyOE zt|K5Lza$?Raz&ZRo_QsyMFmB`Pz2j(1ho&h3Usp&mWSqLme|1zKof@Qve5?x8B!2J z;s-1Wj37HM8+~|W+i^{KvF0`~l{I?0IEGjVE)BNzW_A>)-L19gM6Ak+4lXCD&Q_v#!hMA@?wz|6>6#q+;r}Zkzx7K!UqQo zt>xdJoxR&u;TT`Bf#K61m-Zj<`CG~~xn+s@s%8h>Q(s*_cRotuv$ip{vh5U-d19#c z;M1}Be>5zlvORw=GEI!EVwiGp&XG%p>$1fs+_<*;shqy`Pxqf6o(nTnTXOGA-F?59 zRqgdOeP5%Ny>pf>`&kejq><8adC{RaQU+7QWM|rZ{K~aDsl@zx)^LKtboki)RIJnirk#MVyg;UC9n!BAR8pCucQE0Qj%?}6yY17;GAES zs$iyPpl6_D$EBd4U{jQmW)z9|8>y;bpKhp8 z8yV>WRp=I1=9MH?=;jqGLkxkLMfuL^+7WFhI$72aI=A0Z9t+{kwK}&`8lN^^X-fc3~az^QA80oL3Bi5)qyOE zt|K5Lza$?Raz&ZRo_QsyMFmB`Pz2j(1ho&h3Usp&mWSqLme|1zKof@Qve5?x8B!2J z;s-1Wj37HM8+~|W+i^{KvF0`~m2LHOaSX8#TpGOJn<-JEZqMg)=Zr*6Oc!yqXLZCp zQj(I2c4}(N%F57Lbnw}rckEcO^`fE@r&iRG1CFZ{HBWg@p7Q$jz4yQP_BuA* zduVs>dF{RDmHXw{OE_xR_m^sv>-}9lb4mCOwcp(x*KOOcUfE!9wD-T}{9E0*6IS2e zds$^tz_s%BWS%z)Gb4|AzY96A;Mt$Do5~E^XQ(io{r^qXW9n)11I?Thx%t+nC={*o zW;&6(cfa;SxqHehg+9&vq^r92-4yZfn{#JOZ}@S^q-4(KgIg=@{*^zTy~A$;=Y*&4 z%x08sJ9>UWQCahY6p5vWm0i-FFW~(#*D&+WEoaWgkdE({er~z8*Fx?2cXdrQ~r!c9VsG=d=r^677YxjB45e&59x1-#L2vojgkxXNCmm ziv{fe&GI`bV6okilG1j26{(XZK7JYd%ycI+{n(ZkbZ4qm^x-u#GbFw(-FkQZt=G+F zkDkZqS{@6(7_;|R!>oYZHyzopr0Cj+;;Q#;t diff --git a/src/main/resources/assets/advancedperipherals/textures/item/metaphysics/big_fire_purple.png b/src/main/resources/assets/advancedperipherals/textures/item/metaphysics/big_fire_purple.png index 824e63d55f8607cce6033f78dfb73221d93c6707..3fdccd14de738e50da4b814d71fb69e51d3eb1b9 100644 GIT binary patch delta 183 zcmV;o07(C~3DW_PB!3BTNLh0L01FcU01FcV0GgZ_0001mNkl@qmL!Z?~27yws@Se>?rv(Eqk002ovPDHLkV1g}|P+0%~ literal 1206 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|T2doC(|mmy zw18|523AHk24;{F1|}dO#lQ+?Gcb5DO2gSfj2Z|v?U@WLP&H9N8pPBA5pbG$0V7m3 zP;3DcT(!UgW&|6gZ)3N}G9blS;1OBOz@VoL!i*J5?aLS#nD{e8B1$5BeXNr6bM+Ea z@{>~aDsl@zx)^LKtboki)RIJnirk#MVyg;UC9n!BAR8pCucQE0Qj%?}6yY17;GAES zs$iyPpl6_D$EBd4U{jQmW)z9|8>y;bpKhp8 z8yV>WRp=I1=9MH?=;jqGLkxkLMfuL^+7WFhI$72aI=A0Z9t+{kwK}&`8lN^^X-fc3~az^QA80oL3Bi5)qyOE zt|K5Lza$?Raz&ZRo_QsyMFmB`Pz2j(1ho&h3Usp&mWSqLme|1zKof@Qve5?x8B!2J z;s-1Wj37HM8+~|W+i^{KvF0`~m2L2JaSX8#TpDbx@0=)6=T|LI`cmu?D*AP4e_Ll%57$J_&a5kjp^y8unIezXxNTfsl{#sg)b{j6 zEWx36v3&Wv`X_zrJ$&qjig4G4V@u8)sAYKMojGme8^xGca_v1k=V_H6+HnQ-TQ}X{@M1)D_zAmzh(Zwc5TB8 zIYvRrvpVxn<`^vuyS!0&Pvfd10ZA7ND$0A$by?jg?*8~g?BL16!siaBchtEBrd@n^ z=Jl-S{GBSTj}!AaT%9@pRIZ70SI%F0Fr@l#g{#W9Gn)H2K6!MSE*IdP)y?g@P07u& zM&MTa-K6I+AD)VR5}M2sGEpUJ+p(?;;mCcn&U^fvJw1A3jp@PZ{wM8O?o74l@X)9* g|0i6u`i=4*w)47Y9+~x9sDm=Er>mdKI;Vst0CY8<2LJ#7 diff --git a/src/main/resources/assets/advancedperipherals/textures/item/metaphysics/fire.png b/src/main/resources/assets/advancedperipherals/textures/item/metaphysics/fire.png index 65690e8d417f799448398c018b2661b117fa710b..8986741f142c5f810d8461199e935ed1d7274cdd 100644 GIT binary patch delta 102 zcmbQq-pn{bC7!duBeIx*fm;}a85w5Hkzin8F!gkC46*1<{`3F8J+o>~aDsl@zx)^LKtboki)RIJnirk#MVyg;UC9n!BAR8pCucQE0Qj%?}6yY17;GAES zs$iyPpl6_D$EBd4U{jQmW)z9|8>y;bpKhp8 z8yV>WRp=I1=9MH?=;jqGLkxkLMfuL^+7WFhI$72aI=A0Z9t+{kwK}&`8lN^^X-fc3~az^QA80oL3Bi5)qyOE zt|K5Lza$?Raz&ZRo_QsyMFmB`Pz2j(1ho&h3Usp&mWSqLme|1zKof@Qve5?x8B!2J z;s-1Wj37HM8+~|W+i^{KvF0`~{wI67IEGjVCMPUVoso6sL;WPfW~0cm29y8y@_)#? zOipF+5O$rFxJ}5Yg>#vJeD8Syw;HL$A_e9M35gs33=IC9vOC?dh#NuXl=FXWnDXQI6PxBhQ?s=dM;zMzM4VyRCOJ(kO~PQs pql-<@Wt~$(697CH20s7* diff --git a/src/main/resources/assets/advancedperipherals/textures/item/metaphysics/fire_green.png b/src/main/resources/assets/advancedperipherals/textures/item/metaphysics/fire_green.png index ee4af9c9be24cbe8b66334429791235e0c880649..d5c2475e6e09be649d26828264c0edb2385aefdb 100644 GIT binary patch delta 101 zcmbQv-o!XTC62SeBeIx*fm;}a85w5Hkzin8F!6M846*1<{`3F8J+o>f64|0$o!qu%sAY%w**4t{vP(OV literal 919 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|T2doC(|mmy zw18|523AHk24;{F1|}dO#lQ+?Gcb5DO2gSfj2Z|v?U@WLP&H9N8pPBA5pbG$0V7m3 zP;3DcT(!UgW&|6gZ)3N}G9blS;1OBOz@VoL!i*J5?aLS#nD{e8B1$5BeXNr6bM+Ea z@{>~aDsl@zx)^LKtboki)RIJnirk#MVyg;UC9n!BAR8pCucQE0Qj%?}6yY17;GAES zs$iyPpl6_D$EBd4U{jQmW)z9|8>y;bpKhp8 z8yV>WRp=I1=9MH?=;jqGLkxkLMfuL^+7WFhI$72aI=A0Z9t+{kwK}&`8lN^^X-fc3~az^QA80oL3Bi5)qyOE zt|K5Lza$?Raz&ZRo_QsyMFmB`Pz2j(1ho&h3Usp&mWSqLme|1zKof@Qve5?x8B!2J z;s-1Wj37HM8+~|W+i^{KvF0`~{wI36IEGjVCMPUVeXuX-+x-8VrW!?-HJDic|NleY zWpXNmhp_9c#BD-GEu6~)~aDsl@zx)^LKtboki)RIJnirk#MVyg;UC9n!BAR8pCucQE0Qj%?}6yY17;GAES zs$iyPpl6_D$EBd4U{jQmW)z9|8>y;bpKhp8 z8yV>WRp=I1=9MH?=;jqGLkxkLMfuL^+7WFhI$72aI=A0Z9t+{kwK}&`8lN^^X-fc3~az^QA80oL3Bi5)qyOE zt|K5Lza$?Raz&ZRo_QsyMFmB`Pz2j(1ho&h3Usp&mWSqLme|1zKof@Qve5?x8B!2J z;s-1Wj37HM8+~|W+i^{KvF0`~{#SasIEGjVCMPUVU9o-L|M=w4#XaZw)M6$noaMDV z$#bUXOnJddMGZcqmIX>qTpW^3m$^@{JvMF;j8xP!JHfD0J}BqB#k{{+Hn%z!v9IQy zkjt|1?2=N+4Vi3_Cz{TNP0%%Pb}%f=_$`@p>Ohi&UPC6!$tDwHn?Gj~o~JimW>_Pn z;QX&V=5M`0-rfKIPs{&h|CoJdcIZZ}W2zjNwwUJdMi}dvE`Brtm3T-G@yGywqrj}o8& From 340fbbfc3db21eda153342787e392253fcd25b37 Mon Sep 17 00:00:00 2001 From: Srendi Date: Wed, 15 Jan 2025 03:32:13 +0100 Subject: [PATCH 52/57] Server tick end/post instead of start/pre --- .../de/srendi/advancedperipherals/common/util/ChunkManager.java | 2 +- .../de/srendi/advancedperipherals/common/util/ServerWorker.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/ChunkManager.java b/src/main/java/de/srendi/advancedperipherals/common/util/ChunkManager.java index 9db32aba2..1a20e6023 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/ChunkManager.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/ChunkManager.java @@ -66,7 +66,7 @@ public static void afterServerStarted(ServerStartedEvent event) { } @SubscribeEvent - public static void serverTick(ServerTickEvent.Pre event) { + public static void serverTick(ServerTickEvent.Post event) { if (event.hasTime()) { tickCounter++; if (tickCounter % (APConfig.PERIPHERALS_CONFIG.chunkLoadValidTime.get() / 2) == 0) { diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/ServerWorker.java b/src/main/java/de/srendi/advancedperipherals/common/util/ServerWorker.java index 3d2ffc731..bfb8a9d49 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/ServerWorker.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/ServerWorker.java @@ -20,7 +20,7 @@ public static void add(final Runnable call) { } @SubscribeEvent - public static void serverTick(ServerTickEvent.Pre event) { + public static void serverTick(ServerTickEvent.Post event) { if (event.hasTime()) { while (true) { final Runnable runnable = callQueue.poll(); From 191205fbb3282f14adec06774ded070cace882d2 Mon Sep 17 00:00:00 2001 From: Srendi Date: Wed, 15 Jan 2025 03:34:32 +0100 Subject: [PATCH 53/57] Wrong chunk load time calculation --- .../de/srendi/advancedperipherals/common/util/ChunkManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/ChunkManager.java b/src/main/java/de/srendi/advancedperipherals/common/util/ChunkManager.java index 1a20e6023..1d1a265d8 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/ChunkManager.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/ChunkManager.java @@ -69,7 +69,7 @@ public static void afterServerStarted(ServerStartedEvent event) { public static void serverTick(ServerTickEvent.Post event) { if (event.hasTime()) { tickCounter++; - if (tickCounter % (APConfig.PERIPHERALS_CONFIG.chunkLoadValidTime.get() / 2) == 0) { + if (tickCounter % (APConfig.PERIPHERALS_CONFIG.chunkLoadValidTime.get() * 20 / 10) == 0) { ChunkManager.get(ServerLifecycleHooks.getCurrentServer().overworld()).cleanup(); } } From d845cd4c7c947bb914c5c8c5daeb4dea36e52b34 Mon Sep 17 00:00:00 2001 From: Srendi Date: Wed, 15 Jan 2025 03:36:40 +0100 Subject: [PATCH 54/57] Remove unnecessary check --- .../addons/computercraft/peripheral/ColonyPeripheral.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ColonyPeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ColonyPeripheral.java index 21754e8d7..b89b82665 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ColonyPeripheral.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/ColonyPeripheral.java @@ -237,12 +237,10 @@ public final Object getWorkOrderResources(int id) throws LuaException { } @LuaFunction(mainThread = true) - public final Object getBuilderResources(Map pos) throws LuaException { + public final Object getBuilderResources(Map posTable) throws LuaException { IColony colony = getColony(); - if (!(pos.containsKey("x") && pos.containsKey("y") && pos.containsKey("z"))) - throw new LuaException("Coordinates expected"); - BlockPos blockPos = LuaConverter.convertToBlockPos(pos); + BlockPos blockPos = LuaConverter.convertToBlockPos(posTable); return MineColonies.builderResourcesToObject(colony, blockPos); } From 67fb8c7fd4df7ec4f014719b367ed305cb63f242 Mon Sep 17 00:00:00 2001 From: Srendi Date: Wed, 15 Jan 2025 03:36:59 +0100 Subject: [PATCH 55/57] Math.max begone --- .../advancedperipherals/common/util/DataStorageUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/DataStorageUtil.java b/src/main/java/de/srendi/advancedperipherals/common/util/DataStorageUtil.java index a870f0f4b..b0639b3ae 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/DataStorageUtil.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/DataStorageUtil.java @@ -67,9 +67,9 @@ public static boolean consume(@NotNull ITurtleAccess access, @NotNull TurtleSide public static void addCycles(IPeripheralOwner owner, int count) { PatchedDataComponentMap patch = PatchedDataComponentMap.fromPatch(DataComponentMap.EMPTY, owner.getDataStorage()); Integer currentCharge = patch.get(ROTATION_CHARGE_SETTING.get()); - if (currentCharge == null) + if (currentCharge == null || currentCharge < 0) currentCharge = 0; - patch.set(ROTATION_CHARGE_SETTING.get(), Math.max(0, currentCharge) + count * ROTATION_STEPS); + patch.set(ROTATION_CHARGE_SETTING.get(), currentCharge + count * ROTATION_STEPS); owner.putDataStorage(patch.asPatch()); } From 7a2a45bcce69a9afdda8a9194d2fc047ddec5b2b Mon Sep 17 00:00:00 2001 From: Srendi Date: Wed, 15 Jan 2025 03:41:06 +0100 Subject: [PATCH 56/57] Don't waste time while copying the stack --- .../de/srendi/advancedperipherals/common/util/LuaConverter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java b/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java index 2f8d6ab64..a0f56863d 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/LuaConverter.java @@ -103,7 +103,7 @@ public static Object posToObject(BlockPos pos) { public static Map stackToObject(@NotNull ItemStack stack) { if (stack.isEmpty()) return new HashMap<>(); Map map = itemToObject(stack.getItem()); - DataComponentPatch components = stack.copy().getComponentsPatch(); + DataComponentPatch components = stack.getComponentsPatch(); map.put("count", stack.getCount()); map.put("displayName", stack.getDisplayName().getString()); map.put("maxStackSize", stack.getMaxStackSize()); From e9adb24ae4f16b9e97e311dc8682bee40db04c20 Mon Sep 17 00:00:00 2001 From: Srendi Date: Wed, 15 Jan 2025 03:47:44 +0100 Subject: [PATCH 57/57] Use front textures for turtles --- .../advancedperipherals/models/block/turtle_chatty_left.json | 2 +- .../advancedperipherals/models/block/turtle_chatty_right.json | 2 +- .../models/block/turtle_environment_left.json | 2 +- .../models/block/turtle_environment_right.json | 2 +- .../models/block/turtle_geoscanner_left.json | 2 +- .../models/block/turtle_geoscanner_right.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/resources/assets/advancedperipherals/models/block/turtle_chatty_left.json b/src/main/resources/assets/advancedperipherals/models/block/turtle_chatty_left.json index 5e44820a3..ff49ae618 100644 --- a/src/main/resources/assets/advancedperipherals/models/block/turtle_chatty_left.json +++ b/src/main/resources/assets/advancedperipherals/models/block/turtle_chatty_left.json @@ -1,4 +1,4 @@ { "parent": "computercraft:block/turtle_upgrade_base_left", - "textures": {"texture": "advancedperipherals:block/chat_box"} + "textures": {"texture": "advancedperipherals:block/chat_box_front"} } \ No newline at end of file diff --git a/src/main/resources/assets/advancedperipherals/models/block/turtle_chatty_right.json b/src/main/resources/assets/advancedperipherals/models/block/turtle_chatty_right.json index 4ca41794e..9c5de71bd 100644 --- a/src/main/resources/assets/advancedperipherals/models/block/turtle_chatty_right.json +++ b/src/main/resources/assets/advancedperipherals/models/block/turtle_chatty_right.json @@ -1,4 +1,4 @@ { "parent": "computercraft:block/turtle_upgrade_base_right", - "textures": {"texture": "advancedperipherals:block/chat_box"} + "textures": {"texture": "advancedperipherals:block/chat_box_front"} } \ No newline at end of file diff --git a/src/main/resources/assets/advancedperipherals/models/block/turtle_environment_left.json b/src/main/resources/assets/advancedperipherals/models/block/turtle_environment_left.json index 8a4fc9acd..f144c9175 100644 --- a/src/main/resources/assets/advancedperipherals/models/block/turtle_environment_left.json +++ b/src/main/resources/assets/advancedperipherals/models/block/turtle_environment_left.json @@ -1,4 +1,4 @@ { "parent": "computercraft:block/turtle_upgrade_base_left", - "textures": {"texture": "advancedperipherals:block/environment_detector"} + "textures": {"texture": "advancedperipherals:block/environment_detector_front"} } \ No newline at end of file diff --git a/src/main/resources/assets/advancedperipherals/models/block/turtle_environment_right.json b/src/main/resources/assets/advancedperipherals/models/block/turtle_environment_right.json index 800a144c2..a86301e57 100644 --- a/src/main/resources/assets/advancedperipherals/models/block/turtle_environment_right.json +++ b/src/main/resources/assets/advancedperipherals/models/block/turtle_environment_right.json @@ -1,4 +1,4 @@ { "parent": "computercraft:block/turtle_upgrade_base_right", - "textures": {"texture": "advancedperipherals:block/environment_detector"} + "textures": {"texture": "advancedperipherals:block/environment_detector_front"} } \ No newline at end of file diff --git a/src/main/resources/assets/advancedperipherals/models/block/turtle_geoscanner_left.json b/src/main/resources/assets/advancedperipherals/models/block/turtle_geoscanner_left.json index 7bfe302a3..03466103f 100644 --- a/src/main/resources/assets/advancedperipherals/models/block/turtle_geoscanner_left.json +++ b/src/main/resources/assets/advancedperipherals/models/block/turtle_geoscanner_left.json @@ -1,4 +1,4 @@ { "parent": "computercraft:block/turtle_upgrade_base_left", - "textures": {"texture": "advancedperipherals:block/geo_scanner"} + "textures": {"texture": "advancedperipherals:block/geo_scanner_front"} } \ No newline at end of file diff --git a/src/main/resources/assets/advancedperipherals/models/block/turtle_geoscanner_right.json b/src/main/resources/assets/advancedperipherals/models/block/turtle_geoscanner_right.json index 5304628b8..b79935bae 100644 --- a/src/main/resources/assets/advancedperipherals/models/block/turtle_geoscanner_right.json +++ b/src/main/resources/assets/advancedperipherals/models/block/turtle_geoscanner_right.json @@ -1,4 +1,4 @@ { "parent": "computercraft:block/turtle_upgrade_base_right", - "textures": {"texture": "advancedperipherals:block/geo_scanner"} + "textures": {"texture": "advancedperipherals:block/geo_scanner_front"} } \ No newline at end of file