Giter Site home page Giter Site logo

maxvar / mcf-reap Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 2.0 216 KB

(minecraft mod) reap for fabric - right-click on a fully grown plant to harvest and reseed

Home Page: https://www.curseforge.com/minecraft/mc-mods/maxvar-reap-for-fabric

License: Do What The F*ck You Want To Public License

Java 100.00%
mc-fabric mc-mod minecraft-fabric-mod minecraft-mod

mcf-reap's People

Contributors

maxvar avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mcf-reap's Issues

Play plant or break sound

It would be nice if a plant or break sound was played when a crop is harvested.
Just change

public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
    if (!world.isClient() & isMature(state)) {
        return ReapHelper.reap(state, world, pos, player, hand, getSeedsItem().asItem(), getAgeProperty());
    }
    return super.onUse(state, world, pos, player, hand, hit);
}

to

public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
    if(isMature(state)) {
        if (!world.isClient()) {
            return ReapHelper.reap(state, world, pos, player, hand, getSeedsItem().asItem(), getAgeProperty());
        } else {
            player.playSound(SoundEvents.ITEM_CROP_PLANT, 1.0f, 1.0f);
        }
    }
    return super.onUse(state, world, pos, player, hand, hit);
}

Using @Inject instead of @Overwrite?

Hello there, I recently had a request to add compatibility with your mod, as my mod does some stat tracking on breaking crops, the person asking wanted to have using your mod also increment the stat.

However im having some issues getting it to work, because you used @Overwrite instead of @Inject or similar, leaving a simple HEAD injection if your mod is loaded impossible

Would you consider re-writing those parts of your mod to not overwrite methods? Thanks.

Update to 1.21?

Will there be an update to this version of the game soon?

Not work on server

It is not work on server
Everytime I right click the plants, it show me the error on the server, and only have sound but not harvest.

Error executing task on Server
java.lang.RuntimeException: Cannot load class me.shedaniel.clothconfig2.api.AbstractConfigListEntry in environment type SERVER
at Not Enough Crashes deobfuscated stack trace.(1.18.1+build.12) ~[?:?]
at net.fabricmc.loader.impl.transformer.FabricTransformer.transform(FabricTransformer.java:59) ~[fabric-loader-0.12.12.jar:?]
at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPreMixinClassByteArray(KnotClassDelegate.java:282) ~[fabric-loader-0.12.12.jar:?]
at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:240) ~[fabric-loader-0.12.12.jar:?]
at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:150) ~[fabric-loader-0.12.12.jar:?]
at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:155) ~[fabric-loader-0.12.12.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
at net.minecraft.block.CropBlock.onUse(CropBlock:2552) ~[?:?]
at net.minecraft.block.AbstractBlock$AbstractBlockState.onUse(AbstractBlock:937) ~[?:?]
at net.minecraft.server.network.ServerPlayerInteractionManager.redirect$bbo000$activateWithOptionalCactus(ServerPlayerInteractionManager:2029) ~[?:?]
at net.minecraft.server.network.ServerPlayerInteractionManager.interactBlock(ServerPlayerInteractionManager:327) ~[?:?]
at net.minecraft.server.network.ServerPlayNetworkHandler.onPlayerInteractBlock(ServerPlayNetworkHandler:1057) ~[?:?]
at net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket.apply(PlayerInteractBlockC2SPacket:30) ~[?:?]
at net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket.apply(PlayerInteractBlockC2SPacket:8) ~[?:?]
at net.minecraft.network.NetworkThreadUtils.method_11072(NetworkThreadUtils:21) ~[?:?]
at net.minecraft.server.ServerTask.run(ServerTask:18) ~[?:?]
at net.minecraft.util.thread.ThreadExecutor.redirect$zkm000$redirectExecuteTask(ThreadExecutor:521) ~[?:?]
at net.minecraft.util.thread.ThreadExecutor.runTask(ThreadExecutor:125) ~[?:?]
at net.minecraft.server.MinecraftServer.runOneTask(MinecraftServer:762) ~[server-intermediary.jar:?]
at net.minecraft.server.MinecraftServer.runTask(MinecraftServer:756) ~[server-intermediary.jar:?]
at net.minecraft.util.thread.ThreadExecutor.runTasks(ThreadExecutor:110) ~[?:?]
at net.minecraft.server.MinecraftServer.runTasksTillTickEnd(MinecraftServer:740) ~[server-intermediary.jar:?]
at net.minecraft.server.MinecraftServer.handler$zop000$modifiedRunLoop(MinecraftServer:4365) ~[server-intermediary.jar:?]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer:663) ~[server-intermediary.jar:?]
at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer:270) ~[server-intermediary.jar:?]
at java.lang.Thread.run(Thread.java:833) [?:?]

add config to mod menu

enable/disable mod, enable/disable direct collection into player's inventory, enable/disable planting sound when reaping.
all options are enabled by default.

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.