#help-development

1 messages · Page 1673 of 1

grim ice
#

Yes but the getString is returning null

#

did I get it wrong?

opal epoch
#

its a normal plugin.
Wich is working but they can expand features on there own if they use the Abstract Class. Compile it and put the .jar into the config folder

ivory sleet
#

Yes but the it seems like cfgn.getMaterialsConfig() returns null

tardy delta
#

Material.valueOf?

grim ice
#

OH RIGHT

#

"materials" is null

grim ice
#

didn't read it correctly sorry

lean gull
#

oh btw it didn't write in the config file, 1 sec lemme get the code for that

ivory sleet
#

No worries

#

@lean gull give us your ConfigManager

opal epoch
# tardy delta uh okey

Like Spigot handles the normal plugin 😄
Abstract Class onEnable gets called and youre good to go 😄

ivory sleet
#

And the class you use it in

lean gull
#

?paste

undone axleBOT
lean gull
opal epoch
#

You know what i mean ? 😄

grim ice
#

it's not possible to make a /evaluate command, right? I mean that is it possible to get the args from /evaluate and use it like /evaluate Sout("smth"); (too lazy to write sout btw) and smth will get printed basically get the args and execute it as code i don't think it's possible because you need to import but is there a way to automatically import? Maybe looking through the spigot api and importing the class that's getting mentioned
idk

lean gull
#

spam sheeesh

atomic gyro
#

Just had an extra bracket. Sorry to have you explain scope.

ivory sleet
#

No it’s fine

atomic gyro
#

I was so confused for a minute because I knew it wasn't supposed to be there so I tried to find out why it was there

#

then it made like 20 errors when i removed it, but then just saved the program after removing it and poof 0 errors

craggy cypress
#

Is there a way to check if a sound is allready playing? (1.12.2)
I looked into the docs, but i can only find things like playSound() and stopSound()

tacit drift
#

how can i modify this message? I've seen a couple of servers do this

tardy delta
#

lang file

#

?

#

lemme search

tacit drift
#

no but like they modify it

#

before the user accepts it

atomic gyro
#

Hey there guys; this Predicate doesn't seem to be working as I'm still catching myself with the rayTrace. Any help?
final Predicate<Entity> filter = (hit) -> !hit.equals(p);

grim ice
#

instead of comparing player objects

#

cant you compare UUIDs?

opal epoch
#

How does Spigot load all plugins and start them ?

tardy delta
#

plugin loader

#

javapluginloader class i guess

grim ice
#

Actuaally

#

uuids occupy less space

#

Player objects cause memory leaks but uuids don't

eternal night
#

👀

#

this is a predicate, not a data store

#

equals is perfectly fine here

grim ice
#

then sure i guess..

ivory sleet
# opal epoch How does Spigot load all plugins and start them ?

Spigot loops through all jars in the plugins folder, it then loads them with a urlclassloader derivative which is also known as the plugin class loader that loads something like the plugin loader which then reflectively instantiates your main class and then gets that instance and call the instance methods on it accordingly iirc.

tardy delta
grim ice
#

wait

opal epoch
opal epoch
grim ice
#

there is no adventage of using player objects

#

but there are adventages of using uuids

#

not really huge ones

#

but uuids win imo

ivory sleet
#

Players are identity holders during their online session

#

Speed is key (:

grim ice
#

when they go offline u cant access them

eternal night
#

you are calling an equals function. Presumably no new memory is allocated for this

quaint mantle
grim ice
#

exception is offlineplayer

tardy delta
#

why

eternal night
#

you could even just do an instance comparison

grim ice
#

why all that just to not use uuids

#

plus uuids look more clean idk

#

maybe its becuz im used to using them

quaint mantle
#

legit

opal epoch
quaint mantle
#

UUIDs are superiour

eternal night
#

if you want to optimize this, using uuids is not the way

open vapor
#

how can i tell what end gateway a player walks through?

eternal night
#

as player instances are shared you can just compare their instances

grim ice
#

it's same thing to be honest

#

but uuids less effort

ivory sleet
#

UUID is good if you want to keep data even after the player is offline

eternal night
#

it is not. comparing a uuid here is more line of code written for little to know benefit

ivory sleet
#

Like maybe fetch data on APPLE, then you simply can’t put the player as a key because it isn’t loaded yet

eternal night
#

you could just do hit -> hit != player

#

and you'd be good

ivory sleet
#

However Player works very fine

grim ice
#

this explains it all

opal epoch
eternal night
#

you do realize that post is about storing data

ivory sleet
#

Uh well you need a ClassLoader

grim ice
#

well yeah

ivory sleet
#

Julian

#

Maybe

#

Look into PlaceholderAPI or EcoEnchants

grim ice
#

but there are related stuff, at least in my end

ivory sleet
#

Both do the thing you want to do

eternal night
#

sure, that still does not mean uuids are the best for every job. E.g. in this case regarding a ray trace predicate, they most certainly aren't

opal epoch
grim ice
lean gull
#

anyone know why this isn't setting anything?
getMaterialsConfig().set("announceAdvancementsMaterialEnabledConfig", "LIME_STAINED_GLASS_PANE");

here's the whole class:
https://paste.md-5.net/bupohiregu.cpp

ivory sleet
#

Maybe take a look at spring some day and you’ll understand (:

eternal night
#

worst part hex xD the dude isn't even here anymore lol

opal epoch
ivory sleet
#

That’s good

#

Wouldn’t be of your favor if both my examples are too complicated for you

opal epoch
#

Hopefully i can use it 😂 hard one but i i think im able to...

ivory sleet
#

Sure, good luck

opal epoch
#

Thanks ^^
Otherwise im reading in a .java file and run a runtime compiler at it 😂

tardy delta
#

:/

lean gull
#
    public void saveMaterialsConfig() {
        try {
            materials.save(materialsFile);
            Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.translateAlternateColorCodes('&', "&aSUCCESS &8» &7Config file &bmaterials.yml &7has been saved!"));
        } catch(IOException e) {
            Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.translateAlternateColorCodes('&', "&cERROR &8» &7Could not save config file &bmaterials.yml&7!"));
        }
    }```
grim ice
#

but

#

uh

#

call saveMaterialsConfig() there just in case

lean gull
#

it dont work

#

it dunt even send save message to console twice

grim ice
#

HMM

lean gull
#

villager_huh.mp3

dense shoal
#

I'm revising the land protection logic for one of the plugins I'm working on and I just found that I don't have a blanket statement blocking PlayerInteractEvent for players that don't have permission to build in protected land. Can anyone think of any reason I shouldn't just make a blanket logic for that event and cancel it outright?

unreal quartz
#

doesnt that include eating etc.

#

might be unwise cancelling all without checking the actual action

#

otherwise players cannot feed themselves

kindred valley
#

how can i take a custom item from another class

#

it always takes ItemStack constructor i dont know what to type as parameter type

unreal quartz
#

material

#

your IDE tells you what parameters the constructor needs

dense shoal
lean gull
#

yes, that

#

:p

unreal quartz
#

^ lol

#

Represents an event that is called when a player interacts with an object or air, potentially fired once for each hand.

#

literally, anything involving a left or a right click

#

and a a middle click maybe

#

and also maybe pressure plates etc.

dense shoal
#

Hm gotcha

#

So you think a blacklist of actions involving this event would be better than whitelisting actions?

#

Looks like projectiles can't be fired either. Such a hard functional decision.

lean gull
#

i still need help btw

kindred valley
# unreal quartz material
package Items;

import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Item;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

import java.util.ArrayList;

public class HandCluffs {
    private ItemStack kelepce;


    public ItemStack getKelepce() {
        return kelepce;
    }

    public void setKelepce(ItemStack kelepce) {
        this.kelepce = kelepce;
    }

    public HandCluffs(ItemStack kelepce) {

    }

    public void handcluffs(){

        ItemStack kelepce = new ItemStack(Material.TRIPWIRE);
        ItemMeta meta_kelepce = kelepce.getItemMeta();
        meta_kelepce.setDisplayName(ChatColor.GRAY + "Kelepçeler");
        ArrayList<String> lore = new ArrayList<>();
        lore.add(ChatColor.DARK_BLUE + "Polislere Özgüdür");
        lore.add(ChatColor.DARK_BLUE + "Kişileri Kelepçeleyip Soymaya Yarayabilir.");
        meta_kelepce.setLore(lore);
        meta_kelepce.addEnchant(Enchantment.PROTECTION_FALL, 1, true);
        kelepce.setItemMeta(meta_kelepce);

    }
}







#

this is the class of custom item

lean gull
#

?paste

undone axleBOT
tardy delta
#

why do peoply copy imports im wondering

unreal quartz
#
    public HandCluffs(ItemStack kelepce) {

    }
``` what is the purpose of this empty constructor
lean gull
#

cause too lazy to copy certain part and easier to do CTRL+A

kindred valley
unreal quartz
#

you need to type into google java tutorials

lean gull
#

ok, can you tell me why?

sharp bough
#

yea

#

i can

lean gull
#

ok, please, go ahead

sharp bough
#

why

lean gull
#

because

kindred valley
sharp bough
# lean gull because

what makes you think i have the time to explain to you, a noone why your code doesnt work?

unreal quartz
# lean gull pls hulp

your constructor shouldn't even work because you call getMaterialsConfig() before actually setting materials

lean gull
#

so uh what do i do

dense remnant
#

Is it possible to make a fireball instant explode after summoning?

sharp bough
# lean gull this person gets it

do you know what a guide is? is literally a person that said "oh man i feel bad for dumb people, im gonna make a tutorial so they can read and learn"

#

if i copy and paste the guide here

#

will you read it then?

unreal quartz
lean gull
#

lucas do you know what being nice is

grim ice
sharp bough
#

wait they both @lean gull and @kindred valley dont wanna read the docs?

#

this is pure gold

lean gull
unreal quartz
#

it is like somebody asking how to write an english novel when they do not understand english

grim ice
#

You're coding java, without understanding java

tardy delta
#

how do i do strike through text?

sharp bough
grim ice
#

?learnjava

undone axleBOT
lean gull
#

alright if you're not gonna help please just don't waste both our times talking

unreal quartz
#

a

lean gull
#

you're not. stop talking. shut

grim ice
#

but what you want is spoonfeed, not help ^^

tardy delta
sharp bough
sharp bough
#

you should read one

grim ice
#

lmao

sharp bough
#

xd

tardy delta
#

lets change my name to read the docks

unreal quartz
sharp bough
#

wait no i feel bad

#

aight let me explain

grim ice
#

ok just don't spoonfeed him anymore, he will get bored and go learn java eventually

sharp bough
#

what do you need to know

kindred valley
tardy delta
#

ah /nick went brr

sharp bough
#

sorry

#

what do you need help with @lean gull

lean gull
#

nothing from you, h u s h

tardy delta
#

constructors

unreal quartz
tardy delta
#

😳

sharp bough
lean gull
#

no ur offering to troll, h u s h

kindred valley
sharp bough
#

i was noob was, ik how it feels

#

let me know

unreal quartz
sharp bough
#

what do you need help with

lean gull
#

h u s h

unreal quartz
#

if you don't want to spend the time learning the language yourself, then why should we help you

reef wind
#

he literally offered help

kindred valley
lean gull
kindred valley
#

really i mean

#

really

tardy delta
#

xd

sharp bough
# lean gull *h u s h*

are you really that dumb? you ask for help and when you get it you dont want it? isint this banneable?

lean gull
#

i am having a little fun, yes :p

reef wind
#

this

unreal quartz
sharp bough
#

haahahahaha

kindred valley
lean gull
reef wind
lean gull
sharp bough
#

🤡

#

hahahaahh

tardy delta
#

goodnight yall

lean gull
#

gn

sharp bough
unreal quartz
sharp bough
#

lol

lean gull
sharp bough
tardy delta
#

hush?

sharp bough
#

otherwise you wouldnt ask for help

lean gull
#

i am asking for help, not from you anymore tho

#

nor from 2hex

sharp bough
#

im quite literally

lean gull
#

clearly not, h u s h

sharp bough
#

the only one

#

willing to spend more than 5 minutes with you

#

why? cuz i have an insane patience with people like you

lean gull
#

not asking for spoonfeeding, asking for geninue help with no trolls

undone axleBOT
sharp bough
#

and you say "hush"

#

lmaoo

#

🤡

kindred valley
lean gull
#

5 different reasons why you should hush:
1: hush

kindred valley
#

you should know it

sharp bough
lean gull
#

i kno mafs

#

2 + 2 = f i s

sharp bough
#

mafs?

#

whats mafs?

lean gull
#

quik mafs

sharp bough
lean gull
#

nah fam

unreal quartz
quaint mantle
#

can i make a command to make someone install my virus n get free vbucks

sharp bough
#

no :c

sharp bough
#

type in the onEnable

sharp bough
#

while(true){bukkit.stop}

reef wind
quaint mantle
#

KEKA

kindred valley
quaint mantle
sharp bough
kindred valley
#

and still just know the purpose of it

reef wind
sharp bough
#

here let me google it

lean gull
quaint mantle
#

idk

sharp bough
quaint mantle
#

elgar: learn java

#

💀🛸

unreal quartz
lean gull
unreal quartz
sharp bough
#

go play outside

#

forget about math

#

java

lean gull
#

what's outside

sharp bough
#

just go play outside

lean gull
#

huh

reef wind
#

air I heard

lean gull
#

dis aint my code?

reef wind
#

so?

lean gull
#

what u want

#

i am the confusion

#

oo i kno

sharp bough
#

xd

reef wind
lean gull
#

it makes a thing in a place, don't like it? try a different one in a different time ™️

#

bill wurtz

sharp bough
lean gull
kindred valley
#

and i did this.kelepce = kelepce;

reef wind
#

you are still not answering

unreal quartz
lean gull
#

am bored

#

yall are borin

kindred valley
sharp bough
# kindred valley to call it from another class

heres an example i made for you, so you can understand

// Create a Main class
public class Main {
  int x;  // Create a class attribute

  // Create a class constructor for the Main class
  public Main() {
    x = 5;  // Set the initial value for the class attribute x
  }

  public static void main(String[] args) {
    Main myObj = new Main(); // Create an object of class Main (This will call the constructor)
    System.out.println(myObj.x); // Print the value of x
  }
}

// Outputs 5```
unreal quartz
sharp bough
lean gull
#

so can anybody help?

sharp bough
#

it must be so sad so see your kid beeing like you

lean gull
#

:p

sharp bough
#

do they work?

lean gull
#

i dunno

sharp bough
#

or they also bed all day for money?

lean gull
#

2hex being reasonable?

#

yo wtf

sharp bough
#

no bro like imagine you are just chilling and you see your kid refusing to learn when 6 people is telling him a decent way of learing

lean gull
#

andd he's back

#

imma go make cool bow stuff

#

tell me when someone reasonable and helpful and nice comes

sharp bough
#

lmao

lean gull
#

no one

#

twas a joke

sharp bough
#

oh look if you block them

lean gull
#

i guess elgar is somewhat nice

sharp bough
#

the message shows as "1 blocked message"

lean gull
#

nah

#

if so and he replies with that then he lazy

#

kay

#

what's a bozo

narrow furnace
#

an idiot

kindred valley
#

?paste

undone axleBOT
narrow furnace
#

a nobend

#

a spastic

lean gull
#

ah

narrow furnace
#

aka you

lean gull
#

ouchie

#

hurt

severe oracle
#

any ideas how to get feedback of a command executed as plugin?

sharp bough
unreal quartz
#

example?

kindred valley
#

how to post this code as paste

#

couldnt do it

sharp bough
#

?paste

undone axleBOT
lost matrix
kindred valley
sharp bough
#

and share the link

kindred valley
#

yes

#

being like this

sharp bough
#

public HandCluffs() {

}
#

wtf is that

severe oracle
#
");```
kindred valley
narrow furnace
#

nice

sharp bough
#

and

        private ItemStack kelepce = new ItemStack(Material.TRIPWIRE);
        ItemMeta meta_kelepce = kelepce.getItemMeta();
        meta_kelepce.setDisplayName(ChatColor.GRAY + "Kelepçeler");
        ArrayList<String> lore = new ArrayList<>();
        lore.add(ChatColor.DARK_BLUE + "Polislere Özgüdür");
        lore.add(ChatColor.DARK_BLUE + "Kişileri Kelepçeleyip Soymaya Yarayabilir.");
        meta_kelepce.setLore(lore);
        meta_kelepce.addEnchant(Enchantment.PROTECTION_FALL, 1, true);
        kelepce.setItemMeta(meta_kelepce);
kindred valley
#

yes

sharp bough
#

????

kindred valley
#

i wanted to ask this part

eternal oxide
severe oracle
#

how do i make a block blast proof ?

kindred valley
#

how do i need to identify this part of code on class

sharp bough
kindred valley
sharp bough
#

no you dont

lost matrix
sharp bough
undone axleBOT
sharp bough
#

read that

#

and come bacck

kindred valley
narrow furnace
#

call it metaKelpace or kelpaceMeta

#

rather than meta_kelpace

sharp bough
# kindred valley i did it

can you see a difference between your code structure and

public class Hello
{   
    /* Author: www.w3schools.in
    Date: 2018-04-28
    Description:
    Writes the words "Hello Java" on the screen */
    public static void main(String[] args)
    {
        System.out.println("Hello Java");  
    }
}```
narrow furnace
#

kelepce*

#

did you send the link?

#

to the ?paste

#

i saw it send for a second and it disappeared

lost matrix
# severe oracle material

Listen for the EntityExplodeEvent and BlockExplodeEvent and remove every block from the blocks list which
is of a certain type.

sharp bough
severe oracle
#

???

raven ore
#

How can i get hit position in EntityDamageByEntityEvent

narrow furnace
kindred valley
sharp bough
#

what a blessing lmao

sharp bough
#

do you know what a structure is?

narrow furnace
narrow furnace
#

ty

sharp bough
#

.. what

#

lmao

kindred valley
#

wrong

sharp bough
#

XDD

severe oracle
#

how do i make a functuin that executes once every second ?

sharp bough
narrow furnace
#

you should declare your private variables outside of the constructor

sharp bough
narrow furnace
#

and then assign them in the constructor

lost matrix
# severe oracle ???

For one material:

  @EventHandler
  public void onExplode(final EntityExplodeEvent event) {
    event.blockList().removeIf(block -> block.getType() == Material.STONE);
  }

For multiple materials:

  private static final EnumSet<Material> EXPLOSION_RESISTANT_MATS = EnumSet.of(
      Material.STONE,
      Material.GRASS_BLOCK,
      Material.COBBLESTONE
  );


  @EventHandler
  public void onExplode(final EntityExplodeEvent event) {
    event.blockList().removeIf(block -> EXPLOSION_RESISTANT_MATS.contains(block.getType()));
  }
eternal oxide
lean gull
#

ohhh im dum dum

lost matrix
lean gull
#

alright thanks

lost matrix
#

?scheduling

undone axleBOT
narrow furnace
narrow furnace
#

what is this

lost matrix
raven ore
#

1.8

narrow furnace
#

why did you close the {

lean gull
#
[21:34:49 ERROR]: Error occurred while enabling Gamerules v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.file.FileConfiguration.set(String, Object)" because the return value of "ConfigManager.getPresetConfig()" is null
        at ConfigManager.<init>(ConfigManager.java:53) ~[Gamerules.jar:?]
        at Main.loadConfigManager(Main.java:20) ~[Gamerules.jar:?]
        at Main.onEnable(Main.java:14) ~[Gamerules.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[patched_1.17.1.jar:git-Paper-224]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.17.1.jar:git-Paper-224]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.17.1.jar:git-Paper-224]
        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:535) ~[patched_1.17.1.jar:git-Paper-224]
        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:449) ~[patched_1.17.1.jar:git-Paper-224]
        at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:654) ~[patched_1.17.1.jar:git-Paper-224]
        at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:306) ~[patched_1.17.1.jar:git-Paper-224]
        at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1141) ~[patched_1.17.1.jar:git-Paper-224]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[patched_1.17.1.jar:git-Paper-224]```
maiden thicket
#

event.getEntity().getLocation() ?

lost matrix
# raven ore 1.8

Then you cant. Unless you know a rly good ray marching algorithm.

kindred valley
narrow furnace
#

why

kindred valley
#

the code is not like that

narrow furnace
#

did you close it

lost matrix
maiden thicket
narrow furnace
#

okay paste the code

#

why paste that

raven ore
#

no all pvp servers are on 1.8

maiden thicket
#

1.8 sucks

narrow furnace
maiden thicket
#

who cares

#

ur not going to get support

#

for 1.8

#

at all

kindred valley
#

sorry guys

maiden thicket
#

unless someone wants to go out of their way to do so

#

?paste

undone axleBOT
maiden thicket
#

just use newer versions with 1.8 combat mechanics

#

not that hard

kindred valley
#

but cant message you

maiden thicket
#

@lost matrix how are you not a discord mod yet

narrow furnace
#

we cant stay here?

dense shoal
#

I am using a PlayerInteractEvent to prevent boats from being placed in land. I am tempted to use something like

if(e.getBlock().getType().toString().contains("BOAT"));```
However, is there any way I could use *instanceof* for a cleaner solution? It feels hacky to cast this to a string.
maiden thicket
#

initialize the item in a constructor

narrow furnace
#

okay i think ill just rewrite it

maiden thicket
#

ur setting the item equal to the item too

kindred valley
dense shoal
maiden thicket
narrow furnace
#

why static

dense shoal
#

I feel like I should be able to do something like event.getItem().getData() instanceof Boat, but I know that's wrong lol

narrow furnace
#

^ i think thats what you want

#

idk what its meant to do though because i dont speak that language

maiden thicket
#

cast it to blockdata i think

#

i mean

#

uh

#

event.getBlock().getBlockData() instanceof Door

dense shoal
#

Doesn't getData() return type of blockdata?

dense shoal
dense shoal
#

Yeah that's where I'm stuck too, but casting that to a string at all makes it feel kind of hacky

maiden thicket
hasty prawn
neon kestrel
#

How would I make a player glow client side? Do I have to manually mess with packets, or is there a method to add client side effects?

lean gull
#

if u can tell me what's wrong with it pls tell me ok thanx

dense shoal
sharp bough
#

// i think this checks if the config file does NOT exist, not sure doe

#

xd

severe oracle
#

how do i call one function after some time has passed ?

chrome beacon
undone axleBOT
neon kestrel
#

Oh God I don't have to use NMS do I

narrow furnace
#

whats wrong with nms

neon kestrel
#

It seems more like an unreliable hack than anything

quaint mantle
#

its just tricky

#

NMS isnt an unreliable hack, its actually super reliable afaik

#

its just tricky to do stuff w/ if you dont know what ur doing

#

which is why i just dont use NMS

#

because i cba

neon kestrel
#

Fair enough

eternal night
#

does this not work ?

#

I mean it it server wide

#

but if you need it for only specific clients, look at what the method does

neon kestrel
#

Well, it's close! I have two teams (red and blue respectively) and I'm trying to make their teammates see their other teammates, but not the opposing team.

eternal oxide
#

to see invisible team mates

neon kestrel
#

...what

#

Oh, by "see", I meant with the glow effect

eternal oxide
#

you want each team to only see their team mates and not the other team

#

ah

neon kestrel
#

Everyone should still be visible, but teammates should be glowing

eternal oxide
#

use different scoreboards for each team

eternal night
#

glowing isn't part of the scoreboard tho

#

but rather part of the entity shared flags

#

which would default players not on the scoreboard to a glowing colour of white

#

instead of no glow

eternal oxide
#

You set teh team color not glow

eternal night
#

but how does that solve "only my teammates glow for me"

eternal oxide
#

soryr, you do use glow

eternal night
#

that would leave the enemy glowing

eternal oxide
#

they glow with the team color

#

if they have different scoreboards they shoudl only see glowing teams that are on their scoreboard.

neon kestrel
#

Well, I'll give it a shot

eternal night
#

an entity can still glow without a scoreboard :/

#

but yea, maybe I am wrong

eternal oxide
#

I guess its possible the other team could simply glow white

quaint mantle
#

.setGlowing(true);

eternal oxide
#

as thats the default

quaint mantle
#

the team (if the color is set), is the glow colour

eternal night
#

for everyone xD

eternal oxide
#

Yeah, my way won't work 😦

eternal night
#

the packet way is also pain

#

as glowing is updated every time the player flags updates (which includes sprinting, sneaking, swimming etc)

#

so you would probably have to dive as deep as a packet listener

neon kestrel
#

Great

quaint mantle
#

dont get mad at us

#

for assisting

neon kestrel
#

Oh I'm not

quaint mantle
#

oh ok

#

ily

#

i didnt even help

#

LMAOOOOOOO

neon kestrel
#

I'm really grateful that y'all are helping lol

#

Is there a basic tutorial of how to mess with packet listeners? I'm still knew to plugin development in general (not programming though!) so I'm not really sure how to mess with stuff like this

eternal night
#

might be able to help you

#

it seems to be able to also does what you want

neon kestrel
#

Yea, but I don't want to add a whole library for a small feature

#

I'll save it for a last resort though

eternal night
#

👍 good luck on the NMS deep dive. It is rather fun down there

neon kestrel
#

Thanks lol. I'll need the good luck 😨

lost matrix
#

No need for nms

#

Hm

#

Yes should be possible,

eternal night
#

well "not add a whole library" kind of murders "simple packet listener" heh

lost matrix
#

Oh. F then

eternal night
#

and if you are fine with throwing protocol lib in there, consider if you trust you or inventivetalent more xD

lost matrix
#

My servers always look like this:
ProtocolLib
OneMonolithPlugin

eternal night
#

The one and only spigot stack

neon kestrel
#

We are currently using protocol lib for other features, so maybe that'll make my life a bit easier

eternal night
#

oh if you are using protocol lib it should be rather easy then

lost matrix
#

If i knew how to reliably inject a handler into the netty pipeline i would drop Plib too

eternal night
#

(also dig the "imma ask on paper discord as well, the spigot plebs won't know")

neon kestrel
#

Haha, it's not like that at all. I'm asking everywhere in case I get ignored/can't find an answer

quaint mantle
#

It’s very simple just implement channelinboundhandler

#

Reflect to grab your channel

#

Then you have read and write

#

Keep it in a Player, Handler map

lost matrix
quaint mantle
#

I did make my own system for my anticheat not public tho.

#

Let me turn on pc

stoic ravine
#
    Player p = e.getPlayer();
    UUID dUUID = p.getUniqueId();
    UUID uuid = e.getPlayer().getUniqueId();
    Class clasS = Main.getClassManager().getClass(uuid);
    if (clasS.equals(Class.PRIEST)) {
      Action action = e.getAction();
      if ((action.equals(Action.RIGHT_CLICK_AIR) || action.equals(Action.RIGHT_CLICK_BLOCK)) && p.getInventory().getItemInHand().equals(Material.DIAMOND_SWORD ))```
#

This is not getting through when I add equals(Material.diamond_sword)
even tho im holding a sword, any clue?

cerulean jasper
#

java: package jdk.tools.jmod does not exist

When does this happen?

lost matrix
lost matrix
quaint mantle
#

you can make the predicate a consumer its for cancelling packets

lost matrix
quaint mantle
#

you need to reflect as well

#

so then you can have systems like thsi for example

#
public class RangeA {
    public RangeA(Player damager, PacketHandler handler) {
        handler.onSend(damager, PacketPlayInUseEntity.class, (p) -> {
            final PacketPlayInUseEntity packet = ((PacketPlayInUseEntity) p);
            final Entity damaged = packet.a(((CraftWorld) damager.getWorld()).getHandle());

            if (damaged instanceof EntityPlayer && packet.a() == PacketPlayInUseEntity.EnumEntityUseAction.ATTACK) {
            }

            return false;
        });
    }
}```
stoic ravine
#

How do I do that in the code 7smile?

lost matrix
quaint mantle
#

It’s very old lol

lost matrix
quaint mantle
#

I haven’t touched this packet handler in about 1.5 years?

#

Yea use as you wish

stoic ravine
#
    ItemStack Sword = new ItemStack(Material.DIAMOND_SWORD);
    Player p = e.getPlayer();
    UUID dUUID = p.getUniqueId();
    UUID uuid = e.getPlayer().getUniqueId();
    Class clasS = Main.getClassManager().getClass(uuid);
    if (clasS.equals(Class.PRIEST)) {
      Action action = e.getAction();
      if ((action.equals(Action.RIGHT_CLICK_AIR) || action.equals(Action.RIGHT_CLICK_BLOCK)) && p.getInventory().getItemInHand() == Sword && ``` Like this?
lost matrix
stoic ravine
#

Hmm alright but not sure how to do it then

lost matrix
#

And only use == for primitives and enums.

quaint mantle
#

Kotlin makes the system much easier. Can have player extensions so you don’t need to pass handler anywhere

#

Just java rips

ivory sleet
#

Lombok (:

quaint mantle
#

Gross

lost matrix
quaint mantle
#

Lombok extensions are a meme

lost matrix
#

Idk why ppl hate on lombok that much.

quaint mantle
#

I don’t like it

#

why

#

Clutters code, you shouldn’t really have that many setters anyways

#

What 😂

#

I don’t like getWhatever

#

I’m more about whatever()

#

so you're a weirdo

#

Because I don’t use lombok?

#

because you dont use get

lost matrix
quaint mantle
#

I use to then I realized Lombok for noobs?

#

Lol not in that sense but lomboks a nono for me. I’m not a fan of annotations

#

how may one not be a fan of annotations

#

i just use lombok because its faster than typing it all out

quaint mantle
#

intellij always gives me errors when I try to auto-generate

#

@quaint mantle I’d rather my code look pretty. The have @Getter before everythint because I was too lazy

stoic ravine
#

Where should I get the type from the itemstack to then compare in the if statement? xd

#

is it the gettype or?

quaint mantle
#

Let’s see the only good thing is requiredargs and val lol

ivory sleet
#

Annotation on annotation!!!

quaint mantle
lost matrix
#

This saves me a whole proxy class and a lot of logic:

@Builder
public class CoolClass<T> {

  private final Predicate<T> filter;
  private final Supplier<T> supplier;
  private final Consumer<T> consumer;

  public void applyIfPossible() {
    final T value = this.supplier.get();
    if (this.filter.test(value)) {
      this.consumer.accept(value);
    }
  }

}
    final CoolClass<Player> cool = CoolClass.<Player>builder()
        .supplier(() -> Bukkit.getPlayer(playerID))
        .filter(player -> player != null && player.hasPermission("imcool"))
        .consumer(player -> player.sendMessage("You are Cool"))
        .build();

    cool.applyIfPossible();
#

And i dont find that this is cluttered

quaint mantle
#

did you just recreate java streams

lost matrix
#

Idk. I just threw random stuff together so it looks convincing XD

loud swift
#

hey guys, is there any reason to use - or _ for separating words inside configuration nodes instead of just using spaces?
I feel spaces look a lot cleaner & are easier to write, but most configs i've seen do not use them

lost matrix
#

ConfigEntryKey
or
config-entry-key

loud swift
#

what kind?

lost matrix
loud swift
#

I've used yaml files pretty extensively with spaces, and even modified them from my plugin without issues

#

even with lists of elements and such

#

and its odd that yaml doesn't complain if using spaces

#

if it could be problematic

young knoll
#

Spaces on values are fine if you enclose them in quotes

#

Spaces in keys aren’t

eternal night
#
Optional.ofNullable(Bukkit.getPlayer(playerID))
    .filter(player -> player != null && player.hasPermission("imcool"))
    .ifPresent(player -> player.sendMessage("You are cool"));

isn't that basically the same as your class ? xD

lost matrix
lost matrix
eternal night
#
Runnable cool = () -> {
    Optional.ofNullable(Bukkit.getPlayer(playerID))
        .filter(player -> player != null && player.hasPermission("imcool"))
        .ifPresent(player -> player.sendMessage("You are cool"));
};
``` xD
lost matrix
#

-.-

eternal night
#

tho I guess this is actually more code and less generalized

#

than yours

#

so I see the appeal

lost matrix
#

Is it possible to create an invisible arrow?

#

Ive extended EntityTippedArrow and called this.setInvisible(true); in the constructor.

hybrid spoke
#

but i think you have to use packets to destroy it for the player

lost matrix
lost matrix
hybrid spoke
#

its not that hard or aids

#

its literally one packet

hollow sand
hollow sand
#

on*

#

did u register the command in ur onEnable?

lost matrix
hollow sand
#

yes it is

#

you can disable the vanilla cmd

#

i think

hybrid spoke
hollow sand
#

yes u can

#

make a command.yml file :v

hybrid spoke
#

i mean you could listen to the sent packets

hollow sand
#

disabling commands?

#

vanilla commands*

hybrid spoke
#

oh well we have 2 different conversations

hollow sand
#

ah

#

i was talking to 2Hex xd

#

but disabling a vanilla command is possible

#

just need to make a commands.yml file

#

and

#

you know

#

that

#

if you make the same cmd as a vanilla cmd

hybrid spoke
#

is the command there if you type /help?

hollow sand
#

it overrides it

#

like

lost matrix
hollow sand
#

cool

hybrid spoke
hollow sand
quaint mantle
#

Failure

hollow sand
#

damn 😔

#

gonna go back to coding now 😔

atomic gyro
#

hey there guys, I've been pouring over the javadoc for Predicates and can't understand it at all

hybrid spoke
#

a predicate is a functional interface

#

which takes a boolean and tests it against an object

#

iirc

atomic gyro
#

Yeah it's a functional interface according to the doc

#

my main issue is that I'm making code that isn't erroring but its also not working, and I'm having trouble with the whole troubleshooting process

lavish hemlock
#

meaning it takes a generic type and returns a boolean

quaint mantle
lavish hemlock
#

it's filter.test btw

lavish hemlock
#

and also object instantiation overhead

#

and garbage collection overhead

atomic gyro
#
final RayTraceResult result = world.rayTraceEntities(start, direction, distance, 1.0, filter);
Entity LookingAt = result.getHitEntity();```
So using that example, this code should run as intended and ignore the player?
quaint mantle
lavish hemlock
#

nope

#

that doesn't work

quaint mantle
#

java is shit

#

that should work

lavish hemlock
#

you can't invert the value of a method reference

atomic gyro
quaint mantle
#

someone pr that

lavish hemlock
#

as it doesn't reference the method's return value, but instead the method's handle

lavish hemlock
atomic gyro
#

oh lol my bad

lavish hemlock
#

I don't know if that would work or not but it looks fine

#

what you can do is

#

oh nvm

#

I thought there was a Objects::notEquals lmao

quaint mantle
#

wouldnt make since

#

you'd have to pass two args

atomic gyro
#

It;s throwing an error at me, The target type of this expression must be a functional interface. Maybe it needs to contain smth?

lavish hemlock
#

yeah fair

atomic gyro
#

I believe so.

lavish hemlock
#

can you send the full error?

atomic gyro
#

I'm on Eclipse, so I haven't compiled it yet, but it typically shows it before it happens.

#

To my knowledge, The target type of this expression must be a functional interface is the full error. But I can send the code too. Very new to this IDE and Spigot as a whole so forgive my ignorance.

final RayTraceResult result = world.rayTraceEntities(start, direction, distance, 1.0, filter);
Entity LookingAt = result.getHitEntity();```
Error has ** around it.
quaint mantle
#

yeah it doesnt work

#

go back to original

lavish hemlock
#

yeah no that's invalid

#

you can't invert a method reference

hybrid spoke
#

par it and add the ! to the front

quaint mantle
lavish hemlock
#

just do !p.equals(hit) :p it's not that much code

atomic gyro
#

so like !(p::equals) ?

reef wind
#

I thought there was a new staff for a moment

#

lmao

#

phoen changed pfp

atomic gyro
quaint mantle
#

Wait

#

@atomic gyro !!!!!

atomic gyro
#

?

quaint mantle
#

Predicate.not(p::equals)

ivory sleet
lavish hemlock
atomic gyro
quaint mantle
#
Predicate<String> predicate = Predicate.not(String::isEmpty);
lavish hemlock
#

it's more characters and an additional method call

lavish hemlock
#

just do the explicit parameter pass for fuck's sake

ivory sleet
#

Think of them as anonymous instantiations of interfaces that have a single abstract method

#

You can check out
Runnable,
Function,
Consumer,
Callable,
BiConsumer,
AutoClosable and Closable,
BiFunction and so on

quaint mantle
#

Lambda is yes

ivory sleet
#

All of them have a single abstract method and is an interface

lavish hemlock
#

Closeable isn't really meant to be a functional interface tho

ivory sleet
#

Indeed

#

But it does not break the contract of one

#

As of now

#

Probably won’t in the future also

#

Now consider these two effectively equivalent
Runnable r = () -> {
System.out.println("maowcraft");
};
and
Runnable r2 = new Runnable() {
@Override public void run() {
System.out.println("maowcraft");
}
};
@atomic gyro

lavish hemlock
#

why am I an example

ivory sleet
#

Why not (:

lavish hemlock
#

and it's Maow

#

not maowcraft

ivory sleet
#

your nickname is maowcraft 🤨

lavish hemlock
#

yes but that username is literally like

#

gimme a sec

#

3 years old

ivory sleet
#

Still suits you 😏

hybrid spoke
#

better than mine 3 years ago lol

lost matrix
lavish hemlock
#

technically it's 6 years old but the last time I changed my username to Maowcraft was 3 years ago since I changed it to Maow_ last year

ivory sleet
#

Ok Maow_

lavish hemlock
#

Maow was taken

#

somehow

ivory sleet
#

Yeah 4 letter names r popular 🥲

lost matrix
#

Mine is "Gestankbratwurst"
Dont try to translate it into english. It makes no sense.

quaint mantle
#
public class AssLexer {
}

.ASS, gotta make the internals fit the name 😉

lavish hemlock
#

can you parse my ass

lavish hemlock
#

.ass*

quaint mantle
hybrid spoke
quaint mantle
#
public class AssParser {
}
lavish hemlock
#

thank you

ivory sleet
#

lmao smile

lost matrix
ivory sleet
#

lol

lavish hemlock
hybrid spoke
#

i mean mine was "IchLebeNicht"

ivory sleet
#

Yeah Maooooow apologies

hybrid spoke
#

followed by "RunterGebuggt"

lost matrix
hybrid spoke
#

"DerKuhleJunge_" best name i ever had

lost matrix
#

My brothers acc is "AffeMitWaffe"

lavish hemlock
hybrid spoke
#

isnt it a popular name ?

lavish hemlock
#

1997, colorized: Maow breaking into MIT to affect their waffles.

hybrid spoke
lost matrix
#

lul

hybrid spoke
#

seems like a nice guy

atomic gyro
lavish hemlock
#

here's a question @ivory sleet
can I reverify with a different Spigot account? :p

quaint mantle
#

if you want banned

lavish hemlock
#

I'll just delete the old one lmao

quaint mantle
#

yeah still against the rules

ivory sleet
#

Yeah apparently alts are no go

#

But you could donate and change name if that’s what your intention was

lavish hemlock
#

I'm not giving Spigot my money

quaint mantle
#

Ok

ivory sleet
#

That’s ok, to be fair I wish name changes were free like at least one

lavish hemlock
#

like who tf do they think they are

#

Microsoft?

quaint mantle
#

they do it all for free :/

lavish hemlock
#

give us your soul to change your Xbox Live username

#

sorry

#

gamer tag

#

bc XD GAMER

#

SO QUIRKY AND HIP

#

ugh

ivory sleet
#

Yeah well donations are just a way to support spigot merely

atomic gyro
#

Guys I've gotta thank y'all, it finally works at least a little bit. I've been trying to make this plugin for like 2 days and it finally didn't remove me from the game :)

#

Still works thru walls but that's an obstacle for another time lol

ivory sleet
#

That sounds like good news

#

Cheers then

lavish hemlock
hybrid spoke
unreal quartz
#

complete with an entire storyline as well please thanks

ivory sleet
hybrid spoke
lavish hemlock
#

their minimum donation price is $10

hybrid spoke
#

custom models

#

etc

#

all in one

blazing mica
#

Hello Everybody Where Can I Find A Coach For Plugin Development

ivory sleet
#

?services

undone axleBOT
ivory sleet
#

However you can often get a good amount of advice here

#

?ask

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. Create a thread in case the help channel you are using is already in use!

blazing mica
#

Which Category Should I Post Under? I Do Not See A For Dev Coaching

eternal oxide
#

?services

undone axleBOT
solar breach
ivory sleet
#

It would be something along developer hiring

blazing mica
#

But Will That Require Payments?

ivory sleet
#

Necessarily not?

blazing mica
#

Ok So If I Post I Can Find A Coach For Free Java Dev Help?

solar breach
#

dude just google tutorials lol

ivory sleet
#

^

blazing mica
#

I Do Not Like Tutorials I Learn By Doing

ivory sleet
#

Problem is that there’s a lot bad practices one may teach you, especially if you’re using something unprofessional like spigot services section

torn shuttle
blazing mica
#

I Just Want To Develop Servers Not Get A Professional Job Or AnyThing Like That

blazing mica
#

I Will Post There Thank You All

ivory sleet
#

Alright best of luck

torn shuttle
ivory sleet
#

🥲 former C# programmer?

torn shuttle
#

that hit too close to home

#

that and the default bracket formatting for unity projects is triggering me big time

#

why waste an entire line on opening a bracket

unreal quartz
#

why use lines at all

ivory sleet
#

Readability!!! Solidify those scopes!!!

torn shuttle
#

read my ass

ivory sleet
unreal quartz
#

if your source code isn't 1 line and 10000 columns then you're doing it wrong

torn shuttle
#

we already have indentation for readability, are we programming for the blind?

ivory sleet
#

It needs to look good

#

More lines = better code as some assert

torn shuttle
#

it looks like a high school essay trying to fill space for a character count

ivory sleet
#

Precisely

torn shuttle
#

bet you the people who came up with it are paid by the line

ivory sleet
#

Lol

wary harness
#

got this problem

#

any oen able to help

torn shuttle
#

it looks like it says what it wants you to do

severe oracle
#

Is it possible to establish communications beteen plugin and ESP32 over ethernet ?

granite beacon
#

is it better to have one task timer that loops thru a bunch of mobs or have a bunch of mobs have their on task timer (it's for specific movements done with teleportation)

worldly ice
#

are you spawning a mob inside a listener for mob spawning?

astral imp
#

question, Is there any kind of version incompatibilities from 1.13 to 1.17? Do I need any kind of version checks? (For example, if I supported 1.12 and below, and also 1.13+ i'd have to add support for legacy material names, sounds, etc) Is there anything present in the newer version this has to be done as well, if any?

stone sinew
astral imp
#

so if I wanted to support 1.13 through 1.17, which version would I build against? The oldest version I'm supporting?

stone sinew
#

Or I build with 1.8.8 and support up to 1.17.1

astral imp
#

Interesting. Well thanks for your help, I appreciate it(:

stone sinew
#

np

sullen dome
#

is there a better way of creating empty scores (placeholders), except java objective.getScore("").setScore(0); objective.getScore(" ").setScore(1); objective.getScore(" ").setScore(2); objective.getScore(" ").setScore(3);

#

does that apply to empty strings tho?

#

let's try

#

adding a space looks just awful

#

and idk if 15 spaces are too much chars

#

oh i see

eternal oxide
#

why are you setting scores?

sullen dome
#

yea

sullen dome
eternal oxide
#

make what bigger?

sullen dome
#

scoreboard

#

it's smol

eternal oxide
#

so increase the top line width

sullen dome
#

wat

#

^

eternal oxide
#

ah

sullen dome
#

didnt had the word in mind

eternal oxide
#

You can just use colors and add blank lines

#

a team per line using ChatColor.values as teh key

sullen dome
#

guess i'll go with this?

        String s = "";
        for (int i = 15; i > 0; i--)
            if (i != 10) {
                objective.getScore(s).setScore(i);
                s += " ";
            }
        objective.getScore("§cYour Deaths: " + getConfig().getInt(p.getUniqueId() + ".deaths") + "§r").setScore(10);```
written quickly, out of mind
#

or in my mind?

#

whatever

#

yea

#

i was dumb

#

i still hope, minecraft someday gives us a way to remove those dumb scores on the far right

#

just annoying for my death counter

#

and other integer-stuff

#

and the reason is? :o

eternal oxide
#

you can set them all to zero so they can be ignored

eternal oxide
#

look at teh SS I posted above. all scores are zero

#

no it sorts by team name

sullen dome
#

still looks kinda ugly

#

i mean

#

compare that with a sb without those

eternal oxide
#

so you create 15 teams "TEAM_" + ChatColor.values()[line].toString()

#

Then you can set specific lines

golden turret
#

Hello little friends. Im having an issue with texts in prompts of the conversation api.

#

bascially, what i want: prefix: \n\n§5§lHyvoidKronos getPromptText: \n\n §fType the task

#

with 2 spaces i actually got 3

#

with 1 space i got only 1 space

golden turret
sullen dome
#

omg that gif is so fckn cute

crude charm
#

?paste

undone axleBOT
golden turret
#

it was exactly what i said

#

prefix with 2 \n

#

and

crude charm
#

m8

#

?paste

undone axleBOT
golden turret
#

getPromptText with 2\n and 2 spaces

sullen dome
#

instantly saved

crude charm
crude charm
crude charm
sullen dome
crude charm
#

use this

#

spigot scoreboard is shit

golden turret
crude charm
crude charm
sullen dome
#

looks interesting. thanks!

crude charm
#

?paste

undone axleBOT
sullen dome
#

btw: is there still no way to remove specific games from discord's richpresence?

crude charm
#

I would only have intelliJ whitelisted

sullen dome
#

i dont want minecraft to show there

crude charm
#

^

sullen dome
#

it always be in highest priority somehow

crude charm
#

I'm on intelliJ for hours and then boom

#

mc

#

or really blc

#

but yeah