Minor code and documentation cleanup. (#4664)

This commit is contained in:
mezz 2018-01-12 23:54:29 -08:00 committed by GitHub
parent 0c0cb2b11a
commit d0bdb23300
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 227 additions and 249 deletions

View file

@ -1,63 +1,38 @@
# How to install Forge: For Players # How to install Forge: For Players
Go to [http://files.minecraftforge.net](http://files.minecraftforge.net) Go to [the Forge website](http://files.minecraftforge.net)
and select the minecraft version you wish to get forge for from the list. and select the minecraft version you wish to get forge for from the list.
You can download the installer for the *Recommended Build* or the You can download the installer for the *Recommended Build* or the
*Lastest build* there. Latest builds may have newer features but may be *Latest build* there. Latest builds may have newer features but may be
more unstable as a result. The installer will attempt to install forge more unstable as a result. The installer will attempt to install forge
into your vanilla launcher environment, where you can then create a new into your vanilla launcher environment, where you can then create a new
profile using that version and play the game! profile using that version and play the game!
For support and questions, visit [the Support Forum](http://www.minecraftforge.net/forum/forum/18-support-bug-reports/).
Here is a short video from Rorax showing how to install and setup Forge. Here is a short video from Rorax showing how to install and setup Forge:
[![HOWTO Install Forge](https://img.youtube.com/vi/lB3ArN_-3Oc/0.jpg)](https://www.youtube.com/watch?v=lB3ArN_-3Oc) [![HOWTO Install Forge](https://img.youtube.com/vi/lB3ArN_-3Oc/0.jpg)](https://www.youtube.com/watch?v=lB3ArN_-3Oc)
For support and user questions, visit [http://www.minecraftforge.net](http://www.minecraftforge.net).
# How to install Forge: For Modders # How to install Forge: For Modders
If you wish to setup a new mod for Forge, visit [See the "Getting Started" section in the Forge Documentation](http://mcforge.readthedocs.io/en/latest/gettingstarted/).
[http://files.minecraftforge.net](http://files.minecraftforge.net) and
select the **MDK** download.
This is the `Modder Developer Kit` - basically, an example mod with all
the tooling needed to create a Forge mod workspace ready for use in your
IDE of choice.
Here is a short video from @cpw showing how to install and setup the MDK
in Intellij.
[![HOWTO Install MDK](https://img.youtube.com/vi/PfmlNiHonV0/0.jpg)](https://www.youtube.com/watch?v=PfmlNiHonV0)
# How to install Forge: For those wishing to work on Forge itself # How to install Forge: For those wishing to work on Forge itself
If you wish to actually inspect Forge, submit PRs or otherwise work If you wish to actually inspect Forge, submit PRs or otherwise work
with Forge itself, you're in the right place! Clone this (either with Forge itself, you're in the right place!
directly, or make a Fork first if you want to make a PR) and run
```gradlew.bat setupForge``` or ```gradlew setupForge```. This will download and
setup all the bits you need to have a functional Forge workspace.
After that, open a workspace in your favorite IDE and import existing projects
the projects folder.
Here is a short video from @cpw showing how to install and setup Forge [See the guide to setting up a Forge workspace](http://mcforge.readthedocs.io/en/latest/forgedev/).
in Intellij.
[![HOWTO Install MDK](https://img.youtube.com/vi/yanCpy8p2ZE/0.jpg)](https://www.youtube.com/watch?v=yanCpy8p2ZE)
## Pull requests ## Pull requests
Pull requests should target the current default branch. Currently, that is [See the "Making Changes and Pull Requests" section in the Forge documentation](http://mcforge.readthedocs.io/en/latest/forgedev/#making-changes-and-pull-requests).
the 1.10.x branch for Minecraft 1.10.2.
If you intend to modify a minecraft patch, or add a new one, always run
```gradlew genPatches``` to generate your patch and validate that you
are not doing anything unexpected in your patch.
### Contributor License Agreement ### Contributor License Agreement
As stated in the (https://github.com/MinecraftForge/MinecraftForge/blob/1.10.x/LICENSE-new.txt) As stated in the [LICENSE-new](LICENSE-new.txt)
file, we require all contributors to acknowledge the Forge Contributor file, we require all contributors to acknowledge the Forge Contributor
License Agreement. Please ensure you have a valid email address License Agreement. Please ensure you have a valid email address
associated with your github account to do this. If you have previously associated with your github account to do this. If you have previously
signed it, you should be OK. signed it, you should be OK.

View file

@ -14,6 +14,9 @@ Source pack installation information:
Standalone source installation Standalone source installation
============================== ==============================
See the Forge Documentation online for more detailed instructions:
http://mcforge.readthedocs.io/en/latest/gettingstarted/
Step 1: Open your command-line and browse to the folder where you extracted the zip file. Step 1: Open your command-line and browse to the folder where you extracted the zip file.
Step 2: Once you have a command window up in the folder that the downloaded material was placed, type: Step 2: Once you have a command window up in the folder that the downloaded material was placed, type:
@ -24,7 +27,7 @@ Linux/Mac OS: "./gradlew setupDecompWorkspace"
Step 3: After all that finished, you're left with a choice. Step 3: After all that finished, you're left with a choice.
For eclipse, run "gradlew eclipse" (./gradlew eclipse if you are on Mac/Linux) For eclipse, run "gradlew eclipse" (./gradlew eclipse if you are on Mac/Linux)
If you preffer to use IntelliJ, steps are a little different. If you prefer to use IntelliJ, steps are a little different.
1. Open IDEA, and import project. 1. Open IDEA, and import project.
2. Select your build.gradle file and have it import. 2. Select your build.gradle file and have it import.
3. Once it's finished you must close IntelliJ and run the following command: 3. Once it's finished you must close IntelliJ and run the following command:
@ -33,14 +36,14 @@ If you preffer to use IntelliJ, steps are a little different.
Step 4: The final step is to open Eclipse and switch your workspace to /eclipse/ (if you use IDEA, it should automatically start on your project) Step 4: The final step is to open Eclipse and switch your workspace to /eclipse/ (if you use IDEA, it should automatically start on your project)
If at any point you are missing libraries in your IDE, or you've run into problems you can run "gradlew --refresh-dependencies" to refresh the local cache. "gradlew clean" to reset everything {this does not effect your code} and then start the processs again. If at any point you are missing libraries in your IDE, or you've run into problems you can run "gradlew --refresh-dependencies" to refresh the local cache. "gradlew clean" to reset everything {this does not affect your code} and then start the processs again.
Should it still not work, Should it still not work,
Refer to #ForgeGradle on EsperNet for more information about the gradle environment. Refer to #ForgeGradle on EsperNet for more information about the gradle environment.
Tip: Tip:
If you do not care about seeing Minecraft's source code you can replace "setupDecompWorkspace" with one of the following: If you do not care about seeing Minecraft's source code you can replace "setupDecompWorkspace" with one of the following:
"setupDevWorkspace": Will patch, deobfusicated, and gather required assets to run minecraft, but will not generated human readable source code. "setupDevWorkspace": Will patch, deobfuscate, and gather required assets to run minecraft, but will not generate human readable source code.
"setupCIWorkspace": Same as Dev but will not download any assets. This is useful in build servers as it is the fastest because it does the least work. "setupCIWorkspace": Same as Dev but will not download any assets. This is useful in build servers as it is the fastest because it does the least work.
Tip: Tip:

View file

@ -4,17 +4,28 @@ import net.minecraft.init.Blocks;
import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import org.apache.logging.log4j.Logger;
@Mod(modid = ExampleMod.MODID, version = ExampleMod.VERSION) @Mod(modid = ExampleMod.MODID, name = ExampleMod.NAME, version = ExampleMod.VERSION)
public class ExampleMod public class ExampleMod
{ {
public static final String MODID = "examplemod"; public static final String MODID = "examplemod";
public static final String NAME = "Example Mod";
public static final String VERSION = "1.0"; public static final String VERSION = "1.0";
private static Logger logger;
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
logger = event.getModLog();
}
@EventHandler @EventHandler
public void init(FMLInitializationEvent event) public void init(FMLInitializationEvent event)
{ {
// some example code // some example code
System.out.println("DIRT BLOCK >> "+Blocks.DIRT.getUnlocalizedName()); logger.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
} }
} }

View file

@ -164,7 +164,7 @@
} }
public static class EntityEggInfo public static class EntityEggInfo
@@ -428,5 +449,16 @@ @@ -428,5 +450,16 @@
this.field_151512_d = StatList.func_151182_a(this); this.field_151512_d = StatList.func_151182_a(this);
this.field_151513_e = StatList.func_151176_b(this); this.field_151513_e = StatList.func_151176_b(this);
} }

View file

@ -68,7 +68,7 @@
CreativeTabs creativetabs = this.func_77640_w(); CreativeTabs creativetabs = this.func_77640_w();
return creativetabs != null && (p_194125_1_ == CreativeTabs.field_78027_g || p_194125_1_ == creativetabs); return creativetabs != null && (p_194125_1_ == CreativeTabs.field_78027_g || p_194125_1_ == creativetabs);
} }
@@ -435,11 +445,704 @@ @@ -435,11 +441,704 @@
return false; return false;
} }
@ -773,7 +773,7 @@
public static void func_150900_l() public static void func_150900_l()
{ {
func_179214_a(Blocks.field_150350_a, new ItemAir(Blocks.field_150350_a)); func_179214_a(Blocks.field_150350_a, new ItemAir(Blocks.field_150350_a));
@@ -999,6 +1702,8 @@ @@ -999,6 +1698,8 @@
private final float field_78010_h; private final float field_78010_h;
private final float field_78011_i; private final float field_78011_i;
private final int field_78008_j; private final int field_78008_j;
@ -782,7 +782,7 @@
private ToolMaterial(int p_i1874_3_, int p_i1874_4_, float p_i1874_5_, float p_i1874_6_, int p_i1874_7_) private ToolMaterial(int p_i1874_3_, int p_i1874_4_, float p_i1874_5_, float p_i1874_6_, int p_i1874_7_)
{ {
@@ -1034,6 +1739,7 @@ @@ -1034,6 +1735,7 @@
return this.field_78008_j; return this.field_78008_j;
} }
@ -790,7 +790,7 @@
public Item func_150995_f() public Item func_150995_f()
{ {
if (this == WOOD) if (this == WOOD)
@@ -1057,5 +1763,21 @@ @@ -1057,5 +1759,21 @@
return this == DIAMOND ? Items.field_151045_i : null; return this == DIAMOND ? Items.field_151045_i : null;
} }
} }

View file

@ -19,14 +19,18 @@
package net.minecraftforge.client; package net.minecraftforge.client;
/**
* @deprecated TODO remove in 1.13. This has never been used
*/
@Deprecated
public interface IRenderContextHandler public interface IRenderContextHandler
{ {
/** Run before the specified rendering context. /** Run before the specified rendering context.
*/ */
public void beforeRenderContext(); void beforeRenderContext();
/** Run after the specified rendering context. /** Run after the specified rendering context.
*/ */
public void afterRenderContext(); void afterRenderContext();
} }

View file

@ -28,10 +28,10 @@ public interface ICustomModelLoader extends IResourceManagerReloadListener
* Checks if given model should be loaded by this loader. * Checks if given model should be loaded by this loader.
* Reading file contents is inadvisable, if possible decision should be made based on the location alone. * Reading file contents is inadvisable, if possible decision should be made based on the location alone.
*/ */
public boolean accepts(ResourceLocation modelLocation); boolean accepts(ResourceLocation modelLocation);
/* /*
* loads (or reloads) specified model * loads (or reloads) specified model
*/ */
public IModel loadModel(ResourceLocation modelLocation) throws Exception; IModel loadModel(ResourceLocation modelLocation) throws Exception;
} }

View file

@ -106,6 +106,9 @@ import com.google.common.base.Joiner;
import com.google.common.base.Objects; import com.google.common.base.Objects;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
import com.google.common.base.Predicate; import com.google.common.base.Predicate;
import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader; import com.google.common.cache.CacheLoader;
@ -208,8 +211,10 @@ public final class ModelLoader extends ModelBakery
@Override @Override
protected void loadBlocks() protected void loadBlocks()
{ {
List<Block> blocks = Lists.newArrayList(Iterables.filter(Block.REGISTRY, block -> block.getRegistryName() != null)); List<Block> blocks = StreamSupport.stream(Block.REGISTRY.spliterator(), false)
blocks.sort(Comparator.comparing(b -> b.getRegistryName().toString())); .filter(block -> block.getRegistryName() != null)
.sorted(Comparator.comparing(b -> b.getRegistryName().toString()))
.collect(Collectors.toList());
ProgressBar blockBar = ProgressManager.push("ModelLoader: blocks", blocks.size()); ProgressBar blockBar = ProgressManager.push("ModelLoader: blocks", blocks.size());
BlockStateMapper mapper = this.blockModelShapes.getBlockStateMapper(); BlockStateMapper mapper = this.blockModelShapes.getBlockStateMapper();
@ -280,8 +285,10 @@ public final class ModelLoader extends ModelBakery
registerVariantNames(); registerVariantNames();
List<Item> items = Lists.newArrayList(Iterables.filter(Item.REGISTRY, item -> item.getRegistryName() != null)); List<Item> items = StreamSupport.stream(Item.REGISTRY.spliterator(), false)
Collections.sort(items, (i1, i2) -> i1.getRegistryName().toString().compareTo(i2.getRegistryName().toString())); .filter(item -> item.getRegistryName() != null)
.sorted(Comparator.comparing(i -> i.getRegistryName().toString()))
.collect(Collectors.toList());
ProgressBar itemBar = ProgressManager.push("ModelLoader: items", items.size()); ProgressBar itemBar = ProgressManager.push("ModelLoader: items", items.size());
for(Item item : items) for(Item item : items)

View file

@ -34,36 +34,18 @@ import net.minecraftforge.common.ForgeModContainer;
public class ForgeBlockModelRenderer extends BlockModelRenderer public class ForgeBlockModelRenderer extends BlockModelRenderer
{ {
private final ThreadLocal<VertexLighterFlat> lighterFlat = new ThreadLocal<VertexLighterFlat>() private final ThreadLocal<VertexLighterFlat> lighterFlat;
{ private final ThreadLocal<VertexLighterSmoothAo> lighterSmooth;
@Override
protected VertexLighterFlat initialValue()
{
return new VertexLighterFlat(colors);
}
};
private final ThreadLocal<VertexLighterSmoothAo> lighterSmooth = new ThreadLocal<VertexLighterSmoothAo>()
{
@Override
protected VertexLighterSmoothAo initialValue()
{
return new VertexLighterSmoothAo(colors);
}
};
private final ThreadLocal<VertexBufferConsumer> wrFlat = new ThreadLocal<>(); private final ThreadLocal<VertexBufferConsumer> wrFlat = new ThreadLocal<>();
private final ThreadLocal<VertexBufferConsumer> wrSmooth = new ThreadLocal<>(); private final ThreadLocal<VertexBufferConsumer> wrSmooth = new ThreadLocal<>();
private final ThreadLocal<BufferBuilder> lastRendererFlat = new ThreadLocal<>(); private final ThreadLocal<BufferBuilder> lastRendererFlat = new ThreadLocal<>();
private final ThreadLocal<BufferBuilder> lastRendererSmooth = new ThreadLocal<>(); private final ThreadLocal<BufferBuilder> lastRendererSmooth = new ThreadLocal<>();
private final BlockColors colors;
public ForgeBlockModelRenderer(BlockColors colors) public ForgeBlockModelRenderer(BlockColors colors)
{ {
// TODO Auto-generated constructor stub
super(colors); super(colors);
this.colors = colors; lighterFlat = ThreadLocal.withInitial(() -> new VertexLighterFlat(colors));
lighterSmooth = ThreadLocal.withInitial(() -> new VertexLighterSmoothAo(colors));
} }
@Override @Override

View file

@ -166,7 +166,7 @@ public class ForgeChunkManager
* @param tickets The tickets to re-register. The list is immutable and cannot be manipulated directly. Copy it first. * @param tickets The tickets to re-register. The list is immutable and cannot be manipulated directly. Copy it first.
* @param world the world * @param world the world
*/ */
public void ticketsLoaded(List<Ticket> tickets, World world); void ticketsLoaded(List<Ticket> tickets, World world);
} }
/** /**
@ -197,7 +197,7 @@ public class ForgeChunkManager
* to "maxTicketCount" size after the call returns and then offered to the other callback * to "maxTicketCount" size after the call returns and then offered to the other callback
* method * method
*/ */
public List<Ticket> ticketsLoaded(List<Ticket> tickets, World world, int maxTicketCount); List<Ticket> ticketsLoaded(List<Ticket> tickets, World world, int maxTicketCount);
} }
public interface PlayerOrderedLoadingCallback extends LoadingCallback public interface PlayerOrderedLoadingCallback extends LoadingCallback
@ -216,7 +216,7 @@ public class ForgeChunkManager
* @return A list of the tickets this mod wishes to use. This list will subsequently be offered * @return A list of the tickets this mod wishes to use. This list will subsequently be offered
* to the main callback for action * to the main callback for action
*/ */
public ListMultimap<String, Ticket> playerTicketsLoaded(ListMultimap<String, Ticket> tickets, World world); ListMultimap<String, Ticket> playerTicketsLoaded(ListMultimap<String, Ticket> tickets, World world);
} }
public enum Type public enum Type
{ {

View file

@ -38,7 +38,7 @@ public interface IMinecartCollisionHandler
* @param cart The cart that called the collision. * @param cart The cart that called the collision.
* @param other The object it collided with. * @param other The object it collided with.
*/ */
public void onEntityCollision(EntityMinecart cart, Entity other); void onEntityCollision(EntityMinecart cart, Entity other);
/** /**
* This function replaced the function of the same name in EntityMinecart. * This function replaced the function of the same name in EntityMinecart.
@ -48,7 +48,7 @@ public interface IMinecartCollisionHandler
* @param other The entity requesting the collision box. * @param other The entity requesting the collision box.
* @return The collision box or null. * @return The collision box or null.
*/ */
public AxisAlignedBB getCollisionBox(EntityMinecart cart, Entity other); AxisAlignedBB getCollisionBox(EntityMinecart cart, Entity other);
/** /**
* This function is used to define the box used for detecting minecart collisions. * This function is used to define the box used for detecting minecart collisions.
@ -56,7 +56,7 @@ public interface IMinecartCollisionHandler
* @param cart The cart for which the collision box was requested. * @param cart The cart for which the collision box was requested.
* @return The collision box, cannot be null. * @return The collision box, cannot be null.
*/ */
public AxisAlignedBB getMinecartCollisionBox(EntityMinecart cart); AxisAlignedBB getMinecartCollisionBox(EntityMinecart cart);
/** /**
* This function replaces the function of the same name in EntityMinecart. * This function replaces the function of the same name in EntityMinecart.
@ -64,6 +64,6 @@ public interface IMinecartCollisionHandler
* @param cart The cart for which the bounding box was requested. * @param cart The cart for which the bounding box was requested.
* @return The bounding box or null. * @return The bounding box or null.
*/ */
public AxisAlignedBB getBoundingBox(EntityMinecart cart); AxisAlignedBB getBoundingBox(EntityMinecart cart);
} }

View file

@ -25,6 +25,6 @@ import net.minecraft.world.IBlockAccess;
public interface IPlantable public interface IPlantable
{ {
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos); EnumPlantType getPlantType(IBlockAccess world, BlockPos pos);
public IBlockState getPlant(IBlockAccess world, BlockPos pos); IBlockState getPlant(IBlockAccess world, BlockPos pos);
} }

View file

@ -43,12 +43,12 @@ public interface IShearable
* Checks if the object is currently shearable * Checks if the object is currently shearable
* Example: Sheep return false when they have no wool * Example: Sheep return false when they have no wool
* *
* @param item The itemstack that is being used, Possible to be null * @param item The ItemStack that is being used, may be empty.
* @param world The current world * @param world The current world.
* @param pos Block's position in world. * @param pos Block's position in world.
* @return If this is shearable, and onSheared should be called. * @return If this is shearable, and onSheared should be called.
*/ */
public boolean isShearable(@Nonnull ItemStack item, IBlockAccess world, BlockPos pos); boolean isShearable(@Nonnull ItemStack item, IBlockAccess world, BlockPos pos);
/** /**
* Performs the shear function on this object. * Performs the shear function on this object.
@ -62,11 +62,12 @@ public interface IShearable
* For entities, they should trust there internal location information * For entities, they should trust there internal location information
* over the values passed into this function. * over the values passed into this function.
* *
* @param item The itemstack that is being used, Possible to be null * @param item The ItemStack that is being used, may be empty.
* @param world The current world * @param world The current world.
* @param pos If this is a block, the block's position in world. * @param pos If this is a block, the block's position in world.
* @param fortune The fortune level of the shears being used * @param fortune The fortune level of the shears being used.
* @return A ArrayList containing all items from this shearing. Possible to be null. * @return A List containing all items from this shearing. May be empty.
*/ */
public List<ItemStack> onSheared(@Nonnull ItemStack item, IBlockAccess world, BlockPos pos, int fortune); @Nonnull
List<ItemStack> onSheared(@Nonnull ItemStack item, IBlockAccess world, BlockPos pos, int fortune);
} }

View file

@ -60,7 +60,7 @@ public interface ISpecialArmor
* @param slot The armor slot the item is in. * @param slot The armor slot the item is in.
* @return A ArmorProperties instance holding information about how the armor effects damage. * @return A ArmorProperties instance holding information about how the armor effects damage.
*/ */
public ArmorProperties getProperties(EntityLivingBase player, @Nonnull ItemStack armor, DamageSource source, double damage, int slot); ArmorProperties getProperties(EntityLivingBase player, @Nonnull ItemStack armor, DamageSource source, double damage, int slot);
/** /**
* Get the displayed effective armor. * Get the displayed effective armor.
@ -70,7 +70,7 @@ public interface ISpecialArmor
* @param slot The armor slot the item is in. * @param slot The armor slot the item is in.
* @return The number of armor points for display, 2 per shield. * @return The number of armor points for display, 2 per shield.
*/ */
public abstract int getArmorDisplay(EntityPlayer player, @Nonnull ItemStack armor, int slot); int getArmorDisplay(EntityPlayer player, @Nonnull ItemStack armor, int slot);
/** /**
* Applies damage to the ItemStack. The mod is responsible for reducing the * Applies damage to the ItemStack. The mod is responsible for reducing the
@ -84,7 +84,7 @@ public interface ISpecialArmor
* @param damage The amount of damage being applied to the armor * @param damage The amount of damage being applied to the armor
* @param slot The armor slot the item is in. * @param slot The armor slot the item is in.
*/ */
public abstract void damageArmor(EntityLivingBase entity, @Nonnull ItemStack stack, DamageSource source, int damage, int slot); void damageArmor(EntityLivingBase entity, @Nonnull ItemStack stack, DamageSource source, int damage, int slot);
public static class ArmorProperties implements Comparable<ArmorProperties> public static class ArmorProperties implements Comparable<ArmorProperties>
{ {

View file

@ -27,5 +27,5 @@ package net.minecraftforge.common.animation;
*/ */
public interface ITimeValue public interface ITimeValue
{ {
public float apply(float input); float apply(float input);
} }

View file

@ -37,16 +37,16 @@ public interface SelectorHandler
* *
* @param sender The {@link ICommandSender} that initiated the query * @param sender The {@link ICommandSender} that initiated the query
*/ */
public <T extends Entity> List<T> matchEntities(ICommandSender sender, String token, Class<? extends T> targetClass) throws CommandException; <T extends Entity> List<T> matchEntities(ICommandSender sender, String token, Class<? extends T> targetClass) throws CommandException;
/** /**
* Returns whether the selector string potentially matches multiple entities * Returns whether the selector string potentially matches multiple entities
*/ */
public boolean matchesMultiplePlayers(String selectorStr) throws CommandException; boolean matchesMultiplePlayers(String selectorStr) throws CommandException;
/** /**
* Returns whether the string matches the overall syntax of the selector<br> * Returns whether the string matches the overall syntax of the selector<br>
* <b>Note:</b> If this returns {@code false}, {@link #matchEntities} should return an empty list * <b>Note:</b> If this returns {@code false}, {@link #matchEntities} should return an empty list
*/ */
public boolean isSelector(String selectorStr); boolean isSelector(String selectorStr);
} }

