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

Feature/sink explosion #701

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Intybyte
Copy link
Contributor

Describe in detail what your pull request accomplishes

Adds the ability to make the craft explode on sink

Related issues:

Checklist

  • Tested

Comment on lines +213 to +227
@Override
public void run() {
CraftType type = sinkingCraft.getType();
float explosionStrength = type.getFloatProperty(CraftType.EXPLODE_ON_SINK);
boolean incendiary = type.getBoolProperty(CraftType.INCENDIARY_ON_SINK);

Location location = sinkingCraft.getHitBox().getMidPoint().toBukkit(sinkingCraft.getWorld());

ExplosionEvent event = new ExplosionEvent(location, explosionStrength, incendiary);
Bukkit.getServer().getPluginManager().callEvent(event);

if (!event.isCancelled())
location.createExplosion(explosionStrength, incendiary);
}
}.runTaskLater(Movecraft.getInstance(), tickDelay);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implementation does not match the requested feature in #501. The request was that blocks randomly explode as the craft sinks, this triggers a single explosion at the center.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad went by assumption, and didnt finish reading, my idea was that if like when a player dies/craft sinks or a craft sinks it explodes so it can't be used by the enemy or for modern servers that use movecraft and are like OilTrucks or stuff that in general can carry dangerous stuff they explode on sink

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is too different from the feature in #501, if this features isn't needed I will close it, otherwise I will close the PR

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

Successfully merging this pull request may close these issues.

2 participants