#help-development

1 messages · Page 749 of 1

upper hazel
#

This is probably a comfort zone for them and they have been doing this ide for 5 years and don’t want to move to Intelji

mortal hare
#

and gets job done better than lets say vscode

#

but lacks some features from more full fledge ide's like intellij

#

or the features are not as polished

#

and another factor that eclipse is and will be always free

#

thus businesses can install them on dev environments for little to no cost

upper hazel
#

intelji has free version too

#

Have you seen how a damn project is created in eliscape?

mortal hare
#

eliscape

slender elbow
#

eliscape

mortal hare
#

are you talking about some kind of eliscape or eclipse 😄

ivory sleet
#

pretty sure u can configure ram usage w intellij lol

upper hazel
#

oh yes Eclipse

#

lool

mortal hare
#

when starting the projects

#

and my projects arent that big

slender elbow
#

are you using an i3 from 2008 or what

mortal hare
#

i used skylake

ivory sleet
#

lol

mortal hare
#

now im on ryzen 7 3700x

#

i3 weren't out yet in 2008, core 2 duos rocked then

versed jackal
#

Hello, I was wondering if Wall Signs still need to use the GetSide method in 1.20

sick edge
#

Im Having a weird issue where an InventoryClickEvent behaves differently if two player are online...it seems to fire more then once or something like that because more then one case is taking place in the if else statement...
It's really weird because it has nothing to do with other players that did not click (After click it sets ItemMeta of an Item and a new Item to Cursor)

chrome beacon
#

?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.

stoic otter
#

Hello,
I reported a resource of mine asking for its premium status to be removed and convert it to free, and it hasn’t been restored yet. When will it be restored?

sick edge
#
 @EventHandler
 public void onBackpackChangeItem(InventoryClickEvent e) {
        Player p = (Player) e.getWhoClicked();
        if (state.getManager().getPlayers().contains(p)) {
            if (e.getClick() == ClickType.RIGHT && e.getCurrentItem() != null && 
e.getCurrentItem().getType() == Material.BUNDLE && !e.getCursor().getType().equals(Material.AIR)) { // Add to Backpack
                //Bukkit.getLogger().info("Added to backpack");
                BundleMeta newBackpack = state.getManager().getTeam(p).addItemToBackPack(e.getCursor());
                if (newBackpack != null) {
                    e.getCurrentItem().setItemMeta(newBackpack);
                    e.getView().setCursor(new ItemStack(Material.AIR));
                }
                e.setCancelled(true);
                Bukkit.getLogger().info("Jo1");

            } else if (e.getClick() == ClickType.RIGHT && e.getCurrentItem() != null && e.getCurrentItem().getType() == Material.BUNDLE && e.getCursor().getType().equals(Material.AIR)) { // Remove from Backpack
                //Bukkit.getLogger().info("Removed from backpack");
                Pair<BundleMeta, ItemStack> pair = state.getManager().getTeam(p).removeItemFromBackPack();
                if (pair != null) {
                    e.getCurrentItem().setItemMeta(pair.getLeft());
                    e.getView().setCursor(pair.getRight());
                }
                e.setCancelled(true);
                Bukkit.getLogger().info("Jo2");
            } else if (e.getClick() == ClickType.LEFT && e.getCurrentItem() != null && e.getCurrentItem().getType() == Material.BUNDLE) { // Update Backpack
                //Bukkit.getLogger().info("Updated backpack");
                e.getCurrentItem().setItemMeta(state.getManager().getTeam(p).updateBackPack());
            }
        }
    }
#

Both players are in the same Scoreboard Team and in the getPlayers() list

chrome beacon
#

💀

chrome beacon
sick edge
# chrome beacon 💀

But if the players are not in the same team (meaning nothing should change at all vs single player) it also doesn't work

chrome beacon
#

Do yourself a favour an cleanup that code

#

It's a mess

sick edge
#

wdym xD

halcyon hemlock
#

Sup guys

pseudo hazel
#

start by returning early

#

and why are these different checks e.getCurrentItem().getType() == Material.BUNDLE && e.getCursor().getType().equals(Material.AIR))

#

why did you use .equals for one and == for the other

#

maybe explain waht you expect to happen vs what actually happens

sick edge
pseudo hazel
#

so how do you know it fires twice?

ivory sleet
#

ah u cant do that

quiet ice
#

?jd-s

undone axleBOT
quiet ice
mortal hare
#

?paste

undone axleBOT
ivory sleet
#

^

#

if (x.getType() == Boolean.class) {
GameRule<Boolean> booleanRule = (GameRule<Boolean>) gameRule;
}

#

in principle

quiet ice
#

Isn't it boolean (the primitive)?

ivory sleet
#

idk if they use Boolean.class or Boolean.TYPE

#

yeah

#

im unsure

mortal hare
#

https://paste.md-5.net/hacapujuma.js
guys rate my command framework, i dont know what to add else. I've implemented kick command in under 5 mins with tab completion, permissions, custom arguments, usages etc.
It looks like a big code for such a simple command, but that's just because i've added executor for each case without calling one method externally instead

glad prawn
#

search google for that

mortal hare
#

you're casting the generic type

#

in runtime generic types do not exist

#

in runtime GameRule<Boolean> would turn into GameRule, and compiler cannot be sure if that object is properly casted

#

just use @SuppressWarnings("unchecked") on the variable or the method

#

unchecked casts are not code smells if they're used accordingly

#

Sometimes you need to use them

#

even java collection classes afaik some use them

lost matrix
#

You just have to make sure the type errasure doesnt leave your scope.
Can be done with strong encapsulation and implicit type safety through inference.
Let me show a quick example

#
public class SomeManager {
  
  private final Map<Class<?>, Something<?>> registry = new HashMap<>();
  
  public <T> void addElement(Something<T> something, Class<T> type) {
    this.registry.put(type, something);
  }
  
  @SuppressWarnings("unchecked")
  public <T> Something<T> getElement(Class<T> type) {
    return (Something<T>) this.registry.get(type);
  }
  
}

Like this

#

The cast is unchecked but never fails as you have internal constraints

sick edge
sick edge
ivory sleet
#

There is one way you can avoid it indirectly but like else dont care about unchecked casts

#

It only matters if you know its gonna be… well… unchecked

#

When you have runtime code that can ensure you get the right type its fine

young knoll
#

It’s still annoying

#

Particularly when genetics are involved

ivory sleet
#

The warning is pretty harmless tho

full holly
ivory sleet
#

I talked w some of the java devs at my uni

young knoll
#

You would need some kind of polygonal region system

#

Like worldedit has

ivory sleet
#

They really wanna add semantics to disable erasure

#

but like, legacy compatibility is really important

young knoll
#

POV: Md is a java dev

ivory sleet
#

Also a reason why iirc valhalla is so delayed

remote swallow
young knoll
#

I can’t tell if you missed the joke or are also making a joke

