#help-development

1 messages ยท Page 829 of 1

river oracle
#

Also craftbukkit relocates

eternal oxide
#

this is for reflection so it gives exactly whast is in the package name

chrome beacon
#

Especially now with Mojang adding experimental content

orchid trout
#

what is this phenomeno m called

minor junco
#

Shouldn't be breaking changes at least if we talk semantic versioninh

river oracle
#

They put breaking changes into patches frequently

minor junco
#

That's interesting

#

I mean I work a lot with NMS but mostly through protocol lib and don't use version mapping most of the time

river oracle
#

Yeah protocol lib handles that shit foe you

#

Mostly unless the packet changes

#

Idk if they provide compat for that

minor junco
#

Nah not necessarily, protocol lib doesn't have everything mapped. Often I end up checking for mappings and use class member lookups

#

Or accessors as it's done

river oracle
#

Reflection ๐Ÿ˜ซ

#

I couldn't be fucked to do all that work when I could just mojmap

ivory sleet
#

What exactly lol

smoky oak
#

the like 12 messages above that one

ivory sleet
#

the var int thingy?

quaint mantle
smoky oak
ivory sleet
#

Idk, I mean I use duckduckgo, google and bing :>

river oracle
#

this is no secret?

#

why are we surprised that google prioritizes advertisers??

orchid trout
#

im so appaled by google doing that, so i just read books

ivory sleet
#

well, I suppose there are those that just live under a rock at times :>

young knoll
#

What did google do?

smoky oak
#

block other search engines and making its results worse by restructuring the way theyre ordered to favour paying websites even more than before

slate crown
#

guys

#

why, after deleting the uid.dat and teleporting the player to the island, do the players not see each other?

proud badge
#

yo where specifically do I put the ItemStack variable? (ItemStack itemInFrame)
alertComp.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_ITEM, itemInFrame));

slate crown
#

Who knows how to help. Look, I'm making a skyblock:
When the player enters, a copy of the island is created for him (with the removal of the uid.data). If someone is added to the island, that player is teleported to the owner's island.

Problem:
After the player teleports to the island, the players do not see each other.
However, if the owner re-enters, then the players see each other.
And also, if the players teleport to another world, they see each other.

I don't use packages. Vanish, etc., is not present either. Simple spigot teleportation methods.
Version: 1.12.2 (paper)

chrome beacon
#

Why are you removing uid.data

#

also we're not Paper

slate crown
proud badge
#

ok thx

eternal oxide
eternal oxide
#

when it's first loaded if there is no id it will be generated

slate crown
#

sec, i will send

#

        World originalWorld = Bukkit.getWorld("IslandCopy");
        if (originalWorld != null) {
            deleteUidDat(originalWorld);
            copyWorld(originalWorld, copiedWorldName);

            World copiedWorld = Bukkit.createWorld(new WorldCreator(copiedWorldName));
            copiedWorld.save();

            checkAndCreateIslandData(playerUUID);

            teleportPlayerToOwnerUUID(playerUUID);
        }
    }
eternal oxide
#

how certain are you that it's the missing id that causes this issue?

proud badge
#

would it be possible to convert ItemStack to Item

slate crown
eternal oxide
#

does the issue occur if you don't delete the id?

echo basalt
#

You should just copy everything except the id

#

been there done that about 4 years ago

slate crown
echo basalt
#

Yeah

#

uid.dat is just a binary file containing the world's uuid

slate crown
echo basalt
#

Don't delete it

#

Don't copy it either otherwise you'll have issues

eternal oxide
#

@echo basalt his issue is that players are invisible to each other when teleported to the new world.

echo basalt
#

I've only experienced block invisibility

icy beacon
echo basalt
#

Player invisibility is a new one

slate crown
#

So what should we do then? If it cannot be copied and deleted?

icy beacon
#

You can get an ItemStack from an Item, not the other way around

#

But you can spawn an Item and set its itemstack to be your desired itemstack

eternal oxide
#

I have seen player invisible issues but it was LONG ago and actually a bug with world loading.

#

or chunk loading to be precise

#

but thats all changed since then

#

can you repeat the invisible issue on Spigot?

echo basalt
#

think my block invisibility issue was because of how fast ppl were tp'ing to their worlds

slate crown
#

That is, players can break blocks, they can hear sounds, but they do not see each other

echo basalt
#

I've also had world corruption issues because IO is done async after the world saves

#

My solution to all of those issues was to just give up on using .mca files and have a world pool

slate crown
eternal oxide
#

If you can repeat this issue on Spigot we can look more into it, as paper and spigot world loading is different

slate crown
#

And there was also such a problem, although 1 time, as soon as the players entered, they did not see them when breaking blocks

slate crown
eternal oxide
#

it won't

#

its the clients not receiving the add player info

proud badge
#

is it possible to get an item inside of an item frame as an Item and not an ItemStack?

proud badge
#

rip

slate crown
#

And, I forgot to mention, when trying to teleport to the world through (multiworld /mw goto), it gives an error...

eternal oxide
#

Item is a wrapper for a dropped ItemStack

slate crown
#

eh... Idk where is a problem...

#

I forgot to say, as soon as the players become visible, they never become invisible again (i.e., when they re-enter, they see each other)

chrome beacon
#

used in hover component

eternal oxide
#

ah

icy beacon
#

Can somebody briefly explain why Spigot is not allowed to distribute Spigot jars, but forks like Paper or Purpur freely distribute theirs without needing to run something locally?

#

Just realized this

smoky oak
#

isnt it that they just dont care about the copyright theyre breaking

eternal oxide
#

?dmca

undone axleBOT
icy beacon
#

I think I've read that at some point

#

But it didn't make it clear why paper on the other hand can do the distribution

#

Unless I didn't read it well enough

icy beacon
#

That's weird then

eternal night
#

paper distributes a paperclip jar

#

which does not include mojang code, it just contains a giant binary patch that is applied onto the vanilla jar (which is downloaded on the server)

icy beacon
#

Ohh, I see

#

That makes sense, basically an alternate buildtools but abstracted xD

#

Tyty

halcyon hemlock
quaint mantle
#

is there a way to check if an interaction event is cancelled by another plugin

eternal oxide
#

yes

quaint mantle
#

cause it's cancelled if the vanilla behavior does nothing

eternal oxide
#

check on monitor priority isCancelled()

#

well

halcyon hemlock
eternal oxide
#

you can't detect if it was a plugin or vanilla

quaint mantle
halcyon hemlock
eternal oxide
#

only certain actions fire with a default cancelled though

halcyon hemlock
#

Vanilla cancels event?

quaint mantle
eternal oxide
#

some event fire cancelled if the vanilla action would do nothing

quaint mantle
#

idk

#

im making a custom item plugin

#

and i dont want items to trigger

#

if they're cancelled by like world guard or something

halcyon hemlock
#

Why not just check if event is cancelled, I'm confused

eternal oxide
#

yeah, just check in monitor if it's cancelled, if not run your code, but do NOT change anything in the event at monitor

quaint mantle
#

?

#

that wouldn't make a difference

hard perch
#

Hello, How to import CraftBukkit in maven ?

eternal oxide
#

?nms

eternal oxide
#

or

#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

eternal oxide
#

spigot not -api

slate tinsel
#

