#help-development

1 messages · Page 1249 of 1

jagged thicket
#

there might be some big brain way to do that

outer tendon
#

Alright, but I'm saying I don't think your warning is necessary.

blazing ocean
#

Async plugin loading is just a stupid idea since plugins may have to block the server from starting whilst initialising...

slim wigeon
jagged thicket
#

i mean yeah its not necessary

#

just a thought

blazing ocean
#

Would just break all plugins made before that version though

jagged thicket
#

idk @ ike do u wanna make ur exentions load async in helix

thorn isle
#

I do async plugin loading because once you have enough plugins it actually starts to take a while, and most of the things happening on load can be done in parallel

#

Not async in the sense that I patched the server to throw a new thread at every plugin's onEnable, but rather making select time consuming plugins do their startup async and offer a completablefuture for dependents to block on

cursive kite
#

I am working on an auction plugin - I have an event every second as the GUI shows a live countdown - will this affect performance / is there a solution

sullen marlin
#

No

#

Unless your event is slow

cursive kite
#

It is working perfectly but just brain storming since in testing I have like 5 items but of course in theory you never know it might become 2000 one day

sullen marlin
#

server has lots of events per second already

cursive kite
#

About memory impacts - currently I generate two items, the item being auctions and a modified display auction (lore for countdown/price/etc) - is it necessary to reduce that to one itemstack value (default item being sold) and just generate and throw the lore onto it while being displayed instead of having a display item generate ?

thorn isle
#

uh

#

huh?

#

i'm not sure what your questions it, but aside from items that hold recursive data like shulkers or written books, itemstacks aren't that heavy on memory, it will be fine to have thousands of them

#

in some sense the server is allocating and discarding thousands of them all the time, or at least tens for every online player

daring light
#

What would be the best way to disable redstone in a world?

thorn isle
#

listen to the related events and spawn tnt

sullen marlin
#

BlockRedstoneEvent -> event.setCancelled(true)

#

@jagged thicket you around?

#

how did you enable whitelist?

eternal night
#

@echo basalt it's nexo

#

Your PDC issue

#

Someone else on paper ran into it, cross referenced with your plugin list, only nexo and mythic mobs matched and removing nexo solved it. They are reporting it as I type this

jagged thicket
sullen marlin
#

I still can'tt reproduce

#
[19:48:55] [Server thread/INFO]: Login by md_5 from 127.0.0.1
[19:48:55] [Server thread/INFO]: Disconnecting md_5 (/127.0.0.1:46738): You are not whitelisted on this server!
[19:48:55] [Server thread/INFO]: md_5 (/127.0.0.1:46738) lost connection: You are not whitelisted on this server!
slim wigeon
#

Since the timers is what I can do with my goal. I going to create a manager that my plugin can access. I might be doing too much. But if you look at the code from how SA-MP does it, you see it needs a timerID.

https://sampwiki.blast.hk/wiki/KillTimer

But from the Java end, there is no such thing as a timer id. You get the timer and run .cancel(). So my question is, how would I put multiple timers (BukkitRunnable) into one List<BukkitRunnable> in a named array. Like what I doing with the Player object?private HashMap<Player, List<BukkitRunnable>> timers = new HashMap<Player, List<BukkitRunnable>>();

jagged thicket
sullen marlin
#
    public void event(PlayerLoginEvent event)
    {
        System.out.println( "Login by " + event.getPlayer().getName() + " from " + event.getAddress().getHostAddress() );
    }```
jagged thicket
#

can i show it live?

sullen marlin
#

are you offline mode?

jagged thicket
#

yes

sullen marlin
#

let me try that

#
[19:51:08] [Server thread/INFO]: Login by md_5 from 127.0.0.1
[19:51:08] [Server thread/INFO]: Disconnecting md_5 (/127.0.0.1:55738): You are not whitelisted on this server!
[19:51:08] [Server thread/INFO]: md_5 (/127.0.0.1:55738) lost connection: You are not whitelisted on this server!
#

still fine

jagged thicket
#

very weird

#

the test server is still up

#

leme jus try again

sullen marlin
#

maybe it only affects windows haha

thorn isle
#

what's the question? it looks to me like you answered your own question

jagged thicket
rough drift
jagged thicket
#

1.21.4

thorn isle
#

if you want to associate the list with a String identifier instead of a player, change it to Map<String, List<BukkitTask>>

rough drift
sullen marlin
#

like how is GTA san andreas relevant

jagged thicket
#

i need to build spigot jar 💀

rough drift
rough drift
jagged thicket
#

This server is running CraftBukkit version dev-Spigot-73860e0-f0c8dd3

#

i only have the patched version rn

slim wigeon
# jagged thicket very weird

You can run ngrok and let people test it. I found out you not getting player's IPs. I was testing my VPN block and I seen "VPN/Proxy detected - (0:0:0:0:1) " so its safe to run. But if you running it on your network, you might wish to avoid this. Ngrok is perfect for protection between its users and the hoster

jagged thicket
#

leme re build spigot

sullen marlin
#

wat

jagged thicket
#

and try again

sullen marlin
#

are you a bot?

thorn isle
#

no he's just a bit uh

slim wigeon
thorn isle
#

the way he is

#

definitely a human

#

self botting is a thing but it's against the tos and whatever

sullen marlin
rough drift
thorn isle
#

bots don't get offended and i'm pretty sure he still has me blocked for telling him to start with java basics

jagged thicket
#

im building 1.21.4

#

leme let u know in 5 mins

#

i have so many server jars

#

idk which is the stock spigot one

#

@sullen marlin

#

yeah i can reproduce

sullen marlin
#

hmmm

jagged thicket
sullen marlin
#

what about if you make a new server folder and start from that

jagged thicket
#

leme try that

#

but i don't think thats the problem

#

because i tried it already

sullen marlin
#

hmm idk why I'm not getting the issue

#

maybe my connection is closing too quickly, I think I see where there could be a bug

jagged thicket
#

also weirdly it only happens on the first connect

#

@sullen marlin can confirm only happens in offline mode

jagged thicket
#

after restart

pseudo hazel
#

its probably mojangs fault then

sullen marlin
#

@jagged thicket I think this is a better fix:

Add "DISCONNECTED" to LoginListener.EnumProtocolState.

As first line of try { block in disconnect(IChatBaseComponent) add "this.state = EnumProtocolState.DISCONNECTED; // CraftBukkit"

#

does that fix it for you?

jagged thicket
#

i think that will work too

#

leme try that

short pilot
#

hey guys!

#

ive made goals for melee attacking players, but how do you make ones for ranged attacks like a traditional skeleton bow and arrow shooting?

slim wigeon
#

Lemehost[09:33:44 WARN]: Can't keep up! Is the server overloaded? Running 6804ms or 136 ticks behind

#

Need free hosting, this one not working

thorn isle
#

what was that fork with the async entity pathfinding again?

chrome beacon
#

Use your PC

thorn isle
#

i vaguely remember someone actually competent implementing it at some point

slim wigeon
slim wigeon
thorn isle
#

not talking about the $100 "async paper forks"

slim wigeon
thorn isle
#

i'm saying $100 async paper forks are not competently written; they're almost universally cashgrabs written by beginners

#

but i vaguely remember someone doing async entity pathfinding in a proper open source fork

#

i just can't remember which one of them it was

slim wigeon
thorn isle
#

i mean like i feel like spottedleaf or one of the other paper performance nuts has already done this open-source, i remember it being talked about

slim wigeon
#

Try to create one and you see what I talking about, you have been warned

thorn isle
#

i'm not commissioning an async pathfinder fork or anything

#

pathfinding itself is pretty simple, but there are tons of ai goals associated with mobs which would all have to be made thread safe probably individually

slim wigeon
#

With their road system

thorn isle
#

i did write a pathfinder for my npc plugin

slim wigeon
#

Minecraft is more complex than SA-MP because the mobs and all that

torn shuttle
#

you can do pathfinding in async pretty easily, what are we smoking today

thorn isle
#

for sure

#

i want to take a look though to see if they also async'd the ai goals

torn shuttle
#

if you implement your own goal system it can be as async as you want lol

#

just remake the game

#

but asyncier

smoky anchor
#

What is SA-MP ?

thorn isle
#

pathfinding itself isn't that expensive these days vs all the goals being started and tested every tick

slim wigeon
#

San Andreas Multiplayer

torn shuttle
#

depends on the pathfinding

#

at a scale it sucks

slim wigeon
#

Its a mod for GTA SA that allows Multiplayer

torn shuttle
#

and it sucks if you're pushing follow distance

thorn isle
#

scarcely shows up in my timings but then again i'm not doing anything special with pathfinding, most mobs have like a 20 block follow range or something so it's usually not an issue

#

trying to use it for like getting hundreds of blocks away is probably doomed

torn shuttle
#

I mean it's not the thing you think about short of wanting to mess with entities at least in the low to high hundreds all at once, or tryign to make a caravan-style mob that can go for thousands of blocks

pure dagger
#

why doesnt

InventoryClickEvent.getCursor().setType(Material.AIR)
work?

thorn isle
#

i just want to try and remember what that fork was to see if they have some work done on the goals

torn shuttle
#

uh folia or whatever it was?

thorn isle
#

i'm debating looking into having some of the common goals run async and would like to see how others have done it before me

#

folia was the regionized ticking thing, right? i don't think that's the type of async i'm looking for

torn shuttle
#

yeah it was mostly for async chunks

#

iirc

#

the main problem I see with throwing too much stuff into async is just that you might end up with some critical behavior that feels sluggish

thorn isle
#

as long as all of it runs every tick there should probably not be more than maybe 50-100ms delay for things to happen, i'm not sure how noticeable that would be

#

at least i can't think of an ai goal that'd be that sensitive to delays

#

maybe like running around with speed V and mobs chasing you; if the pathfinder lags behind they'll look to be chasing your shadows

torn shuttle
#

man why is buildtoolsl failing

#

I love having my computer getting wiped

#

I don't think I had the jdk

#

yesterday I had to manually download some stuff for directx 11

sullen marlin
jagged thicket
#

i think it works

#

leme try again

elder berry
#

I want plugin fakeplayer support 1.19.4

smoky anchor
#

I want ten million dollars

torn shuttle
#

I want a billion dollars in gold bars

smoky anchor
jagged thicket
#

@sullen marlin

#

Yeah that fixes the problem

#

leme open a CB pr

elder berry
smoky anchor
white crescent
#

Hello, I am trying to add custom font to text into minecraft resourcepack, I added font throught .ttf, added .json for getting the abilities and added it into en_us.json. It doesn´t work, can someone help me please?

smoky anchor
#

I do not think the lang file supports font or anything text component related.

#

For this probably go to the Minecraft Commands discord server

jagged thicket
sullen marlin
jagged thicket
#

speedrun 😎

jagged thicket
#

@sullen marlin oh no, smth wrong with the patch version

#

idk how to fix

sullen marlin
#

Weird that it passed jenkins

#

Let me check

#

dw I pushed a fix

jagged thicket
#

thanks

#

idk why it happend, im pretty sure i rebased and stuff

sullen marlin
#

spigot sometimes need a rebuild

#

usually jenkins catches it, idk why it didnt

jagged thicket
#

alrightt!!

remote swallow
#

you know what would be crazy

#

merging bukkit and cb into spigot directly

jagged thicket
#

yeah, it would be convenient

young knoll
#

Chocos component pr is a good start

eternal night
#

I do remember a move of a good amount of patches from spigot to CB not that long ago right?

young knoll
#

I believe we got the number down a bit

#

Ye

halcyon dirge
#

@wise rock hi, could you add me? I need to dm you about some of your projects [sorry for the ping]

#

also i thought i was in #general lol

radiant lotus
#

Is any1 able to make a plugin for my minecraft smp you will get acces to the smp without making a application as you coded the plugin

chrome beacon
#

?services

undone axleBOT
white crescent
#

Can someone help me to get only some text with different font with minecraft resource pack?

smoky anchor
#

You can use the font field in a text component

blazing ocean
#

?components

undone axleBOT
white crescent
#

I am trying to get it into minecraft first throught resourcepack but I want it only apply the custom font to action bar

smoky anchor
#

You have to use components as linked above

slender elbow
#

im sorry to hear that

naive knoll
#

i use packetevents and i want create armor stand with name above, and i try search what metadata i must use but i can't find. i find some github repository, where if find on which index i should set string name, but i don't know how to do to see this title, anyone have idea?
my actual code:

        WrapperPlayServerEntityMetadata metadataPacket = new WrapperPlayServerEntityMetadata(entityId, Arrays.asList(
                new EntityData(0, EntityDataTypes.BYTE, (byte) 0x20), 
                new EntityData(4, EntityDataTypes.STRING,  nameTag)
        ));```
https://github.com/Attano/Spigot-1.8/blob/master/net/minecraft/server/v1_8_R3/DataWatcher.java
I search in wiki.vg for 1.8.8 in web archive, but information in web archive is not same as in datawatcher class:
https://web.archive.org/web/20151004095301/http://wiki.vg/Entities
smoky oak
#

player placed leaf blocks know they've been placed by a player. is this something all blocks have or something sepcific to leaves?

manic delta
#

use that

smoky anchor
harsh ruin
#

Does anyone know anything about TensorFlow?? Please

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!

sly topaz
#

though that has little to do with plugin development tbh

harsh ruin
# sly topaz ?ask

`from keras.models import load_model # TensorFlow is required for Keras to work
from PIL import Image, ImageOps # Install pillow instead of PIL
import numpy as np

Disable scientific notation for clarity

np.set_printoptions(suppress=True)

Load the model

model = load_model("/content/keras_model.h5", compile=False)

Load the labels

class_names = open("/content/labels.txt", "r").readlines()

Create the array of the right shape to feed into the keras model

The 'length' or number of images you can put into the array is

determined by the first position in the shape tuple, in this case 1

data = np.ndarray(shape=(1, 224, 224, 3), dtype=np.float32)

Replace this with the path to your image

image = Image.open("/content/manette.jpg").convert("RGB")

resizing the image to be at least 224x224 and then cropping from the center

size = (224, 224)
image = ImageOps.fit(image, size, Image.Resampling.LANCZOS)

turn the image into a numpy array

image_array = np.asarray(image)

Normalize the image

normalized_image_array = (image_array.astype(np.float32) / 127.5) - 1

Load the image into the array

data[0] = normalized_image_array

Predicts the model

prediction = model.predict(data)
index = np.argmax(prediction)
class_name = class_names[index]
confidence_score = prediction[0][index]

Print prediction and confidence score

print("Class:", class_name[2:], end="")
print("Confidence Score:", confidence_score)`

This is my code to identify an object with teachable Machine in google colab

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
blazing ocean
#

not for this size

#

?paste

undone axleBOT
blazing ocean
#

also is that code ai-generated

sly topaz
chrome beacon
sly topaz
#

was about to say myself

sly topaz
harsh ruin
# sly topaz ?codeblock

