新增对掉落物的优化,可以吃到精准采集buff
This commit is contained in:
parent
bda0f8dee7
commit
007142891b
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>cn.lunadeer</groupId>
|
<groupId>cn.lunadeer</groupId>
|
||||||
<artifactId>LiteWorldEdit</artifactId>
|
<artifactId>LiteWorldEdit</artifactId>
|
||||||
<version>2.4.3.9</version>
|
<version>2.5.0.1</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>LiteWorldEdit</name>
|
<name>LiteWorldEdit</name>
|
||||||
|
@ -8,6 +8,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.block.BlockBreakEvent;
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
public class Remove extends Job {
|
public class Remove extends Job {
|
||||||
@ -45,10 +46,12 @@ public class Remove extends Job {
|
|||||||
BlockBreakEvent event = new BlockBreakEvent(raw_block, _creator);
|
BlockBreakEvent event = new BlockBreakEvent(raw_block, _creator);
|
||||||
Bukkit.getPluginManager().callEvent(event);
|
Bukkit.getPluginManager().callEvent(event);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
Material block_type = raw_block.getType();
|
Collection<ItemStack> drops = raw_block.getDrops(pickaxe, _creator);
|
||||||
raw_block.setType(Material.AIR);
|
raw_block.setType(Material.AIR);
|
||||||
if (LiteWorldEdit.instance.getConfigMgr().isDropItems()) {
|
if (LiteWorldEdit.instance.getConfigMgr().isDropItems()) {
|
||||||
raw_block.getWorld().dropItemNaturally(raw_block.getLocation(), new ItemStack(block_type));
|
for (ItemStack drop : drops) {
|
||||||
|
raw_block.getWorld().dropItemNaturally(raw_block.getLocation(), drop);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 损坏镐
|
// 损坏镐
|
||||||
if (!_creator.isOp() && _creator.getGameMode() != GameMode.CREATIVE) {
|
if (!_creator.isOp() && _creator.getGameMode() != GameMode.CREATIVE) {
|
||||||
|
Loading…
Reference in New Issue
Block a user