summaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/keuin/blame/EventHandler.java2
-rw-r--r--src/main/java/com/keuin/blame/data/entry/LogEntry.java14
2 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/com/keuin/blame/EventHandler.java b/src/main/java/com/keuin/blame/EventHandler.java
index b91ddb2..4a28a84 100644
--- a/src/main/java/com/keuin/blame/EventHandler.java
+++ b/src/main/java/com/keuin/blame/EventHandler.java
@@ -17,6 +17,8 @@ import net.minecraft.util.registry.Registry;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;
+import java.util.Objects;
+
public class EventHandler implements AttackEntityHandler, PlaceBlockHandler, BreakBlockHandler, UseBlockHandler, UseEntityHandler, UseItemHandler {
public static final EventHandler INSTANCE = new EventHandler();
diff --git a/src/main/java/com/keuin/blame/data/entry/LogEntry.java b/src/main/java/com/keuin/blame/data/entry/LogEntry.java
index 586ba91..090d77c 100644
--- a/src/main/java/com/keuin/blame/data/entry/LogEntry.java
+++ b/src/main/java/com/keuin/blame/data/entry/LogEntry.java
@@ -73,6 +73,20 @@ public class LogEntry {
public LogEntry() {
}
+ // 拷贝构造器
+ public LogEntry(LogEntry entry) {
+ this.version = entry.version;
+ this.gameVersion = entry.gameVersion;
+ this.timeMillis = entry.timeMillis;
+ this.subjectId = entry.subjectId;
+ this.subjectUUID = entry.subjectUUID;
+ this.subjectPos = entry.subjectPos;
+ this.actionType = entry.actionType;
+ this.objectType = entry.objectType;
+ this.objectId = entry.objectId;
+ this.objectPos = entry.objectPos;
+ }
+
public LogEntry(long timeMillis, String subjectId, UUID subjectUUID, WorldPos subjectPos, ActionType actionType, ObjectType objectType, String objectId, WorldPos objectPos) {
if (subjectId == null)
throw new IllegalArgumentException("subjectId cannot be null");