SteamWar/BauSystem
Archiviert
13
0

Add TPSLimit to any Entity except Player #210

Manuell gemergt
YoyoNow hat 1 Commits von TPSLimit nach master 2021-03-28 01:12:00 +01:00 zusammengeführt
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -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()));

Datei anzeigen

@ -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()));