View file

@ -67,21 +67,21 @@ public @interface Config
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.TYPE}) @Target({ElementType.FIELD, ElementType.TYPE})
public @interface LangKey @interface LangKey
{ {
String value(); String value();
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD) @Target(ElementType.FIELD)
public @interface Comment @interface Comment
{ {
String[] value(); String[] value();
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD) @Target(ElementType.FIELD)
public @interface RangeInt @interface RangeInt
{ {
int min() default Integer.MIN_VALUE; int min() default Integer.MIN_VALUE;
int max() default Integer.MAX_VALUE; int max() default Integer.MAX_VALUE;
@ -89,7 +89,7 @@ public @interface Config
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD) @Target(ElementType.FIELD)
public @interface RangeDouble @interface RangeDouble
{ {
double min() default Double.MIN_VALUE; double min() default Double.MIN_VALUE;
double max() default Double.MAX_VALUE; double max() default Double.MAX_VALUE;
@ -97,18 +97,18 @@ public @interface Config
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD) @Target(ElementType.FIELD)
public @interface Name @interface Name
{ {
String value(); String value();
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.TYPE}) @Target({ElementType.FIELD, ElementType.TYPE})
public @interface RequiresMcRestart @interface RequiresMcRestart
{} {}
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.TYPE}) @Target({ElementType.FIELD, ElementType.TYPE})
public @interface RequiresWorldRestart @interface RequiresWorldRestart
{} {}
} }

