Code Monkey home page Code Monkey logo

harvest's Introduction

Harvest

Adds right click crop harvesting that is configurable via a JSON file.

Default Config

{
  "crops": [
    {
      "initialBlock": {
        "blockName": "minecraft:wheat",
        "meta": 7
      }
    },
    {
      "initialBlock": {
        "blockName": "minecraft:carrots",
        "meta": 7
      }
    },
    {
      "initialBlock": {
        "blockName": "minecraft:potatoes",
        "meta": 7
      }
    },
    {
      "initialBlock": {
        "blockName": "minecraft:beetroots",
        "meta": 3
      }
    },
    {
      "initialBlock": {
        "blockName": "minecraft:nether_wart",
        "meta": 3
      }
    }
  ],
  "exhaustionPerHarvest": 0.005,
  "additionalLogging": false,
  "checkForCrops": false
}

harvest's People

Contributors

tehnut avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

harvest's Issues

1.13.2 Forge Version Rightclick Bug

Hello!

When you open up the crafting table/furnace/chest or something else and you have a block or something in your hands, it places the block in front of the crafting table/furnace/chest...

Hope this information can help you!

Some of Rustic's Herbs do not want to harvest on right click

MC 1.12.1
Forge 14.22.0.2.2467
SimpleHarvest 1.12-1.2.4-16
Rustic 0.4.1
harvest_config.json

4 of Rustic's herbs work correctly (Cloudsbluff, Core Root, Marsh Mallow, and Ginseng). The other 8 (Horsetail, Deathstalk Mushroom, Cohosh, Chamomile, Blood Orchid, Aloe Vera, Mooncap Mushroom, and Wind Thistle) do not work. Every other crop I've added has worked correctly. I'm not sure what's wrong here. Breaking the herbs work normally, and as far as I can see, they're all implemented the same, so I'm at a loss.

Configuration issue

So I tried to add some modded crop (from the Sandwichable mod) in the config file but, when the config is loaded the added crop turns into air block?
This happen when I try to right click on one of the crop:

[01:00:17] [Server thread/INFO]: [DEBUG] No crop found for state Block{sandwichable:onions}[age=3]
[01:00:17] [Server thread/INFO]: [DEBUG] Valid crops Crop{Block{minecraft:wheat}[age=7]} | Crop{Block{minecraft:nether_wart}[age=3]} | Crop{Block{minecraft:carrots}[age=7]} | Crop{Block{minecraft:potatoes}[age=7]} | Crop{Block{minecraft:beetroots}[age=3]} | Crop{Block{minecraft:air}} | Crop{Block{minecraft:air}} | Crop{Block{minecraft:air}} | Crop{Block{minecraft:air}}
[01:00:17] [Server thread/INFO]: [DEBUG] Attempted crop harvest with result PASS has completed

harvest.json: https://gist.github.com/Leeo97one/8ff9d7096e29c224d09b3b0102ed4377
I also added the associated seeds via a data pack: datapack.zip

Tested with:
Minecraft 1.16.3
Fabric Loader 0.10.3+build.211

[Request] 1.15.2 without Fabric API

It should be possible, but i dont know if it makes any sense. For me it does, as i want to use carpet autocraftingtable without fabric api (the two cause a weird conflict)

Failed to find seed

I left this in comments, and then realized that you have an issue tracker, I just missed it earlier because of the Curse site redesign/restructure.

Fabric Loader Version: 0.4.8 Build 155
Fabric API Ver: fabric-api-0.3.0+build.187.jarfabric-api-0.3.0+build.198.jar
Simple Harvest Ver: Harvest-1.14-fabric-1.0.4.jar

Log: https://paste.dimdev.org/ivewafixiz.cs

With the extra logging enabled, it seems like it's failing because of something to do with seeds? I'm going to guess based on your question in Discord earlier that the config file is missing a value that would make it work...However, I am using the default generated config, since I can read json (usually) but do not understand the syntax well enough to write it. I'm sure if I knew how to do so, I could fix this myself.

Issue between Simple Harvest and Plant Interactor from Industrial Foregoing

