#help-development

1 messages Ā· Page 654 of 1

spare hazel
#

r/ProgrammingHumor

tender shard
#

does that not take the axis into account?

#

I mean that'd also break blocks behind you

north nova
#

proabably every line of code u wrote was already written at least once before

remote swallow
#

wait

north nova
#

so aren't we all stealing

tender shard
#

it's always just +-1

remote swallow
tender shard
#

yeah

remote swallow
#

if you want to break ur self, in front or behind or wherever

tender shard
#

I mean everyone should be able to figure this one out themselves within 3 seconds

#

like

icy beacon
tender shard
#

for cx = x - 1; cx <= x +1; cx++

#

and that thrice

north nova
#

probably been written before

#

maybe not same usecase

#

how many generics can one use in a class im curious now

#

what could u possibly have in a class that would need it to have more than like 5

icy beacon
#

I don't even remember why because that code is long gone thankfully

north nova
#

what the fuck

#

good luck maintaining that LOL

tender shard
#

max_integer

north nova
#

ill test it

tender shard
#

well Class#getGenericTypes() or whatever returns an array

remote swallow
#

add 2.1 billion letters extends Objec

#

t

tender shard
icy beacon
#

also there was once upon a time this code in my codebase

tender shard
north nova
#

WHAT IS THAT

icy beacon
#

please do not ask.

north nova
#

please answer

icy beacon
#

I refuse

north nova
#

Ok

tender shard
north nova
#

lmfao

#

LMFAO

tender shard
#

?morepdc

undone axleBOT
icy beacon
#

lmao

tender shard
#

well it doesn't have pairs

icy beacon
#

I really do not remember why this abomination used to exist

tender shard
#

you'd have to create your own datatype for pairs

icy beacon
#

but this function also had like 300 lines iirc

spare hazel
north nova
#

šŸ˜µā€šŸ’«

quaint mantle
#

how can I get block data for like an iron golem spawner?

north nova
#

what are u tring to do

quaint mantle
#

I am sending a packet and it requires BlockData but I can't figure out how to set the mob type of a spawner

north nova
#

nvm

sullen marlin
#

There's a method for that in 1.20

#

sendTileUpdate or something

tender shard
#

sendBlockUpdate(Location, TileState)

#

on Player

#
CreatureSpawner spawner = (CreatureSpawner) Bukkit.createBlockData(Material.SPAWNER).createBlockState();
        spawner.setSpawnedType(EntityType.ALLAY);
        Player player = ...;
        player.sendBlockUpdate(block.getLocation(), spawner);

sth like this

sullen marlin
#

You may need to send blockdata first

tawdry echo
#

someone know why ide wont start?

north nova
#

update it in toolbox and try

#

2023.1 is not latest

echo basalt
#

oh hi bogdan

north nova
#

noob

tender shard
#

if something's not working in intellij, the problem is usually the MCDev plugin

tawdry echo
#

I updated and work now

north nova
#

šŸ˜„

slate mortar
#

I remember like half a year ago I added an issue about a feature that was accidentally removed

#

He was like "yes I forgot to readd it after the UI rewrite" and now nobody knows if it comes back lol

native bramble
#

writed this function:

public static List<Block> getNearbyBlocks(Location loc, int r){
        List<Block> nearbyBlocks = new ArrayList<>();
        int minX = loc.getBlockX() - r;
        int minY = loc.getBlockY() - r;
        int minZ = loc.getBlockZ() - r;
        int maxX = loc.getBlockX() + r;
        int maxY = loc.getBlockY() + r;
        int maxZ = loc.getBlockZ() + r;
        for(int x = minX; x <= maxX;x++){
            for(int y = minY; y <= maxY;y++){
                for(int z = minZ; z <= maxZ;z++){
                    nearbyBlocks.add(loc.getWorld().getBlockAt(x,y,z));
                }
            }
        }
        return nearbyBlocks;
    }```
But with this for i **cant** go (means it or output one block in console or output nothing) through all blocks from list (list is not null) 
```java
@EventHandler
    public void onFurnaceExplosionEvent(ExplosionPrimeEvent e){
        for(Block b: Utils.getNearbyBlocks(e.getEntity().getLocation(), Math.round(e.getRadius()))){
            logger.warning("ExplosionPrimeEvent-"+b.getType());
            if(!furnaceMaterials.contains(b.getType())) return;
            removeFurnace(b.getLocation());
        }
    }```
native bramble
#

ohh i dont have internet on pc

#

later sry

onyx fjord
#

not even math

#

you can even just use faces

#

if its for a fixed radius

mental moon
#

Anyone been able to make a good decoy entity?
Like an invisible, uninteractable Cat/Ocelot to scare creepers away or a Wolf to scare Skeletons.
I need it to be attached (or follow) to the player in some way.
I have code that gets very close, but the entity will still be in the way and block hits and block interactions.
Is there a way for me to like, spawn an Item entity, attach it as a passenger, then trick the server into thinking it's a cat with packets or something?

young knoll
#

Does a cat actually block interaction when it’s on your head?

mental moon
#

Yes.
When attached as a passenger, it gets in the way from you doing anything.
Can't interact or mine or punch

young knoll
#

You can offset it by stacking it on something else and then stacking that on the player

mental moon
#

I could make a tower of Item entities all with nested passangers, but if the player needs to mine a block above their head it still will be in the way

young knoll
#

Or you can just constantly tp it to the players location + x

mental moon
#

That may work.

#

It's a shame I can't scare these entities with built in functions

young knoll
#

Or you could get messy with NMS and mess with creeper ai so they fear players

mental moon
#

I'm very happy having somehow not needed nms in my plugin yet.
I'll see what I can do with the bukkit api, then if the nms way is straightforward I'll dive in 🄲

young knoll
#

It should be

#

Iirc the scare ai goal can take any entity class

#

Including player

mental moon
#

I'll take a look

lilac dagger
mental moon
young knoll
#

Wait until I teach them to shoot arrows

mental moon
#

Very talented piggies for sure

flint coyote
young knoll
#

Lul

flint coyote
#

They also fly over lava and fire to then kill you. It's fun

fleet imp
#

I'm trying to make a command that would set a sort of timed event, as in one minute to react to the event. How do I set up a synchronous timer

young knoll
#

?scheduling

undone axleBOT
near kite
#

How I detect uhm slim mc skins

wet breach
#

skins are downloadable

near kite
wet breach
#

well skins are pictures

#

you only need to check within a certain size the squares missing color

near kite
#

so a blank texture where the arm area is

#

or i check if there is the black hex

#

mc gives

#

no wait that would cause problems

wet breach
#

you won't use the api here except for obtaining the link to the skin to download

#

once you have the skin picture, you will use the specs required for skins

#

then its checking the appropriate areas for missing color

#

or it has transparency

#

since it will be a png

near kite
#

exactly where

wet breach
#

from the byte information of the png

#

png has a spec itself

#

that tells you how each pixel is stored and its information

near kite
#

so what spec would i need to check

wet breach
#

png and mc skins

young knoll
#

You can also just use the PlayerProfile api

hybrid spoke
near kite
#

i am checking geysermc skins

#

too

hybrid spoke
near kite
#

and geysermcs skins arent in their api

wet breach
#

oh guess it has the slim thing

#

not sure if that solves their problem or not

#

but I suppose that works

near kite
#

cant use a spigtmc apii ether since what im doing is the backend of the plugin

hybrid spoke
#

you probably have to download the skin as an image and go through that pixels then

near kite
#

so how would going through the pixels work then

near kite
wet breach
#

it sounds like you are asking in a way you want us to do the work for you

near kite
#

no

#

i was just asking if i need to search the main area of the skin

#

i have a idea how

wet breach
#

I already told you png has a file specification in regards to how information with pixels are stored

#

you need to use MC skin specification so you know the size and areas you need to constrain your search

near kite
#

i think i did it

brave valve
#

My freind bought this plugin and because we are both new to this stuff, can anyone help me decipher what the develope was trying to say by this?

Just like before, make sure you have a development environment set up with the Spigot API and the necessary dependencies. Create a new Maven or Gradle project, create a new Java class named KillRewardPlugin in your chosen package, and replace the package name accordingly.

Ping or DM me if you can help

near kite
#

bruh

#

do you have any coding background?

hybrid spoke
young knoll
#

You bought a plugin

brave valve
young knoll
#

Why do you need to modify the code?

brave valve
hybrid spoke
#

tell him that

young knoll
#

…

hybrid spoke
#

communication is the key

young knoll
#

You bought a plugin and it was sent to you as text

brave valve
hybrid spoke
#

wha-

#

how-

#

tf-

brave valve
young knoll
#

šŸ™ƒ

hazy parrot
#

Ig you see smth new everyday here

#

KillRewards.txt

young knoll
#

Imagine you buy a burger from McDonald’s and they give you a small garden and a live cow

#

All I’m saying is if I’m paying for it I expect a compiled jar

#

(Or burger)

opal carbon
#

wait the dev just sent the text of one class

#

and then told you to add it to a class and compile it yourself?

#

that aint a dev thats someone using chatgpt

#

i bet theres no actual dev in this situation

#

i dont think theres a single actual human dev who would code it, probably with an ide, test it, then instead of sending a compiled plugin or even the source at least they just send unhelpful instructions of how to setup the project to build it yourself

echo basalt
#

Why the fuck is luckperms' bukkit plugin just a jar in a jar and a fancy classloader

slender elbow
#

because it needs to add the dependencies to the classpath

#

it just bootstraps everything

echo basalt
#

Elaborate

slender elbow
#

the plugin classloader does not allow you to add elements to the classpath (the downloaded dependencies)

#

so it uses its own classloader to do it

echo basalt
#

Yeah but the dependency manager system also has a separate classloader to load dependencies

#

Maybe I should learn about classloaders

#

I really want to do something similar but this is breaking my brain

slender elbow
#

you'll see a ClasspathAppender or something, that's an interface implemented by the bootstrap classloader to add jars to the classpath, and that's where the bulk of the dependencies end up in

opal carbon
#

isnt there a thing built into spigot for downloading maven repo dependencies at runtime

#

or do i misremember

echo basalt
#

There is but I'm not limited to spigot

opal carbon
#

yeah i was just generally curious

opaque scarab
#

Have you specified where to output the jar file?

#

No worries, we’ve all been there! When creating a plugin, you need to specify where the plugin is sent

chrome beacon
#

What does it tell you?

opaque scarab
#

The plugin file

chrome beacon
kind hatch
#

java -jar BuildTools.jar --rev 1.20.1
OR
java -jar BuildTools.jar --rev <VERSION YOU WANT> --output-dir /path/you/want/to/use

#

I don't do DMs from random people.

young knoll
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

#

Usage: !verify <forums username>

#

Rate limited. Please try again later.

kind hatch
#

Oof. That's a first for me.

opaque scarab
#

Unrelated, but what seems like a good way to detect a player opening a survival inventory?

kind hatch
#

BuildTools is not the spigot server jar.

#

It is the tool used to create the spigot jar.

#

Spigot has to be compiled manually because of legal reasons.

river oracle
#

you should send them the GUI

kind hatch
#

I did.

river oracle
#

oh dope

#

just double click the jar given you have java installed

kind hatch
#

If you use Windows, you download it and double click the jar file.

young knoll
#

Like, the players inventory?

#

Because that’s client side

river oracle
#

in XML what's the difference between something like this

<item>
      <name>""</name>
</item>

and something like this

<item name=""></item>
kind hatch
#

One's inline and one is treated as a subsection.

river oracle
kind hatch
#

I don't think it matters as long as it's parsed correctly. I think that's just a preference.

#

Follow the instructions. :3

#

Java 17?

#

Latest from where? Java 8 is the most common download.

chrome beacon
#

^^

#

Yeah you probably got Java 8

river oracle
#

get java from one of the links in the GUI that popped up

kind hatch
#

Use the download links provided in that error modal.

river oracle
#

I'd reccomend adoptium personally

chrome beacon
#

?java17

undone axleBOT
opaque scarab
# young knoll What is ā€œa survival inventoryā€

Yeah kinda bad phrasing. I’m trying to detect when a player accesses their own inventory. I know you can do the crappy way and repeatedly get the player’s inventory and type using a runnable, but isn’t there a more efficient way?

river oracle
#

install the .msi not the .zip

#

.msi is basically a .exe

kind hatch
river oracle
#

this is a good test run for the GUI to see how intuitive it is for newer users though

kind hatch
chrome beacon
#

Now let's watch how many will skip reading and just ask here

river oracle
kind hatch
#

Just reaffirms my belief that no one can read anymore.

#

sadge

young knoll
#

What’s a read

kind hatch
#

dies

river oracle
# kind hatch sadge

go through all the links in the GUI and specify to download the .msi or .exe or whatever it is

young knoll
#

Can you not link directly to the msi

river oracle
#

I mean it would get outdated eventually

#

us developers are lazy

river oracle
undone axleBOT
#

A private message has been sent to your SpigotMC.org account for verification!

kind hatch
river oracle
#

yes

#

if pepole read

chrome beacon
river oracle
#

if a linux user can't figure out how to install a java jdk they have bigger issues than BuildTools

#

but I suppose for mac

kind hatch
#

I'm pretty confident linux users would be able to figure out that these instructions are primarily for windows users.

#

Considering the line above says that downloads are available for all operating systems.

river oracle
kind hatch
#

What's their file format?

river oracle
#

idfk .apple šŸ˜†

#

šŸŽ

chrome beacon
#

dmg I belive

rough ibex
#

whatever it is, it's something stupid.

kind hatch
#

Looks like they also have .pkg

chrome beacon
#

I guess pkg is installer and dmg is executable?

#

No idea

kind hatch
#

Oh well. At least it all fits on one line.

river oracle
#

you could do something like this in the Gui

Windows (.exe / .msi)
Mac (.dmg / .pkg)
Linux (.deb / .rpm)```
#

this would cover a vast majority of people

chrome beacon
kind hatch
#

Hmm, lets see if I can shrink some this.

#

Time to find out if swing supports flexbox/gap.

river oracle
kind hatch
#

You making this for readability/ease of use? Or are you making this for custom data parsing?

chrome beacon
#

material > item-type

river oracle
#

probably within the next update

kind hatch
#

What's it supposed to represent?

river oracle
#

ItemType is the new Material for Items then there is BlockType for blocks

#

spigot experimental branch go brrrr

kind hatch
#

Oh

#

Man, that transition is gonna be wild isn't it.

#

I haven't even looked at it yet.

river oracle
#

its so much better and makes so much more sense

chrome beacon
#

Right I forgot about that

kind hatch
#

Is your vgroup tag supposed to be like a submenu of sorts?

river oracle
#

e.g.
1
2
3

#

vgroup's would cover the entire column of the inventory they are assigned too

kind hatch
#

Those would translate to slots:
0
9
18
right?

river oracle
#

for example in droppers it would be different

kind hatch
#

What happens if you have an item listed later down in your xml that conflicts with the slot?
Does it just get overriden?

simple schooner
#

how do I save an arraylist of textdisplays

river oracle
chrome beacon
#

Windows vps??

river oracle
#

I'm thinking about that right now. I feel like it'd be appropriate to error why would you explcitally define 2 items that override eachother

chrome beacon
#

What ip are you using to connect?

#

Where did you get it from

kind hatch
#

DDos Incoming.

chrome beacon
#

OVH has great DDos protection

#

So no problem

kind hatch
#

I was joking :d

river oracle
chrome beacon
#

It's 4am

river oracle
#

I kinda want feedback I want to design this well

chrome beacon
#

Try using localhost

kind hatch
#

Is the minecraft port on the VPS forwarded?

#

or at least open?

opaque scarab
chrome beacon
#

OVH handles that

#

Need to let Java access internet through Windows firewall though

kind hatch
#

I mean, overall the format is fine. That one line item creation seems really nice.
What does a one line item creation look like with a custom name?

opaque scarab
#

What seems like a good way to access the inventory of a shulker box itemstack?

river oracle
#

I haven't even started coding yet

kind hatch
#

Would be crazy if your parser could recognize which slots are being used more than once and warn you.

river oracle
#

I mean with a name right now you'd have to do

<item item-type="DIRT" row="1" column="2">
    <name>The Name</name>
</item>```
 but that's subject to change if you can just shove it up in the properties and it be fine
kind hatch
#

Oh, how do you plan on doing names with colors?

river oracle
#

MineDown

#

<name>"[Example Diamond](color=#fff-#666)"</name>

kind hatch
#

Ahh, I for some reason thought that was a link because I'm used to the markdown format.

chrome beacon
river oracle
chrome beacon
river oracle
#

MiniMessage is rammed into adventure

#

Why use adventure when spigot will soon be natively supporting BungeeChat on everything

#

I also already have the NMS code to add bungeechat to ItemStack's and Inventories

kind hatch
#

Ffs, it doesn't support it properly.

river oracle
#

I mean maybe I could justify adventure pre mappings, but now I can just copy paste my NMS between versions and change 1 number in the cratbukkit package name

kind hatch
river oracle
#

wow I have senior pictures tomorrow so I have to go to bed :( I wanna code though

river oracle
#

which is my only gripe about it since day 1 of using it

carmine mica
#

Nothing on any event

river oracle
#

but The BukkitAdapter for Adventure can't do that anyways

carmine mica
#

Well that’s why you use a platform that works with adventure natively šŸ˜…

river oracle
#

I'd prefer not to use paper api

#

I like my buggy crashy minecraft :P paper doesn't let that happen

chrome beacon
#

Paper module

lone aurora
#

Gradle isnt loading my dependencies for spigot, it works fine for gson but spigot wont load. (It worked before, but when i switched to linux it broke)

    mavenCentral()
    maven {
        name = 'spigotmc-repo'
        url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
    }
    maven {
        name = 'sonatype'
        url = 'https://oss.sonatype.org/content/groups/public/'
    }
}

dependencies {
    compileOnly "org.spigotmc:spigot-api:1.19.4-R0.1-SNAPSHOT"
    implementation 'com.google.code.gson:gson:2.10.1'
}```
It just doesnt load the External library for spigot
river oracle
river oracle
lone aurora
#

how do i invalidate the said caches? Ive reloaded the project many times

kind hatch
#

File > Invalidate Caches

wet breach
#

intelliJ is the only IDE that I know of, that has these unique problems with it XD

river oracle
#

Its a great IDE, but there's so many weird quirks

#

like when I used vsc didn't have any of these weird issues, but now I finding myself invalidating caches atleast once or twice a day

wet breach
#

seems to me they should remove this so called cache thing

lone aurora
#

It worked! šŸ™

wet breach
#

as it doesn't appear to work for its intended purpose

chrome beacon
#

I haven't invalidated caches in over a year now

tranquil ferry
wet breach
river oracle
# chrome beacon Paper module

also my whole thing with paper is if I want something that's not there I'll PR it and wait. I have a lot of patience because I don't run servers I have nothing banking on these features being released other than the enjoyment of working on a project. I'm kinda in a situation with a lot of my projects where I just don't care and I'm not in a rush for specific things

#

If you're running a server I can see just wanting that stuff if there's someone who provides it

#

its economically smart because it allows you to proceed with your server

#

I just like fucking around with server code and finding out how internals work and such its long fascinated me

wet breach
#

except some people who run servers tend to go to the extremes of expectations

wet breach
river oracle
#

everything is a while loop. I find more interesting the packets and such

#

networking etc

kind hatch
#

Omfg. Swing only supports HTML4 and CSS1.
I don't want to live anymore.

wet breach
#

well I guess we are going to lose shadow

river oracle
#

he was a good part of the GUI team guess I'll have to PR it now

wet breach
#

lol

kind hatch
#

I just wanted to put two divs next to each other. Guess that's too much to ask of CSS1

river oracle
#

mr nothixal

#

I should get a prize for this

#

PR #1234

#

okay this one is funny out of bounds horses crashing the server xD

kind hatch
#

Yooo, I forgot about that method of making holograms.

river oracle
#

pre armor stand

#

another one xD

#

keep trying so hard

#

damn fucking horses

wet breach
inner mulch
#

Is it smart (in terms of efficiency) to create a method, for a quite simple math equasion, that is being used often, or should i just leave it in the method that it is used in?

kind hatch
#

sigh Guess it's just gonna have to scroll to the top instead.

simple schooner
#

If I save an entities uniqueId will it also save their properties?

