#help-development

1 messages · Page 274 of 1

tender shard
#

It'll be a bungee network anyway

#

so for example we could have one spawn

#

and then you can decide

#

"where do you wanna go?"

remote swallow
#

does this mean i get to learn bungee

tender shard
#
  1. Survival server (what I was talking about)
#

or

#

2

#

the event server

#

oh and another thing

#

I am not sure yet how we will handle griefing

remote swallow
#

coreprotect when

#

with an sql server

wet breach
#

well if its mostly pure vanilla, then griefing is not a thing

vocal cloud
#

Instant ban. Write a blacklist into spigot source for griefing

tender shard
#

e.g. should griefing be allowed? Or would we rather say "Okay everyone can build stuff wherever they want, but you also gotta expect that someone else might burn your house down"?

remote swallow
#

that normally causes chaos from what ive seen

wet breach
#

in almost pure vanilla you have to have some expectation that someone is going to burn your house down Xd

tender shard
#

hm in that case we'd need some protection plugin. Or a custom protection plugin

wet breach
#

I mean makes no sense to have grief protection but you can't lock your chests or doors

tender shard
#

Or we could do a hybrid system

vocal cloud
#

When you allow griefing you're pushing a narrative that will drive a lot of people away from your server.

tender shard
#

for example:

wet breach
#

well we could use towny plugin, and have a single massive town for everyone to build in with a single plot

tender shard
#

"Okay, someone just burned my house down. But I can check who it was, 1 sec... okay, it was mfnalex. Now let's go to mfnalex's house and burn his home down, too"

wet breach
#

then, if people want to travel outside of that, that is up to them

wet breach
#

and you can even set an NPC as the mayor of said large town

remote swallow
wet breach
#

towny is free o.O

tender shard
#

oooh ok

remote swallow
#

theres only some addons that are paid

tender shard
#

I confused it with sth else then

#

oh yeah I confused towny with PlotSquared

remote swallow
#

lol

tender shard
#

yeah anyway, I'll spin up a new discord server rn

#

and invite anyone who's interested in helping setting it up and stuff

remote swallow
#

im decent at setting up discord servers

#

ive only done it so many times

tender shard
#

pls join

vocal cloud
tender shard
#

we'll discuss stuff there tomorrow

#

I will go to sleep in a few minutes so yeah

remote swallow
tender shard
#

but if you got any ideas already, ofc feel free to send them in general there

sterile token
#

Please i need an explanation about player hands and how they work. Because im trying to block the hand usage where you can put them via letter F (default from mc), because i cannot understand how they works. You will ask why? The reason is that the OFF HAND is called when you place blocks too

eternal oxide
#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
sterile token
#

But its happen the same with both of the event

#

I dont kno why the f** treat hand from letter/key F, as the same hand which you use to place blocks

eternal oxide
#

swaphand event should only fire once

sterile token
#

Because if i cancel it from PlayerInteract them it cancel block placing, because the shity hand is also trigged when you place blocks, not only when you use letter F

eternal oxide
#

same as for interactEvent in BlockPlaceEvent

#

getHand()

sterile token
#

No no

#

I dont explained my self or you dont understand what i mean

eternal oxide
#

Explain better

#

You can block offHand use in any event that implements it, Interact, Place etc

sterile token
#

Yes 1m, im typing it via translator so oyu understand

sterile token
# eternal oxide You can block offHand use in any event that implements it, Interact, Place etc

I want to disable that you can place things in slot 40 of the player's inventory or via the letter F (both use the same slot). What happens is the following, when I try to cancel what I want, it not only cancels what I want but also overwrites the event of placing blocks. And personally, I think that this is very badly done, because Wednesday slot 40 or letter F use the same hand. According to the docs, the OFF HAND should only be the letter F or slot 40.

#

Do you understand know?

eternal oxide
#

F is swop hands?

sterile token
#

That why im not sure how to cancel it

#

Becaause there 2 ways of using what i want to cancel, either via slot 40 or using letter F

eternal oxide
#

just always cancel swaphands if it's going to put anything in the offhand slot

sterile token
#

From what i test it does it

eternal oxide
#

why would swapHands event have any effect on placing blocks?

#

totally separate events

sterile token
#

That my question

#

For some reason OFF HAND is that slot 40 or letter F AND also is called when you place blocks

#

That is what im arguing about because they are not well identified or explained

eternal oxide
#

only cancel the swap hand event IF it is putting something in the offhand

sterile token
#

Would it cancel putting it via inventory? Dragging nor shift + click over the item

eternal oxide
#

for placing you check the getHand() in the BlockPlaceEvent

#

no

sterile token
#

no no

#

You are not understand what i want tho

#

Idk why its so diff to explain

eternal oxide
#

if you want to keep 40 empty you have to listen also to inventoryClickEvent and inventoryDragEvent

#

Its difficult to understand because you keep talking about Placing Blocks when you really mean moving ItemStacks in your inventory

sterile token
eternal oxide
#

prevent moving anything to the offhand in SwapHandEvent, InventoryClickEvent and InventoryDragEvent

sterile breach
#

hello, do you have a plugin to custom nametag of player?

jagged monolith
#

?paste

undone axleBOT
jagged monolith
#

Don't send screenshots of code. Paste it.

charred blaze
#

ok

jagged monolith
charred blaze
jagged monolith
#

?main

jagged monolith
#

You're getting those errors because the file structure is wrong

#

Either that, or you typed it wrong in the classes.

charred blaze
jagged monolith
#

It's looking for a commands folder for starters. You also need to fix the plugins main class name

charred blaze
#

can i just do it with refactor? or i need to delete the class?

jagged monolith
#

Refactor

charred blaze
small thistle
#

Hi lovely people, how would I make it so that my shapeless recipe would accept variants of a ingredient? In this case, I want to be able to use different bed colors to craft my item. Thanks in advance

        /* Crafting Recipe */
        ShapelessRecipe sr = new ShapelessRecipe(NamespacedKey.minecraft("teleport_scroll"), item);
        sr.addIngredient(1, Material.ENDER_PEARL);
        sr.addIngredient(1, Material.WHITE_BED);
        sr.addIngredient(1, Material.PAPER);
        Bukkit.getServer().addRecipe(sr);
