GithubHelp home page GithubHelp logo

armorequipevent's Introduction

Due to limitations with the Spigot API(because I never cared to remove such limitations) and my time not being spent on Minecraft as much anymore I am no longer interested in attempting to fix all remaining issues with the way this plugin attempts to handle the Event. If you would like to contribute to adding an Armor Equip Event to Spigot you can do so here, otherwise. I give full permission to anyone to take over this project.

ArmorEquipEvent

You can either take the needed parts out and stick it into your plugin or compile it as a jar and use it as a plugin depend, either way its useless without adding function to the event.

Should handle most ways to equip armor and not allow you to spam click equipping armor to get any possible benefits you might be adding using the event.

armorequipevent's People

Contributors

arnuh avatar badbones69 avatar borlea avatar kaeios avatar keebler17 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

armorequipevent's Issues

Detection for heads (Other than player)

Currently line 39 of ArmorType doesn't account for heads other then player, ie dragon head preventing the event from firing. Changing

if(type.endsWith("_HELMET") || type.endsWith("_SKULL") || type.endsWith("PLAYER_HEAD")) return HELMET;

To

if(type.endsWith("_HELMET") || type.endsWith("_SKULL") || type.endsWith("_HEAD")) return HELMET;

Solves this issue

Make a universal check for blocked blocks

Shouldn't really need a whole list of material names to fix this issue but I'm not too interested in fixing it at this point.

Also would make this plugin naturally support future versions.

Event not firing in rightclick

Hello,
I am using this resource as an API for a plugin am developing the only thing is that when i rightclick with an armor in my hand the event doesn't fire

Spigot Version: 1.8.8

1.16 Support

In 1.16 Netheritie armor was added, and if the plugin uses a lower api-version than 1.16 for whatever reason the Material of Netherite armor appears as AIR. If you update the api-version to 1.16 this will likely break lower version compatibility, so I'm not sure how you want to handle this. Either way, a working 1.16 fork can be found at 132ikl/ArmorEquipEvent.

