#help-development

1 messages ยท Page 854 of 1

wet breach
#

however you can fix this with a resource pack

eternal night
#

?services

undone axleBOT
gleaming token
#

k

terse ore
#

I was thinking instead of setting night and day every x ticks

#

delaying by x ticks every y ticks the cycle

#

so I get a smooth cycle

wet breach
#

hmmm

#

accordingly if you set the boolean to false

#

presumably it would be up to you to make the time progress

#

so it seems doable with what you want

#

however, downside of this method, is that it desynchs with server time. In other words you could have a situation where the player is still seeing day

#

but the server time is night

#

and thus they see mobs etc spawning that normally spawn at night, but they see day lol

terse ore
#

I dont matter that

#

it is for a minigame

wet breach
#

ah ok, then that method should work for you then ๐Ÿ˜„

terse ore
#

so mob spawns are disabled etc

shadow night
#

what was the way to make an entity with a lambda or whatever?

quaint mantle
#

would anyone happen to know if there's an actual way to have a tablist like this one? I am looking into implementing a tablist with 2 columns displaying players of (2) different teams in each of them

#

That prob modded server

eternal night
#

cat_what it isn't xD

#

resourcepack magic works

quaint mantle
#

If its rps

#

Bros gonna have heart attack

shadow night
#

Damn

#

That hurts

inner mulch
inner mulch
kindred sentinel
#

So... I can't understand how to download CoreProtect API... At the docs it just said "if using Maven, you can add it via the repository https://maven.playpro.com" but i don't know how...

#

maybe it's a bit stupid question but.. yeah

inner mulch
#

There are no stupid quesrions

#

So you are using maven

kindred sentinel
#

yeah

inner mulch
#

Can you send me the plugin?

#

So i csn copy paste the studf you need

kindred sentinel
#

and i want to add coreprotect

inner mulch
#

No no, i mean the plugin you want to add

kindred sentinel
#

ohh

inner mulch
#

The link

kindred sentinel
inner mulch
#

Um i might be blind but i havent found the import studf yet

#

<dependency>
<groupId>net.coreprotect</groupId>
<artifactId>coreprotect</artifactId>
<version>22.2</version>
<scope>provided</scope>
</dependency>

#

Okay so @kindred sentinel open you pom.xml

inner mulch
#

You know how to add that

kindred sentinel
#

yeah

inner mulch
#

If not i can help

#

Ok

kindred sentinel
#

to repository to repositories, dependency to dependencies

inner mulch
#

Yes

kindred sentinel
#

So but where did you find it?

inner mulch
#

Github

tender shard
kindred sentinel
old cloud
#

Is it possible to use Block#breakNaturally and get a reference to the dropped item(s) from it?

echo basalt
#

BlockDropItemEvent?

#

Doubt the api fires it though

tender shard
tender shard
glossy venture
#

whats the best way to remap a 1.8 gradle plugin from spigot mappings

old cloud
tender shard
#

why not? you'd know that as soon as the items get spawned

old cloud
#

What if another item spawns there but is not a drop

#

like at the same time almost

tender shard
#

just keep track of the block you broke

tidal cipher
#
im"
org.bukkit.command.CommandException: Cannot execute command 'veldoryaclaim' in p
lugin VeldoryaClaim v1.1.1 - plugin is disabled.
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37) ~[pat
ched_1.16.5.jar:git-Paper-794]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:15
9) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchCommand(CraftServ
er.java:826) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchServerCommand(Cra
ftServer.java:788) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.DedicatedServer.handleCommandQueue(Dedi
catedServer.java:470) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:
437) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:
1347) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:
1135) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftSer
ver.java:291) ~[patched_1.16.5.jar:git-Paper-794]
        at java.lang.Thread.run(Thread.java:831) [?:?]```
#

I am using a plugin and I get this error.

old cloud
tender shard
#

no, you gotta keep track of that yourself

#

for example like this

    private boolean iJustBrokeABlock = false;

    public void breakNaturally(Block block) {
        iJustBrokeABlock = true;
        block.breakNaturally();
        iJustBrokeABlock = false;
    }

    @EventHandler
    public void onBlockDropItem(ItemSpawnEvent event) {
        if(!iJustBrokeABlock) return;
        // Do stuff
    }
old cloud
#

Isn't the whole method being executed on one tick? Then the bool would be set back to false before the items even spawned

#

Oh wait the method triggers the event right

tender shard
#

no, breakNaturally() will call the event, the plugin manager calls all registered event handlers, and then it's set back to false again right after that

old cloud
#

Yeah true, then this should work. Thankyou ๐Ÿ‘

tender shard
#

np

kindred sentinel
#

how to make item frames to not blow?

#

like... EntityExplodeEvent.blockList() hasn't item frames in

tender shard
#

maybe HangingBreakByEntityEvent

#

otherwise EntityDamageEvent

kindred sentinel
# tender shard otherwise EntityDamageEvent

ItemFrames don't work with EntityDamageEvent and in the HangingBreakByEntityEvent.getRemover().getType() returning PLAYER even if it was broken by tnt, so I need to know if the item frame was broken by explosion and if it was broken by player

#

Oh

#

i found

naive bolt
kindred sentinel
#

Cause EXPLOSION

naive bolt
#

Why does this happen

#

Is it a plugin chat issue

kindred sentinel
#

So... I found a error but can't understand why

river oracle
#

your java version is too high

shadow night
#

Java version doing funny things

#

Isn't java supposed to have backwards compat

kindred sentinel
river oracle
#

depends on the system

#

idk how windows work so I can't help you there

shadow night
#

"java path" -args

river oracle
#

on linux you just go into your .bashrc and change the JAVA_HOME path

#

or you can just invoke the bin file directly

shadow night
shadow night
river oracle
kindred sentinel
remote swallow
#

java.version meansnothing

remote swallow
#

unless you use it anywhere that variable does nothin

river oracle
remote swallow
#

set the maven compiler plugin source and target

#
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>```
remote swallow
#

yup

kindred sentinel
#

like this?

hushed spindle
#

im getting a net.minecraft.server.CancelledPacketHandleException which apparently occurs when the player received a specific packet asynchronously, and im getting this error semi-consistently with custom GUI related things. issue is I don't know where this is coming from, the error doesn't list any of my code and as far as I know im not doing async stuff to the menus in question, has anyone experienced something like that before?

remote swallow
hushed spindle
#

?paste

undone axleBOT
hushed spindle
kindred sentinel
remote swallow
#

how are you compiling

kindred sentinel
remote swallow
#

run a clean package

kindred sentinel
#

Where?

#

oh

#

sorry