vale ember
#

is there any difference between using Bukkit#getPluginCommand and Plugin#getCommand?

jagged monolith
vale ember
#

so if i am getting a command from my plugin should i prefer Plugin#getCommand?

jagged monolith
#

Yes

vale ember
#

ok thx

fluid river
#

is there any use of this method

#

you sure you need it?

lavish wing
#

Guys help , what could be the problem here?

    public void onEntityDamage(EntityDamageEvent e) {
        if (!(e.getEntity() instanceof Player)) return;
        Player player = Bukkit.getPlayer(((Player) e.getEntity()).getName());
        if (Main.getInstance().getGodList().getOrDefault(player.getName(), false)) e.setCancelled(true);
    }```
fluid river
#

except setExecutor()

#

yes

#

we already answered

#

this entire code is bad

#
@EventHandler
public void onEntityDamage(EntityDamageEvent e) {
    if (!(e.getEntity() instanceof Player player)) return;
        if (mainInstance.getGodList().contains(player)) e.setCancelled(true);
    }
}```
lavish wing
#

It doesnt work

#

Im using hashmap

#

not arraylist

fluid river
#

ez

#
@EventHandler
public void onEntityDamage(EntityDamageEvent e) {
    if (!(e.getEntity() instanceof Player player)) return;
        if (Main.getInstance().getGodList().containsKey(player.getName())) e.setCancelled(true);
    }
}```
#

now it works

#

tho you can use UUID instead of name

#

you really need to learn spigot api meh

lavish wing
fluid river
#

what

lavish wing
#

?

fluid river
lavish wing
#

Yes

fluid river
#

what the heck is this

lavish wing
fluid river
#

cool

#

anyways

#

this should work

lavish wing
# fluid river now it works
java.lang.NullPointerException
        at dev.armlix.EntityEvent.onEntityDamage(EntityEvent.java:27)
        at org.bukkit.plugin.java.JavaPluginLoader$54.execute(JavaPluginLoader.java:833)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:354)
        at net.minecraft.server.EntityLiving.a(EntityLiving.java:481)
        at net.minecraft.server.Entity.a(Entity.java:613)
        at net.minecraft.server.EntityPlayer.b(EntityPlayer.java:274)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:377)
        at net.minecraft.server.Packet10Flying.a(Packet10Flying.java:22)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:255)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:132)
        at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:72)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:459)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:367)
        at net.minecraft.server.ThreadServerApplication.run(ThreadServerApplication.java:13)```
fluid river
#

if it uses java 13+

jagged monolith
#

?paste

undone axleBOT
jagged monolith
#

^ use that

lavish wing
#

but its full error

jagged monolith
#

That wouldn't be the full error.

lavish wing
small thistle
lavish wing
fluid river
#

your Main instance might be null

small thistle
fluid river
#

cuz you get NPE

#

show your getInstance() method and instance declaration/initialisation codes

jagged monolith
#

Yeah, need to see the code for the Class "EntityEvent"

lavish wing
fluid river
#

cool

#

where is instance init?

#

public void onEnable() {
instance = this;
}

or smth

vale ember
#

hey does anyone know how can i make gson prefer concrete type adapters over type adapter factories?

fluid river
#

it's null by default

#

also

#

switch to di

#

singleton is gay

jagged monolith
#

?di

undone axleBOT
jagged monolith
fluid river
#

ok

#

done

lavish wing
#

now it works

fluid river
#

i recommend learning java

#

to avoid NullPointerExceptions

#

(checkmybio)

lavish wing
#

wait it doesn't work like it should

fluid river
#

cool

#

?notworking

undone axleBOT
#

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

lavish wing
#

containsKey is wrong for this.

fluid river
#

if player is a key then it's not

#

wait wait

#

do you have HashMap<Player, Boolean>????

lavish wing
#

yes

fluid river
#

bruh

lavish wing
#

No wait

fluid river
#

memory usage goes brrt

lavish wing
#

String, Boolean

fluid river
#

bruuuh

#

you can just have an ArrayList of strings

jagged monolith
#

?main Not really relevant to the issue but still - Can lead to issues and it's not following proper coding standards otherwise

fluid river
#

if string is in the list then it's true

fluid river
#

reduces memory usage

lavish wing
#

But how i can delete player from list?

#

.remove(player.getName()); cant delete it

fluid river
#

list.remove()

#

??

#

btw

#

Set would be even better

#

Set<String> or String<UUID>

#

cuz you avoid duplicates

wintry gust
#

?personal kits

river oracle
#

Wtf lmao

#

No ones gonna spoon feed you code

ivory sleet
#

and yeah ArrayList is not quite scalable if you wanna check contains with it as that’s O(n)

hushed pawn
#

There is some fully mapped 1.8.8 NMS mappings?

wet breach
#

mappings being provided started being a thing I think at version 1.14

#

so the only mappings you are going to get for the outdated 1.8 version, is spigot/bukkit mappings or mcp

hushed pawn
#

My problem is calculating realistic Y recoil

wet breach
#

minecraft isn't really designed for realism to begin with

#

so yeah can see that being an issue

hushed pawn
#

i mean

#

same as in minecraft

#

xd

#

i tried many things

humble tulip
#

Knockback you mean?

hushed pawn
#

i need it for bot pvp

wet breach
#

do you mean knockback?

#

oh someone else already asked

hushed pawn
#

Knockback

hushed pawn
wet breach
#

no minion above did

hushed pawn
#

i found method that calcualtes it nms

humble tulip
humble tulip
humble tulip
#

Ah ok

hushed pawn
#

i even found one thing

humble tulip
#

Well see where that method is called and what is done after

hushed pawn
#

but there is still something more

hushed pawn
#

mby not even connected with entity ineract packet

#

in the obvious way

humble tulip
#

Might be nms entity class

hushed pawn
#

it not helps much

#

there is alot of .a().b() methods

humble tulip
#

Yes you need to read the code and figure what it does

hushed pawn
#

i did my best and get this

            double newY = getPlayer().getVelocity().getY();
            newY /= 2.0D;
            newY += (double) 0.4F;

            if (newY > 0.4000000059604645D) {
                newY = 0.4000000059604645D;
            }
            newY += 0.1D;
            velocity.setY(newY);
