mirror of
https://github.com/GTNewHorizons/waila.git
synced 2026-11-21 20:52:40 +00:00
Compare commits
18
Commits
v1.5.9_1.7.10
...
1.5.11
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07b0b83f4a | ||
|
|
d932d91a77 | ||
|
|
87261267e1 | ||
|
|
7af9692632 | ||
|
|
1eb78112eb | ||
|
|
4ed103dd25 | ||
|
|
118bab5a2b | ||
|
|
ce6474fc29 | ||
|
|
cbeb3b3628 | ||
|
|
d27d6db57c | ||
|
|
e60974ab20 | ||
|
|
f481e46fb2 | ||
|
|
7638322f7f | ||
|
|
0afbc6efb4 | ||
|
|
737c4e2cbf | ||
|
|
f4f5920d88 | ||
|
|
ea95fadb78 | ||
|
|
77277c6024 |
No files matched your search
@@ -1,2 +1,10 @@
|
||||
syntax: glob
|
||||
*.orig
|
||||
.gradle
|
||||
build
|
||||
eclipse
|
||||
out
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
src/main/java/net/*
|
||||
+2
-2
@@ -35,7 +35,7 @@ apply plugin: 'java'
|
||||
apply plugin: 'forge'
|
||||
apply plugin: 'maven'
|
||||
|
||||
version = "1.5.9_1.7.10"
|
||||
version = "1.5.11-RC3_1.7.10"
|
||||
group= "mcp.mobius.waila" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "Waila"
|
||||
|
||||
@@ -57,7 +57,7 @@ dependencies {
|
||||
}
|
||||
|
||||
minecraft {
|
||||
version = "1.7.10-10.13.2.1291"
|
||||
version = "1.7.10-${config.forge_version}-1.7.10"
|
||||
runDir = "eclipse"
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
mc_version=1.7.10
|
||||
forge_version=10.13.0.1187
|
||||
ccl_version=1.1.1.106
|
||||
ccc_version=1.0.4.+
|
||||
nei_version=1.0.4.+
|
||||
forge_version=10.13.4.1448
|
||||
ccl_version=1.1.3.138
|
||||
ccc_version=1.0.7.+
|
||||
nei_version=1.0.5.+
|
||||
mod_version=1.0
|
||||
waila_version=1.5.2a
|
||||
@@ -44,7 +44,7 @@ import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.client.KeyEvent;
|
||||
import mcp.mobius.waila.commands.CommandDumpHandlers;
|
||||
|
||||
@Mod(modid="Waila", name="Waila", version="1.5.8", dependencies="after:NotEnoughItems@[1.0.4.0,)", acceptableRemoteVersions="*")
|
||||
@Mod(modid="Waila", name="Waila", version="1.5.11", dependencies="after:NotEnoughItems@[1.0.4.0,)", acceptableRemoteVersions="*")
|
||||
/*
|
||||
@NetworkMod(channels = {"Waila"},clientSideRequired=false, serverSideRequired=false, connectionHandler = WailaConnectionHandler.class,
|
||||
packetHandler = WailaPacketHandler.class, versionBounds="[1.5.0,)")
|
||||
|
||||
@@ -14,7 +14,7 @@ public class ExtraUtilitiesModule {
|
||||
|
||||
|
||||
try{
|
||||
Class ModExtraUtilities = Class.forName("extrautils.ExtraUtils");
|
||||
Class ModExtraUtilities = Class.forName("com.rwtema.extrautils.ExtraUtils");
|
||||
Waila.log.log(Level.INFO, "ExtraUtilities mod found.");
|
||||
} catch (ClassNotFoundException e){
|
||||
Waila.log.log(Level.INFO, "[ExtraUtilities] ExtraUtilities mod not found.");
|
||||
@@ -22,7 +22,7 @@ public class ExtraUtilitiesModule {
|
||||
}
|
||||
|
||||
try{
|
||||
TileEntityDrum = Class.forName("extrautils.tileentity.TileEntityDrum");
|
||||
TileEntityDrum = Class.forName("com.rwtema.extrautils.tileentity.TileEntityDrum");
|
||||
} catch (ClassNotFoundException e){
|
||||
Waila.log.log(Level.WARN, "[ExtraUtilities] Class not found. " + e);
|
||||
return;
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package mcp.mobius.waila.addons.thermaldynamics;
|
||||
|
||||
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 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 java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Lordmau5 on 28.02.2015.
|
||||
*/
|
||||
public class HUDHandlerDuct 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;
|
||||
|
||||
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;
|
||||
|
||||
int amount = 0;
|
||||
|
||||
NBTTagCompound tag = accessor.getNBTData();
|
||||
if (tag.hasKey("Amount"))
|
||||
amount = accessor.getNBTInteger(tag, "Amount");
|
||||
|
||||
currenttip.add(String.format(" %d / 1000 mB", amount));
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package mcp.mobius.waila.addons.thermaldynamics;
|
||||
|
||||
import mcp.mobius.waila.Waila;
|
||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
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){
|
||||
Waila.log.log(Level.WARN, "[Thermal Dynamics] Error while loading FluidDuct hooks." + e);
|
||||
}
|
||||
|
||||
// XXX : We register the IBlockInfo interface
|
||||
/*
|
||||
try{
|
||||
IBlockInfo = Class.forName("cofh.api.block.IBlockInfo");
|
||||
IBlockInfo_getBlockInfo = IBlockInfo.getMethod("getBlockInfo", IBlockAccess.class, int.class, int.class, int.class, ForgeDirection.class, EntityPlayer.class, List.class, boolean.class);
|
||||
|
||||
|
||||
//ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energyhandler");
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerIBlockInfo(), IBlockInfo);
|
||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerIBlockInfo(), IBlockInfo);
|
||||
|
||||
} catch (Exception e){
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading IBlockInfo hooks." + e);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package mcp.mobius.waila.addons.thermalexpansion;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameData;
|
||||
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 net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.List;
|
||||
|
||||
public class HUDHandlerCache 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.cache"))
|
||||
return currenttip;
|
||||
try {
|
||||
ItemStack storedItem = null;
|
||||
if(accessor.getNBTData().hasKey("Item"))
|
||||
storedItem = readItemStack(accessor.getNBTData().getCompoundTag("Item"));
|
||||
|
||||
String name = currenttip.get(0);
|
||||
String color = "";
|
||||
if(name.startsWith("\u00a7"))
|
||||
color = name.substring(0, 2);
|
||||
|
||||
if(storedItem != null) {
|
||||
String namex = GameData.getItemRegistry().getNameForObject(storedItem.getItem());
|
||||
name += String.format(" < " + SpecialChars.getRenderString("waila.stack", "1", namex, "0", String.valueOf(storedItem.getItemDamage())) + color + " %s >", storedItem.getDisplayName());
|
||||
}
|
||||
else
|
||||
name += " " + LangUtil.translateG("hud.msg.empty");
|
||||
|
||||
currenttip.set(0, name);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
if (!config.getConfig("thermalexpansion.cache"))
|
||||
return currenttip;
|
||||
|
||||
NBTTagCompound tag = accessor.getNBTData();
|
||||
ItemStack storedItem = null;
|
||||
if(tag.hasKey("Item"))
|
||||
storedItem = readItemStack(tag.getCompoundTag("Item"));
|
||||
|
||||
int stored = 0;
|
||||
int maxStored = 0;
|
||||
if(tag.hasKey("Stored"))
|
||||
stored = tag.getInteger("Stored");
|
||||
if(tag.hasKey("MaxStored"))
|
||||
maxStored = tag.getInteger("MaxStored");
|
||||
|
||||
if(storedItem != null) {
|
||||
currenttip.add("Stored: " + stored + "/" + maxStored);
|
||||
}
|
||||
else
|
||||
currenttip.add("Capacity: " + maxStored);
|
||||
|
||||
|
||||
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);
|
||||
try {
|
||||
tag.setInteger("MaxStored", (Integer) ThermalExpansionModule.TileCache_getMaxStored.invoke(te));
|
||||
tag.setInteger("Stored", (Integer) ThermalExpansionModule.TileCache_getStored.invoke(te));
|
||||
} catch (InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return tag;
|
||||
}
|
||||
|
||||
public ItemStack readItemStack(NBTTagCompound tag) {
|
||||
ItemStack is = new ItemStack(Item.getItemById(tag.getShort("id")));
|
||||
is.stackSize = tag.getInteger("Count");
|
||||
is.setItemDamage(Math.max(0, tag.getShort("Damage")));
|
||||
if (tag.hasKey("tag", 10)) {
|
||||
is.stackTagCompound = tag.getCompoundTag("tag");
|
||||
}
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
}
|
||||
+34
-17
@@ -1,16 +1,12 @@
|
||||
package mcp.mobius.waila.addons.thermalexpansion;
|
||||
|
||||
import mcp.mobius.waila.Waila;
|
||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import mcp.mobius.waila.Waila;
|
||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
|
||||
public class ThermalExpansionModule {
|
||||
|
||||
@@ -44,6 +40,11 @@ public class ThermalExpansionModule {
|
||||
public static Class ISecureTile = null;
|
||||
public static Method ISecureTile_getAccess = null;
|
||||
public static Method ISecureTile_getOwnerName = null;
|
||||
|
||||
public static Class TileCache = null;
|
||||
public static Method TileCache_getItemStack = null;
|
||||
public static Method TileCache_getMaxStored = null;
|
||||
public static Method TileCache_getStored = null;
|
||||
|
||||
public static Class BlockMultipart = null;
|
||||
|
||||
@@ -76,15 +77,15 @@ public class ThermalExpansionModule {
|
||||
|
||||
} catch (Exception e){
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Energy hooks." + e);
|
||||
}
|
||||
}
|
||||
|
||||
// XXX : We register the energy cell
|
||||
try{
|
||||
TileEnergyCell = Class.forName("thermalexpansion.block.cell.TileCell");
|
||||
TileEnergyCell = Class.forName("cofh.thermalexpansion.block.cell.TileCell");
|
||||
TileEnergyCell_Recv = TileEnergyCell.getDeclaredField("energyReceive");
|
||||
TileEnergyCell_Send = TileEnergyCell.getDeclaredField("energySend");
|
||||
|
||||
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energycell");
|
||||
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.energycell");
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerEnergyCell(), TileEnergyCell);
|
||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerEnergyCell(), TileEnergyCell);
|
||||
|
||||
@@ -94,7 +95,7 @@ public class ThermalExpansionModule {
|
||||
|
||||
// XXX : We register the Tank interface
|
||||
try{
|
||||
TileTank = Class.forName("thermalexpansion.block.tank.TileTank");
|
||||
TileTank = Class.forName("cofh.thermalexpansion.block.tank.TileTank");
|
||||
TileTank_getTankFluid = TileTank.getMethod("getTankFluid");
|
||||
TileTank_getTankCapacity = TileTank.getMethod("getTankCapacity");
|
||||
TileTank_getTankAmount = TileTank.getMethod("getTankFluidAmount");
|
||||
@@ -113,7 +114,7 @@ public class ThermalExpansionModule {
|
||||
|
||||
// XXX : We register the Tesseract interface
|
||||
try{
|
||||
TileTesseract = Class.forName("thermalexpansion.block.ender.TileTesseract");
|
||||
TileTesseract = Class.forName("cofh.thermalexpansion.block.ender.TileTesseract");
|
||||
TileTesseract_Item = TileTesseract.getDeclaredField("modeItem");
|
||||
TileTesseract_Fluid = TileTesseract.getDeclaredField("modeFluid");
|
||||
TileTesseract_Energy = TileTesseract.getDeclaredField("modeEnergy");
|
||||
@@ -141,9 +142,25 @@ public class ThermalExpansionModule {
|
||||
|
||||
} catch (Exception e){
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading ISecureTile hooks." + e);
|
||||
}
|
||||
|
||||
// XXX : We register the IBlockInfo interface
|
||||
}
|
||||
|
||||
// XXX : We register the Cache interface
|
||||
try{
|
||||
TileCache = Class.forName("cofh.thermalexpansion.block.cache.TileCache");
|
||||
TileCache_getItemStack = TileCache.getDeclaredMethod("getStoredItemType");
|
||||
TileCache_getMaxStored = TileCache.getDeclaredMethod("getMaxStoredCount");
|
||||
TileCache_getStored = TileCache.getDeclaredMethod("getStoredCount");
|
||||
|
||||
ModuleRegistrar.instance().addConfigRemote("Thermal Expansion", "thermalexpansion.cache");
|
||||
ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerCache(), TileCache);
|
||||
ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerCache(), TileCache);
|
||||
ModuleRegistrar.instance().registerNBTProvider (new HUDHandlerCache(), TileCache);
|
||||
|
||||
} catch (Exception e){
|
||||
Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tesseract hooks." + e);
|
||||
}
|
||||
|
||||
// XXX : We register the IBlockInfo interface
|
||||
/*
|
||||
try{
|
||||
IBlockInfo = Class.forName("cofh.api.block.IBlockInfo");
|
||||
|
||||
@@ -40,6 +40,9 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
|
||||
static Block doubleplant = Blocks.double_plant;
|
||||
static Block leave = Blocks.leaves;
|
||||
static Block leave2 = Blocks.leaves2;
|
||||
static Block log = Blocks.log;
|
||||
static Block log2 = Blocks.log2;
|
||||
static Block quartz = Blocks.quartz_block;
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
@@ -84,6 +87,14 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
|
||||
return new ItemStack(block, 1, accessor.getMetadata() - 4);
|
||||
}
|
||||
|
||||
if (block == log || block == log2){
|
||||
return new ItemStack(block, 1, accessor.getMetadata()%4);
|
||||
}
|
||||
|
||||
if ((block == quartz) && (accessor.getMetadata() > 2)){
|
||||
return new ItemStack(block, 1, 2);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
@@ -228,6 +239,9 @@ public class HUDHandlerVanilla implements IWailaDataProvider {
|
||||
ModuleRegistrar.instance().registerStackProvider(provider, crops.getClass());
|
||||
ModuleRegistrar.instance().registerStackProvider(provider, leave.getClass());
|
||||
ModuleRegistrar.instance().registerStackProvider(provider, leave2.getClass());
|
||||
ModuleRegistrar.instance().registerStackProvider(provider, log.getClass());
|
||||
ModuleRegistrar.instance().registerStackProvider(provider, log2.getClass());
|
||||
ModuleRegistrar.instance().registerStackProvider(provider, quartz.getClass());
|
||||
|
||||
//ModuleRegistrar.instance().registerStackProvider(provider, Block.class);
|
||||
ModuleRegistrar.instance().registerHeadProvider(provider, mobSpawner.getClass());
|
||||
|
||||
@@ -135,7 +135,10 @@ public class ConfigHandler implements IWailaConfigHandler {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Some accessor helpers */
|
||||
public boolean showTooltip(){
|
||||
return getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import mcp.mobius.waila.cbcore.Layout;
|
||||
import mcp.mobius.waila.network.Message0x01TERequest;
|
||||
import mcp.mobius.waila.network.Message0x03EntRequest;
|
||||
import mcp.mobius.waila.network.WailaPacketHandler;
|
||||
import mcp.mobius.waila.utils.Constants;
|
||||
import mcp.mobius.waila.utils.WailaExceptionHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -23,6 +24,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
public class MetaDataProvider{
|
||||
|
||||
@@ -68,7 +70,7 @@ public class MetaDataProvider{
|
||||
public List<String> handleBlockTextData(ItemStack itemStack, World world, EntityPlayer player, MovingObjectPosition mop, DataAccessorCommon accessor, List<String> currenttip, Layout layout) {
|
||||
Block block = accessor.getBlock();
|
||||
|
||||
if (accessor.getTileEntity() != null && Waila.instance.serverPresent && accessor.isTimeElapsed(250)){
|
||||
if (accessor.getTileEntity() != null && Waila.instance.serverPresent && accessor.isTimeElapsed(250) && ConfigHandler.instance().showTooltip()){
|
||||
accessor.resetTimer();
|
||||
HashSet<String> keys = new HashSet<String>();
|
||||
|
||||
@@ -81,7 +83,7 @@ public class MetaDataProvider{
|
||||
if (keys.size() != 0 || ModuleRegistrar.instance().hasNBTProviders(block) || ModuleRegistrar.instance().hasNBTProviders(accessor.getTileEntity()))
|
||||
WailaPacketHandler.INSTANCE.sendToServer(new Message0x01TERequest(accessor.getTileEntity(), keys));
|
||||
|
||||
} else if (accessor.getTileEntity() != null && !Waila.instance.serverPresent && accessor.isTimeElapsed(250)) {
|
||||
} else if (accessor.getTileEntity() != null && !Waila.instance.serverPresent && accessor.isTimeElapsed(250) && ConfigHandler.instance().showTooltip()) {
|
||||
|
||||
try{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package mcp.mobius.waila.client;
|
||||
|
||||
import mcp.mobius.waila.Waila;
|
||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
import mcp.mobius.waila.gui.truetyper.FontLoader;
|
||||
import mcp.mobius.waila.gui.truetyper.TrueTypeFont;
|
||||
@@ -40,7 +41,10 @@ public class ProxyClient extends ProxyServer {
|
||||
if (Loader.isModLoaded("NotEnoughItems")){
|
||||
try{
|
||||
Class.forName("mcp.mobius.waila.handlers.nei.NEIHandler").getDeclaredMethod("register").invoke(null);
|
||||
} catch (Exception e){}
|
||||
} catch (Exception e){
|
||||
Waila.log.error("Failed to hook into NEI properly. Reverting to Vanilla tooltip handler");
|
||||
MinecraftForge.EVENT_BUS.register(new VanillaTooltipHandler());
|
||||
}
|
||||
} else {
|
||||
MinecraftForge.EVENT_BUS.register(new VanillaTooltipHandler());
|
||||
}
|
||||
@@ -53,7 +57,8 @@ public class ProxyClient extends ProxyServer {
|
||||
ModuleRegistrar.instance().registerTailProvider(new HUDHandlerEntities(), Entity.class);
|
||||
|
||||
//ModuleRegistrar.instance().registerShortDataProvider(new SummaryProviderDefault(), Item.class);
|
||||
|
||||
|
||||
ModuleRegistrar.instance().addConfig("General", "general.showents");
|
||||
ModuleRegistrar.instance().addConfig("General", "general.showhp");
|
||||
ModuleRegistrar.instance().addConfig("General", "general.showcrop");
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package mcp.mobius.waila.network;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.SimpleChannelInboundHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
import mcp.mobius.waila.utils.AccessHelper;
|
||||
@@ -20,10 +18,11 @@ import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelFutureListener;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.SimpleChannelInboundHandler;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
public class Message0x01TERequest extends SimpleChannelInboundHandler<Message0x01TERequest> implements IWailaMessage {
|
||||
|
||||
@@ -146,11 +145,10 @@ public class Message0x01TERequest extends SimpleChannelInboundHandler<Message0x0
|
||||
tag.setInteger("WailaX", msg.posX);
|
||||
tag.setInteger("WailaY", msg.posY);
|
||||
tag.setInteger("WailaZ", msg.posZ);
|
||||
tag.setString ("WailaID", (String)((HashMap)classToNameMap.get(null)).get(entity.getClass()));
|
||||
|
||||
ctx.writeAndFlush(new Message0x02TENBTData(tag)).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);
|
||||
|
||||
|
||||
tag.setString ("WailaID", (String)((HashMap)classToNameMap.get(null)).get(entity.getClass()));
|
||||
|
||||
WailaPacketHandler.INSTANCE.sendTo(new Message0x02TENBTData(tag), WailaPacketHandler.getPlayer(ctx));
|
||||
//ctx.writeAndFlush(new Message0x02TENBTData(tag)).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);
|
||||
}catch(Throwable e){
|
||||
WailaExceptionHandler.handleErr(e, entity.getClass().toString(), null);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package mcp.mobius.waila.network;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.SimpleChannelInboundHandler;
|
||||
import mcp.mobius.waila.api.IWailaEntityProvider;
|
||||
import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
import mcp.mobius.waila.utils.AccessHelper;
|
||||
@@ -17,10 +17,9 @@ import net.minecraft.network.NetHandlerPlayServer;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelFutureListener;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.SimpleChannelInboundHandler;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
public class Message0x03EntRequest extends SimpleChannelInboundHandler<Message0x03EntRequest> implements IWailaMessage {
|
||||
|
||||
@@ -94,7 +93,8 @@ public class Message0x03EntRequest extends SimpleChannelInboundHandler<Message0x
|
||||
|
||||
tag.setInteger("WailaEntityID", entity.getEntityId());
|
||||
|
||||
ctx.writeAndFlush(new Message0x04EntNBTData(tag)).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);
|
||||
WailaPacketHandler.INSTANCE.sendTo(new Message0x04EntNBTData(tag), WailaPacketHandler.getPlayer(ctx));
|
||||
//ctx.writeAndFlush(new Message0x04EntNBTData(tag)).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);
|
||||
}catch(Throwable e){
|
||||
WailaExceptionHandler.handleErr(e, entity.getClass().toString(), null);
|
||||
}
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
package mcp.mobius.waila.network;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelFutureListener;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.EnumMap;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
import net.minecraft.nbt.NBTSizeTracker;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.network.FMLEmbeddedChannel;
|
||||
import cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec;
|
||||
import cpw.mods.fml.common.network.FMLOutboundHandler;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelFutureListener;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
import net.minecraft.nbt.NBTSizeTracker;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetHandlerPlayServer;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.EnumMap;
|
||||
|
||||
public enum WailaPacketHandler {
|
||||
INSTANCE;
|
||||
@@ -123,5 +122,9 @@ public enum WailaPacketHandler {
|
||||
int j = buffer.readShort();
|
||||
String s = new String(buffer.readBytes(j).array(), Charsets.UTF_8);
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
public static EntityPlayerMP getPlayer(ChannelHandlerContext ctx){
|
||||
return ((NetHandlerPlayServer) ctx.channel().attr(NetworkRegistry.NET_HANDLER).get()).playerEntity;
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ public class OverlayRenderer {
|
||||
mc.theWorld != null &&
|
||||
Minecraft.isGuiEnabled() &&
|
||||
!mc.gameSettings.keyBindPlayerList.getIsKeyPressed() &&
|
||||
ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, true) &&
|
||||
ConfigHandler.instance().showTooltip() &&
|
||||
RayTracing.instance().getTarget() != null))
|
||||
return;
|
||||
|
||||
@@ -40,7 +40,7 @@ public class OverlayRenderer {
|
||||
renderOverlay(WailaTickHandler.instance().tooltip);
|
||||
}
|
||||
|
||||
if (RayTracing.instance().getTarget().typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY)
|
||||
if (RayTracing.instance().getTarget().typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && ConfigHandler.instance().getConfig("general.showents"))
|
||||
{
|
||||
renderOverlay(WailaTickHandler.instance().tooltip);
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public class Tooltip {
|
||||
|
||||
for (String s : textData){
|
||||
|
||||
ArrayList<String> line = new ArrayList(Arrays.asList(patternTab.split(s)));
|
||||
ArrayList<String> line = new ArrayList<String>(Arrays.asList(patternTab.split(s)));
|
||||
ArrayList<Integer> size = new ArrayList<Integer>();
|
||||
for (String ss : line)
|
||||
size.add(DisplayUtil.getDisplayWidth(ss));
|
||||
|
||||
@@ -59,8 +59,10 @@ public class WailaTickHandler{
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void tickClient(TickEvent.ClientTickEvent event) {
|
||||
|
||||
if (!Keyboard.isKeyDown(KeyEvent.key_show.getKeyCode()) && !ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MODE, false)){
|
||||
ConfigHandler.instance().setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, false);
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
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;
|
||||
@@ -20,6 +18,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.thermaldynamics.ThermalDynamicsModule;
|
||||
import mcp.mobius.waila.addons.thermalexpansion.ThermalExpansionModule;
|
||||
import mcp.mobius.waila.addons.twilightforest.TwilightForestModule;
|
||||
import mcp.mobius.waila.addons.vanillamc.HUDHandlerFurnace;
|
||||
@@ -29,6 +28,8 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
import mcp.mobius.waila.handlers.DecoratorFMP;
|
||||
import mcp.mobius.waila.handlers.HUDHandlerFMP;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class ProxyServer {
|
||||
|
||||
public ProxyServer() {}
|
||||
@@ -60,6 +61,9 @@ public class ProxyServer {
|
||||
|
||||
/* Thermal Expansion */
|
||||
ThermalExpansionModule.register();
|
||||
|
||||
/* Thermal Dynamics */
|
||||
ThermalDynamicsModule.register();
|
||||
|
||||
/* ETB */
|
||||
ETBModule.register();
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
screen.button.waila=Waila
|
||||
screen.button.modules=Moduly
|
||||
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.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é
|
||||
|
||||
choice.showhidewaila=Zobrazit/Skrýt Wailu
|
||||
choice.showhideidmeta=Zobrazit ID:Metadata
|
||||
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...
|
||||
|
||||
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
|
||||
|
||||
waila.keybind.wailaconfig=[Waila] Nastavení obrazu
|
||||
waila.keybind.wailadisplay=[Waila] Zobrazit/Skrýt
|
||||
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í
|
||||
|
||||
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.input=Vstup
|
||||
hud.msg.out=Ven
|
||||
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.send=Odeslat
|
||||
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.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.off=Vypnuto
|
||||
hud.msg.on=Zapnuto
|
||||
hud.msg.state=Stav
|
||||
hud.msg.delay=Prodleva
|
||||
hud.msg.comparator=Porovnávaè
|
||||
hud.msg.substractor=Substraktor
|
||||
hud.msg.record=Záznam
|
||||
|
||||
hud.msg.offers=Poskytuje
|
||||
hud.msg.demands=Požaduje
|
||||
|
||||
option.appeng.monitorcontent=Obsah monitoru
|
||||
option.bb.content=Obsah barelu
|
||||
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.thermalexpansion.fluidtype=Zobrazit typ tekutiny
|
||||
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.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.etb.displaydata=Zobrazit data slotu
|
||||
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.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.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.thaumcraft.aspects=Zobrazit aspekty
|
||||
@@ -143,6 +143,9 @@ option.carpenters.hide=Hide camo blocks
|
||||
option.stevescarts.showall=Show data
|
||||
option.stevescarts.colorblind=Colorblind mode
|
||||
option.stevescarts.shifttoggle=Shift toggle
|
||||
option.general.showents=Show entities
|
||||
option.general.showhp=Show entities health
|
||||
option.general.showcrop=Show crop growth
|
||||
option.thaumcraft.aspects=Show aspects
|
||||
option.thaumcraft.aspects=Show aspects
|
||||
|
||||
nei.options.keys.showenchant=Show enchanting values
|
||||
Reference in new issue
Block a user