#help-development

1 messages · Page 472 of 1

icy beacon
#

a toilet

#

:wheeze:

young knoll
#

Production is a controlled environment

echo basalt
#

one thing is testing mission critical code that can fuck with your database

young knoll
#

Because I control it

echo basalt
#

another is just... making a test command and testing it yourself

#

if you're writing production code I assume you know what it does

livid dove
#

Fuck that. Nasa blew up 100 mil of rocket engines randomly changing the hole design of a faulty part till they solved a problem.

The whole world is full of bodge jobs lol

icy beacon
#

lmao

young knoll
#

Duck Tape and prayers

icy beacon
#

if it works don't touch it

young knoll
#

Or duck tape and dreams if you prefer

icy beacon
#

flex tape? no?

echo basalt
#

if your only point if reference is a nasa problem then idk what to feel

fickle mortar
#

incompatible types: int cannot be converted to org.bukkit.Material

Can someone help me?

icy beacon
#

you can't convert int to material

young knoll
#

Speaking of what is an int

icy beacon
#

naturally

wise mesa
#

Show us the code

young knoll
#

An int is not a material

icy beacon
#

?nocode

undone axleBOT
#

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

livid dove
#

Did u guys know they accidentally incinerated the apollo 11 flag on takeoff but never admitted it publicly?

U can tell it happened as they added a "put the flag X number of ft away from the lander" mission parameter into future mission briefs lol

fickle mortar
# wise mesa Show us the code
public static Double getPrices(LojaEnum type, Sign sign) {
        String[] linePrice = replace(sign.getLine(2)).toLowerCase().split(":");
        if (type.equals(LojaEnum.COMPRAR)) {
            if (linePrice[0].contains("c")) {
                return Double.valueOf(linePrice[0].replace("c", ""));
            } else if (linePrice.length == 2) {
                return Double.valueOf(linePrice[1].replace("v", ""));
            }
        } else if (type.equals(LojaEnum.VENDER)) {
            if (linePrice[0].contains("v")) {
                return Double.valueOf(linePrice[0].replace("v", ""));
            } else if (linePrice.length == 2) {
                return Double.valueOf(linePrice[1].replace("v", ""));
            }
        }
        return 0.0D;
    }

    public static ItemStack getItemLoja(String[] lines, LojaConfig loja) {
        if (replace(lines[3]).matches("^[1-9](\\d)*(#(\\w){4}){1}(\\s|$)")) {
            return loja.getCustomConfig().getItemStack("itens." + replace(lines[3]));
        }
        if (replace(lines[3]).matches("^[1-9](\\d)*(:(\\d){1,2}){1}(\\s|$)")) {
            String[] valores = replace(lines[3]).split(":");
            int idType = Integer.parseInt(valores[0]);
            byte dataId = Byte.parseByte(valores[1]);
            return new MaterialData(idType, dataId).toItemStack();
        }
        if (replace(lines[3]).matches("^[1-9](\\d)*(:(\\d){3,5}){1}(\\s|$)")) {
            String[] valores = replace(lines[3]).split(":");
            int idType = Integer.parseInt(valores[0]);
            short dataId = Short.parseShort(valores[1]);
            ItemStack item = new ItemStack(idType, 1);
            item.setDurability(dataId);
            return item;
        }
        int idType = Integer.parseInt(replace(lines[3]));
        return new ItemStack(idType, 1);
    }
young knoll
#

They also accidentally overwrote the original moon landing footage

livid dove
#

Lmao

#

They also blew up a Mars rover mission because they didn't convert from metric to imperial properly

wise mesa
young knoll
#

I bet it’s the last one

fickle mortar
wise mesa
#

So

#

When you’re creating the item stack

#

You’re passing an integer in where it’s expecting a Material enum

young knoll
#

e-nun

wise mesa
#

That was a real struggle

#

There are no numeric ids since 1.13

livid dove
#

Btw... adding to ur plugin a custom color for DARK_AQUA is as silly as it sounds right?

young knoll
#

I really hope this is at least 1.8

wise mesa
#

Everything has a name now

young knoll
#

Where numeric ids were still a thing

wet breach
young knoll
#

Yes

wise mesa
#

Very holy

fickle mortar
livid dove
#

I'm going to bed as deadass I'd love to stay and help but Xms profile picture is legit nightmare fuel and I'm about to head tk bed 😭🤣

rain sierra
#

yo, coding in kotlin, have an issue with storing the damages players have done to specific bosses, there may be multiple bosses at one time so they are differentiated via UUID, heres how i initialize the hashmap containing the damages.

First UUID is the boss's UUID, second is the player/damager, Int is their damage done.

var damageHashMaps = HashMap<UUID, HashMap<UUID, Int>>()

here is how im trying to add on their damage, when they do damage (sloppy because ive honestly been trying everything)

damageHashMaps[victim.uniqueId]?.set(damager.uniqueId,
  (damageHashMaps[victim.uniqueId]?.get(damager.uniqueId) ?: 0) + event.finalDamage.roundToInt()
)

no matter what it seems like its never adding on the damage im doing, it always says i've dealt null damage, which im tracking via two statements,

// INITAL DAMAGE DONE
damager.sendMessage(convertColorCodes("&cYou did ${event.finalDamage.roundToInt()} damage | TO: ${victim.uniqueId}", false))

// Statement above is here

// TOTAL DAMAGE DONE
damager.sendMessage(convertColorCodes("&cYou've dealt ${damageHashMaps[victim.uniqueId]?.get(damager.uniqueId)} damage | TO: ${victim.uniqueId}", false))
#

if you want sses of whats showing in chat, dm me

lost matrix
#

I wouldnt round raw data like that. Round it when its being displayed but keep its precision in the backend.
Im assuming your problem is here:

damageHashMaps[victim.uniqueId]?.set(

Do you put the victim in the map at any point?

#

I would use computeIfAbsent for that

lost matrix
#

This solves the problem of you having to manually put values in the map.
It just computes them if they are not present or null

echo basalt
#

ew kotlin

#

this is cursed

rain sierra
#

i really wanna learn java plugin development, im using kotlin to kind of get the basics of plugin development beforing jumping into java

#

ykwim

lost matrix
#

...

rain sierra
rain sierra
lost matrix
#

You shouldnt jump from kotlin into java.
If you start with kotlin then you are missing the biggest selling point of it.
Why dont you start with java in the first place?

#

Then you can jump into kotlin

rain sierra
#

dont people always recommend java over kotlin?

jagged monolith
#

Not always. A lot of people prefer Kotlin, but I've always really just used Java, an only a tiny bit of Kotlin

rain sierra
jagged monolith
#

I honestly think it more comes down to personal preference.

lost matrix
#

Depends on the community. But kotlin has a lot of features that kind of
rely on you knowing a more verbose and explicit language like java.

rain sierra
#

oh wait sorry

#

i do know java

#

just not java plugin development

jagged monolith
#

If you want to use Kotlin, it's upto you. It is widely used, but java itself is more common

lost matrix
#

Ok but literally all resources on spigot plugin dev are in java... Now it makes even less sense

rain sierra
#

im very new to plugin dev so i decided to dip my feet into it with kotlin

rain sierra
lost matrix
jagged monolith
#

Personally, Id recommend starting with Just Java until you get a good grasp on plugin dev.

rain sierra
#

thats how i learned

wet breach
#

whether you use kotlin or java doesn't really matter, it gets compiled to bytecode the same

river oracle
#

it definitely affects how much help you can recieve though especially for plugin dev

jagged monolith
#

Currently, I mostly just use kotlin in build files and mostly java for everything else 😛 Not ideal probs, but Kotlin build files are clean 😛

lost matrix
#

kotlin build files.. (?)
You speaking about using kotlin DSL for gradle?

jagged monolith
#

Yeah 😛 I haven't done much else with kotlin apart from that

#

Not yet anyway

rain sierra
jagged monolith
#

I'll get there one day...

lost matrix
#

Ah ok. Yeah i also dont like groovy. So Kotlin there all the way.

rain sierra
#

kotlin dsl gradle files are so sexy

jagged monolith
#

I went from maven, to normal gradle, to kotlin, and won't go back. Kotlin DSL is quite nice

wet breach
#

I just don't bother with all that

#

java and maven have been sufficient

jagged monolith
#

Apart from looks, i've found Kotlin DSL to build quicker and give a little better performance as well as reducing build file size

rain sierra
#

btw @lost matrix worked perfectly, thanks a ton

wet breach
jagged monolith
#

Noone 😛 But smaller file sizes are always better ;P

wet breach
#

not necessarily

#

means more for the compiler to interpret or something in between to do it

jagged monolith
#

It's mostly just the readability and performance mostly that I like Kotlin DSL for.

wet breach
#

maven and gradle are performant too

#

it just depends if you know either of them well enough

lost matrix
jagged monolith
#

That's true. I came from using maven non stop, so I won't ever deny it's usability. or force people to change. Both are good. I am just more comfortable with gradle (kotlin DSL) now.

wet breach
#

thats fine, seems it clicks for you with gradle

#

and that is really the issue sometimes and why we have so many varieties 🙂

jagged monolith
#

Plus, you can't deny, kotlin dsl files do look way better 😛

wet breach
#

I don't use kotlin

lost matrix
#

Show the stack trace

jagged monolith
#

?paste Then paste it.

undone axleBOT
lost matrix
#

If its long then its probably a stack overflow

#

InventoryOpenEvent -> open inventory in it -> InventoryOpenEvent -> open inventory in it -> etc

#

Pretty clear

sullen marlin
#

The code is shocking, but setting clickedCrafting to false before calling openInventory would fix that particular issue

lost matrix
#

My guy you have been here for years on end.

#
            if(clickedCrafting) {
                clickedCrafting = false;
                event.setCancelled(true);
#

This is the fix suggested by md

#

Im also working on guis right now hypers

river oracle
#

woooo

river oracle
lost matrix
#

Let me check what you mean ingame

#

Which line?

lost matrix
river oracle
#

I always see it with default inventories

#

maybe I'm halucinating

lost matrix
#

Oh yeah. The texture completely overlays the inventory

river oracle
#

oh okay

lost matrix
#

But there is nothing here anyways

#

Send the full stack trace

river oracle
#

you can't put an element in a 9thg slot in an array if it doesn't have a 9th slot

remote swallow
#

BettaCore

remote swallow
#

abstract is fun

exotic oriole
#

Hello! Is there any good way to create a menu and show the menu to a player from a bungeecord plugin? without having any spigot plugins..

abstract sorrel
lost matrix
lost matrix
# abstract sorrel Does anyone know why my nms npc plugin isn't working, when i run the command it ...

First of all: What is the point of passing a player if you loop over all players on the server anyways?

    public void spawn(Player player) {
        System.out.println("Looping");
        for (Player p : Bukkit.getOnlinePlayers()) {
            System.out.println("Looped");
            CraftPlayer cp = (CraftPlayer) p;
            ServerPlayer sp = cp.getHandle();
            ServerGamePacketListenerImpl packetListener = sp.connection;

            packetListener.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, npc));
            packetListener.send(new ClientboundAddPlayerPacket(npc));
        }
    }
quaint mantle
abstract sorrel
#

oh yeah i should remove that

lost matrix
#

That is probably your problem

abstract sorrel
#

no its not because when i go to 0 0 0 even if i join the npc still doesn't appear

lost matrix
#

So the npc appears on command but not if you rejoin?

abstract sorrel
#

yes if i do the npc command it does but when i rejoin it doesnt appear

lost matrix
#

What about your debug messages?

abstract sorrel
#

none of them trigger for some reason

lost matrix
#

This means Data.npcs is empty

abstract sorrel
#

but idk how it could be empty if an npc is added to it when the command is run

lost matrix
#

There is so much to unpack here to be honest.

exotic oriole
lost matrix
abstract sorrel
#

oh my god i'm so fricking stupid

#

i removed the add to npcs list when i was changing the code to work with an NPC class

lost matrix
#

Cool, so thats solved.

abstract sorrel
#

what were you suggesting about cleaning up my code btw

lost matrix
#

But for the future:

  • Never make anything that has a state, static. For example: List, Map, Set etc. <- Never static
  • Never expose collections. No getter or setter for Lists, Sets, Maps etc. Ever. No exceptions.
lost matrix
# abstract sorrel what were you suggesting about cleaning up my code btw

Here is an example for a basic manager class:

public class NpcManager {

  private final Map<UUID, NPC> npcMap;

  public NpcManager() {
    this.npcMap = new HashMap<>();
  }

  public void addNpc(NPC npc) {
    npcMap.put(npc.getUniqueId(), npc);
  }

  public void removeNpc(UUID npcId) {
    npcMap.remove(npcId);
  }

  public NPC getNpc(UUID npcId) {
    return npcMap.get(npcId);
  }

  public List<NPC> getAllNpcs() {
    return List.copyOf(npcMap.values());
  }

}

You should create one instance of this in your onEnable() and then pass
this instance around.

abstract sorrel
#