remote swallow
#

take a guess

young knoll
#

Idk

remote swallow
#

i am also making a joke

young knoll
#

Maybe the llama kicked ya in the head

#

Caused some brain damage

remote swallow
#

no hes too scared to do that

lost matrix
# full holly Does anyone have an idea how to get all blocks between multiple locations? (What...

There are a few approaches to this. Either by getting the furthest corners, iterating over all blocks and checking if they are inside your shape.
Or by using some 2D discrete math:

  • Detect all rectangles by pairing corners with at least one matching axis
  • Calculate overlaps of rectangles and shrink them by using area as a priority
  • Iterate over all shrunken rectangles (None should overlap anymore)
#

*If you have two (or more) points in one direction then you need to select the farthest

fervent pelican
#

Does anyone know a good like tutorial or guide of how to make a client sided gui that opens when you run a command?

mortal hare
#

this is spigot dev

#

not forge or fabric's

fervent pelican
#

mb mb

lost matrix
grand flint
mighty mason
#

Hey, question. Im using getConfig() to save and load my config. but im having trouble with the data after a reload
Its lost, anyone knows why?

@Override
    public void onDisable() {
        for (ZooFeeAnimal a : AllAnimals){
            a.HolographicName.removeAll();
        }

        Bukkit.getScheduler().cancelTask(growTaskId);

        saveConfig();

    }

My on disable

lost matrix
valid burrow
#

is this a gradle error? never used it before

remote swallow
#

ur trying to run it with java 21

#

20

#

not 21

valid burrow
#

i didnt even set the java i just imported it from github

mighty mason
#
    @Override
    public void onEnable(){
        instance = this;

        ConfigurationSerialization.registerClass(ZooFeeAnimal.class);
        ConfigurationSerialization.registerClass(ZooCow.class);

        this.getCommand("ZooSpawn").setExecutor(new SpawnZooMobCommand());
        this.getCommand("GetConfig").setExecutor(new GetConfigCommand());
        this.getCommand("ZooSpawn").setTabCompleter(new SpawnZooMobTabCompleter());

        guiManager = new GUIManager();
        GUIListener guiListener = new GUIListener(guiManager);

        this.getServer().getPluginManager().registerEvents(guiListener, this);
        this.getServer().getPluginManager().registerEvents(this, this);

        growTaskId = Bukkit.getScheduler().scheduleSyncRepeatingTask(this, this::TryGrow, 0, 20 * 5);

    }
remote swallow
mighty mason
#

This is my only use of config

#

and this one