View file

@ -9,27 +9,27 @@ public interface IFieldWrapper
/** /**
* @return The type adapter to serialize the values returned by getValue. Null if non-primitive. * @return The type adapter to serialize the values returned by getValue. Null if non-primitive.
*/ */
public ITypeAdapter getTypeAdapter(); ITypeAdapter getTypeAdapter();
/** /**
* @param field the field about which to retrieve information * @param field the field about which to retrieve information
* @param instance The instance whose field shall be queried. * @param instance The instance whose field shall be queried.
* @return a list of keys handled by this field * @return a list of keys handled by this field
*/ */
public String[] getKeys(); String[] getKeys();
public Object getValue(String key); Object getValue(String key);
public void setValue(String key, Object value); void setValue(String key, Object value);
public boolean hasKey(String name); boolean hasKey(String name);
public boolean handlesKey(String name); boolean handlesKey(String name);
public void setupConfiguration(Configuration cfg, String desc, String langKey, boolean reqMCRestart, boolean reqWorldRestart); void setupConfiguration(Configuration cfg, String desc, String langKey, boolean reqMCRestart, boolean reqWorldRestart);
/** /**
* @return the category name in which the entries should be saved. * @return the category name in which the entries should be saved.
*/ */
public String getCategory(); String getCategory();
} }

View file

@ -23,5 +23,5 @@ import java.util.function.BooleanSupplier;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
public interface IConditionFactory { public interface IConditionFactory {
public BooleanSupplier parse(JsonContext context, JsonObject json); BooleanSupplier parse(JsonContext context, JsonObject json);
} }

View file

@ -27,5 +27,5 @@ import net.minecraft.item.crafting.Ingredient;
public interface IIngredientFactory public interface IIngredientFactory
{ {
@Nonnull //If you would return null throw JsonSyntaxException to explain why @Nonnull //If you would return null throw JsonSyntaxException to explain why
public Ingredient parse(JsonContext context, JsonObject json); Ingredient parse(JsonContext context, JsonObject json);
} }

View file

@ -23,5 +23,5 @@ import com.google.gson.JsonObject;
import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.IRecipe;
public interface IRecipeFactory { public interface IRecipeFactory {
public IRecipe parse(JsonContext context, JsonObject json); IRecipe parse(JsonContext context, JsonObject json);
} }

View file

@ -27,6 +27,6 @@ import net.minecraft.item.crafting.IRecipe;
*/ */
public interface IShapedRecipe extends IRecipe public interface IShapedRecipe extends IRecipe
{ {
public int getRecipeWidth(); int getRecipeWidth();
public int getRecipeHeight(); int getRecipeHeight();
} }

View file

@ -29,9 +29,9 @@ import net.minecraft.util.EnumFacing;
*/ */
public interface ITransformation public interface ITransformation
{ {
public Matrix4f getMatrix(); Matrix4f getMatrix();
public EnumFacing rotate(EnumFacing facing); EnumFacing rotate(EnumFacing facing);
public int rotate(EnumFacing facing, int vertexIndex); int rotate(EnumFacing facing, int vertexIndex);
} }

View file

