#help-development

1 messages · Page 256 of 1

wet breach
#

well as long as you are smart about it, and are not spawning a crap ton of them you can easily do so without problems

restive mango
#

How much is a crap ton you think

tall dragon
#

im bringing my snowballs.

wet breach
#

well for tridents probably somewhere around 50 depending on the server setup and everything else

restive mango
#

One of the major issues I’ve had is I’ve coded this thing where I can convert a chunk of land into a chunk of falling blocks 5x5x5 in size and then move them around in 3D space

tall dragon
restive mango
#

Dear

#

50 is less than 125

#

😦

wet breach
#

well, I am not exactly sure because I never load tested how many tridents could you really spawn without issues

#

just there is more logic to tridents then normal projectiles is all

#

like don't tridents go back to their owner?

tender shard
#

only with this enchantment

tall dragon
#

with a certain enchant yea

tender shard
#

otherwise no

restive mango
#

I just delete them as soon as they hit an entity or the ground

wet breach
tender shard
#

i think it's called Riptide?

#

idk

tall dragon
#

RipTide is that u can jump with it

#

iirc

sonic goblet
#

Loyalty I think

restive mango
#

Nah riptide is the one that lets you look like palpating

wet breach
#

then as long as you don't have that enchantment I suppose you should be fine then

restive mango
#

Palpating

tall dragon
#

Loyalty yea

tender shard
#

I made a plugin about this enchantment but I have no clue how it's called lol

restive mango
#

Palpating

#

Palpating

#

Palpatine

tender shard
#

loyalty

wet breach
#

then I guess the next thing to do, would be to test 125 tridents being spawned

tender shard
#

the enchantment is called loyalty

wet breach
#

if you don't have issues you should be fine

#

and as long as you don't have that loyalty enchant on them lmao

dapper forge
#

Hey, i encounter the weird issue, that at some point, my Passengers i sat on an Entity get instantly ejected, did anybody else encounter this?
iam still at debugging the cause so i hope i can follow up with more informations if i get some.

restive mango
#

I honestly didn’t know particles were entities

#

I thought they were their own thing

#

Frost said so

dapper forge
#

are they? didn't looked into the code that deep

#

let me check :D

tender shard
tender shard
restive mango
#

@wet breach !!

tender shard
#

particles "do not exist"

restive mango
#

Settle the disagreement

tender shard
#

they are NONT entities

dapper forge
restive mango
#

Are they entities or not

#

????

tender shard
#

no

#

particles are not entities

#

they are simply a packet sent to the client "yo show some particles at X,Y,Z"

dapper forge
restive mango
#

!

tender shard
#

for the server, they don't even exist

restive mango
#

Frost said they were

#

Wtf

tender shard
#

that's wrong

dapper forge
#

they aren't

tender shard
#

I am 420% sure

dapper forge
dapper forge
#

org.Bukkit.Particle is it's own class and does **not ** extend any other.

tender shard
#

^

#

btw thx xxlucy, thanks to you I discovered that profile pic decorations now exist lol

torn shuttle
#

pride cometh before the fall

dapper forge
#

alright so i did some more debug

#
[23:27:38 INFO]: =========================================================
[23:27:54 INFO]: Item Blocks are alright!
[23:27:54 INFO]: Checking Passengers!
[23:27:54 INFO]: NogitsuneZero is on the Sled!
[23:27:54 INFO]: Alive? SF: true AS: true
[23:27:54 INFO]: =========================================================
[23:27:54 INFO]: Item and Passengers are okay!
[23:27:54 INFO]: [ZeroPower] Silverfish ejected: NogitsuneZero
[23:27:54 INFO]: [ZeroPower] Silverfish ejected: Armor Stand
[23:27:54 INFO]: Item Blocks are alright!
[23:27:54 INFO]: Checking Passengers!
[23:27:54 INFO]: Alive? SF: false AS: true
[23:27:54 INFO]: ========================================================
dapper forge
#

can i somehow get the reason it does despawn?

#

i guess no one has an idea? or do you need the code? 🤔

#

.isRemoved() does return true so iam sure now, the entity get's removed by the Server 🤔

#

omg

torn shuttle
dapper forge
#

i am so incredible stupid

dapper forge
torn shuttle
#

you removed the entity

dapper forge
#

a member of my dev server set difficulty to peaceful.... which despawns SilverFish which i abuse for my stuff right now

#

i feel so dump

torn shuttle
#

ah yeah that's a classic

dapper forge
#

i wanna bgn my head against a wall, i just wasted a hour of debugging for that

torn shuttle
#

at least make it an armorstand

dapper forge
#

because of an attached model etc. i used, the best solution for now was the silverfish 🤔

torn shuttle
#

I have time travelling javascript code somehow

dapper forge
#

i did a thing ! 😄

dapper forge
torn shuttle
#

found the issue

#

I forgot to set it to wumbo

#

what a beautiful webapp

dapper forge
#

do you know how to check if any passenger of an entity is instance of player?

#

