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

Probable bug with RuinGenerateEvent #86

Open
TfT-02 opened this issue Mar 10, 2013 · 6 comments
Open

Probable bug with RuinGenerateEvent #86

TfT-02 opened this issue Mar 10, 2013 · 6 comments

Comments

@TfT-02
Copy link

TfT-02 commented Mar 10, 2013

When listening to RuinGenerateEvent to edit the loot inside the chests, I encountered some trouble. So I added some debug messages and I noticed how:
event.getChest().getType() returns Material.AIR, I'd expect that it would return Material.CHEST

So it would appear that event.getChest() is getting the wrong block.

Using Jenkins dev build: https://diabloplugins.ci.cloudbees.com/job/DiabloDrops/7/

@TfT-02
Copy link
Author

TfT-02 commented Mar 11, 2013

After doing more tests, I noticed that the coordinates are actually correct.
Does this event get called before the chest gets generated?

@ToppleTheNun
Copy link
Contributor

It does get called before the chest is generated.

@TfT-02
Copy link
Author

TfT-02 commented Mar 12, 2013

Is that intentional? Would it be possible to fire the event after the chest is generated?

@ToppleTheNun
Copy link
Contributor

I suggest that you run a task after catching the generation that will then mess with the contents of the chest, using BukkitScheduler.

@TfT-02
Copy link
Author

TfT-02 commented Mar 13, 2013

That would be a possible solution, yes. Though I still think it is weird how event.getChest() does not return the chest.

@ToppleTheNun
Copy link
Contributor

Yeah, it is weird.

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

No branches or pull requests

2 participants