#help-development

1 messages · Page 1397 of 1

silver shuttle
#

why does that give me an exception

lost matrix
#

Rather use Integer.parseInt()
And you should catch the NumberFormatException to prevent invalid inputs

silver shuttle
#

yeah already have that

#

thanks

wraith rapids
#

never say "an exception"

#

always specify the exception

#

there are millions of different exceptions

silver shuttle
#

sorry I am 2 days into java...

wraith rapids
#

yeah, that's fine

#

that's why I'm giving you advice

silver shuttle
#

if you were to look at my code you would loose your mind

wraith rapids
#

i've seen lots of shit tier code

#

i've worked with slimefun

silver shuttle
#

put me at the bottom

young knoll
#

I’ve never looked at slimefun

#

What’s going on in there

wraith rapids
#

keep it that way

silver shuttle
#

lmao

wraith rapids
#

literally the worst plugin that is popular

#

the yandere sim of plugins

young knoll
#

Does that mean it has no loops :p

wraith rapids
#

performs like shit, written like shit, balanced like shit

#

they excuse it by saying that the main developer was a noob when he started writing it

#

but in all honesty he isn't much better now

#

everything he still writes, 5 years later, still runs like shit and looks like shit

#

the 'lag profiler' he added a few months back uses more main thread time than most of the individually ticked blocks in the plugin

#

and is literally fucking useless because it doesn't discriminate between off-thread and main thread time

silver shuttle
#

something is... odd with my code

lost matrix
#

Wait slimefun is still a thing? Fk then my machine plugin might be obsolete...

wraith rapids
#

definitely not obsolete

lost matrix
#

Maybe not because my performance is actually great...

wraith rapids
#

a steaming pile of shit is still a better replacement for slimefun

lost matrix
#

lol

silver shuttle
#

im trying to do an integral in a maths calculation

#

and it one way it works perfectly

#

but the other way gives completely different results than a calculation on my calculator

wraith rapids
#

import a math library

#

no point in reimplementing math functions yourself

silver shuttle
#
                money = Math.log((finalstock / (finalstock - finalamount)) * value);

finalstock = 2
finalamount = 1
value = 1000

lost matrix
#

Integrals are pretty hard to do in programming. Numerical mathematics can get quite complicated.

silver shuttle
#

that on my calculator gives out 693.147
In Java it gives out 7.601

wraith rapids
#

is Math.log log10 or log2

#

i never remember off the top of my head

silver shuttle
#

lemme check

#

i think log2

lost matrix
#

or natural log (so e)

#

pretty sure its not log 2

#

10 or e

wraith rapids
#

probably that actually

#

i think log10 is a separate method

#

this is what autocomplete does to your brain

silver shuttle
#

yeah its e

#

but why is it not working

#

sellitem_money = Math.log((sellitem_sell_final_stock + sellitem_sell_final_amount) / sellitem_sell_final_stock) * sellitem_result_value;

Thats the opposite (selling items) and it works fine

silver shuttle
wraith rapids
#

you should use lowerCamelCase for variables by the way

silver shuttle
#

yeah im going over everything once I am done, realized like 2 hours into the plugin that it was a bad decision

#

but still its giving out wrong answers

wraith rapids
#

look at and compare the intermediate calculations with your calculator

silver shuttle
#

i am

wraith rapids
#

see which one of them is giving an incorrect value

silver shuttle
#

wait a second this just got weirder

#

omgggg

lost matrix
#

What is the function what are the parameters and what integral do you want to calculate

crude charm
#

I want to make a custom damage system, how should I go about it. My idea was to give mobs a shit ton of health and give swords alot of sharpness and just hide it. Is there a better way of doing this?

silver shuttle
#

i found the issue

wraith rapids
#

almost certainly yes

silver shuttle
#

in one function I multiplied log(2/1) * 1000

#

that gave the large number

#

in the other I did log((2/1)*1000)

lost matrix
wraith rapids
#

it will be pretty difficult though, if you want to be compatible with other plugins that also fuck with damage

#

the way how minecraft and bukkit in particular handles damage isn't very brilliant

lost matrix
#

priority monitor and silence them all (dont)

wraith rapids
#

the final solution

crude charm
silver shuttle
wraith rapids
#

listen to and modify damage events

crude charm
#

is that built in

#

or do I have to do it

wraith rapids
#

listening to things is built in

#

damage events are built in

crude charm
#

oh

#

😦

wraith rapids
#

but you obviously need to do the logic in between

novel lodge
#

How can I give a command autofill parameters?

wraith rapids
#

implement tab executor

#

assuming you mean autocomplete

novel lodge
#

yes

wraith rapids
#

if you mean the brigadier named parameter shit, use some brigadier library

#

iirc lucko has a decent one

lost matrix
# crude charm thats very vague

Listen for the EntityDamageEvent and the EntityDamageByEntityEvent
Get the defender and the attacker.
Get both parties PDCs.
Use a manager that evaluates the damage outcome based on those two PDCs plus other effects like those form potions.
Set the calculated damage in the event.

quaint mantle
wraith rapids
#

i've found working with brigadier directly to be kinda cancer

near kayak
#

hi so I have this one plugin and I like it but it seems like it is missing one feature I want so I decided to edit that plugin add a custom permission and the main thing I want to use that permission is to bypass a limit that this p lugin has for example lets say a plugin has a limit of how much money you can have but It doesn't have a permission to bypass that how do I make it exactly I tried playing with eventhandler but it is more complicated than I thought lol

lost matrix
wraith rapids
#

zyte

lost matrix
wraith rapids
#

i would like to introduce you to this concept

#

called punctuation

dusty herald
#

so what is this feature you want to bypass?

#

is it a command? 🤔

dusty herald
#

can you elaborate

wraith rapids
#

and use sentences

#

i will try to help you if I can read what you say without getting an aneurysm

dusty herald
#

hush

near kayak
dusty herald
#

you're being really elaborate

#

why do you want to bypass this value?

silver shuttle
#
                    ItemStack hand = new ItemStack(sellitem_seller.getInventory().getItemInMainHand());
                    hand.setAmount(sellitem_sell_final_amount_int);
                    sellitem_seller.getInventory().remove(hand);
                    int sellitem_stock_after = (int) (sellitem_sell_final_amount + sellitem_sell_final_stock);

Why is this not removing sellitem_sell_final_amount_int amount of the Item in my hand from my Inventory?

near kayak
dusty herald
#

what

lost matrix
near kayak
#

to bypass that

near kayak
#

lol

dusty herald
#

so this plugin limits the amount of money you can have?

near kayak
#

I'll explain in detail

young knoll
#

I’m guessing the plugin has a max money option, and he wants a perm for users to bypass it

dusty herald
#

ah well

lost matrix
#

Not possible

dusty herald
#

i mean

#

if you fork the fuck out of it, maybe

lost matrix
#

bytecode injection lul

lost matrix
# near kayak bingo

You need to modify the plugin itself or use some really shady tricks: Maybe reflections are enough, maybe injecting bytecode is needed.

