#help-development

1 messages · Page 1310 of 1

thorn isle
#

If anything, adding more instances just adds more overhead because the separate application instances can't share resources

wet breach
#

they actually can

#

you can use memory mapping to do this

thorn isle
#

Not without making major changes to the jvm

wet breach
#

nope its native

thorn isle
#

You're approaching the "rewrite the server" territory

wet breach
#

Well, technically if you want more then 300 players while still maintaining performance you will indeed need to rewrite some or a good portion

#

and that has always been the case really

#

I said it was possible, just didn't caveat it yet with the probably going to take some work though part lol

#

As I have always said, you can't expect to get free enterprise software

#

although there is some exceptions like apache and mysql lmao

thorn isle
#

what were we even talking about

#

i just read sharding

wet breach
#

They wanted to get 300 players on a single server

#

and then a bit later they said they are doing skyblock

#

then from there, it was about folia and then sharding and then caveats of the two I guess

thorn isle
#

having a lobby and the dungeons on separate instances has many advantages, so that sounds about right

#

for the skyblock backend, i'd probably use folia for it

#

if worse comes to worst it won't be too late to switch it out for sharding if you eventually do need it

#

if you play your cards right, the dungeons instance not having the skyblock commands can be an advantage; most of those commands probably shouldn't be usable in a dungeon anyway

#

a lobby instance, especially for a cracked server, is useful as an auth sandbox

ivory sleet
#

Folia or if u got competent devs maybe multipaper

thorn isle
#

and of course as a place to toss players when a backend is undergoing a restart

misty ingot
#

i work for a server with a few hundred ccu, we use folia and its going pretty great

#

we did have to make some changes to the original software

#

but it works

#

i wonder what hypixel uses

sullen canyon
#

hygot

wet breach
misty ingot
#

they are on 1.7?

#

i thought they were on 1.8

#

they should really work on maybe updating
theres so much cool stuff in 1.21 and i wonder what those guys could do with that

worldly ingot
#

We support the 1.8 protocol, but Hygot is based on the 1.7 codebase, yes

#

Everything in modern versions has to be implemented manually by us though. We're so far derived from vanilla or Spigot

#

So we implement what we need

misty ingot
#

interesting

slender elbow
#

"hygot" 💀

worldly ingot
#

We've got a lot of fun names that I can't reveal cause they're not public lol

#

Some of them are pretty good

slender elbow
#

i don't believe you

#

i bet they are all terrible

#

but you can't prove me wrong

grim ice
#

LOL

worldly ingot
#

We have a housing furniture store in-game called Hykea

slender elbow
#

okay that one's pretty good

misty ingot
slender elbow
#

he could accept my application and then tell me about 'em

#

run

misty ingot
#

i dont even understand how hypixel is still alive
i get that it gets tens of thousands of players but aren't the costs like millions of dollars?

slender elbow
#

millions of dollars in what timespan?

misty ingot
#

every year

eternal night
#

a night shy_point_pixel

misty ingot
#

probably

#

just thinking of professional developers and server costs

grim ice
#

almost every player buys a rank

#

I'd say like 80% of players have ranks

misty ingot
#

i have noticed that hypixel has a pretty high conversion rate

grim ice
#

alao

misty ingot
#

i wouldnt say 80% tho

grim ice
#

Skyblock makes a lot of money

misty ingot
#

it does
but its dying from what ive seen

#

(unfortunately)

grim ice
#

yeah it's been dead for a while

#

fortunately*

#

it's a mid game

misty ingot
#

i like it 🙁

#

i have like 1k hours in sb

#

but still like how much could it possibly be making
thats what confuses me

#

either the average hypixel player is a big spender

#

or their costs are way lower than i think

thorn isle
#

whales

slender elbow
#

i mean, it's not like they have thousands of developers

#

they have choco

#

and that's all

wet breach
#

choco is all they need

slender elbow
#

yet he charges millions a year

worldly ingot
#

I'm an expensive bitch

cobalt drift
#

Hello,
I need help with NMS implementation. I dont know where I should start to get it implemented into my plugin. I know I need to get a Server JAR but idk how. I also dont know how to implement it then into my plugin.
Can someone help me?

winter jungle
#

?nms

cobalt drift
cobalt drift
cobalt drift
#

Now, I downloaded the BuildTools and built the JAR with that command:
java -jar BuildTools.jar --rev 1.18 -remapped
What's next? How can I include the Server JAR into my plugin so I can use NMS?

rotund ravine
#

?nms

rotund ravine
#

Oh

cobalt drift
# rotund ravine Oh
repositories {
    mavenCentral()
    mavenLocal()
    maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
    maven("https://oss.sonatype.org/content/repositories/snapshots")
    maven("https://oss.sonatype.org/content/repositories/central")
    maven("https://repo.opencollab.dev/main/")
    maven("https://repo.extendedclip.com/releases/")
    maven("https://jitpack.io")
}

dependencies {
    compileOnly("org.spigotmc:spigot:1.18-R0.1-SNAPSHOT")
}

That one works but the NMS code is still obfuscated. What do I have to change? I provided the -remapped argument for the BuildTools

slender elbow
#

for gradle there is a gradle plugin you need to use

#

huh, it does not show the dep declaration

#

cool

#

anyway, i think you need to use the spigot-remapped artifact instead of just spigot

#

idk

rotund ravine
#

Tbh, if it’s too much of a chore just use paper for it. They got plenty of documentation for gradle

cobalt drift
slender elbow
#

the readme says that's the default

cobalt drift
#

Because I heard that Mojang also gives non obfuscated code but it's not allowed to publish work with that

slender elbow
#

that is not entirely correct, but that is the correct setting yes

sly topaz
#

change your dependency to org.spigotmc:spigot:1.18-R0.1-SNAPSHOT:remapped-mojang

#

just make sure you have ran buildtools for that version with the --remapped argument before

sly topaz
#

someone had to do it

cobalt drift
#

Now I got NMS in my project. How can I now get the TranslatationKey?

chrome beacon
#

You need the remapper plugin

chrome beacon
cobalt drift
chrome beacon
#

Until you run the plugin

cobalt drift
sly topaz
#

You need to remap the plug-in afterwards otherwise it’ll be compiled with Mojang mappings

chrome beacon
sly topaz
#

Was getDescriptionId a method on the ItemStack or the Item instance tho

#

If it is on the item then you’ll have to do getItem on the nms stack and then getDescriptionId to that

rotund ravine
cobalt drift
#
public final class CraftItemStack extends org.bukkit.inventory.ItemStack {
    net.minecraft.world.item.ItemStack handle;
}

But in the class there is a handle var. unfortunately the variable is private. Do I have to access it via reflection?

sly topaz
cobalt drift
#

Ah there is an static asNMSCopy method
public static net.minecraft.world.item.ItemStack asNMSCopy(org.bukkit.inventory.ItemStack original)

#

Gradle fails to build my plugin:

plugins {
    id("java")
    id("com.gradleup.shadow") version "9.0.0-rc1"
    id("io.github.patrick.remapper") version "1.4.2"
}
repositories {
    mavenCentral()
    mavenLocal()
    maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
    maven("https://oss.sonatype.org/content/repositories/snapshots")
    maven("https://oss.sonatype.org/content/repositories/central")
}
dependencies {
    compileOnly("org.spigotmc:spigot:1.18-R0.1-SNAPSHOT:remapped-mojang")
}
tasks {
    build {
        dependsOn(shadowJar)
        dependsOn(remap)
    }
    remap {
        version.set("1.18")
        action.set(RemapTask.Action.MOJANG_TO_SPIGOT)
    }
}

Error

Execution failed for task ':spigot:remap'.
> java.nio.file.NoSuchFileException: /home/tommy/Workspace/IdeaProjects/CaseOpening/spigot/build/libs/spigot-1.0.0.jar
keen fjord
#

can someone help me

#

because my luckperms wont show in chat i have every plugin required

#

instead of showing luckperms ranks it shows the world name

#

somebody help

rotund ravine
#

What plugins do you have

#

@keen fjord

keen fjord
pine forge
#

Is it possible to automatically upload plugins to spigot using some api?

sullen marlin
#

Nope

winter jungle
# sullen marlin Nope

Would it be worth considering doing this? It would make things a lot easier if my GitHub workflow uploaded the plugin.

pseudo hazel
#

thankfully

#

and get free bot spam?

drowsy helm
#

they dont allow bots for scraping or anything like that lol

winter jungle
thorn isle
#

just use ci for ci

#

you can set an external download link on spigot

winter jungle
sly topaz
#

anyhow, it has been discussed many times on the forums and the conclusion was always that it wasn't worth the effort given md is the one having to do all that

#

IIRC biggest hurdle was the fact that the xenforo plugin that spigot uses for the resource manager wasn't made by spigot so adding an API would require mantaining their own custom version (created from scratch, since the xenforo addon isn't open-source), which would have its own share of troubles

outer ember
#

how to execute a command without this wierd message to operators?

[Console : ... ]

slender elbow
#

isn't that a property in server.properties?

#

broadcast-commands-to-ops or something like that

misty ingot
#

ye

#

it is

outer elk
#

looking free api for transport player datas to other servers
like inventory, food level, xp

misty ingot
#

if the servers are connected through bungee proxy you could use the server messaging protocol i think that's what its called

outer elk
#

im looking free api for this

misty ingot
#

the bukkit api is pretty free
if you are gonna do it then thats a good way to do it

#

also some external api would also just use it anyway under the hood

#

what exactly are you trying to do? whats the use case?

outer elk
faint prawn
#

yes

violet blade
#

oh hi lol

violet blade
solid crag
#

Hello,

I have an issue with ItemStack serialization.

The issue is when I'm trying to serialize an item, the serialization force the Components (displayName and lore) colors value...

This is my code (very simple):

    public String itemToBase64(ItemStack item) {
        if (item == null) {
            return Base64.getEncoder().encodeToString(new byte[0]);
        }

        return Base64.getEncoder().encodeToString(item.serializeAsBytes());
    }

    public ItemStack itemFromBase64(String data) {
        if (data == null) return null;

        final byte[] bytes = Base64.getDecoder().decode(data);

        if (bytes.length == 0) return null;

        return ItemStack.deserializeBytes(bytes);
    }

And with the screenshot you can see the difference between the 2 items. The left item is the serialized and stored item, the right item is the original item on my inventory.

Thank you very much !

Screenshot:
https://prnt.sc/JU1tER5mRRop

plush sluice
#

How can i force remove player's FishHook from the world?

faint prawn
#

then rotates those points around the stand’s facing direction (its yaw), so the line is always aligned with the armor stand’s rotation.

#

and i think it was best apporch for my use case

outer ember
#

how to execute a command without this wierd message to operators?

[Console : ... ]

thorn isle
#

weren't you already answered

misty ingot
misty ingot
outer ember
#

Oh my ping

plush sluice
misty ingot
mellow edge
#

Hello!
Is it possible to load a player as a "new" player on login? Then do login, then load his actual data. Well it is possible through nms... but in from the API standpoint...

#

If not, is it possible in ||paper||?

chrome beacon
#

Something tells me offline mode

plush sluice
mellow edge
#

I am against offline mode, but I am trying to create some sort of system, yes.

plush sluice
mellow edge
#

well what if I want my own auth system, or just something to have as a test plugin?

#

I don't think it's possible anyway through the api.

prime vortex
#

Hey i have the economy++ plugin everything works fine but i cant figure out the / sell hand command, can someone help me out

wet breach
#

and then you can do whatever you want after that

#

also, you will want to alter their UUID as well and not accept whatever the client sent

#

this way you don't re-introduce UUID spoofing lmao

outer ember
wet breach
#

oh no its the bot, thank goodness they finally read the part where they were responded to

mellow edge
wet breach
#

its not a problem

#

you just remove them from the tab list and re-send packets to everyone and re-add to tab list

#

and everyone should get the updated data

mellow edge
#

I must somehow change the uuid of a player internally for the server to recognize the data.

wet breach
#

its not hard

#

but all of this simply can not be done from the API though

#

not even with paper

mellow edge
#

ik, ik

#

no problem using protocollib/nms

mellow edge
#

@wet breach thank you for help

wet breach
#

np

thorn isle
#

Use a transfer packet to reconnect the player to the server and swap their fake uuid for their actual uuid in the prelogin event

#

Should be completely doable with the paper api, both transfers and swapping out the uuid

wet breach
#

basically they are just wanting to move the verification portion to be done later, but still allow them to join

thorn isle
#

Roll a random uuid on join, set it in the prelogin event, set auth to offline in the same event, then do your verification once the player joins in

#

Transfer the player back to the server, this time let them use their actual uuid

wet breach
thorn isle
#

Just make sure all plugins are set to actually use uuids and not names

#

I don't know if spigot let's you set the uuid either

wet breach
#

it doesn't, which is why I said you can't do what they are wanting with the API

#

also not seeing where paper allows per event auth either

chrome beacon
#

Yeah I doubt they would add that

wet breach
#

paper allows setting uuid in the profile, but not entirely sure if this applies to the player object though

slender elbow
#

yes

hasty saffron
#

I recently downloaded a vehicles plugin by pollitoyeye and it seems theres a permission issue as normal players cannot use /[vehicle]shop. Anyone else experiencing this or have an answer?

rotund ravine
sullen hatch
#

Looking for Dev
-# I need a dev for my mc server I need a custom plugin ny budget is 5 dollars dm if you can help

undone axleBOT
outer elk
misty ingot
outer elk
#

yes

thorn isle
#

i don't know off the top of my head any plugin that does this out of the box

torn shuttle
#

anyone happen to know if set view distance for text display is broken for 1.21.8 or something, it doesn't seem to be working for me

#

I swear it was working before

thorn isle
#

in what way

#

the property you set on the entity is applied clientside during rendering; ramping it up super high won't make the server send it from any farther away

young knoll
#

It’s a multiplier too iirc

#

Based on the clients entity distance

thorn isle
#

yeah, 1.0 is the default and means use the default entity draw distance on the client

stark dirge
#

so i have made a placeholder and it seems to work fine, but not sure how to make it work with essentialsx chat's chat formatting beacause it doesnt allow external placeholders maybe, any other idea so that even if a server has essentialsx chat , then also the placeholder would return the expected output?

violet blade
#

if you are using papi, you could use a chat injector to make it work with essentials

#

or you could check the source and hook it into essx's api by yourself

stark dirge
#

that plugin worked thanks

cobalt drift
#

Hi, I have a problem with the ChatComponent API. I want to send a message to the player where {name} gets replaced with the won item name. Is there a better way than this?

private BaseComponent[] buildMessageWithItemName(String rawMessage, String prefix, BaseComponent wonItemNameComponent) {
        String[] parts = rawMessage.split("\\{name}", -1);

        ComponentBuilder builder = new ComponentBuilder();

        if (prefix != null && !prefix.isEmpty()) {
            builder.appendLegacy(prefix);
        }

        if (parts.length != 0 && !parts[0].isEmpty()) {
            builder.append(parts[0]);
        }

        builder.append(wonItemNameComponent);

        if (parts.length > 1 && !parts[1].isEmpty()) {
            builder.append(parts[1]);
        }

        return builder.create();
    }

It also doesn't work like it should ...

smoky anchor
#

just... String.replace no ?

#

oh ye components right sorry :D

thorn isle
#

If you're on paper or can use adventure, they have replaceAll and similar functions on their components that allow you to search for string matches and substitute them with components

thorn isle
#

Glhf

cobalt drift
violet blade
#

for text components, yeah probably

cobalt drift
thorn isle
#

Run it through the LegacyComponentSerializer to parse them into proper components

cobalt drift
cobalt drift
violet blade
cobalt drift
#

So it's with §

violet blade
#

