Minor code and documentation cleanup. (#4664)

This commit is contained in:
mezz authored and GitHub committed 2018-01-12 23:54:29 -08:00
1 parent 0c0cb2b11a
commit d0bdb23300
52 files changed
+227 -249

No files matched your search

@@ -675,7 +675,7 @@ public class FMLClientHandler implements IFMLSidedHandler
}
catch (NoSuchMethodException e)
{
FMLLog.log.error("The container {} (type {}) returned an invalid class for it's resource pack.", container.getName(), container.getClass().getName());
FMLLog.log.error("The container {} (type {}) returned an invalid class for its resource pack.", container.getName(), container.getClass().getName());
}
catch (Exception e)
{
@@ -34,13 +34,13 @@ public interface IModGuiFactory {
*
* @param minecraftInstance the instance
*/
public void initialize(Minecraft minecraftInstance);
void initialize(Minecraft minecraftInstance);
/**
* If this method returns false, the config button in the mod list will be disabled
* @return true if this object provides a config gui screen, false otherwise
*/
public boolean hasConfigGui();
boolean hasConfigGui();
/**
* Return an initialized {@link GuiScreen}. This screen will be displayed
@@ -62,7 +62,7 @@ public interface IModGuiFactory {
* @return A class that will be instantiated on clicks on the config button
* or null if no GUI is desired.
*/
public GuiScreen createConfigGui(GuiScreen parentScreen);
GuiScreen createConfigGui(GuiScreen parentScreen);
/**
* Return a list of the "runtime" categories this mod wishes to populate with
@@ -84,7 +84,7 @@ public interface IModGuiFactory {
*
* @return the set of options this mod wishes to have available, or empty if none
*/
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories();
Set<RuntimeOptionCategoryElement> runtimeGuiCategories();
/**
* Represents an option category and entry in the runtime gui options list.
@@ -1692,45 +1692,45 @@ public class GuiConfigEntries extends GuiListExtended
* Gets the IConfigElement object owned by this entry.
* @return
*/
public IConfigElement getConfigElement();
IConfigElement getConfigElement();
/**
* Gets the name of the ConfigElement owned by this entry.
*/
public String getName();
String getName();
/**
* Gets the current value of this entry.
*/
public Object getCurrentValue();
Object getCurrentValue();
/**
* Gets the current values of this list entry.
*/
public Object[] getCurrentValues();
Object[] getCurrentValues();
/**
* Is this list entry enabled?
*
* @return true if this entry's controls should be enabled, false otherwise.
*/
public boolean enabled();
boolean enabled();
/**
* Handles user keystrokes for any GuiTextField objects in this entry. Call {@link GuiTextField#textboxKeyTyped(char, int)} for any GuiTextField
* objects that should receive the input provided.
*/
public void keyTyped(char eventChar, int eventKey);
void keyTyped(char eventChar, int eventKey);
/**
* Call {@link GuiTextField#updateCursorCounter()} for any GuiTextField objects in this entry.
*/
public void updateCursorCounter();
void updateCursorCounter();
/**
* Call {@link GuiTextField#mouseClicked(int, int, int)} for and GuiTextField objects in this entry.
*/
public void mouseClicked(int x, int y, int mouseEvent);
void mouseClicked(int x, int y, int mouseEvent);
/**
* Is this entry's value equal to the default value? Generally true should be returned if this entry is not a property or category
@@ -1738,50 +1738,50 @@ public class GuiConfigEntries extends GuiListExtended
*
* @return true if this entry's value is equal to this entry's default value.
*/
public boolean isDefault();
boolean isDefault();
/**
* Sets this entry's value to the default value.
*/
public void setToDefault();
void setToDefault();
/**
* Handles reverting any changes that have occurred to this entry.
*/
public void undoChanges();
void undoChanges();
/**
* Has the value of this entry changed?
*
* @return true if changes have been made to this entry's value, false otherwise.
*/
public boolean isChanged();
boolean isChanged();
/**
* Handles saving any changes that have been made to this entry back to the underlying object. It is a good practice to check
* isChanged() before performing the save action. This method should return true if the element has changed AND REQUIRES A RESTART.
*/
public boolean saveConfigElement();
boolean saveConfigElement();
/**
* Handles drawing any tooltips that apply to this entry. This method is called after all other GUI elements have been drawn to the
* screen, so it could also be used to draw any GUI element that needs to be drawn after all entries have had drawEntry() called.
*/
public void drawToolTip(int mouseX, int mouseY);
void drawToolTip(int mouseX, int mouseY);
/**
* Gets this entry's label width.
*/
public int getLabelWidth();
int getLabelWidth();
/**
* Gets this entry's right-hand x boundary. This value is used to control where the scroll bar is placed.
*/
public int getEntryRightBound();
int getEntryRightBound();
/**
* This method is called when the parent GUI is closed. Most handlers won't need this; it is provided for special cases.
*/
public void onGuiClosed();
void onGuiClosed();
}
}
@@ -691,16 +691,16 @@ public class GuiEditArrayEntries extends GuiListExtended
public static interface IArrayEntry extends GuiListExtended.IGuiListEntry
{
public void keyTyped(char eventChar, int eventKey);
void keyTyped(char eventChar, int eventKey);
public void updateCursorCounter();
void updateCursorCounter();
public void mouseClicked(int x, int y, int mouseEvent);
void mouseClicked(int x, int y, int mouseEvent);
public void drawToolTip(int mouseX, int mouseY);
void drawToolTip(int mouseX, int mouseY);
public boolean isValueSavable();
boolean isValueSavable();
public Object getValue();
Object getValue();
}
}
@@ -200,6 +200,6 @@ public class GuiSelectStringEntries extends GuiListExtended
public static interface IGuiSelectStringListEntry extends GuiListExtended.IGuiListEntry
{
public Object getValue();
Object getValue();
}
}
@@ -35,7 +35,7 @@ public interface IConfigElement
/**
* [Property, Category] Is this object a property object?
*/
public boolean isProperty();
boolean isProperty();
/**
* This method returns a class that implements {@link IConfigEntry} or null. This class MUST
@@ -47,7 +47,7 @@ public interface IConfigElement
* @see GuiConfigEntries.DoubleEntry
* @see GuiConfigEntries.IntegerEntry
*/
public Class<? extends IConfigEntry> getConfigEntryClass();
Class<? extends IConfigEntry> getConfigEntryClass();
/**
* This method returns a class that implements {@link IArrayEntry}. This class MUST provide a constructor with the
@@ -59,131 +59,131 @@ public interface IConfigElement
* @see GuiEditArrayEntries.DoubleEntry
* @see GuiEditArrayEntries.IntegerEntry
*/
public Class<? extends IArrayEntry> getArrayEntryClass();
Class<? extends IArrayEntry> getArrayEntryClass();
/**
* [Property, Category] Gets the name of this object.
*/
public String getName();
String getName();
/**
* [Category] Gets the qualified name of this object. This is typically only used for category objects.
*/
public String getQualifiedName();
String getQualifiedName();
/**
* [Property, Category] Gets a language key for localization of config GUI entry names. If the same key is specified with .tooltip
* appended to the end, that key will return a localized tooltip when the mouse hovers over the property label/category button.
*/
public String getLanguageKey();
String getLanguageKey();
/**
* [Property, Category] Gets the comment for this object. Used for the tooltip if getLanguageKey() + ".tooltip" is not defined in the
* .lang file.
*/
public String getComment();
String getComment();
/**
* [Category] Gets this category's child categories/properties.
*/
public List<IConfigElement> getChildElements();
List<IConfigElement> getChildElements();
/**
* [Property, Category] Gets the ConfigGuiType value corresponding to the type of this property object, or CONFIG_CATEGORY if this is a
* category object.
*/
public ConfigGuiType getType();
ConfigGuiType getType();
/**
* [Property] Is this property object a list?
*/
public boolean isList();
boolean isList();
/**
* [Property] Does this list property have to remain a fixed length?
*/
public boolean isListLengthFixed();
boolean isListLengthFixed();
/**
* [Property] Gets the max length of this list property, or -1 if the length is unlimited.
*/
public int getMaxListLength();
int getMaxListLength();
/**
* [Property] Is this property value equal to the default value?
*/
public boolean isDefault();
boolean isDefault();
/**
* [Property] Gets this property's default value. If this element is an array, this method should return a String
* representation of that array using Arrays.toString()
*/
public Object getDefault();
Object getDefault();
/**
* [Property] Gets this property's default values.
*/
public Object[] getDefaults();
Object[] getDefaults();
/**
* [Property] Sets this property's value to the default value.
*/
public void setToDefault();
void setToDefault();
/**
* [Property, Category] Whether or not this element is safe to modify while a world is running. For Categories return false if ANY properties
* in the category are modifiable while a world is running, true if all are not.
*/
public boolean requiresWorldRestart();
boolean requiresWorldRestart();
/**
* [Property, Category] Whether or not this element should be allowed to show on config GUIs.
*/
public boolean showInGui();
boolean showInGui();
/**
* [Property, Category] Whether or not this element requires Minecraft to be restarted when changed.
*/
public boolean requiresMcRestart();
boolean requiresMcRestart();
/**
* [Property] Gets this property value.
*/
public Object get();
Object get();
/**
* [Property] Gets this property value as a list. Generally you should be sure of whether the property is a list before calling this.
*/
public Object[] getList();
Object[] getList();
/**
* [Property] Sets this property's value.
*/
public void set(Object value);
void set(Object value);
/**
* [Property] Sets this property's value to the specified array.
*/
public void set(Object[] aVal);
void set(Object[] aVal);
/**
* [Property] Gets a String array of valid values for this property. This is generally used for String properties to allow the user to
* select a value from a list of valid values.
*/
public String[] getValidValues();
String[] getValidValues();
/**
* [Property] Gets this property's minimum value.
*/
public Object getMinValue();
Object getMinValue();
/**
* [Property] Gets this property's maximum value.
*/
public Object getMaxValue();
Object getMaxValue();
/**
* [Property] Gets a Pattern object used in String property input validation.
*/
public Pattern getValidationPattern();
Pattern getValidationPattern();
}
@@ -25,5 +25,5 @@ import net.minecraft.entity.Entity;
public interface IRenderFactory<T extends Entity>
{
public Render<? super T> createRenderFor(RenderManager manager);
Render<? super T> createRenderFor(RenderManager manager);
}
@@ -28,10 +28,10 @@ import net.minecraftforge.fml.relauncher.Side;
import org.apache.logging.log4j.Level;
public interface ILanguageAdapter {
public Object getNewInstance(FMLModContainer container, Class<?> objectClass, ClassLoader classLoader, Method factoryMarkedAnnotation) throws Exception;
public boolean supportsStatics();
public void setProxy(Field target, Class<?> proxyTarget, Object proxy) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException;
public void setInternalProxies(ModContainer mod, Side side, ClassLoader loader);
Object getNewInstance(FMLModContainer container, Class<?> objectClass, ClassLoader classLoader, Method factoryMarkedAnnotation) throws Exception;
boolean supportsStatics();
void setProxy(Field target, Class<?> proxyTarget, Object proxy) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException;
void setInternalProxies(ModContainer mod, Side side, ClassLoader loader);
public static class ScalaAdapter implements ILanguageAdapter {
@Override
@@ -45,5 +45,5 @@ public interface IWorldGenerator
* @param chunkProvider : additionalData[2] {@link IChunkProvider} that is requesting the world generation.
*
*/
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider);
void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider);
}
@@ -49,15 +49,15 @@ import net.minecraftforge.fml.relauncher.Side;
* at pre-defined times during the loading of the game, based on where you have applied the {@link EventHandler}
* annotation.
*
* <p>This is a simple example of a Mod. It has the modId of "MyModId", the name of "My example mod", it is
* <p>This is a simple example of a Mod. It has the modId of "mymodid", the name of "My example mod", it is
* version 1.0, and depends on FML being loaded.
* <pre>{@code
* package mymod;
* // Declare that this is a mod with modId "MyModId", name "My example mod", version "1.0" and dependency on FML.
* {@literal @}Mod(modId="MyModId",name="My example mod",version="1.0",dependencies="required-after:FML")
* // Declare that this is a mod with modId "mymodid", name "My example mod", version "1.0" and dependency on FML.
* {@literal @}Mod(modId="mymodid",name="My example mod",version="1.0",dependencies="required-after:FML")
* public class MyMod {
* // Populate this field with the instance of the mod created by FML
* {@literal @}Instance("MyModId")
* {@literal @}Instance("mymodid")
* public MyMod instance;
*
* // Mark this method for receiving an {@link FMLEvent} (in this case, it's the {@link FMLPreInitializationEvent})
@@ -95,6 +95,8 @@ public @interface Mod
*
* The version string here should be just numbers separated by dots,
* to make specifying {@link #dependencies()} simple for other mods.
*
* See also: <a href="https://cwiki.apache.org/confluence/display/MAVENOLD/Versioning">"Versioning" on Maven Wiki</a>
*/
String version() default "";
@@ -253,7 +255,7 @@ public @interface Mod
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({})
public @interface CustomProperty
@interface CustomProperty
{
/**
* A key. Should be unique.
@@ -307,7 +309,7 @@ public @interface Mod
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface EventHandler{}
@interface EventHandler{}
/**
* Populate the annotated field with the mod instance based on the specified ModId. This can be used
@@ -317,7 +319,7 @@ public @interface Mod
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface Instance {
@interface Instance {
/**
* The mod object to inject into this field
*/
@@ -336,7 +338,7 @@ public @interface Mod
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface Metadata {
@interface Metadata {
/**
* The mod id specifying the metadata to load here
*/
@@ -356,7 +358,7 @@ public @interface Mod
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface InstanceFactory {
@interface InstanceFactory {
}
/**
@@ -364,7 +366,7 @@ public @interface Mod
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface EventBusSubscriber {
@interface EventBusSubscriber {
Side[] value() default { Side.CLIENT, Side.SERVER };
/**
@@ -50,7 +50,7 @@ public final class Optional {
* Mark a list of interfaces for optional removal.
* @return
*/
public Interface[] value();
Interface[] value();
}
/**
* Used to remove optional interfaces
@@ -65,20 +65,20 @@ public final class Optional {
* The fully qualified name of the interface to be stripped
* @return the interface name
*/
public String iface();
String iface();
/**
* The modid that is required to be present for stripping NOT to occur
* @return the modid
*/
public String modid();
String modid();
/**
* Strip references to this interface in method declarations? (Useful to kill synthetic methods from scala f.e.)
*
* @return if references should be stripped
*/
public boolean striprefs() default false;
boolean striprefs() default false;
}
/**
* Used to remove optional methods
@@ -92,6 +92,6 @@ public final class Optional {
* The modid that is required to be present for stripping NOT to occur
* @return the modid
*/
public String modid();
String modid();
}
}
@@ -27,6 +27,6 @@ import net.minecraft.world.storage.*;
public interface WorldAccessContainer
{
public NBTTagCompound getDataForWriting(SaveHandler handler, WorldInfo info);
public void readData(SaveHandler handler, WorldInfo info, Map<String,NBTBase> propertyMap, NBTTagCompound tag);
NBTTagCompound getDataForWriting(SaveHandler handler, WorldInfo info);
void readData(SaveHandler handler, WorldInfo info, Map<String, NBTBase> propertyMap, NBTTagCompound tag);
}
@@ -29,5 +29,5 @@ public interface ITypeDiscoverer
// main class part, followed by an optional $ and an "inner class" part. $ cannot be last, otherwise scala breaks
public static Pattern classFile = Pattern.compile("[^\\s\\$]+(\\$[^\\s]+)?\\.class$");
public List<ModContainer> discover(ModCandidate candidate, ASMDataTable table);
List<ModContainer> discover(ModCandidate candidate, ASMDataTable table);
}
@@ -45,7 +45,6 @@ import javax.annotation.Nullable;
* Load any configuration data you might have {@link #getSuggestedConfigurationFile()}
* Search for a version.properties file and load it {@link #getVersionProperties()}
* Configure your {@link ModMetadata} programmatically {@link #getModMetadata()}
* Register your blocks and items with the {@link net.minecraftforge.fml.common.registry.GameRegistry}
* Discover parts of your mod by using annotation search {@link #getAsmData()}
*
* @see net.minecraftforge.fml.common.Mod.EventHandler for how to subscribe to this event
@@ -147,8 +146,6 @@ public class FMLPreInitializationEvent extends FMLStateEvent
/**
* Get a logger instance configured to write to the FML Log as a parent, identified by modid. Handy for mod logging!
* Configurations can be applied through the <code>config/logging.properties</code> file, specifying logging levels
* for your ModID. Use this!
*
* @return A logger
*/
@@ -23,5 +23,5 @@ package net.minecraftforge.fml.common.eventhandler;
public interface IEventListener
{
public void invoke(Event event);
void invoke(Event event);
}
@@ -29,6 +29,6 @@ import static java.lang.annotation.ElementType.*;
@Target(value = METHOD)
public @interface SubscribeEvent
{
public EventPriority priority() default EventPriority.NORMAL;
public boolean receiveCanceled() default false;
EventPriority priority() default EventPriority.NORMAL;
boolean receiveCanceled() default false;
}
@@ -33,11 +33,11 @@ public interface IMessage {
*
* @param buf
*/
public void fromBytes(ByteBuf buf);
void fromBytes(ByteBuf buf);
/**
* Deconstruct your message into the supplied byte buffer
* @param buf
*/
public void toBytes(ByteBuf buf);
void toBytes(ByteBuf buf);
}
@@ -39,5 +39,5 @@ public interface IMessageHandler<REQ extends IMessage, REPLY extends IMessage> {
* @param message The message
* @return an optional return message
*/
public REPLY onMessage(REQ message, MessageContext ctx);
REPLY onMessage(REQ message, MessageContext ctx);
}
@@ -298,21 +298,21 @@ public class GameRegistry
*
* @return The registry name
*/
public String value();
String value();
/**
* The metadata or damage value for the itemstack, defaults to 0.
*
* @return the metadata value
*/
public int meta() default 0;
int meta() default 0;
/**
* The string serialized nbt value for the itemstack. Defaults to empty for no nbt.
*
* @return a nbt string
*/
public String nbt() default "";
String nbt() default "";
}
/**
@@ -33,7 +33,7 @@ public interface IEntityAdditionalSpawnData
*
* @param buffer The packet data stream
*/
public void writeSpawnData(ByteBuf buffer);
void writeSpawnData(ByteBuf buffer);
/**
* Called by the client when it receives a Entity spawn packet.
@@ -41,5 +41,5 @@ public interface IEntityAdditionalSpawnData
*
* @param additionalData The packet data stream
*/
public void readSpawnData(ByteBuf additionalData);
void readSpawnData(ByteBuf additionalData);
}
@@ -31,11 +31,11 @@ public interface IThrowableEntity
* Gets the entity that threw/created this entity.
* @return The owner instance, Null if none.
*/
public Entity getThrower();
Entity getThrower();
/**
* Sets the entity that threw/created this entity.
* @param entity The new thrower/creator.
*/
public void setThrower(Entity entity);
void setThrower(Entity entity);
}
@@ -640,7 +640,7 @@ public class CoreModManager {
}
else if (deobfuscatedEnvironment && location == null) // This is probably a mod dev workspace
{
FMLLog.log.info("Ignoring missing certificate for coremod {} ({}), as this is a probably dev workspace", coreModName, coreModClass);
FMLLog.log.info("Ignoring missing certificate for coremod {} ({}), as this is probably a dev workspace", coreModName, coreModClass);
}
else // This is a probably a normal minecraft workspace - log at warn
{
@@ -93,9 +93,9 @@ public interface IFMLLoadingPlugin
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface TransformerExclusions
@interface TransformerExclusions
{
public String[] value() default "";
String[] value() default "";
}
/**
@@ -107,9 +107,9 @@ public interface IFMLLoadingPlugin
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface MCVersion
@interface MCVersion
{
public String value() default "";
String value() default "";
}
/**
@@ -119,16 +119,16 @@ public interface IFMLLoadingPlugin
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Name
@interface Name
{
public String value() default "";
String value() default "";
}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface DependsOn
@interface DependsOn
{
public String[] value() default {};
String[] value() default {};
}
/**
@@ -138,9 +138,9 @@ public interface IFMLLoadingPlugin
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface SortingIndex
@interface SortingIndex
{
public int value() default 0;
int value() default 0;
}
}
@@ -44,5 +44,5 @@ import net.minecraftforge.fml.common.SidedProxy;
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR})
public @interface SideOnly
{
public Side value();
Side value();
}