#help-development

1 messages · Page 849 of 1

river oracle
#

the numbers guarentee order not sure how its possible you have all 0s?

#

I wasn't even aware such a thing was possible

brazen badge
#

my server is in 1.20.1 and I use via version. Could be via version?

river oracle
#

if your server source is 1.20.1 this isn't an us problem

sullen marlin
#

crucial information there....

river oracle
#

contact ViaVersion first just contact ViaVersion

next plume
#

If it works with a 1.20.1 server and 1.20.1 client, but not a 1.20.4 client, that's ViaVersion.

astral scroll
#

how do you put emojis in the scoreboard?

grand flint
#

lmao thats hilarious

grand flint
astral scroll
#

oh

grand flint
#

bros about to get into the texturepack era 😭

#

here

astral scroll
#

didnt know that i could do that

young knoll
#

I know TAB can do some janky magic to make them all 0 yet still ordered

#

But yeah it’s easier to just use numbers

sullen marlin
#

texture packs are eew

grand flint
astral scroll
#

nah thats normal

river oracle
#

and your eyes get destroyed

astral scroll
#

i can do that with lunar client

grand flint
#

Yeah you can't do it in vanilla

#

You need a texturepack

#

Which edits the shaders core

astral scroll
#

who in the earth still uses vanilla?

young knoll
#

Me

grand flint
#

A ton, lot of people lmao

river oracle
#

i'd caution to say most individuals

astral scroll
#

WHY

young knoll
#

All these custom clients are silly

grand flint
#

^^

astral scroll
#

just use optifine or badlion

river oracle
#

optifine sucks

young knoll
#

And they shove cosmetics down your throat

grand flint
#

optifine is technically vanilla

river oracle
#

like legit ass

grand flint
#

provides what vanilla should be providing lol

river oracle
#

Fabirc mods have superseeded optifine at this point

#

it should be a relic of the past lo

astral scroll
#

bro 💀

river oracle
#

still throw some performance fabric mods together and boom your good

young knoll
#

Or just run vanilla

#

What you got some 10 year old computer smh

river oracle
#

I like the performance mods 🤷‍♂️

#

it makes it less fps droppy at times

#

granted I barely play the game anymore

#

I find minecraft fairly boring to play outside of Development, but who cares

sullen marlin
#

roblox ftw

river oracle
#

oh wait nvm

#

minecraft doesn't use the GPU

#

i5-12600k

#

its on life support

sullen marlin
#

vanilla works fine on my integrated 11 year old cpu

young knoll
#

I mean it does

#

I have an i7 4770

sullen marlin
#

same

river oracle
#

that would drive me mad

young knoll
#

My gpu is uhh

#

1060 I think

astral scroll
#

minecraft is boring to play

river oracle
#

I have my old graphics cards on stand by incase things break

#

I still got my 1050ti 💪

young knoll
#

My old one did break

#

Rip 760

brazen badge
#

I found the issue

river oracle
young knoll
#

F

echo basalt
#

founders edition?

river oracle
#

iirc yeah it was for the 1050ti

next plume
#

It's not an average of the last four values. It's a weighted average and is based on all the player's ping times since he joined the server.

echo basalt
#

isn't it like 75% new ping 25% last avg~?

next plume
#

If I remember correctly. Which means the first ping time still affects the average minutes later.

#

And if you have a single high ping because the server was doing something or your wifi hiccupped, the subsequent reported ping times will be high for quite a while.

echo basalt
#

yeah but impl details

#

It was sleep deprived when I saw it last week but it was somn like what I said

next plume
#

Which is why, 5 years ago, I wrote my own plugin which simply reports the most recent value.

echo basalt
#

welp

#

It's still an average over time

#

And not the past 4 pings

#

75% avg 25% new ping

next plume
#

So make a spreadsheet that starts with 500 followed by a bunch of 10's, and see how long it takes this weighted average to get down to 10.

echo basalt
#

uH

#

mathematically it won't

next plume
#

That's right.

#

So one bad ping time spoils the whole barrel.

echo basalt
#

I've got no clue what this convo is about I'm not against your line of thought

next plume
#

Anybody know why the latest dev build of ProtocolLib isn't triggering on KEEP_ALIVE packets with Spigot 1.20.4? It works with 1.20.1.
I created a ProtocolLib issue 4 days ago, but there's been no reply.

echo basalt
#

protocol change maybe?

next plume
#

Probably. Just asking here in case someone knows how to fix it or if (unlikely) it was a Spigot problem.

echo basalt
#

it wouldn't be a spigot problem

#

protocollib works on nms

next plume
#

Yeah, just grasping at straws.

echo basalt
#

You'd need to uh

#

play with nms to come to a conclusion

#

if you can get a packet listener working in nms then it's protocollib's fault

#

if the packet no longer exists or has been reworked in nms then blame mojank

next plume
#

Hopefully dmulloy2 will appear in Github in the near future.

quaint mantle
#

Guys

#

At what point should exceptions be handled

#

cause some libraries just catch all exceptions and throw runtimes

paper abyss
#

HELP
How can I upload a project to the spigot page?

quaint mantle
#

You go to like resources

#

I think

#

And post your own

#

Also you can just Google that

#

there's 100% a tutorial

paper abyss
#

are you helping me?

#

give me a link please

compact haven
#

if you’re making a library please only handle exceptions you expect

#

generic catchalls tend to be poor design

mellow edge
#

Do you recommend NBT api or raw nms to set simple tag on some items

echo basalt
#

?pdc

mellow edge
#

I know for that... but since I am in a slightly older version that doesnt exist yet

echo basalt
#

NBT-API ideally

mellow edge
#

Lol I've checked their website and every review is 5 stars

glass mauve
#

do scoreboards reset on server restart?

#

ok yeah probably

echo basalt
#

solid chance

turbid scarab
#

how would i implement the fawe api into a 1.8.8 plugin

astral pilot
turbid scarab
#

would it be possible in java 8?

#

if not does windspigot work as a java 17 1.8 server?

astral pilot
#

uh I don't think java 8 would be a problem here

#

as long as both the plugins support java 8 you should be fine

turbid scarab
#

cause i see this

The API requires using Java 17 at development time. Make sure to point your toolchain to Java 17.

#

on the wesbite

#

does this mean to use the normal worldedit api?

FAWE maintains API compatibility with WorldEdit so you can use the normal WorldEdit API async.

glass mauve
#

first time using scoreboards, do I always use dummy criteria for custom text?

wet breach
#

this is the disadvantage of using outdated software

glass mauve
#

how can I activate these in intellij:

2024-01-06 09:20:23,630 ServerMain WARN Advanced terminal features are not available in this environment

#

its used to mark warnings red etc right?

upper hazel
#

why when I try to save an enum type in itemStack and return it back, I get an error that I am converting a string to an enum of the wrong type

dry hazel
#

can you show the enum as well?

upper hazel
dry hazel
#

ArtifactType does not have a GREEN constant

upper hazel
#

yes it is but why does it convert it from another enum class

#

i have 3 impl PDC classes

#

SimpleUtil.setItemPDC(plugin.getPluginKey(),new ArtifactTypePDC(),artifactType,itemStack);
SimpleUtil.setItemPDC(plugin.getPluginKey(),new PowerTypePDC(),artifactKey.getPowerType(),itemStack); - this is how i add
SimpleUtil.setItemPDC(plugin.getPluginKey(),new RarityLevelPDC(),artifactKey.getRarityLevel(),itemStack);

dry hazel
#

the issue is in how you read it

upper hazel
#

wdym

#

String class this is reason?

dry hazel
#

you're trying to read probably a RarityLevel with the ArtifactType PDT

upper hazel
#

i know but why plugin try read so

dry hazel
#

because you're passing in the wrong PDT?

upper hazel
#

code worked normal

#

no this not wrong PDT

#

i was show code

dry hazel
#

show that PDC#get call in the stacktrace

upper hazel
#

if I did this then intellij would not allow me to build the plugin

dry hazel
#

not the stacktrace, the code where you call PDC#get

upper hazel
dry hazel
#

ah wait, you're saving to and reading from the same key

upper hazel
#

yes but this not the same classes

dry hazel
#

it doesn't matter

upper hazel
#

???

dry hazel
#

you're saving to one key, so only the last call is what you see

#

you're writing RarityLevel last, so you see RarityLevel

#

you need to have different keys for different data

upper hazel
#

how they can be same if they not the same classes? Because converting code this same?

dry hazel
#

they are all stored as just bytes in the PDC

#

the PDT you pass in knows how to handle those bytes and make the appropriate type from them

upper hazel
#

I thought if I can save different PDT types into the same key, then it will work with different classes too

glass mauve
#

do I really need to use some team stuff if I want to have a sidebar with custom text and without the score number?

cinder abyss
#

okay I see

#

thanks

astral pilot
#

is grass considered solid or not

echo basalt
#

it is

alpine urchin
astral pilot
alpine urchin
#

gas, liquid and solid

#

is grass a gas?

astral pilot
alpine urchin
#

is grass a liquid?

#

dont think so

#

so probably solid brother

astral pilot
#

e

#

isn't "solid" in spigot

#

basically a block where u can't pass through

#

something like that

alpine urchin
#

you know solid in spigot is solid irl

#

@astral pilot you can walk through a fluid

astral pilot
#

so ig the solid thing in spigot is related irl

alpine urchin
#

bukkit has Api

#

To check

#

if a block is solid

#

isSolid()

#

off the top of my head it should be block.getType().isSolid()

astral pilot
#

ye ik

#

tho i want a way to check if the block is

#

a grass/flower/torch/redstone

#

because those blocks are the blocks where u can go through

alpine urchin
#

block.getType() == Material.GRASS

#

are you trying to make an anticheat

halcyon hemlock
#

or maybe type

#

now i think that is a bad idea

#

just make a list of elements

tender shard
halcyon hemlock
#

and then check if the block is in the list

#

easiest way innit

astral pilot
#

im trying to find a way to improve my mobspawn algorithm

#

cuz it wont spawn on those types of blocks

trim lake
#

What is this error? Someone attacking server probably?

dire marsh
trim lake
#

sorry, thanks

alpine urchin
#

xd

tender shard
shadow night
#

Why

tender shard
#

because sometimes you wonder e.g. "hmm is grass solid?" and don't know what it returns

shadow night
#

._.

#

Can you make one translating potion effects and enchantments to minecraft names?

tender shard
#

sure

cinder abyss
#

is it that we can see another block through?

tender shard
#

is it not possible in kotlin to declare a "narrower" return type for an overriding method?

cinder abyss
sterile flicker
dry hazel
tender shard
dry hazel
#

tried Any?

shadow night
#

Kotlin sounds like a pain

tender shard
tender shard
tender shard
hazy parrot
icy beacon
hazy parrot
#

Smh I was scrolled again

icy beacon
#

Overall more satisfying imo

hazy parrot
#

Tldr unit is Void

icy beacon
#

alex wtf is this .not()

#

You are aware that you can negate booleans with ! right

tender shard
#

is there any way to avoid having to override "create" in every subclass and somehow do it in the abstract superclass? all subclasses have the same constructor signature btw

hazy parrot
#

Or you don't want that

lean pumice
#

i can edit "YOU DIED"? With NMS

tender shard
hazy parrot
#

open fun create(...) {}

#

That way you can override it, but don't have to

#

With abstract, it must be overriden, same as in java

#

Or am I somehow misunderstanding u

tender shard
#