@lost matrix i found the problem, i forgot to add the ```@EventHandler

terse socket
#

Error occurred while enabling money v1.0.0 (Is it up to date?)
java.lang.NoClassDefFoundError: org/bson/conversions/Bson

#

Could not load 'plugins\MainPlugin-1.0-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: com/mongodb/ConnectionString

lost matrix
#

Forgot to shade in the mongodb driver

terse socket
#

what about the bson error

lost matrix
#

Bson is part of mongodb

#

Its how data is structured in there. Binary-Json = Bson

terse socket
#

Oh alright

#

Thanks

sacred wyvern
#

Thank you to everyone here that's helped with advice on Spigot the last month and half. I completed a ChatGPT based plugin for Inworld.AI built out and running an Alice in Wonderland themed world.

pine lake
#

Hello, how can run my test server from Intellij?

remote swallow
pine lake
#

Ah thank you !

lost matrix
#

Like you read variables out of array anywhere else

remote swallow
#

why cant you

lost matrix
#

So? You can nest infinitely many for loops

remote swallow
#

alex you rlike 6 hours late

#

and they already got answered lol

tender shard
#

Idk md pinged me so i sent it

remote swallow
#

fair

#

they came back like 3 or so hours later asking why it didnt work

#

they had it in the compiler plugin

tender shard
#

Why no workings

eternal oxide
tender shard
remote swallow
#

reading is hard

lost matrix
#

This makes very little sense...

#

What are you trying to do

#

Create a set of integers that should be ignored.
Iterate over all slots and dont fill those in the set.

glossy venture
#

u using empty as the index

#

i assume you need cg

#

as the index into the inventory

tawdry echo
#

how can check if itemstack can be 'repair'

eternal oxide
#

check it's damage

tawdry echo
#

0 is full, si?

eternal oxide
#

there is a hasDamage() method

sullen marlin
#

Material#getMaxDurability?

tawdry echo
#

so when item is any planks or some else items then maxdurability be 0?

hazy parrot
#

Why not try and see

tawdry echo
#

already work

misty ingot
#

any better ways to store a list in a mysql db than TEXT and String.valueOf(List)?
basically want to store a list of material names for ex FISHING_ROD, COMMAND_BLOCK, etc.
but only a few

eternal oxide
#

depends on your database setup, but generally no

tawdry echo
#

one collection with empty slots and and loop for each space in inventory and if collections dont contain slot then set itemtack

#

and for the future Inventory#firstEmpty return -1 when there is no free space

tawny remnant
lost matrix
tawny remnant
#

i does have a bow that is just an example

misty ingot
#

AI issue?

rustic pecan
#

Hello everyone, I just have a problem with the rotation of a player head. I'm trying to set the rotation with the following code:


                block1.setType(mBlock.getMaterial());
                block1.setData(mBlock.getData());
                BlockState state = block1.getState();
                Skull skull = (Skull) state;
                skull.setSkullType(SkullType.PLAYER);
                skull.setOwner(mBlock.getPlayerName());
                skull.setRotation(BlockFace.EAST_SOUTH_EAST);
                skull.update();

Unfortunately, the head just does not get any rotation.

rustic pecan
cedar turtle
#

is there a way to get the world from OfflinePlayer?

chrome beacon
#

You could try to read the players save data

cedar turtle
#

or is that only possible with nms?

ornate mantle
#

is there a way to only register full strength hits?

chrome beacon
#

There's no api method for this so yeah nms

cedar turtle
icy beacon
#

?whereami

lost matrix
ornate mantle
#

alr

shadow night
#

how do I add comments in my config

jagged monolith
#
// = single line comment

/*


*/ = MUlti line comment
remote swallow
#

thats java

#

is yaml

eternal oxide
#

or .addComment after using .set to add a Section

remote swallow
#

there isnt a need to tag it imo

#

you should hopefully know whats in everyslot

#

so just keepa set or something with the slots they can access

eternal oxide
#

paste teh full code

ornate mantle
#

LOL

#

i was struggling with making a custom crafting table just like this

eternal oxide
#
if (itemInHand.getType() == Material.matchMaterial(config.getString(itemPath + ".material"))) continue;```
#

not valueof

misty current
#

can I get the path from a file to another? let's say i have a file with path config/test/file.yml and config, can I somehow get test/file.yml?

regal scaffold
#

?…

misty current
#

i need the string test/file.yml in this case

eternal oxide
#

if you have the file you can go up the parent

misty current
#

basically i need to call plugin.saveResource and I have the File object, but the method takes in a local path from your config folder

eternal oxide
#

saveResource gets the resource you specify the path for. It saves into your plugins data folder maintaining teh full path from your jar

warm mica
young knoll
#

It’s not new

paper venture
#

Hello how can I make tab show all vanish players?

naive bolt
#

Is it possible to list all the biomes the server has. even custom ones from mods and things

young knoll
#

Not with the api sadly

livid dove
#

The app im making will be able to Soon 😎

young knoll
#

Once the PR to remove the old enums is merged you will be able to

ocean hollow
serene sigil
#

how do u fill a large area with blocks? can you also randomly add other blocks ?

eternal oxide
#

?workdistro

young knoll
# ocean hollow

Random does not have a method that takes a lower and upper bounds

#

However ThreadLocalRandom does

misty ingot
#

I need help coming up with better lore

#

I want to roast the shit out of the player

icy beacon
#

please mind your grammar or you're the one getting roasted

#

"it's"*

ocean hollow
#

like this?

icy beacon
#

looks good to me

vocal cloud
serene sigil
# eternal oxide ?workdistro

no, its ok if there is a big lag spike, cuz i need to fill it in only when the world loads (so players cannot join there)

#

basically, i want to make a big 100x100 stonbe square

young knoll
#

nested for loops

#

over x y and z

serene sigil
#

but i dont need the workdistro thing there right?

tall dragon
#

100x100x1?

serene sigil
#

no a cube

#

100x100x100

tall dragon
#

o well if u dont mind the lagg spike u dont need it

#

u will probably experience one tho

serene sigil
#

again, its ok cuz its on worldload

tall dragon
#

u can greatly improve performance by using a specific way to set the blocks tho

#

if thats something u want u could look into that

serene sigil
#

wait and how do u set a block?

tardy delta
#

World#setBlock

serene sigil
#

👌

tall dragon
tardy delta
#

ik

tall dragon
#

might be fine for his use case tho

young knoll
#

Not really

misty ingot
#

is there a way to have tab completion in acf from an ArrayList instead of the stupid ass "*" which doesnt actually do anything

tardy delta
#

register it

serene sigil
young knoll
#

Setting a block with no physics is nearly as fast as you can go

tardy delta
#

commandManager.getTabCompletions().registerX or smth

young knoll
#

Other than like, writing directly to the region files

misty ingot
tall dragon
serene sigil
#

ok

tall dragon
#

u can just set with no physics and u will be fine

hushed scaffold
#

is there a way to add a fake player to the tab list? i dont need a real player entity in game , just a name showing up in the tab list , how would i do that?

hushed scaffold
hushed scaffold
#

your not helpful

sacred mountain
#

guys is the spyglass overlay fully clientsided

tall dragon
#

chill man

tall dragon
sacred mountain
#

hm, is there a way to simulate a spyglass event for instance if i have a server resource pack

#

are there any other vignettes/overlays

#

that can be triggered by the server

