org.bukkit.projectiles.BlockProjectileSource Java Examples

The following examples show how to use org.bukkit.projectiles.BlockProjectileSource. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TrackerMatchModule.java    From PGM with GNU Affero General Public License v3.0 5 votes vote down vote up
public @Nullable PhysicalInfo resolveShooter(ProjectileSource source) {
  if (source instanceof Entity) {
    return entityTracker.resolveEntity((Entity) source);
  } else if (source instanceof BlockProjectileSource) {
    return blockTracker.resolveBlock(((BlockProjectileSource) source).getBlock());
  }
  return null;
}
 
Example #2
Source File: CraftDispenser.java    From Kettle with GNU General Public License v3.0 5 votes vote down vote up
@Override
public BlockProjectileSource getBlockProjectileSource() {
    Block block = getBlock();

    if (block.getType() != Material.DISPENSER) {
        return null;
    }

    return new CraftBlockProjectileSource((TileEntityDispenser) this.getTileEntityFromWorld());
}
 
Example #3
Source File: MasterResolver.java    From ProjectAres with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public @Nullable PhysicalInfo resolveShooter(ProjectileSource source) {
    if(source instanceof Entity) {
        return entityTracker.resolveEntity((Entity) source);
    } else if(source instanceof BlockProjectileSource) {
        return blockTracker.resolveBlock(((BlockProjectileSource) source).getBlock());
    }
    return null;
}
 
Example #4
Source File: CraftDispenser.java    From Thermos with GNU General Public License v3.0 5 votes vote down vote up
public BlockProjectileSource getBlockProjectileSource() {
    Block block = getBlock();

    if (block.getType() != Material.DISPENSER) {
        return null;
    }

    return new CraftBlockProjectileSource(dispenser);
}
 
Example #5
Source File: Dispenser.java    From Kettle with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Gets the BlockProjectileSource object for the dispenser.
 * <p>
 * If the block represented by this state is no longer a dispenser, this
 * will return null.
 *
 * @return a BlockProjectileSource if valid, otherwise null
 * @throws IllegalStateException if this block state is not placed
 */
public BlockProjectileSource getBlockProjectileSource();