i am more a python programmer, and i know how to solve this in python but not in java :(

eternal oxide
#

if(entity.getPassenger() instanceof Player)

dapper forge
#

yes i know that it exists but i have multiple Passengers to carry some stuff

hazy parrot
#

its deprecated in newer version afaik

eternal oxide
#

because you can have more than one now

hazy parrot
dapper forge
#

i have this clunky stuff, but isn't there a more efficient way?

Bukkit.getLogger().info("Checking Passengers!");
                              boolean player_is_on_sled = false;
                              for(org.bukkit.entity.Entity ent : sled_engine.getPassengers()){
                                  if(ent instanceof Player && ((Player) ent).equals(player)){
                                      player_is_on_sled = true;
                                      break;
                                  }
                              }
#

would using a filter be more efficient?

torn shuttle
#

why do you need that at all

eternal oxide
#

entity.getPassengers().forEach(...

dapper forge
#

exactly

torn shuttle
#

what is it for

hazy parrot
#

you can just

for(entity in passengers){
  if(entity is player) return true;
}
return false;
dapper forge
#

java has the in keyword? :o

hazy parrot
#

its pseudo

#

you already kinda used it

#

for(org.bukkit.entity.Entity ent : sled_engine.getPassengers()) here

torn shuttle
#

using kotlin is loser behavior

hazy parrot
#

kotlin > java

dapper forge
hazy parrot
#

nono, revert original

torn shuttle
dapper forge
#

Alr. sorry iam a noob then ;D

dapper forge
eternal oxide
hazy parrot
#

more like enchanted java

torn shuttle
#

no need to compare it against anything

dapper forge
dapper forge
torn shuttle
#

then check if there are less than 2 passengers

dapper forge
#

as i sit the player first sled_engine.getPassengers().get(0) should be enough, also it works, but for some reason doesn't feels right.

#

if you think is reliable enough i think this would be better solution, right?

torn shuttle
#

I would only access it to check the count

#

seems like you have a hard threshold where if there's less than 2 passengers then there is no reason to have the sled

dapper forge
#

normally should be 2, so yeah i think that's the way to go, thanks!

torn shuttle
#

and it saves you on checking entity types

dapper forge
#

exactly, didn't tought about that before, thanks m8 !

torn shuttle
#

the fastest code is the code that doesn't exist

dapper forge
#

good advice ! :D

#

sled_engine.getPassengers().size() == 2 should be it then, right? :D

#

ah nvm i should stop asking and test myself, sorry to bother you!

#

yeah which means with 2 entrys it should be 2 and as normally it always should have 2 the == 2 should be enough to ensure that :D

torn shuttle
#

arrays are 0-indexed

#

(in java)

#

I guess collections in general are

dapper forge
#

yeah but the size gives Max Index +1 so if you have 2 entrys it gives you the 2 :D

tender shard
dapper forge
#

:yessir:

torn shuttle
# tender shard lua >.<

say hello to MagmaScript where collections are -1 indexed in the memory of my dog which you shot in cold blood

worldly ingot
#

I shivered at the prospect of -1 indexed arrays

torn shuttle
#

mfnalex said he wanted to do a tiktok trend called "does this shotgun look loaded to you" with my dog and I think he should be in jail

orchid gazelle
#

Tried some Berliner Luft this weekend lmao

opal juniper
torn shuttle
worldly ingot
#

That's just the other side of the array!

torn shuttle
#

we can go further and use different bases for getting and setting elements, that would be interesting

orchid gazelle
#

Explain -1 indexed? Does it mean that the index of arraylists just start at -1 instead of 0?

torn shuttle
#

yep

worldly ingot
#

Could you imagine,

int[] array = new int[10];
for (int i = -1; i < array.length - 1; i++) {
    int value = array[i];    
}```
orchid gazelle
torn shuttle
#

ok so why does javascript's cloneNode not clone the function of my button

wary topaz
#

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

So basically i'm trying to make a class that just gets messages from a properties file. but it seems I keep getting errors such as the one in the file (Code and error in that link)
Can somebody help me?

worldly ingot
#

Oh my. Please don't be loading that file every single time you call the method

wet breach
#

second you should let java handle path separators

wary topaz
#

its been tested it works

#

the file is accessable

orchid gazelle
#

But it is not good

wary topaz
#

even intellij marks it

#

wdym

orchid gazelle
#

Some things just work, but they are bad

worldly ingot
#

The error is almost definitely this line because you're accessing index 0 without checking if there is an index 0,
p.sendMessage("" + translate.replace('&', '§').replace("{0}", args[0]));

wary topaz
#

@worldly ingot people can change stuff in the file though

worldly ingot
#

That's fine... have a reload command

#

Do not load that file synchronously every single time

wary topaz
#

true

#

i'll put that in my trello lol

wet breach
#

you should always verify the data is there first

#

regardless if people can change it

wary topaz
#

i have a backup if an error it just goes to the default one in the jar

wet breach
#

and if the data isn't there, you should fail silently where possible or handle the error by correcting it

worldly ingot
#

It's fine for Properties. It's like a Map and will return null

wary topaz
#

ya

worldly ingot
#

(or if there's a default property, that first)

wary topaz
worldly ingot
#

Well there's no other array accesses in that method

#

And that's an AIOOBE

wary topaz
#

aioobe?

worldly ingot
#

ArrayIndexOutOfBoundsException

wary topaz
#

o

worldly ingot
#

Only other array access you're doing is on a newly created array of size 1

tender shard
#

ArrayIndexInsideBoundsException

orchid gazelle
#

Ayeee its the Jägermeister guy

wary topaz
#

this is what I did but it gave the same error:

if (args != null) {
                    if (args[1] != null) {
                        p.sendMessage("" + translate.replace('&', '§').replace("{0}", args[0]));
                    }
                }
#

the fact that it gave the error is weird

wet breach
#

args will never be null, just empty

wary topaz
#

so replace the second check with .isEmpty?

wet breach
#

yep and that should work

tender shard
#

arrays don't have an isEmpty() method

wary topaz
#

its a string[]

wet breach
#

check its length

#

.length != 0

#

if there is something in that array, even if its at index 0, it will have a length of 1

tender shard
wary topaz
#

Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 0

orchid gazelle
tender shard
orchid gazelle
tender shard
#

you can only do myArray[1] if it's length is at least 2

orchid gazelle
#

3L bottle peppermint lmao

tender shard
#

that's enough to brush your teeth at least 25 times

tender shard
#

maybe 27 times

orchid gazelle
#

That party took away 12 Liters of liquor

torn shuttle
wary topaz
#

if (args[1].length() != 2) { errored

#

maybe 1?

tender shard
#

yeah that makes no sense

#

args.length()

wary topaz
#

you said length

tender shard
#

not args[n].length()

#

?learnjava

undone axleBOT
wary topaz
#

oh

orchid gazelle
wary topaz
#

its not java its me being stupid

tender shard
#

args[1] is the second element of an array, it has no length

orchid gazelle
#

Also had some Jägermeister lmao

tender shard
#

args is the whole array, it does have a length

wary topaz
#

Method call expected

tender shard
#

String[] myArray = {"a","b","c"};

#

myArray.length() would be 3

#

myArray[1] would be "b"

#

so myArray[someNumber] is a string

#

myArray is a string[]

wary topaz
#

ya ik indexes start with 0

orchid gazelle
#

-> indexes start at 0, length-checks start at 1

wary topaz
#

if (args.length() != 1) {??

#

oh wait nvm

#

not ()

hazy parrot
#

without ()

tender shard
#

what they sent is correct

hazy parrot
#

.length() ?

wary topaz
#

Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0

tender shard
#

oh you mean the length thing

hazy parrot
#

its arr.length

orchid gazelle
#

no, length is not a method

wary topaz
#

if (args != null) {
if (args.length != 1) {
p.sendMessage("" + translate.replace('&', '§').replace("{0}", args[0]));
}
}

tender shard
#

yeah, length is a field and not a method

#

so it's just length and not length()

wary topaz
#

this is how I call the method:

if (sender instanceof Player) {
            plugin.getMessage("clearChatCommandMessageToSendToConsole", null, args);
        } else {
            plugin.getMessage("clearChatCommandMessageToSendToConsole", null, null);
        }
        return true;
tender shard
#

maybe we have to send the extended version

#

?learnjava!

undone axleBOT
dapper forge
#

do you think it is possible to offset a second passender on a Entity? 🤔
Took a look into the Entity.Class but didn't found anything regarding the position.

tender shard
#

fun fact: I watched that movie 2 hours ago

molten hearth
#

damn

dapper forge
tender shard
#

yes 🥲

torn shuttle
#

rate how sexy this is looking out of 10

dapper forge
#

some people claim to have done it using NMS 🤔 but i can't find anything regarding it so even if they actually did manage it they ofc never opened up the source :(

tender shard
#

the server only informs clients "x is a passenger of y", it doesn't send any information about the "relative location" or anything

dapper forge
dapper forge
torn shuttle
#

would you script me? I would script me

tender shard
#

sorry, I only script cute dudes < 21 yrs

torn shuttle
dapper forge
tender shard
#

my bf is 20

#

legal age here is 14/18 lol

dapper forge
tender shard
#

germany

torn shuttle
#

same here I think

worldly ingot
dapper forge
worldly ingot
torn shuttle
#

tell? they get shot

worldly ingot
#

oh shit

#

They do things differently in Germany

torn shuttle
#

clearly you've not heard of mfnalex

tender shard
#

he's not black and we're not in US, he won't get shot lol

worldly ingot
#

OH SHIT

#

BACK TO DEV TALK

rare rover
#

would there be a better way of doing this?

    public static Map<UUID, Map<Material, List<PlayerGenerator>>> getFormatedGenerators(Player player) { 
         return PlayerGenerator.getPlayerGenerators().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue().stream().collect(Collectors.groupingBy(generator -> generator.getGenerator().getMaterial())))); 
     }```
torn shuttle
#

guys how can I make a plugin that will make mfnalex not racist?

worldly ingot
#

Well that's certainly something

rare rover
#

Yep

tender shard
torn shuttle
#

I want to make it so every time someone shoots a target in mc mfnalex gets shocked in the nuts

worldly ingot
#

Generally speaking, 3 nested collections is just an all around bad idea

#

What's your input, what are you doing with the output? Surely there's a better way to handle this

rare rover
#

I thought so

#

Im looping each player aka uuid then looping the materials then getting the size of the list then spawning an entity on the last element of the list

#

the size of the list = x amount of entities

dapper forge
#

Something like that

worldly ingot
#

Give me like 5 mins. I'll try and clean that up to the best of my ability, Josh

rare rover
#

Thank you kind sir

dapper forge
#

it was fast stuff that came to my mind :(, don't judge this code out of my head.

dapper forge
#

AAAAA

#

why this stickers everytime

#

gosh

worldly ingot
#

What does getPlayerGenerators() return?

#

A Map obviously, but the generics?

torn shuttle
#

I would give you that just to get footage of you hunting mfnalex down

dapper forge
#

@tender shard i have free candy, do you give me your adress so i can ship it to you? :kek:

rare rover
#

I think

#

Im on my phone so

worldly ingot
#

It's a Map though

rare rover
#

I had that on my github

worldly ingot
#

Map<UUID, List<PlayerGenerator>> then presumably

rare rover
#

One sec

tender shard
#

huh

rare rover
#
         return playerGenerators; 
     }```
tender shard
#

why

#

why kick/ban, did I miss something, lol

worldly ingot
#

oki

torn shuttle
#

if anyone trips and falls on documentation on the 1.19.3 implementation of resource pack atlases let me know

dapper forge
#

did it change from 1.19 at all? 🤔

torn shuttle
#

it changed to the point where resource packs are not working on 1.19.3

#

and I can't guess without documentation, of which seemingly none exist

#

only solution people suggested was decompiling the defaults and that doesn't sound like fun

dapper forge
#

it isn't

tender shard
torn shuttle
#

?

#

what client logs

#

the dumbest part is that it looks like the new atlas system could've autogenerated the files it needs, I really don't know what mojang was thinking

tender shard
#

well the client also does logging

worldly ingot
#

KEKW @rare rover I literally cannot think of a better way to do this. I would honestly opt out of using a Stream entirely due to the complexity of the task you're trying to achieve here. I would opt instead also for a Map<UUID, ListMultimap<Material, PlayerGenerator>>, which is still ugly, but it at least gets you out of 3 nested collections

tender shard
#

if the resource pack doesnt work, it will definitely log why

worldly ingot
#

You can make a ListMultimap with MultimapBuilder.hashKeys().arrayListValues().build()

torn shuttle
#

I mean, checking it right now it basically just says there's missing textures

rare rover
#

Where would i find all maps, hashmaps, lists

#

I wanna learn them all

#

Could be very useful

hasty prawn
#

Maybe look at what extends Map and Collection

torn shuttle
#

personally I like using ArrayListMultimap from commons-io

rare rover
hasty prawn
#

Uhh I think if you go to the Map class in IntelliJ there's a little O with an arrow next to the class definition

#

If you click that I think it should show you all of them

rare rover
#

👍

dapper forge
#

i was reading D:

wary topaz
#

hi guys hru?

last sleet
#

good

ionic dagger
#

im not seeing the problem here

#

the error says the list is empty, but it should contain the was goozed to death by a zombie villager! message, right?

fading spindle
#

if a list has players in it. is using list.get(int) a specific index which has a player in it and casting it to a regular player variable ok?

#

like in a situation lkii,ke thise

ionic dagger
#

if a players stored in index 0, whats wrong with using .get(0) to return the player at the first index?

fading spindle
#

yes but i want all the players in the list to get the effect

ionic dagger
#

wait

fading spindle
#

so the loop increments and then does those effects to the second player

ionic dagger
#

were you saying that in response to me

fading spindle
#

just generally

ionic dagger
#

oh

#

awk

fading spindle
#

haha

#

(forgive for using while btw)

hazy parrot
sullen marlin
#

for (Player nearPlayer : nearbyentities)

fading spindle
#

yes a foreach loop

#

but i wanted to check out this scenario and see if it while still work

#

cause im just wondering is if casting like that is allowed

ionic dagger
#

this j produces a null response, but no error

fading spindle
#

so it thinks the list is empty/

#

?

sullen marlin
#

Idk code looks ok at a glance, debug it

#

Is deathconfig right, is the formatted string right

ionic dagger
#

getDeathConfig() just returns deathConfig

#

and the string formatting seems okay

sullen marlin
#

Uh I don't think you can use getDataFolder in a field initialiser of your main class

#

Set it in onEnable instead

#

Surprised it's not erroring

river oracle
#

maybe it just takes null as an empty string equivalent

ionic dagger
#

set both in onEnable or just the top one

sullen marlin
#

Both

#

Yeah idk what new File(null does

ionic dagger
#

getDeathConfig() doesnt work then?

sullen marlin
#

f parent is null then the new File instance is created as if by invoking the single-argument File constructor on the given child pathname string.

#

Yeh it's loading from your server root, not plugin folder

#

Move to onEnable

ionic dagger
#

sorry, im confused
to use it in the string formatting part, where am i getting the deathConfig from if what im moving is private

river oracle
ionic dagger
river oracle
#

you can keep the fiedl yk

#

just put the init inside of onEnable

#

don't make them final fields either

#

if intellij yells at you disable the warning and tell it to politely go fuck itself

sullen marlin
#

Also probably move the deathFile.exists before the loadConfiguration

ionic dagger
sullen marlin
#

You need to initialise deathFile before checking it exists

#

Might be worth brushing up your programming or thinking carefully

#

?learnjava

undone axleBOT
glad prawn
#

xd

fading spindle
#

what's the turtle master potion called in spigot

glad prawn
#

TURTLE_MASTER?

fading spindle
#

what

#

i dont see it :(

glad prawn
ionic dagger
#

the code that i have is making sense to me

#

but its j giving a null response

#

and idk how to find the answer to the problem

quaint mantle
#

Is it possible to make a custom EntityPlayer chat?

last sleet
#

a separate chat for only a few players?

quaint mantle
#

No

#

like

#

The custom EntityPlayer chat

#

like send a chat packet with it

#

so it looks like it chatted

vapid grove
#

Cause it seems WAY better

#

than what I was doing

summer scroll
#

Like what's the end goal

quaint mantle
#

To have a few NPC's be chatting

summer scroll
#

Can you just broadcast a message, no?

quaint mantle
#

I suppose I could, kinda seems half ass tho

#

Whats the packet for chatting?

summer scroll
#

I don't know the packet for chat.

#

But I feel like you're complicating stuff.

quaint mantle
#

Could be

#

Ok

#

Last question

#

Any idea how to make the custom EntityPlayer have velocity aswell as knockback?

subtle folio
#
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.file.FileConfiguration.options()" because "this.config" is null
        at world.ntdi.nrcore.NRCore.onEnable(NRCore.java:26) ~[nrcore-1.0.3.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:542) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:565) ~[paper-1.19.2.jar:git-Paper-270]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:479) ~[paper-1.19.2.jar:git-Paper-270]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:636) ~[paper-1.19.2.jar:git-Paper-270]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:422) ~[paper-1.19.2.jar:git-Paper-270]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:306) ~[paper-1.19.2.jar:git-Paper-270]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1100) ~[paper-1.19.2.jar:git-Paper-270]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305) ~[paper-1.19.2.jar:git-Paper-270]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]``` How come my config is null, It's in my resources folder, im so confused
#

wait no i know

#

i was calling the variable

#

not getconfig

#

oopss

vapid grove
#

I did as it stated however it doesnt work

#
<dependency>
            <groupId>org.ipvp</groupId>
            <artifactId>canvas</artifactId>
            <version>1.7.0-SNAPSHOT</version>
            <scope>compile</scope>
        </dependency>
#

It states that it cant resolve the dependancy for this

jagged monolith
#

Did you do git clone https://github.com/IPVP-MC/canvas.git cd canvas/ mvn clean install

vapid grove
#

Yes, I did

#

The only issue: I couldnt do mvn, it didnt reconize it

#

so i just use the run/debug config

#

to clean install

#

Unsure if that worked or not

#

Im using intellij

jagged monolith
#

?paste

undone axleBOT
jagged monolith
#

Paste your build file

vapid grove
#

@jagged monolith my pom or

#

i have 0 clue what a build file is otherwise

jagged monolith
#

Yes, your pom.xml

vapid grove
#

here

jagged monolith
#

Looks fine, maybe reach out to the dev and ask them

vapid grove
#

wait no i didnt clean install it correctly

#

@jagged monolith it says mvn isnt a reconized command

#

am i doing something wrong, idk if its cuz im using intellij

tulip nimbus
#

Question about Vectors, does Vector#multiply() perform element-by-element multiplication or does it perform actual matrix multiplication?

#

(For the case where the argument is another Vector)

wet breach
#

Open the project in intellij compile with maven from there

vapid grove
#

wdym

#

oh i see

wet breach
tulip nimbus
wet breach
#

Yes

vapid grove
#

Oh my god

#

thank you frost

#

have 0 idea y that worked but it did

wet breach
#

You never installed maven stand alone

#

You were using maven provided by intellij

#

So all that was needed was just open project in said ide instead and build from there

vapid grove
#

ohhh

wet breach
#

Now you know for future stuff so you don't encounter this problem again

vapid grove
#

?paste

undone axleBOT
vapid grove
#

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

My code refuses to work correctly, the plrData object doesnt show the same things in every place.

plrData.get(p.getUniqueId()).put("Page", "Lot");
plrData.get(p.getUniqueId()).put("AllowC", false);

This is what its supposed to show.

Instead, in the menu.getSlot(?, ?).setClickHandler functions, they are viewed as:

"Page" = "Main"
"AllowC" = true

Everywhere else shows it correctly. Anyone have an idea why?

quaint mantle
#

Maybe open a GitHub issue on their GitHub since I don’t really understand the lib

vapid grove
#

Its not related to the library whatsoever

#

This is just a general bug.

quaint mantle
#

Oh

#

Can you send a full class

vapid grove
#

For some reason it shows the old values inside the setClickHandler function

vapid grove
#

Its the paste

quaint mantle
#

Ohh

vapid grove
#

Find anything?

raw prairie
#

First time making a backend plugin

#

harder than it seems!

#

I still have yet to test it

#

kek

vapid grove
#

Okay, I updated my code after testing a ton of times it STILL doesnt work

#

Im gunna send my updated code

#

someone PLEASE help

rotund ravine
rotund ravine
#

With the put where you set it to menu

#

To putIfAbsent

vapid grove
#

lets see

#

@rotund ravine Nope, it only runs Test once as well btw

rotund ravine
#

Show new code

#

Also highlight test with a comment for me

vapid grove
#
menu.getSlot(2, 5).setClickHandler((player, info) -> {
            System.out.println("Test"); //Hey!!!! THIS ONLY RUNS ONCE!!!
            if(plrData.get(p.getUniqueId()).get("Page").equals("Lot")){
                System.out.println("Test2");
                getRandomReward(5,p);
            }else{
                startLottery(p);
            }
        });
rotund ravine
#

Seems like a library thing if it only runs that part once?

clear granite
#

Is there a wait method for spigot that isnt creating a Bukkit runnable

rotund ravine
clear granite
#

i just wanted to do something like create a mob set it to invunerable , wait 5 seconds, and then make it vunerable again

jagged monolith
#

^ that would be the best thing to use for it

clear granite
#

yea i was just wondering if there was another thing for it

rotund ravine
#

You can’t tell the thread to wait safely

clear granite
#

but alright ill work with it thanks 👍

#

oh is that why you cant use the wait in spigot

rotund ravine
#

There’s other ways, but scheduler is already there

rotund ravine
vapid grove
#

I cant find any contact info for the developer.

#

Nor can I see any good information on how to fix this

clear granite
#

oh i didnt know that that actually explains why i cant use the wait method

rotund ravine
#

Use IF emerald

vapid grove
#

?

#

whats IF

rotund ravine
#

Inventory library

vapid grove
#

@rotund ravine Ah ty

rotund ravine
#

Stef is really responsive to issues

vapid grove
#

@rotund ravine I dont understand what my top level of my package is

#

can you tell me rq

rotund ravine
#

In regards to what?

vapid grove
#

it says replace [YOUR PACKAGE] with top-level package of your project

#

i need it shaded

rotund ravine
#

Oh

#

me.emerald.serverplugin

vapid grove
#

@rotund ravine what function should I use to check for a click at the actual gui

#

gui.setOnTopClick(event -> {});
gui.setOnBottomClick(event -> {});
gui.setOnGlobalClick(event -> {});
gui.setOnOutsideClick(event -> {});

#

Im unsure if its top or global or whatever

#

its confusing

rotund ravine
#

Globalclick is any click

#

Top is top inventory

#

Bottom is bottom inventory

#

Out side is outside

vapid grove
#

ok so top is what i should use

rotund ravine
#

Yeah if u only care about top

vapid grove
#

@rotund ravine Final question: How would I go about adding a singular item to the gui

#

cause it seems different

rotund ravine
#

And set it on a pane

#

Or a gui

vapid grove
#

@rotund ravine Now all I see is the item I wanted to add to the current gui

#

Yet it had another pane before that

rotund ravine
#

Hm? Whats ur code

vapid grove
#
ChestGui inv = findMenu.get(p.getUniqueId());
                        StaticPane pane = new StaticPane(c, 2, 1, 1);
                        pane.addItem(new GuiItem(item), 0, 0);
                        inv.addPane(pane);
                        inv.update();
rotund ravine
#

What happened and what did you expect?

vapid grove
#

@rotund ravine So?

rotund ravine
#

Alright

#

Sry am on my way to school. But instead of a pane, you can simply getInventoryComponent and setItem on that with ur item i suppose.

quaint mantle
#

best way to embed a webserver in plugin ?

chrome beacon
#

You shade it

rotund ravine
rotund ravine
vapid grove
#

im so used to .getslot so im having difficulty

rotund ravine
#

Oh, it’s basically just a grid

vapid grove
#

yea but

#

how do i get a slots grid

#

placement

quaint mantle
chrome beacon
#

Make your own webserver in Java

rotund ravine
vapid grove
rotund ravine
#

3x9?

vapid grove
#

yea

quaint mantle
vapid grove
#

i need the paper in the direct middle

#

well barrier

wet breach
# quaint mantle Whats the easiest way ( no api)

Well easiest way is to just creat a socket listener but like it's just easier to shade apache http stuff because otherwise you are going to have to handle serving content yourself. It's not like automatic lol

vapid grove
#
ChestGui inv = findMenu.get(p.getUniqueId());
                        inv.getInventoryComponent().setItem(new GuiItem(item), 4, 1);
                        inv.update();
#

This is my current

#

But it wont even apepar

rotund ravine
#

It’s set from top right to buttom left

chrome beacon
vapid grove
#

thats so weird

chrome beacon
#

So you don't have a choice

quaint mantle
vapid grove
#

but still it doesnt even appear

rotund ravine
#

So try 2, 1 @vapid grove

vapid grove
#

thats the MAJOR issue

quaint mantle
#

but I will go for apache

chrome beacon
#

So you will use an api

rotund ravine
#

Oh you are

#

Sec

#

Just gotta switch busses

#

Instead of update try show @quaint mantle

#

Wait nvm it already does that

#

Is the item present in getItems()?

quaint mantle
#

?

#

what to show

rotund ravine
#

I said nvm

#

Is the item present in getItems()?

#

I’ve only ever used panes

quaint mantle
#

idk what u r talking bout

vapid grove
#

checking

rotund ravine
quaint mantle
#

bruh

quaint mantle
vapid grove
#

@rotund ravine ho wowuld I check?

rotund ravine
#

If it doesn’t work i’d go back to using panes and playing around with that a bit. I am not home atm and gotta attend a lecture in 15 min.

vapid grove
#

it says 6

#

2 are black and white panes

#

3 are the papers

#

i think

rotund ravine
#

So that’s correct?

vapid grove
#

@rotund ravine just noticed something, do I need to specify that its ALLOWED to replace items?

rotund ravine
#

Doesn’t look like it. But you might actually need to make a static pane the size of the chest @vapid grove

vapid grove
#

Wait... it says that it can ONLY fill empty inventory slots

rotund ravine
#

Can’t test it atm, but it’s a mostly pane system, so it handles everything by the pane.

vapid grove
#

sec

rotund ravine
#

Just make a staticpane “new StaticPane(9, 3)” and set the stuff on there. Supposedly that should work. Then use the addItem on the pane and the addPane (once should be fine) on the gui

#

I can test more later in like 8 hours when i get home

#

I’ll head into my lecture. Hopefully you can figure it out or someone else here can help you.

vapid grove
#

Didnt work, ill figure it out tommorow.

#

Ill ask for help when ppl are online to help

quaint mantle
remote swallow
fierce whale
#

Is there dependency of mythicmob?
I tried to find it but I couldn't 😥

onyx fjord
#

It should tell you on startup

sacred sedge
#

Why can't I implement my own RecipeChoice?

#

I want an ExactRecipe that matches off name instead of off isSimilar

eternal oxide
#

isSimilar also matches name

#

You however should never use the name to match

glossy venture
#

anyone know the mojang mapped names of these packets?

earnest forum
#

use this

eternal oxide
#

depends on what spigot version

#

NO clue on your version as PacketPlayOUt has not been used in a LONG time

glossy venture
eternal oxide
#

net.minecraft.network.protocol.game.ClientboundSetPlayerTeamPacket

jagged monolith
sullen marlin
#

DONT USE PACKETA FOR SCOREBOARDS

#

THERE IS NO REASON TO. EVER.

jagged monolith
#

That's true. The API has pretty much everything needed for scoreboards.

glossy venture
#

im trying to set the team for an npc

torn shuttle
#

I see md5 got in the xmas mood

#

setting coal on fire and throwing it at people who don't use the api, this is what xmas is about

torn shuttle
#

speak for yourself, it makes for a lovely roast

glossy venture
#

it shouldnt show the name tag

    {
        // create team
        scoreboardManager = Bukkit.getScoreboardManager();
        scoreboard = scoreboardManager.getMainScoreboard();
        team = scoreboard.getTeam("npc");
        if (team == null)
            team = scoreboard.registerNewTeam("npc");

        // set team settings
        team.setPrefix(TextUtil.translateLegacy("&8&l[NPC] &8"));
        team.setColor(ChatColor.DARK_GRAY);
        team.setDisplayName("NPC");
        team.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);
        team.setOption(Team.Option.DEATH_MESSAGE_VISIBILITY, Team.OptionStatus.NEVER);
        team.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.NEVER);
    }
