aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/plugin
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2020-01-20 22:00:51 +0800
committershedaniel <daniel@shedaniel.me>2020-01-20 22:00:51 +0800
commitc0b54fae494fcd8bba476eb0153c8689a85231cc (patch)
treef5b7266225093fa811e05e2f6dcf320c7e0ae146 /src/main/java/me/shedaniel/rei/plugin
parentc683eb4cf0b621c5ac176915e3aeea604cea26fd (diff)
downloadRoughlyEnoughItems-c0b54fae494fcd8bba476eb0153c8689a85231cc.tar.gz
RoughlyEnoughItems-c0b54fae494fcd8bba476eb0153c8689a85231cc.tar.bz2
RoughlyEnoughItems-c0b54fae494fcd8bba476eb0153c8689a85231cc.zip
Fix #246
Diffstat (limited to 'src/main/java/me/shedaniel/rei/plugin')
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java23
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java7
2 files changed, 27 insertions, 3 deletions
diff --git a/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java b/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java
index 0f04e72d0..00c383033 100644
--- a/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java
+++ b/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java
@@ -15,6 +15,9 @@ import me.shedaniel.rei.api.plugins.REIPluginV0;
import me.shedaniel.rei.gui.RecipeViewingScreen;
import me.shedaniel.rei.gui.VillagerRecipeViewingScreen;
import me.shedaniel.rei.gui.widget.CategoryBaseWidget;
+import me.shedaniel.rei.gui.widget.QueuedTooltip;
+import me.shedaniel.rei.impl.ClientHelperImpl;
+import me.shedaniel.rei.impl.RenderingEntry;
import me.shedaniel.rei.impl.ScreenHelper;
import me.shedaniel.rei.plugin.blasting.DefaultBlastingDisplay;
import me.shedaniel.rei.plugin.brewing.DefaultBrewingCategory;
@@ -55,6 +58,7 @@ import net.minecraft.recipe.*;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.registry.Registry;
+import org.jetbrains.annotations.Nullable;
import java.util.*;
@@ -138,6 +142,25 @@ public class DefaultPlugin implements REIPluginV0 {
if (!fluid.getDefaultState().isEmpty() && fluid.getDefaultState().isStill())
entryRegistry.registerEntry(EntryStack.create(fluid));
}
+ entryRegistry.registerEntry(new RenderingEntry() {
+ private Identifier id = new Identifier("roughlyenoughitems", "textures/gui/kirb.png");
+
+ @Override
+ public void render(Rectangle bounds, int mouseX, int mouseY, float delta) {
+ MinecraftClient.getInstance().getTextureManager().bindTexture(id);
+ innerBlit(bounds.x, bounds.getMaxX(), bounds.y, bounds.getMaxY(), getBlitOffset(), 0, 1, 0, 1);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return !((ClientHelperImpl) ClientHelper.getInstance()).ok.get();
+ }
+
+ @Override
+ public @Nullable QueuedTooltip getTooltip(int mouseX, int mouseY) {
+ return QueuedTooltip.create("Kibby");
+ }
+ });
}
@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 33a1a3e0d..362187861 100644
--- a/src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java
+++ b/src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java
@@ -75,8 +75,9 @@ public class DefaultCompostingCategory implements RecipeCategory<DefaultComposti
widgets.add(new RecipeBaseWidget(bounds) {
@Override
public void render(int mouseX, int mouseY, float partialTicks) {
+ fillGradient(getBounds().x, getBounds().y, getBounds().getMaxX(), getBounds().getMaxY(), getInnerColor(), getInnerColor());
MinecraftClient.getInstance().getTextureManager().bindTexture(DefaultPlugin.getDisplayTexture());
- this.blit(startingPoint.x, startingPoint.y, 28, 221, 55, 26);
+ this.blit(startingPoint.x, startingPoint.y + 3, 28, 221, 55, 26);
}
});
List<EntryStack> stacks = new LinkedList<>(recipeDisplaySupplier.get().getItemsByOrder());
@@ -92,10 +93,10 @@ public class DefaultCompostingCategory implements RecipeCategory<DefaultComposti
break;
}
}
- widgets.add(EntryWidget.create(bounds.getCenterX() - 72 + x * 18, bounds.y + y * 18).entry(entryStack));
+ widgets.add(EntryWidget.create(bounds.getCenterX() - 72 + x * 18, bounds.y + 3 + y * 18).entry(entryStack));
i++;
}
- widgets.add(EntryWidget.create(startingPoint.x + 34, startingPoint.y + 5).entries(recipeDisplaySupplier.get().getOutputEntries()).noBackground());
+ widgets.add(EntryWidget.create(startingPoint.x + 33, startingPoint.y + 8).entries(recipeDisplaySupplier.get().getOutputEntries()).noBackground());
return widgets;
}