remote swallow
#

just run the clean task then package after

kindred sentinel
old cloud
#

How if they just spawned?

kindred sentinel
#

Oh

#

wait..

#

I have profile

#

I forgot about it

old cloud
#

No, unfortunately not

#

The event approach is good i think

modest vault
#

Sorry, this is the second time I've asked, but for some reason I can't edit my own resources or upload new files

kindred sentinel
#

So.. I tried the version from target and it still returns this error

undone axleBOT
kindred sentinel
modest vault
#

no...

modest vault
kindred sentinel
#

I did everything

tender shard
#

you have set it to use java 17

#

no wait

tender shard
#

pom is correct. are you even using the correct jar?

kindred sentinel
#

And now I still have this problem

kindred sentinel
tender shard
#

did you enable the "export to test server" profile?

kindred sentinel
tender shard
#

ok good because it has an invalid path

kindred sentinel
tender shard
#

you have set thje java version to 21 in maven-compiler-plugin

tender shard
#

anyway yo uhave set 3 different java verisons in your pom, clean it up

kindred sentinel
tender shard
#

first you set java.version to 8

kindred sentinel
#

._.

tender shard
#

then you set it through properties to 17

#

and then you set it again to 21 in the compiler plugin

#

and on top of that, you even additionally enabled preview features

#

so which java version do you really wanna use? 17, 8, or 21?

kindred sentinel
#

17...

tender shard
#

then set java.version in properties to 17, remove the 2 other properties that are currently set to 17, remove the compilerArgs in maven-compiler-plugin, and set both target and source in the compiler plugin to ${java.version}

kindred sentinel
tender shard
#

remove the compilerArgs

#

and as mentioned I'd use a property to set it to 17 so yo udon't have to change it twice, but sure you can also do it like this ^

kindred sentinel
#

So what should I leave there?

tender shard
#

nothing

kindred sentinel
#

Just leave 1.8?

tender shard
#

no

kindred sentinel
#

Maybe I can just delete this?

tender shard
#

yes, that's what I told you twice already lol

kindred sentinel
tender shard
kindred sentinel
#

My brain is not braining

tender shard
#

after that run mvn clean package

kindred sentinel
# tender shard after that run `mvn clean package`

So I changed the version of java to the 21 and there is no error now, but I still need to make it usable for java 18, (It still returning error in java 18) How can I check if the version was really changed?

tender shard
#

why the hell did you change it to 21 now

tender shard
#

ofc it won't run on java 18 (which is end of life btw) if you're compiling it for 21

kindred sentinel
dry hazel
#

compile it for j18 or lower?

tender shard
#

by setting the java version in your compiler-plugin to 18 or lower

#

i really have no idea why you're mixing java versions all the time

#

first you wanted to compile for 17, but set it to 21, 8 and 17, then you again said you wanted to use java 17, and sent a screenshot of the correct settings for 17, I even sent you the whole pom, and then you changed it again to 21 and wondering why it won't work on java 18 (why 18 now?)

#

so now you've been mentioning java 8, 17, 18, and 21

#

just use the pom I sent you

#

and set it to 17

#

java 18 makes no sense, it's end of life

#

whatever you set as java version in the maven-compiler-plugin is the minimum required version needed to run it

kindred sentinel
# tender shard first you wanted to compile for 17, but set it to 21, 8 and 17, then you again s...

So, I had java 21 on my computer, and java 18 on the host, I started creating a plugin using Intelij Idea (minecraft plugin) (Initially for java version - 8), then I started working with the library and code from the documentation, but Intelij Idea gave out error that a higher version of java is needed, using this error notification I changed the version to 21. Then I tested and saw the error that I posted above, after which I tested on a local server (With JDK 21) and it was without an error, I asked about the error in this discord server, and I was told to install version 17, and since I constantly had problems changing the java version, I asked how to do this and was told to write "<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>" I wrote and then sent my pom.xml

tender shard
#

no need to install java 17

tender shard
kindred sentinel
#

So ok

#

THANKS

#

IT WORKS

#

FINALLY

tender shard
#

Np

#

Just remember that it will only run on java 17 or newer

kindred sentinel
#

Yeah I know... I always had problems with changing java version.. Sorry

#

I didn't understand pom.xml so it was difficult to download dependencies and change java version, then I found out how to add dependencies, and know I found out how to change java version. Thank you so much

proper cosmos
#

Hello, can this code cause any performance problems? I'm trying to check if pressure plate have been left by player to remove him from list. And I think that's the only way to do it

@EventHandler
    public void onPlayerMove(PlayerMoveEvent event){
        if(!this.MAIN.playerList.contains(event.getPlayer())) return;

        if(!(Objects.equals(MAIN.getConfig().getLocation("firstPlate"), event.getPlayer().getLocation().getBlock().getLocation()) || Objects.equals(MAIN.getConfig().getLocation("secondPlate"), event.getPlayer().getLocation().getBlock().getLocation()))){
            this.MAIN.playerList.remove(event.getPlayer());
        }
    }```
quaint mantle
#

bruh

orchid trout
#

name your class that extends javaplugin NamePlugin

#

not main

quaint mantle
#

idk honestly

#

but yeah

proper cosmos
quaint mantle
#

Do that

proper cosmos
#

it's varaible in my lsitener class

quaint mantle
#

ok well

orchid trout
#

dont name it that then

proper cosmos
quaint mantle
#

is it a static constant

proper cosmos
#
private Duels MAIN;

    public PlayerListener(Duels duels){
        this.MAIN = duels;
    }```
#

that's how it works

quaint mantle
proper cosmos
quaint mantle
#

don't name it main

#

name it something like duelsPlugin

#

and make it final

proper cosmos
#

ye but why

quaint mantle
#

conventions

worthy yarrow
#

Main is very vague

quaint mantle
#

And usually

#

variable names with all caps are static constants

#

Like

Math.PI

proper cosmos
#

okey

#

thanks for pointing this out

quaint mantle
#

Block blockAtPlayer =...

orchid trout
#

yeah i dont understand what hes trying to do

quaint mantle
#

Or wait is that location

#

Location blockLocAtPlayer smthing like that idk

proper cosmos
quaint mantle
#

you're calling it twice

#

Repeating yourself

orchid trout
#

if you do it more than once then make it a variable

proper cosmos
#

does it really change anything or just convetion?

inner mulch
#

Is there something like stack in java except you take the last out instead of the first one?

orchid trout
quaint mantle
#

Well

#

It clones

#

A new location

#

Or makes a new one

proper cosmos
#

and as i said im just curious if it can cause any performance problems at all

inner mulch
quaint mantle
#

How large is your playerList?

proper cosmos
proper cosmos
#

after there is 2 players, list empties

#

and just fires void and empties list

inner mulch
#

I hope so

proper cosmos
#

at least no one pointed it in about 50 forums posts

inner mulch
#

It depends on how important it is to know when a player leaves the plate

#

If you need to know instantly thid might not be the way

tender shard
#

Just check the material of the block below the player each tick or on each move

#

Chunk is loaded anyway

inner mulch
#

u sure this wouldnt get expensive?

tender shard
#

If you only check the material, thats no issue at all

#

Just think about what vanilla checks for each entity on every single tick

inner mulch
hazy parrot
#

Config is loaded into memory regardlessly

lean pumice
#

how i can pakage the plugin with an library?

#

i have create directory "lib" and click add as library

tender shard
torn shuttle
#

Me, debugging a web page: huh, why is my page showing up blank when I load contents from another page?

Oh yeah, I forgot to write anything on the page getting loaded

#

I am a good web dev

opaque scarab
#

Iโ€™m trying to get the grass color override of level.biome, but biome.getSpecialEffects().getGrassColorOverride().isPresent() returns false in the biome Iโ€™ve tried, which is minecraft:forest

torn shuttle
#

I will make you website for only $50,000

lean pumice
opaque scarab
#

Does anyone know how to get the color?

tender shard
# lean pumice marven

People just getting started with maven always ask me the same 3 questions, so hereโ€™s a a short FAQ! How to change the output directory? Read this. How to shade dependencies and what it means Sometimes you are using certain libraries (for example, my CustomBlockData class, or similar stuff) that is not already present at...

lean pumice
#

ok

quaint mantle
#

someone knows why? I can send pom screenshot

inner mulch
lean pumice
#

@tender shard is arealy shade:

<build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <configuration>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <relocations>
                                <relocation>
                                    <pattern>com.zaxxer.hikari</pattern>
                                    <shadedPattern>pk.ajneb97.libs.hikaricp</shadedPattern>
                                    <includes>
                                        <include>com.zaxxer.hikari.**</include>
                                    </includes>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

sullen marlin
opaque scarab
#

I also tried biome.getGrassColor(0,0) but that returns black

tender shard
quaint mantle
tender shard
sullen marlin
#

no, just once so NMS is in your local repo

quaint mantle
#

I have alredy installed BuildTools

tender shard
tender shard
sullen marlin
#

oh

quaint mantle
#

pain wirkflows

sullen marlin
#

just dont use nms

#

ez pz

lean pumice
tender shard
uncut needle
#

this is in a PlayerJoinEvent and I dont get set the gamemode. I tried two functions. They dont work. I get the message.

#

How to change players gamemode

quaint mantle
uncut needle
#

Why hashtag

uncut needle
tender shard
#

Javadoc notation

ashen quest
# uncut needle Why hashtag

Are u new to Java? If yes

# denote a method or a function in the class so

Car#drive is to say drive is a function/method in the class Car

This is part of the javadoc notation

hazy parrot
# inner mulch It is?

Of course it is lol. Would be stupid for it to be IO for every message you get from config. (also reason you must reload config when changing file)

uncut needle
#

player.setGameMode(GameMode.SPECTATOR);

tender shard
uncut needle
#

Why else it wouldnt work

quaint mantle
uncut needle
#

do events run before the event happen

#

I forgot

quaint mantle
#

If I want to make compatible the pl from 1.13 to latest what version I should use?

inner mulch
#

i guess 1.13?

uncut needle
inner mulch
tender shard
grim hound
#

Thus why you can cancel them

sullen marlin
kindred sentinel
#

Is it good idea to save data in 70000+ blocks using CustomBlockData?

tender shard
#

in one chunk? no

kindred sentinel
#

Where does data of CustomBlockData is saving?

tender shard
#

in the chunk's PDC

kindred sentinel
tender shard
#

so just a boolean - then it shouldn't be an issue

kindred sentinel
#

I just want blocks that were placed by players not to blow by tnt/creepers

tender shard
#

yeah that shouldn't be an issue

kindred sentinel
#

Oh ok

river oracle
#

you might beable to even do cheat optimizations and if a bunch of player placed blocks are next to eachother condense them into regions

quaint mantle
#

How can I execute a java command with a especific JDK version?

kindred sentinel
hazy parrot
quaint mantle
tender shard
#

โ€ฆ\bin\java.exe

quaint mantle
#

I have it yeah

#

now I need to get the Jar path xd

quaint mantle
hazy parrot
#

What

quaint mantle
hazy parrot
#

Pretty sure Users is under C drive

eternal oxide
#

add a . to the beginning of that path

quaint mantle
eternal oxide
#

.\Users etc

#

. is root .. is up one directory

quaint mantle
#

Error

eternal oxide
#

then just put a C: instead of a .

quaint mantle
eternal oxide
#

ah yeah, you have to run teh whole command where buildtools is

#

mine is %cmd% -jar BuildTools.jar

#

the %cmd% is my path to java

#

bin

young knoll
eternal oxide
#

buildtools is expecting you to be in teh same directory

quaint mantle
#

thanks coll and ElgarL

glossy venture
#

love how u need nms to get an entities bounding box

#

in 1.8

#

btw

eternal oxide
sterile token
#

Please i need some explaantion for this debugs im struggling for hours, i cant understand why the heck is giving the data debug data like if am i executing the /faction points commad. When im executing a child of points, called info

#

Adjust capture of the debug

glossy venture
#

does anyone know of an algorithm/formula for the largest possible step size on a raycast to cover all blocks

eternal oxide
#

2

#

actually 1 as 2 could miss a block if you are near a corner

glossy venture
#

basically this but for any direction vector

#

and in 3d

eternal oxide
#

1 not 1 meter

glossy venture
#

a block is a meter

#

in mc

eternal oxide
#

if your direction is across a corner a step size of 2 would miss the block at the corner

#

yes but your raytrace is not

glossy venture
#

? wdym

#

1 in a vector component is 1 block length = 1 meter right

eternal oxide
#

if you are ALWAYS facing a direction like 90, 180 then yes you can step size of 1 meter

glossy venture
#

yeah ik im trying to derive it for any direction vector tho

eternal oxide
#

0.1 then

glossy venture
#

that would be a waste on an axis aligned raycast tho

eternal oxide
#

to calculate the minumum step size based on vector would be a nightmare in math

#

yes it would

glossy venture
#

it really doesnt matter probably but i like optimizing

#

ill just do the more a component differs from 1 or -1 the smaller the step size

#

wait cant i js use the direction vector then

eternal oxide
#

why not simply use a BlockIterator? ?

glossy venture
#

i want to raycast for entities

#

with block intersection

#

?paste

undone axleBOT
glossy venture
#

i wrote this vague outline of my algorithm

young knoll
#

Isnโ€™t that what the normal raytrace method does

#

Itโ€™ll return either the first mob or first block it hits

lunar wigeon
#

watch some tutorials

glossy venture
clear condor
#

Hello

young knoll
#

F

eternal oxide
glossy venture
#

im doing it

#

rn

remote swallow
glossy venture
#

thats why im asking for the algorithm i know how a raycast might work but i thought maybe someone better at math has an indea

lunar wigeon
clear condor
lunar wigeon
#

my IDE is a paper

young knoll
#

The algorithm is in NMS somewhere

glossy venture
#

?mappings

undone axleBOT
quaint mantle
#

Preconditions in constructor or static factory method?

#

which is better

quiet ice
#

what exactly to do you envision here?

#

I don't fully understand why one would do preconditions in a static factory method. But if the constructor is hidden and the only way to create an instance is via the factory - you might go with the factory. For as long as the preconditions are the same for everyone

glossy venture
#

im sure this is not going to break!

lost matrix
glossy venture
#

ik i mean more with remapping

#

or is that not needed

#

on 1.8

quiet ice
#

uh, I think not

#

mojmap wasn't a thing yet

glossy venture
#

ik

lost matrix
#

There are no public mappings from mojang before 1.17

quiet ice
#

I thought 1.14 had mappings?

remote swallow
#

they exist

#

but spigot didnt support til 1.17

glossy venture
#

wait ig not bc if im using a buildtools jar in gradle and to run the server they should both have the same mappings

quiet ice
lost matrix
quiet ice
#

They retroactively published a few ones

#

Spigot took a bit till they supported them - like many other projects out there

lost matrix
#

Hm ok i see them back to 1.14.4 actually

quiet ice
#

Turns out people didn't quite trust the license of the mappings back then

young knoll
#

Yeah the license change was in 1.17

glossy venture
#

wait this is how u get a direction vector right

#

or not

quiet ice
#

looks good enough, as long as end and origin live in the same coordinate space

glossy venture
#

yeah

#

also is paste.md_5 down

#

it gave me an error

remote swallow
#

works for me

lost matrix
#

Depends on what you are trying to do

#

Hm, i dont think this is a black and white problem.
Both are viable. Reading BlockData is quite fast for loaded chunks.
But my first intuition for working with entire chunks would be through a snapshot.
@blissful crow

wanton bough
#

hello there i was wondering how can i access an item/entity NBT using spigot?(i am new to spigot and bukkit so i am not 100% full)

lost matrix
wanton bough
#

there is nothing like it

#

also i will be using kotlin

lost matrix
wanton bough
#

only item stack?

wanton bough
lost matrix
wanton bough
#

so can you give me an example code?(kotlin or java)

lost matrix
wanton bough
lost matrix
wanton bough
lost matrix
wanton bough
wanton bough
#

is there anyway to access there NBT directly?

lost matrix
wanton bough
#

so can i access NBT data directly?

lost matrix
#

Entities are PersistentDataHolders themselves. But this is useless for his case.

young knoll
#

Resource packs canโ€™t modify entities

#

Unless you use optifine

wanton bough
wanton bough
#

you know what i am a bit confused i think i am missing something about resource packs sorry to bother let me research a bit more will look to this a bit more
this SetModel thing seems like the answer but i am not sure

lost matrix
#

You can overwrite the model of an iron ingot, with the model of the vanilla gold ingot using this:

{
 "parent": "item/generated",
 "textures": {
 "layer0": "item/iron_ingot"
 },
 
 "overrides": [
   {"predicate": {"custom_model_data":5}, "model": "item/gold_ingot"}
 ]
}

And creating an Iron Ingot which has the custom_model_data set to 5.
This can be dont through spigot by the method explained above

wanton bough
#

what about blocks?

#

is it the same>

lost matrix
#

Blocks and Entities cant have multiple models as of 1.20
You could only completely replace them with a resourcepack.
There are some tricks to replace blocks and entities, but they are pretty dirty.

lost matrix
#

I mean that those tricks result in unclean experiences for the user, require a lot of work and drain CPU resources of your server.
Blocks are really bad. Entities can be ok, but you need a lot of very complicated code to kind of hack them together.
And they are not really entities in the end.

next stratus
#

Oh cool 7smile you got helper good job!

young knoll
#

That was like

#

A long time ago

#

:p

next stratus
#

I barely come here, aha!

misty ravine
#

can someone tell me how can i make the tnt not damage and not push the player on explosion?

#

mostly the push part

quaint mantle
#

Is it safe to use Block as a hashmap key

sullen marlin
#

?jd-s

undone axleBOT
quaint mantle
#

oh yeah abt that im on 1.8.8 lol

quiet ice
#

So go search up a 188 javadoc

quaint mantle
#

well

#

i saw this

#

This is a live object, and only one Block may exist for any given location in a world

#

does that mean its ok?

quiet ice
#

If it implements hashcode, sure

#

From my memory it does implement equals though so I think that is safe though (given that equals often implies hashcode)

quaint mantle
#

Ok

#

thanks

#

im just keeping track of what blocks are player placed

#

idk if smthing like Location would be better or

young knoll
#

Probably

ivory sleet
#

sadge we dont have identity and value based class semantics yet

river fable
#

can someone give me a hand? This is just a simple command, when run, it should change "is-mod.value" in the (playerUUID).yml file to "TRUE"

instead it does nothing

what am i doing wrong?

package com.dioz.plugin;

import java.io.File;
import java.io.IOException;

import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;

public class setmod implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        Player p = (Player) sender;
        File playerData = new File(Bukkit.getServer().getPluginManager().getPlugin("Utils").getDataFolder(), File.separator + "PlayerDB");
        File f = new File(playerData, File.separator + p.getUniqueId().toString() + ".yml");
        FileConfiguration pData = YamlConfiguration.loadConfiguration(f);
        
        if(args.length == 0) {
            p.sendMessage("ยงcPlease specify a player.");
        } else if (args.length == 1) {
            Player target = Bukkit.getPlayer(args[0]);
            if (target != null ) {
                File a = new File(playerData, File.separator + target.getUniqueId().toString() + ".yml");
                FileConfiguration targetData = YamlConfiguration.loadConfiguration(a);
                if(targetData.getString("is-admin.value").equals("TRUE")) {
                    targetData.set("is-admin.value", "FALSE");
            }
                if(targetData.getString("is-mod.value").equals("TRUE")) {
                    p.sendMessage("ยงcThat user already has MOD privileges.");
                } else {
                    targetData.set("is-mod.value", "TRUE");
                    p.sendMessage("ยง6Successfully granted ยงa" + target.getName() + "ยงc MOD privileges.");
                    try {
                        pData.save(a);
                        
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
        } else {
            p.sendMessage("ยงcPlayer must be online to grant MOD privileges.");
        }
        } else {
            p.sendMessage("ยง6Incorrect syntax.");
            p.sendMessage("ยงcUsage: /setmod <player name>");
        }
        
        return true;
    }
}
worldly ingot
#