tall dragon
#

yea, underwater. idk if that can be triggerted by server tho

young knoll
#

pumpkin

sacred mountain
#

oooh yeah

tall dragon
#

oh yea pumpkin is a good one

sacred mountain
#

good call

#

does that require the item on the head or can i send that through packets

#

time to do some googling

#

found something useful

craftPlayer.getHandle().b.a(new PacketPlayOutSetSlot(0, 0, 5, CraftItemStack.asNMSCopy(itemStack)));```
young knoll
#

Idk if that works on itself

#

But yeah

#

Yeah you can do that with fonts

#

And yes all textures are pngs

#

mhm

misty ingot
#

@tardy delta so how do I get the args for tab completion now? what will the tab completor consider as args and what will it consider as the command

tardy delta
#

target and amount are args

#

look at the docs tho

worldly ingot
#

If this is ACF, there's an annotation for that too, no?

#

At least from my once or twice use of it

tardy delta
#

@CommandCompletion?

worldly ingot
#

idk

#

I hate annotation command frameworks. They're string magic

tardy delta
#

i hate the large amounts of annotations that you'll have to add

misty ingot
#

@CommandCompletion exists but the issue is that you have to add every arg manually like this
@CommandCompletion("a|b|c|d") so I dont think I can have a list of all OfflinePlayer(s) there like in normal tab completion

tardy delta
#

register it

#

what it should return

worldly ingot
#

CompletionProvider or something like that. I dunno. It's been like 8 months since I've worked with ACF and I still hate it

serene sigil
#

any idea why its not generating anything? i put it in the method where i generate my world

river oracle
#

How NPC plugins generally work with spigot e.g. what kinda of entity do they spawn In. I've never worked with any NPC plugins. e.g. do they tend to extend HumanEntity for NPCs or something else?

hard socket
serene sigil
#

wdym?

lost matrix
serene sigil
lost matrix
#

Your center is at 0, 0, 0 in the world.
Did you tp there and check?

serene sigil
#

wdym center?

#

its a normal world

lost matrix
#

Also: Location#add() mutates the location.
So use

center.getBlock().getRelative(x, y, z).setType(Material.STONE)
lost matrix
#

Yes

serene sigil
#

btw the world variable is just Bukkit.getWorld("world")

lost matrix
#

Probably even better to get the center block only once

Location center = new Location(world, 0, 0, 0);
Block centerBlock = center.getBlock();

...
centerBlock.getRelative(x, y, z).setType(Material.STONE);
lost matrix
lost matrix
#

Sure

lost matrix
#

Well not a sphere. Should be a cylinder there

serene sigil
#

oh

#

yea actually i also realized tht

#

how can i fix it?

lost matrix
#

Depends on what you are trying to do

serene sigil
#

a cube that has 10% air and that goes from bedrock to y100

lost matrix
#

For a cube you dont need the distance calculation.
If you remove that then you dont get a cylinder but a cube

serene sigil
#

remove what?

lost matrix
#

Well not a cube

#

A cuboid

serene sigil
lost matrix
serene sigil
#

so like this?

lost matrix
#

Yeah. And dont forget formatting your code

serene sigil
#

right

#

uh oh

paper venture
#

Hello how can I show all vanished players in tablist?

#

I mean vanish should not hide them

#

In tablist

earnest lark
#

whats the function for sine and cosine

lost matrix
lost matrix
earnest lark
#

it no work

paper venture
tawny remnant
#

Math.cos ig

lost matrix
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.

earnest lark
#

oh i didnt uppercase the m in Math

tawny remnant
#

no worries

paper venture
#

I meant specially for tablist

serene sigil
paper venture
#

But anyway thanks

lost matrix
misty ingot
#

is there a way to remove that lore from the item and just have blank lore which I can edit to only have lore I want it to have

lost matrix
serene sigil
#

it needs to be one up

#

cuz it cuts through bedrock

tawny remnant
#

then just add lore

misty ingot
#

nois

misty ingot
worldly ingot
#

Guess not

#

Maybe it was a custom annotation or something at the server I was working with

misty ingot
#

w

#

c

desert tinsel
lost matrix
# misty ingot @CommandCompletion exists but the issue is that you have to add every arg manual...

You need to register a command completion with a key.
For example
Register context resolver for your class

    commandManager.getCommandContexts().registerContext(ActiveCollegeUser.class, context -> {
      String arg = context.popFirstArg();
      return activeCollegeUserManager.getByName(arg);
    });

Register completion with an ID

    commandManager.registerCommand(new TeleportCommand());
    commandManager.getCommandCompletions().registerCompletion("ActiveCollegeUser", context -> {
      return activeCollegeUserManager.getUserNames();
    });

Use completion ID with @ prepended

  @Subcommand("here")
  @CommandCompletion("@ActiveCollegeUser")
  public void onTpHere(Player sender, @Values("@ActiveCollegeUser") ActiveCollegeUser target) {
    TeleportManager teleportManager = CollegeCore.getTeleportManager();
    ...
  }
echo basalt
#

if you change how the jank works underneath you'll obviously have issues

#

Realistically there's no way to detect chat length

serene sigil
# lost matrix Nice

is there a way to add some kind of data to blocks? basically i want the blocks generated from the cube to be different then other stone blocks so if u beak them you can detect that

lost matrix
serene sigil
#

yes but i dont want players to place stone and mine them

#

inside the bb

lost matrix
serene sigil
#

oh so u cannot do that just in spigot itself?

lost matrix
#

Nope. Blocks dont have any kind of data storage unless they are TileStates

earnest lark
#

is there a way to make a Location into all of its seperate parts

plush nest
#

Guys I’ve literally been trying to learn how to code guis for a day and I still can’t

serene sigil
lost matrix
lost matrix
earnest lark
#

ok yes but i want to make a variable that is a location but with modified elements for something like setting a block to a specific location

lost matrix
earnest lark
#

yea

#

but like

#

wait

lost matrix
# earnest lark but like
Location other = oldLocation.clone().add(10, 0, -3);
other.getBlock().setType(Material.STONE);
#

No idea what you are trying to do

quaint mantle
#

Hello i hope you're doing well.

How do I make "named" fake entity in Protocollib in 1.19? (Not on packet event listener, i want to name my fake entity when i spawn)

#

I couldn't find how to name my fake entity via protocollib in 1.19

#

thank you in advance!

lost matrix
# quaint mantle I couldn't find how to name my fake entity via protocollib in **1.19**

Just send a metadata packet with a changed name

  private PacketContainer createDataPacket() {
    PacketType type = PacketType.Play.Server.ENTITY_METADATA;
    PacketContainer packet = ProtocolLibrary.getProtocolManager().createPacket(type);

    packet.getIntegers().write(0, this.entityId);

    WrappedDataWatcher.Serializer byteSerializer = WrappedDataWatcher.Registry.get(Byte.class);
    WrappedDataWatcher.Serializer chatSerializer = WrappedDataWatcher.Registry.getChatComponentSerializer(true);
    WrappedDataWatcher.Serializer boolSerializer = WrappedDataWatcher.Registry.get(Boolean.class);

    List<WrappedDataValue> dataValues = new ArrayList<>();

    Byte flags = 0x20;
    dataValues.add(new WrappedDataValue(0, byteSerializer, flags));

    Optional<?> optChat = Optional.of(WrappedChatComponent.fromChatMessage(this.text.replace("&", "§"))[0].getHandle());
    dataValues.add(new WrappedDataValue(2, chatSerializer, optChat));

    Boolean nameVisible = true;
    dataValues.add(new WrappedDataValue(3, boolSerializer, nameVisible));

    Byte armorStandTypeFlags = 0x10;
    dataValues.add(new WrappedDataValue(15, byteSerializer, armorStandTypeFlags));

    packet.getDataValueCollectionModifier().write(0, dataValues);

    return packet;
  }

Example for armorstand with some other stuff added

quaint mantle
#

ohh thank you for long reply i'll try!

sullen canyon
#

I need some mcp gurus which can explain why when you modify minecraft client side code to hit over 6 blocks minecraft doesn't let you

#

hits simply don't register

lost matrix
sullen canyon
#

wha

#

no even in a singleplayer world

#

well actually this thing happens on servers without anticheats and plugins

lost matrix
#

Did you extend the ray trace?

sullen canyon
#

so I thought people here would know

sullen canyon
#

poorly explained because I don't have the code atm

#

since I am not at home

quaint mantle
#

in 1.19 Protocollib

lost matrix
#
  1. Never make collections static.
  2. Never make collection public.
  3. Never write getters or setters for collections.

It makes your code, really, really fragile and you will spend
hours fixing bugs that originate from this.

lost matrix
sullen canyon
#

just wondering

lost matrix
#

I mean that you should never write getters or setters for collections.

sullen canyon
#

like public List<String> getArray() {
rrturn array;}

lost matrix
#

Here is your fix btw

                for (UUID uuid : List.copyOf(queuedPlayers)){
                    String server = serverQueued.get(uuid);
                    removeFromQueue(uuid);
                    Bungee(Bukkit.getServer().getPlayer(uuid), server);
                }
#

Explanation: You can not modify a collection while iterating over it

lost matrix
quaint mantle
quaint mantle
#

oh my bad ima change it to 4.8.0

#

just saw github readme and thought it was the latest

#

Hmm i changed to

    implementation group: "com.comphenix.protocol", name: "ProtocolLib", version: "4.8.0";

#

but still I dont have tht

lost matrix
#

You just create on single instance in your onEnable and then pass this instance around.
This will lead to much robuster design. This is one of the most important design rules.

#

What spigot and java version are you on?

#

ugh

#

?1.8

undone axleBOT
lost matrix
#

Then use the ArrayList constructor to copy the list

sullen canyon
lost matrix
desert tinsel
quaint mantle
lost matrix
quaint mantle
misty ingot
lost matrix
sullen canyon
#

chatgpt man

misty ingot
#

the class with the command in it?

lost matrix
#

experience. ConcurrentModificationExceptions only occurs in 2 cases:

  • Multithreading
  • Modifying a collection while iterating over it
quaint mantle
# lost matrix

uhm i did "com.comphenix.protocol", name: "ProtocolLib", version: "5.0.0"; and everything doesn't exists (like PacketContainer, Protocollibrary class)

#

it seems 5.0.0 doesn't work

lost matrix
#

Idk... Try registering the incoming channel as well

quaint mantle
misty ingot
#

oh god it took me 3 tries to find it

#

its a c to C in bungeecord

wise mesa
#

i have a bit of a conundrum

#

er actually

#

wait can I do JavaPlugin#getPlugin with an interface?

misty ingot
#

is there a way to just grab the names of these items from this entire thing somehow? (the list of items can be infinitely long)
I do not care about the content inside or outside, just the names of the items in a nice little list

lost matrix
#

Get the "items" sections and call .getKeys(false) on it

tardy delta
#

beat me

wise mesa
fallen fjord
#

how do i make it so a particle is always 1 block in front of the player?

wise mesa
#

I was going to use a registered service provider for other plugins to get that interface

#

but you can't do that in onload

#

and I need it to happen then

#

and I can't have a singleton inside of an interface

lost matrix
quaint mantle
#

Hello, I'm wondering if Plugin Message Channel (like giving information from bungeecord to spigot or spigot to bungeecord) uses many resources

#

I have implemented Level system in bungeecord plugin and i'm getting level from bungeecord plugin via plugin message channel

Also, would it better to implement money/hologram/level/profile system in bungeecord plugin or spigot plugin?

lost matrix
lost matrix
quaint mantle
lost matrix
#

Then put those plugins on every server

lost matrix
misty ingot
quaint mantle
#

wouldn't it better to just put level system in 1 single bungeecord plugin?

misty ingot
#

I know getString, get, etc. none really give me a yamlconfig object

fallen fjord
# lost matrix Show me what you have tried so far
Location location = player.getLocation();
            Vector facing = location.getDirection().normalize().setY(0);
            Vector normal = facing.crossProduct(new Vector(1, 0, 0));
            normal.normalize();
            Location loc = location.clone().add(normal);
lost matrix
lost matrix
twilit roost
#

how would one make PVP Bot?
Server-side

wise mesa
#

so other plugins have to register before that

young knoll
#

Can you not run it one tick after enable

lost matrix
wise mesa
#

server will crash

#

watchdog

wise mesa
wise mesa
#

I just don't feel like it today

#

its not the day for that

quaint mantle
#

TLDR; Would it better to implement level/profile/hologram system(Same system on every servers) in bungeecord plugin or spigot plugin?

misty ingot
#

current status of the next MineMemer commit
tons of stuff coming 😉

#

most important of which, the ability to actually use the plugin

rough ibex
#

you release entire updates as 1 commit?

misty ingot
#

not exactly an "update"

#

the plugin version is currently vBeta -0.8 for a reason

#

half of that is fixes

#

also to answer your question, yes

#

vbeta -0.7 gonna be a big one

ocean hollow
#

InventoryHeldEvent. What should I get? How can I get Item from previous slot?

#

like, it gives 0-8? or position in inventory?

young knoll
#

0-8 iirc

serene sigil
young knoll
#

You can just use getItem

serene sigil
twilit roost
#

Hey!
I have strange instancing problem, where suddenly (without manipulating collections) the number of total instances in pool drop to 0

and I can't figure out why.
The code is long, so if anybody is interested in bug finding, please DM me :)
thx

vocal cloud
#

Why not just send a GH link or paste it

young knoll
#

?paste

undone axleBOT
desert jungle
#

Hello. Can you tell me why I can't find DustOptions?

young knoll
#

Version?

desert jungle
#

1.12.2?

vocal cloud
#

That's probably why

desert jungle
#

That is, on this version I am without the ability to customize the display of the particle in my own way?

young knoll
#

Packets

fervent robin
twilit roost
# vocal cloud Why not just send a GH link or paste it

welp GH is private but I can provide some code
[dont mind the shitty code rn, im trying to fix instancing for like week and I rewrote it x times]

WorldInstance - https://paste.md-5.net/ewiwusimig.java
Pool - https://paste.md-5.net/uyotipuveq.cs
StressInstancing ( just so I get those debug variables quicker) - https://paste.md-5.net/jivefuvihe.java

Results from the Stress [second iteration, first always fails at 4th]:

  • for some reason the server restarted itself
desert jungle
young knoll
#

What

desert jungle
young knoll
#

Use NMS to send a packet directly

serene sigil
young knoll
#

Oh wait no looks like you can do it with the API in 1.12

#

It's just jank

desert jungle
young knoll
#

loc.getWorld().spawnParticle(Particle.REDSTONE, loc.getX(), loc.getY(), loc.getZ(), 0, red,green, blue);

desert jungle
#

but seriously, it's so simple thx

twilit roost
fallen fjord
#

not yaw

young knoll
#

Set the Y of direction to 0

#

(I assume you have pitch and yaw reversed )

eternal oxide
#

a particle spawned in front of a player but ignoring the yaw would be very wierd

#

yaw = player turning around

#

pitch is looking up and down

fallen fjord
#

like vector y?

desert spade
#

direction.setY(0).normalize()

lost matrix
desert jungle
#

and by themselves they are like a campaign and are responsible for offset, not color

young knoll
#

Yeah they are used for color in redstone

#

Because Mojang loves magic values

desert jungle
#

Fine...

#

also, the parameters inside the classes are so well named, the first time you can’t tell what some are responsible for

young knoll
#

¯_(ツ)_/¯

#

Legacy version legacy usage

earnest lark
#

by any chance is there any way to just get a way that a player is facing and using that in like vectors and things

#

?paste

undone axleBOT
earnest lark
young knoll
#

Head facing or body facing?

earnest lark
#

head facing

young knoll
#

getEyeLocation.getDirection

tawny remnant
#

How do I fix this? I want to use NMS in 1.19.4

eternal oxide
#

?nms

desert jungle
tawny remnant
eternal oxide
#

read it

rough ibex
#

yeah, read it

young knoll
#

What is reading

hard ether
#

quick question - would I have to add another plugin that is on the server as a dependency to access it? (which requires bundling it in my jar) Or would I just use PluginManager#getPlugin?

eternal oxide
#

getPlugin

#

you add it as a dependency but scope would be "provided"

hard ether
#

I have all my plugins in a parent directory. Would I just add this as a dependency in my parent POM?

  <groupId>mc.scorchfield</groupId>
  <version>1.0-Beta</version>
  <scope>provided</scope>
</dependency>```
#

