#help-development

1 messages · Page 1707 of 1

quaint mantle
#

i have done this

#

and i cannot access the interface

#

let me also implement api

#

still now working

#

not working

@EventHandler
    public void enderpearlThrow(ProjectileLaunchEvent event) {
        if (!event.getEntity().getType().equals(EntityType.ENDER_PEARL)) return;
        if (!(event.getEntity().getShooter() instanceof Player)) return;

        EnderPearl enderPearl = (EnderPearl) event.getEntity();
        ItemStack enderPearlItem = enderPearl.getItem();
        ItemMeta enderPearlItemItemMeta = enderPearlItem.getItemMeta();

        Player shooter = (Player) event.getEntity().getShooter();
        enderPearlItemItemMeta.setDisplayName("haha");
        enderPearlItem.setItemMeta(enderPearlItemItemMeta);
        enderPearl.setItem(enderPearlItem);
    }
#

yea

#

okay i may found a way to do it

quaint mantle
#

@ivory sleet i have another problem

#

im trying to access a class from core

#

or plugin

#

in my versions

#

and i cant implement the core cause i cant

#

it wont compile if i do it

#

what should i do ?

solar sable
#

uh guys kinda need help again lol

#
 Bukkit.getScheduler().scheduleSyncRepeatingTask(Testing.getPlugin(Testing.class), () -> {
                Bukkit.broadcastMessage("This message is shown immediately and then repeated every second.");
            }, 0L, 20L);
``` what do i need to change at the Bukkit.broadcastMessage to make it repeat my scoreboard?
#

i need to scoreboard to repeat

#

yeh

#

and?

#

example code pls?

plain oxide
#

how to set player xp

solar sable
#

my laptop battery about to die but i dont have a place to charge here.. sad life lol

undone axleBOT
solar sable
#

no im here

#

net is shit rn

#

well sure

#

but the whole thing?

#

i put the thing and now i press ctrl + s but now?

#

okay i gg now because my battery gonna die

#

send it to me in dm ig?

#

okay ill be back when i charge my laptop lol

steady rapids
#

anyone knows how can I load something saved like this?:

    public static List<RecipeSign> signs = new ArrayList<>();

    public void saveSigns(){
        this.getConfig().set("signs", signs);
        this.saveConfig();
    }
    public void loadSigns(){
        List loadedSigns = this.getConfig().??????;  //what should this "???????" be?
        signs = loadedSigns;
    }
#

i try thx

lean gull
#

can someone please help?

#

:p

steady rapids
onyx shale
#

you cant just serialise everything you want

#

you have to either numb it down or make ur own

eternal oxide
#

implement ConfigurationSerializable in your RecipeSign class

#

implement the methods it requires and register your class

onyx shale
#

think its a spigot class

eternal oxide
#

its not

onyx shale
#

ah yes

eternal oxide
#

its his own, and he was told this yesterday or the day before by myself and 7smile7

steady rapids
#

it made me add this to RecipeSign

    public Map<String, Object> serialize() {
        return null;
    }```
do u have an example on how to use this serialization?
onyx shale
#

you could always save primitives and later build the object with them..

eternal oxide
#

where you have null you need to parse teh Map and reconstruct your class fields in the constructor

lean gull
#

how does one make a new entity in a variable, then set a player's passenger to that variable

#

Entity armorStand = new Entity(EntityType.ARMOR_STAND, player.getWorld());
idk how to work with entites

eternal oxide
#

for serializing you build a map

steady rapids
#

hmmm ok

lean gull
#

i don't want to spawn one, i want to set it to a variable and then set the passanger of the player to it

minor vapor
#

if it's not spawned, you can't modify the passenger

lean gull
#

alright

lean gull
#

thanks

minor vapor
#

np

lean gull
#

ok i got this:
Entity armorStand = player.getWorld().spawnEntity(player.getLocation(), EntityType.ARMOR_STAND);
how do i put a paper with a custom model data of 1 on their head

quaint mantle
#

How do i use CraftMagicNumbers or any other tool to calculate the amount of drops from an fortune tool

quaint mantle
lean gull
#

it's already one?

#

on the end

quaint mantle
#

replace Entity with ArmorStand

#

and call .setHelmet(item) on it

#

I'm kinda new to Spigot so I dont know how to put an damaged item onto it

lean gull
#

oh ok thx

minor vapor
#

I suggest going here

quaint mantle
#

I know what method to call but i cannot seem to import it

lean gull
#

how do i add the helmet slot thing doe

quaint mantle
#

<ArmorStand>.setHelmet()

#

or setHelm

lean gull
#

deprecated

minor vapor
#

ah right, get the equipment

#

then use the method in there

lean gull
#

alr

minor vapor
lean gull
#

ty

minor vapor
#

np

quaint mantle
#

But how do i get the amount of items dropped from an block using a fortune pickaxe

eternal oxide
#

you can;t get the loot until its actually broken, due to the random reward

lean gull
#

btw can anyone help with this?

quaint mantle
eternal oxide
#

BlockDropItemEvent

quaint mantle
#

alr

#

and is there a way to cancel that event

#

to cancel the items from dropping

eternal oxide
#

clear the drops

#

or remove any items you don;t want to drop

#

eg, this would double the drops ```java
@EventHandler
public void onDropItem(BlockDropItemEvent event) {

    for(Item item: event.getItems()) {
        ItemStack drop = item.getItemStack();
        drop.setAmount(drop.getAmount() * 2);
    }
}```
quaint mantle
#

alr

#

but can i cancel the dropping as a whole using BlockDropItemEvent.setCancelled(true) ?

eternal oxide
quaint mantle
#

alright, thanks!

plain oxide
#

Is there a way to execute a command from a plugin without logging the command to the console?

tame coral
#

I don't think so

#

Unless you don't use a command but the chat event thingy

slim kernel
#

Omg Thank you so much!

plain oxide
#

Logs are noisy when using dispatch commands

ivory sleet
#

Get the command then from the command map and invoke it?

#

Or maybe if the Server instance offers a way to get a command by its name

steady rapids
#

is there something like BlockPos() in spigot?

#

that contains x,y,z of a block

ivory sleet
#

Location

steady rapids
#

kk ty

ivory sleet
#

Or Vector maybe

#

BlockVector

maiden briar
#

Bukkit.getScoreboardManager().getMainScoreboard() If I set anything to this scoreboard, will it be visible to all players?

#

Ok it saves it to the world, don't want this

quaint mantle
#

How do i cast an List of Item to ItemStack[]

tall dragon
#

toArray()?

ivory sleet
#

You don’t

tall dragon
#

oh you mean a List<Item>

quaint mantle
#

yeah

tall dragon
#

yea you dont

quaint mantle
#

What i'm trying to do is put the Drops from an BlockItemDrop event directly into the player's inventory

#

BlockDropItem*

#

Is there a way to do this?

ivory sleet
#

Yeah

#

Loop through the drops and put each drop into the inventory

quaint mantle
#

BlockItemDropEvent.getItems() returns an List<Item>, i can iterate trough that array but PlayerInventory.addItem() needs an ItemStack

eternal oxide
#

item.getItemStack

quaint mantle
#

ah okay, thanks

#

Thanks so much!

#

how can i change a module's jdk

#

gradle

shadow tide
#

I need to store a players location in a pdc, how would I do this

quaint mantle
#

hm

quaint mantle
eternal oxide
#

no

shadow tide
#

if there was I would be here 🤦‍♂️

eternal oxide
#

why do you need a location in a PDC?

quaint mantle
#

You'd have to use multiple containers or the String type

#

you can store locationWorld string

lost matrix
quaint mantle
#

locationX double

quaint mantle
#

how

tall dragon
#

yea just use custom pdc

shadow tide
eternal oxide
#

?paste

undone axleBOT
eternal oxide
#

um, their location is on ther player

#

when they log in

lost matrix
shadow tide
#

like, when they execute a command, I need to get their location, and store it in a pdc

eternal oxide
#

if they execute a command they are online and have a location object

#

Player#getLocation()

shadow tide
#

I know

quaint mantle
#

use this

#

and create a location

#

persistentdatatype

shadow tide
#

I need to store the player's location when they execute a command

eternal oxide
quaint mantle
#

Is there a way to cancel the dropping of the items on an EntityDeathEvent?

#

Do i just set the amount to 0

#

?

quaint mantle
#

e.getDrops().clear()

#

so can anybody tell me how to change jdk version of a gradle module
and not the others in the project ?

#

SDK is 16

#

but when i compile it

#

i have different modules

#

on for 1.8, 1.9.4 and...

#

all can compile with java 8

#

but 1.17 need java 16

shadow tide
#

I'm guessing this wouldn't work lol java (JavaPlugin) Main.getPlugin()

#

ahhhh

#

@eternal oxide Thanks for the Location pdt class, it really helps!

torn shuttle
#

ok this is a really weird question but has anyone here ever written code for entities or blocks that get modified frequently that would make them auditable?

quaint mantle
shadow tide
#

?pdc if there is an admin online u can delete this lol

eternal oxide
#

why?

#

thats a well used resource

#

?pdc

torn shuttle
#

because he's deeply embarrassed for not having memorized that api

#

I still remember the day I was born god uploaded the documentation for that api directly into my brain

#

which was not very useful as I would not learn english before I was 7

#

and java before I was 22

quaint mantle
#

not the resource

eternal oxide
#

it took months to get it added as a bot command.

quaint mantle
#

bruh

#

i said the message that is in the channel

#

cause he thinks this is not the right channel to execute the command

eternal oxide
#

That makes no sense. this is the correct channel for a PDC resource

quaint mantle
eternal oxide
#

You are making even less sense than he is

quaint mantle
#

bruh

#

for example i execute a command

ivory sleet
eternal oxide
#

bruh, dood

quaint mantle
#

?pdc

eternal oxide
#

yes

quaint mantle
#

so he thinks this is not the right channel

ivory sleet
#

Indeed

eternal oxide
#

a link

quaint mantle
#

or the command that he executed

#

the message of it

#

shouldnt be in this channel

#

so he said

torn shuttle
#

I think 10% of my braincells died reading this discussion

eternal oxide
#

of course it should

quaint mantle
#

bruh

eternal oxide
quaint mantle
ivory sleet
#

What’s the point of this discussion?

eternal oxide
#

I have no idea

quaint mantle
#

i dont know tbh

#

my project sdk is 8

#

the module 16

ivory sleet
#

1.17 does not need java 16 to compile

quaint mantle
#

the nms

ivory sleet
#

At least not plugins

#

Oh yeah

eternal oxide
#

He's calling me bruh as if I should be understanding something

quaint mantle
#

just forget about it

#

:/

#

that discussion had no point

eternal oxide
#

Seems so you had plenty of opportunity to explain but bruh wasn't too helpful

quaint mantle
#

i want my 1.17 module

#

to use java 16

#

the sdk of the module is set to 16

#

but this happens

ivory sleet
#

And language level?

quaint mantle
#

and others to use java 8

#

wait

ivory sleet
#

What gradle version do u use btw

#

Bump to latest if not

quaint mantle
ivory sleet
#

?paste

undone axleBOT
shadow tide
#

I know

#

its not that big dude

quaint mantle
shadow tide
torn shuttle
#

man kids these days have it easy

eternal night
#

register the command in the plugin.yml

#

it is missing

eternal oxide
#

your command is missing from your plugin.yml

eternal night
#

or misspelled

torn shuttle
#

the java I know doesn't even tell me what is null

ivory sleet
quaint mantle
#

conclure smells

#

and language level is 8

eternal oxide
#

LifeSteal.java line 22

quaint mantle
#

the project

shadow tide
#

ik

ivory sleet
#

How have you done it?

shadow tide
#

ik

quaint mantle
shadow tide
#

they were tabbed wrong 🤦‍♂️

ivory sleet
#

I believe you should quite literally set it using something like targetCompatibility = sourceCompatibility = JavaVersion.VERSION in every module might be best

#

If it’s the groovy dsl

quaint mantle
#

it is

quaint mantle
#

the build.gradle of every module

ivory sleet
#

