Removed Waila API

This commit is contained in:
Calclavia 2014-09-07 12:08:26 +08:00
parent 71a7c2417e
commit b364c3d6c9
16 changed files with 12 additions and 354 deletions

View file

@ -1,34 +0,0 @@
package mcp.mobius.waila.api;
import java.util.List;
import net.minecraft.item.ItemStack;
@Deprecated
public interface IWailaBlock {
/*
* Use this method to return an item stack in case the default lookup system fails.
* Return null if you want to use the default lookup system.
* You get the world, the player and the location of the block. With that, it is easy to gather information & tile entities
*/
ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config);
/* Waila HUD is divided into 3 zones. The head corresponds to the item name,
* body to where you mostly want to put informations, and I reserve the tail for modname display
*/
/* Those 2 methods works exactly the same way, except they are related to a different zone in Waila HUD.
* You get in input world, player and the block location. You also get the itemstack as returned by the default lookup system or getWailaStack().
* ConfigHandler provides the current Waila config state so you can show/hide elements depending on the configuration. Refer the ConfigHandler class for more info.
* currenttip represents the current list of text lines in the tooltip zone.
* For example, getWailaHead() will have the current item name as currenttip.
* You can modify the tips, add more, remove some, etc.
* When you are done, just returns the currenttip and it will display in Waila.
*
* Always return the currenttip is you don't want to modify the current zone.
*/
List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
}

View file

@ -1,9 +0,0 @@
package mcp.mobius.waila.api;
import net.minecraft.item.ItemStack;
public interface IWailaBlockDecorator {
void decorateBlock(ItemStack itemStack, IWailaDataAccessor accessor, IWailaConfigHandler config);
}

View file

@ -1,28 +0,0 @@
package mcp.mobius.waila.api;
import java.util.HashMap;
import java.util.Set;
public interface IWailaConfigHandler {
/* Returns a set of all the currently loaded modules in the config handler */
public Set<String> getModuleNames();
/* Returns all the currently available options for a given module */
public HashMap<String, String> getConfigKeys(String modName);
/* Add a new option to a given module
*
* modName is the name of the module to add the option to (ie : Buildcraft, IndustrialCraft2, etc)
* key is the config key (ie : bc.tankcontent, ic2.inputvalue)
* name is the human readable name of the option (ie : "Tank content", "Max EU Input")
* */
//public void addConfig(String modName, String key, String name);
/* Returns the current value of an option (true/false) with a default value 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*/
public boolean getConfig(String key);
//public void setConfig(String key, boolean value);
}

View file

@ -1,33 +0,0 @@
package mcp.mobius.waila.api;
import net.minecraft.block.Block;
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.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
/* 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).
*/
public interface IWailaDataAccessor {
World getWorld();
EntityPlayer getPlayer();
Block getBlock();
int getBlockID();
int getMetadata();
TileEntity getTileEntity();
MovingObjectPosition getPosition();
Vec3 getRenderingPosition();
NBTTagCompound getNBTData();
int getNBTInteger(NBTTagCompound tag, String keyname);
double getPartialFrame();
ForgeDirection getSide();
ItemStack getStack();
}

View file

@ -1,33 +0,0 @@
package mcp.mobius.waila.api;
import java.util.List;
import net.minecraft.item.ItemStack;
public interface IWailaDataProvider{
/*
* Use this method to return an item stack in case the default lookup system fails.
* Return null if you want to use the default lookup system.
* You get the world, the player and the location of the block. With that, it is easy to gather information & tile entities
*/
ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config);
/* Waila HUD is divided into 3 zones. The head corresponds to the item name,
* body to where you mostly want to put informations, and I reserve the tail for modname display
*/
/* Those 2 methods works exactly the same way, except they are related to a different zone in Waila HUD.
* You get in input world, player and the block location. You also get the itemstack as returned by the default lookup system or getWailaStack().
* ConfigHandler provides the current Waila config state so you can show/hide elements depending on the configuration. Refer the ConfigHandler class for more info.
* currenttip represents the current list of text lines in the tooltip zone.
* For example, getWailaHead() will have the current item name as currenttip.
* You can modify the tips, add more, remove some, etc.
* When you are done, just returns the currenttip and it will display in Waila.
*
* Always return the currenttip is you don't want to modify the current zone.
*/
List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config);
}

View file

@ -1,24 +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.MovingObjectPosition;
import net.minecraft.util.Vec3;
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).
*/
public interface IWailaEntityAccessor {
World getWorld();
EntityPlayer getPlayer();
Entity getEntity();
MovingObjectPosition getPosition();
Vec3 getRenderingPosition();
NBTTagCompound getNBTData();
int getNBTInteger(NBTTagCompound tag, String keyname);
double getPartialFrame();
}

View file

@ -1,16 +0,0 @@
package mcp.mobius.waila.api;
import java.util.List;
import net.minecraft.entity.Entity;
public interface IWailaEntityProvider {
/* A way to get an override on the entity returned by the raytracing */
Entity getWailaOverride(IWailaEntityAccessor accessor, IWailaConfigHandler config);
/* The classical HEAD/BODY/TAIL text getters */
List<String> getWailaHead(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config);
List<String> getWailaBody(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config);
List<String> getWailaTail(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config);
}

View file

