Hex Casting

Hex Casting

6M Downloads

Supplementaries cages will overwrite artifacts when used with Place Block

squimbo opened this issue ยท 1 comments

commented

Modloader

Forge

Minecraft version

1.20.1

Hex Casting version

0.11.1-7-pre-668

Modloader version

Forge: 47.1.106

Modpack info

https://cdn.modrinth.com/data/AAfLM2wL/versions/ciAv1CM8/Power%20of%20Creation%201.0.8.mrpack

The latest.log file

No response

Issue description

Releasing a mob from a Supplementaries Cage with the place block spell will overwrite your offhand item.

Steps to reproduce

  1. Create a hex to place a block
  2. Use an artifact to read the spell from your main hand and cast with your offhand
  3. The artifact will be replaced with the now empty cage
cage_bug.mp4

Other information

No response

commented

Relevant code:

Hex:

val itemUseCtx = UseOnContext(env.world, caster as? ServerPlayer, env.castingHand, spoofedStack, blockHit)
val placeContext = BlockPlaceContext(itemUseCtx)
if (bstate.canBeReplaced(placeContext)) {
if (env.withdrawItem({ it == placeeStack }, 1, false)) {
val res = spoofedStack.useOn(placeContext)

Supplementaries:

https://github.com/MehVahdJukaar/Supplementaries/blob/cba3bfae89a48afb35617336b173ce2f90ac1c17/common/src/main/java/net/mehvahdjukaar/supplementaries/common/items/AbstractMobContainerItem.java#L242-L244

Moonlight (dependency of Supplementaries):

https://github.com/MehVahdJukaar/Moonlight/blob/1ae0f2616d1e0d3222a13647a868803c1f907cf8/common/src/main/java/net/mehvahdjukaar/moonlight/api/util/Utils.java#L75-L78