2016-03-01 16:06:03 +01:00
|
|
|
package com.gamingmesh.jobs.nmsUtil;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
2016-04-03 16:22:44 +02:00
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
import org.bukkit.Material;
|
2016-03-01 16:06:03 +01:00
|
|
|
import org.bukkit.block.Block;
|
|
|
|
import org.bukkit.entity.Entity;
|
|
|
|
import org.bukkit.entity.Guardian;
|
2016-03-30 15:42:36 +02:00
|
|
|
import org.bukkit.entity.Player;
|
2016-03-01 16:06:03 +01:00
|
|
|
import org.bukkit.event.block.BlockPistonRetractEvent;
|
2016-03-30 15:42:36 +02:00
|
|
|
import org.bukkit.inventory.ItemStack;
|
2016-03-01 16:06:03 +01:00
|
|
|
|
|
|
|
import com.gamingmesh.jobs.NMS;
|
|
|
|
|
|
|
|
public class v1_9 implements NMS {
|
|
|
|
@Override
|
|
|
|
public List<Block> getPistonRetractBlocks(BlockPistonRetractEvent event) {
|
|
|
|
List<Block> blocks = new ArrayList<Block>();
|
|
|
|
blocks.addAll(event.getBlocks());
|
|
|
|
return blocks;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isElderGuardian(Entity entity) {
|
|
|
|
if (entity instanceof Guardian) {
|
|
|
|
Guardian guardian = (Guardian) entity;
|
|
|
|
if (guardian.isElder())
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2016-04-03 16:22:44 +02:00
|
|
|
|
2016-03-30 15:42:36 +02:00
|
|
|
@Override
|
|
|
|
public ItemStack getItemInMainHand(Player player) {
|
|
|
|
return player.getInventory().getItemInMainHand();
|
|
|
|
}
|
2016-03-01 16:06:03 +01:00
|
|
|
|
2016-04-03 16:22:44 +02:00
|
|
|
@Override
|
|
|
|
public Block getTargetBlock(Player player, int range) {
|
|
|
|
return player.getTargetBlock((Set<Material>) null, range);
|
|
|
|
}
|
|
|
|
|
2016-03-01 16:06:03 +01:00
|
|
|
}
|