100% less NMS
This commit is contained in:
parent
c3e6bb68a9
commit
ccfa75c16f
@ -4,6 +4,5 @@
|
|||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
<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/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/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"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
package com.cnaude.chairs;
|
package com.cnaude.chairs;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.block.Block;
|
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 org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.comphenix.protocol.Packets;
|
import com.comphenix.protocol.Packets;
|
||||||
@ -43,28 +40,13 @@ public class PacketListener {
|
|||||||
final Player player = e.getPlayer();
|
final Player player = e.getPlayer();
|
||||||
if (e.getPacket().getBooleans().getValues().get(1))
|
if (e.getPacket().getBooleans().getValues().get(1))
|
||||||
{
|
{
|
||||||
//hacks to avoid nope error
|
//just eject player if he is sitting on chair
|
||||||
final Entity arrow = pluginInstance.sit.get(player.getName());
|
if (pluginInstance.sit.containsKey(player.getName()))
|
||||||
if (arrow != null)
|
|
||||||
{
|
{
|
||||||
net.minecraft.server.v1_6_R2.EntityArrow nmsarrow = ((CraftArrow) arrow).getHandle();
|
player.eject();
|
||||||
nmsarrow.motX = 0;
|
unSit(player);
|
||||||
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()
|
|
||||||
{
|
|
||||||
unSit(player);
|
|
||||||
}
|
|
||||||
},1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).syncStart();
|
}).syncStart();
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user