Applied Energistics 2

Applied Energistics 2

137M Downloads

Memory card wont work.

Caaruzo opened this issue · 15 comments

commented

Greetings, ive installed AE2 on my Forge Based server. Now i encountered an issue. When i take an fresh clean crafted Memorycard and sneak + rightclick onto an p2p ME tunnel it says Saved to memory card but same time it says memory card cleared. if i just rightclick it says invalid machine. Means iam not able to link 2 p2p ME together. Iam not wearing anything in offhand or something. I dont know what causes the issue and hope someone can help pls.

Minecraft Version: 1.12.2
AE2 Version: appliedenergistics2-rv6-stable-7.jar
Forge: forge-1.12.2-14.23.5.2838-universal.jar
Using Sponge? No

commented

If you can't fix this bug, could you provide a workaround? On my server memory cards immediately clear after storing memory, even if nothing is in my off hand. I downloaded the world and opened it in single player and memory cards work fine.

This makes p2p tunnels completely useless on servers. Could you either add another way to link p2p tunnels or have some "hacky" fix, such as when a memory card is linked creating a couple tick delay before it can be cleared?

commented

I don't think this even is the same bug as the one that has to do with checking the doesSneakBypassUse in both hands. The bug I am having still occurs no matter what is in my off hand. I've tried with nothing in my off hand, tried putting a memory card in both hands, and tried putting a memory card in my off hand and nothing in the main hand. Nothing seems to work.

commented

it seems to he can't fix that. I use other mods that also use the rightclick + shit rightclick mechaninc with cards like RFTools. And they work well. So its ofc not a mc problem or forge. but anyway. As workarround you can do it like me and disable channels in config. this removes controllers and p2p ports etc. so you can connect all together without a channel restriction and p2p mem card using

commented

@yueh , IMO it's not a Forge/MC problem. IMO is problem in the AE2 source file: appeng/items/tools/ToolMemoryCard.java.
When I commented (so removed) the overriden method:
public EnumActionResult onItemUse( ... )
on the line 187, the problem has been solved. From that point the memory card works as expected, it loads configuration on click to a P2P while sneaking and it clears the memory card while sneaking and clicking to air or any else non-AE block.

Tested on both server and client. Forge: forge-1.12.2-14.23.5.2838-universal.jar

commented

I found a workaround that worked for me.

First put the memory card in your offhand,
then right click the p2p,
the take it off your offhand,
then shift-right click the same p2p and you should get the "new device configuration created and copied to memory card" message.
now you can shift-right click the next p2p with no problem.

commented

Also doesnt work for me, still get "Memory Card cleared" message. What i have done:

  1. Put Memory Card in Slot 1 and pressed "F" for offhand equip
  2. rightclick p2p with empty right hand but memory card in left hand.
  3. pressed F again, Memory card went back to Slot 1
  4. Shift+Rightclick p2p-> "ew device configuration created and copied to memory card + Memorycard cleared"
  5. rightclick another p2p Message: "invalid device"

Any other solution maybe? :(

@yueh are u sure with the forge bug? tested that now against several forge versions for 1.12.2 and the issue persists. :(

Edit 2: Problem just exists in Server Multiplayer. Its not recreatable for me on single player

commented

Vanilla/Forge bug.

commented

Update, after it got closed unresolved.

Problem still present. Forge says, "its not the first time, that yueh tells that." Also forge means "its definitly not a forge / mc problem itself."

commented

It's definitely a forge/mc problem, dunno if they understand their own code.

Basically it's these two classes:

net.minecraft.client.multiplayer.PlayerControllerMP#L450
boolean bypass = player.getHeldItemMainhand().doesSneakBypassUse(worldIn, pos, player) && player.getHeldItemOffhand().doesSneakBypassUse(worldIn, pos, player);

net.minecraft.server.management.PlayerInteractionManager#L469
boolean bypass = player.getHeldItemMainhand().doesSneakBypassUse(worldIn, pos, player) && player.getHeldItemOffhand().doesSneakBypassUse(worldIn, pos, player);

It expects that both hold items to allow a bypass, if either does not, it won't allow it. And not allowing is the default case for pretty much everything. Forge could of course argue that it does not work like that etc, But even then they don't document that net.minecraft.item.Item.doesSneakBypassUse(ItemStack, IBlockAccess, BlockPos, EntityPlayer) does need to be true for both items, or that it should not be used because deprecated or what not.
If they aren't able to at least document what they expect us to use, they can't expect that we do it magically.

commented

ok seems logic for me, maybe you both should work together to clarify that and work a solution out? xD

commented

In my experience it's more or less a waste of time. If they believe it's not a bug, they pretty much won't change at all. Regardless of how logically it may sound. There migh also deeper implications, e.g. because forge/vanilla might not able to differ between the main hand and offhand itemstack and tries to use both or the wrong one and patching it all the way through might be too complicated.

commented

@yueh , IMO it's not a Forge/MC problem. IMO is problem in the AE2 source file: appeng/items/tools/ToolMemoryCard.java.
When I commented (so removed) the overriden method:
public EnumActionResult onItemUse( ... )
on the line 187, the problem has been solved. From that point the memory card works as expected, it loads configuration on click to a P2P while sneaking and it clears the memory card while sneaking and clicking to air or any else non-AE block.

Tested on both server and client. Forge: forge-1.12.2-14.23.5.2838-universal.jar

Hello. Can you share this file please? I cant do it mysef. Error:
`FAILURE: Build failed with an exception.

  • What went wrong:
    Could not resolve all files for configuration ':forgeGradleMcpData'.

Could not resolve de.oceanlabs.mcp:mcp:1.12.2.
Required by:
project :
Could not resolve de.oceanlabs.mcp:mcp:1.12.2.
> Could not get resource 'https://minecraft.curseforge.com/api/maven/de/oceanlabs/mcp/mcp/1.12.2/mcp-1.12.2.pom'.
> Could not GET 'https://minecraft.curseforge.com/api/maven/de/oceanlabs/mcp/mcp/1.12.2/mcp-1.12.2.pom'. Received status code 503 from server: Service Temporarily Unavailable`
Thanks

commented

Thank you very very much! I will try it. Sorry for my English)

commented

Here's the version running on my server. It will work completely on the server side, no need to update clients.

The only issue I've seen with it is that memory cards can't be cleared unless you're looking at air, other than that it's flawless.

appliedenergistics2-rv6-stable-7.zip

commented

Just recompiled with this change, its now working perfectly.