It will be unique for that position in the world. A block can be equals() to another but not necessarily ==, just something to keep in mind

river fable
#

nvm, i fixed it

#
pData.save(a);

this was the issue

wraith dragon
#

I see, so listening to blockbreakevent and doing stuff from there

#

hmm but what about if

#

ok so

#

for example if you put tnt inside of a netherrack box

#

it will probably destroy everything

#

but if you put it inside deepslate

#

it doesnt break everything

#

can I replicate that? Or should I jsut use reflection or nms

young knoll
#

Uhh

#

You could get real hacky and actually change the blast resistance internally

#

Not the best idea tho

quaint mantle
#
public final class BlockTracker implements Listener { 
  
     private final Set<Block> playerPlacedBlocks = new HashSet<>(); 
  
     public BlockTracker() { 
     } 
  
     public void addBlock(Block block) { 
         this.playerPlacedBlocks.add(block); 
     } 
  
     public void removeBlock(Block block) { 
         this.playerPlacedBlocks.remove(block); 
     } 
  
     @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) 
     public void onBlockPlace(BlockPlaceEvent event) { 
         this.playerPlacedBlocks.add(event.getBlockPlaced()); 
     } 
  
     @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) 
     public void onBlockBreak(BlockBreakEvent event) { 
         this.playerPlacedBlocks.remove(event.getBlock()); 
     } 
  
 }```
#

would it be OK for this class to register itself

#

Like I pass in Plugin via constructor

wraith dragon
#

hmm

#

honestly ill just do a tracker of the blocks and probs listen through event

wraith dragon
#

do I have to make my own type of resistance system

#

and somehow disperse the explosion to the other blocks

young knoll
#

Probably

wraith dragon
#

hmm

young knoll
#

You could in theory recreate the entire explosion system

#

Might take a while though

quaint mantle
#

The listener or self register

#

or both

ivory sleet
#

coupling registration to the instantiation of the class

#

just register it in onEnable

quaint mantle
#

Should I feel wrong about making it a listener without mentioning the class is a listener in the name

ivory sleet
#

A little bit

#

In general having a listener that also defines state implementation can be tricky

#

and by tricky i mean messy

echo basalt
#

using fileconfigs as a map

#

ow

quaint mantle
#

Messy

#

I thought about having a BlockListener and inject the BlockTracker into it

ivory sleet
#

Sounds good

#

Listeners, CommandExecutors are usually at the bottom of the food chain

#

No classes depend on them in your infrastructure

#

But they depend on higher ordered classes in terms of hierarchical abstraction

sterile token
#

Please people, im too much struggling for some fucking reason when i execute /faction points info command. When getting the argument field data in my case must be taken from info argument. But its giving me his parent data (name, permissions, etc) which is wrong

sterile token
#

I can send it for sure

#

im totally sure its something related to recusivity thats making me struggle

sterile token
#

All the issue started because i was a getting no permission message when executing a child from a parent with the chid permission

#

So starting to debug i realized the data from argument field was containing the parent's data, instead of the argument itself

sterile token
glad prawn
#

Can your permission be null?

sterile token
sullen sierra
#

How can I apply {Marker:1} nbt tag to armorstands that I'm spawning in

sterile token
#

if i use a constructor with no permission i pass them as an empty string (" ")

sterile token
tender shard
sterile token
#

So i dont think its an issue with permissions, its something related to how the argument are parsed or something similar. Because when i run faction points info, where info is the argument. I get the data from his father (points in my case)
@glad prawn sorry for tagging

sullen sierra
#

Worked perfectly, thanks

inner mulch
#

Hey, how can i get all registered commands that there are on the server. (Like luckperms getting all the permission nodes from every plugin)

tender shard
#

Idk if the CommandMap has a public getter

#

If not: its a field in SimplePluginManager

sterile token
tender shard
#

Tree structure?

sterile token
#

If you have worked before, how you treat them if you would have to code to simple classes to managing them

sterile token
tender shard
#

I just use ACF and let that handle it

sterile token
#

oh right, thanks tho

#

Just asked because im struggling haha trying to fix something

inner mulch
sterile token
#

if you using legacy versions CommandMap is getted from reflections from server class to be more precise

inner mulch
#

Ok

wraith dragon
wet breach
wraith dragon
#

the hacky way changes all the blocks of that type iirc so thats not what I need

wet breach
#

The hacky way changes their blast resistance in the nbt data and then you let the server do the rest. To make this work you would need to check all the blocks for your type when chunk loads and change accordingly before anything happens. Or just make use of the api lol. I would stick with api because you dont have to worry about nms and end result is the same

wraith dragon
#

ye

#

also

wraith dragon
#

it doesnt really disperse the damage properly

#

like all affected blocks will get

#

subtracted with the damage

#

equally

#

idk how to go around that tbh

wet breach
#

If you want a dynamic dispersal you can just measure using distance and decide how you want the damage to fall off. You could do is something like for every 2 blocks distance damage is reduced by a third or 0.33

wraith dragon
#

is the affected blocks in order tho?

wet breach
#

But i am pretty sure server already does this though.

wraith dragon
wet breach
wraith dragon
#

like

#

uh

#

the first blocks that got affected

#

and the last blocks

wet breach
#

Maybe, dont think order is guaranteed

#

But you can always check distance

#

The explosion events give you the location of the block or entity that exploded. The affected blocks list you can just check their location. There is a method in location for getting distance to another location

#

Anyways, i can talk further when i get home in 4 hours. Currently at work

young knoll
#

Itโ€™s only the blocks that will be destroyed though

#

Say you want to make obsidian much less blast resistant, the blocks behind the obsidian wonโ€™t be in the list

#

Since by default the obsidian stops the blast rays

#

So youโ€™d have to manually recalculate the blocks to explode with the modified blast resistance of the obsidian

wary tinsel
#

on scoreboard, how i can put a empty line?

#

Score emptyLine1 = objective.getScore(" ");
Score emptyLine2 = objective.getScore(" ");
Score emptyLine3 = objective.getScore(" ");

i try this, but doesn't work

wraith dragon
inner mulch
#

You need to set a score as well

next zinc
#

How does #hasPermission() check for the permissions? For example if I gave a player a random permission via luck perms would #hasPermission(random permission) pick that up?

orchid trout
#

pretty sure plugins like luckperms change Player#hasPermission() to check if a player has a luckperms node

next zinc
#

so probably best to use their api to check then?

orchid trout
#

just use has permission

next zinc
#

alr ty

quaint mantle
sterile token
tender shard
sterile token
#

I have the next command tree structure for some strange and weird reason the debug is giving wrong outputs. I dont know the reason of them please i really need help. Ive been with this for 2 days for being exactly and i cant even understand the reason fo it. None of which i talked knows whats actually happening please just try giving a hand instead of ignoring me

Command structure:

  • faction (hcf.faction.*)

When debugging the commands for some fucking reason im getting as debug output the object data from points command, which is the parent of the child node im executing as debug - So what i mean is that the debug info must be the one from points child command (named as info)

I wont stop until i find a clarify explanation of what causing this issue i know it must be something really simple to fix but i dont know the reason of it. And less when using recursivity which can bug everything pretty fast

#

I can tell you really sure thats not an issue related to the usage of the api, meaning that its not an issue realted to a wrong typing of the permissions into the permissions plugin nor wrong permissions name. I already make sure everything is okay so no other way thats the issue is in the command api itself im creating

I will now adjust captures of the debugs i have done with the different outputs

sterile token
#

lmao this is trolling too much i still with this fucking shit and cant udnerstand the reason, please dont ignore me ๐Ÿ’€

pseudo hazel
#

is points supposed to be a command from faction?

sterile token
pseudo hazel
#

okay so I guess you just named them wrong in your command structure above

#

shouldnt it be hcf.faction.points

sterile token
#

the whole issue is that when debugging i get the output like:

name=points, permission=hcf.faction.points

#

When im executing any child of points

#

Have you checked my code? maybe you realized what wrong

pseudo hazel
#

how did you define the command structure in the code

sterile token
pseudo hazel
#

where

sterile token
#

Via code

#

By creating their own classes

#

There you have an example how i register them, where points is ParentCommand too

#

I mean the names of the objects are no the best for this case but the structure is simple ParentCommand represents a list of children, which those children can have more children. Like how a linked list works

pseudo hazel
#

yeah more like a tree but sure

sterile token
#

yeah a tree thats the correct term

#

I will send you the debug caps so you have a better seen f whats happening

pseudo hazel
#

how did you register the info and list commands

wet breach
# sterile token Via code

I dont see where you set the values of some of those variables before using them? Specifically the permission one

sterile token
#

this actual execute method from ParentCommand

sterile token
pseudo hazel
#

whats singlecommand

wet breach
#

Ok but the parentcommand itself needs to have a default?

sterile token
wet breach
#

Which i dont see you set one

sterile token
wet breach
#

Typically you dont want to leave something null

pseudo hazel
#

constructor probably

sterile token
#

i mean all the command begin from FactionCommand, on it i register the FactionList and PointsCommand

wet breach
#

Your permission variable is null in the parent. Yes the child ones set it but not the parent if its only the parent executing

pseudo hazel
#

I dont know how java works regarding this but if you have a bunch of final fields without constructor does it initialize them in implicit constructor?

sterile token
#

Both of them, SingleCommand and ParentCommand

wet breach
pseudo hazel
sterile token
#

Let me send you whole classes

#

So its better for all of us

wet breach
#

Also if you are going to be using super its probably best you dont use final

#

Since its expected to change

sterile token
wet breach
#

You use final when you dont want it modified or make it more difficult

sterile token
#

i did them final just for the constructor reason, them i will make them like setters

#

But the issue is more to permissions or recursity (this i think is more sure) because of the outputs im gettng

wet breach
#

Ok but that could be a reason for issues possibly?

#

I am on phone so i cant just check lol

sterile token
#

oh right

#

from what i debugged its more like a recusivity issue

pseudo hazel
#

then why not remove the recursive lookups

sterile token
#

if i send photo you can check them frost?

wet breach
#

What i mean by check is tossing into ide and just seeing for myself lol

pseudo hazel
sterile token
pseudo hazel
#

you can look up elements using a stack, you dont have to use recursion

sterile token
#

the toString() from parents is correct but the argument is wrong (only when executing a child of a child)

wet breach
#

alright heading home now. Take about an hour

sterile token
sterile token
pseudo hazel
#

so you are testing the execute command of the parent right?

sterile token
#

where info is a child of child

pseudo hazel
#

what if you remove points, can you then get info successfully?

#

(if you reparent info to faction)

sterile token
#

yeah i set info as faction child works with no issue

#

just issue starts when having a child of a child

#

discord doesnt upload the caps, give me 2

pseudo hazel
#

okay and what if you add a nother child under info

#

faction.points.info.test

sterile token
#

there i would make info a ParentCommand

#

do you want me to test that? i can do it np

pseudo hazel
#

yeah I guess

sterile token
#

right i will do it

pseudo hazel
#

or just add another parent command between points and info

sterile token
#

the most weird thing is that help thing works perfect

#

there is no issue with giving help messahge dynamically

#

but im too stupid that can make a simple permission not work haha

pseudo hazel
#

wdym help

sterile token
#

debug 1 - Success (An argument)

#

Debug 2 - Success (A sub command with no arguments)

#

If you see up to there the outputs are correct, because faction is the base and points has faction as parent, which is okay too

#

Debug 3 - Not successfull

#

There starts the issue Steaf, if you see the command output is from the base command and not from points (which is the parent of info) . And also the argument info is wrong too

kindred sentinel
#

So.. Where is chunk pdc saving data? I mean, item's pdc is item tags, container's pdc it's container's tags, and what about chunk?

pseudo hazel
sterile token
#

Creating a 3 parent and a command with it, will tes tthat case

pseudo hazel
#

and how is the argument info wrong

sterile token
#

Because im executing a child of child, the output i getting is liked im just executing faction points

pseudo hazel
#

yes but its recursive so you will first print the faction information

#

in your prints, argument is just whatever child command you are calling next

sterile token
#

hmnn i dont udnerstand pretty well this thing tho, could you make a small deep explanation

pseudo hazel
#

because thats what it does, and after that it needs to execute .list on points

#

small deep explanation is an oxymoron

sterile token
#

so i have wrong recusivity?

pseudo hazel
#

i dont know yet

#

thats why I wanted to see what happened if you add more commands in between

sterile token
#

okay i done that,m cap is uploading

pseudo hazel
#

but regarding your recursive code, you have this list of arguments, like [points, info], it starts by taking the first argument points and then looks up the object for it, which it finds. after that it will print the parent command of this argument object (factions) and the argument itself (points)

#

then it will take your list and remove points, this leaves you with just [info]. now it will try to execute info on the points command

#

thats where it somehow fails

sterile token
#

Its extrnage because i have been looking at it for hours and cant even realize

pseudo hazel
#

since it doesnt print command help its safe to say that argument is null somehow

sterile token
#

so better debug?

pseudo hazel
#

after args.remove(0)l; print the list of arguments

#

"args left=" + args

sterile token
#

now the structure for debug is next:

  • faction
    • list
  • points
    • info
    • meta
      • info
sterile token
#

sorry for taking so long im trying to make the debugs okay and being sure they are correct

pseudo hazel
#

its fine

sterile token
#

in fact final goal is to learn whats happening for them trying to find a solution haha

#

Is this correct? before starting to debug

pseudo hazel
#

probably

#

run it

sterile token
#

right perfect, sorry for being really asshole

pseudo hazel
#

no its fine

#

you arent being asshole xD

#

btw are you getting any messages in the game chat?

sterile token
#

yes

#

with the messages i realized the issue with permissions there started everything

#

i realized that when i was giving the child of child permission message was still "no permission" when i give correctly the permission in luckperms

pseudo hazel
#

what permission did you put in luckperms then?

sterile token
pseudo hazel
#

and also what message did you get in the game

#

ah so the usage message

sterile token
#

usage message is okay, thats is discarded out

#

testing with 1 permission which is the hcf.points.* i messed up when typed here

pseudo hazel
#

and how did you give yourself that permission?

sterile token
#

and the permission is the same as PointsCommand class

pseudo hazel
#

how, im not super familiar with luckperms

sterile token
pseudo hazel
#

okay

#

and what happens if you are OP?

sterile token
#

with op everything working

#

let me clear everything and recheck

#

Console debug from /faction pointsi nfo

pseudo hazel
#

can you send PointsCommand class?

sterile token
#
public class PointsCommand extends ParentCommand {

    public PointsCommand() {
        super("points", "hcf.points.*", "Faction points command");
        register(new PointsInfo());
        register(new PointsMeta());
    }

}

public class PointsMeta extends ParentCommand {

    public PointsMeta() {
        super("meta", "hcf.points.meta", "Points meta command");
        register(new PointsInfo());
    }
}

public class PointsInfo extends SingleCommand {

    public PointsInfo() {
        super("info", "hcf.points.meta.info", "Points meta info");
    }

    @Override
    public boolean execute(CommandSender sender, List<String> args) {
        sender.sendMessage("info command executed");
        return false;
    }

}

#

There you have all the classes

#

Also i realized when i try to execute /faction points meta i cant even the usage message

pseudo hazel
#

in ParentCommand you have this line if (!isAuthorized(sender) && !argument.isAuthorized(sender))

sterile token
#

isAuthorized() is for checking the parent permission and argument isAuthorized for it child

#

so if i run /faction points info must be able with even hcf.points.* or hcf.points.info (any of it)

pseudo hazel
#

okay but what if you just give both explicitly?

sterile token
pseudo hazel
#

did you try that?

sterile token
#

will try now

wet breach
#

just fyi, bukkit doesn't know what * perms are

sterile token
#

Having both permission (not being op) works

sterile token
wet breach
#

you actually have to make code to interpret what * means in the permissions, but bukkit it treats that as a literal permission itself

pseudo hazel
#

yeah so sender.hasPermission(points.) will check if the player has the `"points.") permission

