This works better, but still strange.

This commit is contained in:
Shevchik 2013-09-01 08:14:57 +04:00
parent 5147416dc9
commit ac462ab278
3 changed files with 4 additions and 14 deletions

View File

@ -4,7 +4,6 @@ import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.v1_6_R2.entity.CraftArrow;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.ItemFrame; import org.bukkit.entity.ItemFrame;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;

View File

@ -1,7 +1,5 @@
package com.cnaude.chairs; package com.cnaude.chairs;
import java.util.HashSet;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_6_R2.entity.CraftArrow; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftArrow;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
@ -40,15 +38,14 @@ public class PacketListener {
System.out.println("Checking packet"); System.out.println("Checking packet");
if (!e.isCancelled()) if (!e.isCancelled())
{ {
System.out.println(e.getPacket().getBooleans().getValues().get(1));
final String playername = e.getPlayer().getName(); final String playername = e.getPlayer().getName();
if (e.getPacket().getBooleans().getValues().get(1)) if (e.getPacket().getBooleans().getValues().get(1))
{ {
e.getAsyncMarker().incrementProcessingDelay();
Bukkit.getScheduler().scheduleSyncDelayedTask(pluginInstance, new Runnable() Bukkit.getScheduler().scheduleSyncDelayedTask(pluginInstance, new Runnable()
{ {
public void run() public void run()
{ {
System.out.println("Doing magic");
Entity arrow = pluginInstance.sit.get(playername); Entity arrow = pluginInstance.sit.get(playername);
if (arrow != null) if (arrow != null)
{ {
@ -56,19 +53,13 @@ public class PacketListener {
nmsarrow.motX = 0; nmsarrow.motX = 0;
nmsarrow.motY = 0; nmsarrow.motY = 0;
nmsarrow.motZ = 0; nmsarrow.motZ = 0;
nmsarrow.boundingBox.b = 0.1; nmsarrow.boundingBox.b = -1;
} }
pm.getAsynchronousManager().signalPacketTransmission(e);
} }
}); });
e.getAsyncMarker().incrementProcessingDelay();
Bukkit.getScheduler().scheduleSyncDelayedTask(pluginInstance, new Runnable()
{
public void run() {
pm.getAsynchronousManager().signalPacketTransmission(e);
}
}, 2);
} }
} }
} }
}).start(); }).start();

Binary file not shown.