i want to have a list of classes and then create an instance of any of those for a given material

#

guess I'll just use reflection and call the constructor

inner mulch
#

can someone tell me what causes a no access error when compiling the plugin? I guess no access but how do i change that, as I didnt clarify the class as private or something.

rotund ravine
#

Give us your error mister

#

There is plenty of errors for no access

tender shard
inner mulch
#

it just says no access to package name

echo basalt
#

what about an interface

#

you can do somn like this in java

inner mulch
tender shard
#

File -> Project Structure -> JDK

echo basalt
#

Map<Class<? extends ...>, Function<Material, ...>>

rotund ravine
undone axleBOT
inner mulch
tender shard
echo basalt
#

or just have a list of Function<Material, ...>

#

not necessarily

#

at least in java you can do stuff like

rotund ravine
echo basalt
#

Function<Material, MyWhatever> whatever = MyWhatever::new

rotund ravine
#

Your IDE only tells us one line though

inner mulch
rotund ravine
#

Give us some images etc

inner mulch
#

?paste

undone axleBOT
inner mulch
#

wait ill translate

#

translated to english

rotund ravine
#

Ehh @echo basalt maven

echo basalt
#

Basically the way I do it is like

public interface MyObjectProvider {

  MyObject provide(Whatever whatever); // whatever your usual constructor is

}
public class MyFancyObject extends MyObject {

  public MyFancyObject(Whatever whatever) {
    super(whatever)
  }

  ...
}
public class MyObjectFactory {

  private final Map<String, MyObjectProvider> providers = new ConcurrentHashMap<>();

  public MyObject provide(String provider, Whatever arg) {
    if(provider == null || arg == null) {
      return null;
    }

    MyObjectProvider registeredProvider = this.providers.get(provider);

    if(registeredProvider == null) {
      return null;
    }

    return registeredProvider.provide(arg);
  }

  public void register(String key, MyObjectProvider provider) {
    this.providers.put(key, provider);
  }

  public void registerDefaults() {
    this.register("my-fancy-object", MyFancyObject::new);
  }
}

@tender shard

echo basalt
#

alex is

rotund ravine
#

Thought alex wasn’t here atm

#

So u were next best

echo basalt
#

I legit use gradle exclusively and I suck at it

inner mulch
#

so maven bad gradle good?

rotund ravine
#

Oh

#

Well

#

I enjoy gradle more

echo basalt
#

50/50

rotund ravine
#

Allows me to easily write my own tasks etc

echo basalt
#

brb putting wings in the air fryer

inner mulch
#

jan do you know why maven does this to me?

tender shard
#

which JDK are you using?

inner mulch
#

jdk 20

#

looks like this

tender shard
#

?paste pom

undone axleBOT
tender shard
#

run mvn clean package -X then send the full log

inner mulch
#

where's the console, i can only find the read only one?

tender shard
#

ofc in the maven tab instead

#

button should look the same

inner mulch
#

?paste

undone axleBOT
tender shard
#

that's not the full log

inner mulch
#

ok

#

i guess ill send the rest before the error

#

?paste

undone axleBOT
inner mulch
#

it's super long tho

ocean hollow
#

how can I add 150 items to inventory? should I use a for loop? I just don’t see the quantity in the arguments to addItem()

inner mulch
tender shard
#

then send it as text file here

tender shard
ocean hollow
#

isn't 64 the maximum?

#

or can I set 150 to the item?

#

or when adding there will be a lot of them

quaint mantle
#

But their are useful apis such as ItemBuilder, you can find it online its one class. All you have to call is