Yes precisely

quaint mantle
#

what is for 16 ?

ivory sleet
#

16

quaint mantle
#

ok

#

and is 7.1.1 ok ?

ivory sleet
#

I think so

#

Idr which gradle version at minimum supports java 17

#

Or 16*

quaint mantle
#

like this

#

every module

ivory sleet
#

Yaa

quaint mantle
#

right ?

ivory sleet
#

Well

#

You’d want to use 8 for most ones

#

Only 16 for the ones which need 16 if I remember correctly

quaint mantle
#

the version of java

#

8 ?

ivory sleet
#

8

shadow tide
#

now all of my commands are tabbed and spelled correctly, and I'm still getting the same error

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

i have to paste something

undone axleBOT
quaint mantle
shadow tide
eternal oxide
#

and what is line 22 that is throwing the error?

ivory sleet
#

Try Java 8 for that as well pmz

#

Everything Java 8

shadow tide
shadow tide
#

permission: default:op

eternal oxide
#

yep

shadow tide
#

wut

ivory sleet
shadow tide
#

it was working before I added home and sethome

eternal oxide
#
  default: op```
shadow tide
#

wut permission do I put in permission.here?

ivory sleet
#

Okay maybe try java 16 there

eternal oxide
#

whatever permission you want for the command

ivory sleet
#

I need to check something

shadow tide
#

I want op

eternal oxide
#

no a permission not a level

quaint mantle
shadow tide
#

what permission then, I have no custom perms

eternal oxide
#

this is where you create it

shadow tide
#

oooh

eternal oxide
#

like lifesteal.command.heal

quaint mantle
ivory sleet
#

go to File -> Settings -> Build Execution Development -> Compiler -> Java Compiler
set the project bytecode to java 8 but then add ur 1.17 module and set that per project bytecode to java 16

shadow tide
#

either sethome is doing absolutely nothing, or home isn't checking properly java if (player.getPersistentDataContainer().has(key, locPDT))

ivory sleet
#

set everything to 8

#

except that one 1.17 module

quaint mantle
#

conclure daddy

#

i love you

ivory sleet
#

im just going to ignore what you just sent ok thx

shadow tide
#

mute him for 1 min please

quaint mantle
#

Conclure is my dad

#

anyone got an issue?

#

@ivory sleet

C:\Users\pmzjs\Desktop\TrexMine\TrexHolograms\versions\v1_17_R1\src\main\java\com\trexmine\trexholograms\v1_17_R1\HologramManager.java:5: error: cannot access net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata
import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata;
                                          ^
  bad class file: C:\Users\pmzjs\.m2\repository\org\spigotmc\spigot\1.17.1-R0.1-SNAPSHOT\spigot-1.17.1-R0.1-SNAPSHOT.jar(net/minecraft/network/protocol/game/PacketPlayOutEntityMetadata.class)
    class file has wrong version 60.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
ivory sleet
quaint mantle
#

the same error

shadow tide
ivory sleet
#

breh

quaint mantle
ivory sleet
# shadow tide ^^^

Due to unfortunate reasons this server hereby does not possess commands of muting people.

shadow tide
#

dyno exists you know

ivory sleet
#

?mute

#

yes but nowork

eternal oxide
#

!mute

#

nope

ivory sleet
#

!mute

quaint mantle
#

you dont have perm

shadow tide
#

I'm pretty sure dyno uses slash commands lol

quaint mantle
#

dyno is like that

craggy cosmosBOT
quaint mantle
#

if you dont have perm, no output

ivory sleet
#

:[

shadow tide
#

we need someone to mute him

eternal oxide
#

Dyno is slow at counting

shadow tide
#

yes

eternal oxide
#

not enough fingers and toes

craggy cosmosBOT
opal juniper
#

elgarl you’re english rite

eternal oxide
#

yep

opal juniper
#

opinions on the fuel shortage?

shadow tide
#

lol

opal juniper
#

i mean

#

it’s just a tonne of idiots panic buying

eternal oxide
#

Stupid people listening to the news media causing a panic

opal juniper
#

but it’s rather annoying

#

if you have things planned

#

and now no fuel sadge

eternal oxide
#

yeah, but in a couple of days they will all have full tanks and garages will have caught up

opal juniper
#

ig - just hope that people don’t pay attention to the news talking about food shortages as well PepeHands

ivory sleet
#

yeah this is odd

quaint mantle
#

and now

#
Could not determine the dependencies of task ':shadowJar'.
> Could not resolve all dependencies for configuration ':runtimeClasspath'.
   > Could not resolve project :versions:v1_17_R1.
     Required by:
         project : > project :Core
      > No matching variant of project :versions:v1_17_R1 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally but:
          - Variant 'apiElements' capability com.trexmine:v1_17_R1:1.0-SNAPSHOT declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component compatible with Java 16 and the consumer needed a runtime of a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
          - Variant 'runtimeElements' capability com.trexmine:v1_17_R1:1.0-SNAPSHOT declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 16 and the consumer needed a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
ivory sleet
#

oh

#

maybe

#

use compileOnly instead of implementation for api and for every nms module

#

only use implementation in the main/rootproject build.gradle

#

havent thought about that

#

but might be substantial since implementation inevitably adds the dependency both as a compile time and a runtime one

quaint mantle
#

same error

acoustic pendant
ivory sleet
#

PmzHero can u push to gh?

eternal oxide
#

learn about variable scope

ivory sleet
#

I'd like to see for myself

#

you can delete it afterwards

acoustic pendant
quaint mantle
eternal oxide
#

of course you are casting to Plyer before you test it is a player

acoustic pendant
#

and

ivory sleet
#

and no I wont steal your code

eternal oxide
#

Console is not a player

acoustic pendant
#

ye

#

but in the }else{ code

eternal oxide
#

but nothing

acoustic pendant
#

it's sending to the console

#

not to the user

eternal oxide
#

system.out

acoustic pendant
#

yes

eternal oxide
#

sends to console

acoustic pendant
#

i want that

quaint mantle
#

@ivory sleet what is your github username ?

eternal oxide
#

you have nothing happening at all if there are args

ivory sleet
#

Conclure

torn shuttle
#

you know I am having fun when I have to add a way to audit entities to know wtf they've been doing

quaint mantle
#

@ivory sleet i added you accept

torn shuttle
#

lol

ivory sleet
#

link

torn shuttle
#

yoink I have now stolen your code

quaint mantle
#

private repo lmao

torn shuttle
#

it's our private repo now comrad

#

mods

#

@ivory sleet wake up

ivory sleet
#

?ban @quaint mantle good bye

undone axleBOT
#

Done. That felt good.

ivory sleet
torn shuttle
#

lmk if you ever find a way to filter those nitro scams

civic apex
#

if i want to store data on a player like stats (custom level, things like that) would persistentdatacontainer be a good way?

ivory sleet
#

lmk if you ever find a way also lol

torn shuttle
civic apex
ivory sleet
quaint mantle
ivory sleet
#

where r the modules?

quaint mantle
#

it is

torn shuttle
#

I'm memeing but I bet there's servers out there that would pay double that to solve this

quaint mantle
#

wait

#

tf

tall dragon
#

thats a really hard problem to solve tho

quaint mantle
#

why is it empty

torn shuttle
#

I'm considering just blacklisting the word nitro

tall dragon
#

there will always be ways to share these scams

quaint mantle
#

let me setup git and push it

ivory sleet
#

ya

#

also my school laptop btw lol

ivory sleet
opal juniper
#

the theme PepeHands

#

meh i need to get a laptop

#

they're pretty expensive tho

ivory sleet
#

yeah

civic apex
#

Ways to store data for players

idle cove
#

I am using BlockPlaceEvent to stop the player from placing a specific block though the block i want the player to not be able to place is a custom item that i made and i want to check the display name to see if it is that custom item the player is trying to place, how would i do this?

eternal oxide
#

Dont compare item names

#

use instances or tag them with the PDC

opal juniper
#

compare their date of birth

civic apex
torn shuttle
#

elgar has the right solution

idle cove
eternal oxide
#

yes

quaint mantle
#

What's the alternative to Player#getItemInHand() because it says it's deprecated

idle cove
#

what exactly do you mean

torn shuttle
#

quick q before I have to dip, how are data containers queried? map?

eternal oxide
#

use myCustomItem.isSimilar(event.getItem)

idle cove
quaint mantle
#

okay thank you

idle cove
#

or offhand

idle cove
#

i am using BlockPlaceEvent

eternal oxide
#

whatever method you need to get the item used

#

then getItemInHand

torn shuttle
#

are data containers using maps behind the scenes or something else?

idle cove
#

Ok

quaint mantle
#

Oh and another thing how can I find in which slot the item is smth like ItemStack#getSlot()

idle cove
#

but wouldnt that return the item that the player has in their hand after they placed the block

#

it oculd be air or the block that the player just placed in case they have a stack of them

eternal oxide
#

Before, as its a cancellable event

idle cove
#

oh ok

#

thank you very much

subtle folio
#

Im making a ridable snowball thingy, my only issue is the snowball colides with the player whilst they are riding it. anyone know any ways of preventing this?

quaint mantle
ivory sleet
#

@quaint mantle

#

remove


        compileOnly files('C:/Users/pmzjs/.m2/repository/org/spigotmc/spigot/1.8.8-R0.1-SNAPSHOT/spigot-1.8.8-R0.1-SNAPSHOT.jar')
        compileOnly files('C:/Users/pmzjs/.m2/repository/org/spigotmc/spigot/1.9.4-R0.1-SNAPSHOT/spigot-1.9.4-R0.1-SNAPSHOT.jar')
        compileOnly files('C:/Users/pmzjs/.m2/repository/org/spigotmc/spigot/1.12.2-R0.1-SNAPSHOT/spigot-1.12.2-R0.1-SNAPSHOT.jar')
        compileOnly files('C:/Users/pmzjs/.m2/repository/org/spigotmc/spigot/1.16.5-R0.1-SNAPSHOT/spigot-1.16.5-R0.1-SNAPSHOT.jar')
        compileOnly files('C:/Users/pmzjs/.m2/repository/org/spigotmc/spigot/1.17.1-R0.1-SNAPSHOT/spigot-1.17.1-R0.1-SNAPSHOT.jar')
quaint mantle
#

?

ivory sleet
#

in COre

quaint mantle
#

yes

ivory sleet
#

compileOnly('org.spigotmcspigot+')

#

just have that instead

quaint mantle
#

ok

ivory sleet
#

in multiversion also

idle cove
#

I am using this code: compactTNTRecipe.addIngredient(567, Material.TNT); : And the error i get is: Shapeless recipes cannot have more than 9 ingredients : Anybody got a solution as i am trying to make a recipe that requires a stack of tnt in every slot.

ivory sleet
#

@quaint mantle for the sake of god
use compileOnly 'org.spigotmcspigotversion' instead

quaint mantle
# ivory sleet <@456226577798135808> for the sake of god use compileOnly 'org.spigotmc<:spigot:...
Could not determine the dependencies of task ':Core:compileJava'.
> Could not resolve all task dependencies for configuration ':Core:compileClasspath'.
   > Could not resolve project :versions:v1_17_R1.
     Required by:
         project :Core
      > No matching variant of project :versions:v1_17_R1 was found. The consumer was configured to find an API of a library compatible with Java 8, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally but:
          - Variant 'apiElements' capability com.trexmine:v1_17_R1:1.0-SNAPSHOT declares an API of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 16 and the consumer needed a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
          - Variant 'runtimeElements' capability com.trexmine:v1_17_R1:1.0-SNAPSHOT declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 16 and the consumer needed a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.


#

i changed multiversion

#

and

#

core

#

i pushed the new changes

ivory sleet
#

now in every nms module

quaint mantle
#

ok

#

wait

idle cove
#

?paste

undone axleBOT
idle cove
young knoll
young knoll
idle cove
#

thats what i saw in the tutorial

#

i dont fully understand it but it worked for him

young knoll
#

What

#

What does that have to do with crafting recipes that require a full stack

idle cove
#

Oh

#

I changed ti to this

#

before it was adding 576 tnt at once

#

now i made it add 64 9 times

#

and i dont get that error anymore

quaint mantle
#

@ivory sleet same error

idle cove
#

Oh

#

No caps

#

ok

#

alright i think i fied it now

#

fixed*

ivory sleet
#

yeah pmz btw is :versions a module?

quaint mantle
idle cove
#

Ok the crafting is the problem now

quaint mantle
idle cove
#

i will try a crating event

ivory sleet
#

include ':versions/multiversion'
try that instead

#

idk if its causing issues

quaint mantle
#

where

#

in the build files ?

ivory sleet
#

settings.gradle

#

:directory/path/moduleName

crude hound
#

hey, I have an really huge calculation task to perform so how can I run it in another thread with spigot?

#

I just use an bukkit runnable?

quaint mantle
ivory sleet
crude hound
#

k

idle cove
#

I am trying to make a recipe with a stack of tnt in each slot but i keep getting the error: Shapeless recipes cannot have more than 9 ingredients : Is there anyway to get around this?

ivory sleet
# quaint mantle everything is bugged now
rootProject.name = 'TrexHolograms'
include ':versions/multiversion'
findProject(':versions/multiversion')?.name = 'multiversion'
include ':core'
findProject(':core')?.name = 'core'
include ':versions/v1_8_R3'
findProject(':versions/v1_8_R3')?.name = 'v1_8_R3'
include ':versions/v1_9_R2'
findProject(':versions:/1_9_R2')?.name = 'v1_9_R2'
include ':versions/v1_12_R1'
findProject(':versions/v1_12_R1')?.name = 'v1_12_R1'
include ':versions/v1_16_R3'
findProject(':versions/v1_16_R3')?.name = 'v1_16_R3'
include ':versions/v1_17_R1'
findProject(':versions/v1_17_R1')?.name = 'v1_17_R1'

@quaint mantle

#

then

#

when adding

#

use project(':versions/name') of the module is contained in versions

quaint mantle
#

just versions ?

#

i guess

undone axleBOT
quaint mantle
#

?paste

ivory sleet
#

yeah

#

I named it core

#

we use kebab-case for module names

tall dragon
#

does anyone know why Byte storage is not more widely used in plugins?

quaint mantle
ivory sleet
#

name ur Core core

ivory sleet
#

its an offical convention

quaint mantle
ivory sleet
#

just upload ur thing

#

push to gh

quaint mantle
#

wait

ivory sleet
#

alr

quaint mantle
#

@ivory sleet done

ivory sleet
#

rename ur module Core to core

#

including the directory

#

as said several times now

#

use kebab-case for module naming

quaint mantle
ivory sleet
#

seems to be Core on gh still

eternal night
#

Git doesn't care much about capitalization

ivory sleet
#

sadly

quaint mantle
#

i renamed with windows explorer

#

so

ivory sleet
#

ya should still work

eternal night
ivory sleet
#

oh

quaint mantle
#

the problem is not related to core module name

#

A problem occurred evaluating project ':core'.

Project with path ':versions/v1_12_R1' could not be found in project ':core'.

ivory sleet
#

well

#

you renamed ur module to just v1_12_R1

#

so skip versions/

#

oh yeah I told u to use that earlier didnt I, im a dofus lol

quaint mantle
#

A problem occurred evaluating project ':core'.

Project with path ':v1_9_R2' could not be found in project ':core'.

ivory sleet
#

without : maybe

quaint mantle
#

A problem occurred evaluating project ':core'.

Project with path 'v1_9_R2' could not be found in project ':core'.

#

let me change it to : in settings

#

and retry

ivory sleet
#

yeah

#

I'm a bit rust when it comes to subprojects, havent had the need to mess with that for a while

stoic osprey
#

how can I shedule a function to run in 5 seconds without using Thread.sleep() and freezing the whole game?

ivory sleet
#

?scheduling

undone axleBOT
quaint mantle
#
Could not resolve project :versions:v1_17_R1.
Required by:
    project :core

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
ivory sleet
#

isnt is :versions/v1_17_R1

#

or smtng

quaint mantle
#

i changed it

ivory sleet
#

what if u remove also those findProject().name =

#

thingies

quaint mantle
#

nevermind

#

i just do something else

#

this shit is hard

ivory sleet
#

alr cool

#

though if I can suggest something

#

Maybe let me try fixing it for you?

#

@quaint mantle

quaint mantle
#

yes if you can

ivory sleet
#

alr 1 sec then

#

do I have permission to push to the repo?

quaint mantle
#

i guess

#

a colabrator has

stoic osprey
idle cove
#

I get this error: Cannot have null choice: on this line : explosionRecipe.setIngredient('C', CompactTNT.compactTNT); : This is my custom item and i am confused why i am getting this error

eternal night
#

Seems like the variable isn't initialized at that point

#

Static is an amazing concept for state management

#

🙃

idle cove
#

What exactly do you mean

#

I have a method that sets the item properties and it is called in the onEnable method

#

So it shouldnt be null

eternal night
#

Before or after you register the ingredients

tardy delta
#

is there a way i can create a message where you can click on but you can only click on a part of the message (now the clickable part is from some point to the end and i dunno how to fix it)
?paste

#

smh

#

?paste

undone axleBOT
idle cove
#

Before

tardy delta
eternal night
#

Well either that is wrong or you aren't setting that field correctly

idle cove
#

Ill send code

eternal night
#

?paste

undone axleBOT
idle cove
#

oh um

#

i accidentally commented out

#

the part where it actually sets the item

#

in the method

eternal night
#

:>

#

Happens XD

idle cove
#

lol

crude hound
#

now my problem is to place blocks in an async task

#

I have like 160 blocks to place in 160 chunks

eternal night
#

You don't place blocks off the main thread

crude hound
#

I know but what can I do?

eternal night
#

Well run logic back on the main thread by scheduling a runnable/task

crude hound
#

like shedule an task in a task?

opal juniper
#

Bukkit.getScheduler#runTask(Runnable);

#

this schedules it for the main thread

crude hound
#

no now there is the BukkitRunnable

#

so I think I will just do that

opal juniper
#

mmm or just use a lambda

idle cove
#

I am having trouble making a recipe that gives my custom item when there is 9 stacks of tnt in the crafting area, I first got the error Shapeless recipe can only have 9 ingredients or something and now i am having the error Index 9 out of bounds for length 9 Could anybody help me?

tall dragon
#

@crude hound do you need to place alot of blocks?

ancient plank
#

an task

crude hound
tall dragon
#

thats not too bad, a runnable should be fine yea

crude hound
#

k

#

I think this will be pain for the server

#

because of my code

tall dragon
#

show us then

acoustic pendant
#

How can i do that people can use %player% in config?

crude hound
tall dragon
ivory sleet
#

@quaint mantle I fixed it now

maiden briar
#

If I join the server for the first time (after resetting the world) I always get teleported to the main world, even if I run this code player.teleport(DogLeader.getLocation(DogLeader.DogLeaderLocation.LOBBY)); (teleport to lobby world), it is not null, because I null check before

tall dragon
#

@crude hound you should probably just run some tests and Time the results

#

check how long everything takes

crude hound
#

I know that 1/40 of the verifications are made in 1.5 sec with 2 go of ram

tall dragon
#

well you could consider workload distribution

quaint mantle
ivory sleet
#

👍

quaint mantle
#

@ivory sleet why is this commented

tall dragon
ivory sleet
quaint mantle
#

why some stuff are commented

ivory sleet
#

so u can just uncomment it lol

quaint mantle
crude hound
quaint mantle
#

oh

#

things of 1.9 are commented i guess

ivory sleet
#

yeah

#

cuz I cba to run bt 1.9 on the spot

#

but yeah it ought to be project(':multiversion') btw

#

with the :

tall dragon
quaint mantle
#

thanks

crude hound
#

like im in a 40 * 40 chunks map and I want to make that

#

so I maked an long algorithm to make that

#

and to see if it work I want to place some blocks

#

to see the state of the chunk

tall dragon
#

soo you need to have a block in the middle of each chunk?

crude hound
#

no where the location that I defined is

tardy delta
#

for some reason the Utils.isAuthorized... gives an UnsupportedOperationException when trying to tabcomplete

@Override
    protected List<String> tabComplete(@NotNull String[] args) {
        if (args.length == 1) {
            List<String> l = Arrays.asList("set", "remove", "cancel", "help");
            if (Utils.isAuthorized(executor, "admin")) l.add("bypass");
            return StringUtil.copyPartialMatches(args[0], l, new ArrayList<>());
        }
        return null;
    }
tall dragon
crude hound
tardy delta
#

i want to add "bypass" to the tabcomplete options if the user has the admin permission

crude hound
#

but the block change from the state decided from my algorithm

tall dragon
#

then make it a map

crude hound
#

k

tardy delta
tall dragon
#

have Location as key and Material as value

tardy delta
#

lets use the arrayList constructor 🥺

#

or Stream.of("a", "b", "c").collect(Collectors.toList()

ivory sleet
#

Lists.newArrayList()

tardy delta
#

i dont even know why to use that class

ivory sleet
#

it is actually unfortunate that Java does not expose the type of the fixed sized list

tardy delta
#

is it optimized or something

ivory sleet
#

no but it takes a vararg E and chops it into an arraylist which it returns

tardy delta
#

so its better than the things i wrote?

ivory sleet
#

yes

#

Streams are slower in this case

tardy delta
#

so like this?

ivory sleet
#

no

#

just

#

Lists.newArrayList("a","b")

tardy delta
#

ah can remove that

#

thanks

ivory sleet
#

no worries

maiden briar
#
@EventHandler
    public void onPlayerSpawn(PlayerSpawnLocationEvent e)
    {
        if(arena.getState() == Arena.ArenaState.WAITING && !arena.getSettings().isPlayable() && DogLeader.getLocation(DogLeader.DogLeaderLocation.LOBBY) != null)
            e.setSpawnLocation(DogLeader.getLocation(DogLeader.DogLeaderLocation.LOBBY));
    }```
