#help-development

1 messages · Page 532 of 1

restive mango
#

Anyone know why EntityType.byString("ZOMBIE").get() doesn't seem to work? It throws
[17:17:34 WARN]: Caused by: java.util.NoSuchElementException: No value present
[17:17:34 WARN]: at java.base/java.util.Optional.get(Optional.java:143)

#

I assume it's something stupid

quaint mantle
#

no source in my language for connectpool

#

but i will add

#

later

remote swallow
#

hikari is coded in english iirc so if you cant understand english to an extent you should learn more first

quaint mantle
#

yep

restive mango
#

i'm really just looking to know why the method doesn't work with the input of 'ZOMBIE'

quaint mantle
#

u need do to EntityType.ZOMBIE ?

remote swallow
#

im not finding a fromString method in the EntityType enum, use EntityType.fromName

young knoll
#

Calling it now

#

NMS EntityType

remote swallow
#

that may make sense

restive mango
#

dw

#

fixed it

exotic moat
restive mango
#

you just need to get the key

#

from the bukkit entity

#

not the name

remote swallow
restive mango
#

so u can pat urself on the back aye

young knoll
#

((CraftEntity)yourEntity).getHandle

exotic moat
restive mango
#

sounds smart

remote swallow
exotic moat
#

none

#

i just use vanilla commands to put stuff on it

remote swallow
#

yeah you most likely will need a plugin if you want it toggleable

exotic moat
remote swallow
#

if you find one with placeholderapi support you can do alot

exotic moat
#

i use /scoreboard to make objectives and display them on the sidebar, can a scoreboard plugin use those objectives?

remote swallow
#

what do you have on your scoreboard currently

exotic moat
#

time played

remote swallow
#

yeah theres a placeholder for that, you just need a plugin that can load them

exotic moat
#

ok

flint coyote
#

is there a way to get Keyed objects as string?
e.g. from StructureType structureType = StructureType.BURIED_TREASURE;
I'd like to get BURIED_TREASURE
Do registries have a function for that?

#

I'd be willing to use reflection if necessary

hybrid spoke
#

learning by doing

orchid gazelle
#

It returns the name of an enum in a string

flint coyote
#

It has to be dynamic for all Keyed Objects. Also StructureType is not an enum

orchid gazelle
#

Ohhh

#

Sorry then I don't know

remote swallow
#

iirc doesnt it have a getKey() method

flint coyote
#

doesn't that return the NamespacedKey but not the actual key of the object?

hybrid spoke
hybrid spoke
remote swallow
orchid gazelle
remote swallow
#

getKey() should return minecraft:buried_treasure getKey() again should return buried_treasure

flint coyote
hybrid spoke
orchid gazelle
#

Fair then

#

Never saw that one tbh

hybrid spoke
#

basic java ¯_(ツ)_/¯

orchid gazelle
#

I have been using .toString for my entire life

flint coyote
orchid gazelle
#

(╯°□°)╯︵ ┻━┻

hybrid spoke
flint coyote
#

Yes but I can't know the name

#
            Keyed test = StructureType.BURIED_TREASURE;
            test.getClass().getField("name???");

it's not like I can do that. Remember that this is just an example and I usually don't know the value of the Keyed object like I do in this example.

hybrid spoke
#

loop over the fields

flint coyote
#

and search for?

hybrid spoke
#

whatever you need

#

upper case or whatever

#

look for patterns

#

or look for an easier way

#

weird enough that StructureType is not an enum

flint coyote
#

I only have a Field that implements Keyed with a value and reflective access to it.

flint coyote
buoyant viper
#

getDeclaredField prayge

carmine mica
#

why aren't you just using the key itself? why do you want the field name?

flint coyote
#

For configuration files

orchid gazelle
carmine mica
#

use the key for config files

onyx fjord
#

any standalone (ideally minimal) libraries to listen to mc packets?

flint coyote
#

Yeah I'll try the key thing

carmine mica
#
some-structure: minecraft:buried_treasure

or

some-structure: buried_treasure
hybrid spoke
#

you could also make a parallel enum class which has the same constants as the class's fields

hazy parrot
flint coyote
hybrid spoke
#

otherwise just use the key if you dont want to overcomplicate it

flint coyote
#

yeah I can use the key, thx

hybrid spoke
#

you are looking for the best looking solution while already having one

carmine mica
#

you should be using the key for everything, not Enum#name (if it is an enum) or toString

orchid gazelle
carmine mica
#

do you think Material should be an enum?

flint coyote
#

I don't get the point of ditching enums either

carmine mica
#

like does the Material enum make sense, as its designed now?

orchid gazelle
#

Yes and no

visual laurel
#

how can i make these particles only last for 4 ticks?

