#help-development

1 messages Β· Page 82 of 1

rough drift
#

I'd suggest you begin working with pufferfish, that's the fastest one I found so far

iron glade
#

So you're making paper?

opal juniper
#

people always use this to try and edit spigot tho lol, you have to clone the repos manually to do that

waxen plinth
#

Paper is also open source

#

Most of its forks are too

rough drift
#

it works?

waxen plinth
#

It's not

rough drift
#

It's not

waxen plinth
#

Because obfuscation is stupid

rough drift
#

^

#

It's easy to bypass

opal juniper
waxen plinth
#

Trust me, people wanting to see your code is a good thing

rough drift
#

So far in 31 minutes I made two classes

#

which are just containers

waxen plinth
#

Ike

rough drift
#

Then I realized I am on a version with records

waxen plinth
#

Write a JSON parser

opal juniper
#

ew

#

no that sounds like a lot of work

#

although, some sort of stack implementation

waxen plinth
#

It's quite easy actually

rough drift
#

Isn't a json parser the easiest thing in the world

opal juniper
#

could make it somewhat easy

waxen plinth
#

And a good project

#

You don't need a stack at all

rough drift
#

I first want to get this portal thing I am working on functioning

#

It's a good learning experience for optimization

opal juniper
#

im just thinking, you can push on the {, [ and pop on the }, ]

waxen plinth
#

It's not the easiest thing ever but it's pretty easy

#

Here's my most recent one

#

Really dead simple, I love how it reads like a description of json's format

rough drift
#

I'd go with a tokenizer then parser impl

waxen plinth
#

I have that too

#

One sec

rough drift
#

Yeah I would go

Tokenize everything
Make AST with Parser
Use AST to make objects

waxen plinth
#

It's much slower that way

#

But the code is even simpler

rough drift
#

I have no need to copy

#

So I won't

waxen plinth
#

I am going to copy your code into my clipboard

rough drift
#

oh jesus

#

that's the best code i've ever seen

serene onyx
#

😈

waxen plinth
#

Stolen

#

It's mine now

novel ocean
#

Hello I want to make a gui which when a player puts or takes an item it does so for every player who has this gui open without having to close and reopen it so that the cursor stays in the same place does anyone know how to do that?

waxen plinth
#

Sent to my buddy already

serene onyx
#

Do you guys like my codeπŸ˜ƒ ?
package com.github.MyPlugin;

public class Main extends JavaPlugin{

public static void main(String[] args) {
    Bukkit.getPlayer("StoneSword").sendMessage("gello");
}

}

waxen plinth
#

Gonna send it to the FBI too

rough drift
novel ocean
waxen plinth
quaint mantle
#

Hey, I want to make a 3d map generator that uses small armor stands to make a round map.
How would I do this?

waxen plinth
#

How

novel ocean
#

i want to update it without reopening it

waxen plinth
#

It's my code

rough drift
waxen plinth
#

You can't sue me

rough drift
#

then it's easy

serene onyx
waxen plinth
#

Stone how old are you

rough drift
#

store the inventory, if you update the item in the opened inventory it auto updates

waxen plinth
opal juniper
#

oh rip

opal juniper
#

you just got owned

waxen plinth
#

12 year old humor

#

Are you 12?

#

11?

boreal seal
#

guys i run into wierd problem

waxen plinth
#

Ok so how old are you

boreal seal
#

the database (mysql says it registered it)

#

but later when i try retrive the data i cant

waxen plinth
#

13?

boreal seal
#

it returns the null (i set null if null..)

quaint mantle
#

You're not able to perform though

boreal seal
#

in general why it can happen i use hikaricp

novel ocean
waxen plinth
#

Anyways I'm gonna go post this code on my github

#

Β© Redempt 2022

reef brook
#

