#help-development

1 messages Β· Page 129 of 1

tender shard
#

a "normal" ground-placed head should be Directional

#

but a wall one isnt

grave plover
#

do I do something wrong?

tender shard
grave plover
#

it even crashes without the //

fervent gate
tender shard
#

then I also don't know πŸ˜„

tardy delta
#

mwoa not too difficulthttps://github.com/FourteenBrush/MathExpressionParser/blob/master/src/main/java/me/fourteendoggo/mathexpressionparser/TokenList.java

grave plover
tender shard
#

try Rotatable instead of Directional @fervent gate

#

I'm quite sure that that one should work

fervent gate
#

I'll try thanks

tender shard
#

Rotatable is for stuff like signs, which has 16 directions instead of only 4 ones

tender shard
#

if so, send it pls

#

?paste

undone axleBOT
grave plover
#

no exception, so far

rancid elm
#

someone help me with setting a world border?

hybrid spoke
rancid elm
tardy delta
#

calculateAndClear method kinda a mess rn, made it yesterday in a first try

tender shard
rancid elm
#

the red line is the Border

tender shard
#

idk then

tardy delta
grave plover
# tender shard idk then

or do I have to enter the coords in another way, like not the normal coords but directly a chunk coord?

rancid elm
hybrid spoke
heavy swan
#

Friends someone of you has an example of this, is that I made an item with the ItemStack method with lore, attributes, etc. what I want is that when I have or anyone has the item in the inventory and I modify it for example by changing the This lore will be updated in the player's inventory without having to have the item again?

hybrid spoke
tender shard
#

getBlockAt takes "normal" coordinates. getChunkAt takes chunk coordinates, e.g. X = X / 16, etc

fervent gate
#

That doesn't seem to work, they're currently facing north when they should be facing east

grave plover
#

i do getchunkat

rancid elm
#

I need the red lines to match up exactly with the map and I'm too dumb to know how

tender shard
#

oh then you have to / 16

#

not * 16

grave plover
#

so as i expected

heavy swan
#

Friends someone of you has an example of this, is that I made an item with the ItemStack method with lore, attributes, etc. what I want is that when I have or anyone has the item in the inventory and I modify it for example by changing the This lore will be updated in the player's inventory without having to have the item again?

fervent gate
dire bluff
#

can someone help me in herlp-server

grave plover
#

@tender shard btw now, everything works fine

hasty prawn
#

I could fix it but that requires effort

tardy delta
#

i'm just negating the internal value of my Operand class

#

hmm would be confusing to people ig

hasty prawn
tardy delta
#

seem to have some bugs lol

hasty prawn
#

Wonder if that works for me

tardy delta
#

time to write more unittests

hasty prawn
#

that's probably right KEKW

tardy delta
#

smh

hasty prawn
#

Do you want me to send mine?

tardy delta
#

ah ig i know why

#

my default double value of the operand is Double.POSITIVE_INFINITY

#

cuz the number is that big, it assumes that no value has been set or whatever

#

ig

#

hmm sure

#

back to using Double.NaN as default then πŸ₯Ί

tender shard
#

just use -9

tardy delta
#

then someone enters -9 and it assumes nothing has been entered lol

hasty prawn
#

There's a LOT that can be done with that, I just wanted to make it as a proof of concept I guess

tardy delta
#

hehe me creating doubles char by char

fervent gate
tender shard
#

why does noone of you use binary trees for this math stuff 😒

#

it's so easy with binary trees

hasty prawn
#

I mean my way aint really that hard either lol

tender shard
#
    *
   / \
  +   7
 / \
5   2
hasty prawn
#

Once it's in RPN notation it's braindead simple to calculate

#

Do we need to have a competition for who can solve this problem in the shortest/most efficient way? KEKW

tender shard
#

please lets not do it haha

#

I would lose

hasty prawn
#

Oh same

#

Someone like Redempt would come in here and pick us up, walk us to the shredder, put us in and then throw us away

tender shard
#

huuuuh not sure about that

tardy delta
#

what the

tender shard
#

probbaly some random person noone of us ever talked to before would win lmao

tardy delta
#

never used binary trees lol

hybrid spoke
#
>>> 3123*3+4/1%3
9370

dankfingers

tardy delta
#

3123 + 1 lmao

hasty prawn
#

Did mine do that or what

tardy delta
#

i clearly broke smth

hybrid spoke
#

im using scriptengine

tardy delta
#

ig it doesnt clear its state

hasty prawn
#

Ah

#

Mine says 9370 HYPERS

hybrid spoke
#

basically

        ScriptEngineManager manager = new ScriptEngineManager();
        ScriptEngine engine = manager.getEngineByName("JavaScript");

        Scanner scanner = new Scanner(System.in);
        while (true) {
            System.out.print(">>> ");
            String input = scanner.nextLine();
            try {
                Object result = engine.eval(input);
                System.out.println(result);
            } catch (Exception e) {
                System.out.println(e.getMessage());
            }
        }
hasty prawn
#

Right yeah

tender shard
#

I just insulted my bf on whatsapp and now he's upset lol

tardy delta
#

probably slow asf

tender shard
#

there is "Javascript" engine anymore

#

no*

#

damn

#

there is NO javascript engine anymore builtin

#

(at least there isnt on adopt-openjdk 17)

hybrid spoke
hybrid spoke
tardy delta
#

ah for some reason my code ignores operators now lol

tender shard
#

wtf my IJ is broken

tardy delta
tender shard
hybrid spoke
#

cant update at work

#

sucks

hasty prawn
tender shard
tardy delta
#

:/

tender shard
#

on java 17 it definitely doesnt work

tender shard
glossy venture
opal juniper
glossy venture
#

last year i tried making an expression parser using a while(i < str.length()) and switching chars it did not go well

hasty prawn
#

So a software developer

tender shard
glossy venture
opal juniper
#

😎

tender shard
#

sorry but it's just not my kind of music

silent wave
odd wedge
glossy venture
#

for fun

tardy delta
#

stdin

glossy venture
odd wedge
#

Just kidding

glossy venture
#

oh

tender shard
#

also update your fn intelliJ

glossy venture
#

lmao

tardy delta
#

nah java lol

odd wedge
#

You should add a graph calculator

tender shard
#

erm

#

Imeant

glossy venture
tender shard
#

whatever it is

#

but update it

glossy venture
tardy delta
#

your code looks hot lol

#

stringlocation sounds very professional

glossy venture
#

😎 very profiessionaal

tardy delta
#

fn, str

#

dang rust

glossy venture
#

filename

#

fn

#

very unclear

tardy delta
#

smh

glossy venture
#

but whatever

tardy delta
#

the hell is ln

glossy venture
#

it says it runs at 60 fps

#

but its stuttering

tardy delta
#

javafx aaaaaaaa

glossy venture
#

no swing lmao

#

but i used the canvas

#

from awt

tardy delta
#

idk

glossy venture
#

so its nice

tardy delta
#

never used smth graphical in java

#

only c#

glossy venture
#

recommended

#

but swing canvas is easy when u need to draw simple shit

#

and it has a nice double buffer thing and the Graphics2D object makes it really easy to draw simple shit

tardy delta
#

:o

glossy venture
#

bruh it broke

#

now the text is off screen

tardy delta
#

i fucked something up too

glossy venture
#

string parsing is so fragile if you forget to skip one character it fucks up everything

zealous osprey
glossy venture
#

it accepts multi letter identifiers so yeah cant really do anything about that

#

at least i wont be able to make it parse ax like a * x because it would be parsed as Identifier: ax

tardy delta
#

ah fuck fucked up my code while debugging

#

fixed it

hybrid spoke
tardy delta
#

lmfaoo

#

ah lmao super calls chain eo

#

getValue calls isBlank in superclass which calls getValue :/

#

fun thing

glossy venture
#

lmao

tardy delta
#

lets just comment out validation

glossy venture
#

i did like