kind hatch
#

No, you have to save those manually.

simple schooner
#

Fffffffuuuuuuuccccckkkkkkkkk

inner mulch
#

what does java reflection mean and does it have something to do with creating instances of classes? (should I avoid it? I heard that reflection is bad for perfomance)

echo basalt
#

Java's reflections system is a native api for playing with classes and their fields and methods natively

#

Let's say you have something like

public class MyClass {

  private int number = 5;

  public int getNumber() {
    return number;
  }

}
#

You can access the number field and make it accessible

#
MyClass instance = ...;

Field field = MyClass.class.getDeclaredField("number");
field.setAccessible(true);
field.set(instance, 10);
#

You can also get constructors and invoke them in code

#

It's mostly used when dealing with hacky stuff

#

Like accessing private fields or injecting data

#

Or annotations

carmine mica
#

I heard that reflection is bad for perfomance
depends. It can be just as fast as normal code if you use the correct APIs and set it up correctly

echo basalt
#

Yeah so fields can be cached

#

Getting a field can be expensive but once you have it, it's quite fast

carmine mica
#

well anything, calling methods, getting fields, setting fields, anything can be jsut as fast

#

If you use the java.lang.invoke api with MethodHandles and those method handles are created and stored in static final fields, the is pretty much no difference between that and just calling the method, getting the field, etc. normally.

echo basalt
#

Reflections are also used when dealing with nms because you aren't doing imports directly

inner mulch
#

Okay, so that does mean my code isnt doomed perfomance-wise for using normal instances of classes to acces their methods?

carmine mica
#

if you can use objects normally, just do that.

inner mulch
#

So accesing methods from another class isnt slower than implemneting it directly into the method?

inner mulch
echo basalt
#

Nothing beats an object getter in terms of performance

#

Avoid reflections and use it if you get desperate :p

wet breach
#

in fact, an overly large class can be slower then if it were split up

carmine mica
#

gotta be a static final field tho, can't create them dynamically

echo basalt
#

There's still the overhead of having to fetch the method

carmine mica
#

when the class loads, like so when your plugin loads

#

don't care about that really

inner mulch
#

I dont really understand what you guys are talking about

wet breach
#

well you asked

carmine mica
#

there's just different reflection APIs in java, the classic reflection and MethodHandle

inner mulch
wet breach
#

now you are getting answers that are way above your level of understanding šŸ˜›

echo basalt
#

Yeah maybe you should understand the questions you're asking about

inner mulch
#

I use this to get methods Main.getinstance.getclass. getmethod?

#

Is this bad?

echo basalt
#

What's the point if you can make a getter instead?

carmine mica
#

you shouldn't be using any reflection to get something in your own class like that

#

just add a method to get what you want

echo basalt
#

Reflections are made to access classes you don't have control over

#

(or to parse annotations)

wet breach
#

or in the rare circumstance, the micro optimization to bypass some thing

echo basalt
#

Pretty much

inner mulch
#

In terms of clean Code or Performance?

echo basalt
echo basalt
inner mulch
#

So i shiuld be using getters?

echo basalt
#

Yeah

#

It's basic java

#

Don't try to be smarter than you are, just stick to the traditional methods and you'll go far

#

There's a reason you don't see reflections for every getter in enterprise code

inner mulch
echo basalt
#

You still need an instance to invoke it

#

And if you have an instance and control over the class why not make a getter in the firs tplace

inner mulch
#

I dont really ever used getters because i got this

wet breach
#

you do use getters

#

just don't understand fully what a getter is

#

šŸ˜›

echo basalt
#

Yeah pretty much

inner mulch
#

If I use getters why is my getter Bad šŸ˜•

echo basalt
#

Because what you think is a getter is in reality an overcomplicated Field#get(instance) method

wet breach
#

But yeah sticking with basics though is generally sufficient for most things and is adequate enough

#

without resorting to some weird method of doing things

#

you should only change how you are doing something if only its a problem identified from testing and profiling

inner mulch
#

I mean its not a problem i was just worried that it is ineffiecnt

wet breach
#

well it is or can be because it isn't providing you with any advantage doing it that way then from the normal way

echo basalt
#

premature optimization moment

#

We should just switch to c++, java's too unoptimal

#

Still waiting for the day we have dedicated minecraft server hardware

wet breach
#

lol, I wish it would be so easy to have some people switch to C++ just to show them the beauty of java in how it optimizes your stuff quite well

#

because in C++ its left to you to optimize but it also won't tell you where its not optimal either

#

if it works, C++ is happy with it as much as you are

echo basalt
#

TBH profiling in java can get pretty cumbersome

#

I paid 100$ for a PERSONAL 1 year license for yourkit

#

all the enterprise stuff is in the thousands

wet breach
#

yeah but like its so much better then trying to profile a native application though

inner mulch
#

Guys is there a Guide on how i can use getters properly?

wet breach
#

?learnjava

undone axleBOT
inner mulch
#

Pls no

echo basalt
#
private final int whatever = 123;

public int getWhatever() {
  return whatever;
}
#

bam

#

But, for collections, make sure to return an immutable version or a defensive copy

inner mulch
echo basalt
#

In every class

#

Main or not

#

It's part of the Encapsulation principle

#

Where you never expose internal values directly

wet breach
#

literally it is impossible to not use a getter in Java

echo basalt
#

But instead make the values private and expose get/set methods as you wish

#

You end up having better control, such as returning a copy or only allowing non-null values to be set

#

And also get to follow basic code principles (yipee!)

wet breach
#

so at the most basic level, a getter is just a method that gets something, whether it be a value or an object or instance etc.

echo basalt
#

In the most basic terms, in java everything is a method, unless it's a field or a constructor

wet breach
#

The reason you see guides explain this a bit differently is because typically people have an issue in regards to using getters for collections or similar where you are not using such methods in a way that is pointless

inner mulch
#

I dont think my getter is that bad its just that i can acces it from every class and dont need to get it everytime i want to use it

echo basalt
#

This is a method:

public/private/protected <Insert Return Type Here> methodName(Param1Type param1Name ...) {
  // implementation
  return /*<Return type, or nothing if it's void>*/;
}
#

What is commonly referred to as a "getter" is just a method that returns a field directly

wet breach
echo basalt
#
public int doWhatever(String input) {
  return input.length();
}

Is a method, of public accessibility, with the return type int, named doWhatever, where the first parameter is of String type and called input

#

So we must return an integer

inner mulch
#

Ik what methods are

echo basalt
#

So you understand that a basic getter is just a method that returns a field's value

wet breach
#

well just know what you are asking or having some confusion over is basic java stuff

inner mulch
#

I have a getter in a class

echo basalt
#

Alright

#

Can we also agree that it's the most basic form of method, as it holds no logic other than just returning a value

inner mulch
#

Yes i have somthing like this

#

I understand the concept but i dont know what wrong about Main.getinstance.getclass.getmethodfromotherclass

