mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Fixed #3858 - Falling blocks in water not getting tracked
This commit is contained in:
parent
21ecf959ea
commit
467025888c
@ -1,3 +1,6 @@
|
|||||||
|
Version 2.1.49
|
||||||
|
Fixed a bug where falling blocks were not marked as unnatural in water
|
||||||
|
|
||||||
Version 2.1.48
|
Version 2.1.48
|
||||||
1.14 Support
|
1.14 Support
|
||||||
Added Cats, Foxes, and Pandas to Taming XP rewards
|
Added Cats, Foxes, and Pandas to Taming XP rewards
|
||||||
|
2
pom.xml
2
pom.xml
@ -2,7 +2,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
||||||
<artifactId>mcMMO</artifactId>
|
<artifactId>mcMMO</artifactId>
|
||||||
<version>2.1.48</version>
|
<version>2.1.49-SNAPSHOT</version>
|
||||||
<name>mcMMO</name>
|
<name>mcMMO</name>
|
||||||
<url>https://github.com/mcMMO-Dev/mcMMO</url>
|
<url>https://github.com/mcMMO-Dev/mcMMO</url>
|
||||||
<scm>
|
<scm>
|
||||||
|
@ -7,7 +7,6 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
import org.bukkit.event.player.PlayerEvent;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event is sent for when mcMMO informs a player about various important information
|
* This event is sent for when mcMMO informs a player about various important information
|
||||||
|
@ -34,16 +34,13 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Tag;
|
import org.bukkit.Tag;
|
||||||
import org.bukkit.block.*;
|
import org.bukkit.block.*;
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
import org.bukkit.entity.Item;
|
import org.bukkit.entity.Item;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.*;
|
import org.bukkit.event.block.*;
|
||||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.metadata.FixedMetadataValue;
|
|
||||||
import org.bukkit.metadata.MetadataValue;
|
import org.bukkit.metadata.MetadataValue;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -187,37 +184,6 @@ public class BlockListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Monitor falling blocks.
|
|
||||||
*
|
|
||||||
* @param event The event to watch
|
|
||||||
*/
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
|
||||||
public void onFallingBlock(EntityChangeBlockEvent event) {
|
|
||||||
/* WORLD BLACKLIST CHECK */
|
|
||||||
if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld()))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (BlockUtils.shouldBeWatched(event.getBlock().getState()) && event.getEntityType().equals(EntityType.FALLING_BLOCK)) {
|
|
||||||
if (event.getTo().equals(Material.AIR) && mcMMO.getPlaceStore().isTrue(event.getBlock())) {
|
|
||||||
event.getEntity().setMetadata("mcMMOBlockFall", new FixedMetadataValue( plugin, event.getBlock().getLocation()));
|
|
||||||
} else {
|
|
||||||
List<MetadataValue> values = event.getEntity().getMetadata( "mcMMOBlockFall" );
|
|
||||||
|
|
||||||
if (!values.isEmpty()) {
|
|
||||||
|
|
||||||
if (values.get(0).value() == null) return;
|
|
||||||
Block spawn = ((org.bukkit.Location) values.get(0).value()).getBlock();
|
|
||||||
|
|
||||||
|
|
||||||
mcMMO.getPlaceStore().setTrue( event.getBlock() );
|
|
||||||
mcMMO.getPlaceStore().setFalse( spawn );
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monitor BlockPlace events.
|
* Monitor BlockPlace events.
|
||||||
*
|
*
|
||||||
|
@ -159,7 +159,9 @@ public class EntityListener implements Listener {
|
|||||||
// When the event is fired for the falling block that changes back to a
|
// When the event is fired for the falling block that changes back to a
|
||||||
// normal block
|
// normal block
|
||||||
// event.getBlock().getType() returns AIR
|
// event.getBlock().getType() returns AIR
|
||||||
if (!BlockUtils.shouldBeWatched(block.getState()) && block.getType() != Material.AIR) {
|
if (!BlockUtils.shouldBeWatched(block.getState())
|
||||||
|
&& block.getState().getType() != Material.WATER
|
||||||
|
&& block.getType() != Material.AIR) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.gmail.nossr50.util.player;
|
package com.gmail.nossr50.util.player;
|
||||||
|
|
||||||
import com.gmail.nossr50.api.exceptions.McMMOPlayerNotFoundException;
|
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
Loading…
Reference in New Issue
Block a user