Anyone know why "findSafeDismountLocation" is null none of the values โ€‹โ€‹used are null

    @Override
    public Location getSafeLocation(Player player) {
        ServerPlayer entityPlayer = ((CraftPlayer) player).getHandle();
        ServerLevel serverLevel = entityPlayer.serverLevel();
        BlockPos blockPos = new BlockPos(entityPlayer.getBlockY(), entityPlayer.getBlockX(), entityPlayer.getBlockZ());

        Log.info("entityPlayer: " + entityPlayer);
        Log.info("serverLevel: " + serverLevel);
        Log.info("blockPos: " + blockPos);

        Vec3 vec3 = DismountHelper.findSafeDismountLocation(EntityType.PLAYER, serverLevel, blockPos, true);

        if (vec3 != null) {
            Location location = new Location(player.getWorld(), vec3.x, vec3.y, vec3.z);
            Log.info("location: " + location);
            return location;
        }
        return null;
    }```
digital carbon
#

Can someone help me with the config.yml I made a bungeecord server and linked it to the rest of the servers as I do however when I try to join the server I am greeted with a message "readtimeout : null" please help me resolve this issue im sure this is a common issue?

proud badge
#

BlockPlaceEvent is not triggered when I place water/lava, which event should I use?

eternal oxide
#

bucket events

hard perch
cloud walrus
#
package de.eugaming.test;

import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;

import java.util.List;

public class ChatFilter implements Listener {
    private List<String> filteredWords;

    public ChatFilter(List<String> filteredWords) {
        this.filteredWords = filteredWords;
    }

    @EventHandler
    public void onPlayerChat(AsyncPlayerChatEvent event) {
        String message = event.getMessage();
        System.out.println("Message: " + message);
        for (String word : filteredWords) {
            System.out.println("Word: " + word);
            if (message.contains(word)) {
                event.setMessage(message.replace(word, ChatColor.DARK_RED + word + ChatColor.RESET));
            }
        }

    }
}

Anyone Know why it Doesnt Run the if satement? inside the for loop

#

System.out.println("Word: " + word);
this works fine tho

quaint mantle
#

A lot of things could happen

#

case sensitive, didn't register, etc

cloud walrus
#

im sending one to one on of the words in the config

#

it doesnt detect it

#

but it reads the words out correctly

steel swan
#

hello, would someone know how to boost the amount of ore per chunks in a world?

eternal oxide
#

why not just increase the drops per block instead of messing with generation?

steel swan
proud badge
#
Sign sign = (Sign) block.getState();
String line1 = sign.getLine(0);
                String line2 = sign.getLine(1);
                String line3 = sign.getLine(2);
                String line4 = sign.getLine(3);```

Any idea why these are empty when the sign I placed isnt in a SignChangeEvent? The event itself fires fine but these Line variables are empty
steel swan
#

and i also want to boost caves sizes

eternal oxide
#

it would achieve the same thing, and simpler

young knoll
#

Datapack is your best option

steel swan
clear elm
#

?paper

#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
__**Admin:**__

selfrole Add or remove a selfrole from yourself.

__**Cleanup:**__

cleanup Base command for deleting messages.

__**Core:**__

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

__**Downloader:**__

findcog Find which cog a command comes from.

__**Mod:**__

names Show previous usernames, global display names, and server...
userinfo Show information about a member.

__**ModLog:**__

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

__**Permissions:**__

permissions Command permission management tools.

clear elm
#

!hell

#

!help

proud badge
clear elm
#

Is there an spigotapi?

#

Or only paper api

#

?spigot

hazy parrot
echo basalt
#

org.spigotmc:spigot-api:1.20.2-R0.1-SNAPSHOT or sumn

clear elm
wet breach
steel swan
#

would you guys know how to put a datapack on a world before generation? cuz i have a datapack that changes the world generation

wet breach
#

or maybe you meant to infer something else, in which case do note spigot came before paper by a long margin ๐Ÿ™‚

wet breach
#

however I am not quite familiar with that since I never bothered with it much, but there should be somewhere in the configs to do such things

young knoll
#

Nope you gotta load it and then restart the server

steel swan
#

like here is where i generate my world

#

do i need to put the datapack after the generation?

young knoll
#

Datapacks have to go in the main world

digital carbon
digital carbon
#

If so would you willing to help me resolve it?

wet breach
#

more then likely yes or its a plugin interfering either of those two are pretty much 90% of the reason

steel swan
wet breach
#

if you do have plugins, maybe try removing them and see if the problem persists

#

if it does, then its the way you configured

digital carbon
#

No plugins new server completely fresh

young knoll
#

But the server must be restarted after you add the datapack

wet breach
#

then the problem is most likely in your configuration. Is the server home hosted? a dedi? a vm?

digital carbon
#

It's on a server hosting service

steel swan
wet breach
#

I assume one of those panel hosts that don't really let you control the server right?

digital carbon
#

They do

#

I changed the config.yml

#

Of each server

wet breach
#

that isn't what I meant

digital carbon
#

Then wym

wet breach
#

are you able to change the OS of the server for example?

#

if the answer is no, then its a panel host that limits your control

digital carbon
#

what is the OS

#

I'm sorry I don't have much knowledge

young knoll
#

new File(worldFolder, "datapacks")

wet breach
digital carbon
#

OH OPERATINF SYSTEM

#

Yes

#

They let me configure that when I created the server

wet breach
#

ok but I think you are missing the point of the freedom of control

steel swan
digital carbon
#

So ur saying they should let the change it at any point of time?

wet breach
#

sure why not? its a vm

digital carbon
#

Yea they let me do that

wet breach
#

there is vm hosting providers all over that provide that since before these panel hosts existed ๐Ÿ˜›

digital carbon
#

I can configure that whenever I want

wet breach
#

well if they give you that freedom then, then I doubt its anything to do with the hosting provider

digital carbon
#

So if it's an issue at my end

#

How do I resolve it

wet breach
#

so that leaves either you misconfiguring something in the OS itself or in the server configs

#

I suppose we can start with the configs though as that would be easier to diagnose

digital carbon
#

Can you provide a list of thing I should change in the "config.yml" as to my knowledge I added the servers and changed the connection trottled to -1 and set bungeecord to true in all the linked server is there any thing else I need to do

wet breach
#

the default is perfect only requiring like couple lines of addition

digital carbon
#

Ok then, do I send a copy past of config here?

wet breach
#

?paste

undone axleBOT
orchid trout
digital carbon
#

omg that didnt work

wet breach
#

so....you chose to not use the link

digital carbon
#

my thing isint working

#

i troubleshooted for 20 days

wet breach
#

not sure what that has to do with the link

digital carbon
#

no im saying my browser isint functioning properly

#

therefore i am unable to open the link

#

but that issue is unimportant

#

shit thats the wrong config.....

#

il change it

#

ccan u del the link

orchid trout
#

๐ŸŸ

wet breach
#

interesting

#

wonder if the issue is just your system then

#

probably should fix it

digital carbon
#

no its not

#

ima send it to u on dms cus it has numberic ips in it

wet breach
#

no one cares about ip's and they are not private anyways, but if you are that concerned just replace them with fake ones

#

like make one just all ones

#

another 2's to differentiate what it is you are doing

#

I don't read DM's to put it more simply

digital carbon
#

screw it

#

this is the config from today after i changed the configurating a little bit

#

i troubleshooted my browser

small glen
#

Hey i need help, With the Spigot 1.10.2 API and ProtocolLib and JavaI'm looking to make a command called /checkvelocity, which is used to detect if a player has anti-knockback, during the check I'd like to block packets to the targeted player in order to put him as a spectator and give him velocity but I want the other players to be able to see the player still in front of them as if nothing had happened and once the check is complete, to be put back on life support and get his packets back. i heard that we can block with ProtocolLib the packet but i don't know anything about packet

wet breach
digital carbon
#

yes im using skynodes for the other servers and another host for bungeecord

#

is that an issue because ive tried that in the past

wet breach
#

idk what skynodes are

digital carbon
#

its just a server hosting service

wet breach
#

anyways have you tried connecting to those servers directly?

digital carbon
#

yes but

#

i have bungeecord on true

#

so it dosent allow me in

wet breach
#

try connecting to them directly

#

to ensure its not the servers

digital carbon
#

ok

#

when i join with bungeecord on false it lets me in however when i put bungeecord on true it says that i need to conect with the bungeecord IP

#

but when i use the dumb bungeecord IP it connection timed out no further info

short pilot
#

Scenario:

There's an add to faction command that gets called when players join, and also when a player creates. I want to implement additional things if it's the case where a player is creating and then joining (like adding them as a leader, giving special perm levels, etc)

Should I add another parameter to the addToFaction() to check if it's a join or create, or make an entirely different special add function for the case of a faction creation?

wet breach
digital carbon
#

i really need to gain some knowledge ๐Ÿ’€

wet breach
#

do you not know how to get to the terminal of your server?

digital carbon
#

Nope

#

is there any alternavite name for the terminal?

wet breach
#