eternal oxide
#

When all you get for xmas is coal, what else is there to do?

eternal oxide
glossy venture
#

its using the main scoreboard

#

idk if thats set by default on the npc

hybrid spoke
#

didnt you had to use packets for scoreboard to have a tablist AND scoreboard?

#

or am i way outdated

glossy venture
#

thats what i was trying to do but the packet doesnt have parameters

#

i need to provide it with a friendlybytebuf

#

but idfk the format

eternal oxide
#

there is usually another constructor which takes an object

glossy venture
#

holy fucking shit

glossy venture
#

r u fucking serious

#

it parses from the byte buf

#

the one taking objects is private

#

oh shit there are helper methods

#

static

torn shuttle
#

hey no profanity in my christian minecraft server

sullen marlin
#

The API does everything packets do

#

You do not need scoreboard packets

glossy venture
#

bruh it doesnt work

sullen marlin
#

Ever

glossy venture
#

for npcs you appereantly do

jagged monolith
#

It does work. I use the API for tablist and stuff

chrome beacon
eternal oxide
#

I can only assume not all your players/npc's are set to the same scoreboard

jagged monolith
#

^

glossy venture
#

oh wait hold on hm

chrome beacon
#

Don't use addPlayer 🙃

glossy venture
#

addEntity?

hybrid spoke
chrome beacon
#