hello, i found this example

                .then(RequiredArgumentBuilder.<CommandSource, String>argument("argument", StringArgumentType.word())
                                .suggests((ctx, builder) -> {
                                    proxy.getAllPlayers().forEach(player -> builder.suggest(player.getUsername(),
                                            VelocityBrigadierMessage.tooltip(Component.text("lol", NamedTextColor.DARK_GREEN))));
                                    return builder.buildFuture();
                                })

but i don't understand when Component.text("lol", NamedTextColor.DARK_GREEN) will show?

quaint mantle
#
print("Hello world!")
``` guys dont copy my code pls
serene onyx
quaint mantle
#

Yes

waxen plinth
#
// Β© Redempt 2022, all rights reserved 
package com.github.MyPlugin;

public class Main extends JavaPlugin{
    
    public static void main(String[] args) {
        Bukkit.getPlayer("Redempt").sendMessage("gello");
    }
}```
reef brook
#

question about brigadier

waxen plinth
#

I registered it with the registry of code copyrights

boreal seal
#

and it worked

waxen plinth
#

I bet you didn't so it's mine now legally

quaint mantle
#

Your code wasn't licensed

serene onyx
quaint mantle
#

lmao

reef brook
#

#general

waxen plinth
#

For $100 it could be yours

serene onyx
#

Deal

waxen plinth
#

Sold!

#

All yours pal, I'll send the title over

serene onyx
#

tyty

waxen plinth
#

My dude

#

We're making fun of you

#

Nobody is going to steal your code

serene onyx
waxen plinth
#

It's not even worth stealing

quaint mantle
#

Level of Humor < 0

waxen plinth
#

He must be 12

quaint mantle
#

Or 11

waxen plinth
#

Or 10

reef brook
#

can you talk somewhere else?

quaint mantle
#

Or 9

opal juniper
#

lolmaooooo

waxen plinth
#

Lmao

ornate patio
#

ok so

waxen plinth
#

@worldly ingot pin that pls?

ornate patio
#

I'm trying to make a plugin where other developers can make addons for it

#

There's some public classes that I would like to keep public for myself, but I don't want others using

#

is it possible to hide these classes from others

#

like should i just declare everything as class instead of public class

opal juniper
#

oh, all the messages are gone

#

well he has disapeared

#

@gleaming escarp come back

ancient plank
#

Interesting

waxen plinth
#

😒

opal juniper
ancient plank
#

Ur mom

opal juniper
#

fuck you

#

i cannot believe that i just got ... ugh

waxen plinth
#

She was the killer all along

opal juniper
#

hidden in plain sight

#

he was suing you for 500k lol

waxen plinth
#

Good

opal juniper
#

wut? i liked it

#

it would write my javadocs for me

waxen plinth
#

The more we use it the sooner it replaces us

opal juniper
#

nah it made mistakes all over the place as soon as it wasnt a common problem

ornate patio
opal juniper
#

wait i have that

waxen plinth
#

And the more you use it, the less of those mistakes it will make

opal juniper
#

how do i activate it

ornate patio
#

its

#

somewhere on the copilot page

#

theres a small link

#

to claim it for free if your a student

waxen plinth
#

I am going to post code but pls promise no steal!!!

opal juniper
#

dont worry redempt

#

i dont want your lousy code

#

@waxen plinth fixed it

ornate patio
#

if i wanted to publish a maven repository would I have to pay for hosting

waxen plinth
#
public static void main(String []args) {System.
out
.println
(
"""
Hello, world!
"""
)
;
}```
opal juniper
#

or use jitpack

#

privately as in self-host

ornate patio
#

alright

waxen plinth
#

I have a maven server

#

I would let you use it

#

But that would give you an arbitrary code execution exploit

#

So I won't

ornate patio
#

yeah its fine

#

i wouldnt share it either

boreal seal
#

okay1204

#

make an api

waxen plinth
#

^

boreal seal
#

and docs πŸ˜› to explain the api

#

in general otherwise its 3rd party addons which arent really addons

ornate patio
#

how would that work though

#

how would I make the API interact with the plugin

boreal seal
#

library...

#

its pretty simple

#

we use an static instance later

waxen plinth
boreal seal
#

to use your api

ornate patio
#

like a completely separate project?

waxen plinth
#

And they can call its public methods and whatnot

boreal seal
#

yeah

ornate patio
#

ah I see

waxen plinth
#

No in the same project

boreal seal
#

completely sperate

waxen plinth
#

Just add javadocs

boreal seal
#

but it will require the library

#

that you made

boreal seal
ornate patio
#

hold on im getting two different responses

waxen plinth
boreal seal
#

okay1204 our both answers are the same..

ornate patio
ancient plank
#

top quality documentation

waxen plinth
#

You can hide classes

#

But any public ones are accessible to other plugins

ornate patio
#

ah so

opal juniper
#

just make api/impl modules

ornate patio
#

sorry im so confused lmfao

opal juniper
#

if you really want to hide them

ornate patio
#

the API would be a seperate project then?

ornate patio
#

yeah but

#

how does this help with hiding my own classes

opal juniper
#

well, if you make it a plugin library and only give them the api dependency, they wont know the others exist as they arent on the classpath

ornate patio
#

I have a bunch of files for the plugin itself, but I only want like 2 of them to be visible to the public for other developers to use

opal juniper
#

well why do they need to be hidden?

ornate patio
#

because i dont want them to mess with the base plugin itself

#

for example they could potentially do some weird shit if they get access to my JavaPlugin instance

#

or mess with the commands or whatever

#

does anyone have an example for how this works

#

for example Lib's Disguises has some way of doing it

#

where Lib's Disguises is a plugin on its own that server owners can use

#

but other plugins can add integrations with it

#

When I add Lib's Disguises as a maven dependency I only see 3 classes that it provides

#

which most are static classes too

wet breach
#

you will never stop people from being able to do something with your plugin

#

so not sure why you are worrying about it

opal juniper
#

ugh

wet breach
#

this is almost along the same lines of trying to stop people from decompiling

opal juniper
#

i hate these stickers

wet breach
#

Java is not designed to stop either of these things

lost matrix
#
JavaPlugin.getPlugin(YourCoolProtectedPlugin.class)
wet breach
#

therefore stop worrying about it and just setup your project in a way where it shows how it is intended to be used, and for those that misuse it, then its their fault lol

viscid ember
#

how can i make it so its like a solid line without gaps

opal juniper
#

What is your current code?

waxen plinth
#

You make the gaps smaller

opal juniper
#

but that ^

waxen plinth
#

You can't make it perfectly solid

lost matrix
waxen plinth
#

New pfp

ornate patio
viscid ember
#

ok got it thanks sorry

ornate patio
#

I don't want their IDEs autofilling stuff that they shouldnt use

viscid ember
#

i was changing the wrong thing

wet breach
waxen plinth
#

The size is negligible

lost matrix
#

Techically you could try incrementing by using the smallest possible double value. But then you would creation billions of particles per block

opal juniper
#

sounds funny

ornate patio
opal juniper
#

but the client would just die

viscid ember
#
public class WandEvents implements Listener {

    @EventHandler
    public void onRightClick(PlayerInteractEvent event) {
        if (event.getAction() == Action.RIGHT_CLICK_AIR) {
            if (event.getItem() != null) {
                if (event.getItem().getItemMeta().equals(ItemManager.wand.getItemMeta())) {
                    Player player = event.getPlayer();

                    Location end = player.getEyeLocation().clone().add(player.getEyeLocation().getDirection().normalize().multiply(15));
                    Location start = player.getEyeLocation();
                    Particle particle = Particle.ASH;
                    int particleCount = 20;

                    double d = start.distance(end) / particleCount;
                    for (double i = 0; i < 20; i = i + 0.5) {
                        Location l = start.clone();
                        Vector direction = end.toVector().subtract(start.toVector()).normalize();
                        Vector v = direction.multiply(i * d);
                        l.add(v.getX(), v.getY(), v.getZ());
                        start.getWorld().spawnParticle(particle, l, 20);
                    }

                }
            }
        }
    }
}```

just made the for loop a double and change it to +0.5
opal juniper
#

oh yeah u need to do like 0.1 or sommin

ornate patio
#

so I'll just include the usable (for other devs) static classes in my plugin itself then

opal juniper
#

for a "solid" line

viscid ember
#

im not that good with vectors and all and not sure if i even should use a vector but im trying to get infront of the eyes and not directly the eye location

Location start = player.getEyeLocation();

How do i make this so it gets like idk 0.5 infront of the eye

lost matrix
novel ocean
#

Hello I want to make a gui which when a player puts or takes an item it does so for every player who has this gui open without having to close and reopen it so that the cursor stays in the same place does anyone know how to do that?

lost matrix
novel ocean
#

I did this so it opens the inv on a command so it uses the items from an arraylist

public static Inventory otchlanGui() {
        Inventory inv = Bukkit.createInventory(new OtchlanGuiHolder(), 54, ChatColor.WHITE + "" + ChatColor.BOLD + "OtchΕ‚aΕ„");
        int index = 0;
        for (Iterator var8 = OtchlanManager.getClearedItems().iterator(); var8.hasNext(); index++) {
            ItemStack item = (ItemStack) var8.next();
            inv.setItem(index, item);
        }
        return inv;
    }```
lost matrix
#

Also this looks decompiled

novel ocean
#

ye

#

ik

#

could get smth to work

novel ocean
#

one instance?

lost matrix
#

You can take that quite literally. One instance of Inventory.

novel ocean
#

isn't that one?

#

oh

#

no its not cause it adds the items every time someone opens it right?

kindred valley
#

There was a topic

#

About the handling high prioritied threads

#

Can someone send the spigot link

viscid ember
lost matrix
wet breach
rough drift
#
create table users (name string, age integer)
insert into users values('Ike', 5)
```Just made a couple helper functions to generate this from a class
viscid ember
# lost matrix show some code
                    Vector startAdd = start.getDirection();
                    double dx = startAdd.getX() * 0.5;

                    start.add(dx, 0, 0);

its only when its going diagonal

quaint mantle
lost matrix
novel lodge
#

How come when using getClickedInventory on a InventoryClickEvent it gets the inventory before the item is picked up and how can I get the inventory after it's clicked

wet breach
#

might need to use radians

lost matrix
novel lodge
#

Okay

#

Ty

viscid ember
# lost matrix Code and pictures dont correlate. Nothing we can help here with.
    @EventHandler
    public void onRightClick(PlayerInteractEvent event) {
        if (event.getAction() == Action.RIGHT_CLICK_AIR) {
            if (event.getItem() != null) {
                if (event.getItem().getItemMeta().equals(ItemManager.wand.getItemMeta())) {
                    Player player = event.getPlayer();

                    double BlocksToShoot = 10; //Number of blocks to shoot for if 10 the beam will be 10 blocks long

                    Location end = player.getEyeLocation().clone().add(player.getEyeLocation().getDirection().normalize().multiply(BlocksToShoot));
                    Location start = player.getEyeLocation();
                    Particle particle = Particle.ASH;

                    Vector startAdd = start.getDirection();
                    double dx = startAdd.getX() * 0.5;

                    start.add(dx, 0, 0);



                    double d = start.distance(end) / 10;
                    for (double i = 0; i < 10; i = i + 0.1) {
                        Location l = start.clone();
                        Vector direction = end.toVector().subtract(start.toVector()).normalize();
                        Vector v = direction.multiply(i * d);
                        l.add(v.getX(), v.getY(), v.getZ());
                        start.getWorld().spawnParticle(particle, l, 20);

                        List<Entity> near = l.getWorld().getEntities();

                        for(Entity e : near) {
                            if (e.getLocation().distance(l) <= 1.5D) {
                                if (e instanceof LivingEntity) {
                                    ((LivingEntity) e).damage(3);
                                }
                            }
                        }
                    }

                }
            }
        }
    }
}```
waxen plinth
#

Oh boy

lost matrix
#

I dont get the addition of X here...

lost matrix
lost matrix
twilit roost
#

Im creating custom World Generator
And I want to create Forest of Trees
Ik how to spawn trees but they are all "long" distances apart, I want them to be stacked on each other, making sort of jungle

twilit roost
#

via Block Populator

lost matrix
grim ice
#

first time i see smile with a different pfp

twilit roost
twilit roost
lost matrix
twilit roost
#

wondering on how to do so
i thought of changing settings of Random but thats all

Couldn't find any other way to change noise values

lost matrix
#

Not sure how much is possible with just the spigot api

sterile token
#

How does work the ignoreCancelled boolean from the @EventHandler annotation?

#

(I mean im recreating the spigot event-listener system)

agile anvil
#

"If ignoreCancelled is true and the event is cancelled, the method is not called. Otherwise, the method is always called."

lost matrix
solid cargo
#

why the hell 😐

sterile token
#

I understand that if "ignoreCancelled=true" will be still called not matter if its cancelled or not right??

lost matrix
#

the other way around

#

ignoreCancelled=false
Is the default. This way the method always gets called.

#

ignoreCancelled=true
The method will only be called if no other method cancelled the event before yours.

#

It means ignored cancelled events

novel lodge
#

What's a good way to give multiple items abilities without switches?

sterile token
#

can you elaborate a bit more

sterile token
#

Also you Rolyn

novel lodge
#

I mean is there a good way to give items functions that trigger on right click without using switches to check for the item?

sterile token
#

That i will dm you once i can fully test the library remake

agile anvil
novel lodge
#

ty

lost matrix
#

Map<Key, Ability>

Then in the PDC write one or many Keys.
On interact -> get all keys -> get corresponding Abilities -> cast Abilities

sterile token
#

Is it from 1.16 up?

agile anvil
#

I guess it's some placeholder

#

Like you can put a UUID

#

or a String

#

or whatever

sterile token
#

oh ok

agile anvil
#

Otherwise I know there are the MinecraftKey

rough drift
#

How do I move a location forward? do I just add it's direction to itself?

agile anvil
#

Add a normalized direction and transform it to Location

waxen plinth
#

The vector returned by Location#getDirection is already normalized

wet breach
#

generally you would use the direction the player is going in as the indicator of moving forward

#

or you could go by cardinal directions as the basis

rough drift
wet breach
#

well forward is relative

#

it is whatever you decide it is

rough drift
#

Vector step = new Vector(1, 0, 0);
dir = dir.add(step);

wet breach
#

but for the most part you would either add or subtract from the x or z

#

to move in a particular direction

rough drift
wet breach
rough drift
#

So moving directly in front is my need

wet breach
rough drift
#

I have their camera dir

wet breach
#

doesn't mean you can't listen to player move events

rough drift
#

I... don't need to do that? Just the block the player's looking at

#

Well sort of

#

it's a bit more complicated, but that's the main thing

wet breach
#

or if they are looking at a block

rough drift
wet breach
#

just compare the values of where they are at and where the block is at and that gets you a direction too on a vector

rough drift
#

Any direction, just move a vector/location forward

#

To run some other calculations

wet breach
#

alright you are making this harder then it needs to be

#

Just compare the location of the block they are looking at, with the location you have which I assume is the players, and with using vectors you can get a direction

rough drift
#

That's what I want

#

How can I achieve that

#

Found it on a thread about spawning particles

wet breach
#

those pictures are not really clear

rough drift
#

The player is the big circle

#

the arrow represents the look direction

#

the small circle is the location I want

echo basalt
rough drift
#

Again, not moving the player

echo basalt
#

you just want to spawn particles at the crosshair?

echo basalt
rough drift
#

I just want a position in front

#

that's it

echo basalt
#

you just add the direction to it

#

either that or add its own normalized value

#

I mean it depends

#

direction is yaw-pitch dependent

#

adding its own normalized self is relative to 0

agile anvil
#

but you have to multiply

#

by something, your welcome x)))

wet breach
#

but as I have stated though if you already have a location in front, and just want the next location after

#

you can know the direction based on the players location and the location you do have

rough drift
#

location.add(location.getDirection()) that's basically what I want, is it correct (moving forwards)

wet breach
#

this is basic vector math, the only thing is there is no velocity, but will just say there is a velocity of 0 going in the direction of the location in front of the player πŸ™‚

agile anvil
wet breach
#

vector still gives you a direction

#

regardless of where you look

agile anvil
wet breach
#

indeed which gives you a direction

agile anvil
rough drift
agile anvil
#

Adding the direction normalized should give the front direction

wet breach
agile anvil
wet breach
#

so the alternative is using vectors

agile anvil
rough drift
#

Oh

#

Fixed it

wet breach
rough drift
#

was adding to a vec rather than loc

agile anvil
wet breach
#

its not important

#

they wanted to establish what forward was in an arbitrary way

#

anyways not sure why what I explained is so difficult to understand

agile anvil
#

I think you just got in a muddle ^^

wet breach
#

not sure how, can't really explain how you get a direction anymore simpler then using a vector with no velocity

#

you can pretend it does have velocity though as it does make the math easier

agile anvil
#

Well I think you got in the muddle cause Velocity is not a math thing

#

velocity is the derivate from the position in physics

ancient plank
#

1+1=2 quicc maffs

viscid ember
# lost matrix Before we continue: Can you please reduce the nesting by using safeguard stateme...
  1. so like this?
public class WandEvents implements Listener {

    @EventHandler
    public void onRightClick(PlayerInteractEvent event) {
        if (!(event.getAction() == Action.RIGHT_CLICK_AIR)) {
            return;
        }
        if (!(event.getItem() != null)) {
            return;
        }
        if (!(event.getItem().getItemMeta().equals(ItemManager.wand.getItemMeta()))) {
            return;
        }

        Player player = event.getPlayer();

        double BlocksToShoot = 10; //Number of blocks to shoot for if 10 the beam will be 10 blocks long

        Location end = player.getEyeLocation().clone().add(player.getEyeLocation().getDirection().normalize().multiply(BlocksToShoot));
        Location start = player.getEyeLocation();
        Particle particle = Particle.ASH;

        Vector startAdd = start.getDirection();
        double dx = startAdd.getX() * 0.5;

        start.add(dx, 0, 0);

        double d = start.distance(end) / 10;

        for (double i = 0; i < 10; i = i + 0.1) {
            Location l = start.clone();
            Vector direction = end.toVector().subtract(start.toVector()).normalize();
            Vector v = direction.multiply(i * d);
            l.add(v.getX(), v.getY(), v.getZ());
            start.getWorld().spawnParticle(particle, l, 20);

            List<Entity> near = l.getWorld().getEntities();

            for (Entity e : near) {
                if (!(e.getLocation().distance(l) <= 1.5D)) {
                    return;
                }

                if (!(e instanceof LivingEntity)) {
                    return;
                }
                ((LivingEntity) e).damage(3);
            }
        }
    }

}```
agile anvil
ancient plank
#