@ -19,25 +19,22 @@
package net.minecraftforge.common.property; package net.minecraftforge.common.property;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import java.util.Optional; import java.util.Optional;
import com.google.common.base.Predicates; import com.google.common.base.Predicates;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableTable; import com.google.common.collect.ImmutableTable;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import net.minecraft.block.Block;
import javax.annotation.Nonnull; import net.minecraft.block.properties.IProperty;
import javax.annotation.Nullable; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
public class ExtendedBlockState extends BlockStateContainer public class ExtendedBlockState extends BlockStateContainer
{ {
@ -98,7 +95,7 @@ public class ExtendedBlockState extends BlockStateContainer
return this; return this;
} }
if (Iterables.all(unlistedProperties.values(), Predicates.<Optional<?>>equalTo(Optional.empty()))) if (unlistedProperties.values().stream().noneMatch(Optional::isPresent))
{ // no dynamic properties present, looking up in the normal table { // no dynamic properties present, looking up in the normal table
return clean; return clean;
} }

View file

@ -46,6 +46,7 @@ import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.EnumSkyBlock; import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.gen.structure.StructureStrongholdPieces.Stronghold.Door; import net.minecraft.world.gen.structure.StructureStrongholdPieces.Stronghold.Door;
import net.minecraftforge.classloading.FMLForgePlugin; import net.minecraftforge.classloading.FMLForgePlugin;
import org.apache.commons.lang3.ArrayUtils;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -376,10 +377,8 @@ public class EnumHelper
try try
{ {
T[] previousValues = (T[])valuesField.get(enumType); T[] previousValues = (T[])valuesField.get(enumType);
List<T> values = new ArrayList<T>(Arrays.asList(previousValues)); T newValue = makeEnum(enumType, enumName, previousValues.length, paramTypes, paramValues);
T newValue = makeEnum(enumType, enumName, values.size(), paramTypes, paramValues); setFailsafeFieldValue(valuesField, null, ArrayUtils.add(previousValues, newValue));
values.add(newValue);
setFailsafeFieldValue(valuesField, null, values.toArray((T[]) Array.newInstance(enumType, 0)));
cleanEnumCache(enumType); cleanEnumCache(enumType);
return newValue; return newValue;

View file

@ -22,5 +22,5 @@ import net.minecraft.util.datafix.IDataFixer;
public interface IDataFixerData extends IDataFixer public interface IDataFixerData extends IDataFixer
{ {
public int getVersion(String mod); int getVersion(String mod);
} }

View file

@ -675,7 +675,7 @@ public class FMLClientHandler implements IFMLSidedHandler
} }
catch (NoSuchMethodException e) 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) catch (Exception e)
{ {

View file

@ -34,13 +34,13 @@ public interface IModGuiFactory {
* *
* @param minecraftInstance the instance * @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 * 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 * @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 * 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 * @return A class that will be instantiated on clicks on the config button
* or null if no GUI is desired. * 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 * 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 * @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. * Represents an option category and entry in the runtime gui options list.

View file

@ -1692,45 +1692,45 @@ public class GuiConfigEntries extends GuiListExtended
* Gets the IConfigElement object owned by this entry. * Gets the IConfigElement object owned by this entry.
* @return * @return
*/ */
public IConfigElement getConfigElement(); IConfigElement getConfigElement();
/** /**
* Gets the name of the ConfigElement owned by this entry. * Gets the name of the ConfigElement owned by this entry.
*/ */
public String getName(); String getName();
/** /**
* Gets the current value of this entry. * Gets the current value of this entry.
*/ */
public Object getCurrentValue(); Object getCurrentValue();
/** /**
* Gets the current values of this list entry. * Gets the current values of this list entry.
*/ */
public Object[] getCurrentValues(); Object[] getCurrentValues();
/** /**
* Is this list entry enabled? * Is this list entry enabled?
* *
* @return true if this entry's controls should be enabled, false otherwise. * @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 * 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. * 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. * 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. * 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 * 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. * @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. * Sets this entry's value to the default value.
*/ */
public void setToDefault(); void setToDefault();
/** /**
* Handles reverting any changes that have occurred to this entry. * Handles reverting any changes that have occurred to this entry.
*/ */
public void undoChanges(); void undoChanges();
/** /**
* Has the value of this entry changed? * Has the value of this entry changed?
* *
* @return true if changes have been made to this entry's value, false otherwise. * @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 * 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. * 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 * 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. * 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. * 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. * 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. * 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();
} }
} }

View file

@ -691,16 +691,16 @@ public class GuiEditArrayEntries extends GuiListExtended
public static interface IArrayEntry extends GuiListExtended.IGuiListEntry 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();
} }
} }

View file

@ -200,6 +200,6 @@ public class GuiSelectStringEntries extends GuiListExtended
public static interface IGuiSelectStringListEntry extends GuiListExtended.IGuiListEntry public static interface IGuiSelectStringListEntry extends GuiListExtended.IGuiListEntry
{ {
public Object getValue(); Object getValue();
} }
} }

View file

@ -35,7 +35,7 @@ public interface IConfigElement
/** /**
* [Property, Category] Is this object a property object? * [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 * 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.DoubleEntry
* @see GuiConfigEntries.IntegerEntry * @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 * 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.DoubleEntry
* @see GuiEditArrayEntries.IntegerEntry * @see GuiEditArrayEntries.IntegerEntry
*/ */
public Class<? extends IArrayEntry> getArrayEntryClass(); Class<? extends IArrayEntry> getArrayEntryClass();
/** /**
* [Property, Category] Gets the name of this object. * [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. * [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 * [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. * 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 * [Property, Category] Gets the comment for this object. Used for the tooltip if getLanguageKey() + ".tooltip" is not defined in the
* .lang file. * .lang file.
*/ */
public String getComment(); String getComment();
/** /**
* [Category] Gets this category's child categories/properties. * [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 * [Property, Category] Gets the ConfigGuiType value corresponding to the type of this property object, or CONFIG_CATEGORY if this is a
* category object. * category object.
*/ */
public ConfigGuiType getType(); ConfigGuiType getType();
/** /**
* [Property] Is this property object a list? * [Property] Is this property object a list?
*/ */
public boolean isList(); boolean isList();
/** /**
* [Property] Does this list property have to remain a fixed length? * [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. * [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? * [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 * [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() * representation of that array using Arrays.toString()
*/ */
public Object getDefault(); Object getDefault();
/** /**
* [Property] Gets this property's default values. * [Property] Gets this property's default values.
*/ */
public Object[] getDefaults(); Object[] getDefaults();
/** /**
* [Property] Sets this property's value to the default value. * [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 * [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. * 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. * [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. * [Property, Category] Whether or not this element requires Minecraft to be restarted when changed.
*/ */
public boolean requiresMcRestart(); boolean requiresMcRestart();
/** /**
* [Property] Gets this property value. * [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. * [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. * [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. * [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 * [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. * select a value from a list of valid values.
*/ */
public String[] getValidValues(); String[] getValidValues();
/** /**
* [Property] Gets this property's minimum value. * [Property] Gets this property's minimum value.
*/ */
public Object getMinValue(); Object getMinValue();
/** /**
* [Property] Gets this property's maximum value. * [Property] Gets this property's maximum value.
*/ */
public Object getMaxValue(); Object getMaxValue();
/** /**
* [Property] Gets a Pattern object used in String property input validation. * [Property] Gets a Pattern object used in String property input validation.
*/ */
public Pattern getValidationPattern(); Pattern getValidationPattern();
} }

View file

@ -25,5 +25,5 @@ import net.minecraft.entity.Entity;
public interface IRenderFactory<T extends Entity> public interface IRenderFactory<T extends Entity>
{ {
public Render<? super T> createRenderFor(RenderManager manager); Render<? super T> createRenderFor(RenderManager manager);
} }

View file

@ -28,10 +28,10 @@ import net.minecraftforge.fml.relauncher.Side;
import org.apache.logging.log4j.Level; import org.apache.logging.log4j.Level;
public interface ILanguageAdapter { public interface ILanguageAdapter {
public Object getNewInstance(FMLModContainer container, Class<?> objectClass, ClassLoader classLoader, Method factoryMarkedAnnotation) throws Exception; Object getNewInstance(FMLModContainer container, Class<?> objectClass, ClassLoader classLoader, Method factoryMarkedAnnotation) throws Exception;
public boolean supportsStatics(); boolean supportsStatics();
public void setProxy(Field target, Class<?> proxyTarget, Object proxy) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException; void setProxy(Field target, Class<?> proxyTarget, Object proxy) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException;
public void setInternalProxies(ModContainer mod, Side side, ClassLoader loader); void setInternalProxies(ModContainer mod, Side side, ClassLoader loader);
public static class ScalaAdapter implements ILanguageAdapter { public static class ScalaAdapter implements ILanguageAdapter {
@Override @Override

View file

@ -45,5 +45,5 @@ public interface IWorldGenerator
* @param chunkProvider : additionalData[2] {@link IChunkProvider} that is requesting the world generation. * @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);
} }

View file

@ -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} * at pre-defined times during the loading of the game, based on where you have applied the {@link EventHandler}
* annotation. * 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. * version 1.0, and depends on FML being loaded.
* <pre>{@code * <pre>{@code
* package mymod; * package mymod;
* // Declare that this is a mod with modId "MyModId", name "My example mod", version "1.0" and dependency on 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") * {@literal @}Mod(modId="mymodid",name="My example mod",version="1.0",dependencies="required-after:FML")
* public class MyMod { * public class MyMod {
* // Populate this field with the instance of the mod created by FML * // Populate this field with the instance of the mod created by FML
* {@literal @}Instance("MyModId") * {@literal @}Instance("mymodid")
* public MyMod instance; * public MyMod instance;
* *
* // Mark this method for receiving an {@link FMLEvent} (in this case, it's the {@link FMLPreInitializationEvent}) * // 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, * The version string here should be just numbers separated by dots,
* to make specifying {@link #dependencies()} simple for other mods. * 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 ""; String version() default "";
@ -253,7 +255,7 @@ public @interface Mod
*/ */
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target({}) @Target({})
public @interface CustomProperty @interface CustomProperty
{ {
/** /**
* A key. Should be unique. * A key. Should be unique.
@ -307,7 +309,7 @@ public @interface Mod
*/ */
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD) @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 * 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) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD) @Target(ElementType.FIELD)
public @interface Instance { @interface Instance {
/** /**
* The mod object to inject into this field * The mod object to inject into this field
*/ */
@ -336,7 +338,7 @@ public @interface Mod
*/ */
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD) @Target(ElementType.FIELD)
public @interface Metadata { @interface Metadata {
/** /**
* The mod id specifying the metadata to load here * The mod id specifying the metadata to load here
*/ */
@ -356,7 +358,7 @@ public @interface Mod
*/ */
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD) @Target(ElementType.METHOD)
public @interface InstanceFactory { @interface InstanceFactory {
} }
/** /**
@ -364,7 +366,7 @@ public @interface Mod
*/ */
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
public @interface EventBusSubscriber { @interface EventBusSubscriber {
Side[] value() default { Side.CLIENT, Side.SERVER }; Side[] value() default { Side.CLIENT, Side.SERVER };
/** /**

View file

@ -50,7 +50,7 @@ public final class Optional {
* Mark a list of interfaces for optional removal. * Mark a list of interfaces for optional removal.
* @return * @return
*/ */
public Interface[] value(); Interface[] value();
} }
/** /**
* Used to remove optional interfaces * Used to remove optional interfaces
@ -65,20 +65,20 @@ public final class Optional {
* The fully qualified name of the interface to be stripped * The fully qualified name of the interface to be stripped
* @return the interface name * @return the interface name
*/ */
public String iface(); String iface();
/** /**
* The modid that is required to be present for stripping NOT to occur * The modid that is required to be present for stripping NOT to occur
* @return the modid * @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.) * Strip references to this interface in method declarations? (Useful to kill synthetic methods from scala f.e.)
* *
* @return if references should be stripped * @return if references should be stripped
*/ */
public boolean striprefs() default false; boolean striprefs() default false;
} }
/** /**
* Used to remove optional methods * 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 * The modid that is required to be present for stripping NOT to occur
* @return the modid * @return the modid
*/ */
public String modid(); String modid();
} }
} }

View file

@ -27,6 +27,6 @@ import net.minecraft.world.storage.*;
public interface WorldAccessContainer public interface WorldAccessContainer
{ {
public NBTTagCompound getDataForWriting(SaveHandler handler, WorldInfo info); NBTTagCompound getDataForWriting(SaveHandler handler, WorldInfo info);
public void readData(SaveHandler handler, WorldInfo info, Map<String,NBTBase> propertyMap, NBTTagCompound tag); void readData(SaveHandler handler, WorldInfo info, Map<String, NBTBase> propertyMap, NBTTagCompound tag);
} }

View file

@ -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 // 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 static Pattern classFile = Pattern.compile("[^\\s\\$]+(\\$[^\\s]+)?\\.class$");
public List<ModContainer> discover(ModCandidate candidate, ASMDataTable table); List<ModContainer> discover(ModCandidate candidate, ASMDataTable table);
} }