addEntry with the npc name ( or uuid?)

torn shuttle
jagged monolith
hybrid spoke
chrome beacon
# glossy venture

Also setting the scoreboard for a fake player like that is pointless

sullen marlin
#

Ye npcs don’t have a gui

glossy venture
#

alright ima test now

#

i realized i was creating a new scoreboard for the gui in kitpvp

#

not using the main

#

fixed that now

#

smh

torn shuttle
#

if you make good AI it should interact with menus the same way players do

glossy venture
#

ayy lets go that works

torn shuttle
#

if it gets good enough maybe you can get the AI to donate to your minecraft server with the dayjob you programmed it to have

hybrid spoke
#

and then it searches the internet for human domination and you become the working slave on your minecraft server

torn shuttle
#

worst part is after a couple of weeks the ai leaves your server because it found a better minecraft server

#

that's when it really stings

hybrid spoke
#

imagine you make an AI to automatically farm things for you

#

and it just switches the server because it want to play something else

torn shuttle
#

2 years later it comes back, says you were a shitty father and that it began a competitor mc server and it's doing way better than your server

#

then you get really angry, you get really drunk and in a moment of anger your pull the plug on the AI which runs entirely on RAM meaning it is effectively dead

#

basically I am describing your average Wednesday

quaint mantle
#

