Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advancements for mekanism #7470

Merged
merged 31 commits into from
Jun 18, 2022
Merged

Advancements for mekanism #7470

merged 31 commits into from
Jun 18, 2022

Conversation

Tyrannicodin
Copy link
Contributor

@Tyrannicodin Tyrannicodin commented May 6, 2022

Changes proposed in this pull request:

Preliminary creation of advancements for Mekanism let me know if you think anything should be changed, updated or added.

Multiblock and gas production

Currently multiblocks can't be detected as Minecraft has no way of creating custom advancement triggers, and gases can only be detected in the inventory, and as most gases are just put through pressurised tubes and other machines, so most likely wont be taken in gas containers.

@pupnewfster
Copy link
Member

If these were actually generated (which would be great) then it looks like the providers and the cache file differences were missed when committing. If they weren't then the things should probably not be in the datagen folder or the next time runData is ran they will all be deleted. Though I probably can help with moving advancements over to datagen after I get a chance to review things.

@Tyrannicodin
Copy link
Contributor Author

To be honest, I didn't really know where to put them and that seemed to worked as it was with all the other data, if you let me know where they should really be I'll move them there.

@Tyrannicodin
Copy link
Contributor Author

Figured out how to use data gen looking by looking at this mod, will try to implement soon.

Copy link
Member

@pupnewfster pupnewfster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you forgot to rerun datagen after moving the rest of the advancements over (or you forgot to commit the added files).

Comment on lines 2 to 61
"advancements.mekanism.alloys.alloy_atomic.title":"A powerful alloy",
"advancements.mekanism.alloys.alloy_atomic.description":"Atomic power!",
"advancements.mekanism.alloys.alloy_infused.title":"Iron-Redstone Fusion!",
"advancements.mekanism.alloys.alloy_infused.description":"Iron + Redstone = ???",
"advancements.mekanism.alloys.alloy_reinforced.title":"Reinforcement",
"advancements.mekanism.alloys.alloy_reinforced.description":"Diamonds make everything better!",
"advancements.mekanism.controls.control_advanced.title":"Better control",
"advancements.mekanism.controls.control_advanced.description":"Craft an advanced control circuit",
"advancements.mekanism.controls.control_basic.title":"Under control",
"advancements.mekanism.controls.control_basic.description":"We have this all under control",
"advancements.mekanism.controls.control_elite.title":"Precision control",
"advancements.mekanism.controls.control_elite.description":"Precise!",
"advancements.mekanism.controls.control_ultimate.title":"Where's my supercomputer?",
"advancements.mekanism.controls.control_ultimate.description":"Honey! Where is my supercomputer?",
"advancements.mekanism.endgame.fullmeka.title":"The ultimate suit",
"advancements.mekanism.endgame.fullmeka.description":"True dedication",
"advancements.mekanism.endgame.mekasuit.title":"Fully kitted",
"advancements.mekanism.endgame.mekasuit.description":"A true mekanism outfit",
"advancements.mekanism.endgame.nantimatter.title":"Impossible material",
"advancements.mekanism.endgame.nantimatter.description":"This shouldn't be here, reporting paradox",
"advancements.mekanism.endgame.nucleosynthesiser.title":"Matter manipulation",
"advancements.mekanism.endgame.nucleosynthesiser.description":"Sending signal, fix inbound",
"advancements.mekanism.endgame.plutonium.title":"Plutonium power",
"advancements.mekanism.endgame.plutonium.description":"Not polonium",
"advancements.mekanism.endgame.polonium.title":"Polonium power",
"advancements.mekanism.endgame.polonium.description":"Not plutonium",
"advancements.mekanism.endgame.sps.title":"Going supercritical",
"advancements.mekanism.endgame.sps.description":"Ready to phase shift",
"advancements.mekanism.qio.advanced_qio.title":"Quantum level 2",
"advancements.mekanism.qio.advanced_qio.description":"Higher density",
"advancements.mekanism.qio.basic_qio.title":"Quantum level 1",
"advancements.mekanism.qio.basic_qio.description":"1/4 storage",
"advancements.mekanism.qio.elite_qio.title":"Quantum level 3",
"advancements.mekanism.qio.elite_qio.description":"In the millions!",
"advancements.mekanism.qio.portal_qio_dash.title":"Portable peek",
"advancements.mekanism.qio.portal_qio_dash.description":"Behold your storage from anywhere!",
"advancements.mekanism.qio.qio.title":"Quantum orchestra",
"advancements.mekanism.qio.qio.description":"You are the conductor!",
"advancements.mekanism.qio.qio_dash.title":"Quantum peek",
"advancements.mekanism.qio.qio_dash.description":"Behold your storage",
"advancements.mekanism.qio.ultimate_qio.title":"Super massive",
"advancements.mekanism.qio.ultimate_qio.description":"Parallel universe detected",
"advancements.mekanism.metallurgy.casing_steel.title":"The perfect foundation",
"advancements.mekanism.metallurgy.casing_steel.description":"The basis for even the most advanced machines",
"advancements.mekanism.metallurgy.metallurgic.title":"A metallur-what now?",
"advancements.mekanism.metallurgy.metallurgic.description":"Craft a Metallurgic Infuser",
"advancements.mekanism.metallurgy.steel.title":"Industrial revolution",
"advancements.mekanism.metallurgy.steel.description":"Create your first steel ingot",
"advancements.mekanism.robit.digi.title":"What is my purpose?",
"advancements.mekanism.robit.digi.description":"Goodbye friend",
"advancements.mekanism.robit.robit.title":"Welcome to the world",
"advancements.mekanism.robit.robit.description":"Hello friend",
"advancements.mekanism.teleports.portableteleporter.title":"Portable portals",
"advancements.mekanism.teleports.portableteleporter.description":"Instant travel from anywhere",
"advancements.mekanism.teleports.quantumentangloporter.title":"Quantum entanglement",
"advancements.mekanism.teleports.quantumentangloporter.description":"Instant resource transport",
"advancements.mekanism.teleports.teleportcore.title":"Instant teleportation",
"advancements.mekanism.teleports.teleportcore.description":"Numerous applications!",
"advancements.mekanism.teleports.teleporter.title":"Portals:online",
"advancements.mekanism.teleports.teleporter.description":"Instant travel",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are these being added from? They should be somewhere in the lang provider

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't added them yet, just trying to get nbt to be working.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I didn't read the sub message in your commit. And in regards to creating a stack with (if I understand properly) maxed upgrades the way I would do it is probably via a helper method like this:

private ItemStack getMaxedGear(ItemRegistryObject<? extends IModuleContainerItem> item) {
    ItemStack stack = item.getItemStack();
    if (stack.getItem() instanceof IModuleContainerItem container) {
        for (ModuleData<?> module : MekanismAPI.getModuleHelper().getSupported(stack)) {
            container.addModule(stack, module);
            ModuleHelper.INSTANCE.load(stack, module).setInstalledCount(module.getMaxStackSize());
        }
    }
    return stack;
}

And then I think you can pass that stack as the display stack to the display method instead of just passing the item.

Copy link
Contributor Author

@Tyrannicodin Tyrannicodin May 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work, thanks. I only needed to convert it to itemPredicate and then that works.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work, thanks. I only needed to convert it to itemPredicate and then that works.

that was worded awfully but it was early

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, .getSupported(stack) return an empty array

@pupnewfster
Copy link
Member

Pushed a couple changes to your branch to clean things up slightly and also get the NBT working for the supported modules. I probably will end up at some point trying to just make a custom advancement trigger so that we can just flag it as requiring all modules and then it calculates it at runtime based on all the available modules (in case mods add any).

@Tyrannicodin
Copy link
Contributor Author

This should all be fixed and is now generated data.

@pupnewfster
Copy link
Member

Pushed a bit of cleanup, and also in theory got it so that the check for a full canteen properly obeys the configured max storage based on the config and the fully upgraded mekasuit properly checks only installed types and should support custom modules.

A couple things I noticed were:

  1. Why were some descriptions obfuscated? I feel like that most likely doesn't fit (so I removed them for now but with TODOs to add back if there is a reasoning)
  2. It seems there was some copy pasting errors so there is no title or description set for the digital miner advancement (see MekanismLangProvider and the todo I left in the addAdvancements section)

Beyond that I haven't looked in too great detail yet at the actual advancements yet, but figured I would give an update on the state of this.

@pupnewfster
Copy link
Member

Also I am thinking of targeting this PR for 1.19 and potentially adding some misc advancements + making the other modules like generators have some basic advancements that get added into the Mekanism tree. So odds are I will merge this into the 1.19 branch before actually starting the port and then I might ask you for suggestions on discord for some of the other modules.

@Tyrannicodin
Copy link
Contributor Author

Tyrannicodin commented May 29, 2022

Why were some descriptions obfuscated?

I wasn't really sure what to put, and it was supposed to be like the antimatter was glitching everything after it was created.

Copy-pasting errors

I think I know where I went wrong with there, as there was a double robit which I removed, that was probably an error in my code that replaced the digital miner with it, I'll take a look. Edit: Fixed with latest commit

Other than that, all sounds good let me know if you want me to do anything else

@Tyrannicodin
Copy link
Contributor Author

Could create a discord channel for advancement suggestions as I wasn't sure what else to add, and I'm sure people in the discord have loads of ideas. They could also probably improve the actual names and descriptions for the titles if I make a tree diagram with that sort of stuff, depends on how long the release will be I guess.

@pupnewfster
Copy link
Member

On second thoughts odds are this will be a couple minor versions into 1.19, but I will rebase and port this PR to 1.19 as needed when the time comes.

@pupnewfster pupnewfster changed the base branch from 1.18.x to 1.19.x June 13, 2022 15:41
@pupnewfster
Copy link
Member

I went ahead and rebased this onto the 1.19 branch, and will likely start looking at it in more depth later today as well as figuring out which other things we may want advancements for, both for base mek and the various modules.

Tyrannicodin and others added 10 commits June 17, 2022 17:52
Added lots more advancements and fixed the problems, probably on a few more and then some hidden ones before making a pull request.
Also created directory paths in the advancements folder
Switched around half of the advancements to be generated with dataGen, rest will come tomorrow

They currently use language but lang is not generated so it'll just show up as the translation ids
All advancements are now generated, only thing left is to add the language generation.
Couldn't find a way to make the mekasuit look fully upgraded in the advancement, any advice would be incredibly appreciated.
Still no lang files, also needs fix for .getSupported() modules in mekanismApi
6 are missing and normal strings are being used to call the functions, lmk if you want me to switch it to being MekanismLang.ADVANCEMENT_NAME
Tyrannicodin and others added 21 commits June 17, 2022 17:54
…easier to read and make it so that the full/max item predicate are calculated at runtime
…that got dropped in the rebase to make it easer
…ccess to it due to using custom item predicates
…arents of a couple things to be more logical
…unch of the titles and descriptions of existing advancements. Also, slightly change the path to advancements
… advancements to require checking each against the inventory less times
… inventory triggers are built in a couple places
…hat we can remove the requirements portion of the json when it is equal to the default
…s#29 and rename a couple advancements to suggested names
@pupnewfster pupnewfster merged commit 59c1cfd into mekanism:1.19.x Jun 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants