#help-development

1 messages Ā· Page 868 of 1

undone axleBOT
azure zealot
#

xd

wraith dragon
#

šŸ‘‰ šŸ‘ˆ

echo basalt
#

the answer that comes immediately to mind is no

#

AFAIK there's a GamePhase#tick method

#

You can use that to your advantage

#

For example

rough drift
#

If another plugin adds the same command as my plugin, is there a way to let my plugin's be the one running? (Maybe using PlayerCommandSendEvent & PlayerCommandPreprocessEvent?)

elder harness
#

Why is there no ItemMeta#deserialize, but there is a ItemMeta#serialize? I am stuck with a Map<String, Object> that I can't deserialize

#

I see people talking about a deserialize method from CraftMetaItem, but I can't find that class

shadow night
elder harness
#

Could be, yea

shadow night
#

ye, the serialize comes from the ConfigurationSerializable interface it seems

wraith dragon
echo basalt
#

yeah I do sumn like this

#

The GameTask interface has a start() and dispose() method

#

Basically you can make your own custom logic and attach it as a task

#

And when the phase ends, it disposes automatically

#

unless you manually cancel it

elder harness
icy monolith
#

Can some one send the the SQLite documentation for java?

chrome beacon
wraith dragon
plain plaza
#

Is there to trigger a player into elytra mode? the player has an elytra equipped dont worry.

#

yep, just figured that out

#

thank you

wary harness
#

at what version was PrepareGrindstoneEvent added

upper hazel
#

how can you make a region unique with the same ID in 1 world

echo basalt
#

hashcode?

wet breach
upper hazel
#

I mean, how does protectionStones, for example, give an id to a region with the same template? It seems you can’t give the same id to a region

wet breach
#

what an old plugin

wraith dragon
wet breach
#

what kind of region are you making?

#

are you referring to when a player places a stone?

echo basalt
#

spending my morning manually aligning inventory slots

#

(this is not an image)

upper hazel
wet breach
#

it uses the players name and just adds a number

#

it uses world guards region listing

#

at least that is what I recall in how it worked from way back when

#

not sure if it has since changed or not

upper hazel
#

like - player region: {PLAYER} {ID} ?

wet breach
#

I don't recall the world guard api, but I am pretty sure you can use it to find regions owned by a player

#

since regions can have owners

#

not sure why you need to know how protection stones works though

#

most of its code is just using worldguard api

#

the only thing feature wise it adds to it, is giving the ability to allow players to create their own regions and the ability for that to be tied to the economy

upper hazel
#

I just noticed that the names of the regions of these forks are the same, although this is impossible

wet breach
#

as well as limiting how many regions they could create

upper hazel
#

bc this id lol.

#

wordguard region id

echo basalt
upper hazel
echo basalt
#

pain

#

and fonts

#

and pain

upper hazel
#

this textures?

echo basalt
#

yeah

#

each row has its own utf

upper hazel
#

lol

wet breach
echo basalt
#

And with a little bit of math things can be done

wet breach
#

therefore it doesn't matter if two regions have the same name

upper hazel
echo basalt
#

just make a uuid

upper hazel
#

will look weird

#

i think need use count

echo basalt
#

have an incrementing counter or a name pool

#

For waystones at a server I work at we use a name pool

#

With stuff like "Shadowfall" or random names

#

once the pool is exhaused we just add numbers

#

"shadowfall 2"

wet breach
#

most likely

#

global regions are used for templating

#

typically anyways

echo basalt
#

yay skipping slots works

versed moss
#

!paste

#

can someone send me the paste link please

wraith dragon
#

?paste

undone axleBOT
versed moss
#

thanks!

wraith dragon
#

npnp

signal kettle
#

is there a way to make a dmg for player on playerinteractevent? or I will need to code smth like spawn arrow above his head or spawn sweet berries bush and then catch the event and change this damage to bigger one?

versed moss
#

Can someone please help me here?

I want to save the item meta of any item into a config, and then load it when they open it back up. For some reason, when i close it the first time it saves the item meta perfectually to the config. but then if i open it again after i close it, the enchantments and meta clears, and only shows a default diamond chestplate

https://paste.md-5.net/luyezoqodi.php

glossy venture
echo basalt
#

For some reason java's regex engine is different to js's ?

#

having a niche bug rn

tardy delta
glossy venture
#

nah it exists

chrome beacon
#

Can't exactly remember what though

tardy delta
#

experienced smth similar

chrome beacon
#

What's the problem?

echo basalt
#

trying to optimize minimessage tags rn

#

I'll need to change it to support other stuff

remote swallow
#

use pineapple chat

versed moss
chrome beacon
#

You seem to be doing a lot weird things instead of just storing the item

tardy delta
#

put debug statements and dont use a player object as key in any hashtable

versed moss
echo basalt
#

wtf is this

glossy venture
#

ok so decompiled the jar does not have the updated library for some fucking reason it was working before

chrome beacon
versed moss
#

so do i just do ItemStack[] contents = (ItemStack[]) config.get(locationOfContents)

chrome beacon
#

I'd get a list

agile hollow
#

how can i make the obsidian explode?

versed moss
#

so config.getList() instead?

chrome beacon
#

Yeah

versed moss
dry hazel
#

arrays != lists

#

change the type to a List<ItemStack>

versed moss
quiet ice
dry hazel
#

jdgui my beloved

versed moss
#
List<ItemStack> contents = (List<ItemStack>) config.getList(path+".items");

            for(ItemStack cont : contents){
                if(cont != null){
                    gui.addItem(cont);
                };
            }
echo basalt
#

jdgui my beloved

#

recaf my second beloved

#

it's too slow

dry hazel
#

slow with what

echo basalt
#

ui and stuff

#

takes forever to open

#

I just can't bother

granite root
#

Hello i have a ceratain problem with my project (it's a FORGE API) .Namely i use an forge 1.12 api and all works good on singleplayer but when i try to use a multiplayer my mod looks like completely off 0 reactions.
@Mod(
modid = Abcd.MOD_ID,
name = Abcd.MOD_NAME,
version = Abcd.VERSION,
acceptableRemoteVersions = ""

)
public class Abcd {

public static final String MOD_ID = "abcd";
public static final String MOD_NAME = "Abcd";
public static final String VERSION = "2.0";



@Mod.Instance("abcd")
public static Abcd instance;

@Mod.Instance(MOD_ID)
public static Abcd INSTANCE;



/**

This is the second initialization event. Register custom recipes/@Mod.EventHandler
public void init(FMLInitializationEvent event) {
FMLCommonHandler.instance().bus().register(this);
MinecraftForge.EVENT_BUS.register(this);
}
It's a part of my code the rest are just events that works on singleplayer but multiplayer doesnt

eternal night
#

wrong server šŸ˜…

versed moss
#

spigot not forge lol

granite root
#

yeah but there i didnt get even one help message for 3 days so im trying here ;/

eternal night
#

rip

versed moss
#

with the error

dry hazel
#

contents is null

#

do you have anything at that config node?

versed moss
#

machines:
'-13671181':
owner: FinGym2468
whitelisted: ''
location:
==: org.bukkit.Location
world: world
x: -135.0
y: 74.0
z: 181.0
pitch: 0.0
yaw: 0.0
items:
- null
- null
- null
- null
- null
- null
- null
- null
- null
- null
- ==: org.bukkit.inventory.ItemStack
v: 2730
type: GRASS_BLOCK
- null
- null
- null
- null
- null
- null
- null
- null
- null
- null
- null
- null
- null
- null
- null
- null

#

o sorry

#

i forgot to paste it lol

dry hazel
#

and are you fetching that one?

#

cause it looks like it's selecting something else

versed moss
#

yea i'm fetchingit

dry hazel
#

the path is the same when loading and saving?

versed moss
#

yup

#

it works because when i print out the owner, it points to it

chrome beacon
#

Print the exact path and make sure it's rounding the way you want

#

alternatively just floor or ciel

versed moss
#

alright, thanks for the help ill try that out rn

icy beacon
#

Anyone worked with retrofit? I'm trying to get my android app to fetch data from my api. If I run my code synchronously (as shown below), it'll work fine, but for some reason android disallows synchronous network calls (according to logcat)? So it just crashes

dataStorage.api.getSubsets().execute().body()?.forEach {
  subsets.add(it)
}

So I decided to do it with coroutines and make a suspend function instead, but this just does not work

println("Waiting for subsets") // This is called
dataStorage.api.getSubsets().await().forEach {
  println("Adding subset ${it.name} ${it.imageUrl}") // This is NEVER called
  subsets.add(it)
}

And I'm left waiting forever. Anybody knows what this could be caused by?

chrome beacon
#

Is that Groovy

sand spire
#

Is there an action or something else to see if a player is looking at an entity within a certain range?

icy beacon
#

Kotlin

icy beacon
chrome beacon
#

So it also has those weird forEach methods šŸ’€

icy beacon
orchid gazelle
chrome beacon
#

? no need to multiply

orchid gazelle
#

Oh well then it can handle that

#

Ahh yeah I remember having to multiply for my own raycasting algorithm

sand spire
#

Thank you both šŸ¤

orchid gazelle
#

šŸ¤

sand spire
#

first i gotta find out how raytrace works but I think i will figure it out

icy beacon
#

Just call 1 function, it'll return a RayTraceResult

icy beacon
#

Maybe someone knows there :p

hazy parrot
signal kettle
#

How I can play hurt effect for player? Like the screen shake and a read/blood screen effect?
I tried player.playEffect(EntityEffect.HURT); but it doesn't work;/

icy beacon
#

Not my function

young knoll
#

You could damage them for 0

signal kettle
young knoll
#

player.damage(0)

icy beacon
# icy beacon It's from retrofit

dataStorage.api.getSubsets().await()

  • api is my interface BackendAPI, it's instantiated by retrofit
  • getSubsets() is this function:
@GET("api/v1/subsets")
fun getSubsets(): Call<List<Subset>>
  • await() is a suspend fun <T : Any> Call<T>.await(): T in Retrofit
hazy parrot
#

Oh I trought it's your extension, idk then

signal kettle
tender shard
#

ForbiddenFruit:

package com.github.spigotbasics.core.module

class ForbiddenFruitException(clazzName: String) :
    Exception("Module tried to eat forbidden fruit $clazzName") {
}

ModuleJarClassLoader

package com.github.spigotbasics.core.module.loader

import com.github.spigotbasics.core.module.ForbiddenFruitException
import org.bukkit.scheduler.BukkitScheduler
import java.io.File
import java.net.URLClassLoader

class ModuleJarClassLoader(val file: File, parentLoader: ClassLoader) :
    URLClassLoader(arrayOf(file.toURI().toURL()), parentLoader) {

    companion object {
        val FORBIDDEN_CLASSES = listOf(BukkitScheduler::class.java).map { it.name }
    }

    override fun loadClass(name: String): Class<*> {
        return this.loadClass(name, false)
    }

    override fun loadClass(name: String, resolve: Boolean): Class<*> {
        if (FORBIDDEN_CLASSES.contains(name)) {
            throw ForbiddenFruitException(name)
        }
        return super.loadClass(name, resolve)
    }
}

Isn't this beautiful?

shadow night
#

No, I understand no word

tender shard
#

modules must not access BukkitScheduler or else they'll get a ForbiddenFruitException

shadow night
#

Do you have something against the scheduler or what

tender shard
#

modules shall only access our own Scheduler, otherwise we wouldn't be able to cancel tasks of modules being disabled

#

they must only use BasicsScheduler

shadow night
#

In kotlin, are they methods or functions

tender shard
#

functions

shadow night
#

But why, aren't functions those that are outside of classes and methods those inside or something

tender shard
#

function is simply the term in kotlin. functions can be declared at top levle (outside of classes) or inside of classes.
in java they're called methods and are always bound to a class

valid burrow
#

is it fine to use this

young knoll
#

I mean, ideally you use the replacement

valid burrow
#

whats the replacement

tender shard
#

use Attributes

#

GENERIC_MAX_HEALTH

valid burrow
#

alriught thx

elder harness
#

Location is correct. I just don't see any redstone block breaking at the location

tardy delta
quaint mantle
#

Has anyone here looked at the auth me plugin source?

peak depot
#
        ItemStack potSpeed = new ItemStack(Material.POTION, 1);
        ItemMeta potSpeedMeta = potSpeed.getItemMeta();
        PotionMeta hpotmeta = (PotionMeta) potSpeedMeta;
        Objects.requireNonNull(hpotmeta).setLore(List.of("§7Alle Spieler bekommen Speed 2"));
        hpotmeta.setDisplayName("§bSpeed 2");
        PotionEffect speed2 = new PotionEffect(PotionEffectType.SPEED, 15, 1);
        hpotmeta.addCustomEffect(speed2, false);
        potSpeed.setItemMeta(hpotmeta);

``` how would I change the color of the potion
tender shard
tardy delta
#

it would call your overridden loadClass(String, Boolean) method

tender shard
worldly ingot
#

Requires a Bukkit Color, so you can do Color.fromRGB(red, green, blue) (each a value from 0 - 255), or you can use a hex value like Color.fromRGB(0xRRGGBB)

shadow night
#

Bukkit has an own color class??

river oracle
#

Yeah

shadow night
#

Doesn't awt or whatever it was called have one too

civic sluice
#

jup

river oracle
#

Yeah awt is usually the default java one used

worldly ingot
#

awt is a graphics library which isn't present in all JDKs (namely headless JDKs)

tender shard
#

Okay so I now got a custom class loader working that I can use to prevent certain classes from being accesses, e.g. BukkitScheduler. However now I'd like to make it possible to access the Bukkit PluginManager, but only intercept certain methods being called from that, e.g. registerEvents - what's the easiest way to do this? Proxy classes?

tardy delta
#

kotlin has delegates

tardy delta
#

then you could so smth like

class ProxiedPluginManager(private val pm: PluginManager) : PluginManager by pm {
  override fun registerEvents(...) { /* own logic */ }
}```
tender shard
tender shard
tardy delta
#

you mean detecting whenever org/bukkit/PluginManager gets loaded and returning ProxiedPluginManager::class instead?

#

dunno what you've been doing with classloaders

tender shard
# tardy delta dunno what you've been doing with classloaders

the plugin consists of modules. modules shall be able to be enabled/disabled at anytime, hence we need to keep track or listeners and tasks registered by those modules, so we can cancel/unregister them when a module gets disabled. This is currently working fine for tasks - I simply disallow access to the BukkitScheduler. The PluginManager however shall be allowed, I only want to disallow modules calling registerEvents

https://github.com/SpigotBasics/basics

tardy delta
#

ah the classloader acts as a bridge to the platform code

#

uhh

#

cant you use reflection to set the plugin manager in CraftServer? dunno if that works on final fields

young knoll
#

final yes

#

static final no

shadow night
#

What is the different

young knoll
#

one is static

#

:p

shadow night
#

Why is that bad

#

I mean

young knoll
#

Because reflection says no

shadow night
#

Static is generally bad

shadow night
young knoll
#

You either need old java janky reflection or unsafe

young knoll
tender shard
tardy delta
#

do you need to change modifiers with &= ~Modifiers.FINAL?

young knoll
#

No

shadow night
#

Can you spoof the pluginmanager or something

young knoll
#

setAccessible handles both final and private

tardy delta
#

ah

young knoll
#

I should make a chart on this

#

:p

tardy delta
#

cant think of a better way atm

valid burrow
#

how can i check if a block is placed by players or generated naturally

rotund ravine
#

Good luck.

valid burrow
#

is there a way or would i have to manually collect all the data

rotund ravine
#

Yes gather data

#

If u have coreprotect or smth similar u can prolly pull from there

young knoll
#

Otherwise blockpdc I guess

#

Or your own database

orchid gazelle
#

wouldn't it be possible to save some performance by making API to disable some features of minecraft and then save performance by for example disabling ticking for it?

river oracle
#

I don't think a plugin can do this

orchid gazelle
#

I mean, if we implement it in Spigot

river oracle
#

Sure but i doubt that'd be accepted if something ticks that probably shouldn't or doesn't need to you can just disable the ticking in those instances

#

That is much more likely to be accepted

rotund ravine
orchid gazelle
#

I didn't get that sentence lmao

rotund ravine
#

Paper and purpur already has toggles for a lot of stuff and it def helps some to turn off some features. So yeah spigot could have improved performance by turning off stuff

orchid gazelle
#

what could we toggle?

#

which helps performance a lot?

echo basalt
#

oh yeah jan while you're here

rotund ravine
#

Butcher villagers

echo basalt
#

I tried your event debugger and it spammed exceptions

rotund ravine
#

Oh nice, haven’t updated or touched that for a long time

orchid gazelle
#

like, just make a simple API call Server#disableThisShit and then make the server NOT tick that shit anymore?

rotund ravine
echo basalt
#

it also doesn't clean up so it was still spamming exceptions after being disabled

orchid gazelle
#

sounds like 0 to me

#

gotta do some shit that is related to ticking in order to improve performance a lot

#

or sth like that

rotund ravine
echo basalt
#

advancements and villagers are useless for minigame servers

rotund ravine
echo basalt
#

but so is spigot

young knoll
#

I mean

orchid gazelle
young knoll
#

If you don't have any villagers they won't tick

orchid gazelle
#

yeah exactly

rotund ravine
#

Don’t be logical

echo basalt
#

npc shops?

orchid gazelle
young knoll
#

Use npcs for that

#

smh

#

Or just call setNoAi/setAware

#

I mean I guess they will still tick they just won't do much

echo basalt
#

no

orchid gazelle
#

and would this go in CB?

young knoll
#

Idk if MD would accept that

echo basalt
#

just make a plugin for it

#

that pastes dummy entity managers n stuff

#

hacks the shit out of nms

orchid gazelle
rotund ravine
#

I mean a spigot config option would make more sense than api to do it.

echo basalt
#

fuck it now I'm inspired to reflect into the guts of nms

#

disable EVERYTHING

orchid gazelle
#

lmao

rotund ravine
orchid gazelle
#

tell me some more heavy shit that we can screw up?

rotund ravine
#

World gen

echo basalt
#

I mean yeah but still maintain stuff

orchid gazelle
#

same thing, world gen does not trigger if you don't generate more chunks

echo basalt
#

disable world saving but still maintain spigot

rotund ravine
#

World loading

#

Entities

orchid gazelle
rotund ravine
#

Poorly optimized plugins

orchid gazelle
echo basalt
#

if(plugin.getName().startsWith("Essentials"))

orchid gazelle
#

plugin.disable()

rotund ravine
#

Players too

orchid gazelle
#

well we cannot just disable entities at all lol

#

at least that's senseless

echo basalt
#

disable everything but players

young knoll
#

If you can optimize something with 0 effect on behaviour feel free

echo basalt
#

every spawnEntity method just returns a dummy entity

young knoll
#

If it changes behaviour at all, it'll need to be disabled by default

rotund ravine
#

You should pr a tnt dupe fix

mighty crane
#

java.lang.NoSuchMethodError: 'net.kyori.adventure.text.format.TextDecorationAndState net.kyori.adventure.text.format.TextDecoration.withState(boolean)'
I'm getting this error when I use MiniMessage.miniMessage().deserialize("")
How do I fix this?

young knoll
#

kek

#

Pr it to mojang first

echo basalt
#

compiling with paper and using spigot?

mighty crane
young knoll
#

Although they won't fix it until the provide an alternative for movable tnt

rotund ravine
#

Shade a new adventure and relocate it i suppose

echo basalt
young knoll
#

So PR movable tile entities to mojang first

#

:p

mighty crane
#

im using 1.17.1

young knoll
#

I was actually thinking of PRing movable tile entities to spigot

echo basalt
#

then yeah shade adventure

young knoll
#

Via a new event

rotund ravine
wary harness
mighty crane
orchid gazelle
#

is there anything major that could be unneccessary in entity ticking

#

?

rotund ravine
#

@echo basalt He’s using paper, was turned away when he said he wasn’t using 1.20.4 and came here 🤪

young knoll
#

kek

rotund ravine
mighty crane
#

maven

echo basalt
#

ppl at work want this

wary harness
#

oh cool

rotund ravine
#

?shading

#

Dang

mighty crane
wary harness
#

lock is another

rotund ravine
#

Does mfnalex have a shading doc or smth

echo basalt
wary harness
#

I see

rotund ravine
#

@tender shard got a shading thing on ur blog?

wary harness
#

what version was PrepareGrindstoneEvent added

rotund ravine
wary harness
rotund ravine
#

There is

#

I am just too lazy

young knoll
#

Wait the lock is custom model data

#

What is the background

tender shard
rotund ravine
wary harness
young knoll
#

Ahhh clever

#

I assume the background is in the inventory title then

tender shard
# mighty crane thx

if you also want to relocate shaded dependencies, add this into your maven-shade-plugin <plugin>:

      <configuration>
        <relocations>
          <relocation>
            <pattern>com.jeff_media.customblockdata</pattern> <!-- package name of what you want to relocate -->
            <shadedPattern>your.own.package.name.customblockdata</shadedPattern> <!-- target name -->
          </relocation>
        </relocations>
      </configuration>
peak depot
#

how to get the ammount of items that a block would drop with fortune

chrome beacon
#

Do note that you shouldn't use this if you have an actual block being broken

peak depot
#

nah I want too do cutclean so ores automaticly get smelten

chrome beacon
#

When a player is breaking a block?

young knoll
#

Ooh fun

#

Use the BlockDropItemEvent

echo basalt
#

it's a mix of 6 characters + color + spacing

#

and acts as a really low quality screen

young knoll
#

Very cool

#

RGB text + custom fonts + negative spacing OP

echo basalt
#

there's also some optimizations being done

#

like space merging and color merging

#

basically I merge duplicate spacing so the client has less to render

#

and I also merge color tags to keep the component simpler

quaint mantle
echo basalt
#

I mean technically this is just a static method

#

that returns a component

#

so it's doable

#

you could also precompile the entire rickroll animation

#

Ig it'd be funny to constantly rickroll ppl opening checks without disrupting inv flow

soft latch
#

The ReadTimeoutException : null error is from spigot?

echo basalt
#

but at the same time you can get a much higher quality image by just skipping this and making a solid image

tender shard
soft latch
#

When you enter my server, some users see ReadTimeoutException : null

tender shard
icy monolith
#

Anyone knows why this happens? I just started working with SQLite and OMRLite. Trying to figure out why it spits out stuff about an exception even tho i allreay have an exception handled in the code.

    public PlayerData getPlayerTokens(Player player) throws SQLException {
        return playerDataDao.queryForId(player.getUniqueId().toString());
    }```
chrome beacon
#

It suggests handling the exeption because you've told it getPlayerTokens might throw SQLException

icy monolith
#

Its an error i should ignore?

chrome beacon
#

No

icy monolith
#

Ok then how would i go about handling it?

chrome beacon
#

Catch the exeption and handle it to fit your needs

icy monolith
#

Ok

chrome beacon
#

also do make sure to cache data and not call database request on the main thread

icy monolith
#

Idk what that means. Im not familiar with thoes terms

#
    public PlayerData getPlayerTokens(Player player) throws SQLException {
        try {
            return playerDataDao.queryForId(player.getUniqueId().toString());
        } catch {
            player.sendMessage("No information about this player's tokens was found!");
            return null;
        }
    }```
Like this?
#

oh wait catch needs a parameter

#

Is it the SQLException?

#
    public PlayerData getPlayerTokens(Player player) throws SQLException {
        try {
            return playerDataDao.queryForId(player.getUniqueId().toString());
        } catch(SQLException exception) {
            player.sendMessage("No information about this player's tokens was found!");
            return null;
        }
    }```
Like this, but then i guess the "throws SQLExceptions" is removable
chrome beacon
#

yeah

#

Also sending the message there seems like a bad idea

icy monolith
hardy spire
#
Caused by: java.lang.NoSuchMethodError: com.mongodb.client.MongoCollection.insertOne(Ljava/lang/Object;)Lcom/mongodb/client/result/InsertOneResult;
    at dk.shadow.bande.bande.BandeHandler.saveAllBandes(BandeHandler.java:285) ~[?:?]
    at dk.shadow.bande.commands.ingamecommands.bandeadmin.subs.SaveSub.lambda$onCommand$0(SaveSub.java:21) ~[?:?]
    at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640) ~[?:1.8.0_392]
    at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1632) ~[?:1.8.0_392]
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[?:1.8.0_392]
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[?:1.8.0_392]
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) ~[?:1.8.0_392]
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175) ~[?:1.8.0_392]
public void savePlayer(UUID uuid) {
        PlayerData playerData = playerDataHashMap.get(uuid);
        if (playerData == null) {
            Bande.getLog().sendMessage("[ERROR] Player with UUID " + uuid + " not found in playerDataHashMap");
            return;
        }

        try {
            Document setData = new Document("bande_name", playerData.getBandeID())
                    .append("player_name", playerData.getPlayer_Name());

            if (playerDocumentExists(uuid)) {
                Document update = new Document("$set", setData);
                mongoCollection.updateOne(Filters.eq("uuid", uuid.toString()), update);
            } else {
                mongoCollection.insertOne(new Document("uuid", uuid.toString())
                        .append("bande_name", playerData.getBandeID())
                        .append("player_name", playerData.getPlayer_Name()));
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
quaint mantle
#

Hey guys, I want to save inventory all items to SQL database, and the encode/decode are the best way to do it?

chrome beacon
chrome beacon
quaint mantle
dry hazel
#

blob is just binary data

shadow night
#

So, a byte array?

sharp heart
#

Hello, how to spawn "fake" entity through packets in 1.20.4 and send it to player ?

quaint mantle
hazy parrot
#

Yes, as you catch it

split lichen
#

What's the optimal way to change a player's nametag (I'm referring to the player name specifically, not just team prefixes through scoreboards) in 1.20?

civic sluice
quaint mantle
#

Hey guys, I'm making Shop Plugin on bungeecord server
And I have a question How can I store shop data? (Currently, I saved it on database 'cause I think it's the best way to do it)
Is there anyway to store data?

chrome beacon
#

If you want another way to store data you can probably use Redis

torn shuttle
#

wow mojang

#

spiders on walls forget pathfinding exists

shadow night
quaint mantle
torn shuttle
#

like the actual pathfinding class

#

they delete it

shadow night
#

Lmfao

torn shuttle
#

very neat, very cool

chrome beacon
lean pumice
#
public boolean setupEconomy() {
        System.out.println("0");
        if (!instance.getServer().getPluginManager().isPluginEnabled("Vault")) {
            return false;
        }
        System.out.println("1");
        RegisteredServiceProvider<Economy> rsp = instance.getServer().getServicesManager()
                .getRegistration(Economy.class);
        System.out.println("2");
        if (rsp == null) { // console output is 0, 1, 2 //TODO: get because is null
            return false;
        }
        System.out.println("3");
        Core.v_economy = rsp.getProvider();
        System.out.println("4");
        return Core.v_economy != null;
    }

beacuse rsp == null?

chrome beacon
#

So you want to use it together with something else (since you probably want things to persist across restarts of redis)

quaint mantle
#

Ahh thank u for answer šŸ™‚

torn shuttle
#

call me crazy but I think the navigation class should act as a global navigation solution for all entities

#

I know, I know, this is heresy

#

but hear me out, maybe slimes should be able to pathfind

valid burrow
#

anyone got an easy soultion to checking if a block is placed by a player?

torn shuttle
#

same with rabbits and bats

shadow night
#

Lol

shadow night
valid burrow
#

or well could but

shadow night
#

why can you not

valid burrow
#

it would require enormous amounts of data wouldnt it

#

for like a huge ass smp server

shadow night
valid burrow
#

i red world edit has such a method

#

read

#

not sure how well it works though

shadow night
#

Depends on how it works

slender elbow
valid burrow
#

arl i guess ill do it with pcd

#

too bad

#

pdc

shadow night
#

Pdc just sounds like the best way to do something like that lol

valid burrow
#

you think it maybe be easier to an SQL database

#

or

#

better

#

not easier

#

what about CoreProtect

chrome beacon
#

Never used it myself šŸ¤·ā€ā™‚ļø

chrome beacon
#

Which can take up quite a bit of storage ofc

valid burrow
#

so im better of storing it myself?

chrome beacon
#

You probably want to store it yourself yeah

valid burrow
#

what would you recommend

#

mysql or pdc

chrome beacon
#

What's the use case

valid burrow
#

well every sinlge block that is brocken by a player needs to be checkde

chrome beacon
#

and why?

valid burrow
#

im making a hypixel skyblock like game that gives players skill xp when they break certain blocks

#

mining xp for stone

#

farming xp for farming stuff

#

etc etc

#

i dont players to be able to place their own block and break them again

#

yk

chrome beacon
#

I would use SQLite or PDC

valid burrow
#

the whole plugin already uses mysql and i dont wanna change it to sqlite which i dont even know anyways so im gonna go with pdc then

chrome beacon
#

You can use MySQL too if you'd want

valid burrow
#

i just want whats fastest

chrome beacon
#

Maybe use that to prevent exessive chunk file sizes

valid burrow
#

mhm

peak depot
#

how can I disable natural regen (with food) thats what I got:

@EventHandler
  public void onHardCore(EntityRegainHealthEvent event) {
      if (event.getRegainReason() == EntityRegainHealthEvent.RegainReason.EATING && main.hardcore) {
          event.setCancelled(true);
      }
  }```
chrome beacon
valid burrow
#

im not yet sure what scale this whole thing will reach

chrome beacon
#

Do make sure to optimize the data you're storing

valid burrow
#

yea

#

ill save like 1 character

chrome beacon
#

You can compress it further

#

1 character takes 8 bits you could in theory store 8 blocks

#

A 1 for player block and a 0 for non player placed block

valid burrow
#

my idea was to just not store non player placed blocks

#

at all

#

if its in there its placed by a player

#

if its not in there

#

its natural

chrome beacon
#

The thing is you need to store where the player placed block is

valid burrow
#

yeah

#

my idea was to simply store coordinates

#

and if the cdoordinates are in there

#

its a player placed block

#

if they are not

chrome beacon
valid burrow
#

but how exactly would the server know what the cords are

#

just store every single block in order?

candid galleon
#

how would you store 8 blocks in one byte?

valid burrow
#

1 byte peer block

candid galleon
#

so you’d need a single gigant at number to store the entire world?

chrome beacon
#

You'd store it in the chunk pdc

#

but yeah it would essentially be a massive binary number

candid galleon
#

i guess that could work

#

probably better than storing it per block

#

someones definitely asked this question before though

valid burrow
#

mhm

sharp heart
#

Do someone have an example for sending the spawn entity packet of ItemDisplay and TextDisplay in 1.20.4 ?

hushed spindle
#

im trying to load in player stats when they log in, but the issue is that some of those stat updates also cause packet updates to the player or interact with bukkit in some other way that's not allowed asynchronously. right now i'm doing it sync, but that's causing a bit of a lag spike. whats a better way to go about it, to spread out the various updates required to update their stats over a longer period of time or something else?

#

i would assume doing it async and then calling a task to re-sync those stat updates would also cause a lag spike due to the amount of tasks scheduled

lost matrix
hushed spindle
#

stuff like discovered recipe updates need to be done sync

#

there are also some attribute updates

lost matrix
#

Those can surely be applied sync in microseconds

hushed spindle
#

actually yeah im just being stupid to update those stats like that right away

#

nevermind

chrome beacon
#

That's how you work with NMS

lost matrix
sharp heart
shadow night
#

What is a ConcurrentMap? I constantly see it

echo basalt
#

We don't want to have a memo leak if someone starts the login process and doesn't manage to go through

lost matrix
shadow night
#

Finally, I always needed that

lost matrix
lost matrix
river oracle
shadow night
#

I absolutely love open source code

#

Everything is so transparent

lost matrix
river oracle
#

with a somewhat better implementation

#

The improvements draw on our experience designing Guava's cache and ConcurrentLinkedHashMap.

slender elbow
#

the guava javadoc suggest to use caffeine too

sharp heart
#
  final CraftWorld world = (CraftWorld) location.getWorld();
        final Level handle = world.getHandle();

        final net.minecraft.world.entity.Display.TextDisplay textDisplay = new net.minecraft.world.entity.Display.TextDisplay(EntityType.TEXT_DISPLAY, handle);

        textDisplay.setBillboardConstraints(net.minecraft.world.entity.Display.BillboardConstraints.FIXED);
        textDisplay.setInvulnerable(true);
        textDisplay.setPos(textLocation.getX(), textLocation.getY(), textLocation.getZ());
        textDisplay.setYRot(LocationUtil.getYaw(orientation.textFace()));
        textDisplay.setXRot(0);

        final List<SynchedEntityData.DataValue<?>> textData = new ArrayList<>();

        textData.add(SynchedEntityData.DataValue.create(new EntityDataAccessor<>(12, EntityDataSerializers.VECTOR3), new Vector3f(0.6f, 0.6f, 0.6f)));

        textData.add(SynchedEntityData.DataValue.create(new EntityDataAccessor<>(23, EntityDataSerializers.COMPONENT), CraftChatMessage.fromString("Hello")[0]));

        for (final Player player : Bukkit.getOnlinePlayers()) {
            final CraftPlayer craftPlayer = (CraftPlayer) player;
            craftPlayer.getHandle().connection.send(new ClientboundAddEntityPacket(textDisplay, 0));
            craftPlayer.getHandle().connection.send(new ClientboundSetEntityDataPacket(0, textData));
        }

Hello, I tried to send a packet to spawn a text display, the entity is spawning, but all its data (text, scale) aren't applied.

vapid grove
#

Is there a reason that teleporting the player sometimes can cause them to tp places they shouldnt be?
Sometimes it can be them in a cave, using teleport and it teleports them to above the cave
Or the nether, and gets tped to the nether roof

#
public static void teleportToSurvival(Player player) {
        UUID id = player.getUniqueId();
        String[] loc = ((String)PlayerData.getUserData(id, "Last.Location")).split(":");
        String world = (String)PlayerData.getUserData(id, "Last.World");
        Location l = new Location(Bukkit.getWorld(world), Integer.parseInt(loc[0]), Integer.parseInt(loc[1]), Integer.parseInt(loc[2]));
        
        player.teleport(l, PlayerTeleportEvent.TeleportCause.COMMAND);
    }
#

This is specifically the code thats causing this issue.

shadow night
#

Hm, is it just me or is this smelling like a bit too much staticity

young knoll
#

Either thats where the coordinates point to

shadow night
#

Or am I high rn

young knoll
#

Or some failsafe is teleporting them to the top block

vapid grove
#

Its when they rejoin the survival world that they get put on it

lost matrix
#

Uh, accessing data by Strings. 😦
Type safety cries when looking at this.

young knoll
#

I think essentials has a failsafe for that

#

Other plugins probably do too

umbral ridge
#

hey

quaint mantle
#

Bros should use byte[] for that

umbral ridge
#

what's sponge? is it a fork of paper?

#

what api do you use for it

#

to make plugins

lost matrix
#

Sponge API

quaint mantle
shadow night
split lichen
#

How do I reset/refresh player profiles?

umbral ridge
#

is it very different to Spigot?

lost matrix
#

And sponge has nothing to do with spigot/paper

lost matrix
young knoll
#

It's an entirly differnt api, so yeah

shadow night
#

It's a completely seperate thing

young knoll
#

It also has a version that runs forge

river oracle
#

sorry gang text wall incoming :(

#

@carmine mica It's been a week since I posted a response on stash, so I'll ping you here instead since I'm interested in your thoughts on this.

First I agree we should probably get rid of Inventory#getMenuType obv we were trying to get away from that it'd be pure idiocy to just go back to it.

Second your response all made me further question how realistic it is to keep allowing these so called "virtual inventories". I myself am hard against things like CraftMultiCraftRestulContainer existing in implementation, however, if we want users inventories to "work" as expected these crappy implementations need to be done. It might honestly be worth it to just remove CraftContainer and pass through SimpleContainer (aka InventorySubContainer in spigot maps) implementations to everything so they can "store" items and not much else without the drawbacks of CraftContainer existing.

Third, I'm wondering whether you'd think it'd even be advantageous to modify the Bukkit#createInventory API at this point. I wonder if it'd be better to just let it die and force newer plugins into using MenuType#create which is and always will be the better way to create Menus. If we go with this approach the API will be easier to maintain and use as well as expand in the future as we'd have removed the need for any form of major patching unless something big changes.

umbral ridge
shadow night
vapid grove
#

I clearly need to watch a 10 hour tutorial on java if a small segment of my code gets a LOT of complaints lmao
Any good tutorials out there anybody would recommend I watch?
I get I could search one up but considering that you guys had to learn from somewhere you probably know better sources.

quaint mantle
#

All you have to learn is oop

river oracle
#

OOP is blegh just learn syntax and that stuff slowly falls into place over time

quaint mantle
#

Also, the memory

river oracle
#

OOP only developers in shambles when I start passing in functions as method parameters

vapid grove
#

If I need to learn javas variables

river oracle
#

variables is episode #5 of the new boston java tutorial

shadow night
#

Practice is the best way to learn

quaint mantle
#

Java variables is just pointers to object in the heap

river oracle
#

yeah when you're starting out though you shouldn't worry about implementation details

shadow night
#

Javas memory managment is goofy

river oracle
#

you should worry if your code works or not lmao

shadow night
#

Lmao

#

My code, initially, was so bad

#

But now I became better, hopefully

vapid grove
#

So why is using static a bad practice by the way?

quaint mantle
#

Encapsulation

vapid grove
#

I see that complaint a lot and nobodys ever explained it to me

river oracle
#

but again there are always exceptions such as, Singletons (love these guys), constants, etc...

vapid grove
river oracle
#

You should know when to use it

#

Generally static should pretty much be used if you have no state (internal data to modify)

#

Like utility methods

shadow night
#

Staticity is bad most of the time

river oracle
#

You're taking in parameters and spitting out a result

#

There's no internal state to that method l that changes that outcome

vapid grove
#
/**
     * Sends a chat message displaying what the source was from.
     *
     * @param player The player to send it to.
     * @param from What was this being called from?
     * @param text The text for the chat message.
     */
    public static void specificChatMessage(Player player, String from, TextComponent text) {
        TextComponent message = new TextComponent(from + ChatColor.RESET + ChatColor.DARK_GRAY + ChatColor.BOLD + "> ");
        message.addExtra(text);
        message.setColor(ChatColor.WHITE.asBungee());

        player.spigot().sendMessage(message);
    }
#

So for example this should be fine to keep as static?

carmine mica
river oracle
river oracle
young knoll
#

TIL ChatColor has an asBungee

river oracle
#

Ofc 🤔

young knoll
#

Also you shouldn't be using ChatColor directly inside a component

vapid grove
#

how should I do that then?

young knoll
#

You can use fromLegacyText if you must

#

Otherwise use a seperate text component for each color and then combine them

#

via ComponentBuilder or append or whatnot

river oracle
#

CompenentBuilder is gross

#

Use PineappleChat šŸ

young knoll
#

ur gross

#

Use choco PR

#

oh wait

river oracle
#

PineappleChat >>>

young knoll
#

ur a pineapple

river oracle
#

Thx

young knoll
#

did you enjoy my painful mob heads class

river oracle
#

yes

river oracle
#

could always be an enum

young knoll
#

Okay material enum

shadow night
#

Enums are shit apparently

young knoll
#

An enum would be bigger anyway, I would lose the few loops I do have

river oracle
young knoll
#

smh

#

I love how all the other configs are 1 or 2 kb and the mob head one is 54

split lichen
#

Is there a way to reset/refresh game profiles for skin resets?

young knoll
#

Packets

split lichen
#

Yeah but which ones

upper hazel
halcyon hemlock
#

who tryna smash

young knoll
#

Or maybe the spaces

ashen quest
upper hazel
young knoll
#

Well it's not ascii

upper hazel
#

I checked no it is not
replaced with English letters the error still appears

young knoll
#

well, try without spaces

upper hazel
#

"_" can be ?

young knoll
#

No idea

#

You'd have to look at the worldguard code

upper hazel
#

dem

#

i was think region name was can have space

young knoll
#

private static final Pattern VALID_ID_PATTERN = Pattern.compile("^[A-Za-z0-9_,'\\-\\+/]{1,}$");

#

That's the regex they use to check

upper hazel
#

thenks

upper hazel
#

this not passoword lol

glad prawn
#

$%%&%&##* u want region name like this?

upper hazel
#

Well, so what? This is just the name of the region; those who create them themselves are responsible for this. After all, they don't come up with a password.

young knoll
#

Probably makes it easier to store in databases

upper hazel
#

database have this pattern too?

young knoll
#

No but it means the database doesn't need to be utf8

sand spire
#

How do I cancel a bukkit runnable/scheduler runTaskTimer inside an entirely different ifstatement?

if () {
          
BukkitTask taskid = new BukkitRunnable() {
               @Override
               public void run() {
                 System.out.println("I want to cancel this");
               }
           }.runTaskTimer```
```java
else if () {
/*I want to cancel it here with "taskid.cancel();" but I can't get it to work because it's out of scope and IntelliJ context actions don't work*/
 }
}```
young knoll
#

Change the scope

#

Make it an instance variable

#

Or DI it into other classes

shadow night
sand spire
#

probably

#

i started learning 10 days ago

shadow night
#

Hm

sand spire
#

idk how i couldn't figure this out myself unless it just doesn't work with bukkitscheduler

shadow night
#

Hmm, actually, I have a slight feeling of xyproblem, because why would you can the task that you create and run in one if in an else if

shut field
#

When using a TextDisplay what happens if you use more lines than fit in the TextDisplay?

sand spire
shadow night
#

No

shadow night
#

Is it in a loop or something

shut field
sand spire
#

i need to stop the loop in a 2nd ifstatement

shut field
young knoll
#

They don't have a size

shadow night
young knoll
#

The width and height aren't actual bounds

shut field
young knoll
#

They just control clipping

shut field
#

and like it auto adds a new line if the text is too long

kind hatch
#

A newline will be created if the text length is longer than the wrap length.

kind hatch
#

TextDisplay#setLineWidth()

shut field
young knoll
#

Minecraft font is like

#

10 pixels tall?

kind hatch
#

Should be the same as an armorstand's text.

#

By default anyways.

#

TextDisplays can be scaled to be larger.

young knoll
#

Yeah by default it's the same as an entity name

sand spire
shut field
sand spire
#

idk if the task "doesn't exist" but the arrow is most certainly still spinning if i don't cancel it

shadow night
#

Hm, well, I'd guess your code could cause issues in your case, but I don't know exactly what your code is so can't know

#

It's usual for people to write fundamentally wrong code, ask for help in smaller parts and then complain about their code not working

sand spire
#

Thank you I will keep it in mind

quaint mantle
#
        if (prestige == 0) { 
             return prestigeWrapper.getBracketColor() + "[" + 
                     levelWrapper.getLevelColor() + level + 
                     prestigeWrapper.getBracketColor() + "]" + 
                     ChatColor.GRAY + name + ": " + message; 
         } else { 
             return prestigeWrapper.getBracketColor() + "[" + 
                     ChatColor.YELLOW + prestigeWrapper.getRomanNumeralDisplay() + 
                     prestigeWrapper.getBracketColor() + "-" + 
                     levelWrapper.getLevelColor() + level + 
                     prestigeWrapper.getBracketColor() + "]" + 
                     ChatColor.GRAY + name + ": " + message; 
         }

How do I make this look more readable, I'm using Java 8

young knoll
#

StringBuilder mayhaps

river oracle
#

StringBuilder def is a must here

kind hatch
quaint mantle
shut field
echo basalt
#

Fun fact: an inventory slot is 16x16 pixels

#

The inventory slot border is ~2 pixels wide and ~1 pixel tall iirc

young knoll
#

Me omw to steal the colored background idea

#

:p

echo basalt
#

no clue why you'll use it

#

we need it at a new project I'm working on

young knoll
#

Idk I could see use for a colored background for the funz

#

Everyone likes colors

echo basalt
#

the whole goal is to use it with custom uis

young knoll
#

DeluxeMenus2.0

kind hatch
#

Show code

echo basalt
#

except it needs a resource pack

#

and makes quite long strings

#

I need to benchmark it to see if it's even viable

young knoll
#

RPs aren't an issue anymore

#

Because we can have multiple server packs woo

#

It adds like 108 characters to the inventory title

#

Doesn't seem tooo bad

kind hatch
#

What's frame.mainPanel?

#

Probably missing some field on it since I think that's where it errors out.

proper cosmos
#

what tf is that?

echo basalt
#

which is cool

young knoll
#

Ah fancy

echo basalt
#

and allows me to merge spacing

young knoll
#

I just made a bitmask style system for it

echo basalt
#

I just pass a Map<Integer, Color>

proper cosmos
#

So it's not spigot related?

young knoll
#

So if you wanted a 14 space it would combine an 8, 4, and 2

lost matrix
echo basalt
young knoll
echo basalt
kind hatch
#

What's the IJ form builder look like?

lost matrix
#

pic or didnt happen

#

Ah

proper cosmos
#

?whereami

chrome beacon
#

I prefer Netbeans when working with Swing

kind hatch
#

I had issues with IJ's forms so I used netbeans to build out the BuildTools GUI.

lost matrix
echo basalt
#

yes

#

Rgb and manual alignment

#

it's like 100 lines of code

#

half of them dedicated to optimizing colors and spacing

young knoll
#

What's that game called where you color stuff based on numbers for each row/column

#

Reminds me of that :p

echo basalt
#

color by number

#

I play that on my phone

young knoll
#

Nonogram

echo basalt
#

we could make a color by number

young knoll
#

But yes color by number is another name for it

kind hatch
#

I just couldn't use the GUI to make it do what I needed it to. It tried to force certain layouts when I needed the freedom to place the elements where I wanted.
IJ wouldn't let me do that so I just switched.

echo basalt
#

but yeah it's quite easy to make

#

each row just has a character that represents a scaled 1x1 image with a different negative ascent

lost matrix
#

Whats the backbone? Anything fancy or new?

echo basalt
#

not rly

#

basically for each row I get the color

#

If it doesn't exist I just send an INVENTORY_SLOT_SPACE and move on

lost matrix
#

Ah ok. So you detect the title width (Assuming you enforce a font) and then color in the background

echo basalt
#

it negates its own width so I can apply titles on top

lost matrix
#

Ah this way around makes more sense. So font doesnt matter.

#

Alright so the usual šŸ™‚

echo basalt
#

there's some manual alignment and stuff

young knoll
#

Scaling a 1x1 pixel is smart

#

My smooth brain would have just made a 16x16 image

echo basalt
#

a lot of my tries looked like this

lost matrix
#

You can even scale them negatively. Im guessing thats what he is doing for the spacing

young knoll
#

lol

echo basalt
#

It's nice

young knoll
#

We love the negative space font

echo basalt
kind hatch
#

Not from what I remember. Even when testing with IJ, everything worked the same as in netbeans. Although, we ended up ditching IJ for the form builder in Netbeans since it was more flexible and used that for a while. The project got a little more complex to where we ended up dropping the formbuilder altogether and switched to raw swing code.

echo basalt
#

Anyways once I'm done rendering my title I merge spaces

young knoll
#

Smort

#

Merge adjacent colors

kind hatch
#

EnterUIDFrame#mainPanel. When does this field get initialized?

#

Is the project hosted somewhere? I want to see if it compiles properly on my machine.

#

That's fine

paper falcon
#

quick question I was just wondering, how do bukkit plugins work as java programs if we don't have the main method?

public static void main(String[] args) {
}
``` or am I just lacking additional java knowledge lol
young knoll
#

Spigot has the main method

#

Plugins won't run on their own

#

Spigot constructs an instance of your plugin and then calls onLoad / onEnable

quaint mantle
#

Bukkit gets main class in plugin.yml file

paper falcon
#

oh well, makes sense

#

but everything is like super automated for me that I don't even think about these stuff

sharp heart
#

Is there an exemple about spawning entity with packets in 1.20 ? (and apply it some modifier)

tender shard
tender shard
tardy delta
#

have you figured out how to do the bukkit scheduler proxying?

tender shard
#

no, I didnt think about that any further

#

maybe tomorrow lol

paper falcon
#

and here was I thinking I were decent at coding spigot plugins xD

proper cosmos
#
public List<String> onTabComplete(CommandSender commandSender, Command command, String s, String[] args) {
        List<String> returnList = new ArrayList<>();
        if(args.length == 4){
            returnList.add("SECONDS");
            returnList.add("MINUTES");
            returnList.add("HOURS");
            returnList.add("DAYS");
            returnList.add("WEEKS");
            returnList.add("MONTHS");
            returnList.add("YEARS");
        }
        return returnList;
    }```
What's most efficient way, to delete items that does not fit.
tardy delta
#

take a look at StringUtils.copyPartialMatches

young knoll
#

StringUtil.copyParti- dangit

river oracle
#

if you want to do it yourself to you can also make a Trie (Syntax Tree) data structure

#

that is generally the intuition

tardy delta
#

thats basically returnList.filter(arg -> args.startsWith(lastArg))

river oracle
#

sure, but more efficent

#

:P

young knoll
#

I think it also uses bukkits startsWithIgnoreCase

#

Could be wrong

river oracle
#

I could've sworn that had existed

tardy delta
young knoll
#

ĀÆ_(惄)_/ĀÆ

#

I guess it could but what if people don’t want it

river oracle
#

fair

sharp heart
#

pls how to spawn a display entity through packet

mellow edge
#

Is it worth to even try to use nbt classes from nms instead of using nms api, because I dont even know half of the obfuscated code unless there is some documentation on it

young knoll
#

Use remapped?

#

Unless you are on 1.old

mellow edge
#

I am on 1.8

#

Some functions have names but some dont, this is the problem and this mappings arent even by mojang

#

(Bc they dont exist btw)

young knoll
#

Rip

#

Have fun

mellow edge
civic sluice
#

Using 1.8 is like voluntary participating in waterboarding.

mellow edge
#

I am forced to do it because the minigame is old school pvo

#

Pvp

#

For other plugins I use the latest version (and there I can just use PersistentDataContainer)

valid burrow
#

why would blockbreakevent always return a player

#

what if it broke from something ele then a player

young knoll
#

Then it won’t fire a block break event

valid burrow
#

oh

#

okay goodd to know

#

:D

#

thx

undone axleBOT
inner mulch
#

does .size() on hashmaps start counting on 0 or 1?

sullen marlin
#

0 = empty, 1 = 1

inner mulch
#

okay, thanks

rare rover
#

so i'm making a prison server and currently im using FAWE api for the enchants but it keeps producing ghost blocks

#

is there any work around to this?

#

hella annoying

young knoll
#

What version

proper cosmos
young knoll
#

Yes

#

And lists

rare rover
young knoll
#

Hmm

#

Idk how stable fawe is for 1.20.4

#

I think it’s kinda just a limitation on how it works though

#

That sometimes you get weird stuff happening

inner mulch
#

hello, im currently trying to use heads from a website but im not sure how to use them, as skullMeta only has setOwningPlayer(OfflinePlayer player);

but the website provides stuff like this for developers, im not quite sure what this is and what to do with this.

eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjgyYWQxYjljYjRkZDIxMjU5YzBkNzVhYTMxNWZmMzg5YzNjZWY3NTJiZTM5NDkzMzgxNjRiYWM4NGE5NmUifX19

rotund ravine
#

Looks like base64

#

Try to decode it

rotund ravine
inner mulch
#

no

#

1.20.2

rotund ravine
#

Then use PlayerProfile

inner mulch
#

how do i get it?

#

wait jan are these heads even secure, like if the acc changes its head they will change too, right?

inner mulch
#

i think i shouldnt use them then

#

as these accs could change

rotund ravine
#

Though it will have a link to the previous head texture so can’t know if that ever gets updated

young knoll
#

Depends where you got it from

rare rover
#

i've always had this issue but wondering if i could get rid of the ghost block

rotund ravine
#

Well it’s called async for a reason

rare rover
#

ye ik

young knoll
#

Specifically the custom-heads section though, not the entire site

sand spire
#

Should I use ItemDespawnEvent, EntityDeathEvent, EntityRemoveFromWorldEvent or anything else to stop an arrow from despawning?

glossy venture
#

anyone know how to force a client to update the head textures?

#

whenever i add a skull item it js renders fucking steve

#

using an owner name btw not a game profile

#

on 1.8 so yeah thahts probably it

glossy venture
#

item

#

in an inventory

#

i sent with packets

#

i had to bc the bukkit inventory literally didnt update

young knoll
#

1.8ļøāƒ£

halcyon hemlock
#

like a really small one

#

like very very small

#
returnList.addAll(List.of("SECONDS", "MINUTES", "HOURS", "DAYS", "WEEKS", "MONTHS", "YEARS"));
#

easy

#

and less code

young knoll
#

…

#

Why not just use the List.of

halcyon hemlock
#

honestly you could do this instead:

return args.length == 4 ? ArrayList<>(List.of("SECONDS", "MINUTES", ... )) : new ArrayList<>();
halcyon hemlock
#

oh

#

you could do that, but then it won't be mutable pretty sure, unless he's modifying the list both should be fine

young knoll
#

Well it doesn’t need to be mutable

#

It’s just a return value for onTabComplete

halcyon hemlock
#

yep

#

I realize

halcyon hemlock
ivory sleet
halcyon hemlock
#

conclube detected

ivory sleet
#

List.of() copies the vararg array

#

where as asList() just wraps around it

#

And since the list isn’t exposed to anything, its just niece to save some memory and computation

halcyon hemlock
#

its java honestly

#

if I cared about saving memory i wouldn't use java

young knoll
#

Ah man now I gotta do a find and replace

#

List.of was less bytes :(

ivory sleet
#

You gotta pay attention to those details, esp if u use it and care about the impl and u’re building a project for the world to consume

halcyon hemlock
#

oh btw you back from your trip?

ivory sleet
#

Yes

halcyon hemlock
#

nice nice

young knoll
#

He’s always tripping

ivory sleet
#

Coll bonk

ivory sleet
halcyon hemlock
#

cat side-eyed you

#

how do you feel about that

ivory sleet
#

Such ominous movements there

halcyon hemlock
#

we should make our own spigot in rust

#

or cpp

#

would look cool in university application form

worldly ingot
#

If you're passing 10 or less values, it does not copy the varargs

ivory sleet
#

yep

young knoll
#

Wack

halcyon hemlock
#

isn't it funning managing memory or is it just me

#

like trying to actually optimize a program

#

in cpp or rust

#

cpp ofc gives more control

ivory sleet
#

I mean, even in Java it’s scarcely the case where you want to just throw away memory, but yeah I get ur point

halcyon hemlock
#

you're good at rust right?

ivory sleet
#

I guess if you code after some weird religious cult like elegant objects principle

ivory sleet
#

I’ve written some cool stuff in it

halcyon hemlock
ivory sleet
#

Ugh, well what exactly are your goals?

halcyon hemlock
ivory sleet
#

Design wise, and what do you care about in the product?

halcyon hemlock
#

in java i would inheritance the fuck out of it

#

but in rust theres no inheritance stuf

ivory sleet
#

I mean there is sorta

halcyon hemlock
#

im just tryna get a simple server working

#

you can join and do stuff

#

no world gen cause too complicated pretty sure

ivory sleet
#

Well you asked me how to design it, and I can’t answer that straightforward without knowing what exactly you’re aiming at here

#

obviously you’d open up a server socket

#

Default the port to 25565

halcyon hemlock
#

yeah

ivory sleet
#

but like

halcyon hemlock
#

and then on connection i would send to another thread

ivory sleet
#

That’s past my point

#

Yea

halcyon hemlock
#

how would that thread manage the packet data etc/

#

one sec let me show you my current project

#

it has no server connection stuff right now only config

ivory sleet
#

Show it to me, I’ll take a look and reply tmrw, heading to sleep now

halcyon hemlock
#

dont question goofy code, i aint good ati t

molten kestrel
#

what is the best way to handle this?, i don't see any fishing state referring to this, (the unhook thing)