private void shootParticleLaser(Player player, double damagePerTick, double maxDistance, int tickDelay) {
        new BukkitRunnable() {
            double distance = 0;

            public void run() {
                Location particleLocation = player.getEyeLocation().add(player.getLocation().getDirection().multiply(distance));

                // Spawn laser particle
                player.getWorld().spawnParticle(Particle.REDSTONE, particleLocation, 1, 0, 0, 0, 0, new Particle.DustOptions(Color.GREEN, 1));

                // Check for players in the laser path
                for (Entity entity : particleLocation.getWorld().getEntities()) {
                    if (entity != player && entity.getLocation().distance(particleLocation) < 1 && entity instanceof LivingEntity) {
                        // Apply damage to hit entity
                        LivingEntity livingEntity = (LivingEntity) entity;
                        livingEntity.damage(damagePerTick);
                    }
                }

                distance += 0.1;

                // Check if the laser has reached its maximum distance
                if (distance >= maxDistance) {
                    this.cancel();
                }
            }
        }.runTaskTimer(this, 0, tickDelay);
    }```
orchid gazelle
#

But honestly, more like yes

carmine mica
orchid gazelle
#

I think the Material rnum is good

carmine mica
#

It combines Block and Item in a way they shouldn't be combined

#

why are Stone block and Stone the item type the same thing?

orchid gazelle
#

I mean

hybrid spoke
#

because its made out of the same material

#

thats what its for

carmine mica
#

Ok, so then what about potatoes.

hybrid spoke
#

you can seperate them

carmine mica
#

or carrots

orchid gazelle
#

There maybe should be a BlockMaterial and ItemMaterial enum

hybrid spoke
#

but the enum would be as a type probably the best option

carmine mica
#

those have separate enums

remote swallow
carmine mica
#

Material.POTATO, and Material.POTATOES, those are the same thing too, just like the item stone, and block stone

hybrid spoke
#

a reason to change, but not to ditch enums

carmine mica
#

you can't have a server implementation of an enum, so that means if you want to get some property of that enum, either it has to be hardcoded to the enum constructor, or you have to make a bridge method to get it, through UnsafeValues, Server, ItemFactory, one of those bridges

orchid gazelle
remote swallow
#

so im meant to do some hella jank do check if its a custom item

onyx fjord
remote swallow
#

no thankyou

quaint mantle
#

try with resource can close statement and connection after leave onenable?

carmine mica
hybrid spoke
onyx fjord
#

Should be an enum if it has limited options

hybrid spoke
#

this isnt modding

remote swallow
carmine mica
orchid gazelle
hybrid spoke
onyx fjord
#

It's server side modding

orchid gazelle
#

Yes

carmine mica
#

and you can't do that with an enum, so you have to hardcode properties or have bridge methods

remote swallow
#

the material enum in its current state for the pr is being deprecated and stuff is converted to BlockType and ItemType

carmine mica
#

both of which are not needed if you just follow the interface + impl pattern

orchid gazelle
#

I literally just guessed that BlockType and ItemType would be a way LMAO

carmine mica
#

they aren't enums

remote swallow
#

one machine maker is also there

orchid gazelle
#

I did not know it was a thing

onyx fjord
#

Why would that be split

carmine mica
#

because they are separate things

#

you can't have new ItemStack(Material.MOVING_PISTON)

onyx fjord
#

But block has the same material as it's item

carmine mica
#

not always

onyx fjord
#

Ah

remote swallow
#

not for everything

carmine mica
#

potatoes and carrots

remote swallow
#

theres a load @young knoll found

carmine mica
#

its a completely arbitrary connection, that an item and block happen to have the same name. It doesn't signify anything about them

onyx fjord
#

So there would be duplicates?

#

Or

#

Yeah what do you do with those with regular behavior

carmine mica
#

you also shouldn't be able to do block.setType(Material.DIAMOND_PICKAXE)

#

but because they are combined as a single monstrocity, you can

tardy delta
#

shouldnt?

onyx fjord
#

Never tried, does it error?

carmine mica
#

idk either, and thats a great reason why it shouldn't be a thing, which is why splitting them up is good

#

it could error, it could go to air, idk

onyx fjord
#

As long as it stays as enums

carmine mica
#

they aren't enums

#

which is also good

onyx fjord
#

What are they

remote swallow
#

^^

#

interfaces

carmine mica
#

static final fields in ItemType and BlockType

onyx fjord
#

Ehh

carmine mica
#

idk why ehh

hybrid spoke
#

so still constants

#

just not as enums anymore

onyx fjord
#

What does that benefit

remote swallow
hybrid spoke
carmine mica
#

which is what the Material enum does all over the place now

#

you can have a CraftItemType which just gets the property directly from the nms type

hybrid spoke
#

not sure if im a fan of that

#

but it will be fun to see all plugins break

carmine mica
#

well, they won't

hybrid spoke
#

once material is gone they will

carmine mica
#

lots of stuff is being fixed with bytecode rewriting, and Material isn't being deleted

#

no, its just being deprecated

hybrid spoke
#

fuck the latter

remote swallow
onyx fjord
#

Maybe material could redirect to the new solution or something

carmine mica
#

and all methods that use it are being replaced with bytecode rewrites fixing the ABI breaks that causes

onyx fjord
#

So it doesn't break

young knoll
#

Material is staying as is

carmine mica
#

they need to fix their "compiles", but at runtime, most things will work

#

and there's an option to make sure pretty much everything will work, at a potential small performance hit, but that's disabled by default

#

a plugin complied against an api with Material-related methods and other enums that will be changed will still work after

#

you will just have to fix those issues before you compile against the new api

onyx fjord
young knoll
#

PacketEvents

remote swallow
#

im taking a wild guess thats what he uses already and was wonder if any smaller exists

onyx fjord
#

Yea I need it as minimal as possible

remote swallow
#

how big even is packet events

onyx fjord
#

Over a meg shaded

remote swallow
#

just use libby to load it

onyx fjord
#

Could be even more

remote swallow
#

its like 25kb

onyx fjord
#

Btw I'm not making a plugin

#

But standalone program

remote swallow
#

oh

#

you can probably some class loader magic to load it and not shade it

chrome beacon
#

Yeah you can download the jar and then load it

warm mica
#

Multi support is getting extensively more complicated with each update

low marten
#

wrote a spawner plugin and i use minecraft’s block storage system to store data. there was no lag the server just crashed, i don’t understand too much about what happened or how to fix the issue

warm mica
#

They should just keep Material as they had it before where it included both items and blocks

sharp bough
#

does anyone konw how hypixel makes this kind of things?

chrome beacon
sharp bough
#

what are they?

low marten
#

invisible ones holding the items

low marten
#

i need to fix it, it was for a client who spent a ton 😂

sharp bough
#

is there a guide, api or smth to work with it?

low marten
chrome beacon
undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

low marten
#

makes it hard ik

chrome beacon
#

Can't help then

low marten
#

im just so confused

chrome beacon
#

Something you did froze the server

#

You can see the thread dump for what exactly

#

We can't help you more than that

low marten
#

is that something other than what i sent?

chrome beacon
#

No

low marten
#

the error points to the customblockdata code which just uses mc’s block info storage system

#

which makes no sense

remote swallow
#

check the lines the thread dumb is saying is causing the errors

chrome beacon
#

You could be stuck in an infinite loop or smth

low marten
#

nah not that

low marten
#

no line #

chrome beacon
#

We can't exactly help without code so grab your debugger

#

And see what it's doing

remote swallow
#

check cmd's code then, see if its a bug and report it

low marten
#

i hate weird errors

sharp bough
remote swallow
#

if its 1.19.4 you can use the new item displays

low marten
#

i was just saying armorstands are entities and you can spawn them

remote swallow
#

they're non ticking entities for display items

#

with transformation

quaint mantle
#

== or != ?

#

ty

remote swallow
#

its intellij enabling ligatures

worldly ingot
#

lol I'm glad you already answered because I was going to say they were ligaments

#

and I realize that those are joints

remote swallow
smoky anchor
#

Heyo, how do I play a note in world ?
I have not found a anything like playNote that is in player

quaint mantle
#

why i need here ?

quaint mantle
#

actually why i need check is connection not null and return connection ?

smoky anchor
tall dragon
tall dragon
remote swallow
# quaint mantle

you probably want to run that async and return a future if you arent using hikari

tall dragon
#

the method takes a "Sound" Enum

smoky anchor
tall dragon
#

which contain "BLOCK_NOTE_BLOCK_<instrument>"

smoky anchor
#

I want to play the note in world, not for a specific player

tall dragon
#

then use this one

#

or the one taking a location

#

instead of an entity

smoky anchor
#

ok so I have to create the pitch myself, can't use the Note class for this
sad

tall dragon
#

??

smoky anchor
#

? ? ?

#

I want to do exactly what noteblocks do

#

the sounds have a pitch

tall dragon
#

yea whats the problem with specifying that urself.

smoky anchor
#

That I should not have to do that, Spigot should have the API for this
The same one as it is for player

sullen marlin
#

Add a feature request

quaint mantle
#
    Connection connection;

    public Connection getConnection() throws SQLException{
        if (connection != null) return connection;
        String userName = "root";
        String password = "12345";
        String dbUrl = "jdbc:mysql://localhost:3306/players";
        this.connection = DriverManager.getConnection(dbUrl, userName, password);
        return connection;
    }
    public void initializeDatabase(){
        try (Statement statement = getConnection().createStatement()){
            String sql = "CREATE TABLE IF NOT EXISTS playerstats(name varchar(16) primary key, emerald int, token int, level int, skillpoint int)";
            getLogger().info(ChatColor.RED + "There was an error in database -> ");
            statement.execute(sql);
        }
        catch (SQLException exception){
            getLogger().info(ChatColor.RED + "There was an error in database -> ");
            exception.printStackTrace();
        }

    }``` is my code true ? i don't wanna use try cath in onEnable so i  do twr
