#help-development

1 messages · Page 620 of 1

young knoll
#

Pretty sure the bounding box class even has methods to get the middle

lilac dagger
#

(x1 + x2)/2

umbral ridge
#

How do I do that? distance these two locations and half it?

#

or how

lilac dagger
#

for all 3 coords

umbral ridge
#

hmm

lilac dagger
#

and that's the middle

umbral ridge
#

I'll try it

zealous osprey
#

Make a vec from point A to point B and half it; The spigot API has a method for doing that I believe

umbral ridge
#

Thank you all for immidiate response xD

#

I'll try to implement it

ivory sleet
#

na

zealous osprey
#

Is it unmodifieable?

umbral ridge
#

That worked

#

thanks

native bramble
#

how can i create enchanted book which will works in anvils?

young knoll
#

Make sure to use EnchantmentStorageMeta#addStoredEnchantment

native bramble
#

i have this itemstack:

ItemStack smite = new ItemStack(Material.ENCHANTED_BOOK, 1);
smite.addUnsafeEnchantment(Enchantment.DAMAGE_UNDEAD, 1);
native bramble
#

ebat`

#

thank u

umbral ridge
#

Doesn't enderpearl throw fire a PlayerTeleportEvent

#

how else can I prevent it? Eg. if it landed in certain location

#

Would I manually have to check for all of this in ProjectileLaunchEvent?...

hybrid spoke
young knoll
#

It should fire a teleport event

#

When it lands

umbral ridge
#

huh

#

Let me recheck

fervent robin
#

Use event#getCause() and check if its TeleportCause.ENDER_PEARL

umbral ridge
#

of course

#

i forgot to register it

shadow night
#

Ender Pearls don't always do damage tho

young knoll
#

How is that relevent

shadow night
#

I misread

#

Lol

#

I thought it said DamageCause or something

novel kite
#

Is there any preprocess event/way to replicate a preprocess event for commands sent by command blocks?

novel kite
brisk estuary
#

Hey, I made a PersistentDataType of a MerchantRecipe list and it's working when the results and ingredients for the merchant recipes are ItemStacks. But when I try to use it with a subclass of ItemStack an error is thrown: https://pastebin.com/zxCrjs3L . Here's my MerchantRecipeListDataType class: https://pastebin.com/jBv1qQ0M. Does anybody know how to solve it?

wary harness
#

I am trying to build gradel project which I am pluling from git hub
and I am getting this error

Searched in the following locations:
    https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/bukkit-1.13.1-R0.1-SNAPSHOT.jar

it is asking for dependancy which I got in my repositories

#

what can I do to fix that problem

remote swallow
#

does it have mavenLocal() the dependencies block

wary harness
remote swallow
#

yeah

#

what github project is it

wary harness
#

I usualluy use maven so this is unknown are for me

remote swallow
#

drop the github link

wary harness
vapid verge
#

Does the lore of an item have a limit to what it shows? I have a banner with more than 6 patterns and it's cutting off after the 6th (in the lore), is it possible to show all the patterns?

wary harness
#

so link will not help you out

remote swallow
#

is it multi module

wary harness
#

but I think I got it

#

helped

remote swallow
#

ah

wary harness
#

Thanks anyway

young knoll
#

The game won’t show more than 6 automatically

vapid verge
#

The data is there I've noticed. I have just to show it manually?

young knoll
#

Mhm

vapid verge
#

Oh so I have to set the lore for the banner, and explictly add in all the patterns. Makes sense, thanks.

river oracle
#

is there anyway I can utilize the API to make a custom LootTable for some chests I'm generating or do I just have to make my own system

young knoll
#

You need your own system

#

Or a datapack

river oracle
#

sadge life

#

:( i just wanted to finish this commission

#

now I need to make some loot table system

#

yay Json parsing! yay randomizing and stuff! Yay learning how tf loottables work!!

river oracle
#

?paste

undone axleBOT
vapid verge
#

Could you just implement loot table to create a new loot table?

young knoll
#

Nah you can’t

ashen cape
#

help for displaying the image of an item on the texture of a block

river oracle
#

it'd be more easy to just implement something yourself at that point

#

So I'm mocking up what I want my loot-table to look like , but I'm curious what would drop-chance really entail. I see it on a lot of loot tables I'm using for example, but what does it really mean, how would I go about implementing it. for example entry one has a drop chance of 40%, and entry two has a drop chance of 30%, How would I setup choosing between entry, one or two, also what would happen if it doesn't add up to 100? would things just not drop? I honestly haven't the slightest clue how to implement this.

I mean I haven't done drop chances in so long I forgot how to do basic weighted percentages, let alone a whole loot table

https://paste.md-5.net/owuvedalas.json

young knoll
#

I thought it was weight based

ember estuary
#

Is it possible to open the clients chat and prefill it with some command, so that the user only has to complete it (by typing a username, for example) and press enter?

river oracle
#

Its been literally 3 years now since I've done weight based percentages, (yeah last time I did them it was in python lol)

young knoll
#

Stack overflow had a good post on weighted random

river oracle
#

do you know link otherwise I'll just look it up later

#

my brain is busted so I'm takinga break

young knoll
grim oak
#

Is there a way I can block a specific command

#

And all its variations

#

like 'enderchest' 'echest' 'ec', but without having to do each one individually

eternal oxide
#

permissions

grim oak
#

hmm yeah

eternal oxide
#

commands and their aliases use a single permission

grim oak
#

Yeah

#

ty

deft thistle
#

Anyome mind helping in facing a nnnoying issue
I was at first using paper api, but changed to spigot. The problem is that, even though I changed the stuff in the pom maven file the plugin still generates a paper-plugin.yml file once it compiles. I also did remove the paper-plugin.yml from the resources folder, but it keeps creating one when the plugin compiles (nothing on the ide resources folder though). Any help?

eternal oxide
#

probably using the intelij minecraft plugin

deft thistle
#

yes

eternal oxide
#

I don;t use it so can;t help there

#

its that plugin creating the yml

remote swallow
#

iirc it only creates it on project creation

chrome beacon
#

^

deft thistle
#

oh deleting the target folder fixed it

#

lol

brisk estuary
#

Error when deserializing an instance of a subclass of ItemStack

vapid verge
#

What is the text shown when you over a banner and it shows what the patterns are? That doesn't seem to be the more. Is that something that can be modified?

stiff knot
vapid verge
#

Can I add to it? I don't want deal with making logic for removing and adding lore lmao

chrome beacon
#

You need to use lore

vapid verge
#

Probably not going to deal with it right now then. Thanks though.

candid kindle
#

opened intellij today and its being really weird about importing anything

eternal night
#

Try to smack the repair button in the "File" heading

candid kindle
#

seemed to work, thanks

frosty geyser
#

hi was trying to use eyes of ender with one of my plugins and to cancel the throw event but when trying to use Material.ENDER_EYE or EntityType.ENDER_SIGNAL I get Unknown class: 'Material.ENDER_EYE' and Unknown class: 'Material.ENDER_SIGNAL' Don't have a clue why exactly. Currently using spigot 1.19.4-R0.1

eternal oxide
#

missing import, or you imported the Minecraft Material instea fo Bukkit

frosty geyser
#

its using org.bukkit.entity.EntityType; & org.bukkit.Material;

#

and all other items work

stiff knot
#
class StaffChat {

    private val statesMap: MutableMap<UUID, Boolean> = HashMap()
    private var mm = MiniMessage.miniMessage()

    private fun setState(player: Player, state: Boolean) {
        statesMap[player.uniqueId] = state
        for ((key, value) in statesMap) {
            println("$key: $value")
        }
    }

    fun toggleState(player: Player) {
        val state = getState(player)
        setState(player, !state)
        player.sendMessage(mm.deserialize("<${if (state) "green" else "red"}>Staff chat ${if (state) "enabled" else "disabled"}"))
    }

    fun getState(player: Player): Boolean {
        if (!statesMap.containsKey(player.uniqueId)) {
            statesMap[player.uniqueId] = false
        }
        return statesMap[player.uniqueId]!!
    }

    fun sendMsg(player: Player, message: String) {
        for (onlinePlayer in player.server.onlinePlayers) {
            if (onlinePlayer.hasPermission("void.staff")) {
                onlinePlayer.sendMessage(mm.deserialize("<aqua><bold>Staff<reset> <dark_gray>→<reset> <aqua>${player.name}<reset><dark_gray>:<reset> $message"))
            }
        }
    }
}

I'm attempting to make a staff chat toggle, does anyone know why my toggle function isn't working? Every time it runs it stays as True for some reason

frosty geyser
#

it's just Eye of enders

#

Actually I was just really dumb, my bad, I was using instanceof to check if two things are correct

ornate patio
#

what's the best way to make an item that is usally stackable non-stackable

#

I was thinking of just setting some random key of the item's PDC to a random uuid

young knoll
#

Yeah that’s pretty much the way

ornate patio
#

alright thanks

zenith gate
#

?paste for me...

undone axleBOT
river oracle
young knoll
#

The navigable map one?

#

Two elements weighted at 50 means an equal chance to choose either

river oracle
#

since its a Double, E not E, Double

#

the second put call would overwrite the first element no?

young knoll
#

No

#

Because the second one would be 100

river oracle
#

oh true

#

smh I'm so dumb

umbral ridge
#

I implemented this, on the sides it somewhat works but it's glitchy, on top I'm bouncing the player off from the block in the center of the region. But it's not consistent. Sometimes players will get stuck on top of it, not being able to move, it happens randomly, should I use a different approach to this instead of just checking if player y axis is the same (or lower) than the maximum region y axis?

Here's how I handle it, a code snippet for an example:

@EventHandler(ignoreCancelled = true)
public void onPlayerMove(org.bukkit.event.player.PlayerMoveEvent event) {

  Player player = event.getPlayer();
  Location from = event.getFrom();
  Location to = event.getTo();

  // minimalize location checking
  if (from.getBlockX() == to.getBlockX() && 
      from.getBlockY() == to.getBlockY() && 
      from.getBlockZ() == to.getBlockZ())
      return;

  ... // region checking handling, etc..
  
  if (currentYAxis == maxRegionYAxis) { // if player jumped on top
     Location middleLocation = regionData.getMiddleLocation();
     event.setTo(middleLocation);

    // disable fall damage
    player.setFallDistance(0);

    Vector direction = from.toVector().subtract(middleLocation.toVector()).normalize();
    player.setVelocity(direction.multiply(1));
    ...
    // if I attempt to cancel the event, player won't "bounce" back
  }
}```
eternal oxide
#

