Selaa lähdekoodia

WorldEdit selection highlighting is ready for Cuboid shape selection region.

ZRY 10 kuukautta sitten
vanhempi
säilyke
e5d3ff27d0

+ 4 - 4
build.gradle

@@ -148,12 +148,12 @@ dependencies {
 jar {
     manifest {
         attributes([
-                "Specification-Title"     : "examplemod",
-                "Specification-Vendor"    : "examplemodsareus",
-                "Specification-Version"   : "1", // We are version 1 of ourselves
+                "Specification-Title"     : "zry_client_utils_mod",
+                "Specification-Vendor"    : "ZRY",
+                "Specification-Version"   : "0.1.0", // We are version 1 of ourselves
                 "Implementation-Title"    : project.name,
                 "Implementation-Version"  : project.jar.archiveVersion,
-                "Implementation-Vendor"   : "examplemodsareus",
+                "Implementation-Vendor"   : "ZRY",
                 "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
         ])
     }

+ 15 - 0
src/main/java/com/zjinja/mcmod/zry_client_utils_mod/cui/CUIRegionManager.java

@@ -2,6 +2,7 @@ package com.zjinja.mcmod.zry_client_utils_mod.cui;
 
 import com.mojang.brigadier.Command;
 import com.mojang.logging.LogUtils;
+import com.zjinja.mcmod.zry_client_utils_mod.renderer.RenderContext;
 import com.zjinja.mcmod.zry_client_utils_mod.utils.ZLogUtil;
 import net.minecraft.client.Minecraft;
 import net.minecraft.network.chat.Component;
@@ -345,4 +346,18 @@ public class CUIRegionManager {
             return true;
         }
     }
+
+    public static void render(RenderContext rctx) {
+        var inst = getInstance();
+        if (inst != null) {
+            if(inst.selRegion != null) {
+                inst.selRegion.render(rctx, true);
+            }
+            if (inst.regions != null) {
+                for (IRegion ir : inst.regions.values()) {
+                    ir.render(rctx, false);
+                }
+            }
+        }
+    }
 }

+ 25 - 0
src/main/java/com/zjinja/mcmod/zry_client_utils_mod/cui/CuboidRegion.java

@@ -1,7 +1,11 @@
 package com.zjinja.mcmod.zry_client_utils_mod.cui;
 
 import com.mojang.logging.LogUtils;
+import com.zjinja.mcmod.zry_client_utils_mod.renderer.RGBA;
+import com.zjinja.mcmod.zry_client_utils_mod.renderer.RenderContext;
+import com.zjinja.mcmod.zry_client_utils_mod.renderer.RenderUtils;
 import com.zjinja.mcmod.zry_client_utils_mod.utils.ZLogUtil;
+import net.minecraft.world.phys.AABB;
 import net.minecraft.world.phys.Vec3;
 
 import java.util.Optional;
@@ -45,4 +49,25 @@ public class CuboidRegion extends EmptyRegion {
             }
         }
     }
+
+    @Override
+    public void render(RenderContext rctx, boolean mainSelection) {
+        if(this.point1.isEmpty() || this.point2.isEmpty()) {
+            return;
+        }
+        Vec3 p1 = this.point1.get();
+        Vec3 p2 = this.point2.get();
+        double aX = Math.min(p1.x, p2.x);
+        double bX = Math.max(p1.x, p2.x) + 1;
+        double aY = Math.min(p1.y, p2.y);
+        double bY = Math.max(p1.y, p2.y) + 1;
+        double aZ = Math.min(p1.z, p2.z);
+        double bZ = Math.max(p1.z, p2.z) + 1;
+        AABB aabbMain = new AABB(aX, aY, aZ, bX, bY, bZ);
+        AABB aabbFP = new AABB(p1.x, p1.y, p1.z, p1.x + 1, p1.y + 1, p1.z + 1);
+        AABB aabbSP = new AABB(p2.x, p2.y, p2.z, p2.x + 1, p2.y + 1, p2.z + 1);
+        RenderUtils.drawOutlineBox(rctx, aabbMain, new RGBA(0.0F, 0.0F, 1.0F, 1.0F));
+        RenderUtils.drawOutlineBox(rctx, aabbFP, new RGBA(1.0F, 0.0F, 0.0F, 1.0F));
+        RenderUtils.drawOutlineBox(rctx, aabbSP, new RGBA(0.0F, 1.0F, 0.0F, 1.0F));
+    }
 }