smoky anchor
sullen marlin
#

?jira

undone axleBOT
smoky anchor
#

ty

remote swallow
#

so you dont want to meet md's kangaroo

quaint mantle
#

can we cancel the item using ?
i mean bow pulling shield blocking ?

tall dragon
#

fairly sure we cannot

#

but dont quote me on that

quaint mantle
#

when i add the itemcooldown to shield
shield has cooldown but i can still blocking

vocal cloud
#

Do you want to cancel it sometime or all the time?

quaint mantle
#

when player get damage from sword attacker

vocal cloud
young knoll
#

Adventure is for components anyway...?

worldly ingot
#

It touches everything keyed

#

Including sounds

young knoll
#

TIL

pseudo hazel
#

imagine touching someones keys

#

smh

quaint mantle
#

Where can I find a modified 1.8 spigot for good knockback etc, something like NitroSpigot but 1,8 only

opal carbon
#

adventure messes with everything yeah

carmine mica
warm mica
carmine mica
#

well, Material will still exist, just deprecated and not getting future updates

#

and the 2 new things aren't enums either, saw you corrected your statement

warm mica
carmine mica
#

if you are developing for older versions, you probably aren't compiling against the new api right?

#

well actually, idk if its decided that Material won't get new constants, I think that's still up in the air

#

but new methods, I think is off the table

warm mica
#

This depends on the plugin itself. Newer ones likely use the new API

carmine mica
#

well if you use new api, you obviously can't use it on a server that doesn't have that api, like an older version

#

that's just how it works

warm mica
#

But this rather seemless change has massive affect on plugins as EssentialsX and any other

#

Each plugin is forced to create the wrapper classes if they want to retain the support

carmine mica
#

idk what seemless means to you in this context, if you mean seamless, that doesn't make sense either

warm mica
#

I mean that it's a small change with massive consequences for almost any plugin

carmine mica
#

I feel like you still aren't understanding that you can't use new api on old servers, that's always the case, not something new that's happening here

#

if you compile against spigot api for 1.19.4 and use material, that will still work on a hypothetical 1.20 spigot server (assuming this happens for 1.20), and into the future

vocal cloud
#

QoL to use an entire library over just using a native method?

warm mica
#

But there's nothing new. Something existing is just being split apart enforcing everyone to adapt something that's basically the same thing as before. Material will likely stay until the death of Spigot itself, similar to the past legacy methods that have been deprecated. It wouldn't be a lot of effort to add new items/blocks into the Material enum as well. As a result of this not being done, almost any plugin needs an overhaul if they just want to make use of the new materials

#

I can understand that it's being deprecated. There is no way around that

#

But the transition should be done easier for everyone

carmine mica
#

I said I don't think its been decided if new constants will continue to be added to Material

#

it sounds like doing that would solve all your issues

warm mica
#

Yes, that's my main concern

livid dove
remote swallow
opal carbon
#

wait what are they doing to material anyway

warm mica
opal carbon
#

classes?

#

or enums

warm mica
warm mica
opal carbon
#

do they just not like enums since they not flexible or smthm

warm mica
#

Ig because of potential mod support

opal carbon
#

makes sense sorta ish

#

cause yeah enums on their own do tend to be rather hardcoded

#

so its understandable sorta ish

restive mango
#

I've been having some trouble using packets to simulate the movement of falling blocks. I find that they 'stutter' in space, teleporting 0.1~ blocks rapidly as they travel, rather than move smoothly. Here's the code:

#
public AsynchronousEntity(Vector velocity, Location spawnLocation, org.bukkit.entity.EntityType entityType, Material mat, 
 int x){
        this.unmodVec = velocity;
        this.velocity = new Vec3(velocity.getX()*x, velocity.getY()*x, velocity.getZ()*x);
        this.lastLocation = spawnLocation;

        lastTime = System.currentTimeMillis();

        entityID = new Random().nextInt(Integer.MAX_VALUE);
        entityUUID = UUID.randomUUID();
        if (entityType != null) {
            this.entityString = entityType.getKey().toString();

            Bukkit.getOnlinePlayers().forEach(player -> {
                CraftPlayer craftPlayer = (CraftPlayer) player;
                if (mat != null) {
                    craftPlayer.getHandle().connection.send(new ClientboundAddEntityPacket(entityID, entityUUID, lastLocation.getX(), lastLocation.getY(), lastLocation.getZ(), 0, 0, EntityType.byString(entityString).get(), getId(CraftMagicNumbers.getBlock(mat, (byte) 0)), this.velocity));
                } else {
                    craftPlayer.getHandle().connection.send(new ClientboundAddEntityPacket(entityID, entityUUID, lastLocation.getX(), lastLocation.getY(), lastLocation.getZ(), 0, 0, EntityType.byString(entityString).get(), 0, this.velocity));

                }
                craftPlayer.getHandle().connection.send(new ClientboundSetEntityMotionPacket(entityID, this.velocity));
               
              });

        }

    }
#
public AsynchronousEntity updateLocation(){
        Long timeDiff = System.currentTimeMillis() - lastTime;
        lastTime = System.currentTimeMillis();
        Vector vec = new Vector(unmodVec.getX(), unmodVec.getY(), unmodVec.getZ());
        vec.multiply(((double) timeDiff)*0.05);

        lastLocation.add(vec);



        vec.multiply(32*128);

        Bukkit.getOnlinePlayers().forEach(player -> {
            CraftPlayer craftPlayer = (CraftPlayer) player;
            if (vec.length() <32767) {
                craftPlayer.getHandle().connection.send(new ClientboundMoveEntityPacket.Pos(entityID, (short) vec.getX(), (short) vec.getY(), (short) vec.getZ(), false));
            }
            craftPlayer.getHandle().connection.send(new ClientboundSetEntityMotionPacket(entityID, this.velocity));

        });
        
        return this;
    }
