Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parrot interaction condition #2543

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

Dreeam-qwq
Copy link
Contributor

In original condition, if the player right clicked target is not Parrot, but if the hand is offhand and player hold cookie on offhand, the whole condition will pass. So it may has error like below, possibly player right clicked cat and also hold cookie on offhand.

[16:48:32 ERROR]: Could not pass event PlayerInteractEntityEvent to BentoBox v2.7.0
java.lang.ClassCastException: class org.bukkit.craftbukkit.entity.CraftCat cannot be cast to class org.bukkit.entity.Parrot (org.bukkit.craftbukkit.entity.CraftCat and org.bukkit.entity.Parrot are in unnamed module of loader java.net.URLClassLoader @1c6b6478)
        at BentoBox-2.7.0.jar/world.bentobox.bentobox.listeners.flags.protection.HurtingListener.onPlayerFeedParrots(HurtingListener.java:120) ~[BentoBox-2.7.0.jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor65.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:65) ~[leaf-1.21.1.jar:1.21.1-DEV-9514f2b]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) ~[leaf-1.21.1.jar:1.21.1-DEV-9514f2b]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:629) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl$3.performInteraction(ServerGamePacketListenerImpl.java:2946) ~[leaf-1.21.1.jar:1.21.1-DEV-9514f2b]

This pr fix it.

@tastybento
Copy link
Member

Thanks!

@tastybento tastybento merged commit e761d65 into BentoBoxWorld:develop Nov 6, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants