Code improvements
This commit is contained in:
@@ -170,21 +170,18 @@ public class GuiGrid extends GuiBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isHoveringOverClear(int mouseX, int mouseY) {
|
public boolean isHoveringOverClear(int mouseX, int mouseY) {
|
||||||
if (grid.getType() == EnumGridType.CRAFTING) {
|
switch (grid.getType()) {
|
||||||
return inBounds(81, 105, 7, 7, mouseX, mouseY);
|
case CRAFTING:
|
||||||
} else if (grid.getType() == EnumGridType.PATTERN) {
|
return inBounds(81, 105, 7, 7, mouseX, mouseY);
|
||||||
return inBounds(64, 105, 7, 7, mouseX, mouseY);
|
case PATTERN:
|
||||||
|
return inBounds(64, 105, 7, 7, mouseX, mouseY);
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isHoveringOverCreatePattern(int mouseX, int mouseY) {
|
public boolean isHoveringOverCreatePattern(int mouseX, int mouseY) {
|
||||||
if (grid.getType() == EnumGridType.PATTERN) {
|
return grid.getType() == EnumGridType.PATTERN && inBounds(152, 124, 16, 16, mouseX, mouseY) && ((TileGrid) grid).mayCreatePattern();
|
||||||
return inBounds(152, 124, 16, 16, mouseX, mouseY) && ((TileGrid) grid).mayCreatePattern();
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -297,9 +294,9 @@ public class GuiGrid extends GuiBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qty >= 1000000) {
|
if (qty >= 1000000) {
|
||||||
return String.format("%.1f", (float) qty / 1000000).replace(",", ".").replace(".0", "") + "M";
|
return String.format(Locale.US, "%.1f", Math.floor(qty / 1000000)).replace(".0", "") + "M";
|
||||||
} else if (qty >= 1000) {
|
} else if (qty >= 1000) {
|
||||||
return String.format("%.1f", (float) qty / 1000).replace(",", ".").replace(".0", "") + "K";
|
return String.format(Locale.US, "%.1f", Math.floor(qty / 1000)).replace(".0", "") + "K";
|
||||||
} else if (qty == 1) {
|
} else if (qty == 1) {
|
||||||
return null;
|
return null;
|
||||||
} else if (qty == 0) {
|
} else if (qty == 0) {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
package refinedstorage.tile.config;
|
package refinedstorage.tile.config;
|
||||||
|
|
||||||
public class ModeConstants {
|
public final class ModeConstants {
|
||||||
public static final int WHITELIST = 0;
|
public static final int WHITELIST = 0;
|
||||||
public static final int BLACKLIST = 1;
|
public static final int BLACKLIST = 1;
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,7 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
import refinedstorage.RefinedStorageUtils;
|
import refinedstorage.RefinedStorageUtils;
|
||||||
|
|
||||||
public class ModeFilter {
|
public final class ModeFilter {
|
||||||
public static boolean respectsMode(IItemHandler filters, IModeConfig mode, int compare, ItemStack stack) {
|
public static boolean respectsMode(IItemHandler filters, IModeConfig mode, int compare, ItemStack stack) {
|
||||||
if (mode.getMode() == ModeConstants.WHITELIST) {
|
if (mode.getMode() == ModeConstants.WHITELIST) {
|
||||||
int slots = 0;
|
int slots = 0;
|
||||||
|
@@ -9,7 +9,7 @@ import refinedstorage.tile.TileRelay;
|
|||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class ControllerSearcher {
|
public final class ControllerSearcher {
|
||||||
public static TileController search(World world, BlockPos current, Set<String> visited) {
|
public static TileController search(World world, BlockPos current, Set<String> visited) {
|
||||||
if (visited.contains(current.getX() + "," + current.getY() + "," + current.getZ())) {
|
if (visited.contains(current.getX() + "," + current.getY() + "," + current.getZ())) {
|
||||||
return null;
|
return null;
|
||||||
|
Reference in New Issue
Block a user