本文整理汇总了Java中org.bukkit.event.player.PlayerArmorStandManipulateEvent.getRightClicked方法的典型用法代码示例。如果您正苦于以下问题:Java PlayerArmorStandManipulateEvent.getRightClicked方法的具体用法?Java PlayerArmorStandManipulateEvent.getRightClicked怎么用?Java PlayerArmorStandManipulateEvent.getRightClicked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.event.player.PlayerArmorStandManipulateEvent
的用法示例。
在下文中一共展示了PlayerArmorStandManipulateEvent.getRightClicked方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ArmorStandGreef
import org.bukkit.event.player.PlayerArmorStandManipulateEvent; //导入方法依赖的package包/类
@EventHandler
public void ArmorStandGreef(PlayerArmorStandManipulateEvent e){
if(e.getRightClicked() instanceof ArmorStand){
ArmorStand clickedA = (ArmorStand) e.getRightClicked();
if(clickedA.getPassenger() == null){
ArrayList<Location> all_main_seats = new ArrayList<Location>();
for(attractie att : Main.r.Attracties.values()){
for(ArmorStand a : att.getMainSeats())
{
all_main_seats.add(a.getLocation());
}
}
if(all_main_seats.contains(clickedA.getLocation())){
e.setCancelled(true);
}
}
}
}
示例2: onArmorStandManupulation
import org.bukkit.event.player.PlayerArmorStandManipulateEvent; //导入方法依赖的package包/类
@EventHandler
public void onArmorStandManupulation(PlayerArmorStandManipulateEvent e) {
KingdomFactionsPlayer p = PlayerModule.getInstance().getPlayer(e.getPlayer());
if(p.isVanished()) return;
if(e.isCancelled()) return;
if(e.getRightClicked() == null) return;
if(!p.canBuild(e.getRightClicked().getLocation())) {
e.setCancelled(!ProtectionModule.getInstance().tryInfluence(p, 200));
}
}
示例3: ArmorStandGreef
import org.bukkit.event.player.PlayerArmorStandManipulateEvent; //导入方法依赖的package包/类
@EventHandler
public void ArmorStandGreef(PlayerArmorStandManipulateEvent e){
if(e.getRightClicked() instanceof ArmorStand){
ArmorStand clickedA = (ArmorStand) e.getRightClicked();
if(clickedA.getPassenger() == null){
ArrayList<ArmorStand> all_main_seats = new ArrayList<ArmorStand>();
for(Rollercoaster att : Main.r.Attracties.values()){
all_main_seats.addAll(att.getMainSeats());
}
if(all_main_seats.contains(clickedA)){
e.setCancelled(true);
}
}
}
}
示例4: ArmorStandGreef
import org.bukkit.event.player.PlayerArmorStandManipulateEvent; //导入方法依赖的package包/类
@EventHandler
public void ArmorStandGreef(PlayerArmorStandManipulateEvent e){
if(e.getRightClicked() instanceof ArmorStand){
ArmorStand clickedA = (ArmorStand) e.getRightClicked();
if(clickedA.getPassenger() == null){
ArrayList<ArmorStand> all_main_seats = new ArrayList<ArmorStand>();
for(attractie att : Main.r.Attracties.values()){
all_main_seats.addAll(att.getMainSeats());
}
if(all_main_seats.contains(clickedA)){
e.setCancelled(true);
}
}
}
}
示例5: onPlayerManipulateArmorStand
import org.bukkit.event.player.PlayerArmorStandManipulateEvent; //导入方法依赖的package包/类
@EventHandler(ignoreCancelled = true)
public void onPlayerManipulateArmorStand(PlayerArmorStandManipulateEvent e) {
// When clicking an armor stand with an armor item, the armor stand will take it.
// As a hologram consists of armor stands, they would also take the item.
ArmorStand armorStand = e.getRightClicked();
if (Hologram.isPartOfHologram(armorStand)) {
e.setCancelled(true);
}
}
示例6: onArmorStandManip
import org.bukkit.event.player.PlayerArmorStandManipulateEvent; //导入方法依赖的package包/类
@EventHandler
public void onArmorStandManip(final PlayerArmorStandManipulateEvent event) {
debug("PlayerArmorStandManipulateEvent(" + event.getPlayer().getName() + ", " + event.getRightClicked().getType() + ", "
+ event.getArmorStandItem().getType() + ", " + event.getPlayerItem() + ")");
final ArmorStand entity = event.getRightClicked();
if (!canInteract(entity, event.getPlayer())) { debug("CANCELLED!"); event.setCancelled(true); }
else { debug("ALLOWED!"); }
}