opal carbon
#

Random.nextInt(1,101) should give from 1-100

#

then check for 30 percent for example if number is < 30

restive mango
#

I have an asynchronous task which runs updateLocation

opal carbon
#

and obviously that percent could just be a variable

#

?

#

wdym

#

then it doesnt activate

#

90% chance for that to happen, so 1-90 mean it activates

#

95 means they dont get it

#

so make it 100%

#

ex

warm mica
opal carbon
#

if you want it to have to proc then make it 100% chance to proc

opal carbon
#

some of it at least

warm mica
opal carbon
#

or am i just stupid

warm mica
#

For other entities it's usually just using the velocity

opal carbon
#

thats what else is for

restive mango
#

but i can't tell a client to simulate spinning a floating object made of blocks in 3d space without simulating the movement of all the blocks composing that floating object

opal carbon
#

if (random <= 10) {
// rare item
} else if (random <= 45) {
// uncommon
} else if (random <= 90) {
// common
} else {
// dogshit
}

restive mango
#

Here's an example

warm mica
restive mango
#

of the stuttering

#

I'm on 1.18.2

#

Uhuh... you realize even if I put it on an armorstand or whatever, it would still have the same problem? In normal MC, falling blocks throw packets every few seconds to update their locations, otherwise everything is done by simply updating motion using ClientboundSetEntityMotionPacket(entityID, velocity)

#

But I can send more packets more frequently than MC would normally.

#

Causing it to update the location more often

#

Now, when I send a motion packet to the FB, when it 'moves', it should 'line up' with where ClientboundMoveEntityPacket places the falling block at, but it doesn't, and I'm not sure why

#

Maybe my math is broken somewhere

#

I've been running through different X's to try to find the proper motion, but alas

warm mica
#

Oh I thought you meant stuttering because of it falling down. That'd be a common question back then

restive mango
#

no

#

i just turn off gravity lol

#

i don't include it in the above

#

because it was over the character limit

warm mica
#

Everything is so easy nowadays

opal carbon
#

any problem with this

restive mango
#
 if (hasNoGravity) {
                    PacketContainer metapacket = new PacketContainer(PacketType.Play.Server.ENTITY_METADATA);
                    metapacket.getIntegers().write(0, entityID);
                    List<WrappedWatchableObject> metadat = new ArrayList<>();
                    metadat.add(new WrappedWatchableObject(new WrappedDataWatcher.WrappedDataWatcherObject(5, WrappedDataWatcher.Registry.get(Boolean.class)), true));
                    metapacket.getWatchableCollectionModifier().write(0, metadat);
                    ProtocolLibrary.getProtocolManager().sendServerPacket(player, metapacket);
                }
#

hm

opal carbon
#

couldnt you just only update the rotation

#

not the location

#

if thats the problem

restive mango
#

No.

#

I have a large collection of FBs, say in the shape of a sword. When I 'rotate' that object in space, the relative positions of all those FB's change.

opal carbon
#

having a hard time understanding your problem then

restive mango
#

I need that rotation to be 'smooth', that is, as the group of FBs move through space, they shouldn't 'stutter'.

opal carbon
#

hate to be that guy but why not just use texture packs

restive mango
#

Because it's a server-side plugin.

opal carbon
#

well duh

restive mango
#

There are other reasons I want to simulate using BOTH motion and moveentitypackets, namely, that this will allow me to ignore collision.

opal carbon
#

but server texture packs do exist

restive mango
#

Anyway, if anywhere here knows why that stuttering exists, or how to fix it, let me know.

#

