100% less NMS

This commit is contained in:
Shevchik 2013-09-01 15:27:01 +04:00
parent c3e6bb68a9
commit ccfa75c16f
3 changed files with 4 additions and 23 deletions

View File

@ -4,6 +4,5 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="C:/Users/Shevchik/Documents/GitHub/Chairs/libs/ProtocolLib-2.6.1-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="C:/Users/Shevchik/Documents/GitHub/Chairs/libs/bukkit-1.6.2-R0.2-20130829.060124-15.jar"/>
<classpathentry kind="lib" path="C:/Users/Shevchik/Documents/GitHub/Chairs/libs/craftbukkit-1.6.2-R0.2-20130830.024149-24.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -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)
{
net.minecraft.server.v1_6_R2.EntityArrow nmsarrow = ((CraftArrow) arrow).getHandle();
nmsarrow.motX = 0;
nmsarrow.motY = 0;
nmsarrow.motZ = 0;
nmsarrow.boundingBox.b = -1;
}
//teleport player to correct location
//unsit player
Bukkit.getScheduler().scheduleSyncDelayedTask(pluginInstance, new Runnable()
{
public void run()
//just eject player if he is sitting on chair
if (pluginInstance.sit.containsKey(player.getName()))
{
player.eject();
unSit(player);
}
},1);
}
}
}
}).syncStart();

Binary file not shown.