I join at the correct location, but 1 second later I get teleported to world spawn
#

Note: If I join the server for the second time, it just works

#

And scoreboard issue: My health is always 0

#

If I take damage it will be set correctly forever, but it starts with 0

ancient plank
#

descriptive

opal juniper
#

are you in your main class?

#

Then you need to use something like di

#

?di

undone axleBOT
opal juniper
#

and pass your plugin instance thru the constructor

crude hound
#

I will see

tardy delta
muted idol
#

could anyone link me the maven repo for the PagedGUI repo?

celest nacelle
#

How do I set the nametag of a player?

tardy delta
#

hmm if a player doesnt have permisson to execute a command, is there a tabcomplete?

#

i gues no

eternal oxide
#

no

tardy delta
#

oki

maiden briar
celest nacelle
tardy delta
#

the name above their head?

celest nacelle
#

yes

tardy delta
#

player.setDisplayName(...)

tall dragon
#

that won't set the tag above their head

tardy delta
#

thats for chat..

#

F

#

you need packets

#

or scoreboard

quaint mantle
#

basically..

Make a Constructor like

private final Plugin plugin;

public TestCommand(Plugin plugin) {
     this.plugin = plugin;
}```

then you can do

```java
this.plugin.getConfig();```
tardy delta
#

Plugin.getPlugin(Plugin.class).getConfig() 😳

quaint mantle
tardy delta
#

mwoa yea

quaint mantle
#

good practice 👀

crude hound
#

oh no he's offline

quiet osprey
#

Wait @maiden briar you’re on newdale and I just randomly found you here xD

maiden briar
#

Cool

#

I still have a problem with scoreboards: If I add an health objective it does show me 0, and if you take damage it shows the correct health. How is this possible? I tried player.setHealth(player.getHealth() - 0.001); but that does nothing

celest nacelle
muted idol
#

Does anybody know a good external API for creating inventorys?

maiden briar
#

Also updating the scoreboard costs so much tps

tardy delta
# celest nacelle What packets exactly

found this

PacketPlayOutPlayerInfo with action REMOVE_PLAYER
PacketPlayOutPlayerInfo with action ADD_PLAYER with a different name (perhaps through reflecting on the packet data)
PacketPlayOutDestroyEntity to all players except you.
PacketPlayOutNamedEntitySpawn to all players except you.
ancient plank
#

its been 10 minutes :/

eternal night
#

Doesn't spigot even have a wiki entry

#

With like common Interface libraries

tardy delta
muted idol
tardy delta
#

?paste

undone axleBOT
tardy delta
#

won't this return the home names?

return new HashSet<>(homesFile.getConfigurationSection("homes." + p.getUniqueId()).getKeys(false));
quaint mantle
tardy delta
#

well it doesnt return anything

#

lemme check again

paper viper
#

storing data in yaml isnt really a good idea. i think json in general would be better

#

but its fine ig cause of how bukkit handles things... sadly

tardy delta
#

i dunno know json good enough

paper viper
#

its just one line lmao

tardy delta
#

i dunno 🥺

steady rapids
#

anyone knows how to save to a file a list of ItemStack? i tried using gson but i get this error:java.lang.AssertionError: java.lang.NoSuchFieldException: ARMOR

paper viper
#

Location loc = gson.fromJson(Files,newBufferedReader(Path.of("C://config.json")), Location.class);

eternal oxide
#

saving ItemStacks to Json is simple. reloading them you will have issues with ItemData

tardy delta
#

oh

steady rapids
eternal oxide
#

Bukkit serialization already handles ItemStacks and Location fine

steady rapids
#

oke i'll re-try with it xd u know any plugin that uses it? I didnt really understand how it works

tardy delta
#

also to check whether or not a player has a home can i just check return homesFile.isConfigurationSection("homes." + player.getUniqueId();).

eternal oxide
#

yes

#

better to use .contains though

#

it may not always be a ConfigurationSection you need to test

tardy delta
#

ah then i can leave it like i have

#

but does .contains checks if there are keys under it?

eternal oxide
#

no

#

it only checks teh path exists

tardy delta
#

so this is good?

private boolean hasHome(Player p) {
        return homesFile.contains("homes." + p.getUniqueId()) &&
                homesFile.getConfigurationSection("homes." + p.getUniqueId()).getKeys(false).size() > 0;
    }
eternal oxide
#

you should not have empty nodes though

#

no

tardy delta
#

yea but when i remove a home i get this

eternal oxide
#

if you don;t have anything under that entry it will be null, so getKeys will be operating on a null

#

getConfigurationSection will probably return null on that

#

as its not a map

tardy delta
#

so how should i do it?

#

something with contains

eternal oxide
#

check contains, tells you if it exists

#

isConfigurationSection tells you if it has a contents map

#

if both are true getConfigurationSection. getKeys etc

#

isConfig may already do the contains check but it can;t hurt to do both

tardy delta
eternal oxide
#

yep, you can just do isConfigurationSection

#

then get and getkeys

tardy delta
#

oki thank you

tardy delta
#

is there a way to override worldguard so i can leave horses?

#

i did this

@EventHandler(priority = EventPriority.HIGHEST)
    public void onEntityInteract(PlayerInteractEntityEvent event) {
        if (event.getRightClicked() instanceof Horse) event.setCancelled(false); // override worldguard
    }
eternal oxide
#

are you sure that is the event WG is cancelling?

tardy delta
#

hmm its only horses

eternal oxide
#

k

tardy delta
#

i'll try with that

#

if i havent already

solar sable
#

?paste

undone axleBOT
neon nymph
#

Change "Plugin" to "p" and remove the ")" beside it

solar sable
tardy delta
#

worldguard uses their own UseEntityEvent and it is not implementing Cancellable

#

sad

next stratus
#

How do you setup buildtools to do NMS stuff on windows?

unreal quartz
#

wut

upbeat fog
#

I need someone to help me fix a few issues and help me progress with my plugin. Dm if you willing to help me.

next stratus
#

I wanna write some code using nms but I can't work out how to set it all up.

unreal quartz
#

run it

#

and t will be in maven local

next stratus
#

And how do I add it to my gradle?

unreal quartz
#

same as you do with spgiot, but spigot as the artifact id instead

#

and with mavenLocal() as ar eoi

#

a repo

next stratus
#

I have mavenLocal() at the top already

upbeat fog
#

Can someone help me with my plugin?

unreal quartz
#

no

quaint mantle
#

@ivory sleet i have this problem

#

when i try to open the project

tardy delta
#

no .zip

quaint mantle
#

what .zip

solar sable
upbeat fog
#

Can someone help me with my plugin?

quaint mantle
upbeat fog
#

is it cool if we hop into a call? It would be easier

quaint mantle
#

ask here

solar sable
quaint mantle
#

The docs are your gods

#

instead of cancelling it you just set the current to 0

upbeat fog
#

long story short

#

it worked before

#

now its not working

solar sable
#

just type here its easier for us to understand

upbeat fog
#

no error

#

when I try to add a different enchantment lvl, its doesnt set it

#

so yeah

#

no clue what went wrong

solar sable
#

to make it short, just type it man

upbeat fog
#

I just did lmfaoo

quaint mantle
#

What's an event for disabling the Eye of Ender?

wary harness
#

when we are areound custom enchant I am looking a way to make custom enchant

solar sable
upbeat fog
quaint mantle
#

?jd

wary harness
#

with all features of efficiency

quaint mantle
#

listen to playerinteractevent

solar sable
#

.getName ?

quaint mantle
#

if the interacted block is a button, lever, or they placed redstone current you can send the message

upbeat fog
#

so yeah, thats why I asked to hop into a call so I show it to you, because just looking at the code I dont think you could solve it.

#

Ill just send screenshots

upbeat fog
#

this is the sharpness

#

any ideas what went wrong? again, it was working before I added the array list and tried to use that to display a custom enchanting lvl

quaint mantle
#

pistonevent

#

cancel it

upbeat fog
#

@quaint mantle can you help me with my customenchant?

quaint mantle
#

i would if i could

upbeat fog
#

wym, you dont know customenchant stuff?

quaint mantle
#

no?

#

do you have a custom event setup correctly

#

nah i cant help with that

#

it probably syncs by itself

#

idk

#

try it

#

blockpistonevent is a base event

#

listen to PistonExtend instead

#

ye

#

i have this

    public void setupManager() {
        try {
            version = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
        } catch (Exception e) {
            getLogger().info("Unable to detect version. plugin disabling");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }
        switch (version) {
            case "v1_8_R3":
                hologramManager = new HologramManager(this);
                break;
            case "v1_9_R2":
                hologramManager = new com.trexmine.trexholograms.v1_9_R2.HologramManager(this);
                break;
                
            case "v1_12_R1":
                hologramManager = new com.trexmine.trexholograms.v1_12_R1.HologramManager(this);
                break;
            case "v1_16_R3":
                hologramManager = new com.trexmine.trexholograms.v1_16_R3.HologramManager(this);
                break;
            case "v1_17_R1":
                hologramManager = new com.trexmine.trexholograms.v1_17_R1.HologramManager(this);
                break;
            default:
                getLogger().info("Your current version (" + version + ") is not supported!");
                getServer().getPluginManager().disablePlugin(this);
                return;
        }
        getLogger().info("Detected version " + version + ". plugin enabling!");

    }

but there is a problem when i enable the plugin
https://cdn.discordapp.com/attachments/873960964125503498/891728285619331172/unknown.png

golden turret
#

use maven/gradle modules

quaint mantle
#
@Override
public void onEnable() {
    Logger logger = Logger.getLogger("MyPlugin");

    try {
        FileHanler handler = new FileHander(new File(this.getDataFolder(), "pluginlog.log").getPath());
        logger.addHandler(handler);
        
        handler.setFormatter(new SimpleFormatter());
    }
    catch (SecurityException | IOException exception) {
        exception.printStackTrace();
        this.setEnabled(false);
        return;
    }
}

@thorn narwhal try this

#

modified that from a stack overflow post

quaint mantle
tardy delta
#

it seems like this is recognised as an configurationsection too

eternal oxide
#

then check getKeys

#

isEmpty

#

probably

tardy delta
#

or getKeys(false).size > 0

eternal oxide
#

either or

tardy delta
#

make an object of that class?

eternal oxide
#

?scheduling use the scheduler

undone axleBOT
shadow tide
#

I'm trying to use java's SerializationUtils but I can't find it, did they change what its called?

shadow tide
shadow tide
#

ye

young knoll
#

Well it isn't part of java itself

shadow tide
#

wut is it then?

quaint mantle
young knoll
young knoll
quaint mantle
golden turret
#

@quaint mantle

#

share with us

#

the

#

classes

quaint mantle
#

classes of what

shadow tide
quaint mantle
#

let me just remove the default

eternal oxide
#

depend on spigot not spigot-api and you'll have apache commons

shadow tide
#

ooooh

#

so I can just copy my server's spigot.jar and change my dependencies to that?

eternal oxide
#

are you using maven?

shadow tide
#

no

eternal oxide
#

then probably

shadow tide
#

I should be

#

tho

#

whats the difference with maven?

golden turret
#

gradle >>>>

tardy delta
#

so json is faster than yml?

gaunt saffron
#

okay i have .java file (source code) for a plugin for some weirdass minecraft jar (the owner is busy with life)
how can i import? it or well, compile and edit, i dont have idea if there is any docs

any idea what i can do?
im using intellij

like, where do i start? i can post the code here...

solar sable
quaint mantle
tardy delta
#

how would this look in json?

homes:
  9558961c-bc19-4820-9f75-5d486448c2d5:
    spawn:
      playerName: FourteenBrush
      location:
        ==: org.bukkit.Location
        world: Generated World
        x: -208.2980065075412
        y: 125.0
        z: 671.6890372002864
        pitch: 21.804726
        yaw: 321.21497
eternal oxide
#

zero point is switching from yaml to json

tardy delta
#

ah found a converter

solar sable
tardy delta
#

can i parse from json to a location object?

shadow tide
#

I'm making my own PeristantDataType and I wanted my own class to be the complex type, it is forcing me to remove the @Override, is it ok if I do this?

#
public byte[] toPrimitive(Loc complex, PersistentDataAdapterContext context) {
        return SerializationUtils.serialize((complex));
    }```
