#help-development

1 messages · Page 2290 of 1

noble lantern
#

idc about pings, reminds me this servers exists ngl lmao

#

i forget about it if i dont go in it for like 2 days

#

and before you know it its been 3 weeks

true oak
#

Hi guys.
I'm creating an alpine docker image that runs, amongst other things, buildtools to build spigot 1.12.
During buildtools execution I have 2 issues:

  • java.lang.RuntimeException: Error running command, return status !=0: [sh, applyPatches.sh]
    => I saw the advice in https://www.spigotmc.org/wiki/buildtools/#issues-and-common-concerns
    Sadly adding those elements did not solve my issue :
    - Dockerfile
    ```
    SHELL ["/bin/bash", "-c"]

    Runs entrypoint script

    ENTRYPOINT ["/bin/bash", "-c", "/root/entrypoint.sh"]
       - entrypoint.sh
         ```
    export SHELL="/bin/bash"
    
  • The execution is very slow. I may have badly configured docker but I have no idea how to increase buildtools execution speed.
noble lantern
#

Do you run this on ptero

#

you would have better Luck IMO

#

having just core libs on the docker image

#

like gradle, maven, java

#

and have a seperate install script that runs all this

Doing it in docker is a little aids just for debugging wise

#

especially certain alpine images

#

cause some are like 300mb

quartz basalt
#

how can i create a non-static library? ive seen vault and they use public methods with a variable Economy which controls the api, how is it possible to do something like that?

undone axleBOT
noble lantern
#

Use di ^

quartz basalt
#

no..

#

i want to make my own library

ivory sleet
#

ServicesManager

noble lantern
#

Yes so you make getters for your API in your main class for anything you need

Make a abstraction API where users hook into it via class inheritence

Or services manager

#

ServicesManager is what vault uses

quartz basalt
#

ok ty

noble lantern
#

im not rly sure if theres much of a performance difference

#

between al of em tho

quartz basalt
#

i just want it to look cleaner instead of having to do Class.<method> instead you do what vault does

noble lantern
#

okay then defo do ServicesManager if you wanna copy that

ivory sleet
#

Literally services manager

#

But thats just a static map<class,object> at most

quartz basalt
#

do i need to add extra code to my library or is that the person using the library that needs to do that

noble lantern
#

Me personally i dont like that method

#

I prefer class hierechy or just a getter for plugins main class instance

ivory sleet
quartz basalt
#

cant rly find anything online

noble lantern
#

instead of running it through services manager?

true oak
# noble lantern cause some are like 300mb

I build it on a volume (like a mount) so the size is not an issue.
I use zulu8-ca-jdk-headless (like suggested in the buildtools wiki).
I can't do it in ptero if I want to fit my needs

ivory sleet
#

Yes but that’s irrelevant

lethal python
#

i haven't updated my plugin to 1.19 yet and i have never updated a plugin before, is it difficult or easy

ivory sleet
#

The point of services manager is to provide a loosely coupled way deploy an implementation to an abstraction

noble lantern
#

ohh its for abstractions

#

okay i see

#

thats why it never appealed to me

ivory sleet
#

Yeah, but well else the classic getter works fine

noble lantern
#

My Apis are instance based so i just extend on the JavaPlugin to the plugins main class

ivory sleet
#

Ah ye

noble lantern
#

eg Plugin extends BurchAPI extends JavaPlugin

sterile token
#

Why vault api doesnt have examples lmao i really hate because i need to lost minutes of life just reading their javadoc

noble lantern
#

and BurchAPI controls the entire thing

sterile token
#

😡

vast raven
#

To make an armorstand rotating on itself I need to put a code inside a Bukkit runnable timer that changes the yaw and the pitch of the armorstand and teleports it right?

noble lantern
#

and provides to Plugin

noble lantern
#

ArmorStand has rotate methods?

vast raven
#

y

noble lantern
#

ah no

#

so yeah just change yaw

sterile token
#

burch any idea?

vast raven
#

I never used pitch and yaw, I hate the "location math"

sterile token
#

wheere

noble lantern
#

pitch is like looking up and down

sterile token
#

i read full ghb and not find anything only their javadocs url

vast raven
noble lantern
vast raven
#

Thanks a lot, I'll give a try.

noble lantern
#

and the yaw is left to right

quartz basalt
#

you dont need to read the docs tbh its extremely simple and common sense just instance.getBalance for example

sterile token
#

okay? i ill see that i never seen it before

#

thanks man

noble lantern
oblique wigeon
#

is there a way to make the ender dragon fly faster? I tried ajusting movement speed and fly speed attributes, but both seem to do nothing

lethal python
#

if i am writing my plugin in intellij how do i update it to 1.19

quartz basalt
#

yeah that youd need the github for

noble lantern
#

i just search"Vault api spigot" and its first google result

quartz basalt
#

tbh it is quite confusing vault has 2 githubs 1 for the plugin and 1 for the api which is weird

noble lantern
#

yeah thats why i always tell google exactly what i want

quaint mantle
noble lantern
#

and dont gnerify

sterile token
#

WHY NAME? LMAO

vast raven
quartz basalt
sterile token
quartz basalt
#

oops

#

wrong person

noble lantern
quartz basalt
noble lantern
vast raven
sterile token
noble lantern
#

Vault uses OfflinePlayer now

lethal python
#

hey guys how do i update my plugin to 1.19 o_0

quartz basalt
lethal python
#

no i don't think so

vast raven
# quartz basalt deprecated

about deprecated, can't actually find a way to put an helmet on armor stand, the only way is using a deprecated method and suppress the error.

noble lantern
#

in maven or gradle

lethal python
#

how to do :D

quartz basalt
#

then you probably dont need to update anything at all

noble lantern
#

and compile/check for errors

sterile token
quartz basalt
#

*.getEquipment()

noble lantern
#

i dont have a 1.19 maven or gradle import handy

quartz basalt
#

thinking of players :p

noble lantern
#

would have to google it

vast raven
lethal python
#

here it

#

my maven

