From 539275fec738d186f57beaafc97619945763fe33 Mon Sep 17 00:00:00 2001 From: Keuin Date: Fri, 25 Dec 2020 00:26:57 +0800 Subject: merge modifications from another branch (rather not legal) --- src/main/java/com/keuin/blame/EventHandler.java | 2 ++ src/main/java/com/keuin/blame/data/entry/LogEntry.java | 14 ++++++++++++++ 2 files changed, 16 insertions(+) (limited to 'src/main/java/com') 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"); -- cgit v1.2.3