class Context {
  static Context newContext {
    Context ctx = new Context();
    return ctx.setGlobal(ctx);
  }
  public Value getValue() {
    return global.getValue(...);
  }
}
``` and spent quite a bit trying to figure out why it was fucking the stack
tardy delta
#

i believe precision fucked up this time

#

cuz its notated as e36

glossy venture
#

isnt that like 36 zeros

tardy delta
#

i believe those 1's gets chopped off or whatever

glossy venture
#

oh yeah

#

doubles have some precision shit

#

i think

tardy delta
#

1.11..e36 + 1 chops those 1s off

#

wondering where my 2 is then

glossy venture
#

lmao

tardy delta
#

ah wait no its 2 at the end

glossy venture
#

where 2

tardy delta
#

1.11111...2e36 or whatever

glossy venture
#

ah

tardy delta
#

and i thought i could handle it

#

and now suddenly theres a 7 :/

glossy venture
#

lmao what

tardy delta
#

i should probably be making an BigOperand class which holds a bigdecimal inside

glossy venture
#

didnt u already have one

#

or does it not do anything

#

rn

tardy delta
#

uhh tried covering Double.POSITIVE_INFINITY but just realized that doesnt make sense at all

#

otherwise it gave a result of Infinity but now it gives some random big number lol

tardy delta
#

how is this even possible for java to interpret such big numbers? im just doing my value *= 10 and value += new int

fluid river
#

You should try informatics class in university)

tardy delta
#

?

fluid river
#

probably would get direct answer to how is this even possible for java to interpret such big numbers?

tender shard
#

big numbers are no problem, you just lower the precision

#

I mean

fluid river
#

can't C# and C++ intepret it the same way?

tender shard
#

1000 / 10 is no different to 100 / 1

#

and stuff

fluid river
#

like a calculator with E

tender shard
#

exactly

glossy venture
#

yeah

#

IEEE754 its smart

fluid river
#

Not realy

#

I fucking hate doing IEEE754 calculations in a textbook

#

Bro take number

glossy venture
#

if we had 128 bit numbers fixed point would be better

fluid river
#

bro 2 system number

#

Bro direct code reverse code

glossy venture
#

but we dont

tender shard
#

beloved bc ❀️

fluid river
#

idk how is it on english

#

just trying refresh what i had in informatics class

#

Were studying history of IEEE754 problems

tardy delta
#

do floats have a higher precision in comparson with doubles?

tender shard
#

ofc not

tender shard
#

doubles are "twice as precise"

fluid river
#

double has more precision

tender shard
#

doubles are 8 bit, floats are only 4

tardy delta
#

only 8 πŸ‘‰πŸ‘ˆ

glossy venture
#

does BigInteger use a string to represent itself?

tardy delta
#

some scaled value iirc

fluid river
#

Every class has toString(), so probably yes)

hazy parrot
#

isn't double 64 bits ?

glossy venture
#

yeah

#

64 bit float

fluid river
#

64 bits = 8 bytes so

tender shard
#

oh yeah sorry

#

I meant 8 bytes, not 8 bit

tardy delta
#

thats what i thought

glossy venture
#

booleans are never stored as 1 bit tho

tender shard
glossy venture
#

maybe in a struct bit field in C++

hybrid spoke
tender shard
tardy delta
#

why wouldnt booleans be 1 bit?

tender shard
#

ofc bools only take up 1 bit, but the reference itself takes more space πŸ˜„

glossy venture
#

no

#

the memory of a computer is byte aligned

tardy delta
#

reference to boolean?

glossy venture
#

it would be inefficient to query single bits

tardy delta
#

o

glossy venture
#

so a boolean is stored as a byte

#

0 or 1

tender shard
#

that's not always true, e.g. just look at an ESP8266

glossy venture
#

thats a wifi chip

tender shard
#

it's a normal computer

tardy delta
#

lmfao

glossy venture
#

and im sure its not always true, but generally it is

tender shard
#

it's a computer that also happens to have wifi

glossy venture
tender shard
glossy venture
#

its a wifi chip with microcontroller capablities

tender shard
#

that's bullshit tbh though

glossy venture
#

what

glossy venture
tender shard
#

it is a normal microchip and it also has wifi builtin

#

how would that make it any different to a normal computer that you have next to your desktop

glossy venture
#

i dont think its intended for 'heavy' computing

#

heavy for microcontrollers

tender shard
#

you can get an ESP for like 4€

#

but yeah you are totally right, a normal computer wouldn't care about "is this one byte or one bit"

tardy delta
#

anyone into creating more invalid expressions lol?

hybrid spoke
tender shard
#

1 / 0

#

asd

tardy delta
#

0/0 return NaN for some reason

#

lol

tender shard
#

what about "asd"?

tardy delta
#

1/0 Infinity lol

glass mauve
#

im back, how can I retrieve the pdc of a block? can I just use the constructor again?

tender shard
#

yes

glass mauve
#

ok ty

tender shard
#

you can store the CustomBlockData object, or create a new one. both will work

glass mauve
#

ok ty

#

why is there no boolean PersistentDataType?

#

am I blind?

#

is there a reason?

hasty prawn
#

Use integer with 0 and 1

tardy delta
#

use Byte with (byte) 1

#

ha

hasty prawn
#

Or that

glass mauve
#

bruh xD

hasty prawn
#

But yeah there's no boolean afaik lol

tardy delta
#

imagine storing too much bits

#

there isnt one :}

hasty prawn
#

imagine not having an expression calculator PepeLaugh

glass mauve
#

ty

tardy delta
#

i have one so

hasty prawn
#

that works consistently*

tardy delta
#

shut

hasty prawn
#

Lol sorry

tardy delta
#

🌝

#

lmfao

hasty prawn
#

I made one in an hour yes

glossy venture
#

lmao

hasty prawn
#

It's extremely primitive but it works KEKW

glossy venture
#

does it use an AST

tardy delta
#

a what

glossy venture
#

abstract syntax tree

hasty prawn
#

No

tardy delta
#

lol no idea what that is

hasty prawn
#

It uses RPN notation

tardy delta
#

mine just parses each char and decides what token to add ;

hasty prawn
#

Mine kinda works like that yeah

glossy venture
#

where

6 * 4 + 8
``` turns into
 AddNode
/       \

MulNode 8
/
6 4

#

this is how you implement shit like operator priority

hasty prawn
#

Ah, the binary tree alex mentioned earlier.

glossy venture
#

yeah

hasty prawn
#

I think RPN notation is probably based on that

glossy venture
#

whats rpn

tardy delta
hasty prawn
#

Reverse Polish notation, it's a way to write expressions that can easily be computed

glossy venture
#

ah

hasty prawn
#

For example, 1 + 1 becomes 1 1 +

glossy venture
#

yeah

hasty prawn
#

And then it uses a stack to pretty easily calculate it

tardy delta
#

so you have a values and operators stack?

glossy venture
#

then you can just use a stack and a string character reader

hasty prawn
#

This is the calculation code

glossy venture
#

but ast is very nice for stuff like functions

tardy delta
#

made my own operator enum

hasty prawn
glossy venture
hasty prawn
#

Oh

#

That's pretty cool

glossy venture
#

though you do need all this shit

tardy delta
#

lul

hot panther
#

Does anyone know of a tutorial/help for a permissions plugin with groups and a MySQL database?

hasty prawn
#

Yeah mine is 3 classes and they're all short LOL

glossy venture
#

the evaluation and parsing is surprisingly fast tho

tardy delta
#

mine is 10 classes :kekw:

#

and benchmark and unit tests

flint coyote
# hot panther Does anyone know of a tutorial/help for a permissions plugin with groups and a M...

I mean you can basically use any MySQL Database Tutorial as long as you have a basic understanding of relational database models.
And for the permission plugin there's that: https://bukkit.fandom.com/wiki/Developing_a_permissions_plugin

BukkitWiki

This tutorial will guide you through how to create your own permissions plugin that sets permissions using the new Bukkit permissions API. This tutorial assumes you have a good understanding of the Java language, and general plugin development. This tutorial will only cover the specifics of the Bukkit permissions API. Everything that can have pe...

tardy delta
#

altho i have no idea what im doing with that benchmark