should work with what vcs2 suggested

cobalt drift
#

Perfect :)

cobalt drift
violet blade
#

He is talking about the adventure api

#

the only proper way to deal with text components as now on spigot without touching internals

cobalt drift
#

Can't I use a method from the spigot api?

#

Maybe the ComponentSerializer is useful?

cobalt drift
naive loom
#

anyone know how this works? im assuming something with resource packs bur confused with the rainbow and the enchanted back box

cobalt drift
#

probably itemadder

naive loom
#

Oh the imagine isnt animated that was what was confusing me the SYBAU tag was a animated rainbow gradient and the ENCHANYED had a moving background

#

Would that be the same?

violet blade
#

is that chat ?

cobalt drift
violet blade
#

yeah once the chat is sent and received it stays as is with one set of colors, the only way to animate it should be by removing and resending it every tick with diff colors

violet blade
#

you could technically add animated textures to that, i dont know how you would do that for the text part tho

naive loom
#

im sure the rainbow part is with shaders but can textures in chat be a gif / animated?

#

if so then i could just do that right?

#

thise would be dynamic and the rainbow would be static because the shader does all the work

violet blade
#

not a gif but a longer texture like this, saved like somename.png

#

and a set of instructions like this named somename.png.mcmeta

misty ingot
#

its a diff font from normal

#

so its likely a pack yes

#

the server i work for uses resource packs like this too

pseudo hazel
#

doubt

#

its maybe a shader

#

pack with shader for moving tags

#

thats my guess

worldly ingot
#

Or they're re-sending chat every tick kirbywoah

#

If that's actual in-lined chat colour animations, I would also be willing to bet it's a shader. Set it to be a really obscure colour that you probably won't use, then override the text shader to replace that colour with a rainbow effect

#

It actually would be a relatively simple shader to make too

misty ingot
#

wouldnt that require the end user to use optifine that way tho?

chrome beacon
#

you can make one with a resource pack

misty ingot
#

interesting

ripe depot
#

how do i set nbt data like VaultServerData.stateUpdatingResumesAt on a vault?

chrome beacon
#

That specific field doesn't look to be part of the api

#

so you'd need to use nms

ripe depot
#

can you explain how I would do that

chrome beacon
#

What part do you need help with?

torn crystal
#

does anyone know how to make block display smaller?

#

is that even possible?

young knoll
#

Change the scale in the transformation

plush sluice
#

i get this error while using buildtools when building 1.21.8

#

i have maven installed

chrome beacon
#

Yeah that's known issue I'm suprised it still hasn't been fixed

#

Setup your local maven install properly so BuildTools can detect and use it

#

instead of trying to download its own

chrome beacon
plush sluice
#

does it specifically need be v3.9.6?

chrome beacon
plush sluice
#

im still getting the same error

chrome beacon
plush sluice
chrome beacon
#

How are you running BuildTools?

plush sluice
#

app?

#

if thats what you mean by it

mortal vortex
#

As in, through command prompt or?

plush sluice
#

.exe*

mortal vortex
#

oh okay

chrome beacon
#

Run it using the jar and through the command prompt

#

Looks like BuildTools still checks for M2_HOME even though MAVEN_HOME replaced that one in Maven 3

#

So se that as well and see if it helps

plush sluice
#

didnt work thru cli, so i tried to install latest build tools and ran it, and now after 3mins of building it did this...

chrome beacon
#

That's odd could you run it again in an empty folder

plush sluice
#

ima try one more time

coarse hamlet
#

the rage bait 🥹

plush sluice
#

It has compiled

eternal oxide
#

Gremlins in the machine

onyx fjord
#

Must've been the wind

echo basalt
#

Is there any info on how interaction entities can lag the client?

#

We have about ~2.7k item displays in use right now and about half of them have an interaction entity as a hitbox

#

we're already looking into merging a lot of these models and implementing culling but there's room for improvement

mortal vortex
#

mfw someone replaces outdated code with modern standins 🤯

echo basalt
#

huh interesting it seems like protocollib is still the most unreliable POS library I've ever used

chrome beacon
#

hm? What's wrong

echo basalt
#

I'm trying to prevent interaction entities from being sent to the player

#

And it's detecting every single item display being sent but not any interaction entities

chrome beacon
#

can you not use the api to hide them?

echo basalt
#

It's not what I'm looking for

#

these might be client-sided

chrome beacon
#

I see, was just asking while browsing through some code

echo basalt
#

Yeah even on a MONITOR priority it doesn't work

#

I might try packetevents after gym

chrome beacon
#

yeah you'll probably have a better time with that

#

ProtocolLib is pretty painful to work with tbh

echo basalt
#

and if that doesn't work then I'll be lost

#

because I disabled hitboxes on nexo as well

#

and /kill @e[type=interaction] does nothing

slender elbow
#

i mean, that just straight up indicates they are not real server entities

#

which like, who/how is sending them then

thorn isle
#

If they're getting sent deep in the network pipeline (e.g. wire packets), PL won't see then

#

Dump your netty pipeline and see who's where

thorn isle
#
            Class<?> relEnum = Class.forName("net.minecraft.world.entity.RelativeMovement");
            enumPlayerTeleportFlags.addAll(Arrays.asList(relEnum.getEnumConstants()));

            float diffPitch = targetDirection.getPitch() - currentDirection.getPitch();
            float diffYaw   = targetDirection.getYaw()   - currentDirection.getYaw();

            //Normalize to (-360..360)
            diffYaw %= 360;

            //If greater than 180 in either direction, mod 180 and flip the sign; 270 % 180 = 90, 90 * -1 = -90
            if (Math.abs(diffYaw) > 180) diffYaw = (diffYaw % 180) * -1;

            if (Math.abs(diffYaw) < 15 && Math.abs(diffPitch) < 10) continue;

            diffYaw *= 0.05;
            diffPitch *= 0.05;

            PacketContainer packet = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.POSITION);

            packet.getDoubles().writeSafely(0, 0.0D); //x
            packet.getDoubles().writeSafely(1, 0.0D); //y
            packet.getDoubles().writeSafely(2, 0.0D); //z
            packet.getFloat().writeSafely(0, diffYaw); //yaw
            packet.getFloat().writeSafely(1, diffPitch); //pitch

            @SuppressWarnings("unchecked")
            Set<Object> relativitySet = (Set<Object>) packet.getModifier().read(RELATIVITY_BIT_FIELD_ORDINAL); //relativity bit field
            relativitySet.addAll(enumPlayerTeleportFlags);

            packet.getIntegers().writeSafely(0, ThreadLocalRandom.current().nextInt()); //teleport id
            packet.getBooleans().writeSafely(0, false); //dismount

            try { ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet); }
            catch (Exception ex) {
                ex.printStackTrace();
            }

this was in 1.20; i've since removed the logic since players found it disorienting, and i'm fairly sure the relativity set has been changed since

echo basalt
#

does java have a lazy String.replace where I can toss a supplier or something

#

I might've gone a bit crazy with my placeholder system and it's wasting a lot of time rendering strings that will never be matched

mortal vortex
#

Use Apache's StringSubstitutor @echo basalt

sly topaz
#

ah, I get what you mean now. Only replace if it finds the placeholder

echo basalt
#

Something like
"Really really big string".replace("really", () -> Whatever)

mortal vortex
#

Otherwise, what stops you from making your own:

public static String lazyReplace(String source, String target, Supplier<String> replacementSupplier) {
    if (!source.contains(target)) {
        return source;
    }
    return source.replace(target, replacementSupplier.get());
}
echo basalt
#

the contains and replace check could be merged :)

#

is my intuition

mortal vortex
echo basalt
#

Well it could in theory find the target and its start and end positions before having to call the supplier

#

I'm just not sure if apache figured that out or if it's just a utility for replacement

mortal vortex
#

I think its more extensive

echo basalt
#

I'll need to investigate

mortal vortex
# echo basalt Well it could in theory find the target and its start and end positions before h...

I see what you mean, so maybe:

private static List<Integer> findAllOccurences(String source, String target) {
    List<Integer> positions = new ArrayList<>();
    int index = 0;
    while ((index = source.indexOf(target, index)) != -1) {
        positions.add(index);
        index += target.length();
    }
    return positions;
}

public static String lazyReplace(String source, String target, Supplier<String> replacementSupplier) {

    List<Integer> positions = findAllOccurrences(source, target);
    if (positions.isEmpty()) {
        return source;
    }
    
    String replacement = replacementSupplier.get(); 
    return replaceAtPositions(source, target, replacement, positions);
}
#

or you could use boxed with streams

sly topaz
#

I'd just make a proper tokenizer at that point

mortal vortex
#

Yeah lol

echo basalt
#

ok what the fuck

#

this guy's either running this a trillion times or hosts his minecraft server on a smart toaster

mortal vortex
#

lmfao what

sly topaz
#

hasMetadata is essentially just a Map#containsKey so I wonder if it is just sampling bias

rotund ravine
#

Percentages mean shit anyway

echo basalt
#

as for MSPT it's sticking at around 80

#

2% of that going to metadata checks is still more than it should be

frozen venture
#

Hi 👋 I’m looking for some help to build my Paper 1.21.8 plugin with Gradle.
If anyone is available, could you please contact me in DM? 🙏
Thank you very much!

quaint mantle
sleek hedge
#

Hi, does anyone here know the Essentials plugin well? I'm having some problems blocking certain commands. Can anyone help me?

mortal vortex
sleek hedge
#

Yes. Is there any chat where I can ask questions about plugins?

sleek hedge
mortal vortex
#

the server channel

sleek hedge
#

thanks

torn yew
#

Why when I change remove the same letter or ' and after dm reload this menu doesn't work

#

I have 193 menus but i removed ' and dm reload - 192 menus and again i put this ' and dm reload- 192 menus
I've seen this problem in other menus from buil.b_b*t ( where there are ready-made menus ), but these menus are from my developer from 7 months ago and if I change a letter, the menu doesn't work.

sullen marlin
#

' is a quote, why are you removing it?

echo basalt
#

chat why is it that when I remove a \n the line doesn't break anymore

gaunt tangle
gaunt tangle
winter jungle
violet blade
winter jungle
#

Ohh i see, is there a way to get one sound specifically from the list of available sounds?

#

well there is probably a way, but yeah

violet blade
#

void playSound(Entity entity, Sound sound, SoundCategory category, float volume, float pitch, long seed)

#

you are particularly interesting in this https://youtu.be/-C-zQLd03Ic

Plays when the player is inside a nether wastes or basalt deltas biome.

Java Information
File name: mood3.ogg
File path: sounds/ambient/nether/nether_wastes/mood3.ogg
Sound event: ambient.nether_wastes.mood / ambient.basalt_deltas.mood
Subtitle: None
Category: Ambient/Environment
Added in: 1.16 (20w15a)

Bedrock Information
File name: mood3...

▶ Play video
#

ah look, someone already provided a list of seeds that can be useful

winter jungle
#

Thanks!

hybrid spoke
violet blade
#

i knew it was an ambience sound from the reverb but the mc wiki helped

rotund ravine
slender elbow
#

frankly using a Pattern with a literal string is very fine too, probably not as "elegant" but you don't need a whole stinking apache library for it

#
static final Pattern P = Pattern.compile("foobar", Pattern.LITERAL)

P.matcher(input).replaceAll(match -> ???)
#

and because it's a simple string literal it's dirt cheap

worldly ingot
#

(a) single-letter constants 😔
(b) Isn't Apache text already shaded into Bukkit?

dull atlas
#

Hey, I made a move-able building and I just added a function to move all entities inside of its bounding box, however when I try to teleport the player, I feel like it resets its camera to previous tick or smth, so I was wondering if there's a way to teleport the player without resetting its pitch & yaw? I'm not entirely sure of the source of this issue, so here's a video and my code:

public void moveEntities(World world, Location posA, Location posB, int dx, int dz) {
        BoundingBox area = new BoundingBox(posA.getX(), posA.getY(), posA.getZ(), posB.getX(), posB.getY(), posB.getZ());
        Collection<Entity> entities = world.getNearbyEntities(area);
        for(Entity entity : entities) {
            Location loc = entity.getLocation().add(dx, 0, dz);
            entity.teleport(loc, PlayerTeleportEvent.TeleportCause.PLUGIN);
        }
    }```
slender elbow
smoky anchor
eternal oxide
#

EyeLocation has pitch and yaw, not sure entity location has teh correct value

dull atlas
#

I mean, I do teleport the player relatively with entity.getLocation().add(dx, 0, dz);,
I can try to do via command but I have some doubts, still doesn't hurt to try it ig

eternal oxide
#

but spigot teleport does support pitch/yaw

smoky anchor
#

no I mean that the TP packet literally has "relative flags" which I doubt are added by the teleport function in API in any way
If you TP with yaw/pitch then you would take the servers latest value which will not be up to date 'cause ping exists

dull atlas
#

Oh wait so you meant like to use the tp command to only use relative pos and ignore pitch yaw right

smoky anchor
#

I think that way the clients yaw and pitch will be taken instead, I do not know tho

#

I know there was a guy who was trying to do recoil and that involved TP as well
something similar

dull atlas
#

Sound logical, I will try that

#

Last time I tried to dispatch commands, it was burrying the console so I'll see if there's a "cleaner" way to do it with flooding 😅

smoky anchor
#

Well you can always just teleport directly with NMS :D

dull atlas
#

Oh yeah, I'll check that out (haven't used much NMS, been dark sorcery for me ngl xD)

outer ember
#

Is there any way to test my newer version of my plugin without restarting server with something like reload?

pine forge
#
repositories {
    mavenCentral()
    maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
    maven("https://oss.sonatype.org/content/repositories/snapshots")
}

dependencies {
    compileOnly("org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT")
}```

