#help-development

1 messages · Page 461 of 1

terse cargo
#

Does bungeecord permissions read [ .* ]

ivory sleet
#

thats a feature right

#

so its hard to define that as a performance footrpint

#

yeah I saw

#

I was gonna ask the others if we do those commands for 3rd party libraries specifically

young knoll
#

Is that English

eternal oxide
#

almost

#

Stroke?

young knoll
#

Rip conclure

ivory sleet
#

was my sentence that incomprehensible?

#

;-;

eternal oxide
#

lol very

young knoll
#

I mean even corrected I lack context so maybe that’s it

#

Idk what third party libraries and commands are being referenced

ivory sleet
#

that was to morice

eternal oxide
#

I assumed as context was missing

ivory sleet
#

?pdc

ivory sleet
#

^this1

undone axleBOT
young knoll
#

Ah

eternal oxide
#

?nms

eternal oxide
#

not a lib though

young knoll
#

Just stuff it all in spigot

#

Make the jar huge

rough ibex
#

<scope>compile</scope>

weak meteor
#

Simple-YAML is beautiful

#

Bukkit config but for any file 🥲

#

My lifesaver

young knoll
#

What

#

Bukkit already lets you use arbitrary files with its yaml api

weak meteor
#

didnt know that

#

btw its the same lol

young knoll
#

YamlConfiguration.loadConfiguration

#

:p

weak meteor
young knoll
#

So it’s SnakeYaml

#

But with whatever added features

ember comet
#

Im trying to make a plugin that listens for an packet sent by a modded client, the packet ID is dark_list:packet, I am trying to use protocollib but I cant seem to get it into my build environment

fluid river
#

pomxml

ember comet
#

Yes, it has been added to my build.gradle as shown in the repo, and I have reloaded gradle to get the deps

ember comet
fluid river
#

oh

#

gradle

ember comet
#

at this point this plugin is meant to be simple

young knoll
#

Does the server even receive modded packets

ember comet
#

get packet from player
if packet contains data server dont like (blacklisting mods), kick player and tell why

ember comet
#

thats the plan atleast

young knoll
#

The custom payload packet?

ember comet
#

ye

young knoll
#

You don’t event need plib for that

ember comet
#

teach me thine ways

#

this is my first plugin

#

the mod side was also made by me

#

I can send the link to the mod if you want to see how it works? it has server and client logic in it

young knoll
#

I’m pretty sure you can use

#

?pmc

young knoll
#

That’s specially for bungee but you should be able to listen to any

#

I believe

ember comet
#

Will this work with Paper/purpur servers as well?

young knoll
#

It should

#

I’m fairly sure that can listen to external channels, if not then yeah protocollib is the best bet

true perch
#

After updating my plugin from 1.12.2 to 1.19.4 I am getting this error: class file has wrong version 61.0, should be 55.0. How can I change a file version to 55.0?

chrome beacon
#

The pmc should work fine

ember comet
#

are there any official "hello world" plugin examples?

chrome beacon
#

It uses the pmc

ember comet
#

I cant look at heavy code for starting out

#

Still mostly new to java and the extra information overwhelms me as I cant figure out what I need to keep the code running

young knoll
#

Not sure much else actually communicates with client mods

#

It’s a fairly niche functionality

ember comet
#

It has much more than I expect

true perch
young knoll
#

I’ve done it but only from server to client

young knoll
true perch
young knoll
#

I believe it’s just 11

true perch
#
[ERROR] /D:/Server Stuffs/_LOCAL SERVERS/.7 Realms/Plugin Source/src/main/java/me/combatborn/realms/mechanics/realmitem/RealmItemManager.java:[6,33] cannot access org.bukkit.inventory.meta.ItemMeta
  bad class file: C:\Users\Hunti & Hopi\.m2\repository\io\papermc\paper\paper-api\1.19.4-R0.1-SNAPSHOT\paper-api-1.19.4-R0.1-SNAPSHOT.jar(/org/bukkit/inventory/meta/ItemMeta.class)
    class file has wrong version 61.0, should be 55.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.```
chrome beacon
#

They stopped using 1. In Java 9 and above

ember comet
#

Okay I just reset my workspace from scratch and now how do I setup the main.java? the thing I was using before was an plugin template that had excessive integrations and an structure I had difficulty following

young knoll
true perch
#

It worked!

true perch
ember comet
#

aight what am I doing wrong?

young knoll
#

What’s the issue

ember comet
#

I dont think its outputting an plugin jar properly

young knoll
#

should be in build/libs

hazy parrot
#

Your main class is wrong

ember comet
ember comet
hazy parrot
#

Main class in your plugin yml is wrong

ember comet
#

How is it wrong?

jagged monolith
#

You typed it in wrong

ember comet
#

oh, i typed plugin not spigot

jagged monolith
#
  1. Your not extending from JavaPlugin either.
  2. Main is a bad name for your main plugins class.
#

?main

ember comet
#

okay that one is fair

#

refractored to DarkListMain

echo basalt
#

DarkListPlugin

#

is much better

ember comet
#

Hmm. Fair

#

now I build and test?

remote swallow
#

yeah

ember comet
#

Eyy! thanks, now to look into handling custom packet channel

#

okay could someone point me in a direction?

#

of documentation

chrome beacon
#

?pmc

chrome beacon
#

?jd-s

undone axleBOT
young knoll
#

There’s not a ton on it

#

Sadly

ember comet
#

Is fine, I know the exact structure of the packet my mod is sending anyways

#

basically, just sends an table hashmap of String:String

#

modid:version as reported by the modloader

#

server can then specify in config an list of modids to not allow

#

and kick player

#

so basically, just gotta get that custom packet incoming on player login, then kick them if they dont have an authorized mod

young knoll
#

Maybe

jagged monolith
#

Nope

#

Not a single person

regal scaffold
#

Is there a way I can make a aSyncChatEvent from a command

#

Like, have a command toggle a aSyncChatEvent like if the player sent a message himself

young knoll
#

What

regal scaffold
#

Can I create a new AsyncChatEvent from a command, like

/message <This is a message>

Will trigger aSyncChatEvent

young knoll
#

You can manually fire an event, yes

desert loom
#

and it makes the player chat

#

if that's what you're looking for

regal scaffold
#

oooooooo

young knoll
#

Yes that will fire the event

regal scaffold
#

Yes yes

#

Exactly that

young knoll
#

But it will likely be sync

regal scaffold
#

Fantastic

#

uh

#

That's no bueno

desert loom
#

It will be ran sync.

regal scaffold
#

🖤

desert loom
#

If a player is the direct cause of this event by an incoming packet, this event will be asynchronous. If a plugin triggers this event by compelling a player to chat, this event will be synchronous.

young knoll
#

You can check if it’s sync with Event.isAsync

regal scaffold
#

Fair

#

Yeah I can get around it

young knoll
#

isAsynchronous? One of those

regal scaffold
#

Thanks guys

fluid river
young knoll
#

?learnspigotplugindevelopment

#

Shame

fluid river
#

Choco

#

ask md_5 to add ?freejavalessons command

#

which points to my profile

remote swallow
#

you might need to ping him for that

#

also just ask imagine

young knoll
#

You need to bribe him

desert loom
#

Bribe with free java lessons

young knoll
#

Idk I think MD knows java

ember comet
#

By doing the project

weak meteor
#

??

echo basalt
#

minecraft doing funky logic

jagged monolith
weak meteor
#

like, it always worked like that

#

idk whats happening

jagged monolith
#

What does java --version show in the terminal

weak meteor
jagged monolith
#

Make sure the project in the IDE is set to the right jdk and language level etc..

jagged monolith
#

What's that bit set to

weak meteor
#

oh

#

it worked

#

i was using intellij

acoustic gorge
#

Is there some reason why my new command is able to be run in game by /pluginname:<command>

stable dawn
#

Is it possible to change the default minecraft experience curve values?

Some classes/methods to do so / look into would be much appreciated

weak meteor
#

this looks good?

jagged monolith
acoustic gorge
#

Is there a way for me to hide that plugin side or will I have to handle that using a separate permissions plugin

jagged monolith
ember comet
#

I have zero clue what I am droing wrong. I am referencing Vivecrafts plugin for how the code is implemented and its the same format, differnt logic internally but the frame is the same

weak meteor
ember comet
#

Why is it giving the red squigly!?

weak meteor
#

delete "this"

#

i think its that

young knoll
ember comet
#

ah

#

will try this...

#

also what is the proper way to log to the console?

weak meteor
#

Bukkit.getLogger

ember comet
#

this is how I am lol

weak meteor
#

dont use that

#

please

#

use Bukkit.getLogger

ember comet
#

I just made every plugin dev here cringe HARD didnt I?

acoustic gorge
young knoll
#

You can disable all of those with a server setting iirc

#

But not individually

#

And for good reason, plugins may register commands with the same name

acoustic gorge
#

but then they can't use the /<command>

#

guess I'll just have to live with it 🙂

weak meteor
#

Just discovered Bukkit.getLogger and my life got better

ember comet
#

There is no getLogger

young knoll
#

Don’t use Bukkit.getLogger either

ember comet
weak meteor
#

what

ember comet
#

then what do I use

young knoll
#

Your plugin has a logger, use that

weak meteor
#

Yes then that

ember comet
#

I was making my own from scratch!?

young knoll
#

Mhm

ember comet
#

confused

weak meteor
#

private Logger log = Logger.getLogger("Minecraft");

#

this

young knoll
#

-_-

weak meteor
#

No?

quaint mantle
#

Lmao

weak meteor
#

Ive seen too many people using that one

young knoll
#

Gonna have an aneurism

quaint mantle
#

Just use plugin.getLogger();

weak meteor
#

then what coll

ember comet
#

Wat

weak meteor
#

this.getLogger if ur in main

ember comet
#

I am seeing multiple different ways people are saying to do logs?

weak meteor
young knoll
weak meteor
#

[21:53:40 ERROR]: Could not load 'plugins\TenguCore-1.0.jar' in folder 'plugins': uses the space-character (0x20) in its name

#

wwaaht

young knoll
#

Ur plugin.yml

#

Has a space in the name

weak meteor
#

yes

#

i was going to say

#

nvm

#

resolved

young knoll
#

You cannot do that

weak meteor
#

maybe a confussion creating the plugin

#

lol

#

yeee

#

i love spigot

#

especially their errors

ember comet
acoustic gorge
#

Wait are you able to create an alias for the long plugin name so instead of having to type /pluginname:<command> it'll show up as /command

weak meteor
quaint mantle
ember comet
#

like, how do I get PacketHandler, to be able to use the logger

quaint mantle
#

or inject to the class

young knoll
ember comet
weak meteor
weak meteor
undone axleBOT
weak meteor
#

its easy to solve

remote swallow
#

i can show you an example if you need

ember comet
#

I get to this point

acoustic gorge
weak meteor
#

you cant make static a plugin

#

look

remote swallow
#

you can make an instance static

acoustic gorge
#

so I was curious if i can turn the original into an alias

ember comet
#

I want to slam my face through my desk,

young knoll
#

You want to hide the original

weak meteor
young knoll
#

But not the namespaced version

weak meteor
#

lets say this is your class

acoustic gorge
#

yes hide /pluginname:command and not /command

young knoll
#

Oh

acoustic gorge
#

because the first one looks and feels ugly to type

young knoll
#

So you want to hide the namespaced one

weak meteor
#

top left Code > Generate

young knoll
#

So? You don’t have to use it

jagged monolith
ember comet
weak meteor
#

this intellij

acoustic gorge
#

It shows up on the list of commands is what i mean

weak meteor
#

is just a new UI

weak meteor
acoustic gorge
#

I know i don't have to type it but I'd prefer to hide it so if you look at the list of commands itll just show the /command

young knoll
#

I guess if it’s a private plugin that’s fine

#

You can probably remove it with the PlayerCommandSendEvent

quaint mantle
#

@ember comet Just leave static logger null. Then from onEnable() method set it to your plugin's logger instance

weak meteor
#

i have this code, how should i values to it? I know with the config.yml file is just write in the IDE and saveDefaultConfig, but here idk what to do.

acoustic gorge
#

Hmm I'll try it out thank you

weak meteor
#

Bro NazarXeXe is writting too much

#

💀

quaint mantle
#

@ember comet

public class PluginExample extends JavaPlugin {
  public static Logger logger;

  @Override
  public void onEnable() {
    logger = this.getLogger();

    Test test = new Test();
    test.sayHi() // [PluginExample] hi
  }
  
  // Another class
  public static class Test() {
    
    public void sayHi() {
      PluginExample.logger.info("hi");
    } 
   
  }
}
remote swallow
#

you shouldnt really be extending plugin base

quaint mantle
#

public static like global variable

remote swallow
#

you should extending javaplugin

ember comet
#

WELL YOU GOT A BETTER IDEA?!

#

I have been presented so many different ways

#

people keep saying one way is better than another

quaint mantle
#

Sorry I've coding on nukkit

ember comet
#

I am new to java, yall are way more experienced than I. traditional guides do not work for me because of my ADD/Autism, And the worst part? i actually have to state that usually because no one believes me

#

I barely know what I am doing, github copilot is helping but Im still doing the code work

remote swallow
#

the best bet you have it just seeing what you get given and seeing what works, slowly the traditional guides start to make sense more and more untill you can just scan through them and figure it out

weak meteor
#

You can watch KodySimpson to start

#

Its a good way to start and have some bases.

ember comet
#

the main issue is java is an new language to me for the most part

#

I dont have the reference of the "frame" the language has,

weak meteor
remote swallow
#

oh i had no idea how to even code java before i jumped in the deep end

weak meteor
#

BroCode is a good youtuber to understand java.

#

Also, there is chatgpt, he will explain the basics

#

Such as constructor and stuff

remote swallow
#

chatgpt is so good for the stuff i cannot be arsed to google

weak meteor
#

Reading the Spigot Forums is also good, not only for errors

#

By a hobby

#

i like reading the forums

remote swallow
weak meteor
#

chatgpt isnt too smart ig

remote swallow
weak meteor
#

it doesnt work like i thought?

ember comet
#

Honestly, yall so far are way better than the GoLang discord, I was effectively getting looked down upon for asking questions and kept getting directed with teh XY Problem or to the Go Tour which didnt teach me shit, because it was giving me already completed puzzles or small peices with no understanding of how the peices fit

weak meteor
#

gpt said me this, i guess its good:

remote swallow
ember comet
#

Now we see if the server gets the packet the client sends

quaint mantle
remote swallow
#

so you can either handle adding data in the class you want to save stuff or you make general methods for it

weak meteor
#

What does YamlConfigurationOptions do?

ember comet
#

Quilt/Fabric have an thing where it can check if the client "understands" the packet

#

does Spigot have such a thing?

weak meteor
ember comet
#

damnit

ember comet
#

wait

young knoll
#

You don’t really need to worry about YamlConfigurationOptions

ember comet
#

Let me rebuilt to make sure

desert loom
#

It says right there at the top

young knoll
#

Looks like it’s mostly for changing the formatting

weak meteor
#

ig this is all i need

young knoll
#

Use set

weak meteor
#

Thanks

#

But why?

ember comet
#

Server does not appear to be getting the packet the client is sending on login

remote swallow
#

addDefault wont actually add it to the config

echo basalt
#

ehh

young knoll
#

addDefault is for default values which the user can’t change

remote swallow
#

untill like next restart

echo basalt
#

save every time you do something

#

bleh

#

are you really trying to make a yml-based database

young knoll
#

Heh

weak meteor
#

just a list and a boolean

#

lol

#

i just put DB because i wanna look specific

#

idk

#

lemme be happy

echo basalt
#

no

echo basalt
#

if you're gonna do it

#

do it right

ember comet
#

can someone help me with the packet thing? the packet is coming on client login

weak meteor
#

reclaim.yml?

remote swallow
#

what was the event again coll

echo basalt
#

the file name doesn't matter

weak meteor
#

oh

young knoll
weak meteor
#

no im not messing with online db

#

lemme be happy

echo basalt
#

I know stfu

remote swallow
#

no find

remote swallow
#

oh you know what i did

#

cloned maseter

#

ill test it tomrrow

echo basalt
#

okay here

young knoll
#

Nice job

echo basalt
#

so

#

Your data class

#

contains... data

weak meteor
remote swallow
#

im going to play shapez game

echo basalt
#

You'll want to have a serializer

#

that loads and saves to that data class

#

I haven't done anything basic lately so I don't have any examples fuck

#

yeah there

#

You can make a constructor that takes in a ConfigurationSection

#

and just reads off of it

#

Then a manager that goes over all the sections and creates new objects through that constructor

ember comet
#

I am in pain

#

I dont know why this no work

echo basalt
#

like we do here

#

You can then make a save(ConfigurationSection section) method that saves back the data to the section

#

and call such save method from the same manager onDisable or on a repeating task

echo basalt
ember comet
#

I am learning but this shit no work

#

Maybe im trying to listen for the packet at the wrong time? Shouldnt there be a way for spigot to listen for an packet sent during login/connection?

remote swallow
#

imagine actually learning java

#

i just annoyed @young knoll alot

echo basalt
#

you can but it's a bitch

#

I'd recommend you just use ProtocolLib for this

#

So there are 2 types of plugin message packets

#

one is sent on handshake

ember comet
#

tried that, litterally could not get it to load in gradle

echo basalt
#

the other is sent on play

#

this is on handshake

#

This is on play

#

The idea here is that you can do a

#

<Mod> Hey, you up?
<Plugin> Yeah, I'm here
<Mod> vomits data

#

And if the response goes like

#

<Mod> Hey you up?
<Plugin> doesn't respond
<Mod> Okay then, I guess we're not communicating

ember comet
#

nah, the mod just
<Mod> opens the door
<Server> looks at Player handing over data
<Mod> Vomits on servers shoes

echo basalt
#

sure

ember comet
#

if you want to see the code

echo basalt
#

it can be as simple as

#

<Mod> AYO I OPENED THIS
<Server> Understood.
<Mod> barfs

#

Now keep in mind some clients might not have the mod

#

and some servers might not have the plugin

#

So you gotta handle both sides

#

And also handle invalid data and outdated mod versions

remote swallow
#

we should totally have a way for a mod to just kick a door down and vomit data at the server

echo basalt
#

Now, for bukkit

#

There was something like an IncomingPluginMessageListener from what I remember

ember comet
#

The mod, as its written serverside
Makes sure client knows the packet code (understood is teh variable used in code)
then does shit,

Clientside, on login send modlist

echo basalt
#

haven't worked with it in like 4 years

ember comet
#

If i could share my screen to you so you could see the code I would

echo basalt
#

it's 4:30am the last thing I want to do right now is see mod code

ember comet
#

the plugin code

#

the mod code is actually simple

echo basalt
#

or the plugin code

ember comet
#

lol

#

Eh I will work on this later

weak meteor
#

What i just found is gold i think.

young knoll
#

Material.GOLD_INGOT?

weak meteor
#

At least for me, i found a way to not hard write all the other files of configuration

#

Like it is with saveDefaultConfig();

#

But with any file

#

For me thats fucking gold.

young knoll
#

saveResource?

weak meteor
#

Tmrrw ill try

#

It is in kotlin

#

But i can traduce it

young knoll
#

saveResource is great

#

Copies a file from jar to plugin data folder

weak meteor
#

Bukkit lib?

weak meteor
young knoll
#

Yeah it’s part of JavaPlugin

weak meteor
#

Gotta try it

weak meteor
#

fun loadConfig(){
        if (!file.exists()) HCFPlugin.instance.saveResource(file.name, false)

this.reload()
    }

#

Well, from there i can start a little handler

#

For this config stuff

echo basalt
valid solstice
#

Hello, how do you guys test plugin that requires like more than 1 player? I only have one mc account

remote swallow
#

That is an acceptable time for offline mode

young knoll
#

Why do you need 2 launchers

remote swallow
#

To secure the mc against choco the children slayer

#

Alts

#

Offline mode

#

Friends

#

You can boot 2 mcs from one launcher

#

Get good

valid solstice
remote swallow
#

Also just dont use the official launcher

valid solstice
#

And if I get an offline launcher, do I need another pc

#

Or laptop

remote swallow
rough ibex
#

don't ever use tlauncher

valid solstice
#

Why?

rough ibex
#

it's outright not a good launcher

young knoll
#

You can definitely launch multiple instances from 1 launcher

valid solstice
young knoll
#

At least with the non-windows store one

rough ibex
#

except there's much better launchers

valid solstice
#

Lunar is not cracked though

#

U need another mc account for lunar

#

And it’s like 20 bucks for another account

#

The pain of development…😫

young knoll
#

There’s also tools for this

#

And unit testing with mockbukkit

wet breach
#

Didnt minidigger make a launcher.

#

Could use his

#

Pretty sure its on his github somewhere

weak meteor
#

@valid solstice use solar tweaks

#

It allows offline mode

quaint mantle
#

ive seen people make plugins that send msg in discord servers. Weebhooks or what ever. Anyone know how to make them?

lost matrix
wise mesa
quaint mantle
#

im able to code both individually but i have no clue how to let them do shi together

lost matrix
#

There are several ways of achieving that.
If i where to write something like this right now then i would use Redis.
Create a topic and let the spigot server publish and the discord bot subscribe.

quaint mantle
#

aight thx ill read into that a bit

lost matrix
#

RabbitMQ also works. Its a simple message broker.

#

But i would prefer Redis

quaint mantle
grizzled oasis
young knoll
#

You can also just embed the bot in the plugin

lost matrix
young knoll
#

If you want

grizzled oasis
lost matrix
#

Your calculation doesnt do anything. You can remove all of this and the
code does exactly the same thing

quaint mantle
grizzled oasis
lost matrix
quaint mantle
#

yh same

grizzled oasis
lost matrix
#

Hm, maybe Quartz is overkill. A simple polling strategy would also do.

young knoll
#

I mean, couldn’t you just calculate the time until the desired event and then start a schedular for that

#

Each time the server starts

grizzled oasis
quaint mantle
#

isnt there a way to simply request the current time each time the plugin start and then start a countdown?

young knoll
#

Yeah you have a bunch of them

#

Calendars and datetimes and whatnot

grizzled oasis
quaint mantle
#

@Override
public void onEnable() {
// Create a Timer instance
Timer timer = new Timer();

    // Create a Calendar instance and set the desired start time
    Calendar startTime = Calendar.getInstance();
    startTime.set(Calendar.HOUR_OF_DAY, 12); // 12:00 PM
    startTime.set(Calendar.MINUTE, 0);
    startTime.set(Calendar.SECOND, 0);
    startTime.set(Calendar.MILLISECOND, 0);

    // Schedule the task to run at the specified time
    timer.schedule(new MyTask(), startTime.getTime());
}


    @Override
    public void run() {

event here
}
}

#

this should work i suppose

grizzled oasis
quaint mantle
#

oh

hybrid spoke
#

what are you trying to do

grizzled oasis
quaint mantle
#

?

grizzled oasis
hybrid spoke
#

and what doesnt work

quaint mantle
#

thatswhat im saying it should work x)

#

import java.util.Calendar;
import java.util.Timer;
import java.util.TimerTask;

hybrid spoke
#

i mean making a scheduler which runs every 7 days will at some point probably skip a day

grizzled oasis
hybrid spoke
#

and you would have to start it at monday which sucks

hybrid spoke
#

once an hour or so

grizzled oasis
vocal cloud
#

Just run one every minute. If it's the correct day do the task then set a config flag to true or w/e. Then when it's not Monday set flag to false to allow it to run again

hybrid spoke
#

possible

grizzled oasis
#

ok, thanks

quaint mantle
#

if (currentDayOfWeek == Calendar.MONDAY) {
timer.schedule(new MyTask(), startTime.getTime());
} else {
// Otherwise, calculate the delay until the next Monday and schedule the task
int daysUntilMonday = (Calendar.SATURDAY - currentDayOfWeek + 2) % 7;
startTime.add(Calendar.DATE, daysUntilMonday);
timer.schedule(new MyTask(), startTime.getTime());

vocal cloud
#

Don't do that

hybrid spoke
#

why would you do that

quaint mantle
#

i dont know just found that on github

lost matrix
#

Usually you would poll like this:

#

Half the time to the target event

vocal cloud
#

Use a config with a simple bool and just check every minute. It will barely tax the CPU

lost matrix
#

Thats also how mc does it for halloween for example

hybrid spoke
#

just have a timestamp for the next monday midnight

vocal cloud
#

Idk I feel like a very simple once-a-minute task would work:
if(isMonday)
// Do task
// set run=true in config
else
//set run=false in config

quaint mantle
#

wouldnt it run it over and over again

#

nvm,

vocal cloud
#

If you're worried about it running to0 much you can just do what smile recommended and just poll it

grizzled oasis
wise mesa
#

Is there an api for using loot tables

quaint mantle
#

Whats loot tables

#

oki

wise mesa
#

Idk why I asked that it was a 10 second google

#

I’m making a whole custom blocks system and the blocks gotta drop when you break them 😅😅

young knoll
#

You can access the vanilla structure loot tables

#

I don’t know about block and entities

#

There is no api to make your own tables

quaint mantle
young knoll
#

Nice

quaint mantle
#

if you mean what i think you mean

young knoll
#

Yeah it seems you can get and set the loot table of entities and containers

#

Blocks have getDrops

#

So you’re good there

quaint mantle
#

i would probally do it with a mod instead of a plugin then tho

#

yes and yes

#

swords would probally be very laggy and ugly tho

#

you could make invis armorstand that holds it turned sideways

young knoll
#

Or a ItemDisplay in 1.19.4

quaint mantle
#

thats a preety common techniquq

#

im not sure but probally

young knoll
#

Tridents are easier since they are already an entity

quaint mantle
#

well if you wanna do swords that would probally be a bit complicated to code but definetly possinble

#

tridands even easier if you use the baisic follow thingy from vanilla

#

idk if that easily accessible tho

#

of topic anyone wanna play a game of val

#

no

#

my personal opinion. learning books are useless. theres enough free content on the internet.

#

and if you want to learn in professionally

#

book an actual curse

#

corse

#

i dont know how to spell

#

its 9 am

#

well imo the books teach you less then videos

#

thats probally the first steps of object oriented programming

#

thats the java mascot

opal juniper
#

why are you buying books

#

get the drive

#

no

quaint mantle
#

yo anyone know how to add license to plugins

tender shard
#

you just choose one and include the license file in your gh repo

quaint mantle
#

no i mean like

#

that

#

i can dissasable ones licensw and the plugin stops working

tender shard
#

you do a web request to your webserver or some github file. all you have on spigot is the %%__USER__%% placeholder which will be their spigot user id

#

people who leak your plugin will replace it with a random number everytime though. people can also easily change /etc/hosts to "blacklist" your domain etc

#

well you also have the %%__NONCE__%% but that changes on every download

quaint mantle
#

well what if i just check if the license is still valid every time the plugin starts

#

i have a license server from a friend i can use

tender shard
#

and what will you do if that server is not reachable?

quaint mantle
#

counts as license invalid

tender shard
#

because e.g. someone set it to 127.0.0.1 in /etc/hosts

#

then you violate spigotmc's premium resource rules and your plugin is going to get removed

quaint mantle
#

im not planing on putting it on spigot mc

tender shard
#

then you are free to do that

#

however expect people to be very upset if their purchased plugin stops working just because your webserver is down

quaint mantle
#

some dude whats me to code him something and he wants to pay later but i dont want to get scammed uk

tender shard
#

ah ok. I usually use allatori to set an expiry date to the .jar file

quaint mantle
tender shard
#

ofc they could just change the server's date/time, but in times of letsencrypt, where SSL licenses are only valid for 3 months, all shit's going to break in at least 3 months

quaint mantle
#

aught thanksu

paper venture
#

Hello I'm trying to reset my worlds asynchronously by creating BukkitRunnable async task:

#

But there is an error: WorldInitEvent cannot be triggered asynchronously from another thread.

jovial vigil
#

Is there anything where I can instantly start coding and not setting up all the stuff to make a plugin?

paper venture
deep dagger
#

I want to Start my Minecraft Server, but when i join i Crash

tender shard
jovial vigil
paper venture
jovial vigil
#

Is it free?

tender shard
#

yes

paper venture
jovial vigil
#

And can I use community licenses to make plugins

rough drift
eternal oxide
#

If the worlds are identical or just regen you can template the world, delete it's ID, then just copy it to generate new worlds.

#

which can all be done async

rough drift
#

@supple parcel it doesn't seem as if you return here, why's that?

#

also, you're not caching the file names, well technically you are but you still loop over every file in the update folder

quaint goblet
#

Does anyone know how to make a piece of paper claim a rank?

rough drift
#

you should generate the names once on startup

supple parcel
eternal oxide
quaint goblet
#

Idk how to do that

rough drift
#

It will still continue ahead with the new functionality

supple parcel
#

Yes

eternal oxide
undone axleBOT
quaint goblet
quaint goblet
supple parcel
#

It won't preserve the old functionality in that you can use duplicate plugin names

rough drift
#

So it always copies by plugin name?

#

Because that's what it looks like

supple parcel
#

It'll always overwrite the files with the same name, then it'll do the plugin names

quaint goblet
rough drift
eternal oxide
#

no, this channel is for plugin devs

quaint goblet
#

Kk

paper venture
eternal oxide
#

Youstill use worldcreator but the world is pre generated so its faster

paper venture
#

I have several worlds with index suffix, I copy from worlds folder and add suffix, then load it using WorldCreator

rough drift
#

@supple parcel Added comments

supple parcel
#

Picture this weirdo server owner, he likes to run two gamemodes on his server. Lets call it SurvivalGames.jar and Parkour.jar
In his plugin directory, he has one file called Games.jar
Currently, Games.jar is running Parkour.
He puts SurvivalGames.jar in the plugin directory, he also puts SurvivalGames.jar in there as well but names it Games.jar

Now when he starts the server, he notices that first Games.jar is copied from the update directory, and deleted.
Then SurvivalGames.jar is copied and deleted

paper venture
eternal oxide
#

They will still run but they will be MUCH quicker if the world is already generated

quaint goblet
#

Im currently using a plugin to make ranks claimable, What is the luckperms command to give the player a rank?

paper venture
eternal oxide
#

yes

#

create a world, fully load it, then shut down the server.
delete teh UID.dat and copy the whole folder to a backup location.

#

you never load that backup, just copy it to wherever you want a new wold then load the copy

paper venture
#

So worlds without UID.dat are loaded faster right

weak kayak
eternal oxide
#

if you keep the ID you can't use multiple copies

#

teh ID identifies the world

#

if you delete teh ID it generates a random one when loaded

paper venture
#

In my backup folder all ids are deleted, when I want to reset my worlds I unload them, copy from my backup folder and then load again

eternal oxide
#

Thats how you are currently doing it?

paper venture
#

Yes

eternal oxide
#

then so long as each backup is fully generated (spawn) it's loading as fat as you can, other then configuring the world to not keep spawn in memory

paper venture
#

So I just need to do world.setKeepSpawnInMemory(false) after I loaded this world?

eternal oxide
#

you do it on the backup before you store it

jovial vigil
#

Can I do plugins with the "Licence for evulation purpose only" IntelJ?

paper venture
#

Understood, thanks!!

eternal oxide
#

so after you copy/load it doesn;t keep it in memory

supple parcel
eternal oxide
#

don;t mess with the days time using a scheduler

#

all you have to do is add a gamerule

rough drift
#

use the game rule DO_DAYLIGHT_CYCLE or what is it called

jovial vigil
#

?img

undone axleBOT
jovial vigil
#

Do I put my code in the plugin.yml?

rough drift
jovial vigil
#

I just paste it?

#

?img

undone axleBOT
jovial vigil
#

or delete it?

#

and how do I get the .jar file

rough drift
tender shard
#

why the heck is your main class called spawnerplugin.spawnerplugin.Spawnerplugin lol

#

for weather there's the gamerule doWeatherCycle

pseudo hazel
#

weather and time of day separate

rough drift
#

If disable the weather cycle, and set the time to 0, it will be perma day with no rain

tender shard
#

unfortunate

#

idk, I never used such an old version

rough drift
#

^

#

?1.8

undone axleBOT
tender shard
#

weather cycle was added in 1.11

sacred mountain
#

rate my debugging skills

pseudo hazel
#

10/10

rough drift
pseudo hazel
#

would print again

jovial vigil
#

?img

undone axleBOT
rough drift
#

So you're better than me frfr

#

I rate your debugging skills a System.out/println

jovial vigil
tender shard
#

you can listen to WeatherCHangeEvent and cancel it if the new weather is rain

#

that's even available in 1.8

pseudo hazel
sacred mountain
#

yesssi fnially working

pseudo hazel
#

you can delete it if you want, but youll need to add it back for any initialization anyways

sacred mountain
#

i can shoot my friends

#

lets gooo

rough drift
#

@jovial vigil It was fun and all but

#

?learnjava

undone axleBOT
sacred mountain
#

is it laggy to have a raytrace of over 100 metres

#

in an fps sort aplugin

supple parcel
#

It depends on what you're doing for a raytrace, and how often

tawny pine
#

Hey guys, I'm using this code to replace a crossbow with a loaded crossbow, and a loaded crossbow with a crossbow on left click:
if(player.getInventory().getItemInHand().getType() == Material.CROSSBOW){ if(event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK) { ItemStack loadedCrossbow = new ItemStack(Material.CROSSBOW, 1); CrossbowMeta meta = (CrossbowMeta) loadedCrossbow.getItemMeta(); meta.addChargedProjectile(new ItemStack(Material.ARROW, 1)); loadedCrossbow.setItemMeta(meta); if(player.getInventory().getItemInHand().equals(loadedCrossbow)) { player.getInventory().setItemInHand(new ItemStack(Material.CROSSBOW, 1)); } else { player.getInventory().setItemInHand(loadedCrossbow); } } }
It works well, but instead of doing this I want to just change the metadata state of the crossbow instead of replacing the item itself.
When I try this I get errors, and I am told it is because I am trying to cast class to object, or object to class.
What is wrong there and how would I go about fixing it?

supple parcel
#

Lets assume you're starting at Location1 and ending at Location2, a vector with a multiple of 0.2
Honestly I'm not really sure, it highly depends here on how fast you can fetch a world's block at XYZ cords.
And you'd want to definitely cache stuff.

I thikn there's also raytracing in the nms, but I'm not going there

tender shard
tawny pine
tender shard
#
    @EventHandler
    public void chargeCrossbowOnLeftClick(PlayerInteractEvent event) {
        if(event.getAction() != Action.LEFT_CLICK_AIR && event.getAction() != Action.LEFT_CLICK_BLOCK) {
            return;
        }
        ItemStack itemInHand = event.getItem();
        if(itemInHand == null || itemInHand.getType() != Material.CROSSBOW) return;
        CrossbowMeta meta = (CrossbowMeta) itemInHand.getItemMeta();
        meta.addChargedProjectile(new ItemStack(Material.ARROW));
        itemInHand.setItemMeta(meta);
    }
#

You said that it was because I was trying to cast a class to an object or something?
it's because you haven't understood the difference between classes (ItemMeta, e.g.) and instances of that class (e.g. ItemMeta myMeta)

tawny pine
tender shard
#

no

tawny pine
#

ok

tender shard
#

a class is e.g. Human
an instance of that class is e.g. mfnalex

#

you can do mfnalex.setHealth(...) but you cannot just do Human.setHealth(...) because - how is java supposed to know WHICH human you mean

tawny pine
#

OHHHH ok

#

I'll read through that link

#

tysm 🙂

tender shard
#

np

#

in your case, you cannot just do CrossbowMeta.addProjectile(...) because you have to call it on a SPECIFIC crossbowmeta - the one you get from myItemStack.getItemMeta()

tawny pine
#

yeah that kinda makes sense now ty 🙂

tender shard
#

np

quaint goblet
#

?paste

undone axleBOT
tardy delta
#

Interesting book

ivory sleet
#

Reflection proxy api?

#

Interesting they bring that up

round finch
#

Name of book?

eternal oxide
#

Is @tardy delta pretending he can read again?

ivory sleet
tardy delta
#

i didnt know people thought i cant read

ivory sleet
#

By whom?

eternal oxide
#

No pictures or pages to colour

round finch
#

Wait birds can read and code
We are all doomed

ivory sleet
#

Anyway fourteen you should read effective java whenever you get the chance to

#

And the design patterns book

#

Those 3 are very useful

tardy delta
#

its fairly limited but we are going to discuss them in college next year anyways

ivory sleet
#

Ye thats good also

#

I mean u have GitHubs for clean code also :>

tardy delta
#

probably

ivory sleet
#

Who wrote the clean code book you’re reading? Out of curiosity

tender shard
#

bookgpt

ivory sleet
tardy delta
#

Robert Cecil Martin

ivory sleet
#

A thats the right one

#

Good

tender shard
#

13mb on rapidgator

#

what

tardy delta
#

vsc very useful

#

feels like eclipse

fluid river
#

#include <vector> dumb

tardy delta
#

figured that out yes

#

qualified name is not allowed smh

#

i wanted to do smth with llvm but i better learn some more c++ 🥲

opal juniper
tardy delta
#

shouldve put a laughing emoji behind it

nocturne steppe
#

Does anyone know why StructureManager not work with any .nbt files for structures?

eternal oxide
#

errors?

rotund ravine
#

?jd-s

undone axleBOT
rotund ravine
#

How are you doing it

#

What are you doing

#

What are you saving

#

How are you saving

nocturne steppe
#

sorry am back discord was being stupid

eternal oxide
#

I'm fairly certain I know his issue but until he shows an error

nocturne steppe
#
java.lang.RuntimeException: java.util.zip.ZipException: Not in GZIP format
    at me.viciscat.mineralcontest.MineralContest.onEnable(MineralContest.java:32) ~[mineral-contest-1.0-SNAPSHOT-shaded.jar:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:279) ~[paper-api-1.19.4-R0.1-SNAPSHOT.jar:?]
    at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:192) ~[paper-1.19.4.jar:git-Paper-477]
    at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.19.4.jar:git-Paper-477]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.19.4-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugin(CraftServer.java:555) ~[paper-1.19.4.jar:git-Paper-477]
    at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugins(CraftServer.java:466) ~[paper-1.19.4.jar:git-Paper-477]
    at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:638) ~[paper-1.19.4.jar:git-Paper-477]
    at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:437) ~[paper-1.19.4.jar:git-Paper-477]
    at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[paper-1.19.4.jar:git-Paper-477]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1104) ~[paper-1.19.4.jar:git-Paper-477]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[paper-1.19.4.jar:git-Paper-477]
#
Caused by: java.util.zip.ZipException: Not in GZIP format
    at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:165) ~[?:?]
    at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:79) ~[?:?]
    at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:91) ~[?:?]
    at net.minecraft.nbt.NbtIo.createDecompressorStream(NbtIo.java:49) ~[?:?]
    at net.minecraft.nbt.NbtIo.readCompressed(NbtIo.java:53) ~[?:?]
    at net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager.readStructure(StructureTemplateManager.java:231) ~[paper-1.19.4.jar:git-Paper-477]
    at org.bukkit.craftbukkit.v1_19_R3.structure.CraftStructureManager.loadStructure(CraftStructureManager.java:145) ~[paper-1.19.4.jar:git-Paper-477]
    at me.viciscat.mineralcontest.MineralContest.onEnable(MineralContest.java:26) ~[mineral-contest-1.0-SNAPSHOT-shaded.jar:?]
    ... 12 more
eternal oxide
#

yep

#

You packaged the nbt file into your jar while filtering true on resources

nocturne steppe
#

a

#

where's filtering setting

eternal oxide
#

in your pom

#

the section that packages your resources

nocturne steppe
#

found it

#

what does filtering do?

eternal oxide
#

filtering is when you want to replace values in your files, like version etc in plugin.yml

#

But, it results in every file in resources to be opened and searched before packaging.

#

This corrupts zip file formatting

nocturne steppe
#

a ok

#

let me test le plugin

tall dragon
tall dragon
#

not sure tbh

fluid river
#

i can helb

eternal oxide
#

If you need filtering add an exclusion/inclusion to it so you only process the files you want

nocturne steppe
#

😐
same error

eternal oxide
#

?paste your pom

undone axleBOT
tardy delta
fluid river
#

i studied for 2 years

#

😉

tardy delta
#

dang

fluid river
#

in a university

eternal oxide
#

looks fine, you probably need to clean package

nocturne steppe
#

how do you do that?

eternal oxide
#

what IDE?

nocturne steppe
#

intellij IDEA

eternal oxide
#

in maven window, lifecycles, double click clean

tardy delta
#

just hit ctrl twice and type mvn clean package

eternal oxide
#

then package

fluid river
#

ayo guys

#

any noob plugin idea?

#

simple but not useless

tardy delta
#

smth with easter eggs

fluid river
#

hmm why not

#

now what to do with easter eggs

tardy delta
#

no clue actually

#

🤔

eternal oxide
fluid river
#

admin can place

#

player can collect

#

and that's all lol

#

some cool message

nocturne steppe
#

also i take shaded jar, should i not be doing that?
anyways now my error changed but that's just me being bad at coding
thanks for the help ❤️

fluid river
#

and counter of eggs

tall dragon
fluid river
#

?

tall dragon
#

playing yt video on a screen of color changing sheeps

#

xD

tardy delta
#

smells like a teletubbie

fluid river
#

oof

tardy delta
#

or however you write that

nocturne steppe
#

should i clean everytime before i package or just every now and then?

tall dragon
#

xD

eternal oxide
#

clean removes old build files so you don't get left over data from previous builds

nocturne steppe
tall dragon
#

shading = including libraries in your final jar

eternal oxide
#

shaded includes any dependencies you set to be included (shaded) into your jar

green prism
#

ElgarL

#

Sorry to bother you, just a quick question. What IDE do you use?

eternal oxide
#

Eclipse

fossil wraith
tardy delta
#

hehe

green prism
nocturne steppe
nocturne steppe
eternal oxide
fossil wraith
tall dragon
#

if ur shading libaries that you require, yes u should use the shaded jar

fossil wraith
#

why don'tya use Intellij XD

tall dragon
#

else there is also no point in shading

eternal oxide
#

You currently have nothing shaded

wet breach
green prism
#

Was thinking about changing ide

eternal oxide
tall dragon
fossil wraith
wet breach
tardy delta
#

it runs fine for me

#

only had it lagging when using gradle

green prism
green prism
wet breach
#

Md and myself use netbeans

tall dragon
fossil wraith
green prism
#

gonna try with 8192

tall dragon
#

maybe it need even more 😄

green prism
#

wtf

fossil wraith
green prism
#

intellij is heavy af

tardy delta
#

then you have alex who gives it 32 gigs

fossil wraith
#

it'll be better if udon't use snippest hahaha

#

but that only happens when i was writing spigot but not fabric haha

green prism
#

What should I do more?!!?

tardy delta
#

what cpu?

#

takes 6% for me lol

fluid river
wet breach
eternal oxide
#

I have multiple installs

fluid river
#

i just upgraded to 2023-03

eternal oxide
#

2020 is the older one

#

latest is 2022-06

fluid river
#

is 2020 even supported now

#

with extensions like YAML editor

eternal oxide
#

"supported"? It does what I want for those projects. No need to break it if it works

fluid river
#

ahem

#

jree

#

fava

#

lessons

tardy delta
#

gimme free c++ lessons

fluid river
#

call

#

1 min

tardy delta
#

can no call

fluid river
#

cool

#

dm then xD

tardy delta
#

no lessons then

#

o

young knoll
#

C++ is just java

fluid river
#

but also not java

young knoll
#

Just remember to write your own garbage collector

tardy delta
#

nah

fluid river
#

just switch to ~Class() instead of Object#finalize()

tardy delta
#

std::unique_ptr kek

fluid river
#

and start using header files for extension

#

and from static imports use namespaces

#

like

#import <ostream>
using namespace std;
int main() {
    cout << "";
}```
tardy delta
#

trying to figure out what thiis means

public:
        virtual ~ExprAST() = default;```
rough drift
#

damn

#

@fluid river bad at c++?

tardy delta
#

some kind of destructor

#

but whats the virtual and default

fluid river
rough drift
fluid river
#

who knows

fluid river
rough drift
#

iirc

lost matrix
rough drift
#

Haven't used C++ in a long while

tardy delta
#

and if you dont put virtual, you cannot overload it?

rough drift
#

yeah iirc

wet breach
rough drift
#

it removes the need for std::, but it also makes everything harder to read

fluid river
#

you can still overload(not override)

tardy delta
#

ik

wet breach
#

Default is to tell the compiler to independently generate the class function

tardy delta
#

uhh

#

what

wet breach
#

Its similar to using lombok in java

#

Only c++ has that kind of stuff natively

rough drift
#

yep

tardy delta
#

imma watch some yt vids ig

lost matrix
#

Do you have to use C++ or do you just want a low level language?

tardy delta
#

i just want to learn it

lost matrix
#

Rust is a better low level language all around in my opinion

tardy delta
#

what have you said

lost matrix
#

Writing C++ is a gross experience

wet breach
#

C++ isnt going away anytime soon

#

It is good to learn even if you wont really use it

tardy delta
#

i have tried rust but the syntax is weird sometimes, although there are some things i really like

#

like the enums

#

npe? ah cant read

lost matrix
#

Ive written C++ for about a year because i needed low level implementations
of neural networks. Hated it to the guts.

tardy delta
#

changing weather calls that event ig