wet breach
#

I will give you an example of how to handle * perms yourself

sterile token
pseudo hazel
#

yes, but you wont have that if you dont add it to the player explicitly

sterile token
#

isAuthorized() just make sure the permission is not empty and then do Sender#hasPermission

sterile token
wet breach
pseudo hazel
#

from what I understand what frostalf is saying, hasPermission will not work for hcf.points.info if you just give the permission hcf.points*

wet breach
#

you are using the bukkit api

pseudo hazel
#

namely bukkit.CommandSender.hasPermission

sterile token
#

not wanna be dumb but i udnerstand the issue is just because im using an something.* withing my permissions?

pseudo hazel
#

yeah

wet breach
#

if you used luckperms api then it should work as you are expecting it to, because luck perms knows how to handle star perms

pseudo hazel
#

bukkit does not know what you mean by that

sterile token
#

but why? im just comparing literal strings

pseudo hazel
#

no

wet breach
#

not according to bukkit, because * and info are two different things

sterile token
#

I know but that no the issue

#

i just dont really know how to explain well

wet breach
#

ok but your demonstration proved it when you gave yourself the explicit permission

#

and not just the *

sterile token
#

@pseudo hazel

pseudo hazel
#

you are using hasPermission

sterile token
#

yeah

pseudo hazel
#