#

but its not complete or something

#

there is still something more

humble tulip
#

Why do you say so?

hushed pawn
humble tulip
#

Ok and??

#

What did you see

hushed pawn
#

by giving hit 3 times every 10 ticks

humble tulip
#

????

hushed pawn
#

wait

kind coral
#

how can i make it so there is a tablist per world, like players that are not in that world are not displayed

hushed pawn
# humble tulip ????

there is 3 pakets will be send player with this formula Y velocity Value is
1: 0.46.....(the same as vanilla kb)
2: 0.32.....
3: 0.24.....

But with vanilld kb it soud be
1: 0.46.....
2: 0.38.....
3: 0.04.....

#

before 1 player is on ground, after 3 player is landed

wet breach
#

believe you are missing gravity

#

if that isn't it, your numbers might be off due to rounding or precision

gleaming grove
#

Does anyone has knowledge about annotation processing in Java? I have this simple example that suppose to generate test.txt file but nothing happends when I build the project

river oracle
#

runtime processing

#

or compiile time

#

I only know about runtime processing lol. Compile time is probably a whole lot of bytecode I rather not do

gleaming grove
#

Compile time

#

The idea is to make class that contains informations about permissions and everytime I build code permissions in plugin.yml are updated

wet breach
#

compile time annotation processors happen before compile time

#

not sure what processor you are trying to use, but typically the code for such processors is not part of the project itself

sly venture
#

I want to get a custom sound name. What should I do?

#
for(Sound sound : Sound.values()) {
                    completions.add(sound.name());
                }
wet breach
#

don't custom sounds take the place of an existing one?

#

otherwise don't think you can do it from the API since the custom sound isn't known

sly venture
#

Hmm... I don't think I can? ;-;

wet breach
#

well you probably can

#

just not from the API

#

that means most likely having to do it from NMS

gleaming grove
wet breach
#

as I said, I don't know what processor you are using

#

you would need to look at that processors documentation

gleaming grove
#

The AbstractProcessor

wet breach
#

are you saying you are trying to use Java's annotation API?

sly venture
#

The sound added as resourcepack.

#
{
  "example": {
    "sounds": [
      "custom/example"
    ]
  },
  "example2": {
    "sounds": [
      "custom/example2"
    ]
  }  
}
gleaming grove
#

I guess people in all tutorials I've seen are using the AbstractProcessor

wet breach
#

yeah that is Javax api stuff

#

Anyways, you are going about it the wrong way then. There is a reason something like lombok is provided as a maven plugin

#

lombok is an annotation processor, but because it generates code at compile time, it needs to happen before Java compiling actually happens

#

you can't really do that inside the project itself

#

so you need something like a maven plugin where you can utilize a lifecycle before the compilation process to actually do what you need done

#

I am going to assume the tutorials you were following were for creating your own annotation processing? And probably failed to mention the caveats lol

quaint mantle
#

its asking for a double but its a double, what should i do?

wet breach
#

you are using the wrong method

#

add() is for adding two locations together

#

yaw is part of the location itself

gleaming grove
quaint mantle
wet breach
# quaint mantle its asking for a double but its a double, what should i do?

full qualified location object contains this World, x, y, z, yaw, pitch however to make a location object valid it only needs the coords which is what add, sub, and all those math methods interact on. So if you want the pitch to be changed you need to create a new location object with the new pitch or yaw added. if instead you want to teleport the player with the current pitch and yaw they have, then you don't need to do anything except continue doing your math stuff.

sage dragon
#

How would I properly teleport a player that has entities riding it?

I tried ejecting the passengers first, but that doesn't seem to work.

I also tried the teleportTo nms method.

That seems to work sometimes, but not always

wet breach
#

you can get the passengers by calling getPassengers() which should give you a list of all passengers

sage dragon
wet breach
#

might have to wait a tick after dismounting possibly

#

and then wait a tick after teleporting all entities since they don't all teleport exactly at the same time

#

to ensure they are re-mounted

#

but the easiest method if those entities are custom

#

would be to kill the entities retaining their info in memory

#

and then just respawn said entities at new location and then remount after player has teleported

sage dragon
#

Okay, will try that, thanks

wet breach
#

fun fact about teleporting

quaint mantle
wet breach
#

when an entity teleports in the same world, it just travels really really fast

quaint mantle
wet breach
#

if you were to slow the server down, you could see this happen where the entity kind of zooms off

sage dragon
# wet breach fun fact about teleporting

Another fun fact about teleporting:
When a player has a passenger, and you try to teleport him with a plugin, good luck.

Enderpearls and vanilla teleport command work just fine though

humble tulip
#

Or execute the command to tp them😂

sage dragon
robust light
#

is there a way to get enchantments over level 5? For example level 6 prot?

sage dragon
#

Seems like removing an AreaEffectCloud does not dismount it from a player 🤔

robust light
humble tulip
#

One sec

robust light
#

found it, thanks!

sage dragon
#

Even though I don't think that should be expected behaviour, since the cloud should be removed entirely 🤔

charred blaze
#

what does args[0] return in this command? /tpa someone "someone" or "tpa"?

quaint mantle
#

someone

charred blaze
#

ok thx

quaint mantle
#

can we get keyboard inputs with spigot?

rotund ravine
quaint mantle
#

i had plans xD

#

thx tho

tall dragon
small thistle
hushed spindle
#

the actual ingredient part can be replaced by such a recipechoice

small thistle
hushed spindle
#

you can pass on an exact item requirement as well, but specifically for shapeless recipes this doesnt work so you'd need to make your own implementation that way

#

yeah if you look at the methods for addIngredient you see there's options to add just a material, like you did, or a RecipeChoice

#

what

#

git add <file>?

humble tulip
#

Git add

hushed spindle
#

shouldnt do that unless you yourself deleted them in your commit

#

did you do git remote add origin https://github.com/yourrepo.git yet

twin venture
#

Hello , i have this class :
its for my QusetEvent
and i use example :
what iam trying to acheive now , is get the event from the config as i have it rn

small thistle
hushed spindle
#

i mean idk what to tell you, should be able to add files and commit and then push them just fine

hushed spindle
tall dragon
#

i cant wrap my head around how crazy this is

#

this thing knows everything

