ItemJoin

ItemJoin

157k Downloads

Items not being given when teleporting into region

ShawnPR1 opened this issue · 8 comments

commented

1.) Version of ItemJoin: 5.0.3
2.) Version of Spigot: Latest
3.) Issue:
I have an item set up that needs to be given to players when they enter a spawn region. It works perfectly when you walk into the region, but it does not give the item to the player when they teleport into the region.
4.) Relevant YAML:

  survival-wings:
    permissions-node: itemjoin.default
    id: elytra
    slot: chestplate
    name: '&cRed&1Bull&7 Gives you Wings'
    lore:
    - ''
    - '&7&oFly you fools!'
    itemflags: inventory-modify
    triggers: region-enter
    enabled-regions: spawn
    enabled-worlds: VikingsDen

As stated above, this works perfectly when a player walks into the region, but the item is not received when the player teleports into the region (even if they are in the same world).

This plugin is damn near perfect for anything imaginable I just wanna say that. This is a minor inconvenience, but I thought I may as well post it here since there are no item triggers called region-teleport. region-enter (I assume) should handle that as well.

commented

Funny enough I literally just released (like 2 hrs ago) a FULL rewrite of the RegionEnter class which (should) work and has been tested. The issue had to do with all the recent WorldGuard changes, its hard to keep up with all the new API versions, there is like three for WG and four for WorldEdit.

I should note tho, the way the RegionEnter class works is the player has to move once they are in the region to get the item. (Even a slight mouse twitch will give them the items). It is the way that WorldGuard's api checks to see if they are in a region.

Snapshot (containing the "fix"); http://ci.craftationgaming.com/job/ItemJoin/228/

Let me know if this resolved your issue.

commented

Ah, its all good. Either way the RegionEnter class has been rewritten--so I know for a fact it will work in the next update! haha. If you need anything else let me know!

commented

Know what I'm to blame here.

I had 2 regions set up:
One called spawn, one called inner-spawn.

Forgot to set the priority of spawn to 1 (both were on 0).

This does not seem to be an issue at all since I teleported into the region from multiple worlds and received the item as intended.

Sorry for the false bug report.

Keep up the phenomenal work!

commented

I used this quite a while back and had an issue with the maps unloading when players tp and so on.

Stopped with MC for quite some time and saw at some point you resolved that issue since a lot of people were apparently also getting the problem haha.

Thanks for your quick responses. Yet again this plugin is mindblowingly helpful and is so darn customizable.

commented

Thanks for the kind words I really appreciate it. It always makes me happy to make my project into something that others can enjoy.

commented

I know this ticket is closed, but just want to at least state that the snapshot 5.0.4 fixed an actual bug I encountered just now haha:

If you have 2 regions with a similar name (mine being spawn and spawn-inner) the item would disappear when leaving the inner-most region and then be given back to you after a short delay. The only reason why this is a bug is because I've set it up to only give the item to players in spawn-inner and the spawn region surrounds that region.

Just posting that here in case someone else has that same issue so you at least know your snapshot version does indeed resolve that.

commented

Yeah, it was because I used a comparison to see if the names were similar (suppose to ignore cases) but it actually did an isSimilar to the text instead of checking for the name. Now it directly compares with the region list and sees if the name is EXACT, except it ignores cases properly now :3.

This latest snapshot also fixes issues with subregions (allowing you to give items in a subregion while also being in the main region).

commented

I can see that haha. Removed priority of the inner region and the item is still being given to a player, but removed when they leave it.

Main reason I do the whole 2 region spawn thing is so that players don't fly outside of spawn using the elytra then die when it gets removed.

This might be completely irrelevant, but sometimes effort goes unnoticed a lot haha. Like you fixing these bugs or me setting up a double region in a specific way so players don't die.

I'm a programmer myself (although I have almost zero knowledge on how to code plugins) so I can somewhat understand how much effort you put into this, if not more. Thanks again man.