#help-development

1 messages · Page 853 of 1

tender shard
#

huh weird, no clue

sterile token
#

i will try to look at the java versions

#

i have installed java 17, but i dont think thats causing the issue

dry hazel
#

alternatively you can disable the epoll with use-native-transport in server.properties, don't know whether it'll have a measurable performance impact

sterile token
tender shard
sterile token
#

okay, this definitly not okay

#

not sound as troller but the server is starting with no problem

#

just start to spam the stracktrace when pinging or trying to connect the server

tender shard
#

java -version

sterile token
#

there is no way server starts from what you said before

tender shard
sterile token
#

okay this is not okay

#

no idea for sure whats happening

tender shard
#

btw 9fb885e-af1a232 is latest 1.16.5

#

you're using some other version?

sterile token
#

oh lmao im too stupid

#

i upload the wrong spigot

tender shard
#

yeah isn't that a 1.8 verison?

sterile token
#

that why it was starting but no giving any version message

#

okay, know not understanding why is not being server executed with path specified

tender shard
#

?

sterile token
# tender shard ?

really thanks mfalex, i already figured everything. I appretiate your help as always you helping me

sterile flicker
#

is it possible to create several custom data models in a resource pack for one item? I now have several items that contain a custom date model, is it possible to make only one item, for example, a stick, have several models and the texture of the item itself, as in my case, was not broken

#

for example

#
{
  "parent": "minecraft:item/generated",
  "textures": {
    "layer0": "minecraft:item/stick"
  },
  "overrides": [
    {
      "predicate": {
        "custom_model_data": 1
      },
      "model": "ak47/ak47"
    }
  ]
 "overrides": [
    {
      "predicate": {
        "custom_model_data": 2
      },
      "model": "mp5/mp5"
    }
  ]
}```
shadow night
#

Hmm

#

Maybe you should not make two "overrides" sections

sterile flicker
#

but even if it is possible, why is the stick texture itself broken?

sterile flicker
shadow night
#

The overrides is an array, but your second override there

#

I bet the reason for thr Stick breaking is an invalid model json

sterile flicker
halcyon hemlock
#

smash

shadow night
#

Well, you also forgot a comma after the first overrides array

sterile flicker
shadow night
#

Yes, you have two elements with the same key in your json and you also forgot a comma

sterile flicker
#

I have to add to the atlas texture of the item itself right?

#
    minecraft:textures/atlas/blocks.png:minecraft:item/white_wool```
halcyon hemlock
#

smash

shadow night
halcyon hemlock
#

md_5 smash

sterile flicker
shadow night
#

Also, as far as I'm aware thr atlast stuff is done automatically

sterile flicker
#

I have the right one, I don't see any mistakes.

#

where ,

#

?

shadow night
#

You had two overrides before

sterile flicker
#

But I don't have it like that

shadow night
#

Hm

#

Well, the right thing would be to add a new element to the overrides array with other custom model data values and another model location

sterile flicker
#

you mean

#
"overrides": [
    {
      "predicate": {
        "custom_model_data": 18
      },
      "model": "ak47/ak47"
    },
    {
      "predicate": {
        "custom_model_data": 2
      },
      "model": "mp5/mp5"
    }
  ]```
#

?

shadow night
#

Yeah

shadow night
#

That should work, as far as I'm aware

sterile flicker
shadow night
#

No idea what could cause that

#

To me the file looks fine

wooden frost
#

Hello, could anyone help?
Im trying to make a tnt stick that can be ignited using a flint and steel. Because it is imposible for me to make it unstackable, i made the tnt stick change its state from ignited to non ignited when thrown, while working on it, i noticed that it runs both of these functions at the same time.

public static void playerInteract(PlayerInteractEvent e)
    {
        World world = Bukkit.getServer().getWorld("world");
    if((e.getAction()==Action.RIGHT_CLICK_AIR||
            e.getAction()==Action.RIGHT_CLICK_BLOCK)&&
                e.getPlayer().getInventory().getItemInMainHand().getType()==Material.SCUTE&&
                    e.getPlayer().getInventory().getItemInMainHand().getItemMeta().getCustomModelData()==1&&
                        e.getPlayer().getInventory().getItemInOffHand().getType()==Material.FLINT_AND_STEEL)
        {
            e.getPlayer().swingOffHand();
            e.setCancelled(true);
            ItemMeta meta = CustomItem.tntStick.getItemMeta();
            meta.setCustomModelData(2);
            e.getPlayer().getInventory().getItemInMainHand().setItemMeta(meta);

            world.playSound(e.getPlayer().getLocation(), Sound.ENTITY_TNT_PRIMED, 1, (float) 1.2);
            world.playSound(e.getPlayer().getLocation(), Sound.ITEM_FLINTANDSTEEL_USE, 1, (float) 1.2);
                return;
        }

        if((e.getAction()==Action.RIGHT_CLICK_AIR||
                e.getAction()==Action.RIGHT_CLICK_BLOCK)&&e.getPlayer().getInventory().getItemInMainHand().getType()==Material.SCUTE&&
                    e.getPlayer().getInventory().getItemInMainHand().getItemMeta().getCustomModelData()==2)
        {
            ItemMeta meta = CustomItem.tntStick.getItemMeta();
            meta.setCustomModelData(1);
            world.playSound(e.getPlayer().getLocation(), Sound.ENTITY_SNOWBALL_THROW, 1, 1);
            e.getPlayer().getInventory().getItemInMainHand().setItemMeta(meta);
                return;
        }
    }
#

Any idea what i could do?

young knoll
#

You can make it unstackable

#

Add a random uuid to pdc

tribal zephyr
#

What is the windowClick packet?

chrome beacon
#

depends

wooden frost
chrome beacon
#

why do you need it

tribal zephyr
chrome beacon
#

Just update

tribal zephyr
chrome beacon
#

It's for when clicking in inventories

tender shard
#

Just add a pdc tag with name „unstackable“ and value random uuid

wooden frost
#

ok

#

super strange

#

i even changed the order in which the functions are executed (the function that requires changed custom model data comes first and the one that changes it comes second)... IT STILL RUNS WRONG WTF

#
@EventHandler
    public static void playerInteract(PlayerInteractEvent e)
    {
        World world = Bukkit.getServer().getWorld("world");
        if((e.getAction()==Action.RIGHT_CLICK_AIR||
            e.getAction()==Action.RIGHT_CLICK_BLOCK)&&
            e.getPlayer().getInventory().getItemInMainHand().getType()==Material.SCUTE&&
            e.getPlayer().getInventory().getItemInMainHand().getItemMeta().getCustomModelData()==2)
    {
        e.setCancelled(true);
        world.playSound(e.getPlayer().getLocation(), Sound.ENTITY_SNOWBALL_THROW, 1, 1);
    }
    if((e.getAction()==Action.RIGHT_CLICK_AIR||
            e.getAction()==Action.RIGHT_CLICK_BLOCK)&&
                e.getPlayer().getInventory().getItemInMainHand().getType()==Material.SCUTE&&
                    e.getPlayer().getInventory().getItemInMainHand().getItemMeta().getCustomModelData()==1&&
                        e.getPlayer().getInventory().getItemInOffHand().getType()==Material.FLINT_AND_STEEL)
        {
            e.getPlayer().swingOffHand();
            e.setCancelled(true);
            ItemMeta meta = CustomItem.tntStick.getItemMeta();
            meta.setCustomModelData(2);
            e.getPlayer().getInventory().getItemInMainHand().setItemMeta(meta);

            world.playSound(e.getPlayer().getLocation(), Sound.ENTITY_TNT_PRIMED, 1, (float) 1.2);
            world.playSound(e.getPlayer().getLocation(), Sound.ITEM_FLINTANDSTEEL_USE, 1, (float) 1.2);
        }

    }
#

probably a stupid mistake, i tend to do those

#

but how

#

...

smoky anchor
#

please take a look at early return
or guard clause

valid burrow
#

can u use ?paste instead

#

cant read this

wooden frost
valid burrow
#

?paste

undone axleBOT
valid burrow
#

put your code in there

wooden frost
#

ok

valid burrow
#

okay what exactly is the problem

wooden frost
wooden frost
#

that should not happen

valid burrow
#

both of what

wooden frost
#

if statements

#

yet it should not be possible

valid burrow
#

why not

#

a code can run through 2 if statements

wooden frost
#

I dont want it to... tho

valid burrow
#

put return; at the end of your 1st statement to prevent that

wooden frost
#

i tried using return; it still did not do that

valid burrow
#

return; will make the code stop

wooden frost
#

it maybe will work

valid burrow
#

where did you put it

wooden frost
#

in the end

#
@EventHandler
    public static void playerInteract(PlayerInteractEvent e)
    {
        World world = Bukkit.getServer().getWorld("world");
        if((e.getAction()==Action.RIGHT_CLICK_AIR||
            e.getAction()==Action.RIGHT_CLICK_BLOCK)&&
            e.getPlayer().getInventory().getItemInMainHand().getType()==Material.SCUTE&&
            e.getPlayer().getInventory().getItemInMainHand().getItemMeta().getCustomModelData()==2)
    {
        e.setCancelled(true);
        world.playSound(e.getPlayer().getLocation(), Sound.ENTITY_SNOWBALL_THROW, 1, 1);
        return;
    }
    if((e.getAction()==Action.RIGHT_CLICK_AIR||
            e.getAction()==Action.RIGHT_CLICK_BLOCK)&&
                e.getPlayer().getInventory().getItemInMainHand().getType()==Material.SCUTE&&
                    e.getPlayer().getInventory().getItemInMainHand().getItemMeta().getCustomModelData()==1&&
                        e.getPlayer().getInventory().getItemInOffHand().getType()==Material.FLINT_AND_STEEL)
        {
            e.getPlayer().swingOffHand();
            e.setCancelled(true);
            ItemMeta meta = CustomItem.tntStick.getItemMeta();
            meta.setCustomModelData(2);
            e.getPlayer().getInventory().getItemInMainHand().setItemMeta(meta);

            world.playSound(e.getPlayer().getLocation(), Sound.ENTITY_TNT_PRIMED, 1, (float) 1.2);
            world.playSound(e.getPlayer().getLocation(), Sound.ITEM_FLINTANDSTEEL_USE, 1, (float) 1.2);
            return;
        }

    }
valid burrow
#

well

#

you want to only run the first statement or tthe second statement

#

so

#

you need to stop the code after the first statement

#

put it before the first if statement ends

#

or do else if

wooden frost
#

Yeah

#

no i copied it

#

still executes both

hushed spindle
#

how do you remove plugins off of spigot again? i got a couple i don't maintain any more

#

setting them to premium right

shadow night
#

you report them and say to delete I think

quaint mantle
#

I would do something like

@EventHandler
public static void playerInteract(PlayerInteractEvent e) {
  World world = Bukkit.getServer().getWorld("world");
  org.bukkit.event.block.Action action = e.getAction()
  Player player = e.getPlayer();

  if (!(action.equals(Action.RIGHT_CLICK_AIR) && action.equals(ACTION_RIGHT_CLICK_BLOCK))) return;
  //If the interaction is not a right click to air or block, do nothing

  ItemStack item = player.getInventory().getItemInMainHand();
  if (item == null || item.getType().equals(Material.AIR)) return;
  //If the item is null or air, do nothing
  
  Material type = item.getType();
  ItemMeta meta = item.getItemMeta();
  if (meta == null) return; //Just in case, don't really needed

  int modelData = meta.getCustomModelData();
  if (modelData == 2) {
    e.setCancelled(true);
    world.playSound(player.getLocation(), Sound.ENTITY_SNOWBALL_THROW, 1, 1);
  } else if (modelData == 1) {
    ItemStack off = player.getInventory().getItemInOffHand();
    if (off == null) return;

    Material typeOff = off.getType();
    if (type.equals(Material.SCUTE) && typeOff.equals(MaterialFLINT_AND_STEEL)) {
      player.swingOffHand();
      e.setCancelled(true);
      ItemMeta meta = CustomItem.tntStick.getItemMeta();
      meta.setCustomModelData(2);
      player.getInventory().getItemInMainHand().setItemMeta(meta);

      world.playSound(player.getLocation(), Sound.ENTITY_TNT_PRIMED, 1, (float) 1.2);
      world.playSound(player.getLocation(), Sound.ITEM_FLINTANDSTEEL_USE, 1, (float) 1.2);
    }    
  }
  //If you end up adding more, I would recommend a switch structure instead
}
shadow night
#

if you end up adding more, you should make some system to do that

quaint mantle
#

Yes, that's a better solution

shadow night
#

I have a registry system that works with namespaces stuff, so I could make that in like 2 classes

quaint mantle
#

That's way better, the code would look cleaner than that

shadow night
#

yes, probably

proud badge
#

What would be the best way to do this:
For the next 5 seconds (while the hologram is alive) I need it to be teleported to 2 blocks above the player's location, so its constantly there, even if the player moves.

#

Maybe something like this would work?

#

uh oh, server crashed

tender shard
#

yeah because you kept it stuck in the while loop

proud badge
#

what could I do to not make it stuck then?

tender shard
#

use a scheduler to teleport the entity every tick

#

also why are yo uchecking the command's name in the onCommand method?

proud badge
#

so I know its the right command

tender shard
#

did you register this executor to a ton of different unrelated commands, or why do you need to know that?

#

the proper way is to simply only register the executor to the correct command o0

proud badge
#

so... wait... you're right

tender shard
#

and then:

#

?scheduling

#

?scheduler

undone axleBOT
tender shard
#

use runTaskTimer with a delay of 1 tick that teleports the entity every run

quaint mantle
#

Bros can do async I think

#

Holos are mostly IO stuff

proud badge
#

no because hologram (armour stand) is being teleported

#

also, how would I make the runtasktimer only run whilst !holo.isDeleted()?

tender shard
#

create a class that implements Consumer<BukktTask> and takes in the entity as constructor parameter, then once it's dead (or isDeleted or whatever) call BukkitTask#cancel()

#

e.g. like this

        Player player = null;
        Entity hologram = null;
        Bukkit.getScheduler().runTaskTimer(myPlugin, task -> {
            if(hologram.isDead()) {
                task.cancel();
            } else {
                hologram.teleport(player);
            }
        }, 0, 1);
#

or with a declared class

public class HologramTeleporter implements Consumer<BukkitTask> {

    private final Player player;
    private final Entity hologram;

    public HologramTeleporter(Player player, Entity hologram) {
        this.player = player;
        this.hologram = hologram;
    }

    @Override
    public void accept(BukkitTask task) {
        if(hologram.isDead()) {
            task.cancel();
        } else {
            hologram.teleport(player);
        }
    }
    
}
proud badge
#

ok epic thanks

hushed spindle
#

is there some app or plugin that trims a world size by removing chunks that haven't been changed by a player

worthy yarrow
#

so dynmap has this thing where if you hold compass and a sword you are invisible on the map, squaremap has none of these things, would it be possible to implement it on squaremap? If anyone has some experience with squaremap api please let me know!

native surge
hushed spindle
#

ah sick

#

thanks man

quaint mantle
#

Anyone know good chart image generator libary for java?

#

(I want to do something with maps)

wooden frost
#

OH WAIT @valid burrow I realised what the problem was. If you have two items in (off and main)hand it uses the interaction event twice. Any way to prevent that?

hazy parrot
icy beacon
hazy parrot
#

Yes

icy beacon
#

Tyty

hazy parrot
#

Or smth along those lines

icy beacon
#

Also need that lol

#

I think it's this

hazy parrot
#

They have official one

icy beacon
#

As official as it can get, no?

wooden frost
worthy yarrow
#

Anyone have some experience with squaremap’s api? I want to implement something that dynmap has where a player holds both a Diamond sword and a compass making them invisible on squaremap

quaint mantle
#

Or it just runs js code

icy beacon
#

I have no idea

#

I looked it up in 40 seconds

hazy parrot
karmic mural
#

Anyone ever had an issue with BlockFertilizeEvent being cancelled but the bonemeal still being used?

#

Or am I targeting the incorrect event to detect and cancel bone_meal application?

clever lantern
#

how do i get the world player got into from PlayerChangedWorldEvent

young knoll
#

It's their current world

clever lantern
#

ah okay

slate tinsel
#

If I want to draw a straight line between point a and point b, which are two locations, what is the easiest thing to use? Between these points I also want to retrieve all locations.

(If it's possible to instead add velocity to change direction so it's just not a straight stretch that would be great)

tender shard
misty current
#

hello, small question about code design. I am making a proxy composed of multiple instances and I need to handle player data loading. To prevent data duplication and desyncronization, should I only allow the proxy to load data and then send it to the server where the player is connecting to through plugin messages/a socket or should I use something such as redis to cache online player data and send it to the server requesting it?

quaint mantle
#

MySql

misty current
#

and in case I use redis, how can I prevent data duplication? Is there some sort of lock to block access from a certain value until the lock is released?

quaint mantle
#

Have permissions

#

And unique keyword

misty current
#

I am already using mongodb for data storage, I am not asking about suggestions for data storage, i'm looking for suggestions about caching the data and sending it to where it is needed

quaint mantle
astral scroll
#

when doing player.inventory.contents (in kt) if an item is empty on the inv is it air or null

quaint mantle
#

Redis for sure

remote swallow
astral scroll
#

im getting kinda fucked with that

#

cause idk if its air or null

#

lol

quaint mantle
#

Craftbukkit ❤️

astral scroll
#

its null

#

but there's a 41

#

item?.type is 41

#

nvm

#

said nothing

astral scroll
#

can i delete a world?

#

like in code

ivory sleet
misty current
#

not much i'd say

#

i know what caching is, but i have never used any external program such as redis

ivory sleet
#

I mean the obvious answer is that you probably want a read through and write through code implementation

#

But like

#

There is more to it if you’re willing to go deeper

lean pumice
#
public class BetterHitbox {
    private final Entity entity;

    public BetterHitbox(Entity entity) {
        this.entity = entity;
    }

    public boolean areLookBy(Player player) {
        BoundingBox hitbox = entity.getBoundingBox();
        return player.getLocation().getDirection().isInAABB(hitbox.getMin(), hitbox.getMax());
    }
}

Return always false, because?

misty current
#

not sure what you mean with that

lean pumice
young knoll
#

Players look vector will almost certainly not be in an entities bounding box

#

Unless they are very close

#

You need to raytrace

misty current
lean pumice
misty current
#

but i've figured out i probably need a better caching system to do what i described

ivory sleet
#

Alr I found it

#

This is a good read

#

Its not entirely up to date i believe but it gives you the basics

#

Assuming you’re planning on using redis

misty current
#

so what i was thinking was pulling data from mongo when a player joins the proxy, store to redis and when the player moves to a server, make the instance read from redis and parse the profile

#

when a player leaves a server, serialize the data and send to redis

#

when a player moves from a proxy to another, data is saved to the cache and then pulled again

lean pumice
#

but i want use the AABB

#

because PaperMC is very poorly made and there aren't any useful things

misty current
#

never heard of it

#

but a read-through cache sounds like something i would need

obsidian drift
#

I'm trying to update a plugin from 1.19.2 to 1.20.4, and Registry.BIOME_REGISTRY doesn't exist anymore

WritableRegistry<Biome> registryWriteable = (WritableRegistry<Biome>) dedicatedServer.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY);

Anyone know what I can use instead?

young knoll
#

?mappings

undone axleBOT
young knoll
#

net.minecraft.core.registries.Registries

obsidian drift
#

How did u find it so quick?

young knoll
#

magics

obsidian drift
#

How tho

#

because u cant search up field names

young knoll
#

I just searched Registry and found RegistryKeys in yarn mappings

#

Which was correct

ivory sleet
quiet ice
#

Really stupid question but is there any way to express boolean return = obj instanceof clazz as a method handle? clazz can be a java.lang.Class object but other things work. Of course I could directly call Class#isInstance via a method handle but I figured that ought to be better ways around it

chrome beacon
#

obj.getClass().isAssignableFrom(clazz)

quiet ice
#

Well that is the same thing as using clazz.isInstance(obj)

#

might be even worse honestly

chrome beacon
#

ah right I miss read your question

river oracle
#

if you're using MethodHandles you should really know what they are returning tbh

#

just blind cast the result if you're wrong you aren't using the correct version of the library / code you are reflecting

quiet ice
#

Problem is that I give it an interface and call a method on it. Instead of throwing some random exception I'd rather print the exact cause of the issue. The other parts were rather easy to set up, but I wasn't able to find a neat drop-in replacement for instanceof.

ivory sleet
#

Id say isInstance is best

quiet ice
#

Basically right now I have

            if (modJar instanceof SoftwareComponent) {
                if (!(modJar instanceof DefaultAdhocSoftwareComponent)) {
                    throw new IllegalStateException("Only implementations of SoftwareComponent that are an instance of DefaultAdhocSoftwareComponent can be used as a mod jar.");
                }
                for (UsageContext usageCtx : ((DefaultAdhocSoftwareComponent) modJar).getUsages()) {
                    // ...

Problem is that gradle moved the package of DefaultAdhocSoftwareComponent, so I'd need to make use of reflection or method handles regardless in order to still keep compatibility with older gradle versions. Figured it might be neater to learn method handles.

ivory sleet
#

Remember instanceof is a bytecode instruction afterall, not sure how method handle-able that is

fallen grove
#

any ideas why this doesnt work on 1.20.4
PotionBrewer potionBrewer = this.getServer().getPotionBrewer();
getPotionBrewer() cannot be found, how am I supposed to get the brewer?

java: cannot find symbol
symbol: method getPotionBrewer()
location: interface org.bukkit.Server

minor junco
#

imagine java was fully type erased 💀

#

ala typescript style

ivory sleet
#

that’d be sad

quiet ice
ivory sleet
#

yea fair enough, well i was just unsure regarding that

fallen grove
#

🗿

quiet ice
#

I'd even guess that method handles generate bytecode directly (if not even skipping that step) given that you can construct loops and other stuff with method handles

river oracle
#

@fallen grove and their never was afaik

#

I went back to 1.19.3 no such method
no such method in 1.18.2
no such method in 1.17.1

I could keep going but I feel like 2 years worth of updates is enough

eternal night
dry hazel
slender elbow
#

the jdk can suck it

#

slorp slorp

astral scroll
#

cluster name is database name in mongo, right?

quiet ice
astral scroll
#

no... 💀

fallen grove
#

but you are right its not under server

#

hhhhhmmmm

quiet ice
river oracle
#

sounds like a paper moment

eternal night
#

is it (it is)

river oracle
#

@eternal night does paper have such a method

eternal night
#

yea xD

dry hazel
#

something like MethodHandles.publicLookup().findVirtual(Class.class, "isInstance", MethodType.methodType(Boolean.TYPE, Object.class)).bindTo(clazz) should work fine

fallen grove
#

oh? so what does that mean?

river oracle
fallen grove
#

paper has the potionmix class which i am also using, i just cannot figure out how to get the brewer

eternal night
#

spigot exposes theirs on Potion

fallen grove
#

i am crying

eternal night
#

if you want to use paper-api stuff anyway, you'll have to use paper-api lol

river oracle
#

^

eternal night
#

at which point, that method would exist

river oracle
#

I mean nothing wrong with it if you use Paper already too

quiet ice
fallen grove
ivory sleet
#

boolean.class and Boolean.TYPE is the same thing

fallen grove
#

getPotionBrewer is a mystery though

#

nothing on docs

eternal night
#

then something is pulling in spigot-api

river oracle
ivory sleet
#

(He did actually)

eternal night
river oracle
#

us spigoters can't help with the mysteries of the random missing paper classes and methods

fallen grove
#

🫡

inner mulch
#

is there a reason why i should use placeholders, even thought i can insert the object directly into the string?

eternal night
#

depends ?

#

if you are talking about like SQL it would be a different answer than talking about printing something to console

inner mulch
#

So it depends on whether i use sql or not?

ivory sleet
#

And when it comes to placeholders it can be niece for configs or other types of configurable stuff :)

inner mulch
#

So readability?

minor junco
#

i mean it can theoretically attribute to having clearer readability, but it depends again

ivory sleet
#

^

minor junco
#

you should use placeholders only then, when a thing within your string is variable

#

then you can opt into using string#format

#

or default concatenation

#

or string builder

#

or whatever you want

inner mulch
#

Is "my string" + number + "afgfssa" bad practice ?

eternal night
#

for just plain text output, concatination is fine /shrug

inner mulch
#

Oh ok, so placeholders stop SQL injection in queries?

eternal night
#

well thats why you have setParameter on statements

quaint mantle
ivory sleet
#

YourSalvation, yk how bad websites have an input field, and then u can end up inputting some sql thingy and it ends up working

quaint mantle
#

Otherwise it does not matter

young knoll
ivory sleet
#

Prepared statements as its called, is a way of compiling the sql statements you have, such that when u get the input data from whatever input field, we will already know what data, how much data and where it should be since we compiled the statement, thus arbitrary data becomes impossible to input. I think pHp had a tragic history w this type of vulnerability.

quaint mantle
#

If you not sure

#

Setup permissions

ivory sleet
#

That too ^

astral scroll
#

MongoDatabase#getCollection() may return null if collection doesnt exists?

#

or if collection doesnt exists it creates it

molten hearth
#

make a threat actor's day and don't sanitise your inputs 🙏

#

Everybody needs some love

quaint mantle
zealous osprey
#

Quick question:
I have a function which returns a CompleteableFuture<Void> and now I have a different function which calls the prior function X amount of times. How would I check that everything was completed?
Do I really make a collection of the futures and everytime one completes check every other if they are complete or not?

quaint mantle
#

await?

#

Do get() or join()

zealous osprey
#

But if I #get on all of them, won't it only wait for one, then the other, then the other, etc.?

tender shard
zealous osprey
#

That exists? Damn, didn't know. Thanks 👍

next plume
#

It was like wrestling with a pig, but I finally got my TinyProtocol / Keep_Alive thing working.
Among other things, I had to grab some random unmerged ProtocolLib PR because TinyProtocol has been broken since 1.19.

tidal kettle
#

hello i try to make a square of particule, i use this code but i don't work can you help me?

#

like the particule go everywhere

quaint mantle
#

Locations are mutable

tidal kettle
#

yes and ? 😅

quaint mantle
tidal kettle
#

just like this it work...

#

so simple...

#

thank you...

quaint mantle
#

No problem

#

Locations are mutable, so everytime you use .add, it changes the location

tidal kettle
#

also when i .add a numbre <1 the particule spawn on me

#

any idea why?

young knoll
#

You should cast the 2 to a float

#

Otherwise it'll do integer division

tidal kettle
#

oo i see

young knoll
#

You can just do 2f to cast it

sterile token
#

Something is wrong with my output debugs from my command api

21:13:35 INFO: argument(faction.points.*)= false

argument(faction.points.info)=true

Im not sure why i get the debug message 2 times

For debugging im running the /faction points info command and getting the output on top

rotund ravine
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

sterile token
rotund ravine
#

argument.execute

sterile token
#

what do you mean?

#

I must apply recursion, because a ParentCommand command can be parent of another command

#

Like Tree strcutures works

#
  • faction => ParentCommand
  • list
  • points => ParentCommand
    • info
clever lantern
#

someone knows why this doesnt work in nether (didnt test in overworld)

                lodestone.getBlock().setType(Material.LODESTONE);

                CompassMeta meta = (CompassMeta) itemStack.getItemMeta();
                meta.setLodestone(lodestone);
                meta.setLodestoneTracked(true);
                itemStack.setItemMeta(meta);```
