#help-development

1 messages · Page 1128 of 1

grave lagoon
#

maybe try force updating with mvn clean install -U

#

mb

strong parcel
# grave lagoon maybe try force updating with `mvn clean install -U`

When I try that, I get [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.966 s [INFO] Finished at: 2024-09-09T00:12:33-05:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project TWClaim: Could not resolve dependencies for project com.ethan:TWClaim:jar:1.0-SNAPSHOT: Could not find artifact com.jeff_media:CustomBlockData:jar:2.2.0 in jeff-media-public (https://hub.jeff-media.com/nexus/repository/jeff-media-public/) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

#

So I guess something happened with Jeff's repo?

#

Since I am using everything he posted publicly in my pom, and it was working for about a year.

deft geode
#

This is just a general question, but is there a way to tell what entities actually use the EquipmentSlot.BODY? I'm trying to identify which ones, but just haven't found anything, besides horses and wolves which are explicitly listed within the javadocs

drowsy helm
#

its on maven central now

mortal vortex
#

How do plugins like essentials store data? Like warps and stuff? I've never really looked into it. But from what I remember, there is no database file is there?

glad prawn
#

file

hybrid turret
#

there is no other way

echo basalt
#

pdc be like

hybrid turret
#

which is

#

still

#

files

#

lol

hybrid turret
deft geode
#

I did do some minimal testing, only entities that I found to use the slot are regular horses (Not skeleton and zombies), wolves, and [trader]llamas

strong parcel
hybrid turret
#

i mean yea

strong parcel
hybrid turret
#

but i doubt that a massive plugin like essentials stors all data in some Cow lmao

strong parcel
#

The ancient cow of omnipotence is essential to every plugin

hybrid turret
#

that would be hilarious tho lmao

#

just some cow with a sign "DON'T KILL OR THE SERVER BREAKS"

strong parcel
#

XD

mortal vortex
#

Im only curious how those kind of plugins do it

hushed spindle
#

yml, json, sqlite, whatever you feel is most fitting

#

yml is easy to edit for the average joe but its not the fastest or suitable for mass data storage. for example, i use yml for storing player clan data

blazing ocean
hushed spindle
#

json is very easy for you to implement and is fast, but users tend to make more mistakes while trying to edit it. i use json to store custom recipes and such

hybrid turret
#

nbt are the .dat files right?

blazing ocean
hushed spindle
#

sqlite if you wanna store a large amount of stuff and get only parts of it with queries without loading the whole file, i use it to store player data

#

xml is also fine

#

not for mass storage obviously but can kinda be used in place of yml

#

if you're more comfortable with that

blazing ocean
#

and are a complete psychopath

hushed spindle
#

yea that too

#

its fine in the same sense that pouring your cereal after your milk is also technically fine

hushed spindle
#

its technically fine but you belong in a mental institution if you do

mortal vortex
hushed spindle
#

it might just store stuff in the world save file idk

glad prawn
hybrid turret
#

What exactly are the X and Z coordinates for chunks? is the 0,0 chunk where 0,0 is but 1,0 the NEXT chunk next to it in X direction? (and not the same chunk bc 0,0 and 1,0 are in the same chunk)

tl;dr: do chunks have their own coordinate system?

wet breach
#

not really, think of them as compressed forms of the coordinate system

hybrid turret
#

i don't get it

#

Let me give an example of what I mean:

wet breach
#

to get a chunk coordinate of a particular coordinate, divide x and z by 16 and round down

hybrid turret
#
Chunk chunk = world.getChunkAt(0, 0);
Chunk chunk1 = world.getChunkAt(0, 1);

sout(chunk.getX() + ", " + chunk.getZ()); // 0, 0
sout(chunk1.getX() + ", " + chunk1.getZ()); // 0, 1

This is what i get.
Are those now the coordinates of a BLOCK (without Y) or of a CHUNK?

#

Bc it seems to get the correct chunk with getChunkAt(blockCoordinateX, blockCoordinateZ)

#

wait

#

or does it

wet breach
#

technically there will be a block at the location of the chunk coord

hybrid turret
#

now i'm confused on what my test returned me

wet breach
#

dividing the coordinate by 16 and round down

#

knowing this, you should be able to verify if its getting the right chunk or not

hybrid turret
#

so if i want to get the chunk of the block coordinates:

256, 64, 122

I have to: world.getChunkAt((int) 256 / 16, (int) 122 / 16) ?

wet breach
#

getChunkAt does the math for you

#

so you toss in a coordinate into that method and it will get you the chunk that coordinate belongs to

hybrid turret
#

ah okay

wet breach
#

however, you can if you wanted do the math yourself and verify the chunk coord

hybrid turret
#

okay so i asked this bc my tests confused my but i cant retest it rn and i apparently cant remeber anymore as well lol

#

(i'm kinda dumb sometimes)

#

but

#

uhm

wet breach
#

well now you know how to verify your test

#

tests are not very good if you can't determine if they are correct or not 😛

hybrid turret
#

I think i tried getting a chunk with getChunkAt with 0,0 and 0,1 and it let me set the plugin chunk tickets

#

but if it converts my input to chunk coordinates

#

it should disallow me from setting that, no?

hybrid turret
wet breach
#

coordinates 0,0 and 0,1 exist, and both of those should exist in chunk 0,0

hybrid turret
#

exactly

#

that's what's confusing me

#

and the chunks getChunkAt returned, returned 0 for getZ and 1 for getZ

#

docs could also mean both lmao

#

at least from how i understand it

lost matrix
# hybrid turret that's what's confusing me

The world has two coordinate systems, one chunk grid and one block grid. When getting a chunk, you select from the chunk grid.
Should probably be mentioned somewhere in the javadocs

slate siren
#
test:
  player-list:
    9226563f-1b48-38e4-b2d1-b4b400e0b646:
      playername: _SinHa_
      player-uuid: 9226563f-1b48-38e4-b2d1-b4b400e0b646


_SinHa_:
  player-list:
    530fa97a-357f-3c19-94d3-0c5c65c18fe8:
      playername: test
      player-uuid: 530fa97a-357f-3c19-94d3-0c5c65c18fe8

when i deleted SinHa in my friend list.

test:
  player-list: {}


_SinHa_:
  player-list:
    530fa97a-357f-3c19-94d3-0c5c65c18fe8:
      playername: test
      player-uuid: 530fa97a-357f-3c19-94d3-0c5c65c18fe8

RemoveCommand
https://paste.md-5.net/saxagiwode.js

FriendsDataManager
https://paste.md-5.net/qogaxinute.cs

When I remove a player from my friends list, if the removed player is offline, only my name is not removed from their friends list, and it still appears in the "friends.yml" file; the offline player's list isn't updated, and I'm struggling to find a solution for this issue.
When I remove a player from my friends list while they are online
everything works correctly, and the player is removed from both friends' lists However
if the player is offline when I remove them
they are only removed from my list
but not from the offline player's list in the "friends.yml" file

lost matrix
#

Unrelated

slate siren
#

how can

dawn flower
#

How do I change the max stack size of potions?

young knoll
#

ItemMeta

#

Should have a setMaxStackSize in 1.21

dawn flower
#

I'm on 1.20.4

lost matrix
#

The components where introduced in 1.20.5 iirc
So updating to just that should give you the option to set any ItemStacks max stack size.

young knoll
#

The method I sent will get the chunk based on block coordinates

#

Otherwise you can use X >> 4 and Z >> 4 to go from block to chunk coordinates

pseudo hazel
#

imagine if they used chunks of 15 blocks instead 💀

young knoll
#

The power of 2 wasn’t just a lucky coincidence :p

wary harness
#

why is my intellj importing like this when I press import button?

inner mulch
#

because you have a class named ActionType

wary harness
inner mulch
#

?

wary harness
inner mulch
#

what do you mean?

#

what do you want to import?

wary harness
inner mulch
#

yeah you imported it?

wary harness
#

but it is importing it at front of object

#

not on top of file

chrome beacon
#

Do you have another import called ActionType

wary harness
#

in import section

inner mulch
#

then its because you have 2 imports

#

named actiontype

wary harness
#

it is showing as option

#

when I want to import my own

inner mulch
#

show us ur imports

wary harness
inner mulch
#

import it, then it should be there

#

if not ur intellij is probably just bugged, maybe clear cache?

wary harness
#

well like i said it is adding it at front of new object

#

insted to import section

#

cleared cache same

inner mulch
#

is anything in ur class imported and named ActionType?

glad prawn
inner mulch
#

how does horizontal scaling make perfomance better? in the case of a database for example, every server should share the same data (or does it), if they always replicate the data once it changes on the another node, wouldn't it handle the same amount of requests as before?

hazy parrot
#

Data doesn't always have to be consistent across nodes

inner mulch
#

but in such case, how does horizontal scaling work?

hazy parrot
#

It really depends on the type of distributed system

#

It doesn't always replicate data, you can look at Cassandra for example

#

That database kinda sacrifices consistency for availability

inner mulch
#

okay

hybrid turret
#

oh signed right shift

#

ohhhh it shifts the bits by for to the right therefore dividing by 16 in a fancy way lol

#

I've read in the docs, that HumenEntity#closeInventory is unsafe in InventoryClickEvent... Would the following cause bugs?

  @EventHandler
  public void onClick(InventoryClickEvent event) {
    HumanEntity humanEntity = event.getWhoClicked();

    if (
      /*Inventory check for it being the correct inventory*/humanEntity.getItemOnCursor().getType() == Material.WRITABLE_BOOK ||
      humanEntity.getItemOnCursor().getType() == Material.WRITTEN_BOOK
    ) return;

    event.setCancelled(true);
    humanEntity.closeInventory();
  }
#

I want to prevent the player from moving anything into a specific custom inventory except book&quill/signed books

smoky oak
#

i believe moving items into inventories that aren't bound to blocks (think ender chest) will always cause an event. i think there's around four?

#

unless theyre all counted under the click event

#

you dont necessarily need to close the inventory tho

hybrid spoke
smoky oak
#

unrelated, but is there a way to obtain the ItemEntities dropped from a EntityDeathEvent?

hybrid turret
#

lol

#

sorry

hybrid spoke
#

but that could be a hacky solution

smoky oak
#

unless manipulating ItemStack allows you to pass data to the entity when it gets turned into one i dont think that'll happen

hybrid spoke
#

my approach would be to store the drops, get the itemstack from the item entity around the death location and compare. if it hits, you have the entity

#

but no idea if there is a more easier solution

smoky oak
#

there an event thrown when the items start existing or do i need to run a 0/1 tick scheduler?

hybrid turret
#

trying to use the adventure-api and minimessage rn. i shaded adventure into my plugin but i still get a ClassNotFoundException.

[14:34:04] [Server thread/ERROR]: Error occurred while enabling VanillaUtility v1.5.0 (Is it up to date?)
java.lang.NoClassDefFoundError: com/github/shioku/vanillautility/misc/external/adventure/platform/bukkit/BukkitAudiences
    at com.github.shioku.vanillautility.VanillaUtility.onEnable(VanillaUtility.java:106) ~[?:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:267) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:492) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_21_R1.CraftServer.enablePlugin(CraftServer.java:575) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4302-Spigot-a759b62-63f9166]
    at org.bukkit.craftbukkit.v1_21_R1.CraftServer.enablePlugins(CraftServer.java:489) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4302-Spigot-a759b62-63f9166]
    at org.bukkit.craftbukkit.v1_21_R1.CraftServer.reload(CraftServer.java:1013) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4302-Spigot-a759b62-63f9166]
    at org.bukkit.Bukkit.reload(Bukkit.java:870) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:27) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:150) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_21_R1.CraftServer.dispatchCommand(CraftServer.java:921) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4302-Spigot-a759b62-63f9166]
    at org.bukkit.craftbukkit.v1_21_R1.CraftServer.dispatchServerCommand(CraftServer.java:906) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4302-Spigot-a759b62-63f9166]
    at net.minecraft.server.dedicated.DedicatedServer.br(DedicatedServer.java:431) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4302-Spigot-a759b62-63f9166]
    at net.minecraft.server.dedicated.DedicatedServer.c(DedicatedServer.java:407) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4302-Spigot-a759b62-63f9166]
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1321) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4302-Spigot-a759b62-63f9166]
    at net.minecraft.server.MinecraftServer.y(MinecraftServer.java:1071) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4302-Spigot-a759b62-63f9166]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4302-Spigot-a759b62-63f9166]
    at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: java.lang.ClassNotFoundException: com.github.shioku.vanillautility.misc.external.adventure.platform.bukkit.BukkitAudiences
    at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:160) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:112) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?]
    ... 18 more
hybrid spoke
#

its an entity. you can just listen to the entityspawnevent

smoky oak
#

fair
identification via uuid possible or na?

hybrid spoke
#

for itemstack there is the isSimilar method

smoky oak
#

alr

#

wait but wouldnt that trigger on any random itemstack if its the same material and count

hybrid spoke
#

most likely. as i said, hacky solution

smoky oak
#

ill go check smth else ig

hybrid spoke
#

imo there has to be a better way

smoky oak
#

the item stack might still be the same reference

#

if thats the case use uuid. imma check that

hybrid spoke
smoky oak
#

wheres the website for how to setup debugging again?

smoky oak
#

ill take a look once i can actually take a look lol

#

wasnt there some argument in the server args involved?

#

(new computer :/)

hybrid spoke
#

in what case?

smoky oak
#

i dont quite recall how to connect IJ to my local server

smoky oak
#

thats absolutely not what i meant but also works

hybrid turret
smoky oak
#

theres a different one with like a port connection

hybrid spoke
smoky oak
#

yea that

hybrid spoke
#

ah

hybrid turret
hybrid spoke
smoky oak
#

wait build? cipher im not trying to make changes to the server lol

#

ill use the 2nd one

hybrid spoke
#

or build gradle

hybrid turret
#

?paste

undone axleBOT
hybrid turret
hybrid spoke
hybrid turret
#