Hey, i get this error, when i try to compile the gradle project
```Configuration cache state could not be cached: field `provider` of `org.gradle.internal.serialize.codecs.core.ProviderBackedFileCollectionSpec` bean found in field `element` of `java.util.Collections$SingletonList` bean found in field `elements` of `org.gradle.internal.serialize.codecs.core.ResolutionBackedFileCollectionSpec` bean found in field `__classpathSnapshot__` of `org.jetbrains.kotlin.gradle.tasks.KotlinCompile$ClasspathSnapshotProperties_Decorated` bean found in field `__classpathSnapshotProperties__` of task `:compileKotlin` of type `org.jetbrains.kotlin.gradle.tasks.KotlinCompile`: error writing value of type 'org.gradle.api.internal.provider.DefaultProvider'
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find net.md-5:bungeecord-chat:1.12-SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/net/md-5/bungeecord-chat/1.12-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/net/md-5/bungeecord-chat/1.12-SNAPSHOT/bungeecord-chat-1.12-SNAPSHOT.pom
       - https://hub.spigotmc.org/nexus/content/repositories/snapshots/net/md-5/bungeecord-chat/1.12-SNAPSHOT/maven-metadata.xml
       - https://hub.spigotmc.org/nexus/content/repositories/snapshots/net/md-5/bungeecord-chat/1.12-SNAPSHOT/bungeecord-chat-1.12-SNAPSHOT.pom
       - https://oss.sonatype.org/content/repositories/snapshots/net/md-5/bungeecord-chat/1.12-SNAPSHOT/maven-metadata.xml
       - https://oss.sonatype.org/content/repositories/snapshots/net/md-5/bungeecord-chat/1.12-SNAPSHOT/bungeecord-chat-1.12-SNAPSHOT.pom
#

i do not use bungeecord chat

#

its not mentioned in the docs

chrome beacon
#

The Spigot API uses it

pine forge
#

i dont need to add it in my other projects

worldly ingot
#

You do if you want to use the Spigot API

pine forge
worldly ingot
#

Yeah, and BungeeChat for version 1.12 (which you are depending on) exists on the md-5 repo, not the Sonatype repo

#

That wiki page is for 1.20

plush current
#

Hey, i m new to plugin developement and i was wondering how can i make my minecraft plugin work in different versions? without the use of NMS.

quaint mantle
#

The api does it by default

plush current
quaint mantle
#

yes

plush current
#

alright thanks for the informtion

chrome beacon
#

Just make sure to depend on the oldest version you want to support

violet blade
pseudo hazel
#

i.e. if you want to make a 1.21 plugin work on 1.18, you have to code it for 1.18

thorn isle
#

If you're matching for literals, wrap your pattern in Pattern.quote

#

This also allows you to parse through the string in one go resolving all placeholders at once, rather than searching for them individually

rancid stream
#

i am making custom recipes ofr cookies but htye are not registering

#

only the honey cookie works and all of the funcitnos are claled in on enbable and cookite items. then ame is using the item fomr anypother class which works with t the shop

misty ingot
#

oh my god what did i just read

#

respectfully man, you gotta work on those typos

inner egret
#

Hi there! i just published my first plugin and it says i need to enable 2FA to push an update, i did enable 2fa, tried relogging and clearing cache but no luck sadly

#

update for the plugin is to connect to spigot api for plugin updates and really dont want people downloading without that but needed to upload plugin to create the plugin resource

sly topaz
#

?support

undone axleBOT
inner egret
#

sweet thank you

#

ah nvm there it is! just took a minute

plush current
#

How can i make a plugin run from 1.9-1.21?

#

without NMS

rotund ravine
#

Use the bukkit api

plush current
elfin isle
#

the lowest version you're targeting

#

but ideally you should specify api-version: 1.13

rancid stream
mortal vortex
rotund ravine
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

plush current
#

I am new to minecrft plugin developement, while i was tying to code my plugin i am not getting any code suggestions can any one help me?

thorn isle
#

Which IDE are you using

plush current
#

someone help?

sullen marlin
#

Does your plugin compile?

plush current
#

My IDE can see normal Java classes (like onEnable()), but it doesn’t recognize Spigot classes like Player, Bukkit, or CommandSender. I think the Spigot API jar isn’t properly linked or downloaded. Could you help me ensure the API is correctly set up so imports and suggestions work?

rotund ravine
#

How did you set up ur project?

plush current
rotund ravine
#

No clue what that meqns

#

Means

thorn isle
#

what build tool are you using? or are you using the ide's built-in dependency manager?

lethal meteor
thorn isle
#

the default build tool for that is maven iirc

lethal meteor
#

gradle works fine too

#

atleast for me

lethal meteor
#

if yes - show contents of it

tawny osprey
#

Hey guys, do commands have to have their own class?

violet blade
echo basalt
#

Is there any set collection that's made for bulk adds / removes? HashSet's collection constructor manually adds each entry one by one

#

and that's hogging 6% of the server performance at ~2500 entries a tick

slender elbow
#

i mean, hashset kinda has to do that, as it needs to hash each item to know in what bucket to put it

#

any other set is not going to have the properties of a hash set

#

why are you copying a collection with 2.5k items into a hash set every tick?

rancid stream
echo basalt
#

it's a bulk update task kind of thing

slender elbow
#

could you use a tree set? the NavigableSet interface has some really neat methods that might be useful, but it heavily depends on the use case

#

obviously that implies ordering

echo basalt
#

goes a bit like this

#
public void bulkUpdate(Collection<Entry> entries) {
  this.existingEntries.computeIfAbsent(entry, EntryWrapper::wrap).update();

  Set<Entry> expired = new HashSet<>(existingEntries.keySet());
  expired.removeAll(entries);

  bulkRemove(expired);
}
#

the whole method pulls 6% cpu time, evenly divided between computeIfAbsent and the set add / removeAll methods

slender elbow
#

hm, is the use of a hash set there strictly necessary?
you could use an array list with the capacity ctor and manually add the entries that aren't to be removed instead of add all + remove all
or if you can somehow determine an immutable ordering for the entries, using a tree set/map and getting all the keys before/after some min/max entry

thorn isle
#

use fastutil collections

#

and instead of the constructor that takes a collection, use .clone()

#

this'll just clone the underlying structure rather than initializing an empty collection and adding things one by one

cobalt drift
#

Hi, is it allowed to upload a jar on Spigot that's not a plugin but helps for servers?

#

So the JAR doesn't implement any Minecraft API

chrome beacon
#

There is a category for non-plugins

#

it's a bit stricter on the reviews

slender elbow
#

eh, fastutils is kind of whatever in my experience if you aren't working with primitive types

#

you'd need to clone the whole map since you can't clone just the key set but i guess that would work too

thorn isle
#

yeah, it's just an arraycopy

#

use a paste site

rancid stream
#

ok

#

only the honey cookie recipe works

eternal oxide
#

lol, zero formatting

rancid stream
#

i changed the link

thorn isle
#

it's still unreadable

eternal oxide
#

you copy pasted from your pastebin so zero formatting remained

rancid stream
#

now try

eternal oxide
#

nope

rancid stream
#

try this link

eternal oxide
#

better

rancid stream
#

and cooie items is another script iwth the items

#

cookie*

eternal oxide
#

do you discover recipe for the player?

rancid stream
#

when i put them in a crafting table only honey cookie works

#

the other ones dont work

thorn isle
#

grandmacookierecipe.addIngredient(10,Material.COCOA_BEANS);

#

i'm not sure if this is something you can do

#

have you checked the console for errors?

rancid stream
#

yes

#

and nothing

#

but the other ones dont work either and beofre i had muilitolpe amoutns they still didint owrk

eternal oxide
#

yeah all your other recipies are broken

#

you can;t do quantity

rancid stream
#

so how can i

thorn isle
#

you maybe can but 10 isn't going to fit in the crafting grid

eternal oxide
#

um yeah

#

2 should

#

ah I see

#

your second recipe errors out at startup so only the first recipe is registered

#

you are erroring out of yoru onenable

thorn isle
#

that's why i asked for errors, but supposedly there aren't any

#

not to say we don't trust you but uh maybe send your server startup log in another paste

eternal oxide
#

yeah, he'd miss it as its during startup and he's likely not looked there

#

also NameSpacedKey shoudl all be lowercase

plush current
# lethal meteor do you have `pom.xml` or `build.gradle` files?

<?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>HellFire</groupId>
<artifactId>ReportDesk</artifactId>
<version>1.0</version>
<packaging>jar</packaging>

<name>ReportDesk</name>

<properties>
<java.version>17</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.13.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.5.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</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>
</repositories>

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

rancid stream
eternal oxide
rancid stream
#

but some of them are lower case

eternal oxide
#

also as vcs said, change the value down from 10 so all components fit in a crafting grid

#

ALL have to be lower case

#

and your error is your quantity of ingredients

rancid stream
#

this wont work

thorn isle
#

yes, that's not how shapeless recipes with amounts work

#

having an amount of n means the ingredient needs to appear n times in the recipe

#

think fireworks gunpowder

#

or honestly god only knows if amounts work in shapeless recipes at all, iirc fireworks are a special case of a complexrecipe

#

get rid of the amount numbers in your code and send the server startup log in a paste

wet breach
#

amounts work, but I don't remember how you do them in the api also you have to know which ingredients can be stacked and which can't lol

rancid stream
#


public void ProtienCookieRecipe(){
        ShapelessRecipe protiencookierecipe = new ShapelessRecipe(new NamespacedKey(this,"protien_cookie"), CookieItems.Proiten_COOKIE);
        protiencookierecipe.addIngredient(Material.COOKIE);
        protiencookierecipe.addIngredient(Material.COOKED_BEEF);
        protiencookierecipe.addIngredient(Material.COOKED_BEEF);

        Bukkit.addRecipe(protiencookierecipe);
    }
#

would this wokr

echo basalt
#

?tryandsee

undone axleBOT
plush current
#

My IDE can see normal Java classes (like onEnable()), but it doesn’t recognize Spigot classes like Player, Bukkit, or CommandSender. I think the Spigot API jar isn’t properly linked or downloaded. Could you help me ensure the API is correctly set up so imports and suggestions work?

sleek sparrow
#

Is there any1 here who knows how to fix ghost blocks on bridging server?

#

Pls i really need help

eternal oxide
thorn isle
#

onEnable is not a class and it is indeed from the spigot api

#

can you maybe send a screenshot of what you're seeing, or specific linkage errors if you are getting any

undone axleBOT
eternal oxide
#

Nope, seems 17+ is ok

#

My best guess is you have a fubar cache

#

clear cache and restart, under the file menu of IJ

#

I think

thorn isle
#

either "repair ide" or "invalidate caches and restart" under that menu yeah

misty ingot
#

in the meantime also consider switching to gradle

plush current
#

oh ok

plush current
fickle spindle
#

how i can update a gui (without the cursor of the player moving) or move my cursor in a specific position when opening a guy?

chrome beacon
#

don't close the old one

fickle spindle
#

and how i can update the amount of an item?

chrome beacon
#

call set amount on the itemstack

fickle spindle
#

ok ty

fickle spindle
thorn isle
#

have an inventory per player

#

then you can reorder and change the inventory as much as you like without having to close it and open a new one, except for changing the dimensions of the inventory, and maybe i think the inventory title

fickle spindle
thorn isle
#

do what you're doing now but instead of just having one inventory, have one inventory for each player

chrome beacon
fickle spindle
#

i'm creating a inventory in a class for all my inventories and then opening it with the p.openInventory(shop(p)) then if i try to do the item.setamount in the function when i buy the item nothing change

thorn isle
#

someone throw that bot command with the inventory framework guide at him

chrome beacon
#

?gui

fickle spindle
#

thanks and sorry 🙁

smoky anchor
#

@torn shuttle Hi, does your model thingie support Inverse Kinematics ?
My renderer... doesn't :D

thorn isle
#

LGTM

smoky anchor
#

ah sad

torn shuttle
#

I've seen it being implemented elsewhere, didn't seem that hard

#

there's definitely a wealth of guides on how to do it out there

leaden field
#

Hello everyone, who wants to help me with plugin creation? I dont know anything about spigot coding, but i have great idea

smoky anchor
torn shuttle
#

there's a billion guides on ik out there

#

maybe take a look at them

#

pretty sure it's soemthing ai can do too since it's been done to death

#

you know what it can't do though

#

wfc

#

ask me how I know

smoky anchor
#

I'll ask better, what is wfc :D

torn shuttle
#

wave function collapse

leaden field
#

Pls, can somebody help me? I want to create a great plugin, but i don't know how

torn shuttle
#

we're clearly not interested

smoky anchor
torn shuttle
#

?services if you want to hire someone

undone axleBOT
thorn isle
#

simple wfc is trivial but making it perform well enough to be feasible is difficult

torn shuttle
#

mine performs real well actually

#

the thing killing me though is the antipattern bs I've been doing with it

#

like the concept of nothing spaces or world borders

#

tag-based generation and meta tags like no-mirror

#

also honorable mention to worldedit for being generally unpleasant to interface with

#

it's working though

#

she's a beaut

thorn isle
#

my wfc approach basically blocks-as-voxels; pixel art in 3d

torn shuttle
#

I mean blocks are voxels but sure

thorn isle
#

since every block was its own point in the solution space with its own wave function to collapse, it was pretty difficult to get it to perform reasonably

torn shuttle
#

this one generates that in about 10 seconds tops I think

#

including paste time

#

well within reason

thorn isle
#

in the end i had to make it approximate and just regenerate portions if it ran into a contradiction

torn shuttle
#

also without causing lag because I put that sucker on its own workload task

echo basalt
#

wasted 2 hours at work trying to force an empty chunk into paper's chunk system

#

wsup nerds

torn shuttle
#

why not just make a chunk with a pixel art display of your bank account status instead

smoky anchor
torn shuttle
#

np

#

I think I only ever did it once for unity ages ago, I have no memory how now

#

very basic game dev stuff

#

or robotics

#

same thing powers articulated bots

tired cedar
#

Hi all

#

VehicleBlockCollisionEvent doesn't work

#

is there a well known alternative

sullen marlin
#

?xy

undone axleBOT
sullen marlin
#

What's not working and what are you trying to do

tawny osprey
tired cedar
#

VehicleBlockCollisionEvent never fires

#

when I google this it seems to be common knowledge

#

maybe it's just an issue with paper, but I'm wondering if there's a commonly known way around it

worldly ingot
#

Well if you're using Paper, there's always the possibility it behaves differently

mortal vortex
mortal vortex
#

I like your water slide. Can I use it as a schematic in my world? I will pay you in robux

violet blade
mortal vortex
#

oof, hope you havet been bummed too much there.

minor urchin
#

anyone know the event for feeding an animal?

rotund ravine
mortal vortex
# minor urchin anyone know the event for feeding an animal?

I found one result for “animal feeding events” British Columbia:

Don-O-Ray Farm Adventure
Located in Kelowna, this family-friendly farm offers a petting zoo where visitors can feed goats, ponies, ducks, and bunnies. The farm is open on weekends and during school holidays. They also offer season passes for unlimited visits between May 16 and September 30.

https://donorayfarmadventure.com

-# This response was performed automatically. If this response was not accurate, type /help.

minor urchin
minor urchin
#

i guess PlayerInteractAtEntity

sullen marlin
#

Probably entity interact? Not sure specific one for feeding

mortal vortex
#

bro wrote spigot and doesn’t know 😭😭😭

sullen marlin
#

F

minor urchin
#

jk

mortal vortex
sullen marlin
#

guy

minor urchin
minor urchin
minor urchin
mortal vortex
violet blade
#

the EntityBreedEvent has a getBreeder but thats already uhh... postpartum

mortal vortex
#

In other words, after they make sweet love.

violet blade
#

wait

#

you can probably make use of the Animal#isLoveMode() to cancel the event earlier if an animal is already fed

mortal vortex
#

isLoveMode is a weird way to say isArroused.

remote swallow
mortal vortex
#

oof good point

violet blade
ripe depot
#

how do i access block entity data?

#

the block is a trial vault

rotund ravine
#

Look for at the javadoc

ripe depot
#

i need the VaultServerData.stateUpdatingResumesAt

quaint mantle
#

Hi, I don't know if this is the place to ask, but I have tried using BuildTools to build spigot-1.8.8.jar. I am running into issues while building though:
https://pastebin.com/QtjuKqHz

thorn isle
#

I don't remember all of the method names off the top of my head but if you build against mojang mapped nms they will be fairly self-evident

ripe depot
thorn isle
#

That also works

fickle spindle
#

How I can make on screen animations like for example egg Hatching or just like a block that moves

fickle spindle
#

Something on the screen that moves

mortal vortex
#

This is not fucking roblox

fickle spindle
#

I remember someone did it on Minecraft but I don't remember where I saw it

drowsy helm
#

Can definitely do it with display entities

mortal vortex
drowsy helm
#

Spectate armorstand ez

mortal vortex
#

and also, an egg isnt a model, so all you can pobably do is have a 2d egg sprite that rolls back and forth

fickle spindle
#

Okay thanks

violet blade
#

100% doable with a resource pack

violet blade
primal island
#

So if I want to make a farming plugin where you can select different crops and it only needs to be showed to the player that select it, I need to use Protocollib for fake block spawning right? So it will plant a specific area with that crop you select for the player.

thorn isle
#

the api has supported sending block change packets for a while

fickle spindle
#

when empty hand right click fires? (i tried in PlayerInteractEvent)

chrome beacon
#

if you're right clicking air with no item no event will be fired

#

The client never sends a packet to the server

pure dagger
#

When you make a plugin does the maven create a normal jar or a fat jar ???

chrome beacon
#

Depends on your setup

tawny osprey
#

why is there so little documentation on nms

graceful fiber
#

Hopefully this is the correct place to ask; I was installing spigot via BuildTools and got this error:

[ERROR] Failed to execute goal on project spigot-api: Could not resolve dependencies for project org.spigotmc:spigot-api:jar:1.8.8-R0.1-SNAPSHOT: The following artifacts could not be resolved: net.md-5:bungeecord-chat:jar:1.8-SNAPSHOT (absent): net.md-5:bungeecord-chat:jar:1.8-SNAPSHOT was not found in https://oss.sonatype.org/content/repositories/snapshots during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of sonatype-nexus-snapshots has elapsed or updates are forced -> [Help 1]

The command I ran was:
java -jar BuildTools.jar --rev 1.8.8 --remapped

chrome beacon
#

and it keeps changing

graceful fiber
#

I really hate it

tawny osprey
#

Why does it keep changing wtf

graceful fiber
#

but the first thing is I need to get access to NMS 😭

#

can't even build NMS for some stupid reason, and im not sure why I CANT ACCESS spigot-api via the repository

tawny osprey
chrome beacon
graceful fiber
chrome beacon
#

and let it fetch again

graceful fiber
#

deleted everything literally in that folder

chrome beacon
#

Could you send the full log of the first run with an empty m2

tawny osprey
#

With packets

#

I dont want my code to be meaningless if I update my version

thorn isle
#

depends on what's changed about them

#

for example, in one update mojang arbitrarily made the delete entity packet hold a list of entity id's rather than a single entity id, to delete entities in bulk

#

why? i'm not sure

#

will something like it happen again? for certain

chrome beacon
#

not to mention nms is massive

thorn isle
#

in what way specifically? god only knows

chrome beacon
#

It would take a crazy effort to document it all

tawny osprey
#

lol

chrome beacon
#

not to mention it really isn't needed that much

#

you can usually just read through the decompiled code and figure out what things do

graceful fiber
graceful fiber
chrome beacon
#

?paste

undone axleBOT
chrome beacon
#

^^

graceful fiber
#

update on this: i invalidated IntelIJ Idea cache and it somehow seemed to fix itself

olive vault
olive vault
tawny elk
#

Could I pay someone to update a plugin for me?

rotund ravine
#

?services

undone axleBOT
thorn isle
wispy ember
somber scarab
#

does anyone know how to get the resulting item entity from a block break event?

chrome beacon
#

You can't really

#

The event is fired before the drop is fully calculated

#

There a separate event you can use, let me check

somber scarab
#

under the world class

#

that solves it thanks alot tho

chrome beacon
#

huh

#

guess you had a xy problem

somber scarab
#

I wanted to drop tnt randomly along with the result. I thought I could add it in the drop table but I can just spawn a tnt and drop it naturally

heavy wraith
#

anyone know where i can still find net.md-5:bungeecord-chat:jar:1.8-SNAPSHOT? maven central only has 1.16+ and buildtools can't build 1.8.8 without it.

eternal oxide
#

install that to yoru local maven repo

heavy wraith
#

Thanks. Any clue why this is suddenly missing?

eternal oxide
#

1.8 is not supported

heavy wraith
#

sure but this was fine a couple weeks ago

eternal oxide
#

did you wipe yoru machine or maven cache?

heavy wraith
#

my buildtools runs in a github workflow, they start with a fresh repo every time

eternal oxide
#

then I guess it was removed

heavy wraith
#

must be related to that sonatype sunsetting thing

chrome beacon
#

probably

quaint dagger
#

Hello, I'm making a Spigot plugin. Is it possible to lower the horizontal velocity of a player's jump?

chrome beacon
#

jump length? or just the speed?

quaint dagger
chrome beacon
#

Could try and change the movement speed and movement efficiency

#

attributes ^

misty ingot
#

put some weights in the player's pockets

quaint dagger
misty ingot
#

read the java docs and you'll find out

#

it probably is that one tho

chrome beacon
#

No GENERIC part of the attribute anymore

#

so I assume you're on an old version

quaint dagger
#

1.20.1

misty ingot
#

ah thats unfortunate

#

because now we are obligated to say that its not supported

#

or smth like that

chrome beacon
#

and that the movement efficiency attribute is missing

#

iirc

misty ingot
#

i think you can find old javadocs somewhere tho

chrome beacon
#

helpchat has them

misty ingot
#

yes that

chrome beacon
#

yeah no movement efficiency in 1.20.1

misty ingot
#

even more unfortunate

#

imagine having no support AND no feature

#

make a fork of 1.20.1 and add it yourself instead of updating to a newer version which has the feature to show dominance

chrome beacon
#

That's something the client would need to support

#

so forking won't help

misty ingot
#

make a custom client to go along with it to show double dominance

thorn isle
#

i think the slowness effect/movement speed attribute still applies midair

#

there'll be some latency related inconsistency, but if you apply an attribute modifier or the effect on the jump event you can probably reduce the jump length, or at least midair movement control

quaint dagger
chrome beacon
red crag
#

🎮 Hey! I’m hugozz26, a developer focused on Minecraft.
✅ I create custom plugins, configure servers and also build Discord bots.
🔧 Affordable prices for server owners who want to level up their projects.
📩 DM me and let’s talk about your idea!

tawny osprey
#

Does anyone know where I can find a list of all clientbound nms packets?

sullen marlin
#

Why?

tawny osprey
#

if not i will rescind my request

sullen marlin
#

No but if you say what your goal is, people might be able to give a more helpful answer

tawny osprey
#

also nice to meet you 🙂

chrome beacon
#

?protocol

undone axleBOT
chrome beacon
#

and mappings.dev

#

but also just use Citizens, this isn't something that needs to be reinvented for the 1000th time

smoky anchor
#

wait for 1.21.9 and use mannequins

chrome beacon
#

or that if you only want to support newer versions

violet blade
#

u dont want ur fake players to be ticking the world due to a bad implementation

misty ingot
#

citizens is goated

echo basalt
#

ew no

#

citizens is functional and all but it's pretty old and flawed in some cases

pseudo hazel
#

thats like everything else then basically

misty ingot
#

ive never used the citizens api but the citizens2 plugin itself is goated

echo basalt
#

plugin itself works the API is kinda shit

#

it also does a lot of questionable stuff

misty ingot
#

me omw to make citizens3 with a strong focus on writing the most infuriating code

thorn isle
#

My personal favourite approach is still to use libsdisguises and just disguise a mob type of my choice as a player, and then control it's ai through the api

#

Doesn't come with nearly as much baggage as citizens

wild condor
buoyant viper
#

shant be using versions that old anyway.. smh

wild condor
wild condor
#

I discovered a temporary fix for buildtools. Third party repos, use with caution.

Declare ~/.m2/settings.xml with the following contents:

  <profiles>
    <profile>
      <id>legacy-bungee-mirrors</id>
      <repositories>
        <repository>
          <id>elmakers</id>
          <url>https://maven.elmakers.com/repository/</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
        <repository>
          <id>stellardrift-snapshots</id>
          <url>https://repo.stellardrift.ca/maven/snapshots/</url>
          <releases><enabled>false</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>legacy-bungee-mirrors</activeProfile>
  </activeProfiles>
</settings>```
chrome beacon
#