myItem = new ItemBuilder(Material.EGG)
unsafeStackSize(true).
amount(#yourStackSize)

#

Very useful, i use it my plugin for my survival games to allow potions to be stacked!

tender shard
#

try updating maven-compiler-plugin to 3.11.1, then run mvn clean package and send paste again (without -X this time)

inner mulch
#

okay

tender shard
#

3.12.1*

#

why can't I add to an arraylist in kotlin lol

shadow night
#

Is kotlin goofy

tender shard
#

ah it's gotta be MutableList<Column> instead of MutableList<out Column>

quaint mantle
tender shard
#

in java it'd have been the same, ? extends vs ? super

shadow night
#

Why does kotlin look like typescript with a bit more oop

quaint mantle
#

Bro kotlin looks mad confusing

tender shard
#

yeah I think so too

shadow night
#

I should try writing a plugin in kotlin

#

Gotta translate my libraries ExamplePlugin to kotlin lel

agile hollow
#

how can i check in bungeecord the data of the Plugin Messaging ?

quaint mantle
quaint mantle
agile hollow
tender shard
quaint mantle
quaint mantle
#

Im pretty sure bungeecord has a specific category for connecting players to servers. You can read that online

agile hollow
agile hollow
#

because the wiki say SubChannel https://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel/
But i used that https://www.spigotmc.org/threads/yet-another-plugin-messaging-tutorial.523693/ and i didn't understand how can i check my X item

echo basalt
#

Well

#

I'd probably avoid the bungee messaging channel

#

because while it's neat it's incredibly flawed

quaint mantle
echo basalt
#

And given you're making custom events you should have enough knowledge to dabble in making your own communication platform

quaint mantle
#

You need to use out.toByteArray()

echo basalt
#

I should write a forum thread about sending data between servers

agile hollow
echo basalt
#

yeah in that sense it's simple

#

sending a player to a bungee server is a good use-case scenario

#

I wouldn't use it for anything else

agile hollow
warm galleon
#

caut un developer roman cineva interesat?

agile hollow
#

the only part i'm having problem now it's the check of a SubChannel in the bungeecord

echo basalt
warm galleon
#

ok

shadow night
#

√π

echo basalt
#

?services for general development services

undone axleBOT
echo basalt
#

I'd look for a niche romanian dev community or a service team

quaint mantle
warm galleon
#

can you give me his discord account?

#

@quaint mantle

quaint mantle
#

I will.

echo basalt
#

only romanian dev I can vouch for is masecla22 but I doubt you can afford him

quaint mantle
#

My guy is expensive

shadow night
#

Is he that expensive

echo basalt
#

similar pricing to me

#

except he speaks more romanian than I do

shadow night
#

Lol

echo basalt
#

I understand a solid 30% of the words

shadow night
#

I understand a solid nothing

agile hollow
#

why nothing appen if i make the way for send and for get the data
Spigot:

    public void onInventoryClick(InventoryClickEvent event) {
        Player p = (Player) event.getWhoClicked();
        if (event.getSlot() == 11 && event.getInventory().getName().equals(ChatColor.DARK_PURPLE + "Host Command")) {
            this.main.getServer().sendPluginMessage(this.main, "custom:mytestchannel", "sumo".getBytes());
        }
    }```
Bungee:

```    @EventHandler
    public void onPluginMessageReceived(byte[] message, PluginMessageEvent event) {
        ByteArrayDataInput in = ByteStreams.newDataInput(message);
        String subchannel = in.readUTF();
        if (subchannel.equals("sumo")) {
            ServerInfo sumo = ProxyServer.getInstance().getServerInfo("sumo");
            ProxiedPlayer p = (ProxiedPlayer) event.getSender();
            p.connect(sumo);
        }
    }```
eternal oxide
#

you don;t need a custom channel to send a player to a server

#

there is a built in method for it

ivory depot
#
    public static boolean IsInOwnRegion(Player p) {
        Location loc = p.getLocation();
        RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
        container.get(BukkitAdapter.adapt(p.getWorld()));
        RegionQuery query = container.createQuery();
        ApplicableRegionSet set = query.getApplicableRegions(BukkitAdapter.adapt(loc));
        Iterator var6 = set.iterator();

        ProtectedRegion region;
        do {
            if (!var6.hasNext()) {
                return false;
            }

            region = (ProtectedRegion)var6.next();
        } while(!region.getOwners().contains(p.getUniqueId()));

        return true;
    }```
This function should check if players is in region which he is a owner, but every time this return false. In my another plugin this worked without any problems.
agile hollow
tender shard
#

you send "Connect" to the bungee channel, and then the server name

agile hollow
tender shard
fluid river
#

jree fav

#

hi guys

sleek estuary
#

How do I set a head and keep the head on the wall if it was on the wall before interacting? spigot api 1.8.8

warm mica
agile hollow
#

String server = in.readUTF(); // Name of server, as given in the arguments what argument?

sleek estuary
warm mica
#

Oh, you can obtain the BlockState using Block#getBlockState before setting it to air and then re-apply it when the scheduler gets called using state.update(true, false)

sleek estuary
warm mica
#

I mean getState()

agile hollow
#

String server = in.readUTF(); // Name of server, as given in the arguments what argument?

sleek estuary
warm mica
astral pilot
#

why is the zombie that i spawned loses its helmet after some time

young knoll
#

Takes damage from the sun

#

And breaks

clever lantern
#

how can i track an entity with compass

astral pilot
young knoll
#

They do on mobs that burn in the sun

astral pilot
#

how do i disable that

young knoll
#

make it unbreakable

astral pilot
#

how?

young knoll
#

itemMeta#setUnbreakable iirc

astral pilot
#

i see

#

thanks

quaint mantle
#

i have a client problem

#

event cancelling working but doesnt good work in client side

#

someone have idea ?

young knoll
#

You could run player#updateInventory

#

May need a 1 tick delay

quaint mantle
#

aight ty

silent slate
#

Hi, what event is called when a bell is rung?

young knoll
eternal night
#

searching the javadocs is pretty useful NODDERS

silent slate
eternal night
#

I mean yea

#

its not google

#

if you put in "Bell"

#

this is what you get ^

glad prawn
#

?image

#

eh

hasty oyster
#

1 sec (trying to verify)

glad prawn
#

?img

undone axleBOT
#

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

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

hasty oyster
#

Super noob Java question, what am I doing wrong?

#

I even got frustrated so I import these:

import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
#

Problematic code:

        Map<Material, Material> signPlaceOnBlock = Map.ofEntries(
            Map.entry(Material.OAK_SIGN, Material.OAK_PLANKS),
            Map.entry(Material.OAK_WALL_SIGN, Material.OAK_PLANKS),
            Map.entry(Material.SPRUCE_SIGN, Material.SPRUCE_PLANKS),
            Map.entry(Material.SPRUCE_WALL_SIGN, Material.SPRUCE_PLANKS)
        );
eternal night
#

presumably source level 8 or something ?

chrome beacon
#

I recommend just using map of

hasty oyster
eternal night
#

can you share your pom.xml/build.gradle.kts

hasty oyster
#
<?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>chunktycoon</groupId>
    <artifactId>chunktycoon</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>Chunktycoon</name>

    <description></description>
    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <defaultGoal>clean package</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <outputFile>out/artifacts/Chunktycoon_jar/Chunktycoon.jar</outputFile>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

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

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.20.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>
chrome beacon
hasty oyster
eternal night
#

<java.version>1.8</java.version>

#

yea

#

java 8 does not have those methods

icy beacon
#

Why java 8 with spigot 1.20 o.O

hasty oyster
# eternal night yea

Here's the thing I don't understand, I tried 1.20 (which I think is what I have installed) and it wouldn't work

chrome beacon
#

Java 9+

eternal night
#

its just 20 I think

chrome beacon
eternal night
hasty oyster
#

So Java 8 is 1.8, but 21 is just 21, ahhhhh

eternal night
#
<properties>
    <maven.compiler.release>17</maven.compiler.release>
</properties>
#

says baeldung

hasty oyster
#

Okay, I'll give that a go, thanks!

#

That's gross, I've been compiling with version 8 this whole time 🤮

eternal night
#

my condolences

#

that is indeed gross kekwhyper

hasty oyster
eternal night
#

I mean, do you have java 21 installed ?

hasty oyster
#

I'm pretty sure I do

eternal night
#

hmm maybe maven compiler plugin weirdness

chrome beacon
#

you might need to update maven

#

Intellij ships an old version

hasty oyster
#

That's the reason it was set to 1.8, I couldn't get anything else working

hasty oyster
chrome beacon
hasty oyster
#

How do I change the project to be set to *21? :)

