#help-development

1 messages ยท Page 525 of 1

undone axleBOT
tranquil prairie
#

Hey. For some reason the only thing that prints that I actually see is RETURNING. Not sure if this is because of threads or not but the server freezes when this method is executed

https://paste.md-5.net/akakabigec.cs

quaint mantle
#

Possible to get player's info when player query motd?

quaint mantle
#

Oh thats sad

tardy delta
#

i believe i fucked up md5 paste with 10k lines of css ๐Ÿ’€

#

lagging a bit

tardy delta
#

and not a ResultSet

young knoll
#

Because returning a ResultSet is bad

tranquil prairie
#

^

tardy delta
#

oh wait you are using a future but awaiting on it

#

that defeats the point

tranquil prairie
#

Yeah I dont really know much about the future stuff. Im just trying to run a SQL query async

tardy delta
#

this always executes

#

return a CompletableFuture<ResultSet>

tranquil prairie
#

But it never prints stack trace

#

and it freezes and if it returned it wouldnt

tardy delta
#

oh well its probably stuck in the get then

tranquil prairie
#

Yeah thats where I narrowed it down too but I have no clue why. Literally was working flawlessly before I converted to async

tardy delta
#

nothing is running async

#

you run something async and you block it on the main thread, that just runs it sync

#

either work with a callback or return a future

tranquil prairie
#

Well I want to return a future but I dont understand it. I dont understand why the get is freezing and how to fix it

remote swallow
#

calling join or get on a future forces it to run, blocking the main thread

young knoll
#

Because get forces it to block until complete

tardy delta
#

because your database call takes x hundred milliseconds where a server tick should only take 50 at max

young knoll
#

You should be chaining something like thenAccept

tranquil prairie
remote swallow
#

you have to return the future, then use whenComplete((result, ex) -> {code})

young knoll
#

I prefer thenAccept

tardy delta
#

e.g.

CompletableFuture<ResultSet> queryDB(String query) {
  return CompletableFuture.supply(() -> {
    try (Connection conn = ...; PreparedStatement ps = conn.prepareStatement(query);
       ResultSet rs = ps.executeQuery()) {
      return rs;
    } catch (something)
  });
}```
young knoll
#

smh

remote swallow
#

you do you

#

ill do me

young knoll
#

Can you even safely return a future with a resultset

remote swallow
#

go find out

tardy delta
#

should store a supplier imo or some kind of functional interface where parameters may be passed to ::fromEnum in theory

eternal oxide
#

the resultset should be auto closed once outside the try with

tardy delta
#

well you generally shouldnt return a future with a resultset???

#

should have concrete methods for your db interactions, not just some generic ones that return an async resultset ๐Ÿค”

#

what are you making

young knoll
#

I usually have a factory like class with a create method

ember estuary
#

In the BasicEuclideanComparator , do you really need the square root?
Because no matter if I compare 4 to 5 or 16 to 25, the outcome will be the same, won't it?
I think you can just compare the square sums without taking the root. Would save some performance.

dense falcon
#

BRUH IAM SO STUPID HOW I FORGOT ๐Ÿ˜ญ.

#

Sorry caps.

tardy delta
#

what are you even making

undone axleBOT
echo basalt
hazy parrot
#

Why not. Also you are already having Class<> instance in enum, then you are calling getName on that class again, then getting instance with forName

#

It's redundant, just return Class<>

echo basalt
#

You're literally performing graphics operations in the CPU so I doubt saving those extra 2 clock cycles for a value that would be cached would be as big of a deal as just doing gpu magic

tardy delta
#

variable argument constructors ๐Ÿฅฒ

ember estuary
hazy parrot
#

I also think supplier would be better here

ember estuary
#

hmm yea maybe

echo basalt
#

In color science, color difference or color distance is the separation between two colors. This metric allows quantified examination of a notion that formerly could only be described with adjectives. Quantification of these properties is of great importance to those whose work is color-critical. Common definitions make use of the Euclidean dista...

#

play with the math

ember estuary
#

i heard square roots take a lot of performance, but maybe that was just back in the day

dense falcon
#

How I know when the player do a right click on a player?

echo basalt
#

at a low-level they do

tardy delta
#

if you can avoid it, just do that, but we arent living in 1990 anymore

echo basalt
#

but overall they're negligible compared to idk

young knoll
echo basalt
#

all the chunk checks the server does every tick

dense falcon
tardy delta
#

same types for every class type?

hazy parrot
#

i don't see you are passing any data in your example

quaint mantle
#

would a spigot 1.7 plugin be compatible with 1.8 automatically

tranquil prairie
hazy parrot
#

just don't make 1.7 plugin SkullPixel

quaint mantle
hazy parrot
#

no

subtle folio
tardy delta
subtle folio
tranquil prairie
#

yeah im using hikaricp rn but implemented after I realized the lag would come but I havent been able to test if it would hold up

quaint mantle
tranquil prairie
#

So your saying hikaricp would manage it good?

tardy delta
#

atleast better than a single connection

quaint mantle
#

i dont mean like simple shit like if it was a fully built plugin should there be differences other than the 1.8 api just has more functions

#

Who plays 1.8.9 in 2023 โ˜ ๏ธ

dense falcon
#

We can disable damages from some "blocks" like wither rose on entities?

tranquil prairie
subtle folio
tardy delta
subtle folio
tardy delta
#

what db are you using though

young knoll
#

didn't 1.8 introduce 2 hands

quaint mantle
#

no

hazy parrot
#

its 1.9 afaik

subtle folio
#

That's 1.9

young knoll
#

ah

subtle folio
#

but the methods for single handed use are still apart of the API

#

just deprecated

tardy delta
#

imagine only having one hand and playing minecraft with two hands

#

wait

tranquil prairie
subtle folio
#

I play MC with my foot.

tardy delta
#

fine

tranquil prairie
#

so it will work fine?

tardy delta
#

ye

tranquil prairie
#

alright thanks

dense falcon
subtle folio
#

For a wither rose?

dense falcon
#

Yeah.

subtle folio
#

Wither I'd assume

heavy mural
#

Is there a way to distinguish these inventoryCloseEvents:

  • a player closing their inventory (with for example escape)
  • another inventory opening which closes the old one automatically

?

dense falcon
subtle folio
#

You could keep track yourself with a hashmap of sorts

kind hatch
#

You'd have to already be keeping track of inventories they have opened.

subtle folio
#

but nothing built into the API

quaint mantle
heavy mural
subtle folio
#

I believe the player's inventory is CRAFTING

remote swallow
#

guys we get to # LEARN JAVA! people now

#

LEARN JAVA!

ivory sleet
#

lol

#

should we change the command?

remote swallow
#

we need both

subtle folio
#

put it at the end of it

#

?learnjava

undone axleBOT
remote swallow
#

funky list

subtle folio
#

oh wait thats hot

ivory sleet
#

it doesnt work

remote swallow
#

restart ur discord

subtle folio
#

most definilty does

hazy parrot
ivory sleet
#

wth

hazy parrot
#

lol

remote swallow
#

restart discord

tardy delta
#

BOO

remote swallow
#

AH

hazy parrot
#

yap, that was it

tardy delta
#

I AM A SHEEP

#

wait

ivory sleet
#

it doesnt work for me :c

hazy parrot
#

please automod h1 asap ๐Ÿ˜„

ivory sleet
#

alr

hazy parrot
#

PLSEASE HELP MY PLUGIN NO WORK

subtle folio
#

ctrl + r?

ivory sleet
#

oh it works

#

holy my pants

tardy delta
#

best way to insult people

heavy mural
#

AA

remote swallow
subtle folio
#

based

ivory sleet
subtle folio
#

LEARN KOTLIN

remote swallow
#

wheres ur folders at conclure

subtle folio
#

lmao

ivory sleet
#

the rest 50 arent

subtle folio
remote swallow
#

sort them

heavy mural
#

Yeah doesn't seem to work, sadge

ivory sleet
#

effort

remote swallow
#

this is a sane server list

tardy delta
#

yeehaw

heeheeheeha

  • here
  • we
  • go
    <em>boo<em>
heavy mural
#

It's my own private plugin

#

Gui an all too

quaint mantle
eternal oxide
#

lol

quaint mantle
#

how is it false

heavy mural
#

Oh damn it does? I might switch hmmm
I do have 3k lines in code tho so maybe that's a bit much

quaint mantle
#

not true. Take a look at skyblock for example

quaint mantle
austere totem
#

?nms

quaint mantle
#

*some but not most.

heavy mural
#

Does paper plugin development also bring it's performance upgrade?

quaint mantle
#

i dont know why all these guys hate 1.8 so much its just a version get over it

#

Small ones. Yes. Big ones. No. They are scared of making changes.

remote swallow
heavy mural
quaint mantle
tardy delta
#

async spigot

remote swallow
quaint mantle
#

source

remote swallow
#

inb4 "bstats isnt on every server"

quaint mantle
#

u guys are talking to ghosts

remote swallow
#

funny

quaint mantle
#

That statistic is completly invalid for your argument. It doesnt take in account the

kind hatch
quaint mantle
#

the players on most pvp servers

#

because these

#

dont use those

quaint mantle
#

i guess

river oracle
#

My dms with my friend is in every chat this is so weird

quaint mantle
#

yes a lot. isnt all. 10 small pieces of cake is the same as 3 big.

#

how is minecraft playable for more then 5 minutes if its not pvp

remote swallow
#

hypixel has like 25k average, it used to be over 100k

remote swallow
quaint mantle
remote swallow
#

yeah

quaint mantle
#

because i dont have a server? Probally?

remote swallow
#

not everyone spends their entire life trying to click quicker

quaint mantle
#

crazy world we live in full of robots and drones

river oracle
#

Vanilla survival is boring asf imo but its popular gamemode rn

quaint mantle
#

Comparison.

#

Scale is always a factor.

remote swallow
kind hatch
#

Hypixel is the exception though.

quaint mantle
#

you never see the bigger picture

#

probably the same in life

remote swallow
#

plus pre made maps

quaint mantle
#

Oh okay is an elephant small or big. Tell me. Without a scale. Tell me. Its impossible without including other data

#

That is the basics of using data
properly

kind hatch
#

You are supposed to compare reasonably.

quaint mantle
#

i can also call my 1080 high end if i only compare it to gpus older then it self

remote swallow
#

cant wait for hypixel to inevitably stop releasing new stuff on 1.8 and slow move away for it

quaint mantle
#

I never said i licked the 1.8 trend

#

its just

#

a fact

#

anyone know why i get this issue?

[20:21:48 ERROR]: Error occurred while enabling RSCore v1.2.5 (Is it up to date?)
org.bukkit.plugin.IllegalPluginAccessException: Plugin attempted to register me.data.redstonepvpcore.listeners.Banker@5382f0d while not enabled
        at org.bukkit.plugin.SimplePluginManager.registerEvents(SimplePluginManager.java:533) ~[server.jar:git-Carbon-"38757d2"]
        at me.data.redstonepvpcore.RSPVPCore.loadEvents(RSPVPCore.java:73) ~[?:?]
        at me.data.redstonepvpcore.RSPVPCore.onEnable(RSPVPCore.java:43) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:334) ~[server.jar:git-Carbon-"38757d2"]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:319) ~[server.jar:git-Carbon-"38757d2"]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:395) ~[server.jar:git-Carbon-"38757d2"]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:382) ~[server.jar:git-Carbon-"38757d2"]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:341) ~[server.jar:git-Carbon-"38757d2"]
        at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:368) ~[server.jar:git-Carbon-"38757d2"]
        at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:332) ~[server.jar:git-Carbon-"38757d2"]
        at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:286) ~[server.jar:git-Carbon-"38757d2"]
        at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:302) ~[server.jar:git-Carbon-"38757d2"]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:527) ~[server.jar:git-Carbon-"38757d2"]
        at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_312]
remote swallow
#

less people are joining 1.8 pvp and more are joining the 1.9pvp stuff and crystals and whatever, at some point everyone that plays 1.8 will move on and either leave minecraft or update

quaint mantle
#

spigot fork

#

yh at some point. a point that we didnt fully reach tho

#

sadly

#

i also enjoy coding for newer version wayyy more

#

but 99% of people i work for or with are working with 1.8

kind hatch
gentle nimbus
quaint mantle
#

redstonepvpcore/rscore is the plugin erroring.

#

different work envriorment id say no clue how to spell envrioremnt

#

environment

remote swallow
#

environment

heavy mural
#

148 deprecated issues โ˜ ๏ธ

#

gonna be fun

gentle nimbus
#

oh just realized RSCore is redstonepvpcore lol

kind hatch
#

Well, you can ignore them until they finally move away from spigot.

quaint mantle
remote swallow
#

cant wait for paper hard forking

kind hatch
#

Truly one of the moments in minecraft history.

remote swallow
#

its getting closer now hanger is out

gentle nimbus
#

It seems like it is trying to register events even though the plugin is somehow not enabled yet. Idk how your code looks but u might wanna consider delaying event registration

#

to point the obvious

heavy mural
#

well it fixed my issue

#

with the player closing the inventory

#

so that is great :)

#

I am just getting dizzy by the 148 warnings and yellow lines. Is there a way I can disable those?

#

or would it also be an option to upgrade to their non-depricated paper versions?

kind hatch
#

You can either convert to paper methods, or just put a bunch of @SuppressWarnings("deprecation") everywhere.

young knoll
#

Sure but then it won't run on spigot

heavy mural
#

I see, hmmm I mean it will only be used on my own purpur server

#

which is fork of paper

#

aka. spigot support is not needed as far as I know

#

ty for the info tho

quaint mantle
#

is NitroSpigot performance good

#

anyone know

eternal oxide
#

?whereami

remote swallow
#

?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.

quaint mantle
#

they dont have one ๐Ÿ’€

opal juniper
#

red flag

quaint mantle
#

oh nvm they do

#

nvm

austere totem
#

?nms

tardy delta
#

this is fine

dense falcon
#
    @EventHandler
    public void onInteractEntity(PlayerInteractEntityEvent event) {
        Player player = event.getPlayer();
        FileConfiguration config = this.plugin.getConfig();
        if (event.getRightClicked() instanceof Player target) {
            ItemStack item = event.getPlayer().getItemInUse();
            if (item != null && item.hasItemMeta()) {
                ItemMeta meta = item.getItemMeta();
                PersistentDataContainer container = meta.getPersistentDataContainer();
                
                NamespacedKey key_cps = new NamespacedKey(this.plugin, "cps");
                NamespacedKey key_playerinfo = new NamespacedKey(this.plugin, "info_plr");
                
                if (item.getType() == Material.CLOCK && container.has(key_cps, PersistentDataType.DOUBLE)) {
                    cpsPlayer(this.plugin, player, config);
                } else if (item.getType() == Material.PLAYER_HEAD && container.has(key_playerinfo, PersistentDataType.DOUBLE)) {
                    informationPlayer(this.plugin, player, config);
                }
            }
        }
    }
``` To check the current item that used the player, what I could use (the method) ?
agile anvil
#

?jd-s

undone axleBOT
dense falcon
#

If I am asking, I do not know.

tardy delta
kind hatch
dense falcon
#

Alright thanks.

agile anvil
dense falcon
#
    private void informationPlayer(Main plugin, Player player, FileConfiguration config) {
        player.sendMessage("Yo");
    }

    private void cpsPlayer(Main plugin, Player player, FileConfiguration config) {
        player.sendMessage("Bad boy ?");
    }
kind hatch
#

?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
}
dense falcon
#

Oh nice thanks.

turbid crest
#

Hello ๐Ÿ™‚ I would like an advice.

I have two differents classes in my plugin with PlayerQuitEvent
The first one TP the players home when he leaves the server
The second one does something else, but need the player to be home

How can I do to make sure that the first event processing is finished before executing the second one ?

eternal oxide
#

whatever you do the player will not be teleported before your second listener is called

#

server has to tick for the teleport to happen

visual laurel
#

Hiya, im using custom model data with a resource pack but one of my items isnt displaying the texture instead is just a empty item.

wide dune
#

Is it possible to make a block appear as one material for one player and another for a different player using packets?

E.g obsidian appears as bedrock for certain players

young knoll
#

Yes but it's not easy

wide dune
#

How do you do it?

tender shard
pseudo hazel
#

does anyone have a simple, not overengineered r cumbersome way to just deal with a command executor that has a bunch of sub commands

tender shard
#

ACF or just switch/case on the args

young knoll
#

I use a map

pseudo hazel
#

whats acf

young knoll
pseudo hazel
#

how, can you show?

wide dune
young knoll
#

Good luck finding one that's open source

wide dune
#

It that difficult?

#

Bloody ell

ember estuary
#

How can i stop the server from sending map updates? (I'm making my own custom map item)

#

I can send an update with ClientboundMapItemDataPacket, but the server just sends another map update every 3rd tick of so, which just overwrites what i recently sent..

#

I've already tried removing the MapRenderer and adding my own with an empty render function, but that doesn't seem to help

young knoll
#

This is all I do

#
MapView mapView = Bukkit.getMap(mapId);
mapView.setLocked(true);
mapView.getRenderers().clear();
slim wigeon
young knoll
#

As a PR?

#

Or do you just want a string list type

austere totem
#

can anyone help?

Resetting Spigot-API to Bukkit...
error: No such remote: 'upstream'
HEAD is now at 01d18206 Add non-mutative getCrossProduct method to Vector.
Applying patches to Spigot-API...
fatal: Resolve operation not in progress, we are not resuming.
Applying: POM Changes
gpg: skipped "BuildTools devcodedred@gmail.com": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object
Something did not apply cleanly to Spigot-API.
Please review above details and finish the apply then
save the changes with rebuildPatches.sh
Error compiling Spigot. Please check the wiki for FAQs.
If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support.
java.lang.RuntimeException: Error running command, return status !=0: [C:\Program Files\Git\usr\bin\bash.exe, applyPatches.sh]
at org.spigotmc.builder.Builder.runProcess0(Builder.java:1055)
at org.spigotmc.builder.Builder.runProcess(Builder.java:986)
at org.spigotmc.builder.Builder.main(Builder.java:731)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)

Im trying to build spigot 1.8.8 but it wont work for some reason

ember estuary
young knoll
#

mhm

ember estuary
#

alrighty, will try that

slim wigeon
# young knoll Or do you just want a string list type

I want to add 3 filters to a hopper.world:193:64:-130: Player: 0b605717-d3a0-4cd4-8b67-3af1eb6449ca Location: World: world X: 193 Y: 64 Z: -130 Options: Suction: false BlockBreak: false AutoSell: falseSo there be a key of Filter with lists of Void, Whitelist and Blacklist. Like how EpicHoppers work

young knoll
#

So you want a string list type

#

Make a class that implements PersistentDataType

slim wigeon
#

Wait, I just noticed that is for items and blocks, not config. I cannot think right now. Time to look at my code

young knoll
#

A list of strings can already be used in a config

slim wigeon
young knoll
#

config.set(path, list)

slim wigeon
#

So I just add the list? Thanks

young knoll
#

mhm

#

You can read it with getStringList

slim wigeon
#

I was about to ask about that as well

#

My network[download] Got error: The read operation timed out. Retrying (2/10)...Cannot have plugins that uses the internet to verify from urls like Jeff's plugins

#

I should not be using this channel for this but I will say this, slow internet is like h***, I think some of you know what I mean

tardy delta
#

and every game is represented by a specific class?

#

im dissapointed in myself

slim wigeon
tardy delta
#

but you know the constructor signatures at compile time?

#

wondering about some kind of map which holds a game creator, which needs to be registered before

#

i remember 7smile once sent smth good here but thats years ago :(

undone axleBOT
tardy delta
#

ye that will suck when more parameters are introduced

#

(dunno if thats really scalable) but you could just have a functional interface which acts as a creator and accepts all possible param types and each game constructor only uses the ones it needs ๐Ÿ’€

#

GameType.GAME_WHATEVER(id: 1, (gamedata, loc, smthElse) -> new WhateverGame(id))

#

kinda sucks but i cant think of better things at the moment

#
enum GameType {
  BEDWARS((id, data, loc) -> new BedwarsGame(id, loc)),
  SKYWARDS((id, data, loc) -> new SkywarsGame(data)),
  X((id, data, loc) -> new X(id));

  func<T extends Game(int, GameData, Loc)> func;

  Game create(int id, GameData, Loc) {
    return func(id, data, loc);
  }
}```
#

was thinking about smth like this

#

why dont you just create those game classes first and then wonder about how to do the dispatching

rare rover
#

okay question

ember estuary
#

How can i convert a MapCursor into a MapDecoration?

Edit:
Nevermind, I found how Bukkit does it.

For anyone that needs this in the future:
new MapDecoration(Type.byIcon(cursor.getRawType()), cursor.getX(), cursor.getY(), cursor.getDirection(), CraftChatMessage.fromStringOrNull(cursor.getCaption()))

tardy delta
#

what about you show some constructors

rare rover
#
public void spawnNextStructure(DungeonStructure dungeonStructure) {
        if (structureDeque.size() == 5) {
            DungeonStructure structure = structureDeque.removeLast();
            structure.remove();
        }
        structureDeque.addFirst(dungeonStructure);
        dungeonStructure.generate(lastestStructure.getNextPasteLocation().toLocation(Bukkit.getWorld("world")));
        lastestStructure = dungeonStructure;
    }``` any suggestions?
tardy delta
#

whats lastest supposed to mean

rare rover
#

yeah i misspelt that

#

latest

tardy delta
#

also Bukkit.getWorld("world") probably means overworld, not sure if you can change the name but Bukkit.getWorlds().get(0) is also overworld, then nether and end and custom worlds etc

rare rover
#

yeah that's just a placeholder until i get a config in

#

but thanks

tardy delta
#

anyways does anyone knows what this bar on the right in vscode is called? kinda want it in jetbrains products

sullen marlin
#

Sublime text calls it mini map or something

#

I think they started it

tardy delta
#

this thing exists but its kinda wack

#

as i said, im disapointed by myself

#

why do you really need an enum tho

#

how do you need to lookup the game

#

but how are you deciding the game type

#

user input?

#

and you dont have any surrounding scope to get those constructor params from?

tardy delta
sullen marlin
#

Lambdas work great

tardy delta
#

no clue how many games you have but id start from a point where you receive an id and a GameData and some custom params

sullen marlin
#

ClassName::new creates a Supplier<ClassName>

tardy delta
#

ive told him

#

but kinda sucks with the constructors that take different param types

ivory sleet
#

method handle

tardy delta
#

could accept any possible type and let the lambda decide but that goes brr

#

help me conclure lol

ivory sleet
#

hai

worldly ingot
#

I think the design is just sort of wrong to begin with

#

If you have to use reflection to solve your problem, something isn't designed correctly

tardy delta
#

bruh discord bugged lol

#

i restart it and suddenly it changes my volume to 80%

#

fuck my ears

worldly ingot
#

That seems like the least convenient way to do it

storm scaffold
#

Is there a way to tell when a player enters a structure like a shipwreck?

young knoll
#

Not with the API

#

*Yet

austere totem
worldly ingot
#

If that's a respawn, player.spigot().respawn()

wise mesa
#

perhaps there's some event for when a structure is created

#

and you could mark down its bounds

#

and then check if a player enter's those

#

idk if that's the case though

worldly ingot
#

There is

wise mesa
#

so maybe you could do something like that @storm scaffold

tardy delta
#

got it

buoyant viper
#

also called uhhh Map Mode on VS

#

wish i could set the CodeLens display to the right side

#

like i can in intellij

warm mica
#

I always ignore it in vs code

tardy delta
#

faster than scrolling sometimes

#

something tells me i should measure how much those console.logs clutter up the apps start time

#

its already fucked up cuz electron but whatever

#

wait wha am i in help dev

tough magnet
#

I've been messing around with the
player.getInventory().addItem();
I cannot figure out how to use NBT tags for 1.8.9

#

*get

warm mica
tough magnet
#

yeah I know it complicates things

warm mica
#

Pretty sure that using nms would be the only solution

tough magnet
#

what is nms?

warm mica
#

Basically the original mojang server code that is hidden from the spigot api

#

Alternatively you could also execute the vanilla give command. That's way easier and doesn't require you to use nms

onyx fjord
#

Biggest pain ever

warm mica
onyx fjord
#

That too

#

Also it's not / it's +

warm mica
#

Pretty sure it's /, that's how it's written everywhere

onyx fjord
#

Yeah but rms prefers +

#

Also it makes more sense

warm mica
#

It does

onyx fjord
#

It's gnu software plus the Linux kernel

warm mica
#

Second biggest pain I guess

#

People saying gnu/linux

young knoll
#

What NBT tags are we talking about

tough magnet
#

The give command drops you the item, and I plan on using it for a GUI. I've seen hypixel use NBT tags on just about any item.

young knoll
#

Any vanilla NBT data should be available in the API

#

For custom data we have PDC, but not in 1.8

#

So you'll have to use NMS or something like NBTApi

slim wigeon
#

Upon adding the filter GUI to my hopper plugin, I ran into a issue. I see why people are keep posting that new GUI thread

#

So I had to re-write the whole thing

#

Just the GUI at least

strong parcel
#

Can I target a block caught in an explosion and delete it or delete its drop?

wet breach
#

Yes

strong parcel
#

Which event do I need to look at to do that?

young knoll
#

BlockExplodeEvent and EntityExplodeEvent

wet breach
#

In there there should be a collection or list that contains blocks in the explosion

#

You would go through that to find the one you are looking for

strong parcel
#

So I have been looking at those events, and I grabbed the blocklist from them. However, I don't know how to make the block drop nothing. I tried block.drops.clear, but that didn't work.

young knoll
#

Remove the block from the list and manually set it to air

strong parcel
#
        bastionBlock.getDrops().clear();
        e.blockList().add(bastionBlock);```
#

Oh, that's a good idea. I will try it out rn

worldly ingot
#

The drops you get from getDrops() is a copy. Modifying that won't do much at all

#

(just as a future note)

young knoll
#

(Sadly)

strong parcel
#

That's a shame. No way to setDrops?

wet breach
worldly ingot
#

Well now you're wanting a mutable loot table API, Coll ๐Ÿ˜‰

#

Good luck to you!

young knoll
#

Yeah Iโ€™ve looked at loot tables

#

Lot of abstraction

wet breach
subtle folio
#

drop naturally ?

young knoll
#

You can change drops with the BlockDropItemsEvent

#

However Iโ€™m not sure if that only fires when a player breaks the block or not

strong parcel
#

ChatGPT and the docs tell me it only fires when a player does it

wet breach
#

At minimum there is itemspawn event

wise mesa
#

what is the point of this

#

why not just use pdc?

young knoll
#

Because itโ€™s older than pdc

wise mesa
#

ah but like

#

its still updated?

#

and people still use it?

#

I hope not for new code

young knoll
#

I mean maybe it can provide some useful stuff

#

Since not all NBT is exposed in the api quite yet

wet breach
#

So its nice if there is options to choose from sometimes

wise mesa
#

fair enough

worldly ingot
young knoll
#

Heh

#

Laughs in canBreak/canDestroy

#

Or various monster spawner options

worldly ingot
#

I had a PR for that but I'm waiting for 1.20's ItemType/BlockType changes

#

Monster spawners and spawn eggs are difficult and up for constant debate

river oracle
#

What's wrong with monster spawners and spawn eggs

#

Is it a matter of ItemMeta vs ItemType?

young knoll
#

They basically require the concept of virtual entities

worldly ingot
#

Just hard to get the NBT of an Entity onto an ItemMeta

#

You need an Entity, but you can't have an Entity unless it exists in the World

#

At least as far as Bukkit is concerned

wise mesa
young knoll
#

Nop

wise mesa
#

damn

#

glad to know

young knoll
#

Not that it gets used much because itโ€™s an adventure mode thing

wise mesa
#

honestly if I ever do need it might just be easier to call /give ๐Ÿ˜…

wise mesa
#

we're making dungeon typa things for my server

wise mesa
young knoll
#

You can always just remake it with pdc

#

Or just wait for choco to do said pr

wise mesa
#

you can't access vanilla nbt with pdc's

#

and you can't reimplement block breaking and placing

#

because its adventure mode

#

so they wont have a mining animation

young knoll
#

Just use survival mode

wise mesa
#

ugh

wet breach
#

Instead of relying on the server to do something if those are set. You would create those values and do all the checks and changes yourself

#

Hence remaking

wise mesa
#

right but then I'd have to use survival mode

#

ill just wait

#

it's gonna be a 1.20 server anyways

#

we're just starting dev early

#

hopefully ๐Ÿคž the unenuming will happen at the beginning of 1.20

young knoll
#

Glad to know choco also has evil plans PR plans

wet breach
wise mesa
#

yes

#

oh right could always run on the pr lol

wet breach
#

Then you dont have any problems just imaginary ones then

wise mesa
#

not that concerned about it anyways

wet breach
#

You are free to change the server code as you see fit

echo basalt
#

You'll be fine

wise mesa
#

ewwww

#

then I have to like

#

make sure to merge upstream commits occasionally

#

could never do that

#

ill be patient

wet breach
#

Only if you want or need the upstream changes

echo basalt
#

or you can just be patient

#

make a decent 1.19 codebase

wise mesa
#

also losing support because im running on a modified server

echo basalt
#

and like

wise mesa
#

not worth

wet breach
#

But you can just make patches of your changes so you can always reapply your changes when updating

echo basalt
#

spend a couple nights porting everything

wise mesa
#

as I mentioned above

#

I'm actually kinda excited to port everything it'll be fun

#

messing with the new api

wet breach
#

And you wouldnt necessarily lose support. Just you would require different kind of support

wise mesa
#

true

young knoll
#

Iโ€™ve got to get back to working on the placed structure pr

#

At least I have time

wet breach
#

Anyways i have some work to do. Ironically not changing tires lol

echo basalt
#

oh damn

#

probably just receiving new tires

wet breach
#

No. I have to do wheel end services which involves the hubs

river oracle
#

Nein

wary topaz
#

for (int i = 1; i<20;i++) { i-- //:) }

river oracle
#

Oh boy look whose back

wary topaz
#

hehe

river oracle
wary topaz
#

E

wise mesa
#

i hate that

wary topaz
#

to make people cry

wise mesa
#

aaaaah

#

its working

#

also you forgot a semicolon

wary topaz
#

okay mr debugger

#

i wrote that in discord

#

atleast i put the semicolons in the for loop

wary topaz
#

public Inventory inventory = Bukkit.createInventory(null, 45, ChatColor.YELLOW + "BetterInventoryManager V");

signal kettle
#

Hello how I can make that if it equals any string from arraylist?

        ArrayList<String> RedAppleTree = new ArrayList<String>();
        RedAppleTree.add("red_apple_tree_stage_1");
        RedAppleTree.add("red_apple_tree_stage_2");
        RedAppleTree.add("red_apple_tree_stage_3");
        RedAppleTree.add("red_apple_tree_stage_4");
        RedAppleTree.add("red_apple_tree_stage_5");
        RedAppleTree.add("red_apple_tree_stage_6");
        RedAppleTree.add("red_apple_tree_stage_7");

        if (!furnitureMechanic.getItemID().equals("red_apple_tree_stage_1")) return;
echo basalt
#

list.contains

signal kettle
#

like that? Then it asking me for an object

if (!furnitureMechanic.getItemID().contains(RedAppleTree.contains())) return;
remote swallow
#

you are checking if it contains something, so if (RedAppleTree.contains(furnitureMechanic.getItemID())

#

and follow naming conventions

#

?conventions

signal kettle
#

ohh okay thank you

wet breach
echo basalt
#

mans copying my search index

remote swallow
#

yeah

#

its smart

#

i did say i was gonna steal it

echo basalt
#

true

tough magnet
#

I added the imports into my code it seemed fine with my IDE.

import de.tr7zw.nbtapi.NBTCompound;
import de.tr7zw.nbtapi.NBTItem;

However, trying to compile my code I get a "package de.tr7zw.nbtapi does not exist". I even after I downloaded the jar and placed it into my spigot plugins folder. I also file -> project structure -> Modules -> dependencies -> there's a + symbol -> I added the jar file into the list. I also added "depend: [NBTAPI]" on my plugin.yml

grave kayak
#

hello, i asked this question a few days ago but was suggested a very old plugin that does not work anymore. I am trying to make a plugin that spawns an npc on a creative plot, when the npc is clicked it will open the creative menu and players will be able to take what they wish from the menu. I am having extreme difficulty finding a way to open the creative menu when the npc is clicked. if anyone has any ideas or a solution it would be much appreciated

agile anvil
#

There is no way of opening that inventory I'm afraid

eternal oxide
#

*afraid

echo basalt
#

unless you make a custom gui but then you won't have any scrolling

wet breach
agile anvil
grave kayak
#

RIP, thanks for your answers

agile anvil
eternal oxide
#

or use the libraries feature in plugin.yml

remote swallow
#

they have both

echo basalt
#

hmm

#

I wonder what a .jar would look like if we like

#

rendered all the bytes as an image

#

and added some padding

eternal oxide
#

imillusion is about to make the Matrix

echo basalt
#

6am thoughts

#

it'd be quite goofy tho

#

because at the end of the day it's all a bunch of bytes

#

so like what if we read bytes 3 by 3 and made an image out of it

#

and just render it as a square or something

#

let me mock up a project real quick

eternal oxide
#

probably noise

echo basalt
#

rgb noise though

#

not just black and white

eternal oxide
#

I wonder if you could see a pattern

tough magnet
#

earlier today I tried making a lib folder and move the jar into it but it would pop up a screen and said something long the times refactoring and it would let me push the buttom

echo basalt
tough magnet
#

well I tried adding .zip file for the lib and end up with a Empty Library

wet breach
#

Or fingerprint

echo basalt
#

interesting

#

I just had this random thought honestly

wet breach
#

But it does sometimes create some interesting images

echo basalt
#

and like 30 lines of code later it just looks... yellow

#

I wonder what happens if I have an image embedded in it

wet breach
#

Obviously have to be into abstract stuff though cause it isnt going to like create no fancy art lmao

echo basalt
#

watch me write cursed java code to paint the mona lisa

eternal oxide
#

would be hard to get the correct size

echo basalt
#

well

eternal oxide
#

So java is yellow we learned

wet breach
#

But yeah, rendering the bytes of compiled stuff as an image is a good way to create a fingerprint because it is extremely difficult to change something in it and still retain the exact same bytes

#

And instead of checking all the bits you would just see if it renders the same image and could check it against another one that is known to be good

echo basalt
#

but that's literally as efficient as just storing the original file

remote swallow
wet breach
echo basalt
#

unless you're omitting stuff it kinda is?

wet breach
#

Its more like 8:1

echo basalt
#

my 1ish mb jar created a 640x640 image

#

that's about 400k pixels, multiply by 3 bytes per color and it's around 1ish mb

wet breach
#

Its not 3 bytes per color

echo basalt
#

r(255) g(255) b(255)

wet breach
#

What does the image look like ?

#

And you are right for rgb its 3bytes

#

4 if you add a couple more options

echo basalt
#

4 if you add transparency and all

#

here's what an mp4 looks like

#

those lines are weird

#

forbidden sawdust

wet breach
#

Woo, what a nice image and its one of a kind too

agile anvil
#

How do you choose the dimensions?

echo basalt
#

it just makes a square

#

based on like the total amount of pixels

#

just sqrt's it

agile anvil
#

Do you fill it line by line or column by column

echo basalt
#

line by line

agile anvil
#

Just the right size

remote swallow
echo basalt
#

just messing around

#

excel file.. interesting

#

wait the dimensions aren't square

#

i'm an idiot

#

those are the minimum dimensions of my jframe

tough magnet
#

When I add
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api-plugin</artifactId>
<version>2.11.2</version>
<scope>provided</scope>
</dependency>

It's properly indented. I get "Dependency 'de.tr7zw:item-nbt-api-Plugin2.11.2' not found :39". I made sure it was Within <dependencies> and under the spigotmc <dependency>

#

NVM

echo basalt
#

maybe because you didn't specify the repo?

#

jitpack

tough magnet
#

I reload it

echo basalt
#

smort

wet breach
echo basalt
#

well this image is literally just a representation of the binary data so

#

it's not an odds thing

#

it's just an image hash

#

type thing

#

it's all fun and games until you bring jpeg compression in

#

then things can change

#

but until then this is just a copy of the file but rendered as an image

wet breach
#

Yes but since we are not changing the data and only displaying it in another format. It isnt something you can easily fool. Unlike in programming where you can manage to fit the bits in the right place when you change something but still executes or trying to fool a hash which does change the data.

#

This makes it extremely harder and the check for comparing images is typically faster then comparing the bits individually

echo basalt
#

hm

#

what if you had an obfuscator that could like

#

tweak the image in a lossless format

#

and then you'd like

#

embed that obfuscated image in your jar

#

which would be a representation of the code within it

#

and then... obfuscate your code and compare against the image

#

that sounds like an overengineered hash

wet breach
#

Lol

#

I think a fun thing to probably do is make a programming language out of images

echo basalt
#

I could think of a use in qr codes but cameras aren't that accurate

livid dove
#

Q

echo basalt
#

it literally just represents the bytes as an image instead of as a binary blob

#

the image is the same size as the original file so

glossy venture
#

you can analyze memory with tools like process hacker as well

#

find strings and shit

livid dove
tardy delta
cunning shard
#

Does anyone know how to move a piece of code that (uses bookAPI not sure if this matters) to a universal config.yml or something similar to make it easily editible to the average server owner?
will provide code that i want to move if needed.

quaint mantle
#

saveDefaultConfig(); ?

pseudo hazel
#

or ConfigurationFile i think its called

quaint mantle
#

I think json is better for configuring.

sullen marlin
#

Why

#

It doesn't even have comments

tardy delta
#

i do my comments like "__comment": "oh hell ye"

#

shouldnt be doing that

pseudo hazel
#

json is terrible for configuration

#

a normal person can actually write yml files unlike json which takes ages and is annoying to type

#

json is not made so that humans can write in it

tardy delta
#

json is fine for some stuff

agile anvil
#

Just to read and edit yeah

granite olive
#

What is the simplest way to have separately loaded worlds with their own datapacks, scoreboards, chat, etc. be isolated from the other worlds on the same server? So to essentially have the worlds be as if they are on a separate server without that actually being the case?

chrome beacon
#

Just run another server

#

The overhead and time required to split everything isn't going to be worth it

eternal oxide
#

Bungee and multiple servers

granite olive
#

Yeah I figured that when starting to get some of the mentioned things working but was hoping that I maybe just miss an easy solution

#

Alright I guess Iโ€˜ll have to look into bungee as I have no experience with that. Thanks for pointing me in the right direction

eternal oxide
#

?bungee

#

odd not linked

granite olive
#

will do, thank you!

quaint mantle
pseudo hazel
#

yeah each plugin needs to handle that themselves usually

austere totem
#

does any1 know how to get spigot + nms for 1.8.8 i get error if i try to do it via buildtools

chrome beacon
#

Well what's the error

austere totem
#

Resetting Spigot-API to Bukkit...
error: No such remote: 'upstream'
HEAD is now at 01d18206 Add non-mutative getCrossProduct method to Vector.
Applying patches to Spigot-API...
fatal: Resolve operation not in progress, we are not resuming.
Applying: POM Changes
gpg: skipped "BuildTools devcodedred@gmail.com": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object
Something did not apply cleanly to Spigot-API.
Please review above details and finish the apply then
save the changes with rebuildPatches.sh
Error compiling Spigot. Please check the wiki for FAQs.
If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support.
java.lang.RuntimeException: Error running command, return status !=0: [C:\Program Files\Git\usr\bin\bash.exe, applyPatches.sh]
at org.spigotmc.builder.Builder.runProcess0(Builder.java:1055)
at org.spigotmc.builder.Builder.runProcess(Builder.java:986)
at org.spigotmc.builder.Builder.main(Builder.java:731)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)

#

this

chrome beacon
#

Please check the wiki for FAQs.
If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support.

austere totem
#

right ok 1 sec

#

?nms

chrome beacon
#

^^ This is for modern versions

austere totem
#

right i was just getting the buildtools command to get a log

chrome beacon
#

?bt

undone axleBOT
austere totem
#

here s the log

eternal oxide
#

what command line are you using?

austere totem
#

java -jar BuildTools.jar --rev 1.8.8

#

java.lang.RuntimeException: Error running command, return status !=0: [C:\Program Files\Git\usr\bin\bash.exe, applyPatches.sh]

valid root
#

Hey that might be stupid question butt, thoes snowball is a living entity?

young knoll
#

No

valid root
#

But from what i know it got rotation/eyelocation

#

but idk how to get it

tender shard
chrome beacon
tender shard
valid root
#

forge think otherwise

chrome beacon
#

If you want to get the direction of the snowball

#

get the location

valid root
#

ya ok i will try to figure something out

chrome beacon
#

Unlike a player or a living entity the eye location (head) isn't separate from the body

river oracle
tender shard
chrome beacon
tender shard
#

because you can do /execute @e[...]

#

yeah

valid root
chrome beacon
#

Intellij

tender shard
river oracle
tender shard
chrome beacon
#

That might be an ultimate thing

tardy delta
#

ye

valid root
young knoll
#

Whatโ€™s the diagram for player look like

tender shard
tender shard
#

on spigot it's this

topaz atlas
#
    private final Set<Duels> currentDuels = new HashSet<>();
}

public class Duels {
Bukkit.getPluginManager().registerEvents(signEvent, this);```

I will add more code to sign events and i only showns a bit of the Duels class.
Do I need to extend duels for it to be able to create events? or listener, can I just invoke it

river oracle
tender shard
chrome beacon
#

^

tender shard
#

Audience is basically message receivers or sth

river oracle
tender shard
#

as said, first diagram was paper, second one is spigot

river oracle
#

Ah

#

Didn't see

tender shard
#

had to switch to paper for mockbukkit to work

#

only in the test classes though ofc

topaz atlas
# tardy delta what

So, I will have events in both signevents and duels, duels is invoked from signevents

tardy delta
#

any class that has event handlers needs to implement Listener (marker interface)

river oracle
#

Don't ask

topaz atlas
#

nvm

tardy delta
#

if you are calling them explicitly, dont need it

tender shard
topaz atlas
#

Oh ok

tardy delta
#

@EventHandler methods will be invoked from spigots side

river oracle
#

I use mock bukkit and their all at 1.19.2

tender shard
#

IIRC everything below 2.X.X works on spigot but the latest (or at least 2.145.0+) need paper-api at least on test scope

tender shard
tender shard
river oracle
river oracle
#

I'm assuming they have some patch to make them work

tender shard
#

I only remember I once had some issues with mockbukkit when they told me to use 1.19.2 because they haven't updated to 1.19.3 because of "<some issue I forgot>"

#

?paste

undone axleBOT
tender shard
tardy delta
#

lmao gradle moment

#

probably maven though

tender shard
#

and yeah that's why I have to use paper-api 1.19.2, but only on <scope>test

#

one can continue to use spigot-api for the actual classes

dense falcon
#

To check if a player has an anti kb, I saw some servers were checking velocity but why?

chrome beacon
#

Because antikb removes the velocity?

#

To stop the player from taking knockback

topaz atlas
#

?paste just finding the paste

undone axleBOT
quaint mantle
#

Wait

#

You can tp forward

topaz atlas
#

https://paste.md-5.net/ihawupatol.java

So, I want to create a duel system, how do I create the duel class with the Start function invoked and all the varibles set, awaiting the next player to click a sign, then start the event, and how would I reset the event?

dense falcon
chrome beacon
#

player#getVelocity

dense falcon
chrome beacon
#

Depends on how the player is moving

dawn flower
#

can you change someone's skin without protocol lib? i tried the docs but i cant seem to find anything

river oracle
#

Then it works idk abt maven

topaz atlas
wet breach
#

technically its 0.10000000149011612

#

but, 0.1 should be fine

chrome beacon
dense falcon
#

So if I create a command, get a velocity of a target if it's higher > 0.1, that he has an anti kb?

wet breach
#

no

#

you asked what is normal velocity

#

I gave you what that is, and that is if they are walking

dawn flower
dense falcon
#

So when they are running ?

wet breach
#

running is 30% faster

#

also these numbers assume no status effects as well

#

or anything else acting upon the player

chrome beacon
wet breach
#

slowness for example

#

or certain blocks slowing you down

#

or vice versa

chrome beacon
#

If you don't know how velocity works you probably shouldn't make an anticheat (which I assume you're trying to do)

wet breach
#

now to answer your question in regards to anti-knockback

#

and why velocity is checked

#

if they are supposed to get knocked back, then that means they should have a velocity going away from the attacker

wet breach
#

if that velocity is 0 or near 0 then that means they have anti-knockback

chrome beacon
dense falcon
#

Commands.

chrome beacon
#

Make antiknockback?

#

??

wet breach
chrome beacon
#

oh that code is a mess

topaz atlas
#

like 3 lines that are unrelated

chrome beacon
#

and? The code is still a mess

topaz atlas
#

Well, ignore the sign place event

topaz atlas
#

anyways, I was told I need to create class's as apart of a hashSet to have my varibles reset properly

chrome beacon
#

I assume you're going to have one sign listener per duel then

topaz atlas
#

I dont really know how to do that.

#

also, the playerInteract event is the thing that trigger the duel

#

it should run the function, set the first player, and await a second player, or any number of players i waant

topaz atlas
#

so yeah

chrome beacon
#

Seems like bad future proofing but sure I guess if you only want one duel per server ๐Ÿคทโ€โ™‚๏ธ

wet breach
#

um, why we extending signevents?

#

and why are you implementing listener when these appears to be you want to be extending events instead

topaz atlas
chrome beacon
#

Duels

topaz atlas
restive tangle
#

Duels plugin moment

topaz atlas
#

in the first place

wet breach
topaz atlas
#

the SignEvents

wet breach
#

when creating a custom event class, you don't implement the listener there

topaz atlas
#

I meant

#

that events will kickstart the duel

#

the duel will remain till either player dies, then a new hash set is made, I think thats how it works

wet breach
#

ok....that doesn't appear to change what I have said still

chrome beacon
#

Why do you use a set to store a single value?

wet breach
#

there is just all kinds of wrong going on here

chrome beacon
#

Yeah I'll just skip this one... too tired to try and decipher this

topaz atlas
#

lol

#

I had a issue with the varibles resetting

#

and the people here

#

its so confusing

#

people here tell me one thing

#

then another batch of people wonder tf im doing

chrome beacon
#

Yeah your code is confusing

topaz atlas
#

^

topaz atlas
wet breach
topaz atlas
wet breach
#

yours

topaz atlas
#

lmao, so dont take the advice here ?

wet breach
#

that isn't what I said

#

and not all advice here is perfect

topaz atlas
#

ok, i will assume it was faulty advice originally

#

and ill listen to what you suggest

#

i know ill need a hashmap or smthin along the lines

wet breach
#

have to realize that everyone here is just voluntarily providing help. It is a community

topaz atlas
#

the general approach is correct

wet breach
#

why would you need a hashmap for 2 objects?

topaz atlas
#

Edgar said that you would have the class registered with a hashmap or set

chrome beacon
#

He probably assumed you wanted more than one duel

wet breach
#

oh, one of the classes to hold the duel objects right yeah

topaz atlas
#

Well I wanted to reset everything after a duel occured

#

i been having issues with that

wet breach
#

what exactly is everything?

#

or what is needing reset?

topaz atlas
#

seems that one player is always null, while the other is always full

#

after the first event

#

the first event works fine

#

then whenever you click a sign

wet breach
topaz atlas
#

it assumes your player 2

topaz atlas
wet breach
#

you do realize that variables in an object go away when said object goes away

wet breach
#

a class, is an object

keen ferry
#

Is there a way to make shulkers not interactable? Like making an armor stand a marker.
I'm using them to make a chest glow, but because of the shulker, I cannot open the chest

topaz atlas
wet breach
#

see

#

you have a lack of understanding

#

as I said

topaz atlas
#

yeah, i dont get what your saying

wet breach
#

Because you don't understand object oriented programming yet

topaz atlas
#

"go away"

wet breach
#

I am not talking about anything advanced

topaz atlas
#

is there another term?

#

like, when spigot registers events, are new instances of the class created at diffrent moments

#

is that what your talking about?

wet breach
#

you can have more then one object of a class. A class doesn't just exist only just 1 at a time

topaz atlas
#

right, so, currently the same class is remaining, which is a issue, i want everthing to reset

wet breach
cunning shard
wet breach
#

the event class should only be used to initiate the start of or the creation of your object invoking it through your manager class

cunning shard
topaz atlas
wet breach
#

well, its just not organized properly is all

#

you should have a manager class which will hold the hashmap of all the duels

#

then you will have a class that is the duels. It should take in as parameters 2 player objects as you are wanting

topaz atlas
#

the manager currently is signevents and the duel class is duels

wet breach
#

then in your event class, it should create those duel objects as well as possibly having an event initiate the destruction of said objects

topaz atlas
#

I have to adjust it to fit my code lol\

topaz atlas
#

then

#

when the second player clicks

#

it loads the second player and starts it

wet breach
#

The purpose of the manager class here is just to hold the collection really and maybe have some convenience methods in relation to said collection

wet breach
topaz atlas
#

I recreated that scrture with my code, I need to add in the rest tho, like the events, your code was a broad outline. I need help here to construct the fundamentals

topaz atlas
#

two seprate events will occu

wet breach
#

so, to make this possible you need to have a list in the manager class that gets set when a player clicks a sign then

#

your event should check this to ensure the player isn't already in there, if not add them

topaz atlas
wet breach
#

hashmap

topaz atlas
#

yeahm hashmaos have keys

wet breach
#

since order is not really needed here you don't need a set

scenic onyx
#

Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "/playergui " + p.getName()); dont found

smoky anchor
wet breach
#

but hopefully as I am telling you this though, it is clicking how the classes are organized and work together

#

but still keeping logic contained so it doesn't interfere with each other

#

you should end up with a class where the variables you are wanting so called reset, is a non-issue because they go away as soon as the object is not needed no more

keen ferry
wet breach
#

IE the duel ended, so a duel object is gone

topaz atlas
#

is this a good start?

wet breach
#

why UUID?

topaz atlas
#

i was thinking about putting the players uuid there

wet breach
#

I suppose uuid works

#

for now

#

hard part is unique id's

#

can't have more then 1 of a key

topaz atlas
wet breach
#

unless you mean just make a UUID for the duels

topaz atlas
#

for checking if something is already in the map

#

first

wet breach
#

the pitfall of this is that at some point you need to wrap around

#

well, you are constantly incrementing

#

that works until you hit the limit

#

no they shouldn't

#

if you have to restart your mc server everyday then you have issues that need to be addressed

#

I ran MC servers without restarts for months at a time

#

well it does hurt sometimes because you lose whatever optimizations the JVM and OS have done for the program while it was running and now needs to restart that process

#

yeah because you have something going on that shouldn't be

#

either a badly coded plugin or something else

topaz atlas
#

it is to start

wet breach
#

because your duels class should have the 2 players already

#

can't add a duel object if it doesn't have what is required to create the object in the first place

#

this is why I said the duels object should have 2 player objects as parameters

topaz atlas
#

then starts

wet breach
#

and maybe a safety check to ensure that both objects are not the same player to prevent some weird bugs accidentally ๐Ÿ˜›