#
    private void loadEntities(ChunkLoadEvent e){
        if(!getConfig().isSet("ZooAnimals")){
            return;
        }

        for(String uuid : getConfig().getConfigurationSection("ZooAnimals").getValues(false).keySet()){
            for(Entity entity : e.getChunk().getEntities()){
                if(entity.getUniqueId().toString().equals(uuid)){
                    System.out.println(entity.getUniqueId().toString());
                    System.out.println("Found");
                }
            }
        }
#

Do i have to use the saveConfig() on disable?

valid burrow
remote swallow
#

most likely they just dont have it set on toolchains so it didnt auto realise

young knoll
#

You don’t need to saveConfig on disable

ivory sleet
#

altho hopefully that should be almost never

remote swallow
#

new github features just dropped

#

open prs and issu es

valid burrow
#

yh no im to lazy for stuff like this

remote swallow
#

jetbrains released their own ai

mighty mason
#
            ZooFee.getInstance().getConfig().set("ZooAnimals." + animal.getEntity().getUniqueId().toString(), animal);
            ZooFee.getInstance().saveConfig();
#

I save the data here

#

Everything gets saved, normally

mighty mason
#
ZooAnimals:
  edb4b106-7c37-433a-962d-33f48f20c9f2:
    ==: org.example.elwarriorcito.zoofee.Models.CustomMobs.ZooAnimals.ZooCow
    thirst: 12
    entityUUID: edb4b106-7c37-433a-962d-33f48f20c9f2
    entityType: COW
    sex: Male
    name: §8§lZoo§f§lCow
    health: 12
    age: Baby
    hunger: 12
young knoll
#

Oh boy

mighty mason
#

But after i reload, there is no data on getConfig

ivory sleet
#

you dont need to reload

mighty mason
#

Let me try with restart

ivory sleet
#

reload is only really useful if u wanna load in what the server owner has edited into the config.yml file (or on startup obv)

valid burrow
#

What could be other possible reasons for this

mighty mason
#

Still, data dont get save on restart

#

Its empty

lost matrix
valid burrow
#

didnt even know i can change that this is my first time ever using gradle

#

maven superior

lost matrix
#

And what java version do you build for?

valid burrow
#

i didnt even try to build anything yet it gives me that right away

#

i think

#

yh it does as soon as i reload gradle it gives me the error

#

oh yh that is missing

lost matrix
#

Sounds like your java version is just too new to run gradle properly

valid burrow
#

what ever that is

ivory sleet
#

Dont use that

#

You can just process resources

lost matrix
#

Ah its a dependency in your build script...

valid burrow
#

do i need to manually download it or what?

ivory sleet
#

No

#

DrVoss do you use groovy or kotlin?

#

Dsl

remote swallow
#

its husksync

ivory sleet
#

Dk what that is

remote swallow
#

-Dskip.tests=true

#

feck

ivory sleet
#

That big of a project and uses groovy dsl 💀

remote swallow
#

leave groovy alone

ivory sleet
#

Mye I suppose

#

Anyway you probably wanna replace replace tokens with the standard processResources#expand(props)

#

@valid burrow

remote swallow
#

husk sync is just broke, even the release version

ivory sleet
#

Feels bad man

young knoll
#

Darn

#

How else will I sync my husks across servers

river oracle
#

💀 hopefully no one places a husk spawner at the location where my spawn is in another world

#

It'll sync the husks into the player spawn!

valid burrow
#

well if hushsync is so brocken what else should i use

thin iris
#

why does this happen and not like retract / go down

public void progress() {
        boolean end = false;
        if (!clicked) {
            // display smoke particles
            playFocusWaterEffect(source);
        } else {
            Vector direction = GeneralMethods.getDirection(startLocation, endLocation).normalize();
            direction.multiply(speed);
            if (startLocation.distanceSquared(endLocation) <= 1.5) {
                end = true;
                startLocation.subtract(direction);
                new TempBlock(startLocation.getBlock(), Material.AIR);
            }
            if (startLocation.distanceSquared(endLocation) >= 1.5 && !end){
                player.sendMessage("start");
                startLocation.add(direction);
                new TempBlock(startLocation.getBlock(), Material.WATER);
            }
        }
    }```
chrome beacon
#

same goes with multiply for direction

young knoll
#

Bukkit vectors are mutable

chrome beacon
#

oh only location then ig

young knoll
#

Location is also mutable

chrome beacon
#

Yeah looks like you're right

drowsy helm
thin iris
#

i <3 olivia rodrigo

mighty mason
#

Ey. I have a custom config, there is data inside, but when i log it, it doesnt show anything

#
System.out.println(ZooAnimalsConfig.getConfig().getConfigurationSection("ZooAnimals").getValues(false));
``` Im trying to log it like this
this is my config file.
```yml
ZooAnimals:
  bab53bd0-7de5-4f23-811d-88041920b0f1:
    ==: org.example.elwarriorcito.zoofee.Models.CustomMobs.ZooAnimals.ZooCow
    thirst: 12
    entityUUID: bab53bd0-7de5-4f23-811d-88041920b0f1
    entityType: COW
    sex: Female
    name: §8§lZoo§f§lCow
    health: 12
    age: Young
    hunger: 12

it logs as: {}

worldly ingot
rough drift
#

@solar musk what's your goal?

#

Load and unload JARs?

#

Do you want to unload it?

#

Or do you want to just use it

dry hazel
#

you need to add a parent cl with the class

remote swallow
rough drift
#

What I do is simply

var classLoader = new URLClassLoader(new URL[] { ... }, /* parent class loader, usually the system class loader or the plugin's class loader */)

// Use the class loader, or Class.forName
#

Yes

#

Do not do that

worldly ingot
dry hazel
#

you're also using the system class loader there, if that's in a bukkit plugin, it probably won't work if you want to access classes from your plugin

quaint mantle
#

Where is the "en_us" taken from?

rough drift
quaint mantle
#

I can only find en_US, but not all in lowercase

#

I am trying to find all possible locales of Minecraft

rough drift
#

yes, use en_US

rough drift
#
Minecraft Wiki

Languages is a feature that allows changing languages for people who prefer to play in a language other than their default setting. The language menu is accessible via a button in the options/settings menu below general.

#

Check the section in-game

#

Those are the language codes Minecraft uses

quaint mantle
#

Thank you so much

#

You are awesome!

rough drift
#

Np, I had to use them as well like a week or two ago

dry hazel
#

but do the loaded classes rely on classes from your plugin?

#

you should probably use the class loader of your enclosing class as the parent, i.e. getClass().getClassLoader()

quaint mantle
rough drift
opal juniper
#

marco, how exactly does this prevent gpl

quaint mantle
rough drift
#

You're not running createCustomConfig, meaning that file and config are null

#

you probably want to run that before running anything else

quaint mantle
#

but at the constructor im running createCustomConfig

icy beacon
desert loom
rough drift
#

I am way too tired for this lmao

quaint mantle
rough drift
dry hazel
#

refer to what I said before, use the class loader of the enclosing class as the parent

rough drift
#

^

#

Also... are you shading in runtimecore?

#

okay

#

good

rough drift
#

La classe che contiene il codice @solar musk

rough drift
dry hazel
#

the class that makes the class loader, getClass().getClassLoader()

rough drift
#

getClass().getClassLoader() iirc

quaint mantle
rough drift
#

also it is not a factory, a factory creates new objects, you're just using it as-is

quaint mantle
#

true

rough drift
#

Only improvement is in naming, and that is rename it to like CustomConfig or something

#

No

slender elbow
#

have you ever heard of abstraction? lol

rough drift
#

That's wrong

#

@solar musk when you create the class loader

#

new URLClassLoader(urls, getClass().getClassLoader())

#

breaks* or broke*

#

Nice

quaint mantle
#

And if I want to create more than one config at the same time?

rough drift
#
CustomConfig configA = new CustomConfig("configA.yml");
CustomConfig configB = new CustomConfig("configB.yml");
slender elbow
#

bro hasn't heard of abstraction

remote swallow
#

cmarco is just being cmarco

dry hazel
slender elbow
#

I am you from the future

dry hazel
#

o no

slender elbow
#

WTF

remote swallow
#

making pointless plugins, making them premium, saying hes gonna dmca forks of his old repos when the license allowed it

rough drift
remote swallow
#

just average cmarco activity

rough drift
#

average cmarco

grim hound
#

Ai so

#

The server ticks through every entity including players each tick, right?

#

I wanna stop that

#

Only certain players

rough drift
#

Well

#

That's not possible

slender elbow
#

player.kick 👍

rough drift
#

Who's next?

grim hound
rough drift
#

why do you need to do that

thin iris
rough drift
#

^

grim hound
#

I need to seperate a player in the captcha world from a verified one

#

One guy reported

rough drift
#

Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaah

grim hound
#

"What if he logs off having poison and needs to put in his login?"

rough drift
#

Well just use a different server

#

problem solved

grim hound
#

The poison would wear off giving an unfair advanted

grim hound
rough drift
#

Also you can stop potion effects ticking @grim hound

remote swallow
#

save effects on logout?

#

apply them once logged in?

rough drift
#

I am pretty sure there's events for that

grim hound
rough drift
#

Yeah

grim hound
rough drift
#

Just either use bungee and another server

#

or stop the events from ticking off

grim hound
grim hound
#

Mm

#

Well I guess if that's my only solution

valid burrow
#

how come 1 of them can produce a nullpointer exception but all the others cant

rough drift
#

Well

#

@grim hound

#

you can clear the effects while logging in

#

and after logging in apply them back exactly

grim hound
grim hound
rough drift
#

Dudeeeeeeeeeee

grim hound
#

Why such limitations?

#

Anotha question

#

I've used the IntelliJ compiler for 3 years now

remote swallow
#

the built in compiler

#

its probably javac

smoky oak
#

is Item::getItemStack() reference or clone?

rough drift
#

clone

smoky oak
#

f

#

thanks

grim hound
#

But now I've found out that a Headless graphic environment exists and the only solution for that would be using an external library, but it only has Maven. Is there a way I could incorporate maven into my project and have it compile with the already used libraries from the built-in compiler?

#

Or do I have to

remote swallow
#

if you really dont want to use maven download the jar from the repo manually

#

ideally maven is better

grim hound
remote swallow
#

yeah just make the url for it andmanually download the jar

remote swallow
#

get the repo

#

add the artifact, add the group, add the ver, add group-ver and boom

#

send the github and ill do it

grim hound
#

And I don't know if all of them even have a maven repo

#

And I would need to learn how jarinjar compiling works with maven

rough drift
#

you can use that

remote swallow
#

you have two options then

sterile token
#

Can i get a sample about a getParent() would be implemented around a herarchiquical structure of commands? Im struggling too much with sub commands caused by recursivity

remote swallow
sterile token
grim hound
#

But of what?

sterile token
#

For my simple command framework i have some 3 classes

#

Let me details them 1m

echo basalt
#

I made mine in like 20

grim hound
remote swallow
#

technically the sub class shouldnt have a forced connection to a parent class otherwise you loose the chance of using it for a no sub commands command

sterile token
remote swallow
#

if you give a getParent without nullability or able to work without it you can only use single command for /faction something xyz, no longer using it for something like /faction-reload because it wouldnt have a parent

grim hound
#

How do you know what he meant. Am I just too stupid for this conversation?

echo basalt
remote swallow
grim hound
echo basalt
#
commandManager
  .newCommand("give")
  .permission("test.give")
  .registerArgument(new PlayerArgument("target"))
  .registerArgument(new EnumArgument("type", Material.class))
  .registerArgument(new IntegerArgument("amount").orDefault(1))
  .handler((sender, context) -> {
    Player target = context.getArgument("target");
    Material type = context.getArgument("type");
    int amount = context.getArgument("amount");
  })
  .build();
sterile token
#

It is composed of 3 main classes:

Command an interface which contains getters and setters for name, aliases, permission, description and parent. It also contains a method execute(Sender<?> sender, String[] args).

Then there is the BaseCommand, which inherits from Command and is abstract, exposing the execute() method of command.

And then there is SubCommand, which inherits from Command and is not abstract, but makes the exeucte() method final and performs all the checks for the arguments and sub commands associated with it.

But my problem comes when it comes to know, if that executed command is a child of a sub command or not. Because a sub command can have many sub commands associated to it, basically recursion and it is a tremendous dizziness at least for me.

grim hound
#

Also, what exactly is a command framework?

remote swallow
#

make it easier to do sub command stuff, just commands in general

sterile token
sterile token
grim hound
smoky oak
#
int rest = 0;
if(remains.size() != 0)
  rest = remains.get(remains.keySet().stream().findAny().get());}

can the Optional from stream.findAny here be null?
remains is a hashmap

remote swallow
grim hound
#

And not really hard to program

sterile breach
#

Hello, I wonder about bungeecord inventory sync between multiples servers.

i found this "model":

on player leave (event) we get the inventory and stock it in the db.

and on async player join (after inventory clear), we give the inventory

is good?
i know that playerjoinevent is called before the playerleave event in the old server. So i have to wait few seconds before getting the inventory?

opal juniper
#

maybe overload a getArgument(int) which is the index?

sterile token
remote swallow
sterile token
#

Because you end up in a infinite chain

echo basalt
opal juniper
#

ah cool

young knoll
#

If you’re going to do builder hell you might as well use brigadier

echo basalt
#

It can hook with brigadier

sterile token
echo basalt
#

no

#

just made it in like 5 minutes

sterile token
#

lol

echo basalt
#

It also supports contextual tab completion

sterile token
#

thats amazing

#

what means contextual tab?

echo basalt
#

As it passes the same context object to tab completers incrementally

sterile token
#

what what? i cant catch that part

echo basalt
sterile token
#

hmn

echo basalt
#

So you can, for example, only tab complete for materials the player has unlocked

sterile token
#

sorry i cant understand it cant associate to it something

echo basalt
#

Or based on the player's gamemode

sterile token
#

right

#

like "predicates" or some sort of them

remote swallow
#

any reason for using command over command executor

sterile token
#

I use BukkitCommand i dont understand which is better to use

remote swallow
#

any reason to use that over executor

sterile token
#

I think i use BukkitCommand because is less code for CommandMap registration

#

If you use CommandExecutor, you need to reflect over PluginCommand and then CommandMap. Atleast from what i have tested

remote swallow
#

ill use executor just for the example, same concept would follow for it regardless

echo basalt
#

fun thing

#

if you register commands after the server has loaded you need to resync the command map

young knoll
#

There’s api for that

echo basalt
#

don't think so

young knoll
#

Or just don’t register stuff super late :p

echo basalt
#

uhh

#

need database stuff to run first

#

it's a weird conditional system

young knoll
#

Is this to do with sending it to players

#

Or is there something else you have to sync

echo basalt
#

no I just need to load databases first and check what kind of setup based on what kind of databases we're running

echo basalt
#

yeah I load the dbs async

#

and need to go back

#

to load the setup if the dbs worked

smoky oak
#

oh for gods sake

#

why are items dropped into the world invisible

young knoll
#

Wut

smoky oak
#

yea i dunno either

#
//Count is the number of items to be removed from the inventory
//CountMaterial is how many total items of the material are in the inventory

ItemStack rem = new ItemStack(material,count);
PlayerInventory inventory = player.getInventory();
int volume = countMaterial(inventory,material) - count;

inventory.remove(material);
inventory.addItem(new ItemStack(material,volume));

player.getWorld().dropItem(player.getLocation(),rem);
sterile token
remote swallow
sterile token
sterile token
#

I just get struggling with the helping part because i dont want to send fully help

#

I want to send it individually for each commands like:

if run /faction which is Parent of all the single and parent associated to it, will only appear the name of them.
if run /faction <sub command> - will appear all the single and parent names

Do i explain?

#

I was told by Zacken to implement some sort of getter for parenting, which allow me to know which is his father and then do the logic for usage or help as you want to callk

remote swallow
#

pretty much the way i would handle that usage is if they run /faction it sends the faction class sub commands, then the single command can arg length check and send usage

smoky oak
#

this doesnt work

#

or rather

#

it only works sometimes which is worse

#

nevermind my plugin is creating ghost items SOMEHOW

young knoll
#

Fix it

#

Smh

smoky oak
#

all im trying to do is make a player drop items bleh

young knoll
#

What do you mean by that

smoky oak
#

i have a bunch of items in a player's inventory

#

without extra data

#

stuff like apples

#

i want to make them drop all but x amount

#

but so far I've had ghost items in my inventory, items in the world that arent shown to the client, and infinite loops of picking up items and dropping them again

young knoll
#

Should be simple to just remove them and then drop them

#

Maybe add a pickup delay so they don’t get picked up right away

smoky oak
#

ye

#

ill look into that tmr

#

im beat

green plaza
#

null or Optional

ivory sleet
#

By convention of the standard we only return Optional, we don't really store it or pass it to functions, else use what you prefer

#

Well notably, Optional is quite limited since it its just a nullable object wrapper, as opposed to kotlins nullability, or rusts Option etc

green plaza
#

Why you i wanted someone to say, "Well Optional is bad you should use null"

worldly ingot
#

Basically don’t have an Optional field lol

valid burrow
#

either im color blind or this color codes doesnt exist

quiet ice
#

That is light green I'd guess

remote swallow
#

hex

quiet ice
#

Yeah and a hex code ofc

remote swallow
#

its probably like f6ffc3 or cfd3a2

valid burrow
#

wait thats a thing????

#

since when????

remote swallow
#

since 1.16

valid burrow
#

oh

#

i really gotta start learning what got added in the newer versions

quiet ice
#

Yeah that feature broke my plugin back then

#

Well wasn't mine - but was the reason my fork established as the standard back then

valid burrow
#

🫘

halcyon hemlock
#

beans

worldly ingot
#

Definitely #CFD3A2

patent trench
#

What is the proper way to dispose of scoreboard teams on plugin disable? I thought:

if (game.scoreboard != null) {
    game.scoreboard.getTeams().forEach(Team::unregister);
}

would be fine, but I keep getting this error whenever my server boots up: java.lang.IllegalArgumentException: Team name 'Blue' is already in use

#

And no, the code responsible for creating the team is only ever called once.

#

Version 1.19.2

worldly ingot
#

Well why are you disposing of the teams when you could instead just not register a team if it exists already?

patent trench
#

Because the teams shouldn't exist when the plugin is unloaded.

#

I would assume it is generally bad practice to keep bits and bobs left over from the plugin when it is unloaded.

opal carbon
#

depends what types of bits and bobs

#

some bits and bobs are better persistent

worthy hornet
#

i'm working on a plugin to warp players after a time delay on the condition that they have a certain permission. however, i'm having trouble dispatching a command after the delay. i understand that the problem is because i'm trying to dispatch a command outside the main thread, but i'm not sure how to do this instead.

here's my call:
EXECUTOR.schedule(() -> runCommand(target, args[2], args[3]), delay, TimeUnit.MILLISECONDS);
and here's the method it calls:

        if (target.hasPermission(permission)){
            System.out.println("warp "+warp+" "+target.getName());
            Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "warp "+warp+" "+target.getName());
        }
        else System.out.println(target.getName()+" does not have "+permission+" and will not be teleported to "+warp);
    }```
young knoll
#

You shouldn’t run the command

#

Just the teleportation code

#

Also

#

?scheduling

undone axleBOT
thin iris
#

use Bukkit.getScheduler().runTaskLater

#

or sum

young knoll
#

Mhm

worthy hornet
#

thank you very much, so if im trying to feed off essentialsx warps then the best route of actions to read their config files and grab the world/coords myself?

young knoll
#

You could

#

You could also listen for the teleport event and then delay that

sterile token
#

Please I need help in networks to solve my school homework. The teacher asked us to set up this topology, where we have 2 sub networks:

a)
host: 192.168.100.0/24
mask: 255.255.255.0
gateway: 192.168.100.1

