From 40c77f30fd3d9dced8d23befa2b26f4f00ae2ead Mon Sep 17 00:00:00 2001 From: Justin Aquadro Date: Sun, 9 Apr 2017 23:36:44 -0400 Subject: [PATCH] Re-add WAILA (HWYLA) support --- api/mcp/mobius/waila/api/ITaggedList.java | 19 ----- .../waila/api/IWailaBlockDecorator.java | 24 ------ .../waila/api/IWailaCommonAccessor.java | 37 --------- .../mobius/waila/api/IWailaConfigHandler.java | 44 ---------- .../mobius/waila/api/IWailaDataAccessor.java | 39 --------- .../mobius/waila/api/IWailaDataProvider.java | 82 ------------------- .../waila/api/IWailaEntityAccessor.java | 27 ------ .../waila/api/IWailaEntityProvider.java | 79 ------------------ .../mobius/waila/api/IWailaFMPAccessor.java | 29 ------- .../mobius/waila/api/IWailaFMPDecorator.java | 23 ------ .../mobius/waila/api/IWailaFMPProvider.java | 54 ------------ api/mcp/mobius/waila/api/IWailaRegistrar.java | 65 --------------- .../waila/api/IWailaSummaryProvider.java | 21 ----- .../waila/api/IWailaTooltipRenderer.java | 23 ------ api/mcp/mobius/waila/api/SpecialChars.java | 67 --------------- api/mcp/mobius/waila/api/package-info.java | 3 - build.gradle | 13 ++- gradle.properties | 6 +- .../integration/{Waila.java => Hwyla.java} | 2 +- .../integration/LocalIntegrationRegistry.java | 2 +- 20 files changed, 16 insertions(+), 643 deletions(-) delete mode 100644 api/mcp/mobius/waila/api/ITaggedList.java delete mode 100644 api/mcp/mobius/waila/api/IWailaBlockDecorator.java delete mode 100644 api/mcp/mobius/waila/api/IWailaCommonAccessor.java delete mode 100644 api/mcp/mobius/waila/api/IWailaConfigHandler.java delete mode 100644 api/mcp/mobius/waila/api/IWailaDataAccessor.java delete mode 100644 api/mcp/mobius/waila/api/IWailaDataProvider.java delete mode 100644 api/mcp/mobius/waila/api/IWailaEntityAccessor.java delete mode 100644 api/mcp/mobius/waila/api/IWailaEntityProvider.java delete mode 100644 api/mcp/mobius/waila/api/IWailaFMPAccessor.java delete mode 100644 api/mcp/mobius/waila/api/IWailaFMPDecorator.java delete mode 100644 api/mcp/mobius/waila/api/IWailaFMPProvider.java delete mode 100644 api/mcp/mobius/waila/api/IWailaRegistrar.java delete mode 100644 api/mcp/mobius/waila/api/IWailaSummaryProvider.java delete mode 100644 api/mcp/mobius/waila/api/IWailaTooltipRenderer.java delete mode 100644 api/mcp/mobius/waila/api/SpecialChars.java delete mode 100644 api/mcp/mobius/waila/api/package-info.java rename src/com/jaquadro/minecraft/storagedrawers/integration/{Waila.java => Hwyla.java} (99%) diff --git a/api/mcp/mobius/waila/api/ITaggedList.java b/api/mcp/mobius/waila/api/ITaggedList.java deleted file mode 100644 index 62af479d4..000000000 --- a/api/mcp/mobius/waila/api/ITaggedList.java +++ /dev/null @@ -1,19 +0,0 @@ -package mcp.mobius.waila.api; - -import java.util.Collection; -import java.util.List; -import java.util.Set; - -public interface ITaggedList extends List { - public boolean add(E e, T tag); - public boolean add(E e, Collection taglst); - public Set getTags(E e); - public Set getTags(int index); - public void addTag(E e, T tag); - public void addTag(int index, T tag); - public void removeTag(E e, T tag); - public void removeTag(int index, T tag); - public Set getEntries(T tag); - public void removeEntries(T tag); - public String getTagsAsString(E e); -} diff --git a/api/mcp/mobius/waila/api/IWailaBlockDecorator.java b/api/mcp/mobius/waila/api/IWailaBlockDecorator.java deleted file mode 100644 index 7dc6ba03c..000000000 --- a/api/mcp/mobius/waila/api/IWailaBlockDecorator.java +++ /dev/null @@ -1,24 +0,0 @@ -package mcp.mobius.waila.api; - -import net.minecraft.item.ItemStack; - -/** - * Callback class interface used to provide Block/TileEntity decorator.
- * All methods in this interface shouldn't to be called by the implementing mod. An instance of the class is to be - * registered to Waila via the {@link IWailaRegistrar} instance provided in the original registration callback method - * (cf. {@link IWailaRegistrar} documentation for more information). - * @author ProfMobius - * - */ -public interface IWailaBlockDecorator { - - /** - * Callback for the decorator. It provides a standard GL stack positioned on the block.
- * Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerDecorator}.
- * @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. - */ - void decorateBlock(ItemStack itemStack, IWailaDataAccessor accessor, IWailaConfigHandler config); - -} diff --git a/api/mcp/mobius/waila/api/IWailaCommonAccessor.java b/api/mcp/mobius/waila/api/IWailaCommonAccessor.java deleted file mode 100644 index 074de6cd5..000000000 --- a/api/mcp/mobius/waila/api/IWailaCommonAccessor.java +++ /dev/null @@ -1,37 +0,0 @@ -package mcp.mobius.waila.api; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; -import net.minecraft.world.World; - -/** - * The Accessor is used to get some basic data out of the game without having to request direct access to the game engine.
- * It will also return things that are unmodified by the overriding systems (like getWailaStack).
- * Common accessor for both Entity and Block/TileEntity.
- * Available data depends on what it is called upon (ie : getEntity() will return null if looking at a block, etc).
- * - */ -public interface IWailaCommonAccessor { - World getWorld(); - EntityPlayer getPlayer(); - Block getBlock(); - int getBlockID(); - String getBlockQualifiedName(); - int getMetadata(); - TileEntity getTileEntity(); - Entity getEntity(); - BlockPos getPosition(); - Vec3d getRenderingPosition(); - NBTTagCompound getNBTData(); - int getNBTInteger(NBTTagCompound tag, String keyname); - double getPartialFrame(); - EnumFacing getSide(); - ItemStack getStack(); -} diff --git a/api/mcp/mobius/waila/api/IWailaConfigHandler.java b/api/mcp/mobius/waila/api/IWailaConfigHandler.java deleted file mode 100644 index 9752e423f..000000000 --- a/api/mcp/mobius/waila/api/IWailaConfigHandler.java +++ /dev/null @@ -1,44 +0,0 @@ -package mcp.mobius.waila.api; - -import java.util.HashMap; -import java.util.Set; - -/** - * Read-only interface for Waila internal config storage.
- * An instance of this interface is passed to most of Waila callbacks as a way to change the behavior depending on client settings. - * - * @author ProfMobius - * - */ -public interface IWailaConfigHandler { - /** Returns a set of all the currently loaded modules in the config handler. - * - * @return - */ - public Set getModuleNames(); - - /** - * Returns all the currently available options for a given module - * - * @param modName Module name - * @return - */ - public HashMap getConfigKeys(String modName); - - /** - * Returns the current value of an option (true/false) with a default value if not set. - * - * @param key Option to lookup - * @param defvalue Default values - * @return Value of the option or defvalue if not set. - */ - public boolean getConfig(String key, boolean defvalue); - - /** - * Returns the current value of an option (true/false) with a default value true if not set - * - * @param key Option to lookup - * @return Value of the option or true if not set. - */ - public boolean getConfig(String key); -} diff --git a/api/mcp/mobius/waila/api/IWailaDataAccessor.java b/api/mcp/mobius/waila/api/IWailaDataAccessor.java deleted file mode 100644 index 4038d7721..000000000 --- a/api/mcp/mobius/waila/api/IWailaDataAccessor.java +++ /dev/null @@ -1,39 +0,0 @@ -package mcp.mobius.waila.api; - -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.RayTraceResult; -import net.minecraft.util.math.Vec3d; -import net.minecraft.world.World; - -/** - * The Accessor is used to get some basic data out of the game without having to request direct access to the game engine.
- * It will also return things that are unmodified by the overriding systems (like getWailaStack).
- * An instance of this interface is passed to most of Waila Block/TileEntity callbacks. - * @author ProfMobius - * - */ - -public interface IWailaDataAccessor{ - World getWorld(); - EntityPlayer getPlayer(); - Block getBlock(); - //int getBlockID(); - int getMetadata(); - IBlockState getBlockState(); - TileEntity getTileEntity(); - RayTraceResult getMOP(); - BlockPos getPosition(); - Vec3d getRenderingPosition(); - NBTTagCompound getNBTData(); - int getNBTInteger(NBTTagCompound tag, String keyname); - double getPartialFrame(); - EnumFacing getSide(); - ItemStack getStack(); -} diff --git a/api/mcp/mobius/waila/api/IWailaDataProvider.java b/api/mcp/mobius/waila/api/IWailaDataProvider.java deleted file mode 100644 index 0d0e75598..000000000 --- a/api/mcp/mobius/waila/api/IWailaDataProvider.java +++ /dev/null @@ -1,82 +0,0 @@ -package mcp.mobius.waila.api; - -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.util.math.BlockPos; -import net.minecraft.world.World; - -/** - * Callback class interface used to provide Block/TileEntity tooltip informations to Waila.
- * All methods in this interface shouldn't to be called by the implementing mod. An instance of the class is to be - * registered to Waila via the {@link IWailaRegistrar} instance provided in the original registration callback method - * (cf. {@link IWailaRegistrar} documentation for more information). - * @author ProfMobius - * - */ -public interface IWailaDataProvider{ - - /** - * Callback used to override the default Waila lookup system.
- * Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerStackProvider}.
- * @param accessor Contains most of the relevant information about the current environment. - * @param config Current configuration of Waila. - * @return null if override is not required, an ItemStack otherwise. - */ - ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config); - - /** - * Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).
- * Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerHeadProvider} client side.
- * You are supposed to always return the modified input currenttip.
- * - * @param itemStack Current block scanned, in ItemStack form. - * @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers). - * @param accessor Contains most of the relevant information about the current environment. - * @param config Current configuration of Waila. - * @return Modified input currenttip - */ - List getWailaHead(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config); - - /** - * Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).
- * Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerBodyProvider} client side.
- * You are supposed to always return the modified input currenttip.
- * - * @param itemStack Current block scanned, in ItemStack form. - * @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers). - * @param accessor Contains most of the relevant information about the current environment. - * @param config Current configuration of Waila. - * @return Modified input currenttip - */ - List getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config); - - /** - * Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).
- * Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerTailProvider} client side.
- * You are supposed to always return the modified input currenttip.
- * - * @param itemStack Current block scanned, in ItemStack form. - * @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers). - * @param accessor Contains most of the relevant information about the current environment. - * @param config Current configuration of Waila. - * @return Modified input currenttip - */ - List getWailaTail(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config); - - /** - * Callback used server side to return a custom synchronization NBTTagCompound.
- * Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerNBTProvider} server and client side.
- * You are supposed to always return the modified input NBTTagCompound tag.
- * @param player The player requesting data synchronization (The owner of the current connection). - * @param te The TileEntity targeted for synchronization. - * @param tag Current synchronization tag (might have been processed by other providers and might be processed by other providers). - * @param world TileEntity's World. - * @param pos Position of the TileEntity. - * @return Modified input NBTTagCompound tag. - */ - NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, BlockPos pos); -} diff --git a/api/mcp/mobius/waila/api/IWailaEntityAccessor.java b/api/mcp/mobius/waila/api/IWailaEntityAccessor.java deleted file mode 100644 index 52326671f..000000000 --- a/api/mcp/mobius/waila/api/IWailaEntityAccessor.java +++ /dev/null @@ -1,27 +0,0 @@ -package mcp.mobius.waila.api; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.math.RayTraceResult; -import net.minecraft.util.math.Vec3d; -import net.minecraft.world.World; - -/** - * The Accessor is used to get some basic data out of the game without having to request direct access to the game engine.
- * It will also return things that are unmodified by the overriding systems (like getWailaStack).
- * An instance of this interface is passed to most of Waila Entity callbacks. - * @author ProfMobius - * - */ - -public interface IWailaEntityAccessor { - World getWorld(); - EntityPlayer getPlayer(); - Entity getEntity(); - RayTraceResult getMOP(); - Vec3d getRenderingPosition(); - NBTTagCompound getNBTData(); - int getNBTInteger(NBTTagCompound tag, String keyname); - double getPartialFrame(); -} diff --git a/api/mcp/mobius/waila/api/IWailaEntityProvider.java b/api/mcp/mobius/waila/api/IWailaEntityProvider.java deleted file mode 100644 index 5a9acd8da..000000000 --- a/api/mcp/mobius/waila/api/IWailaEntityProvider.java +++ /dev/null @@ -1,79 +0,0 @@ -package mcp.mobius.waila.api; - -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; - -/** - * Callback class interface used to provide Entity tooltip informations to Waila.
- * All methods in this interface shouldn't to be called by the implementing mod. An instance of the class is to be - * registered to Waila via the {@link IWailaRegistrar} instance provided in the original registration callback method - * (cf. {@link IWailaRegistrar} documentation for more information). - * @author ProfMobius - * - */ -public interface IWailaEntityProvider { - - /** - * Callback used to override the default Waila lookup system.
- * Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerOverrideEntityProvider}.
- * @param accessor Contains most of the relevant information about the current environment. - * @param config Current configuration of Waila. - * @return null if override is not required, an Entity otherwise. - */ - Entity getWailaOverride(IWailaEntityAccessor accessor, IWailaConfigHandler config); - - /** - * Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).
- * Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerHeadProvider} client side.
- * You are supposed to always return the modified input currenttip.
- * - * @param entity Current Entity scanned. - * @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers). - * @param accessor Contains most of the relevant information about the current environment. - * @param config Current configuration of Waila. - * @return Modified input currenttip - */ - List getWailaHead(Entity entity, List currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config); - - /** - * Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).
- * Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerBodyProvider} client side.
- * You are supposed to always return the modified input currenttip.
- * - * @param entity Current Entity scanned. - * @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers). - * @param accessor Contains most of the relevant information about the current environment. - * @param config Current configuration of Waila. - * @return Modified input currenttip - */ - List getWailaBody(Entity entity, List currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config); - - /** - * Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).
- * Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerTailProvider} client side.
- * You are supposed to always return the modified input currenttip.
- * - * @param entity Current Entity scanned. - * @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers). - * @param accessor Contains most of the relevant information about the current environment. - * @param config Current configuration of Waila. - * @return Modified input currenttip - */ - List getWailaTail(Entity entity, List currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config); - - /** - * Callback used server side to return a custom synchronization NBTTagCompound.
- * Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerNBTProvider} server and client side.
- * You are supposed to always return the modified input NBTTagCompound tag.
- * @param player The player requesting data synchronization (The owner of the current connection). - * @param ent The Entity targeted for synchronization. - * @param tag Current synchronization tag (might have been processed by other providers and might be processed by other providers). - * @param world TileEntity's World. - * @return Modified input NBTTagCompound tag. - */ - NBTTagCompound getNBTData(EntityPlayerMP player, Entity ent, NBTTagCompound tag, World world); -} diff --git a/api/mcp/mobius/waila/api/IWailaFMPAccessor.java b/api/mcp/mobius/waila/api/IWailaFMPAccessor.java deleted file mode 100644 index 55184c620..000000000 --- a/api/mcp/mobius/waila/api/IWailaFMPAccessor.java +++ /dev/null @@ -1,29 +0,0 @@ -package mcp.mobius.waila.api; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.RayTraceResult; -import net.minecraft.util.math.Vec3d; -import net.minecraft.world.World; - -/** - * The Accessor is used to get some basic data out of the game without having to request direct access to the game engine.
- * It will also return things that are unmodified by the overriding systems (like getWailaStack).
- * An instance of this interface is passed to most of Waila FMP callbacks. - * @author ProfMobius - * - */ - -public interface IWailaFMPAccessor { - World getWorld(); - EntityPlayer getPlayer(); - TileEntity getTileEntity(); - RayTraceResult getPosition(); - NBTTagCompound getNBTData(); - NBTTagCompound getFullNBTData(); - int getNBTInteger(NBTTagCompound tag, String keyname); - double getPartialFrame(); - Vec3d getRenderingPosition(); - String getID(); -} diff --git a/api/mcp/mobius/waila/api/IWailaFMPDecorator.java b/api/mcp/mobius/waila/api/IWailaFMPDecorator.java deleted file mode 100644 index 5484a566e..000000000 --- a/api/mcp/mobius/waila/api/IWailaFMPDecorator.java +++ /dev/null @@ -1,23 +0,0 @@ -package mcp.mobius.waila.api; - -import net.minecraft.item.ItemStack; - -/** - * Callback class interface used to provide FMP decorator.
- * All methods in this interface shouldn't to be called by the implementing mod. An instance of the class is to be - * registered to Waila via the {@link IWailaRegistrar} instance provided in the original registration callback method - * (cf. {@link IWailaRegistrar} documentation for more information). - * @author ProfMobius - * - */ -public interface IWailaFMPDecorator { - - /** - * Callback for the decorator. It provides a standard GL stack positioned on the block.
- * Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerDecorator}.
- * @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. - */ - void decorateBlock(ItemStack itemStack, IWailaFMPAccessor accessor, IWailaConfigHandler config); -} diff --git a/api/mcp/mobius/waila/api/IWailaFMPProvider.java b/api/mcp/mobius/waila/api/IWailaFMPProvider.java deleted file mode 100644 index 6db02fb27..000000000 --- a/api/mcp/mobius/waila/api/IWailaFMPProvider.java +++ /dev/null @@ -1,54 +0,0 @@ -package mcp.mobius.waila.api; - -import java.util.List; - -import net.minecraft.item.ItemStack; - -/** - * Callback class interface used to provide FMP tooltip informations to Waila.
- * All methods in this interface shouldn't to be called by the implementing mod. An instance of the class is to be - * registered to Waila via the {@link IWailaRegistrar} instance provided in the original registration callback method - * (cf. {@link IWailaRegistrar} documentation for more information). - * @author ProfMobius - * - */ -public interface IWailaFMPProvider { - /** - * Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).
- * Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerHeadProvider} client side.
- * You are supposed to always return the modified input currenttip.
- * - * @param itemStack Current block scanned, in ItemStack form. - * @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers). - * @param accessor Contains most of the relevant information about the current environment. - * @param config Current configuration of Waila. - * @return Modified input currenttip - */ - List getWailaHead(ItemStack itemStack, List currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config); - - /** - * Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).
- * Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerBodyProvider} client side.
- * You are supposed to always return the modified input currenttip.
- * - * @param itemStack Current block scanned, in ItemStack form. - * @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers). - * @param accessor Contains most of the relevant information about the current environment. - * @param config Current configuration of Waila. - * @return Modified input currenttip - */ - List getWailaBody(ItemStack itemStack, List currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config); - - /** - * Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).
- * Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerTailProvider} client side.
- * You are supposed to always return the modified input currenttip.
- * - * @param itemStack Current block scanned, in ItemStack form. - * @param currenttip Current list of tooltip lines (might have been processed by other providers and might be processed by other providers). - * @param accessor Contains most of the relevant information about the current environment. - * @param config Current configuration of Waila. - * @return Modified input currenttip - */ - List getWailaTail(ItemStack itemStack, List currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config); -} diff --git a/api/mcp/mobius/waila/api/IWailaRegistrar.java b/api/mcp/mobius/waila/api/IWailaRegistrar.java deleted file mode 100644 index b42e753cb..000000000 --- a/api/mcp/mobius/waila/api/IWailaRegistrar.java +++ /dev/null @@ -1,65 +0,0 @@ -package mcp.mobius.waila.api; - -/** - * Main registration interface. An instance will be provided to a method specified in an IMC msg formatted as follow
- * FMLInterModComms.sendMessage("Waila", "register", "fully.qualified.path.to.registration.method");
- * The registration method need to follow this signature
- * public static void callbackRegister({@link IWailaRegistrar} registrar)

- * If not specified otherwise, all the registration methods taking a class can take classes as well as interfaces. - * Waila will do a lookup using instanceof on the registered classes, meaning that if all your targets inherit one interface, you only need - * to specify it to cover the whole hierarchy.
- * For the registration of blocks, both Blocks and TileEntities are accepted.

- * For the configuration keys :
- * modname refers to a String used for display in Waila's config panel.
- * keyname refers to an unique key used internally for config query (cf {@link IWailaConfigHandler}). Those keys are shared across Waila, keep them unique !
- * - * - * @author ProfMobius - * - */ -public interface IWailaRegistrar { - /* Add a config option in the section modname with displayed text configtext and access key keyname */ - public void addConfig(String modname, String keyname, String configtext); - public void addConfig(String modname, String keyname, String configtext, boolean defvalue); - public void addConfigRemote(String modname, String keyname, String configtext); - public void addConfigRemote(String modname, String keyname, String configtext, boolean defvalue); - public void addConfig(String modname, String keyname); - public void addConfig(String modname, String keyname, boolean defvalue); - public void addConfigRemote(String modname, String keyname); - public void addConfigRemote(String modname, String keyname, boolean defvalue); - - /* Register a stack overrider for the given blockID */ - public void registerStackProvider(IWailaDataProvider dataProvider, Class block); - - /* Same thing, but works on a class hierarchy instead */ - public void registerHeadProvider (IWailaDataProvider dataProvider, Class block); - public void registerBodyProvider (IWailaDataProvider dataProvider, Class block); - public void registerTailProvider (IWailaDataProvider dataProvider, Class block); - - /* Registering an NBT Provider provides a way to override the default "writeToNBT" way of doing things. */ - public void registerNBTProvider(IWailaDataProvider dataProvider, Class block); - - /* Entity text registration methods */ - public void registerHeadProvider (IWailaEntityProvider dataProvider, Class entity); - public void registerBodyProvider (IWailaEntityProvider dataProvider, Class entity); - public void registerTailProvider (IWailaEntityProvider dataProvider, Class entity); - public void registerOverrideEntityProvider (IWailaEntityProvider dataProvider, Class entity); - - /* Registering an NBT Provider provides a way to override the default "writeToNBT" way of doing things. */ - public void registerNBTProvider(IWailaEntityProvider dataProvider, Class entity); - - /* FMP Providers */ - public void registerHeadProvider(IWailaFMPProvider dataProvider, String name); - public void registerBodyProvider(IWailaFMPProvider dataProvider, String name); - public void registerTailProvider(IWailaFMPProvider dataProvider, String name); - - /* The block decorators */ - public void registerDecorator (IWailaBlockDecorator decorator, Class block); - public void registerDecorator (IWailaFMPDecorator decorator, String name); - - public void registerTooltipRenderer(String name, IWailaTooltipRenderer renderer); - - /* UNUSED FOR NOW (Will be used for the ingame wiki */ - //public void registerDocTextFile (String filename); - //public void registerShortDataProvider (IWailaSummaryProvider dataProvider, Class item); -} diff --git a/api/mcp/mobius/waila/api/IWailaSummaryProvider.java b/api/mcp/mobius/waila/api/IWailaSummaryProvider.java deleted file mode 100644 index f79064981..000000000 --- a/api/mcp/mobius/waila/api/IWailaSummaryProvider.java +++ /dev/null @@ -1,21 +0,0 @@ -package mcp.mobius.waila.api; - -import java.util.LinkedHashMap; - -import net.minecraft.item.ItemStack; - -public interface IWailaSummaryProvider { - /* This interface is used to control the display data in the description screen */ - - /* BASIC TOOLS & ITEMS DATA */ - //EnumToolMaterial getMaterial(ItemStack stack); - //String getMaterialName(ItemStack stack); - //String getEffectiveBlock(ItemStack stack); - //int getHarvestLevel(ItemStack stack); - //float getEfficiencyOnProperMaterial(ItemStack stack); - //int getEnchantability(ItemStack stack); - //int getDamageVsEntity(ItemStack stack); - //int getDurability(ItemStack stack); - - LinkedHashMap getSummary(ItemStack stack, LinkedHashMap currentSummary, IWailaConfigHandler config); -} diff --git a/api/mcp/mobius/waila/api/IWailaTooltipRenderer.java b/api/mcp/mobius/waila/api/IWailaTooltipRenderer.java deleted file mode 100644 index efbfd91b7..000000000 --- a/api/mcp/mobius/waila/api/IWailaTooltipRenderer.java +++ /dev/null @@ -1,23 +0,0 @@ -package mcp.mobius.waila.api; - -import java.awt.Dimension; - - -public interface IWailaTooltipRenderer { - /** - * - * @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); - - /** - * Draw method for the renderer. The GL matrice is automatically moved to the top left of the reserved zone.
- * All calls should be relative to (0,0) - * - * @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 - */ - void draw (String[] params, IWailaCommonAccessor accessor); -} diff --git a/api/mcp/mobius/waila/api/SpecialChars.java b/api/mcp/mobius/waila/api/SpecialChars.java deleted file mode 100644 index 4ef877d62..000000000 --- a/api/mcp/mobius/waila/api/SpecialChars.java +++ /dev/null @@ -1,67 +0,0 @@ -package mcp.mobius.waila.api; - -import java.util.regex.Pattern; - -public class SpecialChars { - - public static String MCStyle = "\u00A7"; - - public static String BLACK = MCStyle + "0"; - public static String DBLUE = MCStyle + "1"; - public static String DGREEN = MCStyle + "2"; - public static String DAQUA = MCStyle + "3"; - public static String DRED = MCStyle + "4"; - public static String DPURPLE = MCStyle + "5"; - public static String GOLD = MCStyle + "6"; - public static String GRAY = MCStyle + "7"; - public static String DGRAY = MCStyle + "8"; - public static String BLUE = MCStyle + "9"; - public static String GREEN = MCStyle + "a"; - public static String AQUA = MCStyle + "b"; - public static String RED = MCStyle + "c"; - public static String LPURPLE = MCStyle + "d"; - public static String YELLOW = MCStyle + "e"; - public static String WHITE = MCStyle + "f"; - - public static String OBF = MCStyle + "k"; - public static String BOLD = MCStyle + "l"; - public static String STRIKE = MCStyle + "m"; - public static String UNDER = MCStyle + "n"; - public static String ITALIC = MCStyle + "o"; - public static String RESET = MCStyle + "r"; - - public static String WailaStyle = "\u00A4"; - public static String WailaIcon = "\u00A5"; - public static String WailaRenderer = "\u00A6"; - public static String TAB = WailaStyle + WailaStyle +"a"; - public static String ALIGNRIGHT = WailaStyle + WailaStyle +"b"; - public static String ALIGNCENTER = WailaStyle + WailaStyle +"c"; - public static String HEART = WailaStyle + WailaIcon +"a"; - public static String HHEART = WailaStyle + WailaIcon +"b"; - public static String EHEART = WailaStyle + WailaIcon +"c"; - public static String RENDER = WailaStyle + WailaRenderer +"a"; - - public static final Pattern patternMinecraft = Pattern.compile("(?i)" + MCStyle + "[0-9A-FK-OR]"); - public static final Pattern patternWaila = Pattern.compile("(?i)(" + WailaStyle + "(?..))"); - public static final Pattern patternRender = Pattern.compile("(?i)(" + RENDER + "\\{(?[^,}]*),?(?[^}]*)\\})"); - 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 + "(?[0-9a-z]))"); - public static final Pattern patternLineSplit = Pattern.compile("(?i)(" + WailaStyle + WailaStyle + "[^" + WailaStyle + "]+|" + WailaStyle + WailaIcon + "[0-9A-Z]|" + WailaStyle + WailaRenderer + "a\\{([^,}]*),?([^}]*)\\}|[^" + WailaStyle + "]+)"); - - /** - * Helper method to get a proper RENDER string. Just put the name of the renderer and the params in, and it will give back a directly usable String for the tooltip. - * @param name - * @param params - * @return - */ - public static String getRenderString(String name, String... params){ - String result = RENDER + "{" + name; - for (String s : params){ - result += "," + s; - } - result += "}"; - return result; - } -} diff --git a/api/mcp/mobius/waila/api/package-info.java b/api/mcp/mobius/waila/api/package-info.java deleted file mode 100644 index e1f6cdfa2..000000000 --- a/api/mcp/mobius/waila/api/package-info.java +++ /dev/null @@ -1,3 +0,0 @@ -@API(apiVersion="1.3",owner="Waila",provides="WailaAPI") -package mcp.mobius.waila.api; -import net.minecraftforge.fml.common.API; diff --git a/build.gradle b/build.gradle index 7debf5679..88d580895 100644 --- a/build.gradle +++ b/build.gradle @@ -58,11 +58,11 @@ sourceSets.main { } } -sourceSets.api { +/*sourceSets.api { java { srcDirs project.projectDir.getPath() + '/api/mcp' } -} +}*/ repositories { maven { // JEI @@ -73,6 +73,10 @@ repositories { name = "jared maven" url "http://blamejared.com/maven" } + maven { // HWYLA + name = "HWYLA repo" + url "http://tehnut.info/maven" + } } dependencies { @@ -81,7 +85,10 @@ dependencies { compileOnly "mezz.jei:jei_${minecraft_version}:${jei_version}:api" runtime "mezz.jei:jei_${minecraft_version}:${jei_version}" - deobfCompile "MineTweaker3:MineTweaker3-API:3.0.14.59" + compileOnly "mcp.mobius.waila:Hwyla:${hwyla_version}:api" + runtime "mcp.mobius.waila:Hwyla:${hwyla_version}" + + deobfCompile "MineTweaker3:MineTweaker3-API:${mt_version}" } processResources diff --git a/gradle.properties b/gradle.properties index 82c93815c..2692c6162 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,10 @@ minecraft_base_version=1.10 minecraft_version=1.10.2 forge_version=1.10.2-12.18.3.2221 -mod_version=3.7.0 +mod_version=3.7.1 chameleon_version=2.2.0 chameleon_max_version=3.0.0 -jei_version=3.13.3.382 \ No newline at end of file +jei_version=3.13.3.382 +hwyla_version=1.8.13-B27_1.10.2 +mt_version=3.0.14.59 \ No newline at end of file diff --git a/src/com/jaquadro/minecraft/storagedrawers/integration/Waila.java b/src/com/jaquadro/minecraft/storagedrawers/integration/Hwyla.java similarity index 99% rename from src/com/jaquadro/minecraft/storagedrawers/integration/Waila.java rename to src/com/jaquadro/minecraft/storagedrawers/integration/Hwyla.java index 0e33e6fd7..2ff12325f 100644 --- a/src/com/jaquadro/minecraft/storagedrawers/integration/Waila.java +++ b/src/com/jaquadro/minecraft/storagedrawers/integration/Hwyla.java @@ -27,7 +27,7 @@ import java.util.List; -public class Waila extends IntegrationModule +public class Hwyla extends IntegrationModule { private static Class classConfigHandler; diff --git a/src/com/jaquadro/minecraft/storagedrawers/integration/LocalIntegrationRegistry.java b/src/com/jaquadro/minecraft/storagedrawers/integration/LocalIntegrationRegistry.java index b7478d2c2..4010ec658 100644 --- a/src/com/jaquadro/minecraft/storagedrawers/integration/LocalIntegrationRegistry.java +++ b/src/com/jaquadro/minecraft/storagedrawers/integration/LocalIntegrationRegistry.java @@ -11,7 +11,7 @@ public class LocalIntegrationRegistry static { IntegrationRegistry reg = instance(); if (Loader.isModLoaded("Waila") && StorageDrawers.config.cache.enableWailaIntegration) - reg.add(new Waila()); + reg.add(new Hwyla()); //if (Loader.isModLoaded("Thaumcraft") && StorageDrawers.config.cache.enableThaumcraftIntegration) // reg.add(new Thaumcraft()); //if (Loader.isModLoaded("appliedenergistics2") && StorageDrawers.config.cache.enableAE2Integration)