Fix crash with Ars Magica (#304)

* Fix crash with Ars Magica

* Address review
This commit is contained in:
miozune authored and GitHub committed 2023-04-28 17:47:52 +02:00
1 parent f803769490
commit 2a08134ad6
2 files changed
+11 -6

No files matched your search

+1
View File
@@ -1,2 +1,3 @@
# Ignore spotlessApply reformat
a40ee7424f59aafd3f9e187a95bbb5cb91ec5697
385e163974b86edd071cac928bc7671d02d1da57
+10 -6
View File
@@ -11,10 +11,7 @@
package appeng.parts;
import java.io.IOException;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import java.util.Random;
import java.util.*;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.crash.CrashReportCategory;
@@ -420,7 +417,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
x,
y,
z,
this.side.flag,
getSideIndexFromDirection(this.side),
player.getEntityWorld());
if (event.isCanceled()) return false;
@@ -439,7 +436,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
x,
y,
z,
this.side.flag,
getSideIndexFromDirection(this.side),
player.getEntityWorld());
if (event.isCanceled()) return false;
@@ -498,4 +495,11 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
public void setRenderCache(final ISimplifiedBundle renderCache) {
this.renderCache = renderCache;
}
private static int getSideIndexFromDirection(ForgeDirection direction) {
if (direction == ForgeDirection.UNKNOWN || direction == null) {
return -1;
}
return direction.ordinal();
}
}