#help-development

1 messages · Page 1595 of 1

opal juniper
#

pathfinding

#

Drones

#

remember the conversation

#

about bombs

#

it got a bit harder

eternal oxide
#

I could make it work over a longer distance but it all take time

opal juniper
#

when we thought about all possible terrain features

#

yeah

#

but

#

no

eternal oxide
#

it can currently navigate any maze so long as you are within around 20 blocks

opal juniper
#

what if it flys into a cavern

#

umm

#

ok

#

so

#

what if it flew under an overhang that was then a dead end

cloud berry
#

guys i found this in me old code

    {
        d *= 100;
        if (d >= 0.0) d += 0.5;
        else d -= 0.5;
        int i = (int)d;
        return (double)i / 100d;
    }```
somthin tells me its bad 😳 cn any1 confirm?
eternal oxide
opal juniper
#

but how would it know it was gonna fly into and therefore needed to fly over

eternal oxide
#

you run the path algo before you move. It will return a path of block locations for you to navigate between

#

one sec

opal juniper
#

meh

#

i asked in paper and they were like "code it urself or use the ghast shit"

#

he is getting it

#

rn

#

i imagine

#

cause it aint public yet

#

this was the plan

#

let me show what im doing atm

#

?paste

undone axleBOT
opal juniper
#

for going from point a to b

#

i dont like how i calculate the distance

#

yeah that figures

#

so i mean

#

idrk how to incorperate the height shit into it

#

huh?

#

must have missed it

#

or just been stupid

#

yeah

#

so

#

sure

#

true

eternal oxide
#

ok, you have a 1.17 client?

opal juniper
#

yeah

eternal oxide
#

server at palmergames:1

opal juniper
cloud berry
#

#math #progammin #lessons 🤓 im takein notes

opal juniper
#

true

eternal oxide
opal juniper
eternal oxide
#

oh sorry

opal juniper
#

im stupid

eternal oxide
#

I'm bad

opal juniper
#

dont worry

#

just glad it wasnt me

hoary knoll
#

does callEvent pause the current code until all event handlers have run?

#

i was just wandering because the handlers are not directly called, im just firing the event

#

also i know how java works im not stupid

#

ok

proven ocean
#

Hey there, I have a problem when checking whether an item is damageable or not. Doesn't matter which item I check my code always returns true:

 ItemMeta meta = item.getItemMeta();
 if (meta instanceof Damageable) {
      return true;
  }
hoary knoll
#

i was just making sure. Calm down

proven ocean
#

every Item of a players inventory

#

thats what I thought.... Any ideas how to check if an item can actually be damaged?

opal juniper
#

ok im back

#

so

#

what were you saying i needed

#

an if statement to check it is actually wrong

#

ok

#

😄

#

if (vectorDistance > distance) velocityVector.multiply(distance / vectorDistance);

#

?

#

ok

serene agate
#

persistentdatacontainers vs sql database

opal juniper
#

the former

#

well

serene agate
#

always over sql database?

opal juniper
#

it depends on what you are storing

#

what are you storing

serene agate
#

what r some cases in which sql database be appropriate?

opal juniper
#

large amounts of data imo

#

^

serene agate
#

so like usernames n passwords?

#

ah ok

opal juniper
#

yeah

#

but hash them

serene agate
#

sha256

opal juniper
#

@ebon abyss

#

this approach causes it to majorly overshoot

#

should i take a fraction of the vector?

#

yeah, but i had a method to make the vector a tad better

#

lemme do some control + z

#
    private double getMultiplier(double distance) {
        if (this.maxDistance == 0.0) this.maxDistance = distance;
        return (distance/this.maxDistance) * 4;
    }
#

idk what i was thinking about with the if statement

#

but poorly named vars

#

distance = distance

#

between drone and end

#

maxDistance was the distance from start to end

#

but i just did it stupid

#

well

#

it would never be small enough to get to 0

#

cause of the if distance <= 1 {cancel()}

#

but essentially yes

#

myeah but:

        if (start.distance(end) <= 20) {
            sender.sendMessage(ChatColor.RED + "You are too close to the target!");
            return true;
        }
#

so

#

it was not an issue

#

true

eternal oxide
opal juniper
#

corrupted?

eternal oxide
#

sorry rename to 7z

#

windows is shit

opal juniper
#

np

eternal oxide
opal juniper
#

it goes like 10000000 mph

opal juniper
eternal oxide
#

the prune method may nto be quite right but its close

opal juniper
#

vector: 0.0,0.0,22.5

#

yeah this is gonna be too fast

#

30 blocks

#

this.distance = this.startingNode.distance(this.finalNode);

#

startingNode = spawn

#

finalNode = target

#

wat?

#

oh

#

i just changed it to this:
if (vectorDistance >= 0.5) velocityVector.multiply(0.5 / vectorDistance);

#

works

#

now the gravity is an issue

#

ie

#

it is being pulled down

#

but i want to

#

i mean

#

yeah i then realised

#

no it wont overshoot

#

considers

#

yeah i get you

#

i just mean in general it wont overshoot

#

yeah

#

fair

#

i will probs work out a better way to scale the speed at some point but this is good for now

#

now, pathfinding

#

meh, not atm

#

but an idea

#

i mean

#

are you familiar with the game satisfactory

#

ojk

#

so

quaint mantle
#

Hello! spigot How can I change mob's pathfindergoal while mob is living? (I meant, I want to change pathfindergoal when it spawned. not before spawn)

opal juniper
#

i saw a dev log the other day

#

of them implementing drones

#

and the way they did

#

is that they had a "world grid"

#

so essentially each "chunk" had a height that was safe to fly at

#

im thinking of using that and then elgarls algo to find the route from one y to another

#

yeah

#

that was my initial plan

#

most likely deliveries

#

but could be anything

#

ummm no it is unlikely, it would be more like player x wants to send 64 diamonds to player y

#

using their locations as the start and end

#

this is an issue

#

so

#

despawn the entity

#

👍 we have the same idea

#

mhm

#

only issue is if the player goes and unloads the chunk for delivery

#

may want to add a load on start

#

something like this

#

yea i see what you mean about caching

#

howver i dont really know how much there is to cache

#

i mean

#

this was not gonna be the usecase

#

but i see what you mean

#

true

#

ok

#

so

#

what is the best solution to getting them to manage their y

#

cause to work out the y of a chunk

#

u need to know the chunk the drone is about to fly into

#

oh wow

#

cause atm you have to just loop thru every block to get the highest

#

its gonna be nms i reckon

#

lemme ask the paper people

dusk flicker
opal juniper
#

ok

final monolith
#

can someone review my first plugin? I posted on github

#

😄

opal juniper
#

there are 16 chunk sections right?

final monolith
#

D:

opal juniper
#

no

#

but the argument would be 0-15 or 1-16?

final monolith
#

Hey, jeff how i can use multiples versions in my plugin with Maven?

opal juniper
#

nms versions?

dusk flicker
#

static

final monolith
#

is that the name? NMS?

opal juniper
#

Net Minecraft Server

#

im gonna go for a bit anyways

#

ciao

dusk flicker
#

Might have to translate to the other version of nms due to net Minecraft server doesn't fully exist anymore in 1.17 with other packages

final monolith
#

oh, i will use lowercase now

dusk flicker
#

?conventions

undone axleBOT
final monolith
#

its the right way?

dusk flicker
#

Look at that link for conventions

final monolith
#

what you mean?

#

ooohh yeah

#

i will fix

chrome beacon
#

Folders are structured like a maven project but there is no pom.xml

dusk flicker
#

Currently at -6000220 points

final monolith
#

i will rename to PlayerVariable

#

its my first plugin, sorry

#

;-;

#

i will async

dusk flicker
#

-6005220 points

hasty prawn
#

This point system seems arbitrary

chrome beacon
final monolith
#

looks more sense

chrome beacon
#

Yeah but the name tells us nothing about what it's for or what it does

final monolith
#

ohhh, yeah

#

maybe {PluginName}API.class?

#

renaming...

chrome beacon
#

Only the Main class of an application should ever be allowed to be named Main

#

And since it's a plugin you shouldn't use that

final monolith
#

yes, now that i realized it, i wouldn't realize it alone

tame fern
#

Created and spawned a custom cow entity, server just closes, no error. Great fun.

final monolith
#

thanks for tips guys

#

@ebon abyss maybe this?

dusk flicker
#

Ehh

#

I'd just name it LvData

final monolith
#

no?

dusk flicker
#

For the main

final monolith
dusk flicker
#

A decent amount of plugin devs just use the plugin name as the main class name

final monolith
#

i didnt like that

#

will rename the .class

paper viper
#

Please do not add Main

#

Or use Main at all

#

For your class names

#

In a plugin

quiet ice
#

I'm surprised noone said anything about the wildcard static import

final monolith
#

omg sounds perfect

chrome beacon
#

^^

paper viper
#

I thought originally that had some sort of enums or smithing but it’s a class

#

So yeah don’t do that

dusk flicker
#

How many points

paper viper
#

No it’s not

manic crater
#

For some reason in 1.15.2 when i try to code and use "extends JavaPlugin" New project im working on btw but it doesnt work

final monolith
dusk flicker
#

We're at -6005220 rn

paper viper
#

No do not use Main or have it anywhere in yo class name

#

Bad bad bad

final monolith
paper viper
#

I really didn’t want to pull this out

#

Lol

final monolith
#

woof, now its good

#

thanks for the tips guys

#

but send more plizzzzz :lmao:

dusk flicker
#

tame coral
#

Just name it by the name of your Plugin

paper viper
#

PluginMain is literally no difference still. Implying Main the first place in general is despised severely

#

Adds unnecessary verbosity to the name

#

Exactly

#

Just name it your plugin

#

So what?

#

Do you have to add Main for everyone to know it’s the main class?

#

Not at all

#

It isn’t accurate, it has worse side effects lol

ivory sleet
#

It may be confusing and awkward to work with if you have dependents who depends on your plugin main class

paper viper
#

^

ivory sleet
#

sure it would work fine if its just internal

#

well it would work fine all the time

#

true

paper viper
#

Or just literally name it MyPlugin

#

Lol

quiet ice
paper viper
#

But it isn’t good either… you know right

#

So don’t recommend it lmfao

final monolith
#

looks good?

#

do you find it necessary to put this in async?

#

just an Alter table

plush citrus
#

where do i start the process to reset my stash password? I get the following in an email when trying to reset my password:

Bitbucket is unable to reset the password for your account because it is managed by a read-only external directory. Please contact your administrator to change your password.

dusk flicker
#

I don't believe the stash has public accounts

plush citrus
#

ok

reef wind
#

Is anyones else Firefox on mobile broken when visiting a redirect site like spigotmc?

#

Aight

#

I will never go near chrome

#

It is

#

Chrome is ass

#

Right @daring sierra @quaint mantle

quiet ice
#

the sheeple use brave nowadays

#

I think, idk

#

in part yes

reef wind
#

no “I give you ads I give you money”

quiet ice
#

but it's main selling point is "privacy" and it's obnoxious ads

reef wind
#

It shows ads as a notification on windows and you get BAT

#

Currently it’s worth nothing

#

who cares about privacy

quiet ice
#

I have heard that facebook can reduce the oculus price by around 300$ simply by selling your data

quiet ice
#

So, I wouldn't say that privacy is worth nothing

daring sierra
reef wind
#

Not like anything bad happens because companies sell your info?

#

Just cheaper prices and more relevant annoying ads

quiet ice
#

Nothing all too bad has happened yet

quaint mantle
#

ff ❤️

reef wind
#

ff ❤️

quiet ice
#

And even if they would know all my personal info - most of this personal info is public anyways for me

quaint mantle
#

Mac is ass

reef wind
#

We are boosters dumbass

#

Poor ass/j

quiet ice
#

Most of them got it by exploiting epic games

reef wind
#

I have bought and cancelled a lot of times

final monolith
#

how to use main thread variables in async?

reef wind
#

People say nitro is ridiculous and that everything is nitro but they forget discord is free.

quiet ice
#

or push them in some kind of struct to pass them around the threads

final monolith
#

wowowowowowowowwo

#

solved

#

thanks

tame coral
#

bruh

quiet ice
reef wind
#

Wait wat

quaint mantle
final monolith
#

lmao

reef wind
#

Bye see you in #general

#

Maybe

opal juniper
#

Juice man

#

You there

#

Im not sure how i should go about getting the chunk that the drone should fly at

#

should i take the max height of the three 9 chunks it is in/surround it

#

like this?

#

makes senes

#

yeah

reef wind
opal juniper
#

to get the vector direction i assume i have to calculate it manually

opal juniper
#

something like tan^-1(x/z)

where x & z are the respective components of teh drones vector?

#

wait

#

hmm

#

im not sure that is the whole thing cause it just returns the internal angle of the triangle

grim ice
#

will Array index is out of bounds error stop my code from working

opal juniper
#

its an exception

#

so unless you have some error handling

#

yes

grim ice
#

?paste

undone axleBOT
opal juniper
unkempt ore
#

It's not special, it's a runtime exception

#

If you let an exception climb all the way up, it screws you

#

Though an AIOOB exception isn't something you catch. Again, it's a runtime exception, so it's something to be prevented, not fixed

grim ice
#

https://paste.md-5.net/ucojuqucij.js (im trolling my friend in a troll server) so i want everything i say after /shadow get executed without showing in the console even without me having op perms

#

dw its just a troll server with my friends lol

#

and they agreed for the server to be troll plugins only

unkempt ore
#

I don't think anyone cares about motives here, it's fine man lmao

grim ice
#

idk man i dont wanna get banned or smth

unkempt ore
#

We're just here to fix code

grim ice
#

okay

#

im getting Array index is out of bounds

#

warning

#

line 28 23 and 32

jovial abyss
#

@grim ice Java arrays start at 0

hasty prawn
#

You don't know that args[0] exists

unkempt ore
#

You need to determine the size of the array at runtime and why it'd not be there

grim ice
unkempt ore
#

Like they're saying, you're showing no guarantees that these accesses will be there

hasty prawn
#

ok so that's where your error is

#

Or, warning

unkempt ore
#

Error, he's getting AIOOBd

hasty prawn
#

Yeah he's said both

unkempt ore
#

I see

grim ice
#

how to

#

fix it

hasty prawn
#

I mean they're the same thing, IDE is just telling him the error is gonna happen LOL

#

Check if args.length >= 1

unkempt ore
#

Also, hex, get the command sender on one line first of all

#

And your chain of ifs is a job for switch

grim ice
#

i swear

#

i tried it lul

#

like if i ctrl z

#

a few times

#

itll show lol

unkempt ore
#

Show us the code where you have that

#

I'm sus

hasty prawn
#

Well, think about it this way as well:

You're checking if args.length is 1, and then accessing the second index. It never exists.

grim ice
#

i cant find it its way before

unkempt ore
#

Why are you giving the player op with this command

hasty prawn
#

Wdym how

unkempt ore
#

That's out of nowhere

unkempt ore
# grim ice how?

Listen, if the args length is 1, the only index you've got is 0

#

You don't have index 1

hasty prawn
#

^

unkempt ore
#

That'd be length 2

grim ice
#

ty

unkempt ore
#

Now slow down, that's not the only thing weird with your code

#

Why are you giving players op inside the command

#

That's strange

grim ice
#

wat

unkempt ore
#

Look at the code

grim ice
#

yes?

hasty prawn
#

I think that's what it's intended to do

unkempt ore
#

If the command is "shadow" you're giving them op

hasty prawn
#

For the troll

grim ice
#

yes

unkempt ore
#

But like why?

hasty prawn
#

One note I'd make is that the console can be defined outside the if statements

#

Since it's all the same

grim ice
#

yeah

#

i know that

unkempt ore
#

Yes, I told him that

#

And use a switch

grim ice
#

i was just copy pasting thats why

hasty prawn
#

Ah ok

grim ice
#

alr alr

hasty prawn
#

copy pasting :(

unkempt ore
#

Honestly it's still weird. I don't understand what giving op is doing

livid tundra
#

how do you assign data to an entity

unkempt ore
#

Please be more specific

#

You probably want PersistentDataContainer, but please specify

livid tundra
#

I'm not really sure, It's for a future project I didn't start yet

unkempt ore
#

What

livid tundra
#

anyways, I'll check out the persistent data container

unkempt ore
#

I mean, maybe tell us what sort of data you'd want to attach to the entity

#

Maybe you haven't made the project you speak of, but what is your purpose

vivid temple
#

how do i prevent myself from a NULL error?

chrome beacon
#

Don't access a null value

unkempt ore
#

You make sure you don't- ^^^^

unkempt ore
# vivid temple how do i prevent myself from a NULL error?

Spoonfeeding but this happens when you have a type at runtime which is null and you try to act on it. NullPointerException, because you're working with a pointer to null, which doesn't make sense. So be sure what you access isn't null

grim ice
#

lol

#

spoonfeeding is

#

tell him to

unkempt ore
#

Nah

#

He could do his own research

mighty vine
#

Or you always use try and catch for nullpointerexception Kappa

grim ice
#

if(thing != null){
//code
}

grim ice
#

what i said is spoonfeeding

#

im f eeding the spoon

ivory sleet
#

it isnt

unkempt ore
#

Unless it's from IO or user input somehow

ivory sleet
#

thats just pseudo code, wouldnt define it as spoonfeeding

grim ice
#

im pretty sure an ide will show what is a npe

unkempt ore
#

It can show you what may be

grim ice
#

how r u even supposed to spoonfeed npe

unkempt ore
#

Because there is the @Nullable tag and such things

#

And it'll say "Hey, this may be null, be careful"

grim ice
#

uh

#

even I, who sucks at java

#

would know npe

#

lol

quiet ice
#

@Nullabke and @NotNull are not enforced

#

They are mere suggestions and may be wrong

grim ice
#

honestly

#

most of the time

#

i ignore npe

ivory sleet
grim ice
#

cuz it doesnt do anything

#

sometimes it does

quiet ice
#

ignoring exceptions?

grim ice
#

yes

#

for example when u do if(inv.contain(Smth){}

#

itll tell u

quiet ice
#

Did you code your code defensively or is it more regular code?

grim ice
#

wdym

quaint mantle
#

lmao nnyak got banned again

unkempt ore
#

Who

quiet ice
#

well, you cannot ignore NPEs if your code wasn't written defensively

quiet ice
unkempt ore
#

Hehhhh?

quiet ice
#

this person

#

pretty sure that he also had shroomster2 and juice man as his alts too

eternal oxide
#

He gets banned often

quaint mantle
#

apparently he was racist in paper

#

and he's banned so as long as he comes back hes getting banned

unkempt ore
#

Wait, what? I remember that guy

#

He had mad skills

eternal oxide
#

So we are banning for peoples behavior in other Discords now? or did he do something in here?

quaint mantle
#

he was rude to people in here and was warned alot

eternal oxide
#

k

unkempt ore
#

Dang

ivory sleet
#

he wasn't just racist in paper to begin with

grim ice
#

?paste

undone axleBOT
unkempt ore
#

That's disappointing

#

I thought he seemed cool

quaint mantle
#

yeah he was super helpful but a shitty person

grim ice
#

no error in console

ivory sleet
#

anyways he will probably find a way to disguise himself and snake into this discord again so presumably wont be the last time you meet him

grim ice
#

this is against tos

unkempt ore
#

If you're gonna cancel the event in all branches, just cancel it at the end

grim ice
#

so you can probably report him

unkempt ore
#

Not an error, but just saying

ivory sleet
#

nothing we can do about it

grim ice
unkempt ore
quaint mantle
grim ice
#

it is

#

ban evading

quaint mantle
#

its not

#

nvm it is

#

google lied

grim ice
#

lol wtf

#

did u not read tos tho

quaint mantle
unkempt ore
#

Who actually reads the tos seriously...

quaint mantle
#

just dont break rules

grim ice
unkempt ore
#

You're so weird

eternal oxide
#

He's one of those people who is fine for a bit, quite helpful at times, then needs a ban to quieten him down

grim ice
#

I'm a mod in multiple servers

#

I had to read tos multiple times

#

lol

quaint mantle
#

not really

grim ice
#

I have read them over 20 times

unkempt ore
#

What...

quaint mantle
#

its pretty easy to remember

unkempt ore
#

I'm a mod too, do not care for TOS

grim ice
unkempt ore
#

It is common sense, all of it

grim ice
#

anyways

unkempt ore
#

Okay but

#

What is "not working"

#

What conditions

grim ice
#

/shadow

#

I didn't test others but they prob won't work either

unkempt ore
#

What is it supposed to do and what is it doing

grim ice
#

it's supposed to op me

#

it did not

quaint mantle
#

seems like a horrible command to have

unkempt ore
#

When you do..what command?

grim ice
#

/shadow

unkempt ore
#

Why not just have op to begin with

grim ice
#

It's for trolling

#

lol

unkempt ore
quaint mantle
#

console: player executed command /shadow
made player an operator

#

pretty obvious

grim ice
#

I can't stop it from showing?

unkempt ore
#

You can

quaint mantle
#

you can but idk why

unkempt ore
#

gamerule broadcastConsoleToOps

grim ice
#

I thought it will since im doing the code before the command is happening

#

PlayerCommandPreprocessEvent

#

anyways may you help me

unkempt ore
#

So let me get this straight, /shadow would just give you op, and that's it. /shadow give @a dirt would give you op then give everyone dirt on behalf of the console

grim ice
#

No

#

it wont give u op if u have more than "/shadow"

unkempt ore
#

Ah, but aside from that?

#

The rest is true

grim ice
#

yes

#

you cant do it without using console cuz u r not operator

unkempt ore
#

Your logic is very weird. Rather than having that chain of arg lengths, cut off "shadow " from the input and run that

grim ice
#

what

unkempt ore
#

How do I make that simpler

grim ice
#

still

#

my weird logic

#

wont make the plugin not work

unkempt ore
#

I've heard of dispatchCommand being unreliable

grim ice
#

wat do i use then

unkempt ore
#

What if you try Server's dispatchCommand

#

Just to see

grim ice
#

...

chrome beacon
grim ice
#

did you even read my code

unkempt ore
#

I don't remember, but a friend attempted to make something like this and he said dispatchCommand wouldn't work well

grim ice
#

wait

#

ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();

unkempt ore
#

And it wouldn't actually run as the console

chrome beacon
#

It will if you use it correctly

unkempt ore
#

Is he using it incorrectly?

grim ice
#

Bukkit.getServer().getConsoleSender().dispatchCommand(console, args[1]);

chrome beacon
#

Sounds like it

unkempt ore
#

That's...no

grim ice
chrome beacon
#

Bukkit.dispatchCommand(sender, command)

near crypt
#

when a player holds nothing in the hand is it then Material.AIR ?

chrome beacon
#

Item will be null

near crypt
#

okay thx

#

why is this in the PlayerInteractEvent always true (Intellij says that)? if(event.getItem().getType() != null)

hybrid spoke
#

since the material can't be null

#

just the item can be

near crypt
#

oh yeeeess true thx lmao

grim ice
chrome beacon
#

If args 1 is the command yes

grim ice
#

then why is it not workig

chrome beacon
#

Also I don't think you need to use getServer

chrome beacon
grim ice
#

this is my class

#

i did /shadow and it did not op me

#

r u here

near crypt
#

?paste

undone axleBOT
grim ice
hybrid spoke
#

bro chill

near crypt
eternal oxide
#

Why are you trying to add a secret hidden op command?

grim ice
#

a troll serve

#

server

#

with my friends

eternal oxide
#

yeah

grim ice
#

i wont give it to anyone

#

or publish it

#

lol

#

if i was gonna give it to someone i wouldve not sent it here

hybrid spoke
grim ice
#

@eternal oxide so do u have an idea

#

of how can i fix

near crypt
near crypt
#

what?

hybrid spoke
#

the exception obv.

near crypt
#

oh okay

hybrid spoke
#

also enums should be always compared with the "==" operator

near crypt
#

oh okay

grim ice
#

another repost ig

quaint mantle
hybrid spoke
near crypt
#

okay

hybrid spoke
#

stop spamming it in

grim ice
#

you flooded it

#

no one will answer a question 20 messages old

near crypt
#

?paste

undone axleBOT
tame coral
#

Gah !

hybrid spoke
near crypt
#

the fire charge if

#

if material is firecharge

hybrid spoke
#

so either your metadata is null or anything with your enchantments

hasty prawn
#

Its probably "/shadow" or the command isn't included maybe?

#

Put some print statements, see where it gets, learning to debug your code is something you need to do

hybrid spoke
#

the command should be always args[0]

paper geyser
#

appreciation post for the people who reply to questions here

you guys are very swag and cool and great thank you guys

hasty prawn
unkempt ore
#

Okay I'm back did you fix Hex's shadow bs yet

grim ice
#

no

unkempt ore
#

Dang

paper geyser
unkempt ore
#

Anything new?

grim ice
#

no one uses this event so like

#

no one can fix it

unkempt ore
tame coral
grim ice
hybrid spoke
#

#getMessage returns the command the player has sent. so shadow is args[0], but probably its "/shadow" @grim ice

tame coral
#

a month ago i didn't know anything about spigot

hybrid spoke
#

check for "/shadow" since its in the message

#

but i am not sure

grim ice
#

the way im using it rn

#

is safer i think

unkempt ore
#

Any updates in code?

hybrid spoke
#

because of the /? xd

unkempt ore
#

Also yeah it probably is /shadow

#
Gets the command that the player is attempting to send.
All commands begin with a special character; implementations do not consider the first character when executing the content.
#

I'd think the / is included

grim ice
#

o

#

how would i use i

#

it

hybrid spoke
#

by just adding a "/" to your equals check?

grim ice
#

ok=

tame coral
#

when ran from the console the / isn't included, is it ?

#

as you can run commands in the console without /

#

You should consider this case as well

grim ice
#

its not supposed to be used in the console

tame coral
#

Okay

#

Then add a check for it

unkempt ore
tame coral
#

^

grim ice
#

please try to give me a solution

#

instead of this

tame coral
#

Huh

grim ice
#

lol

unkempt ore
#

Did you add the /....

#

Dude

grim ice
#

uh

tame coral
#

It's not hard to do

unkempt ore
#

We are trying

grim ice
#

if (event.getMessage().equalsIgnoreCase("shadow")) {

#

u mean this?

tame coral
#

yeah

grim ice
final monolith
grim ice
#

bro'

#

wtf

#

dont advertise ur things here

ivory sleet
#

I think it’s fine

tame coral
#

it's not advertising, they're looking for tips

ivory sleet
#

Not like it suits any other channel better, after all it’s programming help

tame coral
#

like if they sent the spigot link it would be an ad

grim ice
#

anyways

hybrid spoke
tame coral
#

but it's the source code so...

grim ice
#

anyone has an idea

tame coral
#

we just told you a solution ???

grim ice
#

which is?

tame coral
#

goddamn

unkempt ore
#

Oh my god.

final monolith
#

i only need tips to upgrade my plugins

grim ice
#

sorry im dumb

tame coral
#

do you read the messages

hybrid spoke
#

search it up yourself

unkempt ore
#

Amnesia

hybrid spoke
#

scroll

tame coral
grim ice
tame coral
#

I'm not experienced enough to give hints yet i guess

ivory sleet
#

Daniel uh well first of all, follow official java naming specifications

ivory sleet
#

package names, lowercase

ivory sleet
#

^

#

I think luzifer can review the rest (:

final monolith
#

its correct uppercase the "plugin" package?

tame coral
#

nah, package name should always be lowercase

paper geyser
#

^

final monolith
#

oh, okay i will lowercase now

tame coral
#

refractor it with intellij, don't rename it raw

final monolith
tame coral
#

good

final monolith
#

😄

#

like this?

tame coral
#

Yep

final monolith
#

yup

tame coral
#

ngl this looks better too

hybrid spoke
# final monolith Hey guys, look my first plugin: https://github.com/LaivyTLife/DataAPI please, s...

your naming convention is shit. you are totally static abusing, why are you nulling the bukkittask but nothing else? its null by default. you don't have to explicit instantiate your vars inside the onEnable. such as the gitlink you can instantiate right away.

why do you have 2 database folders? dont run your database stuff sync. dont close the connection in your try catch, close it in the finally so it will be closed for sure. choose an other name for your Variable class, its redundant and non-telling what it actually do. think of the SRP when creating your classes.

#

thats for everything i looked at yet. so 2 classes or smth. now gonna get some food

ivory sleet
#

Oh that might come a little harsh for the guy

paper geyser
#

^

tame coral
#

Eh

final monolith
tame coral
#

They ask for tips, i mean that was kinda rude but at least it's helping

ivory sleet
#

Well I’m not in the mood for reviewing code today but maybe another day 🙌

final monolith
#

but... what is the difference?

hybrid spoke
#

finally is called whatever happens

#

your try catch can break at any time

#

so it could cause a memory leak

final monolith
#

yeah, i know

final monolith
hybrid spoke
final monolith
#

anyway, i understand a few things, i'll fix it

grim ice
#

uh

#

back

hybrid spoke
#

brb

grim ice
#

still no response dang

#

guess the idea is just impossible

hybrid spoke
#

we already fixed your issue @grim ice

grim ice
#

huh?>?

#

where??

hybrid spoke
#

or is it a new one?

grim ice
#

no the same issue

#

how? where

hybrid spoke
#

yeah we already fixed it. read the chat.

grim ice
#

i read it

hybrid spoke
#

so brb

grim ice
#

BREH'

quaint mantle
#

control + f 🙃

whole stag
#

It wouldn't be useful to, ya know, actually say what order the items should be in...

ivory sleet
#

Myes Bukkit design

final monolith
ivory sleet
final monolith
#

hm?

grim ice
#

?paste

undone axleBOT
ivory sleet
#

try (PreparedStatement statement = ...prepare) {

}

grim ice
#

anyone knows a solution

#

still cant figure it out

tame fern
#

When I do this, and use the spawn egg, it spawns like 500 of them and I have no idea why.

@EventHandler
    public void spawnEntity(CreatureSpawnEvent e) {
        if (e.getEntityType().equals(EntityType.COW)) {
                ((CraftWorld) e.getLocation().getWorld()).getHandle().addEntity(new CowAngus(e.getLocation()));
Bukkit.getLogger().info("Spawned Cow!");
        }
    }
grim ice
#

when a entity is spawned it repeats itself

tame fern
#

I assumed, but how do I spawn the entity without calling the event again.

jovial abyss
#

@grim ice You should add a break otherwise you have a fall through

tame fern
#

Let me try it.

grim ice
#

v

#

case 2:
Bukkit.dispatchCommand(console, event.getMessage());
event.setCancelled(true);
break;
case 3:
Bukkit.dispatchCommand(console, args[1] + " " + args[2]);
event.setCancelled(true);
break;
case 4:
Bukkit.dispatchCommand(console, args[1] + " " + args[2] + " " + args[3]);
event.setCancelled(true);
break;

#

like this

#

?

jovial abyss
#

should be fine

jovial abyss
#

or you could you use switch expression if you use java 13 or greater

ivory sleet
#

You don’t need to close

#

Try with resources does that for you

final monolith
#

ooohhh

unkempt ore
#

Consider try with resources

final monolith
#

thats make sense

unkempt ore
#

It implements AutoCloseable, which is a Java held interface

#

Java knows to do that for you

final monolith
unkempt ore
#

Yes

final monolith
#

wowowowo amazing

unkempt ore
#

When the scope leaves, Java will close for you

#

Also you can just put that loadPlayer after the try-catch, no need for the finally

grim ice
#

@unkempt ore

#

btw

#

can u explain to me

#

wat was the solution

#

becuz im dumb

unkempt ore
#

Did you try with the /

grim ice
#

wdym

grim ice
#

im trying getMessage now

unkempt ore
#

Newline that please

final monolith
#

;-;

unkempt ore
#

But yes

final monolith
#

ok

grim ice
unkempt ore
#

I just discovered it lmao

#
if (event.getMessage().equalsIgnoreCase("shadow"))
grim ice
#

wat

unkempt ore
#

You're only executing "shadow". And if that's not all, try putting "/shadow" there and tell me what it says

grim ice
#

if that was the case saying shadow would work

unkempt ore
#

Like I said, try /shadow

grim ice
#

Okay

unkempt ore
#

Because I don't know if getMessage will include the slash

#

But I think it will. The docs don't imply otherwise

hybrid spoke
#

and he didn't even noticed it

#

and was too lazy to look it up

unkempt ore
#

Lmao

hasty prawn
#

Yeah didn't we say to try "/shadow" like 15 minutes ago LOL

hybrid spoke
#

15 minutes ago 15 times

grim ice
#

uh

#

wait

#

LMAO

unkempt ore
#

:|

#

Yknow what I believe you about being a discord mod now

grim ice
#

Not being good at programming does not mean that

unkempt ore
#

Does your beard go down to your stomach

grim ice
#

uh, no

unkempt ore
#

Okay but did you fix it

grim ice
#

Not yet, im compiling'

tribal elbow
#

Alr, so I am going to need some custom plugins for a server. I plan on creating them myself but needed a place to start. I am familiar with HTML/CSS and can somewhat read java without being taught.

I just need some info.

  1. What is all used for plugin creation? I assume java, but does it use more than just java? Like javascript or smth similar.

  2. Is there a place where I can find a list of MC variables for the coding, or do I have to play it by ear?

Also, I assume I can use Dreamweaver since you can code just about anything in it. But is it better to use smth like eclipse or netbeans?

Ty in advance!

unkempt ore
#
  1. yaml but it doesn't count
#
  1. what...
#
  1. If you're comfortable with...whatever that is, go ahead. But most will recommend IntelliJ IDEA
tribal elbow
#

Also, I don't mind being pinged or DMed if you need more info

hasty prawn
#

JSON is also used sometimes, depends on what you're doing

hybrid spoke
#
  1. Java, YAML, build tool lang, spigot (or any other fork) - really depends
  2. javadocs i guess, whatever you mean
    what is dreamweaver
grim ice
#

Use IntelliJ

#

dreamweaver is an IDE iirc

unkempt ore
#

What the heck did he mean "play it by ear"

#

And what MC variables

tribal elbow
hybrid spoke
#

ew

unkempt ore
#

I was afraid to look it up

#

And I was right to

#

What the heck is this UI

#

VSC is better than this

hybrid spoke
#

editing my photos in my dreamwaver IDE from adobe

unkempt ore
#

Yes

grim ice
#

lmfao

unkempt ore
#

Adobe needs to stick to graphics bruh

hybrid spoke
#

nah adobe is just for making graphics

unkempt ore
#

They posted cringe on main

#

Smh

tribal elbow
# unkempt ore And what MC variables

I mean like the variables in the code that are relative to Minecraft. Because Java is used for so many diff things. There has to be some argument or variable for MC

unkempt ore
#

Ummmm...

#

I don't know how to respond

ivory sleet
#

?Jd-s

grim ice
#

@unkempt ore

ivory sleet
#

Oh

#

?jd-s

undone axleBOT
grim ice
#

it worked

ivory sleet
#

@tribal elbow

unkempt ore
#

Ok

grim ice
#

but thing is

#

other stuff dont work

#

only the op one works'

unkempt ore
#

Yes...that is what I told you

ivory sleet
#

I mean sure there are variables but Java is fully object oriented to no inherited top stuff like other langs

ivory sleet
#

Everything is basically contained in classes which you need to import in order to use their respective variables and functions

tribal elbow
#

So it's more a case by case thing?
For example, to create a command like /stone that simply places a stone block. Wouldn't there be some term or name for the code to.know what that is amd what to do? (Haven't looked at Java too much sry xd)

unkempt ore
#

Mr. Fisher I'll ask right up front. Do you know Java

ivory sleet
#

?learnjava

undone axleBOT
tribal elbow
unkempt ore
#

Ah, didn't see

ivory sleet
#

I would strongly suggest reading into Java a little bit more 😉

unkempt ore
#

What do you know

tribal elbow
#

I know a moderate amount of html/css

#

And can read stuff like java but dont know the lang

unkempt ore
#

Hmmmm, yeah, no, forget everything you know. This is a different world

tribal elbow
#

Like I can see that this does this but idk why xd

ivory sleet
#

HTML and CSS vary humongously from Java

tribal elbow
#

That's why I was asking what languages were used

#

So I can do some studyinf

#

Studying

ivory sleet
#

Yeah just Java should be the answer

unkempt ore
#

Would be kinda nice to have a safe navigation operator in Java now that I think about it

#

Off the topic

tribal elbow
#

Javascript would be more if I wanted to link smth to a website right?

ivory sleet
#

Safe navigation operator?

unkempt ore
#

Sorry, sorry, I don't think that's the name

#

Might be confusing it

ivory sleet
ivory sleet
#

possibleNull?.doSomething()

unkempt ore
#

But it's something like var thing = object.getThing() ?? (fallback thing);

tribal elbow
#

Alr

unkempt ore
#

And it reacts if it's null

tribal elbow
unkempt ore
#

Trust me, it's not

ivory sleet
#

Java has ternary but it’s not like that

tribal elbow
#

Been like 6 years since I last looked at java xd

unkempt ore
#

Well you didn't see that

quaint mantle
#

thats gotta be javascript if you saw that

unkempt ore
#

JS has it

#

Yes

ivory sleet
unkempt ore
#

And some other language, I forgot

ivory sleet
#

Kotlin has it, in fact a lot of high level langs got it

unkempt ore
#

What happens if it is null

#

Does it just not do that

tribal elbow
#

Conclude, could you DM basically what you told me?

What code is used and those educational links for java.

ivory sleet
#

Just won’t chain

#

Yeah it just decides to stop lol

#

?jd-s

undone axleBOT
quaint mantle
#

?learnjava

undone axleBOT
ivory sleet
#

^

tribal elbow
#

Always wanted to learn java and be able to code plugins and such..just never started xd

ivory sleet
#

Feel free to type those commands in #text I guess

tribal elbow
#

Aight

tribal elbow
#

I looked into java like 6 years ago and just never tried to actually learn it

unkempt ore
#

6 years

tribal elbow
#

Like 4-6

unkempt ore
#

That's like...how long I've been programming for

tribal elbow
#

Breh xd

unkempt ore
#

Back in 4th grade bruh

quaint mantle
#

Anyone know a calculation to check how much of something a player can afford with an increasing price? Without the need of for loops.

#

Like the max the player can afford

dusty herald
#

whats 4th gradw

#

that signifies nothing

unkempt ore
#

What

tribal elbow
#

I'm graduated and was in votec xd

unkempt ore
#

How does it signify nothing

dusty herald
#

for all we know you could be a 5th grader

unkempt ore
#

I was in 4th grade 6-7 years ago

dusty herald
#

how old are u 😳

unkempt ore
#

16

dusty herald
#

😂

grim ice
unkempt ore
#

Are you okay?

dusty herald
#

no

grim ice
#

he just said he was 4th grade 6 to 7 years ago

unkempt ore
#

Ok

grim ice
#

lol

#

that means hes 11th grade or 10th

unkempt ore
#

Idk man

#

He probably has dementia

dusty herald
#

yeah but you don't have to be [insert age here] to be in 4th grade

unkempt ore
#

And the number 16 is just hilarious to him

vivid temple
#

when either the chest or the paper in my main gui gets clicked not the depositGUI nor the withdrawGUI gets opened

@EventHandler
    public void guiClick(InventoryClickEvent e){

        Player player = (Player) e.getWhoClicked();

        if (ChatColor.translateAlternateColorCodes('&', e.getView().getTitle()).equals(ChatColor.DARK_GRAY + "Bank Menu")) {
            if (e.getCurrentItem() != null) {
                e.setCancelled(true);

                switch (e.getCurrentItem().getType()){
                    case CHEST:
                        bankerGui.depositGUI(player);
                        break;
                    case PAPER:
                        bankerGui.withdrawGUI(player);
                        break;
                    default:
                        return;
                }
            }

            player.closeInventory();
        }

    }
quaint mantle
#

They might be from the united kingdom or another country

#

We use a thing called "Years" in the united kingdom

#

Year 11 = 15-16

dusty herald
#

light years 😂

quaint mantle
#

wow