remote swallow
glossy venture
# glossy venture the evaluation and parsing is surprisingly fast tho
+- ExprParsing: 1000000 Passes (MAX)  | Total Time: 862747900ns (862ms) | Avg. time/pass: 862.7479ns (8.627479E-4ms)
+- ExprParsingAndExec: 1000000 Passes (MAX)  | Total Time: 1068550500ns (1068ms) | Avg. time/pass: 1068.5505ns (0.0010685505ms)
+- ExprExec: 1000000 Passes (MAX)  | Total Time: 184482300ns (184ms) | Avg. time/pass: 184.4823ns (1.8448230000000002E-4ms)

for expression

test(x * 9 + 1) ^ (7 - 5)
tardy delta
#

calculating time with system.nanos?

glossy venture
#

System.nanoTime()

#

yeah

tardy delta
#

did that too and then the jit decided to optimize stuff :/

glossy venture
#

what do you use

tardy delta
#

same

glossy venture
tardy delta
glossy venture
#

this is the benchmark utility i made

#

benchmark itself

#

one of them

tardy delta
#

i have no idea what im doing wih my benchmark

glossy venture
#

random is prob gonna slow down your time

#

pregenerate the values

#

an array of strings

tardy delta
#

mye idk

glossy venture
#

yeah wouldve been better

flint coyote
#

My expression parser is messed up. But atleast I can solve stuff like this (8=9&8*3333=2&(2<5|7%1123>10|!F|(!T|(!F|!(!F|!F&!T)))))

#

(result is false)

tardy delta
#

jmh generated some stuff lol

flint coyote
#

Or this 3333≀9^9%2>7^10≀3333|3333*1123<8|(7≀8&6%11≀6^(5<1123&5434%9≀7|F&!T))

tardy delta
#

tf

flint coyote
#

I needed a parser for if expressions

glossy venture
#

operators

flint coyote
#

both

glossy venture
#

|

#

is bitwise

viscid wharf
#

any way to modify the display and lore of ItemTag(Item HoverEvent)?
I tried to use JsonParser and ItemTag.ofNbt(jsonElement.toString())
But Gson will break some type of formats like uuid, enchantment level.

flint coyote
#

I just made it with single characters because it was easier

#

but I'm not doing it bitwise

glossy venture
#

true

#

ah

flint coyote
#

needed something for configurable ifs

#

"=", "β‰ ", ">", "<", "≀", "≀","!", "&", "|", "^","T","F","(",")"
are supported tokens

hasty prawn
#

If I put <= does it say its invalid

flint coyote
#

it replaces it before evaluation

hasty prawn
#

ok good

glossy venture
#

what are T and F

hasty prawn
#

true false

glossy venture
#

ah

flint coyote
#

ye. Also gets replaced

tardy delta
glossy venture
#

lmao

tardy delta
flint coyote
#

true=T false=F

#

so true will be replaced by T

hasty prawn
#

I'm sure the boolean algebra you had to do behind the scenes for that was so fun

flint coyote
#

Brackets were the worst

hasty prawn
#

They always are

tardy delta
#

still have to implement brackets

hasty prawn
#

Although I guess technically you can handle brackets recursively.

tardy delta
#

mye

glossy venture
tardy delta
#

whats an ast again lol

glossy venture
#

abstract syntax tree

#

tree of nodes

#

with for example a left and right

tardy delta
#

i have a linkedlist rn

#

lol

glossy venture
#

for tokens and then you parse those into an ast

tardy delta
#

and whats left and right?

hasty prawn
glossy venture
#

nah shes too big for the heap to handle

tender shard
#

damn

tardy delta
#

she thicc

glossy venture
#

and then to evaluate one, you have to evaluate its children

tardy delta
#

lol

glossy venture
#

and then it goes on until you get to constant or whatever

#

output from my parser:

+-> (5 + 6) * (8 + 1)
| ? SOURCE: | (5 + 6) * (8 + 1)
| ? TOKENS: | [tkLEFT_PARENTHESIS, tkNUMBER_LITERAL: 5.0, tkOPERATOR: PLUS, tkNUMBER_LITERAL: 6.0, tkRIGHT_PARENTHESIS, tkOPERATOR: MULTIPLY, tkLEFT_PARENTHESIS, tkNUMBER_LITERAL: 8.0, tkOPERATOR: PLUS, tkNUMBER_LITERAL: 1.0, tkRIGHT_PARENTHESIS]
| ? AST:    | BinOpNode: (BinOpNode: (ConstantNode: 5.0)+(ConstantNode: 6.0))*(BinOpNode: (ConstantNode: 8.0)+(ConstantNode: 1.0))
|   3818600 ns (3 ms)
| = 99.0
desert frigate
glossy venture
#

oh wait nvm

tender shard
glossy venture
#

like sin cos shit

hasty prawn
glossy venture
#

yeah

hasty prawn
#

So I guess technically I am using AST

#

kinda

glossy venture
tender shard
#

you can do something like this:

Vector vec1 = entity1.getLocation().toVector();
Vector vec2 = entity2.getLocation().toVector();
Vector difference = vec2.substract(vector1).normalize();
hasty prawn
glossy venture
#

yeah

hasty prawn
glossy venture
#

then ur parsing it

#

into ast

#

nice

hasty prawn
#

Yep

tender shard
glossy venture
#

concerting

hasty prawn
#

u r not very nice.

tender shard
#

I just couldnt resist

glossy venture
#

he claims hes drunk

hasty prawn
#

He probably is

glossy venture
#

last time he was we went into papermc discord and started spamming your mom jokes

hasty prawn
#

I guess your mom jokes are his tell

tender shard
#

yeah and then I had a discussion with amaranth about copyright, then I sent a soundcloud link and got banned there

