Skip to content

Commit

Permalink
2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
KrLite committed Dec 30, 2023
1 parent 402a48c commit d83d1a3
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 36 deletions.
126 changes: 96 additions & 30 deletions src/main/java/net/krlite/rei_collapsible_entries/REIClientPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public class REIClientPlugin implements me.shedaniel.rei.api.client.plugins.REIC
public void registerCollapsibleEntries(CollapsibleEntryRegistry registry) {
REICollapsibleEntries.LOGGER.info("Registering quality-of-life collapsible entries for REI!");

types: {
types:
{
// Fluids
MC.buildCollection("fluids")
.predicate(ModPredicate.type(VanillaEntryTypes.FLUID))
Expand Down Expand Up @@ -65,7 +66,8 @@ public void registerCollapsibleEntries(CollapsibleEntryRegistry registry) {

// --- Minecraft

minecraft: {
minecraft:
{
// TODO: 2023/12/30
// Tags
Arrays.stream(new String[]{
Expand All @@ -74,7 +76,8 @@ public void registerCollapsibleEntries(CollapsibleEntryRegistry registry) {
"stairs", "slabs", "doors", "trapdoors", "fence_gates",
"boats", "walls", "fences", "trim_templates",
"decorated_pot_sherds", "swords", "shovels", "pickaxes",
"axes", "hoes", "small_flowers", "tall_flowers", "rails"
"axes", "hoes", "small_flowers", "tall_flowers", "rails",
"saplings"
}).forEach(tag -> MC.registerCollapsibleEntryFromTag(registry, tag));

// Tools according to materials
Expand Down Expand Up @@ -148,9 +151,14 @@ public void registerCollapsibleEntries(CollapsibleEntryRegistry registry) {
.predicate(ModPredicate.pathTrailing("horse_armor"))
.register(registry);

// Minecarts
MC.buildCollection("minecarts")
.predicate(ModPredicate.idTrailing(Registries.ITEM.getId(Items.MINECART)))
.register(registry);

// Potions
Arrays.stream(new String[]{ null, "lingering", "splash" }).forEach(prefix ->
MC.buildCollection(prefix, "potions")
Arrays.stream(new String[]{null, "lingering", "splash"}).forEach(prefix ->
MC.buildCollection(joinAll(prefix, "potions"))
.predicate(ModPredicate.idTrailing(MC.id(joinAll(prefix, "potion"))))
.register(registry)
);
Expand All @@ -168,15 +176,15 @@ public void registerCollapsibleEntries(CollapsibleEntryRegistry registry) {

// Corals
{
final String[] TYPES = new String[]{ "tube", "brain", "bubble", "fire", "horn" };
final String[] PREFIXES = new String[]{ null, "dead" };
final String[] POSTFIXES = new String[]{ "coral", "coral_fan", "coral_block" };
final String[] TYPES = new String[]{"tube", "brain", "bubble", "fire", "horn"};
final String[] PREFIXES = new String[]{null, "dead"};
final String[] POSTFIXES = new String[]{"coral", "coral_fan", "coral_block"};

Arrays.stream(POSTFIXES).forEach(postfix ->
MC.buildCollection("blocks", postfix)
.predicate(ModPredicate.iterate(
p -> ModPredicate.iterate(
pp -> ModPredicate.id(MC.id(joinAll(pp ,p))),
pp -> ModPredicate.id(MC.id(joinAll(pp, p, postfix))),
PREFIXES
),
TYPES
Expand All @@ -200,7 +208,7 @@ public void registerCollapsibleEntries(CollapsibleEntryRegistry registry) {

// ...
Arrays.stream(new String[]{
"button", "pressure_plate", "copper", "sapling"
"button", "pressure_plate", "copper"
}).forEach(type -> MC.buildCollection("blocks", type)
.predicate(ModPredicate.pathTrailing(type))
.register(registry)
Expand All @@ -209,7 +217,8 @@ public void registerCollapsibleEntries(CollapsibleEntryRegistry registry) {

// --- Ad Astra

adAstra: {
adAstra:
{
// Flags
AD_ASTRA.buildCollection("flags")
.predicate(ModPredicate.idTrailing(AD_ASTRA.id("flag")))
Expand All @@ -219,15 +228,35 @@ public void registerCollapsibleEntries(CollapsibleEntryRegistry registry) {
AD_ASTRA.buildCollection("globes")
.predicate(ModPredicate.idTrailing(AD_ASTRA.id("globe")))
.register(registry);

// Plates
AD_ASTRA.buildCollection("plates")
.predicate(ModPredicate.idTrailing(AD_ASTRA.id("plate")))
.register(registry);

// Materials
Arrays.stream(new String[]{"iron", "steel", "desh", "ostrum", "calorite"}).forEach(material ->
AD_ASTRA.buildCollection("materials", material)
.predicate(ModPredicate.idContains(AD_ASTRA.id(material)))
.register(registry)
);

// Planet materials
Arrays.stream(new String[]{"moon", "mars", "venus", "mercury", "glacio", "permafrost"}).forEach(planet ->
AD_ASTRA.buildCollection("planets", planet)
.predicate(ModPredicate.idContains(AD_ASTRA.id(planet)))
.register(registry)
);
}

// --- Applied Energetics 2

ae2: {
ae2:
{
// Paint balls
final String postfix = "paint_ball";

Arrays.stream(new String[]{ null, "lumen" }).forEach(type ->
Arrays.stream(new String[]{null, "lumen"}).forEach(type ->
AE2.buildCollection(joinAll(type, "paint_balls"))
.predicate(ModPredicate.dyeVariants(dyeColor ->
ModPredicate.id(AE2.id(joinAll(dyeColor.getName(), type, postfix)))
Expand All @@ -238,7 +267,8 @@ public void registerCollapsibleEntries(CollapsibleEntryRegistry registry) {

// --- Catwalks LLC.

catwalksLLC: {
catwalksLLC:
{
// Paint rollers
CATWALKS.buildTagged("filled_paint_rollers")
.predicate(ModPredicate.mod(CATWALKS)
Expand All @@ -249,7 +279,8 @@ public void registerCollapsibleEntries(CollapsibleEntryRegistry registry) {

// --- Computer Craft

computerCraft: {
computerCraft:
{
// Disks
CC.buildCollection("disks")
.predicate(ModPredicate.id(CC.id("disk")))
Expand All @@ -268,7 +299,8 @@ public void registerCollapsibleEntries(CollapsibleEntryRegistry registry) {

// --- Create

create: {
create:
{
// Stone types
Arrays.stream(new String[]{
"veridium", "scorchia", "scoria", "ochrum", "limestone",
Expand All @@ -282,28 +314,30 @@ public void registerCollapsibleEntries(CollapsibleEntryRegistry registry) {
);

// Copper tiles & shingles
Arrays.stream(new String[]{ "tile", "shingle" }).forEach(type ->
Arrays.stream(new String[]{"tile", "shingle"}).forEach(type ->
CREATE.buildCollection("blocks", joinAll("copper", type))
.predicate(ModPredicate.idContains(CREATE.id(joinAll("copper", type))))
.register(registry)
);

// Toolboxes & seats
Arrays.stream(new String[]{ "toolboxes", "seats" }).forEach(tag ->
Arrays.stream(new String[]{"toolboxes", "seats"}).forEach(tag ->
CREATE.registerCollapsibleEntryFromTag(registry, tag)
);
}

// --- Farmer's Delight

farmersDelight: {
farmersDelight:
{
// Canvas signs
FARMERS_DELIGHT.registerCollapsibleEntryFromTag(registry, "canvas_signs");
}

// --- Hephaestus

hephaestus: {
hephaestus:
{
// Modifiers
TC.buildCollection("modifiers")
.predicate(ModPredicate.mod(TC)
Expand Down Expand Up @@ -361,14 +395,14 @@ public void registerCollapsibleEntries(CollapsibleEntryRegistry registry) {
.register(registry);

// Stations
Arrays.stream(new String[]{ "part_builder", "tinker_station", "crafting_station"}).forEach(station ->
Arrays.stream(new String[]{"part_builder", "tinker_station", "crafting_station"}).forEach(station ->
TC.buildCollection("stations", station)
.predicate(ModPredicate.id(TC.id(station)))
.register(registry)
);

// Foundries & Smelteries
Arrays.stream(new String[]{ "foundry", "smeltery" }).forEach(type ->
Arrays.stream(new String[]{"foundry", "smeltery"}).forEach(type ->
TC.buildTagged("blocks", type)
.predicate(ModPredicate.tag(TC.itemTag(type)))
.register(registry)
Expand All @@ -387,14 +421,14 @@ public void registerCollapsibleEntries(CollapsibleEntryRegistry registry) {
.register(registry);

// Slime grasses
Arrays.stream(new String[]{ "ichor", "ender", "sky", "earth", "vanilla" }).forEach(type ->
Arrays.stream(new String[]{"ichor", "ender", "sky", "earth", "vanilla"}).forEach(type ->
TC.buildCollection("slime_grasses", type)
.predicate(ModPredicate.idTrailing(TC.id(type, "slime_grass")))
.register(registry)
);

// Slime dirt & congealed slimes & slimes
Arrays.stream(new String[]{ "slime_dirt", "congealed_slime", "slime"}).forEach(suffix ->
Arrays.stream(new String[]{"slime_dirt", "congealed_slime", "slime"}).forEach(suffix ->
TC.buildCollection("blocks", suffix)
.predicate(ModPredicate.idTrailing(TC.id(suffix)))
);
Expand All @@ -409,16 +443,18 @@ public void registerCollapsibleEntries(CollapsibleEntryRegistry registry) {

// --- Item Filters

itemFilters: {
itemFilters:
{
// Filters
ITEM_FILTERS.registerCollapsibleEntryFromTag(registry, "filters");
}

// --- Kibe

kibe: {
kibe:
{
// Colored blocks
Arrays.stream(new String[]{ "sleeping_bag", "glider", "rune", "elevator" }).forEach(thing ->
Arrays.stream(new String[]{"sleeping_bag", "glider", "rune", "elevator"}).forEach(thing ->
KIBE.buildCollection("things", thing)
.predicate(ModPredicate.dyeVariants(
dyeColor -> ModPredicate.id(KIBE.id(joinAll(dyeColor.getName(), thing)))
Expand All @@ -429,17 +465,47 @@ public void registerCollapsibleEntries(CollapsibleEntryRegistry registry) {
)
.register(registry)
);

// Kibes
KIBE.buildCollection("kibes")
.predicate(ModPredicate.idTrailing(KIBE.id("kibe")))
.register(registry);

// Kibes
KIBE.buildCollection("rings")
.predicate(ModPredicate.idTrailing(KIBE.id("ring")))
.register(registry);

// Tanks
KIBE.buildCollection("tanks")
.predicate(ModPredicate.id(KIBE.id("tank")))
.register(registry);

// Spikes and belts
Arrays.stream(new String[]{"spikes", "belt"}).forEach(type ->
KIBE.buildCollection("blocks", type)
.predicate(ModPredicate.idTrailing(KIBE.id(type)))
.register(registry)
);

// Stone generators
Arrays.stream(new String[]{"cobblestone", "basalt"}).forEach(type ->
KIBE.buildCollection(joinAll(type, "generators"))
.predicate(ModPredicate.idLeading(KIBE.id(joinAll(type, "generator"))))
.register(registry)
);
}

// --- Promenade

promenade: {
promenade:
{
// Piles
PROMENADE.buildCollection("piles")
.predicate(ModPredicate.idTrailing(PROMENADE.id("pile")));
.predicate(ModPredicate.idTrailing(PROMENADE.id("pile")));

// Mushrooms & mushroom blocks
Arrays.stream(new String[]{ null, "block" }).forEach(type ->
Arrays.stream(new String[]{null, "block"}).forEach(type ->
PROMENADE.buildCollection("blocks", joinAll("mushroom", type))
.predicate(ModPredicate.idContains(PROMENADE.id(joinAll("mushroom", type))))
.register(registry)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import me.shedaniel.rei.api.common.entry.EntryStack;
import me.shedaniel.rei.api.common.entry.type.EntryType;
import net.minecraft.registry.Registries;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.registry.tag.TagKey;
import net.minecraft.util.DyeColor;
import net.minecraft.util.Identifier;
Expand Down
30 changes: 27 additions & 3 deletions src/main/resources/assets/rei_collapsible_entries/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"tagged.minecraft.small_flowers" : "Flowers",
"tagged.minecraft.tall_flowers" : "Tall Flowers",
"tagged.minecraft.rails" : "Rails",
"tagged.minecraft.sapling" : "Saplings",

"tagged.catwalksinc.filled_paint_rolls": "§6Filled Paint Rollers",

Expand Down Expand Up @@ -77,6 +78,7 @@
"collection.minecraft.suspicious_stews": "Suspicious Stews",
"collection.minecraft.banner_patterns" : "Banner Patterns",
"collection.minecraft.horse_armors" : "Horse Armors",
"collection.minecraft.minecarts" : "Minecarts",

"collection.minecraft.spawn_eggs": "Spawn Eggs",
"collection.minecraft.buckets" : "Fluid Buckets",
Expand All @@ -91,7 +93,6 @@
"collection.minecraft.blocks/button" : "Buttons",
"collection.minecraft.blocks/pressure_plate" : "Pressure Plates",
"collection.minecraft.blocks/copper" : "Copper Blocks",
"collection.minecraft.blocks/sapling" : "Saplings",
"collection.minecraft.blocks/coral" : "Corals",
"collection.minecraft.blocks/coral_fan" : "Coral Fans",
"collection.minecraft.blocks/coral_block" : "Coral Blocks",
Expand Down Expand Up @@ -122,8 +123,22 @@
"collection.minecraft.splash_potions" : "Splash Potions",
"collection.minecraft.potions" : "Potions",

"collection.ad_astra:flags" : "Flags",
"collection.ad_astra:globes": "Globes",
"collection.ad_astra.flags" : "Flags",
"collection.ad_astra.globes": "Globes",
"collection.ad_astra.plates": "Metal Plates",

"collection.ad_astra.materials/iron" : "Iron",
"collection.ad_astra.materials/steel" : "Steel",
"collection.ad_astra.materials/desh" : "Desh",
"collection.ad_astra.materials/ostrum" : "Ostrum",
"collection.ad_astra.materials/calorite": "Calorite",

"collection.ad_astra.planets/moon" : "Moon",
"collection.ad_astra.planets/mars" : "Mars",
"collection.ad_astra.planets/venus" : "Venus",
"collection.ad_astra.planets/mercury" : "Mercury",
"collection.ad_astra.planets/glacio" : "Glacio",
"collection.ad_astra.planets/permafrost": "Permafrost",

"collection.ae2.paint_balls" : "Paint Balls",
"collection.ae2.lumen_paint_balls": "Lumen Paint Balls",
Expand Down Expand Up @@ -194,11 +209,20 @@

"collection.indrev.modules": "Modules",

"collection.kibe.kibes" : "Kibes",
"collection.kibe.rings" : "Rings",
"collection.kibe.tanks" : "Tanks",
"collection.kibe.cobblestone_generators": "Cobblestone Generators",
"collection.kibe.basalt_generators" : "Basalt Generators",

"collection.kibe.things/sleeping_bag": "Sleeping Bags",
"collection.kibe.things/glider" : "Gliders",
"collection.kibe.things/rune" : "Runes",
"collection.kibe.things/elevator" : "Elevators",

"collection.kibe.blocks/spikes" : "Spikes",
"collection.kibe.blocks/belt" : "Belts",

"collection.promenade.piles": "Piles",

"collection.promenade.blocks/mushroom" : "Mushrooms",
Expand Down
Loading

0 comments on commit d83d1a3

Please sign in to comment.