mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-24 22:04:49 +00:00
Waila integration - fixes issues with Induction Cells & Induction Providers, also fixed println
This commit is contained in:
1 parent
e31d5573f1
commit
2ebb4838e8
21 files changed
+779
No files matched your search
@@ -1203,9 +1203,14 @@ public class Mekanism
|
||||
addRecipes();
|
||||
addEntities();
|
||||
|
||||
//Integrate certain OreDictionary recipes
|
||||
registerOreDict();
|
||||
|
||||
//Set up multiparts
|
||||
new MultipartMekanism();
|
||||
|
||||
//Integrate with Waila
|
||||
FMLInterModComms.sendMessage("Waila", "register", "mekanism.common.integration.WailaDataProvider.register");
|
||||
|
||||
//Packet registrations
|
||||
packetHandler.initialize();
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
package mekanism.common.integration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.IWailaRegistrar;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.common.tile.TileEntityInductionCell;
|
||||
import mekanism.common.tile.TileEntityInductionProvider;
|
||||
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 cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
|
||||
@Interface(iface = "mcp.mobius.waila.api.IWailaDataProvider", modid = "Waila")
|
||||
public class WailaDataProvider implements IWailaDataProvider
|
||||
{
|
||||
@Method(modid = "Waila")
|
||||
public static void register(IWailaRegistrar registrar)
|
||||
{
|
||||
WailaDataProvider provider = new WailaDataProvider();
|
||||
|
||||
registrar.registerHeadProvider(provider, TileEntityInductionCell.class);
|
||||
registrar.registerHeadProvider(provider, TileEntityInductionProvider.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = "Waila")
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = "Waila")
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
TileEntity tile = accessor.getTileEntity();
|
||||
|
||||
if(tile instanceof TileEntityInductionCell)
|
||||
{
|
||||
currenttip.set(0, EnumColor.WHITE + ((TileEntityInductionCell)tile).getInventoryName());
|
||||
}
|
||||
else if(tile instanceof TileEntityInductionProvider)
|
||||
{
|
||||
currenttip.set(0, EnumColor.WHITE + ((TileEntityInductionProvider)tile).getInventoryName());
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = "Waila")
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = "Waila")
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = "Waila")
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z)
|
||||
{
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,11 @@ public class TileEntityInductionCell extends TileEntityBasicBlock implements ISt
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getInventoryName()
|
||||
{
|
||||
return MekanismUtils.localize(getBlockType().getUnlocalizedName() + ".InductionCell" + tier.getBaseTier().getName() + ".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePacketData(ByteBuf dataStream)
|
||||
{
|
||||
|
||||
@@ -21,6 +21,11 @@ public class TileEntityInductionProvider extends TileEntityBasicBlock
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getInventoryName()
|
||||
{
|
||||
return MekanismUtils.localize(getBlockType().getUnlocalizedName() + ".InductionProvider" + tier.getBaseTier().getName() + ".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePacketData(ByteBuf dataStream)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user