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);
}