MachineMuse / MachineMusePowersuits

Minecraft mod, take 2
236 stars 105 forks source link

[Feature Request] Add Morph-O-Tool module. #859

Open eyeonus opened 5 years ago

eyeonus commented 5 years ago

Obviously super-low priority, get a release out first.

The reasoning behind the feature request is basically, the OmniWrench is no longer Omni, as there are quite few mods it doesn't work as a wrench for, and because of the way it works, this tool does Omni.

https://github.com/Vazkii/Morph-o-Tool

Not even sure if it's possible to make a module out of the tool, also because of the way the tool works, and if not, no worries. If it is possible, Vazkii could probably tell you better than I.

lehjr commented 5 years ago

Probably easy to implement, but I don't see where it does anything other than rotate blocks: https://github.com/Vazkii/Morph-o-Tool/blob/master/src/main/java/vazkii/morphtool/ItemMorphTool.java#L28-L34

eyeonus commented 5 years ago

It does everything a wrench by any name does. The way it works is, when you craft the Morph-O-Tool with a wrench, which includes items that aren't wrenches but do the same thing a wrench does, such as Astral Sorcery's Resonating Wand or Thermal Expansion's Crescent Hammer, it will suck that tool into the Morph-O-Tool.

From that point on, whenever you look at any block for which the Morph-O-Tool has sucked in the "wrench" of, it will morph into that tool.

So when you're looking at a bunch of Thermal Dynamics item ducts, all of sudden you're holding a Crescent Hammer, when you're looking at a bunch of Immersive Engineering machines, now you're holding an Engineer's Hammer, and when you're looking at IC2 components, now you're holding an IC2 electric wrench.

Here's Vazkii's demonstration video from way back when he first made the mod: https://www.youtube.com/watch?v=Rd1IqQnZylU

lehjr commented 5 years ago

Yeah, that's a lot different than it looks in code. Now I have to figure out how it works.

lehjr commented 5 years ago

ok, so it's all here where the "magic" happens: https://github.com/Vazkii/Morph-o-Tool/blob/master/src/main/java/vazkii/morphtool/MorphingHandler.java

lehjr commented 5 years ago

I'll look into it, but it's going to be weird to do because there's no API and it's done with an event handler.

eyeonus commented 5 years ago

Yeah. Like I said, not even sure if it's possible.

The way I imagine it, the module icon would change the way the MoT does when the module is active, but the fist itself would stay a fist.

lehjr commented 5 years ago

the way the code works in that event handler, it looks like it swaps the item out for another and back again.

eyeonus commented 5 years ago

Yeah, it literally uses the actual item itself, but with the name overridden and with a metadata tag to indicate that's it the MoT morphed into said tool.

lehjr commented 2 years ago

I might actually try this in 1.16.5 or 1.17.x using "data generators"