From 85a44207cc9d8256cd76a05dacbe65481474bb3a Mon Sep 17 00:00:00 2001 From: Draylar Date: Tue, 29 Oct 2019 21:33:54 -0500 Subject: [PATCH 1/3] Update to 1.14.4; fix mappings and package changes --- build.gradle | 12 ++++++------ src/main/java/tehnut/harvest/Harvest.java | 9 +++++---- src/main/java/tehnut/harvest/IReplantHandler.java | 1 - 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index fbc62dd..f3655fe 100644 --- a/build.gradle +++ b/build.gradle @@ -1,21 +1,21 @@ 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 { } 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" } 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); From 533490fd45814c70e240f6420d9ef3a7104eb265 Mon Sep 17 00:00:00 2001 From: Draylar Date: Tue, 29 Oct 2019 21:36:12 -0500 Subject: [PATCH 2/3] add ModMenu in dev for testing --- build.gradle | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.gradle b/build.gradle index f3655fe..eae4aa9 100644 --- a/build.gradle +++ b/build.gradle @@ -11,6 +11,10 @@ version = "1.14.4-fabric-1.0.5" minecraft { } +repositories { + maven { url = "https://maven.fabricmc.net/" } +} + dependencies { minecraft "com.mojang:minecraft:1.14.4" mappings "net.fabricmc:yarn:1.14.4+build.14" @@ -18,4 +22,6 @@ dependencies { //Fabric api modCompile "net.fabricmc.fabric-api:fabric-api:0.4.1+build.245-1.14" + + modCompile "io.github.prospector:modmenu:1.7.9+build.118" } From a5f8e4833a17b89003b475da74737a93dc629878 Mon Sep 17 00:00:00 2001 From: Draylar Date: Tue, 29 Oct 2019 21:39:00 -0500 Subject: [PATCH 3/3] update mod.json to new format --- src/main/resources/fabric.mod.json | 34 ++++++++++++++++++------------ 1 file changed, 21 insertions(+), 13 deletions(-) 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