#

compass is still spinning

rotund ravine
sterile token
rotund ravine
sterile token
#

okay, but can you detail more please

#

im not really understanding

#

I dont wanna sound as troll, but i dont catch where you trying to go with the argument.execute()

#

cuz, argument execute calls the execute method from the command class itself?

#

🤔

rotund ravine
#

Execute debugs

#

U call it more than once

#

U get more debug statements

sterile token
#

the argument.execute() is calling that execute method

rotund ravine
#

I guess it is not

lost matrix
sterile token
# rotund ravine I guess it is not

im struggling because yesterday after removing the debug message to add the permission check started to happen this issue i posted. Because before touching the code, the debug was giving just one output and with the correct info

sterile token
# rotund ravine I guess it is not

remember i nee to apply recursion, that why im calling the argument#execute(). Because ParentCommand can be parent of another ParentCommand, just like how a LinkedList works tho

clever lantern
sterile token
#

@rotund ravine sorry for tagging but this is not normal

#

i just removed all debug messages, created just argument.bla() debug and is okay

zealous spear
#

Is Vault on 1.19.4 really necessary or an analogue of this plugin? please tag, otherwise I'm Russian

icy beacon
#

Please don't spam

#

One channel is enough

grim hound
#

Can I create a ServerSocket if the port is already used?