b)
host: 192.168.200.0/24
mask: 255.255.255.0
gateway: 192.168.200.1

And what you asked us, is that the sub networks cannot talk to each other. And at the same time, that a specific pc of the sub network 1 and 2, communicate between them in my case I have these pc to use 192.168.100.11 and 192.168.200.11

echo basalt
#

mask b is fucked

sterile token
#

I cant change it haha

#

I done this config illusion

echo basalt
#

there's no such thing as a 255.255.255.255.0

#

p sure

sterile token
#

sorry i mistiope it

#

im too stresse dhaha

#

now yes

#

can i send my cmds?

echo basalt
#

@wet breach help with this shit I skipped submasking classes

sterile token
#

@wet breach

#

@worldly ingot sorry for tagging but i need to fix this its for school sorry to disturb

worldly ingot
#

lmao, fuck if I know

#

I'm not a system administrator

#

We have people for that KEKW

sterile token
#

who know??

slender elbow
#

bro is that cisco PacketTracer 💀

sterile token
#

Let me know pelase

sterile token
slender elbow
#

good luck lmao

sterile token
#

ohh no dont be like that

#

help me!!!

slender elbow
#

:kekw: no

worldly ingot
sterile token
#

bro really

#

help me

#

😡

remote swallow
sterile token
remote swallow
#