so how can I setup nms

#

?

#

I am finally on my pc

eternal night
glossy venture
#

whats the unicode character for a continueous horizontal line

#

ive tried horizontal bar and extended line from unicode but both show up as extended dashes in the scoreboard

#

ooh underlines

remote swallow
glossy venture
#

or space

#

i saw that the - adds decoration

#

bumps

remote swallow
#

they dont go through spaces i thought

glossy venture
#

bruh

#

idk

remote swallow
#

find a 1 px dot unicode char that renders in mc

glossy venture
#

yeha

#

lemme try with space hold on

earnest forum
#

space isnt a character

#

is it?

#

i doubt it would work

glossy venture
#

its a character

#

it has a width and shit

#

just blank

#

but idk if it will register

#

for strike

#

oh yeah it works

native ruin
#

is there a way to get the similar item of an itemstack?

glossy venture
#

set amount to 1 ig

tender shard
#

Wtf is a „friendly“ byte buffer?

vocal cloud
#

It's a byte buffer that won't hurt you like other byte buffers

tender shard
#

Fair enough

echo basalt
#

serious answer: It's a bytebuffer wrapper that mojang uses because it has extra functionality

#

such as varints and reading their custom codecs iirc

tender shard
#

„Friendly“ 😂

#

So weird

glossy venture
#