chrome beacon
#

Should be in project settings

hasty oyster
chrome beacon
#

and language level?

rotund ravine
#

Whats ur maven compiler version in ur pom?

chrome beacon
#

ah wait I just noticed

hasty oyster
chrome beacon
#

the maven shade plugin is very old

#

update it to 3.5.1

hasty oyster
chrome beacon
#

also compiler plugin should be changed to 3.12.1

hasty oyster
#

It doesn't like 3.5.1

chrome beacon
#

Did you reload your pom

hasty oyster
#

Yes

#
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.12.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.5.1</version>
#

It says "Update Maven indicies", but that button seemingly does nothing ):

#

Ah

#
    <properties>
        <maven.compiler.release>17</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
#

Is that okay ^

chrome beacon
hasty oyster
#

Yeah, strange

chrome beacon
#

can you try running the mvn version command in Intellij

#

just to make sure it's not using the bundled one

hasty oyster
#

That seems to have worked, so my IDE is setup wrong is seems

chrome beacon
#

so it was still using the bundled version?

hasty oyster
#

Well, the build was a success, so I assume so?

tender shard
#

IJ should come with maven 3.9.5. otherwise you can specify the path to an installed maven version

chrome beacon
#

I was just about to say as I checked it

#

they have updated the bundled version

agile hollow
#

the ByteArrayDataInput in = ByteStreams.newDataInput(message); Need a Message what i have to input how message if i'm using it in a InventoryClickEvent?

hasty oyster
#

Okay, @chrome beacon

<artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.5.1</version>
#

So it still doesn't like 3.5.1 for the maven shade plugin

#

Any recommendations to what to set it to?

tender shard
#

it doesn't have to "like" it

#

just run mvn package

hasty oyster
#

I mean, it builds, but my IDE shows it as a glaring red number

tender shard
#

doesn't matter

#

IJ is stupid

#

if maven doesn't complain, then it's fine

hasty oyster
#

Perfect, well thanks for the help both!

#

Seems to be all good

eternal night
#

might need to smack the reload button in the maven tab

agile hollow
#

the ByteArrayDataInput in = ByteStreams.newDataInput(message); Need a Message what i have to input how message if i'm using it in a InventoryClickEvent?

wintry lynx
#

soooooo, i tried to use nms and everything broke lol

#
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find org.spigotmc:spigot:1.20.2-R0.1-SNAPSHOT.
     Searched in the following locations:```
#

Ive run build tools and its all installed but it doesnt look for local packages?

chrome beacon
#

Did you build 1.20.2

#

also you need to tell gradle to look in the local repo

#

and you'll need to find a 3rd party plugin to handle mojang mappings

wintry lynx
wintry lynx
#

Ive never worked with local files in JAVA

#

only Python

chrome beacon
#

mavenLocal() in repositories iirc

wintry lynx
chrome beacon
#

all of it?

#

or just nms code

wintry lynx
#

Anything that uses bukkit

#

including the nms

chrome beacon
#

Make sure it's loading the dependency

#

check the logs

wintry lynx
#

Its all working now :I

#

Also is it allowed to import both bukkit and bukkit-api? or will they fight each other

rough drift
#

useless to import the api when you just import bukkit

wintry lynx
#

Well importing the NMS included Bukkit killed some chat functions

rough drift
#

I guess you can import both then

#

no real issues

wintry lynx
#

specifically event.(whatever you want to access)

chrome beacon
wintry lynx
#

(event.getAction().isRightClick()
For instance the 'isRightClick()' is errored

#

and event.deathMessage is broke as well

#

most event stuff

wintry lynx
#

PlayerDeathEvent & PlayerInteractEvents

#

Player events in general it looks like

chrome beacon
#

isRightClick doesn't exist

#

well both of those are Paper api methods

wintry lynx
#

CRAP

#

That explains it

#

Swapped from Paper to Bukkit

#

downgraded

#

lol

chrome beacon
#

to Spigot*

wintry lynx
#

Im just gonna import paper and act like nothing happened

wintry lynx
chrome beacon
#

If you want Paper then you should use Paper Userdev for Gradle

#

also do keep in mind your plugin will not run on Spigot

#

and therefor cannot be published on Spigotmc

abstract rampart
#

Not sure if I'm using this event wrong or what, but I want to do some manipulation to console commands executed by other plugins, is this the right event? ServerCommandEvent No matter what I do it doesn't seem to want to fire. (yes my listener is registered)

public void on(ServerCommandEvent e) {
        plugin.info("#console executed " + e.getCommand());
}```
wintry lynx
#

Im just replacing paper dependencies with spigot capable ones. They arent that complex to change.

abstract rampart
pliant topaz
#

This may sound like a dumb question, but how would I go about adding NBT data to entitys spawned by using world.spawnEntity(Location, EntityType)?

chrome beacon
#

use the spawn method that accepts a consumer if you plan on modifying the entity

#

also what nbt do you want to change

pliant topaz
#

I'll do a text display, so it's the text of it, billboard, scale and background

tender shard
#

is it normal that EVERY material returns BUILDING_BLOCKS for creative category? o0

pliant topaz
#

i see, thx