wet breach
#

Main.getinstance.getclass.getmethodfromotherclass if the method that you really wanted is in a different class, then why are you not calling the method from that class directly? Why go through the main class?

inner mulch
#

You are correct, but i got tired after doing this over and over again from class to class, so that i just get it from mainclass

wet breach
#

This breaks OOP fundamentals which is what Java is primarily for. This is more inline with how functional programming is.

inner mulch
#

OOP?

wet breach
#

Object Oriented Programming

inner mulch
#

It breaks the OOP, but my code doesnt break, whats the problem with it?

echo basalt
#

Stick to standards

wet breach
#

I mean yeah the code works, just it isn't appropriate or correct is all lol. Java excels at doing Object oriented stuff, its what it is primarily designed to do. This isn't the say that using functional programming is inherently slower, unoptimal or whatever else but it could be depending on what you are doing and more easily. Java does a lot better if you stick with object oriented programming, even more so when it comes to stack traces or errors. If you call a method like you are and it returns an NPE, the stack trace is going to contain unnecessary entry/exit points of the overall execution that resulted in the NPE. There is many other reasons such as standards as well in why the way you are doing it isn't correct.

inner mulch
#

why is it incorrect, if it isnt slower or unoptimal? And it works

echo basalt
#

Welcome to code architecture

inner mulch
#

I know the standards

echo basalt
#

No you don't

inner mulch
#

No I know (bacause of) the standards

echo basalt
#

The standards aren't made as a "because I said so"

inner mulch
#

What?

echo basalt
#

They serve a purpose

#

Their goal is to make you write code that's more reusable, easier to test and enforces ownership

#

When writing a class think "Is this function supposed to be the duty of this class?", will help you avoid writing crazy functions for data objects that should belong elsewhere etc

inner mulch
wet breach
# inner mulch why is it incorrect, if it isnt slower or unoptimal? And it works

because it uses reflection and yes it can end up being more slower or unoptimal. By how much? Well it really depends on the code being called in that way. Granted for the most part you probably wouldn't notice the difference, but do note the JVM has a more difficult time optimizing reflection, then if you were to just stick with the standard way of doing things.

echo basalt
#

If you were to port your entire project to bungeecord, how big of a percentage would need to be re-done? That's a basic example on code re-usability

inner mulch
#

I never used bungeecord

wet breach
#

however it seems pointless though that you keep asking why it is wrong when it is clear your reasoning is because you want to be lazy and ignoring anything else in regards to what is being explained. That is fine, however that isn't justification in whether it is the correct or wrong way of doing things, just you don't want to go through the appropriate coding etiquettes.

inner mulch
#

I would change it, but only if there is evidence that this is perfomance wise worse

echo basalt
#

Maybe you're too caught up in performance to actually care about code quality

simple schooner
#

why is there two exclamation point before the UUID I saved in the config file

#

it's like !!(entity's UUID)

wet breach
#

so you mean before?

simple schooner
#

yeah

#

sorry bout that my brain is melting

wet breach
simple schooner
#

cuz it shows "java.util.UUID (entity's UUID)"

wet breach
#

yes

#

what it is doing is saving it as a Java object

#

but before I assumed that I wanted to see what it looked like first šŸ˜›

echo basalt
#

Yeah I usually just write a basic codec type thing

#

I'm not a huge fan of bukkitserializable's yml format

wet breach
# inner mulch I would change it, but only if there is evidence that this is perfomance wise wo...

just like what was stated, there is more to programming then just performance. It has already been explained to you how it could be less performant as well and that you may not really notice the difference. How you choose to program is up to you, but when you ask however in why it is wrong and others here explain to you why it is. You shouldn't dismiss the explainations all because you don't notice a performance difference. I am not going to go out of my way to create a test application to show you the difference because you want evidence. In large part, the majority here who help are not going to lead you astray or purposely tell you false information and quite a lot of us are very experienced in the programming field.

echo basalt
#

I should write a config codec system

inner mulch
echo basalt
fluid river
#

whats goin on

fluid river
#

nuke?

simple schooner
#

Is there anyway to detect if the player closes the inventory by pressing E?

valid beacon
#

Guys. I need an encoder for payment. For a permanent job

simple schooner
#

InventoryCloseEvent gets triggered by the closeinventory method

zealous osprey
#

Cause I don't think there is

simple schooner
zealous osprey
#

You could create a situation where the player could only close the inventory by themselve and not from outside sources.

#

But they could always just close/crasg the game to close it

simple schooner
zealous osprey
#

Isn't that what you want to check for? That the player closes it?

simple schooner
#

oh wait lemme rephrase that

#

So basically when they press confirm, the inventory closes so that they can type the hologram's text in chat

#

wait nvm

#

i'm just gonna think of another solution

ivory sleet
#

There is a packet server bound u could check for

undone axleBOT
ivory sleet
#

Altho things like world change, logout etc do close inventories as well right?

tender shard
tender shard
tender shard
remote swallow
#

im gonna guess a paid coder

tender shard
#

this is the first time I'm using &= I think

remote swallow
#

wtf for

slate mortar
#

and mcdev provides me with all the autocompletion

tender shard
remote swallow
#

so it should stuff run them, regardless if any fail?

tender shard
slate mortar
#

i dont really do plugins anymore lol, so idk

tender shard
slate mortar
#

but this is kinda self-explaining lol

sand lion
#

When I use this, whenever I get the output item, the lore I created doesn't show up on the outputted item:

        for(Material acceptedItem:acceptedItems) {
            ItemStack newTool = new ItemStack(acceptedItem, 1);
            ItemMeta newToolMeta = newTool.getItemMeta();
            newToolMeta.setLore(List.of(ChatColor.GOLD + "Test"));
            newTool.setItemMeta(newToolMeta);

            NamespacedKey recipeKey = new NamespacedKey(this, "test" + acceptedItem.toString());
            RecipeChoice trimChoice = new RecipeChoice.MaterialChoice(Material.AIR);
            RecipeChoice baseChoice = new RecipeChoice.MaterialChoice(acceptedItem);
            RecipeChoice additionChoice = new RecipeChoice.ExactChoice(createTestItem());
            
            SmithingTransformRecipe smithingRecipe = new SmithingTransformRecipe(recipeKey, newTool, trimChoice, baseChoice, additionChoice);

            Bukkit.getServer().addRecipe(smithingRecipe);
        }

Does anyone know why this is happening? Like does the lore get removed because of the way the smithing table works?

slate mortar
#

easy as heck

sterile breach
sterile breach
slate mortar
#

is a creeper a block? ._.

sterile breach
#

NO

slate mortar
#

so will it work? :=

sterile breach
#

entity explosion?

slate mortar
#

there's probably an EntityExplosionEvent too

sterile breach
#

and that's why blockexplode can be activated (tnt is an entity)

slate mortar
sterile breach
slate mortar
#

uhh

#

you mean when a specific block is removed due to an explosion nearby?

