-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
base: main
Are you sure you want to change the base?
Conversation
@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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Describe in detail what your pull request accomplishes
Adds the ability to make the craft explode on sink
Related issues:
Checklist