Never seen it before

sterile token
glad prawn
#

good luck lol

sterile token
#

please its something easy to do but cant understand why

wet breach
#

The mask you would use is /32 if i am not mistaken

sterile token
#

I was told o can't configure the switchers

#

Also mak Golden was /24

wet breach
#

Thats dumb as that is the proper way. I suppose you could do it on the master and force feed the routes instead

sterile token
#

Yeah that why is dum the config

#

Also take un account we configuring locally we dont get outside to internet

wet breach
#

Well to feed routes the proper way with much issue is to use rip

#

But since you cant configure the slaves you have to go with dumb filters instead

sterile token
#

i have configurad manually and static each PC that maybe help u ti understand

#

putting yo each PC from sub 1 to 100.10, 100.11 and 100.12

#

Smart with sub net 2, but instwad of 100 is 200

wet breach
#

You can do that but subnet mask needs to be 255.255.0.0 then

#

As long as both switches have that subnet and same gateway. They can see each other. You would make a rule to block all ips from either except the two you specified

#

Ideally the other way you would set this up is assigning a second ip to those pcs of that of the other switch

#

Avoids needing rules

#

Not sure if that is an allowed solution but it does conform to the rules you said

sterile token
#

Oh right

#

Really thanks

#

I already fixed it man❤️❤️

sterile token
#

It was what You mention Frist

sterile breach
#

Hello, I wonder about bungeecord inventory sync between multiples servers.

i found this "model":

on player leave (event) we get the inventory and stock it in the db.

and on async player join (after inventory clear), we give the inventory

is good?
i know that playerjoinevent is called before the playerleave event in the old server. So i have to wait few seconds before getting the inventory?

echo basalt
#

well

echo basalt
#

but the principle is the same

#

Storing data is often slower than reading data

#

If you have full ownership of the server and this is just a personal project, or you have high expectations of the people using your plugin

#

You make server A tell server B the data before sending the player

#

And server B caches that data for ~10 seconds

#

Server A then sends the player and saves the player's data

#

While server B already has the up-to-date data

#

Or if the player takes forever, the database will also be up-to-date by the time the data expires

#

It's a bit foolproof

#

Want to make it even more foolproof? Send a confirmation packet

#

Doubles the latency but 100% ensures there's no desync and the data is always cached

quaint mantle
#

how do i only get the name when i use the getOnlinePlayers() method

lethal coral
#

and for each player there's a getName() method

quaint mantle
#

oh

#

how would i use it lol

hushed scaffold
#

String name = p.getname ??

sterile breach
echo basalt
#

ms

#

sometimes seconds

#

it really depends

sterile breach
orchid trout
#

freeze the player

#

or like dont let them modify their inventory

wraith dragon
#

the sout in the loop prints the location correctly

#

but there isnt a bat there

#

😔

sterile breach
wet breach
echo basalt
#

no clue how you expect to have AI working if you never register the bat to the world

#

Also I'd prob send metadata packets

smoky oak
#

wtf my computer just told me i havent used java in 6 months
yea suuuuuure

wet breach
#

Lol

kindred valley
#

im back

#

how do i add repository for 1.7.109

tawny quail
#

Hello I have a problem configuring my bungeecord

hybrid turret
#

Can someone tell me how I load a properties file from the resources folder? (maven)
i tried some different ways and all of these return errors

#

also google didn't help lol

desert tinsel
#

How to spawn skeletons that dont attack players?

#

I tried setting their attack speed to 0 with attributes but I got errors

#

that they dont have attack speed

#

does setAI(false) work?