you are having trouble finding the middle of two locations?

umbral ridge
#

No I've calculated that, but the player gets stuck on top of the region sometimes, only on top

#

Sometimes it would bounce the player away and sometimes, randomly it would just not do anything, the player would be stuck at the region highest y axis

eternal oxide
#

a cleaner return can be if (from.getBlock().equals(to.getBlock())) return;

sharp bough
#

what could be causing something like this? GC removes all of them tho

umbral ridge
eternal oxide
#

to replace your current early return

umbral ridge
#

before currentYAxis == maxRegionYAxis?

eternal oxide
#

the // minimalize location checking

umbral ridge
#

Ok!

eternal oxide
#

your direction calculation also seems to be reversed

umbral ridge
#

can I send you a short video of what it does?

eternal oxide
#

depends if you want to bounce them towards or away from middle

umbral ridge
#

I want you to understand it

#

one sec

#

Look at this

eternal oxide
#

ok direction looks fine then

#

it looks like you get "stuck" if you move during you being pushed when still close to middle

#

which means you have a short vector

umbral ridge
#

How can I fix it? xD

eternal oxide
#

probably zero

umbral ridge
#

Setting player vector to 0?

eternal oxide
#

ensure you set a minimum velocity

#

so check it's length

umbral ridge
#

The velocity is basically how player can jump back

#

So how can i

eternal oxide
#

multiply by 1 does nothing

umbral ridge
#

yes but i can adjust that xD I guess

#

So I should set this to 0?

eternal oxide
#

check the length of the vector you are setting

#

debug it

#

direction.length

umbral ridge
#

Yeah 1 sec

#

Now for some weird reason can't get stuck anymore

#

I'll try

eternal oxide
#

does it show a length of 1 when you get "stuck"?

#

ah ok

umbral ridge
#

ok I got stuck

#

yeah it shows 1.0

eternal oxide
#

debug the vector then. make sure it's throwing you up every time

#

check the Y value

#

if Y goes negative then your center calculation is probably bad

umbral ridge
#

Let me test this

umbral ridge
eternal oxide
#

no

umbral ridge
#

yaw?

eternal oxide
#

y value of teh direction vector

umbral ridge
#

Ok testing it now

#

I got stuck at this

eternal oxide
#

looks fine

umbral ridge
#

Then what else could there be

eternal oxide
#

could you be colliding with a block?

umbral ridge
#

Can I send you the full code in DMs?

#

of an event

eternal oxide
#

nope

umbral ridge
#

don't feel like posting it here

#

I wasn't colliding with a block

#

again, glitched at y=0.7

eternal oxide
#

vector is fine

#

so somethign else is stopping you

ember estuary
#

I created an inventory using

Bukkit.createInventory(player, InventoryType.ANVIL, "Custom Title")

But when i now try to get the rename text, when clicking the item (and therefore renaming it)

((AnvilInventory) e.getInventory()).getRenameText()

i get an exception:

ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.inventory.CraftInventoryCustom cannot be cast to class org.bukkit.inventory.AnvilInventory (org.bukkit.craftbukkit.v1_19_R1.inventory.CraftInventoryCustom and org.bukkit.inventory.AnvilInventory are in unnamed module of loader java.net.URLClassLoader @3b764bce)

Why / How to solve this?

orchid trout
#

what event are you listening for?

ember estuary
#

onInventoryClick

orchid trout
#

anvils have their own events

ember estuary
#

oh, which is it

orchid trout
#

idk

#

?docs

ember estuary
#

ok ill try to google it

orchid trout
#

?jd-s

undone axleBOT
orchid trout
#

PrepareAnvilEvent

ember estuary
#

the only one i can see is PrepareAnvilEvent

#

thats called when u edit the item?

#

oh wow

#

what a weird naming then

orchid trout
#

eh

#

it makes sense

ember estuary
#

how?

#

the doc says "Called when an item is put in a slot for repair by an anvil."
I dont think its called when you edit the item (by clicking on the result)

#

But i can try.

orchid trout
#

you can edit the item in the prepareanvil event

ember estuary
#

no but i want to detect the player editing the item, by clicking on the result on the right

orchid trout
#

when you put an item in the item + item thing, the event is called

#

and you can put items in the output

#

idk if you can chekc if the item was picked up

#

maybe checking if an item has been added to the player's inventory

ember estuary
#

i need to detect when this is clicked

orchid trout
#

yeah idk

ember estuary
#

the item on the right

#

it fires the onInventoryClick

#

but yeah, classcastexception ..

remote swallow
#

anvil prepare item event

ember estuary
#

thats also in prepare?

remote swallow
#

yeah

visual laurel
#

how can i fix this error:

16.07 00:12:46 [Server] [INFO] java.lang.NullPointerException: Cannot invoke "java.sql.Connection.createStatement()" because "this.databaseConnection" is null
16.07 00:12:46 [Server] [INFO] at dev.bentech.statisticsplus.StatisticsAPI.createTables(StatisticsAPI.java:22) ~[StatisticsPlus-1.0-SNAPSHOT.jar:?]
16.07 00:12:46 [Server] [INFO] at dev.bentech.statisticsplus.StatisticsAPI.onEnable(StatisticsAPI.java:82) ~[StatisticsPlus-1.0-SNAPSHOT.jar:?]
16.07 00:12:46 [Server] [INFO] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[purpur-api-1.19.4-R0.1-SNAPSHOT.jar:?]
16.07 00:12:46 [Server] [INFO] at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[purpur-1.19.4.jar:git-Purpur-"6886272"]
16.07 00:12:46 [Server] [INFO] at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[purpur-1.19.4.jar:git-Purpur-"6886272"]
16.07 00:12:46 [Server] [INFO] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[purpur-api-1.19.4-R0.1-SNAPSHOT.jar:?]
16.07 00:12:46 [Server] [INFO] at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugin(CraftServer.java:577) ~[purpur-1.19.4.jar:git-Purpur-"6886272"]
16.07 00:12:46 [Server] [INFO] at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugins(CraftServer.java:488) ~[purpur-1.19.4.jar:git-Purpur-"6886272"]
16.07 00:12:46 [Server] [INFO] at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:643) ~[purpur-1.19.4.jar:git-Purpur-"6886272"]
16.07 00:12:46 [Server] [INFO] at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:442) ~[purpur-1.19.4.jar:git-Purpur-"6886272"]
16.07 00:12:46 [Server] [INFO] at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:345) ~[purpur-1.19.4.jar:git-Purpur-"6886272"]
16.07 00:12:46 [Server] [INFO] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1120) ~[purpur-1.19.4.jar:git-Purpur-"6886272"]
16.07 00:12:46 [Server] [INFO] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:325) ~[purpur-1.19.4.jar:git-Purpur-"6886272"]
16.07 00:12:46 [Server] [INFO] at java.lang.Thread.run(Thread.java:833) ~[?:?]
16.07 00:12:46 [Server] [INFO] [StatisticsAPI] Disabling StatisticsAPI v1.0-SNAPSHOT`

heres my code: https://paste.md-5.net/ahodameziz.js

ember estuary
#

please adjust the documentation then xD

#

and ty

remote swallow
#

get the result item

orchid trout
visual laurel
#

ah

#

ty

ember estuary
# remote swallow anvil prepare item event

Does not seem to get called with fake anvil inventories, only with real ones :(
When i change the name of an item in a real anvil, it triggers PrepareAnvilEvent every time
But when i change the name of the item in the fake anvil, which i made with Bukkit.createInventory, the event doesnt trigger once .... hmmmm

#

and i also cant take the resulting item out, whenever i click it, it just resets to the default again

visual laurel
# orchid trout because you create tables before establishing a connection

im getting the same error with a playerjoinevent

@EventHandler
    public void onJoin(PlayerJoinEvent event) {
        if (event.getPlayer().hasPlayedBefore()){
            try {
                Statement statement = databaseConnection.createStatement();
                String createUser = "INSERT INTO `" + tablePrefix + "statistics` (`player_name`, `player_uuid`, `playtime`, `blocks_mined`, `kills`, `chat_messages_sent`, `deaths`, `xp`, `balance`, `blocks_placed`) VALUES ('" + event.getPlayer().getName().toLowerCase(Locale.ROOT) + "', '" + event.getPlayer().getUniqueId() + "', '0', '0', '0', '0', '0', '0', '0', '0')";
                statement.executeUpdate(createUser);
                statement.close();
            } catch (SQLException e){
                getLogger().warning("Error creating Player Row: " + e.getMessage());
                e.printStackTrace();
            }
        }
    }
ember estuary
#

thats what i mean with "resets to default"

#

Not cancelling any event, so idk what causes this... is this normal with fake inventories?

#

Do fake inventories created via Bukkit.createInventory not trigger their respective events when stuff happens in them?

young knoll
#

I think it’s mostly the anvil one that’s wacky

#

Normal chest ones work fine

ember estuary
#

do you know how i can get an AnvilInventory from the CraftInventoryCustom?

orchid trout
#

because its cleaner

ember estuary
#

e.getCurrentItem() is null too, so its not in my hand either, ig

#

Am i doing something wrong, or is Bukkit.createInventory(player, InventoryType.ANVIL just completely broken and unusable?

#

(if so, maybe mark it as deprecated?)

vapid verge
#

Is there a click called when you shift click an item?

zenith gate
#

called SHIFT_RIGHT or SHIFT_LEFT

#

theres more in there too.

#
ItemStack item = player.getInventory().getItemInMainHand();
ItemMeta itemMeta = item.getItemMeta();

itemMeta.getDisplayName();

what reasons would make the displayName return nothing?

young knoll
#

null?

#

If you haven’t set a display name

valid root
#

Btw u can use

item.hasItemMeta()

Or smth like that

zenith gate
# young knoll If you haven’t set a display name

thats the thing, I check if they no name on the command. if it doesnt then it wont work. but this goes on, it gives me my ticket with a blank display name. like that item didnt have one, when i know it did because i held it.

young knoll
#

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

ember estuary
#

I added a maven-shade-plugin to my pom.xml (because the AnvilGUI wants to be included in the Jar) and now i'm getting this error: java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolManager.addPacketListener(com.comphenix.protocol.events.PacketListener)" because the return value of "com.comphenix.protocol.ProtocolLibrary.getProtocolManager()" is null
Why is that?

#

I'm also getting this warning then clicking "install" in maven:
[WARNING] MapMenu-1.0.jar, ProtocolLib-4.8.0.jar define 1 overlapping resource:
[WARNING] - plugin.yml

zenith gate
#

?paste

undone axleBOT
zenith gate
#

for me ^

zenith gate
ember estuary
vapid verge
#

I didn’t realize those click were types lmfao. Ok yeah that’s easy.

quaint mantle
#

Can someone please help me? I am using SuperiorSkyBlock2 and the /is upgrades are not showing

vital sandal
#

Is there an docs about client-side items :l?

noble lantern
#

Love how I take a break for ONE WEEK and basic java breaks.... what???? Why the fuck aint this message firing it 100% should be

#

like... wha?

#

And my logs are acting up too.... Its like certain things (Lets say MongoDB's logs, but in my case its Spark rest logs) arent showing up either, wtf going on with my CLI?

#

wtf even if i empty the convertToOgg method to empty with only the log it doesnt fire.... what???

#

Why is java ignoring my instructions? Arent computers supposed to execute instructions i give them?

#

? What the actual fuck?

#

No errors no nothing...

worldly ingot
#

Could be some file permission issue

shadow owl
noble lantern
noble lantern
# shadow owl what is ffExecutor?

Its just a class i sent it in the screenshot above ^ i even emptied that method out to only contain a log and it has same behvaiour, see recent screenshot

#

lmao what ???

#

even a new method does nothing??

#

something aint right here...

vital sandal
#

Why blockPhysicEvents called like 6 times ?

shadow owl
noble lantern
#

idk how to even do that

#

so it should be default

shadow owl
noble lantern
#

tried everything nothings fired

#

even raw System.out.prinlnt and throwing exceptions, it just acts like they dont exist

shadow owl
#

ok fair, out of thoughts for now then

#

Are you using maven to build?

noble lantern
#

yee

shadow owl
#

If so try a maven clean build/package (whatever you're using, clean is the important part), maybe restart IDE as well. Could be some weird caching thing

noble lantern
#

havent tried invalidating caches since my refactor ill try that

shadow owl
#

clean will delete all previously compiled files, forcing maven to recompile everything, may be worth a shot as well

noble lantern
#

thats what clean does

shadow owl
#

yea...

noble lantern
#

same behavior sadly

shadow owl
#

:\ ok out of ideas

buoyant viper
#

/killyourself

#

and it just kills U

#

oh wait ur having code issues

#

not a creative burnout

#

woops

noble lantern
#

more like a java is absolutely dumb issue

#

absolutely n oreason a error or my message shouldnt be logged rn

#

kinda bullshit ngl

shadow night
#

Java is annoying sometimes

noble lantern
#

it rly is

#

i would really like to know why my cli is so fucked and not showing my spring, spark or mongodb logs though

#

thats prolly like 40% of the issue tbh

#

never upgrading my gpu again smh

shadow night
#

I can bet the issue will be like you missed one letter or something lol

noble lantern
#

im suspecting that ffmpeg isnt initialized for some reason

#

but, i should be getting an error

#

im not catching this anywhere or using sneaky throws so not sure why loggings fucked

shadow night
#

Java as always

#

Maybe you are catching it and it's just hidden

noble lantern
#

well i immediately throw any catches i grab and i dont catch generic Exception i specify the exceptions i want to catch

#

yep, that was the issue

Now the big question: Why the fuck didnt that throw an error during runtime? Is it possible my global java logger is set to ignore errors for some reason?

#

when attempting to use a class thats not initialized its always thrown errors

shadow night
#

Well, everythings possible, this is java

noble lantern
#

idk i just want my console how it was a week ago

#

its like this on any java application i open too

shadow night
#

Doesn't java have like a settings panel?

buoyant viper
#

well

#

yes

#

but its pretty ... strange

#

ive only ever used it on mac (and i honestly forget why), i think the button to access it on windows is hidden away in Control Panel

quaint mantle
#

Do I need to call save on a fileconfiguration file after setting smth?

buoyant viper
#

possibly

quaint mantle
#

Wait if I am accessing a FileConfiguration from another plugin is there any reason that they would be overriding my changes?

noble lantern
#

oh god im horrible at this, was gonna make the file size for this smaller and i ended up making it 4x the size (was like 133mb)

noble lantern
#

And let alone editing said file

quaint mantle
noble lantern
#

fair enough

Yes, depending on the plugin though your changes will get overwriten

#

You need to actually make the plugin support addons & support modifying player data

#

As most just periodically flash theyre HashMaps of PlayerData (If you find this, you can edit data this way possibly)

#

But, likely not since most decent plugins are gonna make a Data class, and not just store a bunch of FC's in a HashMap

quaint mantle
#

Ideally I would use that but I don't believe they do, its not my plugin and im just devving something simple, if needed Ig I can just implement a barebones system myself

grizzled oasis
#

im trying to make a multiplier system and im using TimeUnit to save the time the player has for the multiplier inside the database but how can i check two times between now and the time saved in the database?

vital sandal
#

How to remove blockdrop from BlockPhysicsEvent?

#

event.getBlock().getDrops().clear() but no luck

jovial verge
#

[04:44:51 INFO]: /103.166.13.64:52843 lost connection: If you wish to use IP forwarding, please enable it in your BungeeCord config as well!

#

Whats This eror

sullen marlin
#

exactly what it says

#

you enabled bungee ip forwarding in spigot but not bungee

jovial verge
#

How to enable It

vast ledge
#

in the config of bungee

vast ledge
#

Line 16 spigot.yml

vast ledge
jovial verge
#

Ok

fallen anvil
#

Does Spigot Interaction entity return it's data properly?

#

I'm getting 0.0 width and height

#

setting it seems to work though

grizzled oasis
#

sorry for the really late ping but that's something the only thing i realized and probably i need it to instant and instant already supports "placeholder" like this there's a method for that, TimeUnit cannot be saved inside mongo so this creates some problems and for clarification im using it for a multiplier system

echo basalt
#

You parse the time as seconds and add it to the current epoch

grizzled oasis
#

found a way to translate them via Duration.parse("PT" + duration)

#

Problem, i wated 10 minutes the system should work after 10 minutes but it doesn't
Runner: https://paste.md-5.net/azovohujag.cs
Multiplier Class: https://paste.md-5.net/ularidoqew.java
How i set it up: ```java
UserManager.setMultipliers(commandSender.getUniqueId(), new Multiplier(1, Duration.parse("PT10M").toString()));