uhm

hybrid spoke
#

provided means it should be already there

#

you want to either remove the <scope> line or put compile in there

hybrid turret
#

oh

#

thanks

#

maybe i should learn more about maven

smoky oak
#

how do i get the name here in the workspace.xml to change? I dont want to manually do it coz that might break something
im trying to rename the workspace from my preset

smoky oak
#

i mean i managed to do it with IJ interfaces before

#

i just dont remember how

#

like, the intended renaming stuff like pom + f4

hybrid spoke
#

no idea, i dont even know what workspace.xml is

smoky oak
#

.idea/workspace.xml

hybrid spoke
#

im aware, still no idea what it does

smoky oak
#

ah

#

its thinking the module classpath is renamed but still showing the old name

#

weird

#

ah yes of course
restarting intellij is the solution here

#

man i hate when that happens
why cant stuff update properly without a restart

slender elbow
#

why wouldn't it?

#

why would they constantly monitor the file for changes when it's meant to be read only at start-up and written as you change settings

hybrid turret
#

i mean... isn't that the first thing to try when finding some sort of inconsistency?

smoky oak
#

see i expect software to work as advertised
aka the renaming button to rename my stuff 😭

slender elbow
#

idk what you're talking about ngl

smoky oak
#

Project Structure -> Module

slender elbow
#

ah, well, intellij will pull module names from maven/gradle upon reloading them

drowsy helm
#

Module renaming is so cursed

#

One of my multi module projects still has a module I deleted months ago

dawn flower
#

How do I make all items have a specific lore when in a specific menu without taking a big risk

drowsy helm
#

Wdym a big risk?

#

Like you want conditional lore?

dawn flower
#

Like for example a crash with the menu opened

drowsy helm
#

Copy contents

dawn flower
#

That makes all the items in the player's inventory have that lore

drowsy helm
#

Change lore of copied contents

#

And send inventory content packet

dawn flower
#

Ok

drowsy helm
#

With editted items

#

Bit of work, but it’s crash safe

smoky oak
#

how do you do item stack PDC again

hybrid spoke
smoky oak
#

is that the only exception?

slender elbow
#

yes

smoky oak
#

so meta == null continue

#

gotcha

hybrid spoke
#

ItemMeta#getPersistentDataContainer() or over the itemstack, one of them it is

smoky oak
#

howd u grab it directly?

hybrid spoke
#

directly?

hybrid spoke
smoky oak
hybrid spoke
#

Class#MethodIndicator

slender elbow
#

what

hybrid turret
#

How do I use Translatable components via the adventure api?

hybrid turret
#

Well

#

Obviously only applies to creating item stacks lol

smoky oak
#

see im not making an item, im manipulating an existing one

hybrid turret
#

yeah mb wasnt thinking

smoky oak
#

im flagging them for 'dont despawn'

hybrid turret
#

i just assert item != null

smoky oak
#

i dont quite recall what does

hybrid turret
#

if i know that it's not air

smoky oak
#

isnt that a test only thing

hybrid turret
#

nah

#

it's a shorthand

#

for

if (item == null) throw new RuntimeException();

And assert item != null : "Item is null"
does:

if (item == null) throw new RuntimeException("Item is null");
#

iirc

smoky oak
#

ouch

#

ye ill go with if null continue

#

ive been ingrained to not throw exceptions if preventable

hybrid turret
#

i mean in what case will an item stack actually be an item?

#

for item stacks that you want the meta from at least

smoky oak
#

idk, im just grabbing the stacks from item entities and manually checking them

hybrid turret
#

Hmm

#

I'm wondering if when iterating through an inventory

#

Does it return the air item stacks?

#

if so, then i was completly wrong lol

slender elbow
#

assertions don't run unless you add a vm flag

hybrid turret
#

continue; is the 100% correct thing to do

hybrid turret
#

virtual machine?

slender elbow
#

yes

#

the jvm is a vm

#

java virtual machine

hybrid turret
#

oh yea

#

wait what

#

you have to change something for assertions to work?

#

they always worked for me out of the box

slender elbow
#

yes you need to add a jvm flag

#

they do not

hybrid turret
#

lol

smoky oak
#

i mean is computers not working as intended news at this point :V

hybrid turret
#

then ig IJ automatically does this(?)

smoky oak
hybrid turret
#

nnnno

#

but i mean i've had no problems

slender elbow
#
PS E:\projects> jshell
|  Welcome to JShell -- Version 21.0.4
|  For an introduction type: /help intro

jshell> assert null != null

jshell>
PS E:\projects> jshell -R-ea
|  Welcome to JShell -- Version 21.0.4
|  For an introduction type: /help intro