ok....well you are going to need an ssh client. I assume your hosting provider has some documentation on connecting to your server via ssh

#

unless you really don't have unlimited control over it

digital carbon
#

yes

#

i have unlimited controll.....i belive

#

believe*

smoky oak
#

is 20.4 currently considered stable?

wet breach
digital carbon
#

il figure it and get back

#

ok well the hosting service ppl say i cant ssh into the server

wet breach
#

ah and so we discover that no you don't have unlimited control

digital carbon
#

welp no unlimited control ig

wet breach
#

anyways, I don't really see anything wrong with your config. The issue is most likely stemming from the host or ip you have but I can't determine that if you don't have the ability to self diagnose the host to begin with

#

hence me wanting you to ping from the bungee host to the mc server one

digital carbon
#

would i say the hosting serive sucks if isaid i cant do that either

wet breach
#

indeed

#

as I said earlier there is plenty of vm providers that let you have unlimited control

#

and they are cheap too, and provide better specs

#

when I say vm providers they are also known as VPS's

#

or you can go with a dedicated server box

#

depends on your budget

inner mulch
#

does somebody know if a lot of data in a pdc, and i mean a lot can cause the chunk corruption glitch, or other problems? (im on 1.20.2 mc)

wet breach
#

you can get quite a decent dedi for like $70/m

inner mulch
wet breach
#

and just so you know, the chunk doesn't get corrupted either

digital carbon
#

welp guess il just buy another one i just bought this cus it same with a sql package but whatevr. Thanks for your time trying to troubleshoot with me

wet breach
inner mulch
#

no

wet breach
#

you do know chunks are in region files correct?

inner mulch
wet breach
#

well yes, but its also important to understand why the chunk becomes unloadable

#

so you know how to avoid it or fix it

#

anyways, region files hold something like 1024 chunks

#

the server loads these region files by memory mapping

#

unlike most api methods in Java, memory mapping actually invokes OS api

#

therefore the files are loaded into memory via the OS and are outside of Java's memory

#

this is important because the key here is the file is loaded into memory

#

the entire file

#

so, if the file is say 6gb large

#

then its going to consume 6gb of ram

#

if you don't have the memory for it, it just doesn't load

inner mulch
#

and this counts for pdc as well i guess?

wet breach
#

I am not entirely sure because I am not sure if the pdc contents are stored directly in the chunk or if they are in a separate file

#

if they are in a separate file, then its not really an issue

inner mulch
#

hmm i hope they are then

wet breach
#

otherwise, if its stored in the chunk, then potentially it could cause the chunk to not load

carmine mica
#

its in the chunk file iirc

wet breach
#

but, you would need a lot of data though because as far as I am aware pdc just stores strings

carmine mica
#

? pdc stores nbt

ivory sleet
#

Yeah its just a wrapper around nbt

#

And is saved/loaded with its parent holder basically

inner mulch
#

so big pdc can be big problem?

wet breach
#

eventually

inner mulch
#

im currently saving a customitem object to an itemstack, which is created with the item's pdc data, should i just use the data from the pdc directly or is a lot faster having it stored in a object?

wet breach
#

if speed is your concern just store binary data yourself in your own file

#

use memory mapping for it

#

should be plenty fast

#

as I have told others in how fast this can be, well you can load 20mil blocks of information in 6 seconds and save it in 3

inner mulch
#

okay thats quite fast

wet breach
#

if you need faster, probably should start looking into DB software at that point

inner mulch
#

i know how to create dbs

native nexus
#

I was about to mention that and your concerns for storage become less worrying

inner mulch
#

so you guys think i should save every custom item in a database?

#

personally i thought this isnt good because players could create an infinite amount of them and tracking which of them are destroyed by lava or something else would be kinda not fun

#

with pdc the server would only know about the items that are there and in use, right?

pseudo hazel
#

you dont put every spawned in item in a database

wet breach
#

load the items you want to track for the players online

pseudo hazel
#

if anything you would just store the info used to create the item

native nexus
#

You can make it so those custom items can't be taken out of the inventory. I think we need a bit more context on what you want the custom items to be and how they are utilised

inner mulch
#

therefore be unique

eternal night
#

what again was the issue with PDC here ? ๐Ÿ˜…

pseudo hazel
#

why do you put them in a database

eternal night
#

what kind of madness are you planning on storing the a PDC

wet breach
inner mulch
pseudo hazel
#

I guess

eternal night
#

I mean, doubt it ?

#

Your plugin controls that data right ?

pseudo hazel
#

I would just rely on mc to store the items for me

eternal night
#

people writing 60 pages of utf-8 garbage into books is a lot more deadly than you storing a couple strings and bytes in a PDC

inner mulch
eternal night
#

Yea, that seems perfectly fine

inner mulch
#

but there will probably be more

wet breach
pseudo hazel
#

just use /data on any hand item, that already has a ton of existing variables and its fine

eternal night
#

yea, I would not worry about a couple floats lol

pseudo hazel
#

yes that may be true

inner mulch
eternal night
#

I'd go with PDC.
The alternative is pretty much always a slapped UUID into the PDC and then all that data in a DB

pseudo hazel
#

if your only issue is overloading chucnks, then yeah, just use pdc

wet breach
eternal night
#

I mean, sure ?

#

but you can do that with or without PDCed items

#

the floats are not like a 10x on the item size lol

meager wolf
#

how do people usually "store" players' options, for example, if a player disabled public chat feature how do u save that

eternal night
#

I'll write you a couple of nice mandarin character filled books

#

smack them into a chunk

#

and youll be at the same end

carmine mica
#

for small stuff like that

#

more in-depth systems probably warrant a database to track that stuff

inner mulch
carmine mica
#

but if something warrants a single bool for each player, im not gonna bother with a whole databsae

wet breach
meager wolf
#

ok ๐Ÿ‘

#

ty

smoky oak
#

wdym u cant use profile to profile ban

eternal oxide
#

cast teh returned BanList

smoky oak
#

nope

eternal oxide
#

thats not a cast

smoky oak
#

what am i supposed to cast it to then?

eternal oxide
#

probably BanList<BanEntry>

#

or ProfileBanLIst<BanEntry>

smoky oak
#

neither of those work

eternal oxide
#

sec

carmine mica
#

this is all caused by enums

#

it can't return the correct type cause the type is an enum

smoky oak
#

so?

#

๐Ÿคฆ
Player::ban exists

short plover
#

how would I check if a block would change a noteblock instrument to BASS