wraith rapids
#

depends on your economy plugin

#

it could have an API or something

#

speaking of economy plugins

#

what eco plugins do people use these days?

near kayak
silver shuttle
#

i think most use essentials

wraith rapids
#

i've been stuck with TheNewEconomy for like ages and I feel like I will fucking die if I have to go another year with it

#

regrettably I don't think essentials eco works with towny properly

#

or, well, that's what the towny people say, anyway

lost matrix
near kayak
silver shuttle
wraith rapids
#

i think towny has been getting more popular recently tbh

#

well, if we ignore all of the minigame and cancer servers

near kayak
#

fr

eternal oxide
#

iCo5 for Towny

wraith rapids
#

i remember usinc ico back in the day

#

might be worth a look

lost matrix
#

Someone members Bosecomony

#

back in the bukkit days

ivory sleet
#

🥲

young knoll
#

I’ve not had an issue with towny and essentials in modern versions

vast quest
#

hello does anyone know why none of the imports work for me/

young knoll
#

But it does still have the warning

near kayak
wraith rapids
#

i never really bothered to actually figure out what the supposed issue with essentials eco and towny was

lost matrix
vast quest
#

well I dont even know what happened

drowsy helm
#

?

#

are you using maven

vast quest
#

it was working before I restarted my computer

#

yes

eternal oxide
vast quest
#

yes...

drowsy helm
#

make sure you're not in offline mode

eternal oxide
#

I'm at a loss then

vast quest
#

like after I restarted my computer

drowsy helm
#

have you tried restarting again?

vast quest
#

yeo

drowsy helm
#

interesting

#

are you getting the error from your pom or your actual imports on java

lost matrix
vast quest
#

Im getting from the imports

pure glacier
#

send ur pom in a

#

?paste

queen dragonBOT
drowsy helm
#

yeah sounds like just an ide problem

vast quest
#

kk

pure glacier
#

eclipse vs intellij war ?

vast quest
lost matrix
pure glacier
#

intellij best

lost matrix
drowsy helm
#

Moved from Eclipse to IJ a week and a bit ago, honestly I don't get the hypw

#

its better but not THAT much better

pure glacier
#

srsly?

#

its a lot better

pure glacier
lost matrix
silver shuttle
#
                    ItemStack hand = new ItemStack(sellitem_seller.getInventory().getItemInMainHand());
                    hand.setAmount(sellitem_sell_final_amount_int);
                    sellitem_seller.getInventory().remove(hand);
                    int sellitem_stock_after = (int) (sellitem_sell_final_amount + sellitem_sell_final_stock);

Why is this not removing sellitem_sell_final_amount_int amount of the Item in my hand from my Inventory?

wraith rapids
#

the search function is trash

#

it doesn't work properly with tab and is slow as shit and doesn't find things half of the time

pure glacier
#

in intellij?

wraith rapids
#

yeah

pure glacier
#

is ur pc good?

wraith rapids
#

no

pure glacier
#

intellij is very heavy to be fair

wraith rapids
#

my stance is that I shouldn't need a giga chad computer to use a fucking search function

pure glacier
#

very true

#

i think the reason why its so heavy

#

is that it kinda learns from u

wraith rapids
#

i hate intellij and would use eclipse but eclipse just lacks so much functionality and features in comparison that I don't really have a choice

drowsy helm
#

I still haven't figured out how to auto-import all unimported refs yet?

#

on eclipse it was ctrl shift O

#

but in IJ it looks like you have to do each one manually

ornate heart
#

Same...

pure glacier
#

if you type getServer().getPluginManager().registerEvents(new Events(), this); then it learns that ur gonna be using registerEvents the most

pure glacier
wraith rapids
#

also, one thing that really fucking grinds my gears with ij is that it's constantly grabbing window focus

#

I have a slow computer and it takes around 30 seconds to open a project

#

during this time, it constantly opens pop ups and steals window focus

#

if i'm f.e typing on discord at the same time, the popup will steal window focus, and when I press space

pure glacier
#

that is very true

wraith rapids
#

it hits the fucking cancel button

#

and I need to start all over again

#

not only this but literally every single fucking thing the ide does tries to grab window focus

drowsy helm
#

also whats up with ctrl Y on IJ

#

it just deleted the whole line

pure glacier
#

@drowsy helm

drowsy helm
#

instead of redo

drowsy helm
near kayak
#

no cap

pure glacier
#

🤮

ornate heart
pure glacier
#

np

near kayak
ornate heart
#

I’ve been looking for this

wraith rapids
#

let me show you some theme

pure glacier
#

material themes best themes

tulip lodge
pure glacier
#

do u use everything in light themes

wraith rapids
#

here is a theme for you peasants

#

your dark mode isn't even dark

near kayak
wraith rapids
#

you're just all light mode fucknuggets to me

pure glacier
#

for example, i cant see the words properly in a light theme, theyre too small

drowsy helm
#

you cant be for real

#

surely you don't use light theme

pure glacier
#

i dont

#

github dark all the way

pure glacier
#

yes thats how i felt when taking the ss

near kayak
#

light theme only

drowsy helm
#

why tf is it even an option

pure glacier
#

:000000000000

#

pls stop

#

i really wish the atom material icons plugin would change the icon for .yml files

#

its a bit bad

#

what even is that

#

when all the other ones are clean

#

like these for example

silver shuttle
#
                    ItemStack hand = new ItemStack(sellitem_seller.getInventory().getItemInMainHand());
                    hand.setAmount(sellitem_sell_final_amount_int);
                    sellitem_seller.getInventory().remove(hand);
                    int sellitem_stock_after = (int) (sellitem_sell_final_amount + sellitem_sell_final_stock);

Why is this not removing sellitem_sell_final_amount_int amount of the Item in my hand from my Inventory?

wraith rapids
#

Removes all stacks in the inventory matching the given stack.

silver shuttle
#

oh so it would remove all stacks matching sellitem_sell_final_amount_int ?

silver shuttle
#

ooooh ok that makes sense

wraith rapids
#

read ze docs

silver shuttle
#

what can I use instead then

wraith rapids
#

i don't know if there is a built in way to remove x items of a type from an inventory tbh

#

you might just have to iterate over the slots and remove them manually

silver shuttle
#

I have no idea how to do that

wraith rapids
#

do you know how to iterate over a collection

silver shuttle
#

wait theres .removeItem()

#

lemme try that

wraith rapids
#

Removes the given ItemStacks from the inventory.

#

probably won't work either

silver shuttle
#

yeah that works

#

it removes from a full stack

#

works perfect

wraith rapids
#

kool beans

#

but

#

you do know how to iterate over a collection, right

#

might be something you want to look into if not 👀

silver shuttle
#

I will...

#

is it possible to store the ItemStack in a String in a MySQL?

#

Like does that work?

wraith rapids
#

yeeees, but not very well on spigot

#

you will want to do something called serialization to the itemstack, which converts it into a serial format, usually raw bytes or a string or something like that