sterile breach
#

yes, let's say that if the block is a gold block, I need to know it in order to act accordingly (I record it in a recovery inventory).

tender shard
simple schooner
#

LETS GOO I FINALLY FINISHED MY FIRST PLUGIN

tender shard
#

oh well for gold blocks you won't need some of those

slate mortar
#

problem there is i doubt that all of them contain the "destroyed" blocks

tender shard
slate mortar
#

i mean, isnt there a basic BlockChangeEvent or smt

#

would make sense

simple schooner
#

Holy shit i got my first happy user

mellow edge
#

is every resource (plugin) on SpigotMC reviewed before published?

#

(for safety...)

quaint mantle
#

i think only paid

#

but i could be wrong

mellow edge
#

well if not then this is a high risk

simple schooner
#

My friend's server got backdoored

flint coyote
#

Paid ones guaranteed. Some suspicious free ones (or reports obviously), too

#

Wouldn't say every single one. At least not by a human

quaint mantle
#

Yes, don't make a bot review a resource

onyx fjord
#

I check every resource I download for the first time

#

As y'all saw tomorrow

#

Yesterday

quaint mantle
#

Curseforge removed and "detected" a virus on my plugin, which is on BBB, PolyMart and of course, spigotmc

onyx fjord
#

I deleted my cf account

#

Useless platform

quaint mantle
#

It's better to leave virus checking yo an human

quaint mantle
onyx fjord
#

I don't want ads on my resources

#

Which I get paid nothing for

quaint mantle
#

A lot of websites put ads too

#

That's not curseforge problem, the problem is that, it allows you to pay to stop viewing ads

#

Bro thinks he's an android game

#

šŸ’€

dire marsh
quiet ice
#

It's not much inside bukkit world

quiet ice
drowsy cloud
#

It is possible to use villager trade gui on spigot plugin ?

quiet ice
#

Yep

smoky oak
#

hey geol is there a way to flag my shit for automatic review? There's a few ways i think i might be able to get perms or backdoors

drowsy cloud
smoky oak
#

like the automatic review thingies

#

can i manually sick them on my stuff

quiet ice
#

Why would they be disabled in the first place?

smoky oak
#

wasnt it mentioned above it's not automatically done for free resources?
also I'd like to see the results, to see if and what it found

quiet ice
#

Also, spigot does its own kind of malware analysis that to my knowledge has little chances of false positives

#

Or rather said the resource is reviewed manually sometime after an upload

#

The automatic malware scanning process is intrinsic to CF/Devbukkit

smoky oak
#

ah makes sense

#

though wouldnt that mean if someone hides something in a super large project it might be undetected for months?

simple schooner
#

How do I continuously rotate an object

#

Is there like any loop for that

smoky oak
#

?scheduler

#

?scheduling

undone axleBOT
smoky oak
#

that

simple schooner
#

Oh alr

#

Thought I was gonna use while loops

smoky oak
#

wouldnt work

simple schooner
#

Alr

smoky oak
#

while loops would brick the thread

#

so your server would freeze

simple schooner
#

And one more thing

#

Can a player interact with display entities

smoky oak
#

depends what you mean

#

like the event should fire

#

but it's not like display entities have their default behaviour

young knoll
#

No

#

They have no hitbox

smoky oak
#

thats optional

simple schooner
#

Aight ty

smoky oak
#

isnt it?

native bramble
#

I need to remove furnace from some list which contains locations of different furnances.
here is func:java public static List<Block> getNearbyBlocks(Location loc, int r){ List<Block> nearbyBlocks = new ArrayList<>(); int minX = loc.getBlockX() - r; int minY = loc.getBlockY() - r; int minZ = loc.getBlockZ() - r; int maxX = loc.getBlockX() + r; int maxY = loc.getBlockY() + r; int maxZ = loc.getBlockZ() + r; for(int x = minX; x <= maxX;x++){ for(int y = minY; y <= maxY;y++){ for(int z = minZ; z <= maxZ;z++){ nearbyBlocks.add(loc.getWorld().getBlockAt(x,y,z)); } } } return nearbyBlocks; }
here is my event:java @EventHandler public void onFurnaceExplosionEvent(ExplosionPrimeEvent e){ logger.log(Level.INFO, () -> "ExplosionPrimeEvent-"+e.getRadius()); for(Block b: Utils.getNearbyBlocks(e.getEntity().getLocation(), Math.round(e.getRadius()))){ logger.warning("ExplosionPrimeEvent-"+b.getType()); if(!furnaceMaterials.contains(b.getType())) return; removeFurnace(b.getLocation()); } }
what i get in console:

[SmeltingParticles] ExplosionPrimeEvent-4.0
[SmeltingParticles] ExplosionPrimeEvent-STONE```
I dont know why, i can't get through the entire list which return `.getNearbyblocks`. List in not null and contains many different `CraftBlock`'s
smoky oak
#

thats simple

fluid river
#

cuz you return

#

not continue

smoky oak
#

oy

#

i was here first šŸ˜…

fluid river
#

oh shit

smoky oak
#

but yea he right

#

the return stops your loop

fluid river
#

your loop kills itself after first block

#

if it's not a furnace

native bramble
#

i need to create variable?

fluid river
#

no

smoky oak
#

no

native bramble
#

ohhh

smoky oak
#

either replace return with continue

native bramble
#

yeah rly

#

im stuped

fluid river
#

if(!furnaceMaterials.contains(b.getType())) continue;

native bramble
#

ty

#

yeah

flint coyote
smoky oak
#

or do if(material == Material.FURNACE) b.remove

fluid river
#

do freejavalessons for him

shadow night
#

I remember when I did return my IDE yelled at me

smoky oak
#

my ide only yells at me for

  1. typos
  2. unused
  3. this aint compiling mate
shadow night
#

Lol

shadow night
#

how do I know if there is a certain plugin on the server?

#

no, I mean in code

#

I don't care what are installed when I'm playing

hazy parrot
#

Oh certain plugin, I read get all plugins

#

There is PluginManager#isPluginEnabled

#

It have overload for string (name) and plugin instance

shadow night
hybrid turret
#

Hello, kinda super general Java question and also kinda embaressing tbh:
This is in Bukkit.class of the Spigot/Bukkit Library:

#
  public static void reload() {
    server.reload();
    CustomTimingsHandler.reload();
  }
hazy parrot
hybrid turret
#

How do I find out what server.reload() does while server is just an Interface? Am I stupid?

shadow night
hazy parrot
undone axleBOT
lilac dagger
#

import spigot from build tools and look into CraftServer

shadow night
#

what the heck is that, codeblock where

hazy parrot
shadow night
#

``` still exists

hybrid turret
hazy parrot
#

You have search in top right

#

Just search for CraftServer

shadow night
#

if there is craftbukkit, is there craftspigot?

hybrid turret
#

lol didnt work for me but i found it

hazy parrot
hybrid turret
#

