Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.1.4 #12

Merged
merged 3 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.1.4] - 2024-06-28

### Fixed

- Support for Refined Storage v2.0.0-milestone.3.14.

## [0.1.3] - 2024-06-20

### Fixed
Expand Down Expand Up @@ -36,7 +42,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- Support for REI collapsable entries.
- Grid / REI search box synchronization options.

[Unreleased]: https://github.com/refinedmods/refinedstorage-rei-integration/compare/v0.1.3...HEAD
[Unreleased]: https://github.com/refinedmods/refinedstorage-rei-integration/compare/v0.1.4...HEAD

[0.1.4]: https://github.com/refinedmods/refinedstorage-rei-integration/compare/v0.1.3...v0.1.4

[0.1.3]: https://github.com/refinedmods/refinedstorage-rei-integration/compare/v0.1.2...v0.1.3

Expand Down
2 changes: 2 additions & 0 deletions config/intellij-code-style.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<code_scheme name="Refined Mods" version="173">
<JavaCodeStyleSettings>
<option name="GENERATE_FINAL_LOCALS" value="true" />
<option name="GENERATE_FINAL_PARAMETERS" value="true" />
<option name="SPACE_INSIDE_ONE_LINE_ENUM_BRACES" value="true" />
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
refinedstorageVersion=2.0.0-milestone.3.13
refinedstorageVersion=2.0.0-milestone.3.14
architecturyVersion=11.1.17
clothConfigVersion=13.0.121
reiVersion=14.1.727
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"gui.refinedstorage_rei_integration.grid.synchronizer.help": "Sync the search box text to the REI filter.",
"gui.refinedstorage_rei_integration.grid.synchronizer.two_way": "REI two-way",
"gui.refinedstorage_rei_integration.grid.synchronizer.two_way.help": "Sync the search box text to the REI filter, and the REI filter to the search box text.",
"block.refinedstorage_rei_integration.controller.fully_charged": "Fully charged Controller"
"block.refinedstorage_rei_integration.controller.fully_charged": "Fully charged Controllers"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import java.util.function.Supplier;

import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap;
import com.refinedmods.refinedstorage2.platform.common.content.Blocks;
import com.refinedmods.refinedstorage2.platform.common.content.ContentIds;
import com.refinedmods.refinedstorage2.platform.common.content.Items;
import com.refinedmods.refinedstorage2.platform.common.content.Tags;
Expand All @@ -19,12 +17,14 @@
import me.shedaniel.rei.api.common.util.EntryStacks;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;

import static com.refinedmods.refinedstorage.rei.common.Common.FULLY_CHARGED_CONTROLLER_GROUP_ID;
import static com.refinedmods.refinedstorage.rei.common.Common.FULLY_CHARGED_CONTROLLER_GROUP_NAME;
import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation;

