Inspection and Cleanup
This commit is contained in:
@@ -4,12 +4,12 @@ import net.kyori.adventure.text.format.NamedTextColor;
|
||||
|
||||
public class ColorUtil {
|
||||
public static NamedTextColor scoreColor(int score) {
|
||||
switch (score) {
|
||||
case 1: return NamedTextColor.GOLD;
|
||||
case 2: return NamedTextColor.GREEN;
|
||||
case 3: return NamedTextColor.DARK_GREEN;
|
||||
}
|
||||
return switch (score) {
|
||||
case 1 -> NamedTextColor.GOLD;
|
||||
case 2 -> NamedTextColor.GREEN;
|
||||
case 3 -> NamedTextColor.DARK_GREEN;
|
||||
default -> NamedTextColor.GRAY;
|
||||
};
|
||||
|
||||
return NamedTextColor.GRAY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package eu.mhsl.minenet.minigames.util;
|
||||
|
||||
import eu.mhsl.minenet.minigames.world.generator.BlockPallet;
|
||||
import net.minestom.server.coordinate.Point;
|
||||
import net.minestom.server.coordinate.Pos;
|
||||
import net.minestom.server.instance.Instance;
|
||||
import net.minestom.server.instance.block.Block;
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
package eu.mhsl.minenet.minigames.util;
|
||||
|
||||
|
||||
import com.extollit.linalg.mutable.Vec2d;
|
||||
import it.unimi.dsi.fastutil.Pair;
|
||||
import net.minestom.server.coordinate.Vec;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class InventoryItemAlignment {
|
||||
private int size;
|
||||
private int x;
|
||||
private int y;
|
||||
private final int size;
|
||||
private final int x;
|
||||
private final int y;
|
||||
|
||||
private int counter = -1;
|
||||
|
||||
@@ -36,7 +32,7 @@ public class InventoryItemAlignment {
|
||||
|
||||
if(this.size < 9) return new ItemOffset(this.row(this.size).get(counter), y > 1 ? 1 : 0);
|
||||
//TODO more items?
|
||||
return new ItemOffset(0,0);
|
||||
return new ItemOffset(0, 0);
|
||||
|
||||
}
|
||||
|
||||
@@ -44,8 +40,9 @@ public class InventoryItemAlignment {
|
||||
private List<Integer> row(int count) {
|
||||
return new ArrayList<ArrayList<Integer>>() {
|
||||
{
|
||||
//noinspection EmptyClassInitializer
|
||||
add(new ArrayList<>() {
|
||||
{
|
||||
static {
|
||||
}
|
||||
});
|
||||
add(new ArrayList<>() {
|
||||
@@ -133,9 +130,9 @@ public class InventoryItemAlignment {
|
||||
}.get(count);
|
||||
}
|
||||
|
||||
public class ItemOffset {
|
||||
private int x;
|
||||
private int z;
|
||||
public static class ItemOffset {
|
||||
private final int x;
|
||||
private final int z;
|
||||
|
||||
public ItemOffset(int x, int z) {
|
||||
this.x = x;
|
||||
|
||||
Reference in New Issue
Block a user