glossy venture
#

lmao wjat

tender shard
#

thank god people here aren't overly sensitive πŸ˜„

hasty prawn
#

You got banned for sending a soundcloud link?

#

what lol

tender shard
#

I have to admit that it was a song with a quite NSFW title

hasty prawn
#

ah

hasty prawn
#

LMAO

glossy venture
#

lmfao

tender shard
#

I made this a few years ago when I was actually in that situation

glossy venture
#

lmaooo

tender shard
#

and then I didnt realize that paper is full of 12 year olds

hasty prawn
#

Is Soundcloud down wtf?

tender shard
#

no

#

working fine for me

glossy venture
#

guys thats offensive u cant send that guys

hasty prawn
tender shard
hasty prawn
#

It doesn't like Firefox I guess, worked on Chrome.

glossy venture
#

still

tender shard
#

haha soundcloud treanslations are a joke

glossy venture
#

embed fail

tender shard
#

it's meant to say "share" but it says "get rid of it"

glossy venture
#

i dont understand shit

hasty prawn
#

LOL

glossy venture
#

of the lyrics

flint coyote
#

I will also have to recode my parser. Currently it's pure chaos :( It does work tho. And I just wanted to test whether I'm able to do it

tender shard
glossy venture
#

whos le crochet

tender shard
#

me

glossy venture
#

lmao

tender shard
#

I am Le Crochet & mfnalex

glossy venture
#

sounds like a collab channel

tender shard
glossy venture
#

so you have 3 names: Jeff media, mfnalex and Le Crochet

#

and whats ur actual name

tender shard
#

that's only some of my names, but yeah

#

Alexander Christian Majka

glossy venture
#

ok so mfnalex is closest

tender shard
#

yep

#

"mfn" is my old counterstrike clan

flint coyote
#
    private static int[] getMostInnerExpressionBounds(String expression, int addToStart) {
        int nextOpeningBracket = expression.indexOf("(");
        if (nextOpeningBracket != -1)
            return getMostInnerExpressionBounds(expression.substring(nextOpeningBracket + 1), addToStart + nextOpeningBracket + 1);

        int nextClosingBracket = expression.indexOf(")");
        if (nextClosingBracket != -1) {
            return new int[]{addToStart, addToStart + nextClosingBracket};
        }
        return new int[]{addToStart, addToStart + expression.length()};
    }

definitly not a clean solution

tender shard
glossy venture
tender shard
#

but maybe we already had a different name back then

#

I really do not remember

peak wharf
#

Hi, I need to get a custom head, an idea of how to do ( Without the player’s name but with an ID)? I googled it, but I couldn’t find it in 1.17

tender shard
desert frigate
#

lemme show my current code

