From ccfa75c16f36caacf2933df6f0ca71a454735a97 Mon Sep 17 00:00:00 2001 From: Shevchik Date: Sun, 1 Sep 2013 15:27:01 +0400 Subject: [PATCH] 100% less NMS --- .classpath | 1 - src/com/cnaude/chairs/PacketListener.java | 26 ++++------------------ target/Chairs.jar | Bin 23503 -> 22461 bytes 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/.classpath b/.classpath index e09f657..1c762da 100644 --- a/.classpath +++ b/.classpath @@ -4,6 +4,5 @@ - diff --git a/src/com/cnaude/chairs/PacketListener.java b/src/com/cnaude/chairs/PacketListener.java index bda5416..64e8d22 100644 --- a/src/com/cnaude/chairs/PacketListener.java +++ b/src/com/cnaude/chairs/PacketListener.java @@ -1,10 +1,7 @@ package com.cnaude.chairs; -import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.block.Block; -import org.bukkit.craftbukkit.v1_6_R2.entity.CraftArrow; -import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import com.comphenix.protocol.Packets; @@ -43,28 +40,13 @@ public class PacketListener { final Player player = e.getPlayer(); if (e.getPacket().getBooleans().getValues().get(1)) { - //hacks to avoid nope error - final Entity arrow = pluginInstance.sit.get(player.getName()); - if (arrow != null) + //just eject player if he is sitting on chair + if (pluginInstance.sit.containsKey(player.getName())) { - net.minecraft.server.v1_6_R2.EntityArrow nmsarrow = ((CraftArrow) arrow).getHandle(); - nmsarrow.motX = 0; - nmsarrow.motY = 0; - nmsarrow.motZ = 0; - nmsarrow.boundingBox.b = -1; + player.eject(); + unSit(player); } - //teleport player to correct location - - //unsit player - Bukkit.getScheduler().scheduleSyncDelayedTask(pluginInstance, new Runnable() - { - public void run() - { - unSit(player); - } - },1); } - } } }).syncStart(); diff --git a/target/Chairs.jar b/target/Chairs.jar index cea016adb6a3090ee4e327f023221a144a0d4987..25dd114c5da65e8cadf6a12e3e3574a366f333e4 100644 GIT binary patch delta 3029 zcmY+GcTiK?7Kf7%kP=EH2wW-BLJ^Q21c_h_Ee7eK3ep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