young knoll
#

You should not need to remove @override

shadow tide
#

The method toPrimitive(Loc, PersistentDataAdapterContext) of type PersistentDataType_LOCATION must override or implement a supertype method

young knoll
#

Share the class

shadow tide
young knoll
#

Loc != Location

shadow tide
#

?

#

Loc is the name of my class

young knoll
#

Then why does your persistent data type use Location

tardy delta
#

what's this

java.util.ConcurrentModificationException: null
    at java.util.ArrayList.forEach(Unknown Source) ~[?:1.8.0_301]
quaint mantle
tardy delta
#

dont really find it

shadow tide
#

guess I was just being dumb lol

young knoll
tardy delta
#
Home.getBuffer().forEach(home -> home.savePlayerHomes(home.getOwner())); // todo
young knoll
#

And what does savePlayerHomes do

tardy delta
#

saves them to yml

#

anyways i'll took at it tomorrow

young knoll
#

Does it try to remove anything from Home.getBuffer

tardy delta
#

lets take a nap xd

#

no

neon nymph
acoustic pendant
#

is it posible to add the counter of mined blocks to a menu and unlock things while you reach a amount of blocks?
(don't tell me how, just if it is posible)
Ty 😄

neon nymph
#

for (Home home : home.getBuffer()) home.savePlayerHomes(home.getOwner());

solar sable
#

hey coral can you help me?

acoustic pendant
neon nymph
#

Whats up

solar sable
neon nymph
#

The error says variable team is null

#

The player doesn't have a team yet

solar sable
#

ouh

#

how to fix that?

neon nymph
#

Team.addPlayer(player); Try that, but javadoc says it's deprecated

solar sable
#

add that to where?

#

the main class?

young knoll
#

Probably wants a string

neon nymph
#

Maybe in an onPlayerJoinEvent

solar sable
#

ah okay

#

i have that

#

oh its null

#

its crossed out