This commit is contained in:
gnembon committed 2019-05-20 23:16:44 -03:00
1 parent 7d9418016a
commit 8b0b5412c4
9 files changed
+161 -13

No files matched your search

@@ -3,19 +3,21 @@ package carpet.logging.logHelpers;
import carpet.logging.LoggerRegistry;
import carpet.utils.Messenger;
import net.minecraft.network.chat.BaseComponent;
import net.minecraft.util.math.Vec3d;
public class TNTLogHelper
{
private double primedX, primedY, primedZ, primedAngle;
private double primedX, primedY, primedZ;
Vec3d primedAngle;
/**
* Runs when the TNT is primed. Expects the position and motion angle of the TNT.
*/
public void onPrimed(double x, double y, double z, float angle)
public void onPrimed(double x, double y, double z, Vec3d motion)
{
primedX = x;
primedY = y;
primedZ = z;
primedAngle = angle;
primedAngle = motion;
}
/**
* Runs when the TNT explodes. Expects the position of the TNT.
@@ -27,15 +29,16 @@ public class TNTLogHelper
{
case "brief":
return new BaseComponent[]{Messenger.c(
"l P ",Messenger.dblt("l",primedX,primedY,primedZ,primedAngle),
"l P ",Messenger.dblt("l",primedX,primedY,primedZ),
"w ",Messenger.dblt("l", primedAngle.x, primedAngle.y, primedAngle.z),
"r E ",Messenger.dblt("r",x, y, z))};
case "full":
return new BaseComponent[]{Messenger.c(
"l P ",Messenger.dblf("l",primedX,primedY,primedZ,primedAngle),
"l P ",Messenger.dblf("l",primedX,primedY,primedZ),
"w ",Messenger.dblf("l", primedAngle.x, primedAngle.y, primedAngle.z),
"r E ",Messenger.dblf("r",x, y, z))};
}
return null;
});
}
}
@@ -28,11 +28,11 @@ public class TrajectoryLogHelper
this.doLog = this.logger.hasOnlineSubscribers();
}
public void onTick(double x, double y, double z, double motionX, double motionY, double motionZ)
public void onTick(double x, double y, double z, Vec3d velocity)
{
if (!doLog) return;
positions.add(new Vec3d(x, y, z));
motions.add(new Vec3d(motionX, motionY, motionZ));
motions.add(velocity);
}
public void onFinish()