why not ExtendedByteBuf or smth

vocal cloud
#

Possible they named it that way because it was more dev friendly. Or they needed to make a unique name and settled on friendly

#

Some stuff feels like it wasn't written for others to use

tender shard
#

HiggsBosonByteBugger

#

Yes, bugger

#

Totally not a typo

echo basalt
#

judging mojang for something this minimal

#

smh

vocal cloud
#

Gotta send them an email and ask

tender shard
#

Lets send them a post card

echo basalt
#

just ask pokechu22

#

on irc

#

idk

remote swallow
#

i love when my location if checks dont work when they are the exact same

echo basalt
#

decimal values

remote swallow
#

still the same

#

could be yaw ig

echo basalt
#

yaw n pitch n shit

remote swallow
#

and pitch

echo basalt
#

I have a method to get a weird hashcode of a location within a single long

glossy venture
#

yeah just compare to vector or smth yaw and pitch annoying af

worn tundra
#

Even with the world?

echo basalt
#

not sure if the world is hashed

#

don't think so

#

I just use it on my particle culler

#

because some mfs at work decided to spawn 32k particles in the same location

worn tundra
#

Make two longs then :D

remote swallow
#

okay even better, all values of the location are the same

echo basalt
#

and it was DDOS'ing the player

#

shit was using like 80mbps / player