This is what it logs in console as an example when i tested the if it worked
[09:17:11 INFO]: multiplier: 2023-07-16T07:18:11.204696100Z
[09:17:11 INFO]: Instant: 2023-07-16T07:17:11.274935900Z
every time the multiplier value goes 1 minutes after the instant one
vital sandal
#

piston push break the BlockPhysicsEvent ?

orchid trout
#

how do i change the player's nametag

umbral ridge
orchid trout
#

with team prefixes?

umbral ridge
#

Yeah

orchid trout
#

i tried that

#

nametag stayed the same

umbral ridge
#

It's best if you write a wrapper for it so you can then use it further on

#

How did you try to change it?

orchid trout
#

with the api

#

i have to do it with packets?

echo basalt
#

Nah

#

packets are never needed for this kind of stuff

umbral ridge
#

How would I teleport the player around the certain area that is x and y in width?

orchid trout
#

ill try it again

primal stirrup
#

Hi there,
I have made a hologram with an item name, and have some item names in my GUI.
The only issue that I am having is that I would like to show the clients language item names.
So if I have set my client to German it will use the German item names and so on.
How would I be able to do this?

echo basalt
#

If you're using paper this is like 15x easier

echo basalt
primal stirrup
#

The issue is that the whole project has been made with spigot.
Changing it to paper will take a long time and time that I don't have XD

#

as much as I love to do it tho

eternal night
#

paper API is compatible with spigot API, you literally just swap out the dependencies

primal stirrup
#

LOL

#

let me check

eternal night
#

Like, you are probably gonna get clapped with a shit load of deprecation warnings for all methods that should be using components

#

but it'll compile

primal stirrup
#

It keeps saying this

#

No idea why and because of what

#

The whole dependencie is good

grim oak
#

Hi, does anyone know if Bukkit.getPlayer(uuid) works for players joining via Geyser (bedrock edition)?

orchid trout
#

i didnt add display name while trying it

echo basalt
orchid trout
#

ok thanks

echo basalt
#

Ugh why are you using a static collection on your usermanager

#

static abuse

#

?learnjava

undone axleBOT
echo basalt
#

I've ran out of patience

buoyant viper
#

me personally

#

i love static electricity @echo basalt

#

but i guess others may finding that... shocking...

umbral ridge
#

is this generated by chatgpt

#

XD

vivid cave
#

lol

grizzled oasis
vivid cave
#

omg i hate so much when i'm abstract programming

echo basalt
vivid cave
#

only making the structures/signatures

#

but not implementing anything

#

it's so much pain

umbral ridge
native pebble
echo basalt
#

I was writing the static guide on discord and it crashed so I wrote it in notepad++ and did a couple word changes here and there

native pebble
#

Java is inherently OOP, but not enforce you to use OOP, it is a Multi paradigm you can also FP

grizzled oasis
#

so after this, any fix for the problem?

native pebble
#

I can use all functions as static in point of FP paradigm

echo basalt
#

disappointment I'm not looking for feedback

grizzled oasis
#

i know static abuse etcs

echo basalt
#

No need to show how smart you are

native pebble
#

I'm not to show you about that

#

I'm just saying your comments seems "static" is bad

echo basalt
#

The guide's audience is beginners so talking about paradigms is just going to overcomplicate things

echo basalt
#

And I touch on that

sullen marlin
#

You gotta shift the paradigm

native pebble
#

Yes I just concerend that it can make people to think "static" is bad, not just static, static "state" the other side your comments helpful

grizzled oasis
#

i started a war. only for counting time

native pebble
#

This is for all paradigm static state is bad in most cases

#

Not just for single paradigm

umbral ridge
#

chilling in offline mode xD

last abyss
#

Hi, sorry for inconvenience.
I would know if the programmation of creation of an inventory customise is different between minecraft 1.8 and 1.18 ?
I'm a minecraft developper begginer, i start yesterday

chrome beacon
#

Not much of a difference

#

also I hope you know some basic Java

grizzled oasis
last abyss
pallid oxide
#

So click components dont work in 1.20.1 anymore? Spigots component api and minimessage both dont work
client says
Not allowed to run command with signed argument from click event:
Any workarounds or ways to fix?

eternal night
#

you cannot force a client to run a command that requires signed arguments

#

e.g. /whisper

vivid cave
#

Tbh, I think it's always better to learn programming while having a project. Something concrete, something in which you just don't learn theory, but also usecases
But then when you have a project, people blame you for not knowing the language

eternal night
#