wintry lynx
#

Yo. Anyone know what Chunk.a() does?

#

xD

#

these are very poorly labeled

chrome beacon
#

You're not using the mappings

remote swallow
chrome beacon
#

I told you two ways of doing that

tender shard
chrome beacon
#

They're using gradle

tender shard
#

that just explains on how to "read" the mappings

#

so they can lookup what chunk #a does

chrome beacon
#

ah

wintry lynx
#

This is like a treasure hunt rn

remote swallow
#

i think ive broken something

chrome beacon
remote swallow
#

because this does not add up

chrome beacon
#

also head over to the Paper discord if you need any help

wintry lynx
#

I removed the paper and swapped pretty much everything over already

#

since id like not to be locked to paper in the future

rotund ravine
molten hearth
#

?whereami

molten hearth
#

(i had to)

inner mulch
#

how do i learn math, I want to animate particles with bukkitrunnables. help pls

molten hearth
#

how to math tutorial

summer sandal
#

hey guys i need help im using chatGPT and trying to compile with Maven (InteliJ Idea) and using mc version 1.19
getting this error: Could not find artifact org.bukkit:bukkit:jar:1.19-R0.1-SNAPSHOT in spigot-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)

inner mulch
summer sandal
#

im just dumb and i have basic understanding of java

summer sandal
#

if anyone can help ty

inner mulch
#

i dont understnad cos tan

summer sandal
#

idk any spigot api

chrome beacon
summer sandal
#

ik java a bit

#

thats all

chrome beacon
#

This is Spigot

summer sandal
#

what do i cahnge in my code

agile hollow
#

