Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,15 @@ public void render (TileEntity tileEntity, IDrawerGroup drawerGroup, int slot, f
GlStateManager.disableBlend();
GlStateManager.enableLighting();
}
}

private void renderQuad (BufferBuilder tessellator, int x, int y, int w, int h, int r, int g, int b, int a)
{
tessellator.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
tessellator.pos(x + 0, y + 0, 0).tex(0, 0).color(r, g, b, a).endVertex();
tessellator.pos(x + 0, y + h, 0).tex(0, 1).color(r, g, b, a).endVertex();
tessellator.pos(x + w, y + h, 0).tex(1, 1).color(r, g, b, a).endVertex();
tessellator.pos(x + w, y + 0, 0).tex(1, 0).color(r, g, b, a).endVertex();
Tessellator.getInstance().draw();
private void renderQuad (BufferBuilder tessellator, int x, int y, int w, int h, int r, int g, int b, int a)
{
tessellator.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
tessellator.pos(x + 0, y + 0, 0).tex(0, 0).color(r, g, b, a).endVertex();
tessellator.pos(x + 0, y + h, 0).tex(0, 1).color(r, g, b, a).endVertex();
tessellator.pos(x + w, y + h, 0).tex(1, 1).color(r, g, b, a).endVertex();
tessellator.pos(x + w, y + 0, 0).tex(1, 0).color(r, g, b, a).endVertex();
Tessellator.getInstance().draw();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
import mcp.mobius.waila.api.IWailaRegistrar;
import mcp.mobius.waila.api.impl.ConfigHandler;

import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
Expand All @@ -27,32 +29,23 @@
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.event.FMLInterModComms;
import net.minecraftforge.fml.relauncher.Side;

import javax.annotation.Nonnull;
import java.lang.reflect.Method;

import java.util.List;

public class Waila extends IntegrationModule
{
private static Class classConfigHandler;

private static Method methInstance;
private static Method methAddConfig;

@Override
public String getModID () {
return "waila";
}

@Override
public void init () throws Throwable {
classConfigHandler = Class.forName("mcp.mobius.waila.api.impl.ConfigHandler");

methInstance = classConfigHandler.getMethod("instance");
methAddConfig = classConfigHandler.getMethod("addConfig", String.class, String.class, String.class);

FMLInterModComms.sendMessage("waila", "register", StorageDrawers.SOURCE_PATH + "integration.Waila.registerProvider");
}

Expand All @@ -66,16 +59,10 @@ public static void registerProvider(IWailaRegistrar registrar) {
registrar.registerBodyProvider(provider, BlockDrawers.class);
registrar.registerStackProvider(provider, BlockDrawers.class);

try {
Object configHandler = methInstance.invoke(null);

methAddConfig.invoke(configHandler, StorageDrawers.MOD_NAME, "display.content", I18n.format("storageDrawers.waila.config.displayContents"), true);
methAddConfig.invoke(configHandler, StorageDrawers.MOD_NAME, "display.stacklimit", I18n.format("storageDrawers.waila.config.displayStackLimit"), true);
methAddConfig.invoke(configHandler, StorageDrawers.MOD_NAME, "display.status", I18n.format("storageDrawers.waila.config.displayStatus"), true);
}
catch (Exception e) {
// Oh well, we couldn't hook the waila config
StorageDrawers.log.error("Failed to hook the Waila Config. Could not add in custom Storage Drawers related configs.");
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
ConfigHandler.instance().addConfig(StorageDrawers.MOD_NAME, "display.content", I18n.format("storageDrawers.waila.config.displayContents"), true);
ConfigHandler.instance().addConfig(StorageDrawers.MOD_NAME, "display.stacklimit", I18n.format("storageDrawers.waila.config.displayStackLimit"), true);
ConfigHandler.instance().addConfig(StorageDrawers.MOD_NAME, "display.status", I18n.format("storageDrawers.waila.config.displayStatus"), true);
}
}

Expand Down