twin elbow
#

its nothing compared to what it can do

#

you don't even know

tall dragon
#

yea i know

#

i woulnt know

#

but its just so crazy to me already

twin elbow
#

you can legit give it a base parent class and make him create children using the given info

ivory sleet
twin elbow
#

yeahh

#

its insane

#

i made a base kit class

#

and each class i make extends it

#

so i gave chat gpt the structure and it made me more classes

tall dragon
#

lmfao

#

thats insaneee

twin elbow
#

thats what i'm talking about

tall dragon
#

let me try that

twin elbow
#

and you say event.setcancelled is wow

#

the key to getting good output from him is feeding him data step by step

#

and not throw it at him all at once

tall dragon
#

alright i will try that

tall dragon
twin elbow
#

I told youu

ivory sleet
#

It can in principle design whole infrastructures

tardy delta
#

it was cleaning my code and it stopped responding half ways \🤔

tall dragon
#

cant u just ask it to continue? haha

tardy delta
#

idk didnt try, it was giving me same code i entered anyways

small thistle
tardy delta
#

damn thats what happens when i leave my pc on

hushed spindle
#

oh yeah you do

#

gotta instantiate them

#

didnt notice

small thistle
#

Like this?

hushed spindle
#

try to remove that 1 at the start

#

pretty sure you dont need it

small thistle
#

So it just knows it requires exactly 1 of said item?

hushed spindle
#

if you look at the docs you see that there is no method that takes in both an integer and a recipechoice

#

only a recipechoice

small thistle
#

But what if I had to lets say have more than 1 item to put into my recipe

#

lets say I had to put in x2 beds

hushed spindle
#

then you do addingredient again idk

small thistle
#

haha alright, that more or less works for me

hushed spindle
#

lemme double check how i did it

#

yup pretty much just repeatedly doing addingredient

twin venture
#

i just want to know if its possible to call the event from the config file :

tardy delta
#

make that a builder lol

twin venture
#

you Mean StringBuilder?

tardy delta
#

builder pattern to construct that quest

#

and why are you calling config.getConfig() like 100 times

lilac dagger
#

it should be per player

#

any idea?

torn shuttle
#

merry xmas losers, hope you get good as a gift

#

if you have a problem with that 1v1 me in rocket league

#

especially you @worldly ingot

lilac dagger
torn shuttle
#

I'll put your mmr in the garbage can

lilac dagger
#

can we play actually? @torn shuttle

torn shuttle
#

of course, 'tis the season to be giving nerds in spigot a virtual wedgie

lilac dagger
torn shuttle
#

@lilac dagger that was a trick, chess is for nerds and you just proved you were one

lilac dagger
#

what rating are you?

torn shuttle
#

none

#

I don't play chess

lilac dagger
#

you're pretty good tho

#

i played beginers

torn shuttle
#

I think I played chess 3 times in the last 10 years

lilac dagger
#

damn

#

you're pretty good

humble tulip
lilac dagger
#

sure

#

let me give you a link

#

@torn shuttle you're pretty good

#

you didn't blundered your pieces

torn shuttle
#

I used to be a bit into chess but I stopped as soon as I got invested because I immediately realized it was just a memorization game and I hated it

lilac dagger
#

i mean later on you did

torn shuttle
#

at a high level you just remember plays

#

hate that

lilac dagger
#

true

torn shuttle
#

I just like the strategy part of it, if you're just remembering openings and counterplays you're not playing against a person you're playing against a meta

#

I actually took my hnefatafl board to play with my family for xmas instead of chess, I just find it way more interesting because no one has played it enough to have developed a meta

#

and it's a fun game

peak depot
#

how can I get the block that the players is aiming at?

chrome beacon
#

Use the rayTraceBlocks method

peak depot
#

whats the double?

chrome beacon
torn shuttle
#

wasn't it the range of the trace?

chrome beacon
#

Time to read the javadocs

torn shuttle
#

ew, reading

peak depot
#

RayTraceResult rayTraceBlocks(double maxDistance)

torn shuttle
#

I'm more of a write-only mode type of guy myself

lilac dagger
humble tulip
#

Sucl

#

Suck

lilac dagger
#

nah

humble tulip
#

Yh

lilac dagger
humble tulip
lilac dagger
#

~1500

humble tulip
#

Ah

lilac dagger
#

struggling to get it higher

humble tulip
#

I was 12-1300

lilac dagger
#

i see

humble tulip
#

But i stopped

lilac dagger
#

i liked the first game against you

#

i saw the nice mate

humble tulip
#

database <—> custom server <—> minecraft servers

#

Is that a good way to keep mc server data in sync?

#

Yes but redis won't be able to communicate with sql

#

My main issue is data saving latency

#

Data saves slower than joining another server

#

If redis can work around this, I'll be happy to use redis

#

^^

#

I know that

#

Are there any public plugins that use redis?

#

Specifically to sync data that changes vert regularly

lone musk
#

Hi, is there a way to get a Minecraft inventory out of a Bukkit's ?

#