if(!(event.getItem() != null))
lol

#

Tf is that

agile anvil
#

NotCeption

viscid ember
#

😭 i just realised

#
if (event.getItem() == null) {
            return;
        }```
#

there we go

agile anvil
viscid ember
#

one sec my code is broken after fixing the nesting

wet breach
chrome beacon
#

^

viscid ember
wet breach
#

if it needs to more technical in regards to vectors, it is a vector defined function in which it has both magnitude (amount) and direction

#

so not sure how you can say velocity isn't a math thing lol

viscid ember
#

not to sound defensive just tryna learn

ivory sleet
#

ItemMetas are first of all just context objects, whilst using PDC would mean that you define your behaviour based on a provided api functionality as opposed to just relying tightly on that the underlying design (aka implementation) conforms to your design. Also should be a bit more scalable.

In simple terms though, using PDC is more robust concerning your design's dependencies.

sullen wharf
#

Is there anyway to know if a item is consumable?

I know there is Material.isEdible, which gives a big list of consumable items, but i wanted some way to include potions and whatever other stuff there is that can be consumed.

quaint mantle
#

Material.POTION

#

and if I'm not mistaken, I believe Material.POTION.isEdible() returns true

#

I'm not 100% sure on the last statement though, so take that with a grain of salt

onyx fjord
quaint mantle
#

You can add those in manually to whatever list you make

sullen wharf
#

it's more manula but it works

#

manual*

final monolith
#

Hey guys, how to spawn a FallingBlock with NMS? im trying to spawn one but doesnt spawns.

quaint mantle
#

Yeah, glancing over the docs I don't really see any methods aside from isInteractable which I think also returns true for blocks that can be right clicked (like the crafting table and furnace etc)

buoyant viper
#

splash is just a throwable potion

#

lingering is a splash potion that ... lingers

#

ig every lingering potion is a splash potion (false if u consider ender dragons ball) but not every splash potion is a lingering potion

patent fox
#

how can i make a 3d sphere with particles? i dont really know how to use cos and sin...

desert frigate
#
recipe.setIngredient('S', Material.STICK);```

