aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/plugin
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-06-18 20:07:38 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-06-18 20:07:38 +0800
commit609c2238e12ad9835c449cd9f9da842ca747d5dc (patch)
tree87d52715819b31543afe88137cd196ce6d7e9cad /src/main/java/me/shedaniel/rei/plugin
parent4f3a2eae017efe3ff6896f5c01d58c7b1a27d814 (diff)
downloadRoughlyEnoughItems-609c2238e12ad9835c449cd9f9da842ca747d5dc.tar.gz
RoughlyEnoughItems-609c2238e12ad9835c449cd9f9da842ca747d5dc.tar.bz2
RoughlyEnoughItems-609c2238e12ad9835c449cd9f9da842ca747d5dc.zip
nah let's break everyone's plugins
Diffstat (limited to 'src/main/java/me/shedaniel/rei/plugin')
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java26
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultPotionEffectExclusionZones.java6
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultRecipeBookExclusionZones.java7
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/blasting/DefaultBlastingCategory.java5
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingCategory.java3
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/campfire/DefaultCampfireCategory.java3
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java32
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingCategory.java3
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/smelting/DefaultSmeltingCategory.java5
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/smoking/DefaultSmokingCategory.java5
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/stonecutting/DefaultStoneCuttingCategory.java23
11 files changed, 33 insertions, 85 deletions
diff --git a/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java b/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java
index 3d8d3e64f..bf22ed09b 100644
--- a/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java
+++ b/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java
@@ -12,7 +12,6 @@ import me.shedaniel.rei.api.*;
import me.shedaniel.rei.client.ScreenHelper;
import me.shedaniel.rei.gui.RecipeViewingScreen;
import me.shedaniel.rei.gui.VillagerRecipeViewingScreen;
-import me.shedaniel.rei.gui.config.DisplayVisibility;
import me.shedaniel.rei.plugin.blasting.DefaultBlastingCategory;
import me.shedaniel.rei.plugin.blasting.DefaultBlastingDisplay;
import me.shedaniel.rei.plugin.brewing.DefaultBrewingCategory;
@@ -171,19 +170,19 @@ public class DefaultPlugin implements REIPluginEntry {
public void registerBounds(DisplayHelper displayHelper) {
displayHelper.getBaseBoundsHandler().registerExclusionZones(AbstractInventoryScreen.class, new DefaultPotionEffectExclusionZones());
displayHelper.getBaseBoundsHandler().registerExclusionZones(RecipeBookProvider.class, new DefaultRecipeBookExclusionZones());
- displayHelper.registerBoundsHandler(new DisplayHelper.DisplayBoundsHandler<AbstractContainerScreen>() {
+ displayHelper.registerBoundsHandler(new DisplayHelper.DisplayBoundsHandler<AbstractContainerScreen<?>>() {
@Override
- public Class getBaseSupportedClass() {
+ public Class<?> getBaseSupportedClass() {
return AbstractContainerScreen.class;
}
@Override
- public Rectangle getLeftBounds(AbstractContainerScreen screen) {
+ public Rectangle getLeftBounds(AbstractContainerScreen<?> screen) {
return new Rectangle(2, 0, ScreenHelper.getLastContainerScreenHooks().rei_getContainerLeft() - 4, MinecraftClient.getInstance().window.getScaledHeight());
}
@Override
- public Rectangle getRightBounds(AbstractContainerScreen screen) {
+ public Rectangle getRightBounds(AbstractContainerScreen<?> screen) {
int startX = ScreenHelper.getLastContainerScreenHooks().rei_getContainerLeft() + ScreenHelper.getLastContainerScreenHooks().rei_getContainerWidth() + 2;
return new Rectangle(startX, 0, MinecraftClient.getInstance().window.getScaledWidth() - startX - 2, MinecraftClient.getInstance().window.getScaledHeight());
}
@@ -195,7 +194,7 @@ public class DefaultPlugin implements REIPluginEntry {
});
displayHelper.registerBoundsHandler(new DisplayHelper.DisplayBoundsHandler<RecipeViewingScreen>() {
@Override
- public Class getBaseSupportedClass() {
+ public Class<?> getBaseSupportedClass() {
return RecipeViewingScreen.class;
}
@@ -217,7 +216,7 @@ public class DefaultPlugin implements REIPluginEntry {
});
displayHelper.registerBoundsHandler(new DisplayHelper.DisplayBoundsHandler<VillagerRecipeViewingScreen>() {
@Override
- public Class getBaseSupportedClass() {
+ public Class<?> getBaseSupportedClass() {
return VillagerRecipeViewingScreen.class;
}
@@ -239,7 +238,7 @@ public class DefaultPlugin implements REIPluginEntry {
});
displayHelper.registerBoundsHandler(new DisplayHelper.DisplayBoundsHandler<CreativeInventoryScreen>() {
@Override
- public Class getBaseSupportedClass() {
+ public Class<?> getBaseSupportedClass() {
return CreativeInventoryScreen.class;
}
@@ -278,17 +277,6 @@ public class DefaultPlugin implements REIPluginEntry {
recipeHelper.registerWorkingStations(COMPOSTING, new ItemStack(Items.COMPOSTER));
recipeHelper.registerSpeedCraftButtonArea(COMPOSTING, bounds -> null);
recipeHelper.registerSpeedCraftButtonArea(DefaultPlugin.CAMPFIRE, bounds -> new Rectangle((int) bounds.getMaxX() - 16, bounds.y + 6, 10, 10));
- recipeHelper.registerRecipeVisibilityHandler(new DisplayVisibilityHandler() {
- @Override
- public DisplayVisibility handleDisplay(RecipeCategory<?> category, RecipeDisplay display) {
- return DisplayVisibility.ALWAYS_VISIBLE;
- }
-
- @Override
- public float getPriority() {
- return -1f;
- }
- });
}
@Override
diff --git a/src/main/java/me/shedaniel/rei/plugin/DefaultPotionEffectExclusionZones.java b/src/main/java/me/shedaniel/rei/plugin/DefaultPotionEffectExclusionZones.java
index 29b150e72..3ef514ea3 100644
--- a/src/main/java/me/shedaniel/rei/plugin/DefaultPotionEffectExclusionZones.java
+++ b/src/main/java/me/shedaniel/rei/plugin/DefaultPotionEffectExclusionZones.java
@@ -6,7 +6,6 @@
package me.shedaniel.rei.plugin;
import com.google.common.collect.Ordering;
-import me.shedaniel.rei.api.BaseBoundsHandler;
import me.shedaniel.rei.client.ScreenHelper;
import me.shedaniel.rei.listeners.AbstractInventoryScreenHooks;
import me.shedaniel.rei.listeners.ContainerScreenHooks;
@@ -19,10 +18,11 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import java.util.function.Function;
-public class DefaultPotionEffectExclusionZones implements BaseBoundsHandler.ExclusionZoneSupplier {
+public class DefaultPotionEffectExclusionZones implements Function<Boolean, List<Rectangle>> {
@Override
- public List<Rectangle> apply(boolean isOnRightSide) {
+ public List<Rectangle> apply(Boolean isOnRightSide) {
if (isOnRightSide || !(ScreenHelper.getLastContainerScreen() instanceof AbstractInventoryScreen) || !((AbstractInventoryScreenHooks) ScreenHelper.getLastContainerScreen()).rei_doesOffsetGuiForEffects())
return Collections.emptyList();
Collection<StatusEffectInstance> activePotionEffects = MinecraftClient.getInstance().player.getStatusEffects();
diff --git a/src/main/java/me/shedaniel/rei/plugin/DefaultRecipeBookExclusionZones.java b/src/main/java/me/shedaniel/rei/plugin/DefaultRecipeBookExclusionZones.java
index 35da5ef24..2e1a8e72d 100644
--- a/src/main/java/me/shedaniel/rei/plugin/DefaultRecipeBookExclusionZones.java
+++ b/src/main/java/me/shedaniel/rei/plugin/DefaultRecipeBookExclusionZones.java
@@ -17,16 +17,17 @@ import net.minecraft.container.CraftingContainer;
import java.awt.*;
import java.util.Collections;
import java.util.List;
+import java.util.function.Function;
-public class DefaultRecipeBookExclusionZones implements BaseBoundsHandler.ExclusionZoneSupplier {
+public class DefaultRecipeBookExclusionZones implements Function<Boolean, List<Rectangle>> {
@Override
- public List<Rectangle> apply(boolean isOnRightSide) {
+ public List<Rectangle> apply(Boolean isOnRightSide) {
if (isOnRightSide || !MinecraftClient.getInstance().player.getRecipeBook().isGuiOpen() || !(MinecraftClient.getInstance().currentScreen instanceof RecipeBookProvider) || !(ScreenHelper.getLastContainerScreen().getContainer() instanceof CraftingContainer))
return Collections.emptyList();
ContainerScreenHooks screenHooks = ScreenHelper.getLastContainerScreenHooks();
List<Rectangle> l = Lists.newArrayList(new Rectangle(screenHooks.rei_getContainerLeft() - 4 - 145, screenHooks.rei_getContainerTop(), 4 + 145 + 30, screenHooks.rei_getContainerHeight()));
- int size = ClientRecipeBook.getGroupsForContainer((CraftingContainer) ScreenHelper.getLastContainerScreen().getContainer()).size();
+ int size = ClientRecipeBook.getGroupsForContainer((CraftingContainer<?>) ScreenHelper.getLastContainerScreen().getContainer()).size();
if (size > 0)
l.add(new Rectangle(screenHooks.rei_getContainerLeft() - 4 - 145 - 30, screenHooks.rei_getContainerTop(), 30, size * 27));
return l;
diff --git a/src/main/java/me/shedaniel/rei/plugin/blasting/DefaultBlastingCategory.java b/src/main/java/me/shedaniel/rei/plugin/blasting/DefaultBlastingCategory.java
index 6afa52724..0a975151f 100644
--- a/src/main/java/me/shedaniel/rei/plugin/blasting/DefaultBlastingCategory.java
+++ b/src/main/java/me/shedaniel/rei/plugin/blasting/DefaultBlastingCategory.java
@@ -7,7 +7,6 @@ package me.shedaniel.rei.plugin.blasting;
import com.mojang.blaze3d.platform.GlStateManager;
import me.shedaniel.rei.api.RecipeCategory;
-import me.shedaniel.rei.api.Renderable;
import me.shedaniel.rei.api.Renderer;
import me.shedaniel.rei.gui.renderables.RecipeRenderer;
import me.shedaniel.rei.gui.widget.RecipeBaseWidget;
@@ -39,7 +38,7 @@ public class DefaultBlastingCategory implements RecipeCategory<DefaultBlastingDi
@Override
public Renderer getIcon() {
- return Renderable.fromItemStack(new ItemStack(Blocks.BLAST_FURNACE));
+ return Renderer.fromItemStack(new ItemStack(Blocks.BLAST_FURNACE));
}
@Override
@@ -49,7 +48,7 @@ public class DefaultBlastingCategory implements RecipeCategory<DefaultBlastingDi
@Override
public RecipeRenderer getSimpleRenderer(DefaultBlastingDisplay recipe) {
- return Renderable.fromRecipe(() -> Arrays.asList(recipe.getInput().get(0)), recipe::getOutput);
+ return Renderer.fromRecipe(() -> Arrays.asList(recipe.getInput().get(0)), recipe::getOutput);
}
@Override
diff --git a/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingCategory.java b/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingCategory.java
index 3d863b706..9d77ff2b0 100644
--- a/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingCategory.java
+++ b/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingCategory.java
@@ -7,7 +7,6 @@ package me.shedaniel.rei.plugin.brewing;
import com.mojang.blaze3d.platform.GlStateManager;
import me.shedaniel.rei.api.RecipeCategory;
-import me.shedaniel.rei.api.Renderable;
import me.shedaniel.rei.api.Renderer;
import me.shedaniel.rei.gui.widget.RecipeBaseWidget;
import me.shedaniel.rei.gui.widget.SlotWidget;
@@ -39,7 +38,7 @@ public class DefaultBrewingCategory implements RecipeCategory<DefaultBrewingDisp
@Override
public Renderer getIcon() {
- return Renderable.fromItemStack(new ItemStack(Blocks.BREWING_STAND));
+ return Renderer.fromItemStack(new ItemStack(Blocks.BREWING_STAND));
}
@Override
diff --git a/src/main/java/me/shedaniel/rei/plugin/campfire/DefaultCampfireCategory.java b/src/main/java/me/shedaniel/rei/plugin/campfire/DefaultCampfireCategory.java
index 02c525f9b..3053b7136 100644
--- a/src/main/java/me/shedaniel/rei/plugin/campfire/DefaultCampfireCategory.java
+++ b/src/main/java/me/shedaniel/rei/plugin/campfire/DefaultCampfireCategory.java
@@ -7,7 +7,6 @@ package me.shedaniel.rei.plugin.campfire;
import com.mojang.blaze3d.platform.GlStateManager;
import me.shedaniel.rei.api.RecipeCategory;
-import me.shedaniel.rei.api.Renderable;
import me.shedaniel.rei.api.Renderer;
import me.shedaniel.rei.gui.widget.RecipeBaseWidget;
import me.shedaniel.rei.gui.widget.SlotWidget;
@@ -36,7 +35,7 @@ public class DefaultCampfireCategory implements RecipeCategory<DefaultCampfireDi
@Override
public Renderer getIcon() {
- return Renderable.fromItemStack(new ItemStack(Blocks.CAMPFIRE));
+ return Renderer.fromItemStack(new ItemStack(Blocks.CAMPFIRE));
}
@Override
diff --git a/src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java b/src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java
index 79f85dd66..93ae4bce9 100644
--- a/src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java
+++ b/src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java
@@ -7,9 +7,7 @@ package me.shedaniel.rei.plugin.composting;
import com.google.common.collect.Lists;
import com.mojang.blaze3d.platform.GlStateManager;
-import me.shedaniel.rei.api.DisplaySettings;
import me.shedaniel.rei.api.RecipeCategory;
-import me.shedaniel.rei.api.Renderable;
import me.shedaniel.rei.api.Renderer;
import me.shedaniel.rei.gui.renderables.RecipeRenderer;
import me.shedaniel.rei.gui.widget.RecipeBaseWidget;
@@ -40,7 +38,7 @@ public class DefaultCompostingCategory implements RecipeCategory<DefaultComposti
@Override
public Renderer getIcon() {
- return Renderable.fromItemStack(new ItemStack(Blocks.COMPOSTER));
+ return Renderer.fromItemStack(new ItemStack(Blocks.COMPOSTER));
}
@Override
@@ -100,28 +98,12 @@ public class DefaultCompostingCategory implements RecipeCategory<DefaultComposti
}
@Override
- public DisplaySettings<DefaultCompostingDisplay> getDisplaySettings() {
- return new DisplaySettings<DefaultCompostingDisplay>() {
- @Override
- public int getDisplayHeight(RecipeCategory<?> recipeCategory) {
- return 140;
- }
-
- @Override
- public int getDisplayWidth(RecipeCategory<?> recipeCategory, DefaultCompostingDisplay display) {
- return 150;
- }
-
- @Override
- public int getMaximumRecipePerPage(RecipeCategory<?> recipeCategory) {
- return -1;
- }
-
- @Override
- public int getFixedRecipesPerPage() {
- return 1;
- }
- };
+ public int getDisplayHeight() {
+ return 140;
}
+ @Override
+ public int getFixedRecipesPerPage() {
+ return 1;
+ }
} \ No newline at end of file
diff --git a/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingCategory.java b/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingCategory.java
index 1b608436a..f63faf35e 100644
--- a/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingCategory.java
+++ b/src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingCategory.java
@@ -8,7 +8,6 @@ package me.shedaniel.rei.plugin.crafting;
import com.google.common.collect.Lists;
import com.mojang.blaze3d.platform.GlStateManager;
import me.shedaniel.rei.api.RecipeCategory;
-import me.shedaniel.rei.api.Renderable;
import me.shedaniel.rei.api.Renderer;
import me.shedaniel.rei.gui.widget.RecipeBaseWidget;
import me.shedaniel.rei.gui.widget.SlotWidget;
@@ -37,7 +36,7 @@ public class DefaultCraftingCategory implements RecipeCategory<DefaultCraftingDi
@Override
public Renderer getIcon() {
- return Renderable.fromItemStack(new ItemStack(Blocks.CRAFTING_TABLE));
+ return Renderer.fromItemStack(new ItemStack(Blocks.CRAFTING_TABLE));
}
@Override
diff --git a/src/main/java/me/shedaniel/rei/plugin/smelting/DefaultSmeltingCategory.java b/src/main/java/me/shedaniel/rei/plugin/smelting/DefaultSmeltingCategory.java
index cfd9c8719..eb4596e68 100644
--- a/src/main/java/me/shedaniel/rei/plugin/smelting/DefaultSmeltingCategory.java
+++ b/src/main/java/me/shedaniel/rei/plugin/smelting/DefaultSmeltingCategory.java
@@ -7,7 +7,6 @@ package me.shedaniel.rei.plugin.smelting;
import com.mojang.blaze3d.platform.GlStateManager;
import me.shedaniel.rei.api.RecipeCategory;
-import me.shedaniel.rei.api.Renderable;
import me.shedaniel.rei.api.Renderer;
import me.shedaniel.rei.gui.renderables.RecipeRenderer;
import me.shedaniel.rei.gui.widget.RecipeBaseWidget;
@@ -39,7 +38,7 @@ public class DefaultSmeltingCategory implements RecipeCategory<DefaultSmeltingDi
@Override
public Renderer getIcon() {
- return Renderable.fromItemStack(new ItemStack(Blocks.FURNACE));
+ return Renderer.fromItemStack(new ItemStack(Blocks.FURNACE));
}
@Override
@@ -49,7 +48,7 @@ public class DefaultSmeltingCategory implements RecipeCategory<DefaultSmeltingDi
@Override
public RecipeRenderer getSimpleRenderer(DefaultSmeltingDisplay recipe) {
- return Renderable.fromRecipe(() -> Arrays.asList(recipe.getInput().get(0)), recipe::getOutput);
+ return Renderer.fromRecipe(() -> Arrays.asList(recipe.getInput().get(0)), recipe::getOutput);
}
@Override
diff --git a/src/main/java/me/shedaniel/rei/plugin/smoking/DefaultSmokingCategory.java b/src/main/java/me/shedaniel/rei/plugin/smoking/DefaultSmokingCategory.java
index 3d654e3c8..9edba769d 100644
--- a/src/main/java/me/shedaniel/rei/plugin/smoking/DefaultSmokingCategory.java
+++ b/src/main/java/me/shedaniel/rei/plugin/smoking/DefaultSmokingCategory.java
@@ -7,7 +7,6 @@ package me.shedaniel.rei.plugin.smoking;
import com.mojang.blaze3d.platform.GlStateManager;
import me.shedaniel.rei.api.RecipeCategory;
-import me.shedaniel.rei.api.Renderable;
import me.shedaniel.rei.api.Renderer;
import me.shedaniel.rei.gui.renderables.RecipeRenderer;
import me.shedaniel.rei.gui.widget.RecipeBaseWidget;
@@ -39,7 +38,7 @@ public class DefaultSmokingCategory implements RecipeCategory<DefaultSmokingDisp
@Override
public Renderer getIcon() {
- return Renderable.fromItemStack(new ItemStack(Blocks.SMOKER));
+ return Renderer.fromItemStack(new ItemStack(Blocks.SMOKER));
}
@Override
@@ -49,7 +48,7 @@ public class DefaultSmokingCategory implements RecipeCategory<DefaultSmokingDisp
@Override
public RecipeRenderer getSimpleRenderer(DefaultSmokingDisplay recipe) {
- return Renderable.fromRecipe(() -> Arrays.asList(recipe.getInput().get(0)), recipe::getOutput);
+ return Renderer.fromRecipe(() -> Arrays.asList(recipe.getInput().get(0)), recipe::getOutput);
}
@Override
diff --git a/src/main/java/me/shedaniel/rei/plugin/stonecutting/DefaultStoneCuttingCategory.java b/src/main/java/me/shedaniel/rei/plugin/stonecutting/DefaultStoneCuttingCategory.java
index c38ceb3b8..d148e420e 100644
--- a/src/main/java/me/shedaniel/rei/plugin/stonecutting/DefaultStoneCuttingCategory.java
+++ b/src/main/java/me/shedaniel/rei/plugin/stonecutting/DefaultStoneCuttingCategory.java
@@ -6,9 +6,7 @@
package me.shedaniel.rei.plugin.stonecutting;
import com.mojang.blaze3d.platform.GlStateManager;
-import me.shedaniel.rei.api.DisplaySettings;
import me.shedaniel.rei.api.RecipeCategory;
-import me.shedaniel.rei.api.Renderable;
import me.shedaniel.rei.api.Renderer;
import me.shedaniel.rei.gui.widget.RecipeBaseWidget;
import me.shedaniel.rei.gui.widget.SlotWidget;
@@ -36,7 +34,7 @@ public class DefaultStoneCuttingCategory implements RecipeCategory<DefaultStoneC
@Override
public Renderer getIcon() {
- return Renderable.fromItemStack(new ItemStack(Blocks.STONECUTTER));
+ return Renderer.fromItemStack(new ItemStack(Blocks.STONECUTTER));
}
@Override
@@ -63,23 +61,8 @@ public class DefaultStoneCuttingCategory implements RecipeCategory<DefaultStoneC
}
@Override
- public DisplaySettings<DefaultStoneCuttingDisplay> getDisplaySettings() {
- return new DisplaySettings<DefaultStoneCuttingDisplay>() {
- @Override
- public int getDisplayHeight(RecipeCategory<?> category) {
- return 36;
- }
-
- @Override
- public int getDisplayWidth(RecipeCategory<?> category, DefaultStoneCuttingDisplay display) {
- return 150;
- }
-
- @Override
- public int getMaximumRecipePerPage(RecipeCategory<?> category) {
- return 99;
- }
- };
+ public int getDisplayHeight() {
+ return 36;
}
}