mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-10-24 05:20:55 +02:00
Reorder tablist refresh
This commit is contained in:
parent
bc16fd739d
commit
273a2b358c
@ -408,8 +408,8 @@ public class EventListen implements Listener {
|
||||
}
|
||||
|
||||
private Location roundLocation(Location input) {
|
||||
return new Location(input.getWorld(), Math.floor(input.getX()),
|
||||
Math.floor(input.getY()), Math.floor(input.getZ()));
|
||||
return new Location(input.getWorld(), Math.floor(input.getX()), Math.floor(input.getY()), Math.floor(input
|
||||
.getZ()));
|
||||
}
|
||||
|
||||
private boolean spawn(NPC npc) {
|
||||
|
@ -25,7 +25,6 @@ import net.minecraft.server.v1_8_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_8_R1.Entity;
|
||||
import net.minecraft.server.v1_8_R1.EntityPlayer;
|
||||
import net.minecraft.server.v1_8_R1.EnumGamemode;
|
||||
import net.minecraft.server.v1_8_R1.EnumPlayerInfoAction;
|
||||
import net.minecraft.server.v1_8_R1.EnumProtocolDirection;
|
||||
import net.minecraft.server.v1_8_R1.GenericAttributes;
|
||||
import net.minecraft.server.v1_8_R1.MathHelper;
|
||||
@ -232,8 +231,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
||||
}
|
||||
moveOnCurrentHeading();
|
||||
} else if (motX != 0 || motZ != 0 || motY != 0) {
|
||||
g(0, 0); // is this necessary? it does controllable but
|
||||
// sometimes
|
||||
g(0, 0); // is this necessary? it does controllable but sometimes
|
||||
// players sink into the ground
|
||||
}
|
||||
|
||||
|
@ -87,8 +87,6 @@ public class HumanController extends AbstractEntityController {
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// Double check that we're still spawned and haven't changed
|
||||
// type.
|
||||
if (npc.isSpawned() && npc.getEntity().getType() == EntityType.PLAYER) {
|
||||
NMS.sendPlayerlistPacket(false, null, npc);
|
||||
}
|
||||
|
@ -495,12 +495,12 @@ public class NMS {
|
||||
|
||||
public static void showNPCReset(final Player player, final NPC npc) {
|
||||
sendDestroyPacket(player, npc);
|
||||
sendPlayerlistPacket(true, player, npc);
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (player.isOnline() && player.isValid() && npc.isSpawned()
|
||||
&& npc.getEntity().getType() == EntityType.PLAYER) {
|
||||
sendPlayerlistPacket(true, player, npc);
|
||||
sendSpawnPacket(player, npc);
|
||||
}
|
||||
}
|
||||
@ -513,7 +513,7 @@ public class NMS {
|
||||
sendPlayerlistPacket(false, player, npc);
|
||||
}
|
||||
}
|
||||
}, 2);
|
||||
}, 10);
|
||||
}
|
||||
|
||||
public static org.bukkit.entity.Entity spawnCustomEntity(org.bukkit.World world, Location at,
|
||||
|
Loading…
Reference in New Issue
Block a user