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

Encode ground items and projectiles in region updates #321

Open
Major- opened this issue May 25, 2017 · 3 comments
Open

Encode ground items and projectiles in region updates #321

Major- opened this issue May 25, 2017 · 3 comments
Labels
medium request A non-content feature request

Comments

@Major-
Copy link
Member

Major- commented May 25, 2017

Region#encode currently skips ground items and projectiles and so updates for these wont be sent.

public Set<RegionUpdateMessage> encode(int height) {
	Set<RegionUpdateMessage> additions = entities.values().stream()
		.flatMap(Set::stream) // TODO fix this to work for ground items + projectiles
		.filter(entity -> entity instanceof DynamicGameObject && entity.getPosition().getHeight() == height)
		.map(entity -> ((GroupableEntity) entity).toUpdateOperation(this, EntityUpdateType.ADD).toMessage())
		.collect(Collectors.toSet());

	ImmutableSet.Builder<RegionUpdateMessage> builder = ImmutableSet.builder();
	builder.addAll(additions).addAll(updates.get(height)).addAll(removedObjects.get(height));
	return builder.build();
}
@Major- Major- added medium request A non-content feature request labels May 25, 2017
@Promises
Copy link
Contributor

Also make sure owner/dropper/creator sees his items first.

@Major-
Copy link
Member Author

Major- commented May 25, 2017

Also make sure owner/dropper/creator sees his items first.

Yeah, this involves sending a separate frame (SendTileItemMessage). Probably want to introduce some sort of repository/manager for the items

@rmcmk
Copy link
Contributor

rmcmk commented Apr 27, 2018

Ground items are finished in #372

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium request A non-content feature request
Projects
None yet
Development

No branches or pull requests

3 participants