View file

@ -45,7 +45,6 @@ import javax.annotation.Nullable;
* Load any configuration data you might have {@link #getSuggestedConfigurationFile()} * Load any configuration data you might have {@link #getSuggestedConfigurationFile()}
* Search for a version.properties file and load it {@link #getVersionProperties()} * Search for a version.properties file and load it {@link #getVersionProperties()}
* Configure your {@link ModMetadata} programmatically {@link #getModMetadata()} * 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()} * 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 * @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! * 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 * @return A logger
*/ */

View file

@ -23,5 +23,5 @@ package net.minecraftforge.fml.common.eventhandler;
public interface IEventListener public interface IEventListener
{ {
public void invoke(Event event); void invoke(Event event);
} }

View file

@ -29,6 +29,6 @@ import static java.lang.annotation.ElementType.*;
@Target(value = METHOD) @Target(value = METHOD)
public @interface SubscribeEvent public @interface SubscribeEvent
{ {
public EventPriority priority() default EventPriority.NORMAL; EventPriority priority() default EventPriority.NORMAL;
public boolean receiveCanceled() default false; boolean receiveCanceled() default false;
} }

View file

@ -33,11 +33,11 @@ public interface IMessage {
* *
* @param buf * @param buf
*/ */
public void fromBytes(ByteBuf buf); void fromBytes(ByteBuf buf);
/** /**
* Deconstruct your message into the supplied byte buffer * Deconstruct your message into the supplied byte buffer
* @param buf * @param buf
*/ */
public void toBytes(ByteBuf buf); void toBytes(ByteBuf buf);
} }

View file

@ -39,5 +39,5 @@ public interface IMessageHandler<REQ extends IMessage, REPLY extends IMessage> {
* @param message The message * @param message The message
* @return an optional return message * @return an optional return message
*/ */
public REPLY onMessage(REQ message, MessageContext ctx); REPLY onMessage(REQ message, MessageContext ctx);
} }

View file

@ -298,21 +298,21 @@ public class GameRegistry
* *
* @return The registry name * @return The registry name
*/ */
public String value(); String value();
/** /**
* The metadata or damage value for the itemstack, defaults to 0. * The metadata or damage value for the itemstack, defaults to 0.
* *
* @return the metadata value * @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. * The string serialized nbt value for the itemstack. Defaults to empty for no nbt.
* *
* @return a nbt string * @return a nbt string
*/ */
public String nbt() default ""; String nbt() default "";
} }
/** /**

View file

@ -33,7 +33,7 @@ public interface IEntityAdditionalSpawnData
* *
* @param buffer The packet data stream * @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. * Called by the client when it receives a Entity spawn packet.
@ -41,5 +41,5 @@ public interface IEntityAdditionalSpawnData
* *
* @param additionalData The packet data stream * @param additionalData The packet data stream
*/ */
public void readSpawnData(ByteBuf additionalData); void readSpawnData(ByteBuf additionalData);
} }

