#help-development

1 messages · Page 122 of 1

lost matrix
#

Static needs to be stateless. Final and immutable.

#

Here are some examples

#

So have a fixed timestamp in your timers and use a single task to check on them.
There is a very well performing approach by using a PriorityQueue but thats probably
a bit too complex.

quaint mantle
#

alr

warm light
#

should I create new thread on db(mysql) writing?
or it will work fine on one thread?

boreal seal
#

how to get block number ID?

#

ill check docs first

fathom otter
#
...
netherite:
  world: world
  loc1: [-5. -55, 6]
  loc2: [-9, -51, 10]
  blocks:
    ancient_debris: 90
    netherite_block: 10```, the list I get from `section.getIntegerList("loc1")` returns [6] and I have 0 clue why
lost matrix
lost matrix
lost matrix
fathom otter
#

I might be a teensy bit stupid

boreal seal
#

i already found it ;.

lost matrix
boreal seal
#

i use the anicent past versions

#

...

#

suddenly rn

fathom otter
#

There's a reason it's deprecated though lol

lost matrix
#

He's using an ungodly old version. 1.8 probably. Garbage.

boreal seal
#

ik

#

yeah dogshit api

#

what can we do about it

lost matrix
#

Tell people that want development work for this version to fk off

#

Its only a handful of people that play this version anyways

boreal seal
#

its like a mirror its same to new that old cant use due new features in newer versions

#

idk man i dont really decide what to code i do community requests

#

which are getting removed later from spigot due obsfucation 🤮

young knoll
#

What

fathom otter
boreal seal
#

because some rats reported it

fathom otter
#

i mean the largest server in the world uses 1.7

lost matrix
#

Why obfuscate community requests? Why obfuscate at all? There is 100% nothing worth decompiling and the stack traces are horrible to read.

lost matrix
boreal seal
#

so

#

they work smoothly

fathom otter
boreal seal
#

either in case if there configs and the fool wrote down something not possible i check it as well during start up

fathom otter
#

but i do agree, 1.8 apis were bad

young knoll
#

Imagine obfuscating community requested plugins

boreal seal
#

i do it for free

lost matrix
fathom otter
young knoll
#

Why would you make something for free

#

And then obfuscate it

lost matrix
boreal seal
#

stats based on what

#

lol

lost matrix
#

6.3% is nothing.

vocal cloud
#

The only reason the biggest server uses 1.7 is because they've spent millions of dollars you don't have paying java engineers to develop custom solutions for the version and upgrading is probably too expensive

boreal seal
#

amount of empty servers is huge

#

lmao

#

this precentage based on servers without any players

#

so please.

fathom otter
#

that's what i thought. big servers likely disable bstats, and if a server uses viaversion/protocolsupport (correct me if im wrong) it won't show

boreal seal
#

only some wierd ass servers

fathom otter
lost matrix
boreal seal
#

with 25%

#

lol

#

there way more

fathom otter
#

@lost matrix if you think about it, there are probably more empty servers in the latest version

lost matrix
fathom otter
#

actually

#

hmm

#

nvm

boreal seal
#

orvit

#

just give up

#

they just hate the old versions

#

and when i ask an question i end up with

lost matrix
boreal seal
#

?howoldis18

vocal cloud
#

People high on copium think they can make a 1.7 server that will remotely be as successful as just using 1.19 and all the benefits it provides.

fathom otter
#

i still find it painful that 5% of servers on bstats use Windows Server 💀

lost matrix
boreal seal
young knoll
#

Minecraft is such a weird game

boreal seal
#

and i would tell you that most players use 1.8

#

and i have many players around 300-400

vocal cloud
#

Yeah, that's a hard no

young knoll
#

How many other games have content creators still developing for 7 year old versions

boreal seal
vocal cloud
#

Most players don't want to use it.

boreal seal
#

fool

#

dont speak if u dont know

#

people still make mods for very old games

young knoll
#

I never said old games

lost matrix
young knoll
#

I said old versions

fathom otter
#

lol @lost matrix hypixel running pre 1.9 actually is very important

boreal seal
#

take cs 1.6

#

very active community

#

and no one tells them dont support it

fathom otter
#

judging by the fact that hypixel's entire player count (during the day) is more than how many people combined are connected to all bstats servers

boreal seal
#

and switch to new conterstrike

boreal seal
#

...

#

they have recoded everything form scratch

#

so they dont suffer from our issues.

#

like some wierd bugs

#

on chunkload and shit

fathom otter
boreal seal
#

what was needed

#

was recoded

#

trust me

lost matrix
fathom otter
#

this argument was about what has the most players, not api originally

fathom otter
lost matrix
young knoll
#

Counter strike 1.6 is still the latest version of the original counter strike

boreal seal
#

well why they dont go to cs 1.8?

#

it exists

#

in fact

#

so man

#

just please dont argue about it people can do what ever they want

#

i have no idea why people stick 1.8 yeah

#

which its really easy to change everything that was made in 1.12 for example to work same as 1.8 beside some client sided shit which is not big deal with mods

fathom otter
#

but either way i do agree that 1.8 api is awful

lost matrix
#

Sure. They can use 1.8 if they want. But they should not expect any support whatsoever. You go with 1.8 then you are on your own.

fathom otter
#

and paper's new apis is amazing

boreal seal
#

back in the days

#

old can be gold

#

dont judge by the book package

#

but its not the point yeah

#

its reallly bad comparing to the new

#

you just didnt see the evoluation guys

#

of older api's

lost matrix
#

Imagine having to fiddle with nms only so you can send action bars.
Or to write data into an ItemStack.

#

Or a player.

#

Or a world. Or chunk. Or TileState.

young knoll
#

Ah the good old days when we had to use NMS to send particles

boreal seal
#

i use it

young knoll
#

I do not miss them

vocal cloud
#

If you're making a new server use the latest version. Hypixel, if they were to make a server today, would most likely be using up-to-date API's so they can provide a much better experience

boreal seal
#

they stick to old version

#

because some gamemodes are for newer

#

some allow old

vocal cloud
#

Because they have to

boreal seal
#

so everyone can play

#

its just the backend

#

yeah many player uses 1.8

#

imagine gettings that hit

#

lmao

lost matrix
#

You can run your server on 1.19 and still allow all players down to 1.8

vocal cloud
#

It's not like people can't run 1.19 lol

boreal seal
#

no

#

you can run server on 1.8 and allow up to 1.19

#

u cant really reverse it

vocal cloud
#

Yeah but why sacrifice the 1.19 API and all it's features?

lost matrix
#

And you can run your server on 1.19 and allow 1.8 - 1.19

boreal seal
#

how 1.8 would be able to process all the shit that the client isnt familiar with

#

insta game crash

lost matrix
#

You can also run your server on 1.19 and only allow 1.8

young knoll
#

You do know via backwards and via rewind exist right?

boreal seal
young knoll
#

And they have for a long time

lost matrix
boreal seal
#

still the things i will make in the new API wont work

#

in fine way

young knoll
#

Most things work fine

#

The main downsides are the offhand not being in 1.8, and extended world height not being in 1.16 and below

vocal cloud
#

Custom Resource packs allowing for cool and unique items.
Easy access to NBT thanks to PDC

#

List is a mile long

lost matrix
#

I actuall just finished worldpainting a new map with the new height settings.
You can do really nice big mountain ranges with it

vocal cloud
#

Oh yeah increased world height

lost matrix
#

In theory up to 2048. Im actually planning on doing something vertically soon.

boreal seal
#

thats pretty

#

kinda sucks that worldpainter is outdated as well

boreal seal
#

its updated by the community no longer by the author

young knoll
#

And?

#

It’s still updated

#

Spigot isn’t updated by the author either

lost matrix
#

Spigot is also updated by the community

boreal seal
#

oh

#

gonna wait till community updates 1.8 💀

#

yeah its joke

vocal cloud
#

I mean Hypixel has in the past released 1.8 libraries that are basically updates

boreal seal
#
int radius = 3;
                int bx = location.getBlockX();
                int by = location.getBlockY();
                int bz = location.getBlockZ();
                for (int x = bx - radius; x <= bx + radius; x++) {
                    for (int y = by - radius; y <= by + radius; y++) {
                        for (int z = bz - radius; z <= bz + radius; z++) {
                            double distance = ((bx - x) * (bx - x) + (bz - z) * (bz - z) + (by - y) * (by - y));
                            if (distance < radius * radius && (distance < (radius - 1) * (radius - 1))) {
#

what i did wrong in this loop?

#

it should be hsphere

#

but it outputs a 3x3 cube

#

for god sake

#

if at the end cuts the cube

eternal oxide
#

a radius of 3 is going to be a cube

boreal seal
#

oh fk

#

ill try with radius of 5

#

im a bongus what can i say

#

since i was like it should cut the extra in the end

lost matrix
#

This is super slow.
Use a midpoint circle algorithm or a Bresenham circle algorithm.

onyx fjord
#

I almost failed math

boreal seal
#

its what my brain lead too

#

tbh

#

its just a cube loop

lost matrix
boreal seal
#

and a check at the end if its inside

boreal seal
#

im looping thru everyblock and gathering data of it

lost matrix
boreal seal
#

ill maybe try to google some formulas

#

i have no idea

lost matrix
#

increase the radius and you will see

boreal seal
#

ill try to increase to 5

onyx fjord
#

I just yeet that kind of code from my beloved stack overflow

boreal seal
#

stackoverflow 🥵

onyx fjord
#

Are you making an empty cube?

boreal seal
#

bruh wtf tottaly different behavior

#

i need to debug

#

nah

#

a sort of sphere

onyx fjord
#

Filled?

boreal seal
#

i make explosives

onyx fjord
#

Ohh

boreal seal
#

and sphere are cool

#

as a pattern

#

i make different patterns of explosives so ;l

#

yikes

onyx fjord
#

You hate yourself

#

Lolo

#

Talking about math I didn't do my homework 🙄

boreal seal
#

well in highschool the best student in the class

#

either my math teacher used to beat me because i used my cellphone his whole lesson

onyx fjord
#

I'm equally best

#

Aka everyone gets a D

boreal seal
#

but he didnt really mind because i cloud solve any thing without even learning

#

like only forumla now adays most of people are 2 digits 😢

onyx fjord
#

So Ur making block sphere?

boreal seal
#

trying too

#

maybe ill make a cube because im too noob

onyx fjord
#

Maybe someone went thru it

#

On spigot forum

boreal seal
#

didnt look up yet

lost matrix
boreal seal
#

ill look once i find nothing

#

wont be issue to translate it too

#

but holy sdhit it looks good

#

why my loop causes it look like this

#

i cant understand

#

it should be sphere some how

#

and my creates this

#

the AIR == loop output

#

fixed it

lost matrix
boreal seal
#

yeah its pretty simple to translate it

#

like the concept of loops is the same everywhere ;P

lost matrix
#

Yeah but this code is quite messy. And there is no concept of blocks or similar so its a bit hard to
get from 3d boxes to a discrete voxel

rough drift
#
Vector previous = entity.getVelocity().clone();
entity.teleport(location.clone().setDirection(entity.getLocation().getDirection()));
entity.setVelocity(previous);

That is my current code, however the player is not keeping it's velocity, how can I solve that?

lost matrix
#

Try setting the velocity one tick later.
How do you determine if the player keeps his velocity or not?

rough drift
#

I have a command to apply a fast velocity to the player (like launching) to test, if they keep moving after the teleport at roughly the same speed, success

#

eyy it works

cerulean jasper
#

how do I hardcodedly add extra Y +1 to a pre defined bukkit Location variable?

#

like, myLocation + (0, 1, 0)

lost matrix
#

Just call add(0, 1, 0) on your location

cerulean jasper
#

ah cool

rough drift
#

if it is an entities location you might wanna clone it first

cerulean jasper
#

a location i .spawn at

#

sorry

#

.teleport *

lost matrix
#

Now every Location is a clone when you get it

rough drift
#

Actually?

#

For me it still moves the player sometimes

kindred valley
#

what is the difference between equals() || isSimilar()?

lost matrix
#

The javadocs are really clear on this one

#

@kindred valley

faint frost
#

creates a black hole if you use both

kindred valley
#

I forgot docs exists sorry

#

Alex was right, itemstacks really ruthless

grizzled pollen
#

yep equals check if stack.isSimilar(otherStack) && stack.size == otherStack.getSize()

shadow zinc
#

apparently this is deprecated, I need to use it for my library so I can include a jar that contains minimized adventure, I don't want to install the jar with maven because its for public use and thats just inconvient

#
<dependency>
    <groupId>com.sample</groupId>
    <artifactId>sample</artifactId>
    <version>1.0</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/src/main/resources/Name_Your_JAR.jar</systemPath>
</dependency>```
tender shard
#