otherwise you'd be able to force them to write a "chat" message (e.g. whisper command) to another player

vivid cave
#

🤷🏻‍♂️

pallid oxide
eternal night
#

click commands are perfectly fine

#

they simply do not work for a specific set of commands as you'd otherwise be able to force a player to chat against their will

#

workaround would be you implementing a command that mirrors the functionality yourself

#

What command are you trying to run

pallid oxide
#

Oh okay so it depends how the commands are implemented, my plugin commands work fine

eternal night
#

yes

#

literally just /say and /whisper should "fail"

#

I might be missing a command, but those were implemented by mojang to support chat signatures, e.g. they can be reported to them via chat reporting

pallid oxide
#

I love it how minimessages docs has only examples with non working commands for the stuff l0l

eternal night
#

oh, yea maybe shoot them a PR to update the docs

#

to something that works

onyx fjord
#

The whole adventure wiki is pretty empty imo

pallid oxide
eternal night
#

Are you gonna shoot them a PR ?

onyx fjord
#

But that's still something, paper Dev tools have no documentation

eternal night
#

otherwise, I'd quickly give someone overthere at least a heads up

#

paper dev tools ?

#

do you mean paperweight kekw

onyx fjord
#

Paperweight

eternal night
#

has two extensive example repos wwith comments

#

¯_(ツ)_/¯

onyx fjord
#

I prefer documentation than code

eternal night
#

code documents itself

#

you should know that

onyx fjord
#

Not on a topic I know nothing about

#

Gradle plugins

eternal night
#

I mean, wwe are not gonna give you a documentation on the entirty of gradle plugins ??

onyx fjord
#

Isn't it written in kotlin btw?

eternal night
#

yes ?

#

the API of userdev is so terribly tiny

#

as to what users can consume

onyx fjord
#

I still have to guess what it does

eternal night
#

there is no use for a full blown docs page

#

if you are gonna dive into the codebase because you wanna do hacky shit

#

that is up to you

#

otherwise the only thing you do in userdev is
A) Add the plugin
B) define the depdency in the dependency block
C) run reobfJar

onyx fjord
#

Paper API has also no documentation the last time I checked there were like 2 pages

eternal night
#

You are free to contribute

onyx fjord
#

Not when I don't know how it works either?

eternal night
#

I mean, we don't add any terribly extensive API that is hard to understand

#

not yet at least

#

between javadocs and method naming, it should be trivial enough to figure out

buoyant viper
#

bc paper has javadocs, its a bit wonky to navigate to but its there

eternal night
buoyant viper
#

yeah

#

they really gotta link their javadocs somewhere on that page, the amount of times i click on Documentation on the papermc.io landing page expecting to see JavaDocs

eternal night
#

the javadocs should be linked on the main papermc docs

#

like in the footer

buoyant viper
#

it is but like

#

idk

eternal night
#

idk I just have it bookmarked 😅

buoyant viper
#

i shrimply do ?jd-s when i need docs

#

?jd-s AbsoluteHalal

undone axleBOT
eternal night
pallid oxide
eternal night
#

oki 🙂

onyx fjord
#

im just using minedown

#

its good but i wanna make my own one

buoyant viper
#

ill probably end up making something MM-like so i can use spigor components

#

and dont feel like depending on adventure

onyx fjord
#

yeah its pretty large shaded

eternal night
#

plain adventure api is large shaded ?

#

the serialisers are annoying af given they shade gson

dire marsh
#

in the old site it was quite easy to find

graceful aspen
#

||t||

umbral ridge
#

How do you determine if player is online or offline, just by having their name

eternal night
#

getPlayerExact

#

will return null if offline, non null if online

umbral ridge
#

Thanks!

onyx fjord
eternal night
#

Yea but adventure serialiser isn't spigot specific

icy bone
#

Got a question, Why are the DisplayBlock a little dark or lighter sometimes? And is there a way to make it the same brightness as the blocks around it? If i place a displayBLock next to some normal blocks, you can see which one is fake

eternal oxide
#

displays have their own light level

icy bone
#

Isthere a way to change the light level?

#

Because it also seems that some sides have different light levels

eternal oxide
#

?jd-s read the javadocs

undone axleBOT
native bramble
#
        at plugin.whiteplus.Utilities.Utils.hasItemEnchant(Utils.java:15) ~[WhitePlus-0.1.jar:?]
        at plugin.whiteplus.Utilities.Enchants.CustomMending.MendingListener.customMendItem(MendingListener.java:72) ~[WhitePlus-0.1.jar:?]```

```java
public static boolean hasItemEnchant(ItemStack item, Enchantment enchantment){
        if(!item.hasItemMeta()) return false;
        return ((EnchantmentStorageMeta) Objects.requireNonNull(item.getItemMeta())).hasStoredEnchant(enchantment);
    }

What im doing wrong?

eternal night
#

I mean, your item stack is not a enchanted book

#

I presume

native bramble
#

ohh

#

really

#

if i need to check enchantment on fishing rod what i need to do?

native bramble
#

ooo

#

ty

round finch
#

Storage enchantment is for enchantment books

#

So just enchantment for items etc

native bramble
#

yeah, thank u

#

its working

green prism
#

Poll: In 2023, for a good code base and good design, should lombok be used?

eternal oxide
#

personal choice, but using lombok makes code less readable to anyone who doesn't use lombok

orchid trout
#

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

#

i mean you can always google, but it doesnt make it that much clearer

warm mica
#

Lombok is a must have. Classes become cluttered and hard to read without out it = bad design

eternal oxide
#

boilerplate code != bad design

shadow night
#

What's lombok

upbeat fog
#

I need some help figuring out how to spawn custom mobs I made on given locations (7 locations) and the amount of mobs cannot exceed 14. I was thinking using an invisible armor stand to check the mobs count in a 50 block radius.

warm mica
#

And with many getters and setters, the complexity increases

eternal oxide
#

boilerplate != complex

warm mica
eternal oxide
#

which is exactly what lombok replaces, boilerplate code

umbral ridge
#

how does WorldEdit achieve multiple strings separated by comma in one command parameter and still get tab suggestions

#

tab suggestion is a list of strings yeah? So how?

shadow night
#

Well, It's done by checking for that stuff in tab completion

warm mica
umbral ridge
#

Yeah but if I have values eg.
["one", "two", "three"]

and if I type /command one,
will i get suggestions for one two three

shadow night
#

Yes I think

eternal oxide
#

No, I suggest you go read what boilerplace code actual is

warm mica
#

Explain

eternal oxide
#

Go learn what boiler plate code is

warm mica
#

Why are you having this discussion then?

shadow night
#

Basically, what you usually do is
if(strings.length == 1) return new List<>();
Or something like tgat

eternal oxide
#

yes I can, you just seem to be arguing over something you don;t know

warm mica
#

You can't even form arguments lmao, just be silent if you don't have anything to say, thank you

eternal oxide
#

Stop being an ass.

warm mica
#

Dito

umbral ridge
eternal oxide
#