(There's no getHandle or any other obfuscated method that returns a minecraft inventory)

frank kettle
#

is there a way to make a copy of a class where data is saved inside that class?

Imagine you have a class for players data like (Level, Xp) and what i want to do is store inside that class their Level/Xp when they joined(so when class is first made, like new UserData(player) and use this UserData for that data. and then I want inside that class to save the "before" progress and upon leaving update on the mysql(instead of forcing an update all the time, want to do one when players leave, so this way it checks if their data changed and updates only what's changed.)

is there a way to do it? I've tried to make 2 different classes but its not working, i've tried setting a "UserData before = this" but when updates the data, is also updates on the "copy" version so then there's no change and no updates happen.

is there a way to make such a copy using some "this" or "copy(this)" class thing?

#

if none of this exists i will just create even more variables with the numbers upon joining and checking that way, but ofc having one variable which is a copy of the class would be way easier.

glossy venture
frank kettle
#

oh, super.clone()

#

thank you, will look into it.

tardy delta
#

and make sure you clone mutable reference types too

frank kettle
#

it worked fine.

#

thank you

frank kettle
# tardy delta and make sure you clone mutable reference types too
public class User implements Cloneable {

    private User before;

    public User(Player player) {
        // get all the data from mysql
        try {
             this.before = (User) super.clone();
        } catch (Exception ignored) { }
    }

    public void saveDatabase() {
        User before = this.before;
        if (this.variable != before.variable) {
            // update on mysql.
        }

    }
}```
#

i just did smth like this

#

worked fine, what do you mean by "clone mutable refence types"?

glossy venture
#

you clone the values of the fields in the cloned object

#

so your clone isnt referencing the same object as the original

#

i dont know if java does that by default

frank kettle
#

it did work as intended tho, it got the values before correct and updated on the mysql

glossy venture
#

but that shouldnt be an issue if you only have primitives in your class

frank kettle
#

i will see if any other error happens

#

ty anyways

torn basalt
#

Hello why its like this and how i can solve this
e.setJoinMessage(joinmessage);

#
[21:37:32 ERROR]: Could not pass event PlayerJoinEvent to FoudreLobby vv0.0.1
java.lang.NullPointerException: Cannot invoke "String.replace(java.lang.CharSequence, java.lang.CharSequence)" because the return value of "org.bukkit.configuration.file.FileConfiguration.getString(String)" is null
        at com.tr.denizusta.foudrelobby.events.OnJoin.onJoin(OnJoin.java:17) ~[?:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor30.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.16.5.jar:git-Paper-794]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.PlayerList.postChunkLoadJoin(PlayerList.java:356) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.PlayerList.lambda$a$1(PlayerList.java:303) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.PlayerConnection.tick(PlayerConnection.java:316) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.NetworkManager.a(NetworkManager.java:408) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.ServerConnection.c(ServerConnection.java:168) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1520) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:436) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1347) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1135) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794]
        at java.lang.Thread.run(Thread.java:833) [?:?]
```Hello why its like this and how i can solve this
e.~~setJoinMessage~~(joinmessage);
#

when i join its give me this error

echo basalt
#

it literally tells you what's wrong

torn basalt
tardy delta
#

FileConfiguration.getString(String)" is null

torn basalt
#

its shows me e.setJoinMessage("Hello");

glossy venture
torn basalt
# undone axle https://cdn.discordapp.com/attachments/864180468680360027/944415049462714469/whe...
    <repositories>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
    </repositories>

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

mighty pier
#

how can i store a pig's instance so i have it after the server restarts

#

basically

#

there is pig

#

that is very important

#

it cant die

#

how do i store it

torn basalt
mighty pier
#

stop pinging me

torn basalt
glossy venture
#

setPersistent(true) or something

torn basalt
#

:D

#

okay just kidding

glossy venture
#

or just respawn on server start

mighty pier
#

no but like

#

yes

#

do i store the location in a file or something?

glossy venture
#

sure

mighty pier
#

oh but

#

how do i kill it

#

cause

#

server might crash

#

then

#

2 pigs

vocal cloud
#

?jd-s

undone axleBOT
vocal cloud
#

Well if you make it so it is immortal and make it persistent then it will never die unless some other plugin deletes it

unkempt chasm
#

@mighty pier you could handle the location two ways, you could do a player interaction event so if a player enters x amount of radius... then load mob or if you want it always there static you can do it in onEnable

solid cargo
#

what would be the best way of implementing mana (like hypixel skyblock)
my idea was to store all the players' max mana on a database and when they join, they get added to a hashmap, which is then used as a way to withdraw the mana as time goes on and add mana as time goes on

eternal oxide
#

?pdc on each player object

river oracle
#

What...

#

What did you do to think you need that

#

You don't need to

#

You can just git commit

hazy parrot
#

what commands are you using

river oracle
river oracle
tardy delta
#

lets just use ij

river oracle
#

Or vscode

#

Or NetBeans

echo basalt
#

yo

#

updated the nms tutorial to include a better explanation of NBT, as well as custom biomes

hazy parrot
#

you are running git init on every commit ?

echo basalt
#

you realize you can just do git stuff on the ide directly

hazy parrot
#

what are you using when you want to commit stuff

echo basalt
hazy parrot
#

then use it ? 😄

#

dont struggle with commands

tardy delta
#

me doing a merge and breaking everything

#

i usually copy all of my code

hazy parrot
#

that is why i was asking for your commit commands

river oracle
#

.

hazy parrot
river oracle
#

Don't tell me

unkempt chasm
solid cargo
#

thats how to show it

#

how should it be stored/changed though?

wide coyote
#

what is the best way to paste schematics without requiring WorldEdit or any other 3rd party plugin?

#

I have thought of structures but not quite sure if thats the best way

vocal cloud
hazy parrot
#

its probably because you dont have readme on your local repo and you are using -f flag

#

fetch origin first

unkempt chasm
#

if you have alot of players a mysql

vocal cloud
#

That sounds like a lot of work for something that PDC would make 100x easier

solid cargo
#

i do these kinds of things to get better at java/spigot, so i think pdc would be better

#

since i havent really gone into it

unkempt chasm
#

im new as well, can someone explain pdc ?

vocal cloud
#

?pdc

unkempt chasm
#

ty

vocal cloud
#

Don't use configs if you can avoid it

solid cargo
#

afaik what pdc does is store something in the player_uuid.json file?

unkempt chasm
#

thisss exsists

#

wow awesome

#

I had no idea lmfao

sterile token
#

Is posible to make automatize github merges? So i dont need to aprove the mergue request manually, so on every push to a secondary branch, compiles that code, make unit testing to it and finally merge the changes into main branch

sterile token
#

Oh wait

#

I was taking about Git

#

That why i answer tha

sterile token
#

I was looking if there is something else, like i dont wanna be limited by github

#

And i wont pay any $ to microsoft

#

Hahaha that why i asked if there where any alternatives

tall dragon
#

gitlab?

sterile token
#

Probably nothing else, i would just have to build my own repo-action system

#

Oh Gitlab i will give a try i never use it

vocal cloud
#

Tonnes of stuff

tall dragon
#

pretty sure a ton of them exist

wide coyote
vocal cloud
#

Can't pretend you're the only dev on the planet to have this issue lol

wide coyote
#

I guess ima end up with supporting multiple plugins

sterile token
#

But most of the time its diff to give confidecen to 3 rd party platforms which are not famous tho

unkempt chasm
#

woops

#

sorry wrong reply

sterile token
#

?pdc

clear sluice
#

Would it be very heavy to run code executing each 50 server ticks that would display actionbar message to people if they are on X world?

unkempt chasm
#

thats every 2.5 seconds right?

clear sluice
#

correct

tardy delta
vocal cloud
#

Depending on what kind of data you're pulling to display it should be no problem

sterile token
# tardy delta whats shitty about github?

Their fkg limitations and specially when you dont want to pay them for something it should be cheaper. But as they are from Microsoft, prices go up, just because of the brand

tardy delta
#

?

tardy delta
#

what limitations?

vocal cloud
#

Just make sure it necessary and optimize from there

sterile token
#

And like that you have many others

tardy delta
#

what actions lol

sterile token
vocal cloud
#

Get yourself a Jenkins server

tardy delta
#

raspberry pi aaaah

clear sluice
# vocal cloud Just make sure it necessary and optimize from there

Whenever player joins the game they're placed in a lobby. Now I have scheduleSyncRepeatingTask sending them actionbar message to "pick a gamemode", but whenever they exit the world it just keeps running... and I just realized I can add check just for the schedule 🤦‍♂️

tardy delta
#

wondering what these things are

#

dont use scheduleSyncRepeatingTask, use runTaskTimer

quaint mantle
#

Use an arraylist or map and take them out of it when theh exit the world

sterile token
proper notch
#

GitHub actions is only limited when you're not open source remember

sterile token
vocal cloud
proper notch
#

I've switched to almost exclusively using GitHub actions right now. I've used primarily teamcity in the past tho

tardy delta
#

i only have a damn pi

vocal cloud
#

As long as your compile times are low a pi could/should suffice

proper notch
#

Ofc teamcity is paid and has limitations. 100 build configurations and I think 2 or 3 runners before u gotta pay and teamcity pricing jumps to full enterprise pricing immediately.

#

I do feel sorry for GitHub with all the storage I use on packages ☠️

sterile token
# tardy delta i only have a damn pi

It all started when a company divided the partners and auctioned much of their equipment. Specifically I paid $US 400 for the lot, I bought it just because they were 2 servers, network cable and some tp link routers. And then I bought it more than anything with the hope that the servers would work. Because if you want to buy them to a third party. Already in itself, used are not worth less than $US 1600-1700 each. And for the price it was profitable if they worked. And then after I bought them, the first thing I did was to plug them in, they didn't turn on and I got scared. But after I opened them, my eyes shined because they didn't have the battery and that was the reason why they didn't work.

reef acorn
#

How can I display the entire skin for NPCs (second layer). I tried some code in the spigot forum but none of them worked
The Code: ```java
public static void addNPCPacket(EntityPlayer npc){
DataWatcher watcher = npc.getDataWatcher();
watcher.set(new DataWatcherObject<>(16, DataWatcherRegistry.a), (byte)127);
for(Player players : Bukkit.getOnlinePlayers()){
PlayerConnection connection = ((CraftPlayer)players).getHandle().playerConnection;
connection.sendPacket(new PacketPlayOutEntityMetadata(npc.getId(), watcher, true));
connection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, npc));
connection.sendPacket(new PacketPlayOutNamedEntitySpawn(npc));
connection.sendPacket(new PacketPlayOutEntityHeadRotation(npc, (byte) (npc.yaw * 256 / 360)));
}
}

hazy parrot
sterile token
hazy parrot
#

Why would you have action on every push of code

sterile token
hazy parrot
#

pull request ?

sterile token
#

HMn let me explain

hazy parrot
#

you dont want to publish things on every commit

#

lol

proper notch
#

You want to run tests on every commit

hazy parrot
#

also on pull request

proper notch
#

Many people also have test deployments, especially on websites

hazy parrot
#

there is literally no excuse for you to do 4k actions with in 30 days

#

like you dont even do mvn verify 4k times

proper notch
#

I think if it was more than me working on my projects I could hit it.

proper notch
#

Sadly I can't see the usage stats coz my repos are all open SRC D:

echo basalt
#

basically send the metadata last

hazy parrot
proper notch
#

I mean legit 2 people. Not an enterprise

hazy parrot
#

i dont think its possible, might be just me

#

but actions shouldnt be run on commit

sterile token
# hazy parrot like you dont even do mvn verify 4k times

The following happens we have a CI/CD system, with which in each thing that someone is going to add to the root project, creates a secondary branch where he makes the changes that he is going to do. Then another dev, wants to make other different changes so he creates another branch for those changes. Then when they finish and make a pull request to the main branch, the branches that contain changes are deployed to the testing server, compiled and executed. In case of failures, then the request is denied with the error occurred. And in case of success, the pull request is accepted and joins the changes of that branch to the project.

hazy parrot
#

maybe on pull request sync, but definitely not on commit

proper notch
#

My main cost no matter what would be packages tho. Packaging java makes those images chonky

reef acorn
proper notch
#

500MB of package storage, maybe 2 docker images for me ☠️

hazy parrot
sterile token
hazy parrot
#

if you have 4k prs per month, you are definitely not individual who is doing coding as hobby

sterile token
#

💀

#

We are around 23 devs

hazy parrot
#

so pay for github 💀

sterile token
hazy parrot
#

i mean, you dont have right to complain then, use local git system

quaint mantle
#

For real you cant complain

sterile token
#

So that why we are planning to design our system for private usage so we dont need to complain

hazy parrot
#

smh me not reading whole conversation

sterile token
#

If not just talking for talk

gilded knot
#

Getting this error

tall dragon
#

ur map is null

#

"playerTeams"

gilded knot
#

right

#
if (playerTeams == null) {
        // Initialize the map of player teams
        playerTeams = new HashMap<>();
    }

``` this should fix it
sterile token
#

Why dont just, make a final map? 🤔

gilded knot
#

ah right

sterile token
#
private final Map<Key, Value> teams = new HashMap<>();
#

I have seen that many ppl initialize them via the construcotrs i dont know if it have a reason but i always initialize them as final

gilded knot
#

right

#

1 sec

tall dragon
#

bruh

gilded knot
#

nope

tall dragon
#

really?

gilded knot
#

i know

#

im stupid

#

I KNOW

#

Key, Value

sonic cosmos
gilded knot
#

yep got it

sonic cosmos
#

i want just open it for player and get text from line

gilded knot
#

woop tested and works ✅

#

thanks guys

undone axleBOT
#

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

weak bear
#

?paste

undone axleBOT
weak bear
sterile token
#

Its called one for each entity if im not wrong

#

The one who is interacting and the one who was interacted

weak bear
#

Okay thx I understand

#

but who can I do one action?

sterile token
#

Na dont worry man we are to help

sterile token
#

What version are you on

weak bear
#

1.12.2

sterile token
#

Because you can use the docs which tell you everything about the api

weak bear
#

how sorry

#

okay

sterile token
#

In java exists something called javadocs, which is like the manual of products, but for coding

#

have you seen that when you bought a mouse they sent it with a manual, well on coding you have the same called docs/documentation, in Java specifc name is Javadocs

weak bear
#

Okay Thx 😉

tardy delta
#

documentation basically

twilit roost
#

Does anyone have HEX Color Translation, that works with Components?

sterile token
#

They allow you to use hex colors, maybe can take the code from there

twilit roost
#

tysm

sterile token
#

Your welcome

tardy delta
#

this is going to take a long time

#

im wondering for the min, cant i just do double min = ctx.get(0) too?

#

drank too much

#

cant think clear lol

sterile token
#

Just dont code durnk

#

Take a nap bro

tardy delta
#

im not drunk

gilded knot
sterile token
tardy delta
#

thats just me putting my pc on hibernation and that discord plugin bugging

sterile token
#

But i can code for 12-13 hours, always taking some time for eating, going to toilet and some break

gilded knot
#

lol im here just re-programming the Annihilation plugin for 1.19.2

sterile token
gilded knot
#

there isn't any good Annihilation plugins out there

gilded knot
#

I found one but it lacks so many configurations

tardy delta
#

in the meanwhile looking at this shit lol

gilded knot
#

and it's not open-source, making my life hell

sonic cosmos
ornate mantle
#

ok hold on

sterile token
ornate mantle
#

?paste

undone axleBOT
gilded knot
sterile token
#

Because i have seen many plugins for making animations

gilded knot
#

I know what I said

#

Annihilation

sterile token
#

Hey please for general topic please use #general

gilded knot
sterile token
#

Because we flood the help coding channel with none related things

gilded knot
#

Ah right

tardy delta
#

thats what happens when you change one line of code

twilit roost
sterile token
twilit roost
#

I guess

sterile token
#

ohh ok

#

Yeah you can do that too

#

Most of ppl relationate ig for instagram tho that why you take me out from my position

twilit roost
#

ikr
but im too lazy to type out I guess

gilded knot
#

ig = {'I guess, 'Instagram", In-Game"}

twilit roost
#

or im gay 😳
|| not me tho ||

tardy delta
#

ingame is ing

gilded knot
#

roblox users specifically

#

lol

ornate mantle
#

if i want to move from one nms mapping to another would i have to do it manually or is there a tool for it

tardy delta
#

roblox sucks anyways

gilded knot
#

Any way for me to select a random worldFile from plugin directory

plugins/MyPlugin/worlds/
And load it

tardy delta
#

new File(plugin.getDataFolder(), "worldfile.txt")

#

dont ask me how to load it tho

gilded knot
#

aight ill google

#

Or I might use multiverse core

#

if they have an API

fading spindle
#

So i'm trying to make it that a certain type of palyer(custom player type) can deal more damage with bows but for some reason it doesn't do that ive been trying to fix it and I think i'm not setting the damage output correctly

    public void damagee(EntityDamageByEntityEvent event) {
        if (event.getDamager() instanceof Arrow) {
            Arrow arrow = (Arrow) event.getDamager();
            if (arrow.getShooter() instanceof Player) {

                Player player = (Player) arrow.getShooter();

                if (playerclass.containsKey(player.getUniqueId())) {
                    if (((customPlayerAttributes) playerclass.get(player.getUniqueId())).getPlayerclass().equals("ARCHER")) {
                        arrow.setDamage(arrow.getDamage() * 2);

                    }

                }

            }


        }
    }```
twilit roost
#

I tried 3 versions
all of them resulted in black color

rough drift
#

or something like that

#

setting the arrow damage won't do anything, the arrow has already dealt it's damage

twilit roost
#

I think I have it from FourteenBrush

tardy delta
#

the hell is the invokedynamic doing there

twilit roost
#

no clue
Its in my Util Plugin
prob decompilation thingy

#

here
not obfuscated

tardy delta
#

lol

twilit roost
#

md-5

undone axleBOT
fading spindle
calm falcon
#

Because you have to do event.setDamage, NOT the arrow.setDamage

twilit roost
#

dont mind that legacyHex

tardy delta
#

whats the problem actually

twilit roost
#

this is supposed to be #AAFF00

twilit roost
#

oh
the first black one

#

this is how it should be looking like

#

yep
1.19.2 to be exact

#

?paste

undone axleBOT
twilit roost
#

TextComponent#fromLegacyText works fine tho

#

just puts hex(preSetColor onto message

#

yep

#

brah
thought it would be same
cause their servers are dead 😄

#

well I could potentially have multiple HEX Codes in one String

#

never used Adventure API

gilded knot
#

So I'm making a plugin which loads a world on startup

/ WORLD MANAGER
    public void loadRandomWorld() {
        File worldsFolder = new File(getDataFolder(), "Worlds");
        if (worldsFolder.isDirectory()) {
            System.out.println("\u001B[32mWorlds folder is a Directory, Loading\u001B[0m");
            // Get a list of the files in the "Worlds" folder
            File[] worlds = worldsFolder.listFiles();
            String worldsString = Arrays.toString(worlds);
            System.out.println("\u001B[0m" + worldsString + "\u001B[0m");
            // Generate a random index to select a random world from the list of files
            Random random = new Random();
            int index = random.nextInt(worlds.length);

            // Load the selected world
            String worldName = worlds[index].getName();
            getServer().createWorld(new WorldCreator(worldName));
        } else {
            // The "Worlds" folder does not exist
        }
    }

However, It doesn't actually create a world. I can't see it under /mvlist (Multiverse Core)

tardy delta
#

are you sure getServer().createWorld(new WorldCreator(worldName)); is the only thing you have to do?

#

dont you have to load it manually using Bukkit.loadWorld if that even exists

gilded knot
#

does create this big red thing :D

unique urchin
#

hi i need help

tardy delta
#

nah theres only unload

gilded knot
#
WorldCreator wc = new WorldCreator("world_name");
getServer().createWorld(wc);
tardy delta
#

very useful

unique urchin
#

I want to make a server in which several versions can be used, how can I do it?

unique urchin
#

sorry

#

haha

gilded knot
#

Well

#

Since you're here

#

Look into a plugin called "ViaVersion"

#

@unique urchin

unique urchin
#

ok thanks

tardy delta
#

CraftServer#createWorld btw

gilded knot
#

right

obsidian drift
#

How can I play the chest open animation on a chest?

gilded knot
#

i put a finger up my bum

#

I'll just use multiverse core API

tardy delta
gilded knot
#

woosh

tall dragon
#

any1 here any advice on how to best implement a data structure for kit editing?. my first thoughts are to map old slots from the default layout to a new slot. any thoughts?

gilded knot
#

ah right

gilded knot
zealous scroll
tardy delta
#

mvn reload

gilded knot
#

closed project and re-openned

#

oh wait

#

ye no

zealous scroll
# gilded knot

check the repo actually has the artifact you’re looking for

gilded knot
#

nope

zealous scroll
#

the version should only be in the version tag

gilded knot
zealous scroll
#

is that really how they do it wow

gilded knot
#

removed && reloaded

zealous scroll
#

are you sure the module and the version are the same

gilded knot
#

wait for gradle `Module

#

yeah

gilded knot
#

What's the module then? 🤔

zealous scroll
#

it says to put module on artifact and group

#

The module should be in multiverse’s documentation’s or their GitHub probably

gilded knot
#

right

zealous scroll
gilded knot
#

aight

zealous scroll
#

module name’s probably whatever comes after the hyphen in the documentation’s module list

gilded knot
#

right

#

ohh

#

wait

zealous scroll
#

Same with artifact

gilded knot
#

yup

#

reloaded mvn too

zealous scroll
#

Artifact isn’t lowercase

gilded knot
#

ill go on their discord

zealous scroll
#

capital C

gilded knot
#

oh

#

right

zealous scroll
#

remove the hyphen in between multiverse and the module name for group ID

#

their documentation doesn’t include it

gilded knot
#

Yep

#

Worked

#

shit thanks

tardy delta
#

lmao

gilded knot
#

makes life so much easier

#

right so I need to make the plugin clone the world from the /Worlds/ directory and move it to the root directory

#

then MV will load it

#

(just talking to myself)

obsidian drift
#

How come this prints out "Oh no" when I click a chest even though it should be an instanceof Lidded

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
                Block block = event.getClickedBlock();

                if (block == null) return;

                if (block instanceof Lidded lidded) {
                        Bukkit.broadcastMessage("Opened");
                        lidded.open();
                 } else {
                         Bukkit.broadcastMessage("Oh no");
                 }
}
tall dragon
# zealous scroll what do you mean by kit editing

sorry for the late response. what i mean is simply a data structure that allows me to easily save an "edited" version of an existing kit. meaning the player can only change the location of the already existing items.

zealous scroll
#

a map with the edited items locations and then for the absent items of the kit just take the fallback location from the default one

#

so if you move your sword to 9 only save that and then for all other items that aren’t that sword use the fallback location

#

unless I understood that wrong

tall dragon
#

with that u mean a map mapping old slot ints to new ones then?

obsidian drift
tall dragon
#

since saving items in this case seems sub-optimal

zealous scroll
tall dragon
#

both

zealous scroll
#

how often do you check people’s kits’ item locations

tall dragon
#

quite often. as it will happen every time a player respawns with a kit they have edited

#

and dying is quite common in this gamemode

zealous scroll
#

then I would use a mix of both suggested solutions.

store all items in a map to read in memory each time the player respawns

and if you want to save these slot changes to a database or a file just store the items they moved in their inventory to avoid saving unnecessary item locations, which are the default ones

tall dragon
#

yea those were pretty much my thoughts as well. tho i had not thought of just not saving default locations

sharp hemlock
tall dragon
#

thats a pretty good idea

zealous scroll
#

yeah that saves on disk space

tall dragon
#

thanks

sharp hemlock
zealous scroll
sterile token
#

Who is tagging me? My bad i see the tag

gilded knot
sterile token
#

Disco bugs tho sorry zecken

gilded knot
#

ah right

sterile token
gilded knot
#

oh

#

Aight

sterile token
#

But depends on what you will do then with the teams

zealous scroll
#

there’s nothing wrong with it if it’s some sort of mini game

gilded knot
#

It's a mini-game

#

Not a permanent storage thing

zealous scroll
#

if people leave and are therefore removed the the game you could setup a cleanup task to evict them from the map

gilded knot
#

yup

#

removed public

sterile token
gilded knot
#

I tried that

#

oh

#

after green

sterile token
#

Sorry for sound rude, but have you learnt java?

gilded knot
zealous scroll
gilded knot
sterile token
sterile token
undone axleBOT
gilded knot
#

I get the logic, It's the syntax

gilded knot
zealous scroll
#

if he uses UUIDs he then has to get the player corresponding to each uid anyway which is equally expensive since it loops through online users

and for a mini game I think it’s not needed tbh

undone axleBOT
sterile token
gilded knot
#

github isnt a programming lan

#

oh

#

right

sterile token
#

Yeah im drunk from yesterday hhaha

gilded knot
zealous scroll
sterile token
gilded knot
#

I know, I know

#

I'll split it into seperate classes

#

oh im stupid

#

I had an extra }

sterile token
jagged monolith
gilded knot
sterile token
#

I know what he has as issue, just suggesting that ina future

#

So?

#

Why you complain

zealous scroll
# gilded knot removed public

you could also just make an EnumMap for relating TeamColor to a List of Player/UUID to avoid using players as keys

that also allows you to quickly get all players in a team without using streams or filters

gilded knot
#

I'm just used to doing everything into 1 script and using Ctrl F to navigate

gilded knot
#

Right

sterile token