#help-development

1 messages · Page 539 of 1

agile anvil
#

Way you set the name

#

When you set the name

#

Etc ..

tame bay
#

The code works. The unicodes are set ingame.

#

It just doesnt color the username on tab

#

Even when I try with just some simple text, it doesnt color it either. It colors the prefix but when I end it with another color code it doesnt colors the players username

kind hatch
#

The player name is probably treated differently then. You'll probably have to look for a method that changes the player name.

kind hatch
#

IIRC, that only changes the name on the tablist.

agile anvil
#

I think that is the goal

tame bay
#

Since when is that function a thing though?

agile anvil
#

At least 2014

kind hatch
#

You might want to try Team#setDisplayName()

tame bay
#

Oof. I never even saw that function

slender cedar
#

does he have one?

#

does it*

tame bay
#

Thanks 👍

fierce salmon
#

How do I do that?

#

👽

rough mirage
#

hey can anyone help me with PlotMe plugin?
its a small issue but i cant seem to figure it out

eager jacinth
#

Hello. I am currently developing a small plugin that adds passports. And I'm worried about the caching. I want the passports to be available at any time, not only when the player is on the server. I use LoadingCache to do this. But I'm more worried about the other thing: should I keep CompletableFuture<Optional<Passport>> in the cache, or should I keep a simple Optional<Passport> there instead?


    private LoadingCache<String, CompletableFuture<Optional<Passport>>> cache = CacheBuilder.newBuilder()
            .expireAfterWrite(15, TimeUnit.SECONDS)
            .build(CacheLoader.from(this::getPassportFromDatabase));

    public PassportManager(DataSource dataSource) {
        super(dataSource);

        // create table
    }

    public CompletableFuture<Optional<Passport>> getCached(String playerName) {
        try {
            return cache.get(playerName);
        } catch (ExecutionException e) {
            throw new RuntimeException(e);
        }
    }

    public CompletableFuture<UpdateResult> save(@NonNull Passport passport) {
        return builder().query("INSERT QUERY")
                .parameter(stmt -> /* set values */)
                .update()
                .send()
                .thenApplyAsync(updateResult -> {
                    /* update cache */
                    return updateResult;
                });
    }

    private CompletableFuture<Optional<Passport>> getPassportFromDatabase(String playerName) {
        return builder(Passport.class)
                .query("SELECT QUERY")
                .parameter(stmt -> stmt.setString(playerName.toLowerCase()))
                .readRow(row -> /* create passport object */)
                .first();
    }

}```
rough mirage
#

okey sry

#

where shall i ask then

kind hatch
rough mirage
#

okey

#

did

#

yall cant take a look? im desperate

chrome beacon
tardy delta
#

and why an expiring cache

#

15 secs is kinda trash

#

ah wait its a cache with futures, nah man

quaint mantle
#

Hello! im looking for a person who would like to build a survival server with me, I already have the server running, and need someone who can configure the plugins, and make it special, and different from others, everything will be 50% 50% shared, and im paying for the plugins and the host, please someone serious, who can work and wont be childish and leave the project, its important, thanks and sorry for the spam.

delicate lynx
#

?services

undone axleBOT
fluid river
slender cedar
#

does it have one?

fluid river
#

java.lang.NullPointerException: Cannot invoke "Pants.shit()" because "gutConents" is null

quaint mantle
slender cedar
quaint mantle
slender cedar
#

ohh

quaint mantle
#

in my opinion best mob creation plugin

slender cedar
#

can you send me a good video with it?

#

i use aternos i hope its on ther

#

ill maybe switch

#

can you customize drops?

#

like boss drops

quaint mantle
quaint mantle
slender cedar
#

so no customizable drops?

#

cus i use it for bosses

#

that spawn and when die drop a token

#

common to legendary

#

thats why i want chances

#

like 5% leg

#

30% common

#

yk

quaint mantle
#

no i don't know bossland

#

so i can't

slender cedar
#

I know

#

but u cant do that on mythicmobs

#

or can u

quaint mantle
slender cedar
#

alr

#

ingame?

#

with an gui

#

or coding

quaint mantle
slender cedar
#

cus i got the items ready

quaint mantle
#

idk

slender cedar
#

so no gui

#

to insert it

#

sadge

quaint mantle
#

yes

#
player.swingMainHand();```
#

i use this but this event using e.getItem method

rough ibex
#

please surround code in ```

quaint mantle
#

omg

chrome beacon
#

or use paste

#

?paste

undone axleBOT
slender cedar
#

soz

wide coyote
slender cedar
#

bro

#

how

chrome beacon
#

How what?

flint coyote
#
like this
wide coyote
#

you don't even need that java thingy

chrome beacon
#

java should be replaced with yaml ^^

wide coyote
#

I thought they were sending java snippets sorry

#

didn't saw what they are trying to send

chrome beacon
#

so you're not wrong to assume they were sending Java code

wide coyote
#

yeah probs

flint coyote
#

yaml developer

#

minecraft on kubernetes

chrome beacon
#

People are deploying Minestom on kubernetes

flint coyote
#

idk if minecraft servers should run as docker images

slender cedar
#

help me at ''help-server'' maybe

chrome beacon
#

Which Minestom is perfect for

flint coyote
#

Minestom is probably stripped down like PocketMine and Nukkit right?

chrome beacon
#

PocketMine and Nukkit are for Bedrock though

flint coyote
#

(those are for bedrock) and from what I heard they both don't really have vanilla survival features

chrome beacon
#

They have more features than Minestom ships with

#

Minestom comes with a great API for implementing what you want and need on your own

flint coyote
#

Yeah for minigames that's perfectly fine

chrome beacon
#

It's more like a bare bones API than an actual server implementation

flint coyote
#

as long as you don't need too many survival features

chrome beacon
#

Yeah

slender cedar
#

is there an easy way to add ''drop percentages'' to your code

#

like i got a boss mob

#

and it drops 5 items

#

common to legendary

#

but idk how to change the drop percentage

#

but its from a plugin called ''bosslands'' which doesnt have any guides

#

idk how to make an spigot discussion

#

nope

#

lol

#

ah

#

already did

#

lmao

chrome beacon
#

Then have patience

#

and wait there

slender cedar
#

alralr

#

how do i

#

they dont have

#

one

chrome beacon
#

You don't need the extends Object

slender cedar
#

i tried something

#

just put ''chance: 30

twilit roost
#

I have a BlockDisplay moving smoothly
im using Shulker to make it walkable

but in some scenarios the one shulker is out of bounds for the BlockDisplay -> creating a uncovered place where player can fall through down

im trying to make something, that lists me with all the required positions, that will be used to hold the player on set BlockDisplay

alternatively one radius from the BlockDisplay, yet only if e.g.: x isn't whole number -> add support shulker there
if it is whole number -> don't add support shulker there

my current attempt [results in all shulkers being stacked in one]:
https://paste.md-5.net/hiqapuceda.cs

slender cedar
#

somewhere in the code

#

LOL

orchid gazelle
#

I did something like that with custom fallingblocks but yeah... I kept getting pushed into the crawling-position

twilit roost
orchid gazelle
#

No

#

I froze the project because of this issue

#

Did that like over half a year ago

twilit roost
#

oh okay :D
imma try to work on it (ehm with GPT help)

orchid gazelle
#

Lol

#

Well, the main problem is the collision

#

I did a lot of hacky stuff to get the fallingblocks stuff working, which ended up senseless because of displayentities

#

This included using reflection to change hardcoded stuff with entities

twilit roost
#

makes sense

orchid gazelle
#

Fallingblocks worked out, shulkers stuck tho

twilit roost
#

I thought of that ceiling problem like so:

  • get the material on the location
  • spawn the shulker there
  • set back the material

this makes the shulker invisible

#

therefore you have the collision block inside the moving block
problem is with block that have smaller height

orchid gazelle
#

Wait what? Were speaking of the crawling issue right

twilit roost
#

oh
I haven't experienced that problem yet :D

orchid gazelle
#

You walk against the shulker with your head, you get put in crawling, no matter what you do

twilit roost
#

oh like so

#

well that's future me problem :D

orchid gazelle
#

Good luck, please tell me if something works out

#

I broke my head down a lot for that

twilit roost
#

sure sure
imma just msg rn

#

I have a few ideas still tho :D
not so simple tho

orchid gazelle
#

Yeah lets see

eager jacinth
eager jacinth
fierce salmon
#

For some reason when I click one of the wools in the inventory, all 4 of the messages are sent to the player

#

I just want the message that correlates to the wool to be sent to the player

eternal oxide
#

no breaks

chrome beacon
#

Don't detect inventories by their name

#

Also you should delay that close by a tick

fierce salmon
#

how do I delay it by a tick?

chrome beacon
#

?scheduling

undone axleBOT
flint coyote
#

Use a scheduler

flint coyote
fierce salmon
#

on god

young knoll
#
This event is called when a player clicks in an inventory.

Because InventoryClickEvent occurs within a modification of the Inventory, not all Inventory related methods are safe to use.

The following should never be invoked by an EventHandler for InventoryClickEvent using the HumanEntity or InventoryView associated with this event:

    HumanEntity.closeInventory()
    HumanEntity.openInventory(Inventory)
    HumanEntity.openWorkbench(Location, boolean)
    HumanEntity.openEnchanting(Location, boolean)
    InventoryView.close() 

To invoke one of these methods, schedule a task using BukkitScheduler.runTask(Plugin, Runnable), which will run the task on the next tick. Also be aware that this is not an exhaustive list, and other methods could potentially create issues as well. 
chrome beacon
#

^^ Taken from Javadoc

flint coyote
#

oh I did not know. Never ran into issues

visual laurel
#

bump

worldly ingot
#

Oh sorry, wrong person

#

lol

chrome beacon
#

also follow naming conventions

#

?conventions

fierce salmon
#

What do I put where it says plugin

languid ibex
#

An instance of your "Main" class (whichever class extends JavaPlugin)

visual laurel
# chrome beacon You need to give us more info than that

This is what I'm doing to register the smithing recipe but its not registering and sends no error in the servers console

        NamespacedKey t1KeyTirFrostDay = new NamespacedKey(this, "first-tirfrost-day");
        NamespacedKey t2KeyTirFrostDay = new NamespacedKey(this, "second-tirfrost-day");
        NamespacedKey t3KeyTirFrostDay = new NamespacedKey(this, "third-tirfrost-day");
        RecipeChoice tirFrost0Day = new RecipeChoice.ExactChoice(TirFrostItem(0, 1));
        RecipeChoice tirFrost1Day = new RecipeChoice.ExactChoice(TirFrostItem(1, 1));
        RecipeChoice tirFrost2Day = new RecipeChoice.ExactChoice(TirFrostItem(2, 1));
        Recipe upgradeT0T1TirFrostDay = new SmithingRecipe(t1KeyTirFrostDay, new ItemStack(TirFrostItem(1, 1)), tirFrost0Day, T1Upgrade);
        Recipe upgradeT1T2TirFrostDay = new SmithingRecipe(t2KeyTirFrostDay, new ItemStack(TirFrostItem(2, 1)), tirFrost1Day, T2Upgrade);
        Recipe upgradeT2T3TirFrostDay = new SmithingRecipe(t3KeyTirFrostDay, new ItemStack(TirFrostItem(3, 1)), tirFrost2Day, T3Upgrade);
        getServer().addRecipe(upgradeT0T1TirFrostDay);
        getServer().addRecipe(upgradeT1T2TirFrostDay);
        getServer().addRecipe(upgradeT2T3TirFrostDay);

this is the code for the "TirFrostItem" variable: https://paste.md-5.net/umenosutez.cs

visual laurel
mortal hare
#

would anyone help me with one particular thing

#

so basically

#

i have a game loop

#

it calls two methods render() and update()

chrome beacon
mortal hare
#

right now the game loop speed is not being limited

#

but it burns the cpu usage really much

visual laurel
mortal hare
#

is there any way to limit the cpu usage to the game

visual laurel
#

its only those that dont

mortal hare
#

consistently

chrome beacon
#

sleep between updates

flint coyote
#

are we talking about a game or about a game plugin?

mortal hare
#

thread.sleep isnt consistent

chrome beacon
#

wdym by not consistent?

mortal hare
#

it sleeps for the amount of time you provide

#

but it doesnt guarantee it that it would sleep for that much time

#

it could sleep for much longer

chrome beacon
#

Yeah but usually not by much

mortal hare
#

thus update times could be inconsistent

chrome beacon
#

Minecraft uses sleep just fine

tardy delta
#

LockSupport.parkMillis?

mortal hare
#

how does minecraft's frame limiter work then

#

with high amounts of fps

tardy delta
#

wait thats not a thing

#

theres parkNanos tho

mortal hare
#

usually thread.sleep doesnt support low amounts of millisecond ranges

chrome beacon
#

FPS caps would probably be handled by GPU

#

So OpenGL

mortal hare
#

hmm

#

you see i have this console application that im currently working on c++

#

and i use console as a renderer

#

and it really works

#

it could go up to 900fps

tardy delta
#

are you using opengl?

mortal hare
#

no

#

nothing but cmd.exe

chrome beacon
#

Then sleep

#

That's good enough

tardy delta
#

dang im doing some opengl stuff

#

raylib actually

mortal hare
#

well, whenever I use std::current_thread::sleep_for(targetFrameTime-deltaTime) i get max up to 60 fps

#

due to windows timer resolution of 15 ms

mortal hare
#

and I wonder how other game engines implement this kind of capping behaviour

flint coyote
mortal hare
#

like do an if statement and skip first sleep if the tick is even or odd or smth

#

?

flint coyote
#

yup or a counter

tardy delta
#

that like makes a few ticks one tick 🤔

fierce salmon
#

?paste

undone axleBOT
flint coyote
#

1..2..3..sleep..1..2..3..sleep

#

yeah it depends on the game if that's reasonable

mortal hare
tardy delta
#

im so glad i have a SetTargetFps

mortal hare
#

lemme try to implement this

mortal hare
tardy delta
#

in the lib i use

#

no more messing with frames

mortal hare
#

i heard that even SFML has inconsistent frame limiter

fierce salmon
mortal hare
#

i spent this whole damn day asking AI and searching google how to fix this

#

to no avail

#

i never realised how fucked up computers are at timing things

quaint mantle
#

Why you are creating many Main instances?

.runTask(new Main(), player::closeInventory);
fierce salmon
#

TCC told me to do that

eternal oxide
#

that will error and do nothign but break your code

#

you only have one instance of your main. The one Spigot creates

#

?di

undone axleBOT
chrome beacon
#

?main

mortal hare
#

oh man

#

my program is cursed

quaint mantle
flint coyote
quaint mantle
#

How I can sync my thread with ticking system?

#

how to cast this warning ?

mortal hare
#

but thats seems wasteful

flint coyote
#

it is

mortal hare
#

i mean switching sleep and delays seems to help

#

it dropped the cpu usage to 8%

#

but my frames now are inconsistent due to weird fuckery of sleep

#

whenever i set targetfps to 60

#

it makes my fps go to 33 fps

#

but whenever i increase to 63

tardy delta
#

oh elgarl, this is some fun keyboard

mortal hare
#

it goes up to 63

#

fps lmao

eternal oxide
#

I can;t remember the last time I looked at the keycaps 🙂

mortal hare
#

i switched from mechnical to membrane

#

just because my relatives cant bother with them

#

anymore

flint coyote
#

I once saw a very nsfw keyboard - can't post that here though

eternal oxide
#

I do dislike the horizontal return keys though

#

seems to be a trend these days

mortal hare
#

1000/60fps = 16.66ms 1000/63fps = 15.87ms

#

16.66ms-frameDelta causes to have 33 fps on average

#

whenever 15.87ms-frameDelta somehow boosts fps up to 63 fps on average

#

lmao

#

with sleep

flint coyote
#

you will find it if you search for it on google though

quaint mantle
remote swallow
flint coyote
#

Or does your thread produce some output that you want to sync at the end?

flint coyote
#

In that case just make a scheduler for next tick

quaint mantle
#

eh ok

mortal hare
#

with 63 fps cap

#

with 60 fps cap

#

wtf is going on

flint coyote
#

what happens if you just do a normal sleep?

#

I mean you said it's problematic but how problematic?

mortal hare
#

here's the code to the main game loop

mortal hare
chrome beacon
#

Website blocked due to trojan 💀

#

Thanks malware bytes

mortal hare
#

thats legit website

tardy delta
#

imagine having an antivirus 💀

mortal hare
#

its just that its anonymized

flint coyote
mortal hare
#

is this what you wished?

visual laurel
mortal hare
#

i did std::chrono::sleep_for(std::chrono::milliseconds(1000/16))

flint coyote
#

why 16?

mortal hare
#

because it consistently sleeps for 16ms

chrome beacon
mortal hare
#

even if work have been completed

young knoll
#

Use RecipeChoice.ExactChoice

mortal hare
#

earlier in the loop

flint coyote
#

what if you do 60?

#

for your 60fps?

visual laurel
mortal hare
#

oh wait lol

#

my bad

young knoll
#

Then you should be good

#

At least for a ShapedRecipe

visual laurel
#

im using shapeless, will it work if i use shaped?

young knoll
#

No idea

#

ExactChoice is still a bit weird

mortal hare
#

yeah

#

still 30 fps

flint coyote
#

meh

mortal hare
#

1000/60

#

i have no idea what causes this

#

it seems the lower the ms the better it runs

#

but its should be opposite

#

63 fps cap runs faster than 60 fps

#

no matter what 😄

flint coyote
#

try /120. Does that somehow double it? 😄

mortal hare
#

now its 64 fps

#

but that's reasonable

#

since timer resolution had hit maximum

#

probably

#

8.33 ms is low enough for a sleep

flint coyote
#

well if that works your fps setting just has to do 1000/fps*2

#

Idk how far this will work

mortal hare
#

but i have no guarantees if that would work on other machines you know

flint coyote
#

1000/400 probably won't give you 200 fps

mortal hare
rough ibex
#

infinite fps hack

flint coyote
hazy parrot
flint coyote
#

"We will not hand your laptop to the customer"

old cloud
#

It will sleep for 8ms and not 8.3, so that probably yields the 64 fps instead of 60.

flint coyote
#

yup

mortal hare
#

without the thread sleeping

#

with while loop delay instead ^

flint coyote
#

what if you sleep with 1ms?

old cloud
#

If you really want to get it to 60 fps, then I think you need to count how long one frame actually needs and then sleep for however much time it has still left.

flint coyote
#

or you just pretend that 64=60. Some games run way to stable on 60. They probably do the same

mortal hare
#

i get the delta time of render time

half bane
#

Whats the best minecraft version to make plugins on (with backwards compatibility)?

mortal hare
#

and subtract from target frame time

#

16ms

old cloud
mortal hare
#

then i do sleeping

mortal hare
#

sleeptime was not constant

#

i did frame delta subtractions

#

it works for 64 frame cap but not for 60

#

frame count literally doubled with 64 cap enabled

old cloud
#

because of integer truncation

mortal hare
old cloud
#

sleep 8ms for two frames, then 9ms for one frame, this will give you an average sleep of 8.333 if everything else takes 0ms to execute

eternal oxide
#

I can;t sleep a fixed value

mortal hare
#

why would it help with this

old cloud
#

(8+8+9)/3=8.33333

zinc lintel
#

does someone know how i add a delay for a command to execute the 2nd task like

p.sendMessage...
3 sec Delay
p.sendMessage...

mortal hare
undone axleBOT
old cloud
#

every 3 frames you sleep 1ms longer

zinc lintel
flint coyote
zinc lintel
mortal hare
#

yea but i still dont see why is that a problem

eternal oxide
#

to FPS limit you measure how long it takes you to render each frame, this is an ongoing process. you take the average of those times and sleep between to fit 60 per second.

old cloud
eternal oxide
#

you will not hit 60 unless your render is very accurate in timing

flint coyote
mortal hare
#

without sleeps

mortal hare
old cloud
#

I mean a really bad idea would be to make a while loop which measures time each iteration, and as soon as it goes over your delay you will break it 😂

eternal oxide
#

Likely all you did was stop rendering until the next second once you hit 60

flint coyote
old cloud
#

yea understandable

mortal hare
#

im wondering if there's balance of those

#

to at least have a fps cap of 120

flint coyote
#

Does NOP in assembly consume cpu? Probably does

eternal oxide
#

a tiny bit

flint coyote
#

is there a way to call NOP in c++?

mortal hare
#

i wonder how browsers handle this type of problem

#

whenever i visit gpu accelerated website cpu usages goes up

#

but whenever i switch to static page

#

it drops down

#

that's logical

#

but i still dont get it how it works, but i would never will

mortal hare
#

it probably uses multiple threads

#

to handle multiple events of actions

#

and whenever some action requires refresh of a screen, then its being updated

#

instead of refreshing every time

#

like in a game

#

eh i give up

#

its a side project after all

flint coyote
#

maybe they do a mix of all the things you tried

#

lets say you want an 8ms delay

mortal hare
#

i would just stick with sleeping

flint coyote
#

So you could do a 7ms delay

mortal hare
#

of 64 fps cap

flint coyote
#

and then do your nanosecond loop

mortal hare
tardy delta
#

thank you chatgpt, saying that my method doesnt exist smh

mortal hare
#

chatgpt sucks

#

i feared that it would takeover programming scene

#

its a clown who doesnt understand nothing about programming

flint coyote
#

Sleep might be inaccurate but I doubt that it will be inaccurate by more than 1ms since that's pretty long for a cpu

tardy delta
#

it mixes everything with python code

mortal hare
#

except CTRL+C and CTRL+V from websites

tardy delta
mortal hare
#

it surprisingly good at assembly

tardy delta
#

ye

mortal hare
#

but fails at high level languages

eternal oxide
#

They are using the population of programmers to teach AI how to program, and foolishly everyone is doing it.

#

every conversation is logged and AI goes over it to learn

mortal hare
#

i need to correct gpt-3 at least 10 times to give me at least something barely useable for me

#

it really wouldnt replace programmers any time soon

eternal oxide
#

10 years at teh outside is my estimate

#

Make your money now as it won;t be long before you will have no jobs

flint coyote
tardy delta
#

i was thinking about Kernel32.Sleep kekw

mortal hare
#

and it is by a lot

flint coyote
#

well then windows.h is the way I guess. Or you could at least give it a try

flint coyote
#

Did you try the timer?

mortal hare
#

🤔

flint coyote
#

It should fire every given amount of milliseconds

#

and then you would do your tick

#

maybe that's precise

#

if that thing ain't precise either then I'm out of ideas

quaint mantle
#

i can make player item hopping ?

#

animation when the item arrives to player hand

half bane
#

does Player.isOnline() check if the player is authorized with mojang or if its playing on the server

tardy delta
half bane
#

oh alright

#

thanks

sharp bough
#

Hologram hologram = DHAPI.createHologram("test", ((Player) sender).getLocation(), lines);

Caused by: java.lang.NoClassDefFoundError: eu/decentsoftware/holograms/api/DHAPI                                                                                                                                                                     at me.paradis.main.commands.CommandManager.onCommand(CommandManager.java:27) ~[Kitpvp98-1.0.jar:?]                                                                                                                                           at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?] 
tardy delta
#

#unknown ?

sharp bough
tardy delta
#

shaded it?

#

or have it installed on the server

sharp bough
#

using latest version

<dependency>
            <groupId>com.github.decentsoftware-eu</groupId>
            <artifactId>decentholograms</artifactId>
            <version>2.8.1</version>
            <scope>provided</scope>
        </dependency>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
tardy delta
#

well you got it installed with the right version?

sharp bough
#

yeah i can ctrl click the DHAPI and i go to the declaration

sharp bough
#

this was working about 2 weeks ago, didnt change anything

tardy delta
#

theres a 2.8.2 btw

#

i hope jitpack has it

chrome schooner
#

What plugins should I implement into my skyblock core with island raiding such as like API’s

sharp bough
sharp bough
#

i tested it in both paper and spigot

#

same result

#

im not sure whats wrong

chrome beacon
#

?paste

undone axleBOT
sharp bough
split gull
#

let's say i log off the server, i change my name and i join back
how can i get the name i used to have before the change?

tardy delta
#

gotta save it

#

although, isnt there a usercache.json file

#

where it keeps track of an old name??

chrome beacon
#

Yeah

split gull
#

mh

fierce salmon
#

I am trying to make a plugin that allows you to change how far down the platform is for water bucket clutching. I built 4 platforms, but don't know how to make them all disappear while one is still there.

split gull
#

yes, mine contains this json {"name":"JakeWithRizz","uuid":"4d829d76-d9ed-4aa8-a2ea-87e003be660d","expiresOn":"2023-06-30 20:57:17 +0000"}
what does the expiresOn part mean?

tardy delta
#

that it will be removed from the cache or smth?

split gull
#

makes sense

#

and when that happens is the join message the normal one?

tardy delta
#

if the player doesnt login for a while ig

split gull
#

or does it still use the "formerly known as " message

chrome schooner
#

Does anyone recommend a good way to set a spawn point for raiders on an island. We have an island core and the spawn point must be a set amount of blocks away from the core chunk. However, We have it to where users have to set their spawns for the raid

young knoll
#

Have them run a command in said spot?

#

That’s the simplest

chrome schooner
chrome beacon
half bane
#
[23:27:45] [Timer-0/WARN]: Exception in thread "Timer-0" java.lang.IllegalStateException: EntityDamageEvent cannot be triggered asynchronously from another thread.
[23:27:45] [Timer-0/WARN]:     at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:572)
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                for(Player plr : Bukkit.getOnlinePlayers()){
                    if(isAffected(plr)){
                        plr.sendMessage(String.valueOf(getOxygen(plr)));
                        subtractOxygen(plr);
                        if(getOxygen(plr) <= 0){
                            plr.damage(damage);
                        }
                    }
                }

            }
        }, 0, interval);

I'm trying to damage a player in a Timer thread but it says that I can't do that in a separate thread. What do I do?

young knoll
#

?scheduling

undone axleBOT
tardy delta
#

TimerTask?

eternal oxide
#

just throw the damage line in a lambda

#

um yeah, why are you even async in the TimerTask

half bane
#
    public void start(){
        scheduler.runTaskTimer(plugin, () -> {
                for(Player plr : Bukkit.getOnlinePlayers()){
                    if(isAffected(plr)){
                        plr.sendMessage(String.valueOf(getOxygen(plr)));
                        subtractOxygen(plr);
                        if(getOxygen(plr) <= 0){
                            plr.damage(damage);

                        }
                    }
                }
        }, 0, interval);
    }

what am i doing wrong

#

it's not running

hybrid spoke
half bane
#

it worked before switching to BukkitScheduler

#

but I'll debug it

#

hm it triggers only once

hybrid spoke
#

interval too high?

half bane
#

uh maybe

#

its probably in seconds

#

yeah

young knoll
#

It’s in ticks

#

20 ticks = 1 second

half bane
#

oh

half bane
#

im not using it anymore

quaint mantle
#

when i log something in the console with the SEVERE level, how do i make the whole log red

#

including the time

#

and yellow for warn

eternal oxide
#

colours in logs are bad

young knoll
#

I think you’d have to mess with the logger for that

quaint mantle
young knoll
#

But it’s best to just leave it

quaint mantle
#

why

#

just help me

eternal oxide
#

most consoles don;t support colours, but files definitely don't. It makes reading the log files a pain

quaint mantle
#

can u help or nah

#

i get you but i still want to do it

eternal oxide
#

you can but it's really difficult with log4j and without triggering Papers annoying nag.

#

on Spigot it's easier, but you will be harassed by every paper user

quaint mantle
#

im using spigot

eternal oxide
#

are you releasing the plugin?

quaint mantle
#

no

eternal oxide
#

you have to create your own appender

quaint mantle
#

how about making the text red only

#

forget the timestamp

#

would it be easier

young knoll
#

Isn’t it already red

eternal oxide
#

I've never actually looked

young knoll
#

Pretty sure severe is red

eternal oxide
#

I don;t get errors in my logs so never noticed 😛

young knoll
#

At least in my command prompt

quaint mantle
#

be

#

but its not

remote swallow
quaint mantle
#

maybe its cuz im using 1.8

remote swallow
#

theyuse jline iirc

young knoll
#

True I don’t remember what happens on spigot

eternal oxide
#

oh 1.8 doesn;t even have log4j

quaint mantle
#

what does 1.8 hav

young knoll
#

It should?

#

It was patched when log4jshell was a thing

quaint mantle
#

thas it

#

ok

eternal oxide
#

to add colours just create your own class that extends ConsoleHandler in 1.8

#

override the publish method

sullen marlin
#

I think 1.8 supports colours, just to the consolecommandsender

eternal oxide
#

super easy then

quaint mantle
#

ill givei t a look

#

cool

opal carbon
#

red error

#

it is red

rough ibex
#

clearly green

quaint mantle
#

except

#

its INFO

quaint mantle
#

sender.sendMessage(ChatColor.RED + s);

how do i make it severe

rough ibex
#

that's the joke

young knoll
#

Idk what you’re on that’s blue

quaint mantle
#

yes]

eternal oxide
#

you have to use logger#

opal carbon
#

ill be honest i know nothing about any api differences in 1.8

young knoll
#

Lol

#

No PDC, that’s the worst part

opal carbon
#

like i know nothing abt plugin dev for old versions lmfao

opal carbon
quaint mantle
young knoll
#

I remember when 1.8 was the accepted version to develop for :p

shadow gazelle
#

Is there some way to get the uses of a service?

quaint mantle
#

oh

#

lol

opal carbon
#

is severe not red by default for you

quaint mantle
#

nope

opal carbon
#

damn

#

thats how it works recent versions from my experience

tardy delta
#

isnt that just your terminal

opal carbon
#

idk man this is why i dont run fossil versions though

young knoll
#

Can’t wait for the day we have legal users on this discord running a version that’s older than them

opal carbon
quaint mantle
young knoll
#

Spigot or a fork?

opal carbon
#

as in on recent versions it color coded red by default for severe

quaint mantle
#

nitrospigot

opal carbon
#

what is that lmao

young knoll
#

Don’t worry about it

quaint mantle
#

1.7 1.8 performance spigot

opal carbon
#

never heard of that one

young knoll
#

I know it’s red on paper 1.19, but I don’t remember if it is on spigot

quaint mantle
young knoll
#

It’s basically the same performance patches that have been floating around for years with a fancy name and a several hundred dollar price tag

#

And some buzz words like async and multithreaded

opal carbon
#

any sort of testing of anything i do is on paper

quaint mantle
opal carbon
#

cause thats what most people use (or derivatives)

quaint mantle
#

i know the developer i have a custom fork of a custom fork

opal carbon
#

its a $15 price tag with only 1 star reviews since November 20 2021

#

💀

quaint mantle
#

what site

opal carbon
#

builtbybit

quaint mantle
#

idk

young knoll
#

Well

quaint mantle
#

its a good spigot anyway

#

has good ender pearls

young knoll
#

At least it’s $15 and not $200

quaint mantle
#

exactly

young knoll
#

Wtf does good ender pearls mean

quaint mantle
#

you can pearl through grass

#

and open fence gats

#

cob webs

rough ibex
#

wait you bought it?

quaint mantle
#

i bought a custom fork of it from the owner for 40$ and he updates it with shit when i need it

#

here are some of the basic options

#
noleafdecay: true
  pearls:
    fencegates: true
    string: true
    cobweb: true
    taliban:
      stairs: true
      slabs: true
      cobblewall: true
      bed: true
      endportal: true
      piston: true
  egg:
    fencegates: true
    string: true
    cobweb: true
  snowball:
    fencegates: true
    string: true
    cobweb: true
  disable-mobai: true
  invalid-location-crash-patch: true
  handle-block-operations: true
  async-hits: true
  unload-chunks: true
  tcp-no-delay: true
  static-protection-damage-reduction: false
  ping-command-enabled: true
rough ibex
#

oh lord

young knoll
#

I’m sorry

#

Taliban

quaint mantle
#

it removes pearl glitching too

young knoll
#

What

rough ibex
#

you paid 40$ for what again

quaint mantle
#

taliban is a type of ender pearling

rough ibex
#

an ender pearl plugin and

quaint mantle
#

fork

young knoll
#

But hey it adds a ping command

rough ibex
#

you're a sucker

remote swallow
#

async hits

young knoll
#

What does async hits even mean

quaint mantle
#

oh yeah

rough ibex
#

plain and simple, you're a sucker

quaint mantle
#

and the knockback

remote swallow
#

you punch async

quaint mantle
#

is so smooth

rough ibex
#

placebo effect

shadow gazelle
young knoll
#

Why does that need to be async

remote swallow
#

way too much time took in a tick

rough ibex
#

don't you know? async makes everything better

young knoll
#

It’s not like damage calculations are gonna nuke your tps

quaint mantle
rough ibex
#

what is a smooth hit

#

you hit or you don't

young knoll
#

Wonder if I could sell a fork that just makes random pointless stuff async

rough ibex
#

yuo can sell a pointless fork

shadow gazelle
#

what

opal carbon
#

...

rough ibex
#

haha

opal carbon
#

💀

young knoll
#

Exactly you gotta have those async join and leave messages

quaint mantle
#

its really good on performance

#

adds a bunch of events too

#

like

#

EquipmentSetEvent

remote swallow
#

alex's armor equip event be like

shadow gazelle
#

Look at the code

young knoll
#

Lol

#

It’s a meme

shadow gazelle
#

I want to shoot myself looking at that

rough ibex
#

that is the joke

remote swallow
#

yeah its great

opal carbon
#

its obviously a joke but damn

#

i love the description

young knoll
#

Jk @ivory sleet always codes like that

opal carbon
#

of the plugin

young knoll
#

(Real)

rough ibex
#

over 20k lines of just \n

shadow gazelle
#

$40 for that software is stupid, but making things asyncrynous makes sense

young knoll
#

I mean

quaint mantle
#

how is it stupid

young knoll
#

Maybe

quaint mantle
#

the performance is insane

young knoll
#

There’s a reason paper doesn’t just make random shit async though

shadow gazelle
#

I'm sure Hypixel could use something like that with how badly a lot of their shit runs

quaint mantle
#

im not just saying the performance is good for the sake of saying its good

young knoll
#

Or spigot even

shadow gazelle
#

It would probably fix the issues with appearing to be right in front of the person you're fighting to them while you're eight blocks away

young knoll
#

Hypixel already has an in-house fork

#

And making stuff async won’t magically fix ping

quaint mantle
#

yeah theres also editable knockback values

shadow gazelle
quaint mantle
#

look

#
current-profile: default
knockback-profiles:
  default:
    knockback:
      horizontal: 0.385
      vertical: 0.34
      extra-horizontal: 0.38
      extra-vertical: 0.085
      friction: 2.0
      vertical-limit: 0.38
      hit-delay: 20
      slowdown: 0.6
      comboVel: -0.2
      combo: false
      comboHeight: 1.5
    potions:
      async: true
      distance: 0.5
      offset: -20.0
      speed: 0.05

#

async potions

#

for ptpvp

#

potpvp

shadow gazelle
#

and the example I'm thinking of was a good like two second fight where I was too far away to hit the guy but he could hit me

opal carbon
#

what

#

async potions

quaint mantle
#

yeah

#

its insane

opal carbon
#

thats gotta be a joke

shadow gazelle
#

okay that makes no sense

opal carbon
#

thats so stupid

quaint mantle
#

async splash potions

opal carbon
#

wtf they do async calculate the players around it

#

thats not a real source of lag

quaint mantle
#

they run asynchronisly n shit idk

opal carbon
#

all that does is slow down the potions and for absolutely nothing potions arent laggy

quaint mantle
#

the knockback is the sell point

quaint mantle
young knoll
#

Aww man I can’t wait for async item dropping

opal carbon
#

potions sinply are not a real source of lag

opal carbon
wary mountain
#

not sure why but this causes null err with p. even though all posibilities lead to it being set to something not null

opal carbon
#

or even better async picking up just so we can have more possible race conditions

eternal oxide
#

EntityEvent?

quaint mantle
#

it has these options too

#
chunk-threads: 1
players-per-thread: 50
young knoll
#

You can’t listen to EntityEvent

#

Afaik

eternal oxide
#

You can;t, it's abstract

opal carbon
#

thats not listening to it

#

its just getting passed in

wise mesa
#

in acf, I want a command to complete with all online players

opal carbon
#

doListenerStuff

wise mesa
#

but I want to accept any offline player as a parameter

young knoll
#

Ah

eternal oxide
#

ah

wise mesa
#

do I just make a command completion called like online players or something?

young knoll
#

Reminds me, spigot should throw an error if you try to listen to an abstract event

wise mesa
#

is there one already built in

young knoll
#

(If it doesn’t already)

eternal oxide
#

getKiller can be null

young knoll
#

^ gotta check those nullability annotations

quaint mantle
#

it also has these

#

idk what they mean

#
async-swings: true
  quad-thread-cows-and-other-mobs-like-rabbits: true
young knoll
#

Hold up

#

quad-thread-cows-and-other-mobs-like-rabbits

#

Wtf is that setting name and wtf does that even mean

wise mesa
#

that's an amazing setting name

#

i love that

quaint mantle
#

i guess it uses 4 threads on cows and rabbits

shadow gazelle
quaint mantle
#

let me refer to the manual

eternal oxide
#

lets put all kinds of crazy config entries in spigot (that do nothign) and sell it for $40 . I'm sure md_5 won;t mind

young knoll
#

Why tf cows and rabbits specifically

quaint mantle
#

its for spawners it says in the manual

shadow gazelle
#

?????

young knoll
quaint mantle
#

these too

#
pearl-particles: true
  damage-player-for-pearling: true
  pearl-antiglitch: true
  critical-block-tali-pearl: true
  suffocation-prevention: true
  no-invis-one-dot-eight: true```
shadow gazelle
#

Why the hell would you need four threads for spawners

young knoll
#

Only cows and rabbits

quaint mantle
#

bro i dont know

#

i didnt make it

young knoll
#

Idk man they have some really advanced ai compared to pigs

shadow gazelle
quaint mantle
quaint mantle
#

wtf does this do

#
per-player-mobai-asynchronous-task-completion-on-rendering: false```
shadow gazelle
#

Ignore the Purpur stuff

young knoll
#

So advanced

shadow gazelle
#

Actually, a pig has more lmao

young knoll
#

Tf does a pig have that a cow doesn’t

#

Oh wait probably for riding

shadow gazelle
#

nvm I'm being stupid

#

that wouldn't be AI

young knoll
#

Sometimes I forgot you can ride pigs

shadow gazelle
#

yeah

young knoll
#

Because who ever does that

shadow gazelle
#

because no one ever has a reason to

#

Only reason I've ever seen is entity speed only working with pigs

#

Anyway

#

I want to be able to have other plugins implement this interface so that I can loop through all of the implementations when checking something for an event

#

How should I do that

quaint mantle
#

why does this not work

@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
    Player player = e.getPlayer();

    String hello = "H";
    hello += "e";
    hello += "l";
    hello += "l";
    hello += "o";

    String greeting = "";
    for (char letter : hello.toCharArray()) {
        greeting += letter + "\u0007";
    }

    player.sendMessage(greeting);
}
#

it says e is not defined'

shadow gazelle
#

That's a joke, right?

sullen marlin
#

Learn java and wtf is that hello

quaint mantle
#

yes not funny am i right

#

it was a joke

#

i guess no one laughed

shadow gazelle
young knoll
#

This is what peak hello world looks like

sullen marlin
#

Add it to deluxeasyncjoinmessage++

quaint mantle
#

@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
Player player = e.getPlayer();
String greeting = "";
for (char letter : hello.toCharArray()) {
greeting += letter + "\u0007";
}

player.sendMessage(greeting);

}

#

thats insane

#

you should be banned from java

#

hwid banned

#

what is the default sound volume value ?

#

1 ? 2 ?

sullen marlin
#

1? Idk

shadow gazelle
#

I think it's a float

young knoll
#

Hey MD when will spigot have “quad-thread-cows-and-other-mobs-like-rabbits”

quaint mantle
#

fork

shadow gazelle
#

yeah, it's a float

sullen marlin
#

💀🔫

quaint mantle
#

i try it got too quiet

young knoll
#

I think it’s 1, idk

shadow gazelle
#

1F is loud enough for me

young knoll
#

Pitch is also weird, different sounds seem to have different default pitch values

#

Because Mojang

sullen marlin
#

More like Mojangk amirite

quaint mantle
shadow gazelle
#

There isn't

sullen marlin
#

Nothing in that context

shadow gazelle
#

compiler will infer 1F if you put 1 when you compile it since that's what the method takes

quaint mantle
#

alright

young knoll
#

Can’t believe we don’t have a shorthand for byte

#

Java is literally unusable

sullen marlin
#

B?

#

It's that not a thing

#

F

young knoll
#

I know lowercase b is Boolean

river oracle
#

(byte)

sullen marlin
#

PR it

shadow gazelle
#

I have no clue how services work if that was a stupid question

young knoll
shadow gazelle
#

what

eternal oxide
#

yoru own registry where others register their class

shadow gazelle
#

I thought you were talking about the vanilla/Bukkit class

young knoll
#

I mean it’s essentially the same

eternal oxide
#

pretty much

young knoll
#

They just boil down to a map in the end

eternal oxide
#

this may actually be an xy issue. Why do you believe you need them to register using yoru interface?

quaint mantle
# sullen marlin PR it

bro can u check my code ?
in dm bcs i don't wanna write here and i have problem for this code

eternal oxide
#

are we really that bad?

quaint mantle
#

no actually i don't wanna share my plugin

#

i did this wait

eternal oxide
#

I guarantee you do not have any code we have not seen many times before

#

No one is going ot steal your plugin.

young knoll
#

But it’s the next hypixel!

eternal oxide
#

I can honestly say I've never even logged into hypixel

quaint mantle
quaint mantle
#

alright wait

eternal oxide
#

what is the problem?>

quaint mantle
#

i did this code

#

wait

eternal oxide
#

last time I saw you had issues with the water block flashing so you now have a watering can

quaint mantle
#

no errors but not work

eternal oxide
#

item2 and itemd2?

quaint mantle
#

itemdata

eternal oxide
#

checkign two different items?

#

oh

wise mesa
#

You could make like a registration service

#

where the other plugins would grab your registration service and use that to register their implementation

eternal oxide
#

code looks fine. you need to add debugs as it's probably not getting there

quaint mantle
#

oke

#

im trying

young knoll
#

Sysout best debug tool

quaint mantle
#

i did with broadcast

eternal oxide
#

that works too

quaint mantle
#

yes i can't get broadcast message

tall furnace
#

Anyone here like messing with Vectors? I have a basic shotgun vector randomizer that for whatever reason always fires right-of-center.

eternal oxide
tall furnace
#

public Vector randomizeVector(Vector direction, float accuracy) { return direction.add(new Vector(Math.random() * accuracy - accuracy, Math.random() * accuracy - accuracy, Math.random() * accuracy - accuracy)); }

eternal oxide
#

somewhere earlier you are consuming it

quaint mantle
#

can u send my code in dm ?

#

if i can't find the problem

eternal oxide
tall furnace
tall furnace
quaint mantle
#

i change material water to pumpkin work

#

but how can i get water ?

#

theres pumpkins in minecraft?

#

yes

#

😄

eternal oxide
#

what do you mean by get water?

quaint mantle
#

since when

#

show me a picutre of a pumpkin

#

how can i interact with water ?

#

i want to right click water

#

😄

#

so theres no pumpkins im guessing

#

i change the event block type pumpkin from water

#

and my code work

young knoll
#

You can’t right click water

#

It doesn’t have a hitbox

#

You would have to raytrace to see if water is in your line of sight

eternal oxide
#

you need to detect the click on AIR (null) then iterate the player line of sight upto 5 blocks to detect water

young knoll
#

You probably want right clicks on blocks too

#

Incase they are interacting with the bottom of a shallow pool of water

eternal oxide
#

yep

quaint mantle
#

what do this place ?

#

i mean what is getblockface.getdata = 0 ?

eternal oxide
#

old code, shoudl not use getData anymore

quaint mantle
#

ty

eternal oxide
#

look at post #13 I linked

quaint mantle
#

i did at post #10

#

it work

eternal oxide
#

13 is better

quaint mantle
#

yes

#

i understand now water need blockface

eternal oxide
#

13 is better because it uses the player line of sight

#

13 will also work if looking into deep water

fleet imp
#

Can someone give an example of how to use Entity.setMetadata()

young knoll
#

It allows you to store data on entities that other plugins can access

#

But it’s lost on restart, if you want it to persist use PDC instead

eternal oxide
#

try not to use it

fleet imp
#

oh i thought it was nbts

eternal oxide
#

MetaData is leaky

young knoll
#

Iirc it’s also kind of leaky implemention wise

fleet imp
#

how do i edit nbts then

young knoll
#

Vanilla NBT, use the various api methods

#

Custom NBT,

#

?pdc

fleet imp
#

ok thx

young knoll
#

Deprecate metadata when

eternal oxide
#

might be an idea

#

if just to discourage it's use

worldly ingot
#

?

#

Metadata is incredibly useful

young knoll
#

Isn’t it leaky

remote swallow
#

but we have pdc

worldly ingot
#

It's not meant to be persistent data

#

It's meant to allow for inter-plugin communication without explicitly depending on them

remote swallow
#

sus

young knoll
#

Idk I heard it was leaky implementation wise

#

I haven’t actually looked

eternal oxide
#

I remember being told it was leaky. Had it explained but I can;t remember

worldly ingot
#

I like to use VanishNoPacket as an example. Actually a lot of vanish plugins have adopted this technique.

public static boolean isVanished(Player player) {
    for (MetadataValue value : player.getMetadata("vanished")) {
        if (value.asBoolean()) {
            return true;
        }
    }

    return false;
}```
#

VNP attaches a lazy metadata value that evalutes to one of its methods

remote swallow
#

why

worldly ingot
#

So that you don't have to explicitly depend on VNP. Most vanish plugins assign this metadata

remote swallow
#

couldnt that be shortented to return value.asBoolean()

eternal oxide
#

single session values

worldly ingot
remote swallow
#

you do the loop so return the first instance

worldly ingot
#

What if the first one is false but the second is true?

remote swallow
#

tough shite, why do you have 2 vanish plugins

#

¯_(ツ)_/¯