Java 类org.bukkit.projectiles.BlockProjectileSource 实例源码
项目:Uranium
文件:CraftDispenser.java
public BlockProjectileSource getBlockProjectileSource() {
Block block = getBlock();
if (block.getType() != Material.DISPENSER) {
return null;
}
return new CraftBlockProjectileSource(dispenser);
}
项目:ProjectAres
文件:MasterResolver.java
@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;
}
项目:ThermosRebased
文件:CraftDispenser.java
public BlockProjectileSource getBlockProjectileSource() {
Block block = getBlock();
if (block.getType() != Material.DISPENSER) {
return null;
}
return new CraftBlockProjectileSource(dispenser);
}
项目:Thermos
文件:CraftDispenser.java
public BlockProjectileSource getBlockProjectileSource() {
Block block = getBlock();
if (block.getType() != Material.DISPENSER) {
return null;
}
return new CraftBlockProjectileSource(dispenser);
}
项目:KCauldron
文件:CraftDispenser.java
public BlockProjectileSource getBlockProjectileSource() {
Block block = getBlock();
if (block.getType() != Material.DISPENSER) {
return null;
}
return new CraftBlockProjectileSource(dispenser);
}
项目:CauldronGit
文件:CraftDispenser.java
public BlockProjectileSource getBlockProjectileSource() {
Block block = getBlock();
if (block.getType() != Material.DISPENSER) {
return null;
}
return new CraftBlockProjectileSource(dispenser);
}
项目:Cauldron-Old
文件:CraftDispenser.java
public BlockProjectileSource getBlockProjectileSource() {
Block block = getBlock();
if (block.getType() != Material.DISPENSER) {
return null;
}
return new CraftBlockProjectileSource(dispenser);
}
项目:Cauldron-Reloaded
文件:CraftDispenser.java
public BlockProjectileSource getBlockProjectileSource() {
Block block = getBlock();
if (block.getType() != Material.DISPENSER) {
return null;
}
return new CraftBlockProjectileSource(dispenser);
}
项目:FFoKC
文件:CraftDispenser.java
public BlockProjectileSource getBlockProjectileSource() {
Block block = getBlock();
if (block.getType() != Material.DISPENSER) {
return null;
}
return new CraftBlockProjectileSource(dispenser);
}
项目:CraftBukkit
文件:CraftDispenser.java
public BlockProjectileSource getBlockProjectileSource() {
Block block = getBlock();
if (block.getType() != Material.DISPENSER) {
return null;
}
return new CraftBlockProjectileSource(dispenser);
}
项目:Ultra-Hardcore-1.8
文件:UhcDmg.java
private String gB(BlockProjectileSource a) {
switch (a.getBlock().getType()) {
case DISPENSER:
return "Dispenser";
default:
return "Unknown 0x5." + a.getBlock().getType().ordinal() + " {" + a.getBlock().getType() + "}";
}
}
项目:Craftbukkit
文件:CraftDispenser.java
public BlockProjectileSource getBlockProjectileSource() {
Block block = getBlock();
if (block.getType() != Material.DISPENSER) {
return null;
}
return new CraftBlockProjectileSource(dispenser);
}
项目:BukkitLib
文件:DamageData.java
/**
* Get the source of the damage done as an instance of {@link Block}.
* <p>
* If the damager related to this data is an instance of {@link Projectile},
* this method will return the <em>block represented by the shooter of</em> that projectile, assuming it is an instance of {@code BlockProjectileSource}.
* To get the projectile instance itself, use {@link #getSourceAsProjectile()}.
* @return The source of damage, or {@code null} if it is not a block that dealt the damage.
*/
public Block getSourceAsBlock(){
if(_source == null || (!(_source instanceof Block) && !(_source instanceof Projectile))){
return null;
}
Projectile proj = getSourceAsProjectile();
ProjectileSource shooter = proj == null ? null : proj.getShooter();
if(shooter instanceof BlockProjectileSource){
return ((BlockProjectileSource)shooter).getBlock();
}else{
return (Block)_source;
}
}
项目:Tweakkit-Server
文件:CraftDispenser.java
public BlockProjectileSource getBlockProjectileSource() {
Block block = getBlock();
if (block.getType() != Material.DISPENSER) {
return null;
}
return new CraftBlockProjectileSource(dispenser);
}
项目:Cauldron
文件:CraftDispenser.java
public BlockProjectileSource getBlockProjectileSource() {
Block block = getBlock();
if (block.getType() != Material.DISPENSER) {
return null;
}
return new CraftBlockProjectileSource(dispenser);
}
项目:SpigotSource
文件:CraftDispenser.java
public BlockProjectileSource getBlockProjectileSource() {
Block block = getBlock();
if (block.getType() != Material.DISPENSER) {
return null;
}
return new CraftBlockProjectileSource(dispenser);
}
项目:PlotSquared-Chinese
文件:PlayerEvents.java
@EventHandler
public void onProjectileHit(ProjectileHitEvent event) {
Projectile entity = (Projectile) event.getEntity();
Location loc = BukkitUtil.getLocation(entity);
if (!PlotSquared.isPlotWorld(loc.getWorld())) {
return;
}
Plot plot = MainUtil.getPlot(loc);
if (!MainUtil.isPlotArea(loc)) {
return;
}
ProjectileSource shooter = entity.getShooter();
if (shooter instanceof BlockProjectileSource) {
if (plot == null) {
entity.remove();
return;
}
Location sLoc = BukkitUtil.getLocation(((BlockProjectileSource) shooter).getBlock().getLocation());
Plot sPlot = MainUtil.getPlot(sLoc);
if (sPlot == null || !PlotHandler.sameOwners(plot, sPlot)) {
entity.remove();
return;
}
}
else if ((shooter instanceof Player)) {
PlotPlayer pp = BukkitUtil.getPlayer((Player) shooter);
if (plot == null) {
if (!pp.hasPermission("plots.projectile.unowned")) {
entity.remove();
}
return;
}
if (plot.isAdded(pp.getUUID())) {
return;
}
if (pp.hasPermission("plots.projectile.other")) {
return;
}
entity.remove();
}
}
项目:PlotSquared
文件:PlayerEvents.java
@EventHandler
public boolean onProjectileHit(ProjectileHitEvent event) {
Projectile entity = event.getEntity();
Location loc = BukkitUtil.getLocation(entity);
if (!PS.get().hasPlotArea(loc.getWorld())) {
return true;
}
PlotArea area = loc.getPlotArea();
if (area == null) {
return true;
}
Plot plot = area.getPlot(loc);
ProjectileSource shooter = entity.getShooter();
if (shooter instanceof Player) {
PlotPlayer pp = BukkitUtil.getPlayer((Player) shooter);
if (plot == null) {
if (!Permissions.hasPermission(pp, C.PERMISSION_PROJECTILE_UNOWNED)) {
entity.remove();
return false;
}
return true;
}
if (plot.isAdded(pp.getUUID()) || Permissions.hasPermission(pp, C.PERMISSION_PROJECTILE_OTHER)) {
return true;
}
entity.remove();
return false;
}
if (!(shooter instanceof Entity) && shooter != null) {
if (plot == null) {
entity.remove();
return false;
}
Location sLoc = BukkitUtil.getLocation(((BlockProjectileSource) shooter).getBlock().getLocation());
if (!area.contains(sLoc.getX(), sLoc.getZ())) {
entity.remove();
return false;
}
Plot sPlot = area.getOwnedPlotAbs(sLoc);
if (sPlot == null || !PlotHandler.sameOwners(plot, sPlot)) {
entity.remove();
return false;
}
}
return true;
}
项目:Pore
文件:PoreDispenser.java
@Override
public BlockProjectileSource getBlockProjectileSource() {
return PoreBlockProjectileSource.of(getTileEntity());
}
项目:Thermos-Bukkit
文件:Dispenser.java
/**
* Gets the BlockProjectileSource object for this dispenser.
* <p>
* If the block is no longer a dispenser, this will return null.
*
* @return a BlockProjectileSource if valid, otherwise null
*/
public BlockProjectileSource getBlockProjectileSource();
项目:CauldronGit
文件:Dispenser.java
/**
* Gets the BlockProjectileSource object for this dispenser.
* <p>
* If the block is no longer a dispenser, this will return null.
*
* @return a BlockProjectileSource if valid, otherwise null
*/
public BlockProjectileSource getBlockProjectileSource();
项目:Cauldron
文件:Dispenser.java
/**
* Gets the BlockProjectileSource object for this dispenser.
* <p>
* If the block is no longer a dispenser, this will return null.
*
* @return a BlockProjectileSource if valid, otherwise null
*/
public BlockProjectileSource getBlockProjectileSource();
项目:Cauldron
文件:Dispenser.java
/**
* Gets the BlockProjectileSource object for this dispenser.
* <p>
* If the block is no longer a dispenser, this will return null.
*
* @return a BlockProjectileSource if valid, otherwise null
*/
public BlockProjectileSource getBlockProjectileSource();
项目:Cauldron
文件:Dispenser.java
/**
* Gets the BlockProjectileSource object for this dispenser.
* <p>
* If the block is no longer a dispenser, this will return null.
*
* @return a BlockProjectileSource if valid, otherwise null
*/
public BlockProjectileSource getBlockProjectileSource();
项目:Spigot-API
文件:Dispenser.java
/**
* Gets the BlockProjectileSource object for this dispenser.
* <p>
* If the block is no longer a dispenser, this will return null.
*
* @return a BlockProjectileSource if valid, otherwise null
*/
public BlockProjectileSource getBlockProjectileSource();
项目:Bukkit-JavaDoc
文件:Dispenser.java
/**
* Gets the BlockProjectileSource object for this dispenser.
* <p>
* If the block is no longer a dispenser, this will return null.
*
* @return a BlockProjectileSource if valid, otherwise null
*/
public BlockProjectileSource getBlockProjectileSource();
项目:BedrockAPI
文件:Dispenser.java
BlockProjectileSource getBlockProjectileSource();