smoky anchor
hybrid turret
#

setAI(false) will disable the whole AI

#

no more walking, no attacking, nothing

#

basically a static NPC

#

doing nothing

desert tinsel
#

yes, thats what I need, ig

hybrid turret
#

what is your goal?

hybrid turret
#

iirc (but that might be wrong)

desert tinsel
#

to shoot random players with this: ```java
public static void shootPlayer(Skeleton skeleton) {
Player target = findRandomTargetPlayer(skeleton);
if (target != null) {
Location skeletonLocation = skeleton.getEyeLocation();
Location targetLocation = target.getEyeLocation();

        Vector direction = targetLocation.toVector().subtract(skeletonLocation.toVector()).normalize();
        double arrowSpeed = 1.0;
        Vector velocity = direction.multiply(arrowSpeed);

        Arrow arrow = skeleton.launchProjectile(Arrow.class);
        arrow.setVelocity(velocity);
    }
}```
hybrid turret
#

Hmmmmm, I doubt then that setAI(false) will work. Try it ig.
I've never worked with that

eternal oxide
#

shootPlayer will never be called with no AI

tawny quail
eternal oxide
#

oh you are calling that yourself?

hybrid turret
#

as it is written there

desert tinsel
hybrid turret
#

fyi: early returns make code very pretty

#
if (target == null) return;
// ... do stuff when target is not null here
hybrid turret
#

Is there something like an auto-import?
I have a method called useMessage(String key) now that gets messages from a properties file (for language support) and I don't wanna import that in every damn class

wraith dragon
smoky oak
#

what's the thing called when a method doesnt do anything?

#

something something case

eternal oxide
#

ineffective? broken?

#

useless? pointless?

wraith dragon
smoky oak
eternal oxide
#

not really a trivial case

#

well I guess it is

smoky oak
#

like the method does things

#

i just forgot the name for when its in a case where it doesnt need to

eternal oxide
#

yep

short pilot
#

Hey I'm a bit lost with setting up sqlite for Spigot, what library should I use and how do I add it to my project?

#

I tried looking at the online docs but it confused me a bit

pseudo hazel
#

which part in the docs confused you?

hushed spindle
#

is there any way to detect when blocks break naturally and to interact with its drops somehow

#

or is nms needed

wraith dragon
#

I think there is block.getDrops() iirc

hushed spindle
#

blockbreakevent only occurs if the player breaks the block

#

Block#breakNaturally() doesn't involve a player

#

i'd also hope it to involve break events like grass or torches being destroyed by water

glad prawn
#

then call event after that

hybrid turret
#

In a certain state, I want my plugin to disable. I managed to do that.
The problem is, in this state, there's a shit ton of log when executing a command of said plugin (because it is disabled, lol)
But I want my plugin to not be there at all. I basically want it deloaded. Is this possible?

rough drift
#

no

quaint mantle
#

nope

rough drift
#

Check if a block can suffocate an entity

wet breach
#

Should solve that problem

lost matrix
#

A custom bat class is useless if you dont actually spawn the bat on the server.

wraith dragon
quaint mantle
#

Hi all guys, I'm writing a plugin for the Hub, how could I create a system that through config you can add new items to the compass, with title, lore etc etc. Because I currently have created a configurable compass but with objects already configured via code, I would like to make the plugin more extensible

sterile token
sterile token
#

And create each item thru a item builser for naking it easier

#

Ando them add it yo the inventory

#

Once i'm at home i can senf a sample

#

Currently i'm on cellphone

quaint mantle
hybrid turret
hybrid turret
hybrid turret
rough drift
young knoll
#

I thought listeners were automatically unregistered on disable

hybrid turret
#

I kinda expected that :/

#

Hmm i gotta see what happens from a player‘s perspective when they try to execute a command from a disabled plugin

#

Maybe i could use the CommandPreProcessEvent where i catch the exception and print that the command is disabled if that is not already implemented

#

Wait

scenic onyx
#

how i can get if player are looking Entity or Block? There is an Dependecy for do this semplify?

hybrid turret
#

That won‘t work

#

Damn

#

Since events are unregistered :|

sterile breach
hybrid turret
#

Btw i still didn‘t manage to serilize inventory contents for json 💀

eternal oxide
young knoll
#

You can save the inventory to a byte array

#

And then base64 that

hybrid turret
#

I have never done that and i have no idea how i would do that. But i‘ll keep it in mind. I‘m keen to learn

sterile breach
valid burrow
#

is there a good api for plots?

#

im trying to make a rather simple plot system

#

with islands instead of the Standard plots

ivory sleet
#

Hmm, I believe plotsquared is nice

valid burrow
#

will that work in my situation?

ivory sleet
#

Idk lol, havent touched it since 3 years ago

valid burrow
#

like does it allow me to create plots from my own resources instead of the standart squares

ivory sleet
#

I believe so

valid burrow
#

alright thank u

ivory sleet
#

:)

orchid gazelle
#

any ideas why BuildTools doesn't want to build 1.20.2? Whenever im running 1.20.1 it completely works

river oracle
#

Delete all the build tools data folders such as work, bukkit craftbukkit and spigot and run again

orchid gazelle
#

yeah im currently doing that, maybe it works

#

looks good tho

#

nice thanks its done

hybrid turret
#

Like if a player has 10 saved inventories and everytime that is loded or saved, the whole playerdata has to be loaded, i guess?

sterile breach
# young knoll And then base64 that

base64 inventory decoded work in (not natif) java environnement/ server?

if i encode my inventory in the server1 in the db and i decode it in the server 2

#

and i need BukkitObjectInputStream?

young knoll
#

Yeah it should work fine

#

Although I don't think it will handle different versions

sterile breach
#

yes probably not

fluid river
#

yo guys

#

i need some help, but not related to spigot dev

#

actually it's about mc tick system

rough drift
#

sure

fluid river
#

basically i want to know

#

are they actually accurate to 0.05 seconds

#

or thay have some 0.00001 difference to real world time

#

each tick

hasty prawn
#

No it's not accurate and it changes

fluid river
#

okay

hasty prawn
#

It's not a static timing system

fluid river
#

so i'm currently coding a game

#

which is related to beat system

#

and i don't care if it's super accurate

#

but i want to get a thing which basically highlitghts the screen corners each 0.5 seconds

young knoll
#

What language

fluid river
#

c#

#

but it's not a problem rn

#

ik both languages(i guess)

young knoll
#

Just make a thread that does stuff and then sleeps

#

And repeat

fluid river
#

Yeah but that shit would still have 0.00001 difference

young knoll
#

Okay?

young knoll
fluid river
#

and that's okay yeah

#

i'm currently talking about my idea

eternal night
#

I mean, at some point you will always not be accurate

young knoll
#

I run my game on an atomic clock

eternal night
fluid river
#

so well

#

the thing im interested in is keeping the distance between beats as close as possible

#

so if last beat played like 0.001 sec later

#

the next beat would just shift a bit too

#

cuz i want to run method like prepareNextTick()

#

each time the tick happens

#

is it actually a great solution?

#

and does mc work like this

young knoll
#

All I would do is determine how long the actual code took to run

#

And then subtract that from the default time you sleep for

rough drift
#

and then runs at 20tps

#

but you should use a delta-time system tbh

sterile breach
fluid river
young knoll
#

Just use a game engine

fluid river
young knoll
#

Oh

#

Unity already has a fixed timer

#

And deltaTime

fluid river
#

yeah but the problem is i don't get how to actually use that shit

#

unity just has method Update()

#

which has it's own tickrate

#

and it's too low for me

rough drift
#

FixedUpdate()

fluid river
#

cuz i need to sync beats with player inputs and anims and a lot more stuff

#

0.02 seconds (50 calls per second) is the default time between calls.

#

and it's still kinda too slow

rough drift
#

why?

#

what kind of precision do you need

fluid river
#

0.01

#

100 calls

rough drift
#

why?

young knoll
#

FixedUpdate is once per tick

#

Update is once per frame

rough drift
#

nope

#

it's 50 updates per sec

young knoll
#

Yes

rough drift
#

I guess yeah 50 ticks

young knoll
#

You can change that as well

fluid river
#

i don't see it in docs tho

young knoll
#

Edit > Project Settings > Time > Fixed Timestep

fluid river
#

fr bruh

dawn flower
#

is it possible to change the fishing speed by ticks / seconds?

atomic basalt
#

hi, i was wondering if there was some sort of HTTP api to fetch things like available plugin versions, download urls, and other details of plugins.
google was unhelpful :/

hazy parrot
#

There is both official api(not sure to what extent it supports what u want) and there is also spiget

atomic basalt
#

as a short clarification i dont mean the java library required for plugin development
is there a link for http api documentation? @hazy parrot

hybrid turret
#

On a let‘s say larger scale server

sterile breach
#

hey, I remember hearing that certain actions with the server itself should not be done in async which ones?

hybrid turret
#

Or does PDC have some cool performance optimization i don‘t know about?

hazy parrot
#

And also Google about Spiget

#

If this doesn't suit your needs

atomic basalt
#

alright thank you

hybrid turret
hazy parrot
#

Http requests, database access etc

hybrid turret
#

What would be things that can be handled async?

eternal night
#

its a bit bleh tho, PDC is a serialised map

#

reading/writing is not free

#

especially with complex types like inventories

young knoll
#

Who do we blame for that

eternal night
hybrid turret
#

Yeah that‘s why i originally had a folder with the uuid of the player where each inventory got an individual file

young knoll
#

Spigot needs more byte[] serialization methods

#

I don't like having to make my own :c

sterile breach
eternal night
#

or just use a proper DB

young knoll
#

Make your own nbt files

#

Actually that would be a cool api

hybrid turret
#

(oops, sorry for the ping)

eternal night
#

no worries, and well, yea I'd suggest a DB for this

young knoll
#

PDC should really only be used for small bits of data

#

Simple boolean for a players setting? sure why not

hybrid turret
#

Mhhhhhh don‘t really want DBs. Absolutely no idea about that.
Also the plugin is supposed to be used by any server. Small or big

young knoll
#

A bunch of home locations? ehh maybe not

hybrid turret
#

And small servers tend to not have a db

eternal night
#

I mean, if you properly write it out it would also be fast enough to work

young knoll
#

You can use a local db

#

Like SQLite or H2

eternal night
#

like, into multiple PersistentDataContainers in each other

hybrid turret
#

o.o

eternal night
#

those maps are relatively fast to traverse

#

(this is not for your inventory problem, those should defo be in sqlite or h2 or something)

#

(just a general argument for storing data in PDCs)

hybrid turret
young knoll
#

It just saves locally in the plugin folder

hybrid turret
#

Imma try getting it to work with files first. Once that works i‘ll start on DBs

young knoll
#

SQLite and H2 are just a file

hybrid turret
#

But how is that faster than files?

eternal night
#

I mean, yml is fineee I guess

sterile breach
eternal night
#

yml just becomes a pain to work with down the line

hybrid turret
#

Isn‘t it also… well… stored in files?

young knoll
#

Everything is a file at the end of the day

hybrid turret
#

Yeah so why use local db instead of IO?

echo basalt
#

Just make an interface and fuck around with all the impls you want

hybrid turret
#

Or like yaml

young knoll
#

Because DBs are designed for storing and querying data

#

They keep it compact and allow queries

hybrid turret
#

Huh

#

Alright fine, I‘ll look into it

young knoll
#

Plus it's not too hard to support both local and external databases

#

Incase someone wants to share the data across a network

pseudo hazel
#

might not be faster but kinda depends on the data too I guess

hazy parrot
worldly ingot
#

And how much of it you're storing :p

pseudo hazel
#

a big advantage is that you can easily scale like a sqlite db into something bigger once you made some api for it you can just reuse it for other databases usually

remote swallow
#

All spigot

young knoll
#

Now if only SQL languages were consistant

#

:c

remote swallow
#

I will store everthing related or has spigot inside it

sterile breach
young knoll
#

No

river oracle
#

Real ones use Nitrite db which has similar syntax to mongodb

young knoll
#

We are saying the opposite

young knoll
#

Database operations, IO, web requests, should really be done async

remote swallow
#

IO should be done async, database stuff is io

river oracle
#

Unless you're doing it on startup and shutdown ofc

#

Then those operations should be synchronous

young knoll
#

The power of .get

#

:p

river oracle
#

Fr

echo basalt
river oracle
echo basalt
#

True

river oracle
#

If you're not saving data synchronous on shutdown. You could lose data

#

Which is no bueno

echo basalt
#

Exactly

#

But startup is fine

#

Server loads faster

river oracle
#

Make them wait uwu

echo basalt
#

Even though you're jumping hoops

sterile breach
river oracle
#

Yes

#

Bur you can kind of do some stuff async if you capture states

sterile breach
#

because i can get concurency and atomic problem?

river oracle
#

But you can write them

sterile breach
pseudo hazel
#

you can get concurrency problems in all async stuff

young knoll
#

I guess you can do async startup

#

Probably not worth it unless you are doing a lot of operations/working with a lot of data

river oracle
sterile breach
#

ah okay

#

so as long as you interact with any object on the server: it must be done in main thread?

river oracle
#

You can setup a nice system to run things on main thread when possible

#

?workdistro

sterile breach
#

so in an async event like asyncplayerjoin or asyncchat if i want interact with the player i have to use bukkitrunable and run it in sync?

young knoll
#

Depends on what you are doing

#

But genenerally yes

sterile breach
#

okay okay (i am trying to make inventory sync), for the inventory sync because join is called before leave, at my join event. Before request the db i have to wait? how time?

onyx fjord
#

