mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-13 19:51:46 +01:00
Fixed snowman trails being treated as snow fall.
This commit is contained in:
parent
4805df2f03
commit
2df3290d38
@ -685,6 +685,16 @@ public void onBlockForm(BlockFormEvent event) {
|
||||
|
||||
int type = event.getNewState().getTypeId();
|
||||
|
||||
if (event instanceof EntityBlockFormEvent) {
|
||||
if (((EntityBlockFormEvent) event).getEntity() instanceof Snowman) {
|
||||
if (wcfg.disableSnowmanTrails) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == BlockID.ICE) {
|
||||
if (wcfg.disableIceFormation) {
|
||||
event.setCancelled(true);
|
||||
@ -718,27 +728,6 @@ public void onBlockForm(BlockFormEvent event) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Called when a block is formed by an entity.
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
public void onEntityBlockForm(EntityBlockFormEvent event) {
|
||||
ConfigurationManager cfg = plugin.getGlobalStateManager();
|
||||
WorldConfiguration wcfg = cfg.get(event.getBlock().getWorld());
|
||||
|
||||
if (cfg.activityHaltToggle) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getEntity() instanceof Snowman) {
|
||||
if (wcfg.disableSnowmanTrails) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Called when a block spreads based on world conditions.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user