+ 5 - 0
src/main/java/com/zjinja/mcmod/zry_client_utils_mod/cui/EmptyRegion.java

@@ -1,6 +1,7 @@
 package com.zjinja.mcmod.zry_client_utils_mod.cui;
 
 import com.mojang.logging.LogUtils;
+import com.zjinja.mcmod.zry_client_utils_mod.renderer.RenderContext;
 import com.zjinja.mcmod.zry_client_utils_mod.utils.ZLogUtil;
 
 public class EmptyRegion implements IRegion {
@@ -69,4 +70,8 @@ public class EmptyRegion implements IRegion {
                 "wecui/update", "updatePolygon not supported for '{}'", this.describe()
         );
     }
+
+    @Override
+    public void render(RenderContext rctx, boolean mainSelection) {
+    }
 }

+ 3 - 0
src/main/java/com/zjinja/mcmod/zry_client_utils_mod/cui/IRegion.java

@@ -1,5 +1,7 @@
 package com.zjinja.mcmod.zry_client_utils_mod.cui;
 
+import com.zjinja.mcmod.zry_client_utils_mod.renderer.RenderContext;
+
 public interface IRegion {
     public String describe();
     public CUIRegionManager.RegionType getType();
@@ -10,4 +12,5 @@ public interface IRegion {
     public void updateCylinder(int x, int y, int z, double rx, double rz);
     public void updateMinMax(int min, int max);
     public void updatePolygon(int[] vid);
+    public void render(RenderContext rctx, boolean mainSelection);
 }

+ 17 - 10
src/main/java/com/zjinja/mcmod/zry_client_utils_mod/events/ClientEvents.java

@@ -1,18 +1,23 @@
 package com.zjinja.mcmod.zry_client_utils_mod.events;
 
+import com.mojang.blaze3d.vertex.PoseStack;
+import com.mojang.blaze3d.vertex.VertexConsumer;
 import com.mojang.logging.LogUtils;
 import com.zjinja.mcmod.zry_client_utils_mod.ZRYClientUtilsMod;
 import com.zjinja.mcmod.zry_client_utils_mod.commands.CommandGetWESelPos;
+import com.zjinja.mcmod.zry_client_utils_mod.cui.CUIRegionManager;
 import com.zjinja.mcmod.zry_client_utils_mod.gui.GuiWEHelpPanel;
 import com.zjinja.mcmod.zry_client_utils_mod.keybinds.KeyBindings;
 import com.zjinja.mcmod.zry_client_utils_mod.networking.NetworkHandlerWECUI;
+import com.zjinja.mcmod.zry_client_utils_mod.renderer.RenderContext;
 import com.zjinja.mcmod.zry_client_utils_mod.utils.ZLogUtil;
 import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.GameRenderer;
+import net.minecraft.client.renderer.LevelRenderer;
+import net.minecraft.client.renderer.MultiBufferSource;
+import net.minecraft.client.renderer.RenderType;
 import net.minecraftforge.api.distmarker.Dist;
-import net.minecraftforge.client.event.ClientPlayerNetworkEvent;
-import net.minecraftforge.client.event.InputEvent;
-import net.minecraftforge.client.event.RegisterClientCommandsEvent;
-import net.minecraftforge.client.event.RegisterKeyMappingsEvent;
+import net.minecraftforge.client.event.*;
 import net.minecraftforge.eventbus.api.SubscribeEvent;
 import net.minecraftforge.fml.common.Mod;
 import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
@@ -64,12 +69,14 @@ public class ClientEvents {
         }
 
         @SubscribeEvent
-        public static void onGameJoin(GameJ event) {
-            ZLogUtil.log(
-                    LogUtils.getLogger(), ZLogUtil.Level.INFO,
-                    "client-logged-out", "Logged out of server."
-            );
-            NetworkHandlerWECUI.onQuitServer();
+        public static void onRenderLevel(RenderLevelStageEvent event) {
+            //if(event.getStage().equals(RenderLevelStageEvent.Stage.AFTER_CUTOUT_MIPPED_BLOCKS_BLOCKS)) {
+            if(true) {
+                LevelRenderer lr = event.getLevelRenderer();
+                PoseStack ps = event.getPoseStack();
+                RenderContext rctx = new RenderContext(ps);
+                CUIRegionManager.render(rctx);
+            }
         }
 
 

+ 0 - 188
src/main/java/com/zjinja/mcmod/zry_client_utils_mod/renderer/AbstractRenderer.java

@@ -1,188 +0,0 @@
-// Copy and Modified From https://github.com/irtimaled/BoundingBoxOutlineReloaded
-// The origin file is licenced under MIT license.
-
-package com.zjinja.mcmod.zry_client_utils_mod.renderer;
-
-import com.irtimaled.bbor.client.config.ConfigManager;
-import com.irtimaled.bbor.client.models.Point;
-import com.irtimaled.bbor.common.MathHelper;
-import com.irtimaled.bbor.common.models.AbstractBoundingBox;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.FontRenderer;
-
-import java.awt.*;
-import java.util.function.Supplier;
-
-public abstract class AbstractRenderer<T extends AbstractBoundingBox> {
-    private static final double TAU = 6.283185307179586D;
-    public static final double PHI_SEGMENT = TAU / 90D;
-    private static final double PI = TAU / 2D;
-    public static final double THETA_SEGMENT = PHI_SEGMENT / 2D;
-
-    public abstract void render(T boundingBox);
-
-    void renderCuboid(OffsetBox bb, Color color) {
-        OffsetBox nudge = bb.nudge();
-        renderOutlinedCuboid(nudge, color);
-        renderFilledFaces(nudge.getMin(), nudge.getMax(), color);
-    }
-
-    void renderOutlinedCuboid(OffsetBox bb, Color color) {
-        RenderHelper.polygonModeLine();
-        OffsetPoint min = bb.getMin();
-        OffsetPoint max = bb.getMax();
-        renderFaces(min, max, color, 255, min.getY() == max.getY() ? Renderer::startLineLoop : Renderer::startLines);
-    }
-
-    private void renderFaces(OffsetPoint min, OffsetPoint max, Color color, int alpha, Supplier<Renderer> rendererSupplier) {
-        double minX = min.getX();
-        double minY = min.getY();
-        double minZ = min.getZ();
-
-        double maxX = max.getX();
-        double maxY = max.getY();
-        double maxZ = max.getZ();
-
-        if (ConfigManager.invertBoxColorPlayerInside.get() &&
-                playerInsideBoundingBox(minX, minY, minZ, maxX, maxY, maxZ)) {
-            color = new Color(255 - color.getRed(), 255 - color.getGreen(), 255 - color.getBlue());
-        }
-
-        Renderer renderer = rendererSupplier.get()
-                .setColor(color)
-                .setAlpha(alpha);
-
-        if (minX != maxX && minZ != maxZ) {
-            renderer.addPoint(minX, minY, minZ)
-                    .addPoint(maxX, minY, minZ)
-                    .addPoint(maxX, minY, maxZ)
-                    .addPoint(minX, minY, maxZ);
-
-            if (minY != maxY) {
-                renderer.addPoint(minX, maxY, minZ)
-                        .addPoint(maxX, maxY, minZ)
-                        .addPoint(maxX, maxY, maxZ)
-                        .addPoint(minX, maxY, maxZ);
-            }
-        }
-
-        if (minX != maxX && minY != maxY) {
-            renderer.addPoint(minX, minY, maxZ)
-                    .addPoint(minX, maxY, maxZ)
-                    .addPoint(maxX, maxY, maxZ)
-                    .addPoint(maxX, minY, maxZ);
-
-            if (minZ != maxZ) {
-                renderer.addPoint(minX, minY, minZ)
-                        .addPoint(minX, maxY, minZ)
-                        .addPoint(maxX, maxY, minZ)
-                        .addPoint(maxX, minY, minZ);
-            }
-        }
-        if (minY != maxY && minZ != maxZ) {
-            renderer.addPoint(minX, minY, minZ)
-                    .addPoint(minX, minY, maxZ)
-                    .addPoint(minX, maxY, maxZ)
-                    .addPoint(minX, maxY, minZ);
-
-            if (minX != maxX) {
-                renderer.addPoint(maxX, minY, minZ)
-                        .addPoint(maxX, minY, maxZ)
-                        .addPoint(maxX, maxY, maxZ)
-                        .addPoint(maxX, maxY, minZ);
-            }
-        }
-        renderer.render();
-    }
-
-    private boolean playerInsideBoundingBox(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) {
-        return minX < 0 && maxX > 0 && minY < 0 && maxY > 0 && minZ < 0 && maxZ > 0;
-    }
-
-    void renderLine(OffsetPoint startPoint, OffsetPoint endPoint, Color color) {
-        RenderHelper.polygonModeLine();
-        Renderer.startLines()
-                .setColor(color)
-                .addPoint(startPoint)
-                .addPoint(endPoint)
-                .render();
-    }
-
-    void renderFilledFaces(OffsetPoint min, OffsetPoint max, Color color) {
-        renderFilledFaces(min, max, color, 30);
-    }
-
-    void renderFilledFaces(OffsetPoint min, OffsetPoint max, Color color, int alpha) {
-        if (!ConfigManager.fill.get()) return;
-
-        RenderHelper.polygonModeFill();
-        RenderHelper.enableBlend();
-        renderFaces(min, max, color, alpha, Renderer::startQuads);
-        RenderHelper.disableBlend();
-        RenderHelper.enablePolygonOffsetLine();
-        RenderHelper.polygonOffsetMinusOne();
-    }
-
-    void renderText(OffsetPoint offsetPoint, String... texts) {
-        FontRenderer fontRenderer = Minecraft.getInstance().fontRenderer;
-
-        RenderHelper.beforeRenderFont(offsetPoint);
-        float top = -(fontRenderer.FONT_HEIGHT * texts.length) / 2f;
-        for (String text : texts) {
-            float left = fontRenderer.getStringWidth(text) / 2f;
-            fontRenderer.drawString(text, -left, top, -1);
-            top += fontRenderer.FONT_HEIGHT;
-        }
-        RenderHelper.afterRenderFont();
-    }
-
-    void renderSphere(Point center, double radius, Color color) {
-        if (ConfigManager.renderSphereAsDots.get()) {
-            renderDotSphere(center, radius, color);
-        } else {
-            renderLineSphere(center, radius, color);
-        }
-    }
-
-    private void renderLineSphere(Point center, double radius, Color color) {
-        RenderHelper.lineWidth2();
-
-        double offset = ((radius - (int) radius) == 0) ? center.getY() - (int) center.getY() : 0;
-        int dyStep = radius < 64 ? 1 : MathHelper.floor(radius / 32);
-        for (double dy = offset - radius; dy <= radius + 1; dy += dyStep) {
-            double circleRadius = Math.sqrt((radius * radius) - (dy * dy));
-            if (circleRadius == 0) circleRadius = Math.sqrt(2) / 2;
-            renderCircle(center, circleRadius, color, dy + 0.001F);
-        }
-    }
-
-    private void renderCircle(Point center, double radius, Color color, double dy) {
-        Renderer renderer = Renderer.startLineLoop()
-                .setColor(color);
-
-        for (double phi = 0.0D; phi < TAU; phi += PHI_SEGMENT) {
-            renderer.addPoint(new OffsetPoint(center.offset(Math.cos(phi) * radius, dy, Math.sin(phi) * radius)));
-        }
-
-        renderer.render();
-    }
-
-    private void renderDotSphere(Point center, double radius, Color color) {
-        RenderHelper.enablePointSmooth();
-        RenderHelper.pointSize5();
-        Renderer renderer = Renderer.startPoints()
-                .setColor(color);
-
-        for (double phi = 0.0D; phi < TAU; phi += PHI_SEGMENT) {
-            double dy = radius * Math.cos(phi);
-            double radiusBySinPhi = radius * Math.sin(phi);
-            for (double theta = 0.0D; theta < PI; theta += THETA_SEGMENT) {
-                double dx = radiusBySinPhi * Math.cos(theta);
-                double dz = radiusBySinPhi * Math.sin(theta);
-
-                renderer.addPoint(new OffsetPoint(center.offset(dx, dy, dz)));
-            }
-        }
-        renderer.render();
-    }
-}

+ 14 - 0
src/main/java/com/zjinja/mcmod/zry_client_utils_mod/renderer/RGBA.java

@@ -0,0 +1,14 @@
+package com.zjinja.mcmod.zry_client_utils_mod.renderer;
+
+public class RGBA {
+    public final float R;
+    public final float G;
+    public final float B;
+    public final float A;
+    public RGBA(float r, float g, float b, float a) {
+        this.R = r;
+        this.G = g;
+        this.B = b;
+        this.A = a;
+    }
+}

+ 31 - 0
src/main/java/com/zjinja/mcmod/zry_client_utils_mod/renderer/RenderContext.java

@@ -0,0 +1,31 @@
+package com.zjinja.mcmod.zry_client_utils_mod.renderer;
+
+import com.mojang.blaze3d.vertex.PoseStack;
+import net.minecraft.client.Minecraft;
+import net.minecraft.world.phys.Vec3;
+
+public class RenderContext {
+    private final PoseStack poseStack;
+    private final Vec3 camPos;
+
+    public RenderContext(PoseStack ps) {
+        this.poseStack = ps;
+        this.camPos = Minecraft.getInstance().gameRenderer.getMainCamera().getPosition();
+    }
+
+    public void pushPose() {
+        poseStack.pushPose();
+    }
+
+    public void popPose() {
+        poseStack.popPose();
+    }
+
+    public Vec3 getCameraPos() {
+        return camPos;
+    }
+
+    public PoseStack getPoseStack() {
+        return poseStack;
+    }
+}

+ 56 - 0
src/main/java/com/zjinja/mcmod/zry_client_utils_mod/renderer/RenderUtils.java

@@ -0,0 +1,56 @@
+package com.zjinja.mcmod.zry_client_utils_mod.renderer;
+
+import com.mojang.blaze3d.vertex.PoseStack;
+import com.mojang.blaze3d.vertex.VertexConsumer;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.MultiBufferSource;
+import net.minecraft.client.renderer.RenderType;
+import net.minecraft.util.Mth;
+import net.minecraft.world.phys.AABB;
+import net.minecraft.world.phys.Vec3;
+import net.minecraft.world.phys.shapes.Shapes;
+import net.minecraft.world.phys.shapes.VoxelShape;
+import org.lwjgl.opengl.GL11;
+
+public class RenderUtils {
+    public static void renderVoxelShape(PoseStack ps, VertexConsumer vc, VoxelShape vox,
+                                         double refX, double refY, double refZ, float cR, float cG, float cB, float cA) {
+        PoseStack.Pose last = ps.last();
+        vox.forAllEdges((e1, e2, e3, e4, e5, e6) -> {
+            float f = (float)(e4 - e1);
+            float f1 = (float)(e5 - e2);
+            float f2 = (float)(e6 - e3);
+            float f3 = Mth.sqrt(f * f + f1 * f1 + f2 * f2);
+            f = f / f3;
+            f1 = f1 / f3;
+            f2 = f2 / f3;
+            vc.vertex(
+                    last.pose(), (float)(e1 + refX), (float)(e2 + refY),
+                    (float)(e3 + refZ)).color(cR, cG, cB, cA).normal(last.normal(),
+                    f, f1, f2
+            ).endVertex();
+            vc.vertex(
+                    last.pose(), (float)(e4 + refX), (float)(e5 + refY),
+                    (float)(e6 + refZ)).color(cR, cG, cB, cA).normal(last.normal(),
+                    f, f1, f2
+            ).endVertex();
+        });
+    }
+
+    public static void drawOutlineBox(RenderContext rctx, AABB aabb, RGBA color) {
+        MultiBufferSource.BufferSource buffer = Minecraft.getInstance().renderBuffers().bufferSource();
+        VertexConsumer builder = buffer.getBuffer(RenderType.lines());
+        VoxelShape vsp = Shapes.create(aabb);
+        Vec3 cam = rctx.getCameraPos();
+        double camX = cam.x, camY = cam.y, camZ = cam.z;
+        rctx.pushPose();
+        GL11.glDisable(GL11.GL_DEPTH_TEST);
+        renderVoxelShape(
+                rctx.getPoseStack(), builder, vsp,
+                -camX, -camY, -camZ,
+                color.R, color.G, color.B, color.A
+        );
+        GL11.glEnable(GL11.GL_DEPTH_TEST);
+        rctx.popPose();
+    }
+}

+ 0 - 33
src/main/java/com/zjinja/mcmod/zry_client_utils_mod/utils/AbstractBoundingBox.java

@@ -1,33 +0,0 @@
-// Copy and Modified From https://github.com/irtimaled/BoundingBoxOutlineReloaded
-// The origin file is licenced under MIT license.
-
-package com.zjinja.mcmod.zry_client_utils_mod.utils;
-
-import com.irtimaled.bbor.common.BoundingBoxType;
-
-public abstract class AbstractBoundingBox {
-    private final BoundingBoxType type;
-
-    protected AbstractBoundingBox(BoundingBoxType type) {
-        this.type = type;
-    }
-
-    public abstract Boolean intersectsBounds(int minX, int minZ, int maxX, int maxZ);
-
-    public BoundingBoxType getType() {
-        return type;
-    }
-
-    public double getDistance(double x, double y, double z) {
-        double dX = getDistanceX(x);
-        double dY = getDistanceY(y);
-        double dZ = getDistanceZ(z);
-        return Math.cbrt(dX * dX + dY * dY + dZ * dZ);
-    }
-
-    protected abstract double getDistanceX(double x);
-
-    protected abstract double getDistanceY(double y);
-
-    protected abstract double getDistanceZ(double z);
-}

+ 0 - 27
src/main/java/com/zjinja/mcmod/zry_client_utils_mod/utils/BBORMathHelper.java

@@ -1,27 +0,0 @@
-package com.zjinja.mcmod.zry_client_utils_mod.utils;
-
-public class BBORMathHelper {
-    public static int floor(double value) {
-        int intValue = (int) value;
-        return value >= intValue ? intValue : intValue - 1;
-    }
-
-    public static double snapToNearest(double value, double nearest) {
-        double multiplier = 2.0 / nearest;
-        int floor = floor(value);
-        int fraction = floor((value - floor) * multiplier);
-        int midpoint = (int) (multiplier / 2);
-        if (fraction % midpoint == 1) fraction++;
-        return floor + (fraction / multiplier);
-    }
-
-    public static int clamp(int value, int min, int max) {
-        if (value < min) return min;
-        return Math.min(value, max);
-    }
-
-    public static double clamp(double value, double min, double max) {
-        if (value < min) return min;
-        return Math.min(value, max);
-    }
-}

+ 0 - 76
src/main/java/com/zjinja/mcmod/zry_client_utils_mod/utils/BoundingBoxCuboid.java

@@ -1,76 +0,0 @@
-// Copy and Modified From https://github.com/irtimaled/BoundingBoxOutlineReloaded
-// The origin file is licenced under MIT license.
-
-package com.zjinja.mcmod.zry_client_utils_mod.utils;
-
-import com.irtimaled.bbor.common.BoundingBoxType;
-import com.irtimaled.bbor.common.MathHelper;
-import com.irtimaled.bbor.common.TypeHelper;
-
-public class BoundingBoxCuboid extends AbstractBoundingBox {
-    private final Coords minCoords;
-    private final Coords maxCoords;
-
-    protected BoundingBoxCuboid(Coords minCoords, Coords maxCoords, BoundingBoxType type) {
-        super(type);
-        this.minCoords = minCoords;
-        this.maxCoords = maxCoords;
-    }
-
-    public static BoundingBoxCuboid from(Coords minCoords, Coords maxCoords, BoundingBoxType type) {
-        return new BoundingBoxCuboid(minCoords, maxCoords, type);
-    }
-
-    @Override
-    public int hashCode() {
-        return TypeHelper.combineHashCodes(minCoords.hashCode(), maxCoords.hashCode());
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) return true;
-        if (obj == null || getClass() != obj.getClass()) return false;
-        BoundingBoxCuboid other = (BoundingBoxCuboid) obj;
-        return minCoords.equals(other.minCoords) && maxCoords.equals(other.maxCoords);
-    }
-
-    public Coords getMinCoords() {
-        return minCoords;
-    }
-
-    public Coords getMaxCoords() {
-        return maxCoords;
-    }
-
-    @Override
-    public Boolean intersectsBounds(int minX, int minZ, int maxX, int maxZ) {
-        boolean minXWithinBounds = isBetween(minCoords.getX(), minX, maxX);
-        boolean maxXWithinBounds = isBetween(maxCoords.getX(), minX, maxX);
-        boolean minZWithinBounds = isBetween(minCoords.getZ(), minZ, maxZ);
-        boolean maxZWithinBounds = isBetween(maxCoords.getZ(), minZ, maxZ);
-
-        return (minXWithinBounds && minZWithinBounds) ||
-                (maxXWithinBounds && maxZWithinBounds) ||
-                (minXWithinBounds && maxZWithinBounds) ||
-                (maxXWithinBounds && minZWithinBounds);
-    }
-
-    private boolean isBetween(int val, int min, int max) {
-        return val >= min && val <= max;
-    }
-
-    @Override
-    public double getDistanceX(double x) {
-        return x - MathHelper.clamp(x, minCoords.getX(), maxCoords.getX());
-    }
-
-    @Override
-    public double getDistanceY(double y) {
-        return y - MathHelper.clamp(y, minCoords.getY(), maxCoords.getY());
-    }
-
-    @Override
-    public double getDistanceZ(double z) {
-        return z - MathHelper.clamp(z, minCoords.getZ(), maxCoords.getZ());
-    }
-}

+ 0 - 64
src/main/java/com/zjinja/mcmod/zry_client_utils_mod/utils/Coords.java

@@ -1,64 +0,0 @@
-// Copy and Modified From https://github.com/irtimaled/BoundingBoxOutlineReloaded
-// The origin file is licenced under MIT license.
-
-package com.zjinja.mcmod.zry_client_utils_mod.utils;
-
-import com.irtimaled.bbor.common.MathHelper;
-import com.irtimaled.bbor.common.TypeHelper;
-import net.minecraft.util.math.Vec3d;
-import net.minecraft.util.math.Vec3i;
-
-public class Coords {
-    private final int x;
-    private final int y;
-    private final int z;
-
-    public Coords(int x, int y, int z) {
-        this.x = x;
-        this.y = y;
-        this.z = z;
-    }
-
-    public Coords(double x, double y, double z) {
-        this.x = BBORMathHelper.floor(x);
-        this.y = BBORMathHelper.floor(y);
-        this.z = BBORMathHelper.floor(z);
-    }
-
-    public Coords(Vec3i pos) {
-        this(pos.getX(), pos.getY(), pos.getZ());
-    }
-
-    public Coords(Vec3d pos) {
-        this(pos.x, pos.y, pos.z);
-    }
-
-    public int getX() {
-        return x;
-    }
-
-    public int getY() {
-        return y;
-    }
-
-    public int getZ() {
-        return z;
-    }
-
-    @Override
-    public int hashCode() {
-        return TypeHelper.combineHashCodes(z, y, x);
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) return true;
-        if (obj == null || getClass() != obj.getClass()) return false;
-        Coords other = (Coords) obj;
-        return getX() == other.getX() &&
-                getY() == other.getY() &&
-                getZ() == other.getZ();
-
-    }
-}
-

+ 0 - 44
src/main/java/com/zjinja/mcmod/zry_client_utils_mod/utils/OffsetBox.java

@@ -1,44 +0,0 @@
-// Copy and Modified From https://github.com/irtimaled/BoundingBoxOutlineReloaded
-// The origin file is licenced under MIT license.
-
-package com.zjinja.mcmod.zry_client_utils_mod.utils;
-
-class OffsetBox {
-    private final OffsetPoint min;
-    private final OffsetPoint max;
-
-    OffsetBox(Coords minCoords, Coords maxCoords) {
-        this.min = new OffsetPoint(minCoords);
-        this.max = new OffsetPoint(maxCoords).offset(1, 1, 1);
-    }
-
-    OffsetBox(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) {
-        this.min = new OffsetPoint(minX, minY, minZ);
-        this.max = new OffsetPoint(maxX, maxY, maxZ);
-    }
-
-    OffsetBox(OffsetPoint min, OffsetPoint max) {
-        this.min = min;
-        this.max = max;
-    }
-
-    OffsetBox grow(double x, double y, double z) {
-        return new OffsetBox(min.offset(-x, -y, -z), max.offset(x, y, z));
-    }
-
-    OffsetBox nudge() {
-        double growXZ = 0.001F;
-        if (min.getY() == max.getY()) {
-            return new OffsetBox(min.offset(-growXZ, growXZ, -growXZ), max.offset(growXZ, growXZ, growXZ));
-        }
-        return grow(growXZ, growXZ, growXZ);
-    }
-
-    OffsetPoint getMin() {
-        return min;
-    }
-
-    OffsetPoint getMax() {
-        return max;
-    }
-}

+ 0 - 1
src/main/resources/META-INF/mods.toml

@@ -30,7 +30,6 @@ displayName="ZRY Client Utils Mod" #mandatory
 logoFile="zry_client_utils_mod.png" #optional
 # A text field displayed in the mod UI
 credits='''
-Some of code copied from https://github.com/irtimaled/BoundingBoxOutlineReloaded
 Some of code inspired by https://github.com/EngineHub/WorldEditCUI
 Thanks to https://github.com/EngineHub/WorldEdit providing such good mod
 '''