ivory sleet
#

But like, if a port is used, then na

grim hound
#

But like listen to the connections?

ivory sleet
#

you mean when the clients connect?

#

yeah multiple clients can connect to the same server socket

grim hound
#

When I tried doing it with netty instead

#

I got the PortBindedException or smthg

ivory sleet
#

What did you try?

grim hound
#
try {
    ServerBootstrap serverBootstrap = new ServerBootstrap();
    serverBootstrap.group(bossGroup, workerGroup)
            .channel(NioServerSocketChannel.class)
            .childHandler(new Interceptor());
    
    Channel channel = serverBootstrap.bind(port).sync().channel();
    channel.closeFuture().sync();
} catch (InterruptedException e) {
    throw new AlixException(e);
} finally {
    bossGroup.shutdownGracefully();
    workerGroup.shutdownGracefully();
}
#

Made by chat gpt

#

Or if this is valid, where can I find the ServerBootstrap variable

tender shard
grim hound
#

To add my childHandler

sullen marlin
#

What are you trying to do

grim hound
#

Seems it's probably used by the server

grim hound
#

Fast connection refuse

#

FireWall in other words

sullen marlin
#

Why not, y know, a firewall then?

grim hound
#

For now I'm only using APIs for that

grim hound
sullen marlin
#

Run the relevant command

