#help-development

1 messages · Page 1231 of 1

fallow violet
#

now its working

#

HUH

blazing ocean
#

are you sure you even had it reloaded in thef irst place

fallow violet
#

yes i did it like 10 times with number changes and everything idk what i forgot

low field
#
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, () -> {
    torchFreezeTickers.stream()
            .map(Bukkit::getPlayer)
            .filter(Objects::nonNull)
            .forEach(
            p -> {
                ((CraftPlayer) p).getHandle().setIsInPowderSnow(true);
                p.setFreezeTicks(p.getFreezeTicks() + 1);
            }
    );
}, 0, 1);
tight compass
#

a

low field
#

remapped-obf

#

a

limber marten
#

Hey guys, what is the go to GUI API nowadays?

blazing ocean
#

?gui

blazing ocean
#

You could use actual incendo/interfaces but it's kinda dead

sacred marten
#

hey I have a question, if I want to rotate a player but change the rotation taking into account mouse movements, how do I do that?

player.setRotation or player.teleport doesnt allow movements

limber marten
#

last commit was 2 years ago nah? 🫡

blazing ocean
#

Yeaaa that's what I meant

#

Might still work, but probably better off with other ones

#

interfaces-kotlin is great tho

limber marten
#

Okayy, i'm checking the thread

limber marten
sacred marten
#

private void changePlayerLook(Player player) {
Random random = new Random();
boolean turnLeft = random.nextBoolean();
float currentYaw = player.getLocation().getYaw();
float currentPitch = player.getLocation().getPitch();
if (turnLeft) {
currentYaw -= 0.2f;
} else {
currentYaw += 0.2f;
}
currentPitch -= 0.3f;
player.setRotation(currentYaw, currentPitch);
}

thats my code but it blocks any mouse movements when setRotation is applied

#

is there any better alternative?

tight compass
#

any help?

remote swallow
fallow violet
#

Where can i modify the mining speed of an item?

slender elbow
#

modify the Tool component

tight compass
#

aaa

drowsy helm
#

you're looking for ServerPlayer

blazing ocean
wraith delta
#

This new for 1.21.4? It shows on all my custom items even though they do not run commands. Is there a way to hide it with code? I have HIDE_ATTRIBUTES

young knoll
#

It’s an ops only thing iirc

tight compass
wraith delta
tight compass
fallow violet
#

Why does ItemMeta#getTool#getRules returns nothing for a Diamond pickaxe? Shouldn't there be some rules declaring how fast it breaks stone and etc?

young knoll
#

Not by default

#

The default stuff is baked into the pickaxe

slender elbow
#

ah yes, the totally flexible and not flawed ItemMeta system

young knoll
#

I blame Mojang

#

It’s like default attributes

blazing ocean
slender elbow
#

i blame the way ItemMeta works

#

the way the data components map works takes this stuff into account, but itemmeta works solely and entirely, by design, on the patch layer, without considering the whole component map

tight compass
#

Howcome I can't get my IDe to recognize ServerPlayer?

#

Do I need to rerun buildtools?

remote swallow
#

you dont have the remapped-mojang classifier

tight compass
#

where in my pom.xml?

#

OHHH

#

You guys I might just be dumb

#

LOL

rustic ivy
#

How do u set up rescourse pack to autodownload with the accept/dont accept screen when u login to the server? anyone got any tips or tricks for me? ❤️

chrome beacon
#

Needs to be a direct link to the resourcepack zip

#

It's also recommended to provide the sha1 sum of it so the client knows that it downloaded things correctly

rustic ivy
#

Thanks so much ❤️

#

so would a google drive link work?

#

or something like that?

chrome beacon
rustic ivy
#

Aaah soz

#

sorry

chrome beacon
#

So like no buttons being pressed

rustic ivy
#

Ok ok Thank thanks 😄

fallow violet
#

Would it be possible to fake give an item to a player with NMS that has the id minecraft:emerald_sword for example and the client already has textures and models for it via a resource pack?

young knoll
#

Why do you need a custom item

#

Just use an existing item with custom model data/custom model

fallow violet
#

but it sucks

#

imagine seing emerald sword with the id of diamond sword

#

it just sucks

young knoll
#

Who looks at the id of items that often

fallow violet
#

nobody

#

but

#

would it be possible?

#

?nms

young knoll
#

Sure

#

If you unfreeze the registry, inject a custom item, and then have a client mod that recognizes that item

fallow violet
#

but do you need a mod for the client? Would be a ressource pack enough?

young knoll
#

No

fallow violet
#

damn it

young knoll
#

The client can’t recognize an item that doesn’t exist

fallow violet
#

does mjoang plan to add custom items like custom enchantments somehow? xd

young knoll
#

Doubt it

#

That’s what item components are for

slender elbow
#

one day there will only be one item, and all item types will just be variations with different item_model etc components

river oracle
#

I can't read

slim wigeon
#

Wow, someone is spamming #help-server . Anyway, I need help with creating custom enchantments

quaint mantle
#

hello

#

im looking for devs to work in my small mc server for free

#

any1?

slim wigeon
wet breach
quaint mantle
#

yes

#

ones that do it for fun or to train for real work

wet breach
#

except they want to exploit the term interns for their own personal benefit

quaint mantle
#

or ppl who want to work for us for fun

slim wigeon
#

But I don't know. What type of work you looking for? Plugins like EpicFarming and EpicHoppers. If you mean that. Wait, I don't know if I should trust this. You still looking @quaint mantle . Sorry, not getting a risk of legal trouble, that is why my code is not going to github

quaint mantle
#

sry im new to this kind of stuff

slim wigeon
#

To my help question, how can I get a custom enchantment working?

quaint mantle
#

taking an awfully lot of time to type there

livid tundra
slim wigeon
#

@quaint mantle You better purchasing plugins then trying to find devs. If you want to learn how to make plugins, I would recommend learning Java. There are tutorials out there on YouTube. Once you learned that, all you need to learn is the spigot api. I don't recommend this but most people is using paper since paper is more stable. But I think just learning one thing a time like I doing is a good move then to learn multiple apis at once

quaint mantle
#

90+

#

invluding bots

livid tundra
#

excluding bots and alts?

#

also, how many are active on avg?

quaint mantle
quaint mantle
#

tats why we need more content

slim wigeon
#

@wet breach How can I create a custom enchantment?

quaint mantle
#

we wanna do season 2 but my dev takes 10 yars

#

thats the server

slim wigeon
#

@quaint mantle Well, I cannot help you there. But if you want to learn how to make a plugin like this channel is for. I can give you sources to watch and learn from

slim wigeon
livid tundra
#

how many concurrent players did you have at peak?

quaint mantle
quaint mantle
wet breach
#

not sure if that is still relevant but hopefully it helps steer you in the right direction

livid tundra
#

hm

#

seems pretty interesting, but Im not sure I have enough time for doing smth like this

#

maybe I can do smth during the summer

quaint mantle
#

just a small plugin like a weapon that gives buffs or extra health and damage is fien for us

quaint mantle
#

1 plugin per week

#

and maybe a custom texture

livid tundra
#

I might be able to fit that into my schedule

#

I'm not that good at plugin dev tho

quaint mantle
#

its fine

livid tundra
#

good luck finding someone

quaint mantle
#

arent u joining?

#

@livid tundra

livid tundra
quaint mantle
#

bet

livid tundra
#

but I can't guarantee anything

quaint mantle
#

just give like 3 hours a week

#

thts enough for us

livid tundra
#

also this is the channel to get help about developing

#

not get help for develeloping lol

quaint mantle
#

oh ye

#

should go to general

livid tundra
#

ye

slim wigeon
wet breach
#

deprecated doesn't mean unusable

#

and you should be able to figure out from deprecations updated alternatives if one exists

slim wigeon
#

True but I don't want to used that because it might not be there on newer versions

wet breach
#

you will never make an update proof plugin unless its something like a command plugin that doesn't really do much

stoic rose
#

Does anyone know of a plug in that allows people to run some sort of /wardrobe command in the server and they are able to change, save, their skins while in the server?

mortal vortex
stoic rose
rough ibex
#

I don't think it's that difficult.

#

your hardest part may be just setting their skin correctly but the rest is simple

jagged thicket
#

or u can fork skinrestorer 💀

#

and add a limiter

#

but if you wanna learn make it from scratch

mortal vortex
# stoic rose How hard is it, realistically based on the things you saw I was seeking

Not hard.

GUI can be done with any old API, I prefer IF. Create a Pane which displays the player's skins, you should do this with pagination in case there are excess skins, around the sides create some border, with a button in the bottom middle that symbolizes "Add New", perhaps using a head here, which asks them to type either a Username in chat to sample the skin from, OR a texture URL. Or instead of having the "add new" functionality in the GUI, you could instead just have a command for it that takes either value as a paramater, and just use the GUI for displaying and switching skins.

Retrieving the skins, and subsequently setting them isn't hard at all. Take the Base64 JSON data of the texture, then just construct a ProfileProperty out of it. Grab the Player's PlayerProfile, use setProperties and append the property, then save.

Using PlayerProfile, you can also get the skin's head, which you can display in the GUI. Using IF you can handle click events to handle the setProperties.

stoic rose
mortal vortex
#

You just make a function which takes some value, whether you're passing the username of another player and retrieving their skin, or a texture file directly, and return a Profile Property from it, then when it goes to applying, you would just grab the player's existing profile, use SetProperty, and pass what was just returned

stoic rose
#

I know nothing about coding

#

😭😭

mortal vortex
sacred marten
#

I really havent found a solution, can someone tell me a method to implement a rotation of pitch/yaw without using player.teleport or player.setRotation??
those 2 are always blocking player movement or rotation when called

mortal vortex
sacred marten
#

yeah ive tried changing entity.look packets but nothing happens on client side

mortal vortex
sacred marten
#

the teleport sets the velocity to zero

#

and setRotation just blocks mouse input

mortal vortex
#

Isn’t this what PacketPlayOutPosition is used for?

sacred marten
#

probably, chatgpt suggested something with protocollib something, with positionpackets? idk what those are? is nms generally better than protocollib?

sacred marten
#

not yet ill look into it

livid tundra
#

I think thier final solution was

#
   Location loc = event.getTo();
    ClientboundPlayerPositionPacket positionPacket = new ClientboundPlayerPositionPacket(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), setPitch, Set.of(), player.getEntityId());
       
    for(Player players : Bukkit.getOnlinePlayers()){
        ((CraftPlayer) players).getHandle().connection.send(positionPacket);
    }
sacred marten
#

tyvm

#

Ill test it now

cursive kite
#

Can you make NPC usernames appear in tab complete as if it is a normal player

frail pilot
#

If they are added to the tablist, they will be in the tab complete list (iirc)

cursive kite
#

They aren’t appearing 😦

frail pilot
#

If it's in your own commands then you have full control over what you return in the tab complete list

cursive kite
#

Basically for my vanish I add a NPc of the staff member so players think they are just afk

#

But when typing a message “Hello <press tab>” it doesn’t show the Npc username

rough ibex
#

how do you add the NPC

cursive kite
#

Packets

frail pilot
#

Although it might be better to find a way to have the player in the list by default

cursive kite
#

Got it, hoped there was an easier way lol

frail pilot
#

Iirc, Mojang does not want any modifications from the player list, so any project related to "fake players" becomes tedious

quaint mantle
#

How to send a packet so that the player's effect is to display Speed in 1.21.4 ?

urban cloak
#

I dont think its a thing of not wanting, i think the whole playerlist and tablist thing is too hardcoded

urban cloak
chrome beacon
#

If you want an infinite effect don't use int max value

#

Use the infinite constant

quaint mantle
#

strength can be 10% or 30%

urban cloak
#

Ye then you swap that 1 for a 3 or something

#

Or not?

quaint mantle
#

one level in the player's hud = 20% of strength

#

but he can have 30%

chrome beacon
#

Packets won't let you customize it any more than the API

hearty fable
#

Hey, does anyone know how to prevent Bats from colliding with blocks like a vex does. My guess would be something with the BoundingBox, but I dont know how to apply it on NMS 1.17.

dreamy glade
#

Hi, why does this always return false

boolean hasDecoration = player.getInventory().getItemInMainHand().getItemMeta().displayName().hasDecoration(TextDecoration.ITALIC);
chrome beacon
#

That's not Spigot code

dreamy glade
chrome beacon
#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

chrome beacon
young knoll
#

I believe there’s just a no collision Boolean

drifting moat
#

Is there an easy way to convert a Java resources pack to bedrock?

chrome beacon
#

Not really

drifting moat
#

Oh man

#

Sadly all the converters online don't work

I hate bedrock so much

remote swallow
#

didnt geyser have one?

drifting moat
remote swallow
#

no idea if it works or not

drifting moat
#

Lol I will try it

If it doesn't work I will tell them to throw the switch in a volcano and buy a PC

pseudo hazel
#

based

drifting moat
#

Bedrock was a mistake tbh, Java is so much better

thorn isle
#