this is not from lp

sterile token
#

i know, but luckperms add the permission to player ๐Ÿค”

pseudo hazel
#

so the fact that you have luckperms permissions does not matter to bukkit

wet breach
#

luckperms doesn't add extra perms

#

it does something similar to what I showed

#

however, bukkit api doesn't use luck perms or invoke luck perms

pseudo hazel
#

you need something like luckperms.hasPermission(sender, permission) from the luckperms api instead of sender.hasPermission(permission)

wet breach
#

^

pseudo hazel
#

but i never used luckperms so I dont the exact syntax

wet breach
#

or you handle star permissions yourself

sterile token
#

i mean if thats the reason, why when i give myself the parent permission (hcf.points.*) i can execute the /faciton points info

#

if thats what you are saying, that what i said wouldnt work ๐Ÿค”

pseudo hazel
#

I thought you couldnt

#

I thought the whole issue is that you couldnt use /faction points info

wet breach
#

that is what I thought I read too, especially when you said it worked when you used the specific permission

#

the only thing I know with permissions and bukkit, is that bukkit doesn't know that star perms means global perms

sterile token
#

steaf if you see, i can execute the info child with the parent permission. But not with the child permission itself

rotund ravine
#

Luckperms integrates somewhat decently with bukkits permissiom api

sterile token
#

So the problem is not related to how i call my nodes or the permission plugin

pseudo hazel
#

thats because you dont have the hcf.points permission

#

thats how you wrote your permission check

sterile token
#

what what? im too losted sorry but i dont wanna sound troller this is not really easy for me

pseudo hazel
#

you are saying you cannot execute the command if you only have the permission hcf.points.info is that correct?

