mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 02:35:49 +01:00
Implement Arrow tile methods
This commit is contained in:
parent
61ca7d92c1
commit
d0a3620c2d
2 changed files with 29 additions and 0 deletions
|
@ -14,6 +14,19 @@
|
||||||
public abstract class EntityArrow extends Entity implements IProjectile {
|
public abstract class EntityArrow extends Entity implements IProjectile {
|
||||||
|
|
||||||
private static final Predicate<Entity> f = Predicates.and(new Predicate[] { IEntitySelector.e, IEntitySelector.a, new Predicate() {
|
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 @@
|
@@ -50,6 +57,7 @@
|
||||||
public EntityArrow(World world, EntityLiving entityliving) {
|
public EntityArrow(World world, EntityLiving entityliving) {
|
||||||
this(world, entityliving.locX, entityliving.locY + (double) entityliving.getHeadHeight() - 0.10000000149011612D, entityliving.locZ);
|
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 net.minecraft.server.EntityArrow;
|
||||||
|
|
||||||
import org.apache.commons.lang.Validate;
|
import org.apache.commons.lang.Validate;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.craftbukkit.CraftServer;
|
import org.bukkit.craftbukkit.CraftServer;
|
||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
@ -46,6 +47,21 @@ public class CraftArrow extends AbstractProjectile implements Arrow {
|
||||||
getHandle().projectileSource = shooter;
|
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
|
@Override
|
||||||
public PickupStatus getPickupStatus() {
|
public PickupStatus getPickupStatus() {
|
||||||
return PickupStatus.values()[getHandle().fromPlayer.ordinal()];
|
return PickupStatus.values()[getHandle().fromPlayer.ordinal()];
|
||||||
|
|
Loading…
Reference in a new issue