bedrock also updates approximately every 35 seconds and the launcher either doesn't let you, or the xbox kids can't figure out how to, go back to the previous version

#

so in my support chat i will invariably get "when will server update to 1.21.40694???" every other day

drifting moat
thorn isle
#

looks like it's a "library for converting packs"

#

so you're probably expected to use it from a plugin to convert a pack automatically

pseudo hazel
#

i.e. not a standalone program

drifting moat
#

So basically it's useless for me right

pseudo hazel
#

so we kinda expect you are developing something

drifting moat
#

No I'm just desperate because the shitty bedrock version can't see my resource packs

thorn isle
#

it's never too late to start

#

come back in 3 weeks

drifting moat
#

I think the logical next step is to destroy the switch with a hammer, then work 40 hours a week and buy a PC

blazing ocean
#

sounds good

thorn isle
#

you could probably figure out how to write a super simple main class to call the library and then run it within an hour

blazing ocean
#

probably not on a switch though

pseudo hazel
#

if they have something to run an exe they have something to make an exe

drifting moat
#

Or I can pay someone 50$ to do it for me perhaps? 🥹

thorn isle
#

i can give it a shot but the only form of payment i accept is you going to the towny discord to annoy llmdl

drifting moat
#

Lol

blazing ocean
remote swallow
#

do not annoy the llmdl

blazing ocean
#

they're a popular place to ask for (paid) services

drifting moat
thorn isle
#

it's very simple, i've done it some years back though i don't really remember anything about how i did it

#

whether it's feasible for you to do or not depends entirely on you

#

tryitandsee

#

if you run into a problem, ask for help with that problem; but trying to seek help or confidence ahead of time "u guys think i can do it?" is not constructive and gets you nowhere

latent rampart
#
org.bukkit.plugin.InvalidPluginException: Cannot find main class `Plugin'
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:66) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:292) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:198) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        at java.lang.Thread.run(Thread.java:750) [?:1.8.0_442]
Caused by: java.lang.ClassNotFoundException: Plugin
        at java.net.URLClassLoader.findClass(URLClassLoader.java:387) ~[?:1.8.0_442]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[?:1.8.0_442]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_442]
        at java.lang.Class.forName0(Native Method) ~[?:1.8.0_442]
        at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_442]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        ... 7 more
#

can someone explain to me where its supposed to be :c

.
├── net
│   └── leahmc
│       └── recipes
│           └── Plugin.java
└── plugin.yml
chrome beacon
#

Use net.leahmc.recipes.Plugin

#

as the main class in your plugin.yml

latent rampart
#

in the source?

#

oh

#
main: Plugin
#

right...

#

its a bit too long to send

chrome beacon
#

?paste

undone axleBOT
latent rampart
#

but it says this again

chrome beacon
#

How are you compiling your plugin?

latent rampart
#

im using this script

#

well its one line lol

#
jar cvf Recipes.jar -C Recipes/ .
#

i am not a Java developer at all

fair rock
latent rampart
#

it is now

chrome beacon
#

ah yeah I don't recommend using the cli directly

latent rampart
#
main: net.leahmc.recipes.Plugin
chrome beacon
#

Use a build system like Maven or Gradle

#

I recommend Maven for beginners

latent rampart
#

why do i need a build system?

chrome beacon
#

Makes dependency management easier

latent rampart
#

i have one dependency

#

i mean i do this stuff in like C++

chrome beacon
#

You can do it that way if you want to but I wouldn't recommend it

#

Just make sure your class actually is in your jar

latent rampart
#

oh i have a thought

#

yeah nvm

#

i am pretty sure this is a correct build command

#

looking at the structure of another plugin it does look the same

#

do you think it needs to be a .class?

chrome beacon
#

Yes it needs to be a .class

latent rampart
#

or would it compile that automatically

remote swallow
#

a build system compiles it to a class

chrome beacon
#

.java is the source .class is the compiled version

latent rampart
#

right

#

it did say class but they are defined using a class definition so i didnt see that

chrome beacon
#

Save yourself the trouble and use maven

#

It's a good idea to know how it works

#

So you can use the java ecosystem easily

latent rampart
#

ill use it if i need it

#

right. its not compiled

.
├── META-INF
│   └── MANIFEST.MF
├── net
│   └── leahmc
│       └── recipes
│           └── Plugin.java
├── plugin.yml
└── Recipes.jar```
chrome beacon
#

Gotta call javac to compile

latent rampart
#

will having a .java and .class conflict?

smoky anchor
#

What's meta-inf doing there

latent rampart
#

i assume not bc it doesnt look for .java

chrome beacon
#

No the server doesn't care about .java files

latent rampart
#

thank you

#

javac complains it doesnt have the appropriate libraries

#

i mean its right but its a part of the server and not of my jdk

quaint mantle
#

You need to 'link' api jar

chrome beacon
#

^^

quaint mantle
#

Just use build system

latent rampart
#

yeaah

#

okay

#

how can i use maven?

#

or just more simply

quaint mantle
#

Create pom.xml file

latent rampart
#

pull the dependencies to link with

#

in the root of the plugin?

tranquil pecan
chrome beacon
quaint mantle
tranquil pecan
#

Intellij creates it automatically so not for me

latent rampart
#

and then :3

chrome beacon
#

Do you have your pom.xml?

quaint mantle
#

I havent used maven a while 💀

latent rampart
#

it has nothing in it

#

but yeah

chrome beacon
#
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>package</groupId>
    <artifactId>pluginName</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <!-- Dependencies here -->
    </dependencies>
</project>
#

That's a basic pom.xml

#

Then follow

#

?maven

undone axleBOT
latent rampart
#

oh thats lovely that pulls api stuff

chrome beacon
#

And set java compiler versions to 8

latent rampart
#

what does dependencies here mean lol

#

do i specify like <plugin="net.leahmc.Recipes.Plugin">?

chrome beacon
#

No

#

The dependency here would be the spigot api

#

You can see how to add it in the link the bot sent

#

It will automatically download it for you and link when building

latent rampart
#

dependencies

#

isnt the source files?

chrome beacon
#

No

#

It will use the source files in src/main/java

latent rampart
#

right so ig i just paste this

           <groupId>org.spigotmc</groupId>
           <artifactId>spigot-api</artifactId>
           <version>1.21.4-R0.1-SNAPSHOT</version>
           <scope>provided</scope>
chrome beacon
#

and resources in src/main/resources

remote swallow
#

inside a <dependency> block yeah

latent rampart
#

yes

chrome beacon
#

Need the repo as well

latent rampart
#

right so

#
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <repositories>
    <repository>
      <id>spigot-repo</id>
      <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
    </repository>
  </repositories>

  <groupId>package</groupId>
  <artifactId>pluginName</artifactId>
  <version>1.0-SNAPSHOT</version>

  <properties>
    <maven.compiler.source>21</maven.compiler.source>
    <maven.compiler.target>21</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <groupId>org.spigotmc</groupId>
     <artifactId>spigot-api</artifactId>
     <version>1.21.4-R0.1-SNAPSHOT</version>
     <scope>provided</scope>
  </dependencies>
</project>
#

have to change version but does this look good?

remote swallow
#

the repo needs to go inside of a <repositories> block

latent rampart
#

it says repository on the site

#

oh right

#

for multiple repos

#

and so now, can i just run like

#

maven build or something

quaint mantle
#

maven install

latent rampart
#

oh i am using 1.8.8 for my server

quaint mantle
#

Do not use that version

#

at all costs

latent rampart
#

can i just put "1.8.8" instead of "1.20.4..."

#

ok well i am

#

i have 1.13 api on my plugin.yml but iirc like spigot api is backwards compatible

#

i think it might be fine i dont know lol

chrome beacon
#

api-version is ignored in versions below 1.13

latent rampart
#

right so it doesnt matter

chrome beacon
#

Yeah

#

Do depend on 1.8.8 in your pom

#

so you don't accidentally call a method that doesn't exist

latent rampart
#

does that mean changing api version?

#

oh i assume

chrome beacon
#

yeah the spigot api in your pom

latent rampart
#

i dont see where i can do that :c

chrome beacon
#

You already did

#

going by the messages above

latent rampart
#

well alright

#

struggling to get maven installed lol excuse me

#

its package for some reason doesnt include its executable??

quaint mantle
#

Linux or windows

chrome beacon
#

It comes with an executable

#

just no installer

latent rampart
#

Linux

chrome beacon
#

I recommend using SDKMan for all things Java

latent rampart
#

i guess ill just get the tar for maven and use it locally

#

ugh this is so much work lol

chrome beacon
#

eh not that bad

quaint mantle
#

Use intellij idea if you hate doing this 🗿

chrome beacon
#

Especially compared to other languages

latent rampart
#

in C++ i have a like tiny makefile of 3 lines

#

and the source

#

in any directiories i want

#

and then i run make and it just works

#

or i just yk run clang++ src/main.cc (etc)

#

not really here to complain though lol

#

it is what it is

#

OOOOOOOOH

#

ITS MVN

chrome beacon
#

Yeah

latent rampart
#

the executable is named mvn 😭

chrome beacon
#

people do be lazy with the executable names

latent rampart
#

lol

#

i hate vowels

#
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Malformed POM /home/leah/files/necessary-evils/leahmc/plugins/Recipes/pom.xml: Unrecognised tag: 'groupId' (position: START_TAG seen ...<dependencies>\n    <groupId>... @24:14)  @ /home/leah/files/necessary-evils/leahmc/plugins/Recipes/pom.xml, line 24, column 14
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project package:pluginName:1.0-SNAPSHOT (/home/leah/files/necessary-evils/leahmc/plugins/Recipes/pom.xml) has 1 error
[ERROR]     Malformed POM /home/leah/files/necessary-evils/leahmc/plugins/Recipes/pom.xml: Unrecognised tag: 'groupId' (position: START_TAG seen ...<dependencies>\n    <groupId>... @24:14)  @ /home/leah/files/necessary-evils/leahmc/plugins/Recipes/pom.xml, line 24, column 14 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException

maven outputs this, at the root of the plugin

blazing ocean
#

?paste your pom

undone axleBOT
chrome beacon
#

Could you send your pom

latent rampart
#

line 24 column 14

thorn isle
#

muh indentation

chrome beacon
#

xml doesn't care about that?

latent rampart
#
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <repositories>
    <repository>
      <id>spigot-repo</id>
      <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
    </repository>
  </repositories>

  <groupId>package</groupId>
  <artifactId>pluginName</artifactId>
  <version>1.0-SNAPSHOT</version>

  <properties>
    <maven.compiler.source>21</maven.compiler.source>
    <maven.compiler.target>21</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <groupId>org.spigotmc</groupId>
     <artifactId>spigot-api</artifactId>
     <version>1.8.8</version>
     <scope>provided</scope>
  </dependencies>
</project>
thorn isle
#

it shouldn't afaik

latent rampart
#

i was about to say im 99% sure xml doesnt do that

thorn isle
#

but it's the only thing wrong i see at a glance

latent rampart
#

i could change it to 4 space

thorn isle
#

oh, you forgot to wrap it in <dependency>

latent rampart
#

the groupid?

thorn isle
#

the dependency

chrome beacon
#

group id artifact id version and scope

latent rampart
#

oh

#

right

thorn isle
#

the only child tags <dependencies> accepts are <dependency>

latent rampart
#
  <dependencies>
    <dependency>
      <groupId>org.spigotmc</groupId>
      <artifactId>spigot-api</artifactId>
      <version>1.8.8</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
#

like this

chrome beacon
#

yes

quaint mantle
#

Yes

thorn isle
#

tryitandsee but yes

latent rampart
#

mvn install is doing its thing now :3

#

i think i provided an invalid version

#

1.13 it is

thorn isle
#

1.8 is starting to be very invalid for sure

latent rampart
#

lol

thorn isle
#

as in ♿

quaint mantle
#

It's the pom

chrome beacon
#

<version>1.8.8</version>
yeah this is wrong

quaint mantle
#

-R0.1-SNAPSHOT or something

chrome beacon
#

1.8.8-R0.1-SNAPSHOT

latent rampart
#

maven looks nice

#

oh thank you

smoky anchor
#

Please don't use a decade old version

latent rampart
#

its necessary unfortunately

smoky anchor
#

sadge

thorn isle
#

it's a bit boilerplatey but it's simple and straight forward

quaint mantle
latent rampart
#

install worked

thorn isle
#

i do still prefer it over gradle

latent rampart
#

i understand what its doing

#

i now have a /target/ directory

#
target/
├── maven-archiver
│   └── pom.properties
└── pluginName-1.0-SNAPSHOT.jar```
chrome beacon
#

Yeah that's your jar

latent rampart
#

oooh

#

i copy that to plugins

quaint mantle
#

Yes

latent rampart
#

i ran mvn install and it compiled my project?

chrome beacon
#

yes

latent rampart
#

do i need to pull the dependencies every time

quaint mantle
#

Shouldn't it be package?

chrome beacon
#

No

#

It caches

latent rampart
#

i see

chrome beacon
#

install does a little bit more than just compile

#

package will compile for you

latent rampart
#

alright i just expected it to be like mvn or mvn build lol

chrome beacon
#

You can set a default task

#

to make mvn run package

thorn isle
#

install is for installing the artifact (your jar + some maven metadata) to the local maven repository

#

so that other maven projects can be built against it

#

similarly to how your current build grabs the spigot artifact from the spigot repo

latent rampart
#
[08:57:37 ERROR]: Could not load 'plugins/pluginName-1.0-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:154) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:292) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:198) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        at java.lang.Thread.run(Thread.java:750) [?:1.8.0_442]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
thorn isle
#

a pre-requisite for this is compiling it of course

latent rampart
#
├── net
│   └── leahmc
│       └── recipes
│           └── Plugin.java
├── plugin.yml
├── pom.xml
└── target
    ├── maven-archiver
    │   └── pom.properties
    └── pluginName-1.0-SNAPSHOT.jar

i thought this was right?

#

i mean it detected it before

smoky anchor
#

This is not a valid structure for maven

latent rampart
#

oh it says invalid plugin.yml

#

what do you mean?

thorn isle
#

maven expects resources to be placed in a specific directory

river oracle
#

src/main/java

quaint mantle
#

/resources

smoky anchor
#

something like this

latent rampart
#

so

#

wait

#

oooh

blazing ocean
latent rampart
#

just the src part right

quaint mantle
thorn isle
#

this can be changed in the build file of course but it's better to stick to the standard

latent rampart
#

yeah i dont mind

#

it helps be less ambiguous

chrome beacon
#

I told you this earlier

quaint mantle
#

It's okay

latent rampart
#

so i copy /net/ to /src/main/

quaint mantle
#

They're learning

chrome beacon
latent rampart
#

i dont use java or spigot and i am usually a very hands on person with this stuff i dont like abstraction

#

and now recompile

quaint mantle
#

Clean and recompile khajiit

thorn isle
#

you can always javac it yourself and pass on the 100 million dependencies in the classpath from jars you've manually downloaded

latent rampart
#

lol yeah thats what i usually do

#

but i think thats out of scope here

chrome beacon
#

Way too many of them for that to be fun

#

maven will take care of it all for you

latent rampart
#

i appreciate yalls patience

thorn isle
#

i swear every time i build paper it eats up like 5gb of my disk space just caching all the dependencies

quaint mantle
#

What is it even downloading lol

latent rampart
#
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project pluginName: Fatal error compiling: invalid target release: 21 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
#
.
├── plugin.yml
├── pom.xml
├── src
│   └── main
│       └── java
│           └── net
│               └── leahmc
│                   └── recipes
│                       └── Plugin.java
...
#

oh i think

#

i shouldnt put net

chrome beacon
#

Yeah set it to 8

latent rampart
#

what?

#

oh i didnt read the error

chrome beacon
#

Target release is for Java 21 which 1.8.8 does't use

latent rampart
#

thats my fault

#

i didnt see that

river oracle
#

Isn't it 1.8 for java 8 or does it not matter

chrome beacon
#

No worries

latent rampart
#

java 8

chrome beacon
#

Yeah 1.8

latent rampart
#

yes it is

quaint mantle
chrome beacon
#
  1. was dropped in Java 9 and above
smoky anchor
#

(wish minecraft did that)

river oracle
latent rampart
#

more errors :c

#

its overwriting methods?

chrome beacon
#

?

#

Send the error

latent rampart
#

too long

chrome beacon
#

and use the paste

#

?paste

undone axleBOT
latent rampart
#
[ERROR] /home/leah/files/necessary-evils/leahmc/plugins/Recipes/src/main/java/net/leahmc/recipes/Plugin.java:[5,28] onEnable() in Plugin cannot implement onEnable() in org.bukkit.plugin.Plugin
[ERROR]   overriding method is static
[ERROR] /home/leah/files/necessary-evils/leahmc/plugins/Recipes/src/main/java/net/leahmc/recipes/Plugin.java:[15,28] onDisable() in Plugin cannot implement onDisable() in org.bukkit.plugin.Plugin
[ERROR]   overriding method is static
[ERROR] /home/leah/files/necessary-evils/leahmc/plugins/Recipes/src/main/java/net/leahmc/recipes/Plugin.java:[7,5] cannot find symbol
[ERROR]   symbol:   class ShapelessRecipe
...
#

its just more of these

#

i think it didnt find the stuff its actually using

quaint mantle
#

Can you paste the code?

latent rampart
#

i changed 21 to 8

#

sure

chrome beacon
#

Did you put static on your onEnable and onDisable

#

Don't do that

latent rampart
#

oh oops i might have

#

i always put static lol

quaint mantle
#

why

latent rampart
#

yes lol

ancient plank
#

just avoid the word static if you don't know what you're doing uwu

latent rampart
#

public static final void onEnable lol

thorn isle
#

that's not paper itself though

#

just a project depending on userdev

quaint mantle
#

neoforge?

latent rampart
chrome beacon
quaint mantle
#

My laptop would have given up half way

chrome beacon
latent rampart
#

oh ew

latent rampart
#

i tihnk i forgot to import something

quaint mantle
#

Java loves consuming memory if done in the wrong way

chrome beacon
#

In terms of c++ you can think of methods as being virtual by default

latent rampart
#

that makes sense

#

can i just

#

import org.bukkit.*;

#

or is that wasteful

chrome beacon
#

You can do that

latent rampart
#

yayy

chrome beacon
#

I mean usually you'd just rely on the IDE to handle imports for you

valid burrow
#

^

smoky anchor
#

That's not gonna import everything tho, right.

valid burrow
chrome beacon
#

not nested packages

smoky anchor
#

Ye, that's what I mean

ancient plank
#

any ide worth its salt will import for you UwU

latent rampart
#

import org.bukkit.*.*.*.*.*...

#

i got it covered

#

lol

quaint mantle
#

What kind of plugin are you making anyways?

valid burrow
latent rampart
#

im not using an ide i dont even think i have lsp hinting for this

latent rampart
quaint mantle
#

How are you even programming this

smoky anchor
#

nvm, 1.8 lol

latent rampart
#
import org.bukkit.*;

public class Plugin extends JavaPlugin
{
  public final void onEnable()
  {
    ShapelessRecipe gcarrot = new ShapelessRecipe(
      new ItemStack(Material.GOLDEN_CARROT, 1)
    );
    gcarrot.addIngredient(4, Material.GOLD_NUGGET);
    gcarrot.addIngredient(1, Material.CARROT);
    getServer().addRecipe(gcarrot);
  }

  public final void onDisable()
  {

  }
}
valid burrow
latent rampart
#

4 instead of 8 nuggets

quaint mantle
#

You are def a c dev

latent rampart
#

lol why

quaint mantle
#
public class Plugin extends JavaPlugin
{```
latent rampart
#

oh yea

quaint mantle
#

Criminal

latent rampart
#

whhaaat ur mean

chrome beacon
#

In Java we use the { on the same line

quaint mantle
#

^

latent rampart
#

thats called K&R casing

#

invented by C

valid burrow
#

?ban @latent rampart syntax

latent rampart
#

nooooo im sorry

smoky anchor
#

Then you'll have to take me with them

latent rampart
#
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
#

does this part of the url

#

tell met he package

valid burrow
smoky anchor
#

correct

chrome beacon
#

Yes

latent rampart
#

oh then thats easy im just being lazy

quaint mantle
#

Wait

chrome beacon
#

The package is also here

latent rampart
#

ooooooooh

quaint mantle
#

Can't you just do
#.getServer().addRecipe(new ());
?

latent rampart
#

omg

#

i love oneliners

#

if i dont have to make an arraylist of recipes i will be overjoyed

chrome beacon
#

Please don't one line too much

latent rampart
#

lol

chrome beacon
#

That will just make things hard to read

valid burrow
#

java requires you to import a gababollion things just to do simple stuff especially when working with an API like spigots

#

just get an IDE

quaint mantle
#

Don't use a text editor pls

latent rampart
#

id hate to use something im not familiar with with an api im not familiar with with a language im not familiar with

ancient plank
#

I can write java in a text editor :3

smoky oak
#

can != should

valid burrow
#

can yea

#

should no

quaint mantle
ancient plank
#

I like showing off

chrome beacon
#

Java exams on Paper:

valid burrow
chrome beacon
#

Gotta know your syntax

quaint mantle
#

Which paper are we talking about

latent rampart
chrome beacon
#

Paper paper

#

Not the server

latent rampart
#

"spigot shapelessrecipe"

quaint mantle
#

Oh

ancient plank
#

also yeah my comp sci class made us do our final in google docs

latent rampart
#

actually i think i can search the docs

valid burrow
#

i had my java finals on literal paper

chrome beacon
#

same

quaint mantle
#

HOW

chrome beacon
#

Pen and Paper Java 🔥

quaint mantle
#

how do you compile the project

chrome beacon
#

You don't

#

That's the fun part

quaint mantle
#

Write fizzbuzz enterprise edition on a4 paper

smoky anchor
#

so much talk about paper that i want to ?whereami

valid burrow
#

"find 6 logical errors and 3 syntax errors in this code" 11 pages of java

latent rampart
#

you have to know

#

LOL

#

they drill it into ur skull

valid burrow
quaint mantle
#

What if something's wrong in the code?

valid burrow
#

u just cant make mistakes

#

well

#

u fail

quaint mantle
#

nice

latent rampart
#

YAAAAY

#

i took 7 minutes to write 5 lines of imports

quaint mantle
#

Plus

latent rampart
#

thats like almost a minute per line im on good pace

quaint mantle
#

You can make this plugin in 2 lines

valid burrow
#

wouldve taken u 3 to install intellij community

latent rampart
#

😭

#

ugh dude

#

it again cant find plugin.yml

quaint mantle
#

install intellij pls

#

ITS FREE

valid burrow
#

is it in the correct location?

chrome beacon
latent rampart
#

thats what i thought

valid burrow
#

iss it in the jar?

latent rampart
#

wh

valid burrow
#

check if its in the jar

latent rampart
quaint mantle
#

okay

chrome beacon
#

Yeah I did warn you about that earlier

valid burrow
#

maven only adds resources from that path

quaint mantle
#

download pls

chrome beacon
#

They're on Linux smh

#

Sending windows link

valid burrow
#

xd

latent rampart
#

quaint mantle
#

oh

#

fr?

chrome beacon
#

What did you expect for a c dev

valid burrow
#

gods favorite operation system

chrome beacon
#

C dev on Windows is not fun

#

Installing the tools is a pain

latent rampart
#

thats true

quaint mantle
valid burrow
#

c and windows arent fun alone either

latent rampart
#

AYHA YES

#

anyway

quaint mantle
#

install ij

#

thanks

smoky anchor
valid burrow
#

im also like 99% sure that what you are making already exists

latent rampart
#

..cannot find main class

valid burrow
#

?paste

undone axleBOT
latent rampart
#

oooooh i

#

might not have updated it

quaint mantle
smoky anchor
#

Oh I'm gonna be annoying
If all you're adding is just some recipes, why not use a plugin that allows you to add custom recipes via config ?

quaint mantle
#

oh

#

clion is free?

smoky anchor
valid burrow
thorn isle
#

everything is free if you're a 🏴‍☠️

quaint mantle
#

oh

#

it's $230?

smoky anchor
#

it's a subscription

valid burrow
#

just get the student developer pack 😭

quaint mantle
#

I don't code in c++ anyways

latent rampart
#

should the main be from the root?

#

main: src.main.java.net.leahmc.recipes.Plugin

smoky anchor
#

no

#

net.leahmc...

quaint mantle
#

Remove src.main.java

latent rampart
#

oooookay

quaint mantle
#

😭

latent rampart
#

THER SI

#

HOW AM I USPPOSED TO KNOW LOL

#

i mean yes butlike

quaint mantle
#

net.leahmc.recipes.Plugin

#

that's it

valid burrow
#

read the docs nerdcat

latent rampart
#

it kinda interprets this however it wants to

#

lol like absolute path and then local path

latent rampart
#

oh but this is the default config

valid burrow
#

maven compiles it from java/

latent rampart
#

so i could change that if i wanted to

valid burrow
#

in the compiled jar the file is gonna sit at net.leahmc.recipes.Plugin

quaint mantle
latent rampart
#

theres so many small like issues i think im like dodging the actual problem

#

i did change the path in plugin.yml

valid burrow
#

wouldve all been fixed if u used intellij it even has a plugin to auto create minecraft pluginss xd

quaint mantle
#

The actual problem that you're not using an IDE

latent rampart
#

whhhhaaat

quaint mantle
#

Please install ij

chrome beacon
#

Intellij will download all the tools and has a plugin to setup a project for you

#

but you've kind of done that part now

#

so 🤷‍♂️

latent rampart
#
.
├── pom.xml
├── src
│   └── main
│       ├── java
│       │   └── net
│       │       └── leahmc
│       │           └── recipes
│       │               └── Plugin.java
│       └── resources
│           └── plugin.yml

so plugin at net.leahmc.recipes.Plugin

#
main: net.leahmc.recipes.Plugin
#

this is what it says in the yml

quaint mantle
#

yes

latent rampart
#

and it cant find the main class

thorn isle
#

sanity check time

latent rampart
#

i dont get it lol

thorn isle
#

open the jar in winrar or whatever you have

#

and see where the class actually is

latent rampart
#

okay

quaint mantle
#

I don't know why

thorn isle
#

🤡

latent rampart
#

im not a developer

#

im adding a crafting recipe

thorn isle
#

can't you do that with datapacks now

smoky anchor
quaint mantle
#

1.8

valid burrow
latent rampart
#

there should be like a spigot build setup tool

thorn isle
#

ultra-clown

chrome beacon
valid burrow
#

its inside of intellij

#

as a plugin

latent rampart
#

and then i make the project, put my code, and compile it with the script

smoky anchor
valid burrow
thorn isle
#

anyway open up the jar and see where the classes are

latent rampart
thorn isle
#

that's the ground truth

latent rampart
#

it doesnt need to be

#

yeah hol don

chrome beacon
#

If you don't want to use Intellij

quaint mantle
chrome beacon
#

I believe mfnalex has a tool to setup projects

latent rampart
#

lol ok

valid burrow
#

omg

#

actually

latent rampart
#

oh oki

valid burrow
#

like a few months ago

#

someone made a cli one

#

and we all bashed them for it

#

saying its useless

chrome beacon
#

Maven archetypes exists as well

blazing ocean
#

I was gonna make a CLI for sploon

chrome beacon
#

There are ones for Spigot

#

I made my own a couple years ago

latent rampart
#
.
├── META-INF
│   ├── MANIFEST.MF
│   └── maven
│       └── package
│           └── pluginName
│               ├── pom.properties
│               └── pom.xml
├── Plugin.class
└── plugin.yml

??? when i unzip the jar it looks like this

blazing ocean
#

Yea looks good

latent rampart
#

okay..

quaint mantle
#

Wait

blazing ocean
#

but the class is not in the proper package

quaint mantle
#

Do you manually type the command?

latent rampart
blazing ocean
#

yes

valid burrow
quaint mantle
#

Make sure you declared package in the class

latent rampart
#

what does that mean

#

in the source code?

quaint mantle
#
package nano.my.beloved
latent rampart
#

oooh

thorn isle
#

at the very top of the source file, yes

valid burrow
#

^

thorn isle
#

before imports

ancient plank
latent rampart
#

so ig package net.leahmc.recipes

#

or no

chrome beacon
#

yes

latent rampart
#

oh okay

thorn isle
#

definitely more convenient than fiddling with run configs to add command line params you only need to use once

ancient plank
quaint mantle
#

The name is on the sidebar though

valid burrow
#

its faster lol

#

dont wanna click through 10 windows

#

especially when running more complex commands with flags

#

idk

#

mvn clean install -U

ancient plank
latent rampart
#

ok NOW it has the class

valid burrow
#

i do the same for git(hub)

latent rampart
#

im gonna cry diude

#
.
├── META-INF
│   ├── MANIFEST.MF
│   └── maven
│       └── package
│           └── pluginName
│               ├── pom.properties
│               └── pom.xml
├── net
│   └── leahmc
│       └── recipes
│           └── Plugin.class
└── plugin.yml
#

🎉

latent rampart
#

if thereis a god this should work

#

it does not complain i think?

chrome beacon
#

Time to do some crafting

valid burrow
#

run /plugins

#

if its green it works

latent rampart
#

i mean the code dosent work but the plugin is loaded

#

it is c:

valid burrow
#

nice

ancient plank
#

time to inform you to never run /reload in the future as a note or else the plugin will complain about duplicate plugin registration UwU

#

reload is silly anyway

latent rampart
#

oh do i really have to wait the 30 seconds to shutdown and restart the server

quaint mantle
latent rampart
#

i literally have that

#

lol

quaint mantle
#

and it still takes 30 seconds?

latent rampart
#

oh no i meant

#

thats a file i have

#

but no it does a bunch of other stuff like making world backups

ancient plank
#

start.sh doesn't inherently make load times faster lol

latent rampart
#

yeah in that case its way slower

latent rampart
#

anyway thank u all i think ive reached a conclusion with this

#

i just have bad code now

valid burrow
#

/reload is fine unles ur doing specific stuff

#

dont let this community gaslight you

#

and ofc only use it during developoment

quaint mantle
latent rampart
#

lol which one of us is gaslighting

quaint mantle
#

Extremely lazy to type the entire command out

ancient plank
#

what

latent rampart
ancient plank
#

who manually types the start command

latent rampart
#

nono that IS the command

quaint mantle
#

fr double click the jar

latent rampart
#

u mean like bash start.sh??

#

oh mine is much worse

#

hold on

#
    /lib/jvm/java-8-openjdk/jre/bin/java -jar -Xmx1024M -Xms1024M ./spigot-1.8.8.jar nogui | tee ./latest.log
quaint mantle
#

what the

ancient plank
#

I don't know anyone who types out the startup params manually lol

valid burrow
ancient plank
#

the 30 second loadtime is from java initializing classes, spigot etc, and on shutdown saving etc

frank notch
#

yo im trying to compile buildtools and im getting cannot find symbol errors

ancient plank
#

not from having to type the start command lol

valid burrow
#

just specified the java location, usage, nogui and log

chrome beacon
latent rampart
#

thank u guys i think i earned a slice of garlic bread after this

chrome beacon
#

Spigot already has a log file

latent rampart
#

it does??

chrome beacon
#

yes

valid burrow
latent rampart
#

the tee is so that i can see it in the output and also have it as a file

ancient plank
#

I use aikar flags so mine are longer UwU

valid burrow
#

it uses log4j

remote swallow
chrome beacon
#

logs are in the logs folder

latent rampart
#

THERES A LOGS F

#

im s

#

ok

valid burrow
latent rampart
#

IT HAS

#

EVERY SINGLE LOG

#

im removing the tee

#

thats embarrassing

valid burrow
#

xd

#

happens

#

we all started somewhere lol

latent rampart
#

yes :3

valid burrow
quaint mantle
#

Why is the cat

#

Soggy

quaint mantle
#

Fair

ancient plank
#

chatting in here is fine-ish when people aren't asking for help but when someone asks for help please try to minimize it, lest you drown out messages like these #help-development message

quaint mantle
#

okay

frank notch
remote swallow
#

any modifications you did on bt?

frank notch
#

just cloned it from the stash

remote swallow
#

got java 8?

frank notch
remote swallow
#

double check you have java 8 downloaded and check the project is set to use it

frank notch
#

Detected JDK version 1.8.0-442 (JAVA_HOME=/usr/lib/jvm/java-8-openjdk/jre) is not in the allowed range [9,).

#

i get this

kind hatch
frank notch
kind hatch
#

Why not direct download from jenkins?

valid basin
#

I'm trying to port this to 1.19+ since packets change, but I'm getting issues if someone knows how this can be fixed or can give me an updated wiki for protocollib packets that works on 1.19+ lmk

        ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();

        protocolManager.addPacketListener(new PacketAdapter(partyPvP, ListenerPriority.NORMAL, PacketType.Play.Server.PLAYER_INFO) {
            @Override
            public void onPacketSending(PacketEvent event) {
                PacketContainer packet = event.getPacket();
                Set<EnumWrappers.PlayerInfoAction> actions = packet.getPlayerInfoActions().read(0);


                if (actions.contains(EnumWrappers.PlayerInfoAction.ADD_PLAYER) ||
                        actions.contains(EnumWrappers.PlayerInfoAction.UPDATE_GAME_MODE)) {

                    List<PlayerInfoData> dataList = packet.getPlayerInfoDataLists().readSafely(0);
                    if (dataList == null || dataList.isEmpty()) {
                        return;
                    }

                    List<PlayerInfoData> modifiedDataList = new ArrayList<>();

                    for (PlayerInfoData data : dataList) {
                        if (data != null && data.getProfile() != null) {

                            UUID uuid = data.getProfile().getUUID();
                            WrappedChatComponent wrappedDisplayName = data.getDisplayName();


                            PlayerInfoData modifiedData = new PlayerInfoData(
                                    data.getProfile(),
                                    data.getLatency(),
                                    EnumWrappers.NativeGameMode.CREATIVE,
                                    wrappedDisplayName
                            );

                            modifiedDataList.add(modifiedData);
                        }
                    }


                    packet.getPlayerInfoDataLists().write(0, modifiedDataList);
                }
            }
        });

        partyPvP.getLogger().info("Custom spectators have been registered!");
    }```
frank notch
#

yknow

#

jenkins has been working tirelessly

cinder abyss
kind hatch
frank notch
kind hatch
#

Wdym compile through maven? Are you trying to compile it from source and run your own version of it?

kind hatch
#

Cause BuildTools also uses maven to compile spigot itself.

#

Ah

#

Well, then yea, as long as you cloned from master, you should just be able to mvn package it.

remote swallow
#

just cloned it fresh from stash directly and compiled fine for me

frank notch
kind hatch
#

https://hub.spigotmc.org/stash/scm/spigot/buildtools.git
Clone link btw

frank notch
#

that you told me to use

remote swallow
#

see if it works on j21

#

thats what mined just used afai

frank notch
#

alr

#

alr

kind hatch
#
  not setting the bootstrap class path may lead to class files that cannot run on JDK 8
    --release 8 is recommended instead of -source 8 -target 1.8 because it sets the bootstrap class path automatically
#

makes me wonder

frank notch
#

it is yapping about not being able to use 1.8

#

also [INFO] BUILD SUCCESS

#

jdk 23 is borked

#

i mean 23

kind hatch
#

BuildTools only works well with Java 21 and below.
AFAIK, Java 23 is still too new to use reliably.

kind hatch
#

Straight up

frank notch
#

i think you guys should mention that on the readme

#

because i will totally forget in 5 years when i want to play minecraft again

thorn isle
#

by then it'll be java 32 that's too new to use reliably

valid basin
# chrome beacon https://github.com/lukalt/PacketWrapper

Thx, I fixed it. In modern versions (1.19+) the player info data is at index 1 instead of 0

        ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();

        protocolManager.addPacketListener(new PacketAdapter(partyPvP, ListenerPriority.NORMAL, PacketType.Play.Server.PLAYER_INFO) {
            @Override
            public void onPacketSending(PacketEvent event) {
                PacketContainer packet = event.getPacket();
                Set<EnumWrappers.PlayerInfoAction> actions = packet.getPlayerInfoActions().read(0);

                if (actions.contains(EnumWrappers.PlayerInfoAction.ADD_PLAYER) ||
                        actions.contains(EnumWrappers.PlayerInfoAction.UPDATE_GAME_MODE)) {


                    List<PlayerInfoData> dataList = packet.getPlayerInfoDataLists().readSafely(1);
                    if (dataList == null || dataList.isEmpty()) {
                        return;
                    }

                    List<PlayerInfoData> modifiedDataList = new ArrayList<>();

                    for (PlayerInfoData data : dataList) {
                        if (data != null && data.getProfile() != null) {
                            PlayerInfoData modifiedData = new PlayerInfoData(
                                    data.getProfile(),
                                    data.getLatency(),
                                    EnumWrappers.NativeGameMode.CREATIVE,
                                    data.getDisplayName()
                            );
                            modifiedDataList.add(modifiedData);
                        }
                    }
                    
                    packet.getPlayerInfoDataLists().write(1, modifiedDataList);
                }
            }
        });

        partyPvP.getLogger().info("Custom spectators have been registered!");
    }```
#

Fixed code in case someone needs it

kind hatch
latent rampart
#

can someone explain how this doesnt work

#
    ShapelessRecipe golden_carrot = new ShapelessRecipe(
      new ItemStack(Material.GOLDEN_CARROT, 1)
    );
    golden_carrot.addIngredient(4, Material.GOLD_NUGGET);
    golden_carrot.addIngredient(1, Material.CARROT);

    Bukkit.getServer().addRecipe(golden_carrot);
#

ive looked through like

#

the documentation on all of these

#

the itemstack declaration is deprecated but its apparently still available

#

4 different demonstrations of this stuff

#

and they all use this kind of setup but it doesnt work for me

#

i did try splitting the itemstack into its own variable for sanity checking but that didnt work either

chrome beacon
#

How are you crafting that golden carrot

latent rampart
#

its a shapelessrecipe so i just place 1 carrot and 4 nuggets anywhere

chrome beacon
#

4 nuggets that aren't in the same slot

#

Just making sure

latent rampart
#

yes

chrome beacon
#

I feel like that should work

#

Let me give it a try

latent rampart
#

#

actually let me log something to see if its actually enabled

#

thats a smart idea

#

yup it does

#

Bukkit.broadcastMessage does something

chrome beacon
latent rampart
#

so...

#

i have no idea