#help-development

1 messages · Page 441 of 1

vernal oasis
#

sound design, visual, encouragement, everything you need

#

2nd most important thing in development after a computer.

#

Is there an @EventHandler for potion effect application?

young knoll
#

EntityPotionEffectEvent

#

I think

vernal oasis
#

org.bukkit.event.entity.EntityPotionEffectEvent?

fluid river
#

probably

#

?jd-s

undone axleBOT
vernal oasis
#

wack ok, lol why is it the entire link lol

#

nvm

#

fixed it

#

I've learned to just not question it

wet breach
#

btw

#

the creeper

#

the sound for it is just a matchstick being lit

sage patio
#

how i can use a String List in here?

#

instead of "/ah"

wet breach
#

originally the sound for the creeper was supposed to be just a placeholder

#

but the early alpha testers loved it so it stayed permanently

vernal oasis
young knoll
sage patio
#

hmm, maybe getting just the first argument

young knoll
#

Split on space and take the first entry

sage patio
#

the first word of the message

#

yea

#

thanks

paper viper
#

Ok i got the uuid of a offline player how do i get his ingame name?

young knoll
#

I think you can do getOfflinePlayer(uuid).getName

#

Which should get it from the local cache or Mojangs servers

echo basalt
#

all the items are configurable because that's how my engine works

paper viper
sage patio
#

how i can store a Block into .yml file and restore it into a Block with that String in the .yml file?

#

block.toString() looks like CraftBlock{chunk=CraftChunk{x=-22z=2},x=-339,y=63,z=41,type=LOG,data=4}

young knoll
#

Iirc you can convert the blocks data to a string

#

And restore that

sage patio
#

nice, and how

young knoll
#

Block.getBlockData

sage patio
young knoll
#

Oh

#

This is legacy

sage patio
#

unfortunately yes

young knoll
#

Store the material and the meta data

#

No idea how to get the metadata anymore, it’s been too long

#

I think it was Block.getData.getData or something

sage patio
#

then how to get it back into a Block?

echo basalt
#

this is basic serialization

#

get the data you want to serialize, write it somewhere, and then read it back and set it?

sage patio
sage patio
echo basalt
#

then learn java

sage patio
#

anywhere to learn about serialization?

echo basalt
#

not quite the best as it just uses basic writeObject

#

but basically you convert data to a common, simple to understand format

#

and read that format again back into your original data

#

First you must know what data to save

#

in case of a block, it's its location, block type, block data

#

and any other thing you care about

bold vessel
young knoll
#

Pass it a namespaced key

#

It does mention that

orchid gazelle
#
public ItemBuilder setDisplayName(String displayName) {
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName(displayName);
        item.setItemMeta(meta);
        return this;
    }

lol is this a good idea?

sullen marlin
#

sure

orchid gazelle
#

wanna do something like:

    private ItemStack defaultIS = new ItemBuilder(Material.BLUE_STAINED_GLASS_PANE)
            .setDisplayName("§1default")
            .build();
sullen marlin
#

if you wanna optimise, perhaps keep the meta as a field which is set only on .build

orchid gazelle
#

hmm okay

#

Im still getting Cannot invoke build() on the primitive type void tho

#

indeed

buoyant viper
#

i was about to say Display.setTitle but thats legacy lwjgl woops

#

yeah that, GLFW

young knoll
#

Good luck finding women?

buoyant viper
#

not a mojank issue

#

skill issue

orchid gazelle
#

lol

buoyant viper
#

its ok i had to look up the keyboard shit

#

bc fuckkkk mojank code

#

i forget if u register a handler or if u mixin to one of their methods

#

i think i registered a handler

young knoll
#

That’s just because it’s not mapped

buoyant viper
#

obfuscation mappings not existing ezpz

young knoll
#

That’s the obfuscated variable name

#

Idk use like

#

Loom

buoyant viper
#

idk what MCP Reborn uses but if they use Mojang mappings theyre SOL i think, u only get field, method, and class names

#

so then yeah mojmap

#

mojmap

#

mojangs mappings

#

they dont include parameter names

sullen marlin
#

lol

buoyant viper
#

now import org.lwjgl.lwjgl.utils.Display

#

or whatever the old class was

#

dont, it doesnt exist anymore

#

not since 1.13

young knoll
#

Wait

buoyant viper
#

different Display class

young knoll
#

Lightweight java graphics library?

buoyant viper
#

lwjgl-utils is a different thing anguish

#

there were always 2 classes in lwjgl family named Display iirc

#

one for utils and one for real Display stuff i think

young knoll
#

Damagable moment

buoyant viper
#

unless im trippin big balls

#

either way im referencing LWJGL2 stuff so it doesnt matter

#

LWJGL3 💪

#

lwjgl3

#

yes

#

dont listen to what i say tho, its all archaic knowledge in the grand scheme of the game (and probably flat out wrong)

#

the last bits of technical knowledge i have are from 1.8

orchid gazelle
#

does this call the super-class?

buoyant viper
#

uh

#

probably not

orchid gazelle
#

it does not right?

#

thats sad lol

buoyant viper
#

just use super.cp() then

young knoll
#

Hey wait what does cp stand for

orchid gazelle
#

copy

young knoll
#

🤨

buoyant viper
worldly ingot
#

If this is your code, you should name that method copy then

#

Although ideally you use the Cloneable interface and override clone() like a sane developer 😛

weak meteor
#

this should work for passing the enchantments from 1 item to another?

Map<Enchantment, Integer> enchantments = slot15.getEnchantments();
                        ItemMeta meta = slot11.getItemMeta();

                        for (Map.Entry<Enchantment, Integer> entry : enchantments.entrySet()) {
                            Enchantment enchantment = entry.getKey();
                            int level = entry.getValue();
                            meta.addEnchant(enchantment, level, true);
                        }
                        slot11.setItemMeta(meta);
young knoll
#

I barely feel ready to force a custom resource pack :p

hasty prawn
#

I feel like if a server forced me to use a specific launcher I would simply just not play that server lol

#

A mod maybe, if you supported it properly.

#

And it actually added value

young knoll
#

Well on the plus side you get to use mixins

#

On the negative side you get to use mixins

hasty prawn
worldly ingot
#

Damn. That's the truest shit I've read about mixins

#

Had to deal with them for VeinMiner's client mod. Shit sucks

young knoll
#

Very powerful tho

worldly ingot
#

Very powerful, obnoxious syntax that requires a strong understanding of method signatures and bytecode

young knoll
#

It’s better than the old forge coremods :p

#

Or the new ones in JavaScript 🙃

hasty prawn
#

what.

echo basalt
#

I wonder if I can create a public mixin plugin that other plugins can depend on joethinking

#

and maybe market it for 5$

young knoll
#

Good luck

#

Mixins have to run at class loading level, which is way before plugins get enabled

echo basalt
#

yeah but java agent

#

y'know

young knoll
#

Yeah if you used an agent it would probably be easy

#

But then it’s less of a plugin more of a bootstrapper

weak meteor
#

Whats wrong here?
EnchantmentStorageMeta itemMeta = (EnchantmentStorageMeta) slot11.getItemMeta();
EnchantmentStorageMeta bookMeta = (EnchantmentStorageMeta) slot15.getItemMeta();

#

shouldnt i do this?

young knoll
#

Are you certain both of them are enchanted books?

weak meteor
#

hmm

#

damn

#

thats true

#

one its a sword

young knoll
#

You just want regular ItemMeta for that then

weak meteor
#

yes

weak meteor
#

so EnchantmentStorageMeta for book and regular ItemMeta for item?

worldly ingot
#

Yes

#

Enchanted books can both be enchanted and store enchantments

#

A little confusing lol

weak meteor
#

yes

young knoll
#

Incase you want a sharpness 1 book that also has sharpness 1

worldly ingot
#

Exactly! :D

sullen marlin
#

yo dawg

weak meteor
#

Ye so i have a question

young knoll
#

I think Mojang did it to a fix a bug where silk touch books functioned as a silk touch tool

#

Unlimited grass blocks

weak meteor
#

I want to make the users can click the blank slots but not the whole inv, so i did this code java else if (inventoryView.getTitle().equals("Encantar") && event.getRawSlot() <= 44){ if (event.getSlot() != 11 || event.getSlot() != 15){ event.setCancelled(true); if (event.getCurrentItem().getType() == Material.LIME_WOOL) // normal code then
But it doesnt work.

#

damn

#

setCancelled(true)

#

should be false

#

no what

#

nono

#

its okay that way

young knoll
#

It should be && instead of ||

weak meteor
#

you cant click 2 slots at the time

#

well, thats what i think

young knoll
#

Currently you are cancelling the event if they are not clicking slot 11 and they are not clicking slot 15

weak meteor
#

yes

young knoll
#

They will always not be clicking at least one of those

#

You want to cancel if they are not clicking slot 11 and they are not clicking slot 15

weak meteor
#

yes

#

well if slot 11 or 15 is clicked, let them click

#

no other slot

young knoll
#

Right

#

So you want to check they are not clicking slot 11 and they are not clicking slot 15

#

Hence &&

weak meteor
#

okay

#

OHH

#

THATS TRUE

remote swallow
#

it would be || if you used ==

weak meteor
#

yes

calm glen
#

Good evening, all!

weak meteor
#

Worked, thanks

#

But i have a question @young knoll

#

and i dont know what to do

#

I have this inventory that u just saw

#

So i want if the player puts an item in 11 or 15 and closes the inventory without completing the process

#

get the items back

#

and idk how to do it

#

no idea in my mind

young knoll
#

Use the InventoryCloseEvent

remote swallow
#

on inventory close event check if theres items there

young knoll
#

Get the items in those two slots, if they aren’t null give them to the player

weak meteor
#

ohh

#

yess

#

thanks u both

young knoll
#

Or air, you’d have to check which it is based on if it’s @coral knotable

weak meteor
#

i always use null

#

and it works for me

remote swallow
#

bukkit doesnt

calm glen
#

I haven't updated a plugin of mine since 1.17.1. I'm comparing the 1.17.1 and 1.19.4 jar files in Eclipse, and I noticed all of the sources that 1.17.1 used are missing from 1.19.4.
Did my 1.19.4.jar file build wrong? The import command doesn't seem to be working anymore.

worldly ingot
#

Bukkit's use of null and air when working with inventories is pretty sporadic

#

You'll want to check the Javadocs or the nullability annotations to verify which check you need to make

young knoll
#

At least the annotations tell you which it is

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

worldly ingot
#

I do actually think Inventory#getItem() is nullable though so that's probably fine

calm glen
weak meteor
#

Just for security lol

worldly ingot
#

better safe than sorry ¯_(ツ)_/¯

#

You do have item.getType().isAir() at your disposal for convenience though

weak meteor
#

Well it works

#

And just use the ! before and it should be the same

#

thanks

#

This feeling of your code working properly u know, i think is the best a dev can feel in his life

calm glen
#

@young knoll You glorious, glorious human being. You've made this noob's night so much better, thanks.

young knoll
#

There is only one set of Mojang mappings

#

It should map all classes, methods, and fields

#

Just not parameters afaik

#

I found this

#

Might help

remote swallow
#

use yarn

#

they have full client moj maps

weak meteor
#

im crying

young knoll
#

Easiest way is to just make a click listener and print out the slot

quartz gull
raw crow
#

ok, thank you

sullen marlin
#

Second is correct, first is protocol

tender shard
civic topaz
#

someone please?

ocean hollow
#

guys, how to save to config list of my objects? ```blocks:

  • x:
    y:
    z:
    world:
    items:
    • name:
      type:
      count:
    • name:
      type:
      count:
  • x:
    y:
    z:
    world:
    items:
    • name:
      type:
      count:
    • name:
      type:
      count:
tender shard
ocean hollow
#

then what do I need to do?

#

I have now created a class for the object, added "implements ConfigSerializable"

#

added the serializable method, what should I write in it?

tender shard
#

if your objects should look like this:

name: asd
type: 123
count: 45

then you gotta return a Map<String,Object> that has "name" -> "asd", "type" -> 123, and "count" -> 45

ocean hollow
mint nova
#

Can anyone help?

So i create a message command, that will send the target title ans subtitle.

The 1 arg its player and 2 or more its message

The issue is that when i type /wiadomosc <PlayerNick>
Its shows this

#
  • when i do /wiadomosc
    Its dont send the message that player dont provide arguments
mint nova
#

Ok i will test it

tender shard
ocean hollow
#

do like that? @tender shard

#

the server does not recognize keystrokes from the player's client

mint nova
ocean hollow
#

and now?

mint nova
#

I will test

ocean hollow
#

wait

mint nova
#

Yea

#

its working now

#

thanks bro

ocean hollow
#

really?

mint nova
#

yea

ocean hollow
#

I just saw my mistake, it shouldn't work)

mint nova
#

No its work fine

ocean hollow
#

nice

tender shard
#

I hate having to wrap my debug statements into an if everytime D:

remote swallow
#

main

tender shard
#

are you now complaining about how I call my private final fields

remote swallow
#

totally

mint nova
#

Hello its me again.

I have a question and issue

  1. How i can Tab the onlinePlayers in TabExecutor?

  2. I made a /wiadomosc reload, and reload is tabbed

But when i use it that send

tender shard
#

"target" is null

mint nova
tender shard
#

you gotta check whether the player is null before sending a title

mint nova
#

Oh

#

Maybe with else to if(target == null)

#

idk how to write it

#

correctly

tender shard
#
if(target != null) {
  target.sendTitle(...);
}
ocean hollow
#
  if(args[0].equals("reload")){
    //reload?
  }
}```
tender shard
#

or better - return after you detected that args[0] is "reload"

tawdry echo
#

^

tender shard
#

e.g. in line 39, return and stop further execution

#

you should still check whether target is null before sending the title

#

otherwise you'll get an error when someone does /mycommand nonexistingplayer

mint nova
#

and this on 39

tender shard
#

yeah that looks better

vital sandal
#

any way to store data in block ?

tender shard
#

?blockpdc

undone axleBOT
vital sandal
#

dont want to use any external lib

tender shard
#

then you can't

tawdry echo
vital sandal
#

why not :l

tender shard
#

is there a reason why you don't wanna use any lib? I mean, spigot-api is also a lib

tender shard
mint nova
desert loom
tender shard
#

then it would concat the string everytime even when debug is false

#

and that's expensive because it has to serialize the whole itemmeta everytime

charred blaze
#

is it only me who cant select jdk?

tender shard
desert loom
#

didn't even notice the concat

charred blaze
tender shard
charred blaze
#

looks like it does

tender shard
#

then it's just the MC dev plugin being shitty again

#

it's known to cause troubles all the time

charred blaze
#

what do i do?

tender shard
#

idk for maven you could just use archetypes. for gradle, just write the build.gradle yourself

#

I mean, that's all the plugin does, anyway

charred blaze
#

how do i

#

(gradle)

tender shard
#

do you want to use gradle or do you not care about gradle vs maven?

charred blaze
#

gradle

tender shard
#

then you go somewhere and enter gradle init and let it generate an empty build file

#

then you just add the bungee repo and dependency

charred blaze
#

maven just updated something and messed all my dependencies

tender shard
#

i doubt that that's what happened

#

maven doesn't update anything on its own

#

neither does gradle

charred blaze
#

idk i just wasnt coding for a week

#

updated intelij & plugins

#

and one of my plugins broke

tender shard
#

File -> Invalidate Caches -> check everything -> Invalidate and Restart

#

it's probably IJ messing up, not maven

tender shard
remote swallow
#

you can also make a blank gradle project with ij

charred blaze
#

ah wait

remote swallow
#

on the new project screen, look at the Empty Project section

charred blaze
#

if jdk is here why isnt it on devs plugin

#

weird

tender shard
#

so usually, inside ~/IdeaProjects

charred blaze
remote swallow
#

because its under new project

tender shard
#

just use this

#

and good luck with gradle lol

charred blaze
#

i just deleted my old project and saved src

charred blaze
charred blaze
tender shard
#

imho it's a fucking pain

remote swallow
#

no

charred blaze
#

which one to believe

tawdry echo
remote swallow
#

the person who uses gradle

tender shard
#

ofc you ca nget it working by just copy/pasting stuff from other people's build files

charred blaze
tender shard
#

maven is so much easier though

remote swallow
#

me

tender shard
#

I have to use gradle sometimes and I always hate it

charred blaze
#

maven vs gradle?

tender shard
#

example:

sourceSets {
    main {
        java {
            srcDirs('java11')
        }
    }
}
sourceSets.main.java.srcDirs = ['java11']
sourceSets.main.java.srcDirs('java11')

someone can explain the difference pls?

remote swallow
#

groovy syntad

#

probably

tender shard
#

or this:

sourceSets {
    main {
        java {
            srcDirs 'java11'
        }
    }
}
charred blaze
#

what

#

how do i get started with gradle?

#

from literally 0

tender shard
#

you don't. you just copy/paste existing stuff without understanding it

remote swallow
#

if you have never used it before, i wouldnt recomend starting now

tender shard
#

that's the only way, as explained in the blog post I sent

charred blaze
tender shard
#

in gradle you either have to know everything, or you can't do the most simple things

charred blaze
#

what about maven

tender shard
#

maven is easy

charred blaze
tender shard
charred blaze
#

gradle build file sounds prettier

charred blaze
remote swallow
#

look at already made projects

ocean hollow
charred blaze
#

nvm found it

tender shard
charred blaze
#

in dependency

tender shard
charred blaze
# ocean hollow

wait you can save location as string and then make it alive?

ocean hollow
tender shard
# ocean hollow
  1. you can't just cast your config section to location
  2. why don't you just use the normal set("blabla", myLocation), then later retrive it using getLocation("blabla") ?
charred blaze
#

try it

tender shard
#

or just use the already builtin ConfigurationSeriazable interface, that Locations happens to implement, and don't worry about any serialization yourself

charred blaze
ocean hollow
charred blaze
#

?tryitandsee

#

hm where is the command

tender shard
#

it would be easier to get rid of the .serialize() and then later retrive it using getLocation("location")

#

the command is tas

charred blaze
#

thanks

#

?tas

undone axleBOT
charred blaze
#

why

remote swallow
#

dont do kotlin gradle

#

its so bad

charred blaze
#

everytime i do it it says script failed

mint nova
#

i try everything that i thing of and anything dont work

tender shard
#

you accessed args[1] (the second element) although your array only has one element

mint nova
#

what that means

tender shard
mint nova
#

OOo

tender shard
#

in line 32, you say "do the following if ONE argument was entered"

#

in line 50 you then say "give me the SECOND argument"

#

but there is only 1

mint nova
#

O ok

#

so i need put like

tender shard
#

args[0] = first argument
args[1] = second argument

mint nova
#

args.leng => 3?

#

because i need 3 argument

#

or more

mint nova
#

I dont see that

tender shard
#

this bracket should be closed before line 48, and instead of "else if" you should just do "if" there

quaint mantle
#

i have a question.

#

does anyone know how to read other people's code?

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

quaint mantle
#

i am working on another person code and its daunting to even look at.

#

this is not even all the files in the project right now and i have fix something apparently.

tender shard
#

looks quite tidy

jagged monolith
#

Yeah, that's quite a neat layout

tender shard
#

in my first plugins, I had all the classes in one package so that I could keep stuff package-private lmao

quaint mantle
#

yeah but i have almost never really worked with other people's source code before.

#

how does one even try to read someone else's code though for a complete beginner?

#

do i have to read every single line of code now?

#

um?

#

this is mostly what scares me about modding minecraft.

remote swallow
#

figure out what you hav to fix then check the classes you need or look similar to what you need to fix

quaint mantle
#

i am not modding minecraft.

quaint mantle
remote swallow
#

hopefully method names are descriptive

kind hatch
quaint mantle
#

there a lot of errors in the code.

#

there are probably like 10 or 20 different errors from this one class.

#

i am looking at the class and it appears to be missing a lot of code.

#

am i importing this wrong?

#

i literally got this from their github repository and it seems to trying to access instance class member functions as though its a static member function.

#

i am so confused right now.

onyx fjord
quaint mantle
#

am i doing something wrong or is the code just wrong?

#

there are probably like hundreds of these sorts of errors everywhere.

onyx fjord
#

Lol everytime i write code I'm trying my best to make it as readable as possible so when I come back in a month I don't forget everything

onyx fjord
quaint mantle
#

can somebody please try importing that project and check if its actually just me or just the code itself being weird.

onyx fjord
#

Ctrl + click plugincondif

#

Config

quaint mantle
#

this is the class itself.

#

this looks so inconsistent.

onyx fjord
#

How can it get it like that if it's not static

#

Huh

quaint mantle
#

i dont know i just download the code from github.

onyx fjord
#

Does it even compile?

quaint mantle
#

lets try.

charred blaze
#

build file looks like this but i cannot import any bungee things

#

whats wrong?

quaint mantle
#

it is compiling or maybe not??

charred blaze
charred blaze
#

dont i need to run build file?

onyx fjord
#

Does it show up in external libraries ?

charred blaze
#

no

quaint mantle
#

add it to your pom.xml file.

onyx fjord
#

Did you reload project

quaint mantle
#

then reload the project from maven.

onyx fjord
charred blaze
charred blaze
quaint mantle
#

or gradle.

onyx fjord
#

Click gradle icon on the right

#

And there should be a reload button

charred blaze
#

ah right

onyx fjord
#

Actually it shows it in the file

#

A floating box

charred blaze
#

??

onyx fjord
#

Top right in the build file

#

Floating gradle logo

charred blaze
#

ik

onyx fjord
#

It shows up when you gotta reload

#

Click it

charred blaze
#

anyways why is there word maven in the build file if its gradle?

#

weird question right?

onyx fjord
#

Because those are maven repos

charred blaze
#

huh?

#

why do i use maven repos in gradle?

onyx fjord
#

Gradle is compatible with maven repos

onyx fjord
#

Correct me if I'm wrong

charred blaze
#

ok

#

tf it added ton of external libraries

onyx fjord
#

Yeah from your dependencies

#

Btw remove ( ) from jda

#

It's kotlin style i think

charred blaze
#

nice it works now

onyx fjord
#

You don't use that in groovy

charred blaze
#

will try that

onyx fjord
#

It won't change anything just style

#

You will probably wanna shade jda later too

#

Use shadowjar plugin for that

ocean hollow
#

When I save objects to config, only 1 is saved (I put 2 blocks, but only one is saved)

hazy parrot
#

And have you checked how many times is that loop ran

quaint mantle
#

what is command i use for make npc with citizens?

ocean hollow
charred blaze
quaint mantle
#

lmao the switch statement spam.

#

yeah i am convinced that is code is written by someone below mediocre at this point.

#

i would probably have this set up with a hashmap with the string being the key and a lambda of some sort for value or something like that.

hazy parrot
ocean hollow
#

I checked, there are two locations. If you put two blocks, then they are both functional.

kind hatch
quaint mantle
#

ikr.

#

its so bad.

kind hatch
quaint mantle
kind hatch
#

He's calling the garbage collector every 5 minutes in a runnable.

quaint mantle
#

lol.

humble tulip
#

You might wanna do Integer.toString(num)

quaint mantle
#

i thought it was bad because he was not using Bukkit.getScheduler().runTaskAsynchronously(); but what you described there sounds so much worse though.

kind hatch
quaint mantle
#

oh my.

#

what is the problem here? when i using command /npc create (name of the npc)

humble tulip
#

Is it daemon?

#

Check the console for error

warm mica
quaint mantle
warm mica
humble tulip
#

First you read the error

#

Are you a plugin developer?

quaint mantle
warm mica
#

he must be, otherwise he surely wouldn't post it in this channel

quaint mantle
quaint mantle
#

you could probably find the line of code that caused any errors to occur by checking out the stacktrace.

tardy delta
# quaint mantle

id just have a Map<String, CommandExecutor> for all the commands

nocturne steppe
#

Please help i'm going crazy, how can I change the default worldgen to just add a singular jigsaw based (like villages) custom structure

sullen marlin
#

Add new generator, put StructureManager populator

nocturne steppe
nocturne steppe
#

specify what

eternal oxide
#

the generator

nocturne steppe
#

yea but i want to keep the default world generation and add the structure "on top"

eternal oxide
#

so?

#

public class YourGenerator extends ChunkGenerator {

#

and don't override the generateSurface

unreal swallow
#

Hey guys, is there a simple way to listen for a forge event?
I'm trying to listen for interactions with the DayCare block in pixelmon.

nocturne steppe
#

oh yeah right right and where do i put the BlockPopulator?

nocturne steppe
eternal oxide
#

You can add the populator in teh worldInit, not sure if you can do it before

unreal swallow
eternal oxide
#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

eternal oxide
#

There are no forge events in Spigot

unreal swallow
#

Sorry, thanks for your time

tender shard
#

there are also no forge materials in spigot, and iterating over Material causes an NPE or sth in arclight

quaint mantle
#

like, iterating over an Enum class #values ?

tender shard
#

yeah IIRC that caused it to crash. or maybe it was another hybrid fork, not sure rn

#

I'll try whether I can find the issue on github

#

and this is their awesome fix ahaha

quaint mantle
#

is catserver better against arclight and such?

tender shard
#

i have no clue, I don't use these weird forks

#

they all have issues

quaint mantle
#

i have this idea about doing red dead online in minecraft but still figuring out if modding the client with forge or if only make the players use a resourcepack

#

the main issue are mobs… they are hard to implement with custom models unless going with model engine and such (which the more latency each player has, the worse it will look), so I liked the idea of adding new entities to the game

nocturne steppe
#

how do you use the StructureManager to load a structure since it's an interface?

nocturne steppe
#

oh yea true thanks

#

i remember seeing it but i forgor

torpid blaze
#

Hey,
anyone here who know how to give a player a splash_potion in spigot 1.8? Because the IDs do not work.

mint nova
eternal oxide
#

read the caused by line

mint nova
#

its maybe issue on this, because the p from it

#

dont exist

eternal oxide
#

a length of 1 means only [0] exists

mint nova
#

O maybe i find the issue

#

I have now 1 issue

So when i do /wiadomosc its say You dont provide the args and This error thing

        if (sender instanceof Player p) {
            if (args.length == 1) {
                if (args[0].equals("reload")) {
                    if (p.hasPermission("wiadomosc.reload")) {
                        p.sendMessage(prefix + reloadMessage);
                    } else {
                        p.sendMessage(prefix + noPermissionMessage);
                    }
                } else if (args[0].equals("help")) {
                    if (p.hasPermission("wiadomosc.help")) {
                        p.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Przydatne komendy");
                        p.sendMessage(ChatColor.GREEN + "/wiadomosc wyslij <user>" + ChatColor.WHITE + "Wysyła wiadomość użytkownikowi.");
                        p.sendMessage(ChatColor.GREEN + "/wiadomosc reload" + ChatColor.WHITE + "Przeładowuje config.yml");
                    } else {
                        p.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Przydatne komendy");
                        p.sendMessage(ChatColor.GREEN + "/wiadomosc wyslij <user>" + ChatColor.WHITE + "Wysyła wiadomość użytkownikowi.");
                         }
                    }
                }  else if (args.length == 0) {
                         p.sendMessage(prefix + ChatColor.RED + "Zła liczba argumentów!");
                    } 
#

i cant find the issue

eternal oxide
#

read the caused by line in the stacktrace

mint nova
eternal oxide
#

you posted it

#

the null error

mint nova
eternal oxide
#

?npe

undone axleBOT
#

The NullPointerException, (commonly referred to as NPE), is thrown in the following cases, but not sealed to: 1. null is passed into a method or constructor which does not allow it; 2. When trying to access a field on an object pointing to null; 3. Casting null to a primitive. See https://stackoverflow.com/a/3988794/17047120 for information on how to debug NPEs.

mint nova
#

i dont understand because its to complicated english for me

#

i understand few words of this but not much

eternal oxide
#

read further down the error at the line which starts caused by

tardy flame
#

Firther

mint nova
#

O i see

#

Index 0 out bounds for lenght 0 what that means?

eternal oxide
#

it means args is empty

mint nova
#

O

eternal oxide
#

but you are trying to use args[0]

tardy flame
#

What have you got on 51 line?

remote swallow
#

your issue is the fact you check if args.length is 0 in the if of checking if its 1

mint nova
remote swallow
#

you sent this

#

you check for args.length == 1

#

then in that same if you check if its 0

#

when it should be seperate ifs

mint nova
#

So

#

wait

#

now? maybe

tardy flame
#

/tryitandsee

#

?tryitandsee

#

Bruh

mint nova
#

xd

tardy flame
#

?help

remote swallow
#
if (sender instanceof Player p) {
    if (args.legnth == 0) p.sendMessage(message);
    if (args.length == 1) {
        //your code
    }
}
undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

tardy flame
#

Also please don't stack ifs like that

#

Use inverted ifs with return

#

It's much easier to read and maintain

mint nova
#

but idk when use it when not

tardy flame
#

Yeah

mint nova
#

I know that when ! so the player for example dont have permission

#

but i want to send the message to permission and non permission player

pseudo hazel
#

thats fine then

tardy flame
#

if (!sender instanceof player) {
sender.sendMessage(Bla bla);
return
}
// Other code

pseudo hazel
#

they are called early returns

mint nova
tardy flame
#

That's just the name of that

pseudo hazel
#

it means returning earlier in the function to prevent nesting if statements

remote swallow
tardy flame
remote swallow
#

no

tardy flame
#

💀

mint nova
#

eh

remote swallow
#

i will always dev against spigot

mint nova
versed canyon
pseudo hazel
#

if I dev for spigot I can let my plugins be used on all 1000 forks of it

#

if I dev on paper I can use my plugin on just the paper fork

#

with probably some exceptions

versed canyon
#

I'm trying to determine if a brown mooshroom has been fed a flower and is ready to make suspicious stew. The game tracks it, because you get a different particle effect and it won't consume the item after you feed it the first flower. But I don't think Spigot exposes a way to see that.

pseudo hazel
#

and besides I know it was a joke argument but switching to paper wont solve your problems magically 😛

pseudo hazel
#

the way I believe pure vanilla works is you get infinite stew if you use a bowl

#

unless they changed it this year 😛

versed canyon
#

If you feed a brown mooshroom a flower, it will make suspicious stew the next time you use a bowl on it

pseudo hazel
#

oh

versed canyon
#

I don't think Spigot gives you a way to see if the mooshroom has eaten that flower and is ready to make stew.

pseudo hazel
#

okay well you are correct, there is no api for that functionality

versed canyon
#

Yeah, I even thought it might be a potion effect but it's not

#

Ah well, not a huge deal but I was hoping to track that

pseudo hazel
#

the only thing you can do with the MushroomCow entity isset its variant (red or brown)

versed canyon
#

Yup, and I already check that to see if the cow is brown before checking the other things

pseudo hazel
#

maybe you can do something with the interact events

#

but idk

versed canyon
#

This code is in the interact event 😄

pseudo hazel
#

okay then I cant help you further xD

ocean hollow
#

what does it mean?

versed canyon
#

No biggie, and thanks for the input

remote swallow
versed canyon
#

Or is it null?

pseudo hazel
#

oh maybe something you can do is keep a list of cows players interacted with and then checking that list when they feed a flower

versed canyon
pseudo hazel
#

I see

versed canyon
remote swallow
#

wheres the location coming from

ocean hollow
#

then how to fix it?

remote swallow
#

wheres the location coming from

versed canyon
#

Find out what's passing the errant location and check the world that's being passed

ocean hollow
#

here is creating and saving

#

it saving "world"

pseudo hazel
#

whats data in the first screenshot

ocean hollow
versed canyon
#

Does your plugin load before worlds initialize or after?

pseudo hazel
#

okay and then when you actually save it I assume you pull those out and use some number to identify that combination?

ocean hollow
versed canyon
#

You would have had to specify that in plugin.yml

pseudo hazel
#

so probably not then 😛

ocean hollow
#

before generation

versed canyon
#
load: STARTUP
#

If your plugin is loading before generation, no worlds are loaded and that's probably why the deserialzer can't recognize them?

ocean hollow
#

so, what I need to do?

#

how to load it after?

versed canyon
#

Before world generation, plugin.getServer().getWorld("world") will return null

#

Take out load: STARTUP from your plugin.yml

#

or change it to load: POSTWORLD

#

But postworld is the default

#

Now your plugin might need to load before world gen if you do anything to modify the world files

#

But if not you should be good

ocean hollow
mint nova
#

Where i can add the permission, so the user can change it, and give to players?

chrome beacon
#

You can put it in your config if you want people to change it

mint nova
#

How i can create the placeholder inside the plugin, because i want to change player nick in config.yml

#

nvm i figured out

terse ore
#

How can I "link" worlds

#

like world akex06, when you use a nether portal it goes to akex06_nether for example

#

is spigotmc down?

eternal oxide
#

you handle the teleports yourself

terse ore
#

I tried to search it up but

remote swallow
#

thats fun

#

spigots down

terse ore
#

oof

remote swallow
#

sams asleep, md probably wont be looking at discord

#

@sullen marlin website down

terse ore
#

bro what

eternal oxide
#

its up

remote swallow
#

damn

terse ore
#

hmm

remote swallow
#

it was down for a minute

#

im suing

remote swallow
#

it didnt let me access anything then it came back

terse ore
#

is there a way to create worlds in another directory?

eternal oxide
#

no

terse ore
#

f

vivid skiff
#

How should i use ScoreBoardTeamPackets in nms, i tried using PacketPlayOutScoreboardTeam packetPlayOutScoreboardTeam = new PacketPlayOutScoreboardTeam(); but i don't know how to use it and online i couldn't find anything

vivid skiff
elder quail
#

I want it for using packets

vivid skiff
# elder quail All your dependencies
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.17.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>me.neznamy</groupId>
            <artifactId>tab-api</artifactId>
            <version>3.2.4</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.github.cryptomorin</groupId>
            <artifactId>XSeries</artifactId>
            <version>9.3.1</version>
        </dependency>```
elder quail
#

Fck me

#

It's 1.17

#

💀

#

spigot aircraft not working for me

remote swallow
#

have you ran buildtools

elder quail
#

Put it on librarys

#

But it's not workin

remote swallow
#

did you reload maven

elder quail
#

Maven says packages not found

elder quail
vivid skiff
#

Once happend to me to, i just execute the jar directily instead of using the .bat

#

And restared the IDE

elder quail
#

ok

graceful crescent
#

makes nms btw way easier ^ as it includes all method names and such

graceful crescent
#

meh mvn install got clear of an error iirc

#

at least for me

terse ore
#

if I have the permission foo.hello.n

tender shard
#

mvn installcannot possibly work in the buildtools directory - there isn't even a pom.xml there

terse ore
#

which would be the best way of getting n?

tender shard
#

split foo.hello.n by "." then get the last array element

terse ore
#

my python head would split the list at . and get last element

graceful crescent
terse ore
#

ok ty

tender shard
terse ore
#

how could I check if player has a permission with variable end?

golden pumice
#

Hello i need help with 2 things

  1. I want to make a npc (in a lobby) when clicked (right-clicked) it will to teleport you to a cords (of my choice)
  2. i want to have a title on top of them and under the title a description, but again dosenth know the plugin name
terse ore
#

loop through all perms and check if it is the one I want?

tawdry echo
#

is there any way to filter autocomplete commands by player that has permission

terse ore
#

and check if it has a permission

young knoll
#

If you assign a command a permission in your plugin.yml

terse ore
#

it is not a command permission

young knoll
#

It will automatically be filtered from tab complete if the player doesn’t have the perm

terse ore
#

oh not talking to me

#

mb

graceful crescent
terse ore
#

oh right

terse ore
#

oki

#

I wish Java had negative indexing

tender shard
#

you are talking about permissions sth like this right?
myplugin.maxhealth.20

terse ore
#

yeah

tender shard
#

Ok, I'd loop over the effective permissions, then map them to string, filter them by your permissions prefix, map them to only the value (after the last dot), then parse them to string. Instead of using mapToInt(Integer::valueOf), you should rather try/catch it to Integer so you don't get exceptions when someone assigns a non-number perm.
Then just filter out the non-number things, map it to int (IntStream)
Example:

    public static IntStream getPermissionValues(Permissible permissible, String prefix) {
        int prefixLength = prefix.length() + 1;
        return permissible.getEffectivePermissions().stream()
                .map(PermissionAttachmentInfo::getPermission)
                .filter(permission -> permission.startsWith(prefix)).map(permission -> permission.substring(prefixLength))
                .map(valueAsString -> {
                    try {
                        return Integer.parseInt(valueAsString);
                    } catch (NumberFormatException e) {
                        return null;
                    }
                }).filter(Objects::nonNull)
                .mapToInt(Integer::intValue);
    }
#

and then ofc just reduce the stream to the min or max amount found

    public static int getLowestPermissionValue(Permissible permissible, String prefix) {
        return getPermissionValues(permissible, prefix).min().orElse(0);
    }


    public static int getHighestPermissionValue(Permissible permissible, String prefix) {
        return getPermissionValues(permissible, prefix).max().orElse(0);
    }
tardy delta
#

when i want to look into the impl

terse ore
#

let me check that

#
        Integer worldBorderSize = null;
        for (PermissionAttachmentInfo effectivePermission : player.getEffectivePermissions()) {
            if (!effectivePermission.getValue()) {
                continue;
            }

            String permission = effectivePermission.getPermission();
            if (!permission.startsWith("realms.world_border_size.")) {
                continue;
            }

            String[] split = permission.split(".");
            worldBorderSize = Integer.valueOf(split[split.length - 1]);
            break;
        }```
I did this (haven't tried it yet)
tender shard
#

that's bad OOP, why don't you turn this into a reusable method

#

and why are you using the boxed type

terse ore
#

ikik, I was just trying some stuff

tender shard
#

also that would only work for for one permission, what if they have several

terse ore
#

I was going to make it a method

tender shard
#

I mean, it wouldnt be sorted, you wouldnt know whether you get the highest or lowest value or some random one inbetween

terse ore
#

let me try to tell how your code works

terse ore
mint nova
#

Hello guys i have question.

How i can make that the one of file for example SimpleCode can be use it 2 file SimpleCode2?

#

because i do staff for my config like this

tender shard
terse ore
#

why not just pass foo.max-health. ?

tender shard
#

yeah well then change it lol

terse ore
#

just wondering

tender shard
#

I think it'd be dirty to always ask that method for the value of something. instead of asking it for the value of something

#

I mean, you want the value of myplugin.max-health and not the value of myplugin.max-health. Hence I see the dot as separator and so I +1 the length of the prefix

mint nova
#

I'm working on config.yml and is it possible to make classes and everything from 1 file to be used in 2 file. Because it looks a bit messy

#

(example)

tender shard
#

rewrite your stuff to be reusable, then you don't have to copy/paste 100 lines

mint nova
echo basalt
#

time you learn about OOP and data structures

#

for messages you can just make a class that's responsible for sending messages

#

I have mine as "MessagesFile"

#

so stuff like sendMessage(player, "no-permission")

#

The messages file can then look at the config itself, and see if it's either a

  • string (then just format and send it individually)
  • String list (loop through each line and do the process above)
#

For placeholders you can just use a lambda or make your own placeholder class

mint nova
#

Oh ok

#

i understand quie of it

echo basalt
#

For example, I have this

mint nova
echo basalt
#

and my config looks like

near crypt
#

why is this not working when i right click air?

echo basalt
#

now, your item check is probably failing

tardy delta
echo basalt
#

I wouldn't recommend doing any checks by name, instead use pdc

#

?pdc

tender shard
#

yeah RIGHT_CLICK_AIR only works for certain items that have functionality (compass e.g. I guess, or fishing rods)

#

also why the heck are you comparing the display name

echo basalt
#

it's stupid

#

you can give a player an invisible item with a resource pack and it'll work

mint nova
mint nova
#

maybe i will code simple simplest code and understand

#

it

tender shard
#

huh since when are there single picture variants

#

can they also be crafted?

terse ore
terse ore
#

atm they're not craftable I think

tender shard
#

ah oki

#

sad

terse ore
#

I mean

#

they're a shit ton of crafts

#

if they added crafting for those

terse ore
#

you wouldn't be able to get any of them random

tender shard
terse ore
tender shard
#

havent seen those before

terse ore
#

11 months ago

livid dove
#

So is there a good rule of thumb for stuff like area claim plugins when it comes to the checks of its protected by a claim or not?

E.g:
block break event
Get region and chunk location
Check if region has a land claim
Check the chunks of that land claim
If the chunk location is in the claim, Check if player is in claim
If in claim, Check flags and, if right flags allow event
If not, çancel event

#

Seems hella bulky

terse ore
#

YO MY MINECRAFT IS ON FIRE

#

wth is this

eternal oxide
#

Your clock is probably wrong and its some april fools

terse ore
#

it's a bit ironic

modern vigil
tender shard
modern vigil
#

video

tender shard
#

wdym

#

oh you mean "i see"

#

if only I could come up with a good ACI construction as reply but I can't

terse ore
#

ACI?

tender shard
#

it's a latin grammar construct

modern vigil
#

accusativus cum infinitivo

#

Accusative*

tender shard
#

accusativum cum infinitivum

terse ore
#

and I studied this last year lol

tender shard
tender shard
modern vigil
tender shard
#

yeah ik and hence it makes little sense, but it was called like that in our book lol

#

I think the book was called Actio

toxic sorrel
#

I've recently been switching my chat plugins deprecated ProxiedPlayer#.sendMessage(String s) methods to ProxiedPlayer#.sendMessage(BaseComponent c), but I've run into issues with URL links. Links that get put into chat are no longer clickable. Is there a solution for this other than writing code to check every message for URL links and setClickEvent each time?

tender shard
#

how are you creating the component btw?

toxic sorrel
#

very latest bungee, i was just doing sendMessage(new TextComponent(String message)), but im about to try sendMessage(TextComponent.fromLegacyText(String message)) to see if that works

tender shard
#

oh right, sendMessage(String) is declared in CommandSender

#

I only looked at ProxiedPlayer

toxic sorrel
#

ah yea, it's been deprecated forever, but im just now getting around to actually changing it lol

ocean hollow
#

I made this config. how do i create a file for it? this is the output. and when I change the value, it still remains what it was

onyx fjord
#

does IJ have an option to have more detailed tab complete menu ?

#

with stuff like javadoc info

late sonnet
#

CTRL+Q?

onyx fjord
#

i want it persistent tho

#

okay i got it

#

its in settings

green prism
#

Hi all. I am creating a Redis-Spigot handler.
Now, I am trying to implement a PlaceholderAPI placeholder with a Redis value.
If the placeholder will be called more than once a minute, can I still do this sync without imploding the server?
If not, how can I do it async?

#

I am unable to know whether Redis will be hosted locally or not

ivory sleet
#

Why not create a mem cache and poll from redis

tender shard
#

I want it too

tawny remnant
tender shard
#

oh just noticed, one can also move it into a tool window

green prism
ancient plank
green prism
#

It's my first time with Redis, sorry for any misunderstanding

ivory sleet
#

That’s irrelevant

#

Point is

winged anvil
#

uhh

#

that discord channel

ivory sleet
#

If you fetch placeholder data directly by querying redis it may hang

#

since redis at the end of the day is gonna be an external io device u depend on

#

So u should instead poll redis and cache some values, then use those values when parsing the placeholder

green prism
#

Isn't JedisPool some sort of Redis connection caching?

ivory sleet
#

That’s just a pool design

#

Object pool

#

To avoid creating a new connection every time yk

#

But jedis is a bit meh imho

green prism
# ivory sleet That’s just a pool design

I've been asked to make it so that, to speed things up and not use a YAML file, you use Redis and then, when you shut down the Server you save everything in MongoDB.

At this point, would you suggest changing RedisDB value just when updating it and then adding a copy of the entry in a Map<UUID, Document> to speed things up?

green prism
#

It's my first time, I'm open to every kind of advice

ivory sleet
#

Well, lettuce or reddisson is better

#

much more robust design

#

Anyway

#

Yes

ivory sleet
#

You have a local cache

#

The redis cache

#

And then the persistent cache yk

#

But I wouldn’t use a map

green prism
#

At this point I fear that no one will ever be able to destroy my data anymore lmao

ivory sleet
#

Yeah

#

Well only thing is

#

You have to be extremely disciplined

green prism
#

wdym

green prism
ivory sleet
#

To avoid experience data loss

green prism
#

ohh okay okay

ivory sleet
#

It provides an alternative to Map

green prism
#

Caffeine > Redis > MongoDB

#

smth like this?

ivory sleet
#

But it supports eviction, expiration and concurrent operations

ivory sleet
#

yea

#

Like that an entry is expired if it hasn’t been touched for x amount of time

green prism
#

thank you so much! Couldn't ask for a better help 🙂

ivory sleet
#

Yea

#

Well generally, you use the put if absent in cache design

#

Goes for both redis and local cache

winter dome
#

Anyone know hot to add the "/shop" and the "/sell" command in ShopGUI+ and SellGUI+?

ivory sleet
#

And for removing an entry, you remove it from the local cache, redis and persistent, then you tell the other servers to also remove the entry from their local caches

#

Through redis message queue for instance

green prism
onyx fjord
#

show documentation popup in

ivory sleet