how can i make a bungeecord alert by an action on spigot? (I don't want the code done i want where i can find it in the wiki)

tame wolf
#

Can you explain more clearly

sleek estuary
#

When editing the ItemMeta of an ItemStack in a player's inventory, it doesn't update right after setting the itemmeta? Because if I don't have the commented line, the itemmeta is set for the first time and the lore updates, but if I set the itemmeta again, the lore no longer updates, but if I uncomment the print line, the lore always updates like the expected.

pseudo hazel
#

getItemStack will probably get you a copy of the itemstack, not a reference, but im unsure

agile hollow
tender shard
agile hollow
#

how can i make a bungeecord alert by an action on spigot? (I don't want the code done i want where i can find it in the wiki)
Like after a player clicked a slot in a gui and it will send a message every 30 seconds in all the server within the bungeecord for like 3 times

chrome beacon
tender shard
sleek estuary
sleek estuary
#

fixed

shadow night
#

can I somehow get all blocks that have BlockPDC when a chunk is loaded?

eternal night
#

given blockpdc isn't a native thing, check whatever API you are using for it

tender shard
shadow night
shadow night
#

hmm

tender shard
#

hmm?

shadow night
#

I'll see if that works, thanks

heavy void
#

Someone knows a server where i can get support for deprecated version?

heavy void
#

Im backporting to 1.7.10 development cause im helping on a 1.7.10 cauldron server, obs: im developing on SpigotAPI, not CauldronAPI

sullen marlin
#

?whereami

quaint mantle
#

@past fulcrum you're using paper api

#

Spigot hasn't implemented the adventure api

past fulcrum
#

ah, right

#

my bad

quaint mantle
#

But

past fulcrum
#

I shall take this elsewhere

quaint mantle
#

it's almost the same thing

#

MiniMessage.miniMessage().

#

And you can see all the methods there

#

Instead of java strings you represent them with a Component

past fulcrum
#

Yeah

quaint mantle
#

What were u confused abt?

past fulcrum
#

CommandSender#sendMessage(String) is now marked obsolete and ChatColor is deprecated, what should I use in order to send messages then? Making a new component for each message seems a bit inconvenient

#

This is Paper API stuff tho

#

I'll take it to their Discord

shadow night
#

Paper api = paper server

pliant topaz
#

I just can't get it to work

chrome beacon
#

?paste your code

undone axleBOT
pliant topaz
#

I basically don't have much code:
```super(location.getWorld().getHandle())````getHandle doesn't exist

#

and everyone is using it

chrome beacon
#

That's nms

pliant topaz
#

oh

chrome beacon
#

getHandle is what would grab the nms object of the World

#

You do not need to do that, just use the methods I told you about

inner mulch
#

hello, does somebody know a good tutorial on working with particle effects (how sin cos and tan works and stuff) ?

chrome beacon
#

You want a math lesson?

inner mulch
#

i guess, yeah

#

i dont understand how to calculate this stuff

pliant topaz
chrome beacon
#

A consumer is a functional interface provided by the java api

#

Essentially what you do is pass that method a lambda function in which you modify the entity

chrome beacon
# inner mulch hello, does somebody know a good tutorial on working with particle effects (how ...

This math video tutorial provides a basic introduction into trigonometry. It covers trigonometric ratios such as sine, cosine, and tangent. It explains how to evaluate it using right triangle trigonometry and SOHCAHTOA. In addition, it explains how to solve the missing sides of triangles and how to find the missing angles using inverse trig f...

▶ Play video
inner mulch
#

oh no

#

do you think i can calculate circles after this?

pliant topaz
#

for example, if I'd like a zombie named 'Zombi' what would that lookj like?
Would I have to use like the classes of the entity, here EntityTypes.ZOMBIE?

chrome beacon
#

The parameter is the entity being summoned

#

in the method body you place the code modifying said entity

chrome beacon
#

Once you understand how it works and you're able to visualise it, it shouldn't be to hard

inner mulch
#

i hope so, im currently going insane

chrome beacon
inner mulch
#

thank you

chrome beacon
pliant topaz
#

tysm ❤️

#

I really felt kinda lost 🥲

chrome beacon
#

It's slightly more advanced java

#

so it might be hard if you haven't encountered generic and functional programming before

pliant topaz
#

I came here from Python and a bit of C# so yeaa haha

#

Started learning Java a few weeks ago and didn't really get into stuff like that a whole bunch

grim hound
#

Yo

#

I wanna switch to like maven/gradle

#

Probably gradle

#

since I currently build it with artifact compiler

#

But too many libraries I'd want to use don't have a jar file

chrome beacon
#

Maven is easier to learn

eternal night
#

library that don't have a jar file ??

chrome beacon
eternal night
grim hound
#

But I'm currently building my plugin with a jarinjar

grim hound
#

That I could download

chrome beacon
#

Yeah that's what maven points to

#

well a pom and a jar

#

You can grab the jar from any maven url if you know the format

grim hound
eternal night
#

jar in jar dependency ?

chrome beacon
#

You want to shade or bundle jar files?

eternal night
#

usually you'd just shade yea

grim hound
chrome beacon
#

It's not that bad

grim hound
#

But kinda

#

The jarinjar is my own plugin

eternal night
grim hound
#

And the main jar loads the jarinjar depending on server environment

chrome beacon
#

I wouldn't say that maven is much slower than gradle when it comes to smaller projects plugins

grim hound
#

So like Bukkit, Velocity etc

sullen marlin
#

every gradle project I've ever had the misfortune of trying to compile has taken forever

chrome beacon
grim hound
#

But the opposite to gradle

#

No.

#

I wanted to type "heard"

chrome beacon
#

Gradle is a pain every time I have to deal with it

eternal night
#

tbf, pick whatever you'd like. Does not really matter

chrome beacon
#

^^

eternal night
#

if you start with gradle and it explodes in your face, switch to maven

grim hound
#

Gradle it is

remote swallow
eternal night
#

and well, including the entire jar file directly in the "wrapper" thing you have is a bit of work that I don't think gradle provides an inbuilt solution for

remote swallow
#

my shade plugin was out of date so i got a mis version error and swapped to gradle

grim hound
grim hound
eternal night
#

load ?

grim hound
#

Ye?

eternal night
#

load or build ?

grim hound
#

Well I guess build

eternal night
#

Well not natively

grim hound
#

Cuz if it builds it'll load

eternal night
#

the server loads a jar

#

gradle builds it

grim hound
#

And I load the jarinjar

chrome beacon
grim hound
#

xD

#

Yeah

#

Hmm so it is possible on maven?

chrome beacon
#

If you can do it with artifacts you can do it with maven/gradle

grim hound
#

Pretty sure artifacts use gradle

#

That's why my compilations takes about 2s

#

Well skipping that

#

Is there a way to create a virtual server?

#

Like the spigot server opens up

#

And I create a smaller virtual server?

#

But it's like a completly different server

#

That players could connect between

ocean ocean
#

maybe bungeecord

#

does anyone know how would I be able to make a custom recipe craftable just once?

grim hound
#

And save the info

grim hound
ocean ocean
#

yeah ik but that was the closest thing that came to my mind

eternal night
#

no, you cannot spin up a "virtual" server

#

whatever that means

next zinc
#

Does anyone know of a working scoreboard api or just a good tutorial that can cover the creation of one? I've tried YT and google and can't find anything that works for 1.20

chrome beacon
#

Never used it, but that's what I found

river oracle
#

FastBoard is pretty great

#

can def vouch for it

next zinc
#

Is there any other examples for FastBoard because I just tried it and it didn't seem to work

#

most liekly I did something wrong if others can vouch for it but nothing popped up

#

after going through its example

chrome beacon
#

?notworking

undone axleBOT
#

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

next zinc
#

?paste

undone axleBOT
next zinc
#

All I did was copy the example to test if it works

#

No errors or scoreboard

sullen marlin
eternal night
#

I mean, I guess updateLines is a bit less verbose than creating and maintaining scores

fleet kraken
#

I want to hook my plugin in other my plugin, where i can add it in intellij? i'm using maven

sullen marlin
eternal night
#

¯_(ツ)_/¯

sullen marlin
eternal night
#

I mean, idk what the impl does

worldly ingot
#

because S P E E D

eternal night
#

✨ ASYNC PACKETS ✨

river oracle
# sullen marlin whats wrong with the api?

nothing wrong with the API I suppose its something wrong with how NMS represents scoreboards. When I made minigames a bit back I much prefer to run updateLines over maintaining the weird teams and objects nms requires

fleet kraken
river oracle
#

The fact its packets is not an appeal for me

#

Its just a nice API

grim hound
eternal night
#

I mean yea, if you think of scoreboards only to the degree that they display text like that xD

river oracle
sullen marlin
river oracle
#

they are quite literally that

eternal night
#

Yea

river oracle
#

I've never used a scoreboard outside of that capacity

eternal night
#

so obviously that has a leg up above a general purpose server api for scoreboards kekwhyper

fleet kraken
sullen marlin
#

the dependency will be a <dependency> section with the groupID/artifactId/version from the other plugin

#

assuming the other plugin also uses maven

#

post the pom.xml of both plugins

astral scroll
#

commands can run async?

#

hell nah i think it cant

chrome beacon
#

to add it to your local maven repo

grim hound
#

Btw, how does server engine version updating work?

eternal night
grim hound
#

Like mojangs updates their server software

eternal night
fleet kraken
grim hound
#

And if md5 wants to update spigot

#

Doesn't he have to modify every single class?

eternal night
#

not really ?

worldly ingot
#

There's tooling behind a lot of it

#

Semi-automated

grim hound
#

That's what I thought

eternal night
#

you update like, Material enum, Tag, etc. in the API

grim hound
#

But it needs to know which classes changed

eternal night
#

and then well, you need to get all patches to apply

#

well, dunno what spigot does, paper you basically attempt to apply as many patches as possible.
If something in the decompiled server source changed, patch fails to apply

worldly ingot
eternal night
#

fix patch apply

#

and so on

grim hound
eternal night
#

indeed

grim hound
#

So how do you guys do it so fast?

#

It seems like a lot of work

eternal night
#

Our team is a bit larger than spigots ?

grim hound
#

I mean spigot included

eternal night
#

oh

#

I mean, md gets to update to like, snapshots

grim hound
#

Like 1.17 came out and changed a lot

eternal night
#

so they have a lot of time

grim hound
eternal night
#

presumably ?

#

who knows, its not a public process kekwhyper

#

but yea, given spigot update times when the releases come out, spigot is updated prior to the release.

grim hound
#

We can ask the big boi himself

eternal night
#

If that starts at pre-releases or snapshots, who knows

grim hound
#

Maybe Paper and Spigot could unite and form like a SuperEngine

#

So that no unoptimized code is present

eternal night
grim hound
#

What?

eternal night
#

I mean, that is paper I guess

#

can say the same about its forks

#

every fork has its reasons to be a fork

grim hound
#

But it still relies on spigot

eternal night
#

purpur relies on paper

#

like, what is the point xD

#

its stiff a different software with different goals

grim hound
eternal night
#

was more of an example

#

Like, paper has a different vison for the server than spigot and purpur

#

so, three different projects it is

grim hound
eternal night
#

paper wouldn't include purpurs like WASD configuration option to ride random mobs

grim hound
eternal night
#

spigot (probably) won't include papers entire deprecation of legacy text methods or hard removal of sand duping e.g.

eternal night
#

sorry, legacy text

grim hound
#

I never knew

eternal night
#

legacy text ?

grim hound
#

Not only

#

Like I always see

#

"Initializing legacy material support"

eternal night
#

legacy in general means something that is beyond its support cycle

#

legacy materials (those identified by int ids and shit) are no longer a thing

#

they should not exist

#

but to keep old plugins running, spigot does some legacy support

grim hound
#

Won't a simple HashMap do?

eternal night
#

no

grim hound
#

Oh you mean like enums

#

Hmmm

eternal night
#

there is a lot of work going into supporting old plugins

#

spigot basically rewrites your plugins code

grim hound
eternal night
#

yea

grim hound
#

How exactly?

grim hound
#

Btw, are events created and called even if there are no listeners?

eternal night
#

Most, yea

#

some not (the really often called once)

grim hound
#

I should start doing that type of naming

eternal night
grim hound
#

Damn

#

This stuff seems really thought out

eternal night
#

well it has a lot of work to do to support 1.8 developers OMEGALUL

grim hound
#

I don't know what half of this means

#

Never have I rewritten a compiled class

#

Btw why does Paper only support the AsyncTabComplete?

eternal night
grim hound
#

From what I've seen the sync version isn't invoked

#

But like, there aren't other async events

#

of already existing sync ones on Paper

eternal night
#

Note that due to client changes, if the sender is a Player, this event will only begin to fire once command arguments are specified, not commands themselves. Plugins wishing to remove commands from tab completion are advised to ensure the client does not have permission for the relevant commands, or use PlayerCommandSendEvent.

grim hound
#

Like PlayerMoveEvent

eternal night
#

open a bug report I guess ? ¯_(ツ)_/¯

grim hound
#

The argument suggestion after command

grim hound
#

Or maybe it's a ViaVersion issue

#

Since the blindness effect didn't work as well

eternal night
#

HMM xD

grim hound
#

Yeah

#

1.20 server with a 1.17 client

eternal night
#

paper would deprecate stuff if it does not work. Tho like, we generally maintain compat so even then it should still be called.

#

might very well be via

grim hound
#

I spoofed a blindness effect

#

It showed in the client's effects in gui

inner mulch
#

is there a ressource on how to create custom advancements?

grim hound
#

But it didn't have any other visual effects

inner mulch
#

thank

#

s

grim hound
#

They linked their github code there

#

Btw

#

How is a buffer translated into a packet object?

glossy venture
#

it reads the type int

grim hound
#

Is the id read, put into a map with constructors and constructed?

glossy venture
#

then instantiates a packet object

grim hound
#

Cuz if it ain't a switch case

#

Amma be mad

glossy venture
grim hound
eternal night
#

packets have a constructor that takes a friendly bytebuf

glossy venture
#

i dont remember i think constructor taking in the buffer

#

yeah

#

its pretty simple then it just reads the data in order

eternal night
#

it is not a switch statement tho xD

grim hound
eternal night
#

but like

#

no

#

List

#

the packet ids are continuous

grim hound
eternal night
#

its a single array access

#

fast af

grim hound
glossy venture
#

very limited

grim hound
#

Pretty much the same speed as a switch

grim hound
glossy venture
#

probably even slower than just an array access only thing is reflection but its not too slow on newer java

eternal night
#

its not even reflection

glossy venture
glossy venture
eternal night
#

yea

glossy venture
#

which does it

#

ah

#

makes sense

grim hound
#

I don't know exactly but maybe even faster than array access

glossy venture
#

its a branch

#

which is bad

grim hound
#

Doesn't have to be

#

Since you just need to return the packet

eternal night
#

I mean, array access is worse than branch

glossy venture
#

w/o optimizations itll first branch then call the function

glossy venture
eternal night
#

yea

#

not that that happens a lot

grim hound
eternal night
#

ig

grim hound
#

Uhh

eternal night
#

both of them are stupid fast

grim hound
#

Ye

eternal night
#

its w/e

glossy venture
#

true

grim hound
glossy venture
#

javac barely does optimizations

#

jvm figures it all out at runtime

#

later

grim hound
#

But it fuckin unoptimizes

grim hound
glossy venture
#

conceptually in a switch ur jumping to the appropriate code and then calling the constructor