mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-23 21:49:46 +00:00
Minor code and documentation cleanup. (#4664)
This commit is contained in:
52 files changed
+227
-249
No files matched your search
@@ -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 "";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
@@ -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);
|
||||
}
|
||||
Reference in new issue
Block a user