Aquaculture 2

Aquaculture 2

86M Downloads

Dupe issue with Vampirism

maxanier opened this issue Ā· 7 comments

commented

Hello,

there seems to be an dupe issue with my mod Vampirism and its Bat Mode and the Neptune's bounty block from Aquaculture: TeamLapen/Vampirism#1021

Minecraft 1.16

While the player is in bat mode, I cancel the BlockEvent.EntityPlaceEvent https://github.com/TeamLapen/Vampirism/blob/5fd3c650b577a6d85d0077b6108f8814a0cbaba2/src/main/java/de/teamlapen/vampirism/player/ModPlayerEventHandler.java#L199, which results in Forge removing the placed block again (by restoring the stored block snapshots).
For some reason this results in the following behavior:
When a player in bat mode places a Neptune's bounty block, its content is dropped, but the block is not placed in the world and the item remains in the player's inventory.

I assume this is something I have to fix on my end, but I am a bit lost.
How do I obtain a filled Neptune's bounty item for testing? Is there any way to do so without spending a lot of time fishing?
Also how exactly does the block work and where is the respective itemstack created in code?
I looked through the release-1.16.5 branch, but couldn't find the place where the itemstack is created.

Thank you for your help

commented

Ok, thank you, I will try to build myself a similar item, I can cheat for testing purposes.

commented

The content is applied with the vanilla loot table function "minecraft:set_contents".
Besides thatĀ“s, itĀ“s just a vanilla chest with a different texture.
https://github.com/TeamMetallurgy/Aquaculture/blob/master/src/main/resources/data/aquaculture/loot_tables/gameplay/fishing/neptunium.json#L13

commented

Do you mean when placing NeptuneĀ“s Bounty for the first time, when having obtained one from fishing?

commented

As far as I understood, yes.(I haven't reproduced it myself, because I did not want to spend hours fishing)

commented

I was able to create a similar item and recreate my issue with a vanilla chest. I did not know vanilla chests were able to store their content in an item stack :) Thank you

No problem, good to hear you figured it out :)

commented

I was able to create a similar item and recreate my issue with a vanilla chest.
I did not know vanilla chests were able to store their content in an item stack :)
Thank you