and then in my ScorchCore pom I somehow override that?

eternal oxide
#

you should install it to your local maven

#

unless it's in a maven repo somewhere

hard ether
#

which I do how? I've tried using tutorials everywhere, but they don't work.

quaint mantle
#

I was wondering if anybody could tell me how you change keybinds for a plugin when there isn't any option I can see

eternal oxide
hard ether
eternal oxide
#

you don't

quaint mantle
#

so this says sneak in the description line but I don't want the ability to be sneak

#

Repulsion:
colouredName: <bold><black>Repulsion
description: When you sneak, entities are repelled!
skills:
repulsion:
skill: REPULSION
multiplier: 5 # set this to a negative number to attract.
radius: 3
entityBlacklist:
- ARMOR_STAND

eternal oxide
#

mvn install installs it to your mavenLocal

young knoll
#

You can't change that

hard ether
#

oh so not a run config.

#

got it

quaint mantle
hard ether
eternal oxide
#

no

#

these plugins you are hooking into are your own plugins (you built them)?

hard ether
#

yes

quaint mantle
#

conor is there any way i can change the keybinds somewhere?

hard ether
eternal oxide
#

then yes just build maven install

hard ether
#

what is that

hard ether
eternal oxide
#

yes

quaint mantle
# hard ether what is that