If I basically want to change the messages the server sends for reloading, Do I just override the command "reload" and put Bukkit.reload() in there?

stuck imp
#

Hey I have a rather complicated request, do you know how to make a java code or when the player connects to the server. The plugin connects to this link: https://www.xdorgluckuniverse.net/musername/xdorgluck (if the player who just connected is called xdorgluck), and checks if the username appears on the page ?

Xdorgluckuniverse

XDorgLuck

#

The plugin will then send information to the Minecraft server that the user is premium

onyx fjord
#

Make a rest api

#

Not a html page

stuck imp
#

on my website?

onyx fjord
#

Yeah

stuck imp
#

How can I do ?

onyx fjord
#

Scraping the page is a pain

hazy parrot
#

Asking how to make rest api is kinda vague question

onyx fjord
#

Yeah + you have a million frameworks for that

#

Spring etc etc

#

@stuck imp or you can at least make a blank .txt file

#

That will be easier to work with

stuck imp
#

I'm on wix

#

And I use Velo developer Mod

#

// backend function in Velo
import wixData from 'wix-data';

export function getUserData(username) {
return wixData.query("MUsername") // Use your collection ID here
.eq("musernameclass", username) // Use your field key here
.find()
.then( (results) => {
if(results.items.length > 0) {
return results.items[0];
}
return null;
} )
.catch( (err) => {
console.log(err);
} );
}

#

I use this to retrieve the username:

onyx fjord
#

šŸ’€

stuck imp
#

?

onyx fjord
#

Wix

stuck imp
#

Yes

#

What I want to do is possible, I just don't know how

chilly hearth
#

hey

#

i need help installing my servers

#

server*

#

i can that

#

i ran that*

#

it asks me the versoin

#

then java

#

and i enter then it says done the next seconda and a folder is created with buildtools.jar but not spigot 1.18.1 ;-;

shadow night
#

can I somehow prevent the death message from saying what weapon a person was killed with? I don't want people to know shit about the cool sword from my plugin

hybrid turret
#

You can customize the Deathmessage to your liking by adding an EventListener for PlayerDeathEvent.

#
@EventHandler
public void onDeath(PlayerDeathEvent event) {
  Player player = event.getEntity().getPlayer();
  event.setDeathMessage(player + " died.");
}
#

Something along those lines

#

That would be absolutely no information at all

#

Weird question but what happens if you create a new Player() does a model appear somewhere or something? Just something I was wondering about

eternal night
#

no

#

player is an interface

#

not much to create there

steel bloom
#

I saw that some servers have this font is it some spigot feature? Are ordinary characters converted to unicode and where could I find such a font

https://imgur.com/a/TrQvwSC

placid moss
#

texture pack

#

or unicode

#

i think theres like a link somewhere in this chat

#

to the font