eternal oxide
#
ProfileBanList bans = Bukkit.getBanList(BanList.Type.Profile);
bans.addBan(Bukkit.createPlayerProfile("test"), null, null, null);```
#

Or just casting java ((ProfileBanList)Bukkit.getBanList(BanList.Type.Profile)).addBan(Bukkit.createPlayerProfile("test"), null, null, null);

carmine mica
#

such unsafe API. cause that compiles, but here is also what compiles.
BanList<ItemMeta> banList = Bukkit.getBanList(BanList.Type.PROFILE);

#

and that at runtime by itself won't throw any exceptions

#

ofc you will get an error when you try to ban an instance of itemmeta at runtime cause it can't be cast to PlayerProfile

snow compass
#

What do it means with this Represents a choice of multiple matching Materials. in the javadoc for MaterialChoice?

In-game it does not behave as I think it does.

And also ExactChoice is little confusing Represents a choice that will be valid only one of the stacks is exactly matched (aside from stack size). Only valid for shaped recipes do you not want all items to match when use exact beside metadata?

carmine mica
#

how would that work? how would any itemstack match both an itemstack with 2 durability and an itemstack with 3 durability?

snow compass
carmine mica
#

ignores massive not code block or pastebin

carmine mica
#

if I create an exact choice with a oak plank with a special name and a spruce plank with a special name, then either one of those works for that recipe choice

snow compass
carmine mica
#

well its only 1 recipechoice, it can only match against 1 input

#

you have to add another recipe choice instance if you want your recipe to take multiple ingredients

snow compass
#

even if both methods supports array of items?

carmine mica
#

the arrays of items are for matching against 1 input

snow compass
carmine mica
#

no? its a 3x3 grid

#

each choice represents 1 of those 9 slots

#

or well it can match multiple if you specify the shape with duplicate chars

snow compass
carmine mica
#
shaped recipe with shape "# #", "   ", "# #"
set # to be materialchoice(OAK_PLANK, SPRUCE_PLANK)

means I can put either oak or spruce planks in those 4 corner slots

#

no, you can have up to 9 instances of choice for a 3x3 shaped recipe

#

cause you can't have more than 9 ingredients

snow compass
carmine mica
#

yeah, its a string

#

the shape I have matches that

#

its 3 strings so > 0 < 4

#

each string is > 0 chars < 4 chars

wet breach
snow compass
carmine mica
#

yes

#

and you can set a recipe choice for each of those 9

snow compass
# carmine mica yes

alright it is why shape use string and not char then, that clears up 1 or 2 things. Thanks for the help.

carmine mica
#

yeah. I think it would be more clear if the parameter was char[][], but ๐Ÿคทโ€โ™‚๏ธ

snow compass
hard perch
river oracle
#

ChatGPT says nothing useful most of the time lol

hard perch
#

That time, it gave an answer better than human

glad prawn
#

He uses anwser from human

hard perch
#

Yes, but he chooses the more coherent answer among human answers so it's better

eternal night
#

That is truely how large language models work NODDERS

slate tinsel
#

How do I make players unable to take damage from a certain rocket that was created by the code and make it not create flash?

#

when I say flash I mean this:

wet breach
glass mauve
#

why are the methods in MapPalette deprecated? what should I use instead?
I want to send map data through packets and need to send an array of byte
would that be the index of the color palette, like how MapPalette stores it?

wet breach
#

you can still use deprecated methods

sullen marlin
#

Check the javadocs

thin venture
#

I'm playing around with the 1.19.4 text display entities and I want to be able to set the color of the text, how do I do that?

sullen marlin
#

ChatColor ?

thin venture
#

I want to be able to set color via a hex code

sullen marlin
#

ChatColor.of(..)

thin venture
#

that worked :)

clever lantern
#

do blocks have any way to store data in them?

echo basalt
#

?blockpdc

undone axleBOT
smoky oak
clever lantern
#

is there a difference in speed between sending packets and using spigot?

clear elm
#
    public static void main(String[] args) {

        int[] numbers = new int[1000];

        for (int i = 0; i < numbers.length; i++); {
            numbers[i] = i + 1;
        }
        for (int i = 0; i < numbers.length; i++); {
            System.out.println(numbers[i]);
        }

    }
}```
#

i cant put in ,,i,,

#

why?

#

java: Symbol nicht gefunden
Symbol: Variable i
Ort: Klasse main

quiet ice
#

that code should compile

clear elm
#

what

quiet ice
#

Oh I see

#

You have a trailing semicolon after your for loop header

#

So your code would basically compile to (if you were able to compile it)

public class main {
    public static void main(String[] args) {
        int[] numbers = new int[1000];
        for (int i = 0; i < numbers.length; i++) { /* EMPTY BODY */ }
        numbers[i] = i + 1;
        for (int i = 0; i < numbers.length; i++) { /* EMPTY BODY */ }
        System.out.println(numbers[i]);
    }
}
#

Since the for loops would be de-facto NOPs in their entirety, you'd effectively get

public class main {
    public static void main(String[] args) {
        int[] numbers = new int[1000];
        numbers[i] = i + 1;
        System.out.println(numbers[i]);
    }
}
#

And here you can see why i cannot be found

worldly ingot
#

TL;DR: You don't need to put a ; at the end of your loops lol

quiet ice
#

Well need is a rather weak word, you ought not do so

clear elm
#

what

quiet ice
#