@Environment(EnvType.CLIENT)
public class ReiClientPlugin implements REIClientPlugin {
Expand All @@ -45,60 +45,69 @@ public void registerItemComparators(final ItemComparatorRegistry registry) {
Items.INSTANCE.getControllers().stream().map(Supplier::get).forEach(registry::registerNbt);
}

private Component tagName(final String name) {
return createTranslation("tag.item", name);
}

@SuppressWarnings("UnstableApiUsage")
@Override
public void registerCollapsibleEntries(final CollapsibleEntryRegistry registry) {
groupItems(registry, Blocks.INSTANCE.getCable(), ContentIds.CABLE, Tags.CABLES);
groupItems(registry, Blocks.INSTANCE.getGrid(), ContentIds.GRID, Tags.GRIDS);
groupItems(registry, Blocks.INSTANCE.getCraftingGrid(), ContentIds.CRAFTING_GRID, Tags.CRAFTING_GRIDS);
groupItems(registry, Blocks.INSTANCE.getImporter(), ContentIds.IMPORTER, Tags.IMPORTERS);
groupItems(registry, Blocks.INSTANCE.getExporter(), ContentIds.EXPORTER, Tags.EXPORTERS);
groupItems(registry, Blocks.INSTANCE.getDetector(), ContentIds.DETECTOR, Tags.DETECTORS);
groupItems(registry, Blocks.INSTANCE.getDestructor(), ContentIds.DESTRUCTOR, Tags.DESTRUCTORS);
groupItems(registry, Blocks.INSTANCE.getConstructor(), ContentIds.CONSTRUCTOR, Tags.CONSTRUCTORS);
groupItems(registry, Blocks.INSTANCE.getExternalStorage(), ContentIds.EXTERNAL_STORAGE, Tags.EXTERNAL_STORAGES);
groupItems(registry, Blocks.INSTANCE.getController(), ContentIds.CONTROLLER, Tags.CONTROLLERS);
groupItems(registry, tagName("cables"), ContentIds.CABLE, Tags.CABLES);
groupItems(registry, tagName("grids"), ContentIds.GRID, Tags.GRIDS);
groupItems(registry, tagName("crafting_grids"), ContentIds.CRAFTING_GRID, Tags.CRAFTING_GRIDS);
groupItems(registry, tagName("importers"), ContentIds.IMPORTER, Tags.IMPORTERS);
groupItems(registry, tagName("exporters"), ContentIds.EXPORTER, Tags.EXPORTERS);
groupItems(registry, tagName("detectors"), ContentIds.DETECTOR, Tags.DETECTORS);
groupItems(registry, tagName("destructors"), ContentIds.DESTRUCTOR, Tags.DESTRUCTORS);
groupItems(registry, tagName("constructors"), ContentIds.CONSTRUCTOR, Tags.CONSTRUCTORS);
groupItems(registry, tagName("external_storages"), ContentIds.EXTERNAL_STORAGE, Tags.EXTERNAL_STORAGES);
groupItems(registry, tagName("controllers"), ContentIds.CONTROLLER, Tags.CONTROLLERS);
registry.group(
FULLY_CHARGED_CONTROLLER_GROUP_ID,
FULLY_CHARGED_CONTROLLER_GROUP_NAME,
Items.INSTANCE.getControllers()
.stream()
Items.INSTANCE.getControllers().stream()
.map(Supplier::get)
.map(ControllerBlockItem::createAtEnergyCapacity)
.map(EntryStacks::of)
.toList()
);
groupItems(
registry,
Blocks.INSTANCE.getCreativeController(),
tagName("creative_controllers"),
ContentIds.CREATIVE_CONTROLLER,
Tags.CREATIVE_CONTROLLERS
);
groupItems(
registry,
Blocks.INSTANCE.getWirelessTransmitter(),
tagName("wireless_transmitters"),
ContentIds.WIRELESS_TRANSMITTER,
Tags.WIRELESS_TRANSMITTERS
);
groupItems(registry, Blocks.INSTANCE.getNetworkReceiver(), ContentIds.NETWORK_RECEIVER, Tags.NETWORK_RECEIVERS);
groupItems(registry, tagName("network_receivers"), ContentIds.NETWORK_RECEIVER, Tags.NETWORK_RECEIVERS);
groupItems(
registry,
Blocks.INSTANCE.getNetworkTransmitter(),
tagName("network_transmitters"),
ContentIds.NETWORK_TRANSMITTER,
Tags.NETWORK_TRANSMITTERS
);
groupItems(
registry,
Blocks.INSTANCE.getSecurityManager(),
tagName("security_managers"),
ContentIds.SECURITY_MANAGER,
Tags.SECURITY_MANAGERS
);
groupItems(
registry,
Blocks.INSTANCE.getRelay(),
tagName("relays"),
ContentIds.RELAY,
Tags.RELAYS
);
groupItems(
registry,
tagName("disk_interfaces"),
ContentIds.DISK_INTERFACE,
Tags.DISK_INTERFACES
);
}

@Override
Expand All @@ -109,14 +118,10 @@ public void registerExclusionZones(final ExclusionZones zones) {
@SuppressWarnings("UnstableApiUsage")
private static void groupItems(
final CollapsibleEntryRegistry registry,
final BlockColorMap<?, ?> blocks,
final Component name,
final ResourceLocation itemIdentifier,
final TagKey<Item> tag
) {
registry.group(
itemIdentifier,
blocks.getDefault().getName(),
EntryIngredients.ofItemTag(tag)
);
registry.group(itemIdentifier, name, EntryIngredients.ofItemTag(tag));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import java.util.function.Supplier;

import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap;
import com.refinedmods.refinedstorage2.platform.common.content.Blocks;
import com.refinedmods.refinedstorage2.platform.common.content.ContentIds;
import com.refinedmods.refinedstorage2.platform.common.content.Items;
import com.refinedmods.refinedstorage2.platform.common.content.Tags;
Expand All @@ -18,12 +16,14 @@
import me.shedaniel.rei.api.common.util.EntryIngredients;
import me.shedaniel.rei.api.common.util.EntryStacks;
import me.shedaniel.rei.forge.REIPluginClient;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;

import static com.refinedmods.refinedstorage.rei.common.Common.FULLY_CHARGED_CONTROLLER_GROUP_ID;
import static com.refinedmods.refinedstorage.rei.common.Common.FULLY_CHARGED_CONTROLLER_GROUP_NAME;
import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation;

@REIPluginClient
public class ReiClientPlugin implements REIClientPlugin {
Expand All @@ -44,19 +44,23 @@ public void registerItemComparators(final ItemComparatorRegistry registry) {
Items.INSTANCE.getControllers().stream().map(Supplier::get).forEach(registry::registerNbt);
}

private Component tagName(final String name) {
return createTranslation("tag.item", name);
}

@SuppressWarnings("UnstableApiUsage")
@Override
public void registerCollapsibleEntries(final CollapsibleEntryRegistry registry) {
groupItems(registry, Blocks.INSTANCE.getCable(), ContentIds.CABLE, Tags.CABLES);
groupItems(registry, Blocks.INSTANCE.getGrid(), ContentIds.GRID, Tags.GRIDS);
groupItems(registry, Blocks.INSTANCE.getCraftingGrid(), ContentIds.CRAFTING_GRID, Tags.CRAFTING_GRIDS);
groupItems(registry, Blocks.INSTANCE.getImporter(), ContentIds.IMPORTER, Tags.IMPORTERS);
groupItems(registry, Blocks.INSTANCE.getExporter(), ContentIds.EXPORTER, Tags.EXPORTERS);
groupItems(registry, Blocks.INSTANCE.getDetector(), ContentIds.DETECTOR, Tags.DETECTORS);
groupItems(registry, Blocks.INSTANCE.getDestructor(), ContentIds.DESTRUCTOR, Tags.DESTRUCTORS);
groupItems(registry, Blocks.INSTANCE.getConstructor(), ContentIds.CONSTRUCTOR, Tags.CONSTRUCTORS);
groupItems(registry, Blocks.INSTANCE.getExternalStorage(), ContentIds.EXTERNAL_STORAGE, Tags.EXTERNAL_STORAGES);
groupItems(registry, Blocks.INSTANCE.getController(), ContentIds.CONTROLLER, Tags.CONTROLLERS);
groupItems(registry, tagName("cables"), ContentIds.CABLE, Tags.CABLES);
groupItems(registry, tagName("grids"), ContentIds.GRID, Tags.GRIDS);
groupItems(registry, tagName("crafting_grids"), ContentIds.CRAFTING_GRID, Tags.CRAFTING_GRIDS);
groupItems(registry, tagName("importers"), ContentIds.IMPORTER, Tags.IMPORTERS);
groupItems(registry, tagName("exporters"), ContentIds.EXPORTER, Tags.EXPORTERS);
groupItems(registry, tagName("detectors"), ContentIds.DETECTOR, Tags.DETECTORS);
groupItems(registry, tagName("destructors"), ContentIds.DESTRUCTOR, Tags.DESTRUCTORS);
groupItems(registry, tagName("constructors"), ContentIds.CONSTRUCTOR, Tags.CONSTRUCTORS);
groupItems(registry, tagName("external_storages"), ContentIds.EXTERNAL_STORAGE, Tags.EXTERNAL_STORAGES);
groupItems(registry, tagName("controllers"), ContentIds.CONTROLLER, Tags.CONTROLLERS);
registry.group(
FULLY_CHARGED_CONTROLLER_GROUP_ID,
FULLY_CHARGED_CONTROLLER_GROUP_NAME,
Expand All @@ -68,35 +72,41 @@ public void registerCollapsibleEntries(final CollapsibleEntryRegistry registry)
);
groupItems(
registry,
Blocks.INSTANCE.getCreativeController(),
tagName("creative_controllers"),
ContentIds.CREATIVE_CONTROLLER,
Tags.CREATIVE_CONTROLLERS
);
groupItems(
registry,
Blocks.INSTANCE.getWirelessTransmitter(),
tagName("wireless_transmitters"),
ContentIds.WIRELESS_TRANSMITTER,
Tags.WIRELESS_TRANSMITTERS
);
groupItems(registry, Blocks.INSTANCE.getNetworkReceiver(), ContentIds.NETWORK_RECEIVER, Tags.NETWORK_RECEIVERS);
groupItems(registry, tagName("network_receivers"), ContentIds.NETWORK_RECEIVER, Tags.NETWORK_RECEIVERS);
groupItems(
registry,
Blocks.INSTANCE.getNetworkTransmitter(),
tagName("network_transmitters"),
ContentIds.NETWORK_TRANSMITTER,
Tags.NETWORK_TRANSMITTERS
);
groupItems(
registry,
Blocks.INSTANCE.getSecurityManager(),
tagName("security_managers"),
ContentIds.SECURITY_MANAGER,
Tags.SECURITY_MANAGERS
);
groupItems(
registry,
Blocks.INSTANCE.getRelay(),
tagName("relays"),
ContentIds.RELAY,
Tags.RELAYS
);
groupItems(
registry,
tagName("disk_interfaces"),
ContentIds.DISK_INTERFACE,
Tags.DISK_INTERFACES
);
}

@Override
Expand All @@ -107,14 +117,10 @@ public void registerExclusionZones(final ExclusionZones zones) {
@SuppressWarnings("UnstableApiUsage")
private static void groupItems(
final CollapsibleEntryRegistry registry,
final BlockColorMap<?, ?> blocks,
final Component name,
final ResourceLocation itemIdentifier,
final TagKey<Item> tag
) {
registry.group(
itemIdentifier,
blocks.getDefault().getName(),
EntryIngredients.ofItemTag(tag)
);
registry.group(itemIdentifier, name, EntryIngredients.ofItemTag(tag));
}
}
Loading