screen rewrite what LOL
This commit is contained in:
parent
d78c9a35ca
commit
b6589b3629
@ -7,6 +7,7 @@ import themixray.repeating.mod.events.RecordEvent;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RecordFile {
|
||||
@ -68,37 +69,42 @@ public class RecordFile {
|
||||
|
||||
}
|
||||
|
||||
public void writeToFile(File file) {
|
||||
public static void readFromMod() {
|
||||
|
||||
}
|
||||
|
||||
public static void readFromMod() {
|
||||
public void writeToFile(File file) {
|
||||
|
||||
}
|
||||
|
||||
public static RecordFile readFromFile(File file) throws IOException {
|
||||
String text = Files.readString(file.toPath());
|
||||
|
||||
List<String> lines = List.of(text.split("\n"));
|
||||
String last_line = lines.get(lines.size()-1);
|
||||
lines = lines.subList(0,lines.size()-1);
|
||||
|
||||
List<RecordEvent>
|
||||
List<String> signature = lines.subList(0,4);
|
||||
|
||||
for (String line: lines)
|
||||
RepeatingMod.me.record.add(RecordEvent.deserialize(line));
|
||||
String name = signature.get(0);
|
||||
String data = signature.get(1);
|
||||
String author = signature.get(2);
|
||||
|
||||
String[] lss0 = ls.split("x");
|
||||
String record_pos = signature.get(3);
|
||||
|
||||
String[] lss0 = record_pos.split("x");
|
||||
String[] lss1 = lss0[0].split("n");
|
||||
String[] lss2 = lss0[1].split("n");
|
||||
RepeatingMod.me.start_record_pos = new Vec3d(
|
||||
|
||||
Vec3d start_record_pos = new Vec3d(
|
||||
Float.parseFloat(lss1[0]),
|
||||
Float.parseFloat(lss1[1]),
|
||||
Float.parseFloat(lss1[2]));
|
||||
RepeatingMod.me.finish_record_pos = new Vec3d(
|
||||
Vec3d finish_record_pos = new Vec3d(
|
||||
Float.parseFloat(lss2[0]),
|
||||
Float.parseFloat(lss2[1]),
|
||||
Float.parseFloat(lss2[2]));
|
||||
RepeatingMod.sendMessage(Text.literal(""));
|
||||
|
||||
List<String> event_lines = lines.subList(4,lines.size());
|
||||
List<RecordEvent> events = event_lines.stream().map(RecordEvent::deserialize).toList();
|
||||
|
||||
return new RecordFile(file, )
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
package themixray.repeating.mod.events;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import themixray.repeating.mod.RepeatingMod;
|
||||
import themixray.repeating.mod.Main;
|
||||
|
||||
public class RecordBlockBreakEvent extends RecordEvent {
|
||||
public BlockPos pos;
|
||||
@ -19,7 +19,7 @@ public class RecordBlockBreakEvent extends RecordEvent {
|
||||
}
|
||||
|
||||
public void replay() {
|
||||
RepeatingMod.client.interactionManager.breakBlock(pos);
|
||||
Main.client.interactionManager.breakBlock(pos);
|
||||
}
|
||||
|
||||
public String serialize() {
|
@ -5,7 +5,7 @@ import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import themixray.repeating.mod.RepeatingMod;
|
||||
import themixray.repeating.mod.Main;
|
||||
|
||||
public class RecordBlockInteractEvent extends RecordEvent {
|
||||
public Hand hand;
|
||||
@ -32,7 +32,7 @@ public class RecordBlockInteractEvent extends RecordEvent {
|
||||
}
|
||||
|
||||
public void replay() {
|
||||
RepeatingMod.client.interactionManager.interactBlock(RepeatingMod.client.player, hand, hitResult);
|
||||
Main.client.interactionManager.interactBlock(Main.client.player, hand, hitResult);
|
||||
}
|
||||
|
||||
public String serialize() {
|
@ -1,6 +1,6 @@
|
||||
package themixray.repeating.mod.events;
|
||||
|
||||
import themixray.repeating.mod.RepeatingMod;
|
||||
import themixray.repeating.mod.Main;
|
||||
|
||||
public class RecordInputEvent extends RecordEvent {
|
||||
public Boolean sneaking;
|
||||
@ -92,38 +92,38 @@ public class RecordInputEvent extends RecordEvent {
|
||||
}
|
||||
|
||||
public void replay() {
|
||||
RepeatingMod.input_replay = this;
|
||||
Main.input_replay = this;
|
||||
}
|
||||
|
||||
public void inputCallback() {
|
||||
if (sprinting != null && RepeatingMod.client.player.isSprinting() != sprinting)
|
||||
RepeatingMod.client.player.setSprinting(sprinting);
|
||||
if (RepeatingMod.client.player.getYaw() != yaw)
|
||||
RepeatingMod.client.player.setYaw(yaw);
|
||||
if (RepeatingMod.client.player.getHeadYaw() != head_yaw)
|
||||
RepeatingMod.client.player.setHeadYaw(head_yaw);
|
||||
if (RepeatingMod.client.player.getBodyYaw() != body_yaw)
|
||||
RepeatingMod.client.player.setBodyYaw(body_yaw);
|
||||
if (RepeatingMod.client.player.getPitch() != pitch)
|
||||
RepeatingMod.client.player.setPitch(pitch);
|
||||
if (RepeatingMod.client.player.getMovementSpeed() != speed)
|
||||
RepeatingMod.client.player.setMovementSpeed(speed);
|
||||
if (sneaking != null && RepeatingMod.client.player.input.sneaking != sneaking)
|
||||
RepeatingMod.client.player.input.sneaking = sneaking;
|
||||
if (jumping != null && RepeatingMod.client.player.input.jumping != jumping)
|
||||
RepeatingMod.client.player.input.jumping = jumping;
|
||||
if (movementSideways != null && RepeatingMod.client.player.input.movementSideways != movementSideways)
|
||||
RepeatingMod.client.player.input.movementSideways = movementSideways;
|
||||
if (movementForward != null && RepeatingMod.client.player.input.movementForward != movementForward)
|
||||
RepeatingMod.client.player.input.movementForward = movementForward;
|
||||
if (pressingForward != null && RepeatingMod.client.player.input.pressingForward != pressingForward)
|
||||
RepeatingMod.client.player.input.pressingForward = pressingForward;
|
||||
if (pressingBack != null && RepeatingMod.client.player.input.pressingBack != pressingBack)
|
||||
RepeatingMod.client.player.input.pressingBack = pressingBack;
|
||||
if (pressingLeft != null && RepeatingMod.client.player.input.pressingLeft != pressingLeft)
|
||||
RepeatingMod.client.player.input.pressingLeft = pressingLeft;
|
||||
if (pressingRight != null && RepeatingMod.client.player.input.pressingRight != pressingRight)
|
||||
RepeatingMod.client.player.input.pressingRight = pressingRight;
|
||||
if (sprinting != null && Main.client.player.isSprinting() != sprinting)
|
||||
Main.client.player.setSprinting(sprinting);
|
||||
if (Main.client.player.getYaw() != yaw)
|
||||
Main.client.player.setYaw(yaw);
|
||||
if (Main.client.player.getHeadYaw() != head_yaw)
|
||||
Main.client.player.setHeadYaw(head_yaw);
|
||||
if (Main.client.player.getBodyYaw() != body_yaw)
|
||||
Main.client.player.setBodyYaw(body_yaw);
|
||||
if (Main.client.player.getPitch() != pitch)
|
||||
Main.client.player.setPitch(pitch);
|
||||
if (Main.client.player.getMovementSpeed() != speed)
|
||||
Main.client.player.setMovementSpeed(speed);
|
||||
if (sneaking != null && Main.client.player.input.sneaking != sneaking)
|
||||
Main.client.player.input.sneaking = sneaking;
|
||||
if (jumping != null && Main.client.player.input.jumping != jumping)
|
||||
Main.client.player.input.jumping = jumping;
|
||||
if (movementSideways != null && Main.client.player.input.movementSideways != movementSideways)
|
||||
Main.client.player.input.movementSideways = movementSideways;
|
||||
if (movementForward != null && Main.client.player.input.movementForward != movementForward)
|
||||
Main.client.player.input.movementForward = movementForward;
|
||||
if (pressingForward != null && Main.client.player.input.pressingForward != pressingForward)
|
||||
Main.client.player.input.pressingForward = pressingForward;
|
||||
if (pressingBack != null && Main.client.player.input.pressingBack != pressingBack)
|
||||
Main.client.player.input.pressingBack = pressingBack;
|
||||
if (pressingLeft != null && Main.client.player.input.pressingLeft != pressingLeft)
|
||||
Main.client.player.input.pressingLeft = pressingLeft;
|
||||
if (pressingRight != null && Main.client.player.input.pressingRight != pressingRight)
|
||||
Main.client.player.input.pressingRight = pressingRight;
|
||||
}
|
||||
|
||||
public String serialize() {
|
@ -2,7 +2,7 @@ package themixray.repeating.mod.events;
|
||||
|
||||
import net.minecraft.entity.MovementType;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import themixray.repeating.mod.RepeatingMod;
|
||||
import themixray.repeating.mod.Main;
|
||||
|
||||
public class RecordMoveEvent extends RecordEvent {
|
||||
public Vec3d vec;
|
||||
@ -25,11 +25,11 @@ public class RecordMoveEvent extends RecordEvent {
|
||||
}
|
||||
|
||||
public void replay() {
|
||||
Vec3d p = RepeatingMod.client.player.getPos();
|
||||
Vec3d p = Main.client.player.getPos();
|
||||
Vec3d v = new Vec3d(vec.getX() - p.getX(), vec.getY() - p.getY(), vec.getZ() - p.getZ());
|
||||
RepeatingMod.client.player.move(MovementType.SELF, v);
|
||||
RepeatingMod.client.player.setYaw(yaw);
|
||||
RepeatingMod.client.player.setPitch(pitch);
|
||||
Main.client.player.move(MovementType.SELF, v);
|
||||
Main.client.player.setYaw(yaw);
|
||||
Main.client.player.setPitch(pitch);
|
||||
}
|
||||
|
||||
public String serialize() {
|
Loading…
Reference in New Issue
Block a user