silver shuttle
#

mhm okay

wraith rapids
#

the only serialization method spigot provides converts the item into what is basically a ConfigurationSection

lost matrix
#

BukkitObjectOutputStream -> Base64

silver shuttle
#

lemme try around a bit to see if I can get it working

wraith rapids
#

does that take care of data conversions and shit?

#

i remember there being issues with serialized stuff exploding when the data version is incremented

#

like, with server updates and what have you

ivory sleet
#

Yeah that was a problem

silver shuttle
#

This shouldnt cause any issues as long as the item column type is TEXT right?

ivory sleet
#

No

#

I don’t think at least

silver shuttle
#

cool

#

How do I call values from the config outside of the main class file?

wraith rapids
#

now, put on the brakes

#

before give you the answer you want, let me first say that your question is wrong

#

in object oriented programming, everything is an object

#

your problem is not that you can't find the config object

#

your question of "how to find the config outside of my main class" is wrong

#

it should be "how to find the config outside of my main class instance"

silver shuttle
#

... yes

wraith rapids
#

the answer is that you give the config object to the object that needs it

#

you don't give it to a "class file"

#

you give it to another object

#

drop the whole thought pattern of being restricted by "class files"

#

you are always restricted by which object you are in, not which class you are in

ivory sleet
#

Ideally inject your plugin instance into that other instance challenger

silver shuttle
#

how do I do that

wraith rapids
#

do you know what a constructor is

silver shuttle
#

no

wraith rapids
#

do you know what new does

silver shuttle
#

kinda

wraith rapids
#

give me an example of you using new in your code

silver shuttle
#

ItemStack hand = new ItemStack(sellitem_seller.getInventory().getItemInMainHand());

ivory sleet
wraith rapids
#

right there, you are invoking ItemStack's constructor

#

new calls a constructor

#

constructor creates a new object

#

that's why it's called new

#

now, let's try creating a constructor

#

open up the class file where you want to access your config

ivory sleet
#

NNY nice explanation

silver shuttle
#

mk

wraith rapids
#

have you opened it? what is the class called

silver shuttle
#

buyitem.java

wraith rapids
#

now, we will create a constructor

#

write public buyitem() {} somewhere in the class

silver shuttle
#

ok

wraith rapids
#

now, write some code in between the { }

#

it doesn't matter what it is

silver shuttle
#

like I mean

wraith rapids
#

you have to put it inside the class declaration

silver shuttle
#

below the imports or inside the code block of the CommandExecutor

wraith rapids
#

public class buyitem { } is the class declaration

#

so you put it somewhere in between the { }

silver shuttle
#

yes

wraith rapids
#

so now you have something like

public class buyitem {

    public buyitem() {
        System.out.println("the final solution");
    }


}
#

congratulations, you have created a constructor

#

now, whenever you create a new instance of buyitem with new buyitem(), that code is run

silver shuttle
#

wait

#

no that doesnt work

