mirror of
https://github.com/GTNewHorizons/waila.git
synced 2026-11-24 05:54:45 +00:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cef91a3ef4 | ||
|
|
9da2402851 | ||
|
|
3eaffb5812 | ||
|
|
643d1bfad2 | ||
|
|
ad6fd7290a | ||
|
|
7e012ff6c6 |
No files matched your search
@@ -8,7 +8,8 @@ public final class Constants {
|
||||
public static String BIND_WAILA_CFG = "key.wailaconfig";
|
||||
public static String BIND_WAILA_SHOW = "key.wailadisplay";
|
||||
|
||||
public static String CFG_NEI_SHOW = "options.inworld tooltips";
|
||||
public static String CFG_NEI_SHOW = "world.highlight_tips";
|
||||
public static String BIND_NEI_SHOW = "keys.world.highlight_tips";
|
||||
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import net.minecraft.item.Item;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.ItemInfo;
|
||||
import codechicken.nei.forge.GuiContainerManager;
|
||||
@@ -42,6 +43,9 @@ public class ProxyClient extends ProxyServer {
|
||||
|
||||
KeyBindingRegistry.registerKeyBinding(new ConfigKeyHandler());
|
||||
|
||||
// We mute the default keybind for displaying the tooltip
|
||||
NEIClientConfig.getSetting(Constants.BIND_NEI_SHOW).setIntValue(Keyboard.KEY_NONE);
|
||||
|
||||
//GuiContainerManager.addInputHandler(new TechTreeHandler());
|
||||
//API.addKeyBind(Constants.BIND_ENCH, "Display enchantements", Keyboard.KEY_RSHIFT);
|
||||
//API.addKeyBind(Constants.BIND_WIKI, "Display wiki", Keyboard.KEY_RSHIFT);
|
||||
|
||||
@@ -35,7 +35,7 @@ public class AppEngModule {
|
||||
return;
|
||||
}
|
||||
|
||||
mod_Waila.log.log(Level.WARNING, "Waila module AppEng succefully hooked.");
|
||||
mod_Waila.log.log(Level.INFO, "AppEng mod found.");
|
||||
ExternalModulesHandler.instance().addConfig("Applied Energetic", "appeng.monitorcontent", "Monitor's content");
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDAppEngMonitor(), TileStorageMonitor);
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@ public class BCModule {
|
||||
public static Class TileGenericPipe = null;
|
||||
public static Class TileEngine = null;
|
||||
|
||||
public static Method TileTank_GetTanks = null;
|
||||
public static Method IPowerReceptor_PowerRequest = null;
|
||||
public static Method TileTank_getTankInfo = null;
|
||||
//public static Method IPowerReceptor_PowerRequest = null;
|
||||
|
||||
public static void register(){
|
||||
try {
|
||||
@@ -34,8 +34,8 @@ public class BCModule {
|
||||
TileGenericPipe = Class.forName("buildcraft.transport.TileGenericPipe");
|
||||
TileEngine = Class.forName("buildcraft.energy.TileEngine");
|
||||
|
||||
TileTank_GetTanks = TileTank.getMethod("getTanks", ForgeDirection.class);
|
||||
IPowerReceptor_PowerRequest = IPowerReceptor.getMethod("powerRequest", ForgeDirection.class);
|
||||
TileTank_getTankInfo = TileTank.getMethod("getTankInfo", ForgeDirection.class);
|
||||
//IPowerReceptor_PowerRequest = IPowerReceptor.getMethod("powerRequest", ForgeDirection.class);
|
||||
|
||||
} catch (ClassNotFoundException e){
|
||||
mod_Waila.log.log(Level.WARNING, "[BC] Class not found. " + e);
|
||||
@@ -47,10 +47,10 @@ public class BCModule {
|
||||
|
||||
ExternalModulesHandler.instance().addConfig("Buildcraft", "bc.tankamount", "Liquid amount");
|
||||
ExternalModulesHandler.instance().addConfig("Buildcraft", "bc.tanktype", "Liquid type");
|
||||
ExternalModulesHandler.instance().addConfigRemote("Buildcraft", "bc.powerpipe", "Power pipes");
|
||||
//ExternalModulesHandler.instance().addConfigRemote("Buildcraft", "bc.powerpipe", "Power pipes");
|
||||
ExternalModulesHandler.instance().registerHeadProvider(new HUDHandlerBCTanks(), TileTank);
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerBCTanks(), TileTank);
|
||||
ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerBCPipes(), TileGenericPipe);
|
||||
//ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerBCPipes(), TileGenericPipe);
|
||||
//ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerBCEngine(), TileEngine);
|
||||
//ExternalModulesHandler.instance().registerBodyProvider(new HUDHandlerBCIPowerReceptor(), PipeTransportPower);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class HUDHandlerBCIPowerReceptor implements IWailaDataProvider {
|
||||
// }
|
||||
// currenttip.add(String.valueOf(powerRequest));
|
||||
|
||||
NBTTagCompound tag = accessor.getNBTData();
|
||||
// NBTTagCompound tag = accessor.getNBTData();
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package mcp.mobius.waila.addons.buildcraft;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.tools.Reflect;
|
||||
|
||||
public class HUDHandlerBCPipes implements IWailaDataProvider {
|
||||
@Override
|
||||
@@ -30,7 +32,8 @@ public class HUDHandlerBCPipes implements IWailaDataProvider {
|
||||
}
|
||||
|
||||
public boolean hasPartialKey(NBTTagCompound tag, String key){
|
||||
for (Object k : tag.tagMap.keySet())
|
||||
Map tagMap = (Map)Reflect.getFieldValue("net.minecraft.nbt.NBTTagCompound", "tagMap", tag);
|
||||
for (Object k : tagMap.keySet())
|
||||
if (((String)k).contains(key))
|
||||
return true;
|
||||
return false;
|
||||
@@ -38,7 +41,8 @@ public class HUDHandlerBCPipes implements IWailaDataProvider {
|
||||
|
||||
public double getPartialKeySum(NBTTagCompound tag, String key){
|
||||
double retVal = 0;
|
||||
for (Object k : tag.tagMap.keySet())
|
||||
Map tagMap = (Map)Reflect.getFieldValue("net.minecraft.nbt.NBTTagCompound", "tagMap", tag);
|
||||
for (Object k : tagMap.keySet())
|
||||
if (((String)k).contains(key))
|
||||
retVal += tag.getDouble((String)k);
|
||||
return retVal;
|
||||
|
||||
@@ -5,6 +5,9 @@ import java.util.logging.Level;
|
||||
|
||||
//import buildcraft.factory.TileTank;
|
||||
|
||||
|
||||
|
||||
|
||||
import mcp.mobius.waila.mod_Waila;
|
||||
import mcp.mobius.waila.addons.ConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
@@ -12,6 +15,9 @@ import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.liquids.ILiquidTank;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
|
||||
@@ -24,12 +30,13 @@ public class HUDHandlerBCTanks implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
ILiquidTank tank = this.getTank(accessor);
|
||||
LiquidStack stack = tank != null ? tank.getLiquid() : null;
|
||||
FluidTankInfo tank = this.getTank(accessor);
|
||||
FluidStack stack = tank != null ? tank.fluid : null;
|
||||
|
||||
|
||||
String name = currenttip.get(0);
|
||||
if (stack != null && ConfigHandler.instance().getConfig("bc.tanktype"))
|
||||
name = name + " (" + stack.asItemStack().getDisplayName() + ")";
|
||||
name = name + " (" + stack.getFluid().getName() + ")";
|
||||
else if (stack == null && ConfigHandler.instance().getConfig("bc.tanktype"))
|
||||
name = name + " <Empty>";
|
||||
currenttip.set(0, name);
|
||||
@@ -38,10 +45,10 @@ public class HUDHandlerBCTanks implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
ILiquidTank tank = this.getTank(accessor);
|
||||
LiquidStack stack = tank != null ? tank.getLiquid() : null;
|
||||
int liquidAmount = stack != null ? stack.amount:0;
|
||||
int capacity = tank != null ? tank.getCapacity() : 0;
|
||||
FluidTankInfo tank = this.getTank(accessor);
|
||||
FluidStack stack = tank != null ? tank.fluid : null;
|
||||
int liquidAmount = stack != null ? stack.amount:0;
|
||||
int capacity = tank != null ? tank.capacity : 0;
|
||||
|
||||
if (ConfigHandler.instance().getConfig("bc.tankamount"))
|
||||
currenttip.add(String.valueOf(liquidAmount) + "/" + String.valueOf(capacity) + " mB");
|
||||
@@ -49,10 +56,10 @@ public class HUDHandlerBCTanks implements IWailaDataProvider {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
public ILiquidTank getTank(IWailaDataAccessor accessor){
|
||||
ILiquidTank tank = null;
|
||||
public FluidTankInfo getTank(IWailaDataAccessor accessor){
|
||||
FluidTankInfo tank = null;
|
||||
try{
|
||||
tank = ((ILiquidTank[])BCModule.TileTank_GetTanks.invoke(BCModule.TileTank.cast(accessor.getTileEntity()), ForgeDirection.UNKNOWN))[0];
|
||||
tank = ((FluidTankInfo[])BCModule.TileTank_getTankInfo.invoke(BCModule.TileTank.cast(accessor.getTileEntity()), ForgeDirection.UNKNOWN))[0];
|
||||
} catch (Exception e){
|
||||
mod_Waila.log.log(Level.SEVERE, "[BC] Unhandled exception trying to access a tank for display !.\n" + String.valueOf(e));
|
||||
return null;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
|
||||
/* Mob spawner handler */
|
||||
if (blockID == mobSpawnerID && accessor.getTileEntity() instanceof TileEntityMobSpawner && config.getConfig("vanilla.spawntype")){
|
||||
String name = currenttip.get(0);
|
||||
String mobname = ((TileEntityMobSpawner)accessor.getTileEntity()).func_98049_a().getEntityNameToSpawn();
|
||||
String mobname = ((TileEntityMobSpawner)accessor.getTileEntity()).getSpawnerLogic().getEntityNameToSpawn();
|
||||
currenttip.set(0, String.format("%s (%s)", name, mobname));
|
||||
}
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.RenderEngine;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
|
||||
public abstract class BaseWidget implements IWidget {
|
||||
|
||||
@@ -20,7 +20,7 @@ public abstract class BaseWidget implements IWidget {
|
||||
protected int posX, posY, posZ;
|
||||
protected GuiScreen parent;
|
||||
protected FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;;
|
||||
protected RenderEngine renderEngine = Minecraft.getMinecraft().renderEngine;
|
||||
protected TextureManager renderEngine = Minecraft.getMinecraft().renderEngine;
|
||||
protected HashMap<String, IWidget> widgets = new HashMap<String, IWidget>();
|
||||
protected IWidget[] focusWidget = new IWidget[Mouse.getButtonCount()];
|
||||
protected IWidget mainFocusWidget = null;
|
||||
|
||||
@@ -4,7 +4,6 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.RenderEngine;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
|
||||
@@ -5,6 +5,7 @@ import org.lwjgl.opengl.GL11;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class Button2States extends GuiButton {
|
||||
|
||||
@@ -50,7 +51,11 @@ public class Button2States extends GuiButton {
|
||||
if (this.drawButton)
|
||||
{
|
||||
FontRenderer fontrenderer = par1Minecraft.fontRenderer;
|
||||
par1Minecraft.renderEngine.bindTexture("/gui/gui.png");
|
||||
|
||||
//DONE : Changed from v1.5.2 to 1.6.2 resource handling
|
||||
//par1Minecraft.renderEngine.bindTexture("/gui/gui.png");
|
||||
ResourceLocation guipng = new ResourceLocation("textures/gui/widgets.png");
|
||||
par1Minecraft.renderEngine.func_110577_a(guipng);
|
||||
|
||||
if (this.labelSize == -1)
|
||||
labelSize = fontrenderer.getStringWidth(this.label) + 5;
|
||||
|
||||
@@ -50,7 +50,7 @@ public class EnchantmentHandler implements IContainerInputHandler {
|
||||
|
||||
Enchantment[] enchants = null;
|
||||
if (stackover.getItem() == Item.book)
|
||||
enchants = Enchantment.field_92090_c;
|
||||
enchants = Enchantment.enchantmentsBookList;
|
||||
else
|
||||
enchants = Enchantment.enchantmentsList;
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ public class SummaryProviderDefault implements IWailaSummaryProvider {
|
||||
return material!=null?material.getEnchantability():null;
|
||||
}
|
||||
|
||||
public Integer getDamageVsEntity(ItemStack stack){
|
||||
public Float getDamageVsEntity(ItemStack stack){
|
||||
EnumToolMaterial material = this.getToolMaterial(stack);
|
||||
return material!=null?material.getDamageVsEntity():null;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ import cpw.mods.fml.common.network.NetworkMod;
|
||||
import cpw.mods.fml.common.registry.GameData;
|
||||
import cpw.mods.fml.common.registry.ItemData;
|
||||
|
||||
@Mod(modid="Waila", name="Waila", version="1.3.7_dev")
|
||||
@Mod(modid="Waila", name="Waila", version="1.3.8")
|
||||
@NetworkMod(channels = {"Waila"},clientSideRequired=false, serverSideRequired=false, connectionHandler = WailaConnectionHandler.class, packetHandler = WailaPacketHandler.class)
|
||||
|
||||
public class mod_Waila {
|
||||
|
||||
@@ -36,7 +36,7 @@ public class Packet0x01TERequest {
|
||||
|
||||
try{
|
||||
outputStream.writeByte(0x01);
|
||||
outputStream.writeInt(world.getWorldInfo().getDimension());
|
||||
outputStream.writeInt(world.provider.dimensionId);
|
||||
outputStream.writeInt(mop.blockX);
|
||||
outputStream.writeInt(mop.blockY);
|
||||
outputStream.writeInt(mop.blockZ);
|
||||
|
||||
Reference in new issue
Block a user