tender shard
desert frigate
#
Location start = player.getLocation();
        Vector direction = player.getEyeLocation().getDirection();
        for(double i = 0;i<10; i+=0.5) {
            direction.multiply(i);
            start.add(direction);
            player.getWorld().spawnParticle(Particle.DRIP_LAVA,start,10);
            start.subtract(direction);
            direction.normalize();
        }```
desert frigate
tender shard
charred blaze
#

Can someone help me? I just downloaded intelij idea and when I click on it it's not doing anything

tender shard
#

eg this

tender shard
#

sounds weird, but fixes 99% of problems lol

desert frigate
tender shard
#

yes

desert frigate
#

ty

charred blaze
tender shard
#

np

charred blaze
#

when i restart it

#

its not turning on

desert frigate
charred blaze
#

and needs time to

#

do it

tender shard
#

because your math is fucked up

#

you substract the "looking at" vector from the actual location

#

this can't possibly work

#

it seems like you don't really know what a vector actually is

charred blaze
#

wait what

peak wharf
tender shard
#

you can ignore those annotations and just remove them

#

they dont really do anything

#

they are there to clarify stuff

#

e.g. like @Override in onEnable()

flint coyote
#

They do cause warnings tho :p

tender shard
#

yeah that's what I meant with "clarifying things" πŸ™‚

#

but yeah they are useless when just copy/pasting someone else's stuff

flint coyote
#

Clarify things sounds more like documentation

desert frigate
#

I've read docs on vectors

peak wharf
#

hmm...

desert frigate
#

But geometry kills me

tender shard
# desert frigate yeah-

a Vector is nothing more than a class that holds a location and direction. You can turn it into "only a direction" by substracting the actual location from it, and normalizing it. Basically a Vector is nothing else than just "x,y,z,pitch,yaw"

#

To get the "direction" between Vec A and Vec B, you just substract A from B

desert frigate
#

Vector(int,int,int)

tender shard
#

they will just be 0 then

#

but since both are 0, you can ignore those parts anyway

peak wharf
desert frigate
#

oh I see

tardy delta
#

add dependency

tender shard
#

you probably "only" use spigot-api

peak wharf
tardy delta
#

yes

midnight shore
#

Hi everyone, could anyone help me understaning whats wrong here? Data is a list of <MapValues> which contains two values, a key and a value

#

Caused by: java.lang.UnsupportedOperationException

tender shard
#
        <repository>
            <id>minecraft-libraries</id>
            <url>https://libraries.minecraft.net</url>
        </repository>
#
        <dependency>
            <groupId>com.mojang</groupId>
            <artifactId>authlib</artifactId>
            <version>3.2.38</version>
            <scope>provided</scope>
        </dependency>
charred blaze
tender shard
#

add both, then you will have the "authlib" thing

tender shard
peak wharf
charred blaze
midnight shore
echo basalt
#

Arrays#asList and Collections#singletonList provide immutable maps

peak wharf
#

but i have this other issue : πŸ™ƒ

echo basalt
#

List.of too

midnight shore
#

Caused by: java.lang.UnsupportedOperationException
at java.util.AbstractList.remove(AbstractList.java:167) ~[?:?]
at will0mane.plugins.gunmaker171.weapon.DefaultWeapon.removeData(DefaultWeapon.java:88) ~[?:?]
at will0mane.plugins.gunmaker171.weapon.DefaultWeapon.setAmmoLeft(DefaultWeapon.java:70) ~[?:?]
at will0mane.plugins.gunmaker171.weapon.DefaultWeapon.lambda$getShootFunctions$2(DefaultWeapon.java:58) ~[?:?]
at will0mane.plugins.gunmaker171.weapon.ShootingHandler.handleShootEvent(ShootingHandler.java:18) ~[?:?]
at will0mane.plugins.gunmaker171.weapon.ShootingHandler.onClick(ShootingHandler.java:31) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
... 21 more

#

this is the error i get

tardy delta
#

its immutable lol

echo basalt
#

I know that's the error and I understand it perfectly

tender shard
echo basalt
#

you're trying to modify an immutable collection

tender shard
#

some lists are "not changable" by default

#

you cannot remove anything from those

#

what's DefaultWeapon line 88?

midnight shore
#

so how can i fix it?

tender shard
#

probably something like "myList.remove(...)" right?

tender shard
#

so what class does "myList" have?

midnight shore
tender shard
#

where did you get this object from?

midnight shore
tender shard
#

yeah but what did you set it to?

midnight shore
#

wait a second

tender shard
#

it must be something custom, since neither the default JDK nor spigot includes any "MapValues" class

midnight shore
tender shard
#

I see

tender shard
#

you can easily fix this

#

instead of doing Arrays.asList, you have to do this:

#

new ArrayList<>(Arrays.asList(...))

#

example:

sharp heart
#

Do someone know how to save with NBTApi a List of Object ?

tardy delta
#

Arrays.asList is immutable

midnight shore
tender shard
#
List<String> firstList = Arrays.asList("a","b","c");
List<String> secondList = new ArrayList<>(firstList);
#

firstList is immutable, secondList is mutable

midnight shore
#

so like this

tardy delta
#

Lists.newArrayList kekw

#

or smth

tender shard
midnight shore
#

ok lemme see

#

it works!! ty

tender shard
#

np πŸ™‚

peak wharf
#

hmm, i get the good head, but now i have this warning when i compile my plugin :

tender shard
#

that's no problem at all

fluid river
#

some class files are what?

tender shard
#

you can safely ignore this warning

peak wharf
#

okay

tardy delta
#

some classes are

tender shard
#

it probably only is upset about the META-INF files

tardy delta
#

they are

#

😎

fluid river
#

they do

tardy delta
#

they are sus

fluid river
#

warning

#

class files are sussy baka's

tender shard
#

you know who's actually sus?

#

my reddit profile

tardy delta
#

obama

iron glade
#

hellooo

glossy venture
#

obama sussy baka

tender shard
tender shard
#

haha

#

obama is a great dude

tardy delta
#

smh watching a c++ tutorial about oop

tender shard
#

his mic drop was also legen... wait for it

peak wharf
#

Is there an option to remove unnecessary warnings in IntelliJ ?

tardy delta
#

@SuppressWarnings("ConstantConditions")

#

for nullable problems

tender shard
peak wharf
tender shard
#

put it at the top of your method

tardy delta
#

on the method or the class

tender shard
#

like @EventHandler

echo basalt
#

I generally ignore the warnings ye

tardy delta
#

i generally tell the ide to shut up

#

hmm yes new Animal("green", 12):/

tender shard
#

real chads use checkstyle.xml files to setup their warnings ;P

tardy delta
#

how can animals speak :/

tender shard
peak wharf
#

okay thanks, its working, but i still have warning like this :

echo basalt
#

that very condensed filetree

tender shard
tardy delta
#

where @urban grotto annotations

echo basalt
#

hate it

tardy delta
#

that dude should really take another name

echo basalt
peak wharf
tender shard
#

oh that

echo basalt
#

compared to

tardy delta
#

lmfao

echo basalt
#

hella condensed

tender shard
#

well when you have 600 classes, you'r elucky over every pixel of saved space

warm light
#

getScheduler().isCurrentlyRunning asking for int input. what is that?

echo basalt
#

solution: start coding on an 8k tv

tender shard
#

the "id" of the task

tardy delta
#

name sucks lol

tender shard
#

e.g. getScheduler().runTaskLater(...) returns an int

#

that's your task's id

tardy delta
#

doesnt it return a BukkitTask?

echo basalt
#

BukkitTask#getId

tardy delta
#

and scheduleTaskLater or whatever an int

tender shard
#

only half of those methods return a BukkitTask

tardy delta
#

meh

#

ye

tender shard
#

the other half just returns an int

peak wharf
tender shard
#

you can just ignore it

#

don't worry about those warnings πŸ˜„

echo basalt
#

imagine if I worried about warnings lol

tardy delta
peak wharf
#

it's frustrating

tardy delta
#

quick fixes

echo basalt
charred blaze
tender shard
#

you will get used to ignore warnings. when I compile JeffLib, I get 500+ wranings

echo basalt
tender shard
peak wharf
#

perfect thanks

tender shard
echo basalt
#

sadge

#

my project is relatively new

#

only got a couple classes

tender shard
#

yeah okay I got a bit more πŸ˜„

echo basalt
#

looks at my zombies plugin

tender shard
echo basalt
#

eh

#

I could collapse the entire filetree

tender shard
#

I could collapse your mom

echo basalt
#

yeah not many

tender shard
echo basalt
#

ok nvm I'm actually close to the amount of classes in the zombies project

#

even though I'm not even 5% there

tender shard
#

warnings are bit like...

#

I mean stuff like this:

#
try {
  if(file.exists()) // doStuff();
}```
where doStuff throws a FileNotFoundException
warm light
tender shard
#

