Skip to content

Commit

Permalink
Re-enable WAILA support
Browse files Browse the repository at this point in the history
  • Loading branch information
jaquadro committed Oct 21, 2020
1 parent e97b885 commit ace3b49
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,25 @@
import com.jaquadro.minecraft.storagedrawers.integration.jei.TemplateRecipeWrapper;
import mezz.jei.api.*;
import mezz.jei.api.ingredients.IModIngredientRegistration;
import mezz.jei.api.registration.IModIngredientRegistration;
import mezz.jei.api.registration.IRecipeRegistration;
import mezz.jei.api.registration.ISubtypeRegistration;
import mezz.jei.api.runtime.IJeiRuntime;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.oredict.OreDictionary;
import java.util.HashSet;
import java.util.Set;
@JEIPlugin
@JeiPlugin
public class JustEnoughItems extends IntegrationModule implements IModPlugin
{
private static final String MOD_ID = "JEI";
private static Set<ItemStack> pendingHide = new HashSet<ItemStack>();
private static IItemBlacklist blacklist;
//private static IItemBlacklist blacklist;
@Override
public String getModID () {
Expand All @@ -37,17 +42,12 @@ public void postInit () {
}
@Override
public void registerItemSubtypes (ISubtypeRegistry subtypeRegistry) {
}
@Override
public void registerIngredients (IModIngredientRegistration registry) {
public ResourceLocation getPluginUid () {
return null;
}
@Override
public void register (IModRegistry registry) {
public void registerRecipes (IRecipeRegistration registration) {
TemplateRecipeWrapper templateWrapper = new TemplateRecipeWrapper(new TemplateRecipe(), registry.getJeiHelpers());
TemplateRecipeHandler templateHandler = new TemplateRecipeHandler(templateWrapper);
Expand All @@ -60,11 +60,6 @@ public void register (IModRegistry registry) {
pendingHide.clear();
}
@Override
public void onRuntimeAvailable (IJeiRuntime jeiRuntime) {
}
private static void hideItem (ItemStack stack) {
blacklist.addItemToBlacklist(stack);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.jaquadro.minecraft.storagedrawers.integration;
/*

import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
import com.jaquadro.minecraft.storagedrawers.api.storage.EmptyDrawerAttributes;
import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawer;
Expand All @@ -14,6 +14,7 @@
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.IFormattableTextComponent;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TranslationTextComponent;
Expand Down Expand Up @@ -63,23 +64,26 @@ public void appendBody (List<ITextComponent> currenttip, IDataAccessor accessor,

ItemStack stack = drawer.getStoredItemPrototype();
if (!stack.isEmpty()) {
ITextComponent stackName = stack.getDisplayName();
IFormattableTextComponent stackName = new StringTextComponent("").append(stack.getDisplayName());

if (drawer.getStoredItemCount() == Integer.MAX_VALUE)
name = stackName.appendText("[\u221E]");
else if (drawer instanceof IFractionalDrawer && ((IFractionalDrawer) drawer).getConversionRate() > 1)
name = stackName.appendText(((i == 0) ? " [" : " [+") + ((IFractionalDrawer) drawer).getStoredItemRemainder() + "]");
if (drawer.getStoredItemCount() == Integer.MAX_VALUE) {
name = stackName.appendString("[\u221E]");
}
else if (drawer instanceof IFractionalDrawer && ((IFractionalDrawer) drawer).getConversionRate() > 1) {
String text = ((i == 0) ? " [" : " [+") + ((IFractionalDrawer) drawer).getStoredItemRemainder() + "]";
name = stackName.appendString(text);
}
else if (CommonConfig.INTEGRATION.wailaStackRemainder.get()) {
int stacks = drawer.getStoredItemCount() / drawer.getStoredItemStackSize();
int remainder = drawer.getStoredItemCount() - (stacks * drawer.getStoredItemStackSize());
if (stacks > 0 && remainder > 0)
name = stackName.appendText(" [" + stacks + "x" + drawer.getStoredItemStackSize() + " + " + remainder + "]");
name = stackName.appendString(" [" + stacks + "x" + drawer.getStoredItemStackSize() + " + " + remainder + "]");
else if (stacks > 0)
name = stackName.appendText(" [" + stacks + "x" + drawer.getStoredItemStackSize() + "]");
name = stackName.appendString(" [" + stacks + "x" + drawer.getStoredItemStackSize() + "]");
else
name = stackName.appendText(" [" + remainder + "]");
name = stackName.appendString(" [" + remainder + "]");
} else
name = stackName.appendText(" [" + drawer.getStoredItemCount() + "]");
name = stackName.appendString(" [" + drawer.getStoredItemCount() + "]");
}
currenttip.add(new TranslationTextComponent("tooltip.storagedrawers.waila.drawer", i + 1, name));
}
Expand Down Expand Up @@ -111,4 +115,3 @@ else if (stacks > 0)
}
}
}
*/

0 comments on commit ace3b49

Please sign in to comment.