#help-development

1 messages · Page 2268 of 1

somber hull
#

Through the runnable

harsh totem
#

7smile7 here is the code

lost matrix
#

From what i can see you are trying to create a toplist ranking?

lost matrix
lost matrix
harsh totem
somber hull
#

Is it bad to name interfaces of the same name as the class your trying to acheive absraction in?

#

cause i get left with this

#

me.silentprogram.betterspawners.GuiManager

lost matrix
harsh totem
lost matrix
#

Or if you dont need the whole row you can simply remove the wildcard and get only a "rank" variable

SELECT RANK() OVER(ORDER BY level DESC) AS rank
FROM users
WHERE id="${member.id}";
lost matrix
#

I have to google that...

harsh totem
#

maybe I should add AND xp

lost matrix
#

You mean

OVER(ORDER BY level AND xp DESC)

Not sure if this works...

#

Give it a try and tell me if it does

harsh totem
lost matrix
#
| rank |
| 23   |
harsh totem
#

so to use it I need to do rank or row.rank?

lost matrix
lost matrix
#

gosh this language is so ugly

#

x ======= y

harsh totem
#

db.get(`SELECT RANK() OVER(ORDER BY level DESC) AS rank, * FROM users WHERE id="${member.id}";`, (err, row) => { if (err) { return console.error(err.message); } console.log(row)

#

it shouldn't be 1

#

I should be in the 100 place

harsh totem
#

it's still 1

lost matrix
#

I think i see the problem.
WHERE id="${member.id}" might cause an ordering over only one row

somber hull
#

When using an abstract class or interface you cant use private methods?

#

nvm

#

i woulkdnt need to

lost matrix
somber hull
#

Yea im noticing that

harsh totem
lost matrix
#

You use hibernate for a few months and instantly forget how to do sql by hand...

harsh totem
#

thank you for the help btw

lost matrix
harsh totem
#

@lost matrix it works. thank you very much

lost matrix
harsh totem
lost matrix
#

sadge

harsh totem
#

thank you

lost matrix
#

Ok nice

torn shuttle
#

ayy 6 digit club

#

is this where I go to sell out?

sweet pike
#

How can I accurately get a player's UUID, with PostLoginEvent using bungee's API?

#

im getting offline mode UUID's which is quite weird

drowsy helm
eternal oxide
sacred mountain
#

what's the meaning of life

eternal oxide
#

"To crush your enemies, to see them fall at your feet -- to take their horses and goods and hear the lamentation of their women"

sweet pike
eternal oxide
#

Odd then. those protocols are teh only reason you would get different UUIDs

sweet pike
#

and my spigot.yml is here (on my backend)

#

and my server.properties on my backend

#

is this correct?

eternal oxide
#

looks fine to me

sweet pike
eternal oxide
#

The only reference to that happening I can find solved it by reinstalling Bungee. A shame they never found the actual cause.

sweet pike
limpid bronze
#

Hey, I'm trying to verify if 2 items are the same but I want to ignore one (or more maybe later) PersistentDataContainer. I tried to verify 2 items where one has a custom PersistentDataContainer with ItemStack#isSimilar but it return false while they are the same aside the PersistentDataContainer. How can I do that?

vocal cloud
#

What do you mean by are the same? Material or? Cause just make a PDC value to encompass all of them

lost matrix
tardy delta
#

well this is the current setup, where players.uuid refers to homes.owner
and the player record will always be present and that player can have 0, 1 or multiple homes

lost matrix
limpid bronze
tardy delta
#

uh does h2 support uuid?

lost matrix
tardy delta
#

oh well

#

didnt know

lost matrix
#

Use it instead of varchar. Varchar is horrible when indexing.

lost matrix
ebon topaz
#

can i make a plugin that adds more music discs to minecraft but not remove the old ones

agile anvil
tardy delta
lost matrix
tardy delta
#

¯_(ツ)_/¯

#

pretty weird to save two uuids and a name huh

lost matrix
lost matrix
# tardy delta pretty weird to save two uuids and a name huh

How does your memory structure look like?
You should have a home manager that contains a
Map<UUID, Home>
Where the key is the ID of the Home
And something like a HomeOwner containing a
Set<UUID>
Which is a set of uuids the HomeOwner owns.
Thats relational

tardy delta
lost matrix
tardy delta
#

and im having a KingdomsPlayer class, basically some player wrapper which has a Map<String, Home>

lost matrix
tardy delta
#

mongodb ew 😂

lost matrix
#

No need to write any queries

#

Or manage your tables or all that nonsense

tardy delta
#

well im making a kingdoms plugin and i intended to save everything in a database, like kingdoms, players, homes and stuff

limpid bronze
lost matrix
lost matrix
lost matrix
lost matrix
limpid bronze
lost matrix
lost matrix
# limpid bronze What do you mean

Here is the fix just in case

  public void clear(PersistentDataContainer container) {
    new ArrayList<>(container.getKeys()).forEach(container::remove);
  }
pastel juniper
#

Is there a way to reset chunks, with plugins or data packs???

lost matrix
chrome beacon
#

There are some issues with that so keep it in mind

limpid bronze
tardy delta
#

hmm kinda weird to have two databases for the same plugin no?

lost matrix
#

Well... depends actually

tardy delta
#

cuz you suggested to use mongodb and i guess my other data suits more on sql based language

ivory sleet
#

A split storage can sometimes help extend the throughput

lost matrix
tardy delta
#

then lets go for sql

eternal oxide
#

I guess it also depends

lost matrix
#

Unless its a custom server solution. We use Postgres for objects that have real monetary value and need very strict validations and transaction policies
and mongodb for everything else.

eternal oxide
#

2 db is not inherently bad.

#

If you have two distinct sets of data

lost matrix
#

And redis as a cache and other stuff

tardy delta
#

it wouldnt make it easy to create one user object from multiple tables from different databases

#

which is kinda what im tryin to achieve rn

ivory sleet
#

Sounds a bit complicated

#

What’s the reason behind it?

tardy delta
#

well i was talking about two tables; a player table and a homes table. and to create a user objects in memory i need to get stuff from both those tables

ivory sleet
#

Oh

eternal oxide
#

why not keep them separate in memory?

#

no need to combine them

ivory sleet
#

I mean foreign tables or whatever the term is, is quite common

tardy delta
#

cuz im having a playerdata class rn which stores stuff that needs to be accessible at any moment in time

eternal oxide
#

you have a database of users and a database of homes, in memory

lost matrix
eternal oxide
#

HomesManager.getHomes(user)

lost matrix
tardy delta
#

nope

ivory sleet
#

Hibernate 🥲

lost matrix
ivory sleet
#

Haven’t heard that one in a while

tardy delta
#

i was also looking for performance cuz uhh im loading alot of stuff for that user in the prelogin

#

and doing one query vs multiple hmm idk

ivory sleet
#

Time or space performance?

lost matrix
ivory sleet
#

^

tardy delta
#

hmm you could be right

ivory sleet
#

If it’s on login user experience doesn’t take some extra millis into consideration

#

It’s usually once they’re loaded into the game that they don’t want to experience latency etc

tardy delta
#

hmm right

#

at this moment i dunno really what to do

ivory sleet
#

Whats the goal to begin with?

solar citrus
#

Hey, how can I set the instrument variant on the new goat horns ? ^^

tardy delta
#

rn im trying to load a user using two tables

#

i guess ill just implement two queries

#

and combine them

ivory sleet
#

Sure

tardy delta
#

can i put multiple try with resources for preparedstatements in one that opens the connection? 👀

ivory sleet
#

You can declare multiple autoclosables

#

try (var first = …;
var second =…){

}

lost matrix
tardy delta
#

i am ._.

lost matrix
#

Huh? And you still need try with resource?

ivory sleet
#

Don’t worry just make sure to configure it properly and it will optimize itself

tardy delta
#

its better if connections are closed anyway no?

ivory sleet
#

Connections are expensive

#

Sometimes you might wanna reuse them

lost matrix
#
@Cleanup Connection connection = pool.getConnection();

Hate incoming

ivory sleet
#

As opposed to just closing them and re-opening new ones

tardy delta
#

that @Cleanup closes them too no?

lost matrix
ivory sleet
#

If it’s from the pool, wouldn’t it just lend the connection back?

lost matrix
ivory sleet
#

Well I’d just be speculating as I have really no clue about hikari’s implementation

#

(Apart from the fact that it’s an object pool with connections and some properties like time to live etc)

#

But yeah I’d assume it has a special adapter implementation of Connection to just send the connection back as free to the pool when invoking close() rather than directly closing the connection on invocation.

#

• just speculations tho 🙂

quaint mantle
#

any reason for this error?

crimson terrace
lost matrix
# tardy delta that `@Cleanup` closes them too no?
  public void withConnection(Consumer<Connection> consumer) {
    try (Connection connection = dataSource.getConnection()) {
      consumer.accept(connection);
    }
  }

  public <T> T withConnection(Function<Connection, T> function) {
    try (Connection connection = dataSource.getConnection()) {
      return function.apply(connection);
    }
  }

  private List<CoolUser> fetchAll(Connection connection) {
    String sql = "select * from users";
    List<CoolUser> users = new ArrayList<>();
    PreparedStatement pst = con.prepareStatement(sql);
    ResultSet rs = pst.executeQuery();
    CoolUser user;
    while (rs.next()) {
      // add stuff to list
    }
    return users;
  }

  public List<CoolUser> getUserList() {
    return withConnection(this::fetchAll);
  }

Those are probably cool utility methods

tardy delta
#

those are indeed cool

lost matrix
quaint mantle
#

hm

lost matrix
quaint mantle
#

dont u dare do ?java

crimson terrace
#

XD

lost matrix
quaint mantle
#

hm

#

06:05:18 INFO]: Error: null
[06:05:18 WARN]: java.lang.NullPointerException
[06:05:18 WARN]: at me.superischroma.spectaculation.gui.GUI.open(GUI.java:219)
[06:05:18 WARN]: at me.superischroma.spectaculation.command.ItemBrowseCommand.run(ItemBrowseCommand.java:19)
[06:05:18 WARN]: at me.superischroma.spectaculation.command.SCommand$SECommand.execute(SCommand.java:76)
[06:05:18 WARN]: at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:146)
[06:05:18 WARN]: at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:666)
[06:05:18 WARN]: at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchServerCommand(CraftServer.java:629)
[06:05:18 WARN]: at net.minecraft.server.v1_8_R3.DedicatedServer.aO(DedicatedServer.java:416)
[06:05:18 WARN]: at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:379)
[06:05:18 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713)
[06:05:18 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616)
[06:05:18 WARN]: at java.lang.Thread.run(Thread.java:748)