is it possble to use a itemstack as a recipe instead of a material? cause i want custom items to be crafted too
desert frigate
mighty aurora
#

What would the best way to learn packets be?

mighty aurora
desert frigate
#

i-

#

i was boutta do smth like this ```java
List<ShapedRecipe> recipes = new ArrayList<>();
ShapedRecipe enchantedOakLog = new ShapedRecipe(key, item);
enchantedOakLog.shape("EEE", "EEE", "EEE");
enchantedOakLog.setIngredient('E', new ItemStack(Material.OAK_WOOD, 1));

    for (ShapedRecipe recipe : recipes) {
        Bukkit.addRecipe(recipe);
    }```
mighty aurora
#

Quick question. I'm trying to add a players name into a set but when I put set.add(p.getName()) it says "Unchecked call to 'add (E)' as a member of raw type 'java.util.Set' Does anyone know if this means anything and or how to fix?

desert frigate
#

ahh

#

so im guessing hypixel uses a custom gui?

#

ugh

#

thats gonna be so annoying

#

honestly it doesnt matter πŸ’€

#

cause i just want them to put 9 stacks of wood

#

so

#

no other room

#

but then for the other custom items, it isnt very efficent

#

sigh

#

i have to make my own gui

#

gonna be a pain

#

wait whattt

#

how u gonna do that

#

dispensers only have 9 slots

#

smart. but how would i get every crafting recipe without using my life getting each recipe

buoyant viper
#

use Set<String>

mighty aurora
#

It will be

buoyant viper
#

not just Set / Set<?>

#

idk

mighty aurora
#

Your first thing Set<String> worked

desert frigate
#

too much work making my own

mighty aurora
#

Not doing hashmap because its very temporary storage

#

like stored for about 1 second per thing

desert frigate
#

yeah ik, ive already made guis in the past but with my 3 week java experience and no lessons its hard

#

my pc goes mad when i turn on shaders

#

i go from 2000fps to 60

unborn kiln
worldly ingot
#

I actually watched a fantastic video on this not long ago on the algorithms behind a 3D dungeon generator. It touches on 2D as well, but super informative
https://www.youtube.com/watch?v=rBY2Dzej03A

Read the original blog post here: https://vazgriz.com/119/procedurally-generated-dungeons/

Github repo: https://github.com/vazgriz/DungeonGenerator

This video describes an algorithm for procedurally generating 3D dungeons.

0:00 Intro
1:03 2D Algorithm
3:40 2D Dungeon Example
4:17 3D Algorithm
8:39 3D Dungeon Example

β–Ά Play video
#

10 minute video but chalk full of information

unborn kiln
#

Thank you SO much!!!

echo basalt
#

Hey, does anyone know what's causing the clickering whenever I render contents into an imageboard?

#

FYI, the frames and maps are client-sided, and the contents are being written to async

atomic swift
#

ihave a list can i add a string to it or do i have to get the list and add the obj and set the path

drowsy helm
echo basalt
#

20tps

drowsy helm
#

so every tick

#

or every second

echo basalt
#

every tick

drowsy helm
#

try reduce it and see how that goes

#

i think its just the client receving the data

echo basalt
#

I'd need to reduce my raytracing for that hmm

#

how would I make it smooth tho

drowsy helm
#

takes a bit to load

#

have some sort of buffer

echo basalt
#

uhhh

echo basalt
#

how are there plugins like animatedframes doing it πŸ€”

drowsy helm
#

check their src

atomic swift
# drowsy helm wdym

like i have a StringList can i just add something to it or do i have to get the list add to it add(String)then add all the items to the path

unborn kiln
drowsy helm
#

but if you want to add to a list you just do .add(String)

atomic swift
#

and i dont have to re add it of ter getting it

drowsy helm
#

could you give an example of what you're trying to do?

echo basalt
#

lowering tick rate to every 2 ticks seems to fix the flickering

#

but stuff aint updating now

atomic swift
#

whats the difference between these

.getItemMeta().getDisplayName()
.getItemMeta().getLocalizedName()

echo basalt
#

displayname is the custom name set by the anvil n all

#

localized does translation

atomic swift
#

which one would be from an itemstaack

#

?

tulip nimbus
# atomic swift whats the difference between these `.getItemMeta().getDisplayName()` `.getItemM...

getDisplayName() returns the item’s display name, meaning if the item has been renamed with an anvil or has a custom name, that’s what it will return.

getLocalizedName() returns the original name of the item even if it were to be renamed. It’s also privy to the server’s language settings, so if you’re using Spanish as server language, it will return the Spanish names for the items.

#

Does that make sense?

glossy scroll
#

For our purposes, we used pre-built rooms in various shapes and sizes

#

this generator does not require strictly square rooms

#

it was inspired by Zorbus

dim palm
#

hello, anyone knows why this is happening?

faint frost
#

whoa

#

now how did that happen

#

have you tried placing that in ggmode?

dim palm
#

i restarted my pc and that stopped working

faint frost
#

prolly because its not in the package that houses all your classes and sub classes

#

some how that got moved out of where you place all that

glossy scroll
#

Usually fixes for me

faint frost
#

^

dim palm
faint frost
#

For some reason this isn't writing/saving the player config. It reads it just fine though because if I set Start to true in the config it sees that and acts accordingly.

atomic swift
tulip nimbus
atomic swift
tulip nimbus
#

Trying*

tulip nimbus
atomic swift
dim palm
tulip nimbus
#

Oh

#

Yeah she’s right

atomic swift
#

kk thx gtg

tulip nimbus
#

I’ll miss u

dim palm
#

this isn't working 😭

boreal python
#
                    int sharpness = gameStorage.getSharpnessLevel(runningTeam).orElseThrow();
                    item = clampOrApplyEnchants(item, sharpness, Enchantment.KNOCKBACK, type,
                            SBAConfig.getInstance().node("upgrades", "limit", "Sharpness").getInt(1));```
Lets say I wanted to get the enchantments the selected item already has and ADD the efficiency this code is trying to give the stick
How would I do that?
(Ping in responses)
mighty aurora
# boreal python ``` case "stick": int sharpness = gameStorage...

You would create an itemStack or if you are pulling it from say a player you need to do something like player.getInventory().getItemInMainHand().getEnchants that would get you the enchantments of the item in the players hand and then you would do something like player.getInventory().getItemInMainHand().addEnchant(Enchantment.DIG_SPEED, 1) to add the efficienc enchantment.

boreal python
tulip nimbus
#

U don’t have an opening brace on the first if statement!!!

boreal python
# tulip nimbus U don’t have an opening brace on the first if statement!!!
                    if (finalTeamSharpnessLevel > 0)
                        if (item.getType().name().endsWith("STICK")) {
                            item.addEnchantment(Enchantment.KNOCKBACK,
                                    finalTeamSharpnessLevel);
                        }
                    if (finalTeamEfficiencyLevel > 0)
                        if (item.getType().name().endsWith("AXE")) {
                            item.addEnchantment(Enchantment.DIG_SPEED,
                                    finalTeamEfficiencyLevel);
                        }
                    if (finalTeamEfficiencyLevel > 0)
                        if (item.getType().name().endsWith("SHEARS")) {
                            item.addEnchantment(Enchantment.DIG_SPEED,
                                    finalTeamEfficiencyLevel);
                        }
                }```
I mean it still works
tulip nimbus
#

Oh i didn’t see the forEach

mighty aurora
#

Well it depends. What I gave you is for 1.19 if you are in a different version than no. Also from what I'm seeing it looks as though their are other variables and such that we don't know and therefore can't fully interpret the code.

boreal python
#

I just downloaded the source code from another plugin and I'm editing it to apply different enchantments

boreal python
mighty aurora
boreal python
#

Only issue is that it doesn't add the enchantment to the item. it sets it 1 to. so instead of being kb4, it goes from 3 to 1

mighty aurora
#

Likely because they are basing the enchantment level appears to be set based on a variable that I would guess is based on the team upgrades.'

#

So you need to find how they set those variables and modify that as well to match your new enchants

mighty aurora
blissful forge
#

Hello! Do you know if there is any class that identifies when any head is in the head of a player?

mighty aurora
#

You would need to check the players head slot and see if the item material is a player_skull. from their you would then do whatever you want to do after checking that

blissful forge
#

Excellent thanks!

mighty aurora
#

so something like player.getInventory().getHelmet().getData should return the itemtype.

blissful forge
#

I'll write it down thanks, I'm trying to create my first plugin XD

mighty aurora
#

Also if you need help you can always ask

#

Is their a way to create an iron golem that will act like a village golem except the protection would be of a specific player/entity rather than a village?

blissful forge
mighty aurora
#

No I am just asking anyone about that

blissful forge
#

ahh okay

mighty aurora
#

So if you know you can answer but otherwise you don't have to

fluid cypress
#

are entity ids persistent?

#

by id i mean Entity#getEntityId(), idk if there are any kind of ids

glossy scroll
#

I dont think so

#

Its not part of their NBT

fluid cypress
#

not even across chunk loads?

glossy scroll
#

they persist in memory but not between server restarts if thats what u mean

#

If the entity is removed by the server, it loses its id

#

That may include chunk loads

fluid cypress
#

so, in theory, entities are "removed" when the chunk is unloaded

glossy scroll
#

Yes i would assume so

fluid cypress
#

so, how can i get a persistent id?

glossy scroll
#

It’s UUID

#

getUniqueId

fluid cypress
#

thats persistent even when restarting the server, or unloading the world?

glossy scroll
#

Yes

fluid cypress
#

ok that will do it then, thanks

#

can i safely teleport any entity? or just living ones?

#

i mean, if i teleport an item frame, an armor stand, a painting, will that work?

#

well, idk if paintings are entities

waxen plinth
#

They are

tulip nimbus
#

For entities like boats it works as expected

mighty aurora
#

I'm getting an error that I cannot add a value to a set because the set in question has a value of null(or thats what I interpret from the error). Does anyone know how I could fix? I define the set by doing Set<String> Dash; and then use Dash.add(); to add things.

vocal cloud
#

So you create a variable but never define it?

mighty aurora
#

yes and thats because for whatever reason I can't leave it as just an empty Set. I tried to define it but each time it just tells me I need to add an expression...

vocal cloud
#

Set<String> dash /*please use proper variable case*/ = new HashSet<>();

#

Sigh

mighty aurora
#

Thank you. I've never worked with sets. I was told to use them for something I was making when I asked a question and said another method I was going to use to store data(pdc). I then tried to research into sets but didn't find much on them(I read the java doc).

tulip nimbus
#

Set<String> dash = new HashSet<String>();

fluid cypress
#

if i want to compare the worlds of location objects, should i do == or .equals?

tulip nimbus
#

== is generally used for comparing enums

lime moat
vocal cloud
#

Right click -> git -> annotate with blame

#

I believe

lime moat
#

Thank you very much!

vocal cloud
#

you can also right click it and close it

mighty aurora
#

Quick question. Is their a way to make it so that hidden players can take damage(when using .hidePlayer)

#

Or do I need to figure out how to use packets to make the player invisible instead

tulip nimbus
#

You would need to use packets or ProtocolLib I think?

fluid cypress
#

to check if a list contains an uuid, is this enough? list.contains(entity.getUniqueId()), i declared this type of list, idk if there is another List<UUID> list = new ArrayList<>(), idk how the structure of the UUID is, i write java code once a year, so

quaint mantle
#

how would i set an action and set the color?

#

protocollib

tulip nimbus
#

Though I’d suggest using UUID#toString() and making a List<String>

fluid cypress
#

whats the difference if i dont specify the type to ArrayList?

#

ok ill do that

tulip nimbus
#

When you define a list, set, hashmap, etc the typical syntax is to specify the type on both sides

#

Because this will ensure only that type can be added to the list, set, hashmap whatever

mighty aurora
#

Has anyone else added protocollib as a dependency recently? I went ahead and followed the protocolLib instructions of adding the repository and dependency values but it says that it can't find the dependency

mighty aurora
#

And as I said. I followed those instructions and it isn't finding the dependency

#

I redid it a few times and reloaded my IDE a few times and now it seems to have finally found the dependency

fluid cypress
#

is this enough for preventing any spawn on a world with that name?

@EventHandler
public static void onEntitySpawnEvent(EntitySpawnEvent event) {
    if (Objects.requireNonNull(event.getLocation().getWorld()).getName().equals("some_world")) {
        event.setCancelled(true);
    }
}

its temporary, i know gamerules exist, or a better way to do that

mighty aurora
#

likely yes

mighty aurora
kindred valley
#

How can i handle big prioritied threads

#

There was a topic

#

but i cant find

#

7smile made it

kindred valley
mighty aurora
kindred valley
mighty aurora
#

Thats from your message earlier today that was also talking about what you just asked

#

I searched "big prioritied thread"

kindred valley
#

nvm

#

i found i guess

fluid cypress
kindred valley
#

Man he just deleted it?

kindred valley
golden kelp
kindred valley
dim palm
#

How can i get a player address to check their alts?

potent atlas
#

Hello, may I please have some help with my plugin?
I am trying to use PlayerQuitEvent but it's not firing and I made extra sure that I registered it

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

potent atlas
#

What do I have to do to make the PlayerQuitEvent detect a player who clicks on Disconnect?
So far I have done:
Give it its own listener class
Register the event in OnEnable
Made sure to put EventHandler above the event method
I can't use print statements because for some reason nothing in that class happens when I quit

potent atlas
#

I don't think QuitListener is being reached at all but why not?

hybrid spoke
potent atlas
#

Are you sure? I registered it in the second pastebin

hybrid spoke
#

you didnt. you instantiated it and made it a throwaway

potent atlas
#

it says "new QuitListener(this);" under "public void registerEvents" and "registerEvents();"

hybrid spoke
#

but it never says Bukkit.getPluginManager().registerEvents(new QuitListener(this), this);

potent atlas
#

I read somewhere not to put that if you already have "new QuitListener(this);"

#

But I'm sure you're right

#

I'll put that in and test

dim palm
potent atlas
#

Why would I dislike your post?

#

I was just saying, I was mislead somewhere

hybrid spoke
#

i mean the one that misleaded you

potent atlas
#

o: I should do that

#

must be in my history somewhere

#

LSoofiaa idk XD

#

I get confused because I register them in main

#

and think that's enough

#

I see why. Some of my listeners have it and some don't, yet they all work so idk :/
Anyways, adding that did not work, so back to the drawing board

river oracle
#

I reccomend not naming your main class main

#

?main

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

potent atlas
#

ok ok

hybrid spoke
#
  • the current state of your code
potent atlas
#

keep getting yelled at T-T alright lemme just ask really quick: where do I put that line? maybe I did it wrong

hybrid spoke
#

where did you put that line?

#

most likely you replace your QuitListener instantiation with it

potent atlas
#

in the listener class under
"public QuitListener(Main plugin) {
this.plugin = plugin;"

rough drift
#

Registering a runnable as an event listener

potent atlas
#

I'm guessing that's wrong, it's giving me an error. Can you please tell me where to put it?

mighty aurora
#

Unless you have other things you run in you onE noble function the line he gave you should basically be the only line their(at this stage)

potent atlas
#

ok, progress

#

got a debug statement to come through

#

give me a minute...

potent atlas
#

alright I just need to loop through the list and everything should work

#

I'll confirm in a bit

cobalt thorn
#

Hi a question if i use the Material.Skull from 1.8 and set all the proprietaries will work on 1.19 or i need to do some check for version?

charred blaze
#

how can i remove this message? Plugin listener JoinListener took 97ms to process event PostLoginEvent(player=name)!

#

im coding antivpn

reef lagoon
#

is it possible to set multiple slots in the same line?
so instead of
player.getOpenInventory().setItem(0, mat("LIGHT_BLUE_STAINED_GLASS_PANE"));
player.getOpenInventory().setItem(5, mat("LIGHT_BLUE_STAINED_GLASS_PANE"));
something like
player.getOpenInventory().setItem(0 and 5, mat("LIGHT_BLUE_STAINED_GLASS_PANE"));
Does something like this even exist?

flint coyote
#

You can create your own function that does this

flint coyote
#

then it's a 1 liner :p

alpine urchin
#

wait are you coding spigot plugin

#

or bungeecord

#

that looks like bungee

charred blaze
alpine urchin
#

i forgor bungee api

charred blaze
#

wrong event? wdym

alpine urchin
#

you prolly looking for some async event

#

or might have to switch threads

#

cause i assume you’re makimg web requests that are blocking

#

the server thread

charred blaze
alpine urchin
#

some events are just invoked async in spigot api atleast

alpine urchin
charred blaze
#

which event is async for join event?

#

?docs

#

?bungee

#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

charred blaze
#

how do i make event async?

potent atlas
#

I have fixed all my issues, thank you everyone!

tardy delta
charred blaze
#

will it be async?

quasi flint
#

yes

rough drift
#

Shoot rays as a carpet

charred blaze
hard socket
#

well this is a new error to me

quasi flint
#

i wanted to send that :c

opal juniper
#

i generally dislike assert statements as they are mis used by beginners as a way to stop their IDE moaning at them although all they are doing is moving the error

opal juniper
#

although that looks like an NMS error so you are probs doing some wacky shit

hard socket
opal juniper
#

are you setting the amounts of items

hard socket
#

nope

#

The item i click I get it from a file

#

it works fine but that happens when I click it

opal juniper
#

it seems like this error sometimes comes from having -1 amounts, so idk

opal juniper
onyx fjord
#

is it possible to save time until bukkit scheduler runs on restart for example?

bold crescent
#

Heya, do you have any recommendations for design patterns for event listening? I tried to make a factory for a player join event, just for fun, but passing the arg casues issues (I am still learning Java)

flint coyote
onyx fjord
#

lets say scheduler runs every 10 minutes but 5 minutes passed and server got turned off

#

i want to wait additional 5 minutes on start

flint coyote
#

in that case you need some kind of persistent storage that stores the time it last ran

#

then on restart you can pass the time left

#

Means if it ran at 10:00 and your server restarts and is up again at 10:03 then you would pass 7 minutes. If it's down for more than 10 minutes you can run it immediately

#

or like down over the 10 minute mark

onyx fjord
#

ye ye but whats the method for getting time remaining?

#

the rest i can do

flint coyote
#

You subtract the timestamp where it was run for the last time from the current time. If the rest is less than 10 minutes you run it with the resulting time left. Otherwise you can run it immediately

flint coyote
vestal moat
#

Hi guys anyone know how can i control the loggers out of the libraries shaded into my plugin, they do not show as my plugin instead the logger name, and people are confused

opal juniper
#

which libraries are the problem?

rough drift
#

I have a simple raycaster, that moves one block in front each time, however it does get pretty slow if I ray cast say 100 rays with length 15, is there any way I can make it faster

opal juniper
#

dont cast as many rays?

#

i mean, theoretically u could reuse some of those rays

#

where are you sending them

rough drift
#

I need to? Well I am trying to make a really good looking portal effect, so the best way to make it look good is rays

#

As I want it to keep going trough glass and stuff

opal juniper
#

i dont think that rays are the best way, but good luck!

#

i would just do pure angle math, between the eye and the pillar

#

the problem with glass portal frames is that it means that for a smooth effect there wouldn't be any border at all, ie turn the whole world to nether or whatever

rough drift
#

have you seen the immersive potals mod?

#

that effect

zealous osprey
#

try core shaders?

rough drift
#

similar

#

more like

onyx fjord
#

how do i check if command arg is an integer?

#

since i cant cast

iron glade
flint coyote
bold crescent
onyx fjord
#
    public static void sendConfigMessage(String configValue, CommandSender receiver, String toReplace,
                                         String replaceWith) {
        if (!config.getString(configValue).equals("")) {
            receiver.sendMessage(colorString(
                    config.getString(configValue).replace(toReplace, replaceWith)
            ));
        }
    }

i have this function thingy, can i somehow make it so toReplace and replaceWith can be added in unlimited amount?

bold crescent
zealous osprey
ivory sleet
#

Could use String…

onyx fjord
#

what

#

OH

#

that exists in java?

ivory sleet
#

Where even arguments are the substitutes and odd arguments are the placeholders

#

Well

#

Its just a simple vararg argument

#

We dont have keyword arguments or anything to fancy like py or js

onyx fjord
#

ye tho

ivory sleet
#

No only once

iron glade
ivory sleet
#

Or use sth like Pair<String,String>…

flint coyote
# bold crescent That's why I would ask which kind of design patters are being used with spigot p...

Design patterns are optional and differ from case to case. Basically you have a listener class that reacts to the event. In that class you can either handle the full logic or you just go with some checks like
'if(player.getWorld().getName().equals("Testworld"))' and then call a function of another class - that's up to you.

Listeners subscribe to events and get called each time the event occurs. I wouldn't call it "open port". I would compare it to the observer pattern - although it's not exactly that pattern

ornate mantle
#

why is Material#isTransparent() deprecated

flint coyote
#

ye my bad ^^

onyx fjord
ivory sleet
#

You insinuate them everywhere in your code

#

Just not canonically necessarily

ornate mantle
#

nevermind im fucking blind

flint coyote
#

What I meant by optional is that you are not forced to use them. Yes you should in specific cases but you can't generally say "use that pattern" if you don't know exactly what the goal is

ornate mantle
#

anyone have alternatives to Material#isTransparent()?

ivory sleet
#

Just that you might not be aware of them as their formal and canonical names and forms

ornate mantle
#

i need to get every block that doesnt change the player's Y axis when they stand on it

#

like air, lava, saplings, crops etc

iron glade
#

isSolid?

ornate mantle
#

they all return issolid

ivory sleet
#

Like for instance, almost every class is a facade thus can be deduced as using the facade pattern

iron glade
#

isLiquid?

ornate mantle
#

saplings and sugarcane and redstone dust and torches

iron glade
#

how do they change the Y

ornate mantle
#

when you stand on them

iron glade
#

on a torch?

ornate mantle
#

it doesnt

#

you just walk through the torch

#

thats kinda what i want

#

all the blocks you can walk through

iron glade
#

maybe isOccluding

ornate mantle
#

no

iron glade
#

don't have any other ideas rn, maybe u have to create ur own set of materials

ornate mantle
#

shows all full blocks

flint coyote
# ivory sleet Like for instance, almost every class is a facade thus can be deduced as using t...

That's true for some patterns. Facade is a good example that a lot of people implement without actually knowing it. For other patterns like singleton you are not forced to use it.

Even when there's only 1 resource of a type (like only 1 db connection for whatever reason) you can still avoid singleton by adding a static 'locked' boolean or whatever. I'm not suggesting that this is a good way - it does however make it optional

ivory sleet
#

Yes but that would be classified as using the design pattern mono state

ivory sleet
#

Which is still a design pattern

#

Altho frowned upon as an antipattern

ornate mantle
#

i love you

#

mike

iron glade
#

isCollidable?

#

ah yea

vocal cloud
#

Bro use the docs next time

ornate mantle
#

i did

#

didnt look for blocks tho

vocal cloud
#

kinda directed at mine but shrug1

iron glade
#

there a difference between !isCollidable and isPassable?

vocal cloud
#

iscollidable is for livingentities

ornate mantle
#

isnt iscollidable for entities

vocal cloud
#

lol

ivory sleet
#

Tho yes @flint coyote whether you wanna show intent by naming your components after the patterns is optional, but whatever you do you will be insinuating design patterns here and there inevitably

onyx fjord
#

ok conclure i think i got it

iron glade
onyx fjord
#

ive made Pair<CharSequence, CharSequence>... and i loop thru those and set replace to left and replacewith to right

#

😴

ivory sleet
#

πŸ₯²

flint coyote
#

That's pretty much what I tried to say. Best practice often goes hand in hand with design patterns. When using one (e.g. singleton) you don't use mono state (which I didn't know existed before, so thanks) thus making this one optional

iron glade
onyx fjord
#

now how 2 inline pair

ivory sleet
#

Yes but again design patterns as a whole is are not optional at all

#

You use them whether you want to or not

#

Then yea you can choose between which ones to use

#

That does not warrant the optionality

flint coyote
#

I meant to say that each design pattern by itself is optional. Not all of them at once

onyx fjord
#

nvm its Pair.of

#

java funny lang

grim ice
#

so um, I had this bug with minecraft where any versions 1.18 and above would freeze every 1 second, meaning the graph would be some thing like this:
300 -> 1 - 250 -> 1..etc
so well i used some jvm args i got recommended which are:

-Xms2G -Xmx2G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1```