remote swallow
#

can i get the code for that

echo basalt
#

great question

remote swallow
#

for educational purposes

echo basalt
#

you'll get the hashing method

#

rest is under NDA

remote swallow
#

i need the particle spawning

#

fuck

worn tundra
#

for int i = 0; i < 32000; i++

#

:D

remote swallow
#

ig so

#

what particle causes the most lag

echo basalt
#

they all send the same packet

#
public long hash(double x, double y, double z) {
        int xPos = (int) x;
        int yPos = (int) y;
        int zPos = (int) z;

        int xIndex = (int) ((x - xPos) * 0xF);
        int yIndex = (int) ((y - yPos) * 0xF);
        int zIndex = (int) ((z - zPos) * 0xF);

        // 22 bits for xPos, zPos
        // 8 bits for yPos
        // 4 bits for xIndex
        // 4 bits for zIndex
        // 4 bits for yIndex

        long hash = 0;

        hash |= xPos & 0x3FFFFF;
        hash |= (long) (zPos & 0x3FFFFF) << 22;
        hash |= (long) (yPos & 0xFF) << 44;
        hash |= (long) (xIndex & 0xF) << 52;
        hash |= (long) (zIndex & 0xF) << 56;
        hash |= (long) (yIndex & 0xF) << 60;

        return hash;
    }
remote swallow
#

well it looks like im comparing xyz coords then

echo basalt
#

this should have an epsilon of 1/16

glossy venture
#

oh fuck

#

that didnt work

remote swallow
#

didnt i tell you that spaces dont work

glossy venture
#

it does

remote swallow
#

dafuq

echo basalt
#

what you testin?

glossy venture
#

but as you can see

#

im level 8364

#

with 0 total xp

#

doesnt quite seem right

remote swallow
#

something doesnt math up

echo basalt
#

I'd honestly just store totalExp

#

instead of level + totalExp

#

if you change the formula you gotta reset player data n shit

glossy venture
#

true

echo basalt
#

you gotta think about these when coding

worn tundra
#

Just recalculate the level if you change the formula

echo basalt
#

I've used client-sided lore for such purposes, too

worn tundra
#

Why calculate the level every time

echo basalt
#

changing the lore in config applies instantly to allplayers

echo basalt
remote swallow
#

i might work on a crate system for one of my servers later

echo basalt
#

type deal

#

I spent like 2 hours just messing with my new gui engine last night

remote swallow
#

one that you get keys, can redeem them into a respective crate and get items or you can get the key item

echo basalt
worn tundra
remote swallow
glossy venture
#

this shouldnt be too slow right

echo basalt
#

made a role system where you can have weights, display name, permissions

#

and each role has a display item

#

that you can select on a fancy GUI

#

click on the button to type the item name in chat, or just select it from a paginated menu containing most item types

#

hella fancy

#

like 100 lines of code

glossy venture
#

so like a permission plugin

echo basalt
#

not really

glossy venture
#

or does another plugin handle the perms

echo basalt
#

it's more like discord