jshell> assert null != null
|  Exception java.lang.AssertionError
|        at (#1:1)
blazing ocean
hybrid turret
hybrid turret
#

i never gotten to that point

#

bc ig i never handled Air-ItemStacks

#

fair enough

#

time to change stuff

smoky oak
#

huh this is odd

#

anyone know why trying to type into w11 console constantly eats my inputs

blazing ocean
slender elbow
blazing ocean
smoky oak
#

yes

#

hows that relevant?

blazing ocean
#

use 21

#

it breaks shit

slender elbow
#

you are running paper

smoky oak
#

spigot

slender elbow
#

x to doubt

blazing ocean
hybrid turret
smoky oak
#

this is what buildtools gives me

blazing ocean
#

Component.translatable

hybrid turret
#

lol am i fucking blind

#

I FUCKING AM WHAT

blazing ocean
hybrid turret
#

java 22 is such a mess lmao

blazing ocean
#

java 22 not breaking something challenge (impossible)

slender elbow
#

the java 22 issue is only a problem on paper, not spigot, because spigot doesn't bundle nor work with jline, paper does

smoky oak
#

well running 21 fixed the lag thing

#

soo theres def something goin on

smoky oak
#

i totally am not sitting here staring at this item for way too long to determine if my code worked lol

#

darn it failed

#

oh this is annoying @hybrid spoke EntityDropItemEvent doesnt trigger for death items

slender elbow
#

entitydeath event

#

though you can't get the Item entities

smoky oak
#

im using that to flag the item but i still dont have access to the entity itself

#

the problem is that i need to un-flag the item so it becomes stackable again

#

otherwise id just set it when it tries to despawn

#

oh hold on

#

what happens if you overload event handler methods by naming them all 'event'?

#

is this why the second method doesnt seem to run?

slender elbow
#

the method name doesn't really matter

#

spigot will collect them by the event parameter

smoky oak
#

so it aint that then

#

egh

worldly ingot
river oracle
#

he even added /s for serious

worldly ingot
#

Yes. SUPER serious

smoky oak
#

uuuuuuuuhhhhh
I'm debugging my code right now.

    container.remove(key);
    stack.setItemMeta(meta);
--> return true;

debugger says the following:
meta.getPersistentDataContainer().customDataTags.size = 0
and
stack.getItemMeta().getPersistentDataContainer().customDataTags.size = 1
can someone explain why it's not setting the meta back to the itemstack?

hushed spindle
#

is it safe to assume when I use Bukkit.createInventory(owner, MERCHANT) it'll create a MerchantInventory or would it be unsafe to cast like that

river oracle
#

and that's about it

#

are you on 1.21.1?

hushed spindle
#

oh wonderful

#

yea

worldly ingot
#

Oh no he's gonna shill

river oracle
#

lol

#

you know it, well I haven't completed the API for merchant menu yet

#

so I can't fully shill

river oracle
#

for others you can let me shill this brand new API

hushed spindle
#

i want to make it when a player clicks on a villager it opens a custom virtual merchant inventory instead of the regular one, so i can make custom trades without changing that villagers data

hushed spindle
#

is that capable of doing so

river oracle
#

for now 😈

#

I'll ping you in a few weeks when I'ma start shilling my new API

river oracle
hushed spindle
#

no thanks!!!

river oracle
#

its brand new hot off the iron and is just askinggg to be used

hushed spindle
#

i dont need it!!!!

river oracle
#

:( okay

hushed spindle
#

really thank you though lol

river oracle
#

np xD

#

Ima be late for class

#

oh lordee

toxic sage
#

I own such a code:

@NotNull
private final Pattern pattern = Pattern.compile(".*[^\\x20-\\x7FąćęłńóśźżĄĆĘŁŃÓŚŹŻ].*");

@EventHandler(priority = EventPriority.LOWEST)
public void onAsyncPlayerChat(AsyncPlayerChatEvent event) {
    long start = System.nanoTime();
    if(pattern.matcher(event.getMessage()).find()) {
        event.setCancelled(true);
    }

    long end = System.nanoTime();
    System.out.println((end - start) + " nano");
}

It works the way it wants, but I'm wondering if the code executes 2746568nano/2.7ms will the server somehow lose out on that in terms of performance.
This is probably an amateur question, but that's how I am

smoky oak
#

also can discord not crop the crap out of images for once

worldly ingot
#

What the heck is that pattern though? lol

#

Rudimentary chat filter?

slender elbow
toxic sage
worldly ingot
#

Yeah that tracks

#

Certainly a creative way to do it ;p

slender elbow
#

i mean, if you're looking to disallow characters outside of the ascii range, personally i'd just do a for loop on teh string's characters and check they are <= 127

also that pattern is going to only allow strings with non-ascii characters lol

smoky oak
#

can someone explain why setItemMeta seems to not set Item Meta? i looked at the source code but that also looks like it should just check if the meta is applicable - which it is - and set the meta afterwards

#

can ItemMeta keep records of it's previous PDC and overwrite it with that or something?

slender elbow
#

it works fine

#

your code is wrong somewhere

toxic sage
smoky oak
worthy yarrow
#

Show some code

smoky oak
#

this is the code

slender elbow
#

that is not the whole code

#

show the whole method or class that uses the stack and meta

#

?paste

undone axleBOT
slender elbow
#

like i said, your code is wrong somewhere, that one specific line is not it

smoky oak
slender elbow
#

and where exactly are you encountering this issue?

smoky oak
#

line 56 is the breakpoint its stopped on (last line of clean(ItemStack) method)
the debugger gives me the following two very confusing outputs

#

i just want to set the damn meta to the stack

#

it says it does but doesnt

#

(interestingly the setItemMeta(null) DOES change the item meta, but then setting it to the new one restores the old meta for whatever reason)

slender elbow
#

looks fine, let me check real quick

smoky oak
#

want a zip of the folder?

slender elbow
#

i can't test right now but it looks alright

smoky oak
#

grass block

#

hopper

#

what the fuck

#

this is related to containers

#

why does metadata not work on containers

#

it happens on barrels/chest/shulker, and doesnt on signs/grass/trap doors/chest boat/signed books

#

yea enchanted swords fine so its not related to the data previously there, it just doesnt work on containers

#

for whatever inane reason

karmic phoenix
#

How do I make a dragon face where the passenger's facing.

smoky oak
#

hm its getting overwritten by blockentitydata maybe?

#

augh i require the help of someone who knows spigot better than i do

#

i cannot find where the blockentitydata access is in the API

#

like this here

#

cant figure out how to change it

quasi gulch
#

Is there a way to remove a vanilla recipe for example the wood pickaxe recipe. With Bukkit.removeRecipe() but i dont know the Namspace is there maybe a website or another method?

#

Okay i found that it works with Bukkit.removeRecipe but now it shows this Message in the console. Can i disable it somehow?

eternal skiff
tidal finch
#

Hi, is there a way to check whether the players is allowed to place a block? (using setBlock method) I am using this code for my randomizer now but when I am standing on the top edge of the block I am still allowed to place a new block on top of the one I am standing on.

halcyon hemlock
#

good 1:23 AM everyone

#

good 1:24 AM everyone

chrome beacon
#

You're sending a message from the server to itself

eternal skiff
chrome beacon
#

yes

#

?pmc

eternal skiff
chrome beacon
#

Use your own channel

eternal skiff
chrome beacon
#

Then you can't use the plugin messaging channel

#

You need to setup your own messaging system

#

for example you can open your own websocket to send data through

inner mulch
pure dagger
#

why regeneration applied for 1 -2 seconds doesnt work lol, only if i apply 3 seconds

#

does applying for example:
2 second effect every 1 second

restart it? or is it required to be at least few seconds left or... i dont have ideas

chrome beacon
#

so if you give less it doesn't do anything

pure dagger
#

oh.. umm so.. does it restart

chrome beacon
#

try it and see

pure dagger
#

yeah it works with 3 seconds, but actually how does it work that it doenst regenerate because i gave the effect for 30 ticks every 20 ticks so

#

the effect is constantly

#

but probably reseted or something

fringe jetty
#

How can i make a Languge like Skript? Im not so good in Java and i need a easier Language. I want to make a self

eternal oxide
#

Java is easier than skript

fringe jetty
#

can u help me

#

that i can get a language with spigot support

stuck flax
fringe jetty
#

but i want it private ):

fringe jetty
eternal oxide
#

no, what you are asking is ridiculous

stuck flax
#

By learning Java

#

Good luck

orchid iron
#

hey does someone know how i can move the pivot point of a block display to make it not rotate around its edge?

#

im not acually using commandblocks, im working on a java plugin

rough drift
#

using an offset fucks it up because mojang said "that's intended"

orchid iron
#

what

#

thats a lot of math for something that "simple" 😮

rough drift
#

mojank

slender elbow
#

god forbid plugin developers do any math beyond addition

cedar saffron
pure dagger
#

is there a way to check what tool player used to kill another player? - if player hits another player with for example sword, then changes slot to some other item, then player falls and dies - it counts as killer would use the item that they are holding at the moment of death - not the sword

glossy laurel
#

how to add empty scoreboard lines? I added one for 5th, 8th and 2nd line but only the 2nd one appeared?

echo basalt
#

I usually use wonky color codes for that

glossy laurel
#

lmao?

#

alr

#

wait

#

wonky color codes

#

like wdym

orchid iron
#

just put &r

#

with nothing else

cedar saffron
#

People when they are born 💀

pure dagger
echo basalt
#

yurr

pure dagger
glossy laurel
#

where, on the scoreboard?

pure dagger
#

yeah

#

idk if i get what u mean

glossy laurel
#

ohh

#

got it

pure dagger
#

#

i always have it copied

#

#

cedar saffron
pure dagger
#

i like pickels on pizza

cedar saffron
#

Bro I'm faded asf 😭

pure dagger
#

?

cedar saffron
#

Drank 2 coca colas, faded ash

pure dagger
#

whats faded"

cedar saffron
#

Shit this is help dev

pure dagger
#

i dont get u

gleaming grove
# orchid iron

use item display for blocks, instead of block display. Item Display has origin in the middle of the displayed thing

tall dragon
#

does any1 here have an example i could look at of a plugin framework split into modules?. so like a module for commands, gui's etc.

echo basalt
#

bruz

tall dragon
#

?services

undone axleBOT
echo basalt
#

#general message

tardy garden
#

good?


    private static final List<Material> PASSABLE_BLOCKS = Arrays.asList(
        Material.WOODEN_DOOR, Material.IRON_DOOR, Material.TRAP_DOOR, Material.FENCE_GATE, 
        Material.WOOD_BUTTON, Material.STONE_BUTTON, Material.AIR, Material.WATER, Material.LAVA
    );

    @EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {
        Player player = event.getPlayer();
        Location from = event.getFrom();
        Location to = event.getTo();

       
        if (to != null && (from.getBlockX() != to.getBlockX() || from.getBlockY() != to.getBlockY() || from.getBlockZ() != to.getBlockZ())) {
            
            if (isSolidBlock(to)) {
              
                event.setCancelled(true);
                player.teleport(from);
              
            }
        }
    }
    

    private boolean isSolidBlock(Location location) {
        Block block = location.getBlock();
        Material material = block.getType();

    
        if (PASSABLE_BLOCKS.contains(material)) {
            return false;
        }

        return material.isSolid();
    }
}```
glad prawn
#

Set would be better

craggy badge
#

This is gonna be weird but how do i update a plugin :skul: on the spigotmc page

chrome beacon
#

What's the point of that code

chrome beacon
#

if it's not there you might need to enable 2fa

craggy badge
#

Where do i find enable 2fa

chrome beacon
craggy badge
#

i did it 😄

tardy garden
glossy laurel
#

So I wanted to prevent death event so I checked for entity damage and canceled it if it reduced the players health below 0, but... it doesnt work if they have a totem of undying. Can anyone tell me why?

chrome beacon
#

What do you mean by doesn't work?

#

What happens

floral drum
glossy laurel
#

Well its not that im trying to make him immortal

#

Im doing some checks and mark him as dead

#

I just dont want him to actually die

young knoll
#

If you cancel the damage the totem won’t pop

#

Obviously

chrome beacon
#

^^

young knoll
#

You can check both hands for a totem before cancelling it

glossy laurel
#

What if the player dies in like

#

The void

young knoll
#

Then the totem will still activate

#

Just won’t help them much

glossy laurel
#

What

#

No

#

Totems dont activate in the void

#

And dont work against /kill

young knoll
#

Huh I didn’t know that

#

Well check the damage type too then

late sonnet
#

or just listen EntityResurrectEvent and cancel?
@glossy laurel

turbid tapir
#

I hope its allowed to get help with ProtocolLib here, I couldn't find a support discord from the plugin itself.

ProtocolLibrary.getProtocolManager(); returns null, so I assume I haven't included it into my project correctly.

This is what I added to the pom under repositories:

      <repository>
          <id>dmulloy2-repo</id>
          <url>https://repo.dmulloy2.net/repository/public/</url>
      </repository>

and this is what I added to the dependencies:

      <dependency>
          <groupId>com.comphenix.protocol</groupId>
          <artifactId>ProtocolLib</artifactId>
          <version>5.1.0</version>
      </dependency>

Does anyone see what is wrong with this? Or am I completely skipping a step? I'm new to pom/maven in general.

slender elbow
#

<scope>provided

#

you are shading protocollib currently which is a no no

turbid tapir
#

do you have an article or other explanation of what I should be doing? 😄

slender elbow
#

you need to mark the dependency with provided scope

#

in the dependency, add <scope>provided</scope>

tardy garden
#

How do I remove all entities (the unloaded ones too) from the world?

young knoll
#

Delete the entity files I guess

turbid tapir
tardy garden
orchid gazelle
#

whenever you want to remove them

tardy garden
#

I would like to do this in onEnable because ondisable may not be called

tardy garden
orchid gazelle
#

idk what your goal is but probably on command+

tardy garden
#

I remove all entities when the server turns on (in this case I wanted) and spawn all entities according to the vehicles placed in the database

orchid gazelle
orchid gazelle
vast ledge
#

Maybe just keep track of your existing vehicles....

orchid gazelle
#

^

tardy garden
vast ledge
#

ig?

tardy garden
vast ledge
#

Why are you trying to delete them tho?

tardy garden
vast ledge
#

tf is going on with your db

orchid gazelle
#

lol

tardy garden
#

so I need to delete all entities when the server starts and then create them according to the coordinates in the database

tardy garden
orchid gazelle
tardy garden
#

my cache isnt consistent with the db

#

performance issue

vast ledge
#

what cache?

vast ledge
tardy garden
tardy garden
orchid gazelle
#

you should NOT track your vehicle position just by database entries lol

tardy garden
#

and see if the system will not be overloaded

vast ledge
#

What kinda fucking vehicles are you spawning???

blazing ocean
orchid gazelle
#

give your vehicles a proper PDC to keep track of what entities are vehicles and which are not

orchid gazelle
#

yes

tardy garden
#

im on 1.8

orchid gazelle
#

oh

blazing ocean
#

💀

orchid gazelle
#

then ig NBT tags

vast ledge
#

💀

tardy garden
#

😆

blazing ocean
#

no way it's the gongas kid!

orchid gazelle
#

use NBT Data to track vehicles

blazing ocean
#

frfr

tardy garden
orchid gazelle
#

that's NMS stuff

tardy garden
#

yes ik

orchid gazelle
#

idk if anyone here has a proper NBT nms guide

blazing ocean
#

proper way is updating

vast ledge
#

entity.addNBTTag(new NBTTag("myentity"));

tardy garden
#

How will this solve my problem?

blazing ocean
orchid gazelle
#

this should do for items @tardy garden

tardy garden
orchid gazelle
#

but for entities

tardy garden
#

If I set the nbt, does it prevent the chunk from unloading?

blazing ocean
#

?services

undone axleBOT
vast ledge
young knoll
#

You could also just store the entities uuid in a database

tardy garden
vast ledge
#

Bro had the guts to write "for free"

vast ledge
tardy garden
vast ledge
#

Thats why he told you to update...

tardy garden
#

i can get unloaded entity from uuid?

orchid gazelle
#

store entity uuid in db

vast ledge
#

maybe

blazing ocean
orchid gazelle
blazing ocean
#

then you are definitely doing something wrong

#

bros dossing himself 💀

vast ledge
tardy garden
orchid gazelle
blazing ocean
tardy garden
blazing ocean
#

lol

vast ledge
#

thats entity move event

#

theres a difference

tardy garden
vast ledge
#

like with packets and db calls

young knoll
#

That’s not even a real thing!

orchid gazelle
#

coll

#

no

vast ledge
young knoll
#

lol

vast ledge
#

Dayum he made his own event to spam his db

young knoll
#

Imagine an event that gets called that often

blazing ocean
#

how are packets the same as db calls

#

lmao

tardy garden
#

and I don't know if you know but if the server crashes there may be inconsistencies either way

blazing ocean
tardy garden
#

saving this in real time is crazy

orchid gazelle
vast ledge
#

Saving what?

blazing ocean
tardy garden
vast ledge
blazing ocean
orchid gazelle
#

imagine the amount of calls EntityMoveEvent would get if you spawn 100000 cowas

#

cows

#

💀

vast ledge
#

Server begging

orchid gazelle
#

cow moves = server kaboom

#

rico

vast ledge
#

i was about to say

blazing ocean
#

now imagine you have several of those plugin instances running

tardy garden
young knoll
#

Yes Rico

#

Kaboom

vast ledge
blazing ocean
orchid gazelle
tardy garden
#

Now imagine in these 10,000 movements 10,000 insertions in the DB and having the guarantee that the cache is only modified when the insertion in the DB occurs and take into account that an insertion takes 1 ms. The server's TPS will not drop, imagine

young knoll
#

You shouldn’t need to be tracking the location of the vehicles

#

Just track which entities are vehicle entities

#

The location will be tracked by the entity itself

tardy garden
blazing ocean
#

?tas kekwhyper

undone axleBOT
young knoll
#

The entity knows where it is because it knows where it isn’t

tardy garden
#

its possible get a unloaded entity frmo uuid?

orchid gazelle
#

congrats

#

you receive 0.1TPS

undone axleBOT
young knoll
#

It’s not loaded

blazing ocean
vast ledge
#

Why are you trying to get an unloaded entity anyways?

blazing ocean
#

that was without plugins tho

tardy garden
blazing ocean
#

with plugins it's ez shit

blazing ocean
tardy garden
#

as I have to have the cache 100% updated with adb, then the vehicle will take 5 seconds to move one block

orchid gazelle
tardy garden
vast ledge
blazing ocean
#

and if you really need to do so many db operations per second, whicj you don't, you should never even be using mysql in the first place

blazing ocean
vast ledge
#

🌟 REDIS 🌟

orchid gazelle
blazing ocean
orchid gazelle
#

mysql can scale very well

#

with a lot of servers

tardy garden
#

i dont need too

blazing ocean
vast ledge
#

HEH???

blazing ocean
#

discord uses it

orchid gazelle
#

ye ik

vast ledge
tardy garden
#

Now how am I going to take all the vehicles in the world and give them to all the people without having the uuid?

vast ledge
#

you dont

orchid gazelle
#

@blazing ocean school is beginning in 9.5h

#

damn

#

hyped

#

but nervoujs

blazing ocean
vast ledge
#

Why are you hyped

orchid gazelle
#

because I like school and I am entering the course-phase

vast ledge
#

i have to be awake in 7 hours

blazing ocean
#

i've had school for a week now and already missed today and friday

#

rly fucking sick

orchid gazelle
#

school beginning on tuesday. First houseparty of someone in school? you guessed it, this Friday

#

vast ledge
#

School start on a tuesday??

orchid gazelle
#

ye

vast ledge
#

Nahhh

blazing ocean
#

tf

vast ledge
#

whats wrong with you

orchid gazelle
#

first schoolday is always tuesday

vast ledge
#

no??

orchid gazelle
#

yes

#

ofc

vast ledge
#

Monday???

orchid gazelle
#

no lol#

vast ledge
#

Like a normal person?

orchid gazelle
#

no

vast ledge
#

yes

orchid gazelle
#

no

vast ledge
#

yes

young knoll
#

It’s always Tuesday here

vast ledge
#

Hehh

young knoll
#

Right after Labour Day

orchid gazelle
#

Coll you are based

young knoll
#

Which is a holiday

vast ledge
#

No holiday here

#

Had to work today 😢

#

Gimme ur holiday

tardy garden
#

someone know why my src folders not appears?

orchid gazelle
#

L

young knoll
#

I mean not here either

#

Labour Day was last Monday

blazing ocean
orchid gazelle
blazing ocean
#

ew

orchid gazelle
#

we speak more languages than you

young knoll
#

School started last Tuesday as well

#

I think

#

Idk I don’t go to school anymore

tardy garden
vast ledge
#

School started this monday for normal people, but I've had it since last monday

tardy garden
#

how i send sscreenshots here

vast ledge
#

?verify

tardy garden
#

?verify

#

not works

blazing ocean
#

what

tardy garden
#

ill send u on dm

young knoll
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

blazing ocean
#

?verify

young knoll
#

It’s !

#

You spoon

orchid gazelle
#

never use lightshot

blazing ocean
#

idc

#

?verify

tardy garden
blazing ocean
#

why no worky :(

orchid gazelle
#

I ain't clicking on lightshot links, I am traumatized by jumpscares

orchid gazelle
#

I got jumpscared scrolling through instagram reels still being sleepy today

orchid gazelle
#

this sucked

vast ledge
#

Great idea

#

just

#

dont sleep

young knoll
#

Well

blazing ocean
vast ledge
#

Can confirm, works 50/50

blazing ocean
#

same shitty font

young knoll
#

Did it at least wake you up

vast ledge
#

Nahhh

#

Bro created his account today

tardy garden
#

its possible remove all entities?

blazing ocean
vast ledge
#

And is also in paper discord

tardy garden
#

what files i need remove

blazing ocean
#

collio it's the gongas kid fr !

vast ledge
#

Wrong mesage

#

oof

#

I give up

#

i failed miserably

blazing ocean
vast ledge
#

what

blazing ocean
#

paper user caught !

orchid gazelle
#

Minecraft Commands

vast ledge
#

hoes that

#

hoes

#

tf

blazing ocean
vast ledge
#

who's

vast ledge
orchid gazelle
#

boys

blazing ocean
pliant topaz
#

you too, you're both on it uwu

tardy garden
#

can i use char(36) to save serialized uuids or no

river oracle
#

Was thinking about this more And honestly I think the only spot this would fall flat is Generic_9x1 and other generic inventory that aren't backed by a Tile Entity. I think it might be still beneficial to be able to make these without a player. Curious of your thoughts there. I mean could maybe add a bukkit method or something?

blazing ocean
rough drift
#

hey rad

blazing ocean
rough drift
blazing ocean
#

go on

rough drift
#

do you think I should persist bullets after being shot, or clear them out slowly if the player gets far enough

blazing ocean
#

persist them after being shot? as in, they just float?

rough drift
#

idk I like the thought of the first one but the 2nd is more potato friendly

blazing ocean
#

fade away

#

but idrk much about guns

#

youd have to ask raydan for that

rough drift
#

o

shadow night
#

what

#

I can't read

#

Short please

rough drift
#

okay so

#
  1. shoot gun
  2. cartridge falls to the ground
  3. does bulle talso fall to the ground once it stops (if it doesn't embed itself into anything, ofc)
shadow night
#

Bullets aren't visible, cartidges Idk shit

rough drift
#

and just

#

lay there

shadow night
#

Bullets aren't visible

rough drift
#

they are physical bullets

#

like actual game objects

shadow night
#

But not visible

#

Because they look ugly

#

Because high velocities

rough drift
#

they are not visible while flying straight

#

but you can def see them if they slow down enough

shadow night
#

They aren't visible at all

rough drift
#

i.e. from long enough distance

shadow night
#

In our impl

rough drift
#

yeah no I'm

#

talking about my thing

#

asking for

#

opinion

#

😭

shadow night
#

Cool

#

What are you asking me about

#

You didn't ask

#

Not a single question mark since I'm here

rough drift
#

I asked in the original message, but: do I keep the bullets/cartridges persistent or do I remove them when the player is far enough

shadow night
#

Remove them

rough drift
#

kk

left pine
#

question because when I use this:

material.addDefault("enchants", metaMaterial.getEnchants());

I get this

enchants: {Enchantment[34, DURABILITY]=1}

glad prawn
#

whats wrong

left pine
# glad prawn whats wrong

that when I put this

material.addDefault("enchants", metaMaterial.getEnchants())

I get this as a result

enchants: '{Enchantment[34, DURABILITY]=1}

unique shuttle
left pine
glad prawn
#

but it's a map, i don't see anything wrong with it

unique shuttle
#

The result is correct

robust helm
#

context? try comparing the diff with the actual code and see if u ca manually insert the line

unreal wharf
#

I get this error trying to build 1.19.4 from BuildTools, anyone know why?

[INFO] ------------------------< org.spigotmc:spigot >-------------------------
[INFO] Building Spigot 1.19.4-R0.1-SNAPSHOT                               [3/3]
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.apache.maven.plugins:maven-surefire-plugin:jar:3.0.0 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Spigot-API 1.19.4-R0.1-SNAPSHOT .................... SUCCESS [  9.636 s]
[INFO] Spigot-Parent dev-SNAPSHOT ......................... SUCCESS [  0.010 s]
[INFO] Spigot 1.19.4-R0.1-SNAPSHOT ........................ FAILURE [  0.017 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  9.768 s
[INFO] Finished at: 2024-09-09T16:56:25-06:00
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-surefire-plugin:3.0.0 or one of its dependencies could not be resolved: org.apache.maven.plugins:maven-surefire-plugin:jar:3.0.0 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Error compiling Spigot. Please check the wiki for FAQs.
If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support.
java.lang.RuntimeException: Error running command, return status !=0: [C:\WINDOWS\system32\cmd.exe, /D, /C, C:\Program Files\apache-maven-3.8.3/bin/mvn.cmd, -Dbt.name=3763, clean, install]
    at org.spigotmc.builder.Builder.runProcess0(Builder.java:1042)
    at org.spigotmc.builder.Builder.runProcess(Builder.java:967)
    at org.spigotmc.builder.Builder.runMaven0(Builder.java:936)
    at org.spigotmc.builder.Builder.runMavenServer(Builder.java:905)
    at org.spigotmc.builder.Builder.startBuilder(Builder.java:683)
    at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:60)
chrome beacon
#

You can delete it from your .m2 and try again

unreal wharf
#

ty

tidal finch
#

Hi I dont know if I am missing something but can I get food's saturation and nutrition using FoodComponent? if not is there a way to do it? getSaturation and getNutrition return 0. Even in second picture.

young knoll
#

Do you have an item with a food component

#

Idk if the vanilla food have it by default

tidal finch
#

Oh I see so there is no way of finding vanilla saturation and nutrition?

#

of vanilla food items*

carmine mica
#

I guess you can't create a 6x9 either with a single block entity, then you might as well include all those sizes

#

honestly, you could just add some API to change the size of chest block entity inventories

karmic phoenix
river oracle
neon wraith
#

I am setting a display block's billboard to center but it only faces me for about a second after being spawned can someone help me fix this? I am quite new to java so if my code looks messy

public void cool(Location L) {
        int x = 0;
        int y = 0;
        for (int i = 0; i <= 5; i++) {
            y = 0;
            x += 1;
            for (int u = 0; u <= 5; u++) {
                y += 1;
                BlockDisplay bd = (BlockDisplay) (L.getWorld().spawnEntity(L, EntityType.BLOCK_DISPLAY));
                bd.setBlock(Material.OBSIDIAN.createBlockData());
                Transformation transformation = bd.getTransformation();
                transformation.getTranslation()
                        .set(new Vector3d(x, y, 0));
                transformation.getScale()
                        .set(new Vector3d(1, 1, 1));
                bd.setTransformation(transformation);
                bd.setBillboard(Display.Billboard.CENTER);

            }
        }
    }
karmic phoenix
viscid carbon
#

What is a good way to expand GUI slots with the amount of items you have?

#
return Bukkit.createInventory(null, taskManager.getTasks().size(), "Tasks");```
#

