More infomation in TNT logging #1
This commit is contained in:
1 parent
e1948a2fe0
commit
dd4f2aa12d
1 file changed
+15
-1
@@ -9,6 +9,8 @@ public class TNTLogHelper
|
|||||||
{
|
{
|
||||||
public boolean initialized;
|
public boolean initialized;
|
||||||
private double primedX, primedY, primedZ;
|
private double primedX, primedY, primedZ;
|
||||||
|
private static long lastGametime = 0;
|
||||||
|
private static int tntCount = 0;
|
||||||
private Vec3d primedAngle;
|
private Vec3d primedAngle;
|
||||||
/**
|
/**
|
||||||
* Runs when the TNT is primed. Expects the position and motion angle of the TNT.
|
* Runs when the TNT is primed. Expects the position and motion angle of the TNT.
|
||||||
@@ -24,18 +26,30 @@ public class TNTLogHelper
|
|||||||
/**
|
/**
|
||||||
* Runs when the TNT explodes. Expects the position of the TNT.
|
* Runs when the TNT explodes. Expects the position of the TNT.
|
||||||
*/
|
*/
|
||||||
public void onExploded(double x, double y, double z)
|
public void onExploded(double x, double y, double z, long gametime)
|
||||||
{
|
{
|
||||||
|
if (!(lastGametime == gametime)){
|
||||||
|
tntCount = 0;
|
||||||
|
lastGametime = gametime;
|
||||||
|
}
|
||||||
|
tntCount++;
|
||||||
LoggerRegistry.getLogger("tnt").log( (option) -> {
|
LoggerRegistry.getLogger("tnt").log( (option) -> {
|
||||||
switch (option)
|
switch (option)
|
||||||
{
|
{
|
||||||
case "brief":
|
case "brief":
|
||||||
return new BaseText[]{Messenger.c(
|
return new BaseText[]{Messenger.c(
|
||||||
|
"g #" + String.valueOf(tntCount),
|
||||||
|
"m @" + String.valueOf(gametime),
|
||||||
|
"g : ",
|
||||||
"l P ",Messenger.dblt("l",primedX,primedY,primedZ),
|
"l P ",Messenger.dblt("l",primedX,primedY,primedZ),
|
||||||
"w ",Messenger.dblt("l", primedAngle.x, primedAngle.y, primedAngle.z),
|
"w ",Messenger.dblt("l", primedAngle.x, primedAngle.y, primedAngle.z),
|
||||||
"r E ",Messenger.dblt("r",x, y, z))};
|
"r E ",Messenger.dblt("r",x, y, z))};
|
||||||
case "full":
|
case "full":
|
||||||
return new BaseText[]{Messenger.c(
|
return new BaseText[]{Messenger.c(
|
||||||
|
"g #" + String.valueOf(tntCount),
|
||||||
|
"m @" + String.valueOf(gametime),
|
||||||
|
"g : ",
|
||||||
|
"g #" + String.valueOf(tntCount) + ": ",
|
||||||
"l P ",Messenger.dblf("l",primedX,primedY,primedZ),
|
"l P ",Messenger.dblf("l",primedX,primedY,primedZ),
|
||||||
"w ",Messenger.dblf("l", primedAngle.x, primedAngle.y, primedAngle.z),
|
"w ",Messenger.dblf("l", primedAngle.x, primedAngle.y, primedAngle.z),
|
||||||
"r E ",Messenger.dblf("r",x, y, z))};
|
"r E ",Messenger.dblf("r",x, y, z))};
|
||||||
|
|||||||
Reference in new issue
Block a user