#help-development

1 messages · Page 1907 of 1

pine island
#

?paste

undone axleBOT
pine island
rancid snow
#

is it bad to run something asyncRepeating then run some part of syncDelayed with 0 delay to run it on the main thread?

tender shard
#

that's NOT the same source code as from the error you sent

buoyant viper
#

oh hastebin my love, what the fuck

pine island
#

hahah

tender shard
#

can't be line 48

quasi flint
#

The mysterious }

tender shard
#

you changed the code after compiling

#

so the error message is now useless

buoyant viper
#

player probably died from natural causes and youre not checking if they actually died to a player

pine island
#

yeah i tried fall damage

buoyant viper
#

what

tender shard
#

you have to recompile your stuff again... then try it again and then send the correct error message

quasi flint
#

The whole error

tender shard
#

yeah and an error that actually belongs to the source code and not some other version

pine island
#

wait ill send again like 48 is somth diffrent haste bin being weird

waxen plinth
#

Please

#

We are trying to help you, so:

tender shard
#

well

buoyant viper
#

also im sorry INCREASE_DAMAGE... wtf bukkit

waxen plinth
#
  • Send the FULL stack trace
#
  • Send the FULL code
tender shard
#

it's because you removed all the imports

waxen plinth
#
  • Do not exclude anything
tender shard
#

I asked what line 48 is and you then just uploaded part of your code lol

waxen plinth
#

You're making it very difficult to help you with a very simple error

pine island
buoyant viper
#

it doesnt remove imports, u do

tender shard
#

there is no killer

#

i.e.

#

killer is null

pine island
#

hmm

#

while im here why dont i get efects on join?

#

effects*

#

line 61

quasi flint
#

if(killer == null) return

pine island
#

yeah ill do that

quasi flint
#

Why I using that whole ass create method?

#

Can't it be just FireRestistance,1,1

pine island
#

nah that dosnt work for me

quasi flint
#

Well this one doesn't seem to work either 😂

pine island
#

it does

tender shard
#
player.addPotionEffect(new PotionEffect(PotionEffectType.WITHER,duration,amplifier));
#

this does definitely work

buoyant viper
#

createEffect just does that but as a method idk

tender shard
#

yep

pine island
#

i always use createEffect

quasi flint
#

._.

pine island
#

works fine but think it has somth to do with Integer.MAX_VALUE

quasi flint
#

Maybe try a tad lower value

buoyant viper
#

if u want a perm effect i think something like 32767 would do it

pine island
#

its in ticks

buoyant viper
#

yeah

pine island
#

so 32767 * 20

buoyant viper
#

oh

#

hm

tender shard
#

this is your code

buoyant viper
#

i think Drop2InventoryPlus couldnt check for updates

pine island
#

1.8 ;-;

buoyant viper
quasi flint
buoyant viper
pine island
#

i knew this was coming

buoyant viper
#

at least u know

pine island
#

Its a sw plugin what am i supposed to do

buoyant viper
#

u say that like SW as a game-mode is version dependent?

quasi flint
#

Now go to modern versions of this game

#

Not ancient ones

pine island
#

no.

#

snowballs deal damage in 1.8

quasi flint
#

Then code it 😂

pine island
#

no thats effort

quasi flint
#

That's an 5 Min thing

tender shard
#

yeah

tender shard
buoyant viper
#

if snowball collide with entity take 0.5 dmg ezpz

pine island
#

;-; im not gonna port this code to 1.18

quasi flint
#

There is no porting

#

That code is so baisc nothing changed

tender shard
#
    @EventHandler
    public void onHit(ProjectileHitEvent event) {
        if (!(event.getEntity() instanceof Snowball)) return;
        Entity victim = event.getHitEntity();
        if (victim == null) return;
        double damage = getConfig().getDouble("damage");
        boolean sound = getConfig().getBoolean("sound");
        boolean animation = getConfig().getBoolean("animation");
        if (damage > 0) {
            if (victim instanceof Damageable) {
                ((Damageable) victim).damage(damage, event.getEntity());
            }
        }
        if (sound) {
            double pitch = ThreadLocalRandom.current().nextDouble(0.5, 2);
            event.getEntity().getWorld().playSound(event.getEntity().getLocation(), Sound.ENTITY_GENERIC_EXPLODE, SoundCategory.MASTER, 4, (float) pitch);
        }
    }
quasi flint
#

Even configurable 😂

pine island
#

i wont be porting it to newer version but.. double pitch = ThreadLocalRandom.current().nextDouble(0.5, 2); event.getEntity().getWorld().playSound(event.getEntity().getLocation(), Sound.ENTITY_GENERIC_EXPLODE, SoundCategory.MASTER, 4, (float) pitch); thanks for the code lmao

#

i was looking for playsound

quasi flint
pine island
#

alr thanks for the help!

quasi flint
#

You can also remove the playsound if needed 😂

tender shard
#

or put the playSound into a sync repeating task that never stops lol

quasi flint
#

1 tick delay

tender shard
#

I had another idea lol

pine island
#

199980 this is the value that i ned to set for the effects to work

tender shard
#

haha this sound is awesome

buoyant viper
#

32767 ticks is inf, aka 1,638.35 seconds

tender shard
#

check out this sound

quasi flint
#

Jesus

pine island
#

Why wont videos on discord load

buoyant viper
#

discord bad

pine island
#

isnt 250mb/s enough

buoyant viper
#

oh minecraft is cursed

#

i watched an infinite effect start ticking down

quasi flint
buoyant viper
#

tfw no minecraft effect is truly permanent

tender shard
quasi flint
#

My anticheat doesn't support it for a reason

tender shard
#

infinite -1 = infinite

pine island
#

yeah

#

unless its not infinite

buoyant viper
#

idk it said **:** and then it started ticking down from 26:59

#

scared the shit outta me

pine island
#

yeah that just shows **:**

#

for simplicity sake

buoyant viper
#

mayb theres no permanent effect then sadge

quasi flint
#

Sync delayed task 1 tick. There ya go 😂

pine island
#

imma replace that 32767 with some higher value seeing as the effect is not inf

tender shard
#

everything above an hour should be displayed as **:**

pine island
#

^^

#

otherwise it will take too much space

buoyant viper
quasi flint
#

For simplicity sake ima code my plugins in Spigot Version: 1.4.7

pine island
#

why?

quasi flint
#

why 1.8?

buoyant viper
#

idk

#

minecraft is weird

tender shard
#

I'd do Inventory.first(Material), check if it's more than then the amount you want to remove, if yes: lower the amount of the remaining stack.
if no, remove the whole stack and go for the next one, etc

#
    public static boolean removeX(Inventory inventory, Material toRemove, int toRemoveRemaining) {
        HashMap<Integer, ? extends ItemStack> matchingStacks = inventory.all(toRemove);
        for(ItemStack item : matchingStacks.values()) {
            if(item.getAmount() <= toRemoveRemaining) {
                toRemoveRemaining -= item.getAmount();
                item.setAmount(0);
            } else {
                item.setAmount(item.getAmount() - toRemoveRemaining);
            }
            if(toRemoveRemaining == 0) return true;
        }
        return toRemoveRemaining == 0;
    }
#

I'd do it sth like this

#

(haven't tested though)

#

np 🙂

#

this inly works for materials though

#

if you need it to match potion types etc you'll have to change it a bit

buoyant viper
#

ezpz Predicate<ItemStack>

tender shard
#
    public static boolean removeX(final Inventory inventory, final Material toRemove, final int toRemoveRemaining) {
        final HashMap<Integer, ? extends ItemStack> matchingStacks = inventory.all(toRemove);
        return removeItemStacks(toRemoveRemaining, matchingStacks);
    }

    public static boolean removeX(final Inventory inventory, final ItemStack toRemove, final int toRemoveRemaining) {
        HashMap<Integer, ? extends ItemStack> matchingStacks = getAll(inventory, toRemove);
        return removeItemStacks(toRemoveRemaining, matchingStacks);
    }

    private static boolean removeItemStacks(int toRemoveRemaining, final HashMap<Integer, ? extends ItemStack> matchingStacks) {
        for(final ItemStack item : matchingStacks.values()) {
            if(item.getAmount() <= toRemoveRemaining) {
                toRemoveRemaining -= item.getAmount();
                item.setAmount(0);
            } else {
                item.setAmount(item.getAmount() - toRemoveRemaining);
            }
            if(toRemoveRemaining == 0) return true;
        }
        return toRemoveRemaining == 0;
    }

    public static HashMap<Integer, ? extends ItemStack> getAll(final Inventory inventory, final ItemStack item) {
        final HashMap<Integer, ItemStack> map = new HashMap<>();
        for(int i = 0; i < inventory.getSize(); i++) {
            final ItemStack tmp = inventory.getItem(i);
            if(tmp == null || tmp.getAmount() == 0) continue;
            if(tmp.isSimilar(item)) map.put(i,tmp);
        }
        return map;
    }
#

here's one method for removing X itemstacks and one for removing X materials

#

hm

#

does anyone have a good example for how to use this?

worn tundra
tender shard
#

thx

#

btw what's up with the javadocs, they are broken

worn tundra
#

Click on this

tender shard
#

I am talking about the weird layout

#

after runTaskAsynchrounously, everything is bold and only in the leftmost <td>

worn tundra
#

Yeah?

#

I know

tender shard
#

yeah and it's not supposed to be like that lol

#

so I was asking

#

why 😄

worn tundra
tender shard
#

?

#

I don't get it

worn tundra
#

There is a screenshot

tender shard
#

I know

worn tundra
#

With a button in a red box

#

You have to click it

tender shard
#

I know

worn tundra
#

to "fix" your layout

tender shard
#

No

#

it just scrolls down

worn tundra
#

I just did that

#

Switching between those two buttons

#

Changes the view to what you have

#

And back

tender shard
#

the file is still broken

worn tundra
#

Oh

tender shard
#

seems like someone forgot to close the <b> tag in the javadocs or sth 😄

worn tundra
#

Yeah

tender shard
#

Time for my first pull request lmao

buoyant viper
#

spoke too soon

sullen marlin
#

seems like a javadoc bug too

#

consider making a repro case and reporting

tender shard
#

I am already glad I can get actually create javadocs at all lol

#

mvn site never works for me

#

I always have to do mvn javadoc:javadoc

agile sinew
#

how to detect when player hit primed tnt

restive tangle
#

How do I check whether a player right clicked or left clicked an item in the inventory?

tall dragon
#

InventoryClickEvent

tall dragon
agile sinew
#

hmm

#

That event's entity is like e.getRightClicked()

restive tangle
#

Ok, But how do I know whether the player right clicked or left clicked the inventory?

tall dragon
#

check the action

#

InventoryClickEvent#getAction()

#

i think

#

iirc

restive tangle
#

InventoryAction?

agile sinew
#

EntityDamagedByEntityEvent neither not work

restive tangle
#

It doesn't have a right click or left click event

tall dragon
restive tangle
#

Oh, Alright thanks

tall dragon
agile sinew
#

no

#

I want to detect when player hit tnt

#

to left click

tall dragon
#

try PlayerInteractEntityEvent

#

oh u want left click

#

not sure about that tbh

buoyant viper
#

block destroy event?

agile sinew
#

primed tnt

tall dragon
#

idk maybe the only way is to check the players line of sight on interact and see if primed tnt is there

#

i woulnt know another way

glossy venture
#

maybe PlayerInteractEvent with a world.rayTraceEntities(player.getLocation(), player.getLocation().getDirection(), 3)

buoyant viper
#

oh hitting primed tnt

#

hmm

vernal pier
#

Should be just the block break event and check if the tnt blockdata is unstable

glossy venture
#
@EventHandler
public void onInteract(PlayerInteractEvent event) {
  // check if it was a left click
  if (event.getAction() != Action.LEFT_CLICK_AIR) return;

  Player player = event.getPlayer();
  // get head location
  Location head = player.getLocation().add(0, 1, 0);

  // will raytrace for entities in the world, from the players location
  // in the players look direction with a reach of 3 blocks. also only
  // selects primed tnt entities because of the predicate.
  RayTraceResult res = player.getWorld().rayTraceEntities(
    head, // location (from)
    head.getDirection(), // direction (in)
    3, // max distance (reach)
    (entity) -> { return entity instanceof TNTPrimed; } // predicate
  );
  
  Entity entity = res.getHitEntity();
  if (entity == null) return; // no primed tnt found
  TNTPrimed tnt = (TNTPrimed) entity;

  /* Your code */
}
#

i have no idea if it works

#

but you can try

buoyant viper
#

Player#isBlocking returns true when shielding right

#

wait nvm im doing a general check for item use anyway

#

so just getItemInUse() != null should? suffice

#

?jd

buoyant viper
#

what were some conditions for MC to stop a players sprint

#

using an item (bow, food, blocking) and sneaking?

tall dragon
#

pretty sure thats all of them

vocal cloud
#

blindness I think ?

buoyant viper
#

i think <7 food level and blindness still remove sprint @vocal cloud

#

so i dont need to care about them

#

writing some code to restore the old mechanic

vocal cloud
#

Ah I see

buoyant viper
#

bc it pisses me off that they changed something that small

chrome ferry
#

If I wanted to compare an item that’s been created statically (via a config or whatever) and an item in game. How would I compare them if the item in game has been renamed via an anvil? I know it sounds stupid it does, I’ve tried everything and they just aren’t comparing. I’m using ItemStack#isSimilar. What would I put as the display name for the item in the config? Or do I need a different method to set it like an anvil name?

vocal cloud
round finch
#

I'm curious how you would get cause of death

#

Of a player

#

I'm on my laggy slow wifi phone ain't no PC access rn

vocal cloud
#

You'd probably have to listen to the damage events to see what caused a players health to go below= 0

buoyant viper
#

to cancel a BlockPlaceEvent should i use setCancelled(true) or setBuild(false)

round finch
#

Setcancel for prevent any change

#

But players can spam block below themselves near a wall to float up

buoyant viper
#

ik

vocal cloud
buoyant viper
#

just setCancelled should suffice for my case then

vocal cloud
round finch
#

Is it possible to remove building ablity completely without adventure mode

buoyant viper
#

small smp and i just make some little changes w a core plugin

buoyant viper
#

pretty much

round finch
#

Nice!

grizzled pollen
chrome ferry
chrome ferry
#

Of %player%

#

That’s the most popular placeholder variable

#

Also if this is public, I suggest adding comments to your configuration to

grizzled pollen
chrome ferry
vocal cloud
#

Oh

buoyant viper
#

%PLAYER% so we can be like cmd variables

vocal cloud
#

Anvil does something different mb

chrome ferry
#

So there’s not a way to name an item like an anvil

vocal cloud
#

I thought u wanted to check if they're the same item

#

not name

grizzled pollen
chrome ferry
#

Nah same name

buoyant viper
#

becos i run the server on linux

#

smh

#

jk shell would be $PLAYER

#

hence why i had $PLAYER*$*

#

lolz

grizzled pollen
#

ya, but do you use this configuration in linux commands?

buoyant viper
#

nop

grizzled pollen
#

so why then do the same and as on Linux😂

#

lol

buoyant viper
#

personal preferences

vocal cloud
vocal cloud
buoyant viper
chrome ferry
buoyant viper
#

jvm would yell at me

chrome ferry
#

I mean it’s up to you :)

buoyant viper
#

{player} seems nice

#

think ive seen other things use { } as placeholders

#

like log4j

vocal cloud
#

yeah because that worked so well for them mmlul

buoyant viper
#

he he

sage patio
#

Hi, I have this code to blocking a lot of names in anvil rename
and I have a ArrayList of String named blockedNames in my main class
and this code does not work

buoyant viper
#

public class PrepareAnvilEvent
extends InventoryEvent

Called when an item is put in a slot for repair by an anvil.

#

hm

sage patio
#

I want to check the result's name

#

for example test is blocked
and i want if player rename a block like Stone to test, my plugin set the result to a unpickable barrier

chrome ferry
#

I believe check for the click event

#

Check if the inv is an anvil

#

And get the name

#

And then cancel if whatever

buoyant viper
sage patio
#

ok thanks, lemme try

vocal cloud
#

Also the event doesn't have @EventHandler on it so that doesn't help either

red sedge
#

how do i give the player a permission

vocal cloud
#

That might help

buoyant viper
vocal cloud
#

You'd still need a cancel in the anvil event tho I imagine?

buoyant viper
#

i think hes setting the result to a barrier so

#

that might (effectively?) do the same thing

buoyant viper
#

cries in BukkitRunnable cant get its calling Plugin

crude estuary
#

Sad, plugin does not Know itself

inner anvil
#
 else if (!players_Currently_Flying.contains(player)) {
                if (player.isFlying()) {
                    if (!player.isOp()) {
                        player.kickPlayer(ChatColor.RED + "You have been kicked for fly hack(s).");
                    }
                }
            }```
#

do cheats bypass checks like this?

#

haven't got the chance to test yet

buoyant viper
#

yeah

inner anvil
#

ah ok

#

what is the way to efficiently detect a fly hack

vocal cloud
#

That's gliding i believe as well. The biggest issue is that clients not servers set the isflying variable

buoyant viper
#

i think thats isGliding

inner anvil
#

wait

vocal cloud
#

Rather it's

inner anvil
#

I have am array list for flying players

#

they are only added to the list via admin command

#

so it wouldn't detect elytra

vocal cloud
#

I mean what you really want to do is download some hacked clients and do your testing with them

inner anvil
#

maybe it'll detect a noob client like wurst

#

I'll test once I get home from school

dense heath
inner anvil
hardy swan
#

Hacked clients developers are better than you think

inner anvil
#

anticheat isn't something I'm familiar with yet so I'm just messing around to see what works

inner anvil
inner anvil
#

I've watched people make this stuff

inner anvil
hardy swan
#

study player's travelling patterns

dense heath
# inner anvil wdym?

If you want a good vert check, check if the player moved the correct amount based each tick

#

You can make a bullet proof fly check if you do it correctly

vocal cloud
#

Technically if performance isn't something you care about you could check when a player moves if the block under them is air and if they move and their y doesn't shift a lot they're probably hacking

inner anvil
#

okay

#

I added these all to my notes

buoyant viper
inner anvil
#

ty

buoyant viper
#

its a great client for as bad as it is

hardy swan
#

is location spoofable

inner anvil
dense heath
vocal cloud
dense heath
hardy swan
#

he meant the "hackers"

dense heath
vocal cloud
#

I mean no hacked client is going to make you move in a sin wave so

dense heath
ivory sleet
#

I mean it’s really hard to make sure your code is correct

vocal cloud
ivory sleet
#

It’s easy to make sure it’s not incorrect

hardy swan
#

formal proof

buoyant viper
#

is your code politically correct?

alpine barn
#

anyone developing with vsc?

vocal cloud
#

With the comments I have in there no

hardy swan
#

me, actually me

dense heath
vocal cloud
alpine barn
hardy swan
#

yes

alpine barn
#

👍

hardy swan
#

vsc best editor

alpine barn
#

think so too

inner anvil
inner anvil
alpine barn
#

let's agree to disagree

inner anvil
#

perhaps

#

we have our own opinions. and it's too early to be arguing

buoyant viper
hardy swan
inner anvil
hardy swan
inner anvil
#

intellij also catches 99% more errors that vsc doesn't

alpine barn
buoyant viper
#

just dont make mistakes

hardy swan
#

I catch all errors

inner anvil
#

a lot of useful things as well

buoyant viper
inner anvil
#

it's just more convenient for me since I have it for free

hardy swan
#

intellij is free for all, why did you quantify your statement?

alpine barn
vocal cloud
#

Intellij also is a crutch for new learners who use alt enter to add Object.requiresnonnull to their objects then wonder why it's still throwing an error

inner anvil
hardy swan
#

new learners -> vim

alpine barn
#

@hardy swan so I'm getting Cannot find a class with the main method in the folder - what may I have missed?

buoyant viper
hardy swan
#

show plugin.yml

#

show main class

#

?paste

undone axleBOT
restive tangle
vocal cloud
dense heath
vocal cloud
hardy swan
#

new QuantumComputer()

hardy swan
vocal cloud
#

That is a plugin.yml so bare it's illegal to be seen in public

hardy swan
#

"clean code"

alpine barn
dense heath
hardy swan
alpine barn
hardy swan
#

then how are you compiling/building your project/plugin

dense heath
vocal cloud
#

Okay so no maven or Gradle. Just raw old java compiling

#

Oh boy

hardy swan
#

anyways that message isn't important, you don't need a main method anywhere

alpine barn
#

I think I'm using maven

buoyant viper
#

do u have a pom.xml

#

or a build.gradle

inner anvil
#

my plugin commands to discord server integration?

alpine barn
#

pom.xml

buoyant viper
#

maven

hardy swan
#

show pom

buoyant viper
#

you opened the projects folder in vsc?

vocal cloud
#

Whew almost had another Gradle user

snow crow
#

when you find that your plugin does not work after stacktracing for a whole day

hardy swan
#

that cannot happen

#

if you are stacktracing

#

your plugin does not work

vocal cloud
#

I mean it's called getting nowhere fast and usually involves asking for help

snow crow
#

after compileing it and running it on the server

alpine barn
#

I like to say gradle

hardy swan
#

I won't want to say that here

inner anvil
vocal cloud
hardy swan
vocal cloud
#

Man Tutorial videos 🤮

hardy swan
snow crow
#

so can someone help me debug my code im dumb as and cant find the problem

vocal cloud
#

Well we need to see the code before we can help

hardy swan
#

You can only learn by suffering

alpine barn
#

oh wait

hardy swan
#

clean workspace

#

restart

#

thank me

vocal cloud
#

mvn clean

hardy swan
#

you are welcome

alpine barn
#

it might be because vsc is trying to run the code

#

not only build

quaint mantle
#

Can anyone help please?

vocal cloud
#

Are you not running mvn package

snow crow
vocal cloud
#

What why send a link? Just send a pastebin how bad can your error be

hardy swan
#

live share session?

snow crow
#

there is no errors i fixed it

vocal cloud
#

Then?

snow crow
#

ye good idea

vocal cloud
#

I'm confused as to why you'd share working code with me?

snow crow
hardy swan
#

you see, the vc is under-utilized

buoyant viper
#

no streaming perms in it

hardy swan
#

oh f

snow crow
#

f

vocal cloud
#

Then send it in a pastebin

buoyant viper
#

?paste

undone axleBOT
snow crow
#

the whole code? lol

hardy swan
#

i think the server is boosted enough to allow streaming

vocal cloud
#

And explain what exactly isn't working

buoyant viper
hardy swan
#

but there is a quality limit for boost levels

snow crow
hardy swan
#

idk

vocal cloud
snow crow
vocal cloud
#

Send code in a pastebin then talk about what's going wrong with said code

snow crow
#

ok

#

?paste

undone axleBOT
snow crow
#

is the main class

vocal cloud
#

Alright and so what exactly is the issue you're having.

  1. What you want to happen
  2. What's actually happening
snow crow
#

i want the player to ride a ender pearl on the acutal path of the enderpearl

vocal cloud
#

Alright, and where is the logic that makes that happen?

#

Or rather the code that is supposed to

alpine barn
vocal cloud
alpine barn
#

touché

vocal cloud
snow crow
hardy swan
#

how is metrics related?!

vocal cloud
#

Well you said you want it so that a player follows an ender pearl?

snow crow
#

or the command part in the first spot which is not working lol

snow crow
vocal cloud
#

Yeah okay what code do you have for that?

snow crow
#

and i forgot that in commands ofc im dumb

umbral pagoda
#

Static good ?

#

Or abuse ?

vocal cloud
#

Don't static unless need. Static bad

buoyant viper
#

depends on if u abuse it or not

vocal cloud
#

Static damage brain cause memory loss

hardy swan
#

if you abuse it, it is considered abuse

umbral pagoda
#

Ok another way ?

buoyant viper
#

dont abuse it? idfk

hardy swan
#

think oop

umbral pagoda
#

Ok iuse it alot

buoyant viper
#

good

#

👍

umbral pagoda
#

Ineed good way ?

buoyant viper
#

am i having a stroke

vocal cloud
#

Good many words few not

buoyant viper
#

why many words if less same

vocal cloud
#

Few > many

buoyant viper
#

< >

hardy swan
#

clean chat

#

< > >

#

< == > => < >

#

if less same more, less is more

snow crow
#

Solar

#

i need the code for make the player sit on the entity

buoyant viper
#

addPassenger?

vocal cloud
#

Read the documentation?

hardy swan
#

?jd

hardy swan
#

?learnjava

undone axleBOT
hardy swan
#

the theory of everything

snow crow
#

good idea

vocal cloud
#

Alright I'm off to sleep for a few hours. Wake me if md_5 shows up to tell someone not to use NMS it's my favorite part of the morning

red sedge
#

How do i set attack speed but like

#

hte ones that swords use

alpine barn
#

❤️

hardy swan
#

ah familiar env

alpine barn
#

fun facts: I had neither a jdk nor maven installed

buoyant viper
#

how u forget both

alpine barn
#

yeah, I took a break from java for almost 4 years

hardy swan
#

wow

alpine barn
#

restarted yesterday

#

got lost in dayz modding

hardy swan
#

wb to shithole

buoyant viper
#

knew i should've learned cpp instead

hardy swan
#

yes

alpine barn
#

dayz modding isn't cpp

#

it's crap

buoyant viper
#

thats just cpp

#

C supremacy

alpine barn
#

it's a dumbed down version of c#

buoyant viper
#

VB?

alpine barn
#

VBA

#

dim dim dim

hardy swan
#

wtf is enscript

#

alien language

alpine barn
wicked perch
#

Hey, is there a Performance Gentle way to keep a BungeeCord Plugin on track where the players are?

quaint mantle
#

probably not help dev

fallen grove
analog prairie
#

?jd

fallen grove
#

?

snow crow
# fallen grove Hello, I just crashed my server with a plugin I am making. Can someone read this...

https://nekobin.com/rifujicuji
at com.lucidaps.ChatFormat.SymbolRemoval(ChatFormat.java:112) ~[ChatFormat-1.2.jar:?]
at com.lucidaps.ChatFormat.chatFormat(ChatFormat.java:59) ~[ChatFormat-1.2.jar:?]
https://nekobin.com/kevowamobu
ChatFormat-1.2.jar//com.lucidaps.ChatFormat.SymbolRemoval(ChatFormat.java:110)
[11:33:10] [Watchdog Thread/ERROR]: ChatFormat-1.2.jar//com.lucidaps.ChatFormat.chatFormat(ChatFormat.java:59)

#

ye it stack trace

#

now find the line in your code which corresponds to the location in tims lol

alpine barn
#

ok now maven built hoverwars-0.0.2-SNAPSHOT.jar - how do I copy it somewhere?

#

I do that in build.xml, right?

#

oh wait, maybe maven deploy

minor otter
#

Using spigot, how would I go about testing if a blockstate of a noteblock matched what I want

cyan oyster
#

should i use intellj or eclipse

eternal oxide
#

personal choice

red sedge
#

Can someone help me with vault api?
https://paste.md-5.net/tesilimice.sql

p.sendMessage(String.valueOf(AsarSMP.getInstance().getPermission().playerRemove(null, p, oldPermission)));
        p.sendMessage(String.valueOf(AsarSMP.getInstance().getPermission().playerAdd(null, p, permissionToAssign)));```
boreal sparrow
#

any idea on how to play custom noteblock music?

red sedge
#

texturepack

boreal sparrow
#

hmm maybe

red sedge
#

pretty sure thats the only way

boreal sparrow
#

oof

#

but how does hypixel do it lmao

red sedge
#

playing each note

#

with vanilla sounds

boreal sparrow
#

damn

#

how do i add the premission operator to permissions: in plugin.yml so everyone with op can execute it?

supple bay
boreal sparrow
#

yea but can other players use it as well?

#

i want only op can use

red sedge
#

just add a permission???

#

or type op as the permission

supple bay
boreal sparrow
#

yea but i cant remember what its called

eternal oxide
supple bay
supple bay
#

* for all permissions

boreal sparrow
#

like permissions: *

red sedge
supple bay
boreal sparrow
#

ty

red sedge
#

I copied the function from the git page

#

there is a permission plugin assigned to vault checked from /vault-info

supple bay
eternal oxide
#

Bukkit does not understand wildcards. Your permission plugin should do that for you. Or in your plugin.yml, you have to define the * nodes and its children.

supple bay
loud grove
#

Hello everyone
Is it possible that a server blocks moving amorstands with velocity ?
I spawn a custom armorstand and I want to move it with vectors (i know how to do that), but it does not work. It works fine 4 months before but now no...

red sedge
supple bay
red sedge
#

because I need to remove/add permissions

supple bay
boreal sparrow
#

can this work permissions: permission*

boreal sparrow
#

yea

#

it says how to set up pemissions

supple bay
boreal sparrow
#

it doesnt tell you what permissions there are

supple bay
#

luckPerms.getPlayerAdapter(Player.class).getUser(player);
also just get the player from here

red sedge
supple bay
#

go to permissions then handle it from there after

red sedge
#

can i DM you abt it?

supple bay
#

Uh no, will go to bed after this lol

red sedge
#

okay

#

also another thing

#

i- dont know how to get the repo for luckperms

supple bay
analog prairie
#

How can I get player dimension?

eternal oxide
#

Player#getWorld()

red sedge
analog prairie
red sedge
#

like to add it

supple bay
red sedge
boreal sparrow
#

does anyone know how to use noteblock api

supple bay
boreal sparrow
#

yea i found wiki

#

what is maven pom lmao

supple bay
#

Again, learn java -> spigot -> u r good to go

minor otter
#

how could I test for the note of a noteblock

supple bay
#

Also use a music plugin instead

supple bay
#

Play sound for sounds itself

#

And tonality is for the ticks or how high the note will play

minor otter
#

I mean I created a plugin that tests if the player destroys a noteblock and grants items with nbt, which wasn't the hard part, what's difficult for me is figuring out how to test if the noteblock that is destroyed has a certain octave of note

supple bay
boreal sparrow
#

lmao ill try learn java but for now how do i get maven pom in intellij idea

supple bay
#

Hello world

#

And every other objects

elfin tusk
#

IntelliJ also has a Minecraft Development plugin you can use which can make it easier for you.

lost matrix
lost matrix
minor otter
#

alright cool ill try that

latent zephyr
#

Hello, my server is crashing due to the ps.send(new ClientboundAddPlayerPacket(npc)); (1.18.1)
Crash report:

java.lang.NoClassDefFoundError: net/minecraft/world/entity/player/Player

When i try to import import net.minecraft.world.entity.player.Player i get an error: "No documentation found."

minor otter
quaint mantle
#

?learnjava i think the pseudo-code is easy enough to do it yourself?

undone axleBOT
chrome beacon
latent zephyr
supple bay
#

I believe its
((Noteblock)(Block#getBlockData()))#methods

chrome beacon
#

?paste

undone axleBOT
lost matrix
chrome beacon
lost matrix
#

Or map it back using the special sources plugin

analog prairie
#

How can I send clickable text in chat?

lost matrix
spare prism
#

I want my armorstand to go up, but it doesn't go up. Why?

    @Override
    public void animate() {
        if(getSoulEntity().isDead()) return;

        Vector vector = new Vector(0f, 0.5f, 0f);
        ArmorStand armorStand = (ArmorStand) getSoulEntity();

        ItemStack skullItem = new ItemStack(Material.PLAYER_HEAD);
        SkullMeta skullMeta = (SkullMeta) skullItem.getItemMeta();
        skullMeta.setOwningPlayer(Bukkit.getOfflinePlayer(UUID.fromString(Main.getInstance().getConfigManager().getConfig().getString("SoulHeadOwner"))));
        skullItem.setItemMeta(skullMeta);

        ItemStack armorItem = new ItemStack(Material.LEATHER_CHESTPLATE);
        LeatherArmorMeta leatherArmorMeta = (LeatherArmorMeta) armorItem.getItemMeta();
        leatherArmorMeta.setColor(Color.fromRGB(Main.getInstance().getConfigManager().getConfig().getInt("SoulArmorColor")));
        armorItem.setItemMeta(leatherArmorMeta);

        armorStand.getEquipment().setItem(EquipmentSlot.CHEST, armorItem);
        armorStand.getEquipment().setItem(EquipmentSlot.HEAD, skullItem);

        armorStand.setVelocity(vector);
        Bukkit.getScheduler().runTaskAsynchronously(Main.getInstance(), () -> {
            float i = -180.0f;
            while(!armorStand.isDead()) {
                if(i >= 179.9f) i = -180.0f;
                getSoulEntity().setRotation(i, armorStand.getLocation().getPitch());
                i += 1.0f;
            }
        });

        Bukkit.getScheduler().runTaskLater(Main.getInstance(), armorStand::remove, 5*20L);
    }
quaint mantle
#

I spawned an armor stand with a custom falling block as the passenger which creates a non-collisional block but how can I detect if a player went through the block? https://bit.ly/3fUcCWI

analog prairie
#

Which event is player's Inventory change?

lost matrix
lost matrix
analog prairie
lost matrix
lost matrix
lost matrix
quaint mantle
lost matrix
#

Because your while loop is not bound to ticks. So it will run several thousand times per tick.
So you would get like 500 full rotations per second which the client would not notice at all.
Also calling spigot methods async almost always breaks.

lost matrix
spare prism
severe zenith
#
    @EventHandler
    public void onPlace(BlockPlaceEvent event) {
        if (isInSpawnRadius(event.getPlayer().getLocation()))
            event.setCancelled(true);
    }

    @EventHandler
    public void onBreak(BlockBreakEvent event) {
        if (isInSpawnRadius(event.getPlayer().getLocation()))
            event.setCancelled(true);
    }

    @EventHandler
    public void onMobSpawn(EntitySpawnEvent event) {
        if (isInSpawnRadius(event.getLocation()))
            if (!(event.getEntity().getType() == EntityType.PLAYER)) event.setCancelled(true);
    }

    @EventHandler
    public void onPressurePlateActivition(PlayerInteractEvent event) {
        if (event.getAction() == Action.PHYSICAL)
            if (event.getClickedBlock().getType() == Material.OAK_PRESSURE_PLATE) {
                Location spawn = Bukkit.getWorld("world").getSpawnLocation();
                if (event.getClickedBlock().getLocation().getX() == spawn.getX()
                &&  event.getClickedBlock().getLocation().getZ() == spawn.getZ())
                    event.getPlayer().teleport(spawn);
            }
    }

    public boolean isInSpawnRadius(Location location) {
        if (location.getWorld() != Bukkit.getWorld("world")) return false;
        return Bukkit.getWorld("world").getSpawnLocation().distance(location) <= spawnRadius;
    }
quaint mantle
#

is there a way to get the ID of a plugin (the resource id that comes at the last in the url of a plugin from the code

severe zenith
#

hey does anyone know why this prevents blocks that arent in the spawn radius from dropping items?

latent zephyr
tardy delta
#

unless they specified it somewhere easily accessible

quaint mantle
#

is there a way to get the link of a plugin using resource id?

severe zenith
#

oh wow

lost matrix
quaint mantle
#

package me.goldenred.raidspiders.listeners;

import net.md_5.bungee.api.ChatColor;
import net.minecraft.world.entity.monster.EntityZombie;
import net.minecraft.world.level.World;

import org.bukkit.craftbukkit.v1_17_R1.CraftWorld;
import org.bukkit.entity.Zombie;

public class SpidListeners extends EntityZombie {
public SpidListeners(org.bukkit.World world) {
super(((CraftWorld)world).getHandle());
Zombie craftzombie = (Zombie) this.getBukkitEntity();

    this.setBaby(false);
    craftzombie.setMaxHealth(60);
    this.setHealth(60);

    this.setCustomName(ChatColor.RED + "hello");
    this.setCustomNameVisible(true);



}

} Why cant i import the Entity from nms ?? it imports it from net minecraft WORLD ?? why and I don't have an option ?? who can help ?! I have to import the Zombie ?? H.E.L.P.

lost matrix
lost matrix
tardy delta
#

H.E.L.P. lol

#

like S.O.S.

hollow bluff
#

You can probably just use the one that you already imported

quaint mantle
hollow bluff
#

Show the error

quaint mantle
quaint mantle
#

im watching a tutorial

hollow bluff
#

😐👍

severe zenith
lost matrix
severe zenith
#

thx

analog prairie
#
@EventHandler
    public void InventoryEvent(InventoryEvent event){
        Bukkit.getPlayer("whes1015").sendMessage("1");
    }
spiral light
#

you cant use InventoryEvent

analog prairie
#

Why it look like not work?

open lily
#

What event should I use instead of PlayerPickupItemEvent, because it is deprecated

lost matrix
lost matrix
analog prairie
#

I move item in backpack

spiral light
#

InventoryClickEvent ^^

lost matrix
spiral light
#

how high is the chance that an new small event gets added ?

lost matrix
spiral light
#

BlockDamageStopEvent or BlockDamageAbortEvent ^^

lost matrix
#

On what basis would the detection of such an event stand?

spiral light
#

an packet

#

thats already used to send BlockDamageEvent

#

ServerboundPlayerActionPacket

open lily
# lost matrix Read the javadocs. EntityPickupItemEvent

Thanks. Do you know how can I make player open grindstone? The method openInventory() accepts the Inventory or InventoryView parameter, which I'm not sure how to use. I've had a look at InventoryType enum, however I can't put it in openInventory() method

young knoll
#

You can create an inventory with an inventory type

#

Via Bukkit.createInventory

open lily
#

Thanks

elfin tusk
#
NamespacedKey key = NamespacedKey.minecraft(advancement.toString());
AdvancementProgress progress = player.getAdvancementProgress(Bukkit.getAdvancement(key));
for (String criteria : progress.getAwardedCriteria())
  progress.revokeCriteria(criteria);
``` Does anyone know why this wouldn't revoke the criteria?
spiral light
#

should an new event use CraftEventFactory ?

ivory sleet
#

Wym?

spiral light
#

many events use CraftEventFactory to create & call an event ...

ivory sleet
#

Oh

#

If you have a custom event use PluginManager::callEvent

spiral light
#

if i now try to add a new event to api ... should this use the factory ?

mortal hare
#

does any of you use YAML anchors

#

and know if its possible to use them inside string literals

#

by grabbing not the whole defined string literal but only a fragment of it

ivory sleet
#

Believe they’re not interoperable with strings

spiral light
mortal hare
#

this works:

key: &whole-message |-
  Hey! This is a new literal
  I want to grab this one!

but this won't unfortunately

key: |-
  Hey! This is a new literal
  &grabbed-message I want to grab this one!
ivory sleet
#

Since the style is already sort of like that

#

Using static factory methods

spiral light
#

even more classes to destroy xD

mortal hare
#

is it possible to make it work somehow

#

i really want to refactor it

ivory sleet
#

Maybe if you use sth like a sequence as value

mortal hare
#

without replace

#

wdym sequence

ivory sleet
#

["first", &second]

#

idk tho

mortal hare
#

yea but my key only supports string literals

#

not collections

ivory sleet
#

You can transform it?

mortal hare
#

its not my code

ivory sleet
#

Ah

#

Then Idk

mortal hare
#

but wait

ivory sleet
#

I mean yaml is configurable

mortal hare
#

maybe it does

ivory sleet
#

But not that configurable

mortal hare
#

i have never tested it

#

I was so hyped whenever i learned anchors and aliases

ivory sleet
#

Myeah it’s quite nice

mortal hare
#

well it kinda supports it

#

but it adds brackets

#

in the text

#

rip

ivory sleet
#

oof

mortal hare
#

i mean there's other way

#

create a dummy key

#

and create an anchor there

#

but that's just overkill

ivory sleet
#

Maybe not

spiral light
#

should an event contain a time at all and if possible also gameTicks ?

ivory sleet
#

Idk

#

Don’t think so?

spiral light
#

currently thinking of stuff i dont want to miss while adding BlockDamageAbortEvent which gets called for player stops breaking a block (target another one or smth)

ivory sleet
#

ah

#

Well might wanna talk to md about it

spiral light
#

well then he can do it self or not ? xD

ivory sleet
#

Always nice when people do stuff for you :x

#

He’ll be reviewing regardless

hasty prawn
#

Why not just extend BlockEvent and provide everything that the Damage event provides

spiral light
spiral light
hasty prawn
#

It should have item in hand for sure.

#

And then just leave out insta break.

spiral light
#

but its just player.getInveotry().getItemInMainHand() .... but i think it can have it since the var already exists in the same class too

hasty prawn
#

Ya

spiral light
#

BlockDamageAbortEvent can also have multiple uses... like aborting if block breaks or if rly stops breaking ... but is this worth since blockbreakevent would cover the first use ?

boreal sparrow
#

this event doesnt appear to execute anything... any ideas?
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {

boreal sparrow
#

well thing

#

if(kills == maxkills){
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
onlinePlayer.sendTitle(ChatColor.DARK_RED + "HUNTER WINS!!!", "", 1, 60, 1);
onlinePlayer.playSound(onlinePlayer.getLocation(), Sound.ENTITY_WITHER_DEATH, 100000, 1);
onlinePlayer.getInventory().clear();
onlinePlayer.setGameMode(GameMode.ADVENTURE);
new BukkitRunnable() {
@Override
public void run() {
onlinePlayer.teleport(new Location(Bukkit.getWorld("lobby2"), 0, 65, 0));
kills = 0;

                    }
                }.runTaskLater(Parkour.getPlugin(Parkour.class), 2L * 30L /*<-- the delay */);



            }

        }
spiral light
#

?paste

undone axleBOT
boreal sparrow
spiral light
#

it will run if kills == maxkills and there are players online ^^

boreal sparrow
#

hmm

spare prism
boreal sparrow
#

i just want everything in the for loop to execute for every online player

lost matrix
boreal sparrow
#

but it just doesnt

#

🤔

spiral light
spare prism
lost matrix
boreal sparrow
#

int kills = 0;
private int done = 0;

#

eventhandler is there

spiral light
boreal sparrow
#

anything outside the for loop works fine

lost matrix
boreal sparrow
#

wait

hasty prawn
boreal sparrow
#

i have 2 of those for loops

#

hmm

spare prism
spiral light
spare prism
#

I tried to enable and disable it's gravity

#

and nothing changed

spiral light
#

how do you spawn it ? code ?

lost matrix
hasty prawn
spare prism
# spiral light how do you spawn it ? code ?
    @EventHandler
    public void onEntityDeath(EntityDeathEvent event) {
        Player killer = event.getEntity().getKiller();
        if(killer != null) {
            if(generateChance(Main.getInstance().getConfigManager().getConfig().getInt("SoulChance"))) {
                ArmorStand armorStand = (ArmorStand) event.getEntity().getLocation().getWorld().spawnEntity(event.getEntity().getLocation(), EntityType.ARMOR_STAND);
                GhostSoul ghostSoul = new GhostSoul(armorStand);
                ghostSoul.animate();
            }
        }
    }

    private boolean generateChance(int chance) {
        return chance < ThreadLocalRandom.current().nextInt(101);
    }
hasty prawn
spiral light
spare prism
lost matrix
#

and the animate method

spare prism
#
    @Override
    public void animate() {
        if(getSoulEntity().isDead()) return;

        Vector vector = new Vector(0f, 0.5f, 0f);
        ArmorStand armorStand = (ArmorStand) getSoulEntity();

        ItemStack skullItem = new ItemStack(Material.PLAYER_HEAD);
        SkullMeta skullMeta = (SkullMeta) skullItem.getItemMeta();
        skullMeta.setOwningPlayer(Bukkit.getOfflinePlayer(UUID.fromString(Main.getInstance().getConfigManager().getConfig().getString("SoulHeadOwner"))));
        skullItem.setItemMeta(skullMeta);

        ItemStack armorItem = new ItemStack(Material.LEATHER_CHESTPLATE);
        LeatherArmorMeta leatherArmorMeta = (LeatherArmorMeta) armorItem.getItemMeta();
        //leatherArmorMeta.setColor(Color.fromRGB(Integer.parseInt(Main.getInstance().getConfigManager().getConfig().getString("SoulArmorColor"), 16)));
        leatherArmorMeta.setColor(Color.WHITE);
        armorItem.setItemMeta(leatherArmorMeta);

        armorStand.getEquipment().setItem(EquipmentSlot.CHEST, armorItem);
        armorStand.getEquipment().setItem(EquipmentSlot.HEAD, skullItem);

        armorStand.setVelocity(vector);
        Bukkit.getScheduler().runTaskAsynchronously(Main.getInstance(), () -> {
            float i = -180.0f;
            while(!armorStand.isDead()) {
                if(i >= 179.9f) i = -180.0f;
                getSoulEntity().setRotation(i, armorStand.getLocation().getPitch());
                i += 1.0f;
            }
        });

        Bukkit.getScheduler().runTaskLater(Main.getInstance(), armorStand::remove, 5*20L);
    }
spiral light
#

small or big plugin is completly shit ... if you read values all the time again and again its unwanted lagg you can easy abort

lost matrix
hasty prawn
#

Would setGravity prevent the velocity from being applied for some reason?

#

I wouldn't think so

elfin tusk
spiral light
#

what was that .... if you use a jira request as base you have to name the fork of spigot/bukkit to the same id+name ? @ivory sleet

tardy delta
#

how do you run a plugin in the intellij console?

#

i saw the spigot server running in some peoples console window

quaint mantle
tardy delta
#

oh maven :(

quaint mantle
#

Then idk

broken nebula
#

Hi

tardy delta
tardy delta
#

i think i need allowPublicKeyRetrieval set to true for my hikari pool which is connected with a mysql db

#
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public Key Retrieval is not allowed```
https://stackoverflow.com/questions/50379839/connection-java-mysql-public-key-retrieval-is-not-allowed/51132931
grim ice
#

and the values need to be changed without server restart

lost matrix
#

Just update them?

grim ice
#

but your variables are only update to the values you get on enabling

hasty prawn
#

That's what reload sub commands are for

lost matrix
#

You can just update them by reading a file again. I dont understand the problem...

grim ice
#

so the point is just not to access them directly

lost matrix
#

It also helps with a fail fast approach.
Its way more difficult to find errors after 10mins when the config gets eventually accessed instead of right when the server starts.

brave sparrow
#

File access is also slow. You don’t want to be constantly hitting the file system in your main game thread if you don’t have to be

lost matrix
#

Example:

public class PluginConfig {

  private final Supplier<FileConfiguration> configSupplier;
  @Getter
  private boolean portalsEnabled;
  @Getter
  private int messageTimeout;

  public PluginConfig(Supplier<FileConfiguration> configSupplier) {
    this.configSupplier = configSupplier;
    reload();
  }

  public void reload() {
    FileConfiguration configuration = configSupplier.get();
    portalsEnabled = configuration.getBoolean("some.path");
    messageTimeout = configuration.getInt("some.other.path");
  }

}
  @Override
  public void onEnable() {
    PluginConfig pluginConfig = new PluginConfig(this::reloadAndReadConfig);
  }

  private FileConfiguration reloadAndReadConfig() {
    reloadConfig();
    return getConfig();
  }
#

imposter is writing...

tardy delta
#

why a supplier :C

lost matrix
tardy delta
#

it reloads it when you call reload 🤡

#

and when making a new object

lost matrix
#

Doesnt that create a new instance of FileConfiguration?

lost matrix
tardy delta
#

mwoa okay anyways is this an alternative to this code?

userMap.entrySet().removeIf(entry -> entry.getValue().getPlayer() == null);```
```java
for (Iterator<User> iterator = userMap.values().iterator(); iterator.hasNext();) {
            if (iterator.next().getPlayer() == null) {
                iterator.remove();
            }
        }```
tardy delta
#

i need an counter variable tho so im stuck to the second one :(

lost matrix
#

You can also have a counter for the first one.

#

Do you just want to have the total amount removed after the whole iteration or make the counter a condition?

tardy delta
#

i want to have the total removed entries

lost matrix
#

Then just calculate the delta of the userMaps size...

tardy delta
#

the wha- is the delta

#

ah i get it

grim ice
#

userMap.size()
userMap.entrySet().removeIf(entry -> entry.getValue().getPlayer() == null);
userMap.size()

#

wont that work

lost matrix
#
    int before = userMap.size();
    userMap.entrySet().removeIf(entry -> entry.getValue().getPlayer() == null);
    int removed = before - userMap.size();
grim ice
#

lol

#

ye

tardy delta
#

ah yea got me thinking for a while

#

learned that years ago :C

lost matrix
#

If you really want to count up:

    AtomicInteger counter = new AtomicInteger();
    userMap.entrySet().removeIf(entry -> {
      if (entry.getValue().getPlayer() == null) {
        counter.incrementAndGet();
        return true;
      }else {
        return false;
      }
    });
    int removed = counter.get();
tardy delta
#

mwoa its the same

#

and its sync

mint raft
#

Excuse me, I'm making a spigot plugin , but I got an error.
Here it is:

[16:45:46] [Server thread/ERROR]: Error occurred while enabling MBC-T2 v1.5.11 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "smile.main.mbct2.MBCT2.getCommand(String)" is null
    at smile.main.mbct2.MBCT2.onEnable(MBCT2.java:23) ~[MBC-T2-1.5.11.jar:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugin(CraftServer.java:564) ~[paper-1.18.1.jar:git-Paper-165]
    at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugins(CraftServer.java:478) ~[paper-1.18.1.jar:git-Paper-165]
    at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:727) ~[paper-1.18.1.jar:git-Paper-165]
    at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:503) ~[paper-1.18.1.jar:git-Paper-165]
    at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:313) ~[paper-1.18.1.jar:git-Paper-165]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1202) ~[paper-1.18.1.jar:git-Paper-165]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.18.1.jar:git-Paper-165]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
#

My plugin's code:(main.java)

package smile.main.mbct2;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
import smile.main.mbct2.commands.*;

public final class MBCT2 extends JavaPlugin implements Listener {

    @Override
    public void onEnable() {
        System.out.format(ChatColor.AQUA+"MBC-T2正在加載..."+ChatColor.WHITE);
        getCommand("mbc").setExecutor(new mbc());
        getCommand("location").setExecutor(new location());
        getCommand("locationall").setExecutor(new locationall());
        getCommand("claimhelp").setExecutor(new claimhelp());
        getCommand("shovel").setExecutor(new shovel());
    }

    @Override
    public void onDisable() {
        System.out.format(ChatColor.RED+"MBC-T2正在關閉..."+ChatColor.WHITE);
    }


}

line 23 is getCommand("claimhelp").setExecutor(new claimhelp());

grim ice
#

register

#

on plugin yml

lost matrix
#

probably

quaint mantle
#

Is it possible to send a plugin message from bungeecord without any players online?

mint raft
#

I found the mistake
Thank you👍🏼

tardy delta
#

also having the database impl and the cache in one class worries me

lost matrix
#

Any reason why you dont just use Caffeine?

tardy delta
#

i only know the coffee one ._.

#

its a caching service i see

lost matrix
#

LoadingCache for example.
Its a map that returns an element if it is present or loads it with the given loading function, then saves and returns it.
Also supports functionality to add a persisting function for when an element is removed from the map and
automatically lets entries time out after a period of time when they dont get accessed.

waxen plinth
#

Honestly I wish we just had an auto-response when people post NPEs here

tardy delta
#

i was more thinking about the guava cachebuilder in my prev. design but anyways

waxen plinth
#

Because 9/10 times it is the exact same oversight

#

It's especially bad because new NPEs literally show you exactly what is going wrong and people are still just help "pls halp how do fix"

lost matrix
waxen plinth
#

Yeah

tardy delta
#

read stacktraces duke

#

this looks about the same as the guava cachebuilder ._.

Cache<String, DataObject> cache = Caffeine.newBuilder()
  .expireAfterWrite(1, TimeUnit.MINUTES)
  .maximumSize(100)
  .build();```
graceful oak
#

Is it possible to change the enchant glow color or would that be a texture pack situation? Ive been trying to find something like it but all I can find is texture pack related

lost matrix
#

resource pack. Minecraft doesnt have more effects for ItemStacks other than the enchantment glow

tardy delta
#

texture pack

graceful oak
#

alright thanks

tardy delta
#

why is this man putting backticks?

#

was that to prevent sql injection or am i wrong?

#

i remember those were ?'s but i dunno

ivory sleet
#

But it’s just so much more powerful

tardy delta
#

i remember backticks from js who were also powerful 🤡

quaint mantle
tardy delta
#

there is no reserved keyword used

#

atleast i dont see

spiral light
#

hmmm how can i undo adding something in git.... somehow makePatches did not work but the file that i changed also does not exist anymore

quaint mantle
#

like statistics or member

tardy delta
#

oh maybe he's living in the future

worldly ingot
#

It's also a preference thing

quaint mantle
worldly ingot
#

I had worked with people that put backticks on their database and table names

worldly ingot
#

e.g.

SELECT * FROM `database`.`thetable`
worldly ingot
#

:(( why is there no good formatting on that

tardy delta
#

oeh fancy @Language

worldly ingot
#

There's a code block! Use spaces! lol

tardy delta
#

does it hurt your eyes?

worldly ingot
#

:(( yes

tardy delta
#

aah this does

worldly ingot
#

And yeah, @Language is a Jetbrains annotation. Jetbrains IDE will actually interpret the string in that language and do some syntax validation for you

#

Kind of wish Eclipse would support that annotation

quaint mantle
#

Use intellij :)

worldly ingot
#

I tried a few times and never liked it

#

Been using Eclipse for 7 and a half years

quaint mantle
tardy delta
#

i think if i would ever use eclipse something in my brain would break

tardy delta
worldly ingot
#

Yeah, it's a preference thing

tardy delta
#

uhu

#

why are people using a white backcolor 😔

quaint mantle
spiral light
#

i see bad sql design

quaint mantle
worldly ingot
#

Lots of null stuff. Perfect opportunity to make use of relational data structures

quaint mantle
#

Thats just a view!

worldly ingot
#

locations should be in a separate table for instance with a foreign key to the clan id

spiral light
#

also saving everything in just 1 table is weird

quaint mantle
#

Thats not a table! I use the view to load everything i with a single statement

spiral light
#

still dont like it 😄

#

but its probably more sql that i dont like

quaint mantle
#

what should i do instead

kindred aurora
#

Cancel falling block conversion to item

spiral light
#

you can use it ^^ but i used to code my own database with socket connection and stuff like that ... just for fun

quaint mantle
#

🆗

ivory sleet
spiral light
#

its not because of that ^^

ivory sleet
#

Then why do you dislike sql?

spiral light
#

a reason is this ^^

analog prairie
#

Can I calculate the player's walking distance?