3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00

Implement Arrow tile methods

Dieser Commit ist enthalten in:
Parker Hawke 2018-05-01 15:27:59 -04:00 committet von md_5
Ursprung 61ca7d92c1
Commit d0a3620c2d
2 geänderte Dateien mit 29 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -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);

Datei anzeigen

@ -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()];