#

where you have roles

glossy venture
#

ooh ye ok

echo basalt
#

and user permissions separate

#

then it saves to the db n all

remote swallow
#

wait a minute

#

why are you under nda for plugin code

echo basalt
#

that's for another project

#

project-similar-to-discord is not under NDA

#

particle culling is under NDA

remote swallow
#

ah

echo basalt
#

particle culling is just one very minor patch in the NDA code

remote swallow
#

when does it expire

echo basalt
#

10 years from now

worn tundra
#

lmao

remote swallow
#

ill dm you in 10 years asking to look at it

echo basalt
#

oh okay

remote swallow
#

if i remember ofc

glossy venture
#

bruh im starting to regret essentially coding the whole server in one class

#

the whole kitpvp game part at least

remote swallow
#

where has alex gone

echo basalt
#

lol

#

then there's me, making a class for literally everything

glossy venture
#

i would do that

#

but i just wanted to code some shit for my server quickly

#

and i never thought it would get very bi

#

g

remote swallow
#

give me a line count

glossy venture
#

1.3k

#

rn

remote swallow
#

🚪

#

getout

glossy venture
#

ahha

remote swallow
#

refactor that rn

echo basalt
glossy venture
#

i sort of like it because i dont constantly have 3000 tabs open tho

glossy venture
echo basalt
#

surprisingly that's only like 100 hours of development

glossy venture
#

thats a lib tho right

#

or nto

echo basalt
#

nope

glossy venture
#

hoh

echo basalt
#

just a project I've been working on

#

the lib is only the last like 20%

remote swallow
#

how are you coding like that

glossy venture
#

idk

remote swallow
#

its so big, you 2 major ij versions out of date

echo basalt
#

tbh I only updated ij after like 4 years

remote swallow
#

atleast your using gradle

echo basalt
#

I was rockin ij2017 until 2021

remote swallow
#

how

echo basalt
#

I just didn't bother updating

#

I liked the old ij

glossy venture
#

how do i show bookmarks on the sideba

remote swallow
#

faur

echo basalt
#

I think the longest class I have is maybe my color matcher

#

that I use for imageboards

#

just because I had to type every map color manually

#

this was not fun

remote swallow
echo basalt
#

but hey it brought like a 100x performance improvement over the traditional bukkit method

#

so I'm not complaining

remote swallow
#

is it on github

echo basalt
#

took an 80ms rendering process into 0.1ms

remote swallow
#

might need it at somepoint

echo basalt
#

no it's not on github ❤️

#

you might need literally anything I ever write at some point

remote swallow
#

thats why you should os your entire computer

echo basalt
#

ah yes, OS the stash

twin venture
#

Hello , i have a question why its not saving a location to my json file ? what can cause this? i know i asked this in the past , but i didn't find a fix for it ..

lone jacinth
#

Bukkit only needs around 0.091 ms to render a full map since around 1.19

echo basalt
#

and I'm drawing my own images, not rendering a vanilla map

#

there's not setImage, you must setPixel individual pixels

#

I did tests

formal bear
#

I made setCancelled(true) but if i swap item to left hand it dupes

echo basalt
#

some images took 80ms, others were quicker around 20-30

#

my new system is consistently under 100mu

formal bear
echo basalt
#

takes longer to draw the actual image than to split it into itemframes

#

and I'm satisfied enough with that

#

I also made raytracing code that gives me the pixel the player is looking at in about 10-15mu

#

1000 mu = 1ms btw

#

I might need to account for some lens distortion

#

as harsh diagonals seem to be 1-2 pixels off

remote swallow
echo basalt
#

due to some predictions I make

wet breach
#

Basically just need to check the angle if its past a certain point and slightly correct for such things

echo basalt
#

or just correct based on the angle instead of checking for angle ranges

#

red is what's happening, blue is with extra correction

wet breach
#

You could do that too

onyx fjord
#

I suck at math

#

And physics

#

Lol

twin venture
#

no errors tho

remote swallow
#

?paste the type adapter and class

undone axleBOT
twin venture
echo basalt
#

honestly it doesn't matter much, I was planning on doing it regardless

twin venture
#

i removed it , cause it was'nt working

#

i mean the type adapter not the project xd

wet breach
#

If you dont need the location human readable just base64 the location.

remote swallow
echo basalt
#

pretty sure the problem was that the actual thickness of the map in the item frame was like

#

paper-thin

twin venture
echo basalt
#

so I just made a big tolerance

#

the corrections would just base themselves on the border tolerance,

#

basically adjust X and Y so that the Z tolerance is 0

#

or within a thickness of like 0.1

#

this probably makes 0 sense to y'all

remote swallow
#

for the json instance use Gson gson = new GsonBuilder().setPrettyPrinting().registerTypeAdapter(Location.class, new LocationTypeAdapter()).create(); and for the class https://paste.md-5.net/yajafiwazo.java

twin venture
#

it spawn the lootbox preview , but when i restart it dosen't save it in the json file

#

that's my only problem with the entire lootbox system xd

#

i already wasted 3 weeks didn't try to fix it

twin venture
remote swallow
#

just add that

wet breach
#

Personally i just always base64 the location lol

twin venture
#

or it auto use it?

#

i don't need to do anything?

echo basalt
#

base64'ing locations isn't always ideal

#

sometimes you gotta debug stuff

remote swallow
twin venture
remote swallow
#

create a class called LocationTypeAdapter then

twin venture
#

i did , i added the class you send

echo basalt
#

btw you can dynamically register type adapters like this?

twin venture
#

this right?
i just ask where i can use the read & write methods?

#

or i don't need to do anything

#

just register it?

remote swallow
#

it does it auto from what i remember

#

you just need to register it

twin venture
#

ok time for testing i hope

echo basalt
#

bruh you can parse json objects like that?

remote swallow
#

ive got no idea

#

i just stole it from fourteens code and havent had a chance to use it

echo basalt
#

cries in japanese

formal bear
#

how to cancel swapping item from custom inventory

echo basalt
twin venture
#

oh my god that did the trick!

remote swallow
twin venture