(sorry) Thanks for removing EchoPet without warning :(

Hi Borlea, I'm not sure why you abondoned EchoPet fork you did, now I'm stuck on the 1.11.2 version, if the 1.12 comes out and gets broken in 1.12, I'm dead because I have players who bought pet packs I did on my server store and it would be nice to allow posting on your profile, everyone who wants the EchoPet plugin for 1.11.2 or lower, is dead.

Its a shame to see it go EchoPet without warning on SPigot, GitHub and your CI aswell. I counted on you for latest updates. So I'm stuck on 1.11.2 for now, until 1.12 comes out (maybe in months). A snapshot got out yesterday so I guess we have 1-2 month left on 1.11.2, or else ill be forced to remove EchoPet and everyone who bought 'em I'll be forced to refund them :/

I'm sorry if I've opened an issue which does not relate to AEE (ArmorEquipEvent) but that was the only source of communication I can start with you, I want news or if you can retry working on EchoPet, even I can donate if it can motivate you.... My server depend on EchoPet since 1.10. Thanks, have a nice day =(

PS: Don't delete this issue please, I want some news why you removed EchoPet without warning, and let someone fork it for you... I hope if you can update EchoPet if any issues arise.

PSS: Mind if you can send me the entire source of your EchoPEt you did? If I do decompilation, that can be worse (not the same code in case) that'll be appreciated :D You was the best EchoPet fork-er you did when I helped you fixing issues

Even doesn't fire in 1.14.4 it seems

I've forked the repo to compile against 1.14.4 here:
https://github.com/dream-horizon/ArmorEquipEvent

I've created the listener for the event here:
https://github.com/dream-horizon/DreamHorizon-Enchantments/blob/master/src/main/java/com/dreamhorizon/enchantments/listeners/ArmorEquipListener.java

I've created logging statements locally and there are no statements being hit at the root level of the armorEquipEvent function.

Looking for assistance, or a way to reach you outside of github, to update this. Will gladly PR back once the resolution is complete as DH is all about the open source community.

Thank you,
Collin Herber

Bug in InventoryClickEvent of ArmorListener

The if statement in line 50 of ArmorListener will always be true if it's not a crafting inventory:
if((e.getSlotType() != SlotType.ARMOR || e.getSlotType() != SlotType.QUICKBAR) && !e.getInventory().getName().equalsIgnoreCase("container.crafting"))

The first half always returns true because armor can't be quickbar and vice versa.

Echopet Question

<- Removed due to Borlea crying about me commenting on his GitHub, wouldn't want to hurt his feelings. ->

Echopet

<- Removed due to Borlea crying about me commenting on his GitHub, wouldn't want to hurt his feelings. ->

Items lost in creative mode

When I try to directly put an item or try to shift click it to equip it and cancel the event, the item is lost. This is not present while in survival.

Edit: This is paper 1.14.4 (I saw another issue and I saw the Armor event in paper but the javadocs say that the event does exist but is never called).

Edit 2: I just saw this thread and it explained this:

When in creative, most inventory actions fire an InventoryCreativeEvent instead because the client basically tells the server what it's spawning where.

If you do want to support creative armor changes, the click fired is always left, cursor is always the item being created/placed, and the current item is always the item being replaced. All you have to do is check if the current slot is the chest slot, then handle the old/new items accordingly.

So that's most likely the reason why this is happening.

PUMPKIN event does not work fully

equipping PUMPKIN with mouse (click to puck up from inventory click to drop on head slot) does not trigger event
would be nice to add SKULL_ITEM to helmet list as well

Event not firing when switching armor.

Hello, I have been using your plugin in my CrazyEnchantments plugin and its been the best help for me. I have run into a problem where say you have a block in your first slot and then you have a piece of armor on. You then hover over the armor and hit 1 to move it to that slot but the event doesn't fire. I have been trying to make a work around but can't seem to get it working. I would like to ask you if you could try and fix it and make the event fire. Because with my CrazyEnchantments plugin the potion effects stay even when removing the armor using this method.

armor bug

1.7.2 isn't recognizing the netherite material

As the title says the latest release isn't recognizing the netherite material, and I can't use the 1.7.4 version cause it spams console and change the player's gamemode on equip (surely cause it's marked as pre-release)

InventoryDragEvent is not being handled

If a player drags armor across an armor slot, then it will not throw an InventoryClickEvent, but an InventoryDragEvent. This event also needs to be listened for.

Dispensers can sometimes call ArmorEquipEvent when not in range

The check is currently a bit off in some cases. You can be really close but not actually in range.

Current fix: https://gist.github.com/Borlea/f92cf9da25a2a90cb5f60a3f3d3c601c

In order to actually add this fix to a public version of ArmorEquipEvent some changes will need to be made, which is obviously to remove the NMS parts of it.

Due to spigot lacking any form of api with entity bounding boxes(AxisAllignedBB). I will most likely do a commit to solve this. Related issue https://hub.spigotmc.org/jira/browse/SPIGOT-2151.

The current getNearbyEntities does some slight changes to what this code does and will result in issues again.

But as I said, current plan is to just add a AxisAlignedBB getBoundingBox() to the Entity baseclass in spigot and only support dispensers if such method is available.

Bug, Event fired when looking in players inventories.

Since the InventoryClick listener only checks if its a player inventory and not who owns the inventory, you can use the /invsee command to look into someone's inventory and shift click items in and it will trigger the event

Not working on 1.16.1

I'm currently running org.spigotmc:spigot:1.16.1-R0.1-SNAPSHOT as library, and can't manage to get the library working, I am using the following code for the onEnable method (I'm using Kotlin):

override fun onEnable() {
    logger.info("Registering listeners...")
    ArmorEquipListener(this)
}

and on the ArmorEquipListener:

class ArmorEquipListener(private val plugin: Plugin) : Listener {
    init {
        plugin.server.logger.info("   Registering ArmorEquipListener...")
        plugin.server.pluginManager.registerEvents(this, plugin)
    }

    @EventHandler
    fun onArmorEquip(event: ArmorEquipEvent) {
        plugin.server.logger.info("Got armor equip event")

        val player = event.player
        player.sendMessage("Wore armor!")
    }
}

Is the plugin incompatible with 1.16, or am I doing something wrong? Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.