quartz basalt
#

wow nice maven

lethal python
#

where click what are the x y

noble lantern
#

You edit it in the pom.xml

#

its not a button

vast raven
noble lantern
#

you need to find the 1.19 import somewhere online

noble lantern
#

show the code if you still have it

lethal python
#

do 1.19 plugins work on 1.19.1 server

#

is 1.19.1 out yet

noble lantern
#

yes and idk

quartz basalt
#

it should

vast raven
quartz basalt
#

no reason why it wouldnt

vast raven
#

👍

noble lantern
#

however 1.19 may not work on 1.18, 1.17, 1.16 etc

#

it might

#

just depends how you used the api & java version compiled against

lethal python
#

so do i literally just change the line in my pom.xml to <version>1.19-R0.1-SNAPSHOT</version>

noble lantern
#

yes

quartz basalt
#

yes

lethal python
#

no downloady

quartz basalt
#

and api-version if you are using that

noble lantern
#

yeah you do downloa

#

click the amven refresh button

#

once you change it

lethal python
#

wowe EZ

noble lantern
vast raven
lethal python
#

what

noble lantern
#

literally anyone who wants to compile something in 200ms

lethal python
#

im using maven

noble lantern
#

gradle on top

#

unless you need nms

lethal python
#

where is gradle

noble lantern
#

stick with maven for now

#

unless someone here wants to teach you gradle rn

quartz basalt
vast raven
lethal python
#

maven

noble lantern
#

my gradle file is small asf

noble lantern
#

?paste

quartz basalt
#

what is easier to understand <version>oseoeieol</version> or the gradle version forgot what it is

undone axleBOT
noble lantern
lethal python
quartz basalt
#

yeah that

noble lantern
#

groupId:ArtifactId:Version

vast raven
noble lantern
#

you can seperate it

#

groupId: "" artifactId: "" version: ""

quartz basalt
#

more complicated to read and use

lethal python
#

when i first saw pom.xml i thought it said porn 😎

noble lantern
quartz basalt
#

i dont think ive ever heard that 1

noble lantern
#

but its nicer if you want things done quicker without as much configuration

#

in order to add in shading in maven the process is rather complex

noble lantern
#

in gradle you just add shadowJar task

lethal python
#

shadow java

vast raven
#

You will be a good helper for one of my old project.

#

That somehow gives me a strange error.

noble lantern
#

not to mention, importing files in gradle is like

#

woooorlds easier

#

in maven you need to run a command first

#

then import

#

in gradle you just make a directory and: implementation fileTree(include: ['*.jar'], dir: 'libs')

vast raven
noble lantern
#

??

vast raven
#

Like

#

if you open a wiki

noble lantern
#

they both can use maven central

#

oh?

quartz basalt
#

the most important thing is that gradle has a cooler icon

quartz basalt
#

tf

lethal python
#

ok i changed the line in my porn.xml and clicked the arrow wheel button now it is resolve dependencies

quartz basalt
#

elephant

noble lantern
#

gradle rat

#

oh

#

its a elephant?

vast raven
lethal python
#

a elephant

quartz basalt
#

yes

#

lmao

noble lantern
#

shit looks like a rat to me

vast raven
#

Sometimes there is only the maven import

noble lantern
noble lantern
lethal python
noble lantern
#

you can convert ANY maven dependency import into gradle

#

throw any import at me, i will convert it

#

oh shit

quartz basalt
#

how in the world do u

lethal python
#

please help my dependency is not resolving

noble lantern
#

it is a elephant

quartz basalt
#

think thats a rat

lethal python
#

!!!!!!!!!!!!!!!!1111111111111111111111111111111

noble lantern
#

i never opened theyre website

vast raven
noble lantern
#

im always viewing a super small icon

#

like

#

looks like a rat to me

quartz basalt
#

still looks like an elephant

noble lantern
#

im prolly blind

quartz basalt
#

probably tbh

vast raven
noble lantern
#

bad eyesight in my left eye

quartz basalt
#

that explains it

sterile token
#

how do i change intellig view distance?

serene onyx
quartz basalt
#

tf is intellij view distance

lethal python
quartz basalt
noble lantern
#

it does lmfaaao

sterile token
lethal python
#

how do i fix thid problem

noble lantern
lethal python
#

resolving forever

noble lantern
#

give it time

lethal python
#

AGES

tall dragon
#

give it MORE time!

lethal python
#

:l

#

the bar is n't moving

tall dragon
#

real chads use ant

lethal python
#

the bar is ant moving

quartz basalt
lethal python
#

i wil do that

#

do i that button

vast raven
quartz basalt
lethal python
#

the bar is moving

#

it has stopped moving it is done now

#

:D lets see if my plugin work

#

s

#

today i went on a walk with my mum and we saw a cat and it was nice to us instead of running away

#

build suces thanks buoys for your help

obsidian roost
#

Hey, is there a way in the spigot API to make mobs like zombies attack each other or is NMS needed?

tranquil dome
#

What event can I use to check if an item left a players inventory? I want to check if an enderpearl was thrown (thus leaves the inventory) and then get the inventory slot it was taken from.

daring maple
#

Would assume this would be part of the InventoryInteractEvent

zenith gate
#

what's a good way of getting worn armor?

obsidian roost
#

How does Entity#setTarget() work? I can't get my hostile mobs to attack eachother

vocal cloud
#

Afaik setTarget can only target players.

#

NMS is your "friend" if you want to change that behavior

obsidian roost
#

ah i see, thanks

opal herald
#

how do i check if a player takes damage?

shell wraith
#

What are peoples thoughts on SlimeWorldManager

#

is it worth it 🤔

vocal cloud
#

Depends on how much time it saves you

lunar python
#

I've been trying to make a 1.8.8 PaperSpigot fork, but when running applyPatches.sh, I get a merge conflict on pom.xml, at patch 0001 Pom Changes
Does anyone know how to fix this?

#

Logs:

$ ./applyPatches.sh
Rebuilding Forked projects....

Applying SpigotMC patches to CraftBukkit and Bukkit

HEAD is now at 6a039faf #745: Expose more information about advancements
Resetting Spigot-API to Bukkit...
HEAD is now at 6a039faf #745: Expose more information about advancements
  Applying patches to Spigot-API...
Applying: POM Changes
Using index info to reconstruct a base tree...
M       pom.xml
Falling back to patching base and 3-way merge...
Auto-merging pom.xml
CONFLICT (content): Merge conflict in pom.xml
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch' to see the failed patch
Patch failed at 0001 POM Changes
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
  Something did not apply cleanly to Spigot-API.
  Please review above details and finish the apply then
  save the changes with rebuildPatches.sh
delicate lynx
#

1.8.8 :(

vocal cloud
#

1.8.8
Has issue
Roll tide

lunar python
#

this is a git issue more than a 1.8 issue

zenith gate
#

how do i get a runnables ID to stop it outside the runnable?

dusk flicker
#

?1.8

undone axleBOT
lunar python
#

ok cool

dusk flicker
#

try running buildtools in another dir

#

Like, move the bt jar & ur script into another directory and try it

lunar python
dusk flicker
#

hmm

#

buildtools jar updated?

lunar python
#

yeah

#

i used the latest stable version

dusk flicker
#

When you tried it in other directories you are only moving the jar + script, nothing else right?

lunar python
#

patches work fine for spigot, it's just paper's patches that don't work

dusk flicker
#

oh

buoyant viper
#

well sir this is a spigot

dusk flicker
#

?paperdev

undone axleBOT
#

Make sure to ask in the appropriate server concerning development towards different JAR types such as PaperMC. (Tip: Google them!)

dusk flicker
#

tip: if you are working with paper you should use their build system

lunar python
#

the paper forums just told me that 1.8 is old

dusk flicker
#

they aint wrong

buoyant viper
#

i mean yeah

lunar python
#

i mean yeah but a lot of servers are still on 1.8

dusk flicker
#

it is Minecraft 1.8.8 is 6 years, 11 months, and 26 days old today.

#

6% are on 1.8 (bstats)

lunar python
#

i still make tf2 mods, and the last major update was released 1732 days ago, and counting

dusk flicker
#

well that makes sense, you're running the latest major update

#

you're running 1.8 which is what, at LEAST 10 major updates behind?

lunar python
#

yeah but it doesn't mean because something is old that we can't mod it

dusk flicker
#

well yeah

#

but you won't get support fori t

lunar python
#

but i think the error comes from my inexperience with git

dusk flicker
#

You won't get support from most here due to it not running latest; you're also attempting to use Paper patches with buildtools for some reason?

#

Rephrased the last part of that as it wasn't 100% right

#

All I will say, is you should be using Paper's system if you are using their patches, as I doubt buildtools and Paper patches are comptable right out of the box

lunar python
lunar python
raw sky
#

anyone got a good forum/example on how to save a inventory to a database?

tender pond
#

Hey guys! I'm just wondering if anyone knows how I can change what a type of sound is? For example... the default 'player.playSound()' always plays it at a super loud volume and the only way to change it is by turning down Master Volume in settings, whereas the '/playsound' command in-game has options to pick what type of sound it is, for example if I pick 'music' I can turn the Music option up and down to change the volume. Is this possible on the Spigot API?

delicate lynx
#

playSound() let's you specify a volume

tender pond
#

But that volume has 0 use if you're applying the sound directly to the player, pretty sure that only has a function if you're playing to a location

final star
#

someone?

zenith gate
#

is there no Player.isJumping()?

#

do i got to do some stuff with get location??

vocal cloud
#

That's the best way to do it

zenith gate
#

but that will interfere with flying...

vocal cloud
#

?jd-s

undone axleBOT
zenith gate
#

so i cant...

vocal cloud
zenith gate
#

mhm

#

how do I only make this trigger once?
when the player keeps sprinting it keeps triggering, i know its in a player move event but there should be fix

 new BukkitRunnable() {
            @Override
            public void run() {
                if (event.getPlayer().isSprinting()) {
                    Stamina.removeStamina(player, 0.07);
                    if (Stamina.getStamina(player) <= 1) {
                        player.sendMessage(ChatColor.RED + "You are out of stamina!");
                        event.getPlayer().setSprinting(false);
                        Bukkit.getScheduler().cancelTask(this.getTaskId());

                    }
                }else{
                    Bukkit.getScheduler().cancelTask(this.getTaskId());
                }

            }
            }.runTaskTimer(Wired.getPlugin(), 0, 20);
    }
vocal cloud
#

When it first triggers you need to add their uuid to a set if it's in the set ignore.

#

Then when they're not sprinting remove from set

zenith gate
#

ill just use a hashmap

vocal cloud
#

Why a hashmap when a set works just fine

zenith gate
#

Cause i know how to use them..

#

never heard of a set before...

vocal cloud
#

HashSet. It's like a HashMap but it only stores a key with no value.

remote yoke
#

Hey all.

I'm noticing there no way afaik to know when a vehicle takes damage from the void. It neither triggers EntityDamageEvent nor VehicleDamageEvent. Neither does VehicleDestroyEvent trigger on any of this

Is there any way to track vehicles taking damage from falling in the void (or getting destroyed)?

ornate patio
#

How can I reset the world (remove the overworld, nether, and end and generate a new seed)

vocal cloud
#

That sounds like a bug

inland axle
#

remove any seed in server.properties

#

let it regen

ornate patio
vocal cloud
#

Probably not since those files will be in use.

ornate patio
#

Yeah

#

I’m trying to reset the world programmatically

inland axle
#

why

ornate patio
#

because I want to to be a feature of my plugin 🧠

inland axle
#

just add rm -r world to the start script hehe

ornate patio
#

within a plugin

inland axle
#

I suppose multiverse may be able to do that

ornate patio
#

hmm

#

ok maybe it’s not worth it lmao

remote yoke
golden turret
#

how do i get the speed of something using the Vector?

#

I read that the Entity#getVelocity().length() does not work

quaint mantle
#

You do realize that the Vector is the speed

golden turret
quaint mantle
#

I dont know

buoyant viper
#

is LivingEntity#getTargetBlock the equivalent of a rayTraceBlock call?

#

or well, can i use it the same way

worldly ingot
#

Effectively yes, though it won't consider bounding boxes well enough

#

There's a more specific getTargetBlock() iirc that does

#

Yeah. getTargetBlockExact()

buoyant viper
#

yeah

worldly ingot
#

That one is more like a ray trace blocks

buoyant viper
#

i was actually looking at that one and just forgot the exact part

chrome ferry
small current
#

@ornate patio try unloading the world
(Make sure there is no player in the world and it can be unloaded)
Deleting the file and then loading and generating it

oblique wigeon
#

is there a way i can control the ender dragon's movement? i'm trying to make it faster, perhaps add some new behavior, is there any way I can do this?

oblique wigeon
lost matrix
oblique wigeon
oblique wigeon
deft rain
#

Bro is there golden crates ?

#

For 1.18.2

vast raven
#

How to add a yaw to a location?

sage merlin
#

the screenshot shows it all, heres the stack trace and also NullCheck is check Cannot invoke "java.lang.Boolean.booleanValue()" because "NullCheck" is null
at com.plugin.particles.particlesdesign.ConeClass.onDamage(ConeClass.java:73) ~[?:?]

reef lagoon
#

Alpaca is alpaca

brave sparrow
#

It’s messing around with the server internals to do things unsupported by the API

vague berry
#

So I got an issue, I made a merchant.
And I spawn a villager with custom trades, the trades work,
but for some reason when I open the village it immediately closes the menu.


                Merchant villager = (Merchant) p.getWorld().spawnEntity(loc, EntityType.VILLAGER);
                List<MerchantRecipe> recipes = new ArrayList<>();
                MerchantRecipe bread = new MerchantRecipe(new ItemStack(Material.BREAD, 3), 10);
                bread.addIngredient(new ItemStack(Material.EMERALD, 10));
                recipes.add(bread);
                MerchantRecipe tntStick = new MerchantRecipe(ItemManager.CreeperGun, 10);
                tntStick.addIngredient(ItemManager.Wand1);
                recipes.add(tntStick);
                villager.setRecipes(recipes);

        }```
buoyant viper
#

trying to make a basic Sit plugin just for fun... how should i go about making the player ride an entity? use bukkit api to spawn say an arrow into world and add passenger? but then how will i handle destroying the arrow when player is done sitting

#

i also considered packets so that the server (and me) wont necessarily have to manage the arrow but idk if it could break stuff

peak depot
noble lantern
#

or dynamic sitting

buoyant viper
noble lantern
#

in that case i assume you have like a /setchair command right

buoyant viper
#

/sit and then it raycasts to target block

noble lantern
#

ah so its dynamic

buoyant viper
#

if its a stair it spawns arrow and adds passenger

noble lantern
#

in that case youde just store the arrow, and when the players jumps/shifts kill the arrow

As well as on server stop and player disconnect

#

shouldnt need to worry to much about arrows

#

cause MC clears them by default after x minutes

#

oh 60 seconds actually

buoyant viper
#

i was thinking VehicleExitEvent but obviously an arrow isnt a vehicle so... what other event would call for leave?

#

ToggleSneak?

noble lantern
#

lemme look at that event rq

#

yeah wouldnt call

#

is the event called ToggleSneak?

buoyant viper
#

PlayerToggleSneakEvent i think so

noble lantern
#

yee

#

that should work

#

and then for jumping

buoyant viper
#

why jump

#

🤔

noble lantern
#

when you jump on a mounted pig you dismount right

#

or nah

#

cant remember

buoyant viper
#

not that i recall

noble lantern
#

alr then should just handle sneak, player leave and server shutdown

buoyant viper
#

hm

noble lantern
#

I cant remember but

#

Are players even able to dismount after getting used in addPassanger?

#

if they dont sneak event might not even fire tbh

#

and might need packets for when player send sneak packet to process the dismount

#

idk exactly how addPassanger handles that though

#

oh hey

#

look into that

#

@buoyant viper

#

and from there you can just kill the arrow via getDismounted().kill()

#

also suggestion

Make it so when you shift right click on stairs with an empty hand it mounts instead of /sit 😛

charred blaze
#

java.lang.NullPointerException: null
plugin.config.set(member.getId(), true);

eternal oxide
#

member is null

charred blaze
eternal oxide
#

unless it actually is a field for config

charred blaze
eternal oxide
#

ah bungee

charred blaze
charred blaze
deft rain
#

hello i need help whit goldencrates is it for 1.18.2 can someone help me pls

ivory sleet
#

This is still not the place to discuss this @sweet pike

quaint mantle
#

hello so i was wondering how can i make a fire ball shooter gun But with recipe .

#

I tried to find how to but I couldn't find tutorial with recipes

earnest forum
#

how do i get the inventory name from InventoryClickEvent?

#

nvm

reef lagoon
#

Is it smart to store shit ton of data on the player's nbt

#

such as kills, balance, death, killstreak, private ender chests

#

or should I use a database

eternal oxide
#

Best not to store inventories on the player as they can be sizeable

reef lagoon
#

What do u mean

eternal oxide
#

Which bit did you not understand?

reef lagoon
#

"sizeable"

#

i'm always going to store 54 slots

eternal oxide
#

sizeable = big = large = huge

reef lagoon
#

ok lol

#

database then?

#

or yml

eternal oxide
#

each of those 54 slots can have an ItemStack, which could be a schulker box full with other items

ivory sleet
#

Database is always most scalable

#

So use that if you can

#

Else Ig a flatfile system works, but is far from ideal

#

Good as a mock implementation maybe?

reef lagoon
charred blaze
#

if (!plugin.config.getBoolean("" + member.getUser().getIdLong()) == true) {

charred blaze
#

im getting error on this now

#

java.lang.NullPointerException: null

eternal oxide
#

?paste teh actual code which is throwing the error

undone axleBOT
ivory sleet
#

config could be null, member could be null etc

charred blaze
#

i checked

ivory sleet
#

Make sure the receiver objects are not null

charred blaze
#

getid returns me a thing

#

member is not null

#

wdym in config can be null? like empty?

eternal oxide
#

either plugin, config, member or getUser() are null

ivory sleet
#

The variable can contain the value null

shadow zinc
#

I'm trying to halt redstone activity and then restore it

ivory sleet
#

And if it does, running a method on that variable results in an exceptiob

shadow zinc
#

but it is messing up the delays on repeaters and when its on redstone it sets a constant charge

charred blaze
#

member.getUser().getIdLong()

#

this prints

#

744118201809371136

#

this

shadow zinc
#

I'm not sure hold I the delay and dying time

ivory sleet
eternal oxide
#

is plugin null?

#

Your config can;t be null from what you've shown

#

plugin seems to be a field though

charred blaze
eternal oxide
#

That constructor definitely gets called?

charred blaze
#

idk?

eternal oxide
#

wher do you instance Listener?

charred blaze
#

it is in my JDA BUILDER

#

im making discord bot

eternal oxide
#

is your config field assigned before or after you create your Listener instance?

charred blaze
#

assigned?

#

idk what you mean

#

but i got this

#

and this

eternal oxide
earnest forum
#

how do i implement a custom persistent data type? I have a class which i have created that implements PersistentDataType and has all the correct methods implemented, how do i use this when setting something in pdc?

charred blaze
earnest forum
#

I tried CustomPersistentDataType.class

#

nvm i figured it out

eternal oxide
# charred blaze in main class

Then debug. your Method where you are getting the null, seperate it outjava sysout("is Plugin null: " + (plugin == null)); sysout("is config null: " +(plugin.config == null));

charred blaze
#

ok wait

eternal oxide
#

check teh javadoc. Is.load() @smoky tinsel?

charred blaze
#

lel 😄

eternal oxide
#

then your path to ticket.yml is wrong, or the file doesn;t exist

charred blaze
#

it exsists

#

where is bungee's javadocs?

eternal oxide
#

?jd

charred blaze
#

i cant click serach button

eternal oxide
#

broken for me too

#

JavaScript is disabled on your browser. it lies

ivory sleet
#

Been broken since ancient times now ):

eternal oxide
#

md needs a slap

charred blaze
#

wut

noble lantern
#

?jd-s

undone axleBOT
eternal oxide
#

on Bungee

noble lantern
#

ohh

charred blaze
#

hm 😄

#

lets ping

#

md5

eternal oxide
#

lol, bad time to do that

charred blaze
#

why

#

ill got banned?

eternal oxide
#

it's probably around 3 or 4 am his time?

charred blaze
#

uh

eternal oxide
#

maybe later. around 6

charred blaze
#

xd

quaint mantle
#

hello so i was wondering how can i make a fire ball shooter gun But with recipe .

noble lantern
#

mans leaves for days and then comes back with shit like this

quaint mantle
#

i will really appreciate it

charred blaze
#

wut

noble lantern
charred blaze
#

anyways

noble lantern
charred blaze
#

why does my config returns null?

quaint mantle
#

but idk how do i make it as recipe

eternal oxide
#

path is bad or file is not where you expect it to be

charred blaze
#

path is not bad. file is there actually

eternal oxide
#

is it valid yaml?

ivory sleet
quaint mantle
ivory sleet
#

😊

noble lantern
#

i have to find the guide

noble lantern
charred blaze
noble lantern
#

easiest way

quaint mantle
noble lantern
charred blaze
#

my file is empty lel

noble lantern
#

this is the hardest part to understand

noble lantern
#

3 characters are what represent the slots

#

spaces = air

#

Letters = material which you assign later as shown in code

noble lantern
#

iirc

shadow zinc
charred blaze
shadow zinc
#

so the general idea is to stop redstone activity and then restore it

noble lantern
#

are you trying to power a piston before i even read all that

shadow zinc
#

not anymore

#

its repeaters and dust

noble lantern
#

oh you were the one in here yesterday doing that huh

shadow zinc
#

im here everyday

tardy delta
quaint mantle
noble lantern
#

whats with the thread stuff?

shadow zinc
#

so basically its messing up the timings and extending a 1 tick pulse to greater

#

and sometimes it creates a constant pulse

noble lantern
#

also if your catching this error i feel like theres a bigger issue at play

shadow zinc
#

please

#

the issue at hand

quaint mantle
#

@EventHandler(priority=EventPriority.HIGH)
public void onPlayerUse(PlayerInteractEvent event){
Player p = event.getPlayer();

if(p.getItemInHand() == Material.BLAZE_POWDER){
    Fireball fire = p.getWorld().spawn(event.getPlayer().getLocation(), Fireball.class);
    fire.setShooter(p);
}
else if(p.getItemInHand() == Material.BLAZE_ROD){
    //Do whatever
}

}

ok i have done this how can i make it recipe ?

shadow zinc
#

can you format your code please

#

three `

#

then java

#

end with three `

noble lantern
#

u never said

shadow zinc
#

i did

shadow zinc
#

its really temperamental

charred blaze
shadow zinc
#

facts

noble lantern
#

its hard to maintain code when it isnt modularized

Timings as in spigot/paper timings i assume?

quaint mantle
#
public void onPlayerUse(PlayerInteractEvent event){
    Player p = event.getPlayer();
 
    if(p.getItemInHand() == Material.BLAZE_POWDER){
        Fireball fire = p.getWorld().spawn(event.getPlayer().getLocation(), Fireball.class);
        fire.setShooter(p);
    }
    else if(p.getItemInHand() == Material.BLAZE_ROD){
        //Do whatever
    }
}```

ok how can i make it recipe?
eternal oxide
noble lantern
sage merlin
#

heres a better picture

noble lantern
#

then from thre the result item should have some type of PDT identifier

noble lantern
#

that you from there check on your interact event, and then fire the fireball

shadow zinc
#

in the article?

noble lantern
shadow zinc
#

so is there another approach to this?

noble lantern
#

Honestly

noble lantern
#

that codes really hard to understand if im being honest you send, idk what all the thread stuff is for

shadow zinc
#

me?

noble lantern
#

yes

shadow zinc
#

what thread stuff?

eternal oxide
#

sec, its been a while since I used teh Bungee config

#

have to open my IDE

noble lantern
#

?paste

undone axleBOT
charred blaze
shadow zinc
#

im not doing thread stuff, please show me what you are referring to

noble lantern
sage merlin
sage merlin
shadow zinc
#

which part?

noble lantern
#

Not sure what any of the thread stuff does

shadow zinc
#

thats redstone power

#

not threading

noble lantern
#

idk why i read that as thread mb

Do you having the timings you mentioned earlier?

#

its 4am lmao

noble lantern
shadow zinc
#

all g, and no, basically its 1 tick and, 1 repeater, then I halt and restore and then there are two repeaters powered

#

idk how to measure timings

charred blaze
#

help

noble lantern
#

Why halt the server?

shadow zinc
#

because its my plugin

#

its the whole jazz you know

eternal oxide
#

ConfigurationProvider.getProvider(YamlConfiguration.class).load("");

#

Should give you a blank config

charred blaze
#

thx

shadow zinc
#

what?

sage merlin
#

i read that wrong

shadow zinc
#

any ideas, I know this is complicated

noble lantern
#

sry my discord keeps reloading itself

#

everytime i typeit reload and deleted my msgs smh

shadow zinc
#

bruh

#

bad

eternal oxide
#

I would do java config = ConfigurationProvider.getProvider(YamlConfiguration.class).load(data); if (config == null) ConfigurationProvider.getProvider(YamlConfiguration.class).load("");

shadow zinc
#

if I shared my screen briefly would it help you understand whats happening?

noble lantern
#

wait

noble lantern
#

where are you firing that for loop

#

and how

shadow zinc
#

I'll give you the whole code

#

?paste

undone axleBOT
shadow zinc
#

its a runnable

jovial sparrow
#

I'm making a plugin that adds in the magic mirror from terraria, does anyone have any ideas on what Particle and Effect I can use for making it look and sound the part?

noble lantern
shadow zinc
#

Depends

#

its user defined

#

mine is 20

noble lantern
#

when you want to implement server halting im like 99% redstone blocks lock when you set theyre power no? I could be wrong on that

#

just as long as no block updates happen nearby i would assume

#

that method seems rly heavy

charred blaze
#

now

eternal oxide
#

?paste some actual code then. Where you set config

undone axleBOT
charred blaze
#

config is null still

noble lantern
#

Holy crap

eternal oxide
#

too much guesswork

noble lantern
#

your mailing in that loop?

charred blaze
shadow zinc
#

yeah?

noble lantern
#

hollyyy

shadow zinc
#

once

#

its async too

charred blaze
eternal oxide
#

show me yoru onEnable

charred blaze
shadow zinc
#

i've profiled it, there isn't any performance issues

eternal oxide
#

?paste so its readable

undone axleBOT
shadow zinc
#

there was before, but I fixed that up a lot of versions ago

eternal oxide
#

that If data is not going to work

#

if (!(data == null)) is never going to be null

charred blaze
#

why

noble lantern
#

Its just hard to figure out the codebase for that method

So its extending for one tick longer than it needs to be halted for correct

charred blaze
#

what check should i use then?

noble lantern
#

or somtimes constant

eternal oxide
#

data is a File object. never null

#

none

charred blaze
eternal oxide
#
config = ConfigurationProvider.getProvider(YamlConfiguration.class).load(data);
if (config == null) ConfigurationProvider.getProvider(YamlConfiguration.class).load("");```
young knoll
#

!file.exists

eternal oxide
#

don;t even check it

#

if the config fails to load it config will be set null

noble lantern
eternal oxide
#

use the exact code I showed you. no extra if tests

shadow zinc
#

this redstone stuff seems to be more trouble than its worth

#

but I really want it to work

scarlet dirge
#

what event is called when a player joins the bungeecord server

tardy delta
#

if (!(data == null)) 😢

eternal oxide
#

like if (result() == true)

quaint mantle
#

ItemManger.init

i'm trying to do the itemanager but its shwoing red line

#

ItemManager.init();

scarlet dirge
eternal oxide
#

is init() a static method?

quaint mantle
#

yes

eternal oxide
#

Then you have some very bad design

quaint mantle
#

    public static ItemStack SnowBall;
    public static void init() {
        createSnowBall();
    }

    private static void createSnowBall() {
        ItemStack Ball = new ItemStack(Material.DIAMOND_HOE);
        ItemMeta meta = Ball.getItemMeta();

        meta.setDisplayName(ChatColor.WHITE + "Snow Shooter");
        List<String> lore = new ArrayList<>();
        lore.add(ChatColor.GRAY + "Shoots Snow Balls");
        meta.setLore(lore);

        Ball.setItemMeta(meta);
        SnowBall = Ball;
    }
}```
eternal oxide
#

we'd need to see whole code to comment

quaint mantle
#

?print

#

?paste

undone axleBOT
quaint mantle
#

code too long

#

wait

#

here you go

eternal oxide
#

that init is a member of ShooterDesign not ItemManager

scarlet dirge
#

which event is triggered when a player joins bungeecord not change or join spigot server

eternal oxide
#

Where is ItemManager?

quaint mantle
#

i removed it

#

wait

#

it was on onEable() {

eternal oxide
#

Where is teh Class ItemManager ?

quaint mantle
#

@Override
public void onEnable() {

    getServer().getPluginManager().registerEvents(new EntityKill(), this);
    getServer().getPluginManager().registerEvents(new FrogKill(), this);
    getServer().getPluginManager().registerEvents(new WitchKill(), this);

    ItemManger.init
quaint mantle
#

u want all classes

#

?

#

import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

import java.util.ArrayList;
import java.util.List;

public class ShooterDesign {

    public static ItemStack SnowBall;
    public static void init() {
        createSnowBall();
    }

    private static void createSnowBall() {
        ItemStack Ball = new ItemStack(Material.DIAMOND_HOE);
        ItemMeta meta = Ball.getItemMeta();

        meta.setDisplayName(ChatColor.WHITE + "Snow Shooter");
        List<String> lore = new ArrayList<>();
        lore.add(ChatColor.GRAY + "Shoots Snow Balls");
        meta.setLore(lore);

        Ball.setItemMeta(meta);
        SnowBall = Ball;
    }
}
eternal oxide
#

You are referring to something called ItemManager

scarlet dirge
#

which event is triggered when a player joins bungeecord not change or join spigot server

quaint mantle
#

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.PotionMeta;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Random;

public class WitchKill implements Listener {
    @EventHandler
    public void WitcheKill(EntityDeathEvent event) {
        ItemStack WitchPotion = null;
        double percentage = 0;



        switch (event.getEntityType()) {
            case WITCH:
                WitchPotion = new ItemStack(Material.SPLASH_POTION);
                PotionMeta meta = (PotionMeta) Bukkit.getItemFactory().getItemMeta(Material.SPLASH_POTION);

                meta.setDisplayName(ChatColor.DARK_GREEN + "Witch Potty!");
                meta.setLore(Arrays.asList(ChatColor.GREEN + "Drink it Drink it Drink it Drink it!!!!!!"));
                meta.addCustomEffect(new PotionEffect(PotionEffectType.WITHER, 1200, 3, true , true, true), true);
                meta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);

                percentage = 0.15;
                break;
        }
        if (WitchPotion == null)
            return;

        if (new Random().nextDouble() > percentage)
            return;

        event.getDrops().add(WitchPotion);
    }
}
scarlet dirge
#

which event is triggered when a player joins bungeecord not change or join spigot server

eternal oxide
#

?paste

undone axleBOT
quaint mantle
#

package deepsmp_plugin.deepsmp_plugin;

import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

import java.util.ArrayList;
import java.util.List;

public class ShooterDesign {

public static ItemStack SnowBall;
public static void init() {
    createSnowBall();
}

private static void createSnowBall() {
    ItemStack Ball = new ItemStack(Material.DIAMOND_HOE);
    ItemMeta meta = Ball.getItemMeta();

    meta.setDisplayName(ChatColor.WHITE + "Snow Shooter");
    List<String> lore = new ArrayList<>();
    lore.add(ChatColor.GRAY + "Shoots Snow Balls");
    meta.setLore(lore);

    Ball.setItemMeta(meta);
    SnowBall = Ball;
}

}

#

wrong

#

one

#

srry

#

wait

eternal oxide
#

Yeah spam teh channel. That will be so nice.

quaint mantle
quaint mantle
eternal oxide
#

That is ShooterDesign

quaint mantle
eternal oxide
#

You are trying to reference soemthign called ItemManager in your onEnable

scarlet dirge
#

which event is triggered when a player joins bungeecord not change or join spigot server

eternal oxide
quaint mantle
#

then how can i fix

#

CUZ

#

i cant

#

import the ItemManager

scarlet dirge
eternal oxide
#

You have no ItemManager

scarlet dirge
#

I cant understand

quaint mantle
scarlet dirge
#

can you tell me which one is triggered when a player joins bungeecord not change or join spigot server

eternal oxide
#

You have ShooterDesign

quaint mantle
eternal oxide
#

so |f you want to call that method you use ShooterDesign.init(); not ItemManager.init

young knoll
#

ItemManager != ShooterDesign

eternal oxide
scarlet dirge
#

ok

smoky oak
#

are barrier blocks considered solid or transparent? Cant check rn

eternal oxide
#

?stash

undone axleBOT
eternal oxide
#

Yas a BARRIER is solid

#

it is also Transparent

mellow pebble
#

can someone help me find maven dependency for TabAPI 😭

eternal oxide
#

solid = can be built on. Transparent = doesn;t block light

#

It is also isOccluding()

drowsy harness
#

ey hey! i've recently worked on a project that requires modifying the mob ai. i've come to a stage where I think my approach don't work. i want certain entities to not be able to go into certain regions. what is the best way to do this?

i've tried using a pathfinding goal, but it seems like it's way harder to modify each movement pathfinding goal to make sure that the entity doesn't walk in these certain regions.

noble lantern
#

you can keep /sit too

#

and have it as a secondary option

supple elk
#

I'm making maps for minigames, but I need meta data about each map like where the spawn locations are. I could hardcode this for each map and create an object in code for each map, or I could also store an additional file in each world and read that. Any suggestions on how I could store this meta data?

noble lantern
#

<worldname>-settings.yml

#

and store various things like that inside of it

supple elk
#

right

noble lantern
#

wtf

#

chunks can have pdc?

smoky oak
#

chunks yes

#

blocks no

noble lantern
#

oh my god it implements it wtf

#

didnt know that

smoky oak
#

alex has a library that saves per block pdc in chunk pdc

noble lantern
#

pretty smart ngl

gleaming grove
#

Any idea how to fix this, texture pack is on the google drive in .rar format, and code is here

supple elk
smoky oak
#

did you forget to set the hash value?

eternal oxide
#

is rar an accepted compression format?

noble lantern
#

i dont think so for mc

#

.zip

#

i do all my textures and stuff in .zip

#

never have issues

chrome beacon
#

Use zip

gleaming grove
#

ok i will try it

supple elk
#

What are the advantages/disadvantages of a yml file per world vs a spawn chunk PDC?

noble lantern
#

PDC would be siginificantly faster

eternal oxide
#

SpawnChunkPDC travels with the world, always.

noble lantern
#

and your not using IO as well to read/write from the files you would be using

#

even tho its only one read tho

#

still

ivory sleet
noble lantern
#

could do both

#

just dump chunk pdt to a file on shutdown

#

"backup"

supple elk
#

right

#

the issue with a pdt is that I can't edit it too easily

smoky oak
#

main problem is that if you save stuff in pdc its significantly harder to read out

young knoll
#

Worlds have pdc too

smoky oak
#

yea exactly

noble lantern
#

what next u gonna tell me MinecraftServer has a container too

supple elk
young knoll
#

Mhm

supple elk
#

How do I use it

smoky oak
#

yup

ivory sleet
#

I mean having your own yml thing is advantageous because you decide when to read and write for instance

smoky oak
#

same as any other

eternal oxide
#

?paste

undone axleBOT
supple elk
smoky oak
#

(object extends PDC).getPersistentDataHolder()

ivory sleet
#

And well, if you use a binary format then it might also be quite fast additionally

smoky oak
#

smth like that

eternal oxide
supple elk
noble lantern
#

yeah im stealing that

#

thanks

young knoll
#

getPersistentDataContainer*

noble lantern
#

someone needs to make a bunch of custom data types and make a commit to spigot with them

#

like why isnt Location a pdt type anyways

young knoll
#

Doubt it would be accepted

ivory sleet
#

^

noble lantern
#

i doubt it too

#

no things to help api ever do z_aCRYYY

#

still waiting for varags event registration

ivory sleet
#

You have roughly 20 libraries that provide those pdc types anyway

#

Just pick one lol

noble lantern
#

ew

#

other ppls libraries

supple elk
#

🤮

brave sparrow
#

God imagine using a library

ivory sleet
#

🥲

noble lantern
#

"Sorry i only write my own libraries"

brave sparrow
#

Not like spigot is a library or anything

ivory sleet
quaint mantle
#

?paste

undone axleBOT
supple elk
#

lol

lost matrix
#

AnyPersistentDataType<String, T>
Which is backed by Gson. You can throw literally everything at that.

noble lantern
supple elk
#

This now gets confusing

noble lantern
#

nah its easy

supple elk
#

cause I store a world for each map

noble lantern
#

gson handles it for u

smoky oak
#

my solution is to just turn it into a b64 string and convert it back

noble lantern
#

just have a pojo structure class and bam

ivory sleet
#

Store a world?

#

for each map?

smoky oak
#

the library just needs to know what object from and to

noble lantern
#

like world settings he means

#

not the whole world

supple elk
#

but everytime a minigame is launched it creates a clone

noble lantern
#

reeeee

#

?paste

undone axleBOT
brave sparrow
ivory sleet
#

?paste the error

undone axleBOT
supple elk
noble lantern
#

?1.8

undone axleBOT
supple elk
#

can I write to the pdc even if the world is not loaded?

brave sparrow
#

Why are you writing to the PDC?

quaint mantle
supple elk
#

I need to store meta data for each map

brave sparrow
brave sparrow
supple elk
#

no

brave sparrow
#

Why not?

young knoll
#

Yes but they use the latest version of Skyrim :p

supple elk
#

The base world is only loaded when it's edited

lost matrix
quaint mantle
supple elk
#

otherwise it stays unloaded, and a when a minigame using that map is launched it copies the world then loads that world

noble lantern
#

almost done

#

sec

young knoll
#

To be fair we got a new Skyrim

quaint mantle
#

ok

young knoll
#

It has fishing

#

Yay

supple elk
#

as you cannot copy a word whilst it's loaded

smoky oak
#

i feel we need more than one help-dev channel

noble lantern
#

where is

#

ShooterDesign.java:34

young knoll
noble lantern
#

thats the class throwing error

#

not the one you sent

quaint mantle
#

lemme send

#

the class

#

wait

brave sparrow
#

Surely you only do that when you’re editing the map

eternal oxide
#

Invalid key. Must be [a-z0-9/._-]: SNOW

quaint mantle
quaint mantle
#

the ShooterDesign

eternal oxide
#

Your NamespacedKey uses invalid characters

noble lantern
#

its this line

young knoll
#

No caps allowed in a namespaced key

lost matrix
noble lantern
#

ah yeah

brave sparrow
#

And once you’ve written the metadata it’s written into the world files, which will be copied when you clone the world

noble lantern
#

wait no

noble lantern
#

no namespace keys can have uppercase

brave sparrow
#

So it seems like that would work for you

young knoll
#

No they can’t

supple elk
noble lantern
#

the examples for recipes have uppsercase

#

sec

quaint mantle
#

k

eternal oxide
#

all lower case letters

supple elk
#

I have to make tools which let me add various information in game though which is annoying

torn shuttle
#

running buildtools should add the stuff required for nms locally right? where exactly is the ~/.m2 meant to be?

noble lantern
#

ah my bad

ivory sleet
#

Think its in your user folder

quaint mantle
brave sparrow
noble lantern
#

i thought ShapedRecipe was the namespacedkey for some reason i nthat example

noble lantern
#

lowercase namespaces only

smoky oak
eternal oxide
#

C:\Users\%USERNAME%\.m2\repository

torn shuttle
#

yeah seems to be in users thanks

quaint mantle
noble lantern
torn shuttle
#

ok so I just need to figure out how to configure gradle correctly...

noble lantern
#

namespaced keys can only be lowercase

brave sparrow
quaint mantle
brave sparrow
#

Make it lowercase

noble lantern
#

sigh

eternal oxide
#

change "SNOW" to "snow"

smoky oak
quaint mantle
#

ok

#

thx

lost matrix
# quaint mantle ok

[a-z0-9/._-]
a-z -> abcdefghijklmnopqrstuvwxyz
0-9 -> 0123456789
_- -> _ and -

noble lantern
#

no special source gradle :/

supple elk
torn shuttle
ivory sleet
supple elk
#

is this really better then just adding the values in the code

#

?

quaint mantle
brave sparrow
supple elk
#

right

noble lantern
#

a lot of us tried converting that plugin to gradle no luck as well

noble lantern
#

maven only

lost matrix
brave sparrow
#

Since it allows someone to make a map without editing the code

supple elk
#

so would a YAML be better than a PDC?