Actually Additions

Actually Additions

66M Downloads

Allow mod wrenches to change I/O state for lasers

CplPibald opened this issue ยท 8 comments

commented

There is a mod compat issue between AA and WorldEdit. If WorldEdit is installed, it is impossible for a server OP to modify the I/O state of a laser. For several years WorldEdit has had a function for server ops (or anyone else with the right permission) to teleport by clicking with a compass. When such a player tries to right-click a compass on a laser, WorldEdit captures the click and the player teleports to the other side of the laser. You can work around this by removing OP, but that completely breaks WorldEdit.

The recommended fix is to allow a wrench to modify the laser as well. Right-clicking with a wrench is a well-understood mechanic in modded minecraft for toggling the state of a machine block. You can use McJty's WrenchChecker class to simplify detecting whether an item is a wrench.

An alternate fix would be to allow the laser wrench to activate the "compass" function if you right-click while sneaking.

commented

I don't want a Laser to be toggleable with anything but a compass.
WorldEdit overriding the compass function no matter which block you use seems like an issue on their part, especially because it only teleports the player and doesn't interact with the block in any way. Also, I think "WorldEdit has used the compass longer, thus mods shouldn't use it for anything" is no reason for me to change anything.
Sorry.

commented

I don't want a Laser to be toggleable with anything but a compass.

May I ask why? Nobody plays a modpack with just one mod, so item exclusivity will cause conflicts. WorldEdit is not the only mod that uses the compass (and like I said, has been using it like this since before Forge API existed), and this seems like a fairly simple way to make your mod play nice with others.

And if I may further ask, why is the laser configuration item a compass, anyway? You could have chosen a redstone torch, or a hoe, or a gold leggings. Or even better, shift-click with a laser wrench, which is already the item you use to configure lasers. That way a player doesn't have to add two extra junk items to their inventory just to configure your mod.

commented

I don't know what you're referring to as "junk items" here, but if it includes the Laser Wrench, you might as well just uninstall the mod and stop playing with it, seeing as you like subtly throwing insults at the mod and generally not seeming that positive about it way more than just accepting a feature - or posting non-agressive criticism.

Also, the compass is because it changes the priority of Item Lasers and the direction that Energy Lasers transmit power in, which are both things dependent on direction - so the compass was the obvious choice.
To be honest, I made both of the configuring items (the Redstone Torch and the Compass) vanilla ones because I thought it was nice to integrate some more vanilla things, especially things like the compass which no one crafts usually so I wanted to change that. If you don't think that's a good decision, then that's fine.

commented

I'm sorry if you interpreted my post as insulting. I was just genuinely curious about your rationale and why it was so important that only a single item be usable for this purpose. I called out a place where your mod could be made more compatible with other mods, and even handed you the code, which meant almost zero work for you, and you rejected it with very little explanation. This suggested to me that you felt very strongly about the compass.

The words "junk items" were chosen poorly. I only meant that inventory space is always at a premium among modpack players, and items like wrenches that have multiple uses are more desirable than an item that has only one use. Laser relays require the player to carry around two items that each have only one use. If this redundancy was your design goal, then I apologize for the suggestion.

If a redstone torch could be used in addition to a compass to configure the lasers, then that would solve the problem. In the current version, it doesn't appear to work.

Again, I did not mean to disrespect. I was offering some help and free coding to make your mod work better with modpacks. It's your mod, and your right to take or leave it.

commented

The redstone torch and the compass just have distinct uses inside of the mod, and I just like functionality like this, it is a personal opinion that you just have to accept - and most important of all - respect, because I make the decisions around here. I don't like rejecting people's suggestions, especially if they put work into writing the code, but the choice is either rejecting an idea I don't like, or having an idea I don't like as part of my mod :(

As I said, the issue here definitely lies within WorldEdit because you were not talking about Item Laser Relays, but specifically Fluid and Energy ones - correct?
The Item Laser subscribes to a Forge Event to make sneak-right-clicking work, but the Energy and Fluid Laser don't do anything special, they just override the onBlockActivated method from Vanilla Minecraft, so WorldEdit appears to be missing some check before teleporting the player.

commented

As I said, there is no incompatibility problem that arises here, just because I use a vanilla item to configure my block. Both Forge and Vanilla have a lot of systems in place to prevent stuff like this happening. A problem only occurs if either my mod or another mod screws up their code, and I checked very thoroughly in mine after you submitted this issue, and couldn't find anything that isn't the way it should be :/

commented

I agree this is not AA's fault. In my initial post, I should have said "improvement" instead of "fix". This was always a suggestion, not a bug report. I never meant to say AA did anything wrong. Only that by changing this, it could be made better. I apologize for implying that there was problem in AA.

I also agree that AA is correctly using onBlockActivated from Forge (not vanilla Minecraft - the distinction is important). The problem with WorldEdit is that it was created when there was no Forge, and the code is much harder to update, and it has been in low-level maintenance mode for years. It will probably never be updated to use the correct Forge hooks.

For my server's modpack, I have disabled the teleport function in WE for now. AA is still too useful and too popular to remove. As an aside, If you would like any other help with coding or debugging, I offer it. I have been working on compatibility and inter-mod tweaks in my server's custom modpack since MC 1.0.

Good day, sir.

commented

I am 200% sure onBlockActivated is a vanilla method, because it is way above the FORGE START comments in the Block class, and also a bunch of vanilla blocks override it.
Yes, the name is added to it by MCP, but the method is vanilla.
Just wanted to make sure I'm right :P

Also, thanks for the offer, but I have a bunch of people I can ask so I probably won't be needing any additional help :)