and that fixed it, however after 3 days the bug is back, but i realized something, when the bug was fixed i had 2gb allocated and it was using 2.7gb, but when the bug still existed it was using 2gb flat, so i thought maybe that was the problem, i just tried allocating 3gb or 4gb and no luck.
ivory sleet
#

Myeah altho pair::of is more of a recent addition iirc

grim ice
#

someone got an idea? this isnt about spigot or servers tbh but yes

onyx fjord
ornate mantle
#

how do i make a block object from a material

flint coyote
#

Although I guess you could technically avoid all design patterns by writing horrible code all in one class, not using functions etc.

ornate mantle
#

without placing any block

flint coyote
#

unless there's a name for that antipattern aswell (spaghetti code? πŸ˜‚)

iron glade
ivory sleet
#

But yeah spaghetti code is probably a better label for that

ornate mantle
iron glade
#

What are you trying to do?

ornate mantle
#

if itemtype is air

#

will this if section run

iron glade
#

no

#

Don't think you can set the type of a null block

ornate mantle
#

bruh

iron glade
#

What's the context of what you're trying to do?

ornate mantle
#

checking if the block is passable

iron glade
#

why do you need a block

ornate mantle
#

to check if the material is pasasble πŸ’€

#

material doesnt have .isPassable

iron glade
#