its a command that says its description is sneak to use but I don't want sneak and I don't know how to change it, the plugin in called Superheroes | Classes, Origins, Heros

hard ether
#

im very confused

#

first of all

#

did you make this plugin

quaint mantle
#

no

hard ether
#

ok what file is that in?

hard ether
quaint mantle
#

I can't screenshot irritatingly so it's hard to explain and im no expert with coding and stuff

hard ether
#

is it a file?

#

did you decompile the jar?

#

it looks like yaml

#

but i could be wrong

quaint mantle
#

i think so

#

hang on

young knoll
#

Spigot does not have any support for "keybinds"

tawny remnant
#

How do I call "WorldServer" in 1.19.3 NMS

hard ether
young knoll
#

The reason sneak is used is because that is one of the few buttons you can detect

hard ether
eternal oxide
#

no

young knoll
#

lol I wish

hard ether
#

damn

#

i bet if you made your players use a custom client you could implement that

young knoll
#

Well sure

hard ether
#

but that's too much

young knoll
#

But spout is dead

hard ether
golden turret
#

what does the Entity#getVelocity() means? It is the speed per second or per tick?

golden turret
eternal oxide
golden turret
#

i know it is a vector

regal scaffold
#

Is there a preferred way to run a .sql file in a plugin?

golden turret
#

I just wanted to know if it was second or tick

young knoll
#

Spout didn't survive so I doubt any attempts to remake it will last long

regal scaffold
#

Do I just use BufferedReader()

#

Is it possible to make a FileReader or reader from plugin.getResource()

humble tulip
#

Oh just a reader

regal scaffold
#

Reader

#

Yes

humble tulip
#

You can use an inputstreamreader

regal scaffold
#

There you go!

#

So that means I can get the file from resources without copying it to the folder, right?

humble tulip
#

Yep

regal scaffold
#

Amazing

#

Thanks!

humble tulip
#

np

elfin atlas
#

Is there a way to let a player walk automaticaly to a point?

hard ether
#

like

#

control the player?

earnest lark
#

i need a good intermediate command idea

serene sigil
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.

serene sigil
#

like it doesnt send the message

#

but it should

#

cuz i broke a non-player placed block

young knoll
#

Add debug statements

eternal oxide
#

why are you storing/checking BoundingBox ?

serene sigil
#

basically, in an area u can mine blocks and when u do it prints out that message, but if u place a block and mine it, it should not say the message

eternal oxide
#

you are not checking inside an area

#

you are checking your Collection has the specific BoundingBox of that Block

#

is cionMine a BoundingBox itself?

