PPMF #1 - Harvester Hoes

Status
This thread has been locked.

BladianMC

Premium
Feedback score
5
Posts
123
Reactions
72
Resources
0

WHAT IS PPMF

PPMF stands for Paid Plugins Made Free

It's something I'll do in my free time, where I'll make plugins which are so simple that they honestly don't deserve to be paid for

I usually make them better, and more configurable and release the source code for anyone to code / use

If you have any suggestions for something that shouldn't be premium feel free to PM me, or to just say something in the thread

If you're going to suggest something from an existing link, try not to post it in a thread, but rather PM me, they don't deserve shit talk


HARVESTER HOES

Harvester Hoes is a plugin which places all the sugarcane you'd get from destroying one

It places everything into your inventory, so you don't have to deal with entities all around causing lag
Commands:

- /harvesterhoe <player>

Config:

Screen Shot 2017-09-28 at 21.08.17.png


Source Code:

https://github.com/BladianYT/HarvesterHoes

Ignore my comments about asking for permission, do what you want with the code!

Download Link:

Spigot: https://www.spigotmc.org/resources/ppmf-1-harvester-hoes.48706/
 

Attachments

  • Screen Shot 2017-09-28 at 21.08.17.png
    Screen Shot 2017-09-28 at 21.08.17.png
    29.4 KB · Views: 233
Last edited:
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

damagepots

Feedback score
14
Posts
162
Reactions
26
Resources
0
If it sets the sugar cane you mine too the highest wouldn't that be easily exploited?
 

BladianMC

Premium
Feedback score
5
Posts
123
Reactions
72
Resources
0
If it sets the sugar cane you mine too the highest wouldn't that be easily exploited?

What I think the common bug with this (I think this is what you're talking about), is that it gets the block, and does a loop from 256 (highest Y), to that specific block.

What mine does different is that it loops from that block up to whatever the highest block is, attacked to that specific sugar cane.

Code:
private List<Block> getBlocksOfSC(Block block)
    {
        List<Block> blocks = new ArrayList<>();
        blocks.add(block);
        Location checkLoc = block.getLocation().clone().add(0, 1, 0);
        while (checkLoc.getBlock().getType() == Material.SUGAR_CANE_BLOCK)
        {
            blocks.add(checkLoc.getBlock());
            checkLoc.add(0, 1, 0);
        }
        return blocks;
    }

It's generally more efficient, since it's less blocks it has to loop through.

You really should refrain from calling your main class "Core", "Main", etc..

Old habits die hard, I'll start changing it now.
 

BladianMC

Premium
Feedback score
5
Posts
123
Reactions
72
Resources
0
Added a download link, MC Market won't let me upload it as a resource so posted it on spigot.
 
Status
This thread has been locked.
Top