Finished adding Javadoc to most classes.

This commit is contained in:
Thomas Guimbretiere committed 2014-12-18 00:37:51 +01:00
1 parent 30885054a2
commit edb0dab397
60 files changed
+10814 -26

No files matched your search

@@ -2,8 +2,23 @@ package mcp.mobius.waila.api;
import net.minecraft.item.ItemStack;
/**
* Callback class interface used to provide Block/TileEntity decorator.<br>
* 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.</br>
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerDecorator}.</br>
* @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);
}
@@ -7,9 +7,12 @@ 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).
/**
* The Accessor is used to get some basic data out of the game without having to request direct access to the game engine.<br>
* It will also return things that are unmodified by the overriding systems (like getWailaStack).<br>
* An instance of this interface is passed to most of Waila FMP callbacks.
* @author ProfMobius
*
*/
public interface IWailaFMPAccessor {
@@ -2,6 +2,22 @@ package mcp.mobius.waila.api;
import net.minecraft.item.ItemStack;
/**
* Callback class interface used to provide FMP decorator.<br>
* 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.</br>
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerDecorator}.</br>
* @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);
}
@@ -4,9 +4,51 @@ import java.util.List;
import net.minecraft.item.ItemStack;
/**
* Callback class interface used to provide FMP tooltip informations to Waila.<br>
* 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 {
/* The classical HEAD/BODY/TAIL text getters */
/**
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerHeadProvider} client side.</br>
* You are supposed to always return the modified input currenttip.</br>
*
* @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<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config);
/**
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerBodyProvider} client side.</br>
* You are supposed to always return the modified input currenttip.</br>
*
* @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<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config);
/**
* Callback used to add lines to one of the three sections of the tooltip (Head, Body, Tail).</br>
* Will be used if the implementing class is registered via {@link IWailaRegistrar}.{@link registerTailProvider} client side.</br>
* You are supposed to always return the modified input currenttip.</br>
*
* @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<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaFMPAccessor accessor, IWailaConfigHandler config);
}
@@ -1,5 +1,22 @@
package mcp.mobius.waila.api;
/**
* Main registration interface. An instance will be provided to a method specified in an IMC msg formatted as follow<br>
* FMLInterModComms.sendMessage("Waila", "register", "fully.qualified.path.to.registration.method");<br>
* The registration method need to follow this signature<br>
* public static void callbackRegister({@link IWailaRegistrar} registrar)<p>
* 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.<br>
* For the registration of blocks, both Blocks and TileEntities are accepted.<p>
* For the configuration keys :<br>
* modname refers to a String used for display in Waila's config panel.<br>
* keyname refers to an unique key used internally for config query (cf {@link IWailaConfigHandler}). Those keys are shared across Waila, keep them unique !<br>
*
*
* @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);
@@ -53,6 +70,6 @@ public interface IWailaRegistrar {
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);
//public void registerDocTextFile (String filename);
//public void registerShortDataProvider (IWailaSummaryProvider dataProvider, Class item);
}
@@ -178,10 +178,12 @@ public class ModuleRegistrar implements IWailaRegistrar {
this.registerProvider(dataProvider, entity, this.overrideEntityProviders);
}
/*
@Override
public void registerShortDataProvider(IWailaSummaryProvider dataProvider, Class item) {
this.registerProvider(dataProvider, item, this.summaryProviders);
}
}
*/
@Override
public void registerDecorator(IWailaBlockDecorator decorator, Class block) {
@@ -387,6 +389,7 @@ public class ModuleRegistrar implements IWailaRegistrar {
}
/* ----------------- */
/*
@Override
public void registerDocTextFile(String filename) {
List<String[]> docData = null;
@@ -417,27 +420,28 @@ public class ModuleRegistrar implements IWailaRegistrar {
}
}
/*
String[] sections = docData.split(">>>>");
for (String s : sections){
s.trim();
if (!s.equals("")){
try{
String name = s.split("\r?\n",2)[0].trim();
String desc = s.split("\r?\n",2)[1].trim();
if (!this.wikiDescriptions.containsKey(modid))
this.wikiDescriptions.put(modid, new LinkedHashMap <String, String>());
this.wikiDescriptions.get(modid).put(name, desc);
nentries += 1;
}catch (Exception e){
System.out.printf("%s\n", e);
}
}
}
*/
// String[] sections = docData.split(">>>>");
// for (String s : sections){
// s.trim();
// if (!s.equals("")){
// try{
// String name = s.split("\r?\n",2)[0].trim();
// String desc = s.split("\r?\n",2)[1].trim();
// if (!this.wikiDescriptions.containsKey(modid))
// this.wikiDescriptions.put(modid, new LinkedHashMap <String, String>());
// this.wikiDescriptions.get(modid).put(name, desc);
// nentries += 1;
// }catch (Exception e){
// System.out.printf("%s\n", e);
// }
// }
// }
Waila.log.log(Level.INFO, String.format("Registered %s entries from %s", nentries, filename));
}
*/
public boolean hasDocTextModID(String modid){
return this.wikiDescriptions.containsKey(modid);
}