Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

Update to 1.14.4 #20

Open
wants to merge 3 commits into
base: 1.14_fabric
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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"
}
9 changes: 5 additions & 4 deletions src/main/java/tehnut/harvest/Harvest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -43,12 +43,12 @@ public class Harvest implements ModInitializer {
}

BlockPos pos = hit.getBlockPos();
List<ItemStack> drops = Block.getDroppedStacks(state, world, pos, tileEntity, player, player.getStackInHand(Hand.MAIN));
List<ItemStack> 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;
}
}
Expand Down Expand Up @@ -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());
Expand Down
1 change: 0 additions & 1 deletion src/main/java/tehnut/harvest/IReplantHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
34 changes: 21 additions & 13 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -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": "*"
}
}