SteamWar/BauSystem2.0
Archiviert
12
0

Added isolate on trace entity

Dieser Commit ist enthalten in:
D4rkr34lm 2024-04-21 14:57:44 +02:00
Ursprung f7727eb01c
Commit 7ddfcb83ec
3 geänderte Dateien mit 1024 neuen und 1218 gelöschten Zeilen

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -27,12 +27,14 @@ import de.steamwar.entity.REntity;
import de.steamwar.entity.REntityServer; import de.steamwar.entity.REntityServer;
import de.steamwar.techhider.BlockIds; import de.steamwar.techhider.BlockIds;
import lombok.Getter; import lombok.Getter;
import net.md_5.bungee.api.chat.ClickEvent;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* Wrapper for the rendering of a record bundle * Wrapper for the rendering of a record bundle
@ -47,10 +49,13 @@ public class TraceEntity extends REntity {
@Getter @Getter
private final List<TNTPoint> records; private final List<TNTPoint> records;
private final String uniqueTntIdsString;
public TraceEntity(REntityServer server, Location location, boolean isExplosion, List<TNTPoint> records) { public TraceEntity(REntityServer server, Location location, boolean isExplosion, List<TNTPoint> records) {
super(server, EntityType.FALLING_BLOCK, location, BlockIds.impl.materialToId(isExplosion ? Material.RED_STAINED_GLASS : Material.TNT) >> (Core.getVersion() <= 12 ? 4 : 0)); super(server, EntityType.FALLING_BLOCK, location, BlockIds.impl.materialToId(isExplosion ? Material.RED_STAINED_GLASS : Material.TNT) >> (Core.getVersion() <= 12 ? 4 : 0));
setNoGravity(true); setNoGravity(true);
this.records = records; this.records = records;
uniqueTntIdsString = records.stream().map(TNTPoint::getTntId).distinct().map(Object::toString).collect(Collectors.joining(" "));
addEntityMethod.invoke(server, this); addEntityMethod.invoke(server, this);
} }
@ -70,6 +75,7 @@ public class TraceEntity extends REntity {
BauSystem.MESSAGE.sendPrefixless("TNT_CLICK_VELOCITY_X", player, representative.getVelocity().getX() + ""); BauSystem.MESSAGE.sendPrefixless("TNT_CLICK_VELOCITY_X", player, representative.getVelocity().getX() + "");
BauSystem.MESSAGE.sendPrefixless("TNT_CLICK_VELOCITY_Y", player, representative.getVelocity().getY() + ""); BauSystem.MESSAGE.sendPrefixless("TNT_CLICK_VELOCITY_Y", player, representative.getVelocity().getY() + "");
BauSystem.MESSAGE.sendPrefixless("TNT_CLICK_VELOCITY_Z", player, representative.getVelocity().getZ() + ""); BauSystem.MESSAGE.sendPrefixless("TNT_CLICK_VELOCITY_Z", player, representative.getVelocity().getZ() + "");
BauSystem.MESSAGE.sendPrefixless("TNT_CLICK_ISOLATE", player, BauSystem.MESSAGE.parse("TRACE_MESSAGE_CLICK_ISOLATE", player), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/trace isolate " + uniqueTntIdsString));
} }
@Override @Override