This commit is contained in:
2025-02-22 15:41:08 +01:00
parent a0f12ed4b1
commit 5a45506bd9
26 changed files with 411 additions and 130 deletions

Binary file not shown.

View File

@@ -4,18 +4,18 @@ org.gradle.jvmargs=-Xmx1G
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.21.4
yarn_mappings=1.21.4+build.2
loader_version=0.16.9
yarn_mappings=1.21.4+build.8
loader_version=0.16.10
# Fabric API
fabric_version=0.111.0+1.21.4
fabric_version=0.118.0+1.21.4
# Mod Properties
mod_version=3.3.3
mod_version=3.3.4
maven_group=systems.brn
archives_base_name=Serverstorage
# Dependencies
polymer_version=0.11.1+1.21.4
polymer_version=0.11.7+1.21.4
server_translations_api_version=2.4.0+1.21.2-rc1
servergui_version=1.8.1+1.21.4
servergui_version=1.8.2+1.21.4

View File

@@ -30,6 +30,8 @@ import java.util.List;
public class ServerStorage implements ModInitializer {
public static final List<String> moduleList = Arrays.asList("bus", "configuration", "container", "display", "drive", "filtering", "inventory", "pagination", "pcb", "transport", "antenna", "radio", "antenna_connector", "modem", "netherite_upgrade");
public static final List<String> tiers = Arrays.asList("iron", "golden", "diamond", "netherite");
public static final List<String> tiersAntenna = Arrays.asList("iron", "golden", "diamond", "netherite", "ender");
public static final List<String> tiersDrive = Arrays.asList("iron", "golden", "diamond", "netherite", "creative");
public static final List<String> materialList = Arrays.asList("pcb", "pcb_substrate", "cpu", "cpu_substrate", "drive_controller", "drive_casing");
public static final String MOD_ID = "serverstorage";
@@ -103,9 +105,9 @@ public class ServerStorage implements ModInitializer {
HEADS = SimpleItem.register("head", tiers, ItemGroups.INGREDIENTS);
PLATTERS = SimpleItem.register("platter", tiers, ItemGroups.INGREDIENTS);
DRIVES = HardDriveItem.register(tiers);
DRIVES = HardDriveItem.register(tiersDrive);
ANTENNA_LIST = Antenna.register(tiers);
ANTENNA_LIST = Antenna.register(tiersAntenna);
WIRELESS_TERMINAL = WirelessTerminalItem.register();

View File

@@ -12,6 +12,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.World;
import systems.brn.serverstorage.lib.ConnectionType;
import systems.brn.serverstorage.lib.SortMode;
import systems.brn.serverstorage.lib.StorageNetwork;
import systems.brn.serverstorage.screens.SettingsScreen;
@@ -47,7 +48,7 @@ public class InventoryInterfaceBlockEntity extends BlockEntity {
this.network.searchString = query;
this.network.reindexNetwork();
} else {
this.network = new StorageNetwork(world, this.pos, false, query);
this.network = new StorageNetwork(world, this.pos, SortMode.NUMERICALLY_REVERSE, query, false);
}
}
@@ -150,7 +151,7 @@ public class InventoryInterfaceBlockEntity extends BlockEntity {
} else {
Map<ItemStack, Integer> targetedBlockInventoryMap = new HashMap<>();
addInventoryToMap(targetedBlockEntityInventory, targetedBlockInventoryMap);
targetedBlockInventoryMap = sortAndFilterMap(targetedBlockInventoryMap, false, blockEntity.query);
targetedBlockInventoryMap = sortAndFilterMap(targetedBlockInventoryMap, SortMode.NUMERICALLY_REVERSE, blockEntity.query, false);
for (Map.Entry<ItemStack, Integer> entry : targetedBlockInventoryMap.entrySet()) {
ItemStack stack = entry.getKey();
int count = entry.getValue();

View File

@@ -5,6 +5,7 @@ import net.minecraft.block.entity.BlockEntity;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.registry.RegistryWrapper;
import net.minecraft.util.math.BlockPos;
import systems.brn.serverstorage.lib.SortMode;
import systems.brn.serverstorage.lib.StorageNetwork;
import systems.brn.serverstorage.screens.CraftingScreen;
import systems.brn.serverstorage.screens.StorageScreen;
@@ -15,8 +16,9 @@ import static systems.brn.serverstorage.ServerStorage.STORAGE_INTERFACE_BLOCK_EN
public class StorageInterfaceBlockEntity extends BlockEntity {
public Boolean sortAlphabetically = false;
public SortMode sortAlphabetically = SortMode.NUMERICALLY_REVERSE;
public String searchString = "";
public Boolean groupSimilar = false;
public int page = 0;
public StorageNetwork network;
@@ -30,16 +32,17 @@ public class StorageInterfaceBlockEntity extends BlockEntity {
public void reindexDrives() {
if (this.network != null) {
this.network.searchString = searchString;
this.network.sortAlphabetically = sortAlphabetically;
this.network.sortMode = sortAlphabetically;
this.network.groupSimilar = groupSimilar;
this.network.reindexNetwork();
} else {
this.network = new StorageNetwork(world, this.pos, sortAlphabetically, searchString);
this.network = new StorageNetwork(world, this.pos, sortAlphabetically, searchString, groupSimilar);
}
}
public void enforceNetwork() {
if (this.network == null) {
this.network = new StorageNetwork(world, this.pos, sortAlphabetically, searchString);
this.network = new StorageNetwork(world, this.pos, sortAlphabetically, searchString, groupSimilar);
}
}
@@ -62,8 +65,9 @@ public class StorageInterfaceBlockEntity extends BlockEntity {
public void writeNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup wrapperLookup) {
// Save the current value of the number to the nbt
nbt.putInt("page", page);
nbt.putBoolean("sortAlphabetically", sortAlphabetically);
nbt.putInt("sortAlphabetically", sortAlphabetically.getId());
nbt.putString("searchString", searchString);
nbt.putBoolean("groupSimilar", groupSimilar);
super.writeNbt(nbt, wrapperLookup);
}
@@ -74,7 +78,8 @@ public class StorageInterfaceBlockEntity extends BlockEntity {
super.readNbt(nbt, wrapperLookup);
page = nbt.getInt("page");
sortAlphabetically = nbt.getBoolean("sortAlphabetically");
sortAlphabetically = SortMode.fromId(nbt.getInt("sortAlphabetically"));
searchString = nbt.getString("searchString");
groupSimilar = nbt.getBoolean("groupSimilar");
}
}

View File

@@ -24,6 +24,7 @@ import net.minecraft.util.math.Direction;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;
import systems.brn.serverstorage.blockentities.HardDriveContainerBlockEntity;
import systems.brn.serverstorage.lib.SortMode;
import systems.brn.serverstorage.lib.StorageNetwork;
import xyz.nucleoid.packettweaker.PacketContext;
@@ -88,7 +89,7 @@ public class HardDriveContainerBlock extends ConnectedBlock implements PolymerTe
BlockEntity storageBlockEntity = world.getBlockEntity(pos);
if (storageBlockEntity instanceof HardDriveContainerBlockEntity driveContainerBlockEntity) {
if (driveContainerBlockEntity.network == null){
driveContainerBlockEntity.network = new StorageNetwork(world, pos, false, "");
driveContainerBlockEntity.network = new StorageNetwork(world, pos, SortMode.NUMERICALLY_REVERSE, "", false);
}
player.openHandledScreen(driveContainerBlockEntity);
}

View File

@@ -52,6 +52,10 @@ public class HardDrive {
tier = 3;
maxItems = 131072;
break;
case "creative_drive":
tier = 4;
maxItems = Integer.MAX_VALUE;
break;
default:
tier = -1;
maxItems = 0;

View File

@@ -44,7 +44,8 @@ public class WirelessTerminalItem extends SimpleItem {
.component(WirelessTerminalComponents.SESSION_KEY, null)
.component(WirelessTerminalComponents.SESSIONS, new ArrayList<>())
.component(WirelessTerminalComponents.SELECTED_POSITION, -1)
.component(WirelessTerminalComponents.SORT_ALPHABETICALLY, false)
.component(WirelessTerminalComponents.SORT_MODE, SortMode.NUMERICALLY_REVERSE)
.component(WirelessTerminalComponents.GROUP_SIMILAR, false)
.component(WirelessTerminalComponents.QUERY_STRING, "")
.component(WirelessTerminalComponents.PAGE, 0)
.registryKey(RegistryKey.of(RegistryKeys.ITEM, identifier))
@@ -69,18 +70,15 @@ public class WirelessTerminalItem extends SimpleItem {
int finalDistance = 0;
int actualDistance = 0;
if (radioInterfaceBlockEntity.getWorld() instanceof ServerWorld terminalWorldTemp) {
double distanceCoefficient = 1;
terminalWorld = terminalWorldTemp;
if (playerWorld.getRegistryKey() != terminalWorld.getRegistryKey()) {
int playerWorldScale = (int) playerWorld.getDimension().coordinateScale();
int terminalWorldScale = (int) terminalWorld.getDimension().coordinateScale();
playerTempPos = new Vec3d(playerTempPos.getX() * playerWorldScale, playerTempPos.getY(), playerTempPos.getZ() * terminalWorldScale);
playerTempPos = new Vec3d(playerTempPos.getX() / terminalWorldScale, playerTempPos.getY(), playerTempPos.getZ() / terminalWorldScale);
distanceCoefficient = 0.4;
}
playerPos = BlockPos.ofFloored(playerTempPos);
finalDistance = (int) (radioInterfaceBlockEntity.antennaRange * distanceCoefficient);
finalDistance = Math.max(finalDistance, 1);
finalDistance = Math.max(radioInterfaceBlockEntity.antennaRange, 1);
actualDistance = (int) Math.sqrt(playerPos.getSquaredDistance(pos));
}
return new RadioDistance(radioInterfaceBlockEntity, finalDistance, actualDistance, playerPos, pos, playerWorld, terminalWorld);
@@ -95,13 +93,14 @@ public class WirelessTerminalItem extends SimpleItem {
RadioInterfaceBlockEntity radioInterfaceBlockEntity = WirelessTerminalItem.getRadioInterface(pos, world);
if (radioInterfaceBlockEntity != null) {
RadioDistance radioDistance = getDistance(player, radioInterfaceBlockEntity);
if (radioInterfaceBlockEntity.antennaRange > 0 && radioDistance.actualDistance() <= radioDistance.finalDistance()) {
if (radioInterfaceBlockEntity.antennaRange < 0 || (radioInterfaceBlockEntity.antennaRange > 0 && radioDistance.actualDistance() <= radioDistance.finalDistance())) {
player.sendMessage(Text.translatable("gui.serverstorage.radio_connected", pos.toShortString(), terminalWorldName, radioDistance.playerPos().toShortString(), playerWorldName, radioDistance.actualDistance(), radioDistance.finalDistance()), true);
UUID wirelessTerminalSession = stack.getOrDefault(WirelessTerminalComponents.SESSION_KEY, null);
if (radioInterfaceBlockEntity.isSessionAuthorized(wirelessTerminalSession, player.getUuid())) {
boolean sortAlphabetically = stack.getOrDefault(WirelessTerminalComponents.SORT_ALPHABETICALLY, false);
SortMode sortMode = stack.getOrDefault(WirelessTerminalComponents.SORT_MODE, SortMode.NUMERICALLY_REVERSE);
boolean groupSimilar = stack.getOrDefault(WirelessTerminalComponents.GROUP_SIMILAR, false);
String searchQuery = stack.getOrDefault(WirelessTerminalComponents.QUERY_STRING, "");
StorageNetwork storageNetwork = new StorageNetwork(world, pos, sortAlphabetically, searchQuery);
StorageNetwork storageNetwork = new StorageNetwork(world, pos, sortMode, searchQuery, groupSimilar);
StorageScreen storageScreen = new StorageScreen(player, stack, storageNetwork, radioInterfaceBlockEntity);
storageScreen.updateDisplay();
storageScreen.open();
@@ -159,7 +158,8 @@ public class WirelessTerminalItem extends SimpleItem {
ownedBy = Text.translatable("gui.serverstorage.player_management_session_owner", ownerName);
}
int page = stack.getOrDefault(WirelessTerminalComponents.PAGE, 0);
boolean sortingAlphabetically = stack.getOrDefault(WirelessTerminalComponents.SORT_ALPHABETICALLY, false);
SortMode sortMode = stack.getOrDefault(WirelessTerminalComponents.SORT_MODE, SortMode.NUMERICALLY_REVERSE);
boolean groupSimilar = stack.getOrDefault(WirelessTerminalComponents.GROUP_SIMILAR, false);
String searchQuery = stack.getOrDefault(WirelessTerminalComponents.QUERY_STRING, "*");
if (selectedPositionIndex < 0 && !sessions.isEmpty()) {
selectedPositionIndex = sessions.size() - 1;
@@ -172,7 +172,8 @@ public class WirelessTerminalItem extends SimpleItem {
Text.translatable("gui.serverstorage.wireless_terminal_link_index", selectedPositionIndex),
Text.translatable("gui.serverstorage.wireless_terminal_page", page),
Text.translatable("gui.serverstorage.wireless_terminal_search_query", searchQuery),
Text.translatable(sortingAlphabetically ? "gui.serverstorage.wireless_terminal_sorting_alphabetically" : "gui.serverstorage.wireless_terminal_sorting_numerically"),
sortMode.getSortingText(),
Text.translatable(groupSimilar ? "gui.serverstorage.group_similar" : "gui.serverstorage.dont_group_similar"),
radioPlacedAt
)));
}
@@ -202,24 +203,23 @@ public class WirelessTerminalItem extends SimpleItem {
}
}
public static boolean useItem(ServerWorld world, ServerPlayerEntity playerEntity, ItemStack stackTemp) {
public static boolean useItem(ServerWorld world, ServerPlayerEntity playerEntity, ItemStack stack) {
MinecraftServer server = world.getServer();
ensureUUID(stackTemp, server);
updateLore(stackTemp, server);
ensureUUID(stack, server);
updateLore(stack, server);
if (!playerEntity.isSneaking()) {
ItemStack stack = stackTemp.copy();
List<SessionStorageClass> wirelessTerminalPositions = new ArrayList<>(stack.getOrDefault(WirelessTerminalComponents.SESSIONS, new ArrayList<>()));
int selectedPosition = stack.getOrDefault(WirelessTerminalComponents.SELECTED_POSITION, -1);
if (selectedPosition < 0 && !wirelessTerminalPositions.isEmpty()) {
selectedPosition = wirelessTerminalPositions.size() - 1;
stack.set(WirelessTerminalComponents.SELECTED_POSITION, selectedPosition);
saveStack(stack, stackTemp, playerEntity);
saveStack(stack, stack, playerEntity);
}
if (wirelessTerminalPositions.isEmpty()) {
stack.remove(WirelessTerminalComponents.SELECTED_POSITION);
saveStack(stack, stackTemp, playerEntity);
saveStack(stack, stack, playerEntity);
selectedPosition = -1;
}
@@ -236,12 +236,12 @@ public class WirelessTerminalItem extends SimpleItem {
boolean success = openTerminal(selectedPos, playerEntity, stack, sessionStorageClass.getWorld(server));
if (!success) {
removePosition(selectedPos, stack);
saveStack(stack, stackTemp, playerEntity);
saveStack(stack, stack, playerEntity);
}
return true;
} else {
removePosition(selectedPos, stack);
saveStack(stack, stackTemp, playerEntity);
saveStack(stack, stack, playerEntity);
playerEntity.playSoundToPlayer(SoundEvents.BLOCK_NOTE_BLOCK_BASS.value(), SoundCategory.PLAYERS, 1f, 1f);
WirelessTerminalSelectorScreen wirelessTerminalSelectorScreen = new WirelessTerminalSelectorScreen(playerEntity, null);
wirelessTerminalSelectorScreen.open();

View File

@@ -15,6 +15,7 @@ import systems.brn.serverstorage.items.SimpleItem;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import static systems.brn.serverstorage.ServerStorage.ANTENNA_RANGES;
import static systems.brn.serverstorage.ServerStorage.id;
@@ -32,7 +33,7 @@ public class Antenna extends SimpleItem {
public static List<Item> register(List<String> tiers) {
ArrayList<Item> items = new ArrayList<>();
int range = 16;
int range = 150;
for (String tier : tiers) {
Identifier identifier = id(tier + "_antenna");
Item item = Registry.register(Registries.ITEM, identifier, new Antenna(new Settings()
@@ -40,7 +41,11 @@ public class Antenna extends SimpleItem {
, identifier, range));
ItemGroupEvents.modifyEntriesEvent(ItemGroups.FUNCTIONAL).register(content -> content.add(item));
items.add(item);
ANTENNA_RANGES.put(item, range);
if (Objects.equals(tier, "ender")) {
ANTENNA_RANGES.put(item, Integer.MAX_VALUE);
} else {
ANTENNA_RANGES.put(item, range);
}
range *= 3;
}
return items;

View File

@@ -28,8 +28,18 @@ public abstract class PagedGui extends SimpleGui {
public static final String GUI_NEXT_PAGE_BLOCKED = "ewogICJ0aW1lc3RhbXAiIDogMTY0MDYxNjExMDQ4OCwKICAicHJvZmlsZUlkIiA6ICIxZjEyNTNhYTVkYTQ0ZjU5YWU1YWI1NmFhZjRlNTYxNyIsCiAgInByb2ZpbGVOYW1lIiA6ICJOb3RNaUt5IiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzdlNTc3MjBhNDg3OGM4YmNhYjBlOWM5YzQ3ZDllNTUxMjhjY2Q3N2JhMzQ0NWE1NGE5MWUzZTFlMWEyNzM1NmUiLAogICAgICAibWV0YWRhdGEiIDogewogICAgICAgICJtb2RlbCIgOiAic2xpbSIKICAgICAgfQogICAgfQogIH0KfQ==";
public static final String GUI_QUESTION_MARK = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYmM4ZWExZjUxZjI1M2ZmNTE0MmNhMTFhZTQ1MTkzYTRhZDhjM2FiNWU5YzZlZWM4YmE3YTRmY2I3YmFjNDAifX19";
public static final String GUI_REFRESH = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDc1ZDNkYjAzZGMyMWU1NjNiMDM0MTk3ZGE0MzViNzllY2ZlZjRiOGUyZWNkYjczMGUzNzBjMzE2NjI5ZDM2ZiJ9fX0=";
public static final String GUI_A = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGU0MTc0ODEyMTYyNmYyMmFlMTZhNGM2NjRjNzMwMWE5ZjhlYTU5MWJmNGQyOTg4ODk1NzY4MmE5ZmRhZiJ9fX0=";
public static final String GUI_1 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2E1MTZmYmFlMTYwNThmMjUxYWVmOWE2OGQzMDc4NTQ5ZjQ4ZjZkNWI2ODNmMTljZjVhMTc0NTIxN2Q3MmNjIn19fQ==";
public static final String GUI_Z = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzBkNDRmZWUwMzAzZjZkMzdmYWNhN2U5YzMxNTMwOTU1NmZhM2RmMzc5YmRkNTgyMzE3YWEzNjhhYTg0M2UifX19";
public static final String GUI_9 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDZhYmM2MWRjYWVmYmQ1MmQ5Njg5YzA2OTdjMjRjN2VjNGJjMWFmYjU2YjhiMzc1NWU2MTU0YjI0YTVkOGJhIn19fQ==";
public static final String GUI_A_B = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTdkZDM0OTI0ZDJiNmEyMTNhNWVkNDZhZTU3ODNmOTUzNzNhOWVmNWNlNWM4OGY5ZDczNjcwNTk4M2I5NyJ9fX0=";
public static final String GUI_1_B = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDJhNmYwZTg0ZGFlZmM4YjIxYWE5OTQxNWIxNmVkNWZkYWE2ZDhkYzBjM2NkNTkxZjQ5Y2E4MzJiNTc1In19fQ==";
public static final String GUI_Z_B = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzk5MmM3NTNiZjljNjI1ODUzY2UyYTBiN2IxNzRiODlhNmVjMjZiYjVjM2NjYjQ3M2I2YTIwMTI0OTYzMTIifX19";
public static final String GUI_9_B = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOWY3YWEwZDk3OTgzY2Q2N2RmYjY3YjdkOWQ5YzY0MWJjOWFhMzRkOTY2MzJmMzcyZDI2ZmVlMTlmNzFmOGI3In19fQ==";
public static final String GUI_STORE_ALL = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWFkNmM4MWY4OTlhNzg1ZWNmMjZiZTFkYzQ4ZWFlMmJjZmU3NzdhODYyMzkwZjU3ODVlOTViZDgzYmQxNGQifX19";
public static final String GUI_SETTINGS = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTRkNDliYWU5NWM3OTBjM2IxZmY1YjJmMDEwNTJhNzE0ZDYxODU0ODFkNWIxYzg1OTMwYjNmOTlkMjMyMTY3NCJ9fX0=";
public static final String GUI_CRAFTING = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYWQyYzBjZWRmYzMyZTNiZWVlOTU1Y2FiZDY2ZmQ0ZDc2NWVlZGEzYWRjYzg0YmM0NTFjOWZkYmVjZjNjYjdjMiJ9fX0=";
@@ -146,19 +156,19 @@ public abstract class PagedGui extends SimpleGui {
return DisplayElement.filler();
}
protected DisplayElement search(){
protected DisplayElement search() {
return DisplayElement.filler();
}
protected DisplayElement sorting(){
protected DisplayElement sorting() {
return DisplayElement.filler();
}
protected DisplayElement storeAll(){
protected DisplayElement storeAll() {
return DisplayElement.filler();
}
protected DisplayElement settings(){
protected DisplayElement settings() {
return DisplayElement.filler();
}

View File

@@ -0,0 +1,65 @@
package systems.brn.serverstorage.lib;
import net.minecraft.text.MutableText;
import net.minecraft.text.Text;
import static systems.brn.serverstorage.lib.PagedGui.*;
public enum SortMode {
ALPHABETICALLY(0),
ALPHABETICALLY_REVERSE(1),
NUMERICALLY(2),
NUMERICALLY_REVERSE(3);
private final int id;
SortMode(int id) {
this.id = id;
}
public int getId() {
return id;
}
public static SortMode fromId(int id) {
for (SortMode mode : values()) {
if (mode.getId() == id) {
return mode;
}
}
throw new IllegalArgumentException("Unknown SortMode id: " + id);
}
public SortMode nextSort() {
int nextOrdinal = (this.ordinal() + 1) % SortMode.values().length;
return SortMode.values()[nextOrdinal];
}
public MutableText getSortingText() {
return switch (this) {
case ALPHABETICALLY -> Text.translatable("gui.serverstorage.sorting_alphabetically");
case ALPHABETICALLY_REVERSE -> Text.translatable("gui.serverstorage.sorting_alphabetically_reversed");
case NUMERICALLY -> Text.translatable("gui.serverstorage.sorting_numerically");
case NUMERICALLY_REVERSE -> Text.translatable("gui.serverstorage.sorting_numerically_reversed");
};
}
public String getSortingIcon(boolean groupSimilar) {
if (groupSimilar) {
return switch (this) {
case ALPHABETICALLY -> GUI_A_B;
case ALPHABETICALLY_REVERSE -> GUI_Z_B;
case NUMERICALLY -> GUI_1_B;
case NUMERICALLY_REVERSE -> GUI_9_B;
};
}
return switch (this) {
case ALPHABETICALLY -> GUI_A;
case ALPHABETICALLY_REVERSE -> GUI_Z;
case NUMERICALLY -> GUI_1;
case NUMERICALLY_REVERSE -> GUI_9;
};
}
}

View File

@@ -32,7 +32,8 @@ public class StorageNetwork {
public final World world;
public final BlockPos startPos;
public boolean sortAlphabetically;
public SortMode sortMode;
public boolean groupSimilar;
public String searchString;
public int driveContainerCount;
@@ -41,11 +42,12 @@ public class StorageNetwork {
public int driveUsedSlots;
public int driveFreeSlots;
public StorageNetwork(World world, BlockPos startPos, boolean sortAlphabetically, String searchString) {
public StorageNetwork(World world, BlockPos startPos, SortMode sortMode, String searchString, boolean groupSimilar) {
this.world = world;
this.startPos = startPos;
this.sortAlphabetically = sortAlphabetically;
this.sortMode = sortMode;
this.searchString = searchString;
this.groupSimilar = groupSimilar;
reindexNetwork();
}
@@ -65,7 +67,7 @@ public class StorageNetwork {
countStuff();
filteredItemStackMap = getCombinedMap(sortAlphabetically, searchString);
filteredItemStackMap = getCombinedMap(sortMode, searchString, groupSimilar);
}
private void countStuff() {
@@ -163,12 +165,12 @@ public class StorageNetwork {
}
// Modify getCombinedInventoryFromChests to include item metadata and combine stacks
private TreeMap<ItemStack, Integer> getCombinedMap(boolean sortAlphabetically, String query) {
private TreeMap<ItemStack, Integer> getCombinedMap(SortMode sortAlphabetically, String query, boolean groupSimilar) {
itemStackMap = new HashMap<>();
for (HardDrive drive : drives) {
itemStackMap = drive.addToMap(itemStackMap);
}
return sortAndFilterMap(itemStackMap, sortAlphabetically, query);
return sortAndFilterMap(itemStackMap, sortAlphabetically, query, groupSimilar);
}

View File

@@ -10,8 +10,8 @@ import java.util.*;
public class StorageOperations {
// Modify getSimpleInventory to include item metadata and sort conditionally
public static TreeMap<ItemStack, Integer> sortAndFilterMap(Map<ItemStack, Integer> itemStackMap, boolean sortAlphabetically, String query) {
TreeMap<ItemStack, Integer> sortedMap = getItemStackIntegerTreeMap(itemStackMap, sortAlphabetically);
public static TreeMap<ItemStack, Integer> sortAndFilterMap(Map<ItemStack, Integer> itemStackMap, SortMode sortAlphabetically, String query, boolean groupSimilar) {
TreeMap<ItemStack, Integer> sortedMap = getItemStackIntegerTreeMap(itemStackMap, sortAlphabetically, groupSimilar);
if (query == null || query.isEmpty() || query.equals("*")) {
sortedMap.putAll(itemStackMap);
@@ -29,7 +29,7 @@ public class StorageOperations {
return sortedMap;
}
public static TreeSet<CraftingEntry> sortAndFilterEntries(ArrayList<CraftingEntry> craftingEntries, boolean sortAlphabetically, String query) {
public static TreeSet<CraftingEntry> sortAndFilterEntries(ArrayList<CraftingEntry> craftingEntries, SortMode sortAlphabetically, String query) {
TreeSet<CraftingEntry> sortedSet = getTreeSetCraftingEntries(sortAlphabetically);
if (query == null || query.isEmpty() || query.equals("*")) {
@@ -54,67 +54,153 @@ public class StorageOperations {
return false;
}
private static @NotNull TreeMap<ItemStack, Integer> getItemStackIntegerTreeMap(Map<ItemStack, Integer> itemStackMap, boolean sortAlphabetically) {
private static @NotNull TreeMap<ItemStack, Integer> getItemStackIntegerTreeMap(Map<ItemStack, Integer> itemStackMap, SortMode sortMode, boolean groupSimilar) {
TreeMap<ItemStack, Integer> sortedMap;
if (sortAlphabetically) {
// Sort alphabetically by item name
sortedMap = new TreeMap<>((o1, o2) -> {
String name1 = String.valueOf(o1.getItem());
String name2 = String.valueOf(o2.getItem());
return name1.compareToIgnoreCase(name2);
});
} else {
// Sort by count in descending order
sortedMap = new TreeMap<>((o1, o2) -> {
int count1 = itemStackMap.get(o1);
int count2 = itemStackMap.get(o2);
int countCompare = Integer.compare(count2, count1);
// If counts are equal, compare items alphabetically by name
return countCompare == 0 ? String.valueOf(o1.getItem()).compareToIgnoreCase(String.valueOf(o2.getItem())) : countCompare;
});
switch (sortMode) {
case ALPHABETICALLY:
// Sort alphabetically by item name
sortedMap = new TreeMap<>((o1, o2) -> sortAlpha(groupSimilar, o1, o2));
break;
case ALPHABETICALLY_REVERSE:
// Sort alphabetically by item name in reverse order
sortedMap = new TreeMap<>((o1, o2) -> sortAlpha(groupSimilar, o2, o1)); // Reverse comparison
break;
case NUMERICALLY:
// Sort by count in descending order
sortedMap = new TreeMap<>((o1, o2) -> {
int count1 = itemStackMap.get(o1);
int count2 = itemStackMap.get(o2);
int countCompare = Integer.compare(count2, count1);
// If counts are equal, compare items alphabetically by name
if (countCompare != 0) {
return countCompare;
}
return sortAlpha(groupSimilar, o1, o2);
});
break;
case NUMERICALLY_REVERSE:
// Sort by count in ascending order
sortedMap = new TreeMap<>((o1, o2) -> {
int count1 = itemStackMap.get(o1);
int count2 = itemStackMap.get(o2);
int countCompare = Integer.compare(count1, count2); // Reverse comparison
// If counts are equal, compare items alphabetically by name
if (countCompare != 0) {
return countCompare;
}
return sortAlpha(groupSimilar, o1, o2);
});
break;
default:
throw new IllegalArgumentException("Invalid sort mode: " + sortMode);
}
// Populate the sorted map with entries from the original map
sortedMap.putAll(itemStackMap);
return sortedMap;
}
private static @NotNull TreeSet<CraftingEntry> getTreeSetCraftingEntries(boolean sortAlphabetically) {
private static int sortAlpha(boolean groupSimilar, ItemStack o1, ItemStack o2) {
String name1, name2;
if (groupSimilar) {
name1 = String.valueOf(o1.getItem());
name2 = String.valueOf(o2.getItem());
} else {
name1 = o1.getItem() + o1.getComponents().toString();
name2 = o2.getItem() + o2.getComponents().toString();
}
return name1.compareToIgnoreCase(name2);
}
private static @NotNull TreeSet<CraftingEntry> getTreeSetCraftingEntries(SortMode sortMode) {
TreeSet<CraftingEntry> sortedSet;
if (sortAlphabetically) {
// Sort alphabetically by item name
sortedSet = new TreeSet<>((o1, o2) -> {
if (o1.outputStacks.isEmpty()) {
return 1;
} else if (o2.outputStacks.isEmpty()) {
return -1;
}
String name1 = String.valueOf(o1.outputStacks.getFirst().getItem());
String name2 = String.valueOf(o2.outputStacks.getFirst().getItem());
return name1.compareToIgnoreCase(name2);
});
} else {
// Sort by count in descending order
sortedSet = new TreeSet<>((o1, o2) -> {
if (o1.outputStacks.isEmpty()) {
return 1;
} else if (o2.outputStacks.isEmpty()) {
return -1;
}
int count1 = o1.totalMax;
int count2 = o2.totalMax;
int countCompare = Integer.compare(count2, count1);
// If counts are equal, compare items alphabetically by name
if (countCompare == 0) {
switch (sortMode) {
case ALPHABETICALLY:
// Sort alphabetically by item name
sortedSet = new TreeSet<>((o1, o2) -> {
if (o1.outputStacks.isEmpty()) {
return 1;
} else if (o2.outputStacks.isEmpty()) {
return -1;
}
String name1 = String.valueOf(o1.outputStacks.getFirst().getItem());
String name2 = String.valueOf(o2.outputStacks.getFirst().getItem());
return name1.compareToIgnoreCase(name2);
}
return countCompare;
});
});
break;
case ALPHABETICALLY_REVERSE:
// Sort alphabetically by item name in reverse order
sortedSet = new TreeSet<>((o1, o2) -> {
if (o1.outputStacks.isEmpty()) {
return 1;
} else if (o2.outputStacks.isEmpty()) {
return -1;
}
String name1 = String.valueOf(o1.outputStacks.getFirst().getItem());
String name2 = String.valueOf(o2.outputStacks.getFirst().getItem());
return name2.compareToIgnoreCase(name1); // Reverse comparison
});
break;
case NUMERICALLY:
// Sort by count in descending order
sortedSet = new TreeSet<>((o1, o2) -> {
if (o1.outputStacks.isEmpty()) {
return 1;
} else if (o2.outputStacks.isEmpty()) {
return -1;
}
int count1 = o1.totalMax;
int count2 = o2.totalMax;
int countCompare = Integer.compare(count2, count1);
// If counts are equal, compare items alphabetically by name
if (countCompare == 0) {
String name1 = String.valueOf(o1.outputStacks.getFirst().getItem());
String name2 = String.valueOf(o2.outputStacks.getFirst().getItem());
return name1.compareToIgnoreCase(name2);
}
return countCompare;
});
break;
case NUMERICALLY_REVERSE:
// Sort by count in ascending order
sortedSet = new TreeSet<>((o1, o2) -> {
if (o1.outputStacks.isEmpty()) {
return 1;
} else if (o2.outputStacks.isEmpty()) {
return -1;
}
int count1 = o1.totalMax;
int count2 = o2.totalMax;
int countCompare = Integer.compare(count1, count2); // Reverse comparison
// If counts are equal, compare items alphabetically by name
if (countCompare == 0) {
String name1 = String.valueOf(o1.outputStacks.getFirst().getItem());
String name2 = String.valueOf(o2.outputStacks.getFirst().getItem());
return name1.compareToIgnoreCase(name2);
}
return countCompare;
});
break;
default:
throw new IllegalArgumentException("Invalid sort mode: " + sortMode);
}
return sortedSet;
}
public static int canInsertToStack(ItemStack stack1, ItemStack stack2, int maxInsert) {
if (stack1.isEmpty() || ItemStack.areItemsEqual(stack1, stack2)) {
int remainingSpace = stack1.isEmpty() ? stack2.getMaxCount() : stack1.getMaxCount() - stack1.getCount();

View File

@@ -48,8 +48,13 @@ public class WirelessTerminalComponents {
);
public static final ComponentType<Boolean> SORT_ALPHABETICALLY = register(
"sort_alphabetically",
public static final ComponentType<SortMode> SORT_MODE = register(
"sort_mode",
builder -> builder.codec(Codec.INT.xmap(SortMode::fromId, SortMode::getId)) // No packetCodec needed for this example
);
public static final ComponentType<Boolean> GROUP_SIMILAR = register(
"group_similar",
builder -> builder.codec(Codec.BOOL) // No packetCodec needed for this example
);

View File

@@ -1,5 +1,6 @@
package systems.brn.serverstorage.screens;
import eu.pb4.sgui.api.ClickType;
import eu.pb4.sgui.api.elements.GuiElementBuilder;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
@@ -15,10 +16,7 @@ import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import systems.brn.serverstorage.blockentities.StorageInterfaceBlockEntity;
import systems.brn.serverstorage.lib.CraftingEntry;
import systems.brn.serverstorage.lib.PagedGui;
import systems.brn.serverstorage.lib.Searchable;
import systems.brn.serverstorage.lib.WirelessTerminalComponents;
import systems.brn.serverstorage.lib.*;
import java.util.*;
@@ -31,7 +29,6 @@ public class CraftingScreen extends PagedGui implements Searchable {
private final StorageInterfaceBlockEntity blockEntity;
private ArrayList<DisplayElement> recipesList;
public String searchQuery;
public boolean sortAlphabetically = false;
public CraftingScreen(StorageScreen storageScreen) {
super(storageScreen.getPlayer(), null);
@@ -55,7 +52,7 @@ public class CraftingScreen extends PagedGui implements Searchable {
Map<ItemStack, Integer> itemStackMap = new HashMap<>();
addInventoryToMap(storageScreen.getPlayer().getInventory(), itemStackMap);
itemStackMap.putAll(storageScreen.getNetwork().itemStackMap);
Map<ItemStack, Integer> items = sortAndFilterMap(itemStackMap, false, null);
Map<ItemStack, Integer> items = sortAndFilterMap(itemStackMap, SortMode.NUMERICALLY_REVERSE, null, getGroupSimilar());
this.craftingEntries = getCraftableRecipes(items, Objects.requireNonNull(player.getServer()));
this.recipesList = getAvailableRecipes();
super.updateDisplay();
@@ -63,7 +60,7 @@ public class CraftingScreen extends PagedGui implements Searchable {
private ArrayList<DisplayElement> getAvailableRecipes() {
ArrayList<DisplayElement> recipes = new ArrayList<>();
TreeSet<CraftingEntry> filteredCraftingEntries = sortAndFilterEntries(craftingEntries, getAlphabeticalSorting(), getQueryString());
TreeSet<CraftingEntry> filteredCraftingEntries = sortAndFilterEntries(craftingEntries, getSorting(), getQueryString());
for (CraftingEntry craftingEntry : filteredCraftingEntries) {
ItemStack stackWithCount = craftingEntry.outputStacks.getFirst().copy();
if (stackWithCount.getCount() > stackWithCount.getMaxCount()) {
@@ -219,33 +216,55 @@ public class CraftingScreen extends PagedGui implements Searchable {
}
}
public boolean getAlphabeticalSorting() {
public SortMode getSorting() {
if (blockEntity == null) {
return storageScreen.itemStack.getOrDefault(WirelessTerminalComponents.SORT_ALPHABETICALLY, false);
return storageScreen.itemStack.getOrDefault(WirelessTerminalComponents.SORT_MODE, SortMode.NUMERICALLY_REVERSE);
} else {
return blockEntity.sortAlphabetically;
}
}
public void setAlphabeticalSorting(boolean sorting) {
public void setSorting(SortMode sorting) {
if (blockEntity == null) {
storageScreen.itemStack.set(WirelessTerminalComponents.SORT_ALPHABETICALLY, sorting);
storageScreen.itemStack.set(WirelessTerminalComponents.SORT_MODE, sorting);
} else {
blockEntity.sortAlphabetically = sorting;
}
}
public boolean getGroupSimilar() {
if (blockEntity == null) {
return storageScreen.itemStack.getOrDefault(WirelessTerminalComponents.GROUP_SIMILAR, false);
} else {
return blockEntity.groupSimilar;
}
}
public void setGroupSimilar(boolean groupSimilar) {
if (blockEntity == null) {
storageScreen.itemStack.set(WirelessTerminalComponents.GROUP_SIMILAR, groupSimilar);
} else {
blockEntity.groupSimilar = groupSimilar;
}
}
@Override
protected DisplayElement sorting() {
return DisplayElement.of(
new GuiElementBuilder(Items.PLAYER_HEAD)
.setName(Text.translatable(getAlphabeticalSorting() ? "A->Z" : "9->1").formatted(Formatting.WHITE))
.setName(getSorting().getSortingText().formatted(Formatting.WHITE))
.setLore(List.of(Text.translatable(getGroupSimilar() ? "gui.serverstorage.group_similar" : "gui.serverstorage.dont_group_similar").formatted(Formatting.DARK_PURPLE)))
.hideDefaultTooltip().noDefaults()
.setSkullOwner(getAlphabeticalSorting() ? GUI_A : GUI_1)
.setCallback((x, y, z) -> {
.setSkullOwner(getSorting().getSortingIcon(getGroupSimilar()))
.setCallback((x, clickType, z) -> {
playClickSound(getPlayer());
if (storageScreen.checkDistance()) {
setAlphabeticalSorting(!getAlphabeticalSorting());
if (clickType == ClickType.MOUSE_LEFT) {
setSorting(getSorting().nextSort());
} else if (clickType == ClickType.MOUSE_RIGHT) {
setGroupSimilar(!getGroupSimilar());
}
updateDisplay();
}
})

View File

@@ -19,6 +19,7 @@ import systems.brn.serverstorage.blockentities.RadioInterfaceBlockEntity;
import systems.brn.serverstorage.blockentities.StorageInterfaceBlockEntity;
import systems.brn.serverstorage.lib.*;
import java.util.List;
import java.util.Map;
import static systems.brn.serverstorage.ServerStorage.ServerStorage_Crafting_Enable;
@@ -83,17 +84,33 @@ public class StorageScreen extends PagedGui implements Searchable {
return network;
}
public boolean getAlphabeticalSorting() {
public SortMode getSorting() {
if (blockEntity == null) {
return itemStack.getOrDefault(WirelessTerminalComponents.SORT_ALPHABETICALLY, false);
return itemStack.getOrDefault(WirelessTerminalComponents.SORT_MODE, SortMode.NUMERICALLY_REVERSE);
} else {
return blockEntity.sortAlphabetically;
}
}
public void setAlphabeticalSorting(boolean sorting) {
public boolean getGroupSimilar() {
if (blockEntity == null) {
itemStack.set(WirelessTerminalComponents.SORT_ALPHABETICALLY, sorting);
return itemStack.getOrDefault(WirelessTerminalComponents.GROUP_SIMILAR, false);
} else {
return blockEntity.groupSimilar;
}
}
public void setGroupSimilar(boolean groupSimilar) {
if (blockEntity == null) {
itemStack.set(WirelessTerminalComponents.GROUP_SIMILAR, groupSimilar);
} else {
blockEntity.groupSimilar = groupSimilar;
}
}
public void setSorting(SortMode sorting) {
if (blockEntity == null) {
itemStack.set(WirelessTerminalComponents.SORT_MODE, sorting);
} else {
blockEntity.sortAlphabetically = sorting;
}
@@ -136,7 +153,8 @@ public class StorageScreen extends PagedGui implements Searchable {
public void refreshTerminals() {
if (blockEntity == null) {
this.network.sortAlphabetically = getAlphabeticalSorting();
this.network.sortMode = getSorting();
this.network.groupSimilar = getGroupSimilar();
this.network.searchString = getQueryString();
getNetwork().reindexNetwork();
getNetwork().updateDisplays();
@@ -309,13 +327,18 @@ public class StorageScreen extends PagedGui implements Searchable {
protected DisplayElement sorting() {
return DisplayElement.of(
new GuiElementBuilder(Items.PLAYER_HEAD)
.setName(Text.translatable(getAlphabeticalSorting() ? "A->Z" : "9->1").formatted(Formatting.WHITE))
.setName(getSorting().getSortingText().formatted(Formatting.WHITE))
.setLore(List.of(Text.translatable(getGroupSimilar() ? "gui.serverstorage.group_similar" : "gui.serverstorage.dont_group_similar").formatted(Formatting.DARK_PURPLE)))
.hideDefaultTooltip().noDefaults()
.setSkullOwner(getAlphabeticalSorting() ? GUI_A : GUI_1)
.setCallback((x, y, z) -> {
.setSkullOwner(getSorting().getSortingIcon(getGroupSimilar()))
.setCallback((x, clickType, z) -> {
playClickSound(getPlayer());
if (checkDistance()) {
setAlphabeticalSorting(!getAlphabeticalSorting());
if (clickType == ClickType.MOUSE_LEFT) {
setSorting(getSorting().nextSort());
} else if (clickType == ClickType.MOUSE_RIGHT) {
setGroupSimilar(!getGroupSimilar());
}
this.refreshTerminals();
}
})
@@ -351,14 +374,15 @@ public class StorageScreen extends PagedGui implements Searchable {
protected DisplayElement storeAll() {
return DisplayElement.of(
new GuiElementBuilder(Items.PLAYER_HEAD)
.setName(Text.translatable("gui.all").formatted(Formatting.WHITE))
.setName(Text.translatable("gui.serverstorage.store_all").formatted(Formatting.WHITE))
.setLore(List.of(Text.translatable("gui.serverstorage.store_all.lore").formatted(Formatting.DARK_PURPLE)))
.hideDefaultTooltip().noDefaults()
.setSkullOwner(GUI_STORE_ALL)
.setCallback((x, y, z) -> {
playClickSound(player);
if (checkDistance()) {
if (y.isLeft) {
for (int i = 0; i < player.getInventory().main.size(); i++) {
for (int i = y.shift ? 0 : 8; i < player.getInventory().main.size(); i++) {
ItemStack stack = player.getInventory().main.get(i);
insertItem(stack, 0, getVirtualSize(), false);
}
@@ -379,7 +403,7 @@ public class StorageScreen extends PagedGui implements Searchable {
@Override
protected DisplayElement crafting() {
if (world != null && ((ServerWorld) world).getGameRules().getBoolean(ServerStorage_Crafting_Enable)) {
if (world != null && world.getGameRules().getBoolean(ServerStorage_Crafting_Enable)) {
return DisplayElement.of(
new GuiElementBuilder(Items.PLAYER_HEAD)
.setName(Text.translatable("container.crafting").formatted(Formatting.WHITE))

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "serverstorage:item/creative_drive"
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "serverstorage:item/ender_antenna"
}
}

View File

@@ -30,6 +30,8 @@
"item.serverstorage.netherite_head": "Netherite Hard Drive Head",
"item.serverstorage.netherite_platter": "Netherite Hard Drive Platter",
"item.serverstorage.creative_drive": "Creative Hard Drive",
"item.serverstorage.module_bus": "Bus Module",
"item.serverstorage.module_configuration": "Configuration Module",
"item.serverstorage.module_container": "Container Module",
@@ -59,10 +61,12 @@
"item.serverstorage.golden_antenna": "Golden Antenna",
"item.serverstorage.diamond_antenna": "Diamond Antenna",
"item.serverstorage.netherite_antenna": "Netherite Antenna",
"item.serverstorage.ender_antenna": "Ender Antenna",
"item.serverstorage.wireless_terminal": "Wireless terminal",
"item.serverstorage.wireless_terminal": "Wireless Terminal",
"gui.serverstorage.store_all": "Store all items from inventory",
"gui.serverstorage.store_all.lore": "Holding shift includes your hotbar",
"gui.serverstorage.player_management": "Player management",
"gui.serverstorage.player_management_session": "Session %d",
"gui.serverstorage.player_management_session_owner": "Owned by: %s",
@@ -73,8 +77,10 @@
"gui.serverstorage.wireless_terminal_link_index": "Current link index is %d",
"gui.serverstorage.wireless_terminal_page": "Page: %d",
"gui.serverstorage.wireless_terminal_search_query": "Search query: %s",
"gui.serverstorage.wireless_terminal_sorting_alphabetically": "Sorting alphabetically",
"gui.serverstorage.wireless_terminal_sorting_numerically": "Sorting numerically",
"gui.serverstorage.sorting_alphabetically": "Sorting alphabetically",
"gui.serverstorage.sorting_alphabetically_reversed": "Sorting alphabetically reversed",
"gui.serverstorage.sorting_numerically": "Sorting numerically",
"gui.serverstorage.sorting_numerically_reversed": "Sorting numerically reversed",
"gui.serverstorage.antenna_range": "Range: %d blocks",
"gui.serverstorage.player_management_session_click_deauthorize": "Click to deauthorize",
"gui.serverstorage.radio_selector": "Radio selector",
@@ -100,6 +106,9 @@
"gui.serverstorage.direction_up": "Up",
"gui.serverstorage.direction_down": "Down",
"gui.serverstorage.group_similar": "Group Similar",
"gui.serverstorage.dont_group_similar": "Don't Group Similar",
"serverstorage.groups.blocks" : "Serverstorage Blocks",
"serverstorage.groups.materials" : "Serverstorage Materials",
"serverstorage.groups.drives" : "Serverstorage Drives",

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "serverstorage:item/creative_drive"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "serverstorage:item/ender_antenna"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

View File

@@ -15,6 +15,6 @@
},
"result": {
"id": "serverstorage:bus_connector",
"count": 1
"count": 64
}
}

View File

@@ -0,0 +1,19 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"pattern": [
"ENN",
"#A#",
"N#E"
],
"key": {
"#": "minecraft:ender_eye",
"A": "serverstorage:netherite_antenna",
"E": "minecraft:diamond",
"N": "minecraft:netherite_ingot"
},
"result": {
"id": "serverstorage:ender_antenna",
"count": 1
}
}

View File

@@ -10,7 +10,7 @@
"G": "minecraft:gold_nugget",
"C": "serverstorage:material_cpu",
"S": "serverstorage:material_pcb_substrate",
"D": "minecraft:gray_stained_glass"
"D": "minecraft:tinted_glass"
},
"result": {
"id": "serverstorage:module_display",