Hello,
I have first report that to Industrial Foregoing (InnovativeOnlineIndustries/Industrial-Foregoing#535) but the dev say the problem came from SimpleHarvest and it can't do anything about that.

Basically the Plant Interactor do a right click on plants (This is what's the docs say about that machine...). This work with Vanilla plant's how right-click to harvest work directly on my mdoapck, but, with plants configure on Simple Harvest, the plants drop (+ the seed) is adding each refresh to the machine inventory, but the plants is never really harvest...

I have a demonstration video of what I say: https://clips.twitch.tv/SmallPuzzledSamosaTBTacoLeft

Simple harvest is set the way to don't get more seeds, but, like you can see, with Mystical Agriculture plants I always get a seed (And the mod is configure to NEVER drop a second seed, so here a big Dupe Bug!)...

I have try all other mods for harvest but only yours have good configuration and can work with all plants in my modpack, but yours is the only one having that issue with the Plant Interactor.

I what to know if you can do something to fix that issue, because now, my only solution to fix that big Dupe Bug with Mystical Agriculture is, one doesn't have Right-Click to harvest for XL-Foods Plants (I think, this is really annoying), or completly disable that amazing machine, but it work amazing for everything else. Or third possibility is to find another dev to make mods configurable but how work great with that machine (How is not really easy, because my name is not Darkosto)...

Fireztonez

SimpleHarvest crashes on first launch, unable to create config file

On first launch with the mod, Harvest-1.12-1.2.5-17.jar creates the config json as an empty file, but does not populate it. Instead, it crashes.

I am using Forge Mod Loader version 14.22.0.2467.

log error snippet:
net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Harvest (harvest)
Caused by: java.lang.NullPointerException
at tehnut.harvest.JsonConfigHandler.handleDefaults(JsonConfigHandler.java:67)
at tehnut.harvest.HarvestConfig.(HarvestConfig.java:25)
at tehnut.harvest.JsonConfigHandler.init(JsonConfigHandler.java:45)
at tehnut.harvest.Harvest.init(Harvest.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:609)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)

Full log file: https://gist.github.com/anonymous/add8b45ed3754fae1289b7f1803eeb16/raw/ad36cffaf478958ee7c7d4bc89043fad5f50fe1f/fml-client-2.log

uses 'requires' key in fabric.mod.json

Harvest-fabric-1.16.1-1.2.12-26.jar

[09:43:49] [main/WARN]: Mod harvest (1.2.12) uses 'requires' key in fabric.mod.json, which is not supported - use 'depends'

[1.11.2] Can't figure out how to add a config for RandomThings Bean Sprouts

[
  {
    "initialBlock": {
      "blockName": "minecraft:wheat",
      "meta": 7
    },
    "finalBlock": {
      "blockName": "minecraft:wheat",
      "meta": 0
    }
  },
  {
    "initialBlock": {
      "blockName": "minecraft:carrots",
      "meta": 7
    },
    "finalBlock": {
      "blockName": "minecraft:carrots",
      "meta": 0
    }
  },
  {
    "initialBlock": {
      "blockName": "minecraft:potatoes",
      "meta": 7
    },
    "finalBlock": {
      "blockName": "minecraft:potatoes",
      "meta": 0
    }
  },
  {
    "initialBlock": {
      "blockName": "minecraft:beetroots",
      "meta": 3
    },
    "finalBlock": {
      "blockName": "minecraft:beetroots",
      "meta": 0
    }
  },
  {
    "initialBlock": {
      "blockName": "minecraft:nether_wart",
      "meta": 3
    },
    "finalBlock": {
      "blockName": "minecraft:nether_wart",
      "meta": 0
    }
  },
  {
    "initialBlock": {
      "blockName": "randomthings:beansprout",
      "meta": 7
    },
    "finalBlock": {
      "blockName": "randomthings:beansprout",
      "meta": 0
    }
  }
]

I've also tried randomthings:beanSprout. The player's hand swings but the crop is not harvested.

I've looked at the code and I don't see anything special on either end, and I have no idea what else to try to fix this. pls 2 halp :(

[Request] Client-side only support

Hello!

I'd like to be able to auto-replant on vanilla servers.
A client-side mod would allow this without having to modify the server.

SimpleHarvest doesn't work with Sandwichable

Hello. For some reason, Sandwichable crops are not right-clickable. This mod has the right tag for Simple Harvest and I set up the config correctly.

{
  "exhaustionPerHarvest": 0.005,
  "additionalLogging": false,
  "crops": [
    {
      "block": "minecraft:wheat",
      "states": {
        "age": "7"
      }
    },
    {
      "block": "minecraft:nether_wart",
      "states": {
        "age": "3"
      }
    },
    {
      "block": "minecraft:carrots",
      "states": {
        "age": "7"
      }
    },
    {
      "block": "minecraft:potatoes",
      "states": {
        "age": "7"
      }
    },
    {
      "block": "minecraft:beetroots",
      "states": {
        "age": "3"
      }
    },
    {
      "block": "sandwichable:cucumbers",
      "states": {
        "age": "4"
      }
    },
    {
      "block": "sandwichable:lettuce",
      "states": {
        "age": "4"
      }
    },
    {
      "block": "sandwichable:onions",
      "states": {
        "age": "3"
      }
    },
    {
      "block": "sandwichable:tomatoes",
      "states": {
        "age": "4"
      }
    }
  ]
}

[Request] 1.16.x support

The mod crashes the server when I start with the 1.15 version (expected), will there be an update? Several players on my server rely on this.

SimpleHarvest crashes when provided the default config file from the SimpleHarvest CurseForge page

Harvest-1.12-1.2.5-17.jar fails on launch when the harvest_config.json is populated with the example from the CurseForge page.
I've confirmed that the json is valid via JSONLINT
I am using Forge Mod Loader version 14.22.0.2467.

I had to rename the json to .txt to attach it to this issue.
harvest_config.json.txt

log error snippet:
// I just don't know what went wrong :(

Time: 9/3/17 8:19 AM
Description: There was a severe problem during mod loading that has caused the game to fail

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Harvest (harvest)
Caused by: java.lang.RuntimeException: Failed to invoke public tehnut.harvest.HarvestConfig() with no args
at com.google.gson.internal.ConstructorConstructor$3.construct(ConstructorConstructor.java:116)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:210)
at com.google.gson.Gson.fromJson(Gson.java:887)
at com.google.gson.Gson.fromJson(Gson.java:825)
at tehnut.harvest.JsonConfigHandler.init(JsonConfigHandler.java:53)
at tehnut.harvest.Harvest.init(Harvest.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:609)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
at com.google.common.eventbus.EventBus.post(EventBus.java:217)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:253)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:231)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
at com.google.common.eventbus.EventBus.post(EventBus.java:217)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:148)
at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:786)
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:343)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:534)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:377)
at net.minecraft.client.main.Main.main(SourceFile:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:236)
at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:297)
at org.multimc.EntryPoint.listen(EntryPoint.java:162)
at org.multimc.EntryPoint.main(EntryPoint.java:53)
Caused by: java.lang.NullPointerException
at tehnut.harvest.JsonConfigHandler.handleDefaults(JsonConfigHandler.java:67)
at tehnut.harvest.HarvestConfig.(HarvestConfig.java:25)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.google.gson.internal.ConstructorConstructor$3.construct(ConstructorConstructor.java:108)
... 53 more