so say i have 9 items but i add another so i want it to make another line

worldly ingot
#
int size = taskManager.getTasks().size();
size = ((size / 9) + 1) * 9;

Bukkit.createInventory(null, size, "Tasks");
#

That should work fine. The ((size / 9) + 1) * 9 is basically just rounding down to the nearest 9

((x / 9) + 1) * 9
((0 / 9) + 1) * 9 = 9
((5 / 9) + 1) * 9 = 9
((10 / 9) + 1) * 9 = 18
((24 / 9) + 1) * 9 = 27
#

That will give you an extra line if you have 9/9 though, so you could do ((Math.max(size - 1, 0) / 9) + 1) * 9 to fix that I think?

viscid carbon
torn shuttle
#

uh remind me, was there a way to click to go to a url using spigot text components

#

there was right

#

yeah I see it nvm

#

truly gigabrain I even had a utility method for it in a library I forgot about

#

sometimes my wit impresses even me

lethal onyx
#

help me pls

java: cannot access com.viaversion.viaversion.api.Via
  bad class file: /C:/Users/Lol/.m2/repository/com/viaversion/viaversion-api/5.0.4-SNAPSHOT/viaversion-api-5.0.4-20240907.084814-31.jar!/com/viaversion/viaversion/api/Via.class
    class file has wrong version 61.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.```
drowsy helm
#

“Class file has wrong version 61.0 should be 52.0”

lethal onyx
#

so it was compiled with a newer Java version

#

ye

#

mb

#

it was a newer version

echo basalt
#

And just make a special case for 0

quaint mantle
echo basalt
#

Fairly easy to do

quaint mantle
#

new to developing

echo basalt
#

Then don't do it

quaint mantle
#

bro

#

okay

#

☠️

agile anvil
#

As a newcomer to developing you should not start with this

quaint mantle
#

but i'm not expert AT ALL

agile anvil
#

Many concepts are involved in this, and not mastering any of those might make the development of this pet extremely difficult

echo basalt
#

Oscilates up and down on the Y axis and ensures a distance to the player

echo basalt
#

If you spin in circles it won't really move because the distance is there

quaint mantle
#

what should i*

#

use

#

to run it

#

BukkitRunnable?

echo basalt
#

Dunno java code

quaint mantle
#

u aren't helping yk

echo basalt
#

?spoon

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

quaint mantle
#

oh wow

echo basalt
#

I'd prob tick them every tick given they have idle animations n shi

quaint mantle
#

k

agile anvil
#

Looks like a constant loop with:

  • animation (jump)
  • change facing to player
  • move if distance
#

Then you have to figure out how to manage multiple players, the spawn / despawn, ...

echo basalt
#

So..

#

PetInstance, PetController, PetUpdateTask

quaint mantle
#

I have the logic to spawn, despawn, assing to players

#

I only want that animation and i want that if player goes forward facing the pet it stays until player stills goes forward

echo basalt
#

Yeah you just need to ensure a specific distance to the player

#

Let's make it a "min distance" and a "max distance"

#

So there is a range where the pet doesn't move

#

If the player is too close, move the pet away (get the difference between it and the player, nuke the Y, normalize, multiply by max distance)

#

If the player is too far, move the pet closer (get the difference between the player and it, nuke the Y, normalize, multiply by min distance)

#

and then you do the Y after ig

#

You can also just not nuke the Y and add a constant value to it, also works

#

up to you

agile anvil
#

Don't forget to also check the collision and actual floor Y

sweet pike
#

if one were to PR it in

pseudo hazel
#

probably

#

the api can benefit from a lot of things

pseudo hazel
#

thats a whole entity

blazing ocean
#

oh i misread

sweet pike
#

nah that's right

#

completely forgot that existed

quaint mantle
#

yo how do i get killer of EntityDeathEvent?

smoky anchor
#

Most likely from the DamageSource

quaint mantle
#

And how do i get player from damage source?

#

(obviously, making an if to detect if it is a player)

agile anvil
#

then you cast it as a Player if it's one instance

tardy garden
#

exists some api to set persistent data Is there any API to set persistent data in an entity?

#

on 1.8

blazing ocean
#

no

tardy garden
#

you are lying

blazing ocean
#

ok

#

didn't know

vocal cloud
#

You can use the nbt API stuff. It's super miserable but it works.

tardy garden
#

Caused by: de.tr7zw.nbtapi.NbtApiException: [Selfchecked][2.13.1]This Method is only avaliable for the version MC1_14_R1 and above!

vocal cloud
#

Then you've got to figure out what works for 1.8

vocal cloud
#

I'm sure there is documentation for the method you called that threw that

tardy garden
#

omg

#

very good idea Best workaround is putting an item on the entity like a button as helmet

rugged rose
#

Anyone if knows you can either dm me or reply in the thread.

twin venture
#

hi while using mongodb , the collection is not creating .. what should i do?

tardy garden