World Border (Fabric)

World Border (Fabric)

261k Downloads

[Passive Shield] Doesn't support shields using FabricShieldLib

xanthian opened this issue ยท 5 comments

commented

This seems a possibly easy fix and include instanceof FabricShieldItem

if ((stack.getItem() instanceof ShieldItem) || (stack.getItem() instanceof FabricShieldItem))

commented

Is compatibility incoming?

commented

This seems a possibly easy fix and include instanceof FabricShieldItem

if ((stack.getItem() instanceof ShieldItem) || (stack.getItem() instanceof FabricShieldItem))

Hey there,

Im not very tech savvy, but where do I put this code? Thanks

commented

First block:
https://github.com/ricksouth/serilum-mc-mods/blob/0aa89aa9688bd5aa3370cc3cc6b8639aaad580a3/sources-fabric/Passive%20Shield%20(Fabric)/src/main/java/com/natamus/passiveshield/events/ClientEvent.java#L32
Replace with:

if (itemStack.getItem() instanceof ShieldItem || itemStack.getItem() instanceof FabricShieldItem) {

Second block:
https://github.com/ricksouth/serilum-mc-mods/blob/0aa89aa9688bd5aa3370cc3cc6b8639aaad580a3/sources-fabric/Passive%20Shield%20(Fabric)/src/main/java/com/natamus/passiveshield/events/ServerEvent.java#L35-L36
Replace with:

if (!(player.getMainHandItem().getItem() instanceof ShieldItem || player.getMainHandItem().getItem() instanceof FabricShieldItem)) { 
	if (!(player.getOffhandItem().getItem() instanceof ShieldItem || player.getOffhandItem().getItem() instanceof FabricShieldItem)) {

Note: code is untested; please try to test the changes if possible.
You will need to add some import statements near the top of both files and possibly link FabricShieldLib as a soft dependency in order for the change to work.

commented

Support has been added in the latest version via Fabric's new shield tag. Thanks for opening the issue and giving the mod a try!

commented

This still isn't working with Variant Shields mod, but works perfectly with vanilla and knight metal shield from twilight forest. Is the issue on this end?