mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-25 02:17:35 +01:00
Implement Arrow tile methods
This commit is contained in:
parent
61ca7d92c1
commit
d0a3620c2d
@ -14,6 +14,19 @@
|
||||
public abstract class EntityArrow extends Entity implements IProjectile {
|
||||
|
||||
private static final Predicate<Entity> f = Predicates.and(new Predicate[] { IEntitySelector.e, IEntitySelector.a, new Predicate() {
|
||||
@@ -17,9 +24,9 @@
|
||||
}
|
||||
}});
|
||||
private static final DataWatcherObject<Byte> g = DataWatcher.a(EntityArrow.class, DataWatcherRegistry.a);
|
||||
- private int h;
|
||||
- private int at;
|
||||
- private int au;
|
||||
+ public int h; // PAIL: private->public
|
||||
+ public int at; // PAIL: private->public
|
||||
+ public int au; // PAIL: private->public
|
||||
private Block av;
|
||||
private int aw;
|
||||
public boolean inGround;
|
||||
@@ -50,6 +57,7 @@
|
||||
public EntityArrow(World world, EntityLiving entityliving) {
|
||||
this(world, entityliving.locX, entityliving.locY + (double) entityliving.getHeadHeight() - 0.10000000149011612D, entityliving.locZ);
|
||||
|
@ -4,6 +4,7 @@ import com.google.common.base.Preconditions;
|
||||
import net.minecraft.server.EntityArrow;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.EntityType;
|
||||
@ -46,6 +47,21 @@ public class CraftArrow extends AbstractProjectile implements Arrow {
|
||||
getHandle().projectileSource = shooter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInBlock() {
|
||||
return getHandle().inGround;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getAttachedBlock() {
|
||||
if (!isInBlock()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
EntityArrow handle = getHandle();
|
||||
return getWorld().getBlockAt(handle.h, handle.at, handle.au); // PAIL: rename tileX, tileY, tileZ
|
||||
}
|
||||
|
||||
@Override
|
||||
public PickupStatus getPickupStatus() {
|
||||
return PickupStatus.values()[getHandle().fromPlayer.ordinal()];
|
||||
|
Loading…
Reference in New Issue
Block a user