#help-development

1 messages Β· Page 1163 of 1

proper cobalt
#

HEADS never contains any values

cinder abyss
#

no because I'll use custom model data, so I need to use an ItemDisplay

proper cobalt
#

is bukkit yml busted

chrome beacon
#

contact-gui-letters is not a list

#

So you can't use getStringList on it

proper cobalt
#

oh what is it

#

just a section?

chrome beacon
#

yes

proper cobalt
#

                for (final String key : MESSENGER_FILE.getConfigurationSection("texts.contact-gui-letters").getKeys(false)) {
                    HEADS.put(key, MESSENGER_FILE.getString("texts.contact-gui-letters." + key));
                }
chrome beacon
#

You can loop getKeys(false)

proper cobalt
#

so like this

#

aight

chrome beacon
#

yes

eternal oxide
#

from the broken blocks location

cinder abyss
#

ooh okay

#

and what about the X and Z ?

eternal oxide
#

the display you want should always be +0.4 on all axis from the broken block

cinder abyss
#

so I substract -0.4 ?

eternal oxide
#

block location + 0.4

cinder abyss
#

here are the locations for this configuration

eternal oxide
#

shoudl give you the ItemDisplay location

proper cobalt
#

ye that worked thanks Olivo

cinder abyss
#

when breaking the top left one, it breaks the bottom right one

cinder abyss
eternal oxide
#

it may be +0.5 but try it and see

cinder abyss
#

okay thanks

eternal oxide
#

Block location is based on its corner, ItemDisplays are centered

cinder abyss
#

I see

eternal oxide
#

so shoudl alway be +0.4 or +0.5 to find the correct display

cinder abyss
#

so I need to make it's position like a block/BlockDisplay

eternal oxide
#

block.getWorld().getNearbyEntities(block.getLocation().add(0.5,0.5,0.5) ,0.1 ,0.1, 0.1)

#

you can also predicate for an ItemDisplay too, then you'll only get teh one

young knoll
#

You can also tag your item displays with some pdc

#

To be extra safe

stuck oar
#

can i make like huge itemdisplays just in spigot

cinder abyss
blazing ocean
stuck oar
young knoll
#

Item displays

#

That’s literally the entity name

stuck oar
#

oh ye just found it on the api lol

#

thanks

proper cobalt
#

why doesnt it work

#

the inventory stays open

wet breach
#

since its always open

proper cobalt
#

no its like a custom gui

#

chestgui from Inventory framework

worldly ingot
#

They probably have some listeners that prevent inventory closing

river oracle
#

Should work if it's open is it really open when you call the close?

#

Is it flickering?

proper cobalt
#

u can close it normally if u want

#

but when u call that method

#

nothing

river oracle
#

What version?

eternal oxide
#

are you calling close in a click event?

proper cobalt
#

1.19.4

river oracle
#

You're doing something wrong here

proper cobalt
river oracle
#

Ohppee

proper cobalt
#

InventoryClickEvent consumer

eternal oxide
#

do it 1 tick later

proper cobalt
#

aight thanks g

proper cobalt
#

link that

eternal oxide
#

in the javadoc for the click event

remote swallow
#

?jd-s

undone axleBOT
proper cobalt
#

ye the inv closed

#

nice one

dawn plover
#

Hey hey, i updated my spigot api for my plugin from 20.1 to 21.3
in this update, i noticed that Enchantment.DURABILITY seems to not be a thing anymore. and it now is Enchantment.UNBREAKING. But i currently found out by breaking my code,
However, i was wondering if there is a changelog where i can find everything in a nice list just like mojangs changelog?

proper cobalt
#

is it possible to make itemstacks amount like 1, but like actually show the number 1

proper cobalt
dawn plover
#

but that probably is a mod and not a plugin

proper cobalt
#

na obv not

dawn plover
#

plugin is only server sided, while that number is client sided

proper cobalt
#

kk

dawn plover
#

not the quantity ofcourse

river oracle
#

Just retexture every item with a 1 kekw

dawn plover
#

and besides, its also pretty much the only way to do that for the 3d items

#

But before you do that, If yea want the 1, you can also think in alternative ways. Is there for example an empty item slot nearby (below, or on the right for example)
What you can do is in that itemslot, place an item that you retexture to be the one, and make the texture with such an offset that it apears to be 1 slot highter / 1 slot to the left

#

a good example are these locks and checkmarks for example. Those are not actually part of the item below it, but instead are in a slot above it

quaint mantle
#

hey, i made a new project on IntelliJ but instead of showing life com.fourseven.skyblock like a package it shows as separated directorys, also i can't create packages, i just can create directories

remote swallow
#

Use a build system. And reload it

quaint mantle
#

wdym?

#

like adding maven?

remote swallow
#

Maven or gradle

quaint mantle
#

i thought abt that, but i wasn't that sure, it does work

#

ty

#

so i'm doing a plugin recode and copied the pom.xml, reloaded IntelliJ and now i have my proyect skyblock-recode like this

#

sorry if it's a stupid/easy-to-solve question

north nova
#

ur module name is different from directory

quaint mantle
#

I know, how can i un-do that?

#

I just copied the proyect i want to recorde pom.xml but that happened

north nova
#

u can move things where they need to be lol

quaint mantle
#

My module name turned into the other plugin name

#

and the directories i created for the recode are now inside the module

chrome beacon
#

It usually gives a brief overview on the major changes

cinder abyss
#

Hello, what is the wiki to see how is made the packet for PacketType.Play.Server.ENTITY_DESTROY ? (I want to get the entity involved)

quaint mantle
cinder abyss
#

thanks

quaint mantle
#

np

#

also

#

wiki.vg has mojang mappings, you can search spigot mappings in mappings.dev

chrome beacon
#

Wiki vg doesn't really use any specific mappings

quaint mantle
#

Well yeah you right, i forgot it uses packet ids

#

i'm sorry

quaint mantle
#

no problem πŸ˜‰

waxen acorn
#

Did Attribute constants got renamed in latest API? My plugin code seems to be broken after the update to 1.21.3

pliant topaz
# quaint mantle My module name turned into the other plugin name

seems like the pom created (in its sense missing) directories/modules for it. Personally I redo the pom manually in such a case just to update everything and often its not too much work. I would just move/rename your packages to desires place/name, update the pom accordingly and call it a day :)

chrome beacon
#

but your old plugin jar should continue to work

quaint mantle
chrome beacon
#

Or if you're trying to compile against the newer version you'll need to change the code

waxen acorn
#

I know the server will do some ASM magic for me. Uh I'll have to face the tough renames in code...

#

tysm

quaint mantle
#

How do patches work?

#

Maybe a idiot question ik 😭

#

But i never understood them

chrome beacon
#

A patch usually just stores a diff

#

Or a difference between two files

pliant topaz
#

afaik basically do what the name says, patch some stuff over other stuff, like patching a road and putting new stuff ontop of old

#

olivo said it better

quaint mantle
#

But what do they exactly do?

nova notch
chrome beacon
#

Basically turning the old file in to the new file you want

#

A patched file if you will

quaint mantle
#

Ohhhh like they modify the file

chrome beacon
#

For example Spigot uses patches to take the decompiled code and apply their changes on top

quaint mantle
#

Ohh i see

pliant topaz
#

Microsoft restricts others of constributing modified software of them, so by having patches the original source code is used as a base and only modified at the users end, basically a way of altering software without breaking their policy

chrome beacon
#

Legal gray zone

quaint mantle
#

But why do forks use that? can't they just grab the code in java and manually code it? (sorry if im so wrong)

pliant topaz
#

nope

#

Because theres still some copyrighted code from microsoft in there

chrome beacon
#

You cannot redistribute Mojangs code

#

So you just distribute the changes

quaint mantle
#

Oh yeah i totally forgot about that

waxen acorn
#

they are just patches

quaint mantle
#

But is it possible? maybe if i want to do a private fork

chrome beacon
pliant topaz
quaint mantle
#

Afaik you can use microsoft code just for you, right?

waxen acorn
chrome beacon
quaint mantle
pliant topaz
#

kinda funny how it can get really messy easily

waxen acorn
#

they have Hygot

chrome beacon
quaint mantle
pliant topaz
chrome beacon
#

No need to go that route

chrome beacon
#

You can just use the patch tooling on your private fork too

remote swallow
#

The chain is infinite

#

It's all forks, always has been

waxen acorn
quaint mantle
waxen acorn
#

it is interesting to have GPL on Bukkit

#

it totally does not work with Mojang code but still exists so what is the meaning of it

#

just protect Bukkit itself?

quaint mantle
#

I wonder what's CraftBukkit creator doing right now

waxen acorn
#

I had no interest on these legal issues as current dev env had solved this for us but interesting to learn why

chrome beacon
#

Bukkit is just the API so it works fine

pliant topaz
chrome beacon
#

CraftBukkit is a bit different

waxen acorn
quaint mantle
#

Bukkit is API CraftBukkit is server

quaint mantle
waxen acorn
#

I remembered that CB uses LGPL

quaint mantle
#

i'm so glad evilseph and md_5 didn't forget about the project after EULA update

pliant topaz
#

yea

quaint mantle
#

yeah

pliant topaz
#

then we wouldnt have spigot, paper, purpur, pandaspigot and all the other forks out there all depending on each other

waxen acorn
#

yeah Spigot is where the modern MC server plugin modding begins

pliant topaz
#

altough spigot isnt used much anymore its one really important piece of software we have to keep going

quaint mantle
pliant topaz
#

basically

waxen acorn
kind hatch
pliant topaz
#

i know paper had some plans on hardforking, but thats not really a good option, spigot is really the backbone of everything

waxen acorn
#

so Spigot is still important for everyone

quaint mantle
#

Minecraft servers would not be that famous without craftbukkit

waxen acorn
#

but what incompatible change will happen if hardfork really happens?

#

will all Deprecated Spigot methods in Paper got removed?

quaint mantle
#

in the case craftbukkit and spigot got discontinued on EULAs changes, servers would still in 1.7.10, servers would not be popular or they would be so many forks out there

kind hatch
quaint mantle
waxen acorn
#

I don't like incompatible class change errors, really painful haha

pliant topaz
#

Sometimes I think back to mojangs 'Modding API' which has never seen the daylight because 'theres so many community option available so an official api is not necessary but then on the other hand, just these immense constributions like spigot, forge, paper, bukkit, fabric etc etc, im kind of glad they never did it, especially as we're now basically capable of doing what their api would allow us to without their api

cinder abyss
#

Hello, I want to reproduce EntityRemoveEvent for before 1.20.4 by using Protocollib
Everything is working except the fact that the packet is sent after the entity was deleted, so how can I get the entity before it's deleted ?

quaint mantle
#

i recommend using last spigot version

cinder abyss
#

1.20.4 is REALLY young

quaint mantle
#

i mean you can use viaversion

waxen acorn
#

just give it a try first, if it work then you can do backports

quaint mantle
#

and viabackwards

cinder abyss
waxen acorn
#

so it works on 1.20.6 but not on 1.20.4?

cinder abyss
#

I want to support more, but EntityRemoveEvent doesn't exist before

cinder abyss
pliant topaz
#

then you may have to implement it yourself

waxen acorn
cinder abyss
#

but I want to support before 1.20.4

quaint mantle
#

what's entityremoveevent

spice cove
#

i can post a paper plugin as a resource under spigot right?

quaint mantle
#

imma go read javadocs

cinder abyss
spice cove
waxen acorn
quaint mantle
cinder abyss
#

"Called when an Entity is removed.
This event should only be used for monitoring. The result of modifying the entity during or after this event is unspecified. This event is not called for a org. bukkit. entity. Player."

spice cove
pliant topaz
pliant topaz
waxen acorn
quaint mantle
waxen acorn
#

that is how I define Paper-only plugins

spice cove
#

cuz i've seen paper plugins posted as a resource

kind hatch
quaint mantle
cinder abyss
#

Because my entity is a ItemDisplay

quaint mantle
cinder abyss
#

it's not a LivingEntity

kind hatch
#

It's not a living entity

waxen acorn
quaint mantle
#

yeah right

cinder abyss
cinder abyss
quaint mantle
#

saw it, sorry

waxen acorn
pliant topaz
cinder abyss
#

interesting

waxen acorn
#

But it will be tough to read patches instead of patched code

cinder abyss
#

where can I find them/patched code (so what I need basically) ?

waxen acorn
#

then just search for references to what you want to see then you'll found how it works

wet breach
quaint mantle
#

Update spigot

spice cove
#

so i wanna post my plugins on spigot, and i've heard paper has more things and most servers are paper, spigot works in them too. should i use paper or spigot?

quaint mantle
#

look at jd

waxen acorn
spice cove
#

is it anything that is used often

waxen acorn
#

Actually my preference is Paper as I'm a minigame dev and Paper acts actually better on minigames

quaint mantle
kind hatch
wet breach
waxen acorn
cinder abyss
wet breach
#

When health reaches 0 run your custom event

echo basalt
#

EntityRemoveFromWorldEvent

#

type shit

quaint mantle
#

What's the difference between 20.0 TPS and *20.0 TPS

cinder abyss
#

there is health for ItemDisplay ?

north nova
kind hatch
wet breach
#

All entities have health

echo basalt
#

LivingEntity be like

wet breach
#

Items have like .5 if i remember right

quaint mantle
cinder abyss
#

yeah but didn't though it was monitored

waxen acorn
echo basalt
#

non-living entities don't have health

#

πŸ™„

quaint mantle
echo basalt
#

they're either dead or alive

waxen acorn
#

so if it is damageable it should have

cinder abyss
wet breach
waxen acorn
waxen acorn
#

that is common structure for plugin dev

echo basalt
#

Not properly

quaint mantle
echo basalt
#

They can "die" but they don't track health

#

Their damage method insta-kills them

cinder abyss
#

but DamageEvent works on them then ?

waxen acorn
#

techinally right but is there a value tracking health?

quaint mantle
#

afaik vehicles have health, and they aren't living entities

echo basalt
#

frosty don't try to debate over this imma just copy-paste the entire nms entity class and whoop your ass

kind hatch
cinder abyss
waxen acorn
#

and implement by yourself, it seems to be tough but really a working way

cinder abyss
#

ik ik

#

but maybe if I can use DamageEvent that'll be better

waxen acorn
#

So I just wondering if API backports is possible on Spigot?

quaint mantle
#

Bro just do it by yourself

waxen acorn
cinder abyss
#

I'll just try, it costs nothing

echo basalt
wet breach
#

Items have a health of 5 and reduces to 0

echo basalt
#

Items have health and they happen to be non-living, this doesn't mean that every non-living entity has health too

#

For example, marker armorstands

#

Or area of effect clouds

cinder abyss
#

pretty sad

sly topaz
wet breach
#

Armorstands have health too. Just if they are invisible they are invulnerable

cinder abyss
#

I monitored 4 killed rabbits

sly topaz
#

you are free to fork Spigot and backport API there though

cinder abyss
#

but not my ItemDisplay

echo basalt
#

Marker armorstands are separate

#

ItemDisplays don't have health

#

This is a "marker"

waxen acorn
sly topaz
waxen acorn
#

Whoah, Mixins on Bukkit?

#

really hackful but useful on private use, not suitable for distrubted plugins

#

as I don't think will it work with hybrids as I'm a cross platform dev haha

wet breach
#

I would have to look at mc code to see exactly what it does though

sly topaz
echo basalt
#

There's also minecarts

#

Which are non-living but get hurt

sly topaz
#

would barely call that an hybrid considering it was built from the ground up to be compatible with forge

#

anything else is just a disaster

#

there's solutions like architectury but it doesn't support bukkit so it is all the same

cinder abyss
#

hum

#

I've got the patch that I need

#

but I don't really see what to do with it

#

should I just loop every tick for killed ItemDisplay entities ?

#

and check with the old list, and get the killed entity in the old list basically

sly topaz
#

I'd try weak references to the entities

sly topaz
quaint mantle
#

we should have a command like ?downgrade that answers with the md_5 answer to a thread

sly topaz
#

eh, those commands are somewhat aggressive, ideally you just answer their question with a warning that it is unsupported so they'll have to figure stuff out

#

most if not all of the support threads are for older versions too so it is hard to expect people not asking questions about older versions

#

discord killed any kind of searchability issues with spigot/paper had

waxen acorn
sly topaz
#

it's useless to check that kind of thing, since it often hooks into inaccessible code from a plugin

waxen acorn
#

yes maybe tough in that situtation but will be good as a start to understand it

cinder abyss
waxen acorn
#

so it is time to find workarounds

#

uh really a useless sentence

waxen acorn
cinder abyss
#

sure

sly topaz
#

-# just hook into the method with CGLib

cinder abyss
#

oh

sly topaz
#

I was kidding

#

runtime bytecode manipulation go brr

waxen acorn
cinder abyss
waxen acorn
#

particularly 17+

sly topaz
waxen acorn
#

they had suggest ByteBuddy as fallback haha

sly topaz
#

it made hooking into methods you didn't have access to really easy

#

bytebuddy is fine, but it isn't as easy

waxen acorn
#

yeah I've used it before but its API confuses me

sly topaz
#

still, if I wanted to do some serious backporting of functionality, I would probably go that route anyway

waxen acorn
sly topaz
#

eh, it is fine

#

there's a couple of plugins which do it

#

as long as it is done for versions that aren't updated anymore that is

#

since behavior isn't going to change

waxen acorn
#

then I think they have some good way to do so if they really implemented something we can't imagine

sly topaz
#

anyhow, I gotta keep reading this scala book

#

I can't concentrate more than 5 minutes, my brain is broken

junior geyser
#

Did they change the head rotation packet for 1.21.3?

quaint mantle
#

probably

#

i'm glad most of ppl r updating

unborn goblet
#

Does anyone know why PersistentDataContainers are not saving any data to the player?

#

bro this old username

nova notch
#

same and they really want you to pay like $10 to change it

sly topaz
#

how is it not saving data, like, you restart the server and it isn't there?

unborn goblet
sly topaz
#

that just leaves me more confused lol

#

when you set into the PDC, it should save the data to its respective playerdata

#

though I don't know if it does so as soon as you write it, or it is done in batches to avoid doing too much IO

#

the way minecraft handles saves is rather (unfortunately) undocumented

unborn goblet
sly topaz
#

or was it /world-save, something -save

#

it should do that automatically, but maybe you're closing the server before it has the chance to

#

though if you close it the proper way, it should definitely save before close

unborn goblet
#

Is it possible to save pmc and get those new changes in the same method?

sly topaz
#

how are you using PDC

#

because what you're saying isn't making sense

unborn goblet
#

Ah I’ll just send my spaghetti code which isnt working

#

Alright so I’ll briefly explain what I’m doing to test this.

#

I’m adding a player using /trust add (player) but when I then do /trust list it shows an empty list

unborn goblet
sly topaz
#

I gotta ask even though unrelated to your question, why in the lord's name is there an atomic reference there

unborn goblet
unborn goblet
sly topaz
#

what does that have to do with an atomic reference

#

did you use it so IDE wouldn't complain about the perceived lifetime of the variable?

#

you can just use an array with a single element if that's the case

#

an atomic reference however has thread-safe checks which are overkill for whatever you're doing there

worldly ice
#

or just use a regular for-loop

unborn goblet
unborn goblet
worldly ice
#
String playerName = null;
for (Entity entity : worldEntities) {
  if (entity.getName().equals(strings[1])) {
    playerName = entity.getName();
    break;
  }
}
#

you should just be able to do that

#

no reason to use a foreach there

worldly ice
#

as for you issue PersistentDataContainer#get might return a copy of the list

#

so you'd have to set it back after you mutate the list

#

and i will also say your (im assuming) limit of 30 trusted players is done in a very convoluted way

#

just check if the length of the list is >= 30 or something

#

if it is don't add the player

unborn goblet
#

I’ll change that later

worldly ice
#

lists can be any size?

worldly ice
#

they allocate memory dynamically

unborn goblet
#

I’ll try that when I can

unborn goblet
worldly ice
#

oh i see why

#

its because #get returns an immutable view of the list

#

changes to the original list are reflected but you aren't able to make any modifications yourself

unborn goblet
worldly ice
#

create a new ArrayList<>(trustedPlayers)

#

modify that list

#

set the pdc back to that list you just created

unborn goblet
#

Ok tysm 😭

#

I’ll try this out once I can but thank you regardless !

worldly ice
#

yeah np! if you encounter any more issues feel free to ask again

quaint mantle
#

what's the best way y'all know to make a singleton

rough ibex
#

Enum

#

Effective java

#

Item 3

#
// Enum singleton - the preferred approach
public enum Elvis {
INSTANCE;
public void leaveTheBuilding() { ... }
}

This approach is similar to the public field approach, but it is more concise,
provides the serialization machinery for free, and provides an ironclad guarantee
against multiple instantiation, even in the face of sophisticated serialization or
reflection attacks. This approach may feel a bit unnatural, but a single-element
enum type is often the best way to implement a singleton. Note that you can’t
use this approach if your singleton must extend a superclass other than Enum
(though you can declare an enum to implement interfaces)

sly topaz
#

the benefits of this over just doing a normal singleton with a static final class are not worth the unreadability of that code, the intent isn't clear at all here

vagrant stratus
#

@chrome beacon
I saw this re-linked in general
https://hypixel.net/threads/dev-blog-6-keeping-up-with-the-masses.2251554/
We added an ID to the NBT compound, then when we first compare items, if they are equal we sync up their IDs and we know for certain that they’re the same, we also track the parent of each NBT Tag, so when something changes within it we change the ID and thus the process begins again, this makes it much faster for us to do just as many comparisons.

How possible do you think this would be for the item monitoring plugin? There'd definitely have to be a bunch of checks (and NBT calls, obviously) so that vanilla functions as expected, but I think that it would make things easier?

chrome beacon
#

I've never said they don't mess with nms

#

What I did say is that they most likely still use the patch tooling

vagrant stratus
vagrant stratus
smoky anchor
#

well it looks like you're not setting the Lore tag if it does not exist

#

Are you just modifying vanilla code ?
With MCP or something ?

#

Well I wish you the best of luck with whatever you're doing
'cause that version is incredibly limited and has shitty code as far as I know

near furnace
#
public void sendActionBarWithFade(Player player, String message) {
        // this is the fade in code
        int defFadeInTime = 1;

        for (int i = 0; i <= defFadeInTime; i++) {
            Bukkit.getScheduler().runTaskLater(plugin, () -> {
                player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(ChatColor.RED + message));
            }, i);
        }

        int defSecondsLeft = 15;

        for (int secondsLeft = defSecondsLeft; secondsLeft >= 0; secondsLeft--) {
            int delay = defFadeInTime + (defSecondsLeft - secondsLeft) * 20;
            int finalSecondsLeft = secondsLeft;

            Bukkit.getScheduler().runTaskLater(plugin, () -> {
                if (finalSecondsLeft > 0) {
                    player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(ChatColor.RED + message + " (" + finalSecondsLeft + " seconds left)"));
                }
            }, delay);

            Bukkit.getScheduler().runTaskLater(plugin, () -> {
                player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(ChatColor.GREEN + "You are no longer in combat. You may leave the game now"));
            },defFadeInTime + (defSecondsLeft + 1) * 20);
        }

        Bukkit.getScheduler().runTaskLater(plugin, () -> {
            player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(ChatColor.GREEN + "You are no longer in combat. You may leave the game now"));
        }, (defSecondsLeft + 1) * 20 + defFadeInTime);
    }```

Can anyone tell me why the final "You are no longer in combat. You may leave the game now" message won't show up for 20 ticks after the countdown
blazing ocean
near furnace
#

an action text countdown, 15 seconds to 1, then it says "You are no longer in combat" in green text

#

i made it a method so i can use it in my combat thingy

blazing ocean
#

and why the weird fade thing?

near furnace
#

yeah

#

ill remvoe it

#

i thought it was going to act like a fade effect like in titles

#

but action bars are stiff, they dont have any fade effects

blazing ocean
#

You just can't change it

near furnace
#

yea, no need for fade effects

#

but can you help me with the problem

#

the final message wont show

near furnace
# blazing ocean and why the weird fade thing?
public void sendActionBarWithFade(Player player, String message) {

        int defSecondsLeft = 15;

        for (int secondsLeft = defSecondsLeft; secondsLeft >= 0; secondsLeft--) {
            int delay = (defSecondsLeft - secondsLeft) * 20;
            int finalSecondsLeft = secondsLeft;

            Bukkit.getScheduler().runTaskLater(plugin, () -> {
                if (finalSecondsLeft > 0) {
                    player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(ChatColor.RED + message + " (" + finalSecondsLeft + " seconds left)"));
                }
            }, delay);

            Bukkit.getScheduler().runTaskLater(plugin, () -> {
                player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(ChatColor.GREEN + "You are no longer in combat. You may leave the game now"));
            },(defSecondsLeft + 1) * 20);
        }
    }```

Here is the code without the weird fade thingies
blazing ocean
#

just run a timer task lol

near furnace
#

timer task? those exist??

blazing ocean
#

task timers

near furnace
#

thank you so much

#

i thought for loops was the only way

#

❀️

fading drift
#

good idea i’m going to use timer task for myself

inland hemlock
#

I want to give players Enderman vision via packets.

                man.setAI(false);
                ClientboundSetCameraPacket cam = new ClientboundSetCameraPacket(((CraftEnderman)man).getHandle());

                ServerPlayer cp = ((CraftPlayer) p).getHandle();
                ServerGamePacketListenerImpl ps = cp.connection;

                ps.send(cam);
                man.remove();```
Problem is that this will teleport the player into the entity and even removing it makes the player unable to move afterwards.. It's liike being in Spectator mode without being in spectator mode. Only way to come around this is killing the player, afterwards he is able to move + has the vision.
Anyone know a possible workaround?
fading drift
#

possibly just packet log the packets that are sent when you exit endermen from spectator mode and send those

inland hemlock
#

Sounds promising, gonna try that ty.

blazing ocean
inland hemlock
#

Didn't know spigot had it

inland hemlock
#

Player has to be in spectator mode for this.

blazing ocean
#

Setting the camera in other gamemodes is extremely buggy and is rather UB

quaint mantle
#

hii

pseudo hazel
#

UB?

inland hemlock
blazing ocean
#

This is pretty much what can happen when you do this

blazing ocean
pseudo hazel
#

alr

blazing ocean
inland hemlock
#

Problem is just that I want to avoid the "killing" the player.

blazing ocean
#

Well hard to kill em without killing em kek

pseudo hazel
#

that still sounds very buggy lol

inland hemlock
#

Yes thats why I am looking for an alternative way?

pseudo hazel
#

shader in a resourcepack

blazing ocean
#

none of that is supported

blazing ocean
#

You can copy the vanilla shader into your shaders and trigger it based on game time

quaint mantle
#

so i saw this deprecated, is there any method i can use instead?

pseudo hazel
#

go through the entries of a team

#

and match the player name

quaint mantle
#

oh alr ty

pseudo hazel
#

iirc player teams are just entries with the players getName()

mortal hare
#

i've just realised that hybrid of both spaces and tabs is the best imo

#

prove me wrong

#

for example i have such table:
Name\tType
Foooo\tCat
Bar\w\w\w\tDog

this would allow me to adjust spacing between columns but wouldnt alter leading padding of the Name column with Bar as a Name

slender elbow
mortal hare
#

but yeah

slender elbow
#

just because teams can contain more than just players doesn't mean that method should be deprecated

#

why not let me get the team of a player? players are valid team members

mortal hare
#

i guess spigot is trying trying to thin out the line between Bukkit API and NMS lately

eternal night
#

"lately"

#

that deprecation has existed forever

slender elbow
#

yeah lol

mortal hare
#

ok

#

im wrong then

eternal night
#

Now, the question is, if I open paper, will we have fixed that COPIUM

#

Good job mm

slender elbow
#

getEntityTeam isn't deprecated, so I can pass an Entity, but i am not allowed to pass an OfflinePlayer? πŸ™ƒ

#

sigh

eternal night
#

damn, yea that method is deprecated since 2015 omegaroll

slender elbow
#

nvm me i'm lookingat the wrong jd run

eternal night
slender elbow
#

i blame papir run

eternal night
#

papir

dry hazel
#

where are you running

slender elbow
#

the rainbow road

eternal night
#

rymiel hopefully

#

or that

cinder abyss
#

Hello, how can I do a synchronous bukkit task from an asynchronous task ?

river oracle
cinder abyss
#

okay thanks

#

seems logical

mellow edge
#

Hello I wonder whether there is a way to place a sponge to not soak up water, like any property or something. I already tried:
-sending block change to the player that the sponge is there (even if it is not), but this works weirdly for example if I send another block change on top of the previous one
-setType(Material.SPONGE, false /*Physics*/)

#

but none work

#

I know I can cancel the absorb event but I wonder whether I can just somehow switch off this behaviour

#

the actual thing I am trying to do is to immidiately place the sponge down, but make it absorb water in stages (customly)

river oracle
#

You need to use the event

thorn crypt
#

Hey, I have this code using NBTApi to put a NBT on an item (made for blocks especially) and i can't pass a door (1.12.2) (Material.WOODEN_DOOR or any type of doors)

public void giveTierBlock(Player player, Material material, int amount, int tier) {
        ItemStack item = new ItemStack(material, amount);
        ItemMeta meta = item.getItemMeta();

        int life = getConfig().getInt("tier." + tier);
        List<String> lore = new ArrayList<>();
        lore.add(" ");
        lore.add("Β§8[Β§7TierΒ§8] Β§c" + tier);
        lore.add("Β§8[Β§7HPΒ§8] Β§c" + life);
        lore.add(" ");
        meta.setLore(lore);
        item.setItemMeta(meta);

        NBTItem nbti = new NBTItem(item, true);
        nbti.setInteger("Tier", tier);
        nbti.setInteger("Life", life);

        player.getInventory().addItem(nbti.getItem());
    }
kind condor
#

Hi can I make my plugin carries a datapack just like mod?

#

I want to make wither no able to break blocks, so I want to add all blocks to #minecraft:wither_immune

young knoll
#

Probably easier to just use a plugin for that

#

EntityExplodeEvent/EntityChangeBlockEvent iirc

bold plume
#

Do I have to stop using creaturespawnevent for my mob plugin because I need to spawn mobs on blocks like clay?

#

When is creaturespawnevent called? Is it called when the chunks are loaded (chunkloadevent) or is it simply a runnable that goes through all players and selects a coordinate for each nearby player and calls the creaturespawnevent for that player?

near furnace
#

can someone help me with my code? i made this countdown thingy for my combat log plugin, and im having trouble with the countdown. I want my countdown to restart everytime a player hits someone but it only registers the first hit.

proper cobalt
#

yo

#

can text displays have more than one color

#

like background color

#

or if i wanted more than one background color i would have to use more than one text display

#

all i see is this

chrome beacon
#

You'd need more than one text display

bold plume
#

int y = world.getHighestBlockYAt(x, z);

    Location randomLocation = new Location(world, x, y, z);
    player.teleport(randomLocation);
bold plume
vast ledge
#

No...

blazing ocean
#

why would it....

vast ledge
#

Since, it's getting... The highest Block at that location?

bold plume
vast ledge
#

What would they suffocate in air?

bold plume
vast ledge
#

Last time I check my feet to suffocate

bold plume
#

wdym

vast ledge
#

The players feet will be inside said block

bold plume
#

getHighestBlockYAt corresponds to the coordinates of an AIR always?

vast ledge
#

Since ur getting the location of the block

vast ledge
#

Isn't*

#

So a solid

bold plume
vast ledge
#

Do + 1 if you want them above, but they won't suffocate either way

bold plume
#

I don't know why this isn't happening

vast ledge
bold plume
#

and the block below the feet is a solid block

vast ledge
#

Without the + 1 or with?

bold plume
#

without the +1

#

idk why

vast ledge
bold plume
#

i'm using getHighestBlockYAt but is the same thing ig

vast ledge
#

That's what the API says

bold plume
#

Maybe Minecraft itself handles unsafely teleports

vast ledge
bold plume
#

everything is ok then

bold plume
vast ledge
#

If you don't add + 1 it should be a solid

#

That's at least what the API says

pseudo hazel
#

if thats incorrect, it sounds like a bug

vast ledge
#

Try logging the location and look what's at that location

proper cobalt
#

btw do u know the method to make the text bigger

#

on a text display

#

cant find it

chrome beacon
#

The transformation has scale

proper cobalt
#

ah yeah

#
        final Transformation transformation = header.getTransformation();
        transformation.getScale().mul(10);
        header.setTransformation(transformation);
#

its not getting any bigger

chrome beacon
#

I would assume scale isn't mutable

#

so mul returns a modified copy

proper cobalt
#

theres no setter for setScale tho

chrome beacon
#

Make a new transformation

proper cobalt
#

yh

#
        final Transformation transformation = header.getTransformation();
        final Transformation transformation1 = new Transformation(transformation.getTranslation(), transformation.getLeftRotation(), transformation.getScale().mul(10), transformation.getRightRotation());
        header.setTransformation(transformation1);
#

idk doesnt do anything

spiral light
#

Is it possbile that if you cancel the InventoryClickEvent because of swapping a item in the inventory to the offend does not work 100% and displays a ghost item in the off hand ?

bold plume
#

switch is faster but uses more processing than if (condition || condition || ...) ?

slender elbow
#

they are two entirely different things

proper cobalt
#

I'm doing this
display.setAlignment(record.isLocal() ? TextDisplay.TextAlignment.LEFT : TextDisplay.TextAlignment.RIGHT);
And putting the text display at a location, but the location is still like the center of the text display

#

not the allignment

#

I'm guessing its cuz when I spawn it, this isnt taken into consideration

#

only after ofc

#

so what can i do?

vagrant stratus
#

Aight before I go copying NMS classes directly into my plugin, any idea on if spigot has something similar to the DifficultyDamageScaler class built into it already? It handles calculating difficulty stuff, used for things like if zombies should pick up loot & stuff like that
NMS class code: https://paste.md-5.net/olosehujoc.java

proper cobalt
outer river
#

hello, a death a equivalent to a world changing (according he respawn in a different world) or i need to use the PlayerDeathEvent in addition of PlayerChangeWorldEvent ?

bold plume
#

In my mob generation plugin that is being made to replace vanilla mob generation, should I run entity#setRemoveWhenFarAway(false) and do my own task to despawn the mobs? If I leave it true, I can't control the mobs that were despawned because they were far from the players, or can I?

proper cobalt
#

guys is it possible to make text displays too long text only downwards instead of up and down??

bold plume
#

For me to control all the mobs that I spawn, can I store them with a List<LivingEntity> or do I have to have a list of all the ids?

sonic goblet
quaint mantle
#

if i have a brigidier command how can i register it so it can show up in /help with the info

river oracle
#

And then make your own help command

eternal night
#

wat

river oracle
#

Bukkit draws from the command map

quaint mantle
#

awhh

#

can i add my comamnd to the command map

river oracle
#

Which I belive should include brig

eternal night
#

grab the servers help map, smack an entry in there

river oracle
#

Top 10 things I didn't know existed

#

Wtf

#

Well there's your answer

quaint mantle
#

when i register a command through the plugin.yml it shows the description and the aliases and the usage

#

where would i put that in the helpmap

river oracle
#

Read the docs

#

The HelpMap is the correct solution

quaint mantle
#

what is a amendment

river oracle
#

Amendment means to add

quaint mantle
#

nvm i was looking at helptopic

eternal night
river oracle
#

Hush

eternal night
#

πŸ‘΄ fair

river oracle
#

Let that set in old man

quaint mantle
#

hey

#

i forgot how to add nms for spigot

young knoll
#

?nms

quaint mantle
#

is it just org.bukkit:bukkit:version

shadow night
river oracle
#

?nms

quaint mantle
#

ok thakns

sly topaz
#

too bad the topic factory requires of a Command subclass

#

one could create a dummy Command that delegates to brig but eh

sly topaz
#

I did know it existed, but forgot of it for the longest time

soft cairn
#

hey guys, is there is any solution for this error when running my plugin(to create Target folder, .jar)Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project firstplugin: Fatal error compiling: error: invalid target release: 21 -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

sly topaz
#

update your Java version, and make sure Maven is using the same version as your project

#

also, don't use the target/source entries, you can use the release entry nowadays to replace these two

#
<groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>idk_your_version</version>
  <configuration>
-    <source>21</source>
-    <target>21</target>
+    <release>21</release>
  </configuration>
...

like this

bold plume
#

Why am I seeing the name "ANIMAL"?

entity.setCustomName("ANIMAL");
entity.setCustomNameVisible(false);

young knoll
#

You’ll always see it when looking directly at them

bold plume
#

but I would like to set a name without being visible

sly topaz
young knoll
#

You’d have to mount a passenger on the entity

#

However this sounds like

#

?xy

undone axleBOT
sly topaz
#

Ctrl + Alt + Shift + S, and where it says project version change it to jdk 21

soft cairn
river oracle
#

Use Java 21

#

Not 23

#

You should download 21

quaint mantle
#

Java is not C#

young knoll
#

Why not

blazing ocean
river oracle
quaint mantle
#

Why bro deleted the messages 😭

river oracle
#

it totally worked btw!

stuck oar
#
            
            CustomFish caughtFish;
            do {
                caughtFish = simulateCatch();
                if (caughtFish == null) return;
            } while (!canCatchFish(player, caughtFish));
            
            handleCatch(player, caughtFish);
            int xpReward = calculateXpReward(caughtFish.getRarity());
            plugin.getPlayerLevels().get(player).addXp(xpReward);
        }```

how can i cancel the vanilla drops from this?

if i use event.setCancelled it doesnt allow the player to reel in the rod
quaint mantle
#

e.getCaught().remove() ?

stuck oar
#

perfect thanks

sly topaz
#

does Spigot also do ASM shenanigans which aren't forwards compatible?

young knoll
#

Yes

sly topaz
#

sadge

#

hope someone smart enough comes along to standarize stuff like that across the various server platforms so that it stops being necessary to explicitly support newer jdk versions

young knoll
#

You won’t see ASM leave spigot any time soon

#

It’s done for backwards compat

sly topaz
#

it isn't about it leaving, it is about figuring out a way to do it without it being a show stopper for newer java versions

young knoll
#

Ask the ASM library devs :p

slender elbow
#

i mean, they can't

#

classfile api πŸ™

river oracle
#

they could if they hired me on

#

I mean I made inventory PR I can pretty much do anything

slender elbow
#

too bad they don't hire

river oracle
#

yep precisely the issue

#

meanwhile I'm on a downstream spigot forks payroll to stop the production of the greatest bukkit competitor ever conceived redacted

eternal night
#

I thought we wanted to keep that private

river oracle
#

I mean theoretically it could be a possibility

#

But definitely isn't

eternal night
#

Exactly NODDERS certainly isn't

river oracle
#

Uh oh I just got a visit from John NDA

#

He's holding a photo of my message

#

Oh god

eternal night
#

Good, next time itll be john lawenforcement

eternal oxide
#

or john concrete shoes

young knoll
#

Speaking of John

eternal night
#

john horse head comes around first

young knoll
#

What happened to John paper

#

Aka aikar

eternal night
#

enjoying steaks

#

I presume

young knoll
#

Fair

#

I thought maybe he ate so many he turned into one

eternal oxide
#

He'd start mooing before that happens.

tawny remnant
#

arrow.setVelocity() acting weird? It shows the arrow going not straight from the player.getLocation().getDirection() but even if a block is not in it's visible trajectory it hits the block. What causes this issue and is it fixable?
Edit: The arrow does travel straight but not it's animation or something like that

young knoll
#

Don’t set it so high

#

The client doesn’t like it

tawny remnant
eternal oxide
#

velocity.length not the height of teh arrow

tawny remnant
#

oh

bold plume
#

Is it more expensive to spawn 100 entities in a location even if there are no players nearby or should I check if there are players in that location to spawn the entities?

tawny remnant
#

wouldnt the entities despawn if there werent players nearby?

bold plume
bold plume
tawny remnant
#

define "best". what do you mean by that

eternal oxide
#

only spawn when there is a reason to spawn. No players = no reason to spawn

bold plume
#

and checking whether there are players close to this area is checked quite frequently

young knoll
#

Check if the area is loaded first

#

Then you can do some distanceSquared checks if you want

eternal oxide
#

and you don;t need precise checks. Just check chuhnk coords of player to the cunk you want to spawn in. +/- X

young knoll
#

That works too

bold plume
eternal oxide
#

much less costly

bold plume
#

can you tell me why

#

because there are more chunks than players

eternal oxide
#

if its not loaded it means there is no player anywhere near

#

um

#

you are doing a spwn system?

bold plume
#

But isn't going through all the chunks more expensive than going through all the players? There are more chunks to go through than there are players online

#

yes

young knoll
#

You don’t go through all chunks to check if it’s loaded

eternal oxide
#

in all chunks?

eternal oxide
#

ie your spawns can happen in any chunk?

bold plume
#

There are more chunks loaded than players too

bold plume
desert aspen
#

Hi guys, im trying to make that all the living entities that spawn have a chance to be a life stealer, and when it hits a player it takes away from them 1 heart, and once a timer runs up they give it back, also i wanna make that the mob are invisible until they attack a player, the error is that:
1 The mob takes away the heart but he won't gave it back
2 The mob spawn as invis but when it attacks a player it stays the same
https://paste.md-5.net/icehubahuf.java
That's the code

#

if anyone could tell me whats the error pls

young knoll
slender elbow
#

alternatively you could pick a random chunk around a player

#

if that chunk is in your "special area" then, run that special logic

young knoll
#

My special area? 😳

bold plume
young knoll
#

Are you sure it does that

bold plume
young knoll
#

I’m going to guess Mojang has some sort of coordinate mapping for chunk lookup

bold plume
#

public boolean isChunkLoaded(int i, int j) {
return this.chunks.containsKey(LongHash.toLong(i, j));
}

#

Does this hashmap not contain all loaded chunks?

young knoll
#

Yes but hashmap lookups don’t work that way

#

Yay hashmaps

slender elbow
#

the "hash" in "hash map" is very important

bold plume
#

Ok, I saw it here and I already got it

#

boolean isChunkLoaded(int var1, int var2); Are the ints the x and z of the coordinates?

slender elbow
#

chunk coordinates

bold plume
young knoll
#

x >> 4 and z >> 4

slender elbow
#

there's also a isChunkLoaded(Location) in case you didn't see it

bold plume
#

and is it possible to get a randomly loaded chunk with cost O(1)?

slender elbow
#

sure, generate a random number between 0 and size of array returned by getLoadedChunks, then get the Chunk at that index

bold plume
#

Ok thank you

young knoll
#

Yay efficiency

#

If only the average developer had more time to care about that these days

bold plume
#

This is the most efficient way, right?

public static Location getRandomLocationInChunk(Chunk chunk) {

    World world = chunk.getWorld();

    int x = chunk.getX() << 4 + random.nextInt(16);
    int z = chunk.getZ() << 4 + random.nextInt(16);

    int y = world.getHighestBlockYAt(x, z);

    return new Location(world, x, y, z);
}
slender elbow
#

looks good

worldly ingot
#

Bonus points for using << because it looks cool 😎

slender elbow
#

actually true and accurate usage of chunk & block coordinates

#

unbelievably based gigachad

bold plume
#

ok thanks

#

For some reason this chunk (and there are many) are loaded LOL: mobSpawn: Location{world=CraftWorld{name=world},x=-2240.0,y=69.0,z=-6815744.0,pitch=0.0,yaw=0.0}; type: COW

#

and the world only has players from -1000 to 1000

chrome beacon
#

You probably loaded it

#

Certain APi calls will do that for you

slender elbow
#

hold up

#

you wanna do (chunk.getX/Z() << 4) + random.nextInt(16)

#

those parentheses are very important lmao

#

@bold plume

#

those coordinates looked very strange

bold plume
#

let me see

slender elbow
#

otherwise, + takes precedence over <<, so you end up doing chunk.getX/Z() << (4 + random.nextInt(16))

#

which is gonna be a lot

bold plume
#

make sense

#

Now it's working perfectly. Thanks

slender elbow
#

i was more so pointing out the fact they were using it

#

ahem

#

many people just do * 16 and call it a day lol

#

negative chunks:

eternal night
bold plume
remote swallow
#

you go up not down

bold plume
#

Does the compiler not replace * 16 with << 4 for example?

slender elbow
#

the compiler doesn't really do many optimisations besides constant folding

#

hotspot does all the cool stuff

violet blade
#

was the infestation potion effect added to the api?

slender elbow
#

except for the edge case where the bits overlap the sign bit but the game will shit the bed before that ever happens

eternal night
#

Yea, your issue basically is that int division -10 / 16 isn't the same as -10 >> 4

stuck oar
#

how do i get methods from a different plugin, ive got the depend: [] in there and the bukkit.getPlugin whatever but im not actually sure on how to get the methods

bold plume
slender elbow
#

yeah but it doesn't hurt to be consistent

chrome beacon
#

After that you should be able to use the other plugins classes

stuck oar
#

I’ve tried it just says something about the spigot repo

chrome beacon
#

Sounds like you didn't put a valid dependency and repo

#

Send the pom

#

?paste

undone axleBOT
stuck oar
#

I didn’t put a repo idk what to put

river oracle
#

Fucks me up hardcore

chrome beacon
river oracle
#

When I'm working with bytes in Java I sometimes forget they're signed

eternal oxide
#

yeah that throws me off at times

stuck oar
worldly ingot
#

PotionEffectType.INFESTED

violet blade
#

yeah for some reason my gradle wasnt importing it correctly but after restarting the IDE i got it to work ty

graceful oak
#

Idk if im not remembering correctly but I swear I have used mining fatigue at a value of -1 before and it makes it so the player cannot break blocks without a slowdown of swing speed but I cant seem to replicate this in minecraft 1.21.1 am I just crazy or did this used to be a thing?

rough ibex
#

Maybe it wrapped around to 255?

#

and high effects tend to mess it up

mortal hare
#

there's nothing more worse

#

than seeing variable naming convention like this

rough ibex
#

they call HEIGHT(c) a lot

nova notch
mortal hare
#

that's linux x11 dwm code for you

#

this code is older than me

#

its somewhere around 23 yrs old

blazing ocean
#

I believe I'm actually changing that code

grand flint
#

If I want to send a player to a limbo when they afk in the backend server should I use the plugin messaging channel?

slender elbow
#

you can do that, yeah

grand flint
#

Also do I need a plugin on the proxy for that?

sly topaz
#

I'd just use something like NanoLimbo

#

can't beat a server specifically built for that

grand flint
#

How should I send the player to nanolimbo

#

Also isn't this a bungee error

fading drift
#

I used to get that with run-paper

#

but I never could fix it

fading drift
#

anyone happen to have a system for player nametag prefixes using teams for 1.8

spice cove
#

is there a way to simulate a player you can control or something

#

like to test a plugin

#

or do u need another acc

sly topaz
# spice cove or do u need another acc

if you don't have another account, just turn online mode off and you can use one of those bot clients to join the server aside from your usual account

#

either that, or spawn a NPC, but it won't do anything unless you send the packets to make it do things, which is way too much work for testing a plugin

#

my usual recommendation instead is to just use a different entity other than a player, since that's easier to spawn and control

spice cove
#

cuz like i need it to send a command

#

im trying a plugin and seeing if that works tho first

sly topaz
spice cove
#

can you see like the messages they get

#

i wanna have like a prompt that says click here and like it runs a command

sly topaz
#

still, why are you not able to test this by yourself

fading drift
#

is there a way to hide a block from a player but show for everyone else

#

like maybe send the player a packet that the block changed to air

sly topaz
#

that'll only "hide" the block for the player in question

#

though since it only sends the block change, you have to be careful of physics updates and whatnot reverting the change

fading drift
#

thank you

#

how can I change my logger to warn only

sly topaz
#

for either choice, you can use a Filter

fading drift
#

first

sly topaz
#
public YourPlugin() {
  super();
  getLogger().setFilter(this::displayingOnly);
}

private boolean displayingOnly(LogRecord record) {
    // or another type of filter...
    return record.getLevel().equals(Level.WARNING);
}
buoyant viper
#

damn, not even running that on onEnable?

#

just going full force in the constructor?

#

absolutely wild, buckaroo

sly topaz
#

eh, the place doesn't really matter, the constructor is going to be the earliest so I used that but onLoad/onEnable are just as valid

#

doing it on the constructor makes the "loading YourPlugin" log dissapear lol

#
public class VillagerGossips extends JavaPlugin {

    public VillagerGossips() {
        super();
        getLogger().setFilter(this::displayingOnly);
    }

    private boolean displayingOnly(LogRecord record) {
        // or another type of filter...
        return record.getLevel().equals(Level.WARNING);
    }
    @Override
    public void onEnable() {
       getLogger().info("testing if it warns");
       getLogger().warning("should actually warn");
       getLogger().log(Level.SEVERE, "testing");
    }
}

https://pastes.dev/obCiv4YbU1

#

never realized how sneaky one can be by doing something like this

#

loading/enabling record should actually be sent from the parent loggger and not the plugin's to avoid this tbh

#

wonder if behavior is the same on Paper considering they use a completely different logging backend

proper radish
#

how would i go about copying world using another world folder ?

#

like without using worldCreator ? do i need to use NMS ?

chrome beacon
#

hm? Could you not just copy the folder?

#

Or do you just want another world with the same seed

proper radish
#

my template worlds path ./plugins/MyPlugin/template-maps/.
lets say i wanna start a game, so i need to create/generate a new world from the template maps folder (making a new copy)
so i would copy the entire world folder from the template-maps folder into the WorldsContainer (which is .)
then i would rename that folder's name (world name) . and everything is good at this point ..
BUT the issue is i can't just load/get this new world using its folder. i need to use WorldCreator then worldCreator.createWorld()
and this method will make a new world folder with the same name only

#

irdk what i supposed to do, i just wanna make a new copy of the world thats it.

chrome beacon
#

Create the world using the world creator

#

It will read your folder as long as it has the same name

proper radish
#

this is gonna duplicate the world folder ?

chrome beacon
#

It won't

#

It will join load the world

proper radish
#

tysm, Olivo

stuck oar
chrome beacon
stuck oar
#

MainFishingAlgorithm is the plugin i want to use methods from

chrome beacon
#

That didn't answer the question

stuck oar
#

What was the question sorry

chrome beacon
stuck oar
#

It’s in the pom.xml of my plugin yeah

chrome beacon
#

I was talking about MainFishingAlgorithm

stuck oar
#

MainFishingAlgoritm is the plugin that i want to get the methods from, MainCustomRods is the plugin that uses those methods

chrome beacon
#

yeah I understand that

stuck oar
#

So how do i access the methods

chrome beacon
#

Start by answering the question

#

is MainFishingAlgorithm your plugin

stuck oar
#

I’m so confused what do you mean? Is it the plugin im getting the methods from or is it the plugin that im using the methods in

smoky anchor
#

I think he's asking if you created that plugin

chrome beacon
#

I am

#

I want to know if you made the MainFishingAlgorithm plugin that you're trying to depend on

stuck oar
#

Yes i did

#

I have the source and everything

chrome beacon
#

So you don't have a repo for it

stuck oar
#

No

chrome beacon
#

Run mvn install in that project to use your local one

stuck oar
#

Alright thanks

quaint mantle
chrome beacon
proud badge
#

yo does anyone know why morepersistantdatatypes stopped working?

> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find MorePersistentDataTypes-2.4.0.jar (com.jeff_media:MorePersistentDataTypes:2.4.0).
     Searched in the following locations:
         https://hub.jeff-media.com/nexus/repository/jeff-media-public/com/jeff_media/MorePersistentDataTypes/2.4.0/MorePersistentDataTypes-2.4.0.jar

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

It worked fine a few weeks ago, now I load the project without changing anything it doesn't work anymore. I compared it to the example on github and its the same

    implementation 'com.jeff_media:MorePersistentDataTypes:2.4.0'
}```
```repositories {
    mavenCentral()
}```
#

It seems my other projects using morepersistantdatatypes get the same error

buoyant viper
#

@tender shard whatd u break

proud badge
buoyant viper
#

idk, just figured id ping him for u

proud badge
#

can anyone with a project depending on morepersistantdatatypes try to compile it pls and tell me if it works

buoyant viper
#

wait how did gradle search alexs repo without it being in ur config

chrome beacon
#

Looks like the repository got removed

proud badge
#

bru

chrome beacon
#

2.4.0 is available on maven central

#

so just use that

proud badge
#

2.4.0 from maven central

#

and it aint working

chrome beacon
#

Error says it's searching mfnalexs site

#

and not central

#

You might have a cached failure, force an update

proud badge
#

ok refreshed, its using maven central and it works now

quaint mantle
chrome beacon
#

nice folder name

blazing ocean
#

"fuckit"

rough drift
#

or idk the name

blazing ocean
rough drift
buoyant viper
#

fukkit? i dont even knowit

blazing ocean
#

bukkit? I hardly know her!

misty ingot
#

hey, is there a way to tab complete after a custom character instead of only in commands?

chrome beacon
#

You send fake player information with what you want to autocomplete as their username

misty ingot
#

how would i go about doing this tho?
example use case:

@(tab complete all online player names here)

chrome beacon
#

send one fake player info for each thing you want to auto complete

remote swallow
remote swallow
#

yup

rough drift
#

USEFUL AF

misty ingot
chrome beacon
#

oh right they added it to the api

#

nice

hybrid spoke
#

not me manipulating what players write to the chat by giving them weird chatcompletions