More moves and compilation fixes

This commit is contained in:
Sebastian Hartte
2020-06-29 02:15:31 +02:00
parent 3df93fc66d
commit 0d63f560d3
240 changed files with 2221 additions and 1926 deletions
+9 -8
View File
@@ -23,9 +23,10 @@ import java.util.PriorityQueue;
import com.google.common.base.Preconditions;
import net.minecraft.crash.CrashReport;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.crash.ReportedException;
import net.minecraft.util.crash.CrashException;
import net.minecraft.util.crash.CrashReport;
import net.minecraft.util.crash.CrashReportSection;
import net.minecraft.util.crash.CrashException;
import appeng.api.networking.IGrid;
import appeng.api.networking.IGridHost;
@@ -116,11 +117,11 @@ public class TickManagerCache implements ITickManager {
}
}
} catch (final Throwable t) {
final CrashReport crashreport = CrashReport.makeCrashReport(t, "Ticking GridNode");
final CrashReportCategory crashreportcategory = crashreport
.makeCategory(tt.getGridTickable().getClass().getSimpleName() + " being ticked.");
tt.addEntityCrashInfo(crashreportcategory);
throw new ReportedException(crashreport);
final CrashReport crashreport = CrashReport.create(t, "Ticking GridNode");
final CrashReportSection section = crashreport
.addElement(tt.getGridTickable().getClass().getSimpleName() + " being ticked.");
tt.addEntityCrashInfo(section);
throw new CrashException(crashreport);
}
}
+11 -10
View File
@@ -20,7 +20,7 @@ package appeng.me.cache.helpers;
import javax.annotation.Nonnull;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.util.crash.CrashReportSection;
import appeng.api.networking.IGridNode;
import appeng.api.networking.ticking.IGridTickable;
@@ -28,6 +28,7 @@ import appeng.api.networking.ticking.TickingRequest;
import appeng.api.util.DimensionalCoord;
import appeng.me.cache.TickManagerCache;
import appeng.parts.AEBasePart;
import net.minecraft.util.crash.CrashReportSection;
public class TickTracker implements Comparable<TickTracker> {
@@ -71,22 +72,22 @@ public class TickTracker implements Comparable<TickTracker> {
}
public void addEntityCrashInfo(final CrashReportCategory crashreportcategory) {
public void addEntityCrashInfo(final CrashReportSection section) {
if (this.getGridTickable() instanceof AEBasePart) {
final AEBasePart part = (AEBasePart) this.getGridTickable();
part.addEntityCrashInfo(crashreportcategory);
part.addEntityCrashInfo(section);
}
crashreportcategory.addDetail("CurrentTickRate", this.getCurrentRate());
crashreportcategory.addDetail("MinTickRate", this.getRequest().minTickRate);
crashreportcategory.addDetail("MaxTickRate", this.getRequest().maxTickRate);
crashreportcategory.addDetail("MachineType", this.getGridTickable().getClass().getName());
crashreportcategory.addDetail("GridBlockType", this.getNode().getGridBlock().getClass().getName());
crashreportcategory.addDetail("ConnectedSides", this.getNode().getConnectedSides());
section.add("CurrentTickRate", this.getCurrentRate());
section.add("MinTickRate", this.getRequest().minTickRate);
section.add("MaxTickRate", this.getRequest().maxTickRate);
section.add("MachineType", this.getGridTickable().getClass().getName());
section.add("GridBlockType", this.getNode().getGridBlock().getClass().getName());
section.add("ConnectedSides", this.getNode().getConnectedSides());
final DimensionalCoord dc = this.getNode().getGridBlock().getLocation();
if (dc != null) {
crashreportcategory.addDetail("Location", dc);
section.add("Location", dc);
}
}