(hilariously, the motion packet isn't useful for living entities, go figure, all their movement is interpolated)

#

though

#

@warm mica do you know how I could send a packet of an invisible entity with a falling block riding it?

#

maybe that would solve this problem

opal carbon
#

isnt that literally exactly the armor stand suggestion

restive mango
#

that's with MC entities

#

i'm asking packets

#

packets avoid having the server simulate hundreds of entities and their collision

compact haven
#

he wants to have the same goal without the burden of the server knowing about it

restive mango
#

yuh

opal carbon
#

you could just

#

fake a armor stand existing

restive mango
#

buy more ram?

compact haven
opal carbon
#

just send packets pretending a armor stand exists

restive mango
#

@compact haven there isnt a riding entity packet

#

tbh

compact haven
#

there is definitely lmao

#

probably not called “riding entity” though

#

probably called a Vehicle packet of sorts

restive mango
#

fuuuuck

#

i mean yeah you are right

#

but

#

ugh

compact haven
opal carbon
#

like if you want to make a fake entity just make a fake entity

compact haven
restive mango
#

uuuuugh

compact haven
#

Send the armor stand packet, then the set passengers and it might work

restive mango
#

well

opal carbon
#

you just asked how to create a fake entity

restive mango
#

that is one possible solution

opal carbon
#

this is how to do it

restive mango
#

bruh

#

i know that

#

what i am hoping for is someone to go 'oh yes that stuttering problem, i fixed it by just sending a server motion packet every other tick instead of every tick'

#

this is very much a roundabout solution

opal carbon
#

this is a roundabout problem ngl

gleaming grove
#

Is possible to get class object of class with generic type?

compact haven
#

no

#

at least definitely not that way

#

Class class is used for runtime nonsense and generics are pretty obsolete at runtime

#

What’s the actual goal you want to accomplish with clazz

gleaming grove
#

register to DI container

compact haven
#

register, and container?

gleaming grove
#

ok nvm its not related to Spigot

compact haven
#

Register how and what, and what do you mean by container

#

I know that

gleaming grove
#

dependecy injection container

compact haven
#

I know what DI is but what you just said makes no sense

#

DI is a principle, are you talking about a DI framework in particular?

#

because otherwise you just use constructors

#

no idea what a “container” is in Java to be honest

gleaming grove
#

For example Spring framework register all classes with @Bean annotation to its DI container

compact haven
#

oh I have little Spring knowledge but do you mean a class that you can pass that contains all of your typical DI objects instead of passing each object individually?

#

please delete this epic lmao

remote swallow
#

but beans

gleaming grove
#

oh Xd

compact haven
#

alright so now I need more information

#

register how? Are you using Spring or was that just an example?

gleaming grove
compact haven
#

yeah you can’t do that

#

pretty sure that’s the most specific a Class object can get

#

maybe you can use type tokens somehow which is a major hack?

gleaming grove
#

well I can bypass this like that

compact haven
#

pretty sure that the class will not have that generic parameter

#

like the TestConfig generic won’t be part of the object from getClass()

gleaming grove
remote swallow
#

yeah, its like how lists work

#

List<String> list = new ArrayList<>()

#

like you dont add the type on the 2nd half

gleaming grove
#

as I remember for case List<Some<Stuff>> list = new ArrayList<>() an Stuff type will be not included to relfelctions

compact haven
#

Some won’t be either

compact haven
#

It’s just a List

#

It’s true and wrong, it’s just a List in reflections, not even a List<Some>

gleaming grove
#

it is

drowsy helm
#

generics get removed after compilation, so no you cant get the type

compact haven
#

idk if you are trying to correct me Jacek because I’m absolutely positive it’s just a List lmfao

gleaming grove
#

well I've check that. In case of Field you can get the Generic type of list. In case of local variable you can't

compact haven
#

No you can’t, you can get the class of the first element which is likely to be the generic parameter of the List, that’s all

gleaming grove
#
            var memberType = arrayType.getActualTypeArguments()[0];
            var memberClass = Class.forName(memberType.getTypeName());
```   Here is some code that can be use to get generics parameters
compact haven
#

oh my bad, you’re right

gleaming grove
compact haven
#

you can’t get it with just the object though is what I mean, at least I’m pretty sure

gleaming grove
#

yes

compact haven
#

Only if you have the actual reflection field, and possibly method parameters it’ll work as well

#

actually not sure how they’re returned for that last bit

buoyant viper
#

Java 👍

tender shard
#

java > kotlin

opal carbon
tender shard
#

kotlin sucks for a huge amount of reasons, imho.

  1. caring about what's important. what is more important? the type of something, or the name? imho the type is more important
String someVar;

this is definitely better than this:

someVar: String
  1. getters and setters. kotlin thinks it's nice to break encapsulation and just mess around. You can literally do someObject.someField = anotherValue like Wtf. Is this now calling a setter? The funny thing is, it depends on whether the setter is available (aka visible). How stupid is that. Why not just use the setter? Erm....

  2. "Consiseness" lmao yeah well, no. Kotlin is less lines of code, that is true. and Semicolons in java are useless, I agree with that. But Kotlin only makes everything more complicated. It's so ambiguous, I really do not understand why anyone would use it. Open for suggestions though, ofc

#

also kotlin claims to use less code than java, but a simple variable declaration needs more chars than java does

#

not that I'd care about that, but I wanted to mention it

river oracle
#

I'm a maniac

#

I include final

#

:P

#
final String someVar = "Value";
tender shard
river oracle
#

it doesn't

#

I'm just saying if you're literally mad like me and don't like the compiler do its job its longer :P

tender shard
#

i dont get it

#

type > name

#

kotlin is like "yeah the variable has the following value.... oh and btw it's a string"

#

like wtf

#

why not just directly say that it's a string

wary topaz
#

this one little line of code took 3 hours 🙂
public List<String> getMessageList(String key) { if (language.getStringList(key).equals(Collections.emptyList())) { BufferedReader reader = new BufferedReader(new InputStreamReader(this.getResource(translations.language))); return YamlConfiguration.loadConfiguration(reader).getStringList(key) .stream() .map(s -> s.replace("&", "§")) .collect(Collectors.toList()); } else { return language.getStringList(key) .stream() .map(s -> s.replace("&", "§")) .collect(Collectors.toList()); } }

river oracle
lavish hull
#

can someone explain why Deluxe Coinflip shows up as a trojan virus when I download it?

wary topaz
river oracle
#

also if it shows up as a trojan make sure @vagrant stratus heres about it

#

I'd report it and he will deal with it later

#

on spigot

wary topaz
river oracle
wary topaz
#

no it doesnt

tender shard
wary topaz
river oracle
#

also the overhead of loading an entire config for one value

#

is horrid idea

#

cache the config

tender shard
river oracle
#

and reuse it

tender shard
#

nullability is not an issue, it's a feature

wary topaz
#

its a static config which means I can access it anywhere

tender shard
#

oh yeah that reminds me, kotlin does not even support static members

#

"companion objects" lmao yeah, no

tender shard
wary topaz
#

wish the yamlconfiguration accepted inputstreams else I wouldnt have to go through the trouble of all of that code

#

and yes ik its deprecated

wary topaz
#

yes a buffered reader

tender shard
#

and no, it's not deprecated

tender shard
wary topaz
#

check rn its dep

wary topaz
#

I said inputstream

tender shard
#

yeah I know

#

why can't you just put that into a Reader?

#

InputStreamReader

wary topaz
#

BufferedReader reader = new BufferedReader(new InputStreamReader(this.getResource(translations.language)));

tender shard
#

why are you wrapping it into a BR, that's not needed

wary topaz
#

fixed lol

tender shard
#

does it work correctly now?

wary topaz
#

ye

#

InputStreamReader.
CharArrayReader.
FileReader.
PipedReader.
BufferedReader.
FilterReader.
PushbackReader.
LineNumberReader. 🙂

opal carbon
#

are you jeff or alex

wary topaz
undone axleBOT
#

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

opal carbon
#

what

wary topaz
#

do you have a question?

opal carbon
#

i was asking if he is jeff or alex

wary topaz
#

#general

opal carbon
#

that was the question

wary topaz
#

GO is better

#

lmfao jk

river oracle
#

no, Go is for different things

opal carbon
#

not the rust vs go

#

ive seen that debate before

river oracle
#

you should use Go to solve problems go is best at solving

#

and Rust to sovle problems rust is best at solving

wary topaz
#

coding languages be like

opal carbon
#

rust is the only name first language i respect

river oracle
opal carbon
#

i despise python

wary topaz
opal carbon
#

python is one of my least favorite languages

river oracle
opal carbon
#

python was my first but after learning new languages i hate it lol

river oracle
#

poor python

wary topaz
#

python gives me aques

river oracle
#

its so great, but no one loves

opal carbon
#

its main good quality is the fact so many people use it

river oracle
#

its a scripting language after all

#

its goal isn't blazingly fast programs like C or C++

wary topaz
#

who hates arraylists cause I just found a better option

river oracle
wary topaz
#

`import java.util.Map;
import java.util.TreeMap;

public class Main {
public static void main(String[] args) {
Map<String, Integer> treeMap = new TreeMap<>();

    // Adding elements to the tree map
    treeMap.put("A", 1);
    treeMap.put("C", 3);
    treeMap.put("B", 2);

    // Getting values from the tree map
    int valueA = treeMap.get("A");
    System.out.println("Value of A: " + valueA);

    // Removing elements from the tree map
    treeMap.remove("B");

    // Iterating over the elements of the tree map
    for (String key : treeMap.keySet()) {
        System.out.println("Key: " + key + ", Value: " + treeMap.get(key));
    }
}

}` ||(joke)||

river oracle
#

they are a good data structure

wary topaz
#

lmfao

opal carbon
river oracle
opal carbon
#

its simple as shit

#

but also i hate its syntax

#

and lack of any sort of decent typing

river oracle
#

typing in python is very strong if you use it

opal carbon
#

at least js has ts trying to help it out

#

py typing is just confusing

river oracle
#
number: int = 582
opal carbon
#

kinda like ruins the whole point of python

wary topaz
#

wtf

#

"number"

river oracle
#

that's a design flaw

wary topaz
#

🤡

opal carbon
#

im saying typing being weird

#

like it should be mandatory

#

and at least in ts you can trust people are probably gonna use typing otherwise they wouldnt be using ts

river oracle
#

this is why I love python

#

made this script in like 10 minutes

opal carbon
#

why did you make a wrapper for buildtools

river oracle
#

would have taken way longer in java

opal carbon
#

this doesnt need to exist

river oracle
opal carbon
#

ah

opal carbon
river oracle
#

also manages cacheing etc though its not fully flexible yet with the cacheing

opal carbon
#

simple scripts are what python is good for

#

i just dont like when people take super fancy massive projects

#

and do it in python

river oracle
#

if someone makes a big project in python they are stupid

opal carbon
#

just dont like reading large py code

opal carbon
river oracle
#

unless the project is AI, then Its semi-excusable

#

it'd still be better to use C, but I'd understand not wanting to touch that shit show

opal carbon
#

dayum

#

but yeah python is fine as a scripting language

#

but large projects in python just feel confusing to me

river oracle
#

I have uncoditional love for python as my favorite scripting language
(javascript can just go die)

opal carbon
#

i prefer js over py for most projects ngl

river oracle
#

I just hate web dev

#

its irritating and not rewarding

opal carbon
#

oh yeah i like nodejs

#

not web js

river oracle
#

nodejs

#

is weird

opal carbon
#

discord.js my beloved

river oracle
#

I code my discord bots in java

opal carbon
#

i use nodejs as just a scripting language

#

for small projects

#

like for example a stock checker for those peepy stuffed animal things

river oracle
#

also main reason I use py, is because latest version comes preinstalled on most linux distro

#

so it just makes it super portable

opal carbon
#

i made a stock checker for those lol

#

in js

#

im fine with py as long as it's used as a scripting languages i just hate having to look through big ass codebases with no brackets

#

the lack of brackets scares me

#

im just happy i made a little wrapper for bungee messaging channel i cant wait to hopefully never touch it again

#

like ill have to look at docs more cause all i did is make the messages automatically send but they dont know the specific data to send or anything

#

but its less work then writing everything to the message

buoyant viper
#

too long

#

to get working the way i wanted it to

#

started as an afternoon project ended up taking like a good week

scenic onyx
#

"TextComponent message = new TextComponent(ConfigUtil.getplayerconfig((Player) p, "TpaArrivato"));
message.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tp " + p.getName() + " " + target.getName()));
target.spigot().sendMessage(message);" How do I get it to run from the console?

sullen marlin
#

dont cast to player

scenic onyx
#

How do I not do this from the player?

desert tinsel
#

Does anyone know how to use firebase with spigot, if there is a library or smth?

sullen marlin
#

just use the firebase java library

#

isnt it really expensive though

desert tinsel
sullen marlin
#

Need to add google repo

desert tinsel
# sullen marlin Need to add google repo

like this?

    <repositories>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
        <repository>
            <id>google</id>
            <url>https://maven.google.com/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.19.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.firebase</groupId>
            <artifactId>firebase-firestore</artifactId>
            <version>24.6.1</version>
        </dependency>
    </dependencies>```
#

cause I get the same error

silent belfry
#

Does anyone know any alternative to Hibernate that works using libraries flag in plugin.yml

sullen marlin
#

Whats not working

silent belfry
#

still get this

#

with this issue

#

Using 1.19.4

#

but I can give you full stack trace log if you want it

silent belfry
sullen marlin
#

Not running spigot

warm mica
#

Using another library won't fix that. This is not caused by a spigot bug or hibernate. It's just that two components are being loaded by different class loader

#

By default, Class.forName (without passing a classloader) only goes through the classloader you currently are in and your parents. That being e.g. your plugin and the system classloader (used for Bukkit, NMS etc)

#

Alternatively you could also use hibernate with annotations instead of declaring everything in that xml file

#

But I may also be wrong. I am not certain how Spigot handles that internally

quiet ice
#

I mean technically it could be fixed on spigot's by using different classloading techniques. But classloading is painful from time to time with many rouge bugs so I understand if one doesn't touch it

blissful wagon
#

how we can get all entities with specified scroeboard tag ? like how we do it with command @e[tag=test]

#

or at least how we can get a list of every entity in server ?

#

nvm

hazy warren
#

BlockDisplay#setIntepolationDuration doesn't seem to be working for me.
I assume it works by simply setting the delay, and afterwards all following transformations will take X ticks to interpolate?

#

I've set the duration to 10 but all transformations happen instantly

young vine
#

People with a mentality like you are the reason why the Bukkit API is in such a horrible state and we have to push back on that mentality whenever possible to be able to move forward

#

Glad to see that Choco agrees

quiet ice
#

Yeah honestly there is little point in supporting older versions

#

usually there is an older download of your plugin or a specifically made backport if you fancy latter so it is not as if the people running older servers are missing a lot. But new plugins should be written for new technology (which will get outdated in 5 years time but that is another issue)

warm mica
#

If you can't provide a proper stable API that doesn't break in the span of 5 updates, I could just as well use NMS

#

Only thing that I want is that the new materials are being added to the Material enum as well. It's that simple

eternal oxide
#

No point

#

The API has been stable and not broken in MANY years. This is a change that is long overdue. Time to break.

warm mica
#

It's not like as if there is anything that'd hold up from doing that. Just the mentality of the people responsible for that

#

Imagine if windows would remove 32bit support for programs just because they feel like it. Exact same thing

eternal oxide
#

Material Enum is already a nightmare. It kills IDE's for many people

tardy delta
#

download sources

eternal oxide
#

Imagine if Windows removed outdated 32bit support after MANY years of legacy support, in a NEW release. Some would complain. Many would update.

lone jacinth
#

There is a compatibility layer provided (where multiple days worth of hours were put into) to make sure older plugins will stile work

warm mica
icy beacon
#

if anyone has ever worked with Reflections please take a look and tell me if this is obviously wrong or if it could potentially work
i want to go through every class in a package and create an instance of it

eternal oxide
#

Every plugin I've written supports teh version it was written for and backwards. Going forward I'll support only the new system. If people want older versions they can download the appropriate jar.

icy beacon
eternal oxide
warm mica
#

It's not like as if the Material enum disappears with the update. It'll still he very actively used with many following updates

#

It's a transition. 32bit -> 64bit was a transition as well

eternal oxide
#

I think they shoudl actually break teh API with 1.20

#

remove the Material Enum

warm mica
eternal oxide
#

performance

warm mica
#

Performance. By removing that one class from the memory

eternal oxide
#

yes

warm mica
#

Lets just make everyone spend tons of time into forcing them to do something that can easily be avoided just to save a couple of bytes in the memory

eternal oxide
#

yeah, a "couple of bytes"

warm mica
#

Literally. You won't notice a difference

#

A mob spawned in your world likely consumes more

eternal oxide
#

probably, but I think it's time to trim the fat.

warm mica
#

As I said, you just want to get rid of it because you feel like it. Not because there is actually any benefit in doing that

eternal oxide
#

There is guaranteed to be a benefit to removing it.

#

My reason for removing it is two fold.

#

Performance for one. Second is it would clean the gene pool of all old and outdated plugins. Those willing to update would be be clean.

hazy parrot
#

Look up about weighted random

tardy delta
#

are those supposed to add up to 100

quiet ice
#

Yeah, you'd need to change the values so they add up to 100 first

#

Except if you just do other tricks - I guess that would work too

scenic onyx
#

TextComponent message = new TextComponent(ConfigUtil.getplayerconfig((Player) p, "TpaArrived"));
message.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tp " + target.getName() + " " + p.getName()));
target.spigot().sendMessage(message);
how do i make the console execute the command?

#

and dont't the player

eternal oxide
#

If you have 10 items all with a 90% chance, how do you expect to decide which it shoudl give?

#

I don;t believe you understand percentage chance

#

you tell us what you want it to do

scenic onyx
#

no, i want when i click the message the console execute it

#

the code you gave me executes the command and that's it, I want to put it when I click but I don't know how to do it

eternal oxide
#

Do what? You need to explain how you want it to work

tall dragon
#

crazycrates uses weighted random

#

google

sour folio
#

Hey there, im trying to make a homesGUI plugin, how would i go about creating a folder that stores all the player data, so in the homesGUI folder there would be a UserData folder with many files of all the userID's with homes

sullen marlin
#

new File(plugin.getDataFolder(), "UserData").mkdir()

tall dragon
sour folio
#

Thanks for all the help, appreciated 👍

tardy delta
#

actually just File objects

#

looks like im a bit late

solemn dome
young vine
#

Just a deprecation

#

Nothing major will be broken, the cases that will be broken has been warned for for years, in literally every major spigot update post

#

This API didn't change in 11 years

#

11 fucking years

#

Even tho Mojang completely rewrote their code in 1.13, which forced plugins to adopt anyways, but spigot decided to not change the API

#

That was the error right there

#

When Mojang did the flattening it would have been the perfect time to do this change

young vine
#

And they did, nobody really complained

young vine
orchid gazelle
#

Apple 🤮

young vine
orchid gazelle
young vine
#

I said code

orchid gazelle
#

Ohh wait they just removed support

#

Thats fine then

young vine
#

Removing old code from your codebase is a major benefit

orchid gazelle
#

Breaking 32bit compat would be bad

#

Thats what I meant

quiet ice
#

I'd like to see 32 bit compat gone

orchid gazelle
#

No.

#

Half the software im using, gone

young vine
#

Apple fully removed 32bit compat years ago

quiet ice
#

Too much is still using 32 bit. It's time to embrace technology

young vine
#

Was it Catalina?

quiet ice
orchid gazelle
young vine
#

Software can be updated

quiet ice
#

Then just don't use old software?

orchid gazelle
#

But won't

young vine
#

If it's not getting updated, chances are you shouldn't use it anyways

#

If it's Foss, somebody will make the update

shadow night
#

They would have to announce: "You either update to 64-bit or your application is not runnable"

orchid gazelle
young vine
#

If it's commercial software, there is an incentive

young vine
orchid gazelle
#

You cannot expect some 10 year old open-source project made by one person that now has a full-time job to get updated

young vine
#

Just like spigot gave a big warning about the material enum, will but it a compat layer for a few versions and then hopefully nuke the material enum and the compat layer

shadow night
orchid gazelle
young vine
shadow night
orchid gazelle
#

One person will not make the effort and update

#

Also, they would have to confirm the PR

young vine
#

There is always gonna be impact

orchid gazelle
#

Which they won't if they don't care

young vine
#

But should we hold back innovation because of that?

orchid gazelle
#

Maybe

young vine
#

For a sensible amount of time, yes

#

That time long passed

eternal oxide
#

Its been years in the making. Time for breaking changes

young vine
#

Exactly

orchid gazelle
#

Take Materials

shadow night
#

I wonder what will happen to 32-bit devices

orchid gazelle
#

They are gonna break a stupidly high amount of plugins

#

Which will never come back

ivory sleet
#

the Material enum is subject for removal even in spigot rather soon (or at least deprecation from what I understand)

young vine
#

Not really

#

Most plugins will just continue to work

orchid gazelle
#

Since half of the old spigot devs are 10y/o kids that don't even know about those changes

young vine
#

Because there is a compat layer

eternal oxide
#

If a plugin breaks and is popular it will be updated

orchid gazelle
#

"And is popular". Thats the key

#

It has to be really popular

eternal oxide
#

if its not popular it won't be missed

orchid gazelle
#

And the code must be public

eternal oxide
#

not essential

young vine
#

Most plugins are simple to rewrite if needed too

#

And decompilation is easy

orchid gazelle
#

Yeah yeah lets just rewrite 100k plugins, its that easy

warm mica
young vine
#

But again, if a plugin doesn't receive updates in general, you shouldn't use it anyways and look for alternative

ivory sleet
# shadow night Why

because there are more accurate ways to represent item materials, and block materials etc

eternal oxide
#

No just the ones that break and are popular enough to need it

orchid gazelle
#

There is gonna be damage for sure

#

I know that there will be plugins I need and cannot use in the future because of that

young vine
#

And the work can't be avoided

lone jacinth
young vine
#

We need to move forward

orchid gazelle
warm mica
orchid gazelle
#

Sometimes, older software can be better

#

"Better"

eternal oxide
#

grasping at straws now

orchid gazelle
#

For example, minecraft content modding. Way better in the past

eternal oxide
#

Subjective

orchid gazelle
#

Well, is it really? You cannot deny variety

young vine
warm mica
orchid gazelle
warm mica
#

Because it is literally no effort? And it's a huge ton of work to update all these plugins?

young vine
#

To use new materials you would need to compile against a new spigot version anyways, they only work on new spigot versions, you have no reason to not adopt the new API then

young vine
#

Structural find and replace can catch most of the places most likely

tender shard
warm mica
tender shard
#

unless you do use an EnumSet, you'll be alright

tardy delta
#

ctrl r Material -> new name

young vine
orchid gazelle
young vine
#

No rush needed

lone jacinth
tardy delta
#

BlockType being for what?

tender shard
warm mica
#

I find it fascinating how a lot of people here enjoy literally avoidable work

young vine
#

It's unavoidable

#

Stop saying it's avoidable

warm mica
tender shard
orchid gazelle
#

Why would it not be

warm mica
lone jacinth
quaint mantle
#

hi

#

i need help

orchid gazelle
#

Hi

solemn dome
tender shard
undone axleBOT
#

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

young vine
#

The compat layer for enum sets is expensive tho

tender shard
quaint mantle
#
public class rtp implements CommandExecutor {
    private HashMap<UUID,Long> cooldown = new HashMap<UUID, Long>();
    private int cooldowntime = 10;
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player){
            if (command.getName().equalsIgnoreCase("rtp")){
                Random random = new Random();
                Player p = (Player) sender;

                if (cooldown.containsKey(p.getUniqueId())){
                    long timeLeft = ((cooldown.get(p.getUniqueId()) /1000) + cooldowntime) - (System.currentTimeMillis() /1000);
                    if (timeLeft > 0){
                        if (timeLeft <= 4){
                            p.sendMessage(ChatColor.RED + "Możesz się teleportować dopiero za " + timeLeft + " sekundy");
                        }
                        else {
                            p.sendMessage(ChatColor.RED + "Możesz się teleportować dopiero za " + timeLeft + " sekund");
                        }
                    }
                }
                else{
                    int x = random.nextInt(1000);
                    int y = 150;
                    int z = random.nextInt(1000);
                    Location location = new Location(p.getWorld(),x,y,z);
                    y = location.getWorld().getHighestBlockYAt(location);
                    location.setY(y);
                    p.teleport(location);
                    cooldown.put(p.getUniqueId(),System.currentTimeMillis());
                }



            }
        }
        else {
            Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "Komenda może być wykonana tylko za poziomu klienta gry!");
        }
        return false;
    }
}
young vine
#