There is a ; between your ) and {

worldly ingot
#
// What you have
for (int i = 0; i < numbers.length; i++); {
    numbers[i] = i + 1;
}

// What you SHOULD have
for (int i = 0; i < numbers.length; i++) {
    numbers[i] = i + 1;
}
worldly ingot
clear elm
#

ohh ty

#

yay it works

cyan void
#

dose anyone know how i can remove all the defualt achevements in minecraft with a plugin?

clear elm
#

how u guys make code with colors here?

quiet ice
cyan void
worldly ingot
viral temple
#

any open source plugins with a good implementation/framework for commands I can study? thank you in advance.

clear elm
#
public class main {
    public static void main(String[] args) {

        int[] numbers = new int[1000];

        for (int i = 0; i < numbers.length; i++); {
            numbers[i] = i + 1;
        }
        for (int i = 0; i < numbers.length; i++); {
            System.out.println(numbers[i]);
        }

    }
}```
worldly ingot
#

Need a new line after your "java", but yeah

quiet ice
#

It needs to be on the same line

worldly ingot
#

ye

clear elm
#

yay

quiet ice
#

Not entirely sure whether that is what you want though

viral temple
#

no, that's good

#

this is a first one trully using annotations

#

I'm thinking about brigadier but with annotations, or something in-between

dry hazel
#

incendo's cloud

viral temple
#

yes, something like that ๐Ÿ˜„

#

thank you very much

worldly ingot
#

Cloud might be a tad bit overengineered, but knock yourself out I suppose :p

compact haven
#

cloud is definitely overengineered

#

but that's what makes it so great

carmine mica
#

cloud >>>>>>

compact haven
#

im ngl I just see too much appeal in incendo and lucko projects

#

like they're overengineered to some but you can make them do quite a bit since its so extensive and abstract

clear elm
#

is it complicated to create custom items?

viral temple
compact haven
#

are you trying to make a command framework or am I just misunderstanding

quiet ice
viral temple
#

I just trying to see what else I can find that doesn't look like a monster in my code. that's all

#

I guess a simple CommandNode<> that does all the stuff didn't kill anyone

clear elm
#

and pickaxe taht miney 3x3

quiet ice
#

The first one might be semi-easily possible, the second one is more difficult.

rotund ravine
#

I made one of those

#

I had to take permission plugins into consideration ๐Ÿฅฒ

viral temple
rotund ravine
quiet ice
#

Ah yeah, block permissions isn't fun

young knoll
#

Just uhh

#

Fake a place event

#

kek

rotund ravine
#

I faked the break event

quiet ice
#

That will cause exploits with other plugins

rotund ravine
#

But then suddenly anticheats and stuff got mad

quiet ice
#

Notably, McMMO

rotund ravine
#

Then i had to exclude specific plugins from my faked events

young knoll
#

Skill issue on their part

rotund ravine
#

Was a whole 1 hour issue

quiet ice
#

I do support both systems though, just in case.

young knoll
#

At least you don't need to fake a break event anymore

clear elm
#

like 5$ or 50$?

rotund ravine
#

Depends on who is making it

smoky oak
#

lol

quiet ice
#

Depends on the quality. You easily could get it made for either pricetag

rotund ravine
#

Iโ€™ll do it for 150$

clear elm
#

no ty

quiet ice
#

Although yes, it also depends on who makes it

clear elm
#

hmm is it very hard

#

i need them for my server

quiet ice
#

It isn't super duper hard, it just requires you to have a little bit of minecraft-specific knowledge

clear elm
#

could i make it with 0 experience with it

smoky oak
#

i mean, depending on how you do the mining thing it can be done quite quickly

#

pickaxe probs yes, chestplate probs not imo

young knoll
#

You could probably just buy an existing plugin to make it

#

Like ecoitems or whatever

quiet ice
#

Settings attributes and doing stuff with the PDC should be the most challenging task

clear elm
young knoll
#

Probably

#

Youโ€™d have to look at the features first

smoky oak
#

'it will work' is not something you utter in it

smoky oak
#

the other day i had code work on the 1st try

#

it was a haunting experience i tell ya

quiet ice
#

For me it regularly works on the 1st try, but there are a few bugs that I only uncover months afterwards

rotund ravine
#

Well most of my code works on the first try, itโ€™s just the middle parts of the code that sometimes messes up. Breaking everything

smoky oak
#

half my bugs are typos anyway lol

young knoll
#

If you never find the bugs then do they really exist

rotund ravine
#

True

quiet ice
#

I mean, noone will report them so I guess /shrug

clear elm
#

i need an java dev to make custom items right?

rotund ravine
#

Just tell the user itโ€™s a viaversion issue

#

Theyโ€™ll live with it

quiet ice
young knoll
#

Oh yeah script also exists

#

Kek

smoky oak
#

well, it depends how much pain you want to put yourself through

rotund ravine
clear elm
rotund ravine
#

๐Ÿคฎ

clear elm
#

i found it in some tutorials

rotund ravine
#

Tom

clear elm
#

yes?

rotund ravine
#

We donโ€™t do much the vanilla way here

smoky oak
#

yea we do it through four different layers of api :kekw:

clear elm
#

that means

rotund ravine
#

But sure you can use it though to get ur custom items

clear elm
#

hmm okay

restive mango
#

Anyone know anything (or a place where I could find documentation for) about the automatic saves that servers do?

clear elm
#

what means different apis?

#

i tought for minecfat u only need paper api

smoky oak
#

welllll no

young knoll
clear elm
#

4 apis?

smoky oak
#

the way it works is that some people took vanilla and made modifications to it

#

that gives you bukkit

#

then some people thought 'we can do better but this is a nice starting point' and did the same thing to bukkit, resulting in spigot

#

people did the same thing again to spigot, resulting in paper

#

and then they did it again to spigot to create a multi-threaded executable named folia

restive mango
#

Specifically, Iโ€™d like to be able to save a list of blockstates between restarts

young knoll
#

Hey donโ€™t forget purpur

#

Or airplane

clear elm
#

so bukkit paper spigot and folia?

young knoll
#

Or pufferfish

#

Or whatever

clear elm
#

i never heard of foila

rotund ravine
#

Folia is not for you Tom

smoky oak
#

tldr

#

spigot is fine for 95% of servers

clear elm
#

ok

#

how much experience u guys have?

smoky oak
#

uh

clear elm
#

time like 1 year 2 years ...

smoky oak
#

java? 10 years
skill? about 3 years

opal juniper
smoky oak
restive mango
#

Iโ€™d like to be able to destroy blocks in an explosion, have the server autosave, and then regenerate them after a server crash

rotund ravine
undone axleBOT
clear elm
#

is tehre an spigotapi i only heard of paper api

smoky oak
#

well yea i put a \ in front of it

clear elm
restive mango
smoky oak
#

api is just what we use to 'talk' to the server

river oracle
smoky oak
#

paper is an extension of spigot

#

its based on it, so most spigot stuff works in paper

young knoll
#

What the fuck is a spigot

restive mango
#

A tap for dispensing a fluid

smoky oak
#

its the thing in the wall

rotund ravine
#

Coll with his midlife crisis

clear elm
#

so if i wanna learn plugin makeing i have to learn spigot or paper api?

rotund ravine
#

No learn java

#

Or kotlin

smoky oak
#

ah true

restive mango
#

Learn Java

river oracle
clear elm
restive mango
#

Good

smoky oak
#

I recommend java so that you know what kotlin is doing once you use it

rotund ravine
#

Gj

clear elm
#

but waht i have learn to make plugins

young knoll
smoky oak
#

mostly overrides lol

clear elm
#

paper api?

rotund ravine
#

There is also clojure

smoky oak
#

er well, no

river oracle
clear elm
#

i wanna make plugins

restive mango
#

Or resources

clear elm
smoky oak
#

like i mentioned above, an api is just the thing between what you make and what the server does with it

#

it provides easy access

restive mango
#

I have literally made worldedit schematics of the destroyed areas

#

But that seems

#

Inefficient

clear elm
#

so with normal java i cant make plugins what i need to do it

smoky oak
#

so what you learn is not a specific api, but how to make use of apis in general

young knoll
#

Well you can convert a block into a string that has its entire state

rare rover
#

hmm why am i getting this error (Im using mojang mappings):

        at me.outspending.biomestest.registry.BiomeResourceKey.<init>(BiomeResourceKey.java:16) ~[Biomes-Test-1.0-SNAPSHOT-dev-all.jar:?]
        at me.outspending.biomestest.Main.onLoad(Main.java:16) ~[Biomes-Test-1.0-SNAPSHOT-dev-all.jar:?]
        at io.papermc.paper.plugin.storage.ServerPluginProviderStorage.processProvided(ServerPluginProviderStorage.java:59) ~[purpur-1.20.2.jar:git-Purpur-2095]
        at io.papermc.paper.plugin.storage.ServerPluginProviderStorage.processProvided(ServerPluginProviderStorage.java:18) ~[purpur-1.20.2.jar:git-Purpur-2095]
        at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:39) ~[purpur-1.20.2.jar:git-Purpur-2095]
        at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:36) ~[purpur-1.20.2.jar:git-Purpur-2095]
        at org.bukkit.craftbukkit.v1_20_R2.CraftServer.loadPlugins(CraftServer.java:528) ~[purpur-1.20.2.jar:git-Purpur-2095]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:310) ~[purpur-1.20.2.jar:git-Purpur-2095]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1102) ~[purpur-1.20.2.jar:git-Purpur-2095]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[purpur-1.20.2.jar:git-Purpur-2095]
        at java.lang.Thread.run(Thread.java:840) ~[?:?]
Caused by: java.lang.ClassNotFoundException: net.minecraft.resources.ResourceLocation
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:199) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:166) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?]
        ... 11 more
restive mango
#

I wish I could just serialize blockstates ugh

smoky oak
#

plugins work by using a small piece of code provided by the api to 'hook' themselves into the server

young knoll
#

But that wonโ€™t have tile-entity data

restive mango
#

When was this

#

Oh

#

Yeah

#

I need both

rare rover
clear elm
#

hmm i dont rlly understand i can select what plugin iwanna make spigot or paper

#

what i have to select

restive mango
#

Paper

smoky oak
#

no

restive mango
#

Do paper

#

!

rare rover
#

paper is faster

restive mango
#

Ultimately it doesnโ€™t matter too much tho

#

Paper isnโ€™t that much better than spigot

#

Itโ€™s like 10% better

rare rover
#

i personally use purpur but

clear elm
#

wdym ,,better,,

restive mango
#

Itโ€™s better

#

Has more functionality is faster quicker thiccer

clear elm
#

how better

#

okay

restive mango
#

Saves better dances better jumps better sings better

#

Iโ€™ll change my mind if you can fix my coding problem @clear elm

clear elm
#

but is it in general the same to code?

restive mango
#

Yes they all take Java plugins

rare rover
#

i mean paper is a fork of spigot

#

so yes

restive mango
#

It just gives you more methods to use

#

Basically

clear elm
restive mango
#

Argh

clear elm
#

paper right?

restive mango
#

Paper

clear elm
#

and how can i learn paper api

#

ik ik first learn normal java how to learn paper api than

chrome beacon
#

Yeah was about to say

#

1 week is not enough

rotund ravine
#

Learn java some more

#

Then go to the papermc discord and ask again

clear elm
#

and how to learn spigot after this

clear elm
rotund ravine
#

No

restive mango
#

No

clear elm
restive mango
#

You should learn by doing

#

Heโ€™s wrong

#

Code a simple plugin that like

#

Just says a word

clear elm
#

If idk how

restive mango
#

Then one which gives you a potion effect

#

Etc

carmine mica
#

If you donโ€™t know any Java, learn Java

clear elm
#

I only know system.out.println

rotund ravine
#

We donโ€™t want to be your teachers when you stumble upon simple issues a java course could have taught you. ๐Ÿฅฒ

restive mango
#

Copy him

#

@clear elm

#

Start with spigot tutorial 1

#

And learn

chrome beacon
#

Spigot youtubers usually teach bad practices

#

So Id avoid that

restive mango
#

I wouldnโ€™t avoid it

clear elm
#

Ig I watch some plugin make tutos on yt

restive mango
#

Learn how to do it first

#

Clean up your practices after

rotund ravine
#

๐Ÿ˜ด

chrome beacon
#

Also learning one step at a time is important

restive mango
#

Probably

#

Like start with something really simple

#

I do think doing is the best teacher though

chrome beacon
#

Yeah something without Spigot

restive mango
#

โ€ฆeh

#

No

#

Start with spigot

#

Heโ€™s not coding for normal Java after all

carmine mica
#

what is "normal java"

chrome beacon
#

Start with the basics then you can move to Spigot

restive mango
#

@carmine mica console

#

Weโ€™ll start with either I guess lol

#

Take your pick

#

I started coding with spigot, never did any Java beforehand, and I was fine

#

reveals that his face is half melted off

quaint mantle
restive mango
#

๐Ÿ‘

chrome beacon
restive mango
#

You have half your face melted off, too?

quaint mantle
#

no the /config won't appear let me show ya the command section for it

chrome beacon
#

Also you're registering the executor twice

quaint mantle
#

can you tell me where?

chrome beacon
#

32 & 38

quaint mantle
#

can that cause an issue?

chrome beacon
#

Depends on how your command code works

quaint mantle
#

ah i see what about making custom join sound do you maybe know anything of that?

short pilot
#

There's an add to faction command that gets called when players join, and also when a player creates. I want to implement additional things if it's the case where a player is creating and then joining (like adding them as a leader, giving special perm levels, etc)

Should I add another parameter to the addToFaction() to check if it's a join or create, or make an entirely different special add function for the case of a faction creation?

quaint mantle
#

does someone know how ould i fix this ?

[00:38:06 ERROR]: Error occurred while enabling LiquidREST v0.1.0 (Is it up to date?)
java.lang.IncompatibleClassChangeError: Class org.eclipse.jetty.util.ArrayTernaryTrie$Growing does not implement the requested interface org.eclipse.jetty.util.Index$Mutable
        at org.eclipse.jetty.webapp.ClassMatcher$ByPackage.add(ClassMatcher.java:223) ~[LiquidREST-0.1-all.jar:?]
        at org.eclipse.jetty.webapp.ClassMatcher$ByPackageOrName.add(ClassMatcher.java:314) ~[LiquidREST-0.1-all.jar:?]
        at org.eclipse.jetty.webapp.ClassMatcher$ByPackageOrName.add(ClassMatcher.java:286) ~[LiquidREST-0.1-all.jar:?]
        at org.eclipse.jetty.util.IncludeExcludeSet.include(IncludeExcludeSet.java:131) ~[journeymap:?]
        at org.eclipse.jetty.webapp.ClassMatcher.add(ClassMatcher.java:596) ~[LiquidREST-0.1-all.jar:?]
        at org.eclipse.jetty.webapp.ClassMatcher.add(ClassMatcher.java:566) ~[LiquidREST-0.1-all.jar:?]
        at org.eclipse.jetty.webapp.ClassMatcher.add(ClassMatcher.java:71) ~[LiquidREST-0.1-all.jar:?]
        at java.util.AbstractCollection.addAll(AbstractCollection.java:336) ~[?:?]
        at org.eclipse.jetty.webapp.ClassMatcher.addAll(ClassMatcher.java:680) ~[LiquidREST-0.1-all.jar:?]
        at org.eclipse.jetty.webapp.ClassMatcher.setAll(ClassMatcher.java:671) ~[LiquidREST-0.1-all.jar:?]
        at org.eclipse.jetty.webapp.ClassMatcher.<init>(ClassMatcher.java:517) ~[LiquidREST-0.1-all.jar:?]
        at org.eclipse.jetty.webapp.WebAppContext.<clinit>(WebAppContext.java:171) ~[LiquidREST-0.1-all.jar:?]
        at wtf.justmammtlol.plugins.LiquidREST.Rest.start(Rest.java:28) ~[LiquidREST-0.1-all.jar:?]
        at wtf.justmammtlol.plugins.LiquidREST.LiquidREST.setupWebServer(LiquidREST.java:46) ~[LiquidREST-0.1-all.jar:?]
        at wtf.justmammtlol.plugins.LiquidREST.LiquidREST.onEnable(LiquidREST.java:85) ~[LiquidREST-0.1-all.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:273) ~[forge:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:335) ~[forge:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:479) ~[forge:?]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:502) ~[forge:7e29f765-296df566-9fb885e8]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:414) ~[forge:7e29f765-296df566-9fb885e8]
        at net.minecraft.server.MinecraftServer.func_240787_a_(MinecraftServer.java:427) ~[?:?]
        at net.minecraft.server.MinecraftServer.func_240800_l__(MinecraftServer.java:347) ~[?:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:227) ~[?:?]
        at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:768) ~[?:?]
        at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:267) ~[?:?]
        at java.lang.Thread.run(Thread.java:840) ~[?:?]
[00:38:06 INFO]: [LiquidREST] Disabling LiquidREST v0.1.0
[00:38:06 INFO]: Disabled LiquidREST```
fickle harbor
#

Hello! I'm "beginner" and the spaces and # go away when the config load on the server, can semeone help me ? Ty

warm mica
young knoll
#

Not in modern spigot

quaint mantle
wind veldt
ivory sleet
#

Or just use spigots api for it

#

since they do provide api for it which calls snakeyaml, which on its own hand does support comments nonetheless :D

#

how amazing

young knoll
#

Only since 1.18

#

What about my plugin for 1.2.5!

restive mango
young knoll
#

Your only real option would be NBT

#

But thatโ€™s outside the api

ivory sleet
restive mango
young knoll
#

Shove the block into one of Mojangs NBT serializers are store the output

restive mango
#

so, find this mojang nbt serializer, use that on the nbt data, and save the block type

#

then just set the block type and deserialize the nbt data onto it?

young knoll
#

Yes

#

You can probably pass the entire block into the serializer

#

Convert it into snbt or somethin

#

If not then just the tile entity

remote swallow
#

@quaint mantle the tick api got merged

quaint mantle
#

Anyway, which was the question?

#

Too lazy to scroll up

restive mango
#

@quaint mantle
"Hello everyone.

I would like some advice on how to save blocks.

I have a plugin I have designed which blows blocks up in a sphere (replaces them with air, spawns falling blocks that go flying everywhere, the whole shebang), and saves a worldedit schematic of the area to a folder just before the explosion happens. This schematic is then used to regenerate the area some time later. This works very well because, even in the event of a crash after an autosave has transpired, my plugin scans through a folder where all the schematics are stored and uses their file names (in which Iโ€™ve stored location information) to place those schematics in the world and thus fill the holes left by the explosions.

However, I have a nagging suspicion that this is a shit way of doing this. My worldedit system is even just saving a cube of terrain containing the explosion, and doesnโ€™t even save a sphere or some smaller unit of space!

Do you have any suggestions for how I can duplicate this functionality in a way that is faster and better for my server?

Any thoughts would be appreciated, please and thank you"

quaint mantle
#

You will need to store those blocks in a file (in my case json)

#

Then you can read that json later and load the data

#
{
  "blocks": [
    {
      "world": "<uuid>",
      "x": 0,
      "y": 0,
      "z": 0,
      "nbt": "AAA=",
      "type": "SOMETHING"
    }
  ]
}
#

You can ignore storing AIR blocks

#

Again, if you choose to store your own "schematic" file, you can make it so you store the blocks you want, and not every block (and entity) in the area

#

Because I think WE schematics also store entities

restive mango
#

ugh

quaint mantle
#
JsonArray array = new JsonArray (); //Using google gson
for () {... /*iterate on the blocks in the sphere areea*/
  JsonObject object = new JsonObject();
  Block block = /*current block in the spherical radius*/;
  Material type = block.getType();
  if (type.isAir()) continue;  

  object.addProperty("world", block.getWorld().getUID());
  object.addProperty("x", block.getX());
  //Same for Y and Z

  object.addProperty("nbt", Base64.getEncoder().encodeToString(block.getBlockData().getAsString().getBytes())); //Store block data in base64
  object.addProperty("type", type.name());

  array.add(object);
} //end for
restive mango
#

im unfamiliar with storin--oh

#

this will be useful then

#

thank you

quaint mantle
#

Np

restive mango
#

okay FINE he was right all along

#

learn oop, then c, and then daisy, and only then can you learn java

quaint mantle
#

You can skip C and daisy part

#

I would also recommend you to learn a bit about clean code

#

It will help you

restive mango
#

yeah my code is super messy

#

also

#

@quaint mantle ill take a crack at this and get back to you if there are more question if that's okay, haven't used encoders and the lik ebefore

#

or

quaint mantle
restive mango
#

if there is a guide

#

yeah

#

i mean

#

expect a message from me within 30 days

#

lol

quaint mantle
#

lmao

quaint mantle
restive mango
#

hm

#

i think i wont store it

#

like you said though

#

i think i'll probably store it in a database

#

probably

#

but obviously, i will still encode it into a string first

#

hm

quaint mantle
#

First of all, make you this question "Do you really need a database"?

#

If you can store it in a single file, you don't

restive mango
#

actually, it occurs to me this wont work for tile entities, since blockdata doesnt include the tile entity

quaint mantle
#

You can modify the code I've write to include entities

restive mango
#

but the general

#

yeah

#

i will be doing that

#

ty

#

it is useful start though

quaint mantle
#

Again, I recommend you to start learning the basics of oop, then you can go straight to the basics of java

restive mango
#

eurgh

#

this actually means i need to figure out how to merge a block and a tile entity

quaint mantle
#

No, that means you need to figure out, how to modify the code I've write to allow also entities

restive mango
#

no, i mean for placing

#

the blocks

#

that is easy

#

the thing you just said

#

the placing of the blocks will be hard

#

modifying your code is as easy as

quaint mantle
#

You can read the values you need

#
for (JsonElement element : array) {
  if (!element.isJsonObject()) continue;
  JsonObject object = element.getAsJsonObject();

  String worldUUIDRaw = object.getAsString("world");
  UUID worldUID;
  try {
    worldUID = UUID.fromString(worldUUIDRaw);
  } catch (IllegalArgumentException ex) {
    //This means the "world" value is not a world UID
    continue;
  }

  World world = Bukkit.getWorld(worldUID);
  if (world == null) continue; //That means the world is not loaded or does not exist

  int x = object.getAsInt("x");
  //... the rest here
}
restive mango
#

just do this

#

but with the current unhidden nms

#

probably

#

if only i knew what a_ mapped to

quaint mantle
#

Avoid using NMS and OCB

quaint mantle
#

i saw

restive mango
#

hm

#

@quaint mantle storebukkitvalues and readbukkitvalues perhaps

#

they both use a compound nbt

#

ill test tomorrow i suppose

warm light
#

is it possible to register custom items?
like I can get my custom items with /give command

#

so the command will be like this: /give @p PLUGIN:ITEM

halcyon hemlock
#

like a list or anything

#

You could intercept the PlayerCommandPreprocessEvent, and then check if it's the /give command and give the item if the player requested it.

orchid trout
#

what do i do when completablefuture returns null

#

catch the exception?

grim hound
#

But using a try catch would probably solve the issue

#

Show us the code you're using if this doesn't help

orchid trout
#

thanks

distant wave
#

any event for landing arrow?

#

also how can i get javadocs for spigot/bukkit?

eternal oxide
#

press the download javadoc/source button

distant wave
#

ohhh

#

thanks

#

im not used to maven

eternal oxide
#

I'm not used to intelij, but google works ๐Ÿ˜‰

tepid flicker
#

how do I make so when you try to break a block then it says the block to you ```
@EventHandler
public void onBlockDamage(BlockDamageEvent e) {

    e.getPlayer().sendMessage("e.getBlock()");
    e.setCancelled(true);

}```
shadow night
#

do you know java

solemn willow
#

?paste

undone axleBOT
tepid flicker
eternal oxide
#

you are close but your java is lacking

tepid flicker
#

help please I am trying to learn

eternal oxide
#

remove " and " then add .getType()

tepid flicker
#

"and"?

eternal oxide
#

remove both "

tepid flicker
#

"e.getPlayer().sendMessage("e.getBlock()");
e.setCancelled(true);" ?

eternal oxide
#

do you also not understand what remove means?

tepid flicker
eternal oxide
#

you didn;t remove, you added

tepid flicker
eternal oxide
#

no

#

look back over what I told you and try to understand it

tepid flicker
#

where should I add .getType()

eternal oxide
#

I really can't tell you any other way

tepid flicker
#

I don't understand whether not I should remove something or add something and if add something then where

drowsy sandal
#

if a host refuses to add a flag -Dpaper.useLegacyPluginLoading=true is there another easy way to fix this issue
Circular plugin loading detected!
MythicMobs -> Multiverse-Core -> SuperiorSkyblock2 -> ShopGUIPlus -> ExecutableItems -> SCore -> MythicMobs

eternal oxide
#

?fork

undone axleBOT
#

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

wide cipher
#

but it's reflection, it shouldn't need remapping ```public static Class<?> getNMSClass(@Nullable String packageName, @Nonnull String name) {
if (packageName != null && supports(17)) name = packageName + '.' + name;

    try {
        return Class.forName(NMS_PACKAGE + name);
    } catch (ClassNotFoundException ex) {
        throw new RuntimeException(ex);
    }
}```
#

Class<?> serverEntity = getNMSClass("server.level", "ServerEntity");

sullen marlin
#

Your coding Mojang mappings but server is not mapped that way

wide cipher
lost matrix
wide cipher
lost matrix
#

And it looks like you are not caching your reflective Objects.
This can cause serious performance issues as reflections tend to be pretty slow.

twin venture
#

Hi , i have a question , what would be the best way to make a hologram chest system what i mean by that is :

  • when a user click on a chest [after game start and he spawned] , it will open the chest and create hologram
  • that hologram will have a timer .
  • would i need to create a runnable for each chest clicked?
    this is my current code , didn't finish it
    this is the impl of the update && create hologram
#

i just want to know what will be best , to create a seprate runnable for each chest opned?

#

or make a 1 runnable with a list , and when a user click on that chest add it , and check in the runnable if the chest is there or no . ?

lost matrix
#

Create one runnable which ticks all holograms.

twin venture
grim hound
#

does anyone have EnumPlayerInfoAction translated to non-gibberish?

#

in ClientboundPlayerInfoUpdatePacket

lost matrix
#

I personally would add this as part of my hologram API as ticking holograms
is needed quite often.

twin venture
#

what i mean is this :

lost matrix
lost matrix
# twin venture

Yes. My answer doesnt change. I would personally add ticking holograms as part of my hologram API.

grim hound
#

so there's no info on previous versions

lost matrix
twin venture
grim hound
twin venture
#

the Holo Manager Looks like this :
and this is how theHolo Looks like :

#

anything else i need to implmement?

lost matrix
# grim hound oh thanks

Nice. Then you just need to add a bit more logic and create a UpdatedHologram with an

public abstract void update();
public abstract int getUpdateDelayTicks();

In your HologramManager you simply check if your hologram is an instance of UpdatedHologram
and add it somewhere to be ticked.
Just make sure to remove it again, when the HologramManager removes the Hologram.

You could also write this without abstraction and simply have two fields like

private final Consumer<Hologram> updateAction;
private final int updateTickDelay;

@twin venture

grim hound
lost matrix
#

Woops

lost matrix
# twin venture Thanks!
public Holo createUpdatedHologram(String name, Location location, int tickDelay, Consumer<Hologram> action) {

}

That could be one method of your manager for example.
But there are quite a few other approaches as well ๐Ÿ™‚

#

PS: Cooldowns should not be done by bukkit runnables. Timestamps should be preferred and the runnable just checks how
far the timestamp is away from the current time.

twin venture
#

alright thanks . i will try to finish it today

tribal rivet
#

Hello, Im kind of stuck here, i want to make my player not be able to join two queues at the same time but they still can even though my code doesnt allow it? Here is my code: ```public void onPlayerClickSign(PlayerInteractEvent event) {
Player player = event.getPlayer();

    if (event.getClickedBlock() != null && isSign(event.getClickedBlock().getType())) {
        Sign sign = (Sign) event.getClickedBlock().getState();

        if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
            handleRightClick(sign, player);
        } else if (event.getAction() == Action.LEFT_CLICK_BLOCK) {
            handleLeftClick(sign, player);
        }
    }
}

private boolean isSign(Material material) {
    return material == Material.OAK_SIGN || material == Material.OAK_HANGING_SIGN || material == Material.OAK_WALL_SIGN;
}

private void handleRightClick(Sign sign, Player player) {
    String signKey = getSignKey(sign.getLocation());
    removeFromQueue(player);

    setSignLine(sign, LIGHT_PURPLE + "Crystal 1/2");
    playerQueueMap.put(player.getName(), signKey);
    player.sendMessage("Joined the current queue. Current queue: 1");
}

private void handleLeftClick(Sign sign, Player player) {
    removeFromQueue(player);

    setSignLine(sign, GREEN + "Crystal 0/2");
    player.sendMessage("Left the current queue. Current queue: 0");
}

private void removeFromQueue(Player player) {
    String oldQueue = playerQueueMap.get(player.getName());
    if (oldQueue != null) {
        playerQueueMap.remove(player.getName());
    }
}

private void setSignLine(Sign sign, String line) {
    sign.setLine(0, line);
    sign.update();
}

private String getSignKey(Location location) {
    return location.getWorld().getName() + ":" + location.getBlockX() + "," + location.getBlockY() + "," + location.getBlockZ();```
#

I cant seem to find whats incorrect...

lost matrix
#

Whats the type of playerQueueMap?

tribal rivet
#

Its a Map<String, String>

lost matrix
#

What kind?

minor junco
#

Are you sure the player is in 2 queues simultaneously and it's not due to something else

#

Because that's not possible

tribal rivet
#

hmmmm thats weird...

minor junco
#

You have one map and put overrides the entry for key k

#

So you don't even need to remove the player, you can simply just do playerQueueMap.put

lost matrix
#

Ok so this

    private void removeFromQueue(Player player) {
        String oldQueue = playerQueueMap.get(player.getName());
        if (oldQueue != null) {
            playerQueueMap.remove(player.getName());
        }
    }

Does exactly the same as this

    private void removeFromQueue(Player player) {
        playerQueueMap.remove(player.getName());
    }

You can just replace the method.

Next: You cant put the same key in a map twice.
If you add the same key, then the old key:value pair is simply overridden.
Which means

    private void handleRightClick(Sign sign, Player player) {
        String signKey = getSignKey(sign.getLocation());
        removeFromQueue(player); // This line is useless because put always overrides

        setSignLine(sign, LIGHT_PURPLE + "Crystal 1/2");
        playerQueueMap.put(player.getName(), signKey);
        player.sendMessage("Joined the current queue. Current queue: 1");
    }
tribal rivet
minor junco
#

Yeah this

#

The thing is the way your sign works is probably the issue

#

@tribal rivet

#

You update it manually on a click, but not in removeFromQueue

tribal rivet
#

Ohhhh okay

#

i think i get it

minor junco
#

So if a player joins a second queue you override the map, but don't update the queue sign of the queue that the player left

#

What you can do is extend your removeFromQueue and keep it as is, you simply force a sign update on removal

tribal rivet
#

Okay thanks have a great day

versed shore
#

Can someone tell me how to get all LOG** type (OAK, BRICH, JUNGLE, ect.)?
I tired using Material.LOG and returns Error "Cannot resolve symbol 'LOG'

cyan void
#

how can i register a command from another file that is not my main file like in commands/gamemode

versed shore
#

Operator '==' cannot be applied to 'org.bukkit.@org.jetbrains.annotations.NotNull Material', 'org.bukkit.Tag<org.bukkit.Material>'
What?

hazy parrot
#

what

#

is "File" another class ?

quiet ice
#

Well at the very least it probably is a different nest unit

versed shore
# versed shore ```Operator '==' cannot be applied to 'org.bukkit.@org.jetbrains.annotations.Not...
package atlasrs.realisticsurvival;

import org.bukkit.Tag;
import org.bukkit.block.Block;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.Listener;
import org.jetbrains.annotations.NotNull;
import java.util.Objects;

public class TreeBreakingLogic {

    public void breakTrees(PlayerInteractEvent event) {
        Block block = event.getClickedBlock();

        if (block.getType() == Tag.LOGS) {

        }
    }
}

retruns error "Operator '==' cannot be applied to 'org.bukkit.@org.jetbrains.annotations.NotNull Material', 'org.bukkit.Tag<org.bukkit.Material>'"
can someone help me?

eternal night
#

read the javadoc on Tag

#

that is not how you use it

quiet ice
#

Tag.LOGS.contains(block.getType()) is likely the right method, but your IDE should help you out there

#

Spoiler: Actually it isn't the right method. But the idea remains the same

versed shore
#
public class TreeBreakingLogic {

    public void breakTrees(PlayerInteractEvent event) {
        Block block = event.getClickedBlock();

        assert block != null;
        if (Tag.LOGS.getValues().contains(block.getType())) {
            
            return;
        }
    }
}

I figured it out, maybe like this lol

#

I am new to Java so yeah

quiet ice
#

The proper approach would be .isTagged(), but it is the same

versed shore
quiet ice
# versed shore I am new to Java so yeah

In that case some advice: The equality operator == is used to compare whether two values are identical to each other. Two different objects will never be identic to each other, hence the compiler complains about your use

versed shore
#

I though it was block.isTagged()

#

lol

quiet ice
#

Javadoc (and your IDE's suggestions) is your best friend for the very first months. After that you will start to build up a feel on how methods might be named, but as you just saw even then guessing is not very reliable

shadow night
#

Are entity IDs used only in networking?

glossy venture
#

pretty much i think

shadow night
#

Makes sense ig

slate tinsel
#

Anyone know why "findSafeDismountLocation" is null none of the values โ€‹โ€‹used are null

    @Override
    public Location getSafeLocation(Player player) {
        ServerPlayer entityPlayer = ((CraftPlayer) player).getHandle();
        ServerLevel serverLevel = entityPlayer.serverLevel();
        BlockPos blockPos = new BlockPos(entityPlayer.getBlockY(), entityPlayer.getBlockX(), entityPlayer.getBlockZ());

        Log.info("entityPlayer: " + entityPlayer);
        Log.info("serverLevel: " + serverLevel);
        Log.info("blockPos: " + blockPos);

        Vec3 vec3 = DismountHelper.findSafeDismountLocation(EntityType.PLAYER, serverLevel, blockPos, true);

        if (vec3 != null) {
            Location location = new Location(player.getWorld(), vec3.x, vec3.y, vec3.z);
            Log.info("location: " + location);
            return location;
        }
        return null;
    }```

Console:
```cmd
[INFO]: entityPlayer: EntityPlayer['wilmer100101'/135, l='ServerLevel[world]', x=24.18, y=103.74, z=-28.81](wilmer100101 at 24.181414046555776,103.73580524503404,-28.810632492203087)
[INFO]: serverLevel: ServerLevel[world]
[INFO]: blockPos: BlockPosition{x=103, y=24, z=-29}
quaint mantle
#

In the class "Structure" what does the "palette" mean in the "place" function?

place(Location location, boolean includeEntities, StructureRotation structureRotation, Mirror mirror, int palette, float integrity, Random random)
#

and also what does integrity mean

hybrid wadi
#

Hey,
in which class is the "Player" Interface implemented? Because I want to extend the class to add custom Methods to the implemented Player class.

quaint mantle
#

public interface Player
extends HumanEntity, Conversable, OfflinePlayer, PluginMessageRecipient

hybrid wadi
#

Ah okay, thank you

quaint mantle
rotund ravine
#

You should just wrap it @hybrid wadi

#

CraftPlayer is the implem though

hybrid wadi
#

Okay, thanks for the advice

slate tinsel
#

If I use the md_5 plugin in my pom.xml for nms, one then takes and makes a new NMS version for each new version of minecraft, so: 1.17, 1.18, 1.19, 1.20. Or do you do it for every subversion, example, 1.20.1, 1.20.2, 1.20.3 or how does it work?

remote swallow
#

every nms version you want to support would have its own module

slate tinsel
#

So one module per subversion then?

remote swallow
#

yup

slate tinsel
#

But why do plugins usually change to have 1_20_R3, 1_19_R2, etc.? Does it only support subversion 3 or 2 then?

remote swallow
#

it depends onwhat the nms version covers