wet breach
#

which makes sense still

sterile token
#

Basically you have to be able to execute a child command, either with the permission of the child or its parent. That's what I want to achieve so far

pseudo hazel
sterile token
pseudo hazel
#

okay

sterile token
#

atm just working the execution having his parent permission (hcf.points.* one)

wet breach
#

so what you are wanting is inheritance, which I think luckperms can do?

#

bukkit api doesn't do this either

sterile token
wet breach
#

not sure if you have to enable it or structure it properly in luckperms to have inheritance work

pseudo hazel
#

so that means that you not having the hcf.points permission will fail the permission check of if (!isAuthorized(sender) && !argument.isAuthorized(sender)) { since you are checking both the parent command as well as the child command

wet breach
#

you using an and check

#

when it should be ||

sterile token
#

why? im returning in case having none of the permission

wet breach
#

because the check fails unless you have both perms

pseudo hazel
#

you are returning in the case where the command does not have a permission

pseudo hazel
wet breach
#

yes

sterile token
#

okay will change it to an or and test again

wet breach
#

it should be an or check if they want the inheritance to work

sterile token
#

lmao

#

i will shoot up im totally sure thats the whole issue ๐Ÿ’€

#

but i wont sang victory without testing haha

wet breach
#

finally, problems resolved

sterile token
#

i really appretiate both of your helps, really thanks bros

#

i will check it and came back it doesnt work, But there i will shotup haha

#

being with this since from 6 pm and its aroud 5.15 am

sterile token
#

Permissions are correct i copy-pasted

wet breach
#

still saying no permission?

sterile token
#

same as with child

#

now i cant run the command with none of them

#

i added the parent and no permission
then tested with child and no permission

#

this is chaotic at this point lmao

#

steaf are you still up? we continue struggling with frost haha

wet breach
#

try flipping the check around?

#

instead of checking for false, check for true

#

and return true

sterile token
#

right wil test that

#

take in care im returning true in case you dont have any of the permission

wet breach
#

well if they don't have permission it should be false at the end

#

all the if statements should be returning true

#

the only time you should return false, is if some how none of the if statements executed

#

which usually means no permission or something else wrong

sterile token
#

still same message

wet breach
#

well if you flipped the checks around and returned true

#

that means it executed succesfully fyi

sterile token
#

tested like that. thats what you mean

wet breach
#

since you know that if check can't pass if it wasn't true ๐Ÿ˜›

#

yes, that means unless one of those is true

#

sendmessage won't execute

#

but it did execute

#

which means one of them is true

#

so it works

sterile token
#

so if i dont have any of the permissions will join there right? just making sure we tlaking same thing hehe

wet breach
#

if you don't have any permission, it won't execute that if statement

#

but if you have one of the perms

#

it will execute

sterile token
#

oh lmao thats backwords what i need

#

i need player joining that if, when you dont have any

wet breach
#

also, change all your other if statements to return true as well, and leave the one return false at the end of the method for command

wet breach
#

typically defaults are left outside of code blocks and in the main method

#

this is called early returning

sterile token
#

i know about early returns just being too confused

wet breach
#

also returning false in the command block causes bukkit to interpret that as meaning the command wasn't succesful ๐Ÿ˜›

#

this is why you generally return false at the end of the main method, but return true in the if statements XD

#

because to not hit any if statement means either no permission, something is null, or something else

sterile token
#

ok, up to know my code should work right?

wet breach
#

give it a test

sterile token
#

yeah im doing it hehe

pseudo hazel
#

also you should return argument.execute(sender, args); instead of returning true there

wet breach
#

ah right

#

I was thinking something didn't look right XD

pseudo hazel
#

thats a pretty big part of the recursion

sterile token
#

right will apply that, thanks steaf for still being here

#

re debugging momment hehe, dont care with having it fixed haha

#

lmao this is fucking shit

#

i removed his parent permission and cant run the command, same issue we start doesnt allow to run sub command argument with it own child permission

pseudo hazel
#

have it print all the permissions and if you have permission to it when using /faction etc

#

then you can see all permissions and on which one it fails

sterile token
#

the data is wrongly outputed in the child debug

wet breach
#

only thing I can think of doing is using bukkit api to list the permissions it sees since you are using bukkit api. It doesn't matter what luck perms knows, its whether or not the api knows since you are making use of the api methods from bukkit

sterile token
#

yes but not a permission problem

#

is something with the objects storing

#

because the debug output in the info child, as command the object data from faction and argument the object data from points

pseudo hazel
#

if it works when you have OP its by defnition a permissions problem

wet breach
#

the only thing I do see interesting is that No Permission is sent twice, which means both child and parent are executing

#

and both are failing if checks

#

unless you didn't fix the child one to be similar how parent is checking

sterile token
#

give me 5m

#

im re compiling

#

and sent all okay?

#

starting from faction until info all debugs

#

because im too much hard. And really want to fix it haha

tender shard
#

maybe the parent thinks their child's a failure and the child also hates their parents and so they don't talk to each other and that's causing communication issues?

pseudo hazel
#

btw whenever I feel like making something involving permissions, i would make sure the system fully works if I am just in OP first, this usually filters out more than half of the issues

sterile token
#

testing with op right now

#

op works all okay ๐Ÿ’€

pseudo hazel
#

right

#

now you know 100% sure its a permissions thing

#

so you just need to know which permissions you have, which ones it checks, and which ones pass the checks

#

at every step

sterile token
#

i discover a new issue ๐Ÿ˜ก

#

having more than 1 child of child, its messing the base command (which is faction )

tender shard
#

why don't you just use a command framework like acf ๐Ÿฅฒ

sterile token
pseudo hazel
#

because its fun to make your own

sterile token
#

starting from there haha

sterile token
pseudo hazel
#

in what way

tender shard
sterile token
# pseudo hazel in what way

have you seen in each parent i calling a register method? that register method takes the command object and makes a command.setParent(this)
Just trying to discover what happens the permissions are wrongly in the outputs

#

i said it in the start the outputs are wrong when debugging

pseudo hazel
#

I mean do you even use the parent except for printing it?

sterile token
#

look ๐Ÿ’€

#

thats what i said before, giveme the argument data the info parents and in the command the base one. Whcih is all wrong the outputs

#

Because output must be first line data from points and second line data from info

#

do you understand me @pseudo hazel ?

pseudo hazel
#

no

sterile token
#

oh lmaoo uwu

pseudo hazel
#

it first needs to go to the factions parent command does it not?

#

so the first command it passes is factions

#

then points

#

then info

sterile token
#

yeah, faction and points parsing outputs correct