mirror of
https://github.com/GTNewHorizons/waila.git
synced 2026-11-15 17:44:46 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
677a74dad7 | ||
|
|
10219fd204 | ||
|
|
d14044c92e | ||
|
|
5c115d9af3 | ||
|
|
c0a119902a | ||
|
|
93485e1525 | ||
|
|
ceb94e3e2c | ||
|
|
8ea26bf073 | ||
|
|
2aabfdb64c | ||
|
|
a34460c159 | ||
|
|
1f3fd64a38 | ||
|
|
191a916896 | ||
|
|
ee1ed27a3a | ||
|
|
07b9d1bf92 | ||
|
|
e82729a113 | ||
|
|
c938ccf542 | ||
|
|
c2e8b44f2b | ||
|
|
c4e3537957 | ||
|
|
9bc1e79f64 | ||
|
|
bdebd737d6 | ||
|
|
9f04d3d029 | ||
|
|
ef3c4a9774 | ||
|
|
3b64d21335 | ||
|
|
72c91a3700 | ||
|
|
bf6d309038 | ||
|
|
5bb7f7221a | ||
|
|
6278e4d575 | ||
|
|
7a46d914db | ||
|
|
d30d8ba100 | ||
|
|
490a176446 | ||
|
|
453a8f50a7 |
No files matched your search
@@ -28,3 +28,4 @@ whitelist.json
|
||||
src/main/resources/mixins.*.json
|
||||
*.bat
|
||||
layout.json
|
||||
.DS_Store
|
||||
@@ -0,0 +1,13 @@
|
||||
# Waila
|
||||
|
||||
## Contribution
|
||||
|
||||
When forking this repository, make sure to uncheck the `Copy the master branch only` option.
|
||||
This will copy all tags to your fork, so the build system can detect the latest mod version.
|
||||
If you leave it checked, you won't be able to enter the world in a local client run because Waila [will think the mod is outdated](https://github.com/GTNewHorizons/waila/blob/master/src/main/java/mcp/mobius/waila/Waila.java#L133).
|
||||
|
||||
If you already forked the repository without tags, you can fetch them manually:
|
||||
```
|
||||
git remote add upstream https://github.com/GTNewHorizons/waila
|
||||
git fetch upstream --tags
|
||||
```
|
||||
+17
-1
@@ -1,7 +1,23 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
implementation('com.github.GTNewHorizons:NotEnoughItems:2.7.49-GTNH:dev')
|
||||
implementation('com.github.GTNewHorizons:NotEnoughItems:2.8.50-GTNH:dev')
|
||||
|
||||
shadowImplementation('au.com.bytecode:opencsv:2.4')
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.205:dev") { transitive = false }
|
||||
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:WAILAPlugins:0.7.2:dev") {
|
||||
exclude group: 'com.github.GTNewHorizons', module: 'waila'
|
||||
}
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:EnderCore:0.5.3:dev")
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:BuildCraft:7.1.48:dev")
|
||||
runtimeOnlyNonPublishable("curse.maven:cofh-lib-220333:2388748")
|
||||
runtimeOnlyNonPublishable("curse.maven:extrautils-225561:2264383")
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:OpenBlocks:1.12.4-GTNH:dev")
|
||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:Railcraft:9.17.12:dev")
|
||||
runtimeOnlyNonPublishable('curse.maven:thermal-foundation-222880:2388753')
|
||||
runtimeOnlyNonPublishable('curse.maven:thermal-expansion-69163:2388759')
|
||||
runtimeOnlyNonPublishable('curse.maven:thermal-dynamics-227443:2388756')
|
||||
implementation('curse.maven:cofh-core-69162:2388751')
|
||||
}
|
||||
+4
-2
@@ -96,7 +96,9 @@ usesMixinDebug = false
|
||||
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||
mixinPlugin =
|
||||
|
||||
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
||||
# Specify the package that contains all of your Mixins. The package must exist or
|
||||
# the build will fail. If you have a package property defined in your mixins.<modid>.json,
|
||||
# it must match with this or the build will fail.
|
||||
mixinsPackage =
|
||||
|
||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||
@@ -151,7 +153,7 @@ modrinthProjectId =
|
||||
# type can be one of [project, version],
|
||||
# and the name is the Modrinth project or version slug/id of the other mod.
|
||||
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
|
||||
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
|
||||
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
|
||||
modrinthRelations =
|
||||
|
||||
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.38'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.46'
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package mcp.mobius.waila;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -8,11 +7,7 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.FMLModContainer;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
@@ -69,18 +64,10 @@ public class Waila {
|
||||
|
||||
@EventHandler
|
||||
public void initialize(FMLInitializationEvent event) {
|
||||
try {
|
||||
Field eBus = FMLModContainer.class.getDeclaredField("eventBus");
|
||||
eBus.setAccessible(true);
|
||||
EventBus FMLbus = (EventBus) eBus.get(FMLCommonHandler.instance().findContainerFor(this));
|
||||
FMLbus.register(this);
|
||||
} catch (Throwable ignored) {}
|
||||
|
||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
|
||||
MinecraftForge.EVENT_BUS.register(new DecoratorRenderer());
|
||||
FMLCommonHandler.instance().bus().register(new KeyEvent());
|
||||
FMLCommonHandler.instance().bus().register(WailaTickHandler.instance());
|
||||
|
||||
FMLCommonHandler.instance().bus().register(new WailaTickHandler());
|
||||
}
|
||||
FMLCommonHandler.instance().bus().register(new NetworkHandler());
|
||||
}
|
||||
@@ -91,7 +78,7 @@ public class Waila {
|
||||
ModIdentification.init();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
@EventHandler
|
||||
public void loadComplete(FMLLoadCompleteEvent event) {
|
||||
proxy.registerMods();
|
||||
proxy.registerIMCs();
|
||||
|
||||
@@ -8,6 +8,7 @@ import org.apache.logging.log4j.Level;
|
||||
|
||||
import mcp.mobius.waila.Waila;
|
||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
import mcp.mobius.waila.utils.LoadedMods;
|
||||
|
||||
public class BCModule {
|
||||
|
||||
@@ -15,21 +16,26 @@ public class BCModule {
|
||||
public static Method TileTank_getTankInfo = null;
|
||||
|
||||
public static void register() {
|
||||
if (LoadedMods.WAILA_PLUGINS) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
TileTank = Class.forName("buildcraft.factory.TileTank");
|
||||
TileTank_getTankInfo = TileTank.getMethod("getTankInfo", ForgeDirection.class);
|
||||
|
||||
ModuleRegistrar.instance().addConfig("Buildcraft", "bc.tankamount");
|
||||
ModuleRegistrar.instance().addConfig("Buildcraft", "bc.tanktype");
|
||||
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerBCTanks(), TileTank);
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerBCTanks(), TileTank);
|
||||
|
||||
Waila.log.log(Level.INFO, "Buildcraft mod found.");
|
||||
} catch (ClassNotFoundException | NoSuchMethodException e) {
|
||||
Waila.log.log(Level.INFO, "[BC] Buildcraft mod not found.");
|
||||
return;
|
||||
}
|
||||
Waila.log.log(Level.INFO, "Buildcraft mod found.");
|
||||
|
||||
ModuleRegistrar.instance().addConfig("Buildcraft", "bc.tanktype");
|
||||
ModuleRegistrar.instance().addConfig("Buildcraft", "bc.tankamount");
|
||||
|
||||
TankFluidHandler tankFluidHandler = new TankFluidHandler();
|
||||
ModuleRegistrar.instance().registerHeadProvider(tankFluidHandler, TileTank);
|
||||
ModuleRegistrar.instance().registerBodyProvider(tankFluidHandler, TileTank);
|
||||
}
|
||||
|
||||
}
|
||||
+23
-8
@@ -19,8 +19,9 @@ import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
|
||||
public class HUDHandlerBCTanks implements IWailaDataProvider {
|
||||
public class TankFluidHandler implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
@@ -30,27 +31,41 @@ public class HUDHandlerBCTanks implements IWailaDataProvider {
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
|
||||
if (!ConfigHandler.instance().getConfig("bc.tanktype")) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
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.getFluid().getName() + ")";
|
||||
else if (stack == null && ConfigHandler.instance().getConfig("bc.tanktype"))
|
||||
name = name + " " + LangUtil.translateG("hud.msg.empty");
|
||||
currenttip.set(0, name);
|
||||
String fluidName = stack == null ? LangUtil.translateG("hud.msg.empty")
|
||||
: stack.getFluid().getLocalizedName(stack);
|
||||
|
||||
currenttip.set(0, name + " < " + fluidName + " >");
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
|
||||
if (!ConfigHandler.instance().getConfig("bc.tankamount")) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
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(liquidAmount + "/" + capacity + " mB");
|
||||
currenttip.add(
|
||||
String.format(
|
||||
"%s / %s %s",
|
||||
NumberFormatter.format(liquidAmount),
|
||||
NumberFormatter.format(capacity),
|
||||
ConfigHandler.instance().fluidUnit));
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
+10
-8
@@ -14,8 +14,10 @@ import net.minecraftforge.fluids.IFluidHandler;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
|
||||
public class HUDHandlerDrum implements IWailaDataProvider {
|
||||
public class DrumFluidHandler implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
@@ -34,18 +36,19 @@ public class HUDHandlerDrum implements IWailaDataProvider {
|
||||
|
||||
if (!config.getConfig("extrautilities.fluidamount")) return currenttip;
|
||||
|
||||
int amount = 0;
|
||||
|
||||
NBTTagCompound subtag = accessor.getNBTData().getCompoundTag("tank");
|
||||
if (subtag.hasKey("Amount")) amount = accessor.getNBTInteger(subtag, "Amount");
|
||||
|
||||
IFluidHandler handler = (IFluidHandler) accessor.getTileEntity();
|
||||
if (handler == null) return currenttip;
|
||||
|
||||
FluidTankInfo[] tanks = handler.getTankInfo(ForgeDirection.UNKNOWN);
|
||||
if (tanks.length != 1) return currenttip;
|
||||
|
||||
currenttip.add(String.format("%d / %d mB", amount, tanks[0].capacity));
|
||||
int amount = tanks[0].fluid == null ? 0 : tanks[0].fluid.amount;
|
||||
currenttip.add(
|
||||
String.format(
|
||||
"%s / %s %s",
|
||||
NumberFormatter.format(amount),
|
||||
NumberFormatter.format(tanks[0].capacity),
|
||||
ConfigHandler.instance().fluidUnit));
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
@@ -59,7 +62,6 @@ public class HUDHandlerDrum implements IWailaDataProvider {
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||
int y, int z) {
|
||||
if (te != null) te.writeToNBT(tag);
|
||||
return tag;
|
||||
}
|
||||
|
||||
@@ -4,30 +4,26 @@ import org.apache.logging.log4j.Level;
|
||||
|
||||
import mcp.mobius.waila.Waila;
|
||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
import mcp.mobius.waila.utils.LoadedMods;
|
||||
|
||||
public class ExtraUtilitiesModule {
|
||||
|
||||
public static Class<?> TileEntityDrum = null;
|
||||
|
||||
public static void register() {
|
||||
if (LoadedMods.WAILA_PLUGINS) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Class.forName("com.rwtema.extrautils.ExtraUtils");
|
||||
TileEntityDrum = Class.forName("com.rwtema.extrautils.tileentity.TileEntityDrum");
|
||||
Waila.log.log(Level.INFO, "ExtraUtilities mod found.");
|
||||
} catch (ClassNotFoundException e) {
|
||||
Waila.log.log(Level.INFO, "[ExtraUtilities] ExtraUtilities mod not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
TileEntityDrum = Class.forName("com.rwtema.extrautils.tileentity.TileEntityDrum");
|
||||
} catch (ClassNotFoundException e) {
|
||||
Waila.log.log(Level.WARN, "[ExtraUtilities] Class not found. " + e);
|
||||
return;
|
||||
}
|
||||
|
||||
ModuleRegistrar.instance().addConfigRemote("ExtraUtilities", "extrautilities.fluidamount");
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerDrum(), TileEntityDrum);
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerDrum(), TileEntityDrum);
|
||||
ModuleRegistrar.instance().registerBodyProvider(new DrumFluidHandler(), TileEntityDrum);
|
||||
}
|
||||
}
|
||||
@@ -4,30 +4,29 @@ import org.apache.logging.log4j.Level;
|
||||
|
||||
import mcp.mobius.waila.Waila;
|
||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
import mcp.mobius.waila.utils.LoadedMods;
|
||||
|
||||
public class OpenBlocksModule {
|
||||
|
||||
public static Class<?> TileEntityTank = null;
|
||||
|
||||
public static void register() {
|
||||
if (LoadedMods.WAILA_PLUGINS) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Class.forName("openblocks.OpenBlocks");
|
||||
TileEntityTank = Class.forName("openblocks.common.tileentity.TileEntityTank");
|
||||
Waila.log.log(Level.INFO, "OpenBlocks mod found.");
|
||||
} catch (ClassNotFoundException e) {
|
||||
Waila.log.log(Level.INFO, "[OpenBlocks] OpenBlocks mod not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
TileEntityTank = Class.forName("openblocks.common.tileentity.TileEntityTank");
|
||||
} catch (ClassNotFoundException e) {
|
||||
Waila.log.log(Level.WARN, "[OpenBlocks] Class not found. " + e);
|
||||
return;
|
||||
}
|
||||
|
||||
ModuleRegistrar.instance().addConfigRemote("OpenBlocks", "openblocks.fluidamount");
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTank(), TileEntityTank);
|
||||
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerTank(), TileEntityTank);
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerTank(), TileEntityTank);
|
||||
|
||||
TankFluidHandler tankFluidHandler = new TankFluidHandler();
|
||||
ModuleRegistrar.instance().registerBodyProvider(tankFluidHandler, TileEntityTank);
|
||||
ModuleRegistrar.instance().registerHeadProvider(tankFluidHandler, TileEntityTank);
|
||||
}
|
||||
}
|
||||
+13
-12
@@ -15,9 +15,11 @@ import net.minecraftforge.fluids.IFluidHandler;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
|
||||
public class HUDHandlerTank implements IWailaDataProvider {
|
||||
public class TankFluidHandler implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
@@ -37,14 +39,10 @@ public class HUDHandlerTank implements IWailaDataProvider {
|
||||
|
||||
FluidStack fluid = tanks[0].fluid;
|
||||
String name = currenttip.get(0);
|
||||
String fluidName = fluid == null ? LangUtil.translateG("hud.msg.empty")
|
||||
: fluid.getFluid().getLocalizedName(fluid);
|
||||
|
||||
try {
|
||||
name += String.format(" < %s >", fluid.getFluid().getLocalizedName(fluid));
|
||||
} catch (NullPointerException f) {
|
||||
name += " " + LangUtil.translateG("hud.msg.empty");
|
||||
}
|
||||
|
||||
currenttip.set(0, name);
|
||||
currenttip.set(0, name + " < " + fluidName + " >");
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
@@ -60,9 +58,13 @@ public class HUDHandlerTank implements IWailaDataProvider {
|
||||
FluidTankInfo[] tanks = handler.getTankInfo(ForgeDirection.UNKNOWN);
|
||||
if (tanks.length != 1) return currenttip;
|
||||
|
||||
if (tanks[0].fluid != null)
|
||||
currenttip.add(String.format("%d / %d mB", tanks[0].fluid.amount, tanks[0].capacity));
|
||||
else currenttip.add(String.format("0 / %d mB", tanks[0].capacity));
|
||||
int amount = tanks[0].fluid == null ? 0 : tanks[0].fluid.amount;
|
||||
currenttip.add(
|
||||
String.format(
|
||||
"%s / %s %s",
|
||||
NumberFormatter.format(amount),
|
||||
NumberFormatter.format(tanks[0].capacity),
|
||||
ConfigHandler.instance().fluidUnit));
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
@@ -76,7 +78,6 @@ public class HUDHandlerTank implements IWailaDataProvider {
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||
int y, int z) {
|
||||
if (te != null) te.writeToNBT(tag);
|
||||
return tag;
|
||||
}
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
package mcp.mobius.waila.addons.railcraft;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
||||
|
||||
public class HUDHandlerTank implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
if (!config.getConfig("railcraft.fluidamount")) return currenttip;
|
||||
try {
|
||||
IFluidTank tank = (IFluidTank) RailcraftModule.ITankTile_getTank
|
||||
.invoke(RailcraftModule.ITankTile.cast(accessor.getTileEntity()));
|
||||
if (tank == null) return currenttip;
|
||||
|
||||
FluidStack fluid = tank.getFluid();
|
||||
|
||||
String name = currenttip.get(0);
|
||||
|
||||
try {
|
||||
name += String.format(" < %s >", fluid.getFluid().getLocalizedName(fluid));
|
||||
} catch (NullPointerException f) {
|
||||
name += " " + LangUtil.translateG("hud.msg.empty");
|
||||
}
|
||||
|
||||
currenttip.set(0, name);
|
||||
|
||||
} catch (Exception e) {
|
||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
if (!config.getConfig("railcraft.fluidamount")) return currenttip;
|
||||
|
||||
try {
|
||||
IFluidTank tank = (IFluidTank) RailcraftModule.ITankTile_getTank
|
||||
.invoke(RailcraftModule.ITankTile.cast(accessor.getTileEntity()));
|
||||
if (tank == null) return currenttip;
|
||||
|
||||
FluidStack fluid = tank.getFluid();
|
||||
if (fluid != null) currenttip.add(String.format("%d / %d mB", fluid.amount, tank.getInfo().capacity));
|
||||
else currenttip.add(String.format("0 / %d mB", tank.getInfo().capacity));
|
||||
|
||||
} catch (Exception e) {
|
||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||
int y, int z) {
|
||||
if (te != null) te.writeToNBT(tag);
|
||||
return tag;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,43 +1,59 @@
|
||||
package mcp.mobius.waila.addons.railcraft;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import mcp.mobius.waila.Waila;
|
||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
import mcp.mobius.waila.utils.LoadedMods;
|
||||
|
||||
public class RailcraftModule {
|
||||
|
||||
public static Class<?> TileTankBase = null;
|
||||
public static Class<?> ITankTile = null;
|
||||
public static Method ITankTile_getTank = null;
|
||||
public static Method TileTankBase_getTank = null;
|
||||
|
||||
public static Class<?> StandardTank = null;
|
||||
public static Field StandardTank_capacity = null;
|
||||
public static Field StandardTank_renderData = null;
|
||||
|
||||
public static Field StandardTank_renderDataFluid = null;
|
||||
public static Field StandardTank_renderDataAmount = null;
|
||||
|
||||
public static void register() {
|
||||
try {
|
||||
Class.forName("mods.railcraft.common.core.Railcraft");
|
||||
Waila.log.log(Level.INFO, "Railcraft mod found.");
|
||||
} catch (ClassNotFoundException e) {
|
||||
Waila.log.log(Level.INFO, "[Railcraft] Railcraft mod not found.");
|
||||
if (LoadedMods.WAILA_PLUGINS) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
TileTankBase = Class.forName("mods.railcraft.common.blocks.machine.beta.TileTankBase");
|
||||
ITankTile = Class.forName("mods.railcraft.common.blocks.machine.ITankTile");
|
||||
ITankTile_getTank = ITankTile.getMethod("getTank");
|
||||
TileTankBase_getTank = TileTankBase.getMethod("getTank");
|
||||
|
||||
StandardTank = Class.forName("mods.railcraft.common.fluids.tanks.StandardTank");
|
||||
StandardTank_capacity = StandardTank.getSuperclass().getDeclaredField("capacity");
|
||||
StandardTank_capacity.setAccessible(true);
|
||||
StandardTank_renderData = StandardTank.getField("renderData");
|
||||
|
||||
StandardTank_renderDataFluid = StandardTank_renderData.getType().getField("fluid");
|
||||
StandardTank_renderDataAmount = StandardTank_renderData.getType().getField("amount");
|
||||
|
||||
Waila.log.log(Level.INFO, "Railcraft mod found.");
|
||||
} catch (ClassNotFoundException e) {
|
||||
Waila.log.log(Level.WARN, "[Railcraft] Class not found. " + e);
|
||||
return;
|
||||
} catch (NoSuchMethodException e) {
|
||||
Waila.log.log(Level.WARN, "[Railcraft] Method not found." + e);
|
||||
return;
|
||||
} catch (NoSuchFieldException e) {
|
||||
Waila.log.log(Level.WARN, "[Railcraft] Field not found." + e);
|
||||
return;
|
||||
}
|
||||
|
||||
ModuleRegistrar.instance().addConfigRemote("Railcraft", "railcraft.fluidamount");
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTank(), TileTankBase);
|
||||
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerTank(), TileTankBase);
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerTank(), TileTankBase);
|
||||
|
||||
TankFluidHandler tankFluidHandler = new TankFluidHandler();
|
||||
ModuleRegistrar.instance().registerHeadProvider(tankFluidHandler, TileTankBase);
|
||||
ModuleRegistrar.instance().registerBodyProvider(tankFluidHandler, TileTankBase);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package mcp.mobius.waila.addons.railcraft;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
||||
|
||||
public class TankFluidHandler implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
if (!config.getConfig("railcraft.fluidamount")) return currenttip;
|
||||
|
||||
IFluidTank tank = this.getTank(accessor.getTileEntity());
|
||||
if (tank == null) return currenttip;
|
||||
|
||||
FluidStack fluid = tank.getFluid();
|
||||
String name = currenttip.get(0);
|
||||
String fluidName = fluid == null ? LangUtil.translateG("hud.msg.empty")
|
||||
: fluid.getFluid().getLocalizedName(fluid);
|
||||
|
||||
currenttip.set(0, name + " < " + fluidName + " >");
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
if (!config.getConfig("railcraft.fluidamount")) return currenttip;
|
||||
|
||||
IFluidTank tank = this.getTank(accessor.getTileEntity());
|
||||
if (tank == null) return currenttip;
|
||||
|
||||
FluidStack fluid = tank.getFluid();
|
||||
int amount = fluid == null ? 0 : fluid.amount;
|
||||
|
||||
currenttip.add(
|
||||
String.format(
|
||||
"%s / %s %s",
|
||||
NumberFormatter.format(amount),
|
||||
NumberFormatter.format(tank.getCapacity()),
|
||||
ConfigHandler.instance().fluidUnit));
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||
int y, int z) {
|
||||
return tag;
|
||||
}
|
||||
|
||||
private FluidTank getTank(TileEntity tileEntity) {
|
||||
if (tileEntity == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
Object tank = RailcraftModule.TileTankBase_getTank.invoke(tileEntity);
|
||||
|
||||
int capacity = RailcraftModule.StandardTank_capacity.getInt(tank);
|
||||
Object renderData = RailcraftModule.StandardTank_renderData.get(tank);
|
||||
|
||||
Fluid fluid = (Fluid) RailcraftModule.StandardTank_renderDataFluid.get(renderData);
|
||||
int amount = RailcraftModule.StandardTank_renderDataAmount.getInt(renderData);
|
||||
|
||||
return new FluidTank(fluid, amount, capacity);
|
||||
} catch (Exception e) {
|
||||
WailaExceptionHandler.handleErr(e, tileEntity.getClass().getName(), null);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import net.minecraft.world.World;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.SpecialChars;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
|
||||
public class HUDHandlerIAspectContainer implements IWailaDataProvider {
|
||||
@@ -57,9 +58,10 @@ public class HUDHandlerIAspectContainer implements IWailaDataProvider {
|
||||
total += value;
|
||||
String amount = String.valueOf(value);
|
||||
|
||||
if (!aspect.equals("???"))
|
||||
currenttip.add(String.format("%s" + TAB + ALIGNRIGHT + WHITE + "%s", aspect, amount));
|
||||
else unknownAspects.add(String.format("%s" + TAB + ALIGNRIGHT + WHITE + "%s", aspect, amount));
|
||||
if (!aspect.equals("???")) currenttip.add(
|
||||
SpecialChars.getRenderString("waila.tcaspect", aspect) + TAB + ALIGNRIGHT + WHITE + amount);
|
||||
else unknownAspects.add(
|
||||
SpecialChars.getRenderString("waila.tcaspect", aspect) + TAB + ALIGNRIGHT + WHITE + amount);
|
||||
}
|
||||
|
||||
String id = tag.getString("WailaID");
|
||||
@@ -97,7 +99,7 @@ public class HUDHandlerIAspectContainer implements IWailaDataProvider {
|
||||
|
||||
ItemStack headSlot = player.inventory.armorInventory[3];
|
||||
if (headSlot == null) return tag;
|
||||
boolean hasReveal = ThaumcraftModule.IGoggles.isInstance(headSlot.getItem());
|
||||
boolean hasReveal = ThaumcraftModule.isGoggles.apply(headSlot);
|
||||
if (!hasReveal) return tag;
|
||||
|
||||
Map<String, ?> knownAspects = (Map<String, ?>) ThaumcraftModule.CommonProxy_getKnownAspects
|
||||
@@ -118,7 +120,7 @@ public class HUDHandlerIAspectContainer implements IWailaDataProvider {
|
||||
if (tileAspects.get(o) > 0) {
|
||||
if (playerAspects.containsKey(o)) {
|
||||
NBTTagCompound cmptag = new NBTTagCompound();
|
||||
cmptag.setString("key", (String) ThaumcraftModule.Aspect_getName.invoke(o));
|
||||
cmptag.setString("key", (String) ThaumcraftModule.Aspect_tag.get(o));
|
||||
cmptag.setInteger("value", tileAspects.get(o));
|
||||
aspects.appendTag(cmptag);
|
||||
} else {
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
package mcp.mobius.waila.addons.thaumcraft;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
@@ -28,12 +32,19 @@ public class ThaumcraftModule {
|
||||
public static Class<?> Aspect = null;
|
||||
public static Field Aspect_tag = null;
|
||||
public static Method Aspect_getName = null;
|
||||
public static Method Aspect_getAspect = null;
|
||||
public static Method Aspect_getImage = null;
|
||||
public static Method Aspect_getColor = null;
|
||||
|
||||
public static Class<?> CommonProxy = null;
|
||||
public static Method CommonProxy_getKnownAspects = null;
|
||||
|
||||
public static Class<?> IGoggles = null;
|
||||
|
||||
public static ResourceLocation unknownAspectTexture = null;
|
||||
public static Color unknownAspectColor = null;
|
||||
public static Function<ItemStack, Boolean> isGoggles = stack -> IGoggles.isInstance(stack.getItem());
|
||||
|
||||
public static void register() {
|
||||
try {
|
||||
Thaumcraft = Class.forName("thaumcraft.common.Thaumcraft");
|
||||
@@ -53,12 +64,18 @@ public class ThaumcraftModule {
|
||||
Aspect_tag = Aspect.getDeclaredField("tag");
|
||||
Aspect_tag.setAccessible(true);
|
||||
Aspect_getName = Aspect.getDeclaredMethod("getName");
|
||||
Aspect_getAspect = Aspect.getMethod("getAspect", java.lang.String.class);
|
||||
Aspect_getImage = Aspect.getDeclaredMethod("getImage");
|
||||
Aspect_getColor = Aspect.getDeclaredMethod("getColor");
|
||||
|
||||
CommonProxy = Class.forName("thaumcraft.common.CommonProxy");
|
||||
CommonProxy_getKnownAspects = CommonProxy.getDeclaredMethod("getKnownAspects");
|
||||
|
||||
IGoggles = Class.forName("thaumcraft.api.IGoggles");
|
||||
|
||||
unknownAspectTexture = new ResourceLocation("thaumcraft", "textures/aspects/_unknown.png");
|
||||
unknownAspectColor = new Color(0x654242);
|
||||
|
||||
ModuleRegistrar.instance().addConfigRemote("Thaumcraft", "thaumcraft.aspects");
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIAspectContainer(), IAspectContainer);
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIAspectContainer(), TileAlchemyFurnace);
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package mcp.mobius.waila.addons.thaumcraftGadomancy;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import mcp.mobius.waila.Waila;
|
||||
import mcp.mobius.waila.addons.thaumcraft.ThaumcraftModule;
|
||||
|
||||
public class GadomancyModule {
|
||||
|
||||
public static Class<?> RegisteredEnchantments = null;
|
||||
public static Field RegisteredEnchantments_revealer = null;
|
||||
|
||||
public static int revealerEffectId;
|
||||
|
||||
public static void register() {
|
||||
try {
|
||||
RegisteredEnchantments = Class.forName("makeo.gadomancy.common.registration.RegisteredEnchantments");
|
||||
RegisteredEnchantments_revealer = RegisteredEnchantments.getDeclaredField("revealer");
|
||||
Object revealer = RegisteredEnchantments_revealer.get(null);
|
||||
|
||||
revealerEffectId = ((Enchantment) revealer).effectId;
|
||||
|
||||
ThaumcraftModule.isGoggles = stack -> ThaumcraftModule.IGoggles.isInstance(stack.getItem())
|
||||
|| EnchantmentHelper.getEnchantmentLevel(revealerEffectId, stack) > 0;
|
||||
} catch (ClassNotFoundException e) {
|
||||
Waila.log.log(Level.INFO, "[Thaumcraft Gadomancy] Gadomancy mod not found.");
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
Waila.log.log(Level.WARN, "[Thaumcraft Gadomancy] Unhandled exception. {}", e);
|
||||
return;
|
||||
}
|
||||
Waila.log.log(Level.INFO, "Gadomancy mod found.");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package mcp.mobius.waila.addons.thermaldynamics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
|
||||
/**
|
||||
* Created by Lordmau5 on 28.02.2015.
|
||||
*/
|
||||
public class FluiductFluidHandler implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
|
||||
if (!config.getConfig("thermaldynamics.fluiductsFluid")) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
NBTTagCompound tag = accessor.getNBTData();
|
||||
FluidStack fluid = FluidStack.loadFluidStackFromNBT(tag.getCompoundTag("fluid"));
|
||||
int capacity = tag.getInteger("capacity");
|
||||
|
||||
if (capacity == 0) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
String name = currenttip.get(0);
|
||||
String fluidName = fluid == null ? LangUtil.translateG("hud.msg.empty")
|
||||
: fluid.getFluid().getLocalizedName(fluid);
|
||||
|
||||
currenttip.set(0, name + " < " + fluidName + " >");
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
|
||||
if (!config.getConfig("thermaldynamics.fluiductsAmount")) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
NBTTagCompound tag = accessor.getNBTData();
|
||||
FluidStack fluid = FluidStack.loadFluidStackFromNBT(tag.getCompoundTag("fluid"));
|
||||
int amount = fluid == null ? 0 : fluid.amount;
|
||||
int capacity = tag.getInteger("capacity");
|
||||
|
||||
if (capacity == 0) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
currenttip.add(
|
||||
String.format(
|
||||
"%s / %s %s",
|
||||
NumberFormatter.format(amount),
|
||||
NumberFormatter.format(capacity),
|
||||
ConfigHandler.instance().fluidUnit));
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||
int y, int z) {
|
||||
if (te instanceof IFluidHandler fluidHandler) {
|
||||
FluidTankInfo[] infos = fluidHandler.getTankInfo(ForgeDirection.UNKNOWN);
|
||||
if (infos.length != 1) {
|
||||
return tag;
|
||||
}
|
||||
|
||||
FluidTankInfo info = infos[0];
|
||||
|
||||
if (info.fluid != null) {
|
||||
NBTTagCompound fluidNBT = info.fluid.writeToNBT(new NBTTagCompound());
|
||||
tag.setTag("fluid", fluidNBT);
|
||||
}
|
||||
|
||||
tag.setInteger("capacity", info.capacity);
|
||||
}
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,31 +4,35 @@ import org.apache.logging.log4j.Level;
|
||||
|
||||
import mcp.mobius.waila.Waila;
|
||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
import mcp.mobius.waila.utils.LoadedMods;
|
||||
|
||||
public class ThermalDynamicsModule {
|
||||
|
||||
public static Class<?> TileFluidDuct = null;
|
||||
|
||||
public static void register() {
|
||||
// XXX : We register the Fluiduct
|
||||
try {
|
||||
TileFluidDuct = Class.forName("cofh.thermaldynamics.ducts.fluid.TileFluidDuct");
|
||||
|
||||
ModuleRegistrar.instance().addConfigRemote("Thermal Dynamics", "thermaldynamics.fluidDuctsFluid");
|
||||
ModuleRegistrar.instance().addConfigRemote("Thermal Dynamics", "thermaldynamics.fluidDuctsAmount");
|
||||
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerDuct(), TileFluidDuct);
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerDuct(), TileFluidDuct);
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerDuct(), TileFluidDuct);
|
||||
|
||||
} catch (Exception e) {
|
||||
if (e instanceof ClassNotFoundException) {
|
||||
Waila.log.log(Level.INFO, "[Thermal Dynamics] Thermal Dynamics mod not found.");
|
||||
} else {
|
||||
Waila.log.log(Level.WARN, "[Thermal Dynamics] Error while loading FluidDuct hooks. {}", e);
|
||||
}
|
||||
if (LoadedMods.WAILA_PLUGINS) {
|
||||
return;
|
||||
}
|
||||
Waila.log.log(Level.INFO, "Thermal Dynamics mod found.");
|
||||
|
||||
try {
|
||||
TileFluidDuct = Class.forName("cofh.thermaldynamics.duct.fluid.TileFluidDuct");
|
||||
Waila.log.log(Level.INFO, "Thermal Dynamics mod found.");
|
||||
} catch (ClassNotFoundException e) {
|
||||
Waila.log.log(Level.INFO, "[Thermal Dynamics] Thermal Dynamics mod not found.");
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
Waila.log.log(Level.WARN, "[Thermal Dynamics] Error while loading FluidDuct hooks. {}", e);
|
||||
return;
|
||||
}
|
||||
|
||||
ModuleRegistrar.instance().addConfigRemote("Thermal Dynamics", "thermaldynamics.fluidDuctsFluid");
|
||||
ModuleRegistrar.instance().addConfigRemote("Thermal Dynamics", "thermaldynamics.fluidDuctsAmount");
|
||||
|
||||
FluiductFluidHandler fluiductFluidHandler = new FluiductFluidHandler();
|
||||
ModuleRegistrar.instance().registerHeadProvider(fluiductFluidHandler, TileFluidDuct);
|
||||
ModuleRegistrar.instance().registerBodyProvider(fluiductFluidHandler, TileFluidDuct);
|
||||
ModuleRegistrar.instance().registerNBTProvider(fluiductFluidHandler, TileFluidDuct);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -40,14 +40,17 @@ public class HUDHandlerCache implements IWailaDataProvider {
|
||||
if (storedItem != null) {
|
||||
String namex = GameData.getItemRegistry().getNameForObject(storedItem.getItem());
|
||||
name += String.format(
|
||||
" < " + SpecialChars.getRenderString(
|
||||
" < %s %s >",
|
||||
SpecialChars.getRenderString(
|
||||
"waila.stack",
|
||||
"1",
|
||||
namex,
|
||||
"0",
|
||||
String.valueOf(storedItem.getItemDamage())) + color + " %s >",
|
||||
String.valueOf(storedItem.getItemDamage())) + color,
|
||||
storedItem.getDisplayName());
|
||||
} else name += " " + LangUtil.translateG("hud.msg.empty");
|
||||
} else {
|
||||
name += " < " + LangUtil.translateG("hud.msg.empty") + " >";
|
||||
}
|
||||
|
||||
currenttip.set(0, name);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -12,6 +12,7 @@ import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
|
||||
public class HUDHandlerEnergyCell implements IWailaDataProvider {
|
||||
|
||||
@@ -36,11 +37,11 @@ public class HUDHandlerEnergyCell implements IWailaDataProvider {
|
||||
|
||||
currenttip.add(
|
||||
String.format(
|
||||
"%s/%s : %d / %d RF/t",
|
||||
"%s/%s : %s / %s RF/t",
|
||||
LangUtil.translateG("hud.msg.in"),
|
||||
LangUtil.translateG("hud.msg.out"),
|
||||
energyReceive,
|
||||
energySend));
|
||||
NumberFormatter.format(energyReceive),
|
||||
NumberFormatter.format(energySend)));
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
+20
-8
@@ -13,7 +13,8 @@ import mcp.mobius.waila.api.ITaggedList;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
||||
import mcp.mobius.waila.api.SpecialChars;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
|
||||
public class HUDHandlerIEnergyHandler implements IWailaDataProvider {
|
||||
|
||||
@@ -34,15 +35,26 @@ public class HUDHandlerIEnergyHandler implements IWailaDataProvider {
|
||||
|
||||
if (!config.getConfig("thermalexpansion.energyhandler")) return currenttip;
|
||||
if (!accessor.getNBTData().hasKey("Energy")) return currenttip;
|
||||
if (!accessor.getNBTData().hasKey("MaxStorage")) return currenttip;
|
||||
|
||||
int energy = accessor.getNBTInteger(accessor.getNBTData(), "Energy");
|
||||
int maxEnergy = accessor.getNBTInteger(accessor.getNBTData(), "MaxStorage");
|
||||
try {
|
||||
if ((maxEnergy != 0) && (((ITaggedList) currenttip).getEntries("RFEnergyStorage").size() == 0)) {
|
||||
((ITaggedList) currenttip).add(String.format("%d / %d RF", energy, maxEnergy), "RFEnergyStorage");
|
||||
if (currenttip instanceof ITaggedList taggedTips) {
|
||||
int energy = accessor.getNBTInteger(accessor.getNBTData(), "Energy");
|
||||
int maxEnergy = accessor.getNBTInteger(accessor.getNBTData(), "MaxStorage");
|
||||
|
||||
if (maxEnergy > 0 && taggedTips.getEntries("RFEnergyStorage").isEmpty()) {
|
||||
if (config.getConfig("thermalexpansion.rfenergybar")) {
|
||||
taggedTips.add(
|
||||
SpecialChars.getRenderString("waila.rfenergy", energy + "", maxEnergy + ""),
|
||||
"RFEnergyStorage");
|
||||
} else {
|
||||
taggedTips.add(
|
||||
String.format(
|
||||
"%s / %s RF",
|
||||
NumberFormatter.format(energy),
|
||||
NumberFormatter.format(maxEnergy)),
|
||||
"RFEnergyStorage");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
package mcp.mobius.waila.addons.thermalexpansion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
||||
|
||||
public class HUDHandlerTank implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
if (!config.getConfig("thermalexpansion.fluidtype")) return currenttip;
|
||||
|
||||
try {
|
||||
FluidStack fluid = (FluidStack) ThermalExpansionModule.TileTank_getTankFluid
|
||||
.invoke(accessor.getTileEntity());
|
||||
String name = currenttip.get(0);
|
||||
|
||||
try {
|
||||
name += String.format(" < %s >", fluid.getFluid().getLocalizedName(fluid));
|
||||
} catch (NullPointerException f) {
|
||||
name += " " + LangUtil.translateG("hud.msg.empty");
|
||||
}
|
||||
|
||||
currenttip.set(0, name);
|
||||
|
||||
} catch (Exception e) {
|
||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||
}
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
try {
|
||||
if (config.getConfig("thermalexpansion.fluidamount")) {
|
||||
int amount = 0;
|
||||
if (accessor.getNBTData().hasKey("Amount"))
|
||||
amount = accessor.getNBTInteger(accessor.getNBTData(), "Amount");
|
||||
|
||||
Integer capacity = (Integer) ThermalExpansionModule.TileTank_getTankCapacity
|
||||
.invoke(accessor.getTileEntity());
|
||||
|
||||
currenttip.add(String.format("%d / %d mB", amount, capacity));
|
||||
}
|
||||
|
||||
if (config.getConfig("thermalexpansion.tankmode")) {
|
||||
Byte mode = (Byte) ThermalExpansionModule.TileTank_mode.get(accessor.getTileEntity());
|
||||
if (mode == 0) currenttip.add(
|
||||
String.format(
|
||||
"%s : \u00a7a%s",
|
||||
LangUtil.translateG("hud.msg.mode"),
|
||||
LangUtil.translateG("hud.msg.input")));
|
||||
else if (mode == 1) currenttip.add(
|
||||
String.format(
|
||||
"%s : \u00a7c%s",
|
||||
LangUtil.translateG("hud.msg.mode"),
|
||||
LangUtil.translateG("hud.msg.output")));
|
||||
else currenttip.add(String.format("Mode : Unknown (%d)", mode));
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
currenttip = WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||
int y, int z) {
|
||||
try {
|
||||
int amount = (Integer) ThermalExpansionModule.TileTank_getTankAmount.invoke(te);
|
||||
tag.setInteger("Amount", amount);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return tag;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.world.World;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.SpecialChars;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
|
||||
public class HUDHandlerTesseract implements IWailaDataProvider {
|
||||
@@ -33,9 +34,9 @@ public class HUDHandlerTesseract implements IWailaDataProvider {
|
||||
if (config.getConfig("thermalexpansion.tesssendrecv")) {
|
||||
String send = String.format("%s : ", LangUtil.translateG("hud.msg.send"));
|
||||
String recv = String.format("%s : ", LangUtil.translateG("hud.msg.recv"));
|
||||
String item = String.format("\u00a7a%s ", LangUtil.translateG("hud.msg.item"));
|
||||
String fluid = String.format("\u00a79%s ", LangUtil.translateG("hud.msg.fluid"));
|
||||
String energ = String.format("\u00a7c%s ", LangUtil.translateG("hud.msg.energ"));
|
||||
String item = String.format("%s ", SpecialChars.GREEN + LangUtil.translateG("hud.msg.item"));
|
||||
String fluid = String.format("%s ", SpecialChars.BLUE + LangUtil.translateG("hud.msg.fluid"));
|
||||
String energ = String.format("%s ", SpecialChars.RED + LangUtil.translateG("hud.msg.energ"));
|
||||
|
||||
switch (accessor.getNBTInteger(accessor.getNBTData(), "Item.Mode")) {
|
||||
case 0:
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
package mcp.mobius.waila.addons.thermalexpansion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
||||
|
||||
public class TankFluidHandler implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
|
||||
if (!config.getConfig("thermalexpansion.fluidtype")) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
TileEntity tileEntity = accessor.getTileEntity();
|
||||
if (tileEntity == null) return currenttip;
|
||||
|
||||
try {
|
||||
FluidStack fluid = (FluidStack) ThermalExpansionModule.TileTank_getTankFluid.invoke(tileEntity);
|
||||
String name = currenttip.get(0);
|
||||
String fluidName = fluid == null ? LangUtil.translateG("hud.msg.empty")
|
||||
: fluid.getFluid().getLocalizedName(fluid);
|
||||
|
||||
currenttip.set(0, name + " < " + fluidName + " >");
|
||||
|
||||
} catch (Exception e) {
|
||||
WailaExceptionHandler.handleErr(e, tileEntity.getClass().getName(), currenttip);
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
|
||||
if (!config.getConfig("thermalexpansion.fluidamount")) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
TileEntity tileEntity = accessor.getTileEntity();
|
||||
if (tileEntity == null) return currenttip;
|
||||
|
||||
try {
|
||||
int amount = (Integer) ThermalExpansionModule.TileTank_getTankAmount.invoke(tileEntity);
|
||||
int capacity = (Integer) ThermalExpansionModule.TileTank_getTankCapacity.invoke(tileEntity);
|
||||
|
||||
currenttip.add(
|
||||
String.format(
|
||||
"%s / %s %s",
|
||||
NumberFormatter.format(amount),
|
||||
NumberFormatter.format(capacity),
|
||||
ConfigHandler.instance().fluidUnit));
|
||||
|
||||
} catch (Exception e) {
|
||||
WailaExceptionHandler.handleErr(e, tileEntity.getClass().getName(), currenttip);
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||
int y, int z) {
|
||||
return tag;
|
||||
}
|
||||
|
||||
}
|
||||
+24
-27
@@ -1,4 +1,4 @@
|
||||
package mcp.mobius.waila.addons.thermaldynamics;
|
||||
package mcp.mobius.waila.addons.thermalexpansion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -7,17 +7,15 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.SpecialChars;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
||||
|
||||
/**
|
||||
* Created by Lordmau5 on 28.02.2015.
|
||||
*/
|
||||
public class HUDHandlerDuct implements IWailaDataProvider {
|
||||
public class TankModeHandler implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
@@ -27,33 +25,33 @@ public class HUDHandlerDuct implements IWailaDataProvider {
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
if (!config.getConfig("thermaldynamics.fluiductsFluid")) return currenttip;
|
||||
|
||||
FluidStack fluid = FluidStack.loadFluidStackFromNBT(accessor.getNBTData());
|
||||
|
||||
String name = "";
|
||||
|
||||
try {
|
||||
name += String.format(" < %s >", fluid.getFluid().getLocalizedName(fluid));
|
||||
} catch (NullPointerException f) {
|
||||
name += " " + LangUtil.translateG("hud.msg.empty");
|
||||
}
|
||||
|
||||
currenttip.add(name);
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
if (!config.getConfig("thermaldynamics.fluiductsAmount")) return currenttip;
|
||||
try {
|
||||
if (config.getConfig("thermalexpansion.tankmode")) {
|
||||
Byte mode = (Byte) ThermalExpansionModule.TileTank_mode.get(accessor.getTileEntity());
|
||||
if (mode == 0) {
|
||||
currenttip.add(
|
||||
String.format(
|
||||
"%s : %s",
|
||||
LangUtil.translateG("hud.msg.mode"),
|
||||
SpecialChars.GREEN + LangUtil.translateG("hud.msg.input")));
|
||||
} else if (mode == 1) {
|
||||
currenttip.add(
|
||||
String.format(
|
||||
"%s : %s",
|
||||
LangUtil.translateG("hud.msg.mode"),
|
||||
SpecialChars.RED + LangUtil.translateG("hud.msg.output")));
|
||||
}
|
||||
}
|
||||
|
||||
int amount = 0;
|
||||
|
||||
NBTTagCompound tag = accessor.getNBTData();
|
||||
if (tag.hasKey("Amount")) amount = accessor.getNBTInteger(tag, "Amount");
|
||||
|
||||
currenttip.add(String.format(" %d / 1000 mB", amount));
|
||||
} catch (Exception e) {
|
||||
WailaExceptionHandler.handleErr(e, accessor.getTileEntity().getClass().getName(), currenttip);
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
@@ -67,7 +65,6 @@ public class HUDHandlerDuct implements IWailaDataProvider {
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||
int y, int z) {
|
||||
if (te != null) te.writeToNBT(tag);
|
||||
return tag;
|
||||
}
|
||||
|
||||
+52
-55
@@ -9,6 +9,7 @@ import org.apache.logging.log4j.Level;
|
||||
|
||||
import mcp.mobius.waila.Waila;
|
||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
import mcp.mobius.waila.utils.LoadedMods;
|
||||
|
||||
public class ThermalExpansionModule {
|
||||
|
||||
@@ -67,6 +68,7 @@ public class ThermalExpansionModule {
|
||||
IEnergyInfo_getCurStorage = IEnergyInfo.getMethod("getInfoEnergyStored");
|
||||
|
||||
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energyhandler");
|
||||
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.rfenergybar");
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIEnergyHandler(), IEnergyProvider);
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerIEnergyHandler(), IEnergyProvider);
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIEnergyHandler(), IEnergyReceiver);
|
||||
@@ -74,13 +76,11 @@ public class ThermalExpansionModule {
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIEnergyHandler(), IEnergyInfo);
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerIEnergyHandler(), IEnergyInfo);
|
||||
|
||||
} catch (ClassNotFoundException e) {
|
||||
Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found.");
|
||||
printedThermalExpansionNotFound = true;
|
||||
} catch (Exception e) {
|
||||
if (e instanceof ClassNotFoundException) {
|
||||
Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found.");
|
||||
printedThermalExpansionNotFound = true;
|
||||
} else {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Energy hooks. {}", e);
|
||||
}
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Energy hooks. {}", e);
|
||||
}
|
||||
|
||||
// XXX : We register the energy cell
|
||||
@@ -93,41 +93,43 @@ public class ThermalExpansionModule {
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerEnergyCell(), TileEnergyCell);
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerEnergyCell(), TileEnergyCell);
|
||||
|
||||
} catch (Exception e) {
|
||||
if (e instanceof ClassNotFoundException || e instanceof NoSuchFieldException) {
|
||||
if (!printedThermalExpansionNotFound) {
|
||||
printedThermalExpansionNotFound = true;
|
||||
Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found.");
|
||||
}
|
||||
} else {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Energy Cell hooks. {}", e);
|
||||
} catch (ClassNotFoundException e) {
|
||||
if (!printedThermalExpansionNotFound) {
|
||||
printedThermalExpansionNotFound = true;
|
||||
Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found.");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Energy Cell hooks. {}", e);
|
||||
}
|
||||
|
||||
// XXX : We register the Tank interface
|
||||
try {
|
||||
TileTank = Class.forName("cofh.thermalexpansion.block.tank.TileTank");
|
||||
TileTank_getTankFluid = TileTank.getMethod("getTankFluid");
|
||||
TileTank_getTankCapacity = TileTank.getMethod("getTankCapacity");
|
||||
TileTank_getTankAmount = TileTank.getMethod("getTankFluidAmount");
|
||||
TileTank_mode = TileTank.getField("mode");
|
||||
|
||||
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.fluidtype");
|
||||
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.fluidamount");
|
||||
ModuleRegistrar.instance().addConfig("Thermal Expansion", "thermalexpansion.tankmode");
|
||||
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerTank(), TileTank);
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTank(), TileTank);
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerTank(), TileTank);
|
||||
if (!LoadedMods.WAILA_PLUGINS) {
|
||||
TileTank_getTankFluid = TileTank.getMethod("getTankFluid");
|
||||
TileTank_getTankCapacity = TileTank.getMethod("getTankCapacity");
|
||||
TileTank_getTankAmount = TileTank.getMethod("getTankFluidAmount");
|
||||
|
||||
} catch (Exception e) {
|
||||
if (e instanceof ClassNotFoundException || e instanceof NoSuchFieldException) {
|
||||
if (!printedThermalExpansionNotFound) {
|
||||
printedThermalExpansionNotFound = true;
|
||||
Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found.");
|
||||
}
|
||||
} else {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tank hooks. {}", e);
|
||||
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.fluidtype");
|
||||
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.fluidamount");
|
||||
|
||||
TankFluidHandler tankFluidHandler = new TankFluidHandler();
|
||||
ModuleRegistrar.instance().registerHeadProvider(tankFluidHandler, TileTank);
|
||||
ModuleRegistrar.instance().registerBodyProvider(tankFluidHandler, TileTank);
|
||||
}
|
||||
|
||||
ModuleRegistrar.instance().addConfig("Thermal Expansion", "thermalexpansion.tankmode");
|
||||
ModuleRegistrar.instance().registerBodyProvider(new TankModeHandler(), TileTank);
|
||||
|
||||
} catch (ClassNotFoundException e) {
|
||||
if (!printedThermalExpansionNotFound) {
|
||||
printedThermalExpansionNotFound = true;
|
||||
Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found.");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tank hooks. {}", e);
|
||||
}
|
||||
|
||||
// XXX : We register the Tesseract interface
|
||||
@@ -142,15 +144,13 @@ public class ThermalExpansionModule {
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerTesseract(), TileTesseract);
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerTesseract(), TileTesseract);
|
||||
|
||||
} catch (Exception e) {
|
||||
if (e instanceof ClassNotFoundException || e instanceof NoSuchFieldException) {
|
||||
if (!printedThermalExpansionNotFound) {
|
||||
printedThermalExpansionNotFound = true;
|
||||
Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found.");
|
||||
}
|
||||
} else {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tesseract hooks. {}", e);
|
||||
} catch (ClassNotFoundException e) {
|
||||
if (!printedThermalExpansionNotFound) {
|
||||
printedThermalExpansionNotFound = true;
|
||||
Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found.");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tesseract hooks. {}", e);
|
||||
}
|
||||
|
||||
// XXX : We register the ISecureTile interface
|
||||
@@ -163,15 +163,13 @@ public class ThermalExpansionModule {
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerISecureTile(), ISecureTile);
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerISecureTile(), ISecureTile);
|
||||
|
||||
} catch (Exception e) {
|
||||
if (e instanceof ClassNotFoundException) {
|
||||
if (!printedThermalExpansionNotFound) {
|
||||
printedThermalExpansionNotFound = true;
|
||||
Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found.");
|
||||
}
|
||||
} else {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading ISecureTile hooks. {}", e);
|
||||
} catch (ClassNotFoundException e) {
|
||||
if (!printedThermalExpansionNotFound) {
|
||||
printedThermalExpansionNotFound = true;
|
||||
Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found.");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading ISecureTile hooks. {}", e);
|
||||
}
|
||||
|
||||
// XXX : We register the Cache interface
|
||||
@@ -186,16 +184,15 @@ public class ThermalExpansionModule {
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerCache(), TileCache);
|
||||
ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerCache(), TileCache);
|
||||
|
||||
} catch (Exception e) {
|
||||
if (e instanceof ClassNotFoundException) {
|
||||
if (!printedThermalExpansionNotFound) {
|
||||
printedThermalExpansionNotFound = true;
|
||||
Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found.");
|
||||
}
|
||||
} else {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tesseract hooks. {}", e);
|
||||
} catch (ClassNotFoundException e) {
|
||||
if (!printedThermalExpansionNotFound) {
|
||||
printedThermalExpansionNotFound = true;
|
||||
Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found.");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tesseract hooks. {}", e);
|
||||
}
|
||||
|
||||
if (!printedThermalExpansionNotFound) {
|
||||
Waila.log.log(Level.INFO, "Thermal Expansion mod found.");
|
||||
}
|
||||
|
||||
@@ -62,6 +62,35 @@ public interface IWailaDataProvider {
|
||||
List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config);
|
||||
|
||||
/**
|
||||
* Callback used to determine if there is extended information to display for the Body section. If this returns
|
||||
* true, Waila will either display the "Hold <KEY> for more info" prompt or call getWailaAdvancedBody if the key is
|
||||
* being held.
|
||||
*
|
||||
* @param itemStack Current block scanned, in ItemStack form.
|
||||
* @param accessor Contains most of the relevant information about the current environment.
|
||||
* @param config Current configuration of Waila.
|
||||
* @return True if advanced body information is available, false otherwise.
|
||||
*/
|
||||
default boolean hasWailaAdvancedBody(ItemStack itemStack, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return false; // Default to false for backward compatibility
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback used to add the extended lines to the Body section of the tooltip. This method is ONLY called if
|
||||
* hasAdvancedBody returns true AND the player is holding the configured key for advanced tooltips.
|
||||
*
|
||||
* @param itemStack Current block scanned, in ItemStack form.
|
||||
* @param currenttip The current list of tooltip lines, including the normal body.
|
||||
* @param accessor Contains most of the relevant information about the current environment.
|
||||
* @param config Current configuration of Waila.
|
||||
* @return Modified input currenttip with advanced information appended.
|
||||
*/
|
||||
default List<String> getWailaAdvancedBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
return currenttip; // Default to returning the unmodified list
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
|
||||
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerTailProvider}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package mcp.mobius.waila.api;
|
||||
|
||||
import java.awt.Dimension;
|
||||
|
||||
/**
|
||||
* Interface for tooltip renderers that adjust their width depending on the width of the rest of the tooltip.
|
||||
* setMaxLineWidth is called by {@link mcp.mobius.waila.overlay.Tooltip} before every tooltip render to inform the
|
||||
* renderer of the width of the longest line in the tooltip.
|
||||
*/
|
||||
public interface IWailaVariableWidthTooltipRenderer extends IWailaTooltipRenderer {
|
||||
|
||||
/**
|
||||
* Return the size of the tooltip. for variable width renderers it is recommended to return the minimum width needed
|
||||
* for the line, then draw the actual width using getMaxLineWidth(). They do not need to actually match.
|
||||
*
|
||||
* @param params Array of string parameters as passed to the RENDER arg in the tooltip
|
||||
* ({rendername,param1,param2,...})
|
||||
* @param accessor A global accessor for TileEntities and Entities
|
||||
* @return Dimension of the reserved area
|
||||
*/
|
||||
Dimension getSize(String[] params, IWailaCommonAccessor accessor);
|
||||
|
||||
/**
|
||||
* Informs the renderer of what the length of the longest line is.</br>
|
||||
* Called by {@link mcp.mobius.waila.overlay.Tooltip} before every tooltip render.</br>
|
||||
*
|
||||
* @param width The width of the longest line in the tooltip.
|
||||
*
|
||||
*/
|
||||
void setMaxLineWidth(int width);
|
||||
|
||||
/**
|
||||
* Returns the width of the longest line in the current tooltip.</br>
|
||||
* With icons disabled the tooltip's background box is always 2 pixels wider to the right of the line than it is to
|
||||
* the left.</br>
|
||||
*
|
||||
* @return The width of the longest line in the tooltip
|
||||
*
|
||||
*/
|
||||
int getMaxLineWidth();
|
||||
|
||||
}
|
||||
@@ -33,6 +33,7 @@ public class SpecialChars {
|
||||
public static String WailaStyle = "\u00A4";
|
||||
public static String WailaIcon = "\u00A5";
|
||||
public static String WailaRenderer = "\u00A6";
|
||||
public static String WailaRendererComma = "\u0082";
|
||||
public static String TAB = WailaStyle + WailaStyle + "a";
|
||||
public static String ALIGNRIGHT = WailaStyle + WailaStyle + "b";
|
||||
public static String ALIGNCENTER = WailaStyle + WailaStyle + "c";
|
||||
@@ -43,12 +44,19 @@ public class SpecialChars {
|
||||
|
||||
public static final Pattern patternMinecraft = Pattern.compile("(?i)" + MCStyle + "[0-9A-FK-OR]");
|
||||
public static final Pattern patternWaila = Pattern.compile("(?i)(" + WailaStyle + "(?<type>..))");
|
||||
public static final Pattern patternRender = Pattern
|
||||
.compile("(?i)(" + RENDER + "\\{(?<name>[^,}]*),?(?<args>[^}]*)\\})");
|
||||
// (?i)(¤¦a\{(?<name>[^U+0082}]*)U+0082?(?<args>[^}]*)\})
|
||||
public static final Pattern patternRender = Pattern.compile(
|
||||
"(?i)(" + RENDER
|
||||
+ "\\{(?<name>[^"
|
||||
+ WailaRendererComma
|
||||
+ "}]*)"
|
||||
+ WailaRendererComma
|
||||
+ "?(?<args>[^}]*)\\})");
|
||||
public static final Pattern patternTab = Pattern.compile("(?i)" + TAB);
|
||||
public static final Pattern patternRight = Pattern.compile("(?i)" + ALIGNRIGHT);
|
||||
public static final Pattern patternCenter = Pattern.compile("(?i)" + ALIGNCENTER);
|
||||
public static final Pattern patternIcon = Pattern.compile("(?i)(" + WailaStyle + WailaIcon + "(?<type>[0-9a-z]))");
|
||||
// (?i)(¤¤[^¤]+|¤¥[0-9A-Z]|¤¦a\{(?<name>[^U+0082}]*)U+0082?(?<args>[^}]*)\}|[^¤]+)
|
||||
public static final Pattern patternLineSplit = Pattern.compile(
|
||||
"(?i)(" + WailaStyle
|
||||
+ WailaStyle
|
||||
@@ -60,7 +68,11 @@ public class SpecialChars {
|
||||
+ "[0-9A-Z]|"
|
||||
+ WailaStyle
|
||||
+ WailaRenderer
|
||||
+ "a\\{([^,}]*),?([^}]*)\\}|[^"
|
||||
+ "a\\{(?<name>[^"
|
||||
+ WailaRendererComma
|
||||
+ "}]*)"
|
||||
+ WailaRendererComma
|
||||
+ "?(?<args>[^}]*)\\}|[^"
|
||||
+ WailaStyle
|
||||
+ "]+)");
|
||||
|
||||
@@ -71,7 +83,7 @@ public class SpecialChars {
|
||||
public static String getRenderString(String name, String... params) {
|
||||
StringBuilder result = new StringBuilder(RENDER + "{" + name);
|
||||
for (String s : params) {
|
||||
result.append(",").append(s);
|
||||
result.append(WailaRendererComma).append(s);
|
||||
}
|
||||
result.append("}");
|
||||
return result.toString();
|
||||
|
||||
@@ -34,6 +34,8 @@ public class ConfigHandler implements IWailaConfigHandler {
|
||||
public HashMap<String, Boolean> forcedConfigs = new HashMap<>();
|
||||
public Configuration config = null;
|
||||
|
||||
public String fluidUnit;
|
||||
|
||||
public void addModule(String modName, HashMap<String, String> options) {
|
||||
this.addModule(modName, new ConfigModule(modName, options));
|
||||
}
|
||||
@@ -134,6 +136,10 @@ public class ConfigHandler implements IWailaConfigHandler {
|
||||
return getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, true);
|
||||
}
|
||||
|
||||
public boolean showIcon() {
|
||||
return getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOWICON, true);
|
||||
}
|
||||
|
||||
/* Default config loading */
|
||||
|
||||
public void loadDefaultConfig(FMLPreInitializationEvent event) {
|
||||
@@ -145,6 +151,8 @@ public class ConfigHandler implements IWailaConfigHandler {
|
||||
config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_METADATA, false);
|
||||
config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_KEYBIND, true);
|
||||
config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_NEWFILTERS, true);
|
||||
config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOWICON, true);
|
||||
fluidUnit = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_FLUIDUNIT, "mB").getString();
|
||||
|
||||
OverlayConfig.posX = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_POSX, 5000).getInt();
|
||||
OverlayConfig.posY = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_POSY, 100).getInt();
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -17,7 +18,9 @@ import mcp.mobius.waila.Waila;
|
||||
import mcp.mobius.waila.api.IWailaBlock;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.IWailaEntityProvider;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.cbcore.Layout;
|
||||
import mcp.mobius.waila.client.KeyEvent;
|
||||
import mcp.mobius.waila.network.Message0x01TERequest;
|
||||
import mcp.mobius.waila.network.Message0x03EntRequest;
|
||||
import mcp.mobius.waila.network.WailaPacketHandler;
|
||||
@@ -146,11 +149,29 @@ public class MetaDataProvider {
|
||||
}
|
||||
|
||||
if (layout == Layout.BODY) for (List<IWailaDataProvider> providersList : bodyBlockProviders.values()) {
|
||||
boolean hasAdvancedBodyAvailable = false;
|
||||
final boolean isAdvancedKeyDown = KeyEvent.key_show_advanced.getIsKeyPressed();
|
||||
|
||||
for (IWailaDataProvider dataProvider : providersList) try {
|
||||
currenttip = dataProvider.getWailaBody(itemStack, currenttip, accessor, ConfigHandler.instance());
|
||||
|
||||
if (dataProvider.hasWailaAdvancedBody(itemStack, accessor, ConfigHandler.instance())) {
|
||||
hasAdvancedBodyAvailable = true;
|
||||
|
||||
if (isAdvancedKeyDown) {
|
||||
currenttip = dataProvider
|
||||
.getWailaAdvancedBody(itemStack, currenttip, accessor, ConfigHandler.instance());
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Throwable e) {
|
||||
currenttip = WailaExceptionHandler.handleErr(e, dataProvider.getClass().toString(), currenttip);
|
||||
}
|
||||
|
||||
if (hasAdvancedBodyAvailable && !isAdvancedKeyDown) {
|
||||
String keyName = GameSettings.getKeyDisplayString(KeyEvent.key_show_advanced.getKeyCode());
|
||||
currenttip.add(LangUtil.translateG("hud.msg.holdkeymoreinfo", keyName));
|
||||
}
|
||||
}
|
||||
if (layout == Layout.FOOTER) for (List<IWailaDataProvider> providersList : tailBlockProviders.values()) {
|
||||
for (IWailaDataProvider dataProvider : providersList) try {
|
||||
|
||||
@@ -7,13 +7,14 @@ import net.minecraftforge.common.config.Configuration;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.gui.screens.config.ScreenConfig;
|
||||
import mcp.mobius.waila.handlers.nei.NEIHandler;
|
||||
import mcp.mobius.waila.utils.Constants;
|
||||
import mcp.mobius.waila.utils.LoadedMods;
|
||||
|
||||
public class KeyEvent {
|
||||
|
||||
@@ -22,6 +23,7 @@ public class KeyEvent {
|
||||
public static KeyBinding key_liquid;
|
||||
public static KeyBinding key_recipe;
|
||||
public static KeyBinding key_usage;
|
||||
public static KeyBinding key_show_advanced;
|
||||
|
||||
public KeyEvent() {
|
||||
ClientRegistry
|
||||
@@ -34,6 +36,8 @@ public class KeyEvent {
|
||||
key_recipe = new KeyBinding(Constants.BIND_WAILA_RECIPE, Keyboard.KEY_NUMPAD3, "Waila"));
|
||||
ClientRegistry.registerKeyBinding(
|
||||
key_usage = new KeyBinding(Constants.BIND_WAILA_USAGE, Keyboard.KEY_NUMPAD4, "Waila"));
|
||||
ClientRegistry.registerKeyBinding(
|
||||
key_show_advanced = new KeyBinding(Constants.BIND_WAILA_SHOW_ADVANCED, Keyboard.KEY_LSHIFT, "Waila"));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -59,15 +63,22 @@ public class KeyEvent {
|
||||
boolean status = ConfigHandler.instance()
|
||||
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_LIQUID, true);
|
||||
ConfigHandler.instance().setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_LIQUID, !status);
|
||||
} else if (key_recipe.isPressed()) {
|
||||
if (Loader.isModLoaded("NotEnoughItems")) {
|
||||
NEIHandler.openRecipeGUI(true);
|
||||
}
|
||||
} else if (key_usage.isPressed()) {
|
||||
if (Loader.isModLoaded("NotEnoughItems")) {
|
||||
NEIHandler.openRecipeGUI(false);
|
||||
}
|
||||
} else if (LoadedMods.NEI && key_recipe.isPressed()) {
|
||||
NEIHandler.openRecipeGUI(true);
|
||||
} else if (LoadedMods.NEI && key_usage.isPressed()) {
|
||||
NEIHandler.openRecipeGUI(false);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void tickClient(TickEvent.ClientTickEvent event) {
|
||||
if (event.phase == TickEvent.Phase.START) return;
|
||||
if (!KeyEvent.key_show.getIsKeyPressed()
|
||||
&& !ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MODE, false)
|
||||
&& ConfigHandler.instance()
|
||||
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, false)) {
|
||||
ConfigHandler.instance().setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,12 +1,15 @@
|
||||
package mcp.mobius.waila.client;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.IReloadableResourceManager;
|
||||
import net.minecraft.client.resources.IResourceManager;
|
||||
import net.minecraft.client.resources.IResourceManagerReloadListener;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import mcp.mobius.waila.api.impl.DataAccessorCommon;
|
||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
@@ -17,10 +20,15 @@ import mcp.mobius.waila.handlers.HUDHandlerBlocks;
|
||||
import mcp.mobius.waila.handlers.HUDHandlerEntities;
|
||||
import mcp.mobius.waila.handlers.VanillaTooltipHandler;
|
||||
import mcp.mobius.waila.handlers.nei.NEIHandler;
|
||||
import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderAspectString;
|
||||
import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderFluidBar;
|
||||
import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderHealth;
|
||||
import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderProgressBar;
|
||||
import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderRFBar;
|
||||
import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderStack;
|
||||
import mcp.mobius.waila.server.ProxyServer;
|
||||
import mcp.mobius.waila.utils.LoadedMods;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
|
||||
public class ProxyClient extends ProxyServer {
|
||||
|
||||
@@ -33,7 +41,7 @@ public class ProxyClient extends ProxyServer {
|
||||
|
||||
LangUtil.loadLangDir("waila");
|
||||
|
||||
if (Loader.isModLoaded("NotEnoughItems")) {
|
||||
if (LoadedMods.NEI) {
|
||||
NEIHandler.register();
|
||||
} else {
|
||||
MinecraftForge.EVENT_BUS.register(new VanillaTooltipHandler());
|
||||
@@ -53,8 +61,15 @@ public class ProxyClient extends ProxyServer {
|
||||
ModuleRegistrar.instance().registerTooltipRenderer("waila.health", new TTRenderHealth());
|
||||
ModuleRegistrar.instance().registerTooltipRenderer("waila.stack", new TTRenderStack());
|
||||
ModuleRegistrar.instance().registerTooltipRenderer("waila.progress", new TTRenderProgressBar());
|
||||
ModuleRegistrar.instance().registerTooltipRenderer("waila.fluid", new TTRenderFluidBar());
|
||||
ModuleRegistrar.instance().registerTooltipRenderer("waila.rfenergy", new TTRenderRFBar());
|
||||
|
||||
ModuleRegistrar.instance().registerTooltipRenderer("waila.tcaspect", new TTRenderAspectString());
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(new WorldUnloadEventHandler());
|
||||
|
||||
((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager())
|
||||
.registerReloadListener(new NumberFormatterReloadListener());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -68,7 +83,17 @@ public class ProxyClient extends ProxyServer {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWorldUnload(WorldEvent.Unload event) {
|
||||
DataAccessorCommon.instance = new DataAccessorCommon();
|
||||
if (event.world.isRemote) {
|
||||
DataAccessorCommon.instance = new DataAccessorCommon();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class NumberFormatterReloadListener implements IResourceManagerReloadListener {
|
||||
|
||||
@Override
|
||||
public void onResourceManagerReload(IResourceManager resourceManager) {
|
||||
NumberFormatter.onResourcesReload();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,6 +84,16 @@ public class ScreenWailaConfig extends ScreenBase {
|
||||
"screen.button.no",
|
||||
"screen.button.yes"),
|
||||
"choice.shifttoggledents");
|
||||
buttonContainer.addButton(
|
||||
new ButtonBooleanConfig(
|
||||
this.getRoot(),
|
||||
Configuration.CATEGORY_GENERAL,
|
||||
Constants.CFG_WAILA_SHOWICON,
|
||||
true,
|
||||
false,
|
||||
"screen.button.no",
|
||||
"screen.button.yes"),
|
||||
"choice.showicon");
|
||||
|
||||
this.getRoot().addWidget("LayoutConfigPos", new LayoutBase(this.getRoot()));
|
||||
this.getRoot().getWidget("LayoutConfigPos")
|
||||
|
||||
@@ -2,7 +2,6 @@ package mcp.mobius.waila.handlers;
|
||||
|
||||
import static mcp.mobius.waila.api.SpecialChars.BLUE;
|
||||
import static mcp.mobius.waila.api.SpecialChars.ITALIC;
|
||||
import static mcp.mobius.waila.api.SpecialChars.RENDER;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -72,7 +71,7 @@ public class HUDHandlerBlocks implements IWailaDataProvider {
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler config) {
|
||||
currenttip.add(RENDER + "{Plip}" + RENDER + "{Plop,thisisatest,222,333}");
|
||||
// currenttip.add(RENDER + "{Plip}" + RENDER + "{Plop,thisisatest,222,333}");
|
||||
|
||||
String modName = ModIdentification.nameFromStack(itemStack);
|
||||
if (modName != null && !modName.isEmpty()) {
|
||||
|
||||
@@ -23,6 +23,7 @@ import net.minecraft.item.ItemStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaTooltipRenderer;
|
||||
import mcp.mobius.waila.api.SpecialChars;
|
||||
import mcp.mobius.waila.api.impl.DataAccessorCommon;
|
||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
||||
@@ -41,8 +42,9 @@ public class DisplayUtil {
|
||||
Matcher renderMatcher = patternRender.matcher(s);
|
||||
while (renderMatcher.find()) {
|
||||
IWailaTooltipRenderer renderer = ModuleRegistrar.instance().getTooltipRenderer(renderMatcher.group("name"));
|
||||
if (renderer != null)
|
||||
width += renderer.getSize(renderMatcher.group("args").split(","), DataAccessorCommon.instance).width;
|
||||
if (renderer != null) width += renderer.getSize(
|
||||
renderMatcher.group("args").split(SpecialChars.WailaRendererComma),
|
||||
DataAccessorCommon.instance).width;
|
||||
}
|
||||
|
||||
Matcher iconMatcher = patternIcon.matcher(s);
|
||||
|
||||
@@ -16,17 +16,13 @@ public class OverlayConfig {
|
||||
public static int fontcolor;
|
||||
public static float scale;
|
||||
|
||||
// spotless:off
|
||||
public static void updateColors() {
|
||||
OverlayConfig.alpha = (int) (ConfigHandler.instance()
|
||||
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_ALPHA, 0) / 100.0f
|
||||
* 256) << 24;
|
||||
OverlayConfig.bgcolor = OverlayConfig.alpha
|
||||
+ ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_BGCOLOR, 0);
|
||||
OverlayConfig.gradient1 = OverlayConfig.alpha
|
||||
+ ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_GRADIENT1, 0);
|
||||
OverlayConfig.gradient2 = OverlayConfig.alpha
|
||||
+ ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_GRADIENT2, 0);
|
||||
OverlayConfig.fontcolor = OverlayConfig.alpha
|
||||
+ ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_FONTCOLOR, 0);
|
||||
alpha = (int) (ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_ALPHA, 0) / 100.0f * 255f) << 24;
|
||||
bgcolor = alpha + ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_BGCOLOR, 0);
|
||||
gradient1 = alpha + ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_GRADIENT1, 0);
|
||||
gradient2 = alpha + ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_GRADIENT2, 0);
|
||||
fontcolor = ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_FONTCOLOR, 0);
|
||||
}
|
||||
// spotless:on
|
||||
}
|
||||
@@ -11,16 +11,11 @@ import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
|
||||
public class OverlayRenderer {
|
||||
|
||||
protected static boolean hasBlending;
|
||||
protected static boolean hasLight;
|
||||
protected static boolean hasDepthTest;
|
||||
protected static boolean hasLight0;
|
||||
protected static boolean hasLight1;
|
||||
protected static boolean hasRescaleNormal;
|
||||
protected static boolean hasColorMaterial;
|
||||
protected static int boundTexIndex;
|
||||
private static boolean hasBlending;
|
||||
private static boolean hasDepthTest;
|
||||
private static int boundTexIndex;
|
||||
|
||||
public static void renderOverlay() {
|
||||
public static void renderOverlay(Tooltip tooltip) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if (!(mc.currentScreen == null && mc.theWorld != null
|
||||
&& Minecraft.isGuiEnabled()
|
||||
@@ -31,16 +26,16 @@ public class OverlayRenderer {
|
||||
|
||||
if (RayTracing.instance().getTarget().typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK
|
||||
&& RayTracing.instance().getTargetStack() != null) {
|
||||
renderOverlay(WailaTickHandler.instance().tooltip);
|
||||
doRenderOverlay(tooltip);
|
||||
}
|
||||
|
||||
if (RayTracing.instance().getTarget().typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY
|
||||
&& ConfigHandler.instance().getConfig("general.showents")) {
|
||||
renderOverlay(WailaTickHandler.instance().tooltip);
|
||||
doRenderOverlay(tooltip);
|
||||
}
|
||||
}
|
||||
|
||||
public static void renderOverlay(Tooltip tooltip) {
|
||||
private static void doRenderOverlay(Tooltip tooltip) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
saveGLState();
|
||||
@@ -80,26 +75,23 @@ public class OverlayRenderer {
|
||||
|
||||
}
|
||||
|
||||
public static void saveGLState() {
|
||||
private static void saveGLState() {
|
||||
hasBlending = GL11.glGetBoolean(GL11.GL_BLEND);
|
||||
hasLight = GL11.glGetBoolean(GL11.GL_LIGHTING);
|
||||
hasDepthTest = GL11.glGetBoolean(GL11.GL_DEPTH_TEST);
|
||||
boundTexIndex = GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D);
|
||||
GL11.glPushAttrib(GL11.GL_CURRENT_BIT);
|
||||
}
|
||||
|
||||
public static void loadGLState() {
|
||||
private static void loadGLState() {
|
||||
if (hasBlending) GL11.glEnable(GL11.GL_BLEND);
|
||||
else GL11.glDisable(GL11.GL_BLEND);
|
||||
if (hasLight1) GL11.glEnable(GL11.GL_LIGHT1);
|
||||
else GL11.glDisable(GL11.GL_LIGHT1);
|
||||
if (hasDepthTest) GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
else GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, boundTexIndex);
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
public static void drawTooltipBox(int x, int y, int w, int h, int bg, int grad1, int grad2) {
|
||||
private static void drawTooltipBox(int x, int y, int w, int h, int bg, int grad1, int grad2) {
|
||||
DisplayUtil.drawGradientRect(x + 1, y, w - 1, 1, bg, bg);
|
||||
DisplayUtil.drawGradientRect(x + 1, y + h, w - 1, 1, bg, bg);
|
||||
DisplayUtil.drawGradientRect(x + 1, y + 1, w - 1, h - 1, bg, bg);// center
|
||||
@@ -107,7 +99,6 @@ public class OverlayRenderer {
|
||||
DisplayUtil.drawGradientRect(x + w, y + 1, 1, h - 1, bg, bg);
|
||||
DisplayUtil.drawGradientRect(x + 1, y + 2, 1, h - 3, grad1, grad2);
|
||||
DisplayUtil.drawGradientRect(x + w - 1, y + 2, 1, h - 3, grad1, grad2);
|
||||
|
||||
DisplayUtil.drawGradientRect(x + 1, y + 1, w - 1, 1, grad1, grad1);
|
||||
DisplayUtil.drawGradientRect(x + 1, y + h - 1, w - 1, 1, grad2, grad2);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import mcp.mobius.waila.utils.Constants;
|
||||
|
||||
public class RayTracing {
|
||||
|
||||
private MovingObjectPosition target = null;
|
||||
private static RayTracing _instance;
|
||||
|
||||
private RayTracing() {}
|
||||
@@ -35,22 +36,22 @@ public class RayTracing {
|
||||
return _instance;
|
||||
}
|
||||
|
||||
private MovingObjectPosition target = null;
|
||||
private final Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
public void fire() {
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
if (mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY
|
||||
&& !shouldHidePlayer(mc.objectMouseOver.entityHit)) {
|
||||
this.target = mc.objectMouseOver;
|
||||
return;
|
||||
}
|
||||
|
||||
EntityLivingBase viewpoint = mc.renderViewEntity;
|
||||
if (viewpoint == null) return;
|
||||
|
||||
this.target = this.rayTrace(viewpoint, mc.playerController.getBlockReachDistance(), 0);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
target = null;
|
||||
}
|
||||
|
||||
private static boolean shouldHidePlayer(Entity targetEnt) {
|
||||
// Check if entity is player with invisibility effect
|
||||
if (targetEnt instanceof EntityPlayer thePlayer) {
|
||||
@@ -116,7 +117,7 @@ public class RayTracing {
|
||||
|
||||
if (this.target == null) return items;
|
||||
|
||||
World world = mc.theWorld;
|
||||
World world = Minecraft.getMinecraft().theWorld;
|
||||
|
||||
int x = this.target.blockX;
|
||||
int y = this.target.blockY;
|
||||
|
||||
@@ -21,6 +21,8 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaCommonAccessor;
|
||||
import mcp.mobius.waila.api.IWailaTooltipRenderer;
|
||||
import mcp.mobius.waila.api.IWailaVariableWidthTooltipRenderer;
|
||||
import mcp.mobius.waila.api.SpecialChars;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.api.impl.DataAccessorCommon;
|
||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
@@ -106,6 +108,8 @@ public class Tooltip {
|
||||
|
||||
public Tooltip(List<String> textData, boolean hasIcon) {
|
||||
|
||||
if (hasIcon) hasIcon = ConfigHandler.instance().showIcon();
|
||||
|
||||
columnsWidth.add(0); // Small init of the arrays to have at least one element
|
||||
columnsPos.add(0);
|
||||
|
||||
@@ -178,7 +182,10 @@ public class Tooltip {
|
||||
renderable = new Renderable(
|
||||
renderer,
|
||||
new Point(offsetX, offsetY),
|
||||
renderMatcher.group("args").split(","));
|
||||
renderMatcher.group("args").split(SpecialChars.WailaRendererComma));
|
||||
if (renderer instanceof IWailaVariableWidthTooltipRenderer variableWidthRenderer) {
|
||||
variableWidthRenderer.setMaxLineWidth(maxStringW);
|
||||
}
|
||||
this.elements2nd.add(renderable);
|
||||
}
|
||||
} else if (iconMatcher.find()) {
|
||||
|
||||
@@ -12,169 +12,138 @@ import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.api.impl.DataAccessorCommon;
|
||||
import mcp.mobius.waila.api.impl.MetaDataProvider;
|
||||
import mcp.mobius.waila.api.impl.TipList;
|
||||
import mcp.mobius.waila.cbcore.Layout;
|
||||
import mcp.mobius.waila.client.KeyEvent;
|
||||
import mcp.mobius.waila.utils.Constants;
|
||||
|
||||
public class WailaTickHandler {
|
||||
|
||||
public Tooltip tooltip = null;
|
||||
public MetaDataProvider handler = new MetaDataProvider();
|
||||
private final Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
private static WailaTickHandler _instance;
|
||||
|
||||
private WailaTickHandler() {}
|
||||
|
||||
public static WailaTickHandler instance() {
|
||||
if (_instance == null) _instance = new WailaTickHandler();
|
||||
return _instance;
|
||||
}
|
||||
private Tooltip tooltip = null;
|
||||
private final MetaDataProvider handler = new MetaDataProvider();
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void tickRender(TickEvent.RenderTickEvent event) {
|
||||
if (event.phase == TickEvent.Phase.END) {
|
||||
OverlayRenderer.renderOverlay();
|
||||
OverlayRenderer.renderOverlay(tooltip);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void tickClient(TickEvent.ClientTickEvent event) {
|
||||
|
||||
if (event.phase == TickEvent.Phase.START) return;
|
||||
|
||||
if (!Keyboard.isKeyDown(KeyEvent.key_show.getKeyCode())
|
||||
&& !ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MODE, false)
|
||||
&& ConfigHandler.instance()
|
||||
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, false)) {
|
||||
ConfigHandler.instance().setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, false);
|
||||
}
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
World world = mc.theWorld;
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
if (world != null && player != null) {
|
||||
RayTracing.instance().fire();
|
||||
MovingObjectPosition target = RayTracing.instance().getTarget();
|
||||
if (world == null || player == null) {
|
||||
this.tooltip = null;
|
||||
RayTracing.instance().clear();
|
||||
return;
|
||||
}
|
||||
|
||||
List<String> currenttip;
|
||||
List<String> currenttipHead;
|
||||
List<String> currenttipBody;
|
||||
List<String> currenttipTail;
|
||||
if (target != null && target.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||
DataAccessorCommon accessor = DataAccessorCommon.instance;
|
||||
accessor.set(world, player, target);
|
||||
ItemStack targetStack = RayTracing.instance().getTargetStack(); // Here we get either the proper stack
|
||||
// or the override
|
||||
RayTracing.instance().fire();
|
||||
MovingObjectPosition target = RayTracing.instance().getTarget();
|
||||
|
||||
if (targetStack != null) {
|
||||
currenttip = new TipList<String, String>();
|
||||
currenttipHead = new TipList<String, String>();
|
||||
currenttipBody = new TipList<String, String>();
|
||||
currenttipTail = new TipList<String, String>();
|
||||
List<String> currenttip;
|
||||
List<String> currenttipHead;
|
||||
List<String> currenttipBody;
|
||||
List<String> currenttipTail;
|
||||
if (target != null && target.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||
DataAccessorCommon accessor = DataAccessorCommon.instance;
|
||||
accessor.set(world, player, target);
|
||||
ItemStack targetStack = RayTracing.instance().getTargetStack(); // Here we get either the proper stack
|
||||
// or the override
|
||||
|
||||
currenttipHead = handler.handleBlockTextData(
|
||||
targetStack,
|
||||
world,
|
||||
player,
|
||||
target,
|
||||
accessor,
|
||||
currenttipHead,
|
||||
Layout.HEADER);
|
||||
currenttipBody = handler.handleBlockTextData(
|
||||
targetStack,
|
||||
world,
|
||||
player,
|
||||
target,
|
||||
accessor,
|
||||
currenttipBody,
|
||||
Layout.BODY);
|
||||
currenttipTail = handler.handleBlockTextData(
|
||||
targetStack,
|
||||
world,
|
||||
player,
|
||||
target,
|
||||
accessor,
|
||||
currenttipTail,
|
||||
Layout.FOOTER);
|
||||
if (targetStack != null) {
|
||||
currenttip = new TipList<String, String>();
|
||||
currenttipHead = new TipList<String, String>();
|
||||
currenttipBody = new TipList<String, String>();
|
||||
currenttipTail = new TipList<String, String>();
|
||||
|
||||
if (ConfigHandler.instance()
|
||||
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHIFTBLOCK, false)
|
||||
&& !currenttipBody.isEmpty()
|
||||
&& !accessor.getPlayer().isSneaking()) {
|
||||
currenttipBody.clear();
|
||||
currenttipBody.add(ITALIC + "Press shift for more data");
|
||||
}
|
||||
currenttipHead = handler.handleBlockTextData(
|
||||
targetStack,
|
||||
world,
|
||||
player,
|
||||
target,
|
||||
accessor,
|
||||
currenttipHead,
|
||||
Layout.HEADER);
|
||||
currenttipBody = handler
|
||||
.handleBlockTextData(targetStack, world, player, target, accessor, currenttipBody, Layout.BODY);
|
||||
currenttipTail = handler.handleBlockTextData(
|
||||
targetStack,
|
||||
world,
|
||||
player,
|
||||
target,
|
||||
accessor,
|
||||
currenttipTail,
|
||||
Layout.FOOTER);
|
||||
|
||||
currenttip.addAll(currenttipHead);
|
||||
currenttip.addAll(currenttipBody);
|
||||
currenttip.addAll(currenttipTail);
|
||||
|
||||
this.tooltip = new Tooltip(currenttip, targetStack);
|
||||
if (ConfigHandler.instance()
|
||||
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHIFTBLOCK, false)
|
||||
&& !currenttipBody.isEmpty()
|
||||
&& !accessor.getPlayer().isSneaking()) {
|
||||
currenttipBody.clear();
|
||||
currenttipBody.add(ITALIC + "Press shift for more data");
|
||||
}
|
||||
} else if (target != null && target.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY) {
|
||||
DataAccessorCommon accessor = DataAccessorCommon.instance;
|
||||
accessor.set(world, player, target);
|
||||
|
||||
Entity targetEnt = RayTracing.instance().getTargetEntity(); // This need to be replaced by the override
|
||||
// check.
|
||||
currenttip.addAll(currenttipHead);
|
||||
currenttip.addAll(currenttipBody);
|
||||
currenttip.addAll(currenttipTail);
|
||||
|
||||
if (targetEnt != null) {
|
||||
currenttip = new TipList<String, String>();
|
||||
currenttipHead = new TipList<String, String>();
|
||||
currenttipBody = new TipList<String, String>();
|
||||
currenttipTail = new TipList<String, String>();
|
||||
this.tooltip = new Tooltip(currenttip, targetStack);
|
||||
}
|
||||
} else if (target != null && target.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY) {
|
||||
DataAccessorCommon accessor = DataAccessorCommon.instance;
|
||||
accessor.set(world, player, target);
|
||||
|
||||
currenttipHead = handler.handleEntityTextData(
|
||||
targetEnt,
|
||||
world,
|
||||
player,
|
||||
target,
|
||||
accessor,
|
||||
currenttipHead,
|
||||
Layout.HEADER);
|
||||
currenttipBody = handler.handleEntityTextData(
|
||||
targetEnt,
|
||||
world,
|
||||
player,
|
||||
target,
|
||||
accessor,
|
||||
currenttipBody,
|
||||
Layout.BODY);
|
||||
currenttipTail = handler.handleEntityTextData(
|
||||
targetEnt,
|
||||
world,
|
||||
player,
|
||||
target,
|
||||
accessor,
|
||||
currenttipTail,
|
||||
Layout.FOOTER);
|
||||
Entity targetEnt = RayTracing.instance().getTargetEntity(); // This need to be replaced by the override
|
||||
// check.
|
||||
|
||||
if (ConfigHandler.instance()
|
||||
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHIFTENTS, false)
|
||||
&& !currenttipBody.isEmpty()
|
||||
&& !accessor.getPlayer().isSneaking()) {
|
||||
currenttipBody.clear();
|
||||
currenttipBody.add(ITALIC + "Press shift for more data");
|
||||
}
|
||||
if (targetEnt != null) {
|
||||
currenttip = new TipList<String, String>();
|
||||
currenttipHead = new TipList<String, String>();
|
||||
currenttipBody = new TipList<String, String>();
|
||||
currenttipTail = new TipList<String, String>();
|
||||
|
||||
currenttip.addAll(currenttipHead);
|
||||
currenttip.addAll(currenttipBody);
|
||||
currenttip.addAll(currenttipTail);
|
||||
currenttipHead = handler.handleEntityTextData(
|
||||
targetEnt,
|
||||
world,
|
||||
player,
|
||||
target,
|
||||
accessor,
|
||||
currenttipHead,
|
||||
Layout.HEADER);
|
||||
currenttipBody = handler
|
||||
.handleEntityTextData(targetEnt, world, player, target, accessor, currenttipBody, Layout.BODY);
|
||||
currenttipTail = handler.handleEntityTextData(
|
||||
targetEnt,
|
||||
world,
|
||||
player,
|
||||
target,
|
||||
accessor,
|
||||
currenttipTail,
|
||||
Layout.FOOTER);
|
||||
|
||||
this.tooltip = new Tooltip(currenttip, false);
|
||||
if (ConfigHandler.instance()
|
||||
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHIFTENTS, false)
|
||||
&& !currenttipBody.isEmpty()
|
||||
&& !accessor.getPlayer().isSneaking()) {
|
||||
currenttipBody.clear();
|
||||
currenttipBody.add(ITALIC + "Press shift for more data");
|
||||
}
|
||||
|
||||
currenttip.addAll(currenttipHead);
|
||||
currenttip.addAll(currenttipBody);
|
||||
currenttip.addAll(currenttipTail);
|
||||
|
||||
this.tooltip = new Tooltip(currenttip, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
package mcp.mobius.waila.overlay.tooltiprenderers;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import mcp.mobius.waila.addons.thaumcraft.ThaumcraftModule;
|
||||
import mcp.mobius.waila.api.IWailaCommonAccessor;
|
||||
import mcp.mobius.waila.api.IWailaTooltipRenderer;
|
||||
import mcp.mobius.waila.overlay.DisplayUtil;
|
||||
import mcp.mobius.waila.overlay.OverlayConfig;
|
||||
|
||||
public class TTRenderAspectString implements IWailaTooltipRenderer {
|
||||
|
||||
@Override
|
||||
public Dimension getSize(String[] params, IWailaCommonAccessor accessor) {
|
||||
int width;
|
||||
if (params[0].equals("???")) {
|
||||
width = DisplayUtil.getDisplayWidth(params[0]);
|
||||
} else {
|
||||
try {
|
||||
Object aspect = ThaumcraftModule.Aspect_getAspect.invoke(null, params[0]);
|
||||
if (aspect == null) {
|
||||
width = DisplayUtil.getDisplayWidth(params[0]);
|
||||
} else width = DisplayUtil.getDisplayWidth((String) ThaumcraftModule.Aspect_getName.invoke(aspect));
|
||||
} catch (ReflectiveOperationException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
return new Dimension(width + 10, params[0].isEmpty() ? 0 : 8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(String[] params, IWailaCommonAccessor accessor) {
|
||||
try {
|
||||
if (params[0].equals("???")) {
|
||||
drawTag(0, 0, ThaumcraftModule.unknownAspectTexture, ThaumcraftModule.unknownAspectColor, 200);
|
||||
DisplayUtil.drawString(params[0], 10, 0, OverlayConfig.fontcolor, true);
|
||||
return;
|
||||
}
|
||||
Object aspect = ThaumcraftModule.Aspect_getAspect.invoke(null, params[0]);
|
||||
if (aspect == null) return;
|
||||
drawTag(
|
||||
0,
|
||||
0,
|
||||
(ResourceLocation) ThaumcraftModule.Aspect_getImage.invoke(aspect),
|
||||
new Color((int) ThaumcraftModule.Aspect_getColor.invoke(aspect)),
|
||||
200);
|
||||
DisplayUtil.drawString(
|
||||
(String) ThaumcraftModule.Aspect_getName.invoke(aspect),
|
||||
10,
|
||||
0,
|
||||
OverlayConfig.fontcolor,
|
||||
true);
|
||||
} catch (ReflectiveOperationException e) {
|
||||
DisplayUtil.drawString(params[0], 10, 0, OverlayConfig.fontcolor, true);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void drawTag(double x, double y, ResourceLocation image, Color color, double z) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
mc.renderEngine.bindTexture(image);
|
||||
GL11.glColor4f(
|
||||
(float) color.getRed() / 255.0F,
|
||||
(float) color.getGreen() / 255.0F,
|
||||
(float) color.getBlue() / 255.0F,
|
||||
1);
|
||||
|
||||
Tessellator var9 = Tessellator.instance;
|
||||
var9.startDrawingQuads();
|
||||
var9.setColorRGBA_F(
|
||||
(float) color.getRed() / 255.0F,
|
||||
(float) color.getGreen() / 255.0F,
|
||||
(float) color.getBlue() / 255.0F,
|
||||
1);
|
||||
|
||||
var9.addVertexWithUV(x + 0.0D, y + 8.0D, z, 0.0D, 1.0D);
|
||||
var9.addVertexWithUV(x + 8.0D, y + 8.0D, z, 1.0D, 1.0D);
|
||||
var9.addVertexWithUV(x + 8.0D, y + 0.0D, z, 1.0D, 0.0D);
|
||||
var9.addVertexWithUV(x + 0.0D, y + 0.0D, z, 0.0D, 0.0D);
|
||||
var9.draw();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
package mcp.mobius.waila.overlay.tooltiprenderers;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import gregtech.api.util.GTUtil;
|
||||
import gregtech.common.fluid.GTFluid;
|
||||
import gtPlusPlus.api.objects.minecraft.FluidGT6;
|
||||
import gtPlusPlus.core.util.minecraft.FluidUtils;
|
||||
import mcp.mobius.waila.api.IWailaCommonAccessor;
|
||||
import mcp.mobius.waila.api.IWailaVariableWidthTooltipRenderer;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.overlay.DisplayUtil;
|
||||
import mcp.mobius.waila.utils.LoadedMods;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
|
||||
public class TTRenderFluidBar implements IWailaVariableWidthTooltipRenderer {
|
||||
|
||||
int maxStringW;
|
||||
|
||||
private final Consumer<String> bindColor;
|
||||
private static final int height = 12;
|
||||
|
||||
public TTRenderFluidBar() {
|
||||
if (LoadedMods.GT5U) {
|
||||
bindColor = (fluidName) -> {
|
||||
FluidStack aCheck = FluidUtils.getWildcardFluidStack(fluidName, 1000);
|
||||
if (aCheck != null && (aCheck.getFluid() instanceof FluidGT6 || aCheck.getFluid() instanceof GTFluid)) {
|
||||
short[] RGBa = GTUtil.getRGBaArray(aCheck.getFluid().getColor());
|
||||
GL11.glColor4f(RGBa[0] / 255F, RGBa[1] / 255F, RGBa[2] / 255F, 1F);
|
||||
} else {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
}
|
||||
};
|
||||
} else {
|
||||
bindColor = (fluidName) -> GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getSize(String[] params, IWailaCommonAccessor accessor) {
|
||||
boolean isEmpty = (params[0].equals("EMPTYFLUID") && params[1].equals("EMPTYFLUID"));
|
||||
int displayWidth = DisplayUtil.getDisplayWidth(
|
||||
buildDisplayText(
|
||||
isEmpty ? 0 : Double.parseDouble(params[2]),
|
||||
Double.parseDouble(params[3]),
|
||||
params[1],
|
||||
isEmpty));
|
||||
|
||||
return new Dimension(displayWidth + 4, height);
|
||||
}
|
||||
|
||||
public static final ResourceLocation gradient = new ResourceLocation("waila", "textures/gradient.png");
|
||||
|
||||
@Override
|
||||
public void draw(String[] params, IWailaCommonAccessor accessor) {
|
||||
String fluidName = params[0];
|
||||
String localizedName = params[1];
|
||||
double amount = Double.parseDouble(params[2]);
|
||||
double capacity = Double.parseDouble(params[3]);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
boolean isEmpty = fluidName.equals("EMPTYFLUID") && localizedName.equals("EMPTYFLUID");
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if (!isEmpty) {
|
||||
IIcon icon = FluidRegistry.getFluid(fluidName).getIcon();
|
||||
mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
|
||||
bindColor.accept(fluidName);
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
// Intentionally draw 2 pixels taller than needed than cover with the border to make the texture more
|
||||
// visible
|
||||
int i = (int) ((double) (maxStringW - 2) * amount / capacity);
|
||||
int j = 0;
|
||||
for (; i > height; i = i - height) {
|
||||
drawRectFromIcon(tessellator, 1 + (j * height), 0, 0, icon, height, height);
|
||||
j++;
|
||||
}
|
||||
if (i > 0) drawRect(
|
||||
tessellator,
|
||||
1 + (j * height),
|
||||
0,
|
||||
0,
|
||||
i,
|
||||
height,
|
||||
icon.getMinU(),
|
||||
icon.getMinV(),
|
||||
icon.getMinU() + ((icon.getMaxU() - icon.getMinU()) * ((double) i / height)),
|
||||
icon.getMaxV());
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
if (!isEmpty) {
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glColor4f(1F, 1F, 1F, 0.70F);
|
||||
mc.getTextureManager().bindTexture(gradient);
|
||||
tessellator.startDrawingQuads();
|
||||
drawRect(tessellator, 1, 0, 0, maxStringW - 2, height - 1, 0, 0, 1, 1);
|
||||
tessellator.draw();
|
||||
} else {
|
||||
Gui.drawRect(1, 0, maxStringW - 1, height - 1, 0x1A575656);
|
||||
}
|
||||
|
||||
drawThickBeveledBox(0, 0, maxStringW, height, 1, 0xFF505050, 0xFF505050, -1);
|
||||
|
||||
DisplayUtil.drawString(
|
||||
buildDisplayText(amount, capacity, localizedName, isEmpty),
|
||||
2,
|
||||
2,
|
||||
isEmpty ? 0xFFDDDDDD : 0xFFFFFFFF,
|
||||
true);
|
||||
}
|
||||
|
||||
public String buildDisplayText(double amount, double capacity, String fluidName, boolean isEmpty) {
|
||||
return isEmpty
|
||||
? String.format(
|
||||
"%s / %s %s",
|
||||
LangUtil.translateG("hud.msg.empty"),
|
||||
NumberFormatter.format((int) capacity),
|
||||
ConfigHandler.instance().fluidUnit)
|
||||
: String.format(
|
||||
"%s / %s %s %s",
|
||||
NumberFormatter.format((int) amount),
|
||||
NumberFormatter.format((int) capacity),
|
||||
ConfigHandler.instance().fluidUnit,
|
||||
fluidName);
|
||||
}
|
||||
|
||||
public static void drawRectFromIcon(Tessellator tessellator, int x, int y, double z, IIcon icon, int width,
|
||||
int height) {
|
||||
drawRect(tessellator, x, y, z, width, height, icon.getMinU(), icon.getMinV(), icon.getMaxU(), icon.getMaxV());
|
||||
}
|
||||
|
||||
public static void drawRect(Tessellator tessellator, int x, int y, double z, int width, int height, double minU,
|
||||
double minV, double maxU, double maxV) {
|
||||
tessellator.addVertexWithUV(x, y + height, z, minU, maxV);
|
||||
tessellator.addVertexWithUV(x + width, y + height, z, maxU, maxV);
|
||||
tessellator.addVertexWithUV(x + width, y, z, maxU, minV);
|
||||
tessellator.addVertexWithUV(x, y, z, minU, minV);
|
||||
}
|
||||
|
||||
public static void drawThickBeveledBox(int x1, int y1, int x2, int y2, int thickness, int topleftcolor,
|
||||
int botrightcolor, int fillcolor) {
|
||||
if (fillcolor != -1) {
|
||||
Gui.drawRect(x1 + 1, y1 + 1, x2 - 1, y2 - 1, fillcolor);
|
||||
}
|
||||
Gui.drawRect(x1, y1, x2 - 1, y1 + thickness, topleftcolor);
|
||||
Gui.drawRect(x1, y1, x1 + thickness, y2 - 1, topleftcolor);
|
||||
Gui.drawRect(x2 - thickness, y1, x2, y2 - 1, botrightcolor);
|
||||
Gui.drawRect(x1, y2 - thickness, x2, y2, botrightcolor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMaxLineWidth(int width) {
|
||||
maxStringW = width + 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLineWidth() {
|
||||
return maxStringW;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package mcp.mobius.waila.overlay.tooltiprenderers;
|
||||
|
||||
import java.awt.Dimension;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaCommonAccessor;
|
||||
import mcp.mobius.waila.api.IWailaVariableWidthTooltipRenderer;
|
||||
import mcp.mobius.waila.overlay.DisplayUtil;
|
||||
import mcp.mobius.waila.utils.NumberFormatter;
|
||||
|
||||
public class TTRenderRFBar implements IWailaVariableWidthTooltipRenderer {
|
||||
|
||||
int maxStringW;
|
||||
|
||||
private static final int height = 12;
|
||||
private static final int width = 2;
|
||||
|
||||
@Override
|
||||
public Dimension getSize(String[] params, IWailaCommonAccessor accessor) {
|
||||
return new Dimension(
|
||||
DisplayUtil.getDisplayWidth(buildDisplayText(Integer.parseInt(params[0]), Integer.parseInt(params[1])))
|
||||
+ 4,
|
||||
height);
|
||||
}
|
||||
|
||||
public static final ResourceLocation barTexture = new ResourceLocation("waila", "textures/rf_energy_bar.png");
|
||||
public static final ResourceLocation gradientTexture = new ResourceLocation("waila", "textures/gradient.png");
|
||||
|
||||
@Override
|
||||
public void draw(String[] params, IWailaCommonAccessor accessor) {
|
||||
int amount = Integer.parseInt(params[0]);
|
||||
int capacity = Integer.parseInt(params[1]);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
mc.getTextureManager().bindTexture(barTexture);
|
||||
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
tessellator.startDrawingQuads();
|
||||
|
||||
// Draw dark (uncharged) background for whole bar first
|
||||
for (int i = 0; i < (maxStringW - 2); i += width) {
|
||||
drawRect(tessellator, 1 + i, 0, 0, width, height, 0.0, 0.0, 0.5, 1.0);
|
||||
}
|
||||
|
||||
double i = (double) (maxStringW - 2) * amount / capacity;
|
||||
int drawnRects = 0;
|
||||
for (; i > width; i -= width) {
|
||||
drawRect(tessellator, 1 + (drawnRects * width), 0, 0, width, height, 0.5, 0.0, 1.0, 1.0);
|
||||
drawnRects++;
|
||||
}
|
||||
// Do less than full increments just as much as they take up on the scaled texture
|
||||
drawRectD(tessellator, 1 + (drawnRects * width), 0, 0, i, height, 0.5, 0.0, 0.5 + 0.25 * i, 1.0);
|
||||
tessellator.draw();
|
||||
|
||||
// Border
|
||||
drawThickBeveledBox(0, 0, maxStringW, height, 1, 0xFF505050, 0xFF505050, -1);
|
||||
|
||||
// Gradient
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glColor4f(1F, 1F, 1F, 0.5F);
|
||||
mc.getTextureManager().bindTexture(gradientTexture);
|
||||
tessellator.startDrawingQuads();
|
||||
drawRect(tessellator, 1, 1, 0, maxStringW - 2, height - 2, 0, 0, 1, 1);
|
||||
tessellator.draw();
|
||||
|
||||
DisplayUtil.drawString(buildDisplayText(amount, capacity), 2, 2, 0xFFFFFFFF, true);
|
||||
}
|
||||
|
||||
public String buildDisplayText(int amount, int capacity) {
|
||||
return String.format("%s / %s RF", NumberFormatter.format(amount), NumberFormatter.format(capacity));
|
||||
}
|
||||
|
||||
public static void drawRect(Tessellator tessellator, int x, int y, double z, int width, int height, double minU,
|
||||
double minV, double maxU, double maxV) {
|
||||
tessellator.addVertexWithUV(x, y + height, z, minU, maxV);
|
||||
tessellator.addVertexWithUV(x + width, y + height, z, maxU, maxV);
|
||||
tessellator.addVertexWithUV(x + width, y, z, maxU, minV);
|
||||
tessellator.addVertexWithUV(x, y, z, minU, minV);
|
||||
}
|
||||
|
||||
public static void drawRectD(Tessellator tessellator, double x, double y, double z, double width, double height,
|
||||
double minU, double minV, double maxU, double maxV) {
|
||||
tessellator.addVertexWithUV(x, y + height, z, minU, maxV);
|
||||
tessellator.addVertexWithUV(x + width, y + height, z, maxU, maxV);
|
||||
tessellator.addVertexWithUV(x + width, y, z, maxU, minV);
|
||||
tessellator.addVertexWithUV(x, y, z, minU, minV);
|
||||
}
|
||||
|
||||
public static void drawThickBeveledBox(int x1, int y1, int x2, int y2, int thickness, int topleftcolor,
|
||||
int botrightcolor, int fillcolor) {
|
||||
if (fillcolor != -1) {
|
||||
Gui.drawRect(x1 + 1, y1 + 1, x2 - 1, y2 - 1, fillcolor);
|
||||
}
|
||||
Gui.drawRect(x1, y1, x2 - 1, y1 + thickness, topleftcolor);
|
||||
Gui.drawRect(x1, y1, x1 + thickness, y2 - 1, topleftcolor);
|
||||
Gui.drawRect(x2 - thickness, y1, x2, y2 - 1, botrightcolor);
|
||||
Gui.drawRect(x1, y2 - thickness, x2, y2, botrightcolor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMaxLineWidth(int width) {
|
||||
maxStringW = width + 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLineWidth() {
|
||||
return maxStringW;
|
||||
}
|
||||
}
|
||||
@@ -7,15 +7,21 @@ import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameData;
|
||||
import mcp.mobius.waila.api.IWailaCommonAccessor;
|
||||
import mcp.mobius.waila.api.IWailaTooltipRenderer;
|
||||
import mcp.mobius.waila.api.SpecialChars;
|
||||
import mcp.mobius.waila.overlay.DisplayUtil;
|
||||
|
||||
public class TTRenderStack implements IWailaTooltipRenderer {
|
||||
|
||||
@Override
|
||||
public Dimension getSize(String[] params, IWailaCommonAccessor accessor) {
|
||||
return new Dimension(16, 16);
|
||||
boolean small = Boolean.parseBoolean(params.length > 4 ? params[4] : "false");
|
||||
return small ? new Dimension(10, 8) : new Dimension(16, 16);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -24,14 +30,43 @@ public class TTRenderStack implements IWailaTooltipRenderer {
|
||||
String name = params[1]; // Fully qualified name
|
||||
int amount = Integer.parseInt(params[2]);
|
||||
int meta = Integer.parseInt(params[3]);
|
||||
boolean small = Boolean.parseBoolean(params.length > 4 ? params[4] : "false");
|
||||
final float scale = 0.5f;
|
||||
|
||||
ItemStack stack = null;
|
||||
if (type == 0) stack = new ItemStack((Block) Block.blockRegistry.getObject(name), amount, meta);
|
||||
if (type == 1) stack = new ItemStack((Item) Item.itemRegistry.getObject(name), amount, meta);
|
||||
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
DisplayUtil.renderStack(0, 0, stack);
|
||||
|
||||
if (small) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glScaled(scale, scale, 1.0f);
|
||||
|
||||
DisplayUtil.renderStack(0, 0, stack);
|
||||
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
} else {
|
||||
DisplayUtil.renderStack(0, 0, stack);
|
||||
}
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
}
|
||||
|
||||
public static String create(ItemStack itemStack, int amount, boolean small) {
|
||||
String name = GameData.getItemRegistry().getNameForObject(itemStack.getItem());
|
||||
int meta = itemStack.getItemDamage();
|
||||
return SpecialChars.getRenderString(
|
||||
"waila.stack",
|
||||
String.valueOf(1),
|
||||
name,
|
||||
String.valueOf(amount),
|
||||
String.valueOf(meta),
|
||||
String.valueOf(small));
|
||||
}
|
||||
|
||||
public static String create(ItemStack itemStack, boolean small) {
|
||||
return create(itemStack, 1, small);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package mcp.mobius.waila.server;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import mcp.mobius.waila.Waila;
|
||||
import mcp.mobius.waila.addons.agriculture.AgricultureModule;
|
||||
import mcp.mobius.waila.addons.buildcraft.BCModule;
|
||||
@@ -20,6 +19,7 @@ import mcp.mobius.waila.addons.railcraft.RailcraftModule;
|
||||
import mcp.mobius.waila.addons.statues.StatuesModule;
|
||||
import mcp.mobius.waila.addons.stevescarts.StevesCartsModule;
|
||||
import mcp.mobius.waila.addons.thaumcraft.ThaumcraftModule;
|
||||
import mcp.mobius.waila.addons.thaumcraftGadomancy.GadomancyModule;
|
||||
import mcp.mobius.waila.addons.thermaldynamics.ThermalDynamicsModule;
|
||||
import mcp.mobius.waila.addons.thermalexpansion.ThermalExpansionModule;
|
||||
import mcp.mobius.waila.addons.twilightforest.TwilightForestModule;
|
||||
@@ -29,6 +29,7 @@ import mcp.mobius.waila.api.IWailaRegistrar;
|
||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
import mcp.mobius.waila.handlers.DecoratorFMP;
|
||||
import mcp.mobius.waila.handlers.HUDHandlerFMP;
|
||||
import mcp.mobius.waila.utils.LoadedMods;
|
||||
|
||||
public class ProxyServer {
|
||||
|
||||
@@ -50,6 +51,9 @@ public class ProxyServer {
|
||||
/* Thaumcraft */
|
||||
ThaumcraftModule.register();
|
||||
|
||||
/* Gadomancy */
|
||||
GadomancyModule.register();
|
||||
|
||||
/* EnderStorage */
|
||||
EnderStorageModule.register();
|
||||
|
||||
@@ -98,7 +102,7 @@ public class ProxyServer {
|
||||
/* Agriculture */
|
||||
AgricultureModule.register();
|
||||
|
||||
if (Loader.isModLoaded("ForgeMultipart")) {
|
||||
if (LoadedMods.FORGE_MULTIPART) {
|
||||
HUDHandlerFMP.register();
|
||||
DecoratorFMP.register();
|
||||
}
|
||||
@@ -114,16 +118,12 @@ public class ProxyServer {
|
||||
String[] splitName = method.split("\\.");
|
||||
String methodName = splitName[splitName.length - 1];
|
||||
String className = method.substring(0, method.length() - methodName.length() - 1);
|
||||
|
||||
Waila.log.info(String.format("Trying to reflect %s %s", className, methodName));
|
||||
|
||||
Waila.log.debug(String.format("Trying to reflect %s %s", className, methodName));
|
||||
try {
|
||||
Class<?> reflectClass = Class.forName(className);
|
||||
Method reflectMethod = reflectClass.getDeclaredMethod(methodName, IWailaRegistrar.class);
|
||||
reflectMethod.invoke(null, ModuleRegistrar.instance());
|
||||
|
||||
Waila.log.info(String.format("Success in registering %s", modname));
|
||||
|
||||
} catch (ClassNotFoundException e) {
|
||||
Waila.log.warn(String.format("Could not find class %s", className));
|
||||
} catch (NoSuchMethodException e) {
|
||||
|
||||
@@ -6,6 +6,7 @@ public final class Constants {
|
||||
|
||||
public static String BIND_WAILA_CFG = "waila.keybind.wailaconfig";
|
||||
public static String BIND_WAILA_SHOW = "waila.keybind.wailadisplay";
|
||||
public static String BIND_WAILA_SHOW_ADVANCED = "waila.keybind.showadvanced";
|
||||
public static String BIND_WAILA_LIQUID = "waila.keybind.liquid";
|
||||
public static String BIND_WAILA_RECIPE = "waila.keybind.recipe";
|
||||
public static String BIND_WAILA_USAGE = "waila.keybind.usage";
|
||||
@@ -19,6 +20,7 @@ public final class Constants {
|
||||
public static String CFG_WAILA_LIQUID = "waila.cfg.liquid";
|
||||
public static String CFG_WAILA_METADATA = "waila.cfg.metadata";
|
||||
public static String CFG_WAILA_KEYBIND = "waila.cfg.keybind";
|
||||
public static String CFG_WAILA_SHOWICON = "waila.cfg.showicon";
|
||||
public static String CFG_WAILA_POSX = "waila.cfg.posx";
|
||||
public static String CFG_WAILA_POSY = "waila.cfg.posy";
|
||||
public static String CFG_WAILA_SCALE = "waila.cfg.scale";
|
||||
@@ -27,6 +29,7 @@ public final class Constants {
|
||||
public static String CFG_WAILA_NHEARTS = "waila.cfg.heartsperline";
|
||||
public static String CFG_WAILA_MAXHP = "waila.cfg.maxhpbeforetext";
|
||||
public static String CFG_WAILA_NEWFILTERS = "waila.cfg.newfilters";
|
||||
public static String CFG_WAILA_FLUIDUNIT = "waila.cfg.fluid_unit";
|
||||
|
||||
public static String CFG_WAILA_ALPHA = "waila.cfg.alpha";
|
||||
public static String CFG_WAILA_BGCOLOR = "waila.cfg.bgcolor";
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package mcp.mobius.waila.utils;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
|
||||
public class LoadedMods {
|
||||
|
||||
public static boolean FORGE_MULTIPART = Loader.isModLoaded("ForgeMultipart");
|
||||
public static boolean NEI = Loader.isModLoaded("NotEnoughItems");
|
||||
public static boolean GT5U = Loader.isModLoaded("gregtech_nh");
|
||||
public static boolean WAILA_PLUGINS = Loader.isModLoaded("wailaplugins");
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package mcp.mobius.waila.utils;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import gregtech.api.util.GTUtility;
|
||||
|
||||
public class NumberFormatter {
|
||||
|
||||
private static NumberFormat numberFormat = NumberFormat.getInstance(getCurrentLocale());
|
||||
|
||||
public static String format(long number) {
|
||||
if (LoadedMods.GT5U) {
|
||||
return GTUtility.formatNumbers(number);
|
||||
}
|
||||
|
||||
return numberFormat.format(number);
|
||||
}
|
||||
|
||||
public static Locale getCurrentLocale() {
|
||||
String langCode = Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode();
|
||||
String[] parts = langCode.split("_", 2);
|
||||
String language = parts[0];
|
||||
String country = parts.length == 1 ? "" : parts[1];
|
||||
|
||||
return new Locale(language, country);
|
||||
}
|
||||
|
||||
public static void onResourcesReload() {
|
||||
numberFormat = NumberFormat.getInstance(getCurrentLocale());
|
||||
}
|
||||
}
|
||||
@@ -1,148 +1,150 @@
|
||||
screen.button.waila=Waila
|
||||
screen.button.modules=Moduly
|
||||
screen.label.scale=Mìøítko
|
||||
screen.label.dragtuto=Chytni HUD pro nastavení jeho pozice.
|
||||
screen.label.scale=Mìøítko
|
||||
screen.label.dragtuto=Chytni HUD pro nastavení jeho pozice.
|
||||
|
||||
screen.button.default=Defaultní
|
||||
screen.button.cancel=Zrušit
|
||||
screen.button.default=Defaultní
|
||||
screen.button.cancel=Zrušit
|
||||
screen.button.ok=Ok
|
||||
screen.button.yes=Ano
|
||||
screen.button.no=Ne
|
||||
screen.button.back=Zpìt
|
||||
screen.button.hidden=Skrytý
|
||||
screen.button.visible=Viditelný
|
||||
screen.button.maintained=Spravované
|
||||
screen.button.toggled=Pøepnuté
|
||||
screen.button.back=Zpìt
|
||||
screen.button.hidden=Skrytý
|
||||
screen.button.visible=Viditelný
|
||||
screen.button.maintained=Spravované
|
||||
screen.button.toggled=Pøepnuté
|
||||
|
||||
choice.showhidewaila=Zobrazit/Skrýt Wailu
|
||||
choice.showhidewaila=Zobrazit/Skrýt Wailu
|
||||
choice.showhideidmeta=Zobrazit ID:Metadata
|
||||
choice.toggledmaintained=Pøepnuté/Spravované
|
||||
choice.toggledmaintained=Pøepnuté/Spravované
|
||||
choice.showliquids=Tekutiny
|
||||
choice.shifttoggledblock=Pliž se pro pøepnutí blokù
|
||||
choice.shifttoggledents=Pliž se pro pøepnutí entit
|
||||
screen.button.configureaspect=Nastavení vzhledu...
|
||||
choice.shifttoggledblock=Pliž se pro pøepnutí blokù
|
||||
choice.shifttoggledents=Pliž se pro pøepnutí entit
|
||||
screen.button.configureaspect=Nastavení vzhledu...
|
||||
|
||||
enchant.title.name=Jméno
|
||||
enchant.title.minlvl=Minimální lvl
|
||||
enchant.title.maxlvl=Maximální lvl
|
||||
enchant.title.name=Jméno
|
||||
enchant.title.minlvl=Minimální lvl
|
||||
enchant.title.maxlvl=Maximální lvl
|
||||
enchant.title.weight=Hmotnost
|
||||
enchant.label.enchantability=Oèarovatelnost
|
||||
enchant.label.enchantability=Oèarovatelnost
|
||||
|
||||
waila.keybind.wailaconfig=[Waila] Nastavení obrazu
|
||||
waila.keybind.wailadisplay=[Waila] Zobrazit/Skrýt
|
||||
waila.keybind.wailaconfig=[Waila] Nastavení obrazu
|
||||
waila.keybind.wailadisplay=[Waila] Zobrazit/Skrýt
|
||||
waila.keybind.showadvanced=[Waila] Rozšířit popisek
|
||||
waila.keybind.liquid=[Waila] Zobrazit tekutiny
|
||||
waila.keybind.recipe=[Waila] Zobrazit recept
|
||||
waila.keybind.usage=[Waila] Zobrazit použití
|
||||
waila.keybind.testing=[Waila] Testování
|
||||
waila.keybind.usage=[Waila] Zobrazit použití
|
||||
waila.keybind.testing=[Waila] Testování
|
||||
|
||||
client.msg.norecipe=Nenalezen žádný recept.
|
||||
client.msg.nousage=Nenalezeno žádné využití.
|
||||
client.msg.norecipe=Nenalezen žádný recept.
|
||||
client.msg.nousage=Nenalezeno žádné využití.
|
||||
|
||||
hud.msg.none=<Nic>
|
||||
hud.msg.empty=<Prázdný>
|
||||
hud.msg.output=Výstup
|
||||
hud.msg.holdkeymoreinfo=Držte %s pro více informací
|
||||
|
||||
hud.msg.empty=Prázdný
|
||||
hud.msg.output=Výstup
|
||||
hud.msg.input=Vstup
|
||||
hud.msg.out=Ven
|
||||
hud.msg.in=Dovnitø
|
||||
hud.msg.in=Dovnitø
|
||||
hud.msg.power=Energie
|
||||
hud.msg.storage=Úložištì
|
||||
hud.msg.stored=Uloženo
|
||||
hud.msg.any=Jakýkoliv
|
||||
hud.msg.mode=Mód
|
||||
hud.msg.maxpower=Maximální Energie
|
||||
hud.msg.trigger=Spouštìè
|
||||
hud.msg.maxio=Maximální propustnost
|
||||
hud.msg.storage=Úložištì
|
||||
hud.msg.stored=Uloženo
|
||||
hud.msg.any=Jakýkoliv
|
||||
hud.msg.mode=Mód
|
||||
hud.msg.maxpower=Maximální Energie
|
||||
hud.msg.trigger=Spouštìè
|
||||
hud.msg.maxio=Maximální propustnost
|
||||
|
||||
hud.msg.send=Odeslat
|
||||
hud.msg.recv=Obdržet
|
||||
hud.msg.item=Pøedmìt
|
||||
hud.msg.recv=Obdržet
|
||||
hud.msg.item=Pøedmìt
|
||||
hud.msg.fluid=Tekutina
|
||||
hud.msg.energ=Energie
|
||||
hud.msg.frequency=Frekvence
|
||||
|
||||
hud.msg.owner=Vlastník
|
||||
hud.msg.public=Veøejné
|
||||
hud.msg.restricted=Omezené
|
||||
hud.msg.private=Soukromé
|
||||
hud.msg.owner=Vlastník
|
||||
hud.msg.public=Veøejné
|
||||
hud.msg.restricted=Omezené
|
||||
hud.msg.private=Soukromé
|
||||
|
||||
hud.msg.white=Bílá
|
||||
hud.msg.orange=Oranžová
|
||||
hud.msg.magenta=Purpurová
|
||||
hud.msg.lblue=Svìtle modrá
|
||||
hud.msg.yellow=Žlutá
|
||||
hud.msg.lime=Svìtle zelená
|
||||
hud.msg.pink=Rùžová
|
||||
hud.msg.gray=Šedá
|
||||
hud.msg.lgray=Svìtle šedá
|
||||
hud.msg.cyan=Tyrkysová
|
||||
hud.msg.purple=Fialová
|
||||
hud.msg.blue=Modrá
|
||||
hud.msg.brown=Hnìdá
|
||||
hud.msg.green=Zelená
|
||||
hud.msg.red=Èervená
|
||||
hud.msg.black=Èerná
|
||||
hud.msg.white=Bílá
|
||||
hud.msg.orange=Oranžová
|
||||
hud.msg.magenta=Purpurová
|
||||
hud.msg.lblue=Svìtle modrá
|
||||
hud.msg.yellow=Žlutá
|
||||
hud.msg.lime=Svìtle zelená
|
||||
hud.msg.pink=Rùžová
|
||||
hud.msg.gray=Šedá
|
||||
hud.msg.lgray=Svìtle šedá
|
||||
hud.msg.cyan=Tyrkysová
|
||||
hud.msg.purple=Fialová
|
||||
hud.msg.blue=Modrá
|
||||
hud.msg.brown=Hnìdá
|
||||
hud.msg.green=Zelená
|
||||
hud.msg.red=Èervená
|
||||
hud.msg.black=Èerná
|
||||
|
||||
hud.msg.growth=Rùst
|
||||
hud.msg.mature=Stáøí
|
||||
hud.msg.growth=Rùst
|
||||
hud.msg.mature=Stáøí
|
||||
hud.msg.off=Vypnuto
|
||||
hud.msg.on=Zapnuto
|
||||
hud.msg.state=Stav
|
||||
hud.msg.delay=Prodleva
|
||||
hud.msg.comparator=Porovnávaè
|
||||
hud.msg.comparator=Porovnávaè
|
||||
hud.msg.substractor=Substraktor
|
||||
hud.msg.record=Záznam
|
||||
hud.msg.record=Záznam
|
||||
|
||||
hud.msg.offers=Poskytuje
|
||||
hud.msg.demands=Požaduje
|
||||
hud.msg.demands=Požaduje
|
||||
|
||||
option.appeng.monitorcontent=Obsah monitoru
|
||||
option.bb.content=Obsah barelu
|
||||
option.bc.tankamount=Množství tekutiny
|
||||
option.bc.tankamount=Množství tekutiny
|
||||
option.bc.tanktype=Typ tekutiny
|
||||
option.enderstorage.colors=Barvy
|
||||
option.ic2.inputeumach=Maximální pøíjem EU [Stroje]
|
||||
option.ic2.inputeuother=Maximální pøíjem EU [Ostatní]
|
||||
option.ic2.inputeu=Maximální pøijem EU
|
||||
option.ic2.outputeu=Maximální výstup EU
|
||||
option.ic2.storage=Uloženo energie
|
||||
option.ic2.consump=Zobrazit spotøebu
|
||||
option.ic2.tradeomat=Zobrazit Trade-O-Mat požadavek
|
||||
option.thaumcraft.storedvis=Úložištì kondenzátoru
|
||||
option.thermalexpansion.energyhandler=Zobrazit úložištì RF
|
||||
option.thermalexpansion.energycell=Zobrazit ECell VSTUP/VÝSTUP
|
||||
option.ic2.inputeumach=Maximální pøíjem EU [Stroje]
|
||||
option.ic2.inputeuother=Maximální pøíjem EU [Ostatní]
|
||||
option.ic2.inputeu=Maximální pøijem EU
|
||||
option.ic2.outputeu=Maximální výstup EU
|
||||
option.ic2.storage=Uloženo energie
|
||||
option.ic2.consump=Zobrazit spotøebu
|
||||
option.ic2.tradeomat=Zobrazit Trade-O-Mat požadavek
|
||||
option.thaumcraft.storedvis=Úložištì kondenzátoru
|
||||
option.thermalexpansion.energyhandler=Zobrazit úložištì RF
|
||||
option.thermalexpansion.energycell=Zobrazit ECell VSTUP/VÝSTUP
|
||||
option.thermalexpansion.fluidtype=Zobrazit typ tekutiny
|
||||
option.thermalexpansion.fluidamount=Zobrazit množství tekutiny
|
||||
option.thermalexpansion.tankmode=Zobrazit mód nádrže
|
||||
option.thermalexpansion.fluidamount=Zobrazit množství tekutiny
|
||||
option.thermalexpansion.tankmode=Zobrazit mód nádrže
|
||||
option.thermalexpansion.tesssendrecv=Tesseract mode
|
||||
option.thermalexpansion.tessfreq=Frekvence Teseraktu
|
||||
option.thermalexpansion.owner=Zobrazit majitele
|
||||
option.thermalexpansion.conditemmode=Zobrazit mód Itemduktu
|
||||
option.thermalexpansion.conditemmode=Zobrazit mód Itemduktu
|
||||
option.vanilla.spawntype=Typ spawneru
|
||||
option.vanilla.growthvalue=Hodnota rùstu
|
||||
option.vanilla.leverstate=Stav páky
|
||||
option.vanilla.repeater=Prodleva opakovaèe
|
||||
option.vanilla.comparator=Mód porovnávaèe
|
||||
option.vanilla.redstone=Ruditová energie
|
||||
option.vanilla.jukebox=Jukeboxový disk
|
||||
option.vanilla.silverfish=Skrýt rybenku
|
||||
option.vanilla.growthvalue=Hodnota rùstu
|
||||
option.vanilla.leverstate=Stav páky
|
||||
option.vanilla.repeater=Prodleva opakovaèe
|
||||
option.vanilla.comparator=Mód porovnávaèe
|
||||
option.vanilla.redstone=Ruditová energie
|
||||
option.vanilla.jukebox=Jukeboxový disk
|
||||
option.vanilla.silverfish=Skrýt rybenku
|
||||
option.etb.displaydata=Zobrazit data slotu
|
||||
option.enderio.inout=Zobrazit vstup/výstup
|
||||
option.enderio.storage=Zobrazit uskladnìné MJ
|
||||
option.enderio.inout=Zobrazit vstup/výstup
|
||||
option.enderio.storage=Zobrazit uskladnìné MJ
|
||||
option.enderio.owner=Zobrazit majitele bloku
|
||||
option.enderio.channel=Zobrazit kanál nadkrychle
|
||||
option.bcapi.storage=Zobrazit uskladnìné MJ
|
||||
option.bcapi.consump=Zobrazit maximální energii
|
||||
option.bcapi.trigger=Zobrazit spouštìjící se energii
|
||||
option.pr.showio=Zobrazit IO brány
|
||||
option.enderio.channel=Zobrazit kanál nadkrychle
|
||||
option.bcapi.storage=Zobrazit uskladnìné MJ
|
||||
option.bcapi.consump=Zobrazit maximální energii
|
||||
option.bcapi.trigger=Zobrazit spouštìjící se energii
|
||||
option.pr.showio=Zobrazit IO brány
|
||||
option.pr.showdata=Zobrazit data bran
|
||||
option.extrautilities.fluidamount=Zobrazit množství tekutin
|
||||
option.openblocks.fluidamount=Zobrazit množství tekutin
|
||||
option.railcraft.fluidamount=Zobrazit množství tekutin
|
||||
option.secretrooms.hide=Skrýt camo bloky
|
||||
option.carpenters.hide=Skrýt camo bloky
|
||||
option.extrautilities.fluidamount=Zobrazit množství tekutin
|
||||
option.openblocks.fluidamount=Zobrazit množství tekutin
|
||||
option.railcraft.fluidamount=Zobrazit množství tekutin
|
||||
option.secretrooms.hide=Skrýt camo bloky
|
||||
option.carpenters.hide=Skrýt camo bloky
|
||||
option.stevescarts.showall=Zobrazit data
|
||||
option.stevescarts.colorblind=Barevný mód
|
||||
option.stevescarts.shifttoggle=Shift pro pøepnutí
|
||||
option.general.showhp=Zobrazit zdraví entit
|
||||
option.general.showcrop=Zobrazit rùst plodin
|
||||
option.stevescarts.colorblind=Barevný mód
|
||||
option.stevescarts.shifttoggle=Shift pro pøepnutí
|
||||
option.general.showhp=Zobrazit zdraví entit
|
||||
option.general.showcrop=Zobrazit rùst plodin
|
||||
option.thaumcraft.aspects=Zobrazit aspekty
|
||||
@@ -30,6 +30,7 @@ enchant.label.enchantability=Verzauberbarkeit
|
||||
|
||||
waila.keybind.wailaconfig=[Waila] Config-Bildschirm
|
||||
waila.keybind.wailadisplay=[Waila] Zeigen/Verstecken
|
||||
waila.keybind.showadvanced=[Waila] Tooltip erweitern
|
||||
waila.keybind.liquid=[Waila] Zeige Flüssigkeiten
|
||||
waila.keybind.recipe=[Waila] Zeige Rezept
|
||||
waila.keybind.usage=[Waila] Zeige Nutzung
|
||||
@@ -38,8 +39,9 @@ waila.keybind.testing=[Waila] Testen
|
||||
client.msg.norecipe=Kein Rezept gefunden.
|
||||
client.msg.nousage=Keine Nutzung gefunden.
|
||||
|
||||
hud.msg.none=<Nichts>
|
||||
hud.msg.empty=<Leer>
|
||||
hud.msg.holdkeymoreinfo=Halte %s für mehr Infos
|
||||
|
||||
hud.msg.empty=Leer
|
||||
hud.msg.output=Output
|
||||
hud.msg.input=Input
|
||||
hud.msg.out=Out
|
||||
|
||||
@@ -20,6 +20,7 @@ choice.toggledmaintained=Toggled/Maintained
|
||||
choice.showliquids=Liquids
|
||||
choice.shifttoggledblock=Sneak toggle blocks
|
||||
choice.shifttoggledents=Sneak toggle entities
|
||||
choice.showicon=Show/Hide Icon
|
||||
screen.button.configureaspect=Configure aspect...
|
||||
|
||||
enchant.title.name=Name
|
||||
@@ -30,6 +31,7 @@ enchant.label.enchantability=Enchantability
|
||||
|
||||
waila.keybind.wailaconfig=[Waila] Config screen
|
||||
waila.keybind.wailadisplay=[Waila] Show/Hide
|
||||
waila.keybind.showadvanced=[Waila] Expand Tooltip
|
||||
waila.keybind.liquid=[Waila] Show liquids
|
||||
waila.keybind.recipe=[Waila] Show recipe
|
||||
waila.keybind.usage=[Waila] Show usage
|
||||
@@ -38,8 +40,9 @@ waila.keybind.testing=[Waila] Testing
|
||||
client.msg.norecipe=No recipe found.
|
||||
client.msg.nousage=No usage found.
|
||||
|
||||
hud.msg.none=<None>
|
||||
hud.msg.empty=<Empty>
|
||||
hud.msg.holdkeymoreinfo=Hold %s for more info
|
||||
|
||||
hud.msg.empty=Empty
|
||||
hud.msg.output=Output
|
||||
hud.msg.input=Input
|
||||
hud.msg.out=Out
|
||||
@@ -111,6 +114,7 @@ option.ic2.consump=Show consumption
|
||||
option.ic2.tradeomat=Show Trade-O-Mat request
|
||||
option.thaumcraft.storedvis=Capacitor storage
|
||||
option.thermalexpansion.energyhandler=Show RF storage
|
||||
option.thermalexpansion.rfenergybar=Use Progress Bar for RF
|
||||
option.thermalexpansion.energycell=Show ECell IN/OUT
|
||||
option.thermalexpansion.fluidtype=Show fluid type
|
||||
option.thermalexpansion.fluidamount=Show fluid amount
|
||||
|
||||
@@ -38,8 +38,7 @@ waila.keybind.testing=[Waila] Testimine
|
||||
client.msg.norecipe=Ühtegi retsepti ei leitud.
|
||||
client.msg.nousage=Ühtegi kasutust ei leitud.
|
||||
|
||||
hud.msg.none=<Mitte Ükski>
|
||||
hud.msg.empty=<Tühi>
|
||||
hud.msg.empty=Tühi
|
||||
hud.msg.output=Väljund
|
||||
hud.msg.input=Sisend
|
||||
hud.msg.out=Välja
|
||||
|
||||
@@ -30,6 +30,7 @@ enchant.label.enchantability=Loitsitav
|
||||
|
||||
waila.keybind.wailaconfig=[Waila] Konfiguratsiooni ekraan
|
||||
waila.keybind.wailadisplay=[Waila] Näita/Peida
|
||||
waila.keybind.showadvanced=[Waila] Laienda kohtspikrit
|
||||
waila.keybind.liquid=[Waila] Näita vedelikke
|
||||
waila.keybind.recipe=[Waila] Näita retsepti
|
||||
waila.keybind.usage=[Waila] Näita kasutamist
|
||||
@@ -38,8 +39,9 @@ waila.keybind.testing=[Waila] Testimine
|
||||
client.msg.norecipe=Ühtegi retsepti ei leitud.
|
||||
client.msg.nousage=Ühtegi kasutust ei leitud.
|
||||
|
||||
hud.msg.none=<Mitte Ükski>
|
||||
hud.msg.empty=<Tühi>
|
||||
hud.msg.holdkeymoreinfo=Hoia %s lisainfo saamiseks
|
||||
|
||||
hud.msg.empty=Tühi
|
||||
hud.msg.output=Väljund
|
||||
hud.msg.input=Sisend
|
||||
hud.msg.out=Välja
|
||||
|
||||
@@ -28,6 +28,7 @@ enchant.label.enchantability=Enchantabilitée
|
||||
|
||||
waila.keybind.wailaconfig=[Waila] Ecran de config
|
||||
waila.keybind.wailadisplay=[Waila] Afficher/Masquer
|
||||
waila.keybind.showadvanced=[Waila] Développer l'info-bulle
|
||||
waila.keybind.liquid=[Waila] Afficher les liquides
|
||||
waila.keybind.recipe=[Waila] Afficher les recettes
|
||||
waila.keybind.usage=[Waila] Afficher l'utilisation
|
||||
@@ -36,8 +37,9 @@ waila.keybind.testing=[Waila] Test
|
||||
client.msg.norecipe=Pas de recette trouvée.
|
||||
client.msg.nousage=Pas d'utilisation trouvée.
|
||||
|
||||
hud.msg.none=<Aucun>
|
||||
hud.msg.empty=<Vide>
|
||||
hud.msg.holdkeymoreinfo=Maintenez %s pour plus d'infos
|
||||
|
||||
hud.msg.empty=Vide
|
||||
hud.msg.output=Sortie
|
||||
hud.msg.input=Entrée
|
||||
hud.msg.out=Sortie
|
||||
|
||||
@@ -30,6 +30,7 @@ enchant.label.enchantability=Incantabilità
|
||||
|
||||
waila.keybind.wailaconfig=[Waila] Config menù
|
||||
waila.keybind.wailadisplay=[Waila] Mostra/Nascondi
|
||||
waila.keybind.showadvanced=[Waila] Espandi tooltip
|
||||
waila.keybind.liquid=[Waila] Mostra liquidi
|
||||
waila.keybind.recipe=[Waila] Mostra ricetta
|
||||
waila.keybind.usage=[Waila] Mostra uso
|
||||
@@ -38,8 +39,9 @@ waila.keybind.testing=[Waila] Provare
|
||||
client.msg.norecipe=Nessuna ricetta trovata.
|
||||
client.msg.nousage=Nessun uso trovato.
|
||||
|
||||
hud.msg.none=<Niente>
|
||||
hud.msg.empty=<Vuoto>
|
||||
hud.msg.holdkeymoreinfo=Tieni premuto %s per più info
|
||||
|
||||
hud.msg.empty=Vuoto
|
||||
hud.msg.output=Uscita
|
||||
hud.msg.input=Entrata
|
||||
hud.msg.out=Fuori
|
||||
|
||||
@@ -28,6 +28,7 @@ enchant.label.enchantability=Enchantbaarheid
|
||||
|
||||
waila.keybind.wailaconfig=[Waila] Configuratiescherm
|
||||
waila.keybind.wailadisplay=[Waila] Toon/Verberg
|
||||
waila.keybind.showadvanced=[Waila] Tooltip uitvouwen
|
||||
waila.keybind.liquid=[Waila] Toon vloeistoffen
|
||||
waila.keybind.recipe=[Waila] Toon recepten
|
||||
waila.keybind.usage=[Waila] Toon gebruik
|
||||
@@ -36,8 +37,9 @@ waila.keybind.testing=[Waila] Testen
|
||||
client.msg.norecipe=Geen recept gevonden.
|
||||
client.msg.nousage=Geen gebruik gevonden.
|
||||
|
||||
hud.msg.none=<Geen>
|
||||
hud.msg.empty=<Leeg>
|
||||
hud.msg.holdkeymoreinfo=Houd %s ingedrukt voor meer info
|
||||
|
||||
hud.msg.empty=Leeg
|
||||
hud.msg.output=Uitvoer
|
||||
hud.msg.input=Invoer
|
||||
hud.msg.out=Uit
|
||||
|
||||
@@ -30,6 +30,7 @@ enchant.label.enchantability=Зачарование
|
||||
|
||||
waila.keybind.wailaconfig=[Waila] Меню настроек
|
||||
waila.keybind.wailadisplay=[Waila] Показать/Скрыть
|
||||
waila.keybind.showadvanced=[Waila] Развернуть подсказку
|
||||
waila.keybind.liquid=[Waila] Показать жидкости
|
||||
waila.keybind.recipe=[Waila] Показать рецепт
|
||||
waila.keybind.usage=[Waila] Показать применение
|
||||
@@ -38,8 +39,9 @@ waila.keybind.testing=[Waila] Тестировать
|
||||
client.msg.norecipe=Рецептов не найдено.
|
||||
client.msg.nousage=Применений не найдено.
|
||||
|
||||
hud.msg.none=<Ничего>
|
||||
hud.msg.empty=<Пусто>
|
||||
hud.msg.holdkeymoreinfo=Удерживайте %s для подробностей
|
||||
|
||||
hud.msg.empty=Пусто
|
||||
hud.msg.output=Вывод
|
||||
hud.msg.input=Ввод
|
||||
hud.msg.out=Из
|
||||
|
||||
@@ -30,6 +30,7 @@ enchant.label.enchantability=附魔能力
|
||||
|
||||
waila.keybind.wailaconfig=[Waila]配置屏幕
|
||||
waila.keybind.wailadisplay=[Waila]显示/隐藏
|
||||
waila.keybind.showadvanced=[Waila]展开工具提示
|
||||
waila.keybind.liquid=[Waila]显示流体
|
||||
waila.keybind.recipe=[Waila]显示合成
|
||||
waila.keybind.usage=[Waila]显示可参与合成
|
||||
@@ -38,8 +39,9 @@ waila.keybind.testing=[Waila]测试中
|
||||
client.msg.norecipe=未发现合成表.
|
||||
client.msg.nousage=未发现可参与合成.
|
||||
|
||||
hud.msg.none=<无>
|
||||
hud.msg.empty=<空>
|
||||
hud.msg.holdkeymoreinfo=按住 %s 查看更多信息
|
||||
|
||||
hud.msg.empty=空
|
||||
hud.msg.output=输出
|
||||
hud.msg.input=输入
|
||||
hud.msg.out=输出
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 145 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Reference in new issue
Block a user