WorldGuard by far has one of the most fucked up API designs ever. Just look at this:

public class WorldGuardProtection implements PluginProtection {

    @Override
    public boolean canBuild(@NotNull Player player, @NotNull Location location) {
        com.sk89q.worldedit.util.Location weirdLocation = BukkitAdapter.adapt(location);
        LocalPlayer weirdPlayer = WorldGuardPlugin.inst().wrapPlayer(player);
        return WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery().testBuild(weirdLocation, weirdPlayer, Flags.BUILD);
    }

Okay, I gotta convert a Bukkit Location to a WE Location using BukkitAdapter. I get it, makes sense.
I also gotta wrap the Bukkit Player to a WE Player, makes sense. But... the **BukkitAdapter **cannot do that. Instead, I have to do WorldGuardPlugin.inst()
Okay, well, maybe this has some reasons. BUT NOW WTF. One could assume that WorldGuardPlugin.inst() is what I need for most API calls, but no - to actually get a region container, I now have to use WorldGuard.getInstance().getPlatform(). WTF? Who the fuck thought "yeah this makes perfect sense egg_drool "

#

Why is there even a difference between WorldGuardPlugin and WorldGuard, why do both have an instance, and why can the BukkitAdapter adapt locations, but e.g. not players?

drowsy helm
#

sounds like badly planned api decisions piled ontop of eachother

worn tundra
#

^^^

#

That's some open source projects for you

chrome beacon
#

Not just open-source

eternal night
#

I mean

#

reasons for all tbh

#

BukkitAdapter is pure, does not work with any state

#

WorldGuardPlugin is specifically for bukkit based players, tho it needs state as we players require a plugin instance to fetch most of their data

#

last part then obviously is the platform independent part

#

I guess you could re-expose WorldGuardPlugin's methods in the bukkit adapter tho like

#

that mangles state as you'd have a stateless pure namespace like class depend on some partial static state in WorldGuardPlugin

#

or re-expose the bukkit adapter methods in the world guard plugin tho that also kinda does not fit

#

¯_(ツ)_/¯

iron palm
#

what is wrong with maven
Just installed Intelij IDEA after changing my OS
And getting this error.
Tried maven plugins import with force updating but didn't worked.
my pom.xml is same with Minecraft plugin dev's spigot.
anyone has any idea what's wrong?

hazy parrot
#

first link on google

iron palm
#

i did

#

none of them are working thats why im asking here

hazy parrot
#

you invalidated cache ?

iron palm
#

it didnt worked

hazy parrot
#

pretty sure it has no reason to not work, i mean if it doesn't work for you just manually put plugins in /.m2/repository

tender shard
#

oh wait I confused WorldGuardPlugin with WorldGuard

eternal night
#

yea

#

its a bukkit specific

tender shard
#

then why couldn't at least the BukkitAdapter methods also be in WorldGuardPlugin or vice versa

eternal night
#

Well one is stateless and the other isn't

tender shard
#

i dont get what you mean with that

eternal night
#

bukkit adapter does not require a plugin instance

#

you can always construct a WE location from a bukkit locatio

#

you can only construct a WE player if you have a plugin for it

tender shard
#

yeah okay that's the technical explanation I already said made sooome sense internally, but why e.g. couldn't at least WorldGuardPlugin also implement / extend WorldGuard or whatever

#

it doesn't really make sense from the enduser point to have three different endpoints

eternal night
#

Well yea but that is generally the pain of a multi platform stuff

#

I guess your world guard plugin could also just expose the region manager from the core

#

but like

#

¯_(ツ)_/¯

tender shard
#

they could at least have called it WorldGuardBukkit or so, because... is it WorldGuardMod in Fabric then? and what is in Forge? also WorldGuardMod?

#

I would have understood WorldGuard<Platform>

#

then <Platform>Adapter

#

and finally, WorldGuard

eternal night
#

Welp naming conventions are a wild thing xD

#

or well, naming choices rather

#

but yea I agree, you generally just have a fun time when consuming API from a multiplatform

#

could also just be solved by not having the player require a plugin instance

#

so you don't have to call WorldGuardPlugin at all

tender shard
#

yeah overall it's just a bit annoying lol

reef lagoon
#

how do I get a metadata key's value

tender shard
#

getMetadata() ?

reef lagoon
#

no

#

i need the value

tender shard
#

and how is this not exactly what you want then?

#

it returns a List of MetadataValue, the list contains the value for each plugin that has set data for this key

reef lagoon
#

it just returns @27hc8(912u4 or something

tender shard
#

it returns a List<MetadataValue>

#

you can then filter this list for the value that has your plugin instance as owning plugin

reef lagoon
tender shard
#

something like this, haven't tested though

        // set the value
        myPlayer.setMetadata("age",new FixedMetadataValue(myPlugin, 42));

        // get the value with that key that was set by your plugin, or null if not set
        MetadataValue value = myPlayer.getMetadata("age")
                .stream()
                .filter(m -> m.getOwningPlugin().equals(myPlugin))
                .findAny()
                .orElse(null);

        // If the value is not null, we can get it as int, String, or whatever it is
        if(value != null) {
            int age = value.asInt();
        }
green prism
#

Sorry guys, I had a question, in this century have they invented a method to make it easier to set something via chat? That is, that you click "Set" and it says "Write in chat your new favorite block" and when you write in chat, it sets it and reopens the inventory?

#

An API or something

#

To avoid the usual 1000 lines with an arraylist to accompany them

river oracle
#

Java streams

#

Api

#

Look into it it's useful just a heads up it has overhead

green prism
reef lagoon
#

learning basic java time

green prism
green prism
tender shard
# reef lagoon learning basic java time

you could of course also use a regular for loop

        myPlayer.setMetadata("age",new FixedMetadataValue(myPlugin, 42));
        List<MetadataValue> values = myPlayer.getMetadata("age");
        int age = -1;
        for(MetadataValue value : values) {
            if(myPlugin.equals(value.getOwningPlugin())) {
                age = value.asInt();
                break;
            }
        }
#

baeldung has a nice explanation about streams

green prism
#

us*

hard socket
#

I tried this but its not working

hazy parrot
#

Also is it your plugin?

hard socket
#

yes

#

its not connecting

hazy parrot
#

What error

#

Timeout?

hard socket
tender shard
#

what's line 53? your paste doesnt include the imports etc

green prism
tender shard
#

also why do you posted your full credentials here

hazy parrot
#

Could be Nat loopback issue too

#

But as he provided no error, we can't know

#

¯_(ツ)_/¯

hard socket
tender shard
#

is that your server's ip in the first place?

#

the mysql server's ip?

#

getInt get's the int of the column you give it

#

what does getLeaderboardType().getRows() return?

#

so what is "rows" in this case?

#

level? wins? finalkills? whatever of those it is, your table doesn't have such a column. it seems quite weird that you call it "rows" while referring to "column names" btw

#

so where is the "level" column?

#

print out the result of getRow() before throwing it into getInt() and see what it says

hard socket
tender shard
#

what's Stats line 70?

hard socket
tender shard
hard socket
#

yes what should I do

#

info are wrong?

hazy parrot
#

it should throw some error

tender shard
#

i dont even know where your MySQL class comes from, so I can't tell you anything

hazy parrot
#

if you catch it correctly

tender shard
#

did you write that MySQL class yourself?

#

or where does it come from?

hard socket
tender shard
#

maybe you shouldnt ignore all exceptions but rather print them out or rethrow them

#

and then see what they say

hard socket
#

alr

buoyant viper
#

Virgin e.printStackTrace() vs Chad try-catch(ignored)

tender shard
#

and when pasting, please do not remove all the imports. for example now I have no idea whether you have your orn DriverManager or whether you use the java.sql.DriverManager

tender shard
hard socket
#

@tender shard

tender shard
#

[12:39:46 WARN]: Caused by: java.sql.SQLException: Access denied for user 'u728282_rUvDJMZKnj'@'46.4.94.213' (using password: YES)

#

print out your SQL queries before executing them

tardy delta
#

nice password

tender shard
#

why do you keep sending random screenshots instead of what I'm asking for lol

#

print out the SQL statements you execute before executing them

#

no...

#

you print out the result

#

not the sql query

#

the actual SQL string

#

SELECT lastRank FROM FeatherAccount WHERE name = mfnalex

#

that is the actual query

#

e.g. so we can see what ? gets replaced with

#

or print out the whole cachedRowSet by looping over everything inside

#

it's really hard to help you if you don't know the basics of how ResultSets etc. work

#

I'd also split up everything so you better see what exactly throws the exception, e.g.

String name = cachedRowSet.getString("name");
Whatever result = DatabaseManager.query("SELECT lastRank FROM FeatherAccount WHERE name = ?", name);
String lastRank = result.getString("lastRank");
#

no idea what DatabaseManager.query(...) returns

#

I guess another ResultSet?

tender shard
#

you don't seem to understand that a MetadataValue is not a String

reef lagoon
#

But I need a string, that's what I meant by "value"

tender shard
#

then take a look at the javadocs I just sent

hard socket
#

My password is the same

tender shard
#

or at the code I sent you earlier which showed you that MetadataValue has methods like getInt(), getString(), etc

reef lagoon
#

oh it's getString

#

ty

#

asString*

hard socket
#

@tender shard my password is correct

tender shard
#

show your enum thing again

tender shard
glossy venture
#

you need to advance into the first element of the row set i think

#

if its not null

#

is there a cachedRowSet.next() method?

#

oh wait i missed u already callling it

#

can you send the full stascktrace

vivid skiff
#

How can i fix this error in console? I triend to fix it my self but i can' t understand it very well.

tender shard
#

there's no need to ping me

hazy parrot
#

also looks like you are using paper

vivid skiff
flint coyote
#

Player probably has no helmet on

vivid skiff
#

Yes

#

It gives it when it haven't a helmet or have a different helmet

flint coyote
#

So you have to check if p.getInventory.getHelmet() != null

tender shard
#

your CachedRowSet simply doesn't have any column called "name" as it seems

hard socket
#

I fixed it

#

I messed the url up but thx for help <3

tender shard
#

print out the actual column names of your result set right after you retrieved it

CachedRowSet set = /* ... */;
        ResultSet result = set.getOriginal();
        ResultSetMetaData meta = result.getMetaData();
        for(int i = 1; i <= meta.getColumnCount(); i++) {
            String name = meta.getColumnName(i);
            System.out.println("Column " + i + ": " + name);
        }
#

then you cannot get the value of the column "name" if you only selected "lastRank"

#

learn the basics of SQL please. this is a good place to start https://www.w3schools.com/sql/sql_intro.asp

drowsy helm
#

dumb question but can you force open the player inventory

agile anvil
#

no

drowsy helm
#

unfortunate

long zephyr
#

guys one question, i'm sending the PacketPlayOutEntityEffect but its not working, have i send another packet?

long zephyr
#
 private Object PacketEffect() throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException, NoSuchFieldException {
        Constructor<?> spawnEntity = getNMSClass("PacketPlayOutEntityEffect").getConstructor(int.class,getNMSClass("MobEffect"));

        Constructor<?> constructor_mobEffect = getNMSClass("MobEffect").getConstructor(getNMSClass("MobEffectList"),int.class);
        Class<?> moblist = getNMSClass("MobEffects");
        Object mobEffect = constructor_mobEffect.newInstance(moblist.getField("INVISIBILITY").get(moblist),Integer.MAX_VALUE);


        return spawnEntity.newInstance(getEntityIDArrow(),mobEffect);
    }
#

using Reflection, sorry xd

drowsy helm
#

damn, interesting lol

long zephyr
plucky pecan
#

Will there be any economy plugin that is compatible with GeyserMc?

drowsy helm
#

it has nothing to do with how your server works

#

pretty sure its completely clientsided

#

doubt its possible

drowsy helm
long zephyr
#
Object handle2 = arrow.getClass().getMethod("getHandle").invoke(arrow);

            sendPacket(PacketSpawnEntity(handle2));
            sendPacket(PacketEffect());
            sendPacket(PacketMetaData(handle2));
odd wedge
plucky pecan
odd wedge
drowsy helm
plucky pecan
crisp steeple
#

the method isn’t named that at runtime

drowsy helm
#

why are you using reflection btw

#

ah yeah, it would be obfuscated

#

those names are just remap names

long zephyr
odd wedge
#

Any errors

long zephyr
crisp steeple
drowsy helm
odd wedge
#

That’s how it should look

long zephyr
drowsy helm
#

remap is just for development, it changes to obfuscated version when compiled

crisp steeple
#

compile time and runtime are different

drowsy helm
long zephyr
#

i'm using mvn, i dont want to create a folder for each version xD

drowsy helm
#

why not use regular nms names if you're doing reflection anyway

long zephyr
#

.-. the problem is not reflection

#

xd

drowsy helm
#

im not saying it is

long zephyr
#
PacketPlayOutEntityEffect packetPlayOutEntityEffect = new PacketPlayOutEntityEffect(entityId,
                new MobEffect(MobEffects.INVISIBILITY,Integer.MAX_VALUE));

        CraftPlayer craftPlayer = (CraftPlayer) player;
        craftPlayer.getHandle().playerConnection.sendPacket(packetPlayOutEntityEffect);
#

its doesnt apply the effect :(

drowsy helm
#

if you are just trying to hide the entity, send an entity remove packet

long zephyr
#

but i'm using the entity as vehicule (Passanger is an armorstand)

#

will it works if i remove it?

drowsy helm
#

ah yeah maybe not then

#

if the player has to ride it, then it won't work

long zephyr
#

noup

#

player wont ride it

#
arrow.addPassanger(armorStand);
player.addPassanger(arrow);
``` this is what i'm doing
odd wedge
drowsy helm
#

not possible as far as i know

drowsy helm
#

worth a try

long zephyr
#

i'll try

#

ty

shadow zinc
#

why isn't it relocating, its still at net.kyori

#
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <relocations>
                        <relocation>
                            <pattern>net.kyori</pattern>
                            <shadedPattern>com.neomechanical.neoutils.kyori</shadedPattern>
                        </relocation>
                    </relocations>
                    <minimizeJar>true</minimizeJar>
                </configuration>
            </plugin>```
drowsy helm
#

looks fine to me

#

you 100% sure you're looking at the shaded jar?

shadow zinc
#

im looking at the left one

drowsy helm
#

use clean package

#

could be using old caches

shadow zinc
#

im using clean deploy

drowsy helm
#

use package

#

if its for distribution

shadow zinc
#

so whats the different with deploy and package?

drowsy helm
#

still, I doubt that would not relocate it

plucky pecan
#

Is there a plugin that is to remove the commands? It gives a lot of lag when I put the command bar

drowsy helm
#

deploy is for when you are putting it on a remote repo

shadow zinc
shadow zinc
plucky pecan
shadow zinc
#

do you mean how do I remove certain commands from a plugin?

shadow zinc
#

by nothing I mean it still doesn't relocate

plucky pecan
#

No, I mean that when I put the / many commands come out, then it gives me lag

#

I would like to know if there is a plugin to remove that

shadow zinc
#

thats not a development question

#

we make plugins, not suggest them

plucky pecan
#

OK thank you

drowsy helm
#

instead of net.kyori

shadow zinc
drowsy helm
#

im reading on github and people are saying they have issues when they use the groupId

#

if its the same as the package name

shadow zinc
#

thats strange, look at my jar

#

its not relocated but there is a kyori dir with some classes

odd wedge
shadow zinc
drowsy helm
shadow zinc
#

im looking at the left one

odd wedge
shadow zinc
#

that was buoobuoo's suggestion

drowsy helm
#

geyser uses the entire .netkyori package

#

ssems to work fine for them

#

have you tried without minimizeJar?

odd wedge
#

Set the scope to compile

shadow zinc
#

bruh

#

compile is default

shadow zinc
drowsy helm
#

wdym

shadow zinc
#

yes there is a way

drowsy helm
#

yeah use an async tab complete

shadow zinc
green prism
#

Do you guys know where to find some good examples of using ConversationalAPIs? I can't find anything much and I don't see Doc explaining it as well.

shadow zinc
drowsy helm
#

weird how its only relocating some packages

shadow zinc
#

very strange

fluid river
#

class extends TabCompleter

constructor() {
PluginInstance.getCommand("cmd").setTabCompleter(this);
}

odd wedge
fluid river
#
public List<String> onTabComplete(and so on) {
    // you have String[] args here, use it lol
}```
odd wedge
#

Isn’t there a tabcompelete event

shadow zinc
#

?paste

undone axleBOT
odd wedge
#

?jd-s

undone axleBOT
shadow zinc
fluid river
#
if (List.of(args).contains("yourWord")) {
    listToReturn.remove("yourWord");
}```
#

or right in the end when you made all tab completes in one list to return

fluid river
#

listToReturn.removeAll(args);

drowsy helm
#

explain it fully then

fluid river
#

tf you want then

odd wedge
#

I think you could use what I sent and then modify the set

drowsy helm
#

your explanation is very vague

fluid river
#

you literally said

#

if in line remove from suggestions

odd wedge
#

Might be of use

drowsy helm
#

so the command itself?

#

not the args

fluid river
#

????

#

cmd.getName()

#

you want to remove it when player wants to run the command by pressing enter?

drowsy helm
#

not possible afaik

shadow zinc
#

you want to edit the tab completor for commands to remove a certain thing?

drowsy helm
#

you could - make a command for each world name

#

and disable it if the world isnt available

fluid river
#

I don't understand what you really want

drowsy helm
#

so tab complete wouldnt work for it

fluid river
#

you can't tabcomplete

#

With 0 args

drowsy helm
#

yep

#

only args can be tab completed

#

no thats a lie

#

commands can, but you cant get a tab complete befoer an entire command is entered

fluid river
#

well actually there is a thing like

#

/plugi...

#

when server auto suggests /plugins

drowsy helm
#

yeah thats what i was saying before

#

just disable the command if not applicable

#

so it wont tab complete

fluid river
#

true

drowsy helm
#

but theres a lot of fuckery to that

shadow zinc
#

I fixed the relocation problem

drowsy helm
#

what was it

shadow zinc
#

I can't relocate in the module that shades the dependency for some reason, I have to relocate in the parent module

#

its whacked but I'm glad it works

drowsy helm
#

oh there was a parent module?

#

lmao

shadow zinc
#

I was unaware that was a thing

drowsy helm
#

yeah i didnt know you had a parent

#

maven is weird like that

shadow zinc
#

oh well, at least I learnt something

onyx fjord
#

Can I listen for other plugins triggering ex. actionbar?

drowsy helm
#

not the api method itself though

onyx fjord
#

dangg

drowsy helm
#

what usecase

onyx fjord
#

i will send status bar 24/7

#

but i dont want other plugins to get overrided

drowsy helm
#

I've just found

#

somethign called Instrumentation

#

has the redfineClasses method which can change method behaviour

#

could use it to rewrite the action bar method and intercept it

onyx fjord
#

how that shit work

#

gugl not helpful

drowsy helm
#

uhh ive got no clue

#

just found it on github

ivory sleet
drowsy helm
#

ah

#

yeah best bet is packets

rough drift
#

I want to roughly make a tiny cloud of particles in a block, does setting count make that effect? (Like spawning say 15 particles inside a block spread out?)

onyx fjord
#

i love packets 😢

#

deez packet?

rough drift
#

great

drowsy helm
#

the offset isnt heaps

rough drift
#

Yeah just roughly

#

To give like a mini cloud effect

#

Hm

#

I'll fill the rest and see

drowsy helm
#

what is it suppsoed to indicate

rough drift
#

It's a portal

#

wait

drowsy helm
#

Hm looks a bit strange imo

shell finch
#

how could i detect when an attack is blocked by a shield?

rough drift
#

still working on it

#

At some point it will transition between where you are and where you are going

#

so it looks as if the world is changing around you as you move in it

drowsy helm
#

just check is player.isBlocking

shell finch
#

alright thanks :D

long zephyr
#

guys, should this work?

CraftArrow craftArrow = instance;
craftArrow.getHandle().setInvisible(true);

because its not working to me :(

tardy delta
#

whats instance

#

why not working with the api tho

long zephyr
long zephyr
tardy delta
#

uhh

long zephyr
#

also i'm sending PacketMetaData

#

the arrow spawn with PacketSpawnEntity but doesnt works the "Invisible" method

#

also i tried PacketPlayOutEntityDestroy but the solution isn't that i looking for

#

also i tried :

PacketPlayOutEntityEffect packetPlayOutEntityEffect = new PacketPlayOutEntityEffect(entityId,
                new MobEffect(MobEffects.INVISIBILITY,Integer.MAX_VALUE));

        CraftPlayer craftPlayer = (CraftPlayer) player;
        craftPlayer.getHandle().playerConnection.sendPacket(packetPlayOutEntityEffect);
``` but not working idk why
crisp steeple
#

what is the purpose of giving invisibility 2 billion

long zephyr
#

Duration

crisp steeple
#

or is that the time

#

yeah ok

#

are you trying to just delete it on the client?

long zephyr
#

just hide the arrow

crisp steeple
long zephyr
#

not to me because i'm doing :

#
player.addPassanger(craftArrow.getHandle().getBukkitEntity());
hasty prawn
#

Honestly I'm not sure Arrows can be invisible, that's why all the threads are telling you to send the destroy packet.

#

If the arrow exists on the server, and you send the destroy packet for a player, the arrow would be invisible for the player but still exist on the server.

#

Since you're sending the arrow as a packet in the first place, the server has no idea its even there.

long zephyr
hasty prawn
#

Sure, but that doesn't mean the effects actually do anything.

drowsy helm
#

just because its available doesnt mean it works

hasty prawn
#

I mean, you can give a Shulker speed/slowness, doesn't change anything about it though afaik

#

Your best bet probably is to spawn the arrow normally and then send the Destroy packet to everyone you want it to be invisible for.

uncut ferry
#

how to get verified?

hasty prawn
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

uncut ferry
#

i know the command but like im not verified

hasty prawn
#

It sends you a PM on the spigot forums iirc

uncut ferry
#

iirc??

long zephyr
hasty prawn
#

if I recall correctly, check your spigot dms

long zephyr
uncut ferry
#

how do i check spitgot dms

#

spigot*

#

oh wait

#

it says i got a notification

#

hmm

hasty prawn
uncut ferry
#

oh ok

hasty prawn
long zephyr
#

PacketSpawnEntity

#

PacketPlayOutSpawnEntity

hasty prawn
#

Yeah thats why it's not working

#

Don't do that, spawn it with the API

warm light
#

I want to change world gen system with my plugin. I found a basic from spigot forums. but where I can learn it properly?

long zephyr
#

x.x if i do world.spawn(location,Arrow.class); it will be on client-side and server-side

#

orr...

#

wait

#

<.<

#

noup

hasty prawn
#

It would be both, yes. That's why you send the Destroy packet so you're basically removing it from the Client side

#

Which makes it invisible

long zephyr
#

right but i have to do for all players

hasty prawn
#

Yes

long zephyr
#

better just do with PacketPlayOutSpawnEntity

hasty prawn
#

Well okay, but you can't use the API to set their passengers then.

drowsy helm
#

yes but its not server side

long zephyr
#

i can use it, i did it with an armorstand

#

CraftArmorStand

hasty prawn
#

ArmorStands support invisibility and arrows dont though, so it doesn't translate 1-to-1 PeepoShrug

long zephyr
#

yep :(

uncut ferry
#

ok thanks

long zephyr
#

i can destroy the arrow but Passanger wont work :c

drowsy helm
#

what exactly are oyu trying to do

hasty prawn
#

There's a SetPassengers packet you have to send

long zephyr
drowsy helm
#

yeah but what though

#

like in game

long zephyr
#

for example, name tags

long zephyr
drowsy helm
#

ah you're trying to mount it

#

just teleport it same time as player move packet

#

its seamless

ornate zinc
#

i have a zombie spawns with a custom command and i want to set him drop diamond blocks but i confused how to set him data .if i use nametags users can use nametag to acces that mob

long zephyr
#

i'm doing asynch task , then it will shake

hasty prawn
ornate zinc
hasty prawn
#

?pdc

drowsy helm
#

?pdc

drowsy helm
#

wrapper for nbt

hasty prawn
#

🥷

drowsy helm
#

lmao

long zephyr
#

PacketMountEntity(handle2) and handle2 = craftArrow.getHandler

uncut ferry
#

and how do i get voice chat?

long zephyr
uncut ferry
#

what

#

you need to be a mod to get voice chat?

long zephyr
#

aaaa

#

voice chat in dc

#

idk

#

xd

uncut ferry
#

...................................................................................................

#

yay just spent 30 min on verifying my account for nothing

rough drift
#

@drowsy helm I got a gif to show you how the portals work, though its like 40M

uncut ferry
#

G R E A T

uncut ferry
#

oh

#

yeah

#

this is development

#

oopsies

#

wheere doi ask

long zephyr
#

@drowsy helm

#

that arrow

#

D:

tardy delta
#

arrow bigger than the lil gentleman

long zephyr
#

xD

#

i'm teleporting the arrow to the position but if i dont

#

:

#

but the arrow is invisible <.<

boreal seal
#

k guys my soluation were dogshit

#

how to compare

#

block data

#

please dont comment ussless things like

#

"use newer version"

drowsy helm
#

the to string solution was bad?

glossy venture
#

very bad yes

#

just use like 5000 if statements

#

or store field offsets of classes and compare each field one by one using Unsafe

onyx fjord
#

do yall know what

        content {
            onlyForConfigurations(PAPERCLIP_CONFIG)
        }

this would be in groovy?

#
    maven("https://papermc.io/repo/repository/maven-public/") {
        content {
            onlyForConfigurations(PAPERCLIP_CONFIG)
        }
    }
#

full part

#

ik i can add url "" to maven

glossy venture
#

thats correct groovy syntax

onyx fjord
#

but the content part interests me

#

no

#

thats kotlin syntax

#

ij freaks out

glossy venture
#

show err

onyx fjord
#

> Could not get unknown property 'PAPERCLIP_CONFIG' for object of type org.gradle.api.internal.artifacts.repositories.DefaultMavenRepositoryContentDescriptor.

glossy venture
#

so correct syntax just different naming

onyx fjord
#

well

#

im currently migrating to groovy

#

¯_(ツ)_/¯

#

upstream decided to use kotlin but i dont like it

glossy venture
#

what r u trying to do

onyx fjord
rough drift
#

@drowsy helm

#

That's done with my portals plugin

drowsy helm
#

ou nicee

#

wahts the name for those sort of areas

#

non euclidean

#

something like that

rough drift
#

ye

#

It ain't meant for that

#

but works really well

glossy venture
#

bruh that almost crashed my phone

rough drift
#

7.8MB

onyx fjord
#

kotlin is ass

#
tasks.withType < Javadoc > {
    options.encoding = Charsets.UTF_8.name()
}

tasks.withType < ProcessResources > {
    filteringCharset = Charsets.UTF_8.name()
}

#

what would those be

#

shalli just do the name way of groovy

boreal seal
tardy delta
#

why using kotlin too

boreal seal
#

please dont let me to stick to it

#

i had other issue updating the block later

#

fucking broken 1.8

#

broke ass version

#

mojang should ban it for god sake

#

from usage

boreal seal
#

nah there switch later

#

in fact

onyx fjord
#

is that ur code?

boreal seal
#

yeah

#

i got messy due i cloud not get compare those fucking bytes

#

so i had to get byte and add it to string and compare it

#

and guess what

#

it worked

#

but updating block data doesnt work as well

#

i use switch cases really often

boreal seal
#

any idea

#

i raped google already

tender shard
#

what the heck is the difference between worldguard's StateFlags "BLOCK_PLACE" and "BUILD"? o0

tender shard
#

oh I just checked

#

yeah

hasty prawn
#

Yeah

tender shard
#

BUILD means "can open doors"

#

makes sooo much sense lol

hasty prawn
#

build also blocks mining blocks!

tender shard
#

yeah but just imagine I use worldguard's api to check if a player has BUILD permission

#

and they have perms BLOCK_BREAK and BLOCK_PLACE but NOT to sleep in beds

#

then they do NOT have build permission?

#

how is sleeping related to building

hasty prawn
#

Hm yeah I wonder what their order of priority is

tender shard
#

or does it mean they have BUILD flag if ANY of those mentioned things is allowed? because that would mean they have BUILD = allow even when they cannot place or break blocks but are only allowed to switch levers

#

both makes zero sense

hasty prawn
#

I assume if you directly check for build permissions but, for example, they have block-place denied, build would return true but that doesn't necessary mean they can do all the things under the build flag

warm light
#

How can I store the world in a var?

hasty prawn
#

So if block-place is denied, build returns true but they still can't place blocks

#

I guess Thonk

tender shard
#

basically I wonder whether I should use BUILD or BLOCK_PLACE in the first method here

    @Override
    public boolean canBuild(@Nonnull Player player, @Nonnull Location location) {
        return testStateFlag(player, location, Flags.BLOCK_PLACE);
    }

    @Override
    public boolean canBreak(@Nonnull Player player, @Nonnull Location location) {
        return testStateFlag(player, location, Flags.BLOCK_BREAK);
    }

    private static boolean testStateFlag(Player player, Location location, StateFlag flag) {
        return WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery().testBuild(getWeirdLocation(location), getWeirdPlayer(player), flag);
    }
hasty prawn
#

I'd use block place tbh

#

Since my bets are on that one taking priority? Maybe you need both KEKW

tender shard
#

yeah I guess so

warm light
#

worldList a list of some string

crisp steeple
#

are you trying to get all the worlds from the names in that list?

#

or just one

glossy scroll
#

that will return a Stream<World> type

#

and you can do what you wish with that

tardy delta
#

filter that by notnull probably

glossy scroll
#

yep was about to add

warm light
#

alright. thanks

dusk shell
#

how can i do that if block.getLocation == 155, 100, 50...?

#

this doesnt work``` Location lapisBlock = new Location(player.getWorld(), 155, 88, 145);
Location redstoneBlock = new Location(player.getWorld(), 155, 88, 147);
Location emeraldBlock = new Location(player.getWorld(), 155, 88, 150);

    if(action == Action.RIGHT_CLICK_BLOCK && hand == EquipmentSlot.HAND)
    {
        if(block.getType() == Material.LAPIS_BLOCK && block.getLocation() == lapisBlock)```
tardy delta
#

use equals

dusk shell
#

just =?

tardy delta
#

block.getLoc().equals(otherLoc)

quiet ice
#

Either .equals() or use identity comparision with .getBlockX, .getBlockY etc

dusk shell
#

so block.getLocation().equals(lapisBlock)?

tardy delta
#

yes

dusk shell
#

what does it change?

#

it works, but why=

quiet ice
# dusk shell just =?

= -> Assignment operator
== -> Identity comparision
!= -> Negative identity comparision
+=, /=, -=, *= -> Assignment operator with expression
>= -> Value comparision (greater or equal to)
<= -> Value comparision (smaller or equal to)

tardy delta
#

== checks if two objects point to the same space in memory, equal compares the object based on its internal state

#

if overridden atleast

dusk shell
#

intresting, thanks

quiet ice
#

ints, floats, doubles, longs, etc. will be compared by value (there isn't a memory location in a traditional sense anyways)

tardy delta
#

uhh ye forgot to say about primitives

#

i guess he knows that

fluid river
tardy delta
#

dont stack values have a memory location too (as they can have pointers)? 👀

quiet ice
#

Similarly value types/primitive objects are going to behave a bit differently, but they aren't available outside of LWorld testing builds

fluid river
#

And in the end wanna say that Strings are in a string pool

#

unlike all other objects/primitives

#

If you do:

String s = "Hello";
String s2 = "Hello";

s == s2 will return true

tardy delta
#

well stupid question actually

quiet ice
#

But new String("hello") == "hello" will be strictly false

#

The string pool is not a magic thing

fluid river
#

String s2 = new String("Hello");

s == s2 will return false

#

But s == s2.intern() will return true

outer river
#
public void onJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        List<String> uuidList = new ArrayList<>(DataFile.get().getConfigurationSection("Players").getKeys(false));
        
        if (!(uuidList.contains(player.getUniqueId().toString()))) {
             DataFile.get().set("Players." + player.getUniqueId() + ".Ban", true);
             DataFile.get().set("Players." + player.getUniqueId() + ".Name", player.getName());
             DataFile.get().set("Players." + player.getUniqueId() + ".Data", "");
             DataFile.save();
        }
        else return;
    }```

Hello, i'm trying to create a section affiliate to the player when he connects on the server  but this dont works, can you help me pls ?
(No errors)
quiet ice
#

Yes, just that .intern should only be used by the JVM - hence the name

fluid river
#

Also

s = new String("Hello");
s2 = new String("Hello");

s == s2 return false

quiet ice
#

Relying on the string pool is nice and all, but there is little use in that

fluid river
#

even though they have same value

quiet ice
#

Yes, because they are L-type references

#

It just happens to be the case that the JVM caches them (which is the string pool) because it makes sense to do that

fluid river
#

Yeah, speed and stuff

#

I don't remember, but there probably was a VM parameter for String Pool GC

#

Related to pool only

quiet ice
#

Not sure why you'd want to have it though

#

Unless you have some bork application running

fluid river
#

Well every function is made for something

#

Someday you might need it

#

For complete dummies

String s = "Hi";
String s2 = s;

s == s2 returns true

#

and

String s = new String("Hi");
String s2 = s;

s == s2 also returns true;

#

If not sure, equals/equalsIgnoreCase is better

quiet ice
quiet ice
fluid river
#

maybe you forgot @EventHandler, or forgot to register listener, or wrote .save() method wrong

outer river
#

i try wait

fluid river
#

Also remove else return

#

it's useless

#

there is also a new String#comapreTo(String) method

tardy delta
#

what does that do

fluid river
#

Idk if it's worth use, but maybe just a replacement of equals, cuz equals runs for OBJECT, so checks if object is instanceof string and so on

#

Never seen compareTo or String#equals realization

waxen plinth
#

It's not a replacement of equals

#

It's for sorting

fluid river
#

Cool

waxen plinth
#

If it's 0 then they are equal, but if it's -1 or 1 it indicates < or >

fluid river
#

Ah true

#

Lexicographic

#

comparison

fluid scaffold
#

Good for sorting alphabetically ^

fluid river
#

or backwards alphabetically

tender shard
#

I always sort my strings like this

strings.sort((o1, o2) -> o1.equals(o2) ? 0 : ThreadLocalRandom.current().nextBoolean() ? -1 : 1);
ornate zinc
#
if(zombie.getEquipment().getItemInMainHand()  ){}
``` i want when a zombie spawned with an iron shovel server do an action but how can i set it?
ornate zinc
#

tnx

reef lagoon
#
if(player.hasMetadata("meta1") || player.hasMetadata("meta2") || player.hasMetadata("meta3")) ``` Is there a way to check which one is the true one without 3 additional if statements
quaint mantle
#

uhm no

#

you could assign them all to a variable to reuse

#

before this if statement

odd wedge
winged anvil
#

how often do you guys write pseudocode

fringe hemlock
#

?dmca

undone axleBOT
vocal cloud
#

Only really write pseudo when I'm writing comments for future methods or helping someone.

odd wedge
#

Same as above or when I can’t figure something out

molten hearth
cobalt thorn
eternal oxide
#

particles are not permanent

cobalt thorn
#

how i can solve this?

cobalt thorn
eternal oxide
#

that answers the question you asked

quaint mantle
#

Jitpack sucks

cobalt thorn
#

yes but a work around to fix it?