grim hound
#

Hmm

#

And will it work always?

#

Like if the command is correct

sullen marlin
#

What do you mean

grim hound
#

Would every system accept the command?

#

Does every os have a firewall

#

Interaction command?

sullen marlin
#

I mean probably?

grim hound
#

Makes sense

sullen marlin
#

Make the command configurable

grim hound
#

Will do 👍

tender shard
grim hound
#

Oh yeah

#

md5, can we execute root commands?

tender shard
#

only if the server has root ofc

grim hound
#

But then

#

Uhh

tender shard
#

what one could do is to allow password-less sudo for only certain commands, e.g. iptables, with /etc/sudoers

grim hound
#

Why would someone restrict it and someone not?

tender shard
#

ofc that would never work for shared hosters etc though

slate tinsel
#

Hi, when I retrieve the projectile's location in the hit event, it is sometimes up to 3 blocks wrong, i.e. not all the way, mainly this occurs when the projectile travels very fast, for example from a crossbow. Anyone know how I can solve this?

warm mica
#

I guess just listening to AsyncPlayerPreLoginEvent is probably fine for whatever you are trying to do

grim hound
#

That is way after everything

#

It'd be far more laggy if I were to do that

#

Or unoptimized, I should say

#

It'd a shame for an antibot to have it's main firewall be that

warm mica
spare mason
#

why if i unload and load an nms entity it is no longer custom and turns into a normal nms entity of it's original type

warm mica
wet breach
# grim hound It'd be far more laggy if I were to do that

Its not going to make a difference if the connection is halted at the system level or not as the connection reached the system anyways. If you do it at prelogin the server hasnt processed much and you can suspend connections here without causing issues to the server. If you are worried about lag you need to have a box that is further upstream that monitors connections

hazy parrot
#

I mean, they are both correct

wet breach
# grim hound Same here

Its not ignorant just a fact that all you are doing is just changing where in the system the connection is halted. If you add more and more rules to the system firewall eventually you will overwhelm the system which is no different if the mc server is doing it. It is too late to really do much about a connection that has reached a system as it will consume resources regardless. If your goal is to avoid this you need to stop the connection further upstream this is why you can rent firewall boxes

warm mica
# grim hound That is pretty ignorant

"on that level" I don't mean that in an offensive matter (if that's what you have interpreted), but rather that you won't be able to stop a DDoS attack on the application level

astral scroll
#

[15:35:53 ERROR]: Error occurred while enabling MazerArena v1.1.1 (Is it up to date?)
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
?????????'

#

i already tried almost all solutions online

#

nothing works

warm mica
#

Either your database is offline or your credentials are invalid

astral scroll
#

im literally

#

using what ptero gives me

#

and nothing

warm mica
#

Well, it's either of the two, and you should ask that at #help-server

astral scroll
#

wa

velvet hawk
#

I made a plugin using the FAWE API, importing things from FAWE and world edit into the plugin, but whenever I run the plugin on my server, it just errors saying FAWE is already imported and such

young knoll
#

?stacktrace

undone axleBOT
opaque scarab
#

Thoughts on this? I'm trying to improve minecraft's biomes by adding more color variation to trees. Does the sky color seem good?

#

Color and sky variation is done through my biome editing system

sullen marlin
#

Never seen a sky that colour irl

young knoll
#

Australia only has gray/red skies because of all the wildfires

#

Imean what

opaque scarab
young knoll
#

Is this modifying existing biomes

#

Or replacing them with custom ones

velvet hawk
#

i only extend javaplugin in one class idk what im doing tho

young knoll
#

Make sure you never try and create a new instance of your main class

velvet hawk
#

im pretty sure i dont do that anywhere

young knoll
#

What does Techniques.java look like

#

?paste

undone axleBOT
velvet hawk
opaque scarab
young knoll
#

Hmm that looks fine

#

What is your plugin.yml

velvet hawk
# young knoll What is your plugin.yml

quite simple, i didnt really know how to set it up properly, do I have to like add loadbefore or softdepend idk anything about plugin.yml configuration

name: Techniques
version: 1.0
main: bridging.techniques.Techniques

commands:
  techniques:
    description: Open the Techniques GUI
    usage: /techniques

  spawn-schematic:
    description: Spawn a schematic
    usage: /spawn-schematic
opaque scarab
# young knoll At worldgen or via packets?

On startup, a list of all default biomes within the world are gathered. It iterates through the list creating new registries of the same biome. These new copies have the same path, but a different namespace (specified by the plugin). When a chunk is loaded, it’s checked if the chunk contains the necessary alterations. If it does not, the biome is changed in specific places with the copy, according to a simplex octave generator.

#

I don’t quite understand simplex octave generators, but I got it working

young knoll
#

So it’s done at worldgen, neat

young knoll
velvet hawk
#

still giving errors but thats my code's problem

#

it loads now

fleet kraken
#

Why isSimilir doesnt work sometimes?

young knoll
#

Define sometimes

#

Everything about the item needs to match except stack size

#

This includes things like durability

fleet kraken
#

Hmm

young knoll
#

If you want to uniquely tag items

#

Use pdc

opaque scarab
#

Yes, I use NMS and reflection

#

Quickest response ever

#

I’m proud

#

There’s a guide for 1.17 but it’s very outdated and uses obfuscated mappings. I’m working on a tutorial for everyone, which is in 1.20.2

#

I can send you it when I’m done

#

Yeah I use the mojang mappings

#

Same basic stuff, but just different code

#

If that made sense LOL

#

Also releasing a tutorial for custom blocks with GeyserMC

#

I’ll release the custom biome tutorial on the spigot forums, and MAYBE YouTube

#

For geyser, IDK

#

Somewhere. People need to know stuff about geyser because their documentation is completely useless

#

Sure! It’s Cyrei

#

Same name

tender shard
#

blue name = verified = same discord and spigot name 😛

#

it was possible to trick the bot but this got fixed meanwhile i think

opaque scarab
#

You could have discord associated with a past account?

tender shard
#

well ok but in 99% of cases, it should be the same name lol

opaque scarab
#

Yes, you can do it through datapacks. I use custom biomes for seasons though (a plugin I’m developing). Adding custom biomes through plugins gives me more control for this. Plus, you don’t need a datapack and a plugin

hot reef
#

Hello, so i have an issue, how would i go converting a minecraft world itemstack to a bukkit inventory itemstack?

tender shard
hot reef
#

papermc was no help sadly 🦗

#

so i come to you all

#

seeking guidance

#

lol

grim hound
#

Logical fallacy

tender shard
opaque scarab
#

I’m not very familiar with data packs, but to my knowledge, biomes must be hardcoded into the pack. My way allows me to make changes on every initialization

hot reef
#

yes and sadly its the only stuff i got, and i tried doing craftitemstack but idk how to get it into my program

opaque scarab
#

Now I’m curious if that would work… I probably won’t try it, but

tender shard
#

one of those, preferrably asCraftMirror @hot reef

grim hound
hot reef
#

lol

#

what import

#

🦗

tender shard
grim hound
#

Or reflection

grim hound
#

I can send you my github where I use it for multiversion support

tender shard
#

?nms

tender shard
#

how do you acquire an NMS itemstack in the first place if you don't have NMS on the classpath?

tender shard
#

yikes

grim hound
#

Then do reflections

hot reef
#

ima just say it right here, im very much lost in what to do to make it work 😅

#

the code is set up right, except its just not the right class for it to be used properly

grim hound
#

Wait how do I

#

Bright up the line

#

BRUH

hot reef
#

you did

grim hound
#

Oh I did nice

hot reef
#

do i just copy that and put it in and use it?

grim hound
#

I'm using the asNMSCopy

tender shard
#

no, you're usually supposed to understand what it does, then you know what to copy/paste, if anything

grim hound
#

And you want asCraftMirror

hot reef
grim hound
#

So replace that in the code

#

Also, I input ItemStack as the argument

#

And you want to do the reverse yeah?

tender shard
grim hound
#

Nms to bukkit

hot reef
#

my brain hurts

#

but i think i follow

grim hound
tender shard
#

I'd just add craftbukkit as dependency and call CraftItemStack.asNmsCopy directly

hot reef
grim hound
hot reef
#

i coulnd't find a maven repo of cratbukkit

tender shard
hot reef
#

jesus

tender shard
grim hound
grim hound
#

It's cached

tender shard
#

didnt see

#

I only looked at the methods

hot reef
#

my brain hurts again.

grim hound
#

Ok

vernal oasis
#
public static void tempBanPlayer(Player p, int dungeonTime, String reason) {
        long durationInMillis = (long) dungeonTime * 60 * 60 * 1000;
        Date banTime = new Date(System.currentTimeMillis() + durationInMillis);
    
        BanList<Player> banList = Bukkit.getBanList(BanList.Type.PROFILE);
        BanEntry<Player> banEntry = banList.getBanEntry(p);
        
    
        if (banEntry == null) {
            banList.addBan(p, reason, banTime, null);
        } else {
            banEntry.setExpiration(banTime);
        }
    }

How do I do a tempban thingy?

#

If change it to this

public static void tempBanPlayer(Player p, int dungeonTime, String reason) {
        long durationInMillis = (long) dungeonTime * 60 * 60 * 1000;
        Date banTime = new Date(System.currentTimeMillis() + durationInMillis);
    
        BanList banList = Bukkit.getBanList(BanList.Type.NAME);
    
        // Note: Use the player's name for ban entry
        BanEntry banEntry = banList.getBanEntry(p.getName());
    
        if (banEntry == null) {
            // The player is not already banned
            banList.addBan(p.getName(), reason, banTime, null);
        } else {
            // The player is already banned, update the expiration time
            banEntry.setExpiration(banTime);
        }
    }

It yells about BanList.Type.NAME being depracated

sullen marlin
#

What's the question

vernal oasis
#

How do I make a tempban function, 1.20

sullen marlin
#

First code block looks pretty much correct? Although I think it's PlayerProfile not player generic

#

?jd-s

undone axleBOT
sullen marlin
vernal oasis
#

So I have to convert it from Player to PlayerProfie?

sullen marlin
#

Yes, player.getProfile or whatever

vernal oasis
#
BanList<Player> banList = Bukkit.getBanList(BanList.Type.PROFILE);
        PlayerProfile profile = (p.getProfile());
        BanEntry<PlayerProfile> banEntry = banList.getBanEntry(profile);  
#

The method getProfile() is undefined for the type Player

#

well damn

sullen marlin
#

getPlayerProfile()

#

And BanList<PlayerProfile>

vernal oasis
#

Type mismatch: cannot convert from com.destroystokyo.paper.profile.PlayerProfile to com.marcusslover.plus.lib.mojang.PlayerProfile

#

Is paper the correct one to use?

sullen marlin
#

No

#

?whereami

sullen marlin
#

And read the docs linked above

vernal oasis
#

'org.bukkit.profile.PlayerProfile' is deprecated

sullen marlin
#

?whereami

vernal oasis
#

I am aware this is the Spigot server

dry hazel
#

you are using paper API

vernal oasis
#

ah, depencencies...

#

Thanks md_5

#

It would appear that the project was created w/ paper instead of bukkit

shadow night
#

Md 5 has sent more whereami's this hour than I have in my life

vernal oasis
#

Yeah I was confused why the bukkit api wasn't working on that...

#

That makes quite a bit more sense lol

rotund sun
#

How to set npc skin using protocollib?

#

i use this one
profile.getProperties().get("textures").forEach(property -> profile.getProperties().put("textures", new WrappedSignedProperty("textures", property.getValue(), property.getSignature())));

#

but it didn't show anything

inner mulch
#

Hello im trying to spawn 36 different particles, they are supposed to be colored like a rainbow in order, i dont want to hardcode the color, therefore, does somebody know a reliable way that i could calculate the colors and get them from rgb

echo basalt
#

well the rainbow and the rgb spectrum are two different things

inner mulch
#

okay

echo basalt
#

I'd recommend hardcoding these 7 values and interpolating between them

inner mulch
#

So hardcoding would be the way?

echo basalt
#

you hardcode the rainbow

#

and you generate all the points between them

inner mulch
#

okay

wet breach
#

you don't necessarily need to hardcode

#

I recommend sticking with RGB because you can use bitshifting

#

and with just a shift of a bit or two you can essentially get any color and value you want

inner mulch
#

bit shifting sounds bad

wet breach
#

its not

#

I have a project that demonstrates it with rgb

#

basically it compresses 32bit colors to 8bit colors

inner mulch
#

I meant to say it sounds hard

wet breach
inner mulch
#

Thanks i will look into that

echo basalt
#

Well yeah you don't need to hardcode you can just have it be configurable

#

you still need to know the 7 colors of the rainbow as there's like no mathemathical expression to gen it

terse ore
#

If I want to make so certain set of players cant break blocks placed by another set of players, is there a better idea to store the blocks placed in a list and check if that block was placed by another player?

wet breach
echo basalt
#

is it sumn cursed

wet breach
#

and even then those don't need to necessarily be hardcoded either since you know the limit is 255

echo basalt
#

I'm talking about the starting colors

#

interpolation is separate

#

that can be algorithmic

#

Like there's no obvious pattern for the rainbow

wet breach
#

as long as you know the ranges for the colors you want

#

the order is arbitrary really

echo basalt
#

it's not linear..

#

whatever

wet breach
#

not sure what you mean linear

#

255,0,0 is red, 255,255,0 is yellow

#

0,255,0 is green and so forth

#

127,255,0 is green if I remember right

#

er not green

#

0,0,255 is blue lol

#

127,255,0 is lime green

#

just because something isn't linear doesn't mean it has to be hardcoded

#

I will admit non-linear things are not as intuitive to see it though

echo basalt
#

homie I know how colors work

#

I just don't know how you expect me to create a rainbow algorithmically without having at least 7 colors to start with

#
public List<Color> createRainbow(int listSize) {

}
undone axleBOT
terse ore
#

thanks, did not remeber this existed

wet breach
#

and as I said you already know the limits of each

echo basalt
#

That's the rgb spectrum not the rainbow

wet breach
#

you only need the limits of those 3 colors

#

255,0,0

#

255,255,0

#

0,255,0

lost matrix
#

Interpolating in RGB works very poorly

echo basalt
#

frosty talking about the rgb spectrum not the damn rainbow wtf

wet breach
#

I already told you about the raindbow

#

the rainbow isn't some mystical colors

#

its a combination of the primary colors

#

something you learn in school

#

also so happens to be something easy to replicate with just rgb

grim hound
#

is it possible to have like an already existing Spigot server

#

but link a sub-server to it?

