#help-development

1 messages · Page 888 of 1

young knoll
#

Yeah pretty sure that’s how it goes

#

Methods are similar but letters often get reused

#

Which is annoying

tender shard
#

yeah if there's no signature conflict, it will use a as often as possible

young knoll
#

Who tf runs .3

#

Buildtools doesn’t even build it anymore

mellow edge
#

How would I cancel player walking particles without events, is player walking a server-side packet or not?

young knoll
#

Other players particles probably send a packet

#

But your own are probably client side

hybrid spoke
#

could also be that its hardcoded in the client, that player characters have walking particles by default

mellow edge
#

If they are server-side would I have to intercept a packet before sent and not send it?

hybrid spoke
#

that would block it, if you want to achieve that

mellow edge
#

Yeah there are no events afaik

hybrid spoke
#

but looks like its clientside

mellow edge
#

I mean even if they are clientside for the player itself, I just need others to not see it

hybrid spoke
#

which you cant do if its clientside

#

you could try some hacky way like intercepting the player position packet and set on ground to false

#

maybe that removes the particles

tender shard
mellow edge
#

Do you mean it is clientside for all players not just the player itseld?

hybrid spoke
#

yeah

mellow edge
#

Then I will just leave it

tender shard
#

sth like this for example:

    private Map<Class<?>, Field> fieldsByReturnType = new HashMap<>();
    
    public Field getFieldByReturnType(Class<?> clazz, Class<?> returnType) {
        return fieldsByReturnType.computeIfAbsent(clazz, c -> {
            for (Field field : c.getDeclaredFields()) {
                if (field.getType() == returnType) {
                    field.setAccessible(true);
                    return field;
                }
            }
            return null;
        });
    }
#

then you can just do getFieldByReturnType(ServerGamePacketListenerImpl.class, Connection.class)

#

and it also caches it automatically

#

yeah that's what you need now, what about tomorrow? 😛 I'd just throw that code above into a ReflectionUtils class and then use it. even if you only use it once, it'll declutter your actual class

mint nova
#
    @EventHandler
    public void onBlockBreakDrop(BlockDropItemEvent e){

        if(e.getBlock().getType() == Material.COAL_ORE) {
            e.getBlock().getDrops().clear();
        }

        if(e.getBlock().getType() == Material.IRON_ORE){
            e.getBlock().getDrops().clear();
        }

Can anyone can help me?

So i trying to check the material in the one if with array or || but dont work

chrome beacon
#

Show what you tried

lost matrix
#

Im still trying to understand the last sentence..

mint nova
mint nova
chrome beacon
lost matrix
#

Ah ok. Then lets see what he tried so far.

mint nova
#

this array is ngl bad i think but yea i forgot how to do it

hybrid spoke
#

you would have to loop over the list and check each

#

and for the OR you have to write an actual condition

#

not just the material

chrome beacon
lost matrix
#

List is a collection which means you can just call contains(Object) on it

hybrid spoke
#

could even use a EnumSet

chrome beacon
#

Don't do that

#

Material is not guaranteed to stay an enum in the future

hybrid spoke
#

mimimi material will be gone mimimi

lost matrix
#

A normal HashSet is preferred now over an EnumSet because material wont be an Enum for very long

#

Ah

hybrid spoke
#

in the current state of spigot an EnumSet would be the best option

#

but yeah use a hashset then

lost matrix
# mint nova

So your solution is:
Create a List<Material> or Set<Material> as a field (not as a variable in your method)
and then call contains(Object) on this List or Set. I think in your case it doesnt really matter if you use a List or Set.

worldly ingot
#

Yeah you probably won't get a noticeable performance benefit either which way, but a HashSet is technically the correct implementation to use here given you're using it exclusively for #contains() operations

#

Lucky for you, there are factory methods in Java 17 😎

private static final Set<Material> ORES = Set.of(Material.COAL_ORE, Material.IRON_ORE);
young knoll
#

Im pretty sure material is going to stay an enum

#

Just be deprecated

worldly ingot
#

Correct, but you still won't reap all that much benefit from an EnumSet because the Material's universe is so large

minor junco
worldly ingot
mint nova
#

whyyyy

worldly ingot
#

Outside the method

mint nova
#

oh

#

mb

mint nova
#

idk how to say it

minor junco
#

if you want to check if a material is contained in your collection, use contains

#

advantage from using a set is your lookup being O(1), meaning it doesn't grow in complexity with the amount of elements there are added to it

chrome beacon
minor junco
#

and, depending on what you want to achieve with this, you can for example test against a block broken, or clicked, or whatever by using Block#getType() which returns the material

mint nova
#

ohh

minor junco
#

so basically, if you inline your method:

if (ores.contains(event.getBlock().getType()))
  // ... do something with ore
tender shard
#

anyone know how I can fix this?

river oracle
#

Or switch it to all 😎

tender shard
#

the issue is that getMainHandItem is annotated with NotNull but I've seen cases where that's just not true

slender elbow
#

i'd like to see that being the case because it is never null

#
@Override
public ItemStack getItemInMainHand() {
    return CraftItemStack.asCraftMirror(this.getInventory().getSelected());
}

public static CraftItemStack asCraftMirror(net.minecraft.world.item.ItemStack original) {
    return new CraftItemStack((original == null || original.isEmpty()) ? null : original);
}
tender shard
#

not in spigot, but in stupid spigot/forge hybrids

slender elbow
#

why do you care about supporting those

tender shard
#

because if it's just a simple additional null check, then why not

rough ibex
#

You can either do a null check or say spigot/forge is out of scope and not supported

#

or ignore the warnings

#

I can't think of any other options.

young knoll
#

You could tell the hybrids to get their shit together

tender shard
#

alright alright I'll just ignore it kek

deep herald
#

anyone know how to set the attack speed of a hit?

spare hazel
#

is there a way to increase a fireball's damage using the spigot api?

white mountain
white mountain
white mountain
#

PDC ?

agile anvil
#

Doesn't all entityhave PDC?

#

(but what the point of using pdc for a fireball since it's lifetime is really small?)

spare hazel
agile anvil
#

Just save the reference to this fireball in a variable

spare hazel
#

its not 1 fireball

agile anvil
#

In a list then

spare hazel
#
@Override
   public void onRightClick(PlayerInteractEvent e) {
      HypixelPlayer playerAccount = HypixelCustomItems.getSkillCore().getPlayer(e.getPlayer().getUniqueId());

      if(playerAccount.getMana() < getManaCost()){
         e.getPlayer().sendMessage(ChatColor.RED + "Not Enough Mana");
         return;
      }

      playerAccount.setMana(playerAccount.getMana() - getManaCost());

      Player player = e.getPlayer();
      Location spawnAt = player.getEyeLocation().toVector().add(player.getEyeLocation().getDirection()).toLocation(player.getWorld());
      Fireball fireball = (Fireball) player.getWorld().spawnEntity(spawnAt, EntityType.FIREBALL);

      fireball.setIsIncendiary(true);
      fireball.setBounce(false);
      fireball.setShooter(player);
      fireball.setDirection(player.getEyeLocation().getDirection());
      fireball.setVisualFire(false);
   }```
agile anvil
#

I don't know how is your architecture but you have multiple choices.

  1. Use PDC to Tag this fireball
  2. Use a list of fireballs in somewhere
  3. Use a list inside your player object
  4. Other
#

There are plenty possibilities. Take the one that fits the better for your structure

#

The easiest one and most understandable one would be to use PDC

spare hazel
#

alright thanks

agile anvil
#

And this Fireball is an entity, it implements a PersistantDataHolder interface

#

from which you can Fireball#getPersistentDataContainer

trim quest
#

hello does anyone know how to make multi version support project with maven multi module. like that ?

white mountain
agile anvil
#

It's quite tricky to get it correctly but once you did that in place it's quite straightforward

trim quest
#

i mean hierarchy of modules

agile anvil
agile anvil
agile anvil
#

The idea is the following : draw gray background chars, input negative chars to move to the left, right text you want (can include custom chars). (you can also adapt along up/down and right/left)

white mountain
#

And so on we need the player download a ressource pack with the font in it

agile anvil
#

Right

#

Only drawback. But I truly enjoy all the possibilities the resource packs bring nowadays and encourage you to use them

#

(You can also take advantage of it by adding new items, etc)

remote swallow
# trim quest i mean hierarchy of modules

Hi there! Today I’m going to explain how to setup a multi-module project using maven to support different NMS versions. Important notes about this tutorial: Every step will have detailled screenshots using IntelliJ. I explicitly chose not to include everything as copy/pastable source code, but normal screenshots (you can click on them to show th...

smoky anchor
#

Heyo guys
How would one go about creating a resourcepack server-side and then sending that to the player
without the need of uploading it somewhere and then putting the link to server properties
A link to some resource would be appreciated

sullen marlin
#

You need to upload it somewhere

agile anvil
#

Never saw a public plugin doing so. you can decompose it in three steps:

  1. Generating the resource pack
  2. Expose this resource to the internet : you can wether create an HTTP server, or push the resource pack to some hosting content
  3. Make a plugin that send the corresponding resource pack to the player when it joins
smoky anchor
#

Well that sounds hella complicated
Thank you for this guide tho

agile anvil
#

What do you want that for ?

smoky anchor
#

Nothing specific really
Just in case I ever want to use resourcepacks, I don't want to bother updating it on some host manually
Was hoping some easy way (an existing plugin or something) already exists to handle that for me

agile anvil
#

Then you'll maybe find some more help in #help-server -> People often share plugins or existing tools!

smoky anchor
#

Actually, I remember homosexualdemon's MusePulse plugin does this
Looked through sorce, he used SparkJava and it is literally just 4 lines of code for the host
So that's great! :D

misty garden
#

Hi everyone,

I want to create an economy, and this one you earn when you kill players, break a culture, with a kind of percentage

How can I do it?

wet breach
misty garden
wet breach
#

my advice would probably be the same

#

this isn't a place to be spoonfed

native ruin
#

Vault had an economy api maybe use that

misty garden
fringe spruce
#

hi guys,can someone help me out with a listener? So,i am creating a sort of handcuffs custom item and the last thing that I need to do is the listener that listens when a player right clicks on another player,can someone tell me what is the best event that I could use to create that?

smoky anchor
eternal oxide
#

?interact

#

there is a helper for this 🙂

#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
fringe spruce
#

i need to create a "on right click with that item " event

#

listener*

native ruin
#

Why does item frame have server operator interface?

#

And is it usefull for anything

shadow night
#

probably because it's an entity and you can execute stuff as an entity using the execute command

smoky anchor
shadow night
#

event.getItem(): 😑

tepid ore
clear elm
#

i need help i have a little problem... I have an velocity network and me or the 2 nd owner uploaded an plugin with an cryptominer exedently and now every plugin on every server has an javassist package , the javassist package is the cryptominer . can i just replace all plugin jar file or have i reinstall every server

eternal oxide
#

replace all jars

clear elm
#

only in pluggin folder?

#

or all jar

eternal oxide
#

and don;t get plugins from bad places

clear elm
#

so only plugin jar casue server.jar hasnt the javassist folder

eternal oxide
#

They can't easily infect teh server jar as that is active when their injection happens

clear elm
#

i shut the server down and only the plugins are infected should i send one infected plugin?

chrome beacon
#

We don't need your infected plugin

#

Delete all jars on the server

#

plugins, libraries, servar jar etc

clear elm
#

damn

#

so i can basicly reinstall it?

hushed scaffold
#

but you could just delete all the jars

clear elm
#

umm i put very much effor in the server

hushed scaffold
clear elm
#

can i keep the folders from the plugin?

quiet ice
#

Generally yes

clear elm
#

ALL jar files?

hushed scaffold
#

All

icy beacon
#

Hey, probably a simple question but I know next to nothing about this topic. Is it possible to buy a domain and attach it to my VPS? I want to get a domain and then an SSL certificate for it and before I actually go ahead and buy a domain I was wondering if that's possible at all. If there are any articles on the matter I'd appreciate

quiet ice
#

Only rarely will plugins be smart enough to also inject stuff there

hushed scaffold
#

except for the server jar

quiet ice
#

Including the server jar

clear elm
hushed scaffold
quiet ice
#

The cache dir can be nuked no problem

quiet ice
hushed scaffold
#

ah

clear elm
#

how im suposed to get all the new jar files

quiet ice
#

Just how you got them in the first place?

eternal oxide
#

ONLY download from reputable sites, like Spigot

hushed scaffold
#

^

clear elm
hushed scaffold
#

especially dont download cracked paid plugins

quiet ice
hushed scaffold
icy beacon
#

Can you briefly outline the steps I should take?

quiet ice
#

As long as you have a stable IP address there is no issue at all

clear elm
#

ig i download all plugin folder and reinstal server than i upload new good plugin and upload the folders

quiet ice
#

Get the VPS and Domain (from the same provider is usually the simplest) and see from there

icy beacon
#

I already have a VPS but they do not sell domains

#

I have just an IP address and a subdomain of theirs

#

I mean I will most likely be moving away from that vps soon

quiet ice
#

Then go with any reputable domain provider

eternal oxide
#

thats all you need

icy beacon
wet breach
quiet ice
#

Hertzner should provide that alongside DNS

#

But CF and anything else works too

chrome beacon
#

Cloudflare is nice uwu

spare prism
#

?paste

undone axleBOT
clear elm
#

how can i download folders?

chrome beacon
#

From where

quiet ice
#

Tarball them?

clear elm
#

plugin folder

wet breach
# clear elm i need help i have a little problem... I have an velocity network and me or the ...

here is a service script that lets you launch as many server jars as you want, modify to your needs but be mindful of the security settings in it. This service script is designed to prevent processes from doing anything outside of its directory its running in. This means if you get an infected jar again it only affects the server and plugins for that server and not everything outside of that. Also prevents the process from being able to see outside of its directory as well along with it can't modify its perms it started with

chrome beacon
quiet ice
chrome beacon
#

So pterodactyl

clear elm
#

yea

quiet ice
#

Perhaps they even have a negative opinion of systemd

spare prism
wet breach
wet breach
wet breach
hushed scaffold
#

:o

#

does it allow to also force close all processes of that directory?

wet breach
#

well since its a service, the script can kill the process at will

#

the odds of it ghosting is minimal

hushed scaffold
#

seems like the perfect tool to install pirated jars ( joke )

wet breach
#

well systemd is just a service handler

#

all processes started under systemd isn't above it

#

so this means if systemd wants a process to die that it has control over, it will most surely die but it does require a user still to have the appropriate permissions depending on the type of service

quiet ice
hushed scaffold
wet breach
#

Well systemd already runs as admin well kind of

#

it has two different sides to it

#

it has system services, and then there is user services

#

I suppose also network services

#

anyways, the root user can always kill systemd if they wanted to I guess but to do that you would need to install another system handler

#

but any processes started from systemd, is killable by systemd if it needs to do that. A user can always force kill processes especially root, just use the nice command

#

as long as you respect the categories for the services and use them appropriately you shouldn't have issues with a process becoming a ghost. Always a pain dealing with them ghosts >>

eternal oxide
#

I aint afraid of no ghosts.

wet breach
#

maybe not, doesn't mean getting rid of them isn't a hassle though

#

typically ends up you need to reboot the system to just get rid of them XD

#

so typically what you do if you can't get rid of the ghost process is you just ignore it

#

pretend its not there, consuming the small bit of resources and you keep doing that until you need to reboot to free up those resources if it starts consuming too much 🙂

eternal oxide
#

Silly, you call teh ghost busters. Have you not seen the advert?

wet breach
#

Yeah, but not sure if I want to risk them destroying stuff >>

#

maybe if like something important depended on the server not rebooting then maybe

raven vessel
#

@vagrant stratus how do i set up a premiumconnector bungeecord plugin in minehut

wet breach
#

why don't you ask minehut?

#

or the author of whatever plugin you are trying to use

raven vessel
#

ok

kindred valley
#

How can i grt the itemstack of the placed block in blockplaceevent

kindred valley
#

i use 1.7.10 duke

#

Ah wait there actuslly is the method there too

wet breach
#

getType()

kindred valley
kindred valley
#

How do i do uhc pvp plugin without using 1.7

#

I have to do

wet breach
#

why do you need 1.7 for it?

smoky anchor
#

no you don't
they didn't remove the pvp past 1.7

kindred valley
#

its not the same

smoky anchor
#

you can still fight people

kindred valley
#

The rod is literally 2x thicker

wet breach
kindred valley
#

They probably didnt even make 1.7 version for pvp but that version is the best of the best of pvp

main juniper
dire marsh
slender elbow
#

a wise person

wet breach
#

pvp wasn't really a thought out mechanic, hence being able to just spam click. However it makes sense when the game isn't designed centrally around pvp to begin with and rather just a fun feature added that was is not meant to be some hardcore pvp thing XD

wet breach
main juniper
umbral ridge
#

hi frosted elf are you in cali yet

wet breach
#

why would I be in Cali?

kindred valley
umbral ridge
#

why would you not be in cali

wet breach
#

because Cali sucks

umbral ridge
#

XD

kindred valley
#

Isnt there colorful wools on 1.7

#

?

wet breach
#

fuel prices are high because the citizens of the state decided to vote for a stupid tax that increases every year for 10 years. Cali is trying to outlaw the combustion engine even though there is no public transport to get from one end of the state to the other and its power producing abilities sucks right now and they make it nearly impossible for gas stations to setup EV stations so even if you wanted to go EV you won't get far due to lack of power and ev stations lol

wet breach
icy beacon
#

I'm trying to get an SSL certificate with Certbot and install it to the domain provided by my vps. I now have a certificate (fullchain.pem) and a private key (privkey.pem). I have no idea what to do next. Certbot gives this instruction but seeing as I have absolutely no idea what I'm doing, I'm failing to understand where I can find this file

kindred valley
smoky anchor
wet breach
dire marsh
#

oh the joys of legacy api

icy beacon
#

Or is that the absolute path

wet breach
#

that is the path

icy beacon
#

Yeah I don't have that..

wet breach
#

what about certificates?

icy beacon
#

Nope

#

What is the file supposed to be, at least the name or the extension

wet breach
#

hmmm.....check the directory you ran the command for certbot

wet breach
icy beacon
#

I am talking about the instruction prvided by certbot

wet breach
#

there should be 2 pem files and a key file

icy beacon
#

I know where my pem files are

kindred valley
icy beacon
#

But struggling to understand step 7 (screenshot)

young knoll
wet breach
young knoll
#

We love the flattening

icy beacon
wet breach
icy beacon
#

Probably not. Just a VPS

#

The tech support fucking sucks ass

wet breach
#

then you need to install a webserver

icy beacon
#

I was like "How can I install an SSL certificate on a domain of your vps"

quiet ice
#

A webserver is something that runs on port 80/8080

icy beacon
#

They were like "go install it"

spare prism
#

my custom events doesn't get called

icy beacon
#

Like bitch yeah thanks for the help

icy beacon
wet breach
icy beacon
wet breach
#

you don't really install certificates per-say, you just tell the various things that need certs where the certs are located to use

#

literally anything that can use SSL or HTTPs

quiet ice
icy beacon
#

1 sec

#

They aren't intsalled

quiet ice
#

Then why do you want SSL?

icy beacon
#

For my REST API to be able to use HTTPS

#

Am I understanding what I'm doing? Again no

quiet ice
#

Then point your rest API to those certs

icy beacon
#

That's why I've come here. trying to comprehend this

icy beacon
quiet ice
#

Ye?

wet breach
#

it was never difficult to begin with?

icy beacon
#

I'll reiterate that I have 0 understanding of ssl, certificates, and other shit. I thought it was wired to the domain itself in some way

quiet ice
#

Alternatively proxy the REST API with something like httpd or lighttpd and install the certs for httpd or lighttpd

icy beacon
#

I'll take a look at the docs of ktor now

wet breach
#

well it is tied to the domain in a way yes

#

that is what the pem files are for

#

the pem files outlines information in regards to the cert

#

then it provides the cert

quiet ice
#

(there are more options out there, but I use those two as an example that I can think from the top of my head)

icy beacon
#

Not exactly what I mean, my initial understanding of how SSL would work is that the provider of the domain would somehow attach the SSL certificates to the domain. Very scuffed but now I think it is somewhat more clear

#

Ty for the help and helping me clear my misconceptions

#

I'll scout the ktor docs

quiet ice
#

The SSL certs are pretty much just a public/private key pair signed by a CA

#

At least that is how I understand it

shadow night
#

aren't SSL certs also somewhat client sided? Like, I could make my own SSL cert, the only limit is that most browsers don't know of it so they just won't accept it as a secure connection

wet breach
#

technically you could use DNS to hold certs

#

however, it won't work for https though as that must be provided by the webserver because it needs the fullchain pem file

#

the fullchain is how a visitor can verify your certificate is legitimate because it can follow the chain to verify

inner mulch
#

if there is an object held in memory, and I hold on to the same object in another class as well, does the object exist twice now, or do both reference the same one that existed in the first place?

shadow night
#

well, depends

inner mulch
#

i save the object in the other class, not with a getter of where it was, i save it in the constructor, so its probably a second instance?

shadow night
#

uhh what?

#

if you have made it in one class and passed it through the constructor or another method into another class, then it's the same object. If you have specifically recreated (copied) the class, then you will have two identical classes

inner mulch
minor junco
inner mulch
#

okay

minor junco
#

new Object () allocates a consecutive amount of memory in the heap, which represents the data (attributes) of that object. The returned value is just the memory address (pointer) to that object referenced in memory. If you share the same pointer, the memory is still the same place

inner mulch
#

okay nice

#

i was worried I'd be using double the memory

#

if i refer to the "same" object twice

#

and it seems like it is really the same

minor junco
#

Thats pass by reference and pass by value are different. Java is pass by reference for non primitive data types, and pass by value for primitives. So if you pass a primitive, such as an int, it's copied, since it's a different stack frame in memory, that is "allocated"

inner mulch
#

oh thats good to know

slender elbow
#

java is all pass by value

minor junco
inner mulch
#

so you kinda lied?

#

or what does this now mean?

slender elbow
#

it means you don't have to worry about it

#

when you pass a List around, unless explicitly done, the list is not copied as a whole

#

it is "shared"

inner mulch
#

ok

slender elbow
#

for example, if you add an element to the list in one class, and the same list was passed to another class, since it's the same list then the other class will also see the new element

#

but it's a single list

inner mulch
#

okay

small current
#

Hello

#
java.lang.IllegalStateException: Vault service not found
        at com.trexmine.ffa.FFA.registerHooks(FFA.java:130) ~[FFA-3.0.jar:?]
        at com.trexmine.ffa.FFA.onEnable(FFA.java:48) ~[FFA-3.0.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[slimeworldmanager-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[slimeworldmanager-1.19.4.jar:git-SlimeWorldManager-15076]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[slimeworldmanager-1.19.4.jar:git-SlimeWorldManager-15076]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[slimeworldmanager-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugin(CraftServer.java:563) ~[slimeworldmanager-1.19.4.jar:git-SlimeWorldManager-15076]
        at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugins(CraftServer.java:474) ~[slimeworldmanager-1.19.4.jar:git-SlimeWorldManager-15076]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:653) ~[slimeworldmanager-1.19.4.jar:git-SlimeWorldManager-15076]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:437) ~[slimeworldmanager-1.19.4.jar:git-SlimeWorldManager-15076]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[slimeworldmanager-1.19.4.jar:git-SlimeWorldManager-15076]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1119) ~[slimeworldmanager-1.19.4.jar:git-SlimeWorldManager-15076]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[slimeworldmanager-1.19.4.jar:git-SlimeWorldManager-15076]
        at java.lang.Thread.run(Thread.java:840) ~[?:?]
#

why is this happening

#
    private void registerHooks() {
        RegisteredServiceProvider<Economy> serviceProvider = Bukkit.getServicesManager().getRegistration(Economy.class);

        if (serviceProvider != null) {
            VaultHook.register(serviceProvider.getProvider());
        } else {
            throw new IllegalStateException("Vault service not found");
        }

        new PlaceholderHook().register();
    }
#

vault is enabled before and its in depends

eternal oxide
#

Did you shade Vault into your plugin by mistake?

spare prism
upper hazel
#

Is there a way to bypass the restrictions on the form of a final value in a yadda expression?
i try create confortable argument checker

eternal oxide
#

final int toDisplay = hourFrom;

upper hazel
#

this not confortable

eternal oxide
#

just make hourFrom final as you are not re-assining it

small current
eternal oxide
#

What is the import for your Economy.class?

#

Do you even have an Economy plugin?

tender shard
#

you should rather print "Economy provider not found"

tender shard
icy beacon
#

i am going to go crazy

rough ibex
#

Rats? I was crazy once

icy beacon
#

i;'ve finally configured my rest api to run on an ssl certificate that i generated with let's encrypt and spent way too long turning into a jks keystore, launched it on the vps and it launched over https, then i test how it runs and it fucking errors with invalid certificate

#

im going to give up on life

icy beacon
icy beacon
icy beacon
#

netty

#

if that gives you any intel

rough ibex
#

Well, that's a big library.

icy beacon
#

no shit

#

what did you expect to hear

#

had i seen my lines of code in the stacktrace i'd at least have a general idea of what might be wrong

rough ibex
#

Well, you do get a stacktrace

#

May I see it

icy beacon
#

i mean sure

#

1 sec

#

?paste

undone axleBOT
icy beacon
#

it's omst likely because i have misconfigured something

twin venture
#

Hi , been a while .. trying to save a location [world name , x , y , z ] into .json settings file

tender shard
#

I usually just create a wrapper class that only has the information I need

public class SimpleLocation {
  private String world;
  private double x, y, z;

  public SimpleLocation(String world, double x, double y, double z) {
    this.world = world;
    // ...
  }

  public static SimpleLocation fromLocation(Location loc) {
    return new SimpleLocation(loc.getWorld().getName(), loc.getX(), loc.getY(), loc.getZ());
  }
}

then I throw the SimpleLocation into gson

#

alternatively you can create a custom TypeAdapter

icy beacon
rough ibex
icy beacon
#

yes googling the error mentiioned there miht be plaintex t or some shit

tender shard
#

why even bother with https? just make your API run only http and then use a reverse proxy

icy beacon
#

what do i do with that info

icy beacon
#

do you reckon it'd be easier

rough ibex
#

HTTPS also adds a bit of encryption overhead

#

although thats a bit of a microoptimization

tender shard
icy beacon
#

ok my second question is what is a reverse proxy or more specifically how can i set it up

quaint mantle
#

Hi , how to set permission in command sender ?

rough ibex
#

Test for or set?

#

ensure you know what you wanna do

#

do you want the command to test for the sender's permission

tender shard
#
  1. Make your API run only on localhost (HTTP)
  2. In your webserver, create a reverse proxy config for the vhost - it accepts HTTPS requests from anywhere, redirects it to http://localhost:12345 (your API), and returns the results through HTTPS again
<VirtualHost *:443>
  ServerName myapi.mydomain.com

  ProxyPass / http://127.0.0.1:12345/
  ProxyPassReverse / http://127.0.0.1:12345/

  # Configure SSL certificate here like you'd always do on your webserver
</VirtualHost>
icy beacon
#

i have to spin up a webserver 😭

#

like you'd always do
more like for the fisrt timem

rough ibex
#

it isnt very hard to do

#

you're running locally

#

and it's good exposure into networking

tender shard
#

well for apache, HTTPS is as easy as giving it the path to your certificate

        SSLCertificateFile /etc/letsencrypt/live/jeff-media.com/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/jeff-media.com/privkey.pem

icy beacon
#

i mso fucking tiredof this bullshit with ssl i'm going to have ptsd

#

i'll figure it out tomorrow

#

thanks for the lead alex

twin venture
rough ibex
#

if you want to use nginx instead of apache

icy beacon
#

i known't the difference

tender shard
icy beacon
#

but i guess i will be enlightened tomorrow

icy beacon
#

i use jsondeserializer/jsonserializer imo much easier

#

abstracts a bit of stuff out

twin venture
tender shard
#

no, you should not pass null into your write method

rough ibex
#

the problem is that when you ask if (location.getWorld()) , location itself might be null, so null.getWorld() is an error.

tender shard
#

btw you can't just write beginObject() and then return without having written endObject()

twin venture
#

i got it working :p

tender shard
#

the issue with that though is that you will never get a normal location again if you just register your type adapter globally

tender shard
#

that's why I'd just create a separate data class for SimpleLocation, that just has 4 fields; name, x,y,z

#

then gson can also handle it automatically and you dont even need a type adapter

orchid brook
#

I have this config:

reset:
  # Can be daily / weekly / monthly
  frequency: daily
  reset-hour: 23:59

Is it better to use scheduleAtFixedRate() or runTaskTimer() with a 20 tick repeatDelay ?

ivory sleet
#

runTaskTimer imo

#

I assume if you use scheduleAtFixedRate, you mean ScheduledExecutorService, which on its own is fine, but first of all, you’re doing this in ticks (according to what u seem to be using) so BukkitScheduler is a more intrinsically intuitive choice, additionally whenever you carry a ScheduledExecutorService you most likely want to carry a dispatcher/execution ExecutorService as well to not put too much load on the ScheduledExecutorService, this can increase overhead due to underhood thread scheduling etc

tender shard
ivory sleet
#

That’s only for parsing, no?

orchid brook
#

and if i remove the reset-hour configuration, is it more easy to do right ?

fringe spruce
#

hi guys! how can i set in a gui a custom head from the minecraft heads website

ivory sleet
fringe spruce
ivory sleet
fringe spruce
#

do you know the website from which you can give you custom heads in game

tender shard
ivory sleet
#

Ah, well TimerTask + Timer kinda sucks

#

I havent ever used cron so I wouldnt know

tender shard
#

hm no clue then 🥲

fringe spruce
ivory sleet
#

I assume its some sort of rest api

fringe spruce
#

anyway,can i insert custom heads in a created inventory?

river oracle
fringe spruce
#

but the problem is that i need to create the itemstack

orchid brook
#

Alright i got it i think

private void scheduleResetTask() {
        long initialDelay = calculateInitialDelay();

        Bukkit.getScheduler().runTaskTimer(this, () -> {
            // TODO
        }, initialDelay, calculateRepeatDelay());
    }

    private long calculateInitialDelay() {
        LocalDateTime now = LocalDateTime.now();
        LocalDateTime nextReset = LocalDateTime.of(now.toLocalDate(), resetTime);

        if (now.isAfter(nextReset)) {
            switch (resetType.toLowerCase()) {
                case "daily":
                    nextReset = nextReset.plusDays(1);
                    break;
                case "weekly":
                    nextReset = nextReset.plusWeeks(1);
                    break;
                case "monthly":
                    nextReset = nextReset.plusMonths(1);
                    break;
            }
        }

        return ChronoUnit.MILLIS.between(now, nextReset.atZone(ZoneId.systemDefault()));
    }

    private long calculateRepeatDelay() {
        switch (resetType.toLowerCase()) {
            case "daily":
                return TimeUnit.DAYS.toMillis(1);
            case "weekly":
                return TimeUnit.DAYS.toMillis(7);
            case "monthly":
                return TimeUnit.DAYS.toMillis(30); 
            default:
                return TimeUnit.HOURS.toMillis(24);
        }
    }

I hope this will not use to much resources to my server.

ivory sleet
#

Prob not

#

I mean your implementation looks a bit under engineered

#

but its fine

orchid brook
#

oh realy ? hmm

ivory sleet
#

well

fringe spruce
ivory sleet
# orchid brook oh realy ? hmm

Error handling, and tps loss, and availability and persistence may not be fully supported, but I think you don’t need to care about all that

river oracle
#

Bukkit#createPlayerProfile

#

?jd-s

undone axleBOT
river oracle
#

Btw UUID doesn't matter

#

Just use UUID.randomUUID

fringe spruce
#

i want a head on a gui to look like a custom head

#

how can i do that without the uuid

hasty oyster
#

I'm trying to make items non-stackable, is there a good way to do that, my first thought was just giving it a random uuid tag, but I'm not sure how to do that, is there a better way?

hazy parrot
#

random tag seems good enough for me

orchid brook
ivory sleet
#

If the app is closed and it starts again (such as a reboot), then no loss of tasks that have been executed or were going to be executed etc

hasty oyster
hazy parrot
#

?pdc

hasty oyster
orchid brook
ivory sleet
quaint mantle
#

Hi , how to play .mp3 for player ?

rough ibex
#

Convert it to ogg and put it in a resource pack

tender shard
#

(and only use mono files, otherwise it always plays at full volume)

fringe spruce
tender shard
# fringe spruce i want a head on a gui to look like a custom head

Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...

upper hazel
#

plugin support using protocoLib from 1.17.x to 1.20.1 should change 4 times or more than 10 ?

slender elbow
#

what

violet delta
#

Anyone know if Geysermc plugin support all forms of bedrock to join java servers? even mobile? thanks

orchid gazelle
#

consoles usually need you to change the DNS-Server on it

violet delta
#

wym @orchid gazelle

quaint mantle
#

What.

quaint mantle
eternal oxide
#

The one above it. It replaces it with the remapped obf jar

tender shard
#

in IJ, how can I jump to the open class in the project sidebar?

#

basically I want this file to be selected in the sidebar

topaz kestrel
tender shard
#

show the full stracktrace

trim quest
#

hello. can we add player leash to player with NMS ?

#

I want both players to withdraw while they are connected to each other with the lead item.

chrome beacon
trim quest
#

i mean there is event like PlayerToEntityLeadEvent

#

can we implement PlayerToPlayerLeadEvent with NMS

chrome beacon
#

You can

trim quest
#

after changed HumanEntity or Player interfaces

#

i want to add bidirectional leashing

#

i can but how i still wonder

#

if there is good resource can you link me

chrome beacon
#

I don't see why you need to

#

You don't need to use NMS?

#

also when you're working with NMS you're mostly on your own

#

the best documentation is the code itself

lethal knoll
#

Hi, what is the new supported method to parse a string to a potion effect type?

#

it's all deprecated

pseudo hazel
#

which one is deprecated?

lethal knoll
#

static methods, getByKey, getByName, getById

pseudo hazel
#

it says to use Register.get(NameSpacedKey) instead

#

right in the docs

chrome beacon
#

^^

pseudo hazel
lethal knoll
#

yeah, trying that

#

Might be me but I don't see how to use this method

chrome beacon
#

Registry.EFFECT.get(key)

lethal knoll
#

ah ait

#

wait

#

yes I see

#

thnx

#

I am still not getting what I need here, I just need to fetch a PotionEffectType, not a potion, and also not a list of effects from a potion

#

Goal is that I can store the type of the effect in a config, and use it afterwards to change it back to an effect

pseudo hazel
#

so what step are you still missing

lethal knoll
#

I'm not sure, I can't believe I have to get a potion first to get a PotionEffectType

#

Especially not because there is still a depcrated version to get it by the key

pseudo hazel
#

didnt you already have the string?

lethal knoll
#

Yes I do, the string I have

#

I just need to get the PotionEffectType

#

not the potion

#

okay nevermind

#

I was stupid -_-

#

I'm just not remaining up to date enough with the API's

#

Thank you both

quiet ice
#

Does Hashmap have decent iteration performance or is it more or less "required" to have it be a LinkedHashMap if you forsee the possibility of iteration?

#

I'm expecting up to about 200-ish elements for reference - but more are not impossible

pseudo hazel
#

no thats still fine

#

idk what you consider decent

quiet ice
#

Well, anything that wouldn't kill performance a-la #getItemMeta

ivory sleet
ivory sleet
#

However, HashMap is fine

#

And there is less overhead iterating over a HM iirc

#

Tho its negligible unless u fly to the moon

rotund ravine
quiet ice
#

I was asking because LinkedList vs ArrayList is not much of a performance difference (at least on modern computers)

ivory sleet
rotund ravine
quiet ice
#

I'm not going to read through the hashmap impl

quiet ice
ivory sleet
#

But if we’re speaking at max n = 200 I don’t think you need to care about overhead that much between Linked vs non-Linked

#

for the average jvm

pliant topaz
#

I was just wondering why these two objects aren't the same? (The rightclicked item is just Dice.get() in the furthest right hotbar slot, but it still prints 'no')

            System.out.println("Rightlicked dice");
            DiceMechanic.rollDice(player);
        } else {
            System.out.println("no");
        }```
Anyone knows what could be the problem? (I also compared the ItemStack object in console and they were the same if I didn't overlook something)
orchid gazelle
#

try .equals

#

instead of == comparison

rotund ravine
#

Compare with equals or isSimilar

pliant topaz
#

I'll try that thx

#

Okay, it works, but I've got another error ;-;
I used Bukkit.getScheduler().wait(100) to create a small delay but the thread isn't owner, so yeaaaa. Is there anything else I could try (that i can put right into my code without enclosing it or something)?

inner mulch
#

Is there any way to have two constructors with the same parameters, that do different things tho?

rough ibex
#

How are you going to tell them apart

#

do you want to use a factory

ivory sleet
quiet ice
pliant topaz
#

So like I did it here?


                    },2);```
#

can I do these empty?

quiet ice
#

You cannot use Thread.sleep() or similar in a minecraft setting - (exception is the synchronized keyword, but that should only be used in relation to thread safety and nothing else)

quiet ice
pliant topaz
#

well, there's nothing that really has to be delayed, that's the thing. I need code to be executed instantly, then a 2 tick delay

quiet ice
#

For example if you wish to call the method this.runDelayed() every 2 ticks you do Bukkit.getScheduler().scheduleSyncDelayedTask(Catan.plugin, () -> {this.runDelayed();}, 2); or (short form, but is likely to be more confusing for you) Bukkit.getScheduler().scheduleSyncDelayedTask(Catan.plugin, this::runDelayed, 2);

quiet ice
pliant topaz
#

I'm making a dice, and I want it to 'roll' every 2 ticks

#

after 2 seconds it's finished and gives the final result

quiet ice
#

Repeatedly every 2 ticks or just a single delay of two ticks?

pliant topaz
#

just a single delay

quiet ice
#

Then you put anything that needs to be executed after two ticks inside your lambda

pliant topaz
#

Okay, ty

quiet ice
#

Just beware that the lambda will only execute after two ticks while the rest of your method should (ideally speaking) be instantly finished - so two ticks prior your lambda

orchid gazelle
#

Does anybody here know how I can check if my Location is colliding with any block? Needs to be really fast from a processing time pov

#
          if(material != Material.AIR && material != Material.WATER && material != Material.LAVA) {
              return new RayCastResult(RCType.block, current, null, null);
                  }
          }``` got this shit, needs to be about 100-1000x faster tho lmao
#

running this for every 0.0625 blocks in my ray

#

and is also inaccurate

quiet ice
#

What is this for? I suppose bukkit's raytracing is too slow for your purposes?

#

Because depending on the usecase you might be able to do dumb hacks instead of properly raytracing

orchid gazelle
quiet ice
#

The trick when it comes to doing things fast is to do as little as possible

orchid gazelle
#

yeah

orchid gazelle
inner mulch
#

how is it that targetplayer is already defined in scope, even tho i call break?

inner mulch
#

okay thank

#

s

quiet ice
#

This plainly has to do with the fact that java local variables are valid until the corresponding closing bracket (}), even if it would be impossible to use these vars otherwise (which is the case in switch statements)

celest notch
#

I currently have an auction house on my rpg server but it is really inconvinient for buying large amounts of items as it is limited to a stack per auction, how would i code something similar to hypixel's bazaar maybe?

quiet ice
#

The code you provided cannot be improved further though, at least not as-is. (I guess you could make use of Material.ordinal() but that is too negligible of an improvement, if it even is an improvement. And even then it is too brittle)

#

The libGDX guys are quite fond of object pooling so I suppose you could use that, but it won't make much of a difference on modern hardware with modern software.
You could also use NMS instead of the bukkit equivalent (however I suppose that is not what you want) and perhaps even cache the world (or if using NMS - chunk section? I haven't used any NMS though, if you cannot tell already so take this with a grain of salt) if the code is called in a loop

#

I'd just use spark and work on eliminating or reimplementing the hot code in NMS if this was really required

#

Depending on the usecase you can use stupid amounts of caching too (especially if you expect to do basically the same action multiple times)

hazy parrot
shadow gazelle
inner mulch
slender elbow
#

how would you specify which one to invoke

shadow gazelle
slender elbow
#

cmarco with the real answers here

spare mason
#

anyone knows any tool to visualize a group of block entities?

worldly ingot
worldly ingot
#

Some severely fucked up Java that doesn't exist

inner mulch
#

okay

worldly ingot
#

Generally speaking your constructor shouldn't have any side effects - it should affect pretty much only the object instance itself. If still you need two different ways to instantiate an object, pass a boolean to the constructor

inner mulch
#

oh

#

it shouldnt do something to other objects?

worldly ingot
#

Correct

#

More of a general thing to keep in mind than a strict rule though

#

There will always be exceptions to said rule lol

inner mulch
#

what if my constructor does that :(? is this a bad design?

worldly ingot
#

Depends on your object, depends on what it's doing ¯_(ツ)_/¯

inner mulch
#

im creating it, and save it instantly to the place it belongs once created

#

i save it in memory

spare mason
#

hi, i am trying to use display blocks but it uses matrix, I haven't seen anything about a matrix even on school, there's any good tutorial to start learning about that? I have been browsing for some hours but most of it was of matrix of 2x3 but display blocks need a matrix of 4x4 and a value from -1 to 1. I would really appreciate if someone send a link to learn about this

ivory sleet
worldly ingot
spare mason
worldly ingot
#

Translation is movement on the x, y, and z axis

spare mason
#

And left and right rotation? Why the 2 of them are needed

worldly ingot
#

Right rotation is applied first, then scale, then left rotation

#

You can just use right rotation if you'd like and set the left rotation to a unit quaternion (new Quaternionf())

grave vigil
#

Does a bukkitrunnable scheduler reset on server restarts? I want to have a timer that activates once every month.

worldly ingot
#

Yes. It's only valid for the current runtime

#

You'll have to schedule a task that runs every hour or something that checks the current day

grave vigil
#

thanks

spare mason
manic delta
#

Someone who knows about reflection, I have a plugin that I made in 1.20 and I want to make it compatible with 1.13+, the plugin is already finished but I was looking for reflection and the truth is I didn't understand anything lol, so I would like someone to help me understand how to do it, this is the repository, obviously I will give credits and contributions to anyone who can help with this problem
https://github.com/system32developer/Kit-Renamer

GitHub

Contribute to system32developer/Kit-Renamer development by creating an account on GitHub.

quaint mantle
#

@minor otter

#

is this a ghost item or real item

remote swallow
manic delta
lost matrix
#

Cancelling the InventoryClickEvent will completely prevent items from being moved between inventories.
Does this only occur in creative mode?

quaint mantle
#

why does the moderator rank have the admin prefixes even though the one
own has this is my config

useChatFormat: true
useColorTranslate: true
chatFormat: '%chatPrefix%%playerName%&8: &7%message%'
autoUpdate: true
Prefixes:

  • owner;&4Owner &7» &4;&4Owner &7- &4
  • 'default;&7Player&7: ;&7Player&7 ➜ '
  • 'Supporter;&2Supporter&7: ;&2Supporter&7 ➜ '
  • 'Admin;&eAdmin&7: ;&eAdminstrator&7 ➜ '
  • 'Moderartor;&aModerartor&7: ;&aModerartor&7 ➜ '
#

in the lucktab plugin

raw sky
#

is it beneficial to any way to use a lib like skedule or mccoroutine over the bukkit scheduler?

#

i have to use some suspend methods to download files and make http requests

quaint mantle
#

Creative mode inventories are like broken

lost matrix
quaint mantle
#

HttpRequests you can use the httpclient and pair it up with an executor service

wild roost
#

how do I open an inventory which is created by command and then should be opened in the other class?

#

I cant make Inventory public or smth, so idk how

glad prawn
#

use something to contain it?

wild roost
# manic delta Wym exactly

so, im tryin to make a simple item-based backpack, when player executes command /getbag, he gets an item, which when u right click on it opens a small inventory

manic delta
wild roost
#

to the variable?

manic delta
#

Or you can save the inventory contents on the item, using nbt

manic delta
wild roost
#

so, ill try, thnx

manic delta
#

Good luck

wild roost
# manic delta Good luck

and one more thing: when i set inventory's owner as player, can I get an inventory using player.getInventory?
code:
Inventory bagInv = Bukkit.createInventory(player, 9 "Small Bag")

eternal oxide
#

no

wild roost
#

🥲

upper hazel
#

Is buildTools needed to add NMS to a project?

#

and is it necessary to add all subversions from the main version for the plugin to work from 1.17.x to 1.20.1?

eternal oxide
shadow night
upper hazel
eternal oxide
#

Maven modules

upper hazel
#

then why i need use buildTools for this

eternal oxide
#

pretty sure alex will have something on his site about multi module by now

#

buildtools gives you the source

#

?nms

eternal oxide
#

Hi there! Today I’m going to explain how to setup a multi-module project using maven to support different NMS versions. Important notes about this tutorial: Every step will have detailled screenshots using IntelliJ. I explicitly chose not to include everything as copy/pastable source code, but normal screenshots (you can click on them to show th...

upper hazel
eternal oxide
#

it doesn;t

#

NMS is Mojang code and not on any repo

upper hazel
#

but how then intelji can know where source exists???

rotund ravine
#

Local repo 👌🏻

eternal oxide
#

NMS = net.minecraft.server, or shoudl really be called native minecraft code, as it now also contains other packages like org.mojang

eternal oxide
upper hazel
#

For all dependencies located locally on the PC, you have to specify the location from where they are located, don't you?

eternal oxide
#

no

#

its a local maven repository

#

generally it's always searched first

upper hazel
#

So intelji is looking for dependencies in all folders?

#

like antivirus??

eternal oxide
#

no

#

if you specify net.minecraft.server, it looks in your net\minecraft\server folder in your local repo

#

local repo is usually somewhere like C:\users\name\appdata\.m2 or something like

upper hazel
eternal oxide
#

you don;t specify a path, it's your imports

#

Just go read alexs' page

#

You specify the dependency just like all

#

spigot not spigot-api

native ruin
#

I have yet to have the courage to learn nms

rotund ravine
eternal oxide
#

don;t. Its a last resort

upper hazel
#

So it turns out that BooildTools automatically loads dependencies into the local repository ?

eternal oxide
#

yes

#

Buildtools should already be the way you are getting your Spigot server jar

rotund ravine
native ruin
shadow night
#

Being a 1.8 dev has too many disadvantages to look at advantages lol

native ruin
#

if it pays it pays

tropic saddle
#

its same shit, okaeri tasker implements bukkit scheduler xD

#

dude okaeri tasker is literally bukkit scheduler but simplified

grim hound
#

what the fuq

#

This mfo acts like spamming the message will help in any way

tender shard
grim hound
#

reflection

#

cuz multiversion

tender shard
#

why?

grim hound
#

and it works

tender shard
#

as you can see, it works subpar

#

on 1.18.1+ you must use rather use the API

quaint mantle
tender shard
#

fallback to reflection only for extremely outdated versions

#

like 1.17

grim hound
tender shard
#

no, since 1.18

quaint mantle
#

Bruh I thought it existed since 1.12.x

grim hound
tender shard
#

API to get an offline player's skull exists since forever

grim hound
#

didn

#

't have any api until now

tender shard
grim hound
#

and when people found a solution they just said "nah, we adding it now and telling you all that you're doing it wrong"

tender shard
#

you will have to set all fields properly and then the warning won't appear

#

but why not just use the API on versions where it's available?

grim hound
grim hound
#

it

#

works

#

only the texture is necessary

#

for me

#

so why spam messages?

tender shard
#

well you have two options, either

  1. You use the intended way, or
  2. you keep using your outdated way, but then you gotta stop complaining about that message
#

Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...

grim hound
#

can you at least tell me how

#

oh, thanks

tender shard
#

You can do sth like this:

grim hound
#

what if I already have just the skull's value?

#

isn'

#

t that what's necessary?

tender shard
#
if(isMc1_18orNewer()) {
  // Do it like in the blog post
} else {
  // Use your old reflection way
}

public static boolean isMc1_18orNewer()) {
  try { Class.forName("org.bukkit.profile.PlayerProfile"); return true; }
  catch (ReflectiveOperionException e) { return false; }
}
tender shard
#

just keep reading

tropic saddle
tender shard
#

idk I never made fake players

ivory sleet
#

Ofc might need to switch up depending on version

grim hound
ivory sleet
#

Yep

tropic saddle
#

/ serverplayer

tender shard
#

it's not deprecated

#

you must be using some other API besides spigot

grim hound
#

paper

#

but paper is really great at making things harder

#

for no reason

valid burrow
#

not for no reason lol

tender shard
#

you can still use PlayerProfile, even though paper claims it's deprecated. As you see in the spigot docs, it is not deprecated in spigot

valid burrow
#

paper has its reasons

grim hound
#

it changes cosmetic things

valid burrow
grim hound
#

and makes them worse

#

for no reason

drowsy helm
#

paper deprecations are more of a suggestion

valid burrow
grim hound
#

player quit console message

tropic saddle
#

paper uses kyori instead of normal strings

grim hound
tender shard
#

Just use the Spigot API if you want your stuff to be compatible with spigot.

For paper-specific features or adventure, you can still shade adventure manually, and use PaperLib

tropic saddle
#

i personally thing that kyorii components are easier to use than basecomponents

#

use purpur api, paper is legacy :tf:

tender shard
#

if you use paper-api, then you can expect your plugins to not work on spigot anymore

valid burrow
tender shard
#

i also use adventure / minimessage for everything but I still use Spigot API instead of paper api

tropic saddle
#

paperweight is the best option if u want to use nms btw

upper hazel
tender shard
tender shard
upper hazel
tropic saddle
valid burrow
native ruin
tender shard
tropic saddle
tender shard
#

all those spigot versions provide the same classes, hence you'll always only see them from one version

tropic saddle
tender shard
#

@upper hazel https://blog.jeff-media.com/maven-multi-module-setup-for-supporting-different-nms-versions/ This is the proper way to use different NMS versions

Hi there! Today I’m going to explain how to setup a multi-module project using maven to support different NMS versions. Important notes about this tutorial: Every step will have detailled screenshots using IntelliJ. I explicitly chose not to include everything as copy/pastable source code, but normal screenshots (you can click on them to show th...

tender shard
tropic saddle
#

u can use purpur api 😉

upper hazel
#

i shold create should I create multiple plugins in 1?

tender shard
tender shard
tropic saddle
#

who uses clean spigot server jar

tender shard
tropic saddle
#

non sense

tender shard
#

I also use spigot

valid burrow
tropic saddle
#

for what reason u wont use purpur for example

tender shard
#

and there's another reason to support spigot: paper-only plugins aren't allowed to be uploaded on spigotmc

tender shard
#

so why would I use sth that only makes my life harder

#

I don't have 385 players, I don't profit from purpur

#

I only have one player

valid burrow
#

why so specific lmao

tropic saddle
#

purpur makes ur server more optimized i guess

eternal oxide
#

buggier is the word

tropic saddle
#

has some things in api that also makes ur life easier

ivory sleet
#

Ik it had like one new event or sth

#

Wouldn’t say that was lifesaving in any meaningful way

tender shard
tropic saddle
#

oh i just saw ur profile, no questions

valid burrow
#

but that’s complicated as all of that stuff already exists

#

its easier to make custom plugins imo

tropic saddle
#

ik, got skills but hard to come up with an idea

ivory sleet
#

I mean if you have a spigot compatible plugin you want to sell, its probably not a useless idea to just put it on spigotmc, but I’d assume u have it on other platforms ntl

tropic saddle
#

i think that creating minigames server and selling it would be worth more to put time in

ivory sleet
#

Eh, well, if you really wanna earn cash I don’t think server sided mc dev is the hustle for you

tender shard
#

scrooge mcduck made his first million with 1.8 plugins

#

is -1 allowed as custom model data?

ivory sleet
ivory sleet
tender shard
#

oh no that's annoying

ivory sleet
#

I’m actually unsure

native ruin
#

let's fuck around and find out

ivory sleet
#

💯

tender shard
#

if -1 is allowed then my blackliast is broken 🥲

ivory sleet
#

lol why?

tender shard
#

because I'm using -1 to identify items without custom model data

ivory sleet
#

Well items w/o CMD has a null value, no?

grim hound
#

how I could set the value directly

#

"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOThiNWU5ZDVhZmFjMTgzZjFmNTcwYzFiNmVmNTE1NmMxMjFjMWVmYmQ4NTUyN2Q4ZDc5ZDBhZGVlYjY3MjQ4NSJ9fX0"

#

this is an example of a skull value

#

it contains the texture within

sullen marlin
#

No it doesn’t, decode it

tender shard
#

no, but my blog post explains how to turn that into a URL

#

this part

grim hound
hushed spindle
#

did we change the flash particle recently for some reason

#

i used to be able to pass a size to the flash particle but now it throws an error when done so

#

saying the expected data is void

tender shard
#

in which version were you able to pass a size?

hushed spindle
#

like uh, 1.16 or something i dont quite remember

#

i guess i shouldnt say recently then lol

tender shard
#

can you show some code that worked in 1.16? Because usually the data is a class like BlockData or ItemStack or MaterialData or DustOptions etc

upper hazel
tender shard
#

your "core" module will usually contain the plugin

#

unless you want to abstract it even further, then you'd have a separate plugin module

#

if you only want to have multi version NMS, then core/plugin can be one module

upper hazel
#

in the tutorial you create the base of the plugin using the usual method and not through plugin bukkit and then configure everything manually

tender shard
#

no clue what you mean with "usual method" or "through plugin bukkit"

#

do you mean that I'm not using IJ's "Create Spigot plugin" project wizard?

upper hazel
#

i can create module like this?

#

core module

upper hazel
#

with automatic configuration rather than doing everything manually

tender shard
#

yes but there isn't really any benefit from using that

#

I mean all it does is to add the maven-shade-plugin which you don't need

#

but sure, you can use that

upper hazel
#

ok

upper hazel
#

"Main class"

rotund ravine
#

Not that much difference

tender shard
#

doesn't it only create a main class with an empty onDisable and empty onEnable method?

rotund ravine
#

Yeah

tender shard
#

// Plugin startup logic

#

kek

rotund ravine
#

Plus a package structure

tender shard
rotund ravine
#

I use a github template for my kotlin plugins

tender shard
#

oh btw that IJ dev plugin will mess up your parent/child project structure

#

be sure to add the parent section to your core pom if you use the weird MC DEv wizard

upper hazel
tender shard
#

no

upper hazel
#

it is generally needed for the plugin
?

tender shard
#

it would be much easier if you'd just follow the blog post exactly

rotund ravine
#

Gl alex

tender shard
#

for example what even is your question?

#

whether you can use that as complete pom? no

tender shard
upper hazel
tender shard
#

you only need the maven-shade-plugin if you want to shade any dependencies. and even if you do, you would want to use a more up-2-date version instead of maven-shade 3.2.4

upper hazel
#

but maven created through bukkit configuration and through the regular one are different

tender shard
#

yes, it includes some useless stuff

#

as said

upper hazel
tender shard
#

you're sending 3 things at once

  1. the maven-compiler-plugin - you need that to change the java version. You currently set it to 10, which is pretty weird. You normally either use 8 or 17
  2. the shade plugin - as said, only needed when you wanna shade dependencies. You also have set "createDependencyReducedPom" to false, which is very bad. And 3.2.4 is hella outdated
  3. resource filtering - usually you want to keep that
#

and I bet that your MC Dev plugin has not properly added the <parent> section to your pom

upper hazel
#

I didn't change anything there

#

but apparently, as I understand it, some people like to create a template for the plugin manually

#

in any case, I think all these lines are not needed

tender shard
tender shard
#

and I also bet that the mc dev plugin broke your pom by getting rid of the <parent> section

native ruin
#

Would it be practical to convert pdc into a class to edit it and then push it back in or edit it all one at a time?

tender shard
#

would be so much easier if you simply followed my blog post

tender shard
upper hazel
tender shard
native ruin
tender shard
#

what exactly do you want to convert to a class?

#

I don#t really understand what you're trying to do

native ruin
#

map the pdc to a class so i can do var + 1 instead of getpdc().get(new namespacekey(plugin, key),int) + 1

tender shard
#

ofc you could do that, but I don't think it matters. the PDC not much different to a HashMap kept in memory

native ruin
#

so it would just be a waste of resources?

tender shard
#

No, it‘d just be waste of time (premature optimization)

#

And you‘d have to remember to update the PDC itself

#

I would just use the PDC directly

raw sky
raw sky
upper hazel
#

as soon as I removed the dependency on org.apache.maven.plugins immediately sonarList complains about a vulnerability

#

" Provides transitive vulnerable dependency maven:com.google.code.gson:gson:2.8.0 CVE-2022-25647 7.5 Deserialization of Untrusted Data vulnerability Results powered by Checkmarx(c) ' for example

tribal quarry
#

Hello, does anyone knows how to create firework charges (item) with color? in bukkit? Whats the best way to do it in bukkit? should I create them using the damage value? (1.8)

valid basin
#

How to execute spigot command from bungeecord?

#

ik how to execute bungeecord command from spigot

#

but how to do vice versa

inner mulch
valid burrow
#

ye

valid burrow
valid basin
valid basin
inner mulch
#

Yes, spigot can interact with bungee but bungee not with spigot