Yeah, using an enum set for material is stupid, lmao

tender shard
tardy delta
warm mica
young vine
#

No like it brings no benefit because the enum is so large, it's gonna degrade to a normal hash set anyways, iirc

quaint mantle
#

after cooldown command don't teleport player

young vine
#

Like the class file

tender shard
orchid gazelle
young vine
#

The jvm has limits

#

Plus it's slow obviously

tender shard
#

the actual issue is that using an enum will prevent dynamically adding new entries, e.g. because of data packs etc

shadow night
#

How do I make a cooldown for the user of a certain item? Like on some servers there is a counter on the xp bar

solemn dome
orchid gazelle
#

Thats fair

young vine
#

It's also a massive burden on mc Updates, have you seen all the switch cases?

quaint mantle
#

how to fix it?

orchid gazelle
#

I don't have an issue with changing, but for god sake just let compat be there

young vine
#

Compat is provided

#

Only backwards tho obviously

orchid gazelle
#

Not forever

tender shard
young vine
#

Forward compat is stupid

shadow night
warm mica
#

Nothing that'd prevent them to add further entries for the next few updates until everyone has transitioned

orchid gazelle
#

No its not

young vine
#

Nobody will transition then

tender shard
#

Player#setCooldown(...)

young vine
#

If you just let everything continue to work we can never actual remove the enum because the cry would be too large