View file

@ -31,11 +31,11 @@ public interface IThrowableEntity
* Gets the entity that threw/created this entity. * Gets the entity that threw/created this entity.
* @return The owner instance, Null if none. * @return The owner instance, Null if none.
*/ */
public Entity getThrower(); Entity getThrower();
/** /**
* Sets the entity that threw/created this entity. * Sets the entity that threw/created this entity.
* @param entity The new thrower/creator. * @param entity The new thrower/creator.
*/ */
public void setThrower(Entity entity); void setThrower(Entity entity);
} }

View file

@ -640,7 +640,7 @@ public class CoreModManager {
} }
else if (deobfuscatedEnvironment && location == null) // This is probably a mod dev workspace 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 else // This is a probably a normal minecraft workspace - log at warn
{ {

View file

@ -93,9 +93,9 @@ public interface IFMLLoadingPlugin
*/ */
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @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) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @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) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
public @interface Name @interface Name
{ {
public String value() default ""; String value() default "";
} }
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @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) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
public @interface SortingIndex @interface SortingIndex
{ {
public int value() default 0; int value() default 0;
} }
} }

View file

@ -44,5 +44,5 @@ import net.minecraftforge.fml.common.SidedProxy;
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR}) @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR})
public @interface SideOnly public @interface SideOnly
{ {
public Side value(); Side value();
} }

View file

@ -35,7 +35,7 @@ import javax.annotation.Nullable;
*/ */
public interface IForgeRegistry<V extends IForgeRegistryEntry<V>> extends Iterable<V> public interface IForgeRegistry<V extends IForgeRegistryEntry<V>> extends Iterable<V>
{ {
public Class<V> getRegistrySuperType(); Class<V> getRegistrySuperType();
void register(V value); void register(V value);

View file

@ -504,7 +504,7 @@ public class ModelAnimationDebug
public void handleEvents(float time, Iterable<Event> pastEvents) public void handleEvents(float time, Iterable<Event> pastEvents)
{ {
// TODO Auto-generated method stub
} }
@Override @Override