serene sigil
#

yea

eternal oxide
#

ok makes more sense

serene sigil
young knoll
#

You can check if it contains a vector instead

serene sigil
#

ITS JUST THE LAST IF STATEMENT

young knoll
#

I doubt that is the issue but yeah

serene sigil
#

sry caps

eternal oxide
#

if its not a player placed block then surely you want if your Tracker doesn;t contain

serene sigil
#

wait lemme add a debig before that

eternal oxide
#

so if (!PlayerBlockTracker.isTracked

#

I assume your tracker only tracks player placed blocks

serene sigil
serene sigil
eternal oxide
#

are you trying to send the message ONLY when a non player placed block is mined in that area?

eternal oxide
#

then definitely use !

serene sigil
#

okjay

#

yea it just prints the first one

eternal oxide
#

then your .isTracked is always returning true

serene sigil
#

its weird

#

we need to ask smile

eternal oxide
#

you need to show some code is all

lost matrix
#

Hm?

hushed pawn
#

I expect 20 online absolute maximum in my server, i have like lobby and 2 minigame servers, also alot of worldedit stuff, what i have to choose for better performance 2x3.3Ghz or 1x5Ghz ?

serene sigil
#

oh i just realized 😅

serene sigil
#

it doesnt work

eternal oxide
#

yeah you never initialized it

lost matrix
lost matrix
serene sigil
eternal oxide
#

null instance

lost matrix
#

You are shading the plugin

#

Dont do that. Its a standalone plugin.

serene sigil
#

u talking to me?

eternal oxide
#

he is

serene sigil
#

so what should i do?

eternal oxide
#

the block tracker needs to be on your server

#

and in your pom it needs a scope of provided

hushed pawn
#

E5-2695v4(2core 3.3Ghz) i9-9900k(1core 5Ghz)

serene sigil
eternal oxide
#

<scope>provided</scope>

#

on the dependency

quaint mantle
serene sigil
humble tulip
#

You want to remove the plugin messaging channel?

#

@quaint mantle

quaint mantle
humble tulip
#

Why?

hushed pawn
#

Will worldedit things work better on higher frequency single core?

lost matrix
serene sigil
#

also, is there a better way to check if a block mined is inside of a specific location

#

cuz bb is kina weird

humble tulip
#

Bb not weird

#

Bb is a cuboid

quaint mantle
# humble tulip Why?

I want to make a public proxy that anyone can add a server, and the plugin messaging system is a security risk, since anyone can add any server anyone could literally do anything within the proxy

serene sigil
eternal oxide
#

you might want to use .overlaps rather than .contains though

#

so partial covered blocks are included

humble tulip
quaint mantle
serene sigil
#

?learnjava

undone axleBOT
humble tulip
#

Rip

lost matrix
humble tulip
#

I can do it for you if you pay me

#

Kinda busy atm if you need it asap tho

quaint mantle
lost matrix
#

I missed the message where he explained why he wants to do this nonsense

quaint mantle
echo basalt
lost matrix
#

Can you even dynamically add servers to bungeecurd?

echo basalt
#

you can

echo basalt
#

you gotta be hacky but you can

lost matrix
#

Havent used bungeecord since velocity came out

serene sigil
#

@lost matrix

remote swallow
eternal oxide
#

you didn;t put the plugin on your server

remote swallow
#

you dont have TAB

echo basalt
lost matrix
serene sigil
#

wdym?

lost matrix
#

*And installed it on the server

young knoll
#

No shade plugin into jar

#

Put plugin in plugins folder

echo basalt
#

welp I'm going back to old roots

earnest lark
#

how would i make a target player variable

#

for a command

#

Player target = (Player) args[0];bc this aint workin

young knoll
#

Bukkit.getPlayer(string)

#

make sure to null check

tardy delta
#

getPlayerExact uwu

young knoll
#

Ew

#

What if I want to support partial names

hushed pawn
tardy delta
echo basalt
#

Newer versions benefit more from multiple cores

lost matrix
# quaint mantle yes

Ok im kind of lost wrapping my head around this.
If you disable the plugin messaging channel then you cant even transfer the players
between the servers. The player will always just join the fallback server.
Unless you have some command on bungee level which would allow the player
to choose a registered server. But why would you do that?

echo basalt
#

If you only give a single core to your server you'll have a lot of fun

#

figuring out why everything takes 15 years to load

round finch
#

More core vs more hz?

lost matrix
# serene sigil wdym by that?

In your pom:
Add
<scope>provided</scope>
to my dependency or else the maven shade plugin will
copy it into your jar

echo basalt
echo basalt
#

you can't do jackshit with a single core

serene sigil
echo basalt
#

windows won't even boot on a single core system

round finch
#

Lmao

lost matrix
# serene sigil

Did you also put the PlayerBlockTracker jar into your plugins folder?

round finch
#

Smh

echo basalt
#

none of my plugins would work on a single core system either

lost matrix
#

No plugin which does an IO would be happy with that

serene sigil
echo basalt
#

I abuse multithreading to a certain extent

round finch
#

Woah that crazy guys

serene sigil
lost matrix
serene sigil
#

yea but like do i have to use it for it to work

earnest lark
#

how can i get a chest gui to appear for a player

lost matrix
serene sigil
#

nvm

lost matrix
lost matrix
serene sigil
#

alr got it

pseudo hazel
#

so I started like improving my plugin code but I am stumped at one thing, I have this translate feature where I can translate the plugin strings in menus and player messages etc called TranslationData (which just loads a yml file similar to en_us.json for example) but in teh old code I had it static since there is only one of it, but I don't know if that's the best way to approach it

#

the annoying part is that I am using it all over the place

quaint mantle
pseudo hazel
#

so "simple" DI will take some time to implement...

rotund ravine
pseudo hazel
#

what doesnt matter

#

that its static?

lost matrix
young knoll
#

Ah yes eaglercraft

#

The one that mojang recently DMCAd the hell out of

quaint mantle
pseudo hazel
#

no I want users to to be able to make their own translations and stuff

lost matrix
pseudo hazel
#

and a lot of translated strings use arguments too

#

yes that's true

#

you can only change translations in the config

quaint mantle
pseudo hazel
#

but even then idk how to implement what you are suggesting

quaint mantle
#

Have a nice day

lost matrix
# pseudo hazel and a lot of translated strings use arguments too
@AllArgsConstructor
public enum TranslatedMessage {

  GREET("msg.join.greet", "Hello %s!");

  private final String path;
  private String translation;


  @Override
  public String toString() {
    return this.translation;
  }

  public static void loadTranslation(FileConfiguration configuration) {
    for (TranslatedMessage message : values()) {
      message.translation = configuration.getString(message.path, message.translation);
    }
  }

}
  @EventHandler
  public void onJoin(PlayerJoinEvent event) {
    event.setJoinMessage("§f" + TranslatedMessage.GREET);
  }

Simple translation example which uses an enum.

pseudo hazel
#

okay

#

so just keep it static I guess xD

lost matrix
#

Should probably do some more magic so that you only need to add new values to the enum
and the yml file gets filled up with the missing values

pseudo hazel
#

yeah, I guess the main benefit of making it an enum is usability

#

but apart from that its pretty much identical to what I already had

#

thanks for your insight

lost matrix
pseudo hazel
#

also another question, how do libraries do stuff like scheduling tasks without knowing the Plugin ahead of time?

#

like is that just di across the world whatever or does it depend

lost matrix
#

Depends on the library. If its a standalone library then it simply has its own JavaPlugin class.

pseudo hazel
#

hmm

#

yeah that makes sense

serene sigil
#

it somehow doesnt work, it even returns false for player placed blocks and non-player placed blocks

lost matrix
#

Creative placed blocks arent tracked

serene sigil
#

ohhhhh

echo basalt
#

Given we're working with files, I'd probably have a built-in messages.yml file and just copy contents over

lost matrix
#

I should maybe make this bigger

serene sigil
#

but now it works

#

ty

lost matrix
echo basalt
#

valid

pseudo hazel
#

hmm

#

I just came back to say that I undervalued your approach to using enums at first, its actually pretty clever now that I look more into it 😛

torn shuttle
#

yo

#

I just spent 15 minutes on godot and I think I am ready to make the next pokemon game

pseudo hazel
#

pog

#

pogemon

torn shuttle
#

also add voice actor to my cv

pseudo hazel
#

lol

#

"yeah I am a voice actor, famous for my line that goes like 'uhuhuhuuhuhuhuhuhuhu'"

torn shuttle
#

hey some people are famous for saying gigity, fame is easy

echo basalt
#

it only took me 5 days but my code finally compiles

remote swallow
#

would anyone have any idea how i can get a Player from an essentials nickname, Essentials#getUser doesnt work and i cant find any other methods like it and they have 0 api docs

remote swallow
#

doesnt really help me

sullen marlin
#

Probably iterate all and check nicks

wise mesa
#

can I schedule a task on the scheduler from another thread/asynchronous task

#

like if I have an asynchronous task running and then I want something to happen synchronously can I use scheduler#runTask

wise mesa
#

awesome

humble tulip
#

That's how async database calls are done

#

You do the query async and then do stuff with the data on main thread

remote swallow
#

god i fucking hate essentials

echo basalt
#

bukkit's scheduler is a bit lacking

#

@sullen marlin can you make an executor that delegates stuff to the main thread so we can use futures?

#

copypasting mine around can get annoying

tawdry echo
#

can i get drops from block break?

eternal oxide
#

you get drops in blockdropitems event

torn oyster
#

what would be the best way to communicate between backend plugin and proxy plugin

#

i have a minigame deployment system ready to be used

echo basalt
#

make a packet system

torn oyster
#

just want to know how i can get the lobby, for example, to ask the server to create a server for a player

echo basalt
#

make your lobby plugin send a packet to the allocation system controller

torn oyster
#

would it be UDP

torn oyster
#

since i don't want players connecting to in-progress minigames i want to make the servers tell the server controller that they are full/in-progress

echo basalt
#

surprising you got all that stuff done and don't know what a packet is

torn oyster
#

i know what a packet is lmfao

modern plume
torn oyster
#

have you defined "config"

modern plume
#

how?

#

sorry i read in spigot forum here help with a plugins its right or not?

jovial shadow
#

who needs the ultimate java course?

#

its a 12 hour video and its very well explained

twin venture
#

Hello ,
should : player.damage trigger the EntityDamageEvent?

jovial shadow
#

yes (i dont know what im talking about)

twin venture
#

it does not do the debug

#

this is both events and in the same class and both registred..

torn oyster
modern plume
torn oyster
#

surely help me out a bit

sterile token
regal scaffold
#

I'm having some issues adding rows to my sql database

#

The updateQuery gets executed but the data isn't sent

#

And I tried doing it from terminal and it just thinks constantly

#

And eventually says failed

#

[2023-04-15 19:07:45] [40001][1205] Lock wait timeout exceeded; try restarting transaction

#

Why would it be locked

#

Or better, what could be causing the lock

regal scaffold
#

Mysql

terse ore
#

then idk

regal scaffold
#

nvm

#

Still can't actually insert stuff to database

#

And the tables are not locked

#

From command line it thinks for around 50 seconds

jovial shadow
#

@modern plume @sterile token https://youtu.be/xk4_1vDrzzo

Java tutorial for beginners full course
#Java #tutorial #beginners
⭐️Time Stamps⭐️
#1 (00:00:00) Java tutorial for beginners ☕
#2 (00:20:26) variables ❌
#3 (00:32:58) swap two variables 💱
#4 (00:36:42) user input ⌨️
#5 (00:44:40) expressions 🧮
#6 (00:49:13) GUI intro 🚩
#7 (00:55:01) Math class 📐
#8 (01:01:08) ra...

▶ Play video
torn oyster
flint coyote
regal scaffold
#

I need help with my sql issue

#

I had to install SqlServer just to be able to debug further

#

I have no idea why it just waits for 50 seconds then fails

#

Ok I figured something out... keep a connecting alive to the sql database is what's causing nothing to be able to happen, when my server is on and it connects I can no longer interact with the database at all, including requests from the server itself

echo basalt
#

Let's see

#

TCP has slightly higher latency but can detect if it didn't send through, and resend itself

#

so you never lose connection unless a wire gets cut

echo basalt
#

Or UDP, which is slightly faster, but has packet loss

young knoll
#

It’ll handle that for you

regal scaffold
#

But

#

I'm using IBatis because I wanted to execute a .sql file from the plugins resource folders

torn oyster
echo basalt
#

You gotta master the basics

torn oyster
#

I have no networking experience

eternal oxide
#

only a plugin on teh proxy can add a server.

torn oyster
#

I know I have already set that up

eternal oxide
#

So if you are creatign servers externally you have to be able to talk to yoru plugin on the proxy

torn oyster
#

I just want to let backend servers communicate with said plugin

regal scaffold
#

How can I have HikariCP execute a .sql file to generate tables

eternal oxide
#

then Java sockets

torn oyster
#

So like, if they click play or smth, it creates the server and sends them

eternal oxide
#

click play?

torn oyster
#

In the lobby

eternal oxide
#

you mean in game?

torn oyster
#

Yes

#

Like click a gui button or smth it sends them to the game

eternal oxide
#

then you must have a plugin which offered them the "play" message

river oracle
#

Couldn't you just make a proxy plugin for this

#

I don't really see a need for sockets

torn oyster
#

I have done that

eternal oxide
#

yes no need for sockets

torn oyster
#

It works perfectly

#

I just need the backend to tell the proxy when to matchmake them