grim hound
lost matrix
#

What does this "link" do?

grim hound
grim hound
#

and back at one point

lost matrix
#

That just sounds like a perfect task for a proxy

#

BungeeCord, Waterfall, Velocity

grim hound
knotty aspen
#

that is the exact task a proxy is made for

#

so just use that. they are all very lightweight

grim hound
#

then how could I boot up a server

#

with a plugin?

lost matrix
#

Hmm. That would be extremely hard to do because you would have to use the spigot server as a proxy.

grim hound
#

creating a dummy server with a plugin

#

with my own server engine

lost matrix
grim hound
#

or do proxies have a vm for each server?

lost matrix
#

How do you expect two applications share their stack?

grim hound
#

hmm

#

I see

lost matrix
lost matrix
grim hound
#

yep

ivory sleet
#

Its really nice to just isolate each backend server into its own jvm, and then having your proxy on a separate jvm, in practice everything could run on the same jvm, but that sounds like a duct tape hassle

lost matrix
# grim hound yep

Sure, that can be done. You just need to implement the protocol.
But be prepared to write a ton of code. Also proxies are really not meant to have any functionality besides
routing packets.

Maybe explain what you are trying to do. I smell an xy problem.

wet breach
#

should you? probably not

grim hound
#

and connect the player to it

wet breach
#

you want dynamic servers?

grim hound
#

and have it create from my own server engine jar

grim hound
#

unchangeable once created

wet breach
#

I am not understanding what it is you want then

grim hound
wet breach
#

ok, but it still doesn't make sense

#

or is not very clear in what you are trying to achieve

grim hound
#

Create it

#

with a plugin

#

that is placed on the proxy server

#

and is of my own creation

#

so I code this plugin

lost matrix
grim hound
#

I'll make a vm

wet breach
grim hound
#

can I start another vm from java?

wet breach
#

you need to use a Java Agent which handles processes in the JVM

wet breach
ivory sleet
#

No i mean like, assuming you own the software, its possible to invoke the server socket for both backend servers and the proxy server on the same jvm

grim hound
ivory sleet
#

but you probably shouldnt

wet breach
#

its designed to be a wrapper around JVM processes

lost matrix
wet breach
#

basically you would create a wrapper client which makes use of Java Agent, it can then launch Java processes inside of it

#

or launch JVM's outside of it

#

should you do this or is it wise? Not really, the only nice thing of a Java wrapper client is that it can do some utility things for you that make it easy

#

like letting you know if a server died or something and rebooting it back up

#

etc

grim hound
lost matrix
wet breach
#

ok that is fine, but your idea isn't efficient or optimal

grim hound
#

proxy starts up

#

I look for my dummy server

#

if not present I put the jar file

#

and start it

#

and send players to it

#

just 1

wet breach
lost matrix
grim hound
#

JUST 1

#

1 SERVER

#

a dummy server

lost matrix
#

We are still doing xy

grim hound
#

Okay let me be clear:

#

a Velocity server starts up

#

I want to create a dummy server

wet breach
#

oh you want the proxy server to also be the hub server?

grim hound
#

where I'd send players as the primary one

grim hound
wet breach
#

yes this is doable, in fact a world doesn't even need to actually load for a player to connect to it just fyi

grim hound
#

tbf it's for my antibot

wet breach
#

so what you are wanting is completely doable on a proxy

grim hound
#

I plan to develop a server engine

#

to have it as efficent as possible

wet breach
#

ok, well I don't know what inefficiency you are experiencing

grim hound
#

but I still don't know how I could start a server from within a plugin

wet breach
#

you saying efficient as possible is just arbitrary at this point

grim hound
#

so that I don't have to recode it later on

lost matrix
#

Is this public or for private use?

wet breach
#

well you keep explaining dynamic servers, but you keep saying no you don't want dynamic servers despite what you are describing

grim hound
#

public

grim hound
#

and it's unchanging

wet breach
#

yes that is hubs for you

#

they don't typically change

grim hound
wet breach
#

so 2 servers now

grim hound
#

my dummy server will just be for verification

lost matrix
#

Does it need to be a spigot server, or just a "place where a client can connect to"

grim hound
#

I'm planning on creating my own server engine

wet breach
#

ok what kind of verification is needed?

grim hound
#

so I have the jar, how could I create a dummy server the player could connect to

wet breach
#

because I may have an easy solution which requires nothing but a hub

lost matrix
#

There is no need for a server engine.
You can just emulate the protocol and send a few packets.

grim hound
wet breach
#

ok that is it?

grim hound
#

yep

wet breach
#

use demoscreen then

grim hound
#

just like netty communication

wet breach
#

when they connect to the hub, give them the demoscreen

#

you can do all kinds of things with that

grim hound
#

Can you help me with my problem tho?

grim hound
#

on a proxy

wet breach
#

you can even do visual verification with demoscreen too since there is buttons for the screen 🙂

grim hound
#

I'll decide on that

#

for now PLEASE

#

ANSWER THE QUESTION

wet breach
#

then I decide I will go back to my game

#

since I get to decide that

#

have fun

grim hound
#

mhm

lost matrix
grim hound
wet breach
#

just fyi, you are talking with the few people who are actually highly experienced with dynamic servers

#

but what you want doesn't need any protocol manipulation or even a second server

#

can all be done on the hub

grim hound
# lost matrix

but I want to minimize or remove calculations made by the server

echo basalt
#

that's still the rgb spectrum, just 8 points evenly spread out

lost matrix
grim hound
#

if I had my own server engine I could ensure that

echo basalt
#

Well

grim hound
#

thus why I want to create the server

echo basalt
#

You basically want a cloud system

#

and that's core java and not plugin related

lost matrix
wet breach
#

which is what makes it all the more confusing lol

grim hound
echo basalt
#

You need a "core" service that receives a server creation request and sends it to one of its "workers" (one per machine) that make sure the image is up to date and starts a server out of that

ivory sleet
echo basalt
#

You want the server allocation part

#

Well that's a cloud system

#

If you want an already existing one there's TimoCloud

wet breach
#

which in a nutshell is a dynamic servers setup

echo basalt
#

I don't understand CloudNet enough to recommend it

#

I'm just making my own because I can

wet breach
#

which is what was asked quite a few times

lost matrix
# grim hound the server the player is currently on

Wait. Initially the player is on no server. And my interpretation was that you wanted a
minimal server implementation without any functionality (no world, no entities, no other players, no chunks etc)
with just a limbo. And that could be done on a separate thread, started by the proxy, simply sending a few packets.

ivory sleet
#

The loadbalancer is basically velocity/bungee

echo basalt
#

The loadbalancer can run on top of the proxies so that no individual proxy gets overloaded

grim hound
#

The player on login is redirected to an empty server

#

which my plugin would create

echo basalt
#

So we're talking 2 separate things

ivory sleet
#

Does Shadow really need a hierarchical proxy topology?

wet breach
#

probably not

lost matrix
wet breach
#

they just want a verification system for their anti-bot thing

echo basalt
#

Instead of having a "plugin create a server" you'd have a matchmaking service and a server management system working together

wet breach
#

and they seem to be going on the path of over engineering right now

echo basalt
#

but we're probably not talking about cloud anymore

echo basalt
#

we've reached the holy lands of ?xy

#

?xy

undone axleBOT
echo basalt
#

bot pls

grim hound
#

?

#

I've explained many times what I want to achieve

echo basalt
#

You've thought so hard of an anti-bot solution you've crossed the realms of cloud server management

#

:)

#

Maybe what you want to achieve isn't the right solution to your problem

wet breach
#

