Tracer-entity #147
@ -31,10 +31,12 @@ import java.lang.reflect.Field;
|
|||||||
class TraceEntity_12 extends EntityFallingBlock implements AbstractTraceEntity {
|
class TraceEntity_12 extends EntityFallingBlock implements AbstractTraceEntity {
|
||||||
|
|
||||||
private Vector position;
|
private Vector position;
|
||||||
|
private boolean tnt;
|
||||||
|
|
||||||
public TraceEntity_12(World world, Vector position, Player player, boolean exploded, boolean tnt) {
|
public TraceEntity_12(World world, Vector position, Player player, boolean exploded, boolean tnt) {
|
||||||
super(((CraftWorld) world).getHandle(), position.getX(), position.getY(), position.getZ(), tnt ? Blocks.TNT.getBlockData() : Blocks.STAINED_GLASS.getBlockData());
|
super(((CraftWorld) world).getHandle(), position.getX(), position.getY(), position.getZ(), tnt ? Blocks.TNT.getBlockData() : Blocks.STAINED_GLASS.getBlockData());
|
||||||
this.position = position;
|
this.position = position;
|
||||||
|
this.tnt = tnt;
|
||||||
|
|
||||||
this.setNoGravity(true);
|
this.setNoGravity(true);
|
||||||
|
|||||||
this.ticksLived = -12000;
|
this.ticksLived = -12000;
|
||||||
Lixfel
hat
Kann man glaube ich mit in das if ziehen. Kann man glaube ich mit in das if ziehen.
YoyoNow
hat
Ich wollte noch vllt als Namen den int tick anzeigen was hältst du davon? Ich wollte noch vllt als Namen den int tick anzeigen was hältst du davon?
|
|||||||
@ -64,8 +66,10 @@ class TraceEntity_12 extends EntityFallingBlock implements AbstractTraceEntity {
|
|||||||
PacketPlayOutEntityTeleport packetPlayOutEntityTeleport = new PacketPlayOutEntityTeleport(this);
|
PacketPlayOutEntityTeleport packetPlayOutEntityTeleport = new PacketPlayOutEntityTeleport(this);
|
||||||
playerConnection.sendPacket(packetPlayOutEntityTeleport);
|
playerConnection.sendPacket(packetPlayOutEntityTeleport);
|
||||||
Lixfel
hat
Metadata nur benötigt, wenn es sich um TNT handelt. Metadata nur benötigt, wenn es sich um TNT handelt.
|
|||||||
|
|
||||||
|
if (tnt) {
|
||||||
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), datawatcher, true);
|
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), datawatcher, true);
|
||||||
playerConnection.sendPacket(packetPlayOutEntityMetadata);
|
playerConnection.sendPacket(packetPlayOutEntityMetadata);
|
||||||
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -54,8 +54,10 @@ class TraceEntity_15 extends EntityFallingBlock implements AbstractTraceEntity {
|
|||||||
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
|
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
|
||||||
playerConnection.sendPacket(packetPlayOutSpawnEntity);
|
playerConnection.sendPacket(packetPlayOutSpawnEntity);
|
||||||
|
|
||||||
|
if (tnt) {
|
||||||
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), datawatcher, true);
|
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), datawatcher, true);
|
||||||
playerConnection.sendPacket(packetPlayOutEntityMetadata);
|
playerConnection.sendPacket(packetPlayOutEntityMetadata);
|
||||||
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -22,8 +22,6 @@ package de.steamwar.bausystem.commands;
|
|||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
import de.steamwar.bausystem.tracer.record.RecordStateMachine;
|
import de.steamwar.bausystem.tracer.record.RecordStateMachine;
|
||||||
import de.steamwar.bausystem.tracer.record.RecordStatus;
|
|
||||||
import de.steamwar.bausystem.tracer.show.ShowMode;
|
|
||||||
import de.steamwar.bausystem.tracer.show.StoredRecords;
|
import de.steamwar.bausystem.tracer.show.StoredRecords;
|
||||||
import de.steamwar.bausystem.tracer.show.TraceShowManager;
|
import de.steamwar.bausystem.tracer.show.TraceShowManager;
|
||||||
import de.steamwar.bausystem.tracer.show.mode.Advanced;
|
import de.steamwar.bausystem.tracer.show.mode.Advanced;
|
||||||
@ -73,29 +71,16 @@ public class CommandTrace implements CommandExecutor {
|
|||||||
switch (args[0].toLowerCase()) {
|
switch (args[0].toLowerCase()) {
|
||||||
case "start":
|
case "start":
|
||||||
RecordStateMachine.commandStart();
|
RecordStateMachine.commandStart();
|
||||||
player.sendMessage(BauSystem.PREFIX + "§aTNT-Tracer gestartet");
|
player.sendMessage(BauSystem.PREFIX + RecordStateMachine.getRecordStatus().getMessage());
|
||||||
break;
|
break;
|
||||||
case "stop":
|
case "stop":
|
||||||
RecordStateMachine.commandStop();
|
RecordStateMachine.commandStop();
|
||||||
player.sendMessage(BauSystem.PREFIX + "§cTNT-Tracer gestoppt");
|
player.sendMessage(BauSystem.PREFIX + RecordStateMachine.getRecordStatus().getMessage());
|
||||||
break;
|
break;
|
||||||
case "toggleauto":
|
case "toggleauto":
|
||||||
case "auto":
|
case "auto":
|
||||||
RecordStateMachine.commandAuto();
|
RecordStateMachine.commandAuto();
|
||||||
switch (RecordStateMachine.getRecordStatus()) {
|
player.sendMessage(BauSystem.PREFIX + RecordStateMachine.getRecordStatus().getAutoMessage());
|
||||||
case IDLE:
|
|
||||||
player.sendMessage(BauSystem.PREFIX + "§cAuto-Tracer gestoppt");
|
|
||||||
break;
|
|
||||||
case IDLE_AUTO:
|
|
||||||
player.sendMessage(BauSystem.PREFIX + "§aAuto-Tracer gestartet");
|
|
||||||
break;
|
|
||||||
case RECORD:
|
|
||||||
player.sendMessage(BauSystem.PREFIX + "§cTNT-Tracer muss gestoppt werden");
|
|
||||||
break;
|
|
||||||
case RECORD_AUTO:
|
|
||||||
player.sendMessage(BauSystem.PREFIX + "§cTNT-Tracer muss aus sein");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case "clear":
|
case "clear":
|
||||||
Lixfel
hat
Idee: Zugehörige Message als Parameter eines RecordStatus. Dann musst du hier nicht switch-casen. Idee: Zugehörige Message als Parameter eines RecordStatus. Dann musst du hier nicht switch-casen.
|
|||||||
case "delete":
|
case "delete":
|
||||||
@ -103,31 +88,29 @@ public class CommandTrace implements CommandExecutor {
|
|||||||
player.sendMessage(BauSystem.PREFIX + "§cAlle TNT-Positionen gelöscht");
|
player.sendMessage(BauSystem.PREFIX + "§cAlle TNT-Positionen gelöscht");
|
||||||
break;
|
break;
|
||||||
case "show":
|
case "show":
|
||||||
ShowMode showMode;
|
|
||||||
if (args.length < 2) {
|
if (args.length < 2) {
|
||||||
showMode = new Basic(player);
|
TraceShowManager.show(player, new Basic(player));
|
||||||
} else {
|
} else {
|
||||||
switch (args[1].toLowerCase()) {
|
switch (args[1].toLowerCase()) {
|
||||||
case "nowater":
|
case "nowater":
|
||||||
case "basic-nowater":
|
case "basic-nowater":
|
||||||
case "basicnowater":
|
case "basicnowater":
|
||||||
showMode = new BasicNoWater(player);
|
TraceShowManager.show(player, new BasicNoWater(player));
|
||||||
break;
|
break;
|
||||||
case "advanced":
|
case "advanced":
|
||||||
showMode = new Advanced(player);
|
TraceShowManager.show(player, new Advanced(player));
|
||||||
break;
|
break;
|
||||||
case "advanced-nowater":
|
case "advanced-nowater":
|
||||||
case "advancednowater":
|
case "advancednowater":
|
||||||
showMode = new AdvancedNoWater(player);
|
TraceShowManager.show(player, new AdvancedNoWater(player));
|
||||||
break;
|
break;
|
||||||
Lixfel
hat
Statt hier eine extravariable zu setzen, kannst du direkt TraceShowManager.show(player, new ShowMode()); machen. Statt hier eine extravariable zu setzen, kannst du direkt TraceShowManager.show(player, new ShowMode()); machen.
|
|||||||
case "basic":
|
case "basic":
|
||||||
case "default":
|
case "default":
|
||||||
default:
|
default:
|
||||||
showMode = new Basic(player);
|
TraceShowManager.show(player, new Basic(player));
|
||||||
break;
|
break;
|
||||||
Lixfel
hat
Frag evtl. auch mal andere, aber ich würde nowater zum Default machen, und withwater als Extramodus nehmen. Frag evtl. auch mal andere, aber ich würde nowater zum Default machen, und withwater als Extramodus nehmen.
YoyoNow
hat
Kann man das dann als Argument reinhauen? Kann man das dann als Argument reinhauen?
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
TraceShowManager.show(player, showMode);
|
|
||||||
player.sendMessage(BauSystem.PREFIX + "§aAlle TNT-Positionen angezeigt");
|
player.sendMessage(BauSystem.PREFIX + "§aAlle TNT-Positionen angezeigt");
|
||||||
break;
|
break;
|
||||||
case "hide":
|
case "hide":
|
||||||
|
@ -21,17 +21,21 @@ package de.steamwar.bausystem.tracer.record;
|
|||||||
|
|
||||||
public enum RecordStatus {
|
public enum RecordStatus {
|
||||||
|
|
||||||
RECORD("§aan", true),
|
RECORD("§aan", true, "§aTNT-Tracer gestartet", "§cTNT-Tracer muss gestoppt werden"),
|
||||||
RECORD_AUTO("§aan", true),
|
RECORD_AUTO("§aan", true, "§cAuto-Tracer muss aus sein", "§cTNT-Tracer muss aus sein"),
|
||||||
IDLE("§caus", false),
|
IDLE("§caus", false, "§cTNT-Tracer gestoppt", "§cAuto-Tracer gestoppt"),
|
||||||
IDLE_AUTO("§eauto", false);
|
IDLE_AUTO("§eauto", false, "§cTNT-Tracer muss gestoppt werden", "§aAuto-Tracer gestartet");
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
boolean tracing;
|
boolean tracing;
|
||||||
|
String message;
|
||||||
|
String autoMessage;
|
||||||
|
|
||||||
RecordStatus(String value, boolean tracing) {
|
RecordStatus(String value, boolean tracing, String message, String autoMessage) {
|
||||||
this.name = value;
|
this.name = value;
|
||||||
this.tracing = tracing;
|
this.tracing = tracing;
|
||||||
|
this.message = message;
|
||||||
|
this.autoMessage = autoMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
@ -42,4 +46,12 @@ public enum RecordStatus {
|
|||||||
return tracing;
|
return tracing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAutoMessage() {
|
||||||
|
return autoMessage;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Items sollten sowieso nicht droppen (gamerule)
Auch das hier behoben