#

now I get dis

tardy delta
#

check the caused by part

lost matrix
vocal cloud
#

Not to mention a lack of java knowledge

quaint mantle
#

!paste

#

hm

#

?pase

crimson terrace
#

?paste

undone axleBOT
quaint mantle
#

?paste

undone axleBOT
lost matrix
#

!!pasta

crimson terrace
#

%pspspsps

quaint mantle
#

the code

#

is not working

vocal cloud
quaint mantle
#

the error

#

is

crimson terrace
#

Ducky, think about what you want to say and do it in one message

quaint mantle
#

java.lang.IllegalArgumentException: Crafting recipes must be rectangular
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-31.0.1-jre.jar:?]
at org.bukkit.inventory.ShapedRecipe.shape(ShapedRecipe.java:72) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at deepsmp.deepsmp.Main.onEnable(Main.java:47) ~[DeepSMP-1.0-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:536) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:563) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:477) ~[paper-1.19.jar:git-Paper-58]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:633) ~[paper-1.19.jar:git-Paper-58]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:419) ~[paper-1.19.jar:git-Paper-58]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:306) ~[paper-1.19.jar:git-Paper-58]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1121) ~[paper-1.19.jar:git-Paper-58]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:302) ~[paper-1.19.jar:git-Paper-58]
at java.lang.Thread.run(Thread.java:833) ~[?:?]java.lang.IllegalArgumentException: Crafting recipes must be rectangular
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-31.0.1-jre.jar:?]
at org.bukkit.inventory.ShapedRecipe.shape(ShapedRecipe.java:72) ~[paper-api-1.19-R0.1-SNAPSHOT

vocal cloud
#

Paste your errors sigh.

crimson terrace
#

at least its 1.19

quaint mantle
#

it is 1.19

quaint mantle
#

WTF

#

ANOTHER REGTUNGULAR

#

BRUH

lost matrix
#
recipe.shape("AN ","NS"," S ");

Not rectengular

quaint mantle
#

lolllll

#

am dumb

#

ok worked thx

tardy delta
#

is there by any chance a consumer function that has a throws declaration or do i need to make it myself?

ivory sleet
#

Callable

#

Or wait no

#

That might be a supplier

#

Uh might have to make one for yourself

ebon topaz
daring lark
#

how to check if player reproduce entities?

smoky oak
#

PlayerInteractEntityEvent to check if he feeds, EntityMakeLoveEvent to check when it breeds

eternal oxide
smoky oak
#

reproduction is caused indirectly by players not directly

lost matrix
ebon topaz
lost matrix
winged storm
#

what databas should i use for my plugin

lost matrix
winged storm
#

is sqlite good?

#

i used it before with python

smoky oak
#

uh can you even play sounds that arent in the vanilla game smile?

lost matrix
lost matrix
smoky oak
#

no i mean

#

how do you play them via code

#

isnt that a bunch of enums too

lost matrix
#

something something World#playCustomSound()

smoky oak
#

ah ok

winged storm
lost matrix
# winged storm what would you suggest i use?

A few questions before you jump into that:

  1. Do you have a lot of experience on working with Files?
  2. Does your plugin really need a Database? -> With reason pls
  3. What kind of data do you want to store?
jagged thicket
smoky oak
#

urgh i hate that file format

#

for some reason it takes ten times as long to get processed

jagged thicket
#

oh so is it not reliable enough? why isn't there already plugins like that

winged storm
smoky oak
green prism
#

thx

smoky oak
lost matrix
drowsy helm
eternal oxide
smoky oak
#

for fucks sake my name isnt that movie

#

my name is older than that movies name

jagged thicket
#

morbius is kind of like jesus to some ppl

smoky oak
#

look up PDC

lost matrix
#

Bit weird that you made an account just to appreciate your love for that movie... but whatever you fancy...

eternal oxide
#

?pdc store the players coins on the player object

smoky oak
#

you can just make a namespace named 'value' and tack it onto the player

#

keep in mind that this data gets send to the player as part of their nbt

#

as such if you stuff too much into it you essentially bookban them

lost matrix
jagged thicket
lost matrix
jagged thicket
#

i thought there was a way to play it directly with some lib like music bots

smoky oak
#

idunno

#

magic

lost matrix
#

Minecraft has no streaming functionality

jagged thicket
#

yea maybe we could big brain mixin some of that into minecraft

quiet ice
lost matrix
jagged thicket
#

true , but that wouldn't work for spigot servers

lost matrix
#

I once tinkered with proximity chat where the client would have to open a website in order to move on the server.
Then i added a heartbeat and cross-referenced the ip so the user needed to keep the website open.
Over this you could also play sounds and do server announcements etc.

paper viper
#

Made a plugin that steamed audio from twitch, YouTube, and a lot of other sources into a website and discord bot that users could hear

opal juniper
#

is it working now pulse? unsure what the state of dev is

vocal cloud
#

Just make a mod to do it kek

smoky oak
#

how do i do a lambda as a consumer of a set again?

opal juniper
#

?

lost matrix
#

You mean forEach?

opal juniper
#

its just like
.accept( set -> {...});

smoky oak
#

or processes it or whatever

#

nope

opal juniper
#

well that was an example

#

what does getAllowedFaces return

lost matrix
# smoky oak
someSet.forEach(element -> System.out.println(element));
smoky oak
#

set<BlockFace>

lost matrix
#

More info. What are you trying to do?

opal juniper
#

i think you have mis understood what a consumer is

lost matrix
smoky oak
#

im still trying to prevent block state changes on mushrooms

opal juniper
#

speaking of consumers, imma get lunch

tardy delta
#

ollie.work().whenComplete(ollie::lunch)

smoky oak
#
if(shroom(event.getBlock().getType()) && shroom(event.getBlockAgainst().getType())){
  new BukkitRunnable(){@Override public void run(){
    MultipleFacing MF = (MultipleFacing) event.getBlock().getBlockData();
    MF.getAllowedFaces().forEach(element -> MF.setFace(element, true));
  }}.runTaskLater(instance,20);
}
#

long delay for testing only

tardy delta
#

mf lmao

opal juniper
#

i dont like this shroom method

#

it should be called something like isMushroomBlock or something

lost matrix
#

If it returns a boolean then it should be prepended with "is"

tardy delta
#

i will shroom you 💀

lost matrix
#

or "has"

opal juniper
#

but that seems fine no? i cant see anything syntactically wrong

smoky oak
#

havent checked it yet tho

#

time to wait an hour for 1.19 to launch

#

my game not the server

lost matrix
smoky oak
#

im also cancelling block physics update but that does NOT cack

#

damn lag

#

does not catch all the tile state changes

#

it only works for the block that wasnt placed just now for some weird reason

#

hence this mess

smoky oak
#

now what

opal juniper
#

check instance

paper viper
opal juniper
#

instanceof fixes everything

crimson terrace
#

true

smoky oak
#

can i somehow print out the exact class something is

eternal oxide
#

Should you not be using java if (Tag.MUSHROOM_GROW_BLOCK.isTagged(event.getBlock().getType())) for mushrooms?

smoky oak
#

thats just mycelin

#

i tried that

eternal oxide
#

I've never played with Mushrooms so no idea

smoky oak
#

anyways printing out the class of an object?

opal juniper
#

.getClass()

sacred mountain
#

hey is it possible to use regex to replace all numbers to the same number but with a color code? ANSI

#

not too sure on how to get the actual number from the regex

#

should i not be using replaceAll

smoky oak
#

isnt that just all instances

opal juniper
#

replaceall is such a poorly named method

tardy delta
#

replaceRegex

smoky oak
#

oy wait a moment

#

MultipleFacing is a subinterface of BlockData and mushroom blocks definitively have those multiple directional values

#

why cant i cast the block data of a mushroom block to multiple facing then

tardy delta
#

new TextComponent("normal text")

#

ComponentBuilder

#

Bukkit.getPlayers().forEach

sacred mountain
eternal oxide
#
All Known Subinterfaces:
    Fence, Fire, GlassPane, GlowLichen, SculkVein, Tripwire ```I don;t see mushrooms in there
tardy delta
#

do s = s.replace

sacred mountain
#

aight

paper viper
#

That’s why you always check your warnings

#

Smh lol

sacred mountain
#

i forgot thats what it meant

paper viper
#

Lol

tardy delta
#

then do quick fixes

sacred mountain
#

i usually ignore that kind of warning

#

yea

tardy delta
#

lmao

opal juniper
#

@SuppressWarnings("all")

sacred mountain
#

that code looks very inefficiet

paper viper
#

You should not ignore that warning

#

Lmao

sacred mountain
tardy delta
sacred mountain
#

in my head i just like

sacred mountain
#

ok

#

i downloaded an intellij plugin

#

for that stupid warning

tardy delta
#

@Contract("_, _ -> new")

#

@Contract("_ -> fail") hehehe

sacred mountain
#

oh

tardy delta
#

best way to annoy those kids

quaint mantle
#

[07:56:42 INFO]: Error: null
[07:56:42 WARN]: java.lang.NullPointerException
[07:56:42 WARN]: at java.util.regex.Matcher.getTextLength(Matcher.java:1283)
[07:56:42 WARN]: at java.util.regex.Matcher.reset(Matcher.java:309)
[07:56:42 WARN]: at java.util.regex.Matcher.<init>(Matcher.java:229)
[07:56:42 WARN]: at java.util.regex.Pattern.matcher(Pattern.java:1093)
[07:56:42 WARN]: at me.superischroma.spectaculation.util.SUtil.splitByWordAndLength(SUtil.java:179)
[07:56:42 WARN]: at me.superischroma.spectaculation.item.ItemLore.asBukkitLore(ItemLore.java:119)
[07:56:42 WARN]: at me.superischroma.spectaculation.item.SItem.<init>(SItem.java:55)
[07:56:42 WARN]: at me.superischroma.spectaculation.item.SItem.of(SItem.java:488)
[07:56:42 WARN]: at me.superischroma.spectaculation.item.SItem.of(SItem.java:499)
[07:56:42 WARN]: at me.superischroma.spectaculation.gui.ItemBrowserGUI.<init>(ItemBrowserGUI.java:109)
[07:56:42 WARN]: at me.superischroma.spectaculation.gui.ItemBrowserGUI.<init>(ItemBrowserGUI.java:136)
[07:56:42 WARN]: at me.superischroma.spectaculation.command.ItemBrowseCommand.run(ItemBrowseCommand.java:19)
[07:56:42 WARN]: at me.superischroma.spectaculation.command.SCommand$SECommand.execute(SCommand.java:76)

#

tf

paper viper
#

?paste

undone axleBOT
tardy delta
#

paste code whats null

opal juniper
#

me.superischroma.spectaculation.util.SUtil.splitByWordAndLength(SUtil.java:179)

#

whats line 179

quaint mantle
#

in?

sacred mountain
#

i completely suck at regex, so could someone help me on how i would highlight this manually without hardcoding the colors? some replace regex would help. Basically the hard part for me is 'pink but if theres a pipe then cyan'

tardy delta
#

SUtil

#

shuuuu

quaint mantle
#

alr wait

tardy delta
#

lmao

sacred mountain
#

ive currently hardcoded it

sacred mountain
#

and having no life

#

and soul

tardy delta
#

hot

sacred mountain
#

and my brain is slowly melting

#

okay anyways please i need spoonfeed

#

:):)):):)

#

regex is pain

quaint mantle
tardy delta
#

🥄 uwu

quaint mantle
#

the roman part is 179

tardy delta
#

here you go

tardy delta
smoky oak
#

why does everything i look up tell me that mushroom block data can be cast to FacingMultiple

sacred mountain
tardy delta
#

textcomponent is a basecomponent

sacred mountain
#

hey brush

#

gib regex

#

:)

tardy delta
#

./ur_mom[//D]

#

textcomponent extends basecomponent

sacred mountain
tardy delta
#

so just pass it in

ornate mantle
#
deaths:
  1:
    - "/effect give #player# minecraft:speed 2 2 true"
  2:
    - "/give #player# minecraft:diamond 9"

i have this list

sacred mountain
#

:'(

ornate mantle
#

but the amount of numbers assigned in there

#

is random

#

how do i get the numbers

#

getintegerlist("deaths").length?

tardy delta
#

loop over config.getSection("deaths").getKeys(false) iirc

ornate mantle
#

alr ty

#

configurationsection or defaultsection

tardy delta
#

config

smoky oak
#

can i somehow run a method the instant an event is finished?

tardy delta
#

well that returns a Set<String>

#

not sure if thats just Integer::toString or what

eternal oxide
smoky oak
#

eh i found a workaround

#

but

smoky oak
#

eh for some reason i can cast it i just cant tell it foreach

#

now im wondering how quickly after an event has finished i can call a method after it

#

rn im using a one second delayed runnable but maybe theres a better solution

eternal oxide
#

you are simply trying to prevent placed mushroom blocks affecting their neighbors?

smoky oak
#

yes but as said

#

that already happens when i cancel blockphysicsupdate for those blocks

#

the issue is

#

placed blocks update themselves without calling blockphysicsupdate

#

hence this mess up there

#
MultipleFacing MF = (MultipleFacing) event.getBlock().getBlockData();
MF.setFace(BlockFace.UP,true);
MF.setFace(BlockFace.DOWN,true);
MF.setFace(BlockFace.SOUTH,true);
MF.setFace(BlockFace.NORTH,true);
MF.setFace(BlockFace.EAST,true);
MF.setFace(BlockFace.WEST,true);
event.getBlock().setBlockData(MF);```
eternal oxide
#

does it cast fine?

smoky oak
#

yea

eternal oxide
#

odd

smoky oak
#

but if i fire this before the event there might be issues

#

actually

#

lmc

#

huh

#

nevermind ig

#

progress!

tardy delta
#

oh well im stupid

#

well a for loop works too

#

id use a componentbuilder for the hoverable text stuff

lost matrix
#

player1 and text1 text2 ... are terrible variable names

lost matrix
# tardy delta lmao

I think you know that but dont remove the annotation. Keep the map encapsulated.

tardy delta
#

i tried a normal for each on a map

#

smh

lost matrix
#

In most teams TODOs or FIXMEs are strictly forbidden because very often it will never get touched again after it works

lost matrix
tardy delta
#

ye ik im stupid

#

what error lol

lost matrix
#

Refactor this method right now.

#

Show us more code.

tardy delta
#

my eyes have died a couple of times and so did my brain

lost matrix
#

Yes show us those lines

#

Bukkit.getOnlinePlayers().forEach(player1 -> player1.spigot().sendMessage(text,text1,text2,text3,toHoverableText(item),text4));
This garbage. Show us the rest

#

Just use a component builder and append them

ornate mantle
#

7smile7 i wont lie

#

the way you text makes me think you're in a murderous mood

#

i dont exactly know what it is

#

it just makes me think you feel like committing several federal crimes

lost matrix
ornate mantle
#

yes

glossy venture
#

is there a javadocs with spigot api + bungee packages?

chrome beacon
#

Bungee has a seperate javadoc

lost matrix
#

?jd

glossy venture
#

ah

#

thansk

dreamy canopy
#

hi back guys I just wanna ask you if you understand what is wrong in my code plz for tempban, it doesn't work with months and years but the rest is okay

#

            long time = 0;

            int duration = Integer.parseInt(args[1]);

            switch (args[2]){

                case "s":

                    time = duration * 1000;

                    break;
                case "m":

                    time = duration * 1000 * 60;

                    break;
                case "h":

                    time = duration * 1000 * 60 * 60;

                    break;
                case "d":

                    time = duration * 1000 * 60 * 60 * 24;

                    break;

                case "w":

                    time = duration * 1000 * 60 * 60 * 24 * 7;

                    break;

                case "mo":

                    time = duration * 1000 * 60 * 60 * 24 * 7 * 5;

                    break;

                case "y":

                    time = duration * 1000 * 60 * 60 * 24 * 7 * 5 * 12;

                    break;


                default:
                    sender.sendMessage(new TextComponent("§e/tempban §6[Joueur] [Temps] [Unité] [Raison]"));

            }```
#

I'm bad with maths xD

chrome beacon
#

?paste

undone axleBOT
chrome beacon
#

Also java has time and date api you can use

quiet ice
#

Correct

ornate mantle
#

should i use for loops or the bukkit scheduler

#

i read something about threads somewhere

quiet ice
#

They do different things

radiant aspen
#

apart from that I cant see any issues

ornate mantle
#

the for loop dispatches like 3-4 commands

smoky oak
quiet ice
dreamy canopy
quiet ice
#

In that case, do it on the main thread - few commands can be handled async anyways

ornate mantle
chrome beacon
quiet ice
chrome beacon
#

So it's not 35 days agter 1970

minor garnet
#

Line 67. Reader defConfigStream = new InputStreamReader(this.instance.getResource(this.fileName), StandardCharsets.UTF_8);

the ''getResource'' is being null why if filename not null?

ornate mantle
#

@quiet ice i have a for loop that dispatches 4 commands

quiet ice
#

what is instance?

dreamy canopy
#

yes it works with the others after it's the same code

ornate mantle
#

do i keep the for loop or use a runnable

quiet ice
#

Why would you need to do it async though?

minor garnet
quiet ice
#

Is the command that expensive?

ornate mantle
#

its just an effect command

chrome beacon
ornate mantle
#

is it fine with teh for loop

quiet ice
buoyant viper
#

why not apply the effect with api? uwu

ornate mantle
#

because config

quiet ice
minor garnet
# quiet ice and does the file exist within the jar?
    mainConfig = new ConfigurationManager(this, "config.yml");
    mainConfig.load();
    themeConfig = new ConfigurationManager(this, "themes-config.yml");
    themeConfig.load();
    playerConfig = new ConfigurationManager(this, "players-config.yml");
    playerConfig.load();```
quiet ice
#

That does not help at all

#

we need the compiled jar - after that everything would be explainable

minor garnet
quiet ice
#

not it is not - this is the IDE view

#

and from looking at it the resources are not in the resources folder

minor garnet
quiet ice
#

ah well then

chrome beacon
#

They aren't using maven or gradle ;/

minor garnet
#

not now

buoyant viper
#

its eclipse i reckon

quiet ice
#

it is

minor garnet
buoyant viper
#

get good pc idk jk

minor garnet
quiet ice
#

@minor garnet what is the constructor of your ConfigManager class?

buoyant viper
#

cant im still recuperating from when i bought my pc LOL

#

but i digress

chrome beacon
#

Just use paint IDE /s

minor garnet
dreamy canopy
#

it makes me this xD

minor garnet
chrome beacon
#

Yes paint

lost matrix
quiet ice
#

Are you sure that it does not work?

minor garnet
quaint mantle
#

anyone know how to set the spawn chance of chickens from eggs

#

?

quiet ice
#

You might have exported it wrongly

buoyant viper
quiet ice
buoyant viper
#

that was 7?!

quiet ice
#

at least Java 8

#

but I believe Java 7

minor garnet
buoyant viper
#

ill check the @since later ig

#

8

quiet ice
#

I believe you might have left the left things unchecked

minor garnet
#

?

chrome beacon
#

The older java date api isn't that bad either

lost matrix
chrome beacon
#

And it has existed since Java 1.0

minor garnet
quiet ice
# minor garnet ?

Depending on where you clicked for exporting you might not have exported it correctly at first

#

hence why you shouldn't use that window

#

Just try exporting it again and see if it works now

smoky oak
#

can you colour warden screams?

chrome beacon
#

Also you don't need .project or .classpath in the jar

quiet ice
#

If it doesn't then yeah ... I might need to take a look at the entire stuff

chrome beacon
#

So why are you including them?

quiet ice
chrome beacon
#

?

minor garnet
#

when I export, I always press the enter key several times so I don't have to deselect it all the time to be faster for test plugin

quiet ice
#

I personally move the resource files in the src folder

quiet ice
#

Then give me the project or compiled jar and I'll take a look at what might have gone wrong

#

because this is a bit strange

#

?jd-s unless

undone axleBOT
quiet ice
#

okay no, that isn't the reason

#

?stash

undone axleBOT
quiet ice
#

@minor garnet there is no config.yml file

lost matrix
#

One moment

#
  @EventHandler
  public void onChat(AsyncPlayerChatEvent event) {
    Player player = event.getPlayer();
    ItemStack handItem = player.getInventory().getItemInMainHand();
    BaseComponent[] components = new ComponentBuilder()
            .append(new ComponentBuilder("The player ").color(ChatColor.WHITE).create())
            .append(new ComponentBuilder(player.getName()).color(ChatColor.GREEN).create())
            .append(new ComponentBuilder(" has ").color(ChatColor.WHITE).create())
            .append(toHoverableText(handItem))
            .append(new ComponentBuilder(" in his hand.").retain(ComponentBuilder.FormatRetention.NONE).color(ChatColor.WHITE).create())
            .create();
    Bukkit.spigot().broadcast(components);
  }
quaint mantle
lost matrix
quaint mantle
#

wheres the spigot.yml

#

nvm

vestal musk
quaint mantle
eternal oxide
quaint mantle
#

ah

#

couldnt find that when i looked on docs thank

lost matrix
quaint mantle
#

yteaaa got it thanks

quaint mantle
#

[09:18:30 INFO]: Error: null
[09:18:30 WARN]: java.lang.NullPointerException
[09:18:30 WARN]: at java.util.regex.Matcher.getTextLength(Matcher.java:1283)
[09:18:30 WARN]: at java.util.regex.Matcher.reset(Matcher.java:309)
[09:18:30 WARN]: at java.util.regex.Matcher.<init>(Matcher.java:229)
[09:18:30 WARN]: at java.util.regex.Pattern.matcher(Pattern.java:1093)
[09:18:30 WARN]: at me.superischroma.spectaculation.util.SUtil.splitByWordAndLength(SUtil.java:180)
[09:18:30 WARN]: at me.superischroma.spectaculation.item.ItemLore.asBukkitLore(ItemLore.java:119)
[09:18:30 WARN]: at me.superischroma.spectaculation.item.SItem.<init>(SItem.java:55)
[09:18:30 WARN]: at me.superischroma.spectaculation.item.SItem.of(SItem.java:488)
[09:18:30 WARN]: at me.superischroma.spectaculation.item.SItem.of(SItem.java:499)
[09:18:30 WARN]: at me.superischroma.spectaculation.gui.ItemBrowserGUI.<init>(ItemBrowserGUI.java:109)
[09:18:30 WARN]: at me.superischroma.spectaculation.gui.ItemBrowserGUI.<init>(ItemBrowserGUI.java:136)
[09:18:30 WARN]: at me.superischroma.spectaculation.command.ItemBrowseCommand.run(ItemBrowseCommand.java:19)
[09:18:30 WARN]: at me.superischroma.spectaculation.command.SCommand$SECommand.execute(SCommand.java:76)

#

guys

#

anyone help

#

pelase

#

?paste

undone axleBOT
quaint mantle
golden kelp
#

wdym

quaint mantle
#

wait

buoyant viper
#

does getWorld(UUID/String) return null if the world isnt loaded, but is listed in getWorlds() ?

eternal oxide
#

an unloaded world will not be listed in getWorlds()

buoyant viper
quaint mantle
#

and the error now

buoyant viper
#

nvm, i was using the wrong index in command arguments....

eternal oxide
#

if its in getWorlds() its loaded. It may have no chunks loaded, but the world is

buoyant viper
#

nah im just dumb

#

lol

quaint mantle
#

AND NOW IT WORKS

#

THE FUCK

buoyant viper
#

now to look on SO for human readable format

quaint mantle
#

yo cool plugin

buoyant viper
#

maybe i should go back to bed bc in the 5 minutes it took me to write the command class ive made like 4 mistakes already

#

fucked up getting the world, messed up the tab completion..

twilit roost
#

Is there any event for player holding down LMB?

buoyant viper
#

?jd-s for myself

undone axleBOT
eternal oxide
#

no

quaint mantle
#

?java

#

dem

buoyant viper
#

?learnjava

undone axleBOT
buoyant viper
#

😎

smoky oak
#

is there code to tell the client to not cull textures touching a specific block?

eternal oxide
#

Thats probably to do with connected textures. Client side

#

unlikely to be a packet

smoky oak
#

is it part of the texture files or hard coded then?

#

bc if its a texture thing i can just add that to a resource pack

eternal oxide
#

No clue, I'm only guessing

smoky oak
#

wait its a block thing

#

goddammit

rotund pond
#

Is there a way to get all @undone axle commands like ?notworking please ?

subtle folio
#

?help

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

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

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

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

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

**__Permissions:__**

permissions Command permission management tools.

rotund pond
#

?help

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

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

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

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

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

**__Permissions:__**

permissions Command permission management tools.

subtle folio
#

😮

rotund pond
#

xd

subtle folio
#

?help 2

#

fk

rotund pond
#

well ty

#

?uptime

undone axleBOT
#

I have been up for: 25 days, 15 hours, 48 minutes, 24 seconds (since <t:1655244445:f>)

ivory sleet
#

?kick

undone axleBOT
#
CafeBabe Help Menu
Syntax: ?kick <member> [reason]
Kick a user.

Examples:

  • ?kick 428675506947227648 wanted to be kicked.
    This will kick the user with ID 428675506947227648 from the server.
  • ?kick @Twentysix wanted to be kicked.
    This will kick Twentysix from the server.

If a reason is specified, it will be the reason that shows up
in the audit log.

ivory sleet
#

Works as per usual

rotund pond
#

I know

#

What's the command for guys just saying "i have a problem, please help" without explaining what it is ?

subtle folio
#

?xy

undone axleBOT
rotund pond
#

Oh ty, didn't know this

eternal oxide
#

?ask

undone axleBOT
#

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

rotund pond
#

?info

undone axleBOT
rotund pond
#

well w/e

ashen quest
#

does entity#setTarget make the entity angry towards the target (resulting in the entity damaging the target?)

twilit roost
#

Why are my particles shooting randomly to every direction?

Vector direction = p.getEyeLocation().getDirection();
double velocity = 2.5;
w.spawnParticle(Particle.FLAME, rightHand.getX(), rightHand.getY(), rightHand.getZ(), 5, (float) direction.getX(), (float) direction.getY(), (float) direction.getZ(),velocity , null);
eternal oxide
#

set teh speed value

twilit roost
#

thats the velocity

#

this is what i mean by everywhere

eternal oxide
#

reduce the speed, its too high

twilit roost
#

velocity = 1

eternal oxide
#

0 = don;t move from where they spawn

twilit roost
#

well I want them to move forward and create sort of a cloud

eternal oxide
#

are they moving from spawning or are they spawning in random locations around?

twilit roost
#

looks like they be random spawning
therefore I need to redo my calculator for RightHand location

opal oasis
#

can someone help me with this item amount code. like i wanna know exactly what to add to this part. like i want to code how to check if something is a number and if not i want to send a error

eternal oxide
#

speed controls how fast they move/how far they move

#

then set your offsets to 0

#

offsets are the random distance from center they can spawn

opal oasis
#

int amount = Integer.parseInt(args[1]); Material item = Material.getMaterial(args[0].toUpperCase()); if (item != null) { Inventory inv = ((Player) sender).getInventory(); inv.addItem(new ItemStack(item, amount)); player.sendMessage(prefix + "§a+ §6" + item + "§9 " + amount); } else { player.sendMessage(prefix + "§cThis is either not a minecraft item or you wrote it wrong!"); player.playSound(player.getLocation(), Sound.BLOCK_ANVIL_LAND, 0.5F, 2); } this is the code

twilit roost
#

works fine now
I just want to shoot them forward to where player is looking and create sort of cloud out of them

quaint mantle
ornate mantle
#

if i do return config.getInt("path_that_doesnt_exist") will it return 0 or null?

twilit roost
#

int can't be null
therefore 0

ornate mantle
#

epic

eternal oxide
opal oasis
opal juniper
#

before you parse it

#

otherwise send the error message and return

opal oasis
#

currently its saying like isparsable is not a thing

eternal oxide
#
if (NumberUtils.isParsable(args[0])) {
    int amount = NumberUtils.toInt(args[0]);
    // code here
}```Apache commons lib
opal oasis
#

oh

eternal oxide
#

import org.apache.commons.lang3.math.NumberUtils;

#

included with spigot

opal juniper
#

you might have to include it as a dev dependency as it will be present at runtime but your ide doesnt know that

opal oasis
#

i am coding with paperspigot mc thingy

eternal oxide
#

I do Spigot only

quiet ice
#

Given that you are parsing the int either way, it makes more sense to try-catch it

#

Also, paperspigot is dead

#

PaperMC is the real deal

opal oasis
#

i did Paper or something

quiet ice
#

(If you say that you are using paperspigot you are implying that you are using an ancient version (1.8 or earlier iirc) of paper, which lowers the chances of getting help even more)

opal oasis
#

then i am using papermc

opal juniper
#

paperweight?

#

thats their gradle env thing

quiet ice
#

whatever, paper should not remove any dependencies included in spigot

opal juniper
#

i think they update some, but thats about as much yea

opal oasis
#

i use maven

quiet ice
#

Planned Removal of commons-lang
As foreshadowed with the 1.18 release, commons-lang has now been removed from the API. Plugins will not yet be broken as it is still included with the server, however it will eventually be removed in a future release. Please consider switching to Google Guava (which is a supported bundled API) or using your own copy of the much more recent commons-lang3.

eternal oxide
#

thats apache 3 so yes

#

ah true

quiet ice
#

ah right there are two versions

#

or idk

eternal oxide
#

I guess you could guava it. but currently Spigot includes Apache Commons Lang 3

quiet ice
#

Or actually you cannot use it anymore if you are binding against 1.19

opal oasis
#

i am trying to figure out how to install apache

quiet ice
#

apache what?

opal oasis
#

i thought i heard someone say something with apache

quiet ice
#

commons-lang?

opal oasis
#

yes something like that

#

sorry if i am annoying btw. my brain is very tired lately

quiet ice
#

Apache is an organisation that holds a lot of projects ranging from the well known apache webserver to maven

quiet ice
#
try {
  int parsed = Integer.parseInt(string);
  // Normal flow - (valid number)
} catch (NumberFormatException e) {
  // Complain about invalid number, etc.
}

would be another (albeit a bit more convoluted) way of doing that

#

And well someone is going to post that annoying image if you need to parse a lot of numbers

opal oasis
#

would it help if i just share the entire code or? else i might just take a break cause i feel like i am not understanding something very easy

eternal oxide
#

?paste to share anything

undone axleBOT
opal oasis
lost matrix
#
Int? parsed = input.toIntOrNull()

😄

paper viper
#

There is a lot of cursed stuff in the paste code lol

#

One of the first things being casting to Player directly

eternal oxide
# opal oasis https://paste.md-5.net/dazaxebexu.java

ok first off...

  1. This is a registered CommandExecutor. You don't need to check what command was entered.
  2. add the permission to use the command on the plugin.yml and you no longer need to check permissions in code.
lost matrix
opal oasis
#

i am very new to coding...

#

let me get my brain straight

eternal oxide
#

also you shoudl be using import org.apache.commons.lang3.math.NumberUtils;If you are using Lang3 from the Maven link I gave you

quiet ice
#

(you would need to add it as a library in the plugin.yml eventually however)

paper viper
#

It’s provided I’m pretty sure

quiet ice
#

yeah, though subject for removal

paper viper
#

I think that commons lang will be removed, not commons lang 3

eternal oxide
# opal oasis let me get my brain straight

cleaner way of parsing args```java
switch (args.length) {

    case 0 -> { /* code here */ }
    case 1 -> { /* code here */ }
    case 2 -> { /* code here */ }
    default -> { /* code here for anythign not covered */ }
    }```
paper viper
#

Commons Lang 3 is fine

#

Commons Lang is subject to removal

quiet ice
#

yep seems like that

opal oasis
#

btw i really appreciate you guys helping me while i have such a brain storm

quiet ice
#

A bit strange that it isn't exposed via the spigot-api

eternal oxide
#

no bundles are in 1.18+

#

?bootstrap

undone axleBOT
#

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

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

river oracle
#

doesn't spigot use guava now

eternal oxide
#

API is not shaded

paper viper
#

Guava was always there

river oracle
#

oh lol

#

stupid me not knowing that aha

paper viper
#

I still never use commons cause it’s so ass

#

And old

eternal oxide
#

Hey, I'm old too!

paper viper
smoky oak
#

I need access to the 1.19 client jar but it refuses to generate
versions/1.19 folder

quiet ice
eternal oxide
#

old enough I can nearly draw a pension

paper viper
#

Lmao

#

I feel like Spigot discord is filled with 12 year old kids and also boomers

#

No in between

dusk flicker
#

very true

eternal oxide
#

Seems about right

lost matrix
# eternal oxide cleaner way of parsing args```java switch (args.length) { ...

You can also do something cursed like this:

  private final Map<Integer, BiFunction<CommandSender, String[], Boolean>> handlers = new HashMap<>() {{
    this.put(0, YourCommand.this::handleNoArg);
    this.put(1, YourCommand.this::handleOneArg);
    this.put(2, YourCommand.this::handleTwoArg);
  }};

  private boolean fallback(CommandSender sender, String[] args) {

  }

  private boolean handleNoArg(CommandSender sender, String[] args) {

  }

  private boolean handleOneArg(CommandSender sender, String[] args) {

  }

  private boolean handleTwoArg(CommandSender sender, String[] args) {

  }

  public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    return handlers.getOrDefault(args.length, this::fallback).apply(sender, args);
  }
paper viper
#

Go further and split it into classes

#

Lol

eternal oxide
#

lol

paper viper
#

Just make abstractions for each

#

XD

wicked remnant
#

Does anyone know when the gson provided by the server was updated to 2.8.2?

quiet ice
#

between 1.17.1 and 1.18

opal juniper
quiet ice
#

(unless there is a mismatch between api and server)

quiet ice
wicked remnant
#

thank you

worldly ingot
#

Also also, Map.of(). Doing that {{}} trick is a horrible hack

#

Or at the bare minimum, use a map builder. There are a couple provided in Guava and Apache Commons

#

The {{}} hack creates an anonymous type of HashMap which isn't ideal. You're bound to get yourself into trouble doing that

#

I wish articles and tutorials would stop showing that method

radiant aspen
paper viper
radiant aspen
#

yep

smoky oak
#

thx

tardy delta
buoyant viper
#

i love Java

tardy delta
quiet ice
#

and that people is why I rarely use annotations

paper viper
#

This is why I hate command libs that have annotation spam

buoyant viper
#

empire minecraft? uwu

quiet ice
buoyant viper
#

LOL

#

everything about spring is cursed

ashen quest
#

still used so much

buoyant viper
#

like 50 char long class names

tardy delta
#

spring weird

paper viper
ashen quest
#

same

#

thats what pays my billz so i dont have any problems xd

paper viper
#

Spring has a reason to use annotations tho cause it’s huge anyways

#

I don’t like seeing annotation spam in command libraries because it’s just a plugin

ashen quest
#

Yea thats true

tardy delta
#

i love the acf wiki, it just told me look at this and figure it out ._.

dawn hazel
#

anyone know how i can retrieve command aliases from config? (bungeecord plugin)
doing this doesnt work and i dont really know how else i can do it

lost matrix
#

Quarkus > MicroNaut > Spring

dawn hazel
#

yeah i know

#

thats why it didnt work

tardy delta
#

config.getStringList ig

dawn hazel
#

but then i have no where i can put the list

#

ive already tried it

#

this doesnt work

paper falcon
#

how would I go on about making a plugin where randomly throughout the time a message in chat appears displaying a random equation and the first player's chat that is correct wins ?

paper viper
tardy delta
#

it expects an array ig

#

toArray(String[]::new) smh

paper viper
#

Just use streams to convert it into an array

ashen quest
#

So guys, i need to add all elements of X array to Y array (Y array is empty, basically making Y a clone of X)
so i m gonna use this

for(int i = 0; i < x.length; i++) y[i] = x[i]

😌

paper viper
#

Or that I guess lol

lost matrix
ashen quest
#

nah

#

we dont do efficient stuff here

tardy delta
#

lol

quiet ice
#

also, why x++

ashen quest
#

oh yea

quiet ice
#

We aren't doing C here

ashen quest
#

we are simply dumb as well

#

and by we i speak for myself

#

😌

dawn hazel
tardy delta
#

uh well what does it expect from parameter

ashen quest
#

btw does anyone know any open source spigot library/util stuff that look forward to contributions?

tardy delta
#

String... ig then

waxen plinth
#

Yea

ashen quest
#

send link 🔫

waxen plinth
#

I have one that could use some contributors

paper falcon
ashen quest
#

send link 🔫 x2

paper viper
waxen plinth
ashen quest
dawn hazel
#

its expecting a string thats why

quiet ice
#

Vault 2.0 is going to be a thing, and it's best to engage in that now

ashen quest
lost matrix
#
std::copy(std::begin(arr1), std::end(arr1), std::back_inserter(arr2));
paper viper
#

Beuhhhh

waxen plinth
#

It's a command processing library that has a mostly-finished core but needs a lot of other stuff to be ready

ashen quest
#

u dont have any issues?

waxen plinth
#

No cause I'm solo lol

ashen quest
paper viper
#

I want to convert all the super long constants into a JSON file

quiet ice
paper viper
#

Speaking of which you heard about DeluxeChat correct?

quiet ice
#

(though I would need to have some solution that doesn't have terribly shit iteration time)

waxen plinth
#

The only flaw is that there isn't enough of it

paper viper
#

There is a upcoming DeluxeChat 2.0 called ChatChat which is open source and made from HelpChat

ashen quest
paper viper
ashen quest
#

ok this is fun i might add to this

opal juniper
paper viper
#

And also by hc

tardy delta
#

love for acf

#

💀

dawn hazel
# dawn hazel this doesnt work

i did some testing and this works

super("hub", "slashhub.use", new String[]{"1", "2"});```
but i cant do this
```java
super("hub", "slashhub.use", new String[]{String.valueOf(config.getStringList("CommandAliases"))});```
echo basalt
#

probably becuase you're converting a list to a single string, and then making an array out of that single string

tardy delta
#

String.valueOf(List<String>) makes sense that you cant do that

dawn hazel
#

if i try to put it in without string.valueof it gives me an error

tardy delta
#

i'd rather take a string list as parameter instead of an array in this case tbh

paper viper
#

Why would you use string valueOf here

echo basalt
#

are you even trying to understand what you're writing

paper viper
#

Doesn’t make sense

dawn hazel
tardy delta
#

well smth else: are jdbc resultsets and statements closed when the connection they share is closed?

dawn hazel
#

ill do some more digging

tardy delta
#

depends on the impl says stackoverflow

ivory sleet
#

They are basically invalid at that point

tardy delta
#

but they can still lead to memory leaks?

ivory sleet
#

Idr exactly how the implementation was but it’s always smart to use auto closables with try-with-resources

#

But if I’d guess, once you close the connection that should also stop resource consumption of statements and result sets etc

tardy delta
#

hmm

#

well ye uhh

dawn hazel
#

i need to convert it from a list to an array

#

developer moment

tardy delta
#

or you write constructors that accepts both

dawn hazel
#

bungee api

lost matrix
# paper falcon **I** wouldn't call it a small one lol. I thought someone'd give me guide how to...

With crunch i would simply create a class like this:

public class SolvableExpression {

  @Getter
  private final String readable;
  private final double epsilon;
  private final double result;

  public SolvableExpression(String input, double epsilon) {
    this.readable = input;
    this.epsilon = epsilon;
    CompiledExpression expression = Crunch.compileExpression(input);
    this.result = expression.evaluate();
  }

  public boolean isResult(String input) {
    return (input.equals("true") ? OptionalDouble.of(1.0) : input.equals("false") ? OptionalDouble.of(0.0) : safeParse(input))
            .stream()
            .mapToObj(out -> Math.abs(out - result) < epsilon)
            .findAny()
            .orElse(false);
  }

  private OptionalDouble safeParse(String input) {
    try {
      return OptionalDouble.of(Double.parseDouble(input));
    } catch (NumberFormatException exception) {
      return OptionalDouble.empty();
    }
  }

}

And then get a bunch of expressions from a config file and randomly cycle through them.
Then listen for the chat event and check if the input solves the currently active SolvableExpression.

twilit roost
#

Any idea how to create particle cloud?
so I can make something like this?

river oracle
#

aren't there fire particles u cud prob combine cloud and fire particle to make fancy thing

lost matrix
twilit roost
#

random cloud
but cone will do if its easier

lost matrix
#

You can give fire particles a direction

twilit roost
#

ye ikr but there would be gaps between them

lost matrix
#

Or you just spawn them with a random xyz offset

lost matrix
twilit roost
#

my current setup is lines of fire going from location of my hand

lost matrix
twilit roost
#

w.spawnParticle(Particle.FLAME, rightHand.getX(), rightHand.getY(), rightHand.getZ(), 0, direction.getX(), direction.getY(), direction.getZ(),velocity , null);

lost matrix
twilit roost
#

would Random with bounds do?

lost matrix
#

XD using random without bounds would be wild.

river oracle
#

hell yea do it without bounds

#

lets see this shit

twilit roost
#

imma bump up those particle numbers for this

#

what should I bound it to?

#

45°?

lost matrix
#

i would start at 20°

#

And show us how you doing this. Because i dont think spigot has good methods to achieve this

twilit roost
#

what if I would do for loop going to 10 and it would up X,Y,Z by X + Math.PI*i ?

#

but that would go up to 31 degrees..

#

imma try this and then go try that Random method

for(int i = 0;i==20;i++){
    double x = direction.getX() + Math.PI*i;
    double y = direction.getY() + Math.PI*i;
    double z = direction.getZ() + Math.PI*i;
    w.spawnParticle(Particle.FLAME, rightHand.getX(), rightHand.getY(), rightHand.getZ(), 0, x, y, z, velocity, null);
}
lost matrix
#

Well... This is some randomly assembled math. Did you just throw PI in there and hoped it would turn out trigenometric somehow?

twilit roost
#

ye :DD

river oracle
#

good philosophy

#

if you throw pi at it, there is a slight chance it may look circular

twilit roost
#

creates sort of cone but in sky
imma try adding those random values to direction

lost matrix
twilit roost
#
Random random = new Random();
double x = random.nextDouble(20) + direction.getX();
double y = random.nextDouble(20) + direction.getY();
double z = random.nextDouble(20) + direction.getZ();
w.spawnParticle(Particle.FLAME, rightHand.getX(), rightHand.getY(), rightHand.getZ(), 0, x, y, z, velocity, null);

no particles in sight

twilit roost
eternal oxide
#

This draws a circle on the floor, just change it to vertical and expand out in a direction.```java
private void drawCircle(Location loc, float radius) {

    for (float r = 0.1f; r < radius; r += 0.1f) {
        for (double t = 0; t < radius * 25; t += 0.5) {

            float x = r * (float) Math.sin(t);
            float z = r * (float) Math.cos(t);

            loc.getWorld().spawnParticle(Particle.REDSTONE,
                    loc.clone().add(x, 0.5, z), 1,
                    new Particle.DustOptions(Color.PURPLE, 1));
        }
    }
}```
twilit roost
#

thx

lost matrix
# twilit roost ooh so just setting pitch/yaw
  public void randomAngleOffset(Vector vector, double limit) {
    ThreadLocalRandom random = ThreadLocalRandom.current();
    vector.rotateAroundX(random.nextDouble(-limit, limit));
    vector.rotateAroundY(random.nextDouble(-limit, limit));
    vector.rotateAroundZ(random.nextDouble(-limit, limit));
  }

Try this one. Might work. Might be fked.

twilit roost
twilit roost
#

emm wth :DD

#

"charli deepfakes"

quaint mantle
#

can someone help me in spigot 1

#

im workingn on smth

lost matrix
#

?ask

undone axleBOT
#

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

golden turret
#

is there any packet sent to the server when the client clicks in the "done" button of a book?

radiant aspen
#

it might call inventory close event?

#

..... do books count as inventories 🤔

eternal oxide
slim brook
#

Hello ! I have question about #getName of Inventory in 1.19. It's disappeared ?

elder blaze
#

Hi! I have a little question... How I create a custom TabList in Spigot 1.12.2?

lost matrix
river oracle
#

i believe using .equals is the proper practice ^

slim brook
lost matrix
elder blaze
lost matrix
slim brook
#

Ok ok thx

elder blaze
lost matrix
elder blaze
#

I use many versions

#

in the server

opal oasis
#

i still cannot find out a way to make it so i can give a error message if a item amount isn't a number

#

could anyone add the part of the code to make it like that and maybe ill find out why it works. i am usually good at that

lost matrix
#

I need context for that... an item amount is always a number

opal oasis
#

yeah so like for example if i put a letter instead of a number

eternal oxide
#

we gave you at least two ways to detect if its a number

opal oasis
#

it gives me like a server error but i want to do a custom error and not a malfuction

quiet ice
#

then catch the error?

river oracle
quiet ice
#

try-catch is a powerfull tool

elder blaze
#

In the scheduleSyncRepeatingTask arg2 and arg3 what are for?

river oracle
#

ignore me essentially copy pasting what someone put earlier lmfao

lost matrix
kindred valley
#

Is there any project idea links do you have?

elder blaze
waxen plinth
#

Read javadocs