diff --git a/libs/craftbukkit1710.jar b/libs/craftbukkit1710.jar index 16adce3..22915b9 100644 Binary files a/libs/craftbukkit1710.jar and b/libs/craftbukkit1710.jar differ diff --git a/src/com/cnaude/chairs/vehiclearrow/nmsV17R4/CraftChairsArrow.java b/src/com/cnaude/chairs/vehiclearrow/nmsV17R4/CraftChairsArrow.java new file mode 100644 index 0000000..e5ed632 --- /dev/null +++ b/src/com/cnaude/chairs/vehiclearrow/nmsV17R4/CraftChairsArrow.java @@ -0,0 +1,30 @@ +package com.cnaude.chairs.vehiclearrow.nmsV17R4; + +import net.minecraft.server.v1_7_R4.EntityArrow; + +import org.bukkit.craftbukkit.v1_7_R4.CraftServer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftArrow; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; +import org.bukkit.entity.Vehicle; + +import com.cnaude.chairs.api.ChairsAPI; + +public class CraftChairsArrow extends CraftArrow implements Vehicle { + + public CraftChairsArrow(CraftServer server, EntityArrow entity) { + super(server, entity); + } + + @Override + public void remove() { + Entity passenger = getPassenger(); + if (passenger != null && passenger instanceof Player) { + if (ChairsAPI.isSitting((Player) passenger)) { + return; + } + } + super.remove(); + } + +} diff --git a/src/com/cnaude/chairs/vehiclearrow/nmsV17R4/NMSChairsArrow.java b/src/com/cnaude/chairs/vehiclearrow/nmsV17R4/NMSChairsArrow.java new file mode 100644 index 0000000..38a0193 --- /dev/null +++ b/src/com/cnaude/chairs/vehiclearrow/nmsV17R4/NMSChairsArrow.java @@ -0,0 +1,43 @@ +package com.cnaude.chairs.vehiclearrow.nmsV17R4; + +import net.minecraft.server.v1_7_R4.EntityArrow; + +import org.bukkit.Location; +import org.bukkit.Server; +import org.bukkit.craftbukkit.v1_7_R4.CraftServer; +import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; +import org.bukkit.entity.Arrow; + +import com.cnaude.chairs.vehiclearrow.NMSChairsArrowInterface; + +public class NMSChairsArrow extends EntityArrow implements NMSChairsArrowInterface { + + public NMSChairsArrow(CraftWorld cworld) { + super(cworld.getHandle()); + } + + @Override + public void h() { + } + + @Override + public void setBukkitEntity(Server server) { + bukkitEntity = new CraftChairsArrow((CraftServer) server, this); + } + + @Override + public Arrow getBukkitArrow() { + return (Arrow) bukkitEntity; + } + + @Override + public void setArrowLocation(Location location) { + setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); + } + + @Override + public void addToWorld() { + world.addEntity(this); + } + +}