#
public class buyitem implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String alias, String[] args) {
        public buyitem() {
            System.out.println("the final solution");
        }
        if (args.length == 0) {
...
wraith rapids
#

no, no

#

do not put it in a method

#

put it in the class declaration

silver shuttle
#

ok

#

done

wraith rapids
#

next, put something in between the ()

#

let's say Object myObject

#

you will have something like this
so now you have something like

public class buyitem {

    public buyitem(Object myObject) {
        System.out.println("the final solution");
    }


}
silver shuttle
#

ye

wraith rapids
#

now, if you try creating a new buyitem

#

it will throw an error

silver shuttle
#

yeah I see that

wraith rapids
#

new buyitem() will throw an error, because it wants a parameter

#

you have created a constructor that takes 1 parameter

#

you can no longer create instances of this class without giving it some arguments

silver shuttle
#

and the argument tells it stuff about the plugins data I guess?

#

and I can use that to do .getConfig()?

wraith rapids
#

now, to create an instance of it, you need an Object to give to it

Object object = new Object();
buyitem item = new buyitem(object)
#

here we are creating a dummy object and then passing it to the constructor of buyitem

#

now, we can do stuff with this object in the constructor

#
public class buyitem {

    public buyitem(Object myObject) {
        System.out.println("the final solution");
        
        System.out.println("We got an object: " + myObject);
    }


}
#

if we're feeling hardcore, we can create a field and store that object

#
public class buyitem {

    private Object myStoredObject;

    public buyitem(Object myObject) {
        System.out.println("the final solution");
        
        System.out.println("We got an object: " + myObject);

        myStoredObject = myObject;
    }


}
#

and now, the buyitem object will forever remember the object you passed to it in its constructor

#

it can do stuff with that object later

silver shuttle
#

ok

wraith rapids
#
public class buyitem {

    private Object myStoredObject;

    public buyitem(Object myObject) {
        System.out.println("the final solution");
        
        System.out.println("We got an object: " + myObject);

        myStoredObject = myObject;
    }

    public boolean onCommand() {
        System.out.println("The object we have is " + myStoredObject);
    }


}
#

next, do you know what this does

silver shuttle
#

partially

#

I only have it to connect to the MySQL and save the config

wraith rapids
#

now, I want you to embrace the thought that methods belong to an object

silver shuttle
#

mhm

wraith rapids
#

see that onCommand method? I want you to stop thinking that it's a couple of lines of text in a text file named buyitem.java

silver shuttle
#

lmao i know

wraith rapids
#

i want you to imagine that it's part of an object

#

that is

Object object = new Object();
buyitem item = new buyitem(object)
#

it belongs to 'item'

#

we can call it with item.onCommand()

#

now, when we have a this inside the method

#
public class buyitem {

    public boolean onCommand() {
        System.out.println("The object we have is " + myStoredObject);

        System.out.println("My name is " + this);
    }


}
strong kelp
#

how can I get the jar file if I have all java files made?

wraith rapids
#

it will refer to item

silver shuttle
pure glacier
wraith rapids
#

because item owns the method, and this refers to the current object, which is item

silver shuttle
#

yes

strong kelp
pure glacier
#

yeah exporting

#

what ide u using

strong kelp
#

so how can I export

wraith rapids
#

now, next we need to make some assumptions with what bukkit does with plugins

strong kelp
#

idk I took it from github

wraith rapids
#

what is the name of your main class

silver shuttle
#

konstanius

wraith rapids
#

right

pure glacier
strong kelp
#

for what

#

visual studio code

pure glacier
#

u have the java files

#

oh

wraith rapids
#

somewhere in the abyssal fucking spaghetti depths of bukkit, something goes konstanius thatPlugin = new konstanius()

#

it takes your main class

#

and it calls your constructor

#

creating an instance of your main class

#

an object

pure glacier
#

run that @strong kelp

quaint mantle
#

I have this in build.gradle ```
version = '1.0'

ext.pluginName = 'MyFirstPlugin'
ext.author = 'daark'
ext.website = 'google.com'
ext.mainPackage = 'me.daark.myplugin'
ext.mainClass = mainPackage + ".MyFirstPlugin"


How do I use placeholders in plugin.yml with it?
I tried this but it shows same when I build

name: ${pluginName}
author: ${author}
website: ${website}
version: ${project.version}
main: ${mainClass}

wraith rapids
#

it will then do some shit for a while, and then it will call thatPlugin.onLoad()

strong kelp
#

with java?

wraith rapids
#

and a whule later, it will call thatPlugin.onEnable()

pure glacier
strong kelp
#

can you help me in DM?

wraith rapids
#

and before the server shuts down, it will call thatPlugin.onDisable()

ivory sleet
#

processResources.expand "pluginName": "blah" @quaint mantle

pure glacier
strong kelp
#

thanks

quaint mantle
wraith rapids
#

now, we can apply the knowledge we have learned of this

#

and include this in your onEnable method

ivory sleet
#

Using replacetokens is redundant

wraith rapids
#

it will refer to the object that bukkit told your main class's constructor to create

ivory sleet
#

Just expand

wraith rapids
#

that is, it refers to your plugin object

#

now, we can apply the knowledge we learned of constructors

#

and we can give this to the constructor of your buyitem class

#

now, we can apply the knowledge that we can do stuff with the objects we are passed in constructors, and we can store the plugin object in the buyitem object

ivory sleet
#
processResources {
  expand "pluginName": project.name,
                "author": "Drak"
}``` @quaint mantle
#

Etc

quaint mantle
#

And then I use @pluginName@ or ${pluginName}?

ivory sleet
#

Latter

#

If you see someone uses @blah@ then they’re officially boomers

wraith rapids
#

and you end up with something like this

#
public class buyitem {

    private konstantinus myPlugin;

    public buyitem(konstantinus plugin) {
        System.out.println("the final solution");
        
        System.out.println("We got an object: " + plugin);

        myPlugin = plugin;
    }

    public boolean onCommand() {
        System.out.println("The plugin we have is " + myPlugin);
    }


}
silver shuttle
#

okay

wraith rapids
#

and now, in your buyitem's methods, you can take the myPlugin object

#

and do stuff with it

#

like, for example, call getConfig()

silver shuttle
#

like myPlugin.getConfig();?

#

ayyy

quaint mantle
ivory sleet
#

no lol

wraith rapids
#

note that you can shove some this'es in the code and it will do just the same:

public class buyitem {

    private konstantinus myPlugin;

    public buyitem(konstantinus plugin) {
        System.out.println("the final solution");
        
        System.out.println("We got an object: " + plugin);

        this.myPlugin = plugin;
    }

    public boolean onCommand() {
        System.out.println("The plugin we have is " + this.myPlugin);
    }


}
ivory sleet
#

Most likely your project property is also your rootProject

#

If you’re not using modules or smtng

wraith rapids
#

because this refers to the current object, and myPlugin is a field on the current object, both this.myPlugin and myPlugin are the same

quaint mantle
ivory sleet
#

Wat

quaint mantle
#

It thought I should do this

processResources {
  expand "MyFirstPlugin": project.name,
                "author": "Drak"
}```
ivory sleet
#

Yes

quaint mantle
#

No I keep PluginName there right?

quaint mantle
#

IntelliJ

pure glacier
#

with the minecraft dev plugin?

quaint mantle
#

No

silver shuttle
pure glacier
#

use it

ivory sleet
#

Putting $MyFirstPlugin$ into plugin.yml would then translate to the project.name when building

quaint mantle
#

Ooooh

#

So PluginName is the placeholder

ivory sleet
#

Yes

wraith rapids
#

well, you aren't really doing anything with the config there yet

quaint mantle
wraith rapids
#

so there's no need to call myplugin.getConfig yet

ivory sleet
#

Yes0

maiden briar
#
if(!configFile.exists())
        {
            configFile.getParentFile().mkdirs();
            InputStream is = plugin.getResource(configFile.getName());

            try
            {
                Files.copy(is, configFile.toPath());
                loadConfig();
            }
            catch(IOException e)
            {
                e.printStackTrace();
            }
        }
        else
        {
            loadConfig();
        }

Why is 'is' null?

quaint mantle
wraith rapids
#

call it later when you need it

ivory sleet
#

Yes

silver shuttle
quaint mantle
#

aaaah

ivory sleet
#

In this case it is drak

quaint mantle
#

Do I need that plugin too?

wraith rapids
#

what do you mean

maiden briar
#

The inputstream

ivory sleet
#

Wym drak

quaint mantle
#

That minecraft dev plugin

ivory sleet
#

No

silver shuttle
ivory sleet
#

It’s crap

pure glacier
#

it makes it easier

wraith rapids
#

yes, well, we changed the constructor to take in an instance of your main class

ivory sleet
#

It just helps you negligibly

wraith rapids
#

it no longer accepts any random Object

#

it needs to be an instance of your konstanius class

#

the instance that bukkit creates

quaint mantle
#

Do I use expand for ext.mainPackage too?

wraith rapids
#

the instance that bukkit calls the onEnable method on

#

how do we get this instance?

silver shuttle
#

this

wraith rapids
#

how do we refer to this instance?

#

yes

ivory sleet
#

Drak I mean you can expand anything I guess or what hinders you?

wraith rapids
#

good job

wraith rapids
#

now, give the constructor this

#

that will give the buyitem object the instance of your main class

silver shuttle
#

oh bruh i tried doing it in the Object object = new Object(this)

wraith rapids
#

which the buyitem object can then call getConfig on

silver shuttle
#
public class buyitem implements CommandExecutor {
    public buyitem(konstanius plugin) {
        plugin.getConfig();
    }

Does this work too?

quaint mantle
#
processResources {
    expand "pluginName": project.name,
            "author": "dark"
            "website": "google.com"
            "mainPackage": "me.dark.myplugin"
            "mainClass": mainPackage + ".MyFirstPlugin"
}

This is probably not correct.

ivory sleet
#

Commas

#

X: y,
Z: a,
B: c

#

It’s a key-value (map)

quaint mantle
#

But what about this line "mainClass": mainPackage + ".MyFirstPlugin"

ivory sleet
#

Fine though I advocate string interpolation

#

"${mainPackage}.MyFirstPlugin"

silver shuttle
ivory sleet
#

Lol you actually wrote his entire name

silver shuttle
#

copy pasta

quaint mantle
#
processResources {
    expand "pluginName": project.name,
            "author": "dark",
            "website": "google.com",
            "mainPackage": "me.dark.myplugin",
            "mainClass": "${mainPackage}.MyFirstPlugin"
}

Like this?

ivory sleet
#

Yeah

quaint mantle
#

Could not get unknown property 'mainPackage' for task ':processResources' of type org.gradle.language.jvm.tasks.ProcessResources.

wraith rapids
#

no, that doesn't work anymore

#

because now you are no longer storing the instance of your plugin

#
public class buyitem implements CommandExecutor {
    public buyitem(konstanius plugin) {
        plugin.getConfig();
    }
#

you're just taking it

#

and then throwing it away

maiden briar
#

java.lang.ClassNotFoundException:net.minecraft.server.v1_16_R3.ServerPing.ServerData, Why do I get this? I am 100% sure it exists

wraith rapids
#

a field is an object's way of remembering things

ivory sleet
#

@quaint mantle send ur entire build script

wraith rapids
#

you need a field to remember your plugin

silver shuttle
#

ok ty

quaint mantle
silver shuttle
ivory sleet
#

Oh that should work Drak but maybe mainPackage is a reserved one ?

quaint mantle
#

What should I do then?

ivory sleet
#

pluginEntrypoint or smtng mb

quaint mantle
#

I don't know how

ivory sleet
#

Just use that name for your plugin main class path instead of mainPackage

#

Also why do you use gradle groovy if you’re a kotlin programmer lol

novel hornet
#

Hey guys so I’m working on a plugin that summons tnt on a player when ever they crouch and I want to know how would i get the location of any player that crouches

quaint mantle
#

Idk I just never did plugins

ivory sleet
#

Fair enough

wraith rapids
#

listen to toggle sneak event

#

and spawn tnt

dense goblet
#

What events should I look to make an item non-usable?

#

I already cancel block place events

#

is there an easy way to do this for all other item functions (e.g. dyeing)

wraith rapids
#

define non usable

dense goblet
#

can still punch with it but can't perform functions such as special right-click functionality

#

ideally also can't use in crafting or smelting but that is more complex ig

wraith rapids
#

listen to all interact events

#

and cancel any right click ones with that item held

#

you can still use it in recipes and whatever

dense goblet
#

will this affect item-nonspecific events such as trying to open a chest while holding the item?

wraith rapids
#

yes

dense goblet
#

is it difficult to make it ignore those

wraith rapids
#

i'm not sure

dense goblet
#

i.e. without doing it on a case-by-case basis

#

okay, I'll give it a go anyway

#

thank you!

#

PlayerInteractEvent.isCancelled is deprecated for some reason?

ivory sleet
#

I think it uses Event.Result instead

#

Because it can be cancelled in different ways sort of

quaint mantle
#

Conclure it does not work at all

#

processResources doesn't work

ivory sleet
#

What does it say

wraith rapids
#

the interact event is cancer

quaint mantle
#

A lot of errors

#

Deprecated.
This event has two possible cancellation states, one for useInteractedBlock() and one for useItemInHand(). It is possible a call might have the former false, but the latter true, eg in the case of using a firework whilst gliding. Callers should check the relevant methods individually.

#

this what it says on the javadoc

#

When I use ext.pluginName it builds but the placeholders aren't working

#

When trying to use processResources I dig my self a deeper rabbit hole

ivory sleet
#

Where do you use ext.pluginName

#

ext is bad btw

novel hornet
quaint mantle
#

primed tnt

#

or the block tnt

#

But processResources are not really working for me

ivory sleet
#

That’s not the issue

#

How’s your plugin.yml looking

quaint mantle
wraith rapids
#

listen to the sneak toggle event

#

and spawn tnt

dense goblet
#

true @quaint mantle, thought the Javadocs were embedded in the API code and didnt see it there but it looks like they aren't

quaint mantle
#

Tried those two

author: @author@
website: @website@
version: @project.version@
main: @mainClass@

and

author: ${author}
website: ${website}
version: ${project.version}
main: ${mainClass}```
dense goblet
#

if I do setUseItemInHand, will that stop e.g. a sheep being dyed or just stop the dye from being consumed?

wraith rapids
#

probably both

quaint mantle
#

its useItemInHand()

dense goblet
#

okay perfect

ivory sleet
#

Drak you never declared a variable for project.version

#

Or like put it into expand

quaint mantle
#

@novel hornet

e.getPlayer().getWorld().spawnEntity(l, EntityType.PRIMED_TNT);```
#

I have this in build.gradle version = '1.0'

#

i wanna get back into plugin development but idk what to make

dense goblet
wraith rapids
#

make me a decent crate plugin

#

all of the existing ones are trash

quaint mantle
#

ah ok

wraith rapids
#

literally every last one is somehow garbage

quaint mantle
#

i worked for this server owner

wraith rapids
#

one way or the other

quaint mantle
#

literally garbage

#

toxic experience

dense goblet
#

lootcrates?

quaint mantle
#

he kept wanting to use plugins

#

and like his way of owning the server was so bad

wraith rapids
#

let me see if i've checked that

quaint mantle
#

are u allowed to curse on here

dense goblet
#

I mean its kinda good that plugins to exploit children are all trash lol

quaint mantle
#

yeah

#

Look

#

When I try to build

#

I get this

#
> Could not copy file 'D:\GitHub\bMoreFish\src\main\resources\locale\lang_de.yml' to 'D:\GitHub\bMoreFish\build\resources\main\locale\lang_de.yml'.
   > Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed:
     SimpleTemplateScript44.groovy: 1: illegal string body character after dollar sign;
        solution: either escape a literal dollar sign "\$5" or bracket the value expression "${5}" @ line 1, column 10.
        out.print("""#```
#

That is with processResources

#

When I use ext it builds but placeholders don't work

brittle nova
#

how can I change the direction of a lever in 1.16.5? Because when I place the lever it is in the air(like its on a wall) and not down on the block.

quaint mantle
#

something to do with nbt isnt it

dense goblet
#

@brittle nova setFacingDirection

quaint mantle
#

^^

dense goblet
#

unless that is just the rotation

brittle nova
quaint mantle
#

the class is deprecated

#

it says use the BlockData class

#
group = 'me.dark'
version = '1.0'

ext.mainPackage = 'me.dark.myplugin'

processResources {
    expand "pluginName": project.name,
            "author": "dark",
            "website": "google.com",
            "mainClass": "${mainPackage}.MyFirstPlugin"
}

This is currently my build.gradle

dense goblet
#

ohh true, google came up with this one

ivory sleet
#

@quaint mantle wrap it into
filesMatching("plugin.yml") {
expand ...
}

brittle nova
quaint mantle
#

Replacing processresources with filesMatching?

ivory sleet
#

No

quaint mantle
#

im not too sure

ivory sleet
#

I said wrap

mortal hare
quaint mantle
mortal hare
#

like setting the plugin.yml

wraith rapids
#

it doesn't look like the plugin supports complex items properly

quaint mantle
#

Location#.getBlock().setData((byte) 2)

mortal hare
#

through <properties></properties>

quaint mantle
#
group = 'me.dark'
version = '1.0'

ext.mainPackage = 'me.dark.myplugin'

filesMatching("plugin.yml") {
    expand
processResources {
    expand "pluginName": project.name,
            "author": "dark",
            "website": "google.com",
            "mainClass": "${mainPackage}.MyFirstPlugin"
}
}
silver shuttle
#

How can I, in a config, have say
missing-amount-usage: "§eUsage: §c/buyitem %item% <Amount>"
translate to:
"§eUsage: §c/buyitem " + item + "<Amount>"
in my Code?

quaint mantle
#

Like this?

wraith rapids
#

f.e how would I apply a PDC tag with this plugin's config?

mortal hare
wraith rapids
#

i have a bunch of plugins that identify items based on PDC tags

quaint mantle
#

@brittle nova think i found your code

#

give me a secon

ivory sleet
#

processResources {
filesMatching(...) {
expand ...
}
}

wraith rapids
#

i guess I'll just have to write my own crate plugin once I get around to it

quaint mantle
#
BlockData blockData = block.getBlockData();
if(blockData instanceof Rotatable) {
    Rotatable rotatable = (Rotatable) blockData;
    rotatable.setRotation(BlockFace.EAST);
}
block.setBlockData(blockData);
#

@brittle nova

silver shuttle
mortal hare
#

oh

quaint mantle
#

should work

#

make sure the lever block is the variable "block"

#

or just replace the variable name

wraith rapids
#

string.replace("%item%", item.toString())

quaint mantle
#

with whatever ur using

wraith rapids
#

or something

mortal hare
#

then you should do #String.replace("placeholder with escaped chars", "your replacement");

quaint mantle
#
> Could not copy file 'D:\GitHub\bMoreFish\src\main\resources\plugin.yml' to 'D:\GitHub\bMoreFish\build\resources\main\plugin.yml'.
   > Missing property (project) for Groovy template expansion. Defined keys [pluginName, author, website, mainClass, out].```
mortal hare
#

or use glorified version of it - PlaceholderAPI

silver shuttle
#

lemme try

quaint mantle
#

wait

ivory sleet
#

Yes I hope you removed project.version

quaint mantle
#

i think its supposed to be directional not rotatable

#
BlockData blockData = block.getBlockData();
if(blockData instanceof Directional) {
    Directional rotatable = (Directional) blockData;
    rotatable.setRotation(BlockFace.EAST);
}
block.setBlockData(blockData);
ivory sleet
#

Make it into a variable like:
expand "pluginVersion": project.version

quaint mantle
#

@brittle nova

#

that code was wrong use the above block

quaint mantle
#

setFacing

#

**

silver shuttle
#

sender.sendMessage(messages_prefix + myplugin.getConfig().getString("buyitem.missing-amount-usage").replace("%item%", "args[0]"));
Like that?

quaint mantle
#

Oh it finally works

#

Thanks a lot

ivory sleet
#

(:

wraith rapids
#

don't wrap args[0] in ""

#

doing that makes it a string

quaint mantle
#

yea

brittle nova
wraith rapids
#

and you will literally send the player "args[0]"

quaint mantle
#

give me a second

silver shuttle
quaint mantle
#

seems about right

brittle nova
#

ok

quaint mantle
#

im not sure how BlockFaces work in terms of levers so i guess just experiment

wraith rapids
#

no partying allowed

quaint mantle
#

aw u cant use emojis?

#

from other servers

wraith rapids
#

only for nitro booster cucks

quaint mantle
#

i see i see

wraith rapids
#

only boosterers have the perm

quaint mantle
#

what happens

brittle nova
wraith rapids
#

regular verified users don't

quaint mantle
#

any errors in console

mortal hare
#

does Skript count as interpreter for java bytecode?

wraith rapids
#

skript counts as shit

quiet ice
#

it isn't really bytecode

quaint mantle
#

^^^

#

^^

brittle nova
quaint mantle
#

well you gonna get errors if its not there

brittle nova
#

blockdata isn't directinal

quaint mantle
#

not all blocks are directional

mortal hare
quiet ice
#

of course

mortal hare
#

im wondering does it count as interpreter

quaint mantle
#

imagine indentation LOL

quiet ice
#

but that does not make it an interpreter for java bytecode

quaint mantle
#

are you using it in like a interaction event?

quiet ice
#

It likely falls under the same realm as a python interpreter though

brittle nova
quaint mantle
#

what block are you using

quiet ice
#

That it sits on a JVM and translates stuff to bukkit objects changes little

quaint mantle
#

pretty sure Directional is for stuff like chests/furnaces

#

now i see that

wraith rapids
#

directional controls the rotation of the lever

#

faceattachable controls the block face it's attached to

#

iirc

quaint mantle
#

which is what this guys looking for is it not?

quiet ice
#

the lever can be rotated?

wraith rapids
#

i don't know

#

i have literally not read anything about your conversation

quaint mantle
#

yeah like pointing north-south/east-west right?

wraith rapids
#

you can rotate them when they're placed on horizontal surfaces

quaint mantle
#

if its on the ground

#

yeah

#

imagine a sideways wall lever

#

phoenix sc moment

brittle nova
#

the lever is placed like on a wall but I want to be it on the ground. So what do I have to do?

quaint mantle
#

yeah

#

face attachable

wraith rapids
#

set the faceattachable

quaint mantle
#

make it

#

ground

#

or sum

#

FaceAttachable.FLOOR

#

FaceAttachable.AttachedFace.FLOOR

#

one of those

#

idk

wraith rapids
#

latter yeah

quaint mantle
#

dowanrds

wraith rapids
#

The switch is mounted to the ceiling and pointing dowanrds.

#

mounted on the ceiling

#

he wants it on the floor

quaint mantle
#

yea ik

#

just pointing out the typo

wraith rapids
#

lol

quaint mantle
#

greentns let us know if it doesnt work

brittle nova
#

it worked thank you

quaint mantle
#

np

#

have a great day

minor garnet
#

how to define a item stack as a string and get a string as a item stack?

quaint mantle
#

ItemStack.valueOf()?

#

is that a thing

#

also should be like ItemStack.toString()

lost matrix
lost matrix
wraith rapids
#

how would you go about taking a string and converting it into an item stack

quiet ice
#

Probably abuse the fact that it is config serialializable

wraith rapids
#

there are myriads of ways of doing that

wraith rapids
#

and it all depends on how it was converted into a string originally

quaint mantle
#

u could make ur own format

#

and then use the string function to turn it back into an itemstack

minor garnet
#
    public static void spawnLoot(String name, ItemStack item, int chance, Location loc) {
        spawnArmorStand(loc, item);
        String sql = " INSERT INFO loot ("
                + "NAME, ITEM, CHANCE, LOCAL"
                + ") VALUES(?, ?, ?, ?);";
        PreparedStatement ps;
        ps = ConnectionSQL.preparedStatement(sql);
        try {
            ps.setString(1, name);
        } catch(SQLException e) {
            
        }```
quaint mantle
#

im not rlly sure taken a break from coding

quiet ice
#

Don't make your own format

lost matrix
# minor garnet ```vb public static void spawnLoot(String name, ItemStack item, int chance, ...

Im normally using BukkitObjectOutputStreams for serializing ItemStacks.

  public static String itemStackToBase64(final ItemStack item) {
    try (final ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
      final BukkitObjectOutputStream dataOutput = new BukkitObjectOutputStream(outputStream);
      dataOutput.writeObject(item);
      final String line = Base64Coder.encodeLines(outputStream.toByteArray());
      dataOutput.close();
      return line;
    } catch (final IOException e) {
      e.printStackTrace();
      return null;
    }
  }

  public static ItemStack itemStackFromBase64(final String base64) {
    try (final ByteArrayInputStream inputStream = new ByteArrayInputStream(Base64Coder.decodeLines(base64))) {
      final BukkitObjectInputStream dataInput = new BukkitObjectInputStream(inputStream);
      final ItemStack itemStack = (ItemStack) dataInput.readObject();
      dataInput.close();
      return itemStack;
    } catch (final IOException | ClassNotFoundException e) {
      e.printStackTrace();
      return null;
    }
  }
wraith rapids
#

do they handle data versioning properly

#

i've had issues with spigot's itemstack serializers exploding over version upgrades

#

especially the configuration serialization

lost matrix
quaint mantle
#

intellij or eclipse

wraith rapids
#

vim

quaint mantle
#

which one should i download

#

used to use eclipse

ivory sleet
#

Doesn’t matter but I use IntelliJ

wraith rapids
#

vim and javac

lost matrix
quaint mantle
lost matrix
#

"glorified text editors like Eclipse" lol

quiet ice
#

It's made by someone on here, so I can confirm that it works nicely

quaint mantle
#

im sticking to eclipse

wraith rapids
#

you'll get more help for intellij

#

and also more useless eyecandy

quaint mantle
#

eh

minor garnet
#

has a item stack defined the quantity?

quaint mantle
#

ok ill get intelij

ivory sleet
#

ItemStack has an amount property if that’s what u mean vinny

minor garnet
#

okay

quiet ice
#

I haven't seen many people asking for IntelliJ help

#

So I cannot really give numbers on whether you'll actually get more help, because I'd debate that

quaint mantle
#

is there an efficient way to get the total amount of players on the network from bungeecord to a spigot server

wraith rapids
#

more people use ij so you're more likely to get help with it

quiet ice
#

Probs with plugin messages

quaint mantle
#

did that

#

apparently caused lag

wraith rapids
#

it usually takes eclipse people a while before anyone who uses eclipse comes around

quiet ice
#

Then maybe do it less frequently

quaint mantle
#

because the people who use eclipse are the more intelligent ones actually doing the coding instead of needing help 😎

quiet ice
#

There are quite a few using eclipse

dense goblet
ivory sleet
#

Wat lol

quiet ice
#

In general few people ask for IDE-specific help

#

Except when where I'm the only one answering, at which point it always has to be people asking for intelliJ help, but it's biased

wraith rapids
#

most of the time the ide specific questions are "how to maven"

quaint mantle
#

i have to wake up for school in about 4 hours

#

what am i doing

wraith rapids
#

school is for plebians

quaint mantle
#

true that

#

wraith rapids
#

real men learn the nature of the universe through meditation and contemplation

lost matrix
final fog
#

How do I do command arguments with an OfflinePlayer?

wraith rapids
#

become the unmoved mover of your life

quaint mantle
#

cant wait for next year when i get eligible for computer programming classes

#

they do python

#

and some c++

quiet ice
#

So nothing

quaint mantle
#

yeah

#

c++ is ok

#

similar to java

quiet ice
#

C++ is complicated

quaint mantle
#

indeed it is

quiet ice
#

Well, G++ is, but you'd need it

paper viper
#

C++ is not similar to Java when you get into the details

#

lol

lost matrix
quaint mantle
#

yeah but the basics

#

i havent used c++ too much

#
    public void onPlayerHit(EntityDamageByEntityEvent e) {
        if (e.getEntity() instanceof Player) {
            Entity p = e.getEntity();
            new BukkitRunnable() {
                public void run() {
                    p.setVelocity(e.getDamager().getLocation().getDirection().multiply(getConfig().getDouble("knockback-of-players")));
                }
            }.runTaskLater(this, Knockback.getInstance().getConfig().getInt("delay-of-kb-players") * 20L);
        } else if (e.getEntity() != null) {
            Entity p = e.getEntity();
            new BukkitRunnable() {
                public void run() {
                    p.setVelocity(e.getDamager().getLocation().getDirection().multiply(getConfig().getDouble("knockback-of-mobs")));
                }
            }.runTaskLater(this, Knockback.getInstance().getConfig().getInt("delay-of-kb-mobs") * 20L);
        }
    }```
This is my code for delaying a custom amount of knockback, but when the hits are  delayed the knkockback  hit happens AFTER the regular hit. (this is only when the person has it enabled in config) I need to get it so it cancels the regular knockback and implemetns the new delay i have set anyone know any methods for this
paper viper
#

be prepared to call destroy everytime you declare new

#

there is no gc

#

lol

dense goblet
#

is there a way to replicate this without making it an actual autocomplete entry (i.e. pressing tab shouldn't fill in the argument name) https://i.imgur.com/D48N0iE.png

lost matrix
brittle nova
#
                        positionIsCurrentPosition = true;
                    }
                    else {
                        positionIsCurrentPosition = false;
                    }``` Why it is false although one of the location is similar to location?
quaint mantle
#

pointers confused me

lost matrix
#

malloc

paper viper
#

you cant fuck up the pointers tho

quaint mantle
#

the & and * stuff

paper viper
#

cause memory corruption lol

sinful python
#

If I want to make sure a potion be a specific type of potion (ex: fire resistance), do I use I use the addAttributeModifier method for that?

quaint mantle
#

@brittle nova

paper viper
#

but yes, yeah pointers is a big thing in C++

quaint mantle
#

do .equals

#

dont do ===

brittle nova
#

ok

quiet ice
#

Doesn't C++ destroy everything that goes out of scope?

lost matrix
quaint mantle
#

.equals compares the actual data in the class

paper viper
#

Java: int[][]
C++: **int

quaint mantle
#

== compares if the classes are the same

ivory sleet
#

Instances*

quaint mantle
#

yeah

paper viper
#

more specifically, a memory reference

dense goblet
#

it is such a relief using Java again after using mostly C for uni

wraith rapids
#

no

#

equals does not compare the data in the class

#

it may or may not compare the data in the object

dense goblet
#

still some things I miss from C# (structs, out keyword) but Java has a lot of cool stuff that C# doesn't as I'm beginning to find out

wraith rapids
#

== does not compare the classes

#

it compares the object identity

quaint mantle
#

the instance

wraith rapids
#

a == b is true if and only if a is b

paper viper
#

.equals ONLY compares the data if it is overriden with that intent of comparing data

quaint mantle
#

yea

#

which it is in Location right

paper viper
#

I think?

wraith rapids
#

yes, location overrides equals

quaint mantle
#

yeah should b

wraith rapids
#

it checks not only the location but also the direction

final fog
lost matrix
quaint mantle
#

ok goodnight guys

wraith rapids
#

getOfflinePlayer and call hasPlayedBefore to make sure the player actually exists

#

or something

#

alternatively, call mojang

final fog
#

getOfflinePlayer is deprecated

wraith rapids
#

bukkit deprecations aren't deprecations

#

you can still use them

#

just make sure to read the deprecation message

final fog
#

alr ig ill usse it

wraith rapids
#

and see if there is something more suitable

ivory sleet
#

I think the getOfflinePlayer(String) is deprecated right? That’s because it might make a request to mojang iirc

final fog
#

It is

wraith rapids
#

Deprecated.
Persistent storage of users should be by UUID as names are no longer unique past a single session.

#

this basically just means that you can't fetch offline players reliably by name anymore

#

without calling mojang

ivory sleet
#

I think there’s a better description in the paper javadocs

wraith rapids
#

this is from paper javadocs

ivory sleet
#

Oh

#

Nvm

wraith rapids
#

like, yeah, this will not give 100% accurate results if players change their usernames while they're offline

#

but the only way around that is to ring a call to mojang's api

#

which is probably excessive for what you want

ivory sleet
#

Hmm ye

wraith rapids
#

looks like the method might call mojang and do that for you actually

#

which means that it's going to blockeroni and you probably don't want to do it on the main thread

dense goblet
#

does 1.16 spigot support custom TileEntities or would I have to store and manage them manually (using ChunkEvents and some database)?

ivory sleet
#

Yeah wait did mojang ever use names as their primary key :0

wraith rapids
#

spigot doesn't support custom anything really

#

or, well, bukkit doesn't

#

i mean, yes, it ""supports"" custom entity types and shit but it's pretty lousy

#

we don't even have custom biome support yet even though they've been a thing on mojang's end for like years

dense goblet
#

ahhh unfortunate

wraith rapids
#

like, you might be able to hack it together with nms

#

but it won't be fun

dense goblet
#

I think its better to try use my own system alongside vanilla rather than trying to hook into vanilla when its unsupported

wraith rapids
#

if you're on paper, they have a chunk based PDC which probably does mostly what you want

dense goblet
#

not on paper but that sounds really good

wraith rapids
#

you'll still have to have like 20 million listeners trying to track when blocks break and shit, but at least you don't need to worry about an external db

dense goblet
#

I wanna keep my plugin on spigot if possible since you can use spigot plugins on paper but not vice-versa

#

prob should look at source code for some world protection plugins

wraith rapids
#

a nice thought i suppose but paper people probably won't like your plugin because it can't take advantage of their api

quaint mantle
#
    public void onPlayerHit(EntityDamageByEntityEvent e) {
        if (e.getEntity() instanceof Player) {
            Entity p = e.getEntity();
            new BukkitRunnable() {
                public void run() {
                    p.setVelocity(e.getDamager().getLocation().getDirection().multiply(getConfig().getDouble("knockback-of-players")));
                }
            }.runTaskLater(this, Knockback.getInstance().getConfig().getInt("delay-of-kb-players") * 20L);
        } else if (e.getEntity() != null) {
            Entity p = e.getEntity();
            new BukkitRunnable() {
                public void run() {
                    p.setVelocity(e.getDamager().getLocation().getDirection().multiply(getConfig().getDouble("knockback-of-mobs")));
                }
            }.runTaskLater(this, Knockback.getInstance().getConfig().getInt("delay-of-kb-mobs") * 20L);
        }
    }```
This is my code for delaying a custom amount of knockback, but when the hits are  delayed the knkockback  hit happens AFTER the regular hit. (this is only when the person has it enabled in config) I need to get it so it cancels the regular knockback and implemetns the new delay i have set anyone know any methods for this
wraith rapids
#

so while it does run on paper, it runs in a subpar fashion and people probably want to look for a paper-specific alternative

dense goblet
#

its mostly a plugin for myself anyway

ivory sleet
#

Then use paper if you want?

wraith rapids
#

no reason not to use paper by this point tbh

#

afaik, the leading cause of spigot usage is not knowing that paper exists

dense goblet
#

im down to use paper ofc but if I want to use this framework later on for something public it will not be usable on spigot

wraith rapids
#

why would you eat next to a clown when you can dine with a king

dense goblet
#

it is very enticing though

paper viper
#

you should use spigot for the compatability only

dense goblet
#

is there a way to use Forge 1.16 mods alongside Paper?

paper viper
#

but even so, the spigot api is still not a bad api

paper viper
#

Mohist

wraith rapids
#

there are some forge bukkit hybrids out there

#

but they are not very stable

paper viper
#

they won't work very well always

wraith rapids
#

and tend to die every 2 months

paper viper
#

there is a 99% chance that they wont work with plugins using NMS

#

or protocallib

wraith rapids
#

or they might just self combust

dense goblet
#

Forge is built of sticks and ego so not surprised it is buggy as shit

paper viper
#

No, forge itself isnt buggy

wraith rapids
#

forge alone is fine

paper viper
#

the hybrid is

wraith rapids
#

bukkit alone is fine

#

forge bukkit hybrid is like trying to merge a cow with a chicken

paper viper
#

Forge is not buggy at all, and probably infinitely better than server apis at some degree

dense goblet
#

Forge itself on the inside is really bad though. Maybe not buggy, but a huge mess

wraith rapids
#

you don't know whether it's eggs or milk that's going to come out of it and either way it won't be pleasant

dense goblet
#

Spigot seems a lot more clean

paper viper
#

Because it is less complex?

wraith rapids
#

debatable

paper viper
#

lmao

#

and that too

dense goblet
#

yes that contributes to it lol

wraith rapids
#

bukkit is pretty crummy at some parts

paper viper
#

You realize how complex it is to write a mod loader

#

and make it decent

#

LexManos and other devs spent a lot of time on Forge

wraith rapids
#

shit like material enum and the infinitely wise decisions of using bytecode fucknuggetry for legacy compat don't help

dense goblet
#

not saying I could do it better lol

paper viper
#

That is a big severe doubt lmao

#

creating your own mod loader

#

with only 1 dude

dense goblet
#

you misread what I said I think

paper viper
#

oh

dense goblet
#

xd

paper viper
#

Yeah i misread lmao

dense goblet
#

but my point is, yeah it does a very impressive amount of work, but nevertheless working with it is not pleasant

#

also some of the forge devs seem very toxic (look at their forums)

wraith rapids
#

being toxic is just a sign of being a man

#

a real man

paper viper
#

They are toxic because they've been through a lot

dense goblet
#

fabric looking very promising though and more mods are switching over

lost depot
wraith rapids
#

well, it says legacy on the tin

lost depot
#

yeah, but it worked for me in the past with the same url

wraith rapids
#

legacy stuff tends to expire

ivory sleet
lost depot
#

well, if it really is outdated, does anyone know of an alternative way?

dense goblet
#

most fabric mods follow that mentality too

ivory sleet
#

Why not just have the api shaded in?

wraith rapids
#

muh jar size

ivory sleet
#

Feels like most fabric mods are using the api anyways so wouldn’t be weird decision to shade it in or do I miss something here

dense goblet
#

might make compat easier

#

like layers of abstraction in any area of computing