i have this error :
`---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/usr/local/lib/python3.11/dist-packages/keras/src/ops/operation.py in from_config(cls, config)
233 try:
--> 234 return cls(**config)
235 except Exception as e:

19 frames
ValueError: Unrecognized keyword arguments passed to DepthwiseConv2D: {'groups': 1}

During handling of the above exception, another exception occurred:

TypeError Traceback (most recent call last)
/usr/local/lib/python3.11/dist-packages/keras/src/ops/operation.py in from_config(cls, config)
234 return cls(**config)
235 except Exception as e:
--> 236 raise TypeError(
237 f"Error when deserializing class '{cls.name}' using "
238 f"config={config}.\n\nException encountered: {e}"

TypeError: Error when deserializing class 'DepthwiseConv2D' using config={'name': 'expanded_conv_depthwise', 'trainable': True, 'dtype': 'float32', 'kernel_size': [3, 3], 'strides': [1, 1], 'padding': 'same', 'data_format': 'channels_last', 'dilation_rate': [1, 1], 'groups': 1, 'activation': 'linear', 'use_bias': False, 'bias_initializer': {'class_name': 'Zeros', 'config': {}}, 'bias_regularizer': None, 'activity_regularizer': None, 'bias_constraint': None, 'depth_multiplier': 1, 'depthwise_initializer': {'class_name': 'VarianceScaling', 'config': {'scale': 1, 'mode': 'fan_avg', 'distribution': 'uniform', 'seed': None}}, 'depthwise_regularizer': None, 'depthwise_constraint': None}.

Exception encountered: Unrecognized keyword arguments passed to DepthwiseConv2D: {'groups': 1}`

blazing ocean
#

also not related to plugin development

sly topaz
#

yeah, I was hoping they were using tensor in a plugin for some reason but clearly not the case

#

I recommend just joining some random machine learning/python discord, there's bunch of them

#

though they'll probably just tell you to not use AI and to learn the thing, ironically

blazing ocean
#

using AI to build an LLM has gotta be the most ironic shit ever

eternal oxide
#

it could be the end of us all

umbral ridge
#

national disaster

earnest girder
#

if I want to have several timed tasks run periodically on my server, is it best to make one server ticker task for all of them, or to make separate bukkit tasks?

chrome beacon
#

Use multiple tasks

earnest girder
#

whats the best way to get an array or list of all online players? bukkit#getOnlinePlayers returns a collection..

eternal night
#

new ArrayList<>(Bukkit.getOnlinePlayers())

earnest girder
#

ah thanks

eternal oxide
#

Why do you want a List specifically?

slender elbow
#

spoiler alert, you don't

worldly ingot
#

That's not true! There are valid use cases for lists!

earnest girder
blazing ocean
#

and that is not one of those

worldly ingot
#

If you're only randomly selecting one random player, you could opt to use an Iterator and stop at a random index instead

earnest girder
#

doesnt work

worldly ingot
earnest girder
#

wont compile

worldly ingot
#

Oh, Elgar's example

earnest girder
#

because selected player might not be defined

worldly ingot
#

Not Elgar. Lynx

#

I can't read

earnest girder
#

or it doesnt know that it should be

#

I think

blazing ocean
worldly ingot
#

I mean, like I mentioned, if you're only selecting one random player, you're probably fine just using an Iterator

#

In fact, there may even be a Guava method to select a random value from a collection. In Iterables or something

#

Eh, kinda. But there is a method to get a value from any iterable object at a given index

blazing ocean
#

