diff --git a/build.gradle b/build.gradle index fbc62dd..eae4aa9 100644 --- a/build.gradle +++ b/build.gradle @@ -1,21 +1,27 @@ plugins { - id 'fabric-loom' version '0.2.0-SNAPSHOT' + id 'fabric-loom' version '0.2.5-SNAPSHOT' } sourceCompatibility = 1.8 targetCompatibility = 1.8 archivesBaseName = "Harvest" -version = "1.14-fabric-1.0.4" +version = "1.14.4-fabric-1.0.5" minecraft { } +repositories { + maven { url = "https://maven.fabricmc.net/" } +} + dependencies { - minecraft "com.mojang:minecraft:19w08b" - mappings "net.fabricmc:yarn:19w08b.9" - modCompile "net.fabricmc:fabric-loader:0.3.7.109" + minecraft "com.mojang:minecraft:1.14.4" + mappings "net.fabricmc:yarn:1.14.4+build.14" + modCompile "net.fabricmc:fabric-loader:0.6.3+build.168" //Fabric api - modCompile "net.fabricmc:fabric:0.2.3.107" + modCompile "net.fabricmc.fabric-api:fabric-api:0.4.1+build.245-1.14" + + modCompile "io.github.prospector:modmenu:1.7.9+build.118" } diff --git a/src/main/java/tehnut/harvest/Harvest.java b/src/main/java/tehnut/harvest/Harvest.java index 64c7bde..8f630bf 100644 --- a/src/main/java/tehnut/harvest/Harvest.java +++ b/src/main/java/tehnut/harvest/Harvest.java @@ -12,11 +12,11 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.server.world.ServerWorld; -import net.minecraft.sortme.ItemScatterer; import net.minecraft.tag.Tag; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; import net.minecraft.util.Identifier; +import net.minecraft.util.ItemScatterer; import net.minecraft.util.math.BlockPos; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -43,12 +43,12 @@ public class Harvest implements ModInitializer { } BlockPos pos = hit.getBlockPos(); - List drops = Block.getDroppedStacks(state, world, pos, tileEntity, player, player.getStackInHand(Hand.MAIN)); + List drops = Block.getDroppedStacks(state, world, pos, tileEntity, player, player.getStackInHand(Hand.MAIN_HAND)); boolean foundSeed = false; for (ItemStack drop : drops) { if (SEED_TAG.contains(drop.getItem())) { foundSeed = true; - drop.subtractAmount(1); + drop.decrement(1); break; } } @@ -80,11 +80,12 @@ public void onInitialize() { } } + UseBlockCallback.EVENT.register((player, world, hand, hit) -> { if (!(world instanceof ServerWorld)) return ActionResult.PASS; - if (hand != Hand.MAIN) + if (hand != Hand.MAIN_HAND) return ActionResult.PASS; BlockState state = world.getBlockState(hit.getBlockPos()); diff --git a/src/main/java/tehnut/harvest/IReplantHandler.java b/src/main/java/tehnut/harvest/IReplantHandler.java index 9a4b91e..17c7fbb 100644 --- a/src/main/java/tehnut/harvest/IReplantHandler.java +++ b/src/main/java/tehnut/harvest/IReplantHandler.java @@ -6,7 +6,6 @@ import net.minecraft.server.world.ServerWorld; import net.minecraft.util.ActionResult; import net.minecraft.util.hit.BlockHitResult; -import net.minecraft.util.math.BlockPos; public interface IReplantHandler { ActionResult handlePlant(ServerWorld world, BlockHitResult hit, BlockState state, PlayerEntity player, BlockEntity tileEntity); diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 185a4d2..6ba2028 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,25 +1,33 @@ { + "schemaVersion": 1, "id": "harvest", - "version": "1.0.4", + "version": "1.0.5", "name": "Harvest", - "description": "Configurable right click crop harvesting ", - "links": { - "homepage": "https://minecraft.curseforge.com/projects/simpleharvest", - "issues": "https://github.com/TehNut/Harvest/issues", - "sources": "https://github.com/TehNut/Harvest" - }, + "description": "Configurable right click crop harvesting", "authors": [ "TehNut" ], "contributors": [ "InsomniaKitten" ], - "requires": { - "fabric": "*" + "contact": { + "homepage": "https://minecraft.curseforge.com/projects/simpleharvest", + "issues": "https://github.com/TehNut/Harvest/issues", + "sources": "https://github.com/TehNut/Harvest" }, + "license": "MIT", - "side": "universal", - "initializers": [ - "tehnut.harvest.Harvest" - ] + "icon": "assets/harvest/icon.png", + + "environment": "*", + "entrypoints": { + "main": [ + "tehnut.harvest.Harvest" + ] + }, + + "requires": { + "fabricloader": ">=0.4.0", + "fabric": "*" + } } \ No newline at end of file