manually installing the bungeecord chat jar will also work

wild condor
misty ingot
#

is the repo ok?
got status code 502: bad gateway

remote swallow
#

papers repo is odwn

misty ingot
#

FUCK

#

right as i need to compile

#

the repo holds too much power

worldly ingot
#

mfw asking if Spigot's repo is down when it very clearly says it can't reach the Paper one

misty ingot
#

i cant read red text mb

#

i can only read errors when its a stacktrace

#

i also do not speak Could not HEAD

worldly ingot
#

Could not HEAD is a pretty awesome error message

young knoll
#

Unable to head

#

Head machine broke

misty ingot
#

also i did just realise that this is the spigot server and i asked about paper

#

i swear to god if anyone whereami's me

worldly ingot
#

?whereami

worldly ingot
#

I wasn't going to

#

But then you said it

misty ingot
#

time to boycott hypixel

pseudo hazel
tawny osprey
#

I have a question when it comes to Runnables. I’m new with using runnables and the api altogether. So would having many runnables cause my plugin to lag the server?

tawny osprey
#

hmm

echo basalt
#

A runnable is basically just an interface that defines a method named run exists, takes no arguments and returns nothing

#

And whatever you define its implementation as, is what is run

#

If you're running heavy code, then yeah it might lag

tawny osprey
echo basalt
#

It's like asking "if I give my employee a task will they take long?"

#

Yup

#

Whatever that runnable's implementation is

#

it's obviously a lot more complicated than this but at a lower level a scheduler is just

public class Scheduler {

  public void addTask(Runnable task) {
    ...
  }

  public void tickTasks() {
    for (Runnable task : getTasksForCurrentTick()) {
      task.run();
    }
  }

  public Collection<Runnable> getTasksForCurrentTick() {
    ...
  }
}
#

tickTasks is then aligned to the game's tick loop

#

Which is basically something like

public class TickLoop {

  private static final int TICKS_PER_SECOND = 20;
  private static final long TICK_TIME = 1000 / TICKS_PER_SECOND;
  
  private long startMs;

  public void tick() {
    this.startMs = System.currentTimeMillis();
    doTick();
    
    long elapsed = System.currentTimeMillis() - startMs;
    long timeLeft = TICK_TIME - elapsed;
    
    if (timeLeft > 0) {
      sleep(timeLeft);
    }

    tick();
  }

  public void doTick() {
    // tick scheduler and world and whatever
  }
}
tawny osprey
#

would this cause lag

echo basalt
#

What would?

tawny osprey
#

calling the run method on each task

echo basalt
#

It depends on what the task is

#

An empty task will basically do nothing when run

#

something heavy will do a lot when it's run

tawny osprey
echo basalt
#

Yup

#

The idea of an interface is that you're defining how you want to trigger behavior without knowing what that behavior is

#

Or in other words, a contract for a class

#

That defines what methods it'll have

tawny osprey
#

Yes as every method in an interface is abstract

echo basalt
#

Each class that implements that interface, in turn, implements those methods

#

and defines their behavior

#

Here's an implementation

#
public class TextPrinter implements Runnable {

  private final String text;

  public TextPrinter(String text) {
    this.text = text;
  }

  @Override
  public void run() {
    System.out.println(text);
  }
}
tawny osprey
#

But that would only run the block of code once

#

correct?

echo basalt
#

It would run the block of code every time run is called

tawny osprey
#

But why would that be useful

echo basalt
#

What exactly?

#

Interfaces or calling it twice?

tawny osprey
#

Just implementing runnable

#

for that situation

echo basalt
#

This is just a silly example

#

I often implement runnables to define specific tasks as its own class

#

For example

tawny osprey
#

Ahh ok

echo basalt
#
public class DebugClaimOutlinesTask implements Runnable {

    @Override
    public void run() {
        if (!PluginLogger.isDebugging()) {
            return;
        }

        for (GuildData guild : CorePlugin.getInstance().guildManager().getLoadedGuilds()) {
            for (GuildClaim claim : guild.getClaims()) {
                Color color = pickColor(claim.getClaimId());
                Cuboid bounds = claim.getBounds();
                World world = claim.getCenter().getWorld();

                for (Point3D point : bounds.renderOutline(0.2)) {
                    world.spawnParticle(Particle.DUST, new DirectLocation(world, point.getX(), point.getY(), point.getZ()), 1, 0, 0, 0, 0, new DustOptions(color, 1f));
                }
            }
        }
    }

    private Color pickColor(UUID claimId) {
        Random random = new Random(claimId.getMostSignificantBits());
        return Color.fromRGB(random.nextInt(255), random.nextInt(255), random.nextInt(255));
    }
}
tawny osprey
echo basalt
#

Yup, the Runnable interface forces me to

#

And that's by design

#

Whatever method takes a runnable doesn't need to care about what code is running

#

It just needs to know how to call it

#

You can also make your own methods that take runnables

#

For example

#
public void doSomethingWithACallback(String input, Runnable callback) {
  process(input);
  callback.run();
}
#

Runnables are basically just a way to represent a function call as a variable

#

And other functional interfaces to the same, but for different parameters and types

tawny osprey
echo basalt
#

Read and figure it out, the code's pretty clean

tawny osprey
echo basalt
#

What else would I be using?

tawny osprey
echo basalt
#

Runnables are general purpose

#

and this is a task

tawny osprey
#

So would you be able to have the same sort of outcome without the use of the Runnable implementation in this block of code

echo basalt
#

I wrote the runnable implementation

#

I think we need to backtrack

#

Let's say you have a plugin that gives players rewards when they vote

echo basalt
#

And you have different kinds of rewards, such as running a command, giving an item, adding currency through Vault

tawny osprey
#

mhm

echo basalt
#

The beginner approach would be something like this

#
public class CommandReward {

  private String command;

  public CommandReward(String command) {
    this.command = command;
  }

  public String getCommand() {
    return this.command;
  }
}

public class ItemReward {

  private ItemStack item;

  public ItemReward(ItemStack item) {
    this.item = item;
  }

  public ItemStack getCommand() {
    return this.item;
  }
}

...
#
private List<CommandReward> commands;
private List<ItemReward> items;

public void award(Player player) {
  for (CommandReward command : commands) {
    Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command.getCommand().replace("%player%", player.getName()));
  }

  for (ItemReward item : items) {
    player.getInventory().addItem(item.getItem());
  }
}
#

Now this works and might be okay for some people

#

But we can do better

tawny osprey
#

Hmm

echo basalt
#

For example, we could define a common interface among all rewards and pass the actual logic from the "award" logic to each implementation

#

So that the CommandReward class handles running the command

#

the ItemReward class handles giving the item

#

etc

#

But for that we need to say that "no matter the reward, it'll have a award(player) method"

#

in other words, we need to specify common behavior across every reward

tawny osprey
echo basalt
#

Yup

tawny osprey
#

Awesome

echo basalt
#

So it'd look a bit like this

#
public interface Reward {
  void award(Player player);
}
#
public class CommandReward implements Reward {

  private String command;

  public CommandReward(String command) {
    this.command = command;
  }

  /*  We don't need this anymore
  public String getCommand() {
    return this.command;
  }
  */ 

  @Override
  public void award(Player player) {
    Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command.replace("%player%", player.getName()));
  }
}
#
public class ItemReward implements Reward {

  private ItemStack item;

  public ItemReward(ItemStack item) {
    this.item = item;
  }

  /*
  public ItemStack getCommand() {
    return this.item;
  }
  */

  @Override
  public void award(Player player) {
    player.getInventory().addItem(item);
  }
}
#

We can also merge our handler class

#
private List<Reward> rewards;

public void award(Player player) {
  for (Reward reward : this.rewards) {
    reward.award(player);
  }
}
tawny osprey
#

Got it

echo basalt
#

A single interface not only defines common behavior among classes but also results in cleaner, more organized code

#

Our handler class does not need to care about the different types of rewards that exist and this even opens the possibility of having plugins add their own kinds

#

like pet exp, rankup levels etc as rewards

#

It's up for each implementation to decide what it does

tawny osprey
#

Yes 👍

echo basalt
#

Now, Runnables are an interface like any other

#

And if you boil it down it looks like this

public interface Runnable {
  void run();
}
tawny osprey
#

Okay

echo basalt
#

I can make a class that implements it and sends a message to everyone

#

Or spawns some particles

#

Or updates a boss bar

#

Or runs some code

#

Whoever I'm passing that runnable to, doesn't care about what it does

#

It just knows when to call it

tawny osprey
#

I just don’t see how that’s better than making your own method to for example update a boss bar

echo basalt
#

You can definitely make a runnable that just calls your method