diff options
| author | shedaniel <daniel@shedaniel.me> | 2024-06-17 00:07:02 +0900 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2024-06-17 00:07:02 +0900 |
| commit | 667c7993dcea8b09bdffcad9956b353f054ad6e2 (patch) | |
| tree | a8952cd4dd6465919805f159dee66434dc008e22 /default-plugin/src/main/java/me | |
| parent | de36cf8cbce35d6fc5f879651c057fa143e72d89 (diff) | |
| download | RoughlyEnoughItems-667c7993dcea8b09bdffcad9956b353f054ad6e2.tar.gz RoughlyEnoughItems-667c7993dcea8b09bdffcad9956b353f054ad6e2.tar.bz2 RoughlyEnoughItems-667c7993dcea8b09bdffcad9956b353f054ad6e2.zip | |
Update to 1.21
Diffstat (limited to 'default-plugin/src/main/java/me')
13 files changed, 47 insertions, 42 deletions
diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/autocrafting/recipebook/DefaultRecipeBookHandler.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/autocrafting/recipebook/DefaultRecipeBookHandler.java index 5fc2affee..5f42f0303 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/autocrafting/recipebook/DefaultRecipeBookHandler.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/autocrafting/recipebook/DefaultRecipeBookHandler.java @@ -49,7 +49,7 @@ public class DefaultRecipeBookHandler implements TransferHandler { if (context.getDisplay() instanceof SimpleGridMenuDisplay && ClientHelper.getInstance().canUseMovePackets()) return ApplicabilityResult.createNotApplicable(); Display display = context.getDisplay(); - if (!(context.getMenu() instanceof RecipeBookMenu<?> container)) + if (!(context.getMenu() instanceof RecipeBookMenu<?, ?> container)) return ApplicabilityResult.createNotApplicable(); if (container == null) return ApplicabilityResult.createNotApplicable(); @@ -58,7 +58,7 @@ public class DefaultRecipeBookHandler implements TransferHandler { @Override public Result handle(Context context) { - RecipeBookMenu<?> container = (RecipeBookMenu<?>) context.getMenu(); + RecipeBookMenu<?, ?> container = (RecipeBookMenu<?, ?>) context.getMenu(); Display display = context.getDisplay(); if (display instanceof DefaultCraftingDisplay<?> craftingDisplay) { if (craftingDisplay.getOptionalRecipe().isPresent()) { diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientPlugin.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientPlugin.java index a651dbc4d..84629be4d 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientPlugin.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientPlugin.java @@ -41,6 +41,7 @@ import me.shedaniel.rei.api.client.registry.screen.ExclusionZones; import me.shedaniel.rei.api.client.registry.screen.ScreenRegistry; import me.shedaniel.rei.api.client.registry.transfer.TransferHandlerRegistry; import me.shedaniel.rei.api.client.registry.transfer.simple.SimpleTransferHandler; +import me.shedaniel.rei.api.common.display.basic.BasicDisplay; import me.shedaniel.rei.api.common.entry.EntryIngredient; import me.shedaniel.rei.api.common.entry.EntryStack; import me.shedaniel.rei.api.common.entry.type.VanillaEntryTypes; @@ -97,6 +98,7 @@ import net.minecraft.world.item.alchemy.Potion; import net.minecraft.world.item.alchemy.PotionBrewing; import net.minecraft.world.item.alchemy.PotionContents; import net.minecraft.world.item.crafting.*; +import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentInstance; import net.minecraft.world.level.GameType; import net.minecraft.world.level.block.Block; @@ -198,20 +200,20 @@ public class DefaultClientPlugin implements REIClientPlugin, BuiltinClientPlugin @Override public void registerCollapsibleEntries(CollapsibleEntryRegistry registry) { - registry.group(new ResourceLocation("roughlyenoughitems", "enchanted_book"), Component.translatable("item.minecraft.enchanted_book"), + registry.group(ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "enchanted_book"), Component.translatable("item.minecraft.enchanted_book"), stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.<ItemStack>castValue().is(Items.ENCHANTED_BOOK)); - registry.group(new ResourceLocation("roughlyenoughitems", "potion"), Component.translatable("item.minecraft.potion"), + registry.group(ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "potion"), Component.translatable("item.minecraft.potion"), stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.<ItemStack>castValue().is(Items.POTION)); - registry.group(new ResourceLocation("roughlyenoughitems", "splash_potion"), Component.translatable("item.minecraft.splash_potion"), + registry.group(ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "splash_potion"), Component.translatable("item.minecraft.splash_potion"), stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.<ItemStack>castValue().is(Items.SPLASH_POTION)); - registry.group(new ResourceLocation("roughlyenoughitems", "lingering_potion"), Component.translatable("item.minecraft.lingering_potion"), + registry.group(ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "lingering_potion"), Component.translatable("item.minecraft.lingering_potion"), stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.<ItemStack>castValue().is(Items.LINGERING_POTION)); - registry.group(new ResourceLocation("roughlyenoughitems", "spawn_egg"), Component.translatable("text.rei.spawn_egg"), + registry.group(ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "spawn_egg"), Component.translatable("text.rei.spawn_egg"), stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.<ItemStack>castValue().getItem() instanceof SpawnEggItem); - registry.group(new ResourceLocation("roughlyenoughitems", "tipped_arrow"), Component.translatable("item.minecraft.tipped_arrow"), + registry.group(ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "tipped_arrow"), Component.translatable("item.minecraft.tipped_arrow"), stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.<ItemStack>castValue().is(Items.TIPPED_ARROW)); - registry.group(new ResourceLocation("roughlyenoughitems", "music_disc"), Component.translatable("text.rei.music_disc"), - stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.<ItemStack>castValue().getItem() instanceof RecordItem); + registry.group(ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "music_disc"), Component.translatable("text.rei.music_disc"), + stack -> stack.getType() == VanillaEntryTypes.ITEM && stack.<ItemStack>castValue().has(DataComponents.JUKEBOX_PLAYABLE)); } @Override @@ -283,17 +285,17 @@ public class DefaultClientPlugin implements REIClientPlugin, BuiltinClientPlugin registry.addWorkstations(PATHING, EntryStacks.of(item)); } }); - for (EntryStack<?> stack : getTag(new ResourceLocation("c", "axes"))) { + for (EntryStack<?> stack : getTag(ResourceLocation.fromNamespaceAndPath("c", "axes"))) { if (axes.add(stack.<ItemStack>castValue().getItem())) { registry.addWorkstations(STRIPPING, stack); registry.addWorkstations(WAX_SCRAPING, stack); registry.addWorkstations(OXIDATION_SCRAPING, stack); } } - for (EntryStack<?> stack : getTag(new ResourceLocation("c", "hoes"))) { + for (EntryStack<?> stack : getTag(ResourceLocation.fromNamespaceAndPath("c", "hoes"))) { if (hoes.add(stack.<ItemStack>castValue().getItem())) registry.addWorkstations(TILLING, stack); } - for (EntryStack<?> stack : getTag(new ResourceLocation("c", "shovels"))) { + for (EntryStack<?> stack : getTag(ResourceLocation.fromNamespaceAndPath("c", "shovels"))) { if (shovels.add(stack.<ItemStack>castValue().getItem())) registry.addWorkstations(PATHING, stack); } } @@ -431,14 +433,18 @@ public class DefaultClientPlugin implements REIClientPlugin, BuiltinClientPlugin Collections.singletonList(EntryIngredients.of(output.get().getLeft())), Optional.empty(), OptionalInt.of(output.get().getRight()))); } } - List<Pair<EnchantmentInstance, ItemStack>> enchantmentBooks = BuiltInRegistries.ENCHANTMENT.stream() - .flatMap(enchantment -> { + List<Pair<EnchantmentInstance, ItemStack>> enchantmentBooks = BasicDisplay.registryAccess().registry(Registries.ENCHANTMENT) + .stream() + .flatMap(Registry::holders) + .flatMap(holder -> { + if (!holder.isBound()) return Stream.empty(); + Enchantment enchantment = holder.value(); if (enchantment.getMaxLevel() - enchantment.getMinLevel() >= 10) { return IntStream.of(enchantment.getMinLevel(), enchantment.getMaxLevel()) - .mapToObj(lvl -> new EnchantmentInstance(enchantment, lvl)); + .mapToObj(lvl -> new EnchantmentInstance(holder, lvl)); } else { return IntStream.rangeClosed(enchantment.getMinLevel(), enchantment.getMaxLevel()) - .mapToObj(lvl -> new EnchantmentInstance(enchantment, lvl)); + .mapToObj(lvl -> new EnchantmentInstance(holder, lvl)); } }) .map(instance -> { @@ -450,7 +456,7 @@ public class DefaultClientPlugin implements REIClientPlugin, BuiltinClientPlugin ItemStack itemStack = stack.castValue(); if (!itemStack.isEnchantable()) return; for (Pair<EnchantmentInstance, ItemStack> pair : enchantmentBooks) { - if (!pair.getKey().enchantment.canEnchant(itemStack)) continue; + if (!pair.getKey().enchantment.value().canEnchant(itemStack)) continue; Optional<Pair<ItemStack, Integer>> output = DefaultAnvilDisplay.calculateOutput(itemStack, pair.getValue()); if (output.isEmpty()) continue; registry.add(new DefaultAnvilDisplay(List.of(EntryIngredients.of(itemStack), EntryIngredients.of(pair.getValue())), diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java index d9c6c7c35..975491953 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java @@ -58,15 +58,14 @@ import java.util.Objects; @Environment(EnvType.CLIENT) public class DefaultInformationCategory implements DisplayCategory<DefaultInformationDisplay> { - protected static void innerBlit(Matrix4f matrix4f, int xStart, int xEnd, int yStart, int yEnd, int z, float uStart, float uEnd, float vStart, float vEnd) { + protected static void innerBlit(GuiGraphics graphics, Matrix4f matrix4f, int xStart, int xEnd, int yStart, int yEnd, int z, float uStart, float uEnd, float vStart, float vEnd) { RenderSystem.setShader(GameRenderer::getPositionTexShader); - BufferBuilder bufferBuilder = Tesselator.getInstance().getBuilder(); - bufferBuilder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX); - bufferBuilder.vertex(matrix4f, xStart, yEnd, z).uv(uStart, vEnd).endVertex(); - bufferBuilder.vertex(matrix4f, xEnd, yEnd, z).uv(uEnd, vEnd).endVertex(); - bufferBuilder.vertex(matrix4f, xEnd, yStart, z).uv(uEnd, vStart).endVertex(); - bufferBuilder.vertex(matrix4f, xStart, yStart, z).uv(uStart, vStart).endVertex(); - BufferUploader.drawWithShader(bufferBuilder.end()); + BufferBuilder bufferBuilder = Tesselator.getInstance().begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX); + bufferBuilder.addVertex(matrix4f, xStart, yEnd, z).setUv(uStart, vEnd); + bufferBuilder.addVertex(matrix4f, xEnd, yEnd, z).setUv(uEnd, vEnd); + bufferBuilder.addVertex(matrix4f, xEnd, yStart, z).setUv(uEnd, vStart); + bufferBuilder.addVertex(matrix4f, xStart, yStart, z).setUv(uStart, vStart); + BufferUploader.drawWithShader(bufferBuilder.buildOrThrow()); } @Override @@ -104,7 +103,7 @@ public class DefaultInformationCategory implements DisplayCategory<DefaultInform graphics.pose().pushPose(); graphics.pose().translate(-1.2f, -1, 0); Matrix4f matrix = graphics.pose().last().pose(); - DefaultInformationCategory.innerBlit(matrix, bounds.getCenterX() - 8, bounds.getCenterX() + 8, bounds.getCenterY() - 8, bounds.getCenterY() + 8, 0, 116f / 256f, (116f + 16f) / 256f, 0f, 16f / 256f); + DefaultInformationCategory.innerBlit(graphics, matrix, bounds.getCenterX() - 8, bounds.getCenterX() + 8, bounds.getCenterY() - 8, bounds.getCenterY() + 8, 0, 116f / 256f, (116f + 16f) / 256f, 0f, 16f / 256f); graphics.pose().popPose(); } }; diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/BannerDuplicateRecipeFiller.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/BannerDuplicateRecipeFiller.java index f28eb8f43..6c2b9e3bb 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/BannerDuplicateRecipeFiller.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/BannerDuplicateRecipeFiller.java @@ -46,7 +46,7 @@ public class BannerDuplicateRecipeFiller implements CraftingRecipeFiller<BannerD Map<DyeColor, Pair<EntryIngredient.Builder, EntryStack<?>>> displayMap = new HashMap<>(); for (Pair<DyeColor, ItemStack> pair : ShieldDecorationRecipeFiller.randomizeBanners()) { - Optional<Item> bannerOptional = BuiltInRegistries.ITEM.getOptional(new ResourceLocation(pair.getFirst().getName() + "_banner")); + Optional<Item> bannerOptional = BuiltInRegistries.ITEM.getOptional(ResourceLocation.parse(pair.getFirst().getName() + "_banner")); if (bannerOptional.isEmpty()) continue; Pair<EntryIngredient.Builder, EntryStack<?>> builderPair = displayMap.computeIfAbsent(pair.getFirst(), color -> Pair.of(EntryIngredient.builder(), EntryStacks.of(bannerOptional.get()))); builderPair.getFirst().add(EntryStacks.of(pair.getSecond())); diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/CraftingRecipeFiller.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/CraftingRecipeFiller.java index 8670ed6fc..bfe9383aa 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/CraftingRecipeFiller.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/CraftingRecipeFiller.java @@ -80,7 +80,7 @@ public interface CraftingRecipeFiller<T extends CraftingRecipe> extends Function if (display.isShapeless()) { bounds.x -= 10; } - Widget widget = Widgets.createTexturedWidget(new ResourceLocation("roughlyenoughitems:textures/gui/info.png"), bounds.getX(), bounds.getY(), 0, 0, bounds.getWidth(), bounds.getHeight(), 1, 1, 1, 1); + Widget widget = Widgets.createTexturedWidget(ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "textures/gui/info.png"), bounds.getX(), bounds.getY(), 0, 0, bounds.getWidth(), bounds.getHeight(), 1, 1, 1, 1); return Widgets.withTooltip(Widgets.withBounds(widget, bounds), texts); } diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/ShieldDecorationRecipeFiller.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/ShieldDecorationRecipeFiller.java index 2a74d4f66..f44dbc0af 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/ShieldDecorationRecipeFiller.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/crafting/filler/ShieldDecorationRecipeFiller.java @@ -52,7 +52,7 @@ public class ShieldDecorationRecipeFiller implements CraftingRecipeFiller<Shield Random random = new Random(); for (DyeColor color : colors) { - Optional<Item> bannerOptional = BuiltInRegistries.ITEM.getOptional(new ResourceLocation(color.getName() + "_banner")); + Optional<Item> bannerOptional = BuiltInRegistries.ITEM.getOptional(ResourceLocation.parse(color.getName() + "_banner")); if (bannerOptional.isEmpty()) continue; out.add(Pair.of(color, new ItemStack(bannerOptional.get()))); diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/DefaultTagCategory.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/DefaultTagCategory.java index 7f0466cd8..420a96dbb 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/DefaultTagCategory.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/DefaultTagCategory.java @@ -182,12 +182,12 @@ public class DefaultTagCategory implements DisplayCategory<DefaultTagDisplay<?, widgets.add(Widgets.withTranslate(new DelegateWidget(Widgets.noOp()) { @Override protected Widget delegate() { - ResourceLocation expandTexture = !expanded[0] ? new ResourceLocation("roughlyenoughitems", "textures/gui/expand.png") - : new ResourceLocation("roughlyenoughitems", "textures/gui/shrink.png"); + ResourceLocation expandTexture = !expanded[0] ? ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "textures/gui/expand.png") + : ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "textures/gui/shrink.png"); return Widgets.concat( Widgets.createTexturedWidget(expandTexture, new Rectangle(recipeBounds.x + 5 + 2, recipeBounds.y + 6 + 2, 13 - 4, 13 - 4), 0, 0, 9, 9), - Widgets.createTexturedWidget(new ResourceLocation("roughlyenoughitems", "textures/gui/clipboard.png"), + Widgets.createTexturedWidget(ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "textures/gui/clipboard.png"), new Rectangle(recipeBounds.x + 5 + 2, recipeBounds.getMaxY() - 6 - 13 + 2, 13 - 4, 13 - 4), 0, 0, 9, 9) ); } diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/ReferenceTagNodeWidget.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/ReferenceTagNodeWidget.java index 04ddb52bf..723f812e1 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/ReferenceTagNodeWidget.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/tag/ReferenceTagNodeWidget.java @@ -71,7 +71,7 @@ public class ReferenceTagNodeWidget<S, T> extends TagNodeWidget<S, T> { public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) { if (this.overflowBounds.intersects(MatrixUtils.transform(graphics.pose().last().pose(), getBounds()))) { RenderSystem.setShader(GameRenderer::getPositionTexShader); - graphics.innerBlit(new ResourceLocation("textures/gui/sprites/advancements/task_frame_unobtained.png"), + graphics.innerBlit(ResourceLocation.withDefaultNamespace("textures/gui/sprites/advancements/task_frame_unobtained.png"), bounds.x - 1, bounds.x - 1 + 26, bounds.y - 1, bounds.y - 1 + 26, 0, 0, 1, 0, 1); this.slot.getBounds().setLocation(bounds.getCenterX() - this.slot.getBounds().getWidth() / 2, bounds.y + (bounds.height - this.slot.getBounds().getHeight()) / 2 + 1); diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/exclusionzones/DefaultRecipeBookExclusionZones.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/exclusionzones/DefaultRecipeBookExclusionZones.java index 4afaa5674..49e7f7da3 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/exclusionzones/DefaultRecipeBookExclusionZones.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/exclusionzones/DefaultRecipeBookExclusionZones.java @@ -43,7 +43,7 @@ public class DefaultRecipeBookExclusionZones implements ExclusionZonesProvider<R @Override public Collection<Rectangle> provide(RecipeUpdateListener screen) { if (!(screen instanceof AbstractContainerScreen<?> containerScreen) || !(((AbstractContainerScreen<?>) screen).getMenu() instanceof RecipeBookMenu) || - !Minecraft.getInstance().player.getRecipeBook().isOpen(((RecipeBookMenu<?>) ((AbstractContainerScreen<?>) screen).getMenu()).getRecipeBookType())) + !Minecraft.getInstance().player.getRecipeBook().isOpen(((RecipeBookMenu<?, ?>) ((AbstractContainerScreen<?>) screen).getMenu()).getRecipeBookType())) return Collections.emptyList(); RecipeBookComponent recipeBookWidget = screen.getRecipeBookComponent(); List<Rectangle> l = Lists.newArrayList(new Rectangle(containerScreen.leftPos - 4 - 145, containerScreen.topPos, 4 + 145 + 30, containerScreen.imageHeight)); diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/GameModeFavoriteEntry.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/GameModeFavoriteEntry.java index d9ae50fe5..d58d4f501 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/GameModeFavoriteEntry.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/GameModeFavoriteEntry.java @@ -56,7 +56,7 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; public class GameModeFavoriteEntry extends FavoriteEntry { - public static final ResourceLocation ID = new ResourceLocation("roughlyenoughitems", "gamemode"); + public static final ResourceLocation ID = ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "gamemode"); public static final String TRANSLATION_KEY = "favorite.section.gamemode"; public static final String KEY = "mode"; @Nullable diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/TimeFavoriteEntry.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/TimeFavoriteEntry.java index 94139cf6e..b94222fc7 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/TimeFavoriteEntry.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/TimeFavoriteEntry.java @@ -55,9 +55,9 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; public class TimeFavoriteEntry extends FavoriteEntry { - public static final ResourceLocation ID = new ResourceLocation("roughlyenoughitems", "time"); + public static final ResourceLocation ID = ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "time"); public static final String TRANSLATION_KEY = "favorite.section.time"; - private static final ResourceLocation CHEST_GUI_TEXTURE = new ResourceLocation("roughlyenoughitems", "textures/gui/recipecontainer.png"); + private static final ResourceLocation CHEST_GUI_TEXTURE = ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "textures/gui/recipecontainer.png"); public static final String KEY = "mode"; @Nullable private final Time time; diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/WeatherFavoriteEntry.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/WeatherFavoriteEntry.java index 94ea48476..6924e02ad 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/WeatherFavoriteEntry.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/WeatherFavoriteEntry.java @@ -56,9 +56,9 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; public class WeatherFavoriteEntry extends FavoriteEntry { - public static final ResourceLocation ID = new ResourceLocation("roughlyenoughitems", "weather"); + public static final ResourceLocation ID = ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "weather"); public static final String TRANSLATION_KEY = "favorite.section.weather"; - private static final ResourceLocation CHEST_GUI_TEXTURE = new ResourceLocation("roughlyenoughitems", "textures/gui/recipecontainer.png"); + private static final ResourceLocation CHEST_GUI_TEXTURE = ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "textures/gui/recipecontainer.png"); public static final String KEY = "weather"; @Nullable private final Weather weather; diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/common/displays/tag/TagNodes.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/common/displays/tag/TagNodes.java index 488beb78e..b0aa10fef 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/common/displays/tag/TagNodes.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/common/displays/tag/TagNodes.java @@ -55,8 +55,8 @@ import java.util.function.Consumer; @ApiStatus.Internal public class TagNodes { - public static final ResourceLocation REQUEST_TAGS_PACKET_C2S = new ResourceLocation("roughlyenoughitems", "request_tags_c2s"); - public static final ResourceLocation REQUEST_TAGS_PACKET_S2C = new ResourceLocation("roughlyenoughitems", "request_tags_s2c"); + public static final ResourceLocation REQUEST_TAGS_PACKET_C2S = ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "request_tags_c2s"); + public static final ResourceLocation REQUEST_TAGS_PACKET_S2C = ResourceLocation.fromNamespaceAndPath("roughlyenoughitems", "request_tags_s2c"); public static final Map<String, ResourceKey<? extends Registry<?>>> TAG_DIR_MAP = new HashMap<>(); public static final ThreadLocal<String> CURRENT_TAG_DIR = new ThreadLocal<>(); |
