mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-12 03:24:14 +00:00
Delete dead util duplicates
- Delete unused board BoardSettings and ScoreDirection wrappers around the VolmLib board types - Delete unused inventorygui UIStaticDecorator, Window and WindowResolution wrappers around the VolmLib inventorygui types - Delete unused VectorMath subclass of the VolmLib VectorMath - Delete unused InterpolationType enum and the IrisInterpolation blerp overload that keyed on it - Delete HunkFace and point Hunk.viewFace and Hunk.cropFace at the VolmLib HunkFace - Drop the iris board and inventorygui excludes from supersededVolmLibPackages and the VectorMath entry from unusedVolmLibClasses - Drop the deleted inventorygui files from the Bukkit purity allowlist
This commit is contained in:
@@ -269,8 +269,6 @@ List<String> supersededVolmLibPackages = [
|
||||
'art/arcane/volmlib/util/reflect/**',
|
||||
'art/arcane/volmlib/util/documentation/**',
|
||||
'art/arcane/iris/core/report/**',
|
||||
'art/arcane/iris/util/common/inventorygui/**',
|
||||
'art/arcane/iris/util/common/board/**',
|
||||
'art/arcane/volmlib/integration/VaultEconomy*.class'
|
||||
]
|
||||
|
||||
@@ -398,7 +396,6 @@ List<String> unusedVolmLibClasses = [
|
||||
'art/arcane/iris/engine/object/IPostBlockAccess',
|
||||
'art/arcane/iris/engine/object/IrisPotionEffect',
|
||||
'art/arcane/iris/engine/platform/DummyChunkGenerator',
|
||||
'art/arcane/iris/util/common/math/VectorMath',
|
||||
'art/arcane/iris/util/common/parallel/GridLock',
|
||||
'art/arcane/iris/util/common/reflect/W',
|
||||
'art/arcane/iris/util/slimjar/BuildConstants',
|
||||
|
||||
@@ -188,9 +188,6 @@ art/arcane/iris/util/common/director/handlers/VectorHandler.java
|
||||
art/arcane/iris/util/common/director/handlers/WorldHandler.java
|
||||
art/arcane/iris/util/common/director/specialhandlers/NullablePlayerHandler.java
|
||||
art/arcane/iris/util/common/format/C.java
|
||||
art/arcane/iris/util/common/inventorygui/UIStaticDecorator.java
|
||||
art/arcane/iris/util/common/inventorygui/Window.java
|
||||
art/arcane/iris/util/common/inventorygui/WindowResolution.java
|
||||
art/arcane/iris/util/common/math/AxisAlignedBB.java
|
||||
art/arcane/iris/util/common/math/Direction.java
|
||||
art/arcane/iris/util/common/math/VectorMath.java
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
package art.arcane.iris.util.common.board;
|
||||
|
||||
import art.arcane.volmlib.util.board.BoardProvider;
|
||||
|
||||
public class BoardSettings {
|
||||
private final BoardProvider boardProvider;
|
||||
private final ScoreDirection scoreDirection;
|
||||
|
||||
private BoardSettings(BoardProvider boardProvider, ScoreDirection scoreDirection) {
|
||||
this.boardProvider = boardProvider;
|
||||
this.scoreDirection = scoreDirection;
|
||||
}
|
||||
|
||||
public BoardProvider getBoardProvider() {
|
||||
return boardProvider;
|
||||
}
|
||||
|
||||
public ScoreDirection getScoreDirection() {
|
||||
return scoreDirection;
|
||||
}
|
||||
|
||||
public art.arcane.volmlib.util.board.BoardSettings toShared() {
|
||||
return art.arcane.volmlib.util.board.BoardSettings.builder()
|
||||
.boardProvider(boardProvider)
|
||||
.scoreDirection(scoreDirection.toShared())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
private BoardProvider boardProvider;
|
||||
private ScoreDirection scoreDirection;
|
||||
|
||||
public Builder boardProvider(BoardProvider boardProvider) {
|
||||
this.boardProvider = boardProvider;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder scoreDirection(ScoreDirection scoreDirection) {
|
||||
this.scoreDirection = scoreDirection;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BoardSettings build() {
|
||||
return new BoardSettings(boardProvider, scoreDirection);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package art.arcane.iris.util.common.board;
|
||||
|
||||
public enum ScoreDirection {
|
||||
UP,
|
||||
DOWN;
|
||||
|
||||
public art.arcane.volmlib.util.board.ScoreDirection toShared() {
|
||||
return this == UP
|
||||
? art.arcane.volmlib.util.board.ScoreDirection.UP
|
||||
: art.arcane.volmlib.util.board.ScoreDirection.DOWN;
|
||||
}
|
||||
|
||||
public static ScoreDirection fromShared(art.arcane.volmlib.util.board.ScoreDirection direction) {
|
||||
return direction == art.arcane.volmlib.util.board.ScoreDirection.UP ? UP : DOWN;
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2022 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.util.common.inventorygui;
|
||||
|
||||
import art.arcane.volmlib.util.inventorygui.WindowDecorator;
|
||||
|
||||
import art.arcane.volmlib.util.inventorygui.Element;
|
||||
|
||||
import art.arcane.volmlib.util.data.MaterialBlock;
|
||||
import org.bukkit.Material;
|
||||
|
||||
@SuppressWarnings("ClassCanBeRecord")
|
||||
public class UIStaticDecorator implements WindowDecorator {
|
||||
private final Element element;
|
||||
|
||||
public UIStaticDecorator(Element element) {
|
||||
this.element = element == null ? new art.arcane.volmlib.util.inventorygui.UIElement("bg").setMaterial(new MaterialBlock(Material.AIR)) : element;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element onDecorateBackground(art.arcane.volmlib.util.inventorygui.Window window, int position, int row) {
|
||||
return element;
|
||||
}
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
package art.arcane.iris.util.common.inventorygui;
|
||||
|
||||
import art.arcane.volmlib.util.inventorygui.WindowDecorator;
|
||||
|
||||
import art.arcane.volmlib.util.inventorygui.Element;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public interface Window {
|
||||
WindowDecorator getDecorator();
|
||||
|
||||
Window setDecorator(WindowDecorator decorator);
|
||||
|
||||
art.arcane.volmlib.util.inventorygui.WindowResolution getResolution();
|
||||
|
||||
Window setResolution(art.arcane.volmlib.util.inventorygui.WindowResolution resolution);
|
||||
|
||||
default Window setResolution(WindowResolution resolution) {
|
||||
return setResolution(resolution.toShared());
|
||||
}
|
||||
|
||||
default WindowResolution getLocalResolution() {
|
||||
return WindowResolution.fromShared(getResolution());
|
||||
}
|
||||
|
||||
Window clearElements();
|
||||
|
||||
Window close();
|
||||
|
||||
Window open();
|
||||
|
||||
Window callClosed();
|
||||
|
||||
Window updateInventory();
|
||||
|
||||
ItemStack computeItemStack(int viewportSlot);
|
||||
|
||||
int getLayoutRow(int viewportSlottedPosition);
|
||||
|
||||
int getLayoutPosition(int viewportSlottedPosition);
|
||||
|
||||
int getRealLayoutPosition(int viewportSlottedPosition);
|
||||
|
||||
int getRealPosition(int position, int row);
|
||||
|
||||
int getRow(int realPosition);
|
||||
|
||||
int getPosition(int realPosition);
|
||||
|
||||
boolean isVisible();
|
||||
|
||||
Window setVisible(boolean visible);
|
||||
|
||||
int getViewportPosition();
|
||||
|
||||
Window setViewportPosition(int position);
|
||||
|
||||
int getViewportSlots();
|
||||
|
||||
int getMaxViewportPosition();
|
||||
|
||||
Window scroll(int direction);
|
||||
|
||||
int getViewportHeight();
|
||||
|
||||
Window setViewportHeight(int height);
|
||||
|
||||
String getTitle();
|
||||
|
||||
Window setTitle(String title);
|
||||
|
||||
boolean hasElement(int position, int row);
|
||||
|
||||
Window setElement(int position, int row, Element e);
|
||||
|
||||
Element getElement(int position, int row);
|
||||
|
||||
Player getViewer();
|
||||
|
||||
Window reopen();
|
||||
|
||||
Window onClosed(art.arcane.volmlib.util.scheduling.Callback<art.arcane.volmlib.util.inventorygui.Window> window);
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package art.arcane.iris.util.common.inventorygui;
|
||||
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
|
||||
public enum WindowResolution {
|
||||
W9_H6(9, 6, InventoryType.CHEST),
|
||||
W5_H1(5, 1, InventoryType.HOPPER),
|
||||
W3_H3(3, 3, InventoryType.DROPPER);
|
||||
|
||||
private final int width;
|
||||
private final int maxHeight;
|
||||
private final InventoryType type;
|
||||
|
||||
WindowResolution(int w, int h, InventoryType type) {
|
||||
this.width = w;
|
||||
this.maxHeight = h;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getMaxWidthOffset() {
|
||||
return (getWidth() - 1) / 2;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public int getMaxHeight() {
|
||||
return maxHeight;
|
||||
}
|
||||
|
||||
public InventoryType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public art.arcane.volmlib.util.inventorygui.WindowResolution toShared() {
|
||||
return art.arcane.volmlib.util.inventorygui.WindowResolution.valueOf(name());
|
||||
}
|
||||
|
||||
public static WindowResolution fromShared(art.arcane.volmlib.util.inventorygui.WindowResolution resolution) {
|
||||
return valueOf(resolution.name());
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package art.arcane.iris.util.common.math;
|
||||
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class VectorMath extends art.arcane.volmlib.util.math.VectorMath {
|
||||
public static Vector rotate(Direction current, Direction to, Vector v) {
|
||||
if (current.equals(to)) {
|
||||
return v;
|
||||
} else if (current.equals(to.reverse())) {
|
||||
if (current.isVertical()) {
|
||||
return new Vector(v.getX(), -v.getY(), v.getZ());
|
||||
} else {
|
||||
return new Vector(-v.getX(), v.getY(), -v.getZ());
|
||||
}
|
||||
} else {
|
||||
Vector c = current.toVector().clone().add(to.toVector());
|
||||
|
||||
if (c.getX() == 0) {
|
||||
if (c.getY() != c.getZ()) {
|
||||
return rotate90CX(v);
|
||||
}
|
||||
|
||||
return rotate90CCX(v);
|
||||
} else if (c.getY() == 0) {
|
||||
if (c.getX() != c.getZ()) {
|
||||
return rotate90CY(v);
|
||||
}
|
||||
|
||||
return rotate90CCY(v);
|
||||
} else if (c.getZ() == 0) {
|
||||
if (c.getX() != c.getY()) {
|
||||
return rotate90CZ(v);
|
||||
}
|
||||
|
||||
return rotate90CCZ(v);
|
||||
}
|
||||
}
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
public static Vector rotate(Direction current, Direction to, Vector v, int w, int h, int d) {
|
||||
if (current.equals(to)) {
|
||||
return v;
|
||||
} else if (current.equals(to.reverse())) {
|
||||
if (current.isVertical()) {
|
||||
return new Vector(v.getX(), -v.getY() + h, v.getZ());
|
||||
} else {
|
||||
return new Vector(-v.getX() + w, v.getY(), -v.getZ() + d);
|
||||
}
|
||||
} else {
|
||||
Vector c = current.toVector().clone().add(to.toVector());
|
||||
|
||||
if (c.getX() == 0) {
|
||||
if (c.getY() != c.getZ()) {
|
||||
return rotate90CX(v, d);
|
||||
}
|
||||
|
||||
return rotate90CCX(v, h);
|
||||
} else if (c.getY() == 0) {
|
||||
if (c.getX() != c.getZ()) {
|
||||
return rotate90CY(v, d);
|
||||
}
|
||||
|
||||
return rotate90CCY(v, w);
|
||||
} else if (c.getZ() == 0) {
|
||||
if (c.getX() != c.getY()) {
|
||||
return rotate90CZ(v, w);
|
||||
}
|
||||
|
||||
return rotate90CCZ(v, h);
|
||||
}
|
||||
}
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -36,6 +36,7 @@ import art.arcane.volmlib.util.hunk.HunkCoreSupport;
|
||||
import art.arcane.volmlib.util.hunk.HunkInterpolationSupport;
|
||||
import art.arcane.volmlib.util.hunk.HunkMutationSupport;
|
||||
import art.arcane.volmlib.util.hunk.HunkSectionSupport;
|
||||
import art.arcane.volmlib.util.hunk.HunkFace;
|
||||
import art.arcane.volmlib.util.hunk.HunkLike;
|
||||
import art.arcane.iris.util.project.hunk.storage.ArrayHunk;
|
||||
import art.arcane.iris.util.project.hunk.storage.AtomicDoubleHunk;
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2022 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.util.project.hunk;
|
||||
|
||||
public enum HunkFace {
|
||||
TOP(art.arcane.volmlib.util.hunk.HunkFace.TOP),
|
||||
BOTTOM(art.arcane.volmlib.util.hunk.HunkFace.BOTTOM),
|
||||
EAST(art.arcane.volmlib.util.hunk.HunkFace.EAST),
|
||||
WEST(art.arcane.volmlib.util.hunk.HunkFace.WEST),
|
||||
NORTH(art.arcane.volmlib.util.hunk.HunkFace.NORTH),
|
||||
SOUTH(art.arcane.volmlib.util.hunk.HunkFace.SOUTH);
|
||||
|
||||
private final art.arcane.volmlib.util.hunk.HunkFace shared;
|
||||
|
||||
HunkFace(art.arcane.volmlib.util.hunk.HunkFace shared) {
|
||||
this.shared = shared;
|
||||
}
|
||||
|
||||
public art.arcane.volmlib.util.hunk.HunkFace shared() {
|
||||
return shared;
|
||||
}
|
||||
|
||||
public static HunkFace fromShared(art.arcane.volmlib.util.hunk.HunkFace shared) {
|
||||
return HunkFace.valueOf(shared.name());
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2022 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.util.project.interpolation;
|
||||
|
||||
public enum InterpolationType {
|
||||
LINEAR,
|
||||
PARAMETRIC_2,
|
||||
PARAMETRIC_4,
|
||||
BEZIER,
|
||||
NONE
|
||||
}
|
||||
@@ -63,26 +63,6 @@ public class IrisInterpolation {
|
||||
return a + (parametric(f, v) * (b - a));
|
||||
}
|
||||
|
||||
public static double blerp(double a, double b, double c, double d, double tx, double ty, InterpolationType type) {
|
||||
if (type.equals(InterpolationType.LINEAR)) {
|
||||
return blerp(a, b, c, d, tx, ty);
|
||||
}
|
||||
|
||||
if (type.equals(InterpolationType.BEZIER)) {
|
||||
return blerpBezier(a, b, c, d, tx, ty);
|
||||
}
|
||||
|
||||
if (type.equals(InterpolationType.PARAMETRIC_2)) {
|
||||
return blerpParametric(a, b, c, d, tx, ty, 2);
|
||||
}
|
||||
|
||||
if (type.equals(InterpolationType.PARAMETRIC_4)) {
|
||||
return blerpParametric(a, b, c, d, tx, ty, 4);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static double blerpBezier(double a, double b, double c, double d, double tx, double ty) {
|
||||
return lerpBezier(lerpBezier(a, b, tx), lerpBezier(c, d, tx), ty);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user