orchid gazelle
#

Imagine that you got some guy that made you a commission 2 years ago. You still use the plugin because it is great. Then its bonked

young vine
#

Instead we can use that little trick to force people to update their code if they are touching it for new blocks or items anyways

tender shard
#

i remember how 1.13 broke literally every existing plugin, because people kept ignoring the announcement "item IDs will soon get removed"

shadow night
tender shard
#

exactly that's what it is

young vine
#

Or well deprecated and remove later

tender shard
shadow night
orchid gazelle
#

If you break every plugin, make ALL important changes to that point

young vine
#

The PR we have right now could have been done back then

tender shard
warm mica
young vine
#

There have been plenty announcements

warm mica
#

It's not like as if not adding the new entries would prevent anyone from using it

young vine
#

Plus again, there will be a compat layer

tender shard
warm mica
#

The class is still there

tender shard
lone jacinth
tender shard
young vine
#

But I knew I wouldn't have a chance

tender shard
#

did you not sign the CLA or what lol

young vine
#

Am happy that MD finally sees that it's important now

#

But he wouldn't have been open to it back then

#

People tried pushing it back then

orchid gazelle
#

If you do that drastic changes, finally give me a mixin-loader lmao

young vine
#

Oh god please no

warm mica
tender shard
young vine
#