[Bug] Some mods (unreleased Magnet Ring, Industrial Foregoing) consume all drops

When a player harvest a plant with the relevant magnet ring, or a certain machine (uncertain on the specifics) in Industrial Foregoing harvests a plant, all of the drops are consumed and no seed is found. Thus, the block state is never replaced -- meaning you can infinitely harvest some plants.

I posted a video of this on the BM discord a while back.

InsomniaKitten was the one who worked out precisely what was happening (i.e., all drops being eaten). They suggested replacing the block state regardless.

My concern with that would be things like Mystical Agriculture's plant-types for essences or Extra Utilities 2's ender lily seeds could thus still continue to be "duplicated" (even with the state changing), as you would get the seed, and then break it and get another seed.

My thought to resolve this would be a high priority event handler that looks for a seed before other mods have a chance to consume all of the drops. How this would fit in, I have no idea as I only have a passing understanding of the code -- otherwise I might've attempted a PR.

If this bug report makes no sense, please blame my brain which is currently non-functional.

Support for Wall/Non-Floor Blocks

Hello,

This mod works very well with most of the custom crops I have added to it, however it doens't work on blocks that are not on the ground facing up. Example would be Cocoa Beans in vanilla (not that I think the crop should have this behavior, but is easy to test), or Bone Mushroom Spores from BetterNether. In the case of Bone Mushrooms, it works when facing up on the ground, but not facing down, or any of the other cardinal directions. I am not sure if this is intentional or a limitation.

Thank you for all you do.

Mod Version: 1.16.1-1.2.12
Mod Loader: Fabric 0.9.0 build 204

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.