Add TPSLimit to any Entity except Player #210
@ -24,7 +24,7 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.FallingBlock;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.TNTPrimed;
|
import org.bukkit.entity.TNTPrimed;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -36,7 +36,7 @@ class TPSLimit_12 {
|
|||||||
|
|
||||||
static void createTickCache(World world) {
|
static void createTickCache(World world) {
|
||||||
packets.clear();
|
packets.clear();
|
||||||
world.getEntitiesByClasses(TNTPrimed.class, FallingBlock.class).forEach(entity -> {
|
world.getEntities().stream().filter(entity -> !(entity instanceof Player)).forEach(entity -> {
|
||||||
packets.add(new PacketPlayOutEntityVelocity(entity.getEntityId(), 0, 0, 0));
|
packets.add(new PacketPlayOutEntityVelocity(entity.getEntityId(), 0, 0, 0));
|
||||||
packets.add(new PacketPlayOutEntityTeleport(((CraftEntity) entity).getHandle()));
|
packets.add(new PacketPlayOutEntityTeleport(((CraftEntity) entity).getHandle()));
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.FallingBlock;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.TNTPrimed;
|
import org.bukkit.entity.TNTPrimed;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -37,7 +37,7 @@ class TPSLimit_15 {
|
|||||||
|
|
||||||
static void createTickCache(World world) {
|
static void createTickCache(World world) {
|
||||||
packets.clear();
|
packets.clear();
|
||||||
world.getEntitiesByClasses(TNTPrimed.class, FallingBlock.class).forEach(entity -> {
|
world.getEntities().stream().filter(entity -> !(entity instanceof Player)).forEach(entity -> {
|
||||||
packets.add(new PacketPlayOutEntityVelocity(entity.getEntityId(), noMotion));
|
packets.add(new PacketPlayOutEntityVelocity(entity.getEntityId(), noMotion));
|
||||||
packets.add(new PacketPlayOutEntityTeleport(((CraftEntity) entity).getHandle()));
|
packets.add(new PacketPlayOutEntityTeleport(((CraftEntity) entity).getHandle()));
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren