本文整理汇总了Java中org.bukkit.block.PistonMoveReaction类的典型用法代码示例。如果您正苦于以下问题:Java PistonMoveReaction类的具体用法?Java PistonMoveReaction怎么用?Java PistonMoveReaction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PistonMoveReaction类属于org.bukkit.block包,在下文中一共展示了PistonMoveReaction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBlockPistonRetract
import org.bukkit.block.PistonMoveReaction; //导入依赖的package包/类
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onBlockPistonRetract(BlockPistonRetractEvent event) {
final Block block = event.getBlock();
if ( block == null )
return;
// Get the location and target block.
final Location loc = event.getRetractLocation();
if ( loc == null )
return;
final Block target = loc.getBlock();
if ( target == null || target.getType() == Material.AIR )
return;
final Material mat = target.getType();
final PistonMoveReaction reaction = target.getPistonMoveReaction();
// Determine if the piston is sticky.
final boolean sticky = event.isSticky();
// Figure out if we should even care about this.
if ( (sticky && reaction == PistonMoveReaction.BLOCK) || (!sticky && (target.getFace(block) != BlockFace.DOWN || (mat != Material.SAND && mat != Material.GRAVEL))) )
return;
// Check to see if the block is protected.
final ArrayList<ABPortal> portals = plugin.protectBlock(target);
if ( portals == null ) {
event.setCancelled(true);
return;
}
// After the block is gone, update all our portals.
if ( portals.size() > 0 )
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new UpdatePortals(event, portals), 10L);
}
示例2: getPistonMoveReaction
import org.bukkit.block.PistonMoveReaction; //导入依赖的package包/类
public PistonMoveReaction getPistonMoveReaction() {
return PistonMoveReaction.getById(getNMSBlock().getMaterial().getMaterialMobility());
}
示例3: getPistonMoveReaction
import org.bukkit.block.PistonMoveReaction; //导入依赖的package包/类
@Override
public PistonMoveReaction getPistonMoveReaction()
{
// TODO Auto-generated method stub
throw new UnimplementedOperationException();
}
示例4: getPistonMoveReaction
import org.bukkit.block.PistonMoveReaction; //导入依赖的package包/类
@Override
public PistonMoveReaction getPistonMoveReaction() {
return PistonMoveReaction.IGNORE;
}
示例5: getPistonMoveReaction
import org.bukkit.block.PistonMoveReaction; //导入依赖的package包/类
@Override
public PistonMoveReaction getPistonMoveReaction() {
return null;
}
示例6: getPistonMoveReaction
import org.bukkit.block.PistonMoveReaction; //导入依赖的package包/类
@Override
public PistonMoveReaction getPistonMoveReaction() {
return player.getPistonMoveReaction();
}
示例7: getPistonMoveReaction
import org.bukkit.block.PistonMoveReaction; //导入依赖的package包/类
@Override
public PistonMoveReaction getPistonMoveReaction() {
return b.getPistonMoveReaction();
}
示例8: getPistonMoveReaction
import org.bukkit.block.PistonMoveReaction; //导入依赖的package包/类
@Override
public PistonMoveReaction getPistonMoveReaction() {
throw new UnsupportedOperationException();
}
示例9: getPistonMoveReaction
import org.bukkit.block.PistonMoveReaction; //导入依赖的package包/类
@Override
public PistonMoveReaction getPistonMoveReaction() {
return null;
}
示例10: getPistonMoveReaction
import org.bukkit.block.PistonMoveReaction; //导入依赖的package包/类
@Override
public PistonMoveReaction getPistonMoveReaction() {
throw Pokkit.unsupported();
}
示例11: getPistonMoveReaction
import org.bukkit.block.PistonMoveReaction; //导入依赖的package包/类
@Override
public PistonMoveReaction getPistonMoveReaction() {
return PistonMoveReaction.MOVE;
}
示例12: getPistonMoveReaction
import org.bukkit.block.PistonMoveReaction; //导入依赖的package包/类
@Override
public PistonMoveReaction getPistonMoveReaction() {
return PistonMoveReaction.BREAK;
}
示例13: getReturnType
import org.bukkit.block.PistonMoveReaction; //导入依赖的package包/类
public Class<? extends PistonMoveReaction> getReturnType() {
return PistonMoveReaction.class;
}
示例14: get
import org.bukkit.block.PistonMoveReaction; //导入依赖的package包/类
@Nullable
protected PistonMoveReaction[] get(Event e) {
return new PistonMoveReaction[]{block.getSingle(e).getPistonMoveReaction()};
}
示例15: getPistonMoveReaction
import org.bukkit.block.PistonMoveReaction; //导入依赖的package包/类
@Override
public PistonMoveReaction getPistonMoveReaction() {
throw new NotImplementedException("getPistonMoveReaction()");
}