quaint mantle
#
com.devotedmc.ExilePearl.core.ExilePearlCore is not abstract and does not override abstract method getDefaultBiomeProvider(java.lang.String,java.lang.String) in org.bukkit.plugin.Plugin```
#

any reason this keeps happening

placid moss
#

ExilePearlCore does not override method getDefaultBiomeProvider

#

is this your plugin

#

also why are you overriding plugin

#

shouldnt it be javaplugin

shadow night
placid moss
#

id

#

k

#

istg i saw the link to it like 5 times

shadow night
#

small caps

#

maybe

opal saffron
#

hi, i am trying to teleport player into the boat, but it doesn't work

Boat b1 = (Boat) world.spawnEntity(l1, EntityType.BOAT);
            b1.setBoatType(Boat.Type.OAK);
            b1.addPassenger(p1);
#

i'm getting no error

#

what am i doing wrong

smoky oak
#

have you added a check if your code actually runs?

#

happens to me way more often than it should

opal saffron
#

yes it runs

#

it spawns the boat but doesn't put me in it

smoky oak
#

what's the return of your boat.addPassenger

#

does it say tru or false

hybrid turret
#

how do i get an inventory that i saved in a yml file beforehand?

#

it's something along the lines of config.get...(path) or sum, but idk exactly how

pseudo hazel
#

idk how you saved it

hybrid turret
#

I used a Hashmap

pseudo hazel
#

of what

hybrid turret
#
public void saveVault(int number, Inventory inventory) {
    LinkedHashMap<String, Inventory> inventoryHashMap = new LinkedHashMap<>();

    if (!cfg.contains("Vault " + number)) {
      inventoryHashMap.put("inventory", inventory);

      cfg.set("Vault " + number, inventoryHashMap);

      try {
        cfg.save(file);
      } catch (Exception ex) {
        ex.printStackTrace();
        Bukkit.broadcastMessage("Saved.");
      }
    }
  }
smoky oak
#

uh

#

that saves your hashMap memory address i think

#

not the actual map

pseudo hazel
#

what does the file look like

opal saffron
smoky oak
#

anything elsse in console

opal saffron
#

nothing

pseudo hazel
opal saffron
#

same output

#

even teleporting close to the boat

hybrid turret
#

I don't have the file rn bc i'm not at my usual pc and i only have the project due to github.

The file looks something like this:

Vault 0:
  - inventory:
    - item
    - item
...
#

iirc

smoky oak
#

oh actually @opal saffron it might be that players are special in some way, lmc

#

huh nope

#

yea im out of ideas

opal saffron
smoky oak
#

yeah

#

the true return means spigot thinks it put teh player in the boat

#

idk why it didnt

pseudo hazel
hybrid turret
#

yeahhh idk why i was a dumdum and forgot about just get

#

lol

#

i mean i obv have to test that at some point but for now i'll hope this works lol

opal saffron
#

fck

opal saffron
#

now it works :)

chilly hearth
young knoll
#

Idk where that script is from

#

Just run buildtools manually

chilly hearth
#

how ?

chilly hearth
young knoll
#

Download the jar, open command line and run java -jar BuildTools.jar --rev 1.20.1

chilly hearth
#

command line ?

hybrid turret
#

what os are you using?

#

linux or windows?

#

or mac

chilly hearth
#

windos

#

windows*

hybrid turret
#

type cmd in the search bar

chilly hearth
#

ok thats opened

#

Error: Unable to access jarfile BuildTools.jar

hybrid turret
#

then you navigate to the folder where the BuildTools.jar is using cd <path>

#

then you execute the command above

#

in order for the cli to find the jarfile you need to be in the folder or add the absolute path

chilly hearth
#

alr

hybrid turret
#

np :))

smoky oak
hybrid turret
#

does it make sense to have saveDefaultConfig() in both onEnable and onDisable?

smoky oak
#

not really, it writes the included config if it doesnt exist

#

if its not there on disable you have other problems lol

hybrid turret
#

oh okay lmao

#

Is there anything (except for some message) that makes sense to put into onDisable?

smoky oak
#

tons

#

mostly all the data you need to still have next time

#

but cant save immediately after you access it

hybrid turret
#

for example?

smoky oak
#

for example if you do something that constantly changes. If you make custom behaviour for stuff

hybrid turret
#

hmmmmmm

smoky oak
#

also if you save anything in files, you shouldnt do it on every change

#

i/o is slow

hybrid turret
#

hmm

#

well

inner mulch
#

guys why does an event on if(ageable.getAge() == ageable.getMaximumAge()) is being called even though the nether wart is only at stage 2? (it works at stage 3 too, but below 2 it isnt called as intended)

hybrid turret
smoky oak
#

well yes but only if your plugin or the server crashes

#

which again

#

bigger problems

hybrid turret
#

well, true

#

would it make sense to have some async timer running that saves everything after some time?

#

or could that be l a g?

smoky oak
#

eeeh async data is difficult to design properly

#

it may lead to corruption if you dont lock it, at which point you might as well spare yourself the headache

hybrid turret
#

tbh best for me to stay away from that anyway, never worked with async

#

If I have something like a /back-command what is the best way of storing, using and then deleting the locations for that?
I have it working right now but only using a file where the locations are constantly saved everytime a player dies and is then deleted once the player uses the command.

hazy parrot
#

There won't be concurrency if it won't be accessed at same time from multiple thread, hence no needs for lock

hybrid turret
#

And I feel like with a lot of players that would be slow asf

smoky oak
#

uh you could just keep it in a player list too

#

i dont think this needs to persist over restarts

hybrid turret
#

also: i have a command that uses nametags as a key. this key can sadly be renamed or used on entities though and therefore destroyed, which will effectively lead to staff having to restore keys constantly which would be stupid.
how to i prevent players from changing the displayname, crafting with it and using it except for on doors?

young knoll
#

Why does renaming it mater

smoky oak
#

use the item uuid

young knoll
#

Store the key data in pdc

#

Not the name

hazy parrot
#

^

hybrid turret
#

changing the name technically doesnt matter

young knoll
#

As for crafting you can use the PrepareItemCraftEvent

#

For using in mobs there is PlayerInteractEntityEvent

#

There’s also InventoryClickEvent to handle villager trades

hybrid turret
#

it's just it's a special name which you can't get again and you get more than one key to give to trusted people.

what's not working is the EventListener for the key being used.
The rest is stuff that came to my mind while writing the question lol

young knoll
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

hybrid turret
#

sorry lol

#

hold on

#

What's the difference between PlayerInteractEvent PlayerInteractAtEntityEvent and PlayerInteractEntityEvent??

young knoll
#

First one is for interacting with not entities

#

Second one is special and is only really useful for armorstands

#

Third one is for interacting with entities

hybrid turret
#

oh-

smoky oak
#

note

hybrid turret
#

that's the only event i didnt check wtf

#

this is confusing lmao

smoky oak
#

right clicks on air with no items dont trigger the interact event

young knoll
#

^

inner mulch
#

guys since when is sugar cane ageable?

young knoll
#

Since always afaik

shadow night
#

It always was

inner mulch
#

but it isnt like wheat with many different states?

#

sugar cane grows new blocks

young knoll
#

It is

#

It has states

shadow night
#

Yeah, when it reaches max age it grows a new cane on top

young knoll
#

Once the state reaches the max value then it tries to spawn a new block

inner mulch
#

ok, thank

#

you

hybrid turret
#

?gui

#

not the right command ig lol

#

thought it was

#

found it

#

What is the proper way of getting an OfflinePlayer, since Bukkit.getOfflinePlayer(String name) is depracated?

#

I mean it totally makes sense that it's depracated since you can change your name and if you're not on the server a different player could have taken that name.
But how do I get the UUID if I want to e.g. add a whitelist override? (so i only have the name from args)

river oracle
#

Just not recommended in most cases

bright needle
west sail
#

Hey I updated the server to 1.20 and now I always get an error when waterfall is executing the proxyplayer.chat() function: java.lang.UnsupportedOperationException: Cannot spoof chat on this client version!

So far only one has mentioned this issue a year ago but so far I can't see a fix or workaround for that.
https://github.com/SpigotMC/BungeeCord/issues/3327

Do you guys have more info on that topic?

GitHub

16:12:01 [SEVERE] Task BungeeTask(sched=net.md_5.bungee.scheduler.BungeeScheduler@246f8b8b, id=14238, owner=net.william278.huskchat.bungeecord.HuskChatBungee@7eb9bffa, task=net.william278.huskchat....

bright needle
#

Oh-

river oracle
#

?services

undone axleBOT
bright needle
#

Oh- thanks

hybrid turret
river oracle
#

Chat signing stops chat spoofing from being realistically possible

river oracle
west sail
river oracle
hybrid turret
river oracle
#

Don't store the entire offline player object sounds like a waste why are we not comparing uuids in your system all it takes is comparing uiids once you get the offline player var

river oracle
hybrid turret
#

Wait, I think I donā€˜t get how the OfflinePlayer works

river oracle
#

Bungee supports 1.8-latests natively thus the api works for those versions natively depreciating it for

river oracle
#

I'd have to recheck stash but I believe that's what's done

hybrid turret
#

Okay so i can loop through that checking for the uuid but how do i get the uuid from my system?

river oracle
#

Why would you loop and not use a hash set

hybrid turret
#

Uhmmmm tbh maybe iā€˜m dumb lmao guess i donā€˜t have as much java knowledge as i thought

river oracle
#

Hash set contains look up time is o(1)

west sail
hybrid turret
#

I think iā€˜ll need to come back to that later when iā€˜m home

river oracle
#

Then use a hash set instead of an array list

#

In your java code to store those players uuids

pseudo hazel
#

yes but for only like 100 players it generally doesnt matter

#

but using a set in this case is also just cleaner

pseudo hazel
#

like the performance difference can be ignored

river oracle
#

It does matter using proper data structures for a job should be something you just do

pseudo hazel
#

yes

#

but saying its because of the lookup time is kind of a weak argument

pseudo hazel
sand lion
#

It should be a new item (same material as passed in), but with a new meta

pseudo hazel
#

?

#

all im asking is if you used item.setitemmeta(newmeta)

sand lion
#

yes

pseudo hazel
#

otherwise the meta will not be updated regardless

#

hmm, maybe the meta doesnt work for recipe outputs?

#

idk I never made recipes

hybrid turret
pseudo hazel
#

json is super easy, yml even easier and both are pretty much baked into spigot or java

#

you can use the gson library for json stuff

sand lion
#

anyway I could know for sure? I wanna know if I should continue this plugin or not

hybrid turret
#

Yeah rn i use yml but i hate it so much

pseudo hazel
#

and spigot configuration file stuff for yml

hybrid turret
#

Yeah thatā€˜s what makes yaml so easy lmao

pseudo hazel
#

maybe try again with someone else in chat

#

what do you hate about yml

hybrid turret
#

Iā€˜m not sure if i mentioned this already but i have no idea about hashsets

hybrid turret
#

Json is so much better