can i somehow simulate thread sleep with junit?

ivory sleet
onyx fjord
ivory sleet
#

hmm, like are you trying to line them up and simulate a race condition or sth?

onyx fjord
#

so i wanna compare elements before and after run

ivory sleet
#

i mean yes its fine if u use thread.sleep in junit, but this sorta sounds like an xy problem

#

what exactly do u need to sleep for ?

#

this sounds more like you just populate the map, let the scheduler run and then compare the map data (in the test)

onyx fjord
#

yup

desert tinsel
#

does the EntityDamageEvent fires for both EntityDamageByEntityEvent and EntityDamageByBlockEvent?

#

I need to check if the player does not get damage from other player, but from any other way

worldly ingot
#

iirc it does, yes

desert tinsel
#

ig this is how I should do it, no?

shadow night
#

Intuitive variable names 👍

worldly ingot
#

Yeah. That can probably be prettier, but yeah

if (!(e.getEntity() instanceof Player player)) {
    return;
}

if (e instanceof EntityDamageByEntityEvent ed && ed.getDamager() instanceof Player) {
    return;
}

// Now do your thing```
#

And if you're not going to use that player instance, opt instead for an e.getEntityType() != EntityType.PLAYER check

desert tinsel
#

im using it

worldly ingot
#

Then you're fine :p

desert tinsel
#

thx

thin iris
shadow night
desert tinsel
#

because I need it to fire if the player gets fall damage, etc

thin iris
worldly ingot
#

!=

#

I believe the default values just align with Mojang's default op vs. no op. I don't think you can change the defaults

#

Though a permission plugin would let you deny these permissions

sterile breach
worldly ingot
#

Actually you probably can change the default. You could do it through the plugin manager I believe

#
Permission permission = Bukkit.getPluginManager().getPermission("minecraft.command.trigger");
// permission is nullable, but it should exist
permission.setDefault(PermissionDefault.FALSE);```
#

Not recommended, but doable

desert tinsel
#

I just gave an example

thin iris
smoky oak
sterile breach
# rotund ravine Yes

so it's not something that's wanted for a specific reason? (it would be better to make it in main thread?)

smoky oak
#

hey @lost matrix ur code doesnt grab the item in offhand

#

is offhand not part of inventory?

#

huh offhand is specific to playerinventory

#

welp even changing it to playerinventory doesnt count it

#

urgh

#

inventory.remove(material) ignores offhand
of course it does

#

bleh

smoky oak
#

yea a bug in spigot. Who's to blame for this one? setting the hand item doesnt update it's count if its the same material

#

side note: calling it does no fix the number not displaying correctly

#

wtf

#

and inventoryview doesnt have a update method

#

ah

#

calling it at the wrong spot

#

putting it in the right spot didnt help

river oracle
#

spigot has inconsitencies sometimes using null will fix it other times Air is correct

smoky oak
#

ah as i said wrong spot

#

this sets it to null to do some math correctly

#

i then set it to an itemstack thats not air

#

and call the update

#

but that still didnt fix it

river oracle
#

weird

lost matrix
smoky oak
#

ye i did im now wranginling inventory

#

view aint updating

smoky oak
#

???
why is both main and off hand item null when switching armour into a smithing table
of the event i mean

#

wait

#

why does a offhand swap also trigger an inventory click

blazing ocean
#

how can I hide a player just from the tablist?

upper hazel
#

why can a serialized location be duplicated even if the location is the same?

upper hazel
#

cuse this 1 location

#

not 2

#

why this copy

#

when i save in file

#

this dublicated

lost matrix
#

What?

upper hazel
#

the same location is duplicated when saving to a file

lost matrix
#

Of course. Every object is "duplicated" if you save it to a file.

upper hazel
#

i mean key not same

#

but shold be same

#

location1: data

#

location2: data

#

location2 and 1 this same

echo basalt
#

isn't he just describing a palette

#

or am I tripping

lost matrix
uncut folio
#

hello everyone!
i'm trying to make a custom mob that works as a battle summon but i want it to not be hostile with the player
is there anything i should fix with my code?
Mahoraga:

public class Mahoraga extends Warden {
    private final Player player;
    public Mahoraga(Location location, org.bukkit.entity.Player player) {
        super(EntityType.WARDEN, ((CraftWorld) location.getWorld()).getHandle());
        this.setPos(location.getX(), location.getY(), location.getZ());
        this.setCustomName(Component.literal(Common.colorize("&lMahoraga")));
        this.setCustomNameVisible(true);
        this.setHealth(60f);
        this.player = player;
        TargetEvent.mahoragaTarget.put(this.getUUID(), player.getUniqueId());
    }

    @Override
    protected boolean shouldDropLoot() {
        return false;
    }
}

Target event listener:

public class TargetEvent implements Listener {
    public static HashMap<UUID, UUID> mahoragaTarget = new HashMap<>();
    @EventHandler
    public void ignoreEvent(EntityTargetEvent event) {
        if (event.getEntity() instanceof Mahoraga && mahoragaTarget.get(event.getEntity().getUniqueId()) == event.getTarget().getUniqueId()) {
            event.setCancelled(true);
        }
    }
}
upper hazel
#

wait i see now

echo basalt
#

static pain

#

also no clue why you need the target map rather than storing the target in your custom entity object

#

blud's playing with nms yet commits static abuse

upper hazel
#

During sterilization, other data is also saved that simply cannot be the same. head turn, etc.

lost matrix
shadow night
uncut folio
lost matrix
echo basalt
#

bukkit vs nms entities

smoky oak
#

can someone please explain why my intellij keeps doing this

echo basalt
#

indexing

#

prob paperweight

#

mine consumes 14gb ram and 100% cpu when building paperweight

smoky oak
#

whats paperweight?

chrome beacon
#

Papers build tool

#

for gradle

smoky oak
#

im on spigot tho

#

i literally cant work like this lol

#

help

worldly ingot
#

Remember a long time ago people would always complain about Eclipse being a memory and CPU hog?

#

Well how the turn tables, IJ users >:((

smoky oak
#

doesnt explain why it happens when im making a spigot plugin

#

do i seriously have to kill it every 5 minutes to get any chance at working on my plugin

worldly ingot
#

IJ has to index a lot and it consumes a lot of memory and CPU

#

Unsure if there's a way to minimize that at all though. I'm not familiar enough with the IDE

smoky oak
#

bleh

#

thanks i guess

kind hatch
#

I sometimes wonder how so many people have issues with IJ. Everything I do with it doesn't cause issues like the ones they show.
Is it because I use the ultimate edition?

upper hazel
#

or do refactoring

echo basalt
#

I use the community edition and I'm fine with it

#

lovely work tool

smoky oak
#

different topic, where are the potion effects in potion meta?

#

custom potion effects?

halcyon hemlock
#

((CraftLivingEntity) event.getEntity()).getHandle() instanceof....

sterile token