or just ```java
public static <E> Optional<E> random(Collection<E> collection) {
return collection.stream()
.skip((int) (e.size() * Math.random()))
.findFirst();
}

earnest girder
#

you cant select from a collection so you have to use an enhanced loop

worldly ingot
#
Collection<? extends Player> players = Bukkit.getOnlinePlayers();
Player randomPlayer = Iterables.get(players, ThreadLocalRandom.current().nextInt(players.size()));
#

Mine is probably a bit nicer because it actually does have optimization for random access lists, which getOnlinePlayers() theoretically could return

#

Plus it uses an Iterator over a stream

blazing ocean
#

using threadlocalrandom there is crazy

worldly ingot
#

Why?

blazing ocean
#

is there really a need for it

worldly ingot
#

Is there a reason not to use it?

blazing ocean
#

good point

worldly ingot
#

It's a Random constant and you don't care about the origin of its values

#

If you needed a seeded random, or a specific Random implementation, or a Random instance where you cared about the generation order, then yeah you could use your own instance

#

You probably don't need that here KEKW

#

I would argue the Math#random() was crazier

earnest girder
#
        int i = 1;
        int randomInt = (int)(Math.random() * Bukkit.getOnlinePlayers().size());
        Player player;
        for(Player p: Bukkit.getOnlinePlayers()) {
            if(i == randomInt) {
                player = p;
                break;
            }
            i++;
        }

I was just saying that this doesnt work because player still might not be defined

worldly ingot
#

Oh, yeah, cause player would need to be initialized as null

worldly ingot
earnest girder
#

ah yeah

#
ArrayList<Player> allPlayers = new ArrayList<>(Bukkit.getOnlinePlayers());
#

does it matter if I use this or that?

worldly ingot
#

It's a bit unnecessary. You could do it that way, but you don't need to if all you need is one player

earnest girder
#

ok thanks

worldly ingot
#

I would do that if I were wanting to select a handful of random players and not getting duplicates

thorn isle
#

only difference really is that iterables is a google commons class iirc

#

so it's not in the java standard library

worldly ingot
#

Which Bukkit has at runtime, but yes

slender elbow
#

alternatively, always get the first player and say it's random

#

/xkcd 221

young knoll
#

Clearly the best method is to use Bukkit.selectEntities(Bukkit.getConsoleSender(), “@r”).getFirst());

thorn isle
#

doesn't matter in bukkit but that's about the only difference

blazing ocean
#

choco when are we getting an xkcd command

#

or jish

worldly ingot
#

Iterables has some optimizations for List implementations which is nice

  public static <T> T get(Iterable<T> iterable, int position) {
    checkNotNull(iterable);
    return (iterable instanceof List)
        ? ((List<T>) iterable).get(position)
        : Iterators.get(iterable.iterator(), position);
  }

Though I notice they actually only check for List, not if the list is also RandomAccess 👀 So technically, not the MOST optimized

blazing ocean
thorn isle
#

i kinda hate streams but the streams approach here is probably the superior one

worldly ingot
#

I don't think so

#

I want to say that internally, CraftBukkit does return a ConcurrentList or something, so that improvement in Iterables helps

thorn isle
#

its a copy on write list i think

slender elbow
#

yeah it's a COW

worldly ingot
#

I mean even better lol. It's still RandomAccess

young knoll
#

I love cows

worldly ingot
#

Or I guess still a List because Guava doesn't care about RandomAccess

blazing ocean
#

🐄

thorn isle
worldly ingot
#

I'll concede that at least, yes

thorn isle
#

performance wise the cast is probably the best

slender elbow
#

streams could have optimisations depending on the pipeline configuration and the source spliterator too

eternal night
#

streams
optimisations

thorn isle
#

if it's in a very hot loop the jit might nuke the streams altogether

worldly ingot
#

We're all fucking nerds. This person just asked how to get a random player and we're debating semantics between optimization techniques

#

💀 We need to go outside

thorn isle
#

the weather has been very nice recently

#

finally getting some early spring sunshine after a long winter

young knoll
#

Make a PR to change getOnlinePlayers to return a List and then use List.get(random.nextInt(list.size))

thorn isle
#

why does it return a collection, anyway

#

didn't it use to return a list like 10 years ago?

eternal night
#

iirc it is a view and promising as little as possible there makes sense

young knoll
#

It used to return an array

thorn isle
#

oh yeah that's right

worldly ingot
#

Is it a view?

blazing ocean
#

what about a Map<Integer, Player>

worldly ingot
#
    @Override
    public List<CraftPlayer> getOnlinePlayers() {
        return this.playerView;
    }
#

I'll be damned

blazing ocean
#

or even better, a BiMap<Player, Integer> and you just reverse it

worldly ingot
#

So, for the record, it returns an unmodifiable list

#

PES_AngeryFuckoff get fucked, COW people

young knoll
#

Java has bisexual maps?

blazing ocean
#

java has turned woke now

thorn isle
#

an unmodifiable view of a cow list, yes? 🐮

worldly ingot
#

Probably. I can't be bothered to look at what type DedicatedPlayerList.players is lol

blazing ocean
#

not gson

#

google commons

thorn isle
#

even worse

blazing ocean
#

guava, whatever

worldly ingot
#

public final List players = new java.util.concurrent.CopyOnWriteArrayList(); // CraftBukkit - ArrayList -> CopyOnWriteArrayList: Iterator safety

#

smile

#

It probably hasn't changed

blazing ocean
#

where hygot.jar

blazing ocean
#

can I have a copy of C:\Users\chocolate\Desktop\hypixel source code NDA DO NOT PUBLISH OR YOU WILL DIE.zip

worldly ingot
#

I don't wanna die :(

blazing ocean
#

oh yeah just ignore the file name

worldly ingot
#

Also, spaces in the file name?

#

jail

young knoll
#

He’ll only die if they find out it was him

blazing ocean
#

jail for different reasons

timber eagle
#

How do I stop golden apple potion effects from happening without removing the player's potion effects

#

and I can't cancel the event

echo basalt
blazing ocean
#

oh mb then

coarse linden
sullen marlin
#

Why can't you cancel the event?

timber eagle
sullen marlin
#

The potion effect event??

timber eagle
sullen marlin
timber eagle
#

Yeah so the thing is I can't really use that lol

buoyant viper
#

is this what the cool kids would call... an XY Problem?

timber eagle
#

Nope

#

Trust me it's not

#

I haven't abstracted anything

coarse linden
#

😭

timber eagle
#

Hypixel is able to do the exact same thing I am trying to do. Take a look at how they implemented golden apples in some of their gamemodes. In the Hypixel Pit they removed the absorption potion effect while also keeping all animations and sounds working fine.

sullen marlin
#

Why can't you use one of the several options

#

What's wrong with the above event?

#

Or removing the effect?

mellow edge
#

I hope that is possible though

#

maybe PlayerItemConsumeEvent

timber eagle
#

I may be on 1.8.8

#

...

#

Listen I have to use it

#

I'm sorry

mellow edge
#

isn't PlayerItemConsumeEvent on 1.8?

timber eagle
#

Yes

#

If I cancel it the animation wont play fully, same with the sound

#

and cancelling it means you can't change the itemstack using e.setItem, you would have to change it using the player's inventory

#

but still, I want it to be authentic

mellow edge
#

if you are really that into it intercept the packet outgoing from the server and discard it, then do your own logic from there

timber eagle
#

oh my god

#

you may just be right

buoyant viper
#

1.8 moment

short pilot
#

yo is there some sort of goal priority for entities

where they can target players for combat first but when out of combat will return back to a set starting point

#

like path back

mellow edge
#

do you mean PathfinderGoals?

finite path
#

Eggscuse me, wtf is going on, When I include com.sk89q.worldedit or worlguard then com.google.common.base goes to buy milk, but if I dont include worldedit nor worldguard, then it comes back...

buoyant viper
#

LMFAOOO

#

never word something like that EVER again bro

eternal oxide
#

move WG/WE to a lower priority in yrou dependencies

#

I found his sentence funny

finite path
timber eagle
finite path
#

This means it went to buy milk...

buoyant viper
#

task triviality is subjective.

eternal oxide
#

if WE/WG packages the common package it will override your dependency if it is higher in the list

#

its about dependency versions

finite path
#

<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>7.2.7</version>
</dependency>
<dependency>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-bukkit</artifactId>
<version>7.0.6</version>
</dependency>

#

I have it like this

#

At the last place in <dependencies>

eternal oxide
#

looks fine, reload maven

finite path
#

Its the same..

timber eagle
#

modern string utils

short pilot
timber eagle
#

modern

finite path
timber eagle
finite path
#

or if you would like to call it as OLD

short pilot
#

and how can I make target goals take priority over pathfinder goal

timber eagle
#

I used citizens

#

if you need more customization just use citizens npcs, they cover everything including mobs

#

but if you need vanilla stuff, I really can't help you too much because I've never used the pathfinding

gloomy drum
#

is spigot open source?

timber eagle
#

I dont want to just start saying things because I have no clue what your project looks like

eternal oxide
undone axleBOT
buoyant viper
buoyant viper
timber eagle
#

#1 hater

#

only talks to hate

gloomy drum
#

I forgot how messy this stuff is with the bukkit stuff that happened damn

buoyant viper
#

i dont talk to hate

#

i hate to talk

short pilot
timber eagle
#

i know

earnest girder
#

what things might break if you move a plugin from a spigot server to a paper server?

timber eagle
#

depends

eternal oxide
#

undefined

timber eagle
#

most likely nothing

#

paper to spigot yes

buoyant viper
#

hopefully nothing, but who knows for the future

timber eagle
#

will break

#

paper is a fork of spigot

mellow edge
eternal oxide
#

paper hard forked recently so there is no longer any guaranteed compat

mellow edge
short pilot
#

is there any way to configure exact points a and b to move to?

#

like returning to a set point after all other goals aren't valid

buoyant viper
mellow edge
#

there is a navigator that you can set to a specific position

short pilot
#

ok

#

just checking but do goals go in order of increasing priority

#

based on when you register them

mellow edge
#

the number before the goal is the priority

short pilot
#

I see

young knoll
kind hatch
#

Did TextComponents/BaseComponents get an update in 1.21.5?
Cause all hover and click events aren't working.

thorn isle
# finite path

worldguard includes a million outdated libraries (and ancient versions of the bukkit api) as transitive dependencies, you will want to manually exclude them or you'll get conflicts like these, or not finding 1.13+ bukkit classes

young knoll
#

Did you rebuild recently

#

MD just updated the bungee chat api in spigot

kind hatch
#

Wait, really?

#

What changed?

thorn isle
#

in any plugin that builds against worldguard, three quarters of my maven build file is excludes for garbage from worldguard/worldedit

young knoll
#

Circa 1:30 ago

kind hatch
#

Frick

sullen marlin
#

What broke?

#

There weren't any intended breakages, so I'd open a bug report

mellow edge
manic delta
#

guys entities with "entity.isPersistent = false" will despawn on server restart?

kind hatch
sullen marlin
#

?notworking

undone axleBOT
#

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

kind hatch
#

i.e. they are not registering.
All text styling is still present, but any event that is added to the component such as click or hover isn't being set.

sullen marlin
#

Are you up to date?

kind hatch
#

Yes, built it like 5 minutes ago.

sullen marlin
#

Did they work on a previous 1.21.5 version?

kind hatch
#

I am unsure, cause I am just now getting around to testing 1.21.5

sullen marlin
#

Open a bug report with reproduction code please

kind hatch
#

I have tested with 1.21.4 and the events still work as intended.

sullen marlin
#

?jira

undone axleBOT
kind hatch
#

kk

young knoll
#

Yes

#

They will not be saved, so if the chunk ever unloads they go bye bye

manic delta
#

okay, thank you

young knoll
#

Not to be confused with the vanilla use of the term “persistent” which is equal to removeWhenFarAway in the api

#

(I blame MD)

manic delta
#

yea

manic delta
sweet dirge
#

help
im not receiving the verification email from spigotmc
ive tried doing it many times it doent work

manic delta
#

thank you

sonic goblet
kind hatch
short pilot
eager hawk
#

May be a dumb question, but why do big servers hide their plugins if they are custom made anyway?

remote swallow
#

No reason, sometimes it's so you don't realise they might have a known exploit with a plugin

eager hawk
#

Ohh yea

short pilot
timber eagle
#

Is the protocol lib wiki down

#

i can't seem to access it

mellow edge
#

Also note that the previous one was woth spigot mappings and this one with mojang's mappings

chrome beacon
undone axleBOT
timber eagle
#

ty

#

Hey does anyone know how I can disable a potion effect packet? When using protocol lib, it only disables the visual in the player inventory and not the actual affect it has on the player, for example absorption still produces absorption hearts.

@Override
    public void onPluginEnable() {
        PitRemake.getProtocolManager().addPacketListener(new PacketAdapter(PitRemake.getPlugin(), ListenerPriority.NORMAL, PacketType.Play.Server.ENTITY_EFFECT) {
            @Override
            public void onPacketSending(PacketEvent e) {
                Player player = e.getPlayer();
                PacketContainer packet = e.getPacket();

                if (ItemUtils.getInstance().isPitItem(player.getItemInHand(), PitGoldenApple.this)
                        && packet.getBytes().read(0) == PotionEffectType.ABSORPTION.getId()) {
                    e.setCancelled(true);
                }
            }
        });
    }
#

Is there something I'm missing?

young knoll
#

The effect is server side

#

Well, for most things

#

You can cancel it with the EntityPotionEffectEvent

timber eagle
#

That's not available to me

#

Should I instead look at the source for that event to try and make my own for what I'm working with?

young knoll
#

I guess so

#

Also 1.8 moment

mellow edge
#

The event wont help you much, you need to look at the code implementations of it.

timber eagle
#

yeah that's what I meant

timber eagle
#

Well I'm making a remake of something that is specifically in 1.8

mellow edge
#

Again what exactly isn't working

young knoll
#

Me when I remake a hypixel game instead of just playing on hypixel

timber eagle
#

I need the absorption potion effect to be cancelled

timber eagle
timber eagle
mellow edge
timber eagle
#

If I cancel the packet the visuals are the only thing that is being cancelled

#

in the inventory

#

The absorption hearts are still present on the server and client. basically it acts as if its still there because it technically is

#

and if i cancel the PlayerItemConsumeEvent it wont fully play the golden apple animation and sound

mellow edge
#

Yeah that seems logical. Just sending a packet means the server will still recognize it and some time later also the client (after some syncing probably)

#

Maybe you'll have to abstract this even further

young knoll
#

You can just remove the effect a tick later

timber eagle
#

I mean i could but that would mean I wouldn't be able to use the absorption effect at all

young knoll
#

Why?

timber eagle
#

and even if I saved the effects before

#

its such a bad implementation

young knoll
#

Just remove it one tick after they consume the apple

#

Could also check if the duration matches that of the apple

timber eagle
timber eagle
#

really scuffed

timber eagle
young knoll
#

Well then you get to patch the server to implement the event

timber eagle
#

im trying to find a better solution

young knoll
#

Have fun

timber eagle
#

thanks?

mellow edge
#

No no no do not patch the server if you are gonna release this

timber eagle
#

really passive agressive

#

if you dont want to help you dont have to

young knoll
#

I mean that’s basically your only option

mellow edge
#

it is a possible solution tho. The easiest one.

timber eagle
#

I'd like to find the EntityPotionEffectEvent first

#

source

#

before patching

mellow edge
#

Do not patch

#

Also note that hypixel is working with heavily modified spigot API that has direct controls to the slurce coe that is why they can do what they do

timber eagle
#

yeah

mellow edge
#

You do not want to cancel the absorption why?

timber eagle
#

?

#

No i want the absorption gone from the golden apple

#

without cancelling the PlayerItemConsumeEvent

mellow edge
#

You already sent the packet as I said eralier right? But only the visuals (I assume you mean hearts) are gone

timber eagle
#

No the hearts are still there

#

even when I cancel the packet using protocol lib

mellow edge
#

Why are you cancelling the event? Just remove the potion effect with spigot API on the packet fly and discard the packet.

timber eagle
#

I can't get rid of the potion effect like that because that means every other absorption that I gained gets removed too

#

it affects other things

#

I dont want it to even get sent to the server if it was from a golden apple

#

but that's not possible.

#

Okay so I guess this whole problem can't really be solved with just packets

mellow edge
#

Yes it is. Check for receiving packet: eating state food and discard the packet while confirming the eating. Look at the actual protocol for concrete impl.

timber eagle
#

The only way I can edit the potion effects packet is with PacketType.Play.Server.ENTITY_EFFECT

#

which when cancelled doesn't do what it should

young knoll
#

I guess you could just cancel the eating and then manually restore hunger

#

And saturation

timber eagle
#

Okay well i'm either going to just competely remove the ability to gain the absorption potion effect and just use absorption methods from the nms entity player or im going to patch spigot

#

What are the cons about patching spigot?

mellow edge
#

Patching spigot for that small of a change is really, REALLY useless

#

On 1.8

sullen marlin
#

Given you're using 1.8, knock yourself out lol

timber eagle
#

lol

young knoll
#

Not like you have to upkeep it

#

Unless we get another log4jshell

#

But yeah now that I think about it you can just cancel the eating and apply everything yourself

#

Except the absorption

timber eagle
mellow edge
#

The cons:

  • your plugin will not work on standard spigot, since you will be patching the spigot server itself, which I doubt is recommended for that version
timber eagle
#

I'm probably going to try and patch it, if it fails i just wont use absorption potion effects

young knoll
#

It cancels thing that you can easily remake yourself

#

Hunger, saturation, removing the item from the inventory

timber eagle
#

The animation, sound..?

mellow edge
#

Didnt he mention that canceling eating cancels the animation of eating?

timber eagle
#

doesn't finish the eating sound

#

and i'm not trying to hassle my way to fixing that

young knoll
#

Well you can play the sound

thorn isle
#

does the entity effect event or whatever it was that was suggested earlier not exist on 1.8

young knoll
#

I thought the event occurs when the animation is done anyway

timber eagle
#

no

timber eagle
#

thats my issue

#

if it wasn't so wacky

worldly ingot
timber eagle
#

this would be fine

young knoll
#

Ah choco is here

#

I bet Hygot has a similar event he can give you

#

Kek

mellow edge
#

With packets you can do something about it

timber eagle
#

well idk man

worldly ingot
#

I added the entity potion effect event myself lol

buoyant viper
#

fuck it, patch spigot

timber eagle
#

i've researched a good 2 hours

thorn isle
#

give them a regular apple named golden apple and give them the desired effects manually on consume

worldly ingot
#

I was annoyed it didn't exist so I pulled it in

timber eagle
#

please inform me

young knoll
#

I cba to look for the old impl of the event

mellow edge
#

You see he made it now you can ask him how you can do your own replica on 1.8

young knoll
#

The new one is quite different since yknow, item components

worldly ingot
#

New implementation doesn't differ much from 1.7

young knoll
#

You could probably look at the source for whatever version it was added tho

worldly ingot
#

Just the fact it uses integers in most places instead of objects

thorn isle
#

i like how everything can be edible now with components

buoyant viper
thorn isle
#

has anyone made an edible cobblestone plugin yet

young knoll
#

Idk

buoyant viper
#

would make it much more future proofed lol

young knoll
#

Latest has it in net.minecraft.world.component.consumable

worldly ingot
#

Like I said, implementation doesn't differ much from current implementation. That's all we do now is overload the add/remove methods and add causes

timber eagle
young knoll
#

Actually latest has it in a lot of places

worldly ingot
#

Yes, it would have it anywhere addEffect() is called lol

#

ARE MY MESSAGES COMING THROUGH!?

buoyant viper
#

Cause.MILK

young knoll
#

I THOUGHT YOU SAID TO PUT IT IN ADD EFFECT ITSELF

worldly ingot
#

YEAH

#

The event call is in addEffect()'s implementation

#

A method overload is added that takes in an optional cause

young knoll
#

Oh it’s just the cause that’s determined beforehand

worldly ingot
timber eagle
#

is it this

#
while (iterator.hasNext()) {
+                MobEffect effect = iterator.next();
+                EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED);
+                if (event.isCancelled()) {
+                    continue;
+                }
+
+                iterator.remove();
+                toRemove.add(effect);
+            }
buoyant viper
#

this is Minecraft

timber eagle
#

do i just need to follow it

worldly ingot
#

I mean that's one of them. There are like 3 or 4 call sites for that event

timber eagle
#

damn

worldly ingot
#

They're all in EntityLiving though afaik

timber eagle
#

Yeah okay

#

I get how it works

#

this probably wont help lol

#

I need to get to the root cause

#

which is the golden apple

#

or the potion effect

young knoll
#

It’s probably something like ItemGoldenApple

timber eagle
#

yeah, well im going to patch this so I can actually have a 1:1 replica

young knoll
#

Seems fine

quaint mantle
buoyant viper
eager hawk
#

The start/end message only gets sent when I stand on the pressure plates for a few seconds, not immediately when I walk over it. How come?

#
if (playerLocation.equals(startBlockLocation)) {
    player.sendMessage(ChatColor.GREEN + "Successfully started parkouring.");
} else if (playerLocation.equals(endBlockLocation)) {
    player.sendMessage(ChatColor.GREEN + "Successfully ended parkouring.");
}
pliant topaz
#

please show the entire code, when does it get called?

eager hawk
#
@EventHandler
    public void walkOverStartEnd(PlayerInteractEvent event) {
        if (event.getAction().equals(Action.PHYSICAL)) {
            Player player = event.getPlayer();
            Location playerLocation = player.getLocation(); // Player's location (contains floating points)

            Set<String> parkours = parkour.getConfig().getConfigurationSection("parkours").getKeys(false);
            for (String parkourName : parkours) {
                Location startPlate = parkour.getConfig().getLocation("parkours." + parkourName + ".start");
                Location endPlate = parkour.getConfig().getLocation("parkours." + parkourName + ".end");

                // Convert to block coordinates (to match integer-based locations)
                Location startBlockLocation = new Location(
                    startPlate.getWorld(),
                    Math.floor(startPlate.getX()),
                    Math.floor(startPlate.getY()),
                    Math.floor(startPlate.getZ())
                );

                Location endBlockLocation = new Location(
                    endPlate.getWorld(),
                    Math.floor(endPlate.getX()),
                    Math.floor(endPlate.getY()),
                    Math.floor(endPlate.getZ())
                );

                Location playerBlockLocation = new Location(
                    playerLocation.getWorld(),
                    Math.floor(playerLocation.getX()),
                    Math.floor(playerLocation.getY()),
                    Math.floor(playerLocation.getZ())
                );

                if (playerBlockLocation.equals(startBlockLocation)) {
                    player.sendMessage(ChatColor.GREEN + "Successfully started parkouring.");
                } else if (playerBlockLocation.equals(endBlockLocation)) {
                    player.sendMessage(ChatColor.GREEN + "Successfully ended parkouring.");
                }
            }
        }
    }
#

I know the Math floor part is kinda goofy, bcs I need to fix that in the config (but that doesn't matter, the locations are right)

#

I'm just curious why it doesn't immediately activate the msg

pliant topaz
#

would recommend toBlockLocation

#

no need for flooring

eager hawk
#

I do need to bcs in my config a coord looks like this

#

-48.32442794911786

#

and in getBlock().getLocation() its just -48.0

eager hawk
pliant topaz
#

i would change the config, because these coords are really nothing you want to work with, especially in a config

pliant topaz
eager hawk
# pliant topaz on Location

Huh sorry, I'm not really following. You just mean naming convention or you mean an acutal method that will activate the msg instantly?

thorn isle
#

is that a paper only method

eager hawk
#

It's spigot

pliant topaz
#

ah heck

#

vcs2 is right

#

looked at the wrong docs again inflatable

thorn isle
#

finally

eager hawk
#

hahah no worries

thorn isle
#

every fucking time i say something is or is not a paper exclusive method, reality warps, and someone tells me its exactly the other way around

eager hawk
#

Do you have an idea how to instantly activate the message when I walk over a pressure plate in spigot terms?

#

Not only after standing on it for like 0.5s

thorn isle
#

i'm pretty sure pressure plates should get depressed instantly when walked over, not sure where that delay would be coming from

eager hawk
#

Hmm weird

#

Whenever I walk over it I don't get anything, not even after some time, I really need to stop moving to get the message

#

If i hold my W and go over the plate I'm not receiving any msg

#

I only get it when I stand still for a second on the plate

thorn isle
#

i'd start by getting rid of that flooring nonsense

eager hawk
#

Yeah ur right

thorn isle
#

compare blocks or int vectors or something

eager hawk
#

Am I supposed to floor it when I put it in my config?

#

So I don't get these weird numbers like -48.32442794911786 but just -48.0

thorn isle
#

for sure

eager hawk
#

Alrighty

thorn isle
#

on startup i would read the config once, and build a Set<Block> from the locations

#

and then do parkourPlates.contains(event.getClickedBlock()) instead of looping over the config

eager hawk
#

Alright!

#

Is walking over a pressure plate seen as clicking a block?

#

the click in the clip was just by accident haha

thorn isle
#

for the PHYSICAL action iirc the "physically interacted with" block is returned by getClickedBlock yeah

#

could be wrong, test it

eager hawk
#

Oh okay

#

Will do, thx!

rotund ravine
thorn isle
#

yeah they're not something you want to use willy nilly, and sadly it's not really documented which ones are safe to use or how they behave, so you kind of just have to know or have the sources at hand when working with them

#

a lesser known case of this, quite similar to Block, is Chunk

#

World::getChunk with the boolean generate overload, when passed false for, doesn't actually even try loading the chunk - it just constructs a world,x,z tuple from the thin air, and so can be safely used in collections as well

remote swallow
thorn isle
#

Iirc it's a weakreference

chrome beacon
#

It's not

#

Location on the other hand appears to be using a weakref

thorn isle
#

Odd

#

It is for chunk

#

Not sure if block not using one is an oversight or intentional

chrome beacon
#

I don't think you're supposed to keep that stored

#

Location for example does make sense to be stored though

thorn isle
#

i don't think chunk is really supposed to be stored either

#

i could maybe see it being more costly on block than it is for chunk or location, since all world access goes through block, and it gets allocated frequently

chrome beacon
#

hm yeah you're right

#

If it's weakref on chunk then I feel like it should be on block as well

#

I guess you could create an issue and ask

#

or just make a PR 🤷‍♂️

thorn isle
#

i don't particularly mind it since i pretty reliably clean anything involving blocks on world unload

flat lark
sly topaz
#

sometimes you have to set the current thread classloader to the one where hibernate is loaded in order or the sql driver to be loaded properly

flat lark
#
private static final String HIBERNATE_CONFIG_FILE_NAME = "hibernate.cfg.xml";

        this.saveResource(HIBERNATE_CONFIG_FILE_NAME, false);
        this.sessionFactory = new Configuration()
                .configure(new File(this.getDataFolder().getAbsolutePath() + "/" + HIBERNATE_CONFIG_FILE_NAME))
                .addAnnotatedClass(Challenge.class)
                .addAnnotatedClass(PlayerData.class)
                .addAnnotatedClass(PlayerTask.class)
                .addAnnotatedClass(Preset.class)
                .addAnnotatedClass(Task.class)
                .buildSessionFactory();
flat lark
sly topaz
#

try upgrading hibernate (the sqlite driver too, while you're at it) and see if that helps

#

do note that hibernate 7 is still in beta so you may use 6.x releases

flat lark
versed plover
#

hello im making a plugin and im trying to use: customItemItemMeta1.getCustomModelDataComponent().setColors(List.of(Color.WHITE,Color.LIME,Color.BLACK)); does nothing

smoky anchor
#

But iirc getCustomModelDataComponent returns a snapshot, you have to set it back.
Same as you would do with ItemMeta

#

(I believe the docs say that, so read those too)

versed plover
#

ItemStack customItem1 = new ItemStack(Material.IRON_INGOT);
ItemMeta customItemItemMeta1 = customItem1.getItemMeta();

                    customItemItemMeta1.setDisplayName(itemName);

                    List<String> ItemLore1 = new ArrayList<>();
                    ItemLore1.add("sword");
                    ItemLore1.add(madeFrom);
                    customItemItemMeta1.setLore(ItemLore1);

// AttributeModifier Item1Damage= new AttributeModifier(new NamespacedKey(AInfinitycrafterPlugin.DostatPlugin(),"test"), 3, AttributeModifier.Operation.ADD_NUMBER, EquipmentSlot.HAND.getGroup());
// customItemItemMeta1.addAttributeModifier(Attribute.ATTACK_DAMAGE,Item1Damage);

                    customItemItemMeta1.setItemModel(new NamespacedKey("glam","glam_base"));

// customItemItemMeta1.setItemModel();
customItemItemMeta1.getCustomModelDataComponent().setColors(List.of(Color.WHITE,Color.LIME,Color.BLACK));

// customItemItemMeta1.setCustomModelDataComponent()
customItemItemMeta1.getCustomModelDataComponent().setFlags(List.of(true,false,false));

                    System.out.println(customItemItemMeta1.getCustomModelDataComponent().getColors().toString());
                    System.out.println(customItemItemMeta1.getCustomModelDataComponent().getFlags().toString());

                    customItem1.setItemMeta(customItemItemMeta1);
                    player.getInventory().addItem(customItem1);
smoky anchor
#

oh fuck no

#

?paste

undone axleBOT
smoky anchor
#

This is not readable

thorn isle
#

but yes it looks like you're not setting it back

smoky anchor
#

'DostatPlugin'
Not only is it in Czech but also it breaks java naming conventions

versed plover
#

sry im just making a plugin for a friend not profesional

thorn isle
#

still the same answer: you're throwing the component away after editing it

#

you need to set it back onto the meta after editing it

smoky anchor
#

you need to call ItemMeta#setCustomModelDataComponent
Do the same you do with ItemMeta

thorn isle
#

i'm getting fucking radicalized by the frog brain

#

i have no idea what mojang did with it but it's looking like frogs are about on par with villagers now, in terms of being incredibly expensive

versed plover
#

NICE works

#

thanks so much stuck on this for a weak now 😄

sly topaz
smoky anchor
smoky anchor
sly topaz
#

oh I thought it was a class mb

thorn isle
#

and that's exactly why we have the convention

smoky anchor
#

in translation "GetPlugin"

versed plover
#

yea i was just happy it works im starting java and programing so sorry that i dont know this stuff or make mistakes

sly topaz
flat lark
#

Yes

sly topaz
#

Both the api and impl?

flat lark
sly topaz
#

Hm, is it the exact same error?

#

Also, did you keep the old hibernate version or is it 6.x

flat lark
#

I did update to the lastest 6.x version

sly topaz
#

Are you shadowing the Jakarta dependencies?

flat lark
#

java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration I get this error if I use the orginal-TestPlugin.jar

flat lark
sly topaz
flat lark
flat lark
sly topaz
#

oh wait

#

you're using java 8

#

this lib is for java 11+

flat lark
#

by changing it to 17 right in <java.version>

sly topaz
#

well, you got to have jdk 17 in your path too otherwise it won't work but yes

flat lark
#

Was using 17 the entire time

#

same issues

sly topaz
flat lark
#

Could it be issues parsing the config?

sly topaz
#

try removing the jaxb runtime, leave just the API

sly topaz
#

I'll try setting up hibernate myself in a test plugin just to check

flat lark
#

thats what my decompiled jar looks like

quaint mantle
#

Where can i find what all gems do?

sly topaz
#

gems?

quaint mantle
#

ye

sly topaz
#

what are gems

quaint mantle
#

like the brougt me here from sort of discord link from the bliss plugin fore minecraft

sly topaz
#

that sounds like an issue for #help-server though if it is a specific plugin, you might not get a lot of answers. You're better off asking in the discussions tab of the resource in question

quaint mantle
#

Thank you very mutch !

sage hare
#

?img

undone axleBOT
#

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

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

flat lark
#

Idk if it's also because I didn't competly fill out my classes with columns and stuff

smoky oak
#

is it possible to have a temporary chat message?

#

i want to use it to make a status bar

smoky anchor
#

the best you can do is clear the chat after some timeout
But you can use just the action bar with some font magic probably

smoky oak
#

yea i dont want to use resource packs

#

guess ill just use the action bar

thorn isle
#

was there a maximum width for the actionbar text? you could offset it with regular old spaces rather than negative width symbols if the width is unlimited

manic delta
#

how can i get the targetSlot? i mean where the item goes to from a InventoryClickEvent

if(it.action == InventoryAction.MOVE_TO_OTHER_INVENTORY){
                val item = it.currentItem!!
                val player = it.whoClicked
                val targetSlot = it.
            }
thorn isle
#

you don't

manic delta
#

i cant?

thorn isle
#

not from the event

#

you have to look at the item being moved and then the slots in the target inventory and manually determine which slot(s) the item will go into

manic delta
#

from which then

#

wtf

#

how

thorn isle
#

find stackable items in the target inventory that stack with the item being moved

manic delta
#

uhm

thorn isle
#

then take the first one

#

and see if it overflows

#

and then take the next one

#

and repeat until the moved item stack fits in the slots

manic delta
#

damn that sucks

thorn isle
#

yes

manic delta
#

a client want that feature

thorn isle
#

its ass

manic delta
#

just want to say

#

fuck u

#

i dont want to do that

manic delta
#

the event

#

and do that logic

thorn isle
#

i mean depends on what youre doing

#

there's no point to cancelling the event and then doing the logic yourself anyway if the effect is the same

#

doesn't really matter whether its the server shoving the items in the target inventory or if you shove them in it in exactly the same way

#

i assume you're like trying to prevent items from being shift-clicked into a gui or something

manic delta
#

but see

#

let me record

#

a video

#

if i shiftclick the event that i have to convert items doesnt work

thorn isle
#

i have absolutely no idea what im looking at or what you are trying to communicate

#

you are placing a magnifying glass named search into a toilet?

manic delta
thorn isle
#

mmm well

#

in this case, i would listen to the "move to other inventory" click event, wait 1 tick, and then trigger an update for the inventory

#

and in that update call do the conversion logic

#

no need to cancel and simulate the event, just let the server place the things where the client expects them to go and then process them afterward

#

though you will have to fill the bottom row with some invisible item or gui element so it can't be shift-clicked into

wet breach
# manic delta i want to allow that

items go into the first available slot that it fits to include stacking. So if you fill all slots and left a slot open then the item will always go into that one open slot as long as it can't be split and stacked (other items have to be the same including metadata which is how you can control splitting in a sneaky way)

#

Anyways, if you need to know where all items went even if it were split up, you just hold a copy of the inventory

#

compare to later

#

and then its just getting the differences

thorn isle
#

iirc partial stacks are prioritized over empty slots

#

so it's not necessarily the first available slot, you'll want to loop over partial isSimilar stacks first

red bolt
#

PlayerInputEvent

#

☝️ ☝️ ☝️ ☝️ ☝️ ☝️ ☝️ ☝️ ☝️ ☝️ ☝️ ☝️ ☝️ ☝️ ☝️ ☝️ ☝️ ☝️ ☝️
So I'm using playerInputEvent but I cant get key release... I asked GPT and it said I could do it with packets... Would this work?

thorn isle
#

that doesn't look right to met at a glance

orchid furnace
#

Why would you ask chat gpt

thorn isle
#

those look like the input packet fields

red bolt
#

cuz I was lazy

thorn isle
#

but its using the vehicle steer packet

red bolt
#

🤷‍♀️ ik

thorn isle
#

use the input packet

red bolt
#

hence why im asking

thorn isle
#

have you tried it

red bolt
thorn isle
#

see the protocol documentation

red bolt
thorn isle
#

is your question how to use dependencies?

red bolt
#

now it is 😂

orchid furnace
#

😭

red bolt
#

but I could just look up some tut for that

red bolt
#

thx

#

if I use custom packets should I still use playerinputevent for detecting the first keypress?

#

technically I should cuz it's a trigger for the script (an event) right?

thorn isle
#

what's a custom packet

#

are you writing a mod?

red bolt
#

sry wasn't thinking I mean just a packet 🤦 had a long day

thorn isle
#

you could use the event, but if you're already listening to the packet, you might as well keep your handling all in one place

#

i.e. the packet listener

red bolt
#

hmm yeah that'd be smart

#

thx

#

but if I do that doesn't it listen for every packet? putting more load on the srv?

red bolt
thorn isle
#

did you add the repository to <repositories>

red bolt
#

yes

thorn isle
#

did you reimport the project

remote swallow
#

reload maven

red bolt
thorn isle
#

open the maven side pane on the right

#

and click the circular arrow buttons to reimport the project

red bolt
red bolt
thorn isle
#

there are also like 5 other buttons that do this scattered in random places of the ui, but the side pane is the most reliable

#

that'd be the circular arrows yes

red bolt
thorn isle
#

bukkit api/spigot api is a dependency

#

no different from protocollib in principle

red bolt
#

ik

#

I mean like ones that I add

thorn isle
#

i guess everyone uses the mcdev plugin these days

red bolt
#

ye lol

#

thx for the help

manic delta
#

lol

mental trail
#

Allo, I was working on a skyblock plugin, and was curious what the performance tradeoffs, if significant, are for having multiple islands per world or one island per world?

thorn isle
#

worlds use an amount of memory

#

it isn't significant in reasonable numbers but it will absolutely fuck you over if you have them in the high dozens or even hundreds

#

and there aren't many advantages that i can think of in making it island-per-world

mental trail
#

ok ty I was just curious if it was even significant for slime worlds

wet breach
red bolt
# thorn isle it isn't significant in reasonable numbers but it will absolutely fuck you over ...

actually on that subject I wanted to make a similar plugin for my srv idea, and it requires seperate islands for players as well as undisruptive world creation. my main idea was to have empty worlds and load it and paste a schem into it (schem being player's island) and then give that player that world, when they log out the world saves the schem and removes all data from it before unloading. In the case of a lack of vacant worlds we would need to create temporary worlds (preferably async).

mental trail
#

I like the idea of unloading, I feel like that would remove the performance issue

red bolt
#

yeah

#

and instead of storing the block data in the worlds just store them in schem files

amber fjord
#

It's not in javadocs (I checked) but does anyone know if Damageable#damage() does damage values before modifiers (such as armor) or after (armor piercing damage)

red bolt
#

I think its before modifiers

amber fjord
#

damn

#

any way outside of that class to be able to inflict armor piercing damage?

red bolt
#

hmm not sure, def possible i'm sure I just dont know how

mental trail
#

I was thinking about just using the slime world format

ivory sleet
#

w/o ruining things here, has slime world manager been mentioned?

mental trail
#

?

#

I was looking at their API for slime worlds

ivory sleet
#

but I presume that's not what you're looking for exactly?

mental trail
#

I mean I'm not against using it to manage the world format for me

#

also finegamez have you done any performance testing? is it feasible to do it in that manner by unloading the world when not in use?

wet breach
red bolt
wet breach
#

Yes

red bolt
#

but will that still make it use up a lot of storage space

wet breach
#

You just space them far enough from each other if you dont want islands visible to each other. And dont load the chunks that are so many away

red bolt
#

cuz I'm pretty sure say hypixel they use a schem based thing I'm pretty sure they give you like a simulated world not too sure how they do that but its like a separate world without being an actual world I think

wet breach
wet breach
red bolt
#

yeah

#

ik that they use multiple machines and resources but still

#

its not one srv for sure that'd be insane and impractical

wet breach
#

However for smaller networks using 1 or 2 worlds is the best choice in terms of cost and resources

red bolt
#

but like what if players play generate an island and never join again

#

it uses up space for nothing

#

no?

wet breach
#

You would have a system in place that tracks where their island is at. If gone for like 2 months delete the chunk lol

red bolt
#

thats what I would do but some just take a long break, a schem system while still being stored takes alot less space no?

wet breach
#

Then use schem for storing their island for future use. Schematics take up the same amount of space the island will in a void world. Differences being schem wont save entities or lighting info

red bolt
#

oh yeah... so it would end up being harder for no real reason

wet breach
#

Schems are nice in generated worlds because you only save structures and the sorts and not the rest of the world with it...usually lol.

red bolt
#

my worry also comes with migration reasons... if I want to transfer to another host or just store the files for a period of time im obligated to store the full world which each island may not be much but overal it adds up and instead of managing some several mb files it may be 20gb worth of a world I would think...

unless I'm overestimating the amount of storage void worlds take up

red bolt
#

at the end of the day it's probably not that bad tho, I'm overthinking it

mental trail
#

I read somewhere that Hypixel does a server per world for skyblock

mental trail
#

then disables it when everyone is gone

red bolt
#

I think

mental trail
#

yeah probably containerized

red bolt
#

yeah

mental trail
#

kubernetes or something

red bolt
#

yes yes I think your right

#

tells me smth

#

but some overcomplicated custom solution for sure

mental trail
#

well for their amount of users

red bolt
#

ye lol ofc

mental trail
#

I'm sure it's worth it haha

red bolt
#

overcomplicated for the average srv I mean

mental trail
#

yeah

red bolt
mental trail
#

Well, I guess I'll have to make a custom layer over a skyblock plugin now

#

because I cba recreating all the functionality from scratch

red bolt
#

yeah

wet breach
# red bolt my worry also comes with migration reasons... if I want to transfer to another h...

Mc doesnt store every air block. It stores air block and puts a range. This way it only had to store 1 air block or just a few instead of all of them. Thus it isnt wasting space. Only blocks placed use up more storage. In a 10kx10k chunk area a generated world on average if fully generated area takes up like 10gb of space and with 100 players they will probably contribute to about another 5-10gb of space in like a years time

#

A void world with 100 players you are looking at like 5gb at most lol

red bolt
wet breach
#

But that is 5gb in a years time

red bolt
wet breach
#

A single chunk would take up no more then like 30-50mb depending on what that player is doing. They would really need to fill that entire chunk which is not easy in skyblock.

red bolt
#

also random question I dont want to interupt the subject but do you know if coreprotect works with itemsadder

wet breach
#

Have no idea, never used it

mental trail
#

ugh coreprotect

red bolt
mental trail
#

I had to go searching for their patreon just to get a working jar

red bolt
#

huh?

#

I just downloaded it off spigotmc

#

worked fine

#

then later updated from 1.20.1 to 1.21.1

#

just fine

mental trail
#

mine kept spitting errors with one of the plugins on 1.21.4

red bolt
#

huh

mental trail
#

I don't remember which one exactly