Plugin devs already do stupid shit

#

Imagine if you give them mixins

tender shard
orchid gazelle
quiet ice
shadow night
young vine
#

It would be a desaster of incompabilities

quiet ice
#

Finally I can fix stupid plugins not being compatible with my plugin

solemn dome
#

I'm sure someone will do some kind of library/plugin that fixes this issue...

young vine
#

Exactly, monkey patching other plugins code, wooooooo

icy beacon
#

how do I properly setup MockBukkit? i remember that there was something that I had to add to my main plugin class, but it's not in the docs anymore and now i get an error at this line:
plugin = MockBukkit.load(UnderscoreEnchants::class.java)

young vine
#

What could go wrong

tender shard
#

hm material still is an enum

quiet ice
lone jacinth
orchid gazelle
#

What if I finally write my system to get a JavaAgent inject at runtime, overwrite some shit and go STONKS?

young vine
#

I don't give a shit about please that touch 1.8

dire marsh
#

material IDs
kek

young vine
#

They deserve all the pain and suffering possible

young vine
solemn dome
orchid gazelle
#

Why not

young vine
#

They removed the ability to self inject

#

Or are planning? Idk if it's shipped yet

orchid gazelle
ocean hollow
#

if I need to load content from the past inventory, should I do that?

orchid gazelle
#

Fuck them for doing that

young vine
#

Not shipped yet

orchid gazelle
#

Can I run that shit on runtime?

quiet ice
#

Yep and from a remote process

orchid gazelle
#

LMAO

#

So I can still do my JavaAgent stuff?

quiet ice
#

It was made by the Recaf guys

orchid gazelle
#

I love you geol

#

Whatever Recaf is, they deserve to win the lottery rn

quiet ice
orchid gazelle
#

Ohv wait

#

I know

quiet ice
#

If you have never heard about recaf you shouldn't be doing bytecode patching

warm mica
orchid gazelle
#

Recaf, yeah

quiet ice
#

Stupid BCV users, smh

orchid gazelle
#

Its this bytecode editor right?

#

Yeah