literally they could make use of demoscreen XD

#

it is in the API

grim hound
echo basalt
wet breach
#

so far everything they asked in what it needs to do

#

demoscreen provides

#

and this can all be done on the hub

echo basalt
#

welp I'm done here

wet breach
#

which is just 1 server and no other server spooled up

echo basalt
#

omw to spend my last 20$ at the barbershop

#

cya nerds

wet breach
#

cya later

#

get a cool haircut

grim hound
#

then show me how you'd do it

echo basalt
#

imma do my beard and trim the sides n stuff

#

mostly maintenance so I don't look like a hobo

wet breach
#

ah

echo basalt
#

gotta pass by my school in a couple hrs to sort out some degree stuff

grim hound
#

I get that the people here only act nice and in reality are douchebags

wet breach
#

I am not entitled to be nice to anyone

#

yeah really depends what kind of bot problem they are trying to solve

ivory sleet
wet breach
#

yeah smiles solution is nice too

#

if you don't want to make use of the DemoScreen stuff

#

after looking

#

it seems the API is a bit lacking on the DemoScreen area though

ivory sleet
#

Obviously the fact that illusion deployed a huge skull emoji sticker is a bit rude, but don’t think any of us meant any harm or rudeness initially

lost matrix
wet breach
#

I have seen it used, and there is a lot that can be done with it

#

it takes the player to like a separate area where you can give tutorials etc if you wanted

#

its really cool

lost matrix
#

Lecture continues PES_CringeGrin see ya guys

wet breach
#

cya later

echo basalt
#

But ye I'm ticked off today

#

Need my 2 minutes of sleep

tender shard
#

wake up

wraith dragon
#

guys any way to change the blast resistance of a block?

#

ik its with nms but so far I cant figure it out

upper hazel
#

?paste

undone axleBOT
upper hazel
wet breach
upper hazel
wet breach
#

you don't really need to modify it, just have a list of blocks you want the resistance changed, make use of the events

echo basalt
#

I'm lined up with 1$ to spare

#

Every time I hit the barber the guy charges me a different price

wet breach
#

mood pricing

echo basalt
#

It's always 17-18$

rotund ravine
#

Same

wet breach
#

if they like you or in good mood, you get $1 discount 🙂

#

otherwise its full price all the way

wraith dragon
wet breach
#

basically you would make a configuration that has a list of blocks that you want resistance changed to, and their values you want it to be

#

then its a matter of listening for events and detecting the blocks, if the resistance is to be greater, you just don't let it get destroyed if it should be less then you let it get destroyed

#

etc

tender shard
#

ItemStack toString() returns the same as /data get entity… SelectedItem right?

#

Including NBT tags etc?

echo basalt
#

I believe so yeah

tender shard
#

That‘d be great

#

Then i can tell people to just blacklist items by regexing toString

#

is there any simpler way to catch exceptions in the lambda thingy? It looks so ugly compared to the rest lol

        this.toStringRegex = config.getStringList(name + ".toStringRegex").stream().map(entry -> {
            try {
                return Pattern.compile(entry);
            } catch (PatternSyntaxException exception) {
                main.getLogger().warning("Invalid regex in blacklist entry \"" + name + "\": " + entry);
                return null;
            }
        }).filter(Objects::nonNull).collect(Collectors.toList());;
        if( main.debug) main.debug("- toStringRegex: " + toStringRegex.stream().map(Pattern::toString).collect(Collectors.joining(System.lineSeparator())));
green plaza
# tender shard is there any simpler way to catch exceptions in the lambda thingy? It looks so u...
this.toStringRegex = config.getStringList(name + ".toStringRegex").stream()
        .map(this::compilePattern)
        .filter(Objects::nonNull)
        .collect(Collectors.toList());

if (main.debug) {
    main.debug("- toStringRegex: " + toStringRegex.stream().map(Pattern::toString).collect(Collectors.joining(System.lineSeparator())));
}

// ...

private Pattern compilePattern(String entry) {
    try {
        return Pattern.compile(entry);
    } catch (PatternSyntaxException exception) {
        main.getLogger().warning("Invalid regex in blacklist entry \"" + name + "\": " + entry);
        return null;
    }
}
terse ore
#

Is it possible to modify the daytime and nightime times?

#

so daytime is x minutes long and night is y minutes long

ivory sleet
#

Yeah that’s possible

#

There is an event you probably could use to reset the day time every so often making it feel longer

terse ore
tender shard
#

yeah lol why didnt ithink of that

terse ore
#

interesting

ivory sleet
#

alex I also believe there exists some utility thing in guava to wrap around any functional interface with a sneaky throw

#

maybe it was apache commons, idr but yea

tender shard
#

I'm trying to blacklist items by regular expressions, which works fine. I also added a command to automatically print out the regular expression to match exactly the item the player is holding, however admins need to throw this into a yaml, and hence I have to correctly escape it. The regular expression might look like this:

^\QItemStack{WRITTEN_BOOK x 1, BOOK_SIGNED_META:{meta-type=BOOK_SIGNED, title="Quoted" Title, author=mfnalex, pages=["\"this book contains double quotes\" and 'single quotes'"]}}\E$

Obviously it would need to be quoted to be store din a YAML. I could ofc just create a YamlConfiguration, use set("dummy", myRegex) and use saveToString(), then substring the "dummy: " part, but I wonder if there's a better way to get a correctly escaped version of this string

tender shard
ivory sleet
#

Myea in that case

#

Yes

#

Pattern does have a literal regex static factory method

#

Pattern qoute()

#

But I think you can otherwise construct a normal regex instance and just pass the Pattern.LITERAL flag also :)

upper hazel
#

how to display item crafts in inventory like mods (visual)

#

when you click and this opened in inv

tender shard
# ivory sleet Pattern qoute()

that only quotes the regex stuff as mentioned above (wraps it into \Q and \E) but doesn't allow me to throw it into yaml

#

It needs e.g. to also escape all quotes inside, all \ chars, etc

ivory sleet
#

oh

tender shard
#

i'll be back in an hour, if someone knows a solution, ping me pls :3

ivory sleet
hushed spindle
#

im getting the following error

java.lang.NoSuchMethodError: 'org.bukkit.generator.structure.Structure org.bukkit.craftbukkit.v1_20_R3.generator.structure.CraftStructure.minecraftToBukkit(net.minecraft.world.level.levelgen.structure.Structure, net.minecraft.core.IRegistryCustom)'

but within the IDE there's no complaints about such a method not existing on 1_20_R3

#

how would i go about resolving that

river oracle
#

Sounds like your server isn't up to date

#

I'd just run buildtools for 1.20.4 and try again

quiet ice
#

?stash

undone axleBOT
quiet ice
#

(why are there even two structure classes anyways?)

hushed spindle
#

i think i got it

#

seems like this part of the api gets changed rather frequently

river oracle
#

Maybe legacy stuff

quiet ice
#

Heck, there are even two structure packages

river oracle
#

Becuase nothing is ever fully removed it seems like you end up with weird artifacts

hushed spindle
#

its spaghettin' time

quiet ice
#

Well good thing is that with the release of Java 26 or so we will see the end of Java 8 - though you'd still be able to run these plugins for god knows how long

young knoll
#

One represents a structure in minecraft

#

Like a mineshaft or stronghold

#

The other is about structures you save/load with structure blocks

quiet ice
#

aren't they practically identical?

young knoll
#

kinda

#

The first one can't be modified or anything

#

But the second one can

wet breach
# terse ore interesting

the only issue you will run into is people might notice the slight reset of the time if they are paying attention to the moon or sun