diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-07-19 00:06:17 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2023-05-29 21:11:43 +0800 |
| commit | 83ec9cb3e3326b1e9221e0630309c207fb630e8e (patch) | |
| tree | bb5b324b92de4faa8ea865d3b6971746a593b722 /runtime/src/main/java | |
| parent | 575d49c4a9ffd13ec9cffb2be006d316830a1e83 (diff) | |
| download | RoughlyEnoughItems-83ec9cb3e3326b1e9221e0630309c207fb630e8e.tar.gz RoughlyEnoughItems-83ec9cb3e3326b1e9221e0630309c207fb630e8e.tar.bz2 RoughlyEnoughItems-83ec9cb3e3326b1e9221e0630309c207fb630e8e.zip | |
Add InputMethods, Close #574
Diffstat (limited to 'runtime/src/main/java')
79 files changed, 2425 insertions, 814 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCoreClient.java b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCoreClient.java index 7e1a92728..de01c37f2 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; @@ -226,6 +227,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 6a32815b1..911cfe429 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 f46bd01a7..f98d8888d 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 @@ -79,6 +79,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; @@ -135,6 +136,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) { @@ -359,12 +368,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); @@ -383,18 +392,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"))) - ), + ), new TranslatableComponent("text.rei.support.me.bisect") - .withStyle(style -> style - .withColor(TextColor.fromRgb(0xff1fc3ff)) - .withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://www.bisecthosting.com/shedaniel")) + .withStyle(style -> style + .withColor(TextColor.fromRgb(0xff1fc3ff)) + .withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://www.bisecthosting.com/shedaniel")) .withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Im |