@ -1,28 +0,0 @@
package mcp.mobius.waila.api;
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.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
/* 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).
*/
public interface IWailaFMPAccessor {
World getWorld();
EntityPlayer getPlayer();
TileEntity getTileEntity();
MovingObjectPosition getPosition();
NBTTagCompound getNBTData();
NBTTagCompound getFullNBTData();
int getNBTInteger(NBTTagCompound tag, String keyname);
double getPartialFrame();
Vec3 getRenderingPosition();
String getID();
}

View file

@ -1,7 +0,0 @@
package mcp.mobius.waila.api;
import net.minecraft.item.ItemStack;
public interface IWailaFMPDecorator {
void decorateBlock(ItemStack itemStack, IWailaFMPAccessor accessor, IWailaConfigHandler config);
}

View file

@ -1,12 +0,0 @@
package mcp.mobius.waila.api;
import java.util.List;
import net.minecraft.item.ItemStack;
public interface IWailaFMPProvider {
/* The classical HEAD/BODY/TAIL text getters */
List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config);
List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config);
List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config);
}

View file

@ -1,56 +0,0 @@
package mcp.mobius.waila.api;
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 addConfigRemote(String modname, String keyname, String configtext);
public void addConfig(String modname, String keyname);
public void addConfigRemote(String modname, String keyname);
/* Register a IWailaDataProvider for the given blockID, either for the Head section or the Body section */
@Deprecated
public void registerHeadProvider (IWailaDataProvider dataProvider, int blockID);
@Deprecated
public void registerBodyProvider (IWailaDataProvider dataProvider, int blockID);
@Deprecated
public void registerTailProvider (IWailaDataProvider dataProvider, int blockID);
/* Register a stack overrider for the given blockID */
@Deprecated
public void registerStackProvider(IWailaDataProvider dataProvider, int 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);
/* 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);
/* 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 */
@Deprecated
public void registerDecorator (IWailaBlockDecorator decorator, int blockID);
public void registerDecorator (IWailaBlockDecorator decorator, Class block);
public void registerDecorator (IWailaFMPDecorator decorator, String name);
/* Selective NBT key syncing. Will register a key to sync over the network for the given class (block, te or ent).
* Accept * as a ending wildcard
* registerNBTKey("bob.*", MyBlock.class)
* registerNBTKey("data.life", MyEntity.class)
* registerNBTKey("*", MyTileEntity.class) will reproduce the full tag syncing from 1.4.5
* */
public void registerSyncedNBTKey(String key, Class target);
/* UNUSED FOR NOW (Will be used for the ingame wiki */
public void registerDocTextFile (String filename);
public void registerShortDataProvider (IWailaSummaryProvider dataProvider, Class item);
}

View file

@ -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<String, String> getSummary(ItemStack stack, LinkedHashMap<String, String> currentSummary, IWailaConfigHandler config);
}

View file

@ -1,40 +0,0 @@
package mcp.mobius.waila.api;
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 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";
}

View file

@ -1,3 +0,0 @@
@API(apiVersion="1.0",owner="Waila",provides="WailaAPI")
package mcp.mobius.waila.api;
import cpw.mods.fml.common.API;

View file

@ -13,7 +13,9 @@ import resonant.content.prefab.RenderRotatedTexture
import resonant.content.spatial.block.SpatialBlock
import resonant.lib.content.prefab.TRotatable
import resonantinduction.core.Reference
import universalelectricity.core.transform.vector.Vector3ject TileTurntable
import universalelectricity.core.transform.vector.Vector3
object TileTurntable
{
var top: IIcon = null
}

View file

@ -18,6 +18,7 @@ import resonant.lib.wrapper.WrapList._
import resonantinduction.archaic.ArchaicBlocks
import resonantinduction.core.Reference
import scala.collection.JavaConversions._
import scala.util.control.Breaks._
/** A block that allows the placement of mass amount of a specific item within it. It will be allowed
@ -32,7 +33,7 @@ object BlockCrate
/** Puts an itemStack into the crate.
*
* @param tileEntity
* @param itemStack*/
* @param itemStack */
def addStackToCrate(tileEntity: TileCrate, itemStack: ItemStack): ItemStack =
{
if (itemStack == null || itemStack.getItem.isDamageable && itemStack.getItem.getDamage(itemStack) > 0)
@ -228,16 +229,15 @@ class BlockCrate extends SpatialBlock(Material.iron)
* in. */
def tryInsert(tileEntity: TileCrate, player: EntityPlayer, allMode: Boolean, doSearch: Boolean)
{
val success: Boolean = if (allMode) this.insertAllItems(tileEntity, player) else this.insertCurrentItem(timport scala.collection.JavaConversions._Search)
val success: Boolean = if (allMode) insertAllItems(tileEntity, player) else insertCurrentItem(tileEntity, player)
val pathfinder: PathfinderCrate = new PathfinderCrate().init(tileEntity)
for (checkTile <- pathfinder.iteratedNodes)
{
val pathfinder: PathfinderCrate = new PathfinderCrate().init(tileEntity)
import scala.collection.JavaConversions._
for (checkTile <- pathfinder.iteratedNodes)
if (checkTile.isInstanceOf[TileCrate])
{
if (checkTile.isInstanceOf[TileCrate])
{
this.tryInsert((checkTile.asInstanceOf[TileCrate]), player, allMode, false)
}
this.tryInsert((checkTile.asInstanceOf[TileCrate]), player, allMode, false)
}
}
}