ok as you are too lazy to even learn what you are arguing about. Boiler plate code is NOT comp[lext codeIn computer programming, boilerplate code or boilerplate refers to sections of code that have to be included in many places with little or no alteration. It is often used when referring to languages that are considered verbose, i.e. the programmer must write a lot of code to do minimal jobs.

#

lombok replaces that boiler plate code. It's not complex nor confusing, It's the basics of classes

#

ie. construtors, getters/setters

warm mica
eternal oxide
#

wrong

warm mica
#

"must write a lot of code to do minimal jobs"

eternal oxide
#

quantity of code != complexity

#

please learn what you are arguing about. Use a dictionary and lookup th edefinition of conplex

warm mica
#

Google the definition of complexity and paste it in, and compare your other copied definition

eternal oxide
#

why don;t you as you are the one calliing basic boilerplate code is complex

warm mica
#

"no ur wrong" is not an argument btw

eternal oxide
#

only because you refuse to learn what you are trying to argue

eternal oxide
shadow night
umbral ridge
#

It worked but if you press TAB with 2 or more suggestions it'll just remove all and only keep the one I typed

#

I guess that has to do something with packets?

young knoll
#

You need to add the existing text to the start of your suggestion

shadow night
#

Yes

umbral ridge
#

ohh

#

but then this is how it should look? xD

warm mica
# eternal oxide This is exactly what you are doing. I'm the one providing definitions.

Okay, let me sum up you responses:
"wrong"
"Go learn what xyz is"
If you want to have a proper discussion then please at least form proper arguments, as I have already said.
Apart from that, I have searched up the definition of complexity "The intuitive criterion of complexity can be formulated as follows: a system would be more complex if more parts could be distinguished, and if more connections between them existed.".
Now, you have already spend the other half of the work, all you have to do is to read both

#

This is going to my nerves, if you have something to say then do it properly, thanks.

eternal oxide
#

Seroiusly give up, you are completely wrong. Read lonbok's own page. It replaces boilerplate code like constructors and getters/setters. Boilerplate is NOT complex its just repetitive. Repetitive is not complex, it's the most basic of Java code you can have.

warm mica
#

You are doing it again. I literally already gave you the definition for you

eternal oxide
#

An incorrect definition

warm mica
#

It is literally copied from wikipedia lmao

eternal oxide
#

No you typed a generic statement about complexity. No relation to programming.

#

the number of "connections" has no relation to complexity or the application of lombok

warm mica
#

In the context of algorithms it's a different definition. But it's about code, text

eternal oxide
#

lombok has no relation to algorithms either

warm mica
#

And if something causes you to spend more time than you should have to, then the thing is complex. Even a child could tell you that

eternal oxide
#

time taken to type basic Java boilerplatecode is not complex, just time consuming

shadow night
eternal oxide
#

you seem to be associating time taken with complexity.

warm mica
warm mica
eternal oxide
#

Literally what lombok does is replace you having to type repetitive sequences of code. That code is not complex in any definition.

warm mica
#

In the context of algorithms, the complexity is the same. But in the context of code, the complexity has decreased.

eternal oxide
#

you are twisting it around, complex CAN mean more time but more time does not mean more complex

eternal oxide
visual laurel
#

Hey im getting this error when trying to pass my config file to another class: https://paste.md-5.net/upufedegam.apache

this is the script im using to pass it:

        FileConfiguration config = getConfig();
        getServer().getPluginManager().registerEvents(new XPListener(config), this);```

and this is my xpListener class: https://paste.md-5.net/luyepibeya.java
warm mica
eternal oxide
#

Just stop, none of your broken arguments apply in any way to lombok

warm mica
#

Because you seem to mix the both definitions

warm mica
eternal oxide
#

I have broken down every one of yoru statements proven you wrong. You are simply unwilling to learn so I've no more time to waste talking to a wall.

warm mica
#

Your whole argument is "no ur wrong wikipedia is wrong"

#

Literally

eternal oxide
#

No

warm mica
eternal oxide
#

Quote all you like I'm done talking to a fool

warm mica
#

Just accept that you are wrong.

#

That you don't even understand the difference between algorithmic complexity and generic complexity says it all. Please don't be a douche in the future and start discussions by forming proper arguments, thanks. This would save us both time

eternal oxide
#

lol

glad prawn
#

How to store uuid in database? Im new to this.

warm mica
warm mica
#

Some database types even have native support for uuids, but that's not many. Rather use strings

hearty moat
#

So I'm back for some help. I'm trying to use ChatComponents to send a hyperlink, but my plugin doesn't load at server startup if I use that API instead of using player.sendMessage(""). Here's my code:

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String [] args) {
        Player player = (Player) sender;
        TextComponent message = new TextComponent("[!] Pulsa aqui para unirte a nuestro Discord");
        message.setColor(net.md_5.bungee.api.ChatColor.LIGHT_PURPLE);
        message.setUnderlined(true);
        message.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Únete al Discord de --------- (enlace externo)").create()));
        message.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "(discord invite link)"));
        player.spigot().sendMessage(message);
        return true;
    }
warm mica
buoyant viper
warm mica
visual laurel
hearty moat
warm mica
#

You can simply set the value within your constructor. E.g.
private final String beans;

public BeanObject() {
this.beans = "";
}

buoyant viper
#

what does your server log say when its starting

#

?paste it please

undone axleBOT
hearty moat
#

mhm

buoyant viper
#

your command doesnt seem to be registered in your plugin.yml

hearty moat
#

it is

#

oh okay i know what's the problem

river hearth
#

What's the best recommended event/method to get the tnt entity dispensed from a dispenser?

warm mica
river hearth
warm mica
umbral ridge
#

Why doesn't this teleport the player to the location, which is in another world?

Location tpLocation = regionData.getFirstLocation();
player.teleport(tpLocation);

I've checked and world is not null

#

right now I'm in the nether and player.teleport() isn't teleporting me anywhere

#

If I am in the normal world, I'll get teleported

eternal oxide
#

anothe rplugin preventing it?

umbral ridge
#

No actually it's the only plugin I have

eternal oxide
#

Then there is no reason for it to not teleport, unless you are performing muliple teleports

umbral ridge
#

One sec I might have found the issue lol

terse lily
#

why is Messenger.MAX_MESSAGE_SIZE == 32766?

#

in PacketPlayOutCustomPayload's constructor it's also 1048576

worldly ingot
#

Not sure. Give me like 15 minutes and I'll look a little more in detail for you. Could be intentional, could be that it hasn't been updated since it was introduced in like 2013

eternal oxide
#

larger size will error on Bungee

worldly ingot
#

Mmm, ty

umbral ridge
#

Is it possible to suppress "... moved too quickly!" messages when teleporting players? why does it happen in the first place?

#

eg. happens on this:

Location middleLocation = regionData.getMiddleLocation();
Location tpLocation = new Location(middleLocation.getWorld(), 
  middleLocation.getX(), regionData.getHighestYAxis() + 2, middleLocation.getZ());
player.teleport(tpLocation);

fixed: player.teleport(tpLocation, TeleportCause.PLUGIN) and set player vector to 0

visual laurel
grim ice
#

thats just wrong

#

boilerplate can be not complex

#

for example

terse lily
#

like why would I care about this bungee limit while running a server without bungee

grim ice
#

1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+ this is boilerplate

warm mica
grim ice
#

but not complex

#

its just a series of additions and substractions of 1

#

most 2nd graders can solve this

#

but its boilerplate, since u can just do 8.5*2

#

therefore, length isnt complexity

#

your argument is both inaccurate in real life and in practice, and in coding

terse lily
#

why is there a limit just for people who use bungee

warm mica
ivory sleet
warm mica
ivory sleet
warm mica
ivory sleet
#

no

eternal oxide
#

wrong

ivory sleet
#

they are not covariant by any means

warm mica
eternal oxide
#

yes because I got fed up explaining things to you you refuse to understand

warm mica
ivory sleet
#

na

eternal oxide
#

you just blindly argue with everyone when you are incorrect.

warm mica
warm mica
ivory sleet
grim ice
#

it depends on the definition of complex

#

im assuming youre using the standard definition of complex

#

"difficult to analyze, understand, or explain "

#

most boilerplate, at least in java, does not make it harder to understand, or explain

ivory sleet
#

I mean sure if you have an extreme amount of boilerplate it will make it more complicated to understand, and possibly read (although that relation is by no means covariant), however that does not imply the program itself is of a more complex character

eternal oxide
#

most boilerplate make it easier to understand over an annotation many people have to lookup to understand what its doing.

grim ice
#

Exactly

#

if anything, lombok is more complex than getters

ivory sleet
#

we can talk about complexity in terms of different views; that is readability, testability, statefulness and so on

#

but saying boilerplate always leads to more complexity is erroneous

grim ice
#

and because of the way lombok behaves

#

its just more of a pain to debug

#

if something goes wrong

ivory sleet
#

yes additionally its a 3rd party lib

#

using any 3rd party lib makes ur program more complex

grim ice
#

btw @ivory sleet does tap water in sweden actually taste amazing

ivory sleet
#

yeah

grim ice
#

damn

ivory sleet
#

its scrumptious

#

well it doesnt taste anything in principle

#

but thats why its so good lol

eternal oxide
#

tap water in Ramsgate (east of England) tastes amazing too

eternal night
#

mhmm

#

yum

grim ice
#

looks tasty

eternal night
eternal oxide
shadow night
warm mica
#

"Complexity characterises the behaviour of a system or model whose components interact in multiple ways and follow local rules, leading to nonlinearity, randomness, collective dynamics, hierarchy, and emergence.[1][2]

The term is generally used to characterize something with many parts where those parts interact with each other in multiple ways, culminating in a higher order of emergence greater than the sum of its parts. The study of these complex linkages at various scales is the main goal of complex systems theory.

The intuitive criterion of complexity can be formulated as follows: a system would be more complex if more parts could be distinguished, and if more connections between them existed.[3]"
=> Basically something that is more complicated than it could be. It does not automatically mean that it is more difficult to understand, but that's usually the result of complexity.

"In Java programs, DTO classes are often provided with methods for getting and setting instance variables. The definitions of these methods can frequently be regarded as boilerplate. Although the code will vary from one class to another, it is sufficiently stereotypical in structure that it would be better generated automatically than written by hand. For example, in the following Java class representing a pet, almost all the code is boilerplate except for the declarations of Pet, name, and owner: ..."
Boilerplate in this context adds more things that takes way more effort to cognitively understand what it is about than a single @Getter or @Setter.
Thus, and as there is a known easier alternative, it is complex

quaint mantle
eternal oxide
#

Although the code will vary from one class to another, it is sufficiently stereotypical in structure that it would be better generated automatically than written by hand.BETTER does not imply complexity

#

auto generated makes it harder to modify.

#

Its shortening code but not removing complexity

#

else we'll start counting lines of code towards complexity

warm mica
#

It's not about the lines, but about what you have to go through in your mind when reading a method. With a @Getter you immediately know what's up and also immediately have the connections. With getters and setters you have to go through its properties, name, visibility and internal logic. And that for any method that is likely spread around the class.
=> Added complexity

eternal oxide
#

No you only know IF you know what lombok is and does

grim ice
#

you can also argue that lombok just hides the complexity, it doesnt disappear

ivory sleet
#

@Getter I would wonder wtf does this do

#

what access modifiers does this add

#

is this thread safe?

#

is this tested properly as its a 3rd party lib

warm mica
#

I mean, this could also be said the other way around

eternal oxide
#

Then consider if this is lombok or some other annotation system

ivory sleet
quaint mantle
#

@Getter just gets field and field type, then on processing generates:

public Type getField() { return this.field }

Or Am I wrong?

warm mica
#

In the context of not knowing, for instance what a private mofifier does. Surely less likely, but what I am trying to say is that "not understanding" isn't a factor that should be a factor in this.
In that case complexity would be completely subjective, however neither the visibility attribute nor lombok's getters/setters are difficult to understand

quaint mantle
#

Bro I thinking was Setter

#

Changed

ivory sleet
#

however that cannot be said about 3rd party libs

#

as they are just that; 3rd party libs

#

if I used lombok, it would take me some time to understand what it does

warm mica
#

Lombok is so widely used, I am pretty sure that it is safe to assume that the common experienced deceloper knows what it is

warm mica
#

But yes, the complexity surely differs depending on the perspective. We can agree on that

ivory sleet
#

yeah

#

and point is

eternal oxide
#

I used lombok many years ago. Today I dislike and never use it

ivory sleet
#

boilerplate does not inherently imply complexity

#

it can SOMETIMES

eternal oxide
#

I do not know it's annotations today

#

but straying off topic

#

the end is boilerplate does not inherently add complexity especially as it is the default, and as such neither can it be said lombok removes complexity.

ivory sleet
#

yeah lombok takes away boilerplate

#

thats quite literally the reason for its very existence

eternal oxide
#

yep

warm mica
#

I think that's a fair summary. Neither was fully right

ivory sleet
#

myea lets call it a day

eternal oxide
#

yeah

upbeat fog
#

I need some help figuring out how to spawn custom mobs I made on given locations (7 locations) and the amount of mobs cannot exceed 14. I was thinking using an invisible armor stand to check the mobs count in a 50 block radius. Anyone got ideas?

ivory sleet
#

economy seems to be null, no?

visual laurel
ivory sleet
#

well where do u create it?

visual laurel
#

in the onenable

#
getServer().getPluginManager().registerEvents(new BalanceListener(economy, config), this);```
#
    private Economy economy;
    private boolean setupEconomy() {
        RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager()
                .getRegistration(Economy.class);
        if (economyProvider != null) {
            economy = economyProvider.getProvider();
        }
        return (economy != null);
    }```
ivory sleet
#

send ur entire main class

visual laurel
ivory sleet
#

is it that big?

visual laurel
ivory sleet
#

how many lines lol

visual laurel
#

164 lines

ivory sleet
#

uh what

#

try reload md5 paste

visual laurel
#

nope

ivory sleet
#

try pastebin then

#

or some other bin

visual laurel
#

alright

ivory sleet
#

getServer().getPluginManager().registerEvents(new BalanceListener(economy, config), this);

#

117

#

remove that line

visual laurel
#

alright lemme build it again

visual laurel
rose trail
#

Help find the error in the SQL query: "CREATE TABLE IF NOT EXISTS essentials_party (id INT AUTO_INCREMENT primary key, leaderName VARCHAR, leaderUniqueID VARCHAR(36), memberName VARCHAR, memberUniqueID VARCHAR(36), joined BOOL)"

storm scaffold
#

Is there a way to set the player's attack cooldown? It doesn't need to be a specific value, just to force the cooldown to trigger

visual laurel
visual laurel
#

since the maximum characters for a username are 16

ocean hollow
#

how can I can set ItemDisplay rotation as player head

#

i know about it but how do i use yaw,pitch to set itemdisplay rotation

#

I thought something like this, but for some reason it changes size, and the rotation is strange

shadow owl
#

What exactly are you trying to set the rotation to be? A constant transformation or changed based off player's view?

#

If you know how to represent your transform as a matrix you can use setTransformationMatrix

#

¯_(ツ)_/¯

ocean hollow
#

Just a static function that changes the ItemDisplay Transform once. It changes the rotation to the same as that of the player's head

shadow owl
#

Ahh okay, let me take a look at your transformation then, one sec.

shadow owl
eternal oxide
#

heads apply yaw then pitch

ocean hollow
#

yaw = x, pitch = z?

shadow owl
#

doesn't really translate like that

#

if I remember right, Yaw is XZ plane, roll is XY plane, and pitch is YZ plane

#

so rotations in yaw affact where it's looking for X and Z locations, etc.

upper hazel
shadow owl
upper hazel
#

or at least write which plugin is supposedly looking for a specific zone (location set) for its event

clear panther
#

epic CPS

eternal oxide
#

actually it's neither

#

well yes pvbble is correct, but not in this instance as this is matrix math

upbeat fog
#

I need some help figuring out how to spawn custom mobs I made on given locations (7 locations) and the amount of mobs cannot exceed 14. I was thinking using an invisible armor stand to check the mobs count in a 50 block radius. Anyone got ideas?

echo basalt
#

Just do math

warm mica
#

There's world.getNearbyEntities

eternal night
#

Anyone that worked with build tools well enough that can tell me if that tooling has an option to only reset spigot-api and spigot-server to the local CraftBukkit and Bukkit dirs ?

#

It is messing around with my branches and I am not a fan

spiral light
#

just run it again

#

then its the default

eternal night
#

I don't want it to default them

spiral light
#

if you run a custom branch of spigot and run that with "clean install package" for example you install your custom stuff

eternal night
#

Yea but I am not mutating spigot

#

I am mutating the craftbukkit repo which the Spigot stuff applies it patches on top of

spiral light
#

if you dont use "install" on your craftbukkit repo you wont overwrite anything else

eternal night
#

maven install has nothing to do with that unless I am mistaken ?

#

I basically need build tools to just, jump straight to this line

#

Clone over my mutated Bukkit and Craftbukkit repos

#

apply spigot patches on top

#

compile spigot

spiral light
#

oh you want to keep your changes in craftbukkit / bukkit and compile spigot with that ?

eternal night
#

yes

spiral light
#

then i did not understand your msg first

eternal night
#

Yea sorry maybe I wasn't clear enough on that

remote swallow
#

wheres choco at

spiral light
#

you can create a spigot-fork and apply your craftbukkit/bukkit changes there and maven install the spigot fork then

eternal night
#

Hmm true, I guess I can directly edit in the spigot dir think

#

and then manually applyPatches and mvn package

spiral light
#

yes

#

but why do you need it that way ?

eternal night
#

I guess a somewhat workable solution

#

Well I am proposing a PR to craftbukkit and I'd like to test it on a spigot server ?

spiral light
#

if it works on craftbukkit server it will work on spigot too i guess

eternal night
#

Yea but I'd like to avoid running a craftbukkit server skully

#

testing dead software is not really the vibe

spiral light
#

xD if it works it works

#

i always create new folder to test stuff

carmine mica
#

why exactly isn't spigot just merged into craftbukkit? what is the point of keeping the 2 separate?

spiral light
#

i think spigot wants to allow more custom stuff while craftbukkit is just the API with no custom stuff

carmine mica
#

what is "custom stuff"

spiral light
#

for example spigot has the configuation to change the structure-salt for structures like mineshafts to spawn in a world

#

or changing crop-growth speed

carmine mica
#

so? there's a bukkit.yml settings that let you change stuff too, like spawn caps, ticks per spawn, disabling the end

#

those are "custom things", not just API

spiral light
#

how custom ?

eternal night
#

well MM, this way I can smack my head against the wall until I fix PDC YAML representation

maiden geode
#

Does anyone have idea if there is any other way to prevent the player from picking up experience? As of now I used PlayerExpChangeEvent and then just changed the amount of XP player can get to 0 but it's still picking up the XP

zenith gate
#
@EventHandler
  public void onSkeletonSpawn(EntitySpawnEvent event) {
    
    if(!(event.getEntity() instanceof Skeleton skeleton)) return;
    
    Random random = new Random();
    double chance = 0.07; // 7% chance

    if (random.nextDouble() <= chance) {
      
      skeleton.setCustomName(ChatColor.GOLD + "Jackal");
      skeleton.setCustomNameVisible(false);
      
      skeleton.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(250);
      skeleton.getAttribute(Attribute.GENERIC_ATTACK_SPEED).setBaseValue(3);
      skeleton.getAttribute(Attribute.GENERIC_ATTACK_DAMAGE).setBaseValue(12);
      skeleton.getAttribute(Attribute.GENERIC_ARMOR).setBaseValue(10);
      // Create a golden axe
      ItemStack goldenAxe = new ItemStack(Material.GOLDEN_AXE);

      // Set custom display name
      ItemMeta itemMeta = goldenAxe.getItemMeta();
      itemMeta.setDisplayName(ChatColor.GOLD + "Jackal's Golden Axe");

      // Set lore
      itemMeta.setLore(List.of(ChatColor.GRAY + "A powerful golden axe",
                               ChatColor.GRAY + "enchanted by a legendary jackal"));

      // Add sharpness enchantment
      itemMeta.addEnchant(Enchantment.DAMAGE_ALL, 6, true);

      // Set base damage to 12
      itemMeta.setCustomModelData(12);

      goldenAxe.setItemMeta(itemMeta);

      // Give the golden axe to the skeleton
      skeleton.getEquipment().setItemInMainHand(goldenAxe);
      skeleton.getEquipment().setItemInMainHandDropChance(0.03f);
      
      
    }
    
  }

My item is never being set in the Skeletons hand. Don't get an error either. setItemInMainHand can produce a null exception, but it hasnt.

spiral light
shadow night
#

Just check for each PlayerExpCooldownChangeEvent and PlayerJoinEvent and set the exp cooldown to -1 ig?

zenith gate
#

the Skeleton name?

maiden geode
spiral light
zenith gate
#

yes

#

skeleton name does change, his health, changes to. he just doesnt ge tthe axe.

spiral light
# zenith gate yes

What i can think of is that in the spawn-process the default entity equipment calculation overrides yours

#

try running it a tick later

zenith gate
#

nope they still spawn with their bow

spiral light
#

sure ?

zenith gate
#

I spawned 300 of them. all the jackals still had bows

#

i just got an error for an attribute so i fixed that and now checking agian.

#

Okay they are spawning with their axes now.

spiral light
eternal night
zenith gate
spiral light
quaint mantle
#

hi, how can I set a text to show in every player's actionbar?

zenith gate
#

do a for loop for every online player

quaint mantle
#

but how can I change the actionbar text?

tender shard
spiral light
quaint mantle
quaint mantle
eternal night
zenith gate
#

I always use ChatColor

eternal night
#

Storing JSON like strings in PDCs saved to yaml explodes

spiral light
tender shard
eternal night
#

Storing "true" becomes a byte

#

Etc

quaint mantle
fallen anvil
tender shard
#

not a nibble?

quaint mantle
#

and the text disappears very fast, how can I do so every tick the actionbar command is run again? is there some event for that?

tender shard
#

an event for what?

quaint mantle
#

something like a tickPassEvent

tender shard
#

?scheduling

undone axleBOT
quaint mantle
zenith gate
#

is there an event for when like an item is burned? yk how netherite cannot be burned. is there a way to put that on every single item?

spiral light
#

i am not sure but i think EntityDamageEvent could be something

zenith gate
#

I look into that one.

spiral light
#

actually this works

orchid trout
#

wtf

zenith gate
#

ooh perfect

orchid trout
#

no

#

its

#

entityDamageEvent

spiral light
#

xD

zenith gate
#

lmfao

spiral light
#

i was typing just fast

#

be lucky that its not just asykljbhdf

zenith gate
#

proof of concept is all it is

orchid trout
zenith gate
#

wdym confidence?

#

my confidence throughout this project has fastly gone away lol

paper canyon
#

yo not sure if this is the right chanel but i need urgent help with a server

zenith gate
#

are you developing plugin for your server?

spiral light
#

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

paper canyon
#

nvm it belongs in help-server

zenith gate
#

I love the Fleet IDE i think its nice an all, but god there are so many problems with it.

orchid trout
#

why teams no change color

umbral ridge
#

I was actually planning on switching from Eclipse to it lol

zenith gate
#

dont get me wrong its a good IDE. but like theres a lot of Ghost sysntax errors. it showing a syntax error when there is none, also just the smart feature, for predicting what you want to type. unlike IntelliJ it doesnt select the one the best fits your need. most of the time its alphabetical. sometimes its what you need but not really, and the terminal is sometimes very buggy.

umbral ridge
#

oh xD

#

Are you still going to use it?

zenith gate
#

its very clean tho and extremely light weight. I cant wait for the plugins.

zenith gate
umbral ridge
#

It looks very nicely designed

zenith gate
#

my MacBook starts to struggle with IntellIJ indexing my entire project and running a server.

zenith gate
umbral ridge
#

Yeah

zenith gate
#

getting Maven to work on it tho was a pain.

#

it didnt want to save my maven home location. took me almost an hour.

umbral ridge
#

got to finish the projects i have left then im throwing eclipse in trash and switching to it

zenith gate
#

Moving up the ladder hahaha

umbral ridge
#

oh lol

#

I haven't worked with maven much though

#

in eclipse i can just export the plugin with 2 clicks its kinda easy

#

but i want to get to know other ways

zenith gate
#

mine is 1 click lol.

umbral ridge
#

really? isn't there like some sort of commands you have to type or something