show your code pls

#

you can use the consumer to get the id

#

or the normal runTaskTimer method, which returns a BukkitTask

warm light
peak wharf
#

It is possible to make a kind of brick to be able to make it appear or not, because it ruins the readability of the code, without making a function

echo basalt
#

int id = scheduler...

echo basalt
#

you'll collapse like 20 lines into 5

#

pro tip! #2 - Make your item builder fetch items from the config

#

that way you collapse like 5 lines into 1

warm light
echo basalt
#

not that one

#

grr

peak wharf
#

hmmm

#

i will check this on google πŸ™‚

odd wedge
echo basalt
#

100 classes aint much

tender shard
#

you can do it like this

#
        Bukkit.getScheduler().runTaskTimer(this,new Consumer<BukkitTask>() {

            @Override
            public void accept(BukkitTask bukkitTask) {
                // Do your stuff here
                if(bukkitTask.getTaskId() == 0) {
                    // Kill myself when task ID is zero
                }
            }
        }, 1, 1);
warm light
#

thanks

tender shard
#

np

#

by using Inventory#remove(ItemStack) ?

#

haha np

tardy delta
#

runTaskTimer(this, task -> {}) kek

odd wedge
#

?jd-s

undone axleBOT
tender shard
#

πŸ˜›

tardy delta
#

you didnt use a lambda 😠

tender shard
#

oh right

#

I didnt use it on purpose

tardy delta
#

grr

eternal night
#

cursed

tender shard
#

because I thought they dont know about lambdas yet

#

lambdas can be VERY confusing when you dont know about them yet

odd wedge
#

@echo basalt was it you who sent that message about when to ask for help

echo basalt
#

maybe

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

odd wedge
#

Not that one

echo basalt
#

lambdas are just like

odd wedge
echo basalt
#

(<insert params here>) -> {code block}

hasty prawn
#

Alex is a man of so many talents... Making songs about ||fucking a fat girl|| and writing blog posts on lambdas and method references prayge

echo basalt
#

this?

tender shard
odd wedge
#

Should be made a command

hasty prawn
#

LOL

tender shard
#

my father called me at 2 am, and he didnt think that I might be asleep

#

he just assumed "you're probably awake anywy I guess"

hasty prawn
#

Were you?

echo basalt
#

I mean

tender shard
#

yeah I woke up at 1 am haha

chrome beacon
#

He knows that you're awake

echo basalt
#

I went to bed at like 7am

tender shard
tender shard
#

wait no, I was still awake when it was 9am

#

but yeah I also only woke up at 1am so it doesnt really count

odd wedge
#

I went to bed at 8 pm and woke up at 8 am

tender shard
#

you live the healthy live

chrome beacon
#

I'm going to bed now... Have a headache πŸ™ƒ

tender shard
#

aspirin!

odd wedge
tender shard
chrome beacon
tender shard
odd wedge
#

Same

tender shard
echo basalt
#

I hate that I try going to bed at reasonable times

chrome beacon
#

Same

odd wedge
#

I’m surprised I got home safe

echo basalt
#

but end up being obsessive about stupid shit

chrome beacon
#

Sleep is the only fix

echo basalt
#

then I can't go to sleep without getting out of bed, doing what I was obsessing about and going back to sleep

tender shard
#

if neither aspirin nor ibuprofen works for you, you have to go next level and ask your doctor for Novalgin/Metamizole

odd wedge
#

Or don’t take pills at all

chrome beacon
#

Or I just go and sleep

tender shard
#

that will probably also work

chrome beacon
#

Wake up tomorrow and be fine

echo basalt
#

my body has no troubles with staying awake at night

#

there was a day where I woke up at 3am and went to bed at 3am not feeling tired at all

tender shard
odd wedge
#

Sounds like an addiction

tender shard
#

it is, yeah

odd wedge
#

Drinks to remove the hangover

echo basalt
#

I guess I'm addicted with staying awake

odd wedge
tender shard
echo basalt
odd wedge
#

It’ll change soon

tender shard
#

at least once a year

#

I guess

odd wedge
#

I feel like I’ve lost some of my emotions

#

The world feels boring πŸ€·β€β™‚οΈ

#

Maybe I took too much mdma

tender shard
#

or not enough crack cocaine

odd wedge
#

Never have and never will try that

tender shard
#

me neither haha

#

alcohol + cig addicition is enough for me

odd wedge
#

My friends family member died from laced mdma

fluid river
odd wedge
#

Took fentanyl instead

fluid river
#

If you do once a month

odd wedge
tender shard
#

my bf is addicted to heroin and I can tell you, you dont want this to happen

fluid river
odd wedge
#

Nope

#

That shit fucks up your life

odd wedge
#

Any Opioids as well

echo basalt
#

don't do drugs, do commissions

