diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-07-19 00:06:17 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2022-07-27 03:04:59 +0800 |
| commit | 5c6c39f1b0cced155943b91053c56e39693f0377 (patch) | |
| tree | 0e530f725ab63709b1f3d17e1dc6714c1f60c3d5 /runtime/src/main/java | |
| parent | e1a80830128c0ab05607cdce6bafe3d33af02247 (diff) | |
| download | RoughlyEnoughItems-5c6c39f1b0cced155943b91053c56e39693f0377.tar.gz RoughlyEnoughItems-5c6c39f1b0cced155943b91053c56e39693f0377.tar.bz2 RoughlyEnoughItems-5c6c39f1b0cced155943b91053c56e39693f0377.zip | |
Add InputMethods, Close #574
Diffstat (limited to 'runtime/src/main/java')
81 files changed, 2426 insertions, 831 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCoreClient.java b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCoreClient.java index 005d80570..647494f3b 100644 --- a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCoreClient.java +++ b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCoreClient.java @@ -74,6 +74,7 @@ import me.shedaniel.rei.impl.client.registry.category.CategoryRegistryImpl; import me.shedaniel.rei.impl.client.registry.display.DisplayRegistryImpl; import me.shedaniel.rei.impl.client.registry.screen.ScreenRegistryImpl; import me.shedaniel.rei.impl.client.search.SearchProviderImpl; +import me.shedaniel.rei.impl.client.search.method.InputMethodRegistryImpl; import me.shedaniel.rei.impl.client.subsets.SubsetsRegistryImpl; import me.shedaniel.rei.impl.client.transfer.TransferHandlerRegistryImpl; import me.shedaniel.rei.impl.client.view.ViewsImpl; @@ -227,6 +228,7 @@ public class RoughlyEnoughItemsCoreClient { }, new EntryRendererRegistryImpl(), new ViewsImpl(), + new InputMethodRegistryImpl(), new SearchProviderImpl(), new ConfigManagerImpl(), new EntryRegistryImpl(), diff --git a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java index 80d868c28..14ded37f7 100644 --- a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java +++ b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java @@ -30,7 +30,6 @@ import me.shedaniel.rei.api.common.category.CategoryIdentifier; import me.shedaniel.rei.api.common.display.Display; import me.shedaniel.rei.impl.common.transfer.InputSlotCrafter; import net.minecraft.ChatFormatting; -import net.minecraft.Util; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.resources.ResourceLocation; diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigManagerImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigManagerImpl.java index 60a5969f3..6649506e4 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigManagerImpl.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigManagerImpl.java @@ -80,6 +80,7 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; import net.minecraft.nbt.TagParser; import net.minecraft.network.chat.*; +import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import net.minecraft.world.InteractionResult; import org.jetbrains.annotations.ApiStatus; @@ -136,6 +137,14 @@ public class ConfigManagerImpl implements ConfigManager { } private static Jankson buildJankson(Jankson.Builder builder) { + // ResourceLocation + builder.registerSerializer(ResourceLocation.class, (location, marshaller) -> { + return new JsonPrimitive(location == null ? null : location.toString()); + }); + builder.registerDeserializer(String.class, ResourceLocation.class, (value, marshaller) -> { + return value == null ? null : new ResourceLocation(value); + }); + // CheatingMode builder.registerSerializer(CheatingMode.class, (value, marshaller) -> { if (value == CheatingMode.WHEN_CREATIVE) { @@ -364,12 +373,12 @@ public class ConfigManagerImpl implements ConfigManager { if (Minecraft.getInstance().getConnection() != null && Minecraft.getInstance().getConnection().getRecipeManager() != null) { TextListEntry feedbackEntry = ConfigEntryBuilder.create().startTextDescription( new TranslatableComponent("text.rei.feedback", new TranslatableComponent("text.rei.feedback.link") - .withStyle(style -> style - .withColor(TextColor.fromRgb(0xff1fc3ff)) - .withUnderlined(true) - .withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://forms.gle/5tdnK5WN1wng78pV8")) + .withStyle(style -> style + .withColor(TextColor.fromRgb(0xff1fc3ff)) + .withUnderlined(true) + .withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://forms.gle/5tdnK5WN1wng78pV8")) .withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ImmutableTextComponent("https://forms.gle/5tdnK5WN1wng78pV8"))) - )) + )) .withStyle(ChatFormatting.GRAY) ).build(); builder.getOrCreateCategory(new TranslatableComponent("config.roughlyenoughitems.advanced")).getEntries().add(0, feedbackEntry); @@ -388,18 +397,18 @@ public class ConfigManagerImpl implements ConfigManager { TextListEntry supportText = ConfigEntryBuilder.create().startTextDescription( new TranslatableComponent("text.rei.support.me.desc", new TranslatableComponent("text.rei.support.me.patreon") - .withStyle(style -> style - .withColor(TextColor.fromRgb(0xff1fc3ff)) - .withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://patreon.com/shedaniel")) + .withStyle(style -> style + .withColor(TextColor.fromRgb(0xff1fc3ff)) + .withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://patreon.com/shedaniel")) .withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ImmutableTextComponent("https://patreon.com/shedaniel"))) - ), + |
