diff --git a/build.gradle.kts b/build.gradle.kts index 85985e59d..4949cf01c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,6 +8,12 @@ subprojects { apply("plugin" to "xyz.wagyourtail.unimined") apply("plugin" to "com.diffplug.spotless") + group = "net.minecraftforge" + base.archivesName = "forge" + version = "${rootProject.properties["version"]}+${project.name}" + + unimined.useGlobalCache = false + java { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 @@ -27,6 +33,11 @@ subprojects { targetCompatibility = "8" } + tasks.withType(Javadoc::class.java).configureEach { + isFailOnError = false + exclude("net/minecraftforge/mixin/**.java") + } + tasks.withType(ProcessResources::class.java).configureEach { inputs.property ("version", project.version) @@ -34,6 +45,4 @@ subprojects { expand ("version" to project.version) } } - - unimined.useGlobalCache = false } diff --git a/gradle.properties b/gradle.properties index 26c9efd65..f15d96f2b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,5 @@ # Authentication does not work by default by we can still test skins unimined.auth.enabled=false unimined.auth.username=Halotroop2288 + +version=1.0.0 diff --git a/minecraft/beta/1.7.3/gradle.properties b/minecraft/beta/1.7.3/gradle.properties new file mode 100644 index 000000000..bf7dad4dd --- /dev/null +++ b/minecraft/beta/1.7.3/gradle.properties @@ -0,0 +1 @@ +minecraft_version = b1.7.3 diff --git a/minecraft/beta/1.7.3/src/client/java/net/minecraft/src/forge/MinecraftForgeClient.java b/minecraft/beta/1.7.3/src/client/java/net/minecraft/src/forge/MinecraftForgeClient.java index 9186ece05..95715b65d 100644 --- a/minecraft/beta/1.7.3/src/client/java/net/minecraft/src/forge/MinecraftForgeClient.java +++ b/minecraft/beta/1.7.3/src/client/java/net/minecraft/src/forge/MinecraftForgeClient.java @@ -32,7 +32,7 @@ public static void beforeBlockRender(Block block, RenderBlocks renderer) { tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1F, 0.0F); GL11.glBindTexture(GL_TEXTURE_2D, Minecraft.theMinecraft.renderEngine - .getTexture(((ITextureProvider) (block)).getTextureFile())); + .getTexture(((ITextureProvider) (block)).getTextureFile())); } } diff --git a/minecraft/beta/1.7.3/src/client/java/net/minecraftforge/injection/ForgeEffectRenderer.java b/minecraft/beta/1.7.3/src/client/java/net/minecraftforge/injection/ForgeEffectRenderer.java index 4f596de74..7c3641244 100644 --- a/minecraft/beta/1.7.3/src/client/java/net/minecraftforge/injection/ForgeEffectRenderer.java +++ b/minecraft/beta/1.7.3/src/client/java/net/minecraftforge/injection/ForgeEffectRenderer.java @@ -7,7 +7,7 @@ import org.jetbrains.annotations.ApiStatus; /** - * Adds public methods to {@link EffectRenderer} via Fabric Interface Injectors + * Adds public methods to {@link EffectRenderer} via Fabric Interface Injectors. * * @author halotroop2288 */ diff --git a/minecraft/beta/1.7.3/src/client/java/net/minecraftforge/mixin/ItemRendererMixin.java b/minecraft/beta/1.7.3/src/client/java/net/minecraftforge/mixin/ItemRendererMixin.java index f40f3274b..67c7f5a5f 100644 --- a/minecraft/beta/1.7.3/src/client/java/net/minecraftforge/mixin/ItemRendererMixin.java +++ b/minecraft/beta/1.7.3/src/client/java/net/minecraftforge/mixin/ItemRendererMixin.java @@ -23,8 +23,8 @@ public abstract class ItemRendererMixin { * @reason implement {@link MinecraftForgeClient#overrideTexture(Object)} */ @Inject(method = "renderItem", at = @At( - value = "INVOKE", shift = At.Shift.AFTER, - target = "Lorg/lwjgl/opengl/GL11;glBindTexture(II)V")) + value = "INVOKE", shift = At.Shift.AFTER, + target = "Lorg/lwjgl/opengl/GL11;glBindTexture(II)V")) private void forge$overrideTexture(EntityLiving entity, ItemStack stack, CallbackInfo ci) { Item item = stack.getItem(); if (item instanceof ItemBlock) MinecraftForgeClient.overrideTexture(Block.blocksList[stack.itemID]); diff --git a/minecraft/beta/1.7.3/src/client/java/net/minecraftforge/mixin/MinecraftMixin.java b/minecraft/beta/1.7.3/src/client/java/net/minecraftforge/mixin/MinecraftMixin.java index d560809be..34d78a3e8 100644 --- a/minecraft/beta/1.7.3/src/client/java/net/minecraftforge/mixin/MinecraftMixin.java +++ b/minecraft/beta/1.7.3/src/client/java/net/minecraftforge/mixin/MinecraftMixin.java @@ -21,7 +21,7 @@ public abstract class MinecraftMixin { * @reason implement {@link MinecraftForgeClient#onGameStart()} */ @Inject(method = "startGame", at = @At(value = "NEW", - target = "(Ljava/io/File;Lnet/minecraft/client/Minecraft;)Lnet/minecraft/src/ThreadDownloadResources;")) + target = "(Ljava/io/File;Lnet/minecraft/client/Minecraft;)Lnet/minecraft/src/ThreadDownloadResources;")) private void forge$startGame_ThreadDownloadResources(CallbackInfo ci) { MinecraftForgeClient.onGameStart(); } diff --git a/minecraft/beta/1.7.3/src/client/java/net/minecraftforge/mixin/RenderItemMixin.java b/minecraft/beta/1.7.3/src/client/java/net/minecraftforge/mixin/RenderItemMixin.java index eb3fcd241..474e88ff4 100644 --- a/minecraft/beta/1.7.3/src/client/java/net/minecraftforge/mixin/RenderItemMixin.java +++ b/minecraft/beta/1.7.3/src/client/java/net/minecraftforge/mixin/RenderItemMixin.java @@ -23,7 +23,7 @@ public abstract class RenderItemMixin { * @reason implement {@link MinecraftForgeClient#overrideTexture(Object)} */ @Inject(method = "doRenderItem", require = 2, - at = @At(value = "CONSTANT", shift = At.Shift.AFTER, args = "stringValue=/terrain.png")) + at = @At(value = "CONSTANT", shift = At.Shift.AFTER, args = "stringValue=/terrain.png")) private void forge$overrideTerrainTexture(EntityItem itemEntity, double x, double y, double z, float a, float b, CallbackInfo ci) { MinecraftForgeClient.overrideTexture(Block.blocksList[itemEntity.item.itemID]); @@ -36,7 +36,7 @@ public abstract class RenderItemMixin { * @reason implement {@link MinecraftForgeClient#overrideTexture(Object)} */ @Inject(method = "doRenderItem", require = 1, - at = @At(value = "CONSTANT", shift = At.Shift.AFTER, args = "stringValue=/gui/items.png")) + at = @At(value = "CONSTANT", shift = At.Shift.AFTER, args = "stringValue=/gui/items.png")) private void forge$overrideItemsTexture(EntityItem itemEntity, double x, double y, double z, float a, float b, CallbackInfo ci) { MinecraftForgeClient.overrideTexture(itemEntity.item.getItem()); @@ -49,8 +49,8 @@ public abstract class RenderItemMixin { * @reason implement {@link MinecraftForgeClient#overrideTexture(Object)} */ @Inject(method = "drawItemIntoGui", require = 3, at = @At( - value = "INVOKE", shift = At.Shift.AFTER, - target = "Lnet/minecraft/src/RenderEngine;bindTexture(I)V")) + value = "INVOKE", shift = At.Shift.AFTER, + target = "Lnet/minecraft/src/RenderEngine;bindTexture(I)V")) private void forge$overrideTerrainTexture(FontRenderer font, RenderEngine engine, int itemID, int a, int b, int c, int d, CallbackInfo ci) { if (itemID < 256) MinecraftForgeClient.overrideTexture(Block.blocksList[itemID]); diff --git a/minecraft/beta/1.7.3/src/client/java/net/minecraftforge/mixin/WorldRendererMixin.java b/minecraft/beta/1.7.3/src/client/java/net/minecraftforge/mixin/WorldRendererMixin.java index cf9c2ceb6..75f602ebc 100644 --- a/minecraft/beta/1.7.3/src/client/java/net/minecraftforge/mixin/WorldRendererMixin.java +++ b/minecraft/beta/1.7.3/src/client/java/net/minecraftforge/mixin/WorldRendererMixin.java @@ -16,7 +16,7 @@ @Mixin(WorldRenderer.class) public abstract class WorldRendererMixin { @Inject(method = "updateRenderer", at = @At(value = "INVOKE", shift = At.Shift.AFTER, - target = "Lnet/minecraft/src/Block;getRenderBlockPass()I")) + target = "Lnet/minecraft/src/Block;getRenderBlockPass()I")) private void forge$updateRenderer_getRenderBlockPass_after(CallbackInfo ci, @Local(ordinal = 0) LocalBooleanRef flag, @Local(ordinal = 6) LocalIntRef j3, @@ -37,7 +37,7 @@ public abstract class WorldRendererMixin { * @reason implement {@link ITextureProvider} */ @Inject(method = "updateRenderer", at = @At(value = "INVOKE", - target = "Lnet/minecraft/src/RenderBlocks;renderBlockByRenderType(Lnet/minecraft/src/Block;III)Z")) + target = "Lnet/minecraft/src/RenderBlocks;renderBlockByRenderType(Lnet/minecraft/src/Block;III)Z")) private void forge$updateRenderer_renderBlockByRenderType(CallbackInfo ci, @Local Block block, @Local RenderBlocks renderer) { @@ -52,7 +52,7 @@ public abstract class WorldRendererMixin { * @reason prevent bugs caused by implementing {@link ITextureProvider} */ @Inject(method = "updateRenderer", at = @At(value = "INVOKE", shift = At.Shift.AFTER, - target = "Lnet/minecraft/src/RenderBlocks;renderBlockByRenderType(Lnet/minecraft/src/Block;III)Z")) + target = "Lnet/minecraft/src/RenderBlocks;renderBlockByRenderType(Lnet/minecraft/src/Block;III)Z")) private void forge$updateRenderer_renderBlockByRenderType_after(CallbackInfo ci, @Local Block block, @Local RenderBlocks renderer) { diff --git a/minecraft/beta/1.7.3/src/client/resources/fabric.mod.json b/minecraft/beta/1.7.3/src/client/resources/fabric.mod.json index 832efc7d1..289f1481d 100644 --- a/minecraft/beta/1.7.3/src/client/resources/fabric.mod.json +++ b/minecraft/beta/1.7.3/src/client/resources/fabric.mod.json @@ -19,7 +19,9 @@ ], "custom": { "loom:injected_interfaces": { - "net/minecraft/src/EffectRenderer": ["net/minecraftforge/injection/ForgeEffectRenderer"] + "net/minecraft/src/EffectRenderer": [ + "net/minecraftforge/injection/ForgeEffectRenderer" + ] } } -} \ No newline at end of file +} diff --git a/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/Configuration.java b/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/Configuration.java index d6d264f99..e486d3cb1 100644 --- a/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/Configuration.java +++ b/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/Configuration.java @@ -25,13 +25,23 @@ public class Configuration { private final @NotNull File file; + /** + * Properties with no specific category. + */ + public TreeMap generalProperties = new TreeMap<>(); + /** + * Properties in the Block category. + */ public TreeMap blockProperties = new TreeMap<>(); + /** + * Properties in the Item category. + */ public TreeMap itemProperties = new TreeMap<>(); - public TreeMap generalProperties = new TreeMap<>(); /** - * Create a configuration for the file given. + * Creates a configuration for the file given. * + * @param file the location to store the configuration * @author Space Toad * @since 1.0.0 */ @@ -40,14 +50,14 @@ public Configuration(@NotNull File file) { } /** - * Gets or create a block id property.
+ * Gets or creates a block id property.
* If the block id property key is already in the configuration, then it will be used. * Otherwise, {@code defaultID} will be used, except if already taken, * in which case this will try to determine a free default id. * - * @param key the key to get or create a property for + * @param key the key for which to get or create a property * @param defaultID the id to try to use if the property doesn't already exist - * + * @return the property associated with the given key, or null if the property couldn't be created. * @author Space Toad * @since 1.0.0 */ @@ -87,6 +97,13 @@ public Configuration(@NotNull File file) { } /** + * The same as {@link #getOrCreateProperty(String, PropertyKind, String)} + * but for {@link Integer#TYPE int} properties rather than {@link String} properties. + * + * @param key the key for which to get or create a property + * @param kind the category to look for the property in + * @param defaultValue the value to use if the property doesn't already exist + * @return the property associated with the given key, or null if the property couldn't be created. * @author Space Toad * @since 1.0.0 */ @@ -105,6 +122,13 @@ public Configuration(@NotNull File file) { } /** + * The same as {@link #getOrCreateProperty(String, PropertyKind, String)} + * but for {@link Boolean#TYPE boolean} properties rather than {@link String} properties. + * + * @param key the key for which to get or create a property + * @param kind the category to look for the property in + * @param defaultValue the value to use if the property doesn't already exist + * @return the property associated with the given key, or null if the property couldn't be created. * @author Space Toad * @since 1.0.0 */ @@ -120,6 +144,14 @@ public Configuration(@NotNull File file) { } /** + * Gets or creates a property.
+ * If the property key is already in the configuration, then it will be used. + * Otherwise, {@code defaultValue} will be used. + * + * @param key the key for which to get or create a property + * @param kind the category to look for the property in + * @param defaultValue the value to use if the property doesn't already exist + * @return the property associated with the given key, or null if the property couldn't be created. * @author Space Toad * @since 1.0.0 */ @@ -154,6 +186,8 @@ public Configuration(@NotNull File file) { } /** + * Loads the configuration file from disk. + * * @author Space Toad * @since 1.0.0 */ @@ -240,6 +274,8 @@ public void load() { } /** + * Saves the configuration file to disk. + * * @author Space Toad * @since 1.0.0 */ @@ -289,10 +325,6 @@ public void save() { } } - /** - * @author Space Toad - * @since 1.0.0 - */ private void writeProperties(BufferedWriter buffer, Collection props) throws IOException { for (Property property : props) { if (property.comment != null) { @@ -305,20 +337,50 @@ private void writeProperties(BufferedWriter buffer, Collection props) } /** + * Holds data for each configuration entry. + * * @author Space Toad * @since 1.0.0 */ public static class Property { + /** + * The name of the configuration property. + */ public String name; + /** + * The value associated with the configuration property. + */ public String value; + /** + * The comment that describes the configuration property to the user. + */ public String comment; + + /** + * Default constructor. + */ + public Property() { + } } /** + * Valid types of configuration properties. + * * @author Space Toad * @since 1.0.0 */ public enum PropertyKind { - GENERAL, BLOCK, ITEM + /** + * No specific category. + */ + GENERAL, + /** + * Property in the Block category. + */ + BLOCK, + /** + * Property in the Item category. + */ + ITEM, } } diff --git a/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/IConnectRedstone.java b/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/IConnectRedstone.java index dc0bc68cd..7269c2d36 100644 --- a/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/IConnectRedstone.java +++ b/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/IConnectRedstone.java @@ -8,7 +8,7 @@ /** * This interface is to be implemented by {@link Block} classes. - * It will override standard algorithms controlling connection between two blocks by redstone + * It will override standard algorithms controlling connection between two blocks by redstone. * * @author Eloraam * @since 1.0.0 @@ -16,6 +16,8 @@ @FunctionalInterface public interface IConnectRedstone { /** + * Checks if a redstone connection can be made in the given direction from this block. + * * @param world the world to act on * @param x the x position of this block * @param y the y position of this block diff --git a/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/IMultipassRender.java b/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/IMultipassRender.java index fb0ee7cb0..465a6a426 100644 --- a/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/IMultipassRender.java +++ b/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/IMultipassRender.java @@ -14,6 +14,8 @@ */ public interface IMultipassRender { /** + * Checks whether the block can be rendered during the given rendering pass. + * * @param pass the current render pass * @return whether the block should be rendered during this pass * @author Eloraam diff --git a/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/IOverrideReplace.java b/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/IOverrideReplace.java index bd8b57c03..0f91e6b7c 100644 --- a/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/IOverrideReplace.java +++ b/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/IOverrideReplace.java @@ -15,6 +15,8 @@ */ public interface IOverrideReplace { /** + * Checks if the given block can be replaced in the given context. + * * @param world the world to act on * @param x the x position of the block to replace * @param y the y position of the block to replace @@ -27,7 +29,9 @@ public interface IOverrideReplace { boolean canReplaceBlock(@NotNull World world, int x, int y, int z, int blockID); /** - * @return whether the block was successfully replaced + * Checks whether the block was successfully replaced. + * + * @return {@code true} if the operation was a success * @author Eloraam * @since 1.0.0 */ diff --git a/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/ISpecialArmor.java b/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/ISpecialArmor.java index c11fd3da2..857ad513d 100644 --- a/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/ISpecialArmor.java +++ b/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/ISpecialArmor.java @@ -4,6 +4,7 @@ package net.minecraft.src.forge; import net.minecraft.src.ItemArmor; +import org.jetbrains.annotations.ApiStatus; /** * This interface is to be implemented by {@link ItemArmor} classes. @@ -16,17 +17,24 @@ */ public interface ISpecialArmor { /** - * Adjusts the amount of damage received by the entity. + * Called before vanilla damage computation.
+ * Adjusts the amount of damage received by the wearer. * + * @param damage the damage value before the armor is applied + * @return the new damage value after this armor is applied * @author Space Toad * @since 1.0.0 */ + @ApiStatus.OverrideOnly int adjustArmorDamage(int damage); /** - * @return true if the vanilla armor computation should be cancelled. + * Allows you to cancel the vanilla armor calculation. + * + * @return false if the vanilla armor calculation should be cancelled. * @author Space Toad * @since 1.0.0 */ + @ApiStatus.OverrideOnly boolean allowRegularComputation(); } diff --git a/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/ISpecialResistance.java b/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/ISpecialResistance.java index e05cc7756..a89647431 100644 --- a/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/ISpecialResistance.java +++ b/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/ISpecialResistance.java @@ -14,13 +14,15 @@ */ public interface ISpecialResistance { /** - * @param world the world to act on - * @param blockX the x position of this block - * @param blockY the y position of this block - * @param blockZ the z position of this block - * @param sourceX the x position of the explosion source - * @param sourceY the y position of the explosion source - * @param sourceZ the z position of the explosion source + * Gives the block a custom resistance to explosions. + * + * @param world the world to act on + * @param blockX the x position of this block + * @param blockY the y position of this block + * @param blockZ the z position of this block + * @param sourceX the x position of the explosion source + * @param sourceY the y position of the explosion source + * @param sourceZ the z position of the explosion source * @param exploder the cause of the explosion (Example: Creeper, {@code null} if bed, fireball, or TNT) * @return the resistance value to the explosion * @author Eloraam diff --git a/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/ITextureProvider.java b/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/ITextureProvider.java index c8c316197..dab41a464 100644 --- a/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/ITextureProvider.java +++ b/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/ITextureProvider.java @@ -26,6 +26,7 @@ public interface ITextureProvider { * If the block implements {@code getRenderType}}, * it will use that terrain file to render texture instead of the default {@code /terrain.png} one. * + * @return the path to the texture atlas file as described above * @author Space Toad * @since 1.0.0 */ diff --git a/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/MinecraftForge.java b/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/MinecraftForge.java index 0f863a245..2fbf8c5df 100644 --- a/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/MinecraftForge.java +++ b/minecraft/beta/1.7.3/src/main/java/net/minecraft/src/forge/MinecraftForge.java @@ -10,6 +10,8 @@ import java.util.*; /** + * Common hooks for Minecraft mod development. + * * @author Space Toad * @since 1.0.0 */ @@ -18,9 +20,17 @@ public class MinecraftForge { private static final LinkedList biomePopulators = new LinkedList<>(); private static final LinkedList harvestHandlers = new LinkedList<>(); + private MinecraftForge() { + } + /** * This is not supposed to be called outside of Minecraft internals. * + * @param world the world to act on + * @param x the x position of the block the bucket user is aiming at + * @param y the y position of the block the bucket user is aiming at + * @param z the z position of the block the bucket user is aiming at + * @return the stack to replace the bucket * @author Space Toad * @since 1.0.0 */ @@ -33,6 +43,10 @@ public static ItemStack fillCustomBucket(World world, int x, int y, int z) { /** * This is not supposed to be called outside of Minecraft internals. * + * @param world the world to act on + * @param biome the biome at the given chunk coordinates + * @param chunkX the x position of the chunk being generated + * @param chunkZ the z position of the chunk being generated * @author Space Toad * @since 1.0.0 */ @@ -46,6 +60,7 @@ public static void populateBiome(World world, BiomeGenBase biome, int chunkX, in * * @param tool the tool used to harvest the block * @param block the block to be harvested + * @return true if the block can be harvested in the given context * @author Space Toad * @since 1.0.0 */ @@ -72,26 +87,29 @@ public static void addPickaxeBlockEffectiveAgainst(Block block) { /** * Registers a new custom bucket handler. * + * @param handler the handler to register * @author Space Toad * @since 1.0.0 */ - public static void registerCustomBucketHandler(IBucketHandler bucketHandler) { - bucketHandlers.add(bucketHandler); + public static void registerCustomBucketHandler(IBucketHandler handler) { + bucketHandlers.add(handler); } /** * Registers a new biome contributor. * + * @param populator the populator to register * @author Space Toad * @since 1.0.0 */ - public static void registerBiomePopulate(IBiomePopulator biomePopulator) { - biomePopulators.add(biomePopulator); + public static void registerBiomePopulate(IBiomePopulator populator) { + biomePopulators.add(populator); } /** * Registers a new harvest handler. * + * @param handler the handler to register * @author Space Toad * @since 1.0.0 */ diff --git a/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/injection/ForgeItemTool.java b/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/injection/ForgeItemTool.java index 9832cc800..e14b69c9f 100644 --- a/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/injection/ForgeItemTool.java +++ b/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/injection/ForgeItemTool.java @@ -3,9 +3,14 @@ */ package net.minecraftforge.injection; -import net.minecraft.src.Block; -import org.jetbrains.annotations.ApiStatus; +import net.minecraft.src.*; +import org.jetbrains.annotations.*; +/** + * Adds public methods to {@link ItemTool} via Fabric Interface Injectors. + * + * @author halotroop2288 + */ @ApiStatus.Internal public interface ForgeItemTool { /** @@ -15,7 +20,7 @@ public interface ForgeItemTool { * @author Space Toad * @author halotroop2288 */ - default void addBlockEffectiveAgainst(Block block) { + default void addBlockEffectiveAgainst(@NotNull Block block) { throw new RuntimeException("Not implemented."); } } diff --git a/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ChunkMixin.java b/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ChunkMixin.java index 16e291deb..9bc2a1f48 100644 --- a/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ChunkMixin.java +++ b/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ChunkMixin.java @@ -17,10 +17,6 @@ public abstract class ChunkMixin { @Shadow public World worldObj; /** - * @param x the x position to modify - * @param y the y position to modify - * @param z the z position to modify - * @param id the block id to set * @author halotroop2288 * @reason implement {@link IOverrideReplace} */ @@ -37,11 +33,6 @@ public abstract class ChunkMixin { } /** - * @param x the x position to modify - * @param y the y position to modify - * @param z the z position to modify - * @param id the block id to set - * @param meta the metadata value to set * @author halotroop2288 * @reason implement {@link IOverrideReplace} */ diff --git a/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ChunkProviderGenerateMixin.java b/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ChunkProviderGenerateMixin.java index efdd89259..8be897c0f 100644 --- a/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ChunkProviderGenerateMixin.java +++ b/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ChunkProviderGenerateMixin.java @@ -5,7 +5,7 @@ import com.llamalad7.mixinextras.sugar.Local; import net.minecraft.src.*; -import net.minecraft.src.forge.MinecraftForge; +import net.minecraft.src.forge.*; import org.spongepowered.asm.mixin.*; import org.spongepowered.asm.mixin.injection.*; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @@ -17,8 +17,12 @@ public abstract class ChunkProviderGenerateMixin { @Shadow private World worldObj; + /** + * @author halotroop2288 + * @reason implement {@link IBiomePopulator} + */ @Inject(method = "populate", at = @At(value = "INVOKE", ordinal = 1, - target = "Lnet/minecraft/src/World;getWorldChunkManager()Lnet/minecraft/src/WorldChunkManager;")) + target = "Lnet/minecraft/src/World;getWorldChunkManager()Lnet/minecraft/src/WorldChunkManager;")) private void forge$populateBiome_getWorldChunkManager(IChunkProvider provider, int chunkX, int chunkZ, CallbackInfo ci, @Local(ordinal = 0) BiomeGenBase biome) { MinecraftForge.populateBiome(this.worldObj, biome, chunkX, chunkZ); diff --git a/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ExplosionMixin.java b/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ExplosionMixin.java index e2de0d344..cab5fea9a 100644 --- a/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ExplosionMixin.java +++ b/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ExplosionMixin.java @@ -27,12 +27,6 @@ public abstract class ExplosionMixin { @Shadow public Entity exploder; /** - * @param block the block located at the given position - * @param entity the exploding entity - * @param operation the original operation - * @param x the block x position of the explosion - * @param y the block y position of the explosion - * @param z the block z position of the explosion * @author halotroop2288 * @reason implement {@link ISpecialResistance} */ diff --git a/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ItemBucketMixin.java b/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ItemBucketMixin.java index 691fc6062..8b7053f63 100644 --- a/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ItemBucketMixin.java +++ b/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ItemBucketMixin.java @@ -16,12 +16,6 @@ @Mixin(ItemBucket.class) public abstract class ItemBucketMixin { /** - * @param stack the stack containing an empty bucket - * @param world the world - * @param player the interacting player - * @param x block x position - * @param y block y position - * @param z block z position * @author halotroop2288 * @reason Implements {@link IBucketHandler} */ diff --git a/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ItemMixin.java b/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ItemMixin.java index c2a5441eb..a5f6ada19 100644 --- a/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ItemMixin.java +++ b/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ItemMixin.java @@ -9,12 +9,20 @@ import org.spongepowered.asm.mixin.injection.*; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +/** + * @author halotroop2288 + */ @Mixin(Item.class) public abstract class ItemMixin { + /** + * @author halotroop2288 + * @reason implement {@link IUseItemFirst} + */ @Inject(method = "onItemUse", cancellable = true, at = @At("HEAD")) private void forge$onItemUse_head(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, CallbackInfoReturnable cir) { - if (this instanceof IUseItemFirst && ((IUseItemFirst)this).onItemUseFirst(stack, player, world, x, y, z, side)) { + if (this instanceof IUseItemFirst && ((IUseItemFirst) this) + .onItemUseFirst(stack, player, world, x, y, z, side)) { cir.setReturnValue(true); } } diff --git a/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ItemPickaxeMixin.java b/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ItemPickaxeMixin.java index f32e224de..1b9675bb2 100644 --- a/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ItemPickaxeMixin.java +++ b/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ItemPickaxeMixin.java @@ -15,12 +15,11 @@ @Mixin(ItemPickaxe.class) public abstract class ItemPickaxeMixin { /** - * @param block the block to harvest * @author halotroop2288 * @reason Implements {@link IHarvestHandler} */ @Inject(method = "canHarvestBlock", cancellable = true, at = @At(value = "FIELD", ordinal = 0, - target = "Lnet/minecraft/src/Block;blockMaterial:Lnet/minecraft/src/Material;")) + target = "Lnet/minecraft/src/Block;blockMaterial:Lnet/minecraft/src/Material;")) private void forge$canHarvestBlock_return(Block block, CallbackInfoReturnable cir) { if (MinecraftForge.canHarvestBlock(((ItemPickaxe) (Object) this), block)) { cir.setReturnValue(true); diff --git a/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ItemToolMixin.java b/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ItemToolMixin.java index d31e72f18..46db356c7 100644 --- a/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ItemToolMixin.java +++ b/minecraft/beta/1.7.3/src/main/java/net/minecraftforge/mixin/ItemToolMixin.java @@ -5,6 +5,7 @@ import net.minecraft.src.*; import net.minecraftforge.injection.ForgeItemTool; +import org.jetbrains.annotations.NotNull; import org.spongepowered.asm.mixin.*; import java.util.*; @@ -17,12 +18,11 @@ public abstract class ItemToolMixin implements ForgeItemTool { @Shadow private Block[] blocksEffectiveAgainst; /** - * @param block the block to harvest * @author Space Toad * @author halotroop2288 */ @Override - public void addBlockEffectiveAgainst(Block block) { + public void addBlockEffectiveAgainst(@NotNull Block block) { List blocks = new ArrayList<>(Arrays.asList(blocksEffectiveAgainst)); blocks.add(block); blocksEffectiveAgainst = blocks.toArray(new Block[0]); diff --git a/settings.gradle.kts b/settings.gradle.kts index 9df0d7d43..02040689d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -30,4 +30,4 @@ fun createProject(name: String, directory: String) { project.name = name } -createProject("Beta1.7.3", "minecraft/beta/1.7.3") +createProject("MCb1.7.3", "minecraft/beta/1.7.3")