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

Implement ItemSpawnEvent and ItemDespawnEvent #643

Merged
merged 2 commits into from Dec 28, 2017

Conversation

Projects
None yet
3 participants
@momothereal
Member

momothereal commented Dec 25, 2017

This PR implements ItemSpawnEvent and ItemDespawnEvent, and replaces GlowItem constructor usage by the GlowWorld#dropItem method.

@momothereal

This comment has been minimized.

Member

momothereal commented Dec 25, 2017

Do not merge, I found an issue with this but can't fix it for a moment

// TODO: separate spawning and construction for better event cancellation
entity.remove();
} else {

This comment has been minimized.

@mastercoms

mastercoms Dec 28, 2017

Member

Shouldn't this branch also require non null? Wrap the whole if else in a null check.

This comment has been minimized.

@momothereal

momothereal Dec 28, 2017

Member

No, if the event is null, it means that the event was fired elsewhere. The spawn message is still necessary.

This comment has been minimized.

@mastercoms

mastercoms Dec 28, 2017

Member

Oh whoops, I don't know how, but I misread that null check as one for entity, not spawnEvent.

@mastercoms mastercoms merged commit 5e58958 into GlowstoneMC:dev Dec 28, 2017

2 checks passed

ci/circleci: build Your tests passed on CircleCI!
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment