#help-development

1 messages · Page 480 of 1

quaint mantle
#

Is there any way to add a recipe to the smithing recipe

young knoll
#

Keep in mind that by default app metadata on the output will be lost

#

At least on the old one

quaint mantle
#

Im on 1.9.4

#

19*

#

1.19.4

worldly ingot
#

Then yeah, first one

quaint mantle
#

Alr

young knoll
#

Instead the metadata from the input will be copied to the output

quaint mantle
#

Alr

#

So i can register it like any other recipe right?

quaint mantle
#

Like the shaped and shapeless etc

worldly ingot
#

Yeah just Bukkit#addRecipe()

quaint mantle
#

Ight thanks

young knoll
# fluid river wdym?

If you give the output of the recipe say, a name, it won’t appear when you actually try and use it

#

Instead the name from the input will be copied

quaint mantle
#

Whats the difference between RecipeChoice.ExactChoice and RecipeChoice.MaterialChoice?

#

I know with things like shaped recipes you're able to add an item with metadata to a recipe and it would only work if it had that metadata almost as a way to make a custom recipe with a so to speak "custom material"

young knoll
#

ExactChoice requires the entire ItemStack to match

quaint mantle
#

Ah alright

young knoll
#

Material choice just requires the same material

quaint mantle
#

Alr

fluid river
quaint mantle
#

So i should do exact choice if I want it to be an iron ingot with a custom model id and name match?

worldly ingot
#

Yes

quaint mantle
#

👍

young knoll
fluid river
#

i definitely remember doing a plugin "CraftableBlastPickaxes" in which i simply set the output to my pre-made itemstack with name and PDC tags

#

and the result slot containted that exact item

#

when i crafted the thing

young knoll
#

For a smithing recipe?

fluid river
#

oooh

#

that's smithing

#

i just

#

fucked up

#

i need to sleep

#

i guess i had to check the first message in this topic

burnt gale
#

@ancient plank

#

@ivory sleet

#

could you guys help me with bungeecord

#

@staff

#

@worldly ingot

fluid river
#

bruh

young knoll
#

💀

#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

fluid river
#

you found a bug or smth?

#

calling staff so hard

burnt gale
fluid river
#

bungee + spigot?

burnt gale
#

yea

#

@fluid river could please help me

ivory sleet
#

Demon, we would appreciate if you didn't ping, be patient and someone will help you sooner or later

misty current
#

can you reset all chunks in a loaded world except some?

#

do i have to iterate through all existing chunks and delete them or is there a better way?

regal scaffold
#

Of course but what about acf

#

Unless you make the user type /command confirm

#

Or repeat the command twice

ivory sleet
#

Yea

#

I know cloud has it

ivory sleet
#

One way is to unload, delete file and reload

quaint mantle
#

So I made an item and gave it meta data then gave it a smithing recipe but for some reason instead of coming out as an "Enderite Sword" it comes back as a normal wooden sword, anyone know why?
https://pastebin.com/6WF554L4

ivory sleet
#

I think?

quaint mantle
#

paste bin right there

#

The ingot is a legitimate enderite ingot tho the only issue is that the sword metadata isnt working for some odd reason

young knoll
#

I warned you

#

The meta of the output will be lost

quaint mantle
#

Ah

#

So is there any way to give it's meta data back?

young knoll
#

If you want to keep it you need to use the PrepareItemSmithEvent

quaint mantle
#

Oh? What would I do in that event?

#

Like how would I be able to detect its prior meta data to set it's results meta

young knoll
#

You’ll have access to the recipe and its output

quaint mantle
#

event.getInventory().getRecipe()?

young knoll
#

Yes

quaint mantle
#

Alr last question

#

So for my server I use a resource pack that is downloaded on join from a direct download link (dropbox) but when i make changes it wont reinstall i have to delete the resourcepack from my server resource packs and then rejoin so it reinstalls is there a way to make it reinstall if I change the pack?

misty current
ivory sleet
#

if u know a chunk is unloaded

#

and its mem is gcd

#

then u can delete the file

#

w/o unloading world

#

but its somewhat unreliable

round finch
#

kept asking chatgpt to make me a donut
but it keep failing 😦

#

it couldn't make a 3d donut shape out of stone

misty current
#

i'll do some testing, thank you

round finch
#

SherlockThinking i will think of way to do it tomorrow

torn shuttle
#

man shit got toasty fast over here

#

it's mega hot today, my computer is turning this room into a furnace

torn shuttle
#

I'm sure there's a math formula for it out there somewhere as well

quaint mantle
#

Anyone gonna review my code : )

round finch
#

pain yeah i'm fine
yeah i'm good at math

ivory sleet
#

But i wont go easy on u

quaint mantle
#

Dms

ivory sleet
#

Do it here

quaint mantle
ivory sleet
#

use this keyword if possible, you’re taking interface segregation principle way too hard and misunderstanding it, you don’t need a strategy object per function, this is what misusing design patterns look like, don’t name interfaces with the prefix I, that’s a bad practice in Java, the package name interfaces is extremely vague, packages should be named singular and be more specific regarding what the classes they contain are doing, for instance command would dictate the reader to think command related classes are contained within said package, you rarely dedicate an entire package to just all of ur interfaces.

ivory sleet
#

Enterprise is not synonymous to over engineering with design patterns and design principles

#

We use them patterns and principles to avoid code symptoms, to achieve consistency, to address business requirements, to address engineering requirements altogether you get maintainability and extendability

#

They are powerful tools

#

But they become a mess if misused

quaint mantle
#

Yea.

ivory sleet
#

I would have a single facade interface for the configuration, and then for the spawn management, then you have concretions for those interfaces

#

Cause I think its important to centralize what is correlated

nova wraith
#

Guys i need your help,

#

So i've been trying to make Drowneds wear armor when they spawn in the ocean ruin structure.

Heres the code:

#

Im not good at coding ether

#

The event im using is AsyncStructureSpawnEvent

young knoll
#

?paste for code

undone axleBOT
quaint mantle
#

I'm trying to make a custom inventory that has unobtainable custom items in it but I was wondering, how do I make it so when someone grabs an item from it that the item regenerates?

earnest lark
#

im using getBlockAt and im using it in a if statement but i dont know how to get a BlockType

young knoll
#

BlockType?

earnest lark
young knoll
#

As far as I know that method returns a block

#

use getType on the block to get a material

#

You can then compare that

earnest lark
#

k

#

yea i just didnt know what to use

balmy valve
#

Is there anyway, without the block physics event, to stop a trapdoor from being affected by redstone?

#

The BlockRedstoneEvent doesn't appear to be fired for it and I can't think of any other event for it

quaint mantle
#

I wanna install 1.19.4 using build tools but whenever I run build tools and type 1.19.4 and specify im using java 17 it just closes the cmd tab any reason for this?

#

Or how can I fix it I guess I could say

wet breach
#

You havent tried with a 2d array?

wary mauve
#

Anyone know why this happens? And yes, I know reloading is bad.

I can give myself money with essentials with /eco give username amount

Then when I reload and check the bal, the correct amount stays.
Then when I reload a second time, it resets my balance to 0

#

?paste

undone axleBOT
wet breach
#

So one thing i didnt mention and was hoping maybe you would see it on your own was to use an array that is thr same size as the inventory. In this manner you can use the same array index numbers to refer to the slot id's. Saves you on some kind of mapping and saves you from doing a lot of looping.

#

You could use a 1d array in this way too if it makes it easier for you

river oracle
#

If the same behavior occurs on restarts report it to essentials

wet breach
#

It does not and has its own reload command

wary mauve
#

I made a custom crafting menu.
https://paste.md-5.net/evijetuwif.cs

The large craftingMenuRequirementCheck method uses the bottom methods to check for the specified things for each recipe. The bottom methods run certain tests such as countItemsWithStackSize, which will return an int[] with element 0 being the amount of stacks with the correct amount, and element 1 being the amount of stacks iwth the incorrect amount

the needed tests are run based on the specifications of the item and the different slots or amounts that are found

wet breach
#

For me to help coding wise will have to wait till i get home. Get off work in 7 hours lol

wary mauve
#

what I sent in pastebin might be pretty confusing. It doesnt really say what everything does, and its probably not the most efficient way of doing things

wet breach
#

When you create your array that refers to your grid, you put a 1 or 0 if there is an item in that slot. 1 if there is 0 if there isnt. Then you use that array to check if it makes the shape of your recipe or use the shaped recipe api which i think might work not sure. But if i had to nake everything i would use an array that contains the various permutations to check against. In this manner you could just use one loop

#

It sounds complicated but it really isnt. Maybe it just makes sense to me lol

wary mauve
young knoll
#

What’s wrong with the click event

#

Gather the items in those slots into an array

#

And then compare it against recipes

#

I mean you don’t really need a list since it’s a fixed size

plucky pasture
#

Arrays are used when you don't know what the final size would be. Would make your life easier to a 2d array

#

I would use a 3x3 array and put my item objects into it then use a nested for loop to see if any patterns in the current array are formed, and if they are the you associate it with the proper item

sleek turret
#

im trying to debug an error im running into but the error in the console is saying "... 22 more". Is there a way to have this show the extra lines? the content its showing isnt giving me the source

flint coyote
#

Usually the important part is at the beginning. Can you send the exception you are talking about in here?

sleek turret
#
org.bukkit.command.CommandException: Unhandled exception executing 'newkit t' in net.nebulex.alphacentauri.commandlib.bukkit.AlphaCommand(newkit)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:165) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R2.CraftServer.dispatchCommand(CraftServer.java:929) ~[paper-1.19.3.jar:git-Paper-386]
        at org.bukkit.craftbukkit.v1_19_R2.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[paper-1.19.3.jar:git-Paper-386]
        at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:264) ~[paper-1.19.3.jar:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:313) ~[?:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:297) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2288) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$20(ServerGamePacketListenerImpl.java:2248) ~[?:?]
        at net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:59) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.19.3.jar:git-Paper-386]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1341) ~[paper-1.19.3.jar:git-Paper-386]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:197) ~[paper-1.19.3.jar:git-Paper-386]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1318) ~[paper-1.19.3.jar:git-Paper-386]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1311) ~[paper-1.19.3.jar:git-Paper-386]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1289) ~[paper-1.19.3.jar:git-Paper-386]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1177) ~[paper-1.19.3.jar:git-Paper-386]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.19.3.jar:git-Paper-386]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.NullPointerException
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
        at net.nebulex.alphacentauri.commandlib.CommandNode.invoke(CommandNode.java:362) ~[AlphaCentauri-003.jar:?]
        at net.nebulex.alphacentauri.commandlib.bukkit.AlphaCommand.execute(AlphaCommand.java:59) ~[AlphaCentauri-003.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        ... 22 more```
#

not a single one of those is a class im working on

flint coyote
#

oh because of the lib, I see

sleek turret
#

yeah

#

but i think ive narrowed down the problem so i should be able to fix it

flint coyote
#

https://stackoverflow.com/questions/2970361/how-to-read-the-full-stacktrace-in-java-where-it-says-e-g-23-more

Alright that's good because I just checked what the ...22 more means (as I've never needed it) and the result basically said "there's no more info"

sleek turret
#

lmao, always fun

#

thanks for the help!

#

ok, so basically my method jsut needed to be static.

flint coyote
#

Sure, if you need more help let me know

sleek turret
#

would naver have figured that out from the error message

#

will do, thanks!

regal scaffold
#

java.lang.NoClassDefFoundError: net/minecraft/world/entity/animal/Pig

#

Isn't this version related?

rotund ravine
#

?nms-mappings

#

?nms

wet breach
#

You finally did it?

#

Nicely done. Well its progress

#

This was what i was getting at

#

Glad it finally clicked in the end lol

#

There is an inventory drag event

#

Well you would use both

#

So the drag event would start it and then afterwards use the click event ensuring where they click is the inventory grid

regal scaffold
vivid cave
#

Hi! I am trying to make 2 or more java programs running on a same network to communicate with each other.
Typically I do not want to make a server, I just want client A to broadcast to client B, C etc, same with client B and same with client C.
Basically some peer to peer exchange.
Any clue what I should use ?

lost matrix
#

redis

lost matrix
#

You could use sockets but this would approx 200x your development time to solve the same problem.
Sockets often introduce a tremendous amount of security and performance problems that needs to
be solved

lost matrix
vivid cave
lost matrix
#

Why

vivid cave
#

Lots of I/O bound delay in redis (database operation) in comparison to sockets

lost matrix
#

Topics dont store anything, they just broadcast messages. Also sockets are IO as well.
Both will transmit messages in <1ms.

echo basalt
#

They're still under 5ms

#

Well redis pubsub is about 0.3ms

vivid cave
#

I know but conceptually speaking redis is kinda a lot

lost matrix
#

But it should not matter if your message gets transmitted in 1ms or 60ms
because it should always be done async.

vivid cave
#

Communication through a database doesn't sound right to me and I'm also trying to improve in the socket / networking thinggie.
I don't manage to find proper P2P examples on the web

lost matrix
vivid cave
#

No I'm not really concerned

#

It's just that i feel like even though it's a viable solution it isn't really beautiful to make it like that

lost matrix
#

Be prepared to fight with sockets for weeks on end then.
Without a framework that builds on sockets you will need
to write a ton of logic yourself.

#

Redis is the most elegant solution together with RabbitMQ when it comes to
cross application communication.

vivid cave
#

Hm okay

#

What does redis do exactly then ?

lost matrix
#

You can also look at Apache Kafka. But thats more for enterprise applications.

vocal cloud
#
#

literally exactly what you would want

#

Sockets are going to have the exact same issues

lost matrix
vivid cave
#

Can I use my existing database with redis ?
Or does redis has to run its own thing

#

The thing is I don't want another program to run on my server

lost matrix
#

Ive written a minimal example yesterday:

  private static void machineA() {
    Config config = new Config();
    config.useSingleServer().setAddress("redis://127.0.0.1:6379");

    RedissonClient client = Redisson.create(config);

    RTopic topic = client.getTopic(TOPIC_NAME);

    // Listening for messages and printing them
    topic.addListener(String.class, (channel, msg) -> {
      System.out.println("Received message: " + msg);
    });
  }


  private static void machineB() {
    Config config = new Config();
    config.useSingleServer().setAddress("redis://127.0.0.1:6379");

    RedissonClient client = Redisson.create(config);
    RTopic topic = client.getTopic(TOPIC_NAME);

    for(int i = 0; i < 10; i++) {
      // Broadcasting messages in the channel
      topic.publish("Message [" + i + "]");
      sleep(1000);
    }
  }
vivid cave
#

Okay I see

lost matrix
#

Redis uses (like every other messaging system) a broker.

#

So you need to run an instance of redis for this.

vivid cave
#

:/

#

That's also what I was trying to avoid with sockets tbh

#

I was trying to do some "serverless" architecture

lost matrix
#

If you dont write your own broker then your messaging system will be
extremely fragile.

lost matrix
eternal night
#

serverless architecture in a minecraft server network dogekek

vivid cave
lost matrix
#

Redis provides autonomous functions by itself.
Also: Do you need to dynamically scale something?

vivid cave
#

I don't

lost matrix
#

Its not like you are constantly needing to adapt to requests

vivid cave
#

Aha

lost matrix
#

Then dont try to build serverles architecture

vivid cave
#

My solution right now is plugin messaging
However it doesn't work for every situation either.

lost matrix
#

Thats something you can do for a website that needs to be small when only a few people
are there and big when requests go through the roof

lost matrix
#

Plugin messaging is garbage. Ive even replaced transporting players between servers with redis.

vivid cave
#

But it's lightweight

#

That's what I'm trying to maintain

#

I feel like making a whole new thing run on its own (broker/server) is overkill for the simple things I want

lost matrix
#

If you care more about a few less mb in memory then go ahead and write direct communications
with sockets. But be prepared to invest a lot of time and then end up with a fragile and unsecure solution anyways.

lost matrix
#

If i only think about reconnection strategies PES2_SadGeRain

#

Gonna be fun

vivid cave
#

Shouldn't be too bad

#

It's just very new to me

#

Ive never really experimented with sockets before.

remote swallow
#

anyone know how i could make this like run faster or like not skip stuff, just tested it running 3 commands through every .5 seconds it should have gotten up to 900, it ended up getting to 205 with the code

vivid cave
#

So if you have any advice (library etc) I take them

remote swallow
#
@Override
    public void handleCommand(CommandSender sender, String[] args) {
        if (!(sender instanceof Player player)) {
            sender.sendMessage("This is a player only command!");
            return;
        }
        if (args.length < 1) {
            player.sendMessage(plugin.getMessageConfig().getString("no-suggestion-provided"));
            return;
        }

        SuggestionData data = new SuggestionData(SuggestionData.Type.MINECRAFT, player.getUniqueId(), String.join(" ", args));
        System.out.println(plugin.getSuggestionHandler().save(data));
        plugin.getInventoryHandler().openGui(player, new SuggestionViewerInventory(player));
    }
#

idk if its the command or it saving the suggestion running slowly

#

this is the saving anyway ```java
@Override
public int saveSuggestion(SuggestionData data) {
Integer newId = getNextId();
suggestions.put(newId, data);
return newId;
}

lost matrix
lost matrix
vivid cave
lost matrix
vivid cave
lost matrix
#

Sockets use that on default.

#

Now you need to create a session protocol. When does a session start? When does it end?
Which data should be exchanged in the handshake? And so on. After that you establish
sessions between two clients and you can start sending data. (Which needs its own protocol as well unless you are only sending Strings)

remote swallow
#

it would only actually save 1/3 of the commands ran

lost matrix
lost matrix
remote swallow
#

adds to a map

#

data is saved per hour + on shutdown

lost matrix
#

Then make sure getNextId() doesnt overwrite old ids

remote swallow
#

funnily enough all it does is nextId++

vivid cave
lost matrix
#

You cant create a session with only one participant

lost matrix
vivid cave
#

Oh yeah you are right

#

UDP fits better

#

Cuz I don't need to track everything tbh

lost matrix
vivid cave
#

I don't even care about handshake and all that tbh

lost matrix
#

And make sure your SuggestionHandler is a singleton

vivid cave
#

Even if it sounds more fragile/less reliable

lost matrix
#

You just need to hope that nobody does port scanning on your server.
Because they can just bombard your UDP sockets with information or
even inject functionality if they find out how it works

remote swallow
remote swallow
#

yep

vivid cave
#

Can't I just keep my port local ?

#

Like for private communication only

lost matrix
#

If all applications run on your machine then you can do that

vivid cave
#

Yep they all do

#

Oki ty

lost matrix
remote swallow
lost matrix
#

Print out a message at the start of your command.
If it doesnt print on every execution then your command system is broken

#

Java is turing complete. You can do anything with it.

remote swallow
#

it somehow is broken

#

when it just forward requests from bukkits

#

ill test it with bukkits rq

lost matrix
#

Does every of those accounts have the right permissions?

remote swallow
#

i didnt even think about that lmfao

#

it might help if i looked at the other accounts wouldnt it

#

now its running every time

#

i feel very dumb

quiet ice
#

Gradle noob here again: What is the best way of adding your own dependencies that are generated at compile-time. Preferably without using maven - but sources MUST be attached to the dependency (using a file collection with the sources and the "real" jar does not work)

Implementing SelfResolvingDependencyInternal on my custom AbstractDependency instance doesn't seem to do the trick when running ./gradlew dependencies

remote swallow
#

like depending on a file?

quiet ice
#

yes - but I'd also like to have sources attached

remote swallow
#

sources i have no idea, but the file just cimpileOnly or impl fileTree("path") or file('path')

stable dawn
#

Trying to make a floating item currently
Setting gravity to false on the item object results in it floating up.
anyone know if theres any way to stop this without using a second entity? i.e. armorstand

quiet ice
#

Yeah that I have figured out long ago

remote swallow
stable dawn
#

ah, ill try that thanks

quiet ice
#

Hm, I wonder if using PublishArtifacts could work...

remote swallow
#

that could actually work, maven-publish plugin sources to local or something, then use them

torn oyster
#

is 7smile there i have a redisson question

stable dawn
remote swallow
ivory sleet
torn oyster
#

so basically for the RMap feature

remote swallow
#

epic ?ask fail

torn oyster
#

how does saving objects work

#

if i were to access it on another project

#

would i need the exact same class with the exact same package in the project files?

#

if so that would be a bit of a pain to maintain if i use it in a lot of places

ivory sleet
#

I mean you need to depend on redisson at compile time wherever u wanna use it

torn oyster
#

what?

#

i use redisson on all my projects but i the RMap thing allows for storing a map

#

with any object

#

as key or value

ivory sleet
#

Yes

#

But like if you need to use an RMap in another project, ofc u need the class? Or what exactly do you mean

torn oyster
#

well that's what i was asking

#

i just wanted to see if there was a more convenient way

torn oyster
#

no clue what that is

remote swallow
#

now, something doesnt add up

torn oyster
#

oh

lost matrix
#

But if you share objects between applications then both applications need to have this object
on their classpath ofc.

torn oyster
remote swallow
#

its just a bit off

#

and essentials is leaking the ip

torn oyster
#

oh 💀

#

i'll turn that off then

remote swallow
#

i dont advertise ip with it so i just disabled rpc for it lul

lost matrix
#

This can be solved by using a module setup for example.
You have a core module which contains your global data objects
and those modules get shaded into your applications
(or just added to the project with a provided scope if those are spigot plugins)

#

I Personally use a Gson backed codec.

#

A Codec can translate Objects into binary/Strings and back.

#

Codec stands for Encoder/Decoder

torn oyster
lost matrix
#

How else do you expect different applications to know classes of each other?

torn oyster
#

no clue 💀

#

i might just copy paste it into each project

lost matrix
torn oyster
lost matrix
#

Depends on your codec. But you should never do that.

torn oyster
#

so you are suggesting i create a new project

#

for 1 class

#

and then upload it so i can use it for other 2 projects

lost matrix
#

What is your setup? Then ill give you an approach.

stable dawn
#

I have a direction vector between 2 locations
but i'm not sure how I alter it so its only ~.5-1 block away from one of the locations

torn oyster
#

proxy puts data of servers into redis
servers read it and create a menu where players can view all active minigames + click to spectate them

lost matrix
torn oyster
#

i want to store the uuid+name of the players in minigames, the minigame's state, the alive player count in the minigame, and the minigame id

lost matrix
lost matrix
#

That doesnt sound like something a proxy should do

torn oyster
#

which is the one handling that

#

it accesses the pterodactyl panel api to create temporary minigame servers

lost matrix
#

oof. Well then minigames need to be very abstract anyways.
Both the proxy and the server need to know the data, right?

torn oyster
lost matrix
#

Then create a new project which defines your minigame logic and shade it into you proxy
plugin and minecraft plugin.

torn oyster
lost matrix
#

Or shade the proxy plugin completely into the minecraft plugin (dirty solution)

lost matrix
torn oyster
#

i feel like 1 handler that creates and destroys servers is enough

lost matrix
#

Then why do you need redis?

torn oyster
#

for the spectating system

lost matrix
#

??

torn oyster
#

well lobbies have a system where you can view all active minigames and spectate them

lost matrix
#

Then the server needs to know your minigame logic as well...
Unless you store the data as pure JsonObjects and simply use them as is.
But that is not type safe.

torn oyster
lost matrix
#

Use Json then

torn oyster
#

also how would i even share the minigame info without a database?

#

hold on let me fully explain my system

lost matrix
#

Just throw Json into Redis. Explaining how to do this properly would
take its time and you are already deep into the project

torn oyster
# lost matrix Just throw Json into Redis. Explaining how to do this properly would take its ti...

When the proxy starts, the server manager (SM) accesses the pterodactyl instance and its server templates (eggs). It starts off by creating 3 servers by running the egg's install script and creating a BungeeCord ServerInfo. This is then stored in a list in the SM. It also adds it to a Redis map.

The minigame sends info through Redis pub/sub when it is ready to be used. The SM receives this and enables players joining for the server.

The lobby sends a request through Redis pub/sub to queue the player to the specified game. The SM receives this and sends the player to the server.

Lobbies have the ability to send a player to spectate a game. They do this by looking at the Redis map and adding all the servers that are in-game to a gui, where players can click on the item and be sent to the specified minigame.

lost matrix
#

Alright then you need 3 projects:
Common - Used by everyone (Proxy, Website, MCServer)
Proxy-Plugin <- Shade in Common
Minecraft-Plugin <- Shade in Common

The Common project contains your DB clients like Redis, SQL, MongoDB etc.
It also contains managers that can be instantiated by every project to access
the data in exactly the same way

#

Example for a class in common:

public class MinigameStatusManager {
  
  private static final String NAMESPACE = "minigameData";
  
  private final RMap<UUID, MinigameData> minigameDataRMap;
  
  public MinigameStatusManager(RedisClient client) {
    this.minigameDataRMap = client.getMap(NAMESPACE);
  }
  
  public void setMinigameData(UUID playerUUID, MinigameData data) {
    minigameDataRMap.put(playerUUID, data);
  }
  
  public List<MinigameData> getCurrentMinigames() {
    return List.copyOf(minigameDataRMap.values());
  }
  
}
#

Everyone that has common will have MinigameData.
And accessing this data is done the same way in every application.
Doesnt matter if your website wants to access this data or your proxy or your servers.

#

Otherwise you need to do what public APIs do and use Json.

left niche
#

how can i change the message sent when i run /summon (mob) so that it outputs ChatColor.GREEN + "Success!" instead of Object successfully summoned?

eternal oxide
#

If its not your command you'd have to override it and write your own

echo basalt
#

rmap sounds interesting

#

shame jedis doesn't have such a thing iirc

smoky scroll
#

can i add custom textures to a plugins item with the itemmeta?

eternal oxide
#

with a datapack

torn oyster
#

I'll go with that but if I need more details in it then I'll try what you sent

smoky scroll
#

Is there a tutorial on that or a documentation?

young knoll
#

It’s called custom model data

#

Should be a bunch of stuff online

#

?services

undone axleBOT
cobalt thorn
lost matrix
#

Full stack trace

eternal oxide
#

?paste the full stacktrace

undone axleBOT
lost matrix
eternal oxide
#

unlikely

#

?paste full classes so we can see line numbers

undone axleBOT
wet breach
#

the greatest index for an array is always 1 less then the size. Therefore, if the size is 9 you can't have an index at 9 as well.

#

so whatever it is you are doing, you are trying to access an index that does not exist thus the array index out of bounds exception

cobalt thorn
cobalt thorn
eternal oxide
#

thats the wrong class

#

InventoryConstructor.java:44

cobalt thorn
eternal oxide
#

whatever line 44 is is where your error happens, trace baqck through the stacktrace to find it's cause

cobalt thorn
wet breach
#

it would be nice if you just showed us the class so we could look at it

eternal oxide
#

InventoryConstructor.java:44 <- PaginableInventory.java:79 <- GuiTest.java:44

eternal oxide
#

we can';t work with snippets of code

#

now show us PaginableInventory

eternal oxide
#

looks like your max page is 8

cobalt thorn
eternal oxide
#

would it not be 0-8 so 9 pages in total

cobalt thorn
#

another "problem" i wanted to ask, is here (https://paste.md-5.net/xazoqitiwi.java), i made in 92 add item to the first slot, but can be useful setting it as next item and make it go one more and set the item

Like if 1 is used for something and i wanted it to make it in 1 the code skip 1 that is already full and put it in 2 and the rest will continue like that

rigid otter
#

Hello, I've tried hard on googling and as the result I come here. I intend to develop plugins for 1.12.2 server. I want to access to the source code of both spigot-api and - we normally say - nms. For BuildTools, I already build. I omit from spigot-api to spigot in maven, but still I could not get what I want.

ivory sleet
#

well u have mojang mappings for nms

#

idk if it applies to 1.12.2 tho

#

thats the closest u get to source

remote swallow
#

moj maps was 1.17 and higher

#

1.12.2 you get stuck with obsfucated

quaint mantle
#

Theres mcp though

rigid otter
quiet ice
#

The other deobfuscation mapping for 1.12

#

Afaik there is pretty much only MCP and Spigot mappings

quaint mantle
#

The go to deobfuscation before mojmaps

rigid otter
#

Ohh I see

tribal quarry
quaint mantle
#

hi, what is the most suitable version for scalable minecraft servers?

quiet ice
#

depends on what you use internally

quaint mantle
#

and works well with other versions too?

#

i wanna make a minigame but i also want it to be scalable and i will be working on a large server i wanna be able to manage complexity of the project and a bunch of other things.

quiet ice
#

And it also depends on what you want to achieve

#

For minigames Minestom is the ideal solution

quaint mantle
#

Minestom?

river oracle
quiet ice
#

Well not truely ideal because you don't have the luxury of bukkit but it is rather scaleable

proper notch
#

Minestom is a completely rewritten minecraft server software that's extermely stripped down.

quaint mantle
#

oh!

#

what language?

quiet ice
#

It works best for minigames

river oracle
#

Java

proper notch
#

Still Java

quaint mantle
#

oh.

#

lame.

#

would probably use something more performant than java if i wrote my own server software.

river oracle
#

Lol

#

Gl

quiet ice
#

if you want C there is cuberite

#

But performance is trash

quaint mantle
#

BUT I AM NOT WRITING MY OWN SERVER SOFTWARE!

shadow night
#

A rewritten mc server would probably be laggy or buggy

river oracle
#

Besides minestom uwu

quaint mantle
#

whats minestom like? Does it have an easy api to work with like bukkit? With large scale projects, maintainability is also important so i dont wanna use some overtly complicated api.

river oracle
#

The main issue with minestom atm is lighting api

proper notch
#

IMO it's significantly nicer

quaint mantle
#

on the topic starting a new large scale project, what are a couple key things i should look for though?

quiet ice
#

For really fast redstone there is another implementation writtenin C (MCHPRS) but it only shines for creative servers and isn't great for minigames

quaint mantle
#

i dont really wanna use redstone for this minigame though.

shadow night
quaint mantle
#

horizontal scalability.

quiet ice
misty current
#

what method should I use to read a config string and turn it into a material?

#

i've seen multiple in the Material enum

quiet ice
#

Plus it JIT compiles redstone which is super cool

misty current
quaint mantle
#

a minecraft server software for redstone?

#

cool.

remote swallow
quaint mantle
#

but anyway, in the regard of minigame servers, what do bigger networks do like hypixel and what not?

quiet ice
#

They use 1.8.9 but there is a catch

quaint mantle
#

what is it?

remote swallow
#

i thought they used 1.7.10

quiet ice
#

Technical debt

river oracle
misty current
#

some use 1.7

quiet ice
quaint mantle
#

what?

misty current
quiet ice
# quaint mantle what?

Basically for most networks it would be very expensive to upgrade to newer implementations

quaint mantle
#

do they have to develop everything again?

quiet ice
#

Pretty much

misty current
#

also another thing, i'm working on a lib that is supposed to support all version from 1.8 to 1.19 and when working with materials, it's a bit of a mess because of legacy materials

#

is there a way to work around that?

quaint mantle
#

ok so if i was starting a new large scale minigame server like hypixel, what would you guys recommend me doing?

quiet ice
#

1.8 and 1.19 are quite different

river oracle
#

XSeries in general is a solid set

quiet ice
#

Especially with combat there is a difference so you may need to rebalance a few things

quaint mantle
misty current
river oracle
#

Some compatability material api

quaint mantle
#

also, can bungeecord change blocks in the world?

river oracle
#

Even if it could I'd avoid that

#

Seems like flawed design idea

misty current
#

you can use plugin messages to tell a server to remove blocks

quaint mantle
#

i was thinking most of having most of the event handlers on bungeecord instead of spigot to optimise tps or the mspt for the main server.

misty current
#

a bungeecord is just a bridge from your client to the server so it has no access to the servers linked to it

quaint mantle
#

yeah that was expected.

quaint mantle
#

how extensive is bungeecord in terms of event handling capablilites compared to bukkit?

misty current
#

a bungeecord is supposed to handle connections, nothing else

quiet ice
#

As I said - if performance is the issue you'd not want to use anything that is based on the notchian server

misty current
#

doing what you said would put extra strain on both the bungeecord and the server where you want the block to change

quiet ice
#

If it is only a potential concern I'd maybe take a look at that new paper fork

quaint mantle
quiet ice
#

And run a monolithic instance that runs different worlds

misty current
#

and if you want to make a super performant server based on 1.7.10, you'd be better off making your own fork of spigot

quaint mantle
quiet ice
misty current
#

what you want to do is pretty ambitious

quiet ice
lost matrix
quaint mantle
quiet ice
#

At least for Folia

lost matrix
#

^

quiet ice
#

Under other servers it is complicated

echo basalt
#

Ram go boom

misty current
#

anyways any way to get non legacy material constants by using the old api? Can I import both 1.8 and 1.13 and use the two different Material enums based on the server version?

lost matrix
#

But its super experimental and very unstable

quiet ice
#

As in almost no plugins work

lost matrix
quiet ice
#

Even vault doesn't work by default

echo basalt
#

Depends

quaint mantle
# lost matrix Yes

meaning it could be worthwhile to run a minecraft server on a threadripper?

lost matrix
#

You need to write everything full custom

echo basalt
#

If it's minigame worlds type thing just pool em

quiet ice
#

Just use the slime world manager there

misty current
#

not sure if it can help your case, but if you look up asyncworld on github there's a lib that might help your case

quiet ice
#

Although I don't think it works with Folia

misty current
#

i have never used it but it looks pretty solid

quaint mantle
#

i probably wont use any pre-existing plugins though, though that might mean I could suffer from some NIH syndrome but i would probably prefer to use my own stuff for the most part.

#

just so that i can keep the system comprehensive and i know exactly what is going on.

rigid otter
#

I've got this message for adding 1.12.2 dependency
Provides transitive vulnerable dependency maven:com.google.code.gson:gson:2.8.0

<dependency>
    <groupId>org.spigotmc</groupId>
    <artifactId>spigot-api</artifactId>
    <version>1.12.2-R0.1-SNAPSHOT</version>
    <scope>provided</scope>
</dependency>
quiet ice
#

Just exclude all transitive deps

misty current
#

when were the old materials deprecated on spigot?

echo basalt
#

1.13

misty current
#

1.13 being the first version with LEGACY materials in the enum right?

echo basalt
#

Ye

misty current
#

alright thanks

quaint mantle
#

btw, what about viaversion?

rigid otter
quaint mantle
#

does viaversion have something for bungeecord or any other proxies?

quiet ice
#

I believe Viaversion can be installed on a proxy yes

quaint mantle
#

because i dont really wanna run too much on the main server and try to keep tps running okay.

misty current
proper notch
#

Yes although it's generally advised that you keep it off the proxy. IIRC it's been known to cause some issues

quiet ice
#

But not sure if it can be installed on bungee or only on velocity

echo basalt
#

Xmaterial

misty current
#

what's that?

echo basalt
#

Look it up

quaint mantle
#

and i really wanna preserve the tps or the mspt.

misty current
#

oh i couldn't find it before, thanks

quiet ice
quaint mantle
#

like what?

#

what does hypixel do?

quiet ice
#

on 1.19.4 chat encryption needs to be forged

quaint mantle
#

do they not use via version?

remote swallow
#

or just disable it

quiet ice
quaint mantle
#

who uses chat report on their servers?

quiet ice
echo basalt
#

You can only assume so much

#

They have a packet translator of some sorts

#

Via or not, idk

quaint mantle
#

hm.

#

okay.

#

what is the most optimised version of minecraft right now?

#

with support for viaversion perhaps.

eternal oxide
#

1.19.4

quaint mantle
#

what?

#

the game is pretty simple though.

#

dont really wanna give away too much of the ideas but i just need access to wool blocks and tnt.

eternal oxide
#

focus more on where the most players are going to come from.

quaint mantle
#

also should i use spigot or paper, which one is more optimised?

eternal oxide
#

Spigot for development

quaint mantle
#

which is why people use viaversion now, dont they?

eternal oxide
#

not so. Most players have upt to date clients

#

they use viaversion to get the fringe players with hacked clients

misty current
remote swallow
#

its on central

quaint mantle
#

which version do i use?

#

there are so many of them.

eternal oxide
#

work out who your player/customer base is first

remote swallow
eternal oxide
#

you can use bstats to see player numbers

quaint mantle
#

they could be 1.8 players or 1.14 players or 1.19 players.

eternal oxide
#

yes, work out which is going to be the majority. Focus on those.

#

the rest are fringe so you cater to them second

#

design and get it workgin for the majority. If you want to cater to fringe do that after

misty current
#

thanks

quaint mantle
#

ok but i dont really wanna start developing for a version just because that is what most players use because new versions would probably be released and it may not matter.

eternal oxide
#

you can't plan for the future, it's unknown

lost matrix
#

Just update then...

quaint mantle
#

people dont really update their servers everytime mojang drops a new version now, do they? They use something like viaversion.

lost matrix
#

I always keep my projects on the edge

quaint mantle
#

so if i am not updating the server, which version do i use? If i am picking one i gotta stick with, i have to make a good choice though probably.

eternal oxide
#

Most servers I know update. Not immediately but they do

quaint mantle
#

but why?

eternal oxide
#

why what?

quaint mantle
#

why update your server everytime mojang drops a new update?

eternal oxide
#

becaUSE

#

because thats what most people these days want

quaint mantle
#

you lose compatiblility for players playing on older verisons like 1,8 or 1.5.

lost matrix
#

In most cases it means more optimizations, more features etc

eternal oxide
#

The instant gratification generation

quaint mantle
#

and if you dont update you dont have compatiblility for newer versions.

#

so i think using viaversion or something else translate packets for versions would be most appropriate.

#

so i am keeping the version of the actual server same.

#

i might update the packet translater everytime.

lost matrix
quaint mantle
#

for this minigame at least.

rigid otter
glossy venture
#

1.9 pvp sucks for fast paced games

quaint mantle
#

and having something redundant means more of a performance cost for not a lot of gain probably.

lost matrix
#

If you dont need newer features then stay on 1.8
Nobody forces you to use the latest versions. But dont
expect help for software from almost a decade ago.

quaint mantle
#

hm.

lost matrix
quaint mantle
#

what is the most optimised version of minecraft right now without the extended world height?

glossy venture
#

you can modify what they give us

quaint mantle
#

because i dont really need another 100 rows and columns of blocks per chunk.

glossy venture
#

like attack speed

quaint mantle
#

for this minigame at least.

eternal oxide
#

Most optimised would be 1.19.4. Most performant would be 1.8

glossy venture
#

but shit like block hitting wont come back

quaint mantle
#

i might go with 1.8 for this.

lost matrix
#

Depends on what you want to do. For minigames it doesnt matter.
Most of the performance hits come from world generation and
additionally ticked blocks/entities. You can have the same performance
from 1.16 to 1.19 if you properly optimize your minigame worlds

eternal oxide
#

When we get world gen Async with a callback games will be so simple to create

quaint mantle
lost matrix
#

If thats your target audience then go for it.
I personally will never work in a 1.8 community again.
Most toxic, childish people i have encountered so far in mc.

lost matrix
#

If your minigames dont generate vanilla worlds then its irrelevant

quaint mantle
#

OH.

lost matrix
#

You can still clamp the world height to 256 if you feel like it

quaint mantle
#

can i?

lost matrix
#

Sure

glossy venture
#

not in terms of chunk representation

#

but you can prevent people from placing above 256

quaint mantle
#

i am actually planning on having an empty world.

#

a void world.

#

hm.

#

bascially this.

glossy venture
#

it doesnt make that big of a difference in memory though because each chunk is devided into 16 block high subsections

#

so if you dont use the sections it wont allocate them

lost matrix
glossy venture
#

like only in packets or also server side

lost matrix
#

I think upper limit is 2048 currently

quaint mantle
#

i also wanna suppress lighting updates too.

#

because this game involves a lot of blocks being changed and i wanna suppress any lighting updates and have a default ambient light value for every block.

#

how would i do this?

#

this game may involve about thousands of blocks change a lot.

#

lighting updates are terrible for performance.

#

is there an option disabling lighting updates?

glossy venture
#

you can use nms to directly set the block in a chunk without updating anything i think

misty current
#

hey @echo basalt, sorry to bother, with this code i'm still getting legacy materials, not sure if i'm missing something

public Material parse(Object value) {
    Optional<XMaterial> material = XMaterial.matchXMaterial(value.toString());
    return material.map(XMaterial::parseMaterial).orElse(null);
}
glossy venture
#

you can even System.arraycopy block data

glossy venture
#

dont think so

quaint mantle
#

hm.

echo basalt
#

You gotta xmaterial more than that

quaint mantle
#

also, how do i clamp the world height?

#

if it makes the game send fewer packets and actually optimises something.

lost matrix
#

Let me double check on how chunks are serialized for this. Might be only possible by forking.

misty current
glossy venture
#

so you either have to fork or fuck with the class at runtime

quaint mantle
#

i might just go with 1.19.4 with a void world for now.

#

if its a void world, the game does not send any packets right?

#

no packets for any blocks if there are no blocks, right?

glossy venture
#

not big ones I think it does send data packets

#

but not big ones

#

also it wont allocate memory for the void

#

so thats nice

lost matrix
#

Ok it looks like chunk packets are even truncated for every height. It checks the max height
of a chunk and simply doesnt send anything above the highest block (because its all air anyways).
So simply having small chunks is enough.

quaint mantle
lost matrix
#

Yeah. Pretty much on the heightmap of each chunk

quaint mantle
#

per column of blocks in the 16x16 area of the chunk or like per chunk?

#

sorry if i am asking too many questions but i am kind of curious.

#

eh nvm.

lost matrix
#

idk there are several height maps. Cant quite decipher what they are all for.

quaint mantle
#

hm.

lost matrix
#

Are you expecting hundreds of concurrent players to play on a single server?

quaint mantle
#

of course not YET.

#

but i think its good principle to have a good foundation to start on.

#

which is why i am asking so many questions because i am currently working on the foundations of the project which may include things that might be difficult to change in the future.

lost matrix
#

Just start servers as you need them.
Run like 3 minigames per server and if new games start, you simply check if one of the running instances has
some space for more minigames or if you need to start more servers.
Then get a CPU with 8+ cores and you should be set.

quaint mantle
#

hm.

lost matrix
#

Youll need to do that eventually if you want to be scalable

#

Myeah, im assuming that it would look weird without some
additional magic.

wise mesa
quaint mantle
wise mesa
#

It just seems like you’re optimizing things that don’t need to be

#

And if you spend a year building optimizations for something that could happen in the future, you won’t have been spending that year gaining players

#

Which is more important anyways

#

Get something running

#

Get your players (very difficult)

#

Then as you need to scale up you can apply custom patches like that

quaint mantle
#

yeah ik that.

#

getting actual players would perhaps be one of the most critical or all of this effort may end up being a waste.

#

i should probably not worry about scalability if i have no players to scale for and ik that but i am kind of serious about this project.

#

ok then.

wise mesa
#

do what you want

#

But hundreds of concurrent players is a lot of players

#

I’ve heard some rough estimates from someone at photon (they make networking solutions for unity engine)

#

DAU is 20x CCU and MAU is 20x DAU

#

so 100 CCU might not sound like a lot but that could be around 2000 daily active users and 40,000 monthly active users

#

It’s not worth scaling for 100 concurrent users if you aren’t likely to have it

#

If you have 100 active players every day, that might only correlate to 5-10 concurrent users most of the time

#

Of course just a rough estimate but

quiet ice
#

that probably only holds up for a large userbase

wise mesa
#

Sure

#

But 100 concurrent users is a large user base

#

You’re not gonna get there easily

quiet ice
#

For smaller userbases you are going to have the issue of the load not being spread out over a day

wise mesa
#

So I don’t see the value in designing infrastructure for hundreds of active players while you have zero

#

Just not worth the effort

#

The time spent on that is time that could be spent on player acquisition

#

I have a discord of 40 people who play on my little servers I release every few months

#

Highest concurrent is maybe 15-20 on launch day

#

And then 5-10 on peak hours after that

#

Anyways if you really want to design this

#

Like @quaint mantle if it’s something you’re passionate about

#

Then go for it

#

But if you’re just doing because you think you need to

#

Then I wouldn’t recommend it

#

If you think it’ll be a fun challenge then have fun

quiet ice
#

orrr just use Minestom hurr durrr

wise mesa
#

Or that rust thing

#

Not feather the other one

eternal oxide
#

No point in doing all that work if you don't even know if players will like the game type, or you will even attract any players at all

quiet ice
#

That being said I do believe that it makes sense to put in some thought in how it is going to scale in the future and to act accordingly

eternal oxide
#

as I said earlier, target the largest player base and get somethign workgin so you know if there is any interest at all

quiet ice
#

But the details needn't necessarily be figured out from the get-go

#

A rushed launch may be better than no launch at all

eternal oxide
#

If he gets interest he can always rewrite for scalability/performance

quaint mantle
#

i might just wanna build a cool server though, not so worried about how many players it might end up getting right now.

#

and well, this is the start, and if i am already doing this, why not do it right?

#

so yep, that is probably what i wanna do.

eternal oxide
#

its called over engineering

#

test the waters

quaint mantle
#

hm.

eternal oxide
#

you create a proof of concept and see if there is likely to be interest

#

ala Minecraft Alpha/Beta

quaint mantle
#

the game is interesting, you will see once i finish it.

eternal oxide
#

I don;t play any game modes

quaint mantle
#

fair.

eternal oxide
#

What is interesting to you may not be to others, which is why you always do proof of concept before going big

quaint mantle
#

hm.

wise mesa
#

I made a little battle royale gamemode for my friends and I in about two days and the code is so disgusting

#

But it worked well enough for us to play it and have a good time

lost matrix
wise mesa
#

Good one!!!!!!

quaint mantle
fluid river
#

what's wrong

quaint mantle
#

lol what is that?

fluid river
#

get block on X Y Z

quaint mantle
#

i, i1, i2?

fluid river
#

bukkit be like

quaint mantle
#

ikr.

eternal oxide
#

that looks like nms not bukkit

fluid river
#

world also has getBlockAt for ints

eternal oxide
#

yep but i1,i2,i3 looks like decompiled

fluid river
#

1.19.4 javadocs

fluid river
lost matrix
fluid river
#

?nms

lost matrix
#

Your CommandCallback looks like a Runnable. Just with extra steps.

#

I would silently remove this class

quaint mantle
#

ik.

#

but i might change it later so eh.

#

i was gonna pass the arguments to the function but.

#

doing this instead.

#

oh and it throws exceptions which regular runnables probably dont.

orchid trout
#

wouldnt you only need to do it when you have multiple databases

#

no need to standardize if i only have 1 databse

echo basalt
#

True but you can just make it once and copypaste across projects

orchid trout
#

standardize between projects

lost matrix
#

Looking at CommandSender here

valid solstice
#

how do i disable a command if a if statement is true

small timber
#

sending*

misty ingot
valid solstice
brave sparrow
valid solstice
#

disable = cannot be run

remote swallow
#

just return

valid solstice
#

how

remote swallow
#

return;

brave sparrow
#

return true;

#

But

#

Yeah

brave sparrow
small timber
#
p.sendMessage("task completed");
valid solstice
#

well i tried doing this:

@EventHandler
    public void onCommand(PlayerCommandPreprocessEvent event){
        List<String> ignore_commands = new ArrayList<>();
        for (String command : ignore_commands) {
            if (event.getMessage().startsWith(command.toLowerCase()) && Commands.isEventRunning) {
                event.getPlayer().sendMessage(ChatColor.RED + "This command is disabled!");
                event.setCancelled(true);
                break;
            }
        }
    }
``` idk why its not working
brave sparrow
brave sparrow
small timber
valid solstice
remote swallow
#

because theres nothing in the list

#

you are looping over nothing

brave sparrow
small timber
#

yep

valid solstice
remote swallow
#

where do you add it

brave sparrow
valid solstice
#

i just didn't put it in the code cause then it will be long

remote swallow
#

?paste it then

undone axleBOT
misty ingot
#

what item can I use to portray animals in a hunting command menu?
in the fishing menu i am able to use Material.FISH but dunno what I could do in this one

remote swallow
#

uncooked meat

misty ingot
#

hm...

small timber
brave sparrow
#

That’s only called when a block catches fire

small timber
#

wow

misty ingot
#

spawn eggs dont look dat good ngl

#

i thought of that first

brave sparrow
# small timber wow

Although continuing my search has yielded conflicting information, standby

misty ingot
#

but dont wanna

#

trying to portray live animals here

brave sparrow
valid solstice
#
@EventHandler
    public void onCommand(PlayerCommandPreprocessEvent event){
            if (event.getMessage().startsWith("/help")) {
                event.getPlayer().sendMessage(ChatColor.RED + "This command is disabled!");
                event.setCancelled(true);
            }
       
    }
``` ok, this should work right
#

i just simplified it

misty ingot
#

maybe i could do a player head with a cow skin? :p

remote swallow
#

whats the COmmands.isEventRunning for

brave sparrow
misty ingot
#

(skin randomized for animal options)

chrome beacon
misty ingot
#

i just need to find a player who has a cow skin who will never change it

valid solstice
misty ingot
#

or actually no

valid solstice
#

assume that it is true

misty ingot
#

idk how im dumb

valid solstice
remote swallow
#

with a permission plugin

brave sparrow
valid solstice
brave sparrow
#

Delving into permissions seems like an over complication

#

The event is fine for this use case

small timber
#

@brave sparrow so why isnt it working?

brave sparrow
#

You can’t compile a jar file for a later version of java with the java 8 SDK

chrome beacon
#

It tells you what to do

brave sparrow
misty ingot
#

how can I set the skin of a skull to one from a link?

remote swallow
#

what version

brave sparrow
#

You may want to include case matching though

valid solstice
#

should there be a slash

#

or no

brave sparrow
valid solstice
#

hmm ok

misty ingot
#

the first one works fine :p

#

but only for 1.18.1+

#

rip 1.14.* - 1.18 support

#

nah im good

remote swallow
#
public void setTexture(SkullMeta meta, String texture) {
        GameProfile gameProfile = new GameProfile(UUID.randomUUID(), "");
        PropertyMap propertyMap = gameProfile.getProperties();
        propertyMap.put("textures", new Property("textures", texture));

        try {
            Field profileField = meta.getClass().getDeclaredField("profile");
            profileField.setAccessible(true);
            profileField.set(meta, gameProfile);
            profileField.setAccessible(false);
        } catch (NoSuchFieldException | IllegalAccessException ex) {
            ex.printStackTrace();
        }
    }
misty ingot
#

MineMemer wasnt even supposed to have 1.18 support

#

atleast it still has that

orchid trout
#

should i nest the completablefutures

#

like this

echo basalt
#

um

#

merging futures should be done with thenCompose

#

so

misty ingot
#

is there a way to make it so a player cannot close a menu if they try to do it with esc or something but if I do it from inside the plugin it closes

echo basalt
#

storeUser.thenCompose(data -> database.fetchStats(uuid)).thenAccept(stats -> ...)

echo basalt
misty ingot
#

any listener which can tell the diff between those?

echo basalt
#

ñope

misty ingot
#

oof

brisk estuary
#

I should use a concurrent map inside a asynchronous task, right?

brave sparrow
#

Not necessarily

#

What are you trying to do

brisk estuary
#

Basically a cooldown. I’ll store a boolean value in a map to every player and some time after a player executes an action it’s value in the map must be set to false

#

But I would set it to false with an asynchronous task

#

I’m not

brave sparrow
ivory sleet
brave sparrow
ivory sleet
#

if u have multiple threads, but lets say u have memory fences or other memory order effects then chm may not be necessary

brave sparrow
#

Synchronized maps or synchronized blocks can be just as valid ways to accomplish that if you aren’t trying to achieve high throughput reads+writes across multiple threads

ivory sleet
#

mye

#

well id avoid that map unless u know exactly what u want

brave sparrow
#

So far it doesn’t sound as if this needs to involve multiple threads at all

ivory sleet
#

indeed truly

livid dove
#

More just a general "you are spigot devs so i assume ya know" is there a place we take / can request commisions development wise?

Not got a particular need rn but just curious

remote swallow
#

?services

undone axleBOT
livid dove
#

cheers

dusky hinge
#

Hi!

I'm just starting out and I'm trying to detect whenever a minecart is spawned and then set it's max speed.

I'm stuck on the first part, because I tried doing something like this:

public class Events implements Listener {
    @EventHandler
    public void MinecartSpawn(EntitySpawnEvent event) {
        Entity entity = event.getEntity();

        if (entity.getType() != EntityType.MINECART) {
            getLogger().info("sorry no " + entity.getType() + " allowed");

            return;
        }

        getLogger().info("yo no way: " + entity);
        entity.remove();
    }
}

and it seems to work on every other entity I have tried except minecarts.

is this some kind of unwritten rule that minecarts are weird?

I also want to know how to convert an Entity to a Minecart so I can use Minecart specific functions like setMaxSpeed()

livid dove
#

wehn in stead you want the "yo no way : " message

dusky hinge
livid dove
#

i.e. which are you getting of the 2?

quaint mantle
#

hi.

#

how do you decipher a complex api you have never worked with or have no context of what it does exactly?

tawny remnant
livid dove
quaint mantle
#

they do.

dusky hinge
#

no log

#

no nothing

quaint mantle
#

not sure about it being good.

livid dove
livid dove
#

Or even better

#

im an idiot MC logs do it auto usually.

Go to ur console and see if an error pops up when u try

livid dove
quaint mantle
#

Is there a way to make something unburnable so it isnt destroyed in fire/lava like how netherite is?

livid dove
orchid trout
#

im pretty sure it inserts and then checks

#

there are duplicates in sql file

mint nova
#
 if(!p.hasPermission("nextcore.setspawn")){
                return true;
            }

            Location location = p.getLocation();

            plugin.getConfig().set("spawn", location);
            plugin.saveConfig();

Can anyone help? So i try to make "fast return" or something call like that, but i dont understand too much. I watch some tutorial but yea...

lost matrix
orchid trout
#

ywhea

lost matrix
#
INSERT INTO table_name (id, name) VALUES (?, ?) ON DUPLICATE KEY UPDATE;
orchid trout
#

i dont want to update

lost matrix
#

Whats your plan then?

orchid trout
#

i create user or not

#

and then i get value

mint nova
#

No. So when they haven't permission, they cant set spawn

orchid trout
#

ok ill do on duplicate key update

lost matrix
dusky hinge
#

Seems to work. but now if I want to do the same with boats.

I have this:

public class Events implements Listener {
    @EventHandler
    public void minecartCreate(VehicleCreateEvent event) {
        if (event.getVehicle() instanceof Minecart cart) {
            getLogger().info("got cart: " + cart);
            cart.setMaxSpeed(10);
        }
        if (event.getVehicle() instanceof Boat boat) {
            getLogger().info("got boat: " + boat);
        }
    }
}

it just throws an error whenever a boat is made:

#

jesus

#

what have i done

lost matrix
#

?paste

undone axleBOT
dusky hinge
#

sorry

#

fixed it

#

sorry about that

#

it wasn't intentional

lost matrix
#

This looks like an internal problem with paper

#

?whereami

dusky hinge
lost matrix
remote swallow
#

?tas

undone axleBOT
mint nova
#

its a shortcut

remote swallow
#

idk

mint nova
#

idk

brisk estuary
#

Try And See TAS

dusky hinge
#

so

#

time to complain

orchid trout
brisk estuary
#

then why idc stands for I don’t care? It should be idnc

tender shard
#

or in the grammar of 72% of spigot forums posts, why not "mnc" for "me no carings"