diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-08-27 19:36:00 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-08-27 19:36:50 +0800 |
| commit | 6104964f60bac00a4ac1359bd244d361e50786bd (patch) | |
| tree | 04bf0350e7305633436bb133e8647f0cecce0bf5 /RoughlyEnoughItems-api/src/main/java/me | |
| parent | 935417891d62500610fb05ce75dc8d63219c39d2 (diff) | |
| download | RoughlyEnoughItems-6104964f60bac00a4ac1359bd244d361e50786bd.tar.gz RoughlyEnoughItems-6104964f60bac00a4ac1359bd244d361e50786bd.tar.bz2 RoughlyEnoughItems-6104964f60bac00a4ac1359bd244d361e50786bd.zip | |
Migrate from yarn to mojmap
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'RoughlyEnoughItems-api/src/main/java/me')
52 files changed, 394 insertions, 394 deletions
diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java index 45341c88e..809165a8f 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java @@ -27,9 +27,9 @@ import it.unimi.dsi.fastutil.ints.IntArrayList; import it.unimi.dsi.fastutil.ints.IntList; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.gui.screen.ingame.ContainerScreen; -import net.minecraft.container.Container; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; +import net.minecraft.world.inventory.AbstractContainerMenu; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; @@ -170,21 +170,21 @@ public interface AutoTransferHandler { } interface Context { - static Context create(boolean actuallyCrafting, ContainerScreen<?> containerScreen, RecipeDisplay recipeDisplay) { + static Context create(boolean actuallyCrafting, AbstractContainerScreen<?> containerScreen, RecipeDisplay recipeDisplay) { return new ContextImpl(actuallyCrafting, containerScreen, () -> recipeDisplay); } - default MinecraftClient getMinecraft() { - return MinecraftClient.getInstance(); + default Minecraft getMinecraft() { + return Minecraft.getInstance(); } boolean isActuallyCrafting(); - ContainerScreen<?> getContainerScreen(); + AbstractContainerScreen<?> getContainerScreen(); @Deprecated @ApiStatus.ScheduledForRemoval - default ContainerScreen<?> getHandledScreen() { + default AbstractContainerScreen<?> getHandledScreen() { return getContainerScreen(); } @@ -192,12 +192,12 @@ public interface AutoTransferHandler { @Deprecated @ApiStatus.ScheduledForRemoval - default Container getScreenHandler() { + default AbstractContainerMenu getScreenHandler() { return getContainer(); } - default Container getContainer() { - return getHandledScreen().getContainer(); + default AbstractContainerMenu getContainer() { + return getHandledScreen().getMenu(); } } @@ -276,10 +276,10 @@ public interface AutoTransferHandler { @ApiStatus.Internal final class ContextImpl implements Context { private boolean actuallyCrafting; - private ContainerScreen<?> containerScreen; + private AbstractContainerScreen<?> containerScreen; private Supplier<RecipeDisplay> recipeDisplaySupplier; - private ContextImpl(boolean actuallyCrafting, ContainerScreen<?> containerScreen, Supplier<RecipeDisplay> recipeDisplaySupplier) { + private ContextImpl(boolean actuallyCrafting, AbstractContainerScreen<?> containerScreen, Supplier<RecipeDisplay> recipeDisplaySupplier) { this.actuallyCrafting = actuallyCrafting; this.containerScreen = containerScreen; this.recipeDisplaySupplier = recipeDisplaySupplier; @@ -291,7 +291,7 @@ public interface AutoTransferHandler { } @Override - public ContainerScreen<?> getContainerScreen() { + public AbstractContainerScreen<?> getContainerScreen() { return containerScreen; } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/BuiltinPlugin.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/BuiltinPlugin.java index f33a1953e..49a9b7746 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/BuiltinPlugin.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/BuiltinPlugin.java @@ -24,32 +24,32 @@ package me.shedaniel.rei.api; import me.shedaniel.rei.impl.Internals; -import net.minecraft.item.ItemStack; -import net.minecraft.recipe.Ingredient; -import net.minecraft.text.Text; -import net.minecraft.util.Identifier; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.Ingredient; import java.util.Collections; import java.util.List; import java.util.function.UnaryOperator; public interface BuiltinPlugin { - Identifier CRAFTING = new Identifier("minecraft", "plugins/crafting"); - Identifier SMELTING = new Identifier("minecraft", "plugins/smelting"); - Identifier SMOKING = new Identifier("minecraft", "plugins/smoking"); - Identifier BLASTING = new Identifier("minecraft", "plugins/blasting"); - Identifier CAMPFIRE = new Identifier("minecraft", "plugins/campfire"); - Identifier STONE_CUTTING = new Identifier("minecraft", "plugins/stone_cutting"); - Identifier STRIPPING = new Identifier("minecraft", "plugins/stripping"); - Identifier BREWING = new Identifier("minecraft", "plugins/brewing"); - Identifier PLUGIN = new Identifier("roughlyenoughitems", "default_plugin"); - Identifier COMPOSTING = new Identifier("minecraft", "plugins/composting"); - Identifier FUEL = new Identifier("minecraft", "plugins/fuel"); - Identifier SMITHING = new Identifier("minecraft", "plugins/smithing"); - Identifier BEACON = new Identifier("minecraft", "plugins/beacon"); - Identifier TILLING = new Identifier("minecraft", "plugins/tilling"); - Identifier PATHING = new Identifier("minecraft", "plugins/pathing"); - Identifier INFO = new Identifier("roughlyenoughitems", "plugins/information"); + ResourceLocation CRAFTING = new ResourceLocation("minecraft", "plugins/crafting"); + ResourceLocation SMELTING = new ResourceLocation("minecraft", "plugins/smelting"); + ResourceLocation SMOKING = new ResourceLocation("minecraft", "plugins/smoking"); + ResourceLocation BLASTING = new ResourceLocation("minecraft", "plugins/blasting"); + ResourceLocation CAMPFIRE = new ResourceLocation("minecraft", "plugins/campfire"); + ResourceLocation STONE_CUTTING = new ResourceLocation("minecraft", "plugins/stone_cutting"); + ResourceLocation STRIPPING = new ResourceLocation("minecraft", "plugins/stripping"); + ResourceLocation BREWING = new ResourceLocation("minecraft", "plugins/brewing"); + ResourceLocation PLUGIN = new ResourceLocation("roughlyenoughitems", "default_plugin"); + ResourceLocation COMPOSTING = new ResourceLocation("minecraft", "plugins/composting"); + ResourceLocation FUEL = new ResourceLocation("minecraft", "plugins/fuel"); + ResourceLocation SMITHING = new ResourceLocation("minecraft", "plugins/smithing"); + ResourceLocation BEACON = new ResourceLocation("minecraft", "plugins/beacon"); + ResourceLocation TILLING = new ResourceLocation("minecraft", "plugins/tilling"); + ResourceLocation PATHING = new ResourceLocation("minecraft", "plugins/pathing"); + ResourceLocation INFO = new ResourceLocation("roughlyenoughitems", "plugins/information"); static BuiltinPlugin getInstance() { return Internals.getBuiltinPlugin(); @@ -57,9 +57,9 @@ public interface BuiltinPlugin { void registerBrewingRecipe(ItemStack input, Ingredient ingredient, ItemStack output); - void registerInformation(List<EntryStack> entryStacks, Text name, UnaryOperator<List<Text>> textBuilder); + void registerInformation(List<EntryStack> entryStacks, Component name, UnaryOperator<List<Component>> textBuilder); - default void registerInformation(EntryStack entryStack, Text name, UnaryOperator<List<Text>> textBuilder) { + default void registerInformation(EntryStack entryStack, Component name, UnaryOperator<List<Component>> textBuilder) { registerInformation(Collections.singletonList(entryStack), name, textBuilder); } } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ClientHelper.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ClientHelper.java index 2cfcf3ff7..e6b67ff3c 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ClientHelper.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ClientHelper.java @@ -27,10 +27,10 @@ import me.shedaniel.rei.impl.Internals; import me.shedaniel.rei.utils.CollectionUtils; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.text.Text; -import net.minecraft.util.Identifier; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -146,7 +146,7 @@ public interface ClientHelper { * @param item the item to find * @return the mod name with blue and italic formatting */ - Text getFormattedModFromItem(Item item); + Component getFormattedModFromItem(Item item); /** * Gets the formatted mod from an identifier @@ -154,7 +154,7 @@ public interface ClientHelper { * @param identifier the identifier to find * @return the mod name with blue and italic formatting */ - Text getFormattedModFromIdentifier(Identifier identifier); + Component getFormattedModFromIdentifier(ResourceLocation identifier); /** * Gets the mod from an identifier @@ -162,7 +162,7 @@ public interface ClientHelper { * @param identifier the identifier to find * @return the mod name */ - default String getModFromIdentifier(Identifier identifier) { + default String getModFromIdentifier(ResourceLocation identifier) { if (identifier == null) return ""; return getModFromModId(identifier.getNamespace()); @@ -189,13 +189,13 @@ public interface ClientHelper { @Deprecated @ApiStatus.ScheduledForRemoval - default boolean executeViewAllRecipesFromCategory(Identifier category) { + default boolean executeViewAllRecipesFromCategory(ResourceLocation category) { return openView(ViewSearchBuilder.builder().addCategory(category).fillPreferredOpenedCategory()); } @Deprecated @ApiStatus.ScheduledForRemoval - default boolean executeViewAllRecipesFromCategories(List<Identifier> categories) { + default boolean executeViewAllRecipesFromCategories(List<ResourceLocation> categories) { return openView(ViewSearchBuilder.builder().addCategories(categories).fillPreferredOpenedCategory()); } @@ -208,15 +208,15 @@ public interface ClientHelper { return Internals.createViewSearchBuilder(); } - ViewSearchBuilder addCategory(Identifier category); + ViewSearchBuilder addCategory(ResourceLocation category); - ViewSearchBuilder addCategories(Collection<Identifier> categories); + ViewSearchBuilder addCategories(Collection<ResourceLocation> categories); default ViewSearchBuilder addAllCategories() { return addCategories(CollectionUtils.map(RecipeHelper.getInstance().getAllCategories(), RecipeCategory::getIdentifier)); } - @NotNull Set<Identifier> getCategories(); + @NotNull Set<ResourceLocation> getCategories(); ViewSearchBuilder addRecipesFor(EntryStack stack); @@ -226,10 +226,10 @@ public interface ClientHelper { @NotNull List<EntryStack> getUsagesFor(); - ViewSearchBuilder setPreferredOpenedCategory(@Nullable Identifier category); + ViewSearchBuilder setPreferredOpenedCategory(@Nullable ResourceLocation category); @Nullable - Identifier getPreferredOpenedCategory(); + ResourceLocation getPreferredOpenedCategory(); ViewSearchBuilder fillPreferredOpenedCategory(); diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ConfigManager.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ConfigManager.java index 011b53a12..85565a53c 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ConfigManager.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ConfigManager.java @@ -26,8 +26,8 @@ package me.shedaniel.rei.api; import me.shedaniel.rei.impl.Internals; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.screens.Screen; import org.jetbrains.annotations.NotNull; @Environment(EnvType.CLIENT) @@ -64,7 +64,7 @@ public interface ConfigManager { * @param parent the screen shown before */ default void openConfigScreen(Screen parent) { - MinecraftClient.getInstance().openScreen(getConfigScreen(parent)); + Minecraft.getInstance().setScreen(getConfigScreen(parent)); } /** diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayHelper.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayHelper.java index 94d3cf9d6..6693189ea 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayHelper.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayHelper.java @@ -29,14 +29,14 @@ import me.shedaniel.rei.gui.config.SearchFieldLocation; import me.shedaniel.rei.impl.Internals; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.util.ActionResult; +import net.minecraft.world.InteractionResult; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import java.util.List; import java.util.function.Supplier; -import static net.minecraft.util.ActionResult.PASS; +import static net.minecraft.world.InteractionResult.PASS; @Environment(EnvType.CLIENT) public interface DisplayHelper { @@ -166,20 +166,20 @@ public interface DisplayHelper { * @return whether the item slot can fit * @see BaseBoundsHandler#registerExclusionZones(Class, Supplier) for easier api */ - default ActionResult canItemSlotWidgetFit(int left, int top, T screen, Rectangle fullBounds) { - ActionResult fit = isInZone(left, top); - if (fit == ActionResult.FAIL) - return ActionResult.FAIL; - ActionResult fit2 = isInZone(left + 18, top + 18); - if (fit2 == ActionResult.FAIL) - return ActionResult.FAIL; - if (fit == ActionResult.SUCCESS && fit2 == ActionResult.SUCCESS) - return ActionResult.SUCCESS; + default InteractionResult canItemSlotWidgetFit(int left, int top, T screen, Rectangle fullBounds) { + InteractionResult fit = isInZone(left, top); + if (fit == InteractionResult.FAIL) + return InteractionResult.FAIL; + InteractionResult fit2 = isInZone(left + 18, top + 18); + if (fit2 == InteractionResult.FAIL) + return InteractionResult.FAIL; + if (fit == InteractionResult.SUCCESS && fit2 == InteractionResult.SUCCESS) + return InteractionResult.SUCCESS; return PASS; } @Override - default ActionResult isInZone(double mouseX, double mouseY) { + default InteractionResult isInZone(double mouseX, double mouseY) { return OverlayDecider.super.isInZone(mouseX, mouseY); } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayVisibilityHandler.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayVisibilityHandler.java index 732e95949..82d5c901f 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayVisibilityHandler.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayVisibilityHandler.java @@ -23,7 +23,7 @@ package me.shedaniel.rei.api; -import net.minecraft.util.ActionResult; +import net.minecraft.world.InteractionResult; public interface DisplayVisibilityHandler { @@ -46,6 +46,6 @@ public interface DisplayVisibilityHandler { * @param display the display of the recipe * @return the visibility */ - ActionResult handleDisplay(RecipeCategory<?> category, RecipeDisplay display); + InteractionResult handleDisplay(RecipeCategory<?> category, RecipeDisplay display); } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DrawableConsumer.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DrawableConsumer.java index 3aaf05ba6..30d65028a 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DrawableConsumer.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DrawableConsumer.java @@ -23,13 +23,13 @@ package me.shedaniel.rei.api; -import net.minecraft.client.gui.DrawableHelper; -import net.minecraft.client.util.math.MatrixStack; +import com.mojang.blaze3d.vertex.PoseStack; +import net.minecraft.client.gui.GuiComponent; import org.jetbrains.annotations.NotNull; /** * Consumer of a {@link DrawableHelper} and information of mou |