tender shard
odd wedge
#

Do both

fluid river
#

When i was a kid i promised myself that i will never smoke

echo basalt
#

both will ruin your life but you can stop one of them

tender shard
fluid river
#

And drink

tender shard
#

smoking is the worst addiction of all. it doesnt even add ANYTHING useful to your life lol

odd wedge
#

Nicotine as a whole

echo basalt
#

I saw a video about the psychology of nicotine and smoking in general

#

iirc it was a coping mechanism

odd wedge
#

You get more stressed from it

echo basalt
#

yeah

#

without smoke life feels mundane and dull

odd wedge
#

Yeah

echo basalt
#

which is why it's hard to stop

chrome beacon
#

Smokers are so annoying... they keep walking around the train platform every morning smoking

tender shard
#

starting to smoke was probably the worst decision of my whole life

fluid river
odd wedge
#

Even if you stop being addicted from the nicotine you will still fiend the cig

fluid river
#

5 * 20 meters

tender shard
fluid river
#

And it's always filled with smokers like me

odd wedge
chrome beacon
#

I wish someone would enforce the no smoking sign

odd wedge
#

Nobody have a problem with someone being gay

fluid river
tender shard
chrome beacon
#

I don't want to breath that

odd wedge
tender shard
odd wedge
#

Yeah but those are kids

fluid river
tender shard
#

most of those idiots are 20+ year old and actually belive what they say

odd wedge
#

I feel like most people over 18 don’t care

worldly ingot
#

Body of an adult, brain of an undeveloped child

odd wedge
#

I just don’t like people forcing shit upon me, like someone forcing that they’re homosexual, developer etc

#

I couldn’t care less what you do on your free time leave me alone

tender shard
#

yeah I still remember when I sent that screenshot, choco replied something like "damn fire response mfnalex" lol

worldly ingot
delicate obsidian
#

what a nice conversation about development

odd wedge
echo basalt
#

we're talking about brain development

tender shard
#

exactly

#

we talked about brain dev

echo basalt
#

or the lack of

tender shard
#

haha

#

yeah

fluid river
#

kiss nibbler straight mf go freak woman straight

tender shard
#

yeah

fluid river
#

i tried

tender shard
#

it was okay

#

ig

#

not awesome, not bad

odd wedge
#

I have a problem with the extreme feminist though. β€œYou may not like a white cis male president” but like that shit is racist and sexist it’s just so weird

fluid river
#

Actually negr is the only world for black in russia

#

I use this word everyday

odd wedge
#

Either you want equality or you just stfu and cry alone

odd wedge
tender shard
#

I think we should drop this dicussion

#

or at least move it to #general

delicate obsidian
#

why did you guys end up talking about racism in here

echo basalt
#

brain development

#

or lack of

tender shard
echo basalt
#

undeveloped brains come to this

odd wedge
#

Just underdeveloped adults

heavy swan
#

Can you pass me the Wiki where spigot has an example of how to create plugins from scratch? plsss

delicate obsidian
#

iq development

tender shard
odd wedge
#

Just pick a topic you want

eternal night
#

cool kids just watch youtube videos to learn

odd wedge
#

Like a kit plugin and look at the docs

odd wedge
#

If you have problems google them and then ask here

#

When analyzing code you should try to understand then apply it

tender shard
heavy swan
#

Than you very much!

tender shard
#

Np

odd wedge
#

Np

tender shard
odd wedge
#

I would even say an intermediate knowledge

tender shard
#

hm I would say that

onyx fjord
#

bruh this dumass game

#

what do i need to do to show recipe in book?

tender shard
#

my first plugin, ChestSort, I wrote when I had basically no idea about at all

#

the code is shit but it got way over 100k downloads

onyx fjord
#

my mod sees it, table also does but book nope

tender shard
#

so I guess "basic knowledge" is good enough to get started πŸ˜„

odd wedge
tender shard
odd wedge
onyx fjord
tender shard
#

but how are you going to learn java without having an actual project

tender shard
onyx fjord
#

shut up

tender shard
#

what did you expect when asking this

odd wedge
onyx fjord
#

did you know theres a lib that allows you to run python in java?

tender shard
onyx fjord
#

python scripts

tender shard
#

oh sorry

#

it's not Β§ 311a but Β§90a

odd wedge
onyx fjord
#

pyscript ik

tender shard
tender shard
#

what no?

#

even a class or an interface is an object

#

methods are also objects

onyx fjord
#

anyways back to my question

tender shard
#

java only knows 2 things:
primitives and objects

onyx fjord
#

i basically want players to discover recipe vanilla way

#

if they ever picked up all keys of my recipe, they will discover it

#

just like vanilla does

#

but how

delicate obsidian
#

So dumb java only knowing about 2 things πŸ˜‚

odd wedge
#

An object is an instance of an class

tender shard
#

listen to EntityPickupItemEvent ,loop over inv contents, check if they have everything, and if yes, do #discoverRecipe

tender shard
onyx fjord
#

they might not have it anymore

odd wedge
onyx fjord
#

player picks up iron ore, then puts it in chest

tender shard
#
Class<Bukkit> bukkitClazz = Bukkit.class;
odd wedge
#

Each object of that class Carrie’s different states etc

onyx fjord
#

and then player picks up iron block, which is second shape key

#

then recipe gets discovered

tender shard
#

obv "Bukkit" is a class object

#

the java docs even say that everything is either an object or a primitive

#

what else would it be

onyx fjord
#

i need to check if player ever had X in their inventory