where are you using it? like in an event or what

ornate mantle
#

its a 1.8 project which im trying to convert to 1.19.2

#

this guy handcoded every single block

iron glade
#

oh no

ornate mantle
#

in 1.8

#

im trying to unhandcode it

#

by adding stuff like "isoccluding"

#

rather than EVERY SINGLE FULL BLOCK

flint coyote
ornate mantle
#

this code is in a method to get the top height of a block

#

like a full block would have 0 top height

#

while a half block would have 0.5

#

stairs would have 0 or 0.5 depending on where you're standing

iron glade
#

shouldn't it be 0.5 - 1?

#

but yea, gotcha

ornate mantle
#

forgive my bad art skills i was using my finger

#

and my screen wasnt smooth

opal oasis
#

I am trying to make a command that plays a sound but like a few second after the command was executed

ornate mantle
#

use a bukkitrunnable

chrome beacon
#

?scheduling

undone axleBOT
ornate mantle
#

i have fixed 38 files

#

this last one has this one method which makes me cry

ornate mantle
#

theres 6 more files after this

iron glade
#

all that wasn't there in 1.8 I guess?

ornate mantle
#

you got my hopes up

#

bruh this server is literally 1984

#

cant even send death threats anymore

#

method dont work

iron glade
#

rn you are programming against 1.19? Did I get that right

ornate mantle
#

ues

#

1.19.2

#

nms

iron glade
#

then you should have access to material#isCollidable

flint coyote
#

but wouldn't isCollidable return true for stairs while they are still passable?

ornate mantle
#

ugly

flint coyote
#

did you run mvn clean package after changing the pom?

#

or updateProject in intellij?

ornate mantle
#

yes

#

i indeed did

flint coyote
#

and the error message from mvn clean package also shows the isCollidable error?

ornate mantle
#

no

#

havent compiled yet

#

the main error is

ornate mantle
#

and every single other block from 1.8 that got renamed or removed

chrome beacon
#

Why a switch πŸ’€

ornate mantle
#

i didnt write this πŸ’€

#

lemme share with you the original method

iron glade
#

I think material#isCollidable is a paper only thing, sorry, forgot I'm on paper rn

ornate mantle
flint coyote
#

pain.java I love this

ornate mantle
#

as you can see

#

its 1.8

#

because we dont have "steps" or "diodes"

#

we have slabs and repeaters

#

theres also another method just like this

#

but for lower height

spare prism
#

Hello. Is there a way to cancel the bypass of the WG regions using it's API?

#

Or do I have to cancel all the events manually?

onyx fjord
#

how2 people make chance systems for loot?

ornate mantle
flint coyote
onyx fjord
#

omg i forgor haha

#

youre right

ornate mantle
#

forgor πŸ’€ too much

flint coyote
#

how do I java? I forgor πŸ’€

ornate mantle
#

i tried using my free copilot to edit all these values

onyx fjord
#

moon bigsystems

ornate mantle
#

but it takes inspiration from MY code

#

and thats not something i wanna use

onyx fjord
#

HugeHard

#

😳

grim ice
#

so um, I had this bug with minecraft where any versions 1.18 and above would freeze every 1 second, meaning the graph would be some thing like this:
300 -> 1 - 250 -> 1..etc
so well i used some jvm args i got recommended which ill send later,
and that fixed it, however after 3 days the bug is back, but i realized something, when the bug was fixed i had 2gb allocated and it was using 2.7gb, but when the bug still existed it was using 2gb flat, so i thought maybe that was the problem, i just tried allocating 3gb or 4gb and no luck.
the jvm args are here: https://pastebin.com/3mK9yZFf

flint coyote
#

shouldn't Material.isOccluding() be everything you need @ornate mantle?

ornate mantle
#

no πŸ’€

#

alright

flint coyote
#

why?πŸ’€

ornate mantle
#

lemme show you the scale of my problems

#

material.isoccluding only includes full blocks

#

there are blocks that occupy less than a full block

#

like slabs

#

0.5 elevated height

flint coyote
#

and farmland etc ye

ornate mantle
#

YEAH

#

STUFF LIKE CAKE

#

TAKES

twilit roost
#

How to remove World without getting ^ when shutting down?

ornate mantle
#

0.5 nevermind