Initial Setup and Classes
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
package me.hypherionmc.craterlib.util;public class BlockStateUtils {
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
package me.hypherionmc.hyperlighting.utils;
|
||||
|
||||
import net.minecraft.text.BaseText;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Formatting;
|
||||
|
||||
public class LangUtils {
|
||||
|
||||
public static BaseText getTooltipTitle(String key) {
|
||||
return new LiteralText(Formatting.YELLOW + new TranslatableText(key).getString());
|
||||
}
|
||||
|
||||
public static String resolveTranslation(String key) {
|
||||
return new TranslatableText(key).getString();
|
||||
}
|
||||
|
||||
public static BaseText getTranslation(String key) {
|
||||
return new TranslatableText(key);
|
||||
}
|
||||
|
||||
public static BaseText makeComponent(String text) {
|
||||
return new LiteralText(text);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
package me.hypherionmc.hyperlighting.utils;
|
||||
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
|
||||
public class MathUtils {
|
||||
|
||||
public static VoxelShape rotateShape(Direction from, Direction to, VoxelShape shape) {
|
||||
VoxelShape[] buffer = new VoxelShape[]{ shape, VoxelShapes.empty() };
|
||||
|
||||
int times = (to.ordinal() - from.ordinal() + 4) % 4;
|
||||
for (int i = 0; i < times; i++) {
|
||||
buffer[0].forEachBox((minX, minY, minZ, maxX, maxY, maxZ) -> buffer[1] = VoxelShapes.union(buffer[1], VoxelShapes.cuboid(1-maxZ, minY, minX, 1-minZ, maxY, maxX)));
|
||||
buffer[0] = buffer[1];
|
||||
buffer[1] = VoxelShapes.empty();
|
||||
}
|
||||
return buffer[0];
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,2 @@
|
||||
package me.hypherionmc.craterlib.util;public class OptifineUtils {
|
||||
}
|
@@ -0,0 +1,2 @@
|
||||
package me.hypherionmc.craterlib.util;public class RenderUtils {
|
||||
}
|
Reference in New Issue
Block a user