From 3254fd5cd07ff376f94e5df58e3c4e2c60b01e25 Mon Sep 17 00:00:00 2001 From: Shevchik Date: Sun, 23 Mar 2014 01:57:10 +0400 Subject: [PATCH] Add craftchairsarrow class for 1.7.5 --- .../vehiclearrow/nms175/CraftChairsArrow.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/com/cnaude/chairs/vehiclearrow/nms175/CraftChairsArrow.java diff --git a/src/com/cnaude/chairs/vehiclearrow/nms175/CraftChairsArrow.java b/src/com/cnaude/chairs/vehiclearrow/nms175/CraftChairsArrow.java new file mode 100644 index 0000000..7961d90 --- /dev/null +++ b/src/com/cnaude/chairs/vehiclearrow/nms175/CraftChairsArrow.java @@ -0,0 +1,30 @@ +package com.cnaude.chairs.vehiclearrow.nms175; + +import net.minecraft.server.v1_7_R2.EntityArrow; + +import org.bukkit.